@reltio/remotes 1.4.1122 → 1.4.1125
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/2274.js +1 -1
- package/4361.js +1 -1
- package/6027.js +1 -1
- package/7990.js +1 -1
- package/8442.js +1 -1
- package/package.json +1 -1
package/2274.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[2274],{48852:(e,t,n)=>{n.d(t,{l:()=>a});var r=n(24328),o=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 a=(e,t,n)=>{if(e&&t){const a=(0,r.memo)(n);return n=>o().createElement(e.Consumer,null,(e=>o().createElement(a,i({},n,t(e,n)))))}return n}},98808:(e,t,n)=>{n.d(t,{K:()=>h,N:()=>m});var r=n(24328),o=n.n(r),i=n(71153),a=n.n(i),l=n(94079);const s=(0,n(79692).Z)((e=>({button:{padding:"9px 16px 9px 12px","& svg g path, & svg path":{fill:e.palette.primary.main,fillOpacity:1}},iconButton:{"& svg g path, & svg path":{fill:e.palette.primary.main,fillOpacity:1}},startIcon:{marginLeft:0,marginRight:"8px",width:"18px",height:"18px",alignItems:"center"},label:{whiteSpace:"nowrap",fontSize:"14px",lineHeight:"16px",letterSpacing:0},overflowStyle:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},menuIcon:{marginRight:"12px"},menuItem:{minHeight:"28px",padding:"2px 16px 2px 12px"},menuText:{color:e.palette.text.primary,fontSize:"13px",lineHeight:"15px",letterSpacing:0}})));var c=n(31276),u=n(88611),d=n(8818);function p(){return p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},p.apply(this,arguments)}let m;!function(e){e.iconButton="iconButton",e.button="button",e.menuItem="menuItem"}(m||(m={}));const h=(0,r.forwardRef)(((e,t)=>{let{className:n,mode:r=m.iconButton,label:i,disabled:h,icon:g,onClick:b=c.ZT,onMenuClose:f=c.ZT}=e,y=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(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)&&(o[n]=e[n])}return o}(e,["className","mode","label","disabled","icon","onClick","onMenuClose"]);const x=s();return(()=>{switch(r){case"iconButton":return o().createElement(d.k,p({disabled:h,className:a()(x.iconButton,n),size:"S",tooltipTitle:i,onClick:b,icon:g},y));case"button":return o().createElement(l.Button,p({className:a()(x.button,n),disabled:h,startIcon:o().createElement(g,null),onClick:b,color:"primary",classes:{startIcon:x.startIcon,label:x.label}},y),o().createElement(u.C,{value:i},o().createElement("div",{className:x.overflowStyle},i)));case"menuItem":{const e=()=>{f(),b()};return o().createElement(l.MenuItem,p({classes:{root:x.menuItem},onClick:e,disabled:h,ref:t},y),o().createElement(o().Fragment,null,o().createElement(g,{className:x.menuIcon}),o().createElement(l.Typography,{classes:{root:x.menuText}},i)))}}})()}));h.displayName="ActionButton"},30739:(e,t,n)=>{n.d(t,{Z:()=>d});var r=n(24328),o=n.n(r),i=n(50166),a=n(44443),l=n(99493);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 b=s(),f=(0,r.useRef)({}),[y,x]=(0,r.useState)({}),v=(0,r.useCallback)((0,l.DsO)((()=>{x(c({},f.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 o().createElement("div",{style:r,className:b.item},o().createElement("div",{style:h?void 0:{visibility:i in y?void 0:"hidden"}},o().createElement(a.Z,{handleHeight:!0,onResize:(e,t)=>{f.current[i]!==t&&(((e,t)=>{f.current=c({},f.current,{[e]:t})})(i,t),v())}}),p({data:t,index:n})))}),[p,h,E,v,!h&&y]);return o().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)}))},58662:(e,t,n)=>{n.d(t,{Z:()=>y});var r=n(13980),o=n.n(r),i=n(24328),a=n.n(i),l=n(71153),s=n.n(l),c=n(94079),u=n(87918),d=n.n(u),p=n(31276),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){b(e,t,n[t])}))}return e}function b(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const f=e=>{let{classes:t={},count:n,rowsPerPageOptions:r,page:o,onChangePage:l,rowsPerPage:u,onChangeRowsPerPage:b,basicTableRef:f,labelRowsPerPage:y}=e;const x=h(),v=(0,i.useCallback)((()=>{(0,m.pathOr)(m.identity,["current","resetScrollbarPosition"],f)()}),[f]),E=(0,i.useCallback)((e=>{l(e),v()}),[l,v]),w=(0,i.useCallback)((e=>{l(0),b(e),v()}),[l,b,v]);return a().createElement(c.TablePagination,{classes:g({},t,{root:s()(x.pagination,t.root),select:s()(x.select,t.select),caption:x.caption,selectRoot:x.selectRoot,actions:x.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:o,onChangePage:(0,m.pipe)((0,m.nthArg)(1),E),rowsPerPage:u,onChangeRowsPerPage:(0,m.pipe)(p.NA,w)})};f.propTypes={classes:o().object,rowsPerPageOptions:o().arrayOf(o().number),count:o().number,page:o().number,onChangePage:o().func,rowsPerPage:o().number,onChangeRowsPerPage:o().func,basicTableRef:o().shape({current:o().object}),labelRowsPerPage:o().string};const y=a().memo(f)},10237:(e,t,n)=>{n.d(t,{Z:()=>m});var r=n(27556),o=n(13980),i=n.n(o),a=n(24328),l=n.n(a);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,a.forwardRef)(((e,t)=>{let{children:n,className:o}=e,i=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(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)&&(o[n]=e[n])}return o}(e,["children","className"]);const a=u();return l().createElement(r.Z,d({ref:t,className:o,classes:{root:a["basic-view__paper"]}},i),n)}));p.displayName="BasicView",p.propTypes={children:i().node,className:i().string};const m=p},81137:(e,t,n)=>{n.d(t,{Z:()=>c});var r=n(24328),o=n.n(r),i=n(87918),a=n.n(i),l=n(94079);const s=(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"}}),c=e=>{let{open:t,title:n,content:r,onCancel:i,cancelCaption:c=a().text("Cancel"),onDiscard:u,discardCaption:d="",onSave:p,saveCaption:m=a().text("Save"),disabledSave:h=!1}=e;const g=s();return o().createElement(l.Dialog,{open:t,onClose:i,classes:{paperScrollPaper:g.paper}},o().createElement(l.DialogTitle,{classes:{root:g.title}},n),o().createElement(l.DialogContent,{classes:{root:g.content}},o().createElement(l.DialogContentText,{classes:{root:g.contentText}},r)),o().createElement(l.DialogActions,{className:g.actionButtons,disableSpacing:!0},i&&o().createElement(l.Button,{onClick:i},c),o().createElement("div",null,u&&o().createElement(l.Button,{onClick:u,classes:{root:g.discardButton}},d),o().createElement(l.Button,{onClick:p,color:"primary",disabled:h,autoFocus:!0},m))))}},14363:(e,t,n)=>{n.d(t,{n:()=>y});const r=(0,n(79692).Z)({item:{marginBottom:"16px"},dense:{marginBottom:0}});var o=n(20562),i=n(24328),a=n.n(i),l=n(52730),s=n(87638),c=n(99493),u=n(91262),d=n(71153),p=n.n(d),m=n(17440),h=n(7154),g=n(26579),b=n(81077);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 y=e=>{let{connection:t,relatedEntity:n,inRelationTypes:d=[],outRelationTypes:y=[],showEmptyEditors:x,entityErrorMessage:v,onChangeAttribute:E,onRemoveAttribute:w,onAddAttributes:C,onChangeRelationType:T,onChangeEntity:R}=e;const O=r(),{relation:S,entity:P}=t,{attributes:N,uri:L,type:_="",direction:j}=S||{},I=Boolean(_),k=(0,l.useSelector)(s.ZP.selectors.getMetadata),A=(0,i.useMemo)((()=>S&&function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){f(e,t,n[t])}))}return e}({attributes:N},(0,c.p2l)(S))),[S,N]),D=(0,i.useMemo)((()=>(0,c.xF8)(k,_)),[_,k]),U=(0,i.useMemo)((()=>I?(0,c.jWj)(j===c.Nsj.OUT,k,[(0,c.V3K)(k,_)]):(0,m.uniq)((0,c.jWj)(!0,k,y).concat((0,c.jWj)(!1,k,d)))),[I,_,k,d,y]),z=(0,l.useSelector)((e=>s.ZP.selectors.getGlobalSearchRequestOptions(e,["ovOnly"]))),Z=(0,i.useMemo)((()=>S&&{relationType:S.type,direction:S.direction}),[S]),B=(0,i.useMemo)((()=>P&&{entityUri:P.uri,entityType:P.type,entityLabel:(0,c.idV)(P.label)}),[P]),M=(0,i.useMemo)((()=>P&&P.uri?d.filter((0,c.eHk)(!1,P,n,k)):d),[P,d,n,k]),F=(0,i.useMemo)((()=>P&&P.uri?y.filter((0,c.eHk)(!0,P,n,k)):y),[P,y,n,k]);(0,i.useEffect)((()=>{const{type:e,direction:t}=(0,c.z7d)(d,y)||{};!_&&e&&T&&T({type:e.uri,direction:t})}),[_,d,y,T]),(0,o.D)((()=>{const{type:e,direction:t}=(0,c.z7d)(M,F)||{};!_&&e&&T({type:e.uri,direction:t})}),[_,P,M,F,R]);const G=(0,i.useCallback)((e=>{let{type:t,direction:n}=e;T({type:t.uri,direction:n})}),[T]);return a().createElement(a().Fragment,null,T&&a().createElement(h.Z,{className:O.item,relation:Z,metadata:k,inRelationTypes:d,outRelationTypes:y,onChange:G}),R&&a().createElement(g.Z,{errorMessage:v,className:O.item},a().createElement(b.Z,{key:_,className:p()({[O.dense]:v}),entity:B||{},entityTypesUris:U,max:20,globalSearchRequestOptions:z,mode:c.fO_.EDITING,onChange:R,onCreate:void 0,metadata:k,attributeTypesSelectionStrategy:void 0})),_&&a().createElement(u.Z,{attrTypes:D,entity:A,showEmptyEditors:x,mode:c.fO_.EDITING,parentUri:L,onAddAttributes:C,onChangeAttribute:E,onDeleteAttribute:w}))}},7154:(e,t,n)=>{n.d(t,{Z:()=>m});var r=n(24328),o=n.n(r),i=n(13980),a=n.n(i),l=n(99493),s=n(17440),c=n(89846),u=n(27185);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=e=>{let{relation:t={},inRelationTypes:n=[],outRelationTypes:i=[],onChange:a=s.identity,applyFirstByDefault:l=!1,reversedContextLabels:p=!1}=e,m=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(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)&&(o[n]=e[n])}return o}(e,["relation","inRelationTypes","outRelationTypes","onChange","applyFirstByDefault","reversedContextLabels"]);const{getRelationTypesOptions:h,fromEditorValue:g,toEditorValue:b}=(0,c.n)({reversedContextLabels:p}),f=(0,r.useMemo)((()=>h(n,i)),[h,n,i]),y=(0,r.useCallback)((0,s.pipe)(g(n,i),a),[g,n,i,a]),x=!!t.relationType;return(0,r.useEffect)((()=>{l&&f.length&&!x&&y(f[0])}),[f,l,y,x]),o().createElement(u.Z,d({value:b(t,f),options:f,onChange:y},m))};p.propTypes={className:a().string,relation:l.bNA,inRelationTypes:a().arrayOf(l.IYE),outRelationTypes:a().arrayOf(l.IYE),applyFirstByDefault:a().bool,reversedContextLabels:a().bool,onChange:a().func};const m=p},68439:(e,t,n)=>{n.d(t,{Z:()=>p});var r=n(24328),o=n.n(r),i=n(52730),a=n(71153),l=n.n(a),s=n(94079),c=n(99493),u=n(87638);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 a=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 o().createElement(s.Typography,{style:{backgroundColor:g,color:c.P6Y.Colors.getColor(g)?"#FFFFFF":"#212121"},className:l()(a[`entityType-${r}`],n),component:"div"},(0,c.jFi)(p,t))}},59725:(e,t,n)=>{n.d(t,{Q:()=>c});var r=n(24328),o=n.n(r),i=n(87918),a=n.n(i),l=n(99493),s=n(42520);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 o().createElement(s.S,{items:g,selectedItemsUris:n,single:i,placeholder:c,enableEmptyValueUnderline:u,onChange:d,classes:p,ListLabelProps:m,disabled:h,label:a().text("Entity type"),dataReltioId:"entity-type-selector",selectionPopupTitle:a().text("Select entity types")})}));c.displayName="EntityTypesSelector"},93416:(e,t,n)=>{n.d(t,{Z:()=>c});var r=n(24328),o=n.n(r),i=n(71153),a=n.n(i),l=n(92778);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 o().createElement(l.Z,{title:n,classes:{root:a()(i.container,t),title:i.title}},r)}},42520:(e,t,n)=>{n.d(t,{S:()=>L});var r=n(24328),o=n.n(r),i=n(71153),a=n.n(i),l=n(17440),s=n(99493),c=n(94079),u=n(83543),d=n(79692);const p=(0,d.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)"}}),m=(e,t)=>{const{childNodes:n,clientLeft:r,clientWidth:o}=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:a}=i.getBoundingClientRect();if(r+a>o)return n;n!==e.length-1&&i.setEnd(t,i.endOffset+", ".length)}}return-1},h=e=>e.join(", "),g=e=>`calc(${(0,l.isNil)(e)?"100%":`${e}px`} - 35px)`,b=e=>{let{list:t,maxWidth:n}=e;const i=p(),a=(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=m(e,t);return-1===n?0:e.length-n}return 0})(e,t);return n-Math.max(1,n-r)})(t,a.current))}),[t]);const u=h(t),d=l>0,b=d?h(t.slice(0,-l)):u;return o().createElement(c.Tooltip,{title:d?u:""},o().createElement("div",{className:i.listLabelContainer},o().createElement("div",{style:{width:g(n)},className:i.listLabel,ref:a},u),o().createElement("div",{className:i.visibleItemsLabel},b),d&&o().createElement("div",{className:i.hiddenCount},`+${l}`)))};var f=n(22385),y=n(97820),x=n(54763),v=n(7785),E=n(27239),w=n(44890);function C(){return C=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},C.apply(this,arguments)}const T=(0,l.always)(32),R=(0,r.memo)((e=>{let{selectedItems:t,onItemClick:n,focusIndex:r,width:i,height:a}=e,l=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(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)&&(o[n]=e[n])}return o}(e,["selectedItems","onItemClick","focusIndex","width","height"]);return o().createElement(w.Z,C({getItemSize:T,renderItem:(e,i,a)=>{let{item:l}=i;const s=!!t.find((e=>l.uri===e)),c=a===r;return o().createElement(v.Z,{key:l.uri,onClick:n,checked:s,data:l,label:o().createElement(E.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:a},l))}));R.displayName="SelectMetadataTypesList";const O=(0,d.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 S(){return S=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},S.apply(this,arguments)}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){N(e,t,n[t])}))}return e}function N(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const L=(0,r.memo)((e=>{let{placeholder:t,classes:n={},items:i,selectedItemsUris:d,onChange:p,ListLabelProps:m={},disabled:h,enableEmptyValueUnderline:g,single:v,label:E,dataReltioId:w,selectionPopupTitle:C}=e;const T=O(),[N,L]=(0,r.useState)(!1),_=(0,r.useCallback)((()=>L(!0)),[]),j=(0,r.useCallback)((()=>L(!1)),[]),[I,k]=(0,r.useState)(""),A=(0,r.useCallback)((()=>k("")),[]),D=(0,r.useCallback)((0,l.pipe)(A,j),[j,A]),U=i.filter((e=>{let{label:t}=e;return s.P6Y.strings.search(t,I)})).map(((e,t)=>({item:{item:P({},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]),Z=(0,r.useCallback)(((e,t)=>{v?(p(t?[e.uri]:[]),D()):p(t?d.concat(e.uri):d.filter((t=>t!==e.uri)))}),[d,p,v,D]),B=(0,r.useCallback)((e=>{let{item:t}=e;const n=!d.includes(t.uri);Z(t,n)}),[d,Z]),{focusIndex:M,handleKeyDown:F}=(0,x.t)({items:U,open:N,onSelectFocusedItem:B,selectedItems:d,onClose:D}),G=(0,r.useRef)(),H=G.current?G.current.getBoundingClientRect().width:0,q=Math.max(H,255),W=0===d.length;return o().createElement(o().Fragment,null,o().createElement(c.TextField,{label:E,ref:G,InputProps:{startAdornment:W&&!t?null:o().createElement("div",{className:a()(T.inputText,n.inputText)},W?o().createElement("div",null,t):o().createElement(b,S({},m,{list:z}))),classes:{root:T.inputRoot,input:a()(T.input,n.input,{[T.emptyInput]:W&&!t}),disabled:a()(T.disabledInput,{[T.disabledPointer]:h}),underline:T.disabledUnderline},endAdornment:o().createElement(f.Z,{size:"L",icon:u.Z,iconClassName:a()(T.icon,{[T["popup-opened-icon"]]:N}),disabled:h}),readOnly:!0,disabled:!0,disableUnderline:W&&!g},inputProps:{tabIndex:-1},InputLabelProps:{classes:{root:a()(T.inputLabel,n.label)}},value:"",onClick:h?void 0:_,classes:{root:a()(T.root,n.root)},margin:"dense",variant:"filled",disabled:h,"data-reltio-id":w}),o().createElement(y.Z,{open:N,anchorEl:G.current,onClose:D,onSearch:k,title:C,containerWidth:q,containerHeight:355,searchInputOnKeyDown:F,transformOrigin:{horizontal:"left",vertical:"top"},anchorOrigin:{horizontal:"left",vertical:"bottom"},PaperProps:{"data-reltio-id":`${w}-popup`}},o().createElement(R,{items:U,onItemClick:Z,selectedItems:d,width:q,height:245,focusIndex:M})))}));L.displayName="MetadataTypesSelector"},57304:(e,t,n)=>{n.d(t,{Z:()=>v});var r=n(24328),o=n.n(r),i=n(13980),a=n.n(i),l=n(71153),s=n.n(l),c=n(52730),u=n(17440),d=n(94079),p=n(87918),m=n.n(p),h=n(99493),g=n(87638),b=n(53180),f=n(68439);const y=(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:a}=e;const l=y({classes:a}),p=(0,c.useSelector)(g.ZP.selectors.getMetadata),x=(0,r.useCallback)((()=>{navigator.clipboard.writeText((0,h.BTI)(n))}),[n]);if((0,u.isNil)(n))return null;const v=(0,h.idV)(n.label),E=n.secondaryLabel,w=(0,h.ptG)(p,n),C=(0,h.Fn9)(n),T=n.uri,R=(0,h.BTI)(n);return o().createElement("div",{className:s()(l.profileBandWrapper,t)},o().createElement("div",{className:s()(l.profileBand,{[l.inactive]:!C}),"data-entity-uri":T},o().createElement(b.Z,{key:n.uri,entity:n,avatarClassName:l.profileIcon,imageClassName:l.imageProfileIcon}),o().createElement("div",{className:l.profileInfo},o().createElement("div",null,o().createElement(d.Typography,{variant:"h6",className:l.label},v),E&&o().createElement(d.Typography,{variant:"subtitle2",className:l.secondaryLabel},E),w&&o().createElement(d.Typography,{variant:"subtitle1",className:l.businessCard},w)),o().createElement("div",{className:l.specialInfo},o().createElement("div",{className:l.entityType},o().createElement(f.Z,{entity:n,size:"medium",className:l.badge}),!(0,h.ZiX)(T)&&o().createElement(d.Tooltip,{title:m().text("Copy to clipboard")},o().createElement(d.Typography,{display:"inline",variant:"body2",className:l.entityId,onClick:x},m().text("Entity ID"),": ",R))))),i&&o().createElement("div",null,i)))};x.propTypes={className:a().string,entity:a().object,children:a().node,classes:a().object};const v=x},32371:(e,t,n)=>{n.d(t,{U:()=>c});var r=n(24328),o=n.n(r),i=n(87918),a=n.n(i),l=n(99493),s=n(42520);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 o().createElement(s.S,{items:g,selectedItemsUris:n,single:i,placeholder:c,enableEmptyValueUnderline:u,onChange:d,classes:p,ListLabelProps:m,disabled:h,label:a().text("Relation type"),dataReltioId:"relation-type-selector",selectionPopupTitle:a().text("Select relation types")})}));c.displayName="RelationTypesSelector"},39827:(e,t,n)=>{n.d(t,{G:()=>m});var r=n(24328),o=n.n(r),i=n(71153),a=n.n(i),l=n(8818),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,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(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)&&(o[n]=e[n])}return o}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 o().createElement("div",{className:a()(c.container,r)},t.map((e=>{let{id:t}=e,r=p(e,["id"]);return o().createElement(l.k,d({},r,{classes:g,size:"S",key:t,className:a()({[a()(c.active,m)]:n===t},c.buttonWrapper,h),onClick:()=>i(t),"data-reltio-id":`reltio-profile-right-side-button-${t}`}))})))}},52043:(e,t,n)=>{n.d(t,{h:()=>a});var r=n(24328),o=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})}}))),a=e=>{let{width:t,open:n,children:r}=e;const a=i();return o().createElement("div",{className:a.contentWrapper,style:{width:`${n?t:0}px`}},n&&o().createElement(o().Fragment,null,r))}},8962:(e,t,n)=>{n.d(t,{Z:()=>_});var r=n(52730),o=n(87638),i=n(24328),a=n.n(i),l=n(99493),s=n(71153),c=n.n(s),u=n(87918),d=n.n(u),p=n(94079),m=n(60995),h=n(10237),g=n(93416),b=n(80931),f=n(8261),y=n(79692);const x=(0,y.Z)({attributesContainer:{padding:"0 16px 16px 16px"},header:{marginBottom:"4px"},noCaption:{paddingTop:"16px"},noData:{fontSize:"13px",color:"rgba(0,0,0,0.54)"}}),v=(0,r.connect)((e=>({metadata:o.ZP.selectors.getMetadata(e)})))((e=>{let{className:t,entity:n={},metadata:s,caption:u="",excludeUris:y=[],includeUris:v=[],attributesCount:E=16}=e;const w=x(),C=(0,r.useSelector)(o.ZP.selectors.getPivotingAttributes),T=(0,i.useMemo)((()=>(0,f.U)(s,n.type,v,y)),[y,v,s,n.type]),R=(0,l.fyF)(T,n).filter((e=>{let{values:t}=e;return!(0,l.O27)(t)})).length>0;return R||!(0,l.O27)(u)?a().createElement(m.J.Provider,{value:C},a().createElement(h.Z,{className:t},u&&a().createElement(g.Z,{className:w.header,title:u}),a().createElement(p.Box,{className:c()(w.attributesContainer,{[w.noCaption]:!u})},R?a().createElement(b.Z,{entity:n,attrTypes:T,parentUri:n.uri,drawLines:!1,max:E}):a().createElement(p.Typography,{className:w.noData},d().text("No data found"))))):null}));var E=n(17440),w=n(91262),C=n(39450),T=n(66784);const R=(0,y.Z)({attributesContainer:{padding:"0 16px 16px 16px"},header:{marginBottom:"4px"},noCaption:{paddingTop:"16px"}});function O(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}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=(0,r.connect)((e=>({metadata:o.ZP.selectors.getMetadata(e)})))((e=>{let{className:t,entity:n={},mode:s,metadata:u,caption:d="",excludeUris:m=[],includeUris:b=[],pinnedAttributes:y}=e;const x=R(),v=(0,r.useDispatch)(),S=(0,i.useContext)(C.m),P=(0,r.useSelector)(o.ZP.selectors.getUserRoles),N=(0,i.useMemo)((()=>(0,l.mC3)(y,P)),[y,P]),L=(0,r.useSelector)((e=>o.ZP.selectors.getModifiedEntity(e,n.uri)||{})),_=(0,i.useMemo)((()=>(0,f.U)(u,L.type,b,m)),[m,b,u,L.type]),j=(0,i.useCallback)((e=>(0,E.pipe)(o.N5.actions.addAttributes,v)(e.map((e=>O({},e,{viewId:S}))))),[S,v]),I=(0,i.useCallback)((e=>(0,E.pipe)(o.N5.actions.modifyAttribute,v)(O({},e,{viewId:S}))),[S,v]),k=(0,i.useCallback)((e=>(0,E.pipe)(o.N5.actions.removeAttribute,v)(O({},e,{viewId:S}))),[S,v]);return a().createElement(h.Z,{className:t},d&&a().createElement(g.Z,{className:x.header,title:d}),a().createElement(p.Box,{className:c()(x.attributesContainer,{[x.noCaption]:!d})},a().createElement(T.c.Provider,{value:N},a().createElement(w.Z,{entity:L,attrTypes:_,parentUri:L.uri,drawLines:!1,mode:s,showEmptyEditors:(0,l.ZiX)(L.uri),crosswalks:L.crosswalks,onAddAttributes:j,onChangeAttribute:I,onDeleteAttribute:k}))))}));var N=n(3185);function L(){return L=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},L.apply(this,arguments)}const _=(0,r.connect)(((e,t)=>({entity:t.entity||o.ZP.selectors.getEntityWithDiff(e),mode:t.mode||o.ZP.selectors.getMode(e)})))((e=>{let{mode:t=l.ARY.Viewing,attributesCount:n,pinnedAttributes:r,entity:o}=e,i=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(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)&&(o[n]=e[n])}return o}(e,["mode","attributesCount","pinnedAttributes","entity"]);return a().createElement(N.u.Provider,{value:o},(0,l.uzs)(t)?a().createElement(v,L({attributesCount:n,entity:o},i)):a().createElement(P,L({mode:t,pinnedAttributes:r,entity:o},i)))}))},27185:(e,t,n)=>{n.d(t,{Z:()=>T});var r=n(24328),o=n.n(r),i=n(13980),a=n.n(i),l=n(87918),s=n.n(l),c=n(17440),u=n(71153),d=n.n(u),p=n(94079);const m=(0,n(79692).Z)({container:{display:"flex",alignItems:"center",height:"32px",minHeight:"32px",padding:0},text:{display:"flex",width:"calc(100% - 68px)"},textItem:{fontSize:"13px",lineHeight:"15px",marginRight:10},primaryTextItem:{flex:"1 0",flexBasis:0,maxWidth:"50%",overflow:"hidden",textOverflow:"ellipsis"},secondaryTextItem:{flex:"1 0",flexBasis:0,overflow:"hidden",textOverflow:"ellipsis"},icons:{transform:"scale(0.5)",position:"relative",flexShrink:0,width:"68px",bottom:"10px"},iconTop:{position:"absolute",top:0,left:0,zIndex:1},iconBottom:{position:"absolute",top:0,left:26,zIndex:0}});var h=n(31254),g=n(88611);function b(){return b=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},b.apply(this,arguments)}const f=e=>{let{innerRef:t,innerProps:n,selectOption:r,data:i}=e;const a=m(),{value:l,label:s,startObject:c,endObject:u}=i,f=c.objectType.label+" ↔ "+u.objectType.label;return o().createElement(p.MenuItem,b({className:a.container,ref:t,key:l,onClick:()=>r({label:s,value:l,startObject:c,endObject:u})},n),o().createElement("div",{className:a.icons},o().createElement(h.Z,{className:a.iconTop,entityType:c.objectType}),o().createElement(h.Z,{className:a.iconBottom,entityType:u.objectType})),o().createElement("div",{className:a.text},o().createElement(g.C,{value:s},o().createElement(p.Typography,{className:d()(a.textItem,a.primaryTextItem)},s)),o().createElement(g.C,{value:f},o().createElement(p.Typography,{color:"textSecondary",className:d()(a.textItem,a.secondaryTextItem)},f))))};f.propTypes={innerRef:a().oneOfType([a().oneOf([null]),a().func,a().shape({current:a().any.isRequired})]),innerProps:a().object.isRequired,selectOption:a().func.isRequired,data:a().shape({value:a().string.isRequired,label:a().string.isRequired,startObject:a().object,endObject:a().object})};const y=f;var x=n(24737);function v(){return v=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},v.apply(this,arguments)}function E(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const w=e=>{let{value:t={},options:n=[],onChange:i=c.identity,TextFieldProps:a}=e,l=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(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)&&(o[n]=e[n])}return o}(e,["value","options","onChange","TextFieldProps"]);const u=(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){E(e,t,n[t])}))}return e}({},(0,c.defaultTo)({},a),{"data-reltio-id":"relation-type-selector"})),[a]);return o().createElement(x.Z,v({value:t,options:n,onChange:i,label:s().text("Select relationship type "),components:{Option:y},TextFieldProps:u},l))},C=a().shape({label:a().string.isRequired,value:a().string.isRequired,startObject:a().object,endObject:a().object});w.propTypes={value:C,options:a().arrayOf(C),onChange:a().func};const T=w},78620:(e,t,n)=>{n.d(t,{R:()=>u});var r=n(24328),o=n(99493),i=n(17440),a=n(52730),l=n(87638);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=e=>{let{connection:t,onConnectionChange:n,relatedEntity:c}=e;const u=(0,a.useSelector)(l.ZP.selectors.getMetadata),d=(0,r.useCallback)((e=>n(s({},t,{relation:e}))),[t,n]),p=(0,r.useCallback)((0,i.pipe)((0,o.zE1)(t.relation),d),[t.relation,d]),m=(0,r.useCallback)((0,i.pipe)((0,o.lIv)(t.relation),d),[t.relation,d]),h=(0,r.useCallback)((0,i.pipe)((0,o.Ilm)(t.relation),d),[t.relation,d]),g=(0,r.useCallback)((e=>{let{type:r,direction:i}=e;const a={entity:t.entity&&(0,o.eHk)(i===o.Nsj.OUT,t.entity,c,u,(0,o.V3K)(u,r))?t.entity:null,relation:s({},t.relation,{attributes:{},type:r,direction:i})};n(a)}),[t,n,c,u]);return{onAddAttributes:p,onChangeAttribute:m,onRemoveAttribute:h,onChangeEntity:(0,r.useCallback)((e=>n(s({},t,{entity:e}))),[t,n]),onChangeRelationType:g}}},89846:(e,t,n)=>{n.d(t,{n:()=>a});var r=n(24328),o=n(99493),i=n(17440);const a=e=>{let{reversedContextLabels:t}=e;return{getRelationTypesOptions:(0,r.useCallback)(((e,n)=>{const r={},a=(0,i.pipe)(o.PjQ,(0,i.tap)((e=>r[e]=(0,i.propOr)(0,e,r)+1))),l=(0,i.ascend)((0,i.prop)("label")),s=(0,i.curry)(((e,n)=>{let{uri:r,label:i,startObject:l,endObject:s}=n;const c=e===(t?o.Nsj.OUT:o.Nsj.IN)?l:s;return{label:{directionalLabel:a(c),typeLabel:i},value:`${r},${e}`,startObject:l,endObject:s}}));return e.map(s(o.Nsj.IN)).concat(n.map(s(o.Nsj.OUT))).map((0,i.evolve)({label:e=>{let{directionalLabel:t,typeLabel:n}=e;return t?r[t]>1?`${t} (${n})`:t:n}})).sort(l)}),[t]),fromEditorValue:(0,r.useCallback)(((e,t)=>n=>{const[r,a]=n.value.split(",");return{type:(a===o.Nsj.IN?e:t).find((0,i.propEq)("uri",r)),direction:a}}),[]),toEditorValue:(0,r.useCallback)(((e,t)=>t.find((0,i.propEq)("value",`${e.relationType},${e.direction}`))),[])}}},12274:(e,t,n)=>{n.r(t),n.d(t,{default:()=>kn});var r=n(24328),o=n.n(r),i=n(52730),a=n(36138),l=n(585),s=n(22664),c=n(52844),u=n(87638),d=n(99136),p=n(98996),m=n(17440),h=n(99493),g=n(87918),b=n.n(g),f=n(60715),y=n(35174);function x(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){v(e,t,n[t])}))}return e}function v(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const E=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,m.either)((0,m.pipe)(h.nqN,(0,m.equals)(e)),(0,m.pipe)(h.j5q,(0,m.equals)(e))));n.push(...r);const o=(0,m.pipe)(w,(0,m.without)([e]))(r);return o.forEach((e=>E(e,t,n))),n},w=e=>(0,m.pipe)((0,m.chain)((e=>[(0,h.nqN)(e),(0,h.j5q)(e)])),m.uniq)(e),C=(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}--${e.direction}`)}));const o=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,o,a]=e.split("--");i.push({from:t,to:n,key:r,relationTypeUri:o,direction:a})})),{nodes:o,edges:i}})(t);n.nodes.forEach((t=>{e.hasNode(t.id)||e.addNode(t.id,{label:(0,h.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,direction:t.direction})}))},T=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const r=t.neighbors(e).filter((e=>!n.includes(e)));return n.push(...r),r.forEach((e=>T(e,t,n))),n};var R=n(67218);const O=e=>{const[t,n]=(0,r.useState)(null),[o,a]=(0,r.useState)(null),l=(0,i.useDispatch)(),[s,c]=(0,r.useState)(null),[d,g]=(0,r.useState)(!1),v=null==e?void 0:e.uri,O=(0,h.biM)(e),S=(0,i.useSelector)(u.ZP.selectors.getMetadata),P=(0,R._)(),N=(0,r.useCallback)((function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return P((0,h.ZYI)({uri:e,deep:n,limitCreditsConsumption:!0,graphTypes:t?[(0,h.nIW)(t)]:null,activenessDate:null,max:t?200:3e3}))}),[t,P]);(0,r.useEffect)((()=>(!v||(0,h.ZiX)(v)||O||(g(!0),(0,h.ZYI)({uri:v,deep:t?2:1,limitCreditsConsumption:!0,graphTypes:t?[(0,h.nIW)(t)]:null,activenessDate:null,max:t?200:3e3}).then((e=>{const t=new p.MultiGraph;C(t,e),a(t),c(e)})).catch((e=>{console.error(e),c(null),l(u.ui.actions.errorSet((0,h.xU7)(e,b().text("Something went wrong"))))})).finally((()=>{g(!1)}))),()=>{a(null),c(null),g(!1)})),[v,O,l,t]);const L=(0,r.useCallback)((e=>{let{startEntityUri:t,endEntityUri:n,relationType:r,attributes:i,startDate:a,endDate:d}=e;return g(!0),(0,h.DsR)({startEntityUri:t,endEntityUri:n,relationType:r,attributes:i,startDate:a,endDate:d}).then((e=>{var t;if(null==e||null===(t=e[0])||void 0===t||!t.successful)throw null==e?void 0:e[0];const n=e[0].object,r=((e,t,n)=>{const r=t.startObject.objectURI,o=t.endObject.objectURI,i=[r,o],a=e.entities.map((0,m.prop)("uri")),l=(0,h.V3K)(n,t.type),s=i.find((e=>!(0,m.includes)(e,a))),c=s&&(t.startObject.objectURI===s?t.startObject:t.endObject),u=c&&{type:c.type,label:c.label,uri:c.objectURI,traversedRelations:0,untraversedRelations:1},d=x({},(0,m.pick)(["uri","type","attributes","startDate","endDate","crosswalks","direction"],t),{startObject:(0,m.pick)(["objectURI","directionalLabel"],t.startObject),endObject:(0,m.pick)(["objectURI","directionalLabel"],t.endObject),direction:null==l?void 0:l.direction});return{entities:(u?e.entities.concat([u]):e.entities).map((e=>e.uri===r||e.uri===o?x({},e,{traversedRelations:e.traversedRelations+1}):e)),relations:e.relations.concat([d])}})(s,n,S);C(o,r);const i=[n.startObject.objectURI,n.endObject.objectURI],a=s.entities.map((0,m.prop)("uri"));i.map((e=>{if(a.includes(e)){const t=o.getNodeAttribute(e,"traversedRelationsCount");o.setNodeAttribute(e,"traversedRelationsCount",t+1)}})),c(r)})).catch((e=>{throw l(u.ui.actions.errorSet((0,h.xU7)(e,b().text("Something went wrong")))),e})).finally((()=>{g(!1)}))}),[l,s,o,S]),_=(0,r.useCallback)((e=>{g(!0),(0,h.VGk)(e).then((()=>{o.extremities(e).map((e=>{const t=o.getNodeAttribute(e,"traversedRelationsCount");o.setNodeAttribute(e,"traversedRelationsCount",t-1)})),o.dropEdge(e);const{updatedData:t,removedEntitiesUris:n}=((e,t,n,r)=>{const o=r.relations.find((0,m.propEq)("uri",t)),i=(0,h.nqN)(o),a=(0,h.j5q)(o),l=(0,y.toUndirected)(n),s=(0,m.cond)([[()=>!(0,f.Ar)(l,e,i),(0,m.always)(i)],[()=>!(0,f.Ar)(l,e,a),(0,m.always)(a)],[m.T,(0,m.always)(null)]])(),c=(0,m.evolve)({entities:(0,m.map)((e=>e.uri===i||e.uri===a?x({},e,{traversedRelations:e.traversedRelations-1}):e)),relations:(0,m.reject)((0,m.propEq)("uri",t))})(r),{updatedData:u,removedEntitiesUris:d}=s?((e,t)=>{const n=E(e,t),r=(0,m.pipe)(w,(0,m.append)(e),m.uniq)(n);return{updatedData:(0,m.evolve)({relations:(0,m.reject)((e=>n.includes(e))),entities:(0,m.reject)((e=>r.includes(e.uri)))})(t),removedEntitiesUris:r}})(s,c):{updatedData:c,removedEntitiesUris:[]};return{updatedData:u,removedEntitiesUris:d}})(v,e,o,s);((e,t)=>{(t||[]).forEach((t=>{e.dropNode(t)}))})(o,n),c(t)})).catch((e=>{l(u.ui.actions.errorSet((0,h.xU7)(e,b().text("Something went wrong"))))})).finally((()=>{g(!1)}))}),[l,o,v,s]),j=(0,r.useCallback)(((e,t)=>{const{nodes:n=[]}=t,r=(0,m.difference)(o.neighbors(e),n);((e,t,n,r)=>{const o=(0,y.toUndirected)(r),i=(e,t)=>{o.filterEdges(e,t,(e=>!!e)).forEach((e=>o.dropEdge(e)))};n.forEach((e=>{i(t,e),o.forEachNeighbor(e,(t=>{i(e,t)}))}));const a=[];return o.nodes().forEach((t=>{((e,t,n)=>(0,f.Ar)(e,t,n)?null:n)(o,e,t)&&a.push(t)})),(0,m.uniq)(a.reduce(((e,t)=>T(t,o,e)),[...a]))})(v,e,r,o).forEach((t=>{t!==v&&t!==e&&o.setNodeAttribute(t,"hidden",!0)}))}),[v,o]),I=(0,r.useCallback)((e=>{if(e&&!(0,h.ZiX)(e)&&!O){const t=o.getNodeAttribute(e,"untraversedRelationsCount");o.neighbors(e).forEach((e=>{o.setNodeAttribute(e,"hidden",!1)})),t>0&&(g(!0),N(e).then((t=>{const n=((e,t,n)=>{const{entities:r=[],relations:o=[]}=t;return{entities:r.reduce(((e,t)=>{if(e.some((e=>{let{uri:n}=e;return n===t.uri}))){if(t.uri===n){const r=e.findIndex((e=>{let{uri:t}=e;return t===n}));e[r]=x({},e[r],{traversedRelations:t.traversedRelations,untraversedRelations:t.untraversedRelations})}}else e.push(t);return e}),[...e.entities||[]]),relations:o.reduce(((e,t)=>(e.some((e=>{let{uri:n}=e;return n===t.uri}))||e.push(t),e)),[...e.relations||[]])}})(s,t,e);C(o,t);const r=t.entities.find((t=>t.uri===e));o.setNodeAttribute(e,"untraversedRelationsCount",r.untraversedRelations),o.setNodeAttribute(e,"traversedRelationsCount",r.traversedRelations),c(n)})).catch((e=>{console.error(e),l(u.ui.actions.errorSet((0,h.xU7)(e,b().text("Something went wrong"))))})).finally((()=>{g(!1)})))}}),[s,l,o,O,N]);return{graphLoading:d,data:s,graphologyGraph:o,graphTypeUri:t,setGraphTypeUri:n,onAddRelation:L,onDeleteRelation:_,onCollapseEntity:j,onExpandEntity:I}};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)=>{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){S(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},N=[25,50,100];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 _=(e,t,n)=>{const{startObject:r,endObject:o,type:i}=t,{directionalLabel:a}=(0,h.nqN)(t)===n?r:o;return a||(0,h.Lmx)(e,i)},j=e=>{let{data:t,selectedEntityUri:n,mainEntityUri:o,graphTypeUri:a}=e;const[l,s]=(0,r.useState)({field:"",order:"asc"}),[c,d]=(0,r.useState)(0),[p,g]=(0,r.useState)(N[0]),[f,y]=(0,r.useState)([]),[x,v]=(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,m.zipObj)(e.map((0,m.prop)("uri")),e)}),[null==t?void 0:t.entities]),T=(0,r.useMemo)((()=>(0,m.pipe)((0,m.filter)((0,m.either)((0,m.pipe)(h.nqN,(0,m.equals)(n)),(0,m.pipe)(h.j5q,(0,m.equals)(n)))),(0,m.uniqBy)((0,m.prop)("uri")),(0,m.map)((e=>{const t=C[((e,t)=>{const n=(0,h.nqN)(t),r=(0,h.j5q)(t);return n===e?r:n})(n,e)];return{relation:e,entity:t,entityLabel:(0,h.idV)(t.label),entityTypeLabel:(0,h.jFi)(w,t),relationTypeLabel:_(w,e,t.uri)}})))((null==t?void 0:t.relations)||[])),[t,n,C,w]),{searchText:R,onChangeSearchText:O,filters:S,onFilter:P,relationTypesOptions:j,entityTypesOptions:I}=(e=>{const[t,n]=(0,r.useState)(""),[o,a]=(0,r.useState)({entityTypesUris:[],relationTypesUris:[]}),l=(0,i.useSelector)(u.ZP.selectors.getMetadata),s=(0,r.useMemo)((()=>(0,m.pipe)((0,m.map)((e=>{let{entity:t}=e;return t.type})),(0,m.concat)(m.__,o.entityTypesUris),m.uniq,(0,m.map)((0,h.nt9)(l)))(e)),[e,l,o.entityTypesUris]),c=(0,r.useMemo)((()=>(0,m.pipe)((0,m.map)((e=>{let{relation:t}=e;return t.type})),(0,m.concat)(m.__,o.relationTypesUris),m.uniq,(0,m.map)((0,h.V3K)(l)))(e)),[e,l,o.relationTypesUris]);return{searchText:t,onChangeSearchText:n,filters:o,onFilter:a,entityTypesOptions:s,relationTypesOptions:c}})(T),k=(0,r.useMemo)((()=>(0,m.pipe)((0,m.filter)((e=>{let{entityLabel:t,entity:n,relation:r}=e;const{entityTypesUris:o,relationTypesUris:i}=S;return h.P6Y.strings.search(t,R)&&(0,m.ifElse)((0,m.prop)("length"),(0,m.includes)(r.type),m.T)(i)&&(0,m.ifElse)((0,m.prop)("length"),(0,m.includes)(n.type),m.T)(o)})),l.field?(0,m.sort)(((e,t)=>h.P6Y.strings.sort(l.order,e[l.field],t[l.field]))):m.identity)(T)),[T,l,R,S]),A=(0,r.useMemo)((()=>k.slice(c*p,c*p+p)),[k,c,p]),D=(0,r.useCallback)((e=>{v(!0),(0,h._vs)(e).then((e=>{y((t=>[...t,{initialRelation:e,relation:e}]))})).catch((e=>{E(u.ui.actions.errorSet((0,h.xU7)(e,b().text("Can't load relationship's attributes"))))})).finally((()=>v(!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){L(e,t,n[t])}))}return e}({},t,{relation:e}):t))))}),[]);(0,r.useEffect)((()=>{d(0),O("")}),[n,a,O,P]),(0,r.useEffect)((()=>{P({entityTypesUris:[],relationTypesUris:[]})}),[a,o,P]),(0,r.useEffect)((()=>{d(0)}),[l,R,S]);const z=(0,r.useCallback)((e=>{y((t=>t.filter((t=>t.relation.uri!==e))))}),[]),Z=(0,r.useCallback)(((e,t)=>{v(!0),(0,h.HH7)({oldRelation:e,newRelation:t}).then((()=>{z(t.uri)})).catch((e=>{E(u.ui.actions.errorSet((0,h.xU7)(e,b().text("Can't edit relationship"))))})).finally((()=>v(!1)))}),[z,E]);return{rowsData:A,onSort:s,sorting:l,searchText:R,onChangeSearchText:O,filters:S,onFilter:P,entityTypesOptions:I,relationTypesOptions:j,editingRelations:f,onStartRelationEditing:D,onCancelRelationEditing:z,onUpdateEditingRelation:U,total:k.length,page:c,rowsPerPage:p,onPageChange:d,onRowsPerPageChange:g,onSaveEditingRelation:Z,loading:x}},I=o().createContext({graphLoading:!1,data:null,graphologyGraph:null,selectedEntityLoading:!1,selectedEntity:null,onEntitySelect:()=>{},relationshipTable:{},onCollapseEntity:()=>{},onExpandEntity:()=>{}});I.displayName="GraphStateContext";var k=n(71153),A=n.n(k),D=n(57304),U=n(19603),z=n(94646),Z=n(94079),B=n(79692);const M=(0,B.Z)({comments:{display:"flex",justifyContent:"flex-end",marginTop:"10px"}}),F=(0,r.memo)((e=>{let{className:t}=e;const n=M(),r=(0,i.useSelector)(u.ZP.selectors.getEntity),a=(0,i.useSelector)(u.ZP.selectors.getEntityUriWithDataTenant);return o().createElement(D.Z,{className:A()(t,U.U),entity:r},o().createElement(Z.Box,{className:n.comments},o().createElement(z.Z,{uri:a,relatedObjectUris:(0,h.wp9)(h.q7e.ENTITY,{entityUri:a}),objectType:h.q7e.ENTITY})))}));F.displayName="GraphProfileBand";const G=F;var H=n(52043),q=n(39827),W=n(82726);const V=(0,B.Z)({wrapper:{display:"flex",overflow:"hidden",marginLeft:"auto",flexShrink:0}});function Y(){return Y=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},Y.apply(this,arguments)}const $=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(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)&&(o[n]=e[n])}return o}(e,["styles"]);return o().createElement("svg",Y({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),o().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 X=n(48852);const K=(0,X.l)(I,(0,m.pick)(["selectedEntity"]),(e=>{let{selectedEntity:t}=e;return o().createElement(D.Z,{entity:t})}));var Q=n(8962);const J=(0,B.Z)({noShadowBlock:{boxShadow:"none"},wrapper:{position:"relative",paddingRight:"1px",overflow:"auto"}}),ee=(0,X.l)(I,(0,m.pick)(["selectedEntity","selectedEntityLoading"]),(e=>{let{selectedEntity:t,selectedEntityLoading:n}=e;const r=J();return o().createElement("div",{className:r.wrapper},n&&o().createElement(d.Z,null),o().createElement(Q.Z,{entity:t,caption:b().text("Entity details"),className:r.noShadowBlock}))}));var te=n(58662),ne=n(44443),re=n(30739),oe=n(31276);const ie="1px solid rgba(0, 0, 0, 0.05)",ae=(0,B.Z)({table:{flex:1,height:"100%",display:"flex",flexDirection:"column",overflow:"hidden"},tableBody:{height:"100%",overflow:"auto"},tableBodyWrapper:{height:"100%",overflow:"hidden"},tableRowWrapper:{borderBottom:ie},tableRow:{display:"flex",alignItems:"center","& > div":{flexShrink:0}},editingRow:{paddingTop:"8px"},headRow:{borderBottom:ie}});function le(){return le=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},le.apply(this,arguments)}const se=(0,r.memo)((e=>{let{columnsData:t,sorting:n,onSort:r}=e;const i=ae();return o().createElement("div",{className:A()(i.tableRow,i.headRow)},t.map((e=>{const{id:t,sortable:i,headCellRenderer:a,columnClassName:l}=e,s=a,c=i?{sortField:n.field,sortOrder:n.order,sortHandler:()=>{r({field:t,order:n.field===t?(0,oe.Dh)(n.order):"asc"})}}:{};return o().createElement("div",{key:t,className:l},o().createElement(s,le({headCellData:e},c)))})))})),ce=(0,r.forwardRef)(((e,t)=>{let{classes:n,columnsData:i,rowsData:a,sorting:l,onSort:s,getRowKey:c,ExpandedRowRenderer:u,defaultRowHeight:d}=e;const p=ae(),[m,h]=(0,r.useState)({width:0,height:0}),g=(0,r.useCallback)((e=>{let{data:t,index:r}=e;const a=t[r];return o().createElement("div",{className:A()(p.tableRowWrapper,null==n?void 0:n.tableRowWrapper)},o().createElement("div",{className:A()(p.tableRow,null==n?void 0:n.tableRow,{[p.editingRow]:a.expanded})},i.map((e=>{let{id:t,rowCellValueRenderer:n,columnClassName:r}=e;const i=n;return o().createElement("div",{key:t,className:r},o().createElement(i,{value:a[t],rowValue:a}))}))),a.expanded&&u&&o().createElement(u,{open:a.expanded,rowValue:a}))}),[i,u]),b=(0,r.useCallback)(((e,t)=>{h({width:e,height:t})}),[]),f=(0,r.useRef)(null);return(0,r.useImperativeHandle)(t,(()=>({resetScrollbarPosition:()=>{var e;null===(e=f.current)||void 0===e||e.scrollTo(0)}}))),o().createElement("div",{className:p.table},o().createElement(se,{columnsData:i,sorting:l,onSort:s}),o().createElement("div",{className:p.tableBodyWrapper},o().createElement(ne.Z,{handleHeight:!0,handleWidth:!0,onResize:b}),o().createElement("div",{className:p.tableBody},o().createElement(re.Z,{listRef:f,width:m.width,height:m.height,data:a,defaultItemSize:d,itemKey:c,showNotMeasuredItems:!0},g))))})),ue=(0,r.memo)(ce);var de=n(92332),pe=n(88611);const me="rgba(238, 238, 238, 1)",he=(0,B.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:me}}});function ge(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const be={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"},fe=".collapsibleTableRow:hover &",ye=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){ge(e,t,n[t])}))}return e}({},be,{[fe]:{background:`linear-gradient(to right, rgba(238, 238, 238, 0), ${me} 100%)`}}),xe=(0,B.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":be},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":ye},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",[fe]:{visibility:"visible",background:me}},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 ve(){return ve=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},ve.apply(this,arguments)}function Ee(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){we(e,t,n[t])}))}return e}function we(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ce=e=>{let{className:t,headCellData:n}=e,r=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(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)&&(o[n]=e[n])}return o}(e,["className","headCellData"]);const i=xe();return o().createElement("div",{className:A()(i.headCell,t)},o().createElement(de.default,ve({},r,{headCellData:Ee({},n,{label:o().createElement(pe.C,{value:n.label},o().createElement("div",{className:i.headLabel},n.label))})})))},Te=(0,r.memo)((e=>{let{value:t="",tooltip:n,onClick:r,className:i}=e;const a=xe();return n=n||t,o().createElement(pe.C,{value:n},o().createElement("div",{className:A()(a.defaultCell,i,{[a.clickable]:!!r}),onClick:r},t))}));var Re=n(53180);const Oe=(0,X.l)(I,(e=>{let{onEntitySelect:t}=e;return{onClick:t}}),(e=>{let{value:t,rowValue:{entity:n},className:r,onClick:i}=e;const a=xe(),l=o().createElement(o().Fragment,null,o().createElement(Re.Z,{entity:n,avatarClassName:a.entityAvatar}),t);return o().createElement(Te,{value:l,tooltip:t,className:A()(a.profileCell,r),onClick:()=>i(n.uri)})}));var Se=n(78620),Pe=n(14363);const Ne=(0,X.l)(I,((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:a,onCancelRelationEditing:l,onSaveEditingRelation:s}=e;const c=(0,i.useDispatch)(),d=(0,i.useSelector)(u.ZP.selectors.getMetadata),{relation:p,initialRelation:g}=n,f=(0,r.useMemo)((()=>!(0,m.equals)(g,p)),[p,g]),y=xe(),x=(0,r.useCallback)((e=>{let{relation:t}=e;return a(t)}),[a]),v=(0,r.useCallback)((()=>l(p.uri)),[l,p.uri]),E=(0,r.useMemo)((()=>({relation:p})),[p]),{onAddAttributes:w,onChangeAttribute:C,onRemoveAttribute:T}=(0,Se.R)({connection:E,onConnectionChange:x});return t?o().createElement("div",{className:y.expandedRow},o().createElement(Pe.n,{connection:E,onAddAttributes:w,onChangeAttribute:C,onRemoveAttribute:T}),o().createElement("div",{className:y.actionButtons},o().createElement(Z.Button,{onClick:v},b().text("Cancel")),o().createElement(Z.Button,{color:"primary",disabled:!f,onClick:()=>{(e=>{const t=(0,h.xkB)(d,{relation:{object:e}});return c(u.N5.errors.actions.errorsSet(t)),0===t.length})(p)&&s(g,p)}},b().text("Save")))):null}));var Le=n(8818),_e=n(27604),je=n(22983),Ie=n(81137);const ke=(0,X.l)(I,(0,m.pick)(["onDeleteRelation"]),(e=>{let{uri:t,open:n,onClose:r,onDeleteRelation:i}=e;return o().createElement(Ie.Z,{open:n,title:b().text("Do you want to make a clean break?"),content:b().text("To end this relationship, click Delete Relationship. To keep the connection, click Cancel."),saveCaption:b().text("Delete relationship"),discardCaption:b().text("Cancel"),onDiscard:r,onSave:()=>{i(t),r()}})})),Ae=(0,r.memo)((e=>{let{uri:t}=e;const[n,i]=(0,r.useState)(!1),a=(0,r.useCallback)((()=>i(!0)),[]),l=(0,r.useCallback)((()=>i(!1)),[]);return o().createElement(o().Fragment,null,o().createElement(Le.k,{icon:je.Z,size:"XXS",tooltipTitle:b().text("Delete"),onClick:a}),o().createElement(ke,{open:n,onClose:l,uri:t}))}));Ae.displayName="DeleteRelationButton";const De=Ae,Ue=(0,X.l)(I,((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,type:n}},className:r,onEdit:a,isEditing:l}=e;const s=xe(),c=(0,i.useSelector)(u.ZP.selectors.getMetadata),d=(0,h.V3K)(c,n),p=(0,h.Z5t)(h.ARY.Editing,d),m=(0,h.Edd)(h.ARY.Editing,d);return o().createElement("div",{className:A()(s.controlsCell,r,{[s.editingMode]:l})},p&&o().createElement(Le.k,{className:A()(s.editButton,{[s.hidden]:l}),icon:_e.Z,size:"XXS",tooltipTitle:b().text("Edit"),onClick:()=>a(t)}),m&&o().createElement(De,{uri:t}))}));function ze(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 Be=(e,t)=>t[e].relation.uri||`${e}`,Me=(0,X.l)(I,(e=>{let{relationshipTable:t}=e;return ze({},t)}),(e=>{let{rowsData:t,sorting:n,onSort:i,total:a,page:l,rowsPerPage:s,onPageChange:c,onRowsPerPageChange:u,editingRelations:p,loading:m}=e;const h=he(),g=(0,r.useMemo)((()=>[{id:"entityLabel",label:b().text("Profile"),headCellRenderer:Ce,rowCellValueRenderer:Oe,sortable:!0,columnClassName:h.profileColumn},{id:"relationTypeLabel",label:b().text("Relationship type"),headCellRenderer:Ce,rowCellValueRenderer:Te,sortable:!0,columnClassName:h.relationshipTypeColumn},{id:"entityTypeLabel",label:b().text("Entity Type"),headCellRenderer:Ce,rowCellValueRenderer:Te,sortable:!0,columnClassName:h.entityTypeColumn},{id:"controls",label:"",headCellRenderer:Ce,rowCellValueRenderer:Ue}]),[h]),f=(0,r.useRef)(null);(0,r.useEffect)((()=>{var e;null===(e=f.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)}))?ze({},e,{expanded:!0}):e))),[t,p]),x=(0,r.useMemo)((()=>({tableRow:A()(h.row,"collapsibleTableRow")})),[h]);return o().createElement("div",{className:h.tableWithPagination},o().createElement("div",{className:h.tableContainer},o().createElement(ue,{ref:f,columnsData:g,rowsData:y,sorting:n,onSort:i,getRowKey:Be,ExpandedRowRenderer:Ne,defaultRowHeight:28,classes:x})),a>N[0]&&o().createElement(te.Z,{count:a,rowsPerPageOptions:N,rowsPerPage:s,onChangeRowsPerPage:u,page:l,onChangePage:c,basicTableRef:f}),m&&o().createElement(d.Z,null))}));var Fe=n(36444),Ge=n(94574);const He=(0,B.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}}}))),qe=(0,X.l)(I,(0,m.pipe)((0,m.prop)("relationshipTable"),(0,m.pick)(["searchText","onChangeSearchText"])),(e=>{let{searchText:t,onChangeSearchText:n}=e;const r=He();return o().createElement(Ge.Z,{fullWidth:!0,height:40,autofocus:!1,value:t,onSearch:n,placeholder:b().text("Search profiles"),classes:{input:r.input}})}));var We=n(59725),Ve=n(32371);const Ye=(0,B.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"}}))),$e=(0,X.l)(I,(0,m.pipe)((0,m.prop)("relationshipTable"),(0,m.pick)(["onFilter","filters","entityTypesOptions","relationTypesOptions"])),(e=>{let{open:t,onClose:n,filters:i,onFilter:a,entityTypesOptions:l,relationTypesOptions:s}=e;const c=Ye(),[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]),o().createElement(Z.Dialog,{classes:{paper:c.dialogPaper},onClose:h,open:t},o().createElement(Z.Typography,{className:c.title},b().text("Filter")),o().createElement(We.Q,{classes:{root:c.entityTypesSelector},entityTypes:l,selectedEntityTypes:u,enableEmptyValueUnderline:!0,onChange:d}),o().createElement(Ve.U,{classes:{root:c.relationTypesSelector},relationTypes:s,selectedRelationTypes:p,enableEmptyValueUnderline:!0,onChange:m}),o().createElement("div",{className:c.footer},o().createElement(Z.Button,{className:c.clearAllButton,onClick:()=>{d([]),m([])}},b().text("Clear All")),o().createElement(Z.Button,{className:c.cancelButton,onClick:h},b().text("Cancel")),o().createElement(Z.Button,{onClick:()=>{a({entityTypesUris:u,relationTypesUris:p}),n()},color:"primary"},b().text("Apply"))))})),Xe=(0,B.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,X.l)(I,(0,m.pipe)((0,m.prop)("relationshipTable"),(0,m.pick)(["filters"])),(e=>{let{filters:t}=e;const n=Xe(),[i,a]=(0,r.useState)(!1),{entityTypesUris:l,relationTypesUris:s}=t,c=l.length||s.length;return o().createElement("div",{className:n.wrapper},o().createElement(qe,null),o().createElement(Z.IconButton,{className:n.iconButton,onClick:()=>a(!0)},o().createElement(Fe.Z,{className:c?n.activeFiltersIcon:n.inactiveFiltersIcon})),o().createElement($e,{open:i,onClose:()=>a(!1)}))}));var Qe=n(65549),Je=n(98808);const et=e=>{const t=(0,i.useSelector)(u.ZP.selectors.getMetadata),{inRelations:n=[],outRelations:o=[]}=(0,r.useMemo)((()=>(0,h.UWq)(t,e,(0,h.d89)(h.ARY.Editing))),[t,e]);return{inRelationTypes:n,outRelationTypes:o}},tt=(0,B.Z)((e=>({dialogPaper:{height:"600px",maxWidth:"600px"},dialogTitle:{padding:"12px 16px"},titleText:{color:e.palette.text.primary,fontSize:"18px",letterSpacing:0,lineHeight:"21px",fontWeight:"bold"},content:{padding:"8px 16px 0px",borderBottom:"1px solid rgba(0, 0, 0, 0.12)"},attributeList:{paddingTop:"22px"}}))),nt=(0,X.l)(I,(e=>{let{selectedEntity:t,onAddRelation:n}=e;return{selectedEntity:t,onAddRelation:n}}),(e=>{let{selectedEntity:t,open:n,onClose:a,onAddRelation:l}=e;const s=tt(),c=(0,i.useSelector)(u.ZP.selectors.getMetadata),[d,p]=(0,r.useState)({}),{relation:m,entity:g}=d,{type:f,direction:y}=m||{},[x,v]=(0,r.useState)(!1),E=(0,i.useDispatch)();(0,r.useEffect)((()=>{n&&p({relation:{uri:(0,h.ncP)(),type:null,attributes:{}}})}),[n]);const{inRelationTypes:w,outRelationTypes:C}=et(t.type),T=(0,r.useCallback)((()=>{const e=(0,h.xkB)(c,{relation:{object:{relation:m}}});return E(u.N5.errors.actions.errorsSet(e)),0===e.length}),[m,c,E]),{onAddAttributes:R,onChangeAttribute:O,onRemoveAttribute:S,onChangeEntity:P,onChangeRelationType:N}=(0,Se.R)({connection:d,onConnectionChange:p,relatedEntity:t});return o().createElement(Z.Dialog,{open:n,fullWidth:!0,maxWidth:"sm",onClose:a,classes:{paper:s.dialogPaper}},o().createElement(Z.DialogTitle,{disableTypography:!0,classes:{root:s.dialogTitle}},o().createElement(Z.Typography,{variant:"subtitle1",classes:{root:s.titleText}},b().text("Add relationship"))),o().createElement(Z.DialogContent,{classes:{root:s.content}},o().createElement(Pe.n,{connection:d,onAddAttributes:R,onChangeAttribute:O,onRemoveAttribute:S,relatedEntity:t,inRelationTypes:w,outRelationTypes:C,onChangeRelationType:N,onChangeEntity:P})),o().createElement(Z.DialogActions,null,o().createElement(Z.Button,{onClick:a},b().text("Cancel")),o().createElement(Z.Button,{disabled:!(null!=d&&d.entity)||!f||x,color:"primary",onClick:()=>{const{type:e,attributes:n={},startDate:r,endDate:o}=m,i=y===h.Nsj.OUT?t.uri:g.uri,s=y===h.Nsj.OUT?g.uri:t.uri;T()&&(v(!0),l({startEntityUri:i,endEntityUri:s,relationType:e,attributes:n,startDate:r,endDate:o}).then((()=>{a()})).catch((e=>{console.error(e)})).finally((()=>{v(!1)})))}},b().text("Add"))))})),rt=(0,X.l)(I,(0,m.pick)(["selectedEntity"]),(e=>{let{selectedEntity:t}=e;const{inRelationTypes:n,outRelationTypes:i}=et(t.type),a=n.length+i.length>0,[l,s]=(0,r.useState)(!1);return a&&o().createElement(o().Fragment,null,o().createElement(Je.K,{mode:Je.N.button,label:b().text("Add relationship"),icon:Qe.Z,onClick:()=>{s(!0)}}),o().createElement(nt,{open:l,onClose:()=>{s(!1)}}))})),ot=(0,B.Z)({caption:{marginLeft:"16px",marginTop:"12px",display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"14px",fontSize:"16px",lineHeight:"24px"},wrapper:{flex:1,display:"flex",flexDirection:"column",height:0}}),it=()=>{const e=ot();return o().createElement("div",{className:e.wrapper},o().createElement("div",{className:e.caption},o().createElement(Z.Typography,{variant:"subtitle1"},b().text("Relationships")),o().createElement(rt,null)),o().createElement(Ke,null),o().createElement(Me,null))};let at;!function(e){e[e.Relationship=0]="Relationship",e[e.EntityDetails=1]="EntityDetails"}(at||(at={}));const lt=(0,r.memo)((()=>{var e;const t=V(),[n,i]=(0,r.useState)(null),a=(0,r.useCallback)((e=>{i((t=>t===e?null:e))}),[]),l=null!==n,s=(0,r.useMemo)((()=>[{buttonProps:{id:at.Relationship,icon:$,tooltipTitle:b().text("Relationship")},content:o().createElement(it,null)},{buttonProps:{id:at.EntityDetails,icon:W.Z,tooltipTitle:b().text("Entity Details")},content:o().createElement(ee,null)}]),[]);return o().createElement("div",{className:t.wrapper},o().createElement(H.h,{open:l,width:480},o().createElement(K,null),null===(e=s[n])||void 0===e?void 0:e.content),o().createElement(q.G,{buttonsProps:(0,m.pluck)("buttonProps",s),onButtonClick:a,activeIndexId:n}))}));lt.displayName="GraphRightSidePanel";const st=lt;var ct=n(46339),ut=n(23304),dt=n(64488),pt=n(46680),mt=n.n(pt);const ht=(e,t,n)=>{var r;if(!t.label)return;const o=n.labelSize,i=n.labelFont,a=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=`${a} ${o}px ${i}`,e.fillText(t.label,t.x+t.size+11,t.y+o/3)},gt=(e,t,n)=>{const r=n.labelSize,o=n.labelFont,i=n.labelWeight;if(e.font=`${i} ${r}px ${o}`,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,o=Math.round(n+16),i=Math.round(r+2+4),a=Math.max(t.size,r/2)+2,l=Math.asin(i/2/a),s=Math.sqrt(Math.abs(Math.pow(a,2)-Math.pow(i/2,2)));e.beginPath(),e.moveTo(t.x+s,t.y+i/2),e.lineTo(t.x+a+o,t.y+i/2),e.lineTo(t.x+a+o,t.y-i/2),e.lineTo(t.x+s,t.y-i/2),e.arc(t.x,t.y,a,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,ht(e,t,n)};var bt=n(88586);class ft extends ut.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 o=1*n*5;if(t||!e.inPath)return r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,void(r[o++]=0);r[o++]=e.x,r[o++]=e.y,r[o++]=e.size,r[o++]=(0,bt.floatColor)(e.color),r[o]=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 yt{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:o,size:i}=e;const a=Math.min(128,i);let l=0,s=0;(o.width||0)>(o.height||0)?l=(o.width-o.height)/2:s=(o.height-o.width)/2,n.drawImage(o,l,s,i,i,r,0,a,a),this.images[t]={status:"ready",x:r,y:0,width:a,height:a},r+=a})),this.textureImage=n.getImageData(0,0,t.width,t.height),this.hasReceivedImages=!0,this.rebindTextureFns.forEach((e=>e()))}}}const xt={id:"defaultImage",path:(0,h.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 vt extends ut.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 yt,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(xt.id,xt.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 o=1*n*9;const i=e.image;let a=i&&this.imageLoader.images[i];if("string"!=typeof i||a||this.imageLoader.loadImage(i,i),t)return r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,void(r[o++]=0);if(r[o++]=e.x,r[o++]=e.y,r[o++]=e.size,r[o++]=(0,bt.floatColor)(e.color),r[o++]=e.inactive?1:0,a&&"ready"===a.status||(a=this.imageLoader.images[xt.id]),a&&"ready"===a.status){const{width:e,height:t}=this.imageLoader.textureImage;r[o++]=a.x/e,r[o++]=a.y/t,r[o++]=a.width/e,r[o++]=a.height/t}else r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=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 Et=[{id:"expandIcon",path:(0,h.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,h.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 wt extends ut.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 yt,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 o=e.getUniformLocation(this.program,"u_atlas");if(null===o)throw new Error("NodeButtonsProgram: error while getting atlasLocation");this.atlasLocation=o,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])),Et.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 o=2*n*11;const i=t||e.inactive&&!e.highlighted,[a,l]=e.buttonOffset||[0,0];let s=a*a+l*l,c=0,u=0;if(s&&(s=1/Math.sqrt(s),c=l*s,u=a*s),i||!e.showExpand)r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0;else{const t=this.imageLoader.images.expandIcon;if(r[o++]=e.x,r[o++]=e.y,r[o++]=e.size,r[o++]=(0,bt.floatColor)(e.color),r[o++]=e.buttonSize||0,r[o++]=c,r[o++]=-u,t&&"ready"===t.status){const{width:e,height:n}=this.imageLoader.textureImage;r[o++]=t.x/e,r[o++]=t.y/n,r[o++]=t.width/e,r[o++]=t.height/n}else r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0}if(i||!e.showCollapse)r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0;else{const t=this.imageLoader.images.collapseIcon;if(r[o++]=e.x,r[o++]=e.y,r[o++]=e.size,r[o++]=(0,bt.floatColor)(e.color),r[o++]=e.buttonSize||0,r[o++]=-c,r[o++]=-u,t&&"ready"===t.status){const{width:e,height:n}=this.imageLoader.textureImage;r[o++]=t.x/e,r[o++]=t.y/n,r[o++]=t.width/e,r[o++]=t.height/n}else r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=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))}}var Ct=n(23193),Tt=n.n(Ct);class Rt extends(Tt()){process(e,t,n,r,o){if(r){for(let e=27*o,t=e+27;e<t;e++)this.array[e]=0;return}const i=n.arrowSizeRatio||1,a=n.size*i||1,l=t.size||1,s=e.x,c=e.y,u=t.x,d=t.y,p=(0,bt.floatColor)(n.color),m=u-s,h=d-c;let g=m*m+h*h,b=0,f=0;g&&(g=1/Math.sqrt(g),b=-h*g*a,f=m*g*a);let y=27*o;const x=this.array;x[y++]=u,x[y++]=d,x[y++]=-b,x[y++]=-f,x[y++]=l,x[y++]=p,x[y++]=1,x[y++]=0,x[y++]=0,x[y++]=u,x[y++]=d,x[y++]=-b,x[y++]=-f,x[y++]=l,x[y++]=p,x[y++]=0,x[y++]=1,x[y++]=0,x[y++]=u,x[y++]=d,x[y++]=-b,x[y++]=-f,x[y++]=l,x[y++]=p,x[y++]=0,x[y++]=0,x[y]=1}}class Ot extends Rt{process(e,t,n,r,o){super.process(t,e,n,r,o)}}var St=n(73343),Pt=n.n(St);class Nt extends dt.AbstractEdgeProgram{constructor(e){super(e,"\nattribute vec4 a_color;\nattribute vec2 a_normal;\nattribute vec2 a_position;\nattribute float a_radius;\nattribute float a_arrowSizeRatio;\n\nuniform mat3 u_matrix;\nuniform float u_sqrtZoomRatio;\nuniform float u_correctionRatio;\n\nvarying vec4 v_color;\nvarying vec2 v_normal;\nvarying float v_thickness;\n\nconst float minThickness = 1.7;\nconst float bias = 255.0 / 254.0;\nconst float arrowHeadLengthThicknessRatio = 2.5;\n\nvoid main() {\n float normalLength = length(a_normal);\n vec2 unitNormal = a_normal / normalLength;\n\n // These first computations are taken from edge.vert.glsl. Please read it to\n // get better comments on what's happening:\n float pixelsThickness = max(normalLength, minThickness * u_sqrtZoomRatio);\n float webGLThickness = pixelsThickness * u_correctionRatio;\n float adaptedWebGLThickness = webGLThickness * u_sqrtZoomRatio;\n\n // our change - apply a_arrowSizeRatio depending on current zoom and minThickness\n float arrowSizeCoefficient = min(a_arrowSizeRatio, a_arrowSizeRatio / (u_sqrtZoomRatio * minThickness));\n\n // Here, we move the point to leave space for the arrow head:\n float direction = sign(a_radius);\n float adaptedWebGLNodeRadius = direction * a_radius * 2.0 * u_correctionRatio * u_sqrtZoomRatio;\n\n float adaptedWebGLArrowHeadLength = adaptedWebGLThickness * 2.0 * arrowHeadLengthThicknessRatio * arrowSizeCoefficient;\n\n\n vec2 compensationVector = vec2(-direction * unitNormal.y, direction * unitNormal.x) * (adaptedWebGLNodeRadius + adaptedWebGLArrowHeadLength);\n\n // Here is the proper position of the vertex\n gl_Position = vec4((u_matrix * vec3(a_position + unitNormal * adaptedWebGLThickness + compensationVector, 1)).xy, 0, 1);\n\n v_thickness = webGLThickness / u_sqrtZoomRatio;\n\n v_normal = unitNormal;\n v_color = a_color;\n v_color.a *= bias;\n}",Pt(),4,7),this.IndicesArray=void 0,this.indicesArray=void 0,this.indicesBuffer=void 0,this.indicesType=void 0,this.positionLocation=void 0,this.colorLocation=void 0,this.normalLocation=void 0,this.radiusLocation=void 0,this.arrowSizeRatioLocation=void 0,this.matrixLocation=void 0,this.sqrtZoomRatioLocation=void 0,this.correctionRatioLocation=void 0,this.canUse32BitsIndices=void 0;const t=e.createBuffer();if(null===t)throw new Error("EdgeClampedProgram: error while getting resolutionLocation");this.indicesBuffer=t,this.positionLocation=e.getAttribLocation(this.program,"a_position"),this.colorLocation=e.getAttribLocation(this.program,"a_color"),this.normalLocation=e.getAttribLocation(this.program,"a_normal"),this.radiusLocation=e.getAttribLocation(this.program,"a_radius"),this.arrowSizeRatioLocation=e.getAttribLocation(this.program,"a_arrowSizeRatio");const n=e.getUniformLocation(this.program,"u_matrix");if(null===n)throw new Error("EdgeClampedProgram: error while getting matrixLocation");this.matrixLocation=n;const r=e.getUniformLocation(this.program,"u_sqrtZoomRatio");if(null===r)throw new Error("EdgeClampedProgram: error while getting cameraRatioLocation");this.sqrtZoomRatioLocation=r;const o=e.getUniformLocation(this.program,"u_correctionRatio");if(null===o)throw new Error("EdgeClampedProgram: error while getting viewportRatioLocation");this.correctionRatioLocation=o,this.canUse32BitsIndices=(0,bt.canUse32BitsIndices)(e),this.IndicesArray=this.canUse32BitsIndices?Uint32Array:Uint16Array,this.indicesArray=new this.IndicesArray,this.indicesType=this.canUse32BitsIndices?e.UNSIGNED_INT:e.UNSIGNED_SHORT,this.bind()}bind(){const e=this.gl;e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,this.indicesBuffer),e.enableVertexAttribArray(this.positionLocation),e.enableVertexAttribArray(this.normalLocation),e.enableVertexAttribArray(this.colorLocation),e.enableVertexAttribArray(this.radiusLocation),e.enableVertexAttribArray(this.arrowSizeRatioLocation),e.vertexAttribPointer(this.positionLocation,2,e.FLOAT,!1,7*Float32Array.BYTES_PER_ELEMENT,0),e.vertexAttribPointer(this.normalLocation,2,e.FLOAT,!1,7*Float32Array.BYTES_PER_ELEMENT,8),e.vertexAttribPointer(this.colorLocation,4,e.UNSIGNED_BYTE,!0,7*Float32Array.BYTES_PER_ELEMENT,16),e.vertexAttribPointer(this.radiusLocation,1,e.FLOAT,!1,7*Float32Array.BYTES_PER_ELEMENT,20),e.vertexAttribPointer(this.arrowSizeRatioLocation,1,e.FLOAT,!1,7*Float32Array.BYTES_PER_ELEMENT,24)}process(e,t,n,r,o){if(r){for(let e=28*o,t=e+28;e<t;e++)this.array[e]=0;return}const i=n.arrowSizeRatio||1,a=n.size||1,l=e.x,s=e.y,c=t.x,u=t.y,d="doubleArrow"===n.type?e.size||1:0,p=t.size||1,m=(0,bt.floatColor)(n.color),h=c-l,g=u-s;let b=h*h+g*g,f=0,y=0;b&&(b=1/Math.sqrt(b),f=-g*b*a,y=h*b*a);let x=28*o;const v=this.array;v[x++]=l,v[x++]=s,v[x++]=f,v[x++]=y,v[x++]=m,v[x++]=-d,v[x++]=i,v[x++]=l,v[x++]=s,v[x++]=-f,v[x++]=-y,v[x++]=m,v[x++]=d,v[x++]=i,v[x++]=c,v[x++]=u,v[x++]=f,v[x++]=y,v[x++]=m,v[x++]=p,v[x++]=i,v[x++]=c,v[x++]=u,v[x++]=-f,v[x++]=-y,v[x++]=m,v[x++]=-p,v[x]=i}computeIndices(){const e=this.array.length/7,t=e+e/2,n=new this.IndicesArray(t);for(let t=0,r=0;t<e;t+=4)n[r++]=t,n[r++]=t+1,n[r++]=t+2,n[r++]=t+2,n[r++]=t+1,n[r++]=t+3;this.indicesArray=n}bufferData(){super.bufferData();const e=this.gl;e.bufferData(e.ELEMENT_ARRAY_BUFFER,this.indicesArray,e.STATIC_DRAW)}render(e){if(this.hasNothingToRender())return;const t=this.gl,n=this.program;t.useProgram(n),t.uniformMatrix3fv(this.matrixLocation,!1,e.matrix),t.uniform1f(this.sqrtZoomRatioLocation,Math.sqrt(e.ratio)),t.uniform1f(this.correctionRatioLocation,e.correctionRatio),t.drawElements(t.TRIANGLES,this.indicesArray.length,this.indicesType,0)}}const Lt=e=>{let{children:t}=e;const n=(0,r.useMemo)((()=>({allowInvalidContainer:!0,defaultNodeType:"image",hoverRenderer:gt,labelRenderer:ht,nodeProgramClasses:{image:(0,ut.createNodeCompoundProgram)([vt,ft,wt])},edgeProgramClasses:{line:mt(),arrow:(0,dt.createEdgeCompoundProgram)([Nt,Rt]),doubleArrow:(0,dt.createEdgeCompoundProgram)([Nt,Rt,Ot])},labelFont:"Roboto",labelSize:13,labelColor:{color:"rgba(0, 0, 0, 0.87)"}})),[]);return o().createElement(ct.C6,{graph:p.MultiGraph,style:{background:"transparent"},initialSettings:n},t)};var _t=n(28833),jt=n.n(_t),It=n(3660),kt=n.n(It),At=n(28301),Dt=n.n(At),Ut=n(30634),zt=n(20562),Zt=n(31181),Bt=n(30284);const Mt=(e,t,n,r,o,i,a)=>({aX:e+(r-e)*(n-a-i)/n,aY:t+(o-t)*(n-a-i)/n,vX:(r-e)*a/n,vY:(o-t)*a/n}),Ft=(e,t,n,r,o)=>{e.beginPath(),e.moveTo(t+r,n+o),e.lineTo(t+o*Gt,n-r*Gt),e.lineTo(t-o*Gt,n+r*Gt),e.lineTo(t+r,n+o),e.closePath(),e.fill()},Gt=.4,Ht=(e,t,n,r,o)=>{if(t.loop){const{size:r,color:o,arrowSizeRatio:i=1}=t,a=n.x,l=n.y,s=n.size,c=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)}}(a,l,.6*s);if(e.strokeStyle=o,e.lineWidth=r,"arrow"===t.type||"doubleArrow"===t.type){if(e.fillStyle=o,"doubleArrow"===t.type){const{aX:t,aY:n,vX:o,vY:u}=((e,t,n,r,o)=>{const i=Math.sqrt(Math.pow(t-e.x1,2)+Math.pow(n-e.y1,2));return Mt(e.x2,e.y2,i,t,n,r,o)})(c,a,l,s,r*i*2.2);Ft(e,t,n,o,u),e.beginPath(),e.moveTo(t,n)}else e.beginPath(),e.moveTo(a,l);const{aX:n,aY:u,vX:d,vY:p}=((e,t,n,r,o)=>{const i=Math.sqrt(Math.pow(t-e.x1,2)+Math.pow(n-e.y1,2));return Mt(e.x1,e.y1,i,t,n,r,o)})(c,a,l,s,r*i*2.2);e.bezierCurveTo(c.x2,c.y2,c.x1,c.y1,n,u),e.stroke(),Ft(e,n,u,d,p)}else e.beginPath(),e.moveTo(a,l),e.bezierCurveTo(c.x1,c.y1,c.x2,c.y2,a,l),e.stroke()}(0,Bt.default)(e,t,n,r,o)};function qt(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){Wt(e,t,n[t])}))}return e}function Wt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Vt=(e,t,n,r,o)=>e>n-o&&e<n+o&&t>r-o&&t<r+o&&Math.sqrt(Math.pow(e-n,2)+Math.pow(t-r,2))<o,Yt=(0,m.memoizeWith)(((e,t,n)=>n.type),h.uie),$t={size:24,buttonSize:8,buttonOffset:[19,19]},Xt={size:12,buttonSize:6,buttonOffset:[8,13]},Kt=e=>{let{data:t,graph:n,syncLayout:o,workerLayout:a,layoutSettings:l,selectedNode:s,isDirected:c=!1,onNodeClick:d,onNodeCollapse:p,onNodeExpand:m,filters:g}=e;const b=(0,ct.Ys)(),x=(0,ct.sG)(),v=(0,ct.$j)(),E=(0,ct.eP)(),w=(0,i.useSelector)(u.ZP.selectors.getEntity),C=(0,i.useSelector)(u.ZP.selectors.getMetadata),T=(0,i.useSelector)(u.ZP.selectors.getAbsoluteImagePath)||"",[R,O]=(0,r.useState)(void 0),[S,P]=(0,r.useState)(null),[N,L]=(0,r.useState)({});(0,r.useEffect)((()=>{b.getCamera().setState({ratio:1.2})}),[n,b]),(0,r.useEffect)((()=>{if(P((0,y.toUndirected)(n)),x(n),o){const e=o(b.getGraph(),l);(0,Zt.animateNodes)(b.getGraph(),e,{duration:1e3})}if(a){const e=new a(b.getGraph(),l);e.start();const t=setTimeout((()=>{e.stop()}),5e3);return()=>{clearTimeout(t),e.kill()}}}),[t,n,o,a,b,l,x,c]);const _=(0,r.useCallback)((e=>{const t=b.getGraph(),n=null==w?void 0:w.uri;if(t&&S&&n&&e&&n!==e){const r=(0,f.Ar)(S,n,e),o=function(e,t){const n=[],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2]?"findOutEdge":"findEdge";return t&&t.reduce(((t,o)=>(n.push(e[r](t,o,(e=>!!e))),o))),n}(t,r);return r?{edges:o,nodes:r}:{}}return{}}),[b,null==w?void 0:w.uri,S]);(0,r.useEffect)((()=>{L(_(s))}),[s,_]),(0,r.useEffect)((()=>{v({enterNode:e=>{let{node:t}=e;O(t)},leaveNode:()=>{O(void 0)},clickNode:e=>{let{node:t}=e;d(t)},click:e=>{const t=(e=>{let{x:t,y:n}=e;const r=b.viewportToGraph({x:t,y:n}),o=b.getGraph(),i=o.nodes().map((e=>{const t=o.getNodeAttributes(e);return{nodeId:e,distance:Math.pow(r.x-t.x,2)+Math.pow(r.y-t.y,2),hidden:t.hidden}})).sort(((e,t)=>e.distance-t.distance)).filter((e=>{let{hidden:t}=e;return!t}));return i.length>0?i[0].nodeId:null})(e);if(t){const n=b.getNodeDisplayData(t),r=b.framedGraphToViewport({x:n.x,y:n.y}),o=b.scaleSize(n.buttonOffset[0]),i=b.scaleSize(n.buttonOffset[1]),a=b.scaleSize(n.buttonSize),l=Vt(e.x,e.y,r.x+o,r.y-i,a),s=Vt(e.x,e.y,r.x+o,r.y+i,a);n.showExpand&&l&&(m(t),d(t)),n.showCollapse&&s&&(p(t,_(t)),d(t))}}})}),[b,v,d,p,m,_]),(0,r.useEffect)((()=>{const e=b.getGraph(),t=e.neighbors(s);E({nodeReducer:(n,r)=>{const{entityTypesUris:o=[]}=g||{},i=Yt(C,T,{type:r.entityTypeUri}),a=n===s?$t:Xt,l=e.neighbors(n),c=l.map((t=>e.getNodeAttribute(t,"hidden"))).filter((e=>!!e)).length,u=qt({},r,a,{color:"#0072CE",image:i,showExpand:r.untraversedRelationsCount>0||c>0,showCollapse:r.traversedRelationsCount>1&&l.length-c>1}),d=(N.nodes||[]).includes(n),p=R===n;return d||n===s||n===(null==w?void 0:w.uri)?(u.inPath=!0,n===(null==w?void 0:w.uri)&&(u.color="#00FFFF")):!t||t.includes(n)||s===n||s===(null==w?void 0:w.uri)||d||(p||(u.label=""),u.inactive=!0),p&&(u.highlighted=!0),![s,null==w?void 0:w.uri].includes(n)&&o.length>0&&!o.includes(r.entityTypeUri)&&(u.hidden=!0),u},edgeReducer:(t,n)=>{const{relationTypesUris:r=[]}=g||{},o=qt({},n,{hidden:!1}),i=(N.edges||[]).includes(t);var a;return(s&&s!==(null==w?void 0:w.uri)&&!e.hasExtremity(t,s)&&!i||r.length>0&&!r.includes(n.relationTypeUri))&&(o.hidden=!0),c&&(o.arrowSizeRatio=4),i&&(o.color="#0072CE",o.size=4,c&&(o.arrowSizeRatio=1.4)),o.type=(a=c?n.direction:h.MCv.undirected,{[h.MCv.bidirectional]:"doubleArrow",[h.MCv.directed]:"arrow",[h.MCv.undirected]:"line"}[a]||"line"),o},renderEdgeLabels:!0,edgeLabelRenderer:Ht})}),[b,E,R,s,N,null==w?void 0:w.uri,C,T,c,g])};let Qt;function Jt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){en(e,t,n[t])}))}return e}function en(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}!function(e){e.SIMPLE_NETWORK="Simple network",e.VERTICAL_TB="Vertical hierarchy",e.HORIZONTAL_LR="Horizontal hierarchy",e.DIRECTED_NETWORK="Directed Network"}(Qt||(Qt={}));const tn=e=>{let{data:t,graph:n,selectedNode:o,layout:i,onNodeClick:a,onNodeCollapse:l,onNodeExpand:s,filters:c}=e;const u=(0,Ut.D)(t);(0,zt.D)((()=>{if(u){const e=(0,m.difference)(t.entities.map((0,m.prop)("uri")),u.entities.map((0,m.prop)("uri")));if(e.length){const t=n.copy();jt().assign(t),e.forEach((e=>{n.setNodeAttribute(e,"x",t.getNodeAttribute(e,"x")),n.setNodeAttribute(e,"y",t.getNodeAttribute(e,"y"))}))}}}),[t]);const d=(0,r.useMemo)((()=>(jt().assign(n),{settings:Jt({},kt().inferSettings(n),{gravity:1})})),[n]);return Kt({workerLayout:Dt(),layoutSettings:d,data:t,graph:n,selectedNode:o,onNodeClick:a,isDirected:i===Qt.DIRECTED_NETWORK,onNodeCollapse:l,onNodeExpand:s,filters:c}),null};var nn=n(36039);const rn=(e,t,n,r)=>{const o=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)||o.add(r.to)}))})),o.size&&t.push(Array.from(o)),((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})(o,r,n)?rn(o,t,n,r):t},on=(e,t,n,r)=>{if(e.length<10&&(t[r]=[...e]),e.length>10){const o=e.slice(10),i=e.slice(0,10);t[r]=i,t[r+1]=n[r+1]?[...n[r+1],...o]:o}if(t[r+1]||n[r+1]){const e=t[++r]||n[r];return on(e,t,n,r)}return t};function an(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ln=e=>{let{data:t,graph:n,selectedNode:o,layout:i,onNodeClick:a,onNodeCollapse:l,onNodeExpand:s,filters:c}=e;const u=(0,r.useCallback)((e=>{const t=e.copy(),n=(e=>{switch(e){case Qt.VERTICAL_TB:return 180;case Qt.HORIZONTAL_LR:return 270}})(i),r=((e,t)=>{const n=e.nodes,r=e.edges.filter((e=>e.from!==e.to)),o=((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=rn(o,[],new Set,r);return on(i[0],[],i,0)})((e=>{const t=e.nodes().map((e=>({id:e,name:""}))),n=e.mapEdges(((e,t,n,r)=>({from:n,to:r,key:e,relationTypeUri:t.relationTypeUri,direction:t.direction})));return{nodes:t,edges:n}})(t),o),a=(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=a)?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 nn.rotation.assign(t,n,{degrees:!0}),t.reduceNodes(((e,t,n)=>{let{x:r,y:o}=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){an(e,t,n[t])}))}return e}({},e,{[t]:{x:r,y:o}})}),{})}),[i,o]);return Kt({syncLayout:u,data:t,graph:n,selectedNode:o,onNodeClick:a,onNodeCollapse:l,onNodeExpand:s,filters:c}),null};var sn=n(24737);const cn=(0,B.Z)({graphTypeSelector:{minWidth:"200px",backgroundColor:"#FAFAFA",opacity:1,height:"40px"},filledInputRoot:{borderRadius:"4px"},valueContainer:{width:"auto",marginLeft:"16px"}}),un=(0,X.l)(I,(e=>{let{graphTypeUri:t,setGraphTypeUri:n}=e;return{setGraphTypeUri:n,graphTypeUri:t}}),(e=>{let{graphTypeUri:t,setGraphTypeUri:n}=e;const a=cn(),l=(0,i.useSelector)(u.ZP.selectors.getMetadata),s=(0,i.useSelector)(u.ZP.selectors.getEntity),c=(0,r.useMemo)((()=>[{label:b().text("All"),value:null},...(0,h.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 o().createElement(sn.Z,{classes:{valueContainer:a.valueContainer},className:a.graphTypeSelector,height:42,label:b().text("Graph type"),value:d,options:c,onChange:e=>n(e.value),TextFieldProps:{InputProps:{disableUnderline:!0,classes:{root:a.filledInputRoot}}}})})),dn=(0,B.Z)({graphLayoutSelector:{minWidth:"202px",backgroundColor:"#FAFAFA",opacity:1,marginLeft:"10px"},filledInputRoot:{borderRadius:"4px",height:"42px"}}),pn=(0,r.memo)((e=>{let{value:t,onChangeHandler:n}=e;const r=dn(),i=[{label:b().text("Simple network"),value:Qt.SIMPLE_NETWORK},{label:b().text("Vertical hierarchy"),value:Qt.VERTICAL_TB},{label:b().text("Horizontal hierarchy"),value:Qt.HORIZONTAL_LR},{label:b().text("Directed network"),value:Qt.DIRECTED_NETWORK}];return o().createElement(sn.Z,{className:r.graphLayoutSelector,label:b().text("Graph layout"),value:i.find((0,m.propEq)("value",t)),options:i,onChange:e=>n(e.value),TextFieldProps:{InputProps:{disableUnderline:!0,classes:{root:r.filledInputRoot}}}})})),mn=()=>{const e=(0,ct.Ys)(),t=(0,r.useCallback)((()=>{e.refresh()}),[e]);return o().createElement(ne.Z,{handleWidth:!0,onResize:t})};var hn=n(17373);function gn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){bn(e,t,n[t])}))}return e}function bn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const fn="0 1px 1px rgba(0,0,0,0.14), 0 2px 1px rgba(0,0,0,0.12), 0 1px 3px rgba(0,0,0,0.2)",yn={background:"#FFFFFF",boxShadow:fn,width:"28px",height:"28px"},xn=(0,B.Z)({container:{display:"flex",alignItems:"center"},maxButton:gn({},yn,{borderRadius:"2px 4px 4px 2px"}),minButton:gn({},yn,{borderRadius:"4px 2px 2px 4px"}),thumb:{position:"absolute",boxShadow:fn,borderRadius:"2px",width:"8px",height:"28px",marginTop:"-13px",marginLeft:"1px",color:"rgba(0,0,0,0.54)",backgroundColor:"#FFFFFF",boxSizing:"border-box",outline:0,display:"flex",alignItems:"center",justifyContent:"center"},thumbIcon:{transform:"rotate(90deg)"},icon:{width:"18px",height:"18px"},rail:{opacity:1,height:"4px",paddingRight:"10px"},sliderRoot:{color:"#EDEDED",marginRight:"10px"}});function vn(){return vn=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},vn.apply(this,arguments)}const En=e=>Math.pow(100/e,2),wn=e=>100/Math.sqrt(e),Cn=e=>{const t=xn(),n=(0,m.omit)(["className"],e);return o().createElement("div",vn({className:t.thumb},n),o().createElement(hn.Z,{className:A()(t.icon,t.thumbIcon)}))},Tn=e=>{let{className:t,max:n,min:i}=e;const a=xn(),l=(0,ct.eP)(),s=(0,ct.$j)(),c=(0,ct.Ys)().getCamera(),{zoomIn:u,zoomOut:d}=(0,ct.AH)({factor:1.2}),[p,h]=(0,r.useState)((0,m.clamp)(i,n,wn(c.getState().ratio))),g=(0,r.useMemo)((()=>i>0?En(i):null),[i]),b=(0,r.useMemo)((()=>n>0?En(n):null),[n]);return(0,r.useEffect)((()=>(l({maxCameraRatio:g,minCameraRatio:b}),()=>{l({maxCameraRatio:null,minCameraRatio:null})})),[l,b,g]),(0,r.useEffect)((()=>{s({cameraUpdated:e=>h(wn(e.ratio))})}),[s]),o().createElement("div",{className:A()(a.container,t)},o().createElement(Z.IconButton,{className:a.minButton,onClick:()=>d()},o().createElement(hn.Z,{className:a.icon})),o().createElement(Z.Slider,{ThumbComponent:Cn,classes:{root:a.sliderRoot,rail:a.rail},track:!1,value:p,min:i,max:n,onChange:(e,t)=>c.setState({ratio:c.getBoundedRatio(En(t))})}),o().createElement(Z.IconButton,{className:a.maxButton,onClick:()=>u()},o().createElement(Qe.Z,{className:a.icon})))};var Rn=n(25156);const On=(0,B.Z)({button:{background:"#FFFFFF",boxShadow:"0 1px 1px rgba(0,0,0,0.14), 0 2px 1px rgba(0,0,0,0.12), 0 1px 3px rgba(0,0,0,0.2)",width:"28px",height:"28px",borderRadius:"4px"},icon:{width:"18px",height:"18px"}}),Sn=e=>{let{node:t}=e;const n=On(),{gotoNode:r}=(0,ct.AH)();return o().createElement(Z.IconButton,{className:n.button,onClick:()=>r(t)},o().createElement(Rn.Z,{className:n.icon}))},Pn=(0,B.Z)({wrapper:{height:"100%",position:"relative"},selectors:{display:"flex",position:"absolute",top:"12px",right:"16px",zIndex:2},graph:{height:"calc(100% - 5px)"},rightBottomControls:{position:"absolute",zIndex:100,right:"18px",bottom:"16px",display:"flex",width:"200px"},zoomSlider:{flexGrow:1,marginRight:"8px"}}),Nn=(0,X.l)(I,(e=>{let{data:t,graphologyGraph:n,selectedEntity:r,onEntitySelect:o,onCollapseEntity:i,onExpandEntity:a,relationshipTable:{filters:l}}=e;return{data:t,graph:n,selectedNode:null==r?void 0:r.uri,onNodeSelect:o,onNodeCollapse:i,onNodeExpand:a,filters:l}}),(e=>{let{data:t,graph:n,selectedNode:i,onNodeSelect:a,onNodeCollapse:l,onNodeExpand:s,filters:c}=e;const u=Pn(),[d,p]=(0,r.useState)(Qt.SIMPLE_NETWORK),m={data:t,graph:n,selectedNode:i,layout:d,onNodeClick:a,onNodeCollapse:l,onNodeExpand:s,filters:c};return o().createElement("div",{className:u.wrapper},o().createElement("div",{className:u.selectors},o().createElement(un,null),o().createElement(pn,{value:d,onChangeHandler:p})),o().createElement("div",{className:u.graph},n&&o().createElement(Lt,null,o().createElement(o().Fragment,null,o().createElement(mn,null),d===Qt.SIMPLE_NETWORK||d===Qt.DIRECTED_NETWORK?o().createElement(tn,m):o().createElement(ln,m),o().createElement("div",{className:u.rightBottomControls},o().createElement(Tn,{className:u.zoomSlider,min:30,max:300}),o().createElement(Sn,{node:i}))))))})),Ln=(0,B.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"}}))),_n=(0,r.memo)((()=>{const e=Ln(),t=(0,i.useSelector)(u.ZP.selectors.getEntity),n=(e=>{const{graphLoading:t,data:n,graphologyGraph:o,graphTypeUri:a,setGraphTypeUri:l,onAddRelation:s,onDeleteRelation:c,onCollapseEntity:d,onExpandEntity:p}=O(e),{selectedEntity:g,onEntitySelect:f,selectedEntityLoading:y}=((e,t)=>{const n=(0,R._)(),o=(0,i.useDispatch)(),[a,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,h.HvW)(e).then((e=>(s.current=P(s.current,e),e)))}),[]),g=(0,r.useCallback)((e=>{var r;const i=null==t||null===(r=t.entities)||void 0===r?void 0:r.find((0,m.propEq)("uri",e));i&&l(i),d(!0),n(p(e)).then(l).catch((e=>{o(u.ui.actions.errorSet((0,h.xU7)(e,b().text("Something went wrong"))))})).finally((()=>{d(!1)}))}),[o,t,n,p]);return(0,r.useEffect)((()=>{null!=e&&e.uri&&(s.current=P({},e),g(e.uri))}),[null==e?void 0:e.uri]),(0,r.useEffect)((()=>{const n=null==t?void 0:t.entities.find((e=>(null==a?void 0:a.uri)===e.uri));n||(null!=e&&e.uri?(s.current=P({},e),g(e.uri)):(s.current={},l(null)))}),[t]),{selectedEntityLoading:c,selectedEntity:a,onEntitySelect:g}})(e,n);return{graphLoading:t,data:n,graphologyGraph:o,selectedEntity:g,selectedEntityLoading:y,graphTypeUri:a,relationshipTable:j({data:n,selectedEntityUri:null==g?void 0:g.uri,mainEntityUri:null==e?void 0:e.uri,graphTypeUri:a}),onAddRelation:s,onDeleteRelation:c,onCollapseEntity:d,onExpandEntity:p,onEntitySelect:f,setGraphTypeUri:l}})(t),{graphLoading:a}=n;return o().createElement(I.Provider,{value:n},o().createElement("div",{className:e.perspectiveView},a&&o().createElement(d.Z,null),(null==t?void 0:t.uri)&&o().createElement("div",{className:e.graphContainer},o().createElement("div",{className:e.graphWrapper},o().createElement(G,null),o().createElement(Nn,null)),o().createElement(st,null))))}));_n.displayName="GraphPerspectiveView";const jn=_n,In=(0,a.createGenerateClassName)({productionPrefix:"graph",disableGlobal:!0}),kn=e=>{let{store:t}=e;return o().createElement(i.Provider,{store:t},o().createElement(a.StylesProvider,{generateClassName:In},o().createElement(s.MuiPickersUtilsProvider,{utils:c.Z},o().createElement(jn,null),o().createElement(l.Z,{showErrorFromStore:!0}))))}}}]);
|
|
1
|
+
"use strict";(self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[2274],{48852:(e,t,n)=>{n.d(t,{l:()=>a});var r=n(24328),o=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 a=(e,t,n)=>{if(e&&t){const a=(0,r.memo)(n);return n=>o().createElement(e.Consumer,null,(e=>o().createElement(a,i({},n,t(e,n)))))}return n}},98808:(e,t,n)=>{n.d(t,{K:()=>h,N:()=>m});var r=n(24328),o=n.n(r),i=n(71153),a=n.n(i),l=n(94079);const s=(0,n(79692).Z)((e=>({button:{padding:"9px 16px 9px 12px","& svg g path, & svg path":{fill:e.palette.primary.main,fillOpacity:1}},iconButton:{"& svg g path, & svg path":{fill:e.palette.primary.main,fillOpacity:1}},startIcon:{marginLeft:0,marginRight:"8px",width:"18px",height:"18px",alignItems:"center"},label:{whiteSpace:"nowrap",fontSize:"14px",lineHeight:"16px",letterSpacing:0},overflowStyle:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},menuIcon:{marginRight:"12px"},menuItem:{minHeight:"28px",padding:"2px 16px 2px 12px"},menuText:{color:e.palette.text.primary,fontSize:"13px",lineHeight:"15px",letterSpacing:0}})));var c=n(31276),u=n(88611),d=n(8818);function p(){return p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},p.apply(this,arguments)}let m;!function(e){e.iconButton="iconButton",e.button="button",e.menuItem="menuItem"}(m||(m={}));const h=(0,r.forwardRef)(((e,t)=>{let{className:n,mode:r=m.iconButton,label:i,disabled:h,icon:g,onClick:b=c.ZT,onMenuClose:f=c.ZT}=e,y=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(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)&&(o[n]=e[n])}return o}(e,["className","mode","label","disabled","icon","onClick","onMenuClose"]);const x=s();return(()=>{switch(r){case"iconButton":return o().createElement(d.k,p({disabled:h,className:a()(x.iconButton,n),size:"S",tooltipTitle:i,onClick:b,icon:g},y));case"button":return o().createElement(l.Button,p({className:a()(x.button,n),disabled:h,startIcon:o().createElement(g,null),onClick:b,color:"primary",classes:{startIcon:x.startIcon,label:x.label}},y),o().createElement(u.C,{value:i},o().createElement("div",{className:x.overflowStyle},i)));case"menuItem":{const e=()=>{f(),b()};return o().createElement(l.MenuItem,p({classes:{root:x.menuItem},onClick:e,disabled:h,ref:t},y),o().createElement(o().Fragment,null,o().createElement(g,{className:x.menuIcon}),o().createElement(l.Typography,{classes:{root:x.menuText}},i)))}}})()}));h.displayName="ActionButton"},30739:(e,t,n)=>{n.d(t,{Z:()=>d});var r=n(24328),o=n.n(r),i=n(50166),a=n(44443),l=n(99493);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 b=s(),f=(0,r.useRef)({}),[y,x]=(0,r.useState)({}),v=(0,r.useCallback)((0,l.DsO)((()=>{x(c({},f.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 o().createElement("div",{style:r,className:b.item},o().createElement("div",{style:h?void 0:{visibility:i in y?void 0:"hidden"}},o().createElement(a.Z,{handleHeight:!0,onResize:(e,t)=>{f.current[i]!==t&&(((e,t)=>{f.current=c({},f.current,{[e]:t})})(i,t),v())}}),p({data:t,index:n})))}),[p,h,E,v,!h&&y]);return o().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)}))},58662:(e,t,n)=>{n.d(t,{Z:()=>y});var r=n(13980),o=n.n(r),i=n(24328),a=n.n(i),l=n(71153),s=n.n(l),c=n(94079),u=n(87918),d=n.n(u),p=n(31276),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){b(e,t,n[t])}))}return e}function b(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const f=e=>{let{classes:t={},count:n,rowsPerPageOptions:r,page:o,onChangePage:l,rowsPerPage:u,onChangeRowsPerPage:b,basicTableRef:f,labelRowsPerPage:y}=e;const x=h(),v=(0,i.useCallback)((()=>{(0,m.pathOr)(m.identity,["current","resetScrollbarPosition"],f)()}),[f]),E=(0,i.useCallback)((e=>{l(e),v()}),[l,v]),w=(0,i.useCallback)((e=>{l(0),b(e),v()}),[l,b,v]);return a().createElement(c.TablePagination,{classes:g({},t,{root:s()(x.pagination,t.root),select:s()(x.select,t.select),caption:x.caption,selectRoot:x.selectRoot,actions:x.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:o,onChangePage:(0,m.pipe)((0,m.nthArg)(1),E),rowsPerPage:u,onChangeRowsPerPage:(0,m.pipe)(p.NA,w)})};f.propTypes={classes:o().object,rowsPerPageOptions:o().arrayOf(o().number),count:o().number,page:o().number,onChangePage:o().func,rowsPerPage:o().number,onChangeRowsPerPage:o().func,basicTableRef:o().shape({current:o().object}),labelRowsPerPage:o().string};const y=a().memo(f)},10237:(e,t,n)=>{n.d(t,{Z:()=>m});var r=n(27556),o=n(13980),i=n.n(o),a=n(24328),l=n.n(a);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,a.forwardRef)(((e,t)=>{let{children:n,className:o}=e,i=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(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)&&(o[n]=e[n])}return o}(e,["children","className"]);const a=u();return l().createElement(r.Z,d({ref:t,className:o,classes:{root:a["basic-view__paper"]}},i),n)}));p.displayName="BasicView",p.propTypes={children:i().node,className:i().string};const m=p},81137:(e,t,n)=>{n.d(t,{Z:()=>c});var r=n(24328),o=n.n(r),i=n(87918),a=n.n(i),l=n(94079);const s=(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"}}),c=e=>{let{open:t,title:n,content:r,onCancel:i,cancelCaption:c=a().text("Cancel"),onDiscard:u,discardCaption:d="",onSave:p,saveCaption:m=a().text("Save"),disabledSave:h=!1}=e;const g=s();return o().createElement(l.Dialog,{open:t,onClose:i,classes:{paperScrollPaper:g.paper}},o().createElement(l.DialogTitle,{classes:{root:g.title}},n),o().createElement(l.DialogContent,{classes:{root:g.content}},o().createElement(l.DialogContentText,{classes:{root:g.contentText}},r)),o().createElement(l.DialogActions,{className:g.actionButtons,disableSpacing:!0},i&&o().createElement(l.Button,{onClick:i},c),o().createElement("div",null,u&&o().createElement(l.Button,{onClick:u,classes:{root:g.discardButton}},d),o().createElement(l.Button,{onClick:p,color:"primary",disabled:h,autoFocus:!0},m))))}},14363:(e,t,n)=>{n.d(t,{n:()=>y});const r=(0,n(79692).Z)({item:{marginBottom:"16px"},dense:{marginBottom:0}});var o=n(20562),i=n(24328),a=n.n(i),l=n(52730),s=n(87638),c=n(99493),u=n(91262),d=n(71153),p=n.n(d),m=n(17440),h=n(7154),g=n(26579),b=n(81077);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 y=e=>{let{connection:t,relatedEntity:n,inRelationTypes:d=[],outRelationTypes:y=[],showEmptyEditors:x,entityErrorMessage:v,onChangeAttribute:E,onRemoveAttribute:w,onAddAttributes:C,onChangeRelationType:T,onChangeEntity:R}=e;const O=r(),{relation:S,entity:P}=t,{attributes:N,uri:L,type:_="",direction:j}=S||{},I=Boolean(_),k=(0,l.useSelector)(s.ZP.selectors.getMetadata),A=(0,i.useMemo)((()=>S&&function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){f(e,t,n[t])}))}return e}({attributes:N},(0,c.p2l)(S))),[S,N]),D=(0,i.useMemo)((()=>(0,c.xF8)(k,_)),[_,k]),U=(0,i.useMemo)((()=>I?(0,c.jWj)(j===c.Nsj.OUT,k,[(0,c.V3K)(k,_)]):(0,m.uniq)((0,c.jWj)(!0,k,y).concat((0,c.jWj)(!1,k,d)))),[I,_,k,d,y]),z=(0,l.useSelector)((e=>s.ZP.selectors.getGlobalSearchRequestOptions(e,["ovOnly"]))),Z=(0,i.useMemo)((()=>S&&{relationType:S.type,direction:S.direction}),[S]),B=(0,i.useMemo)((()=>P&&{entityUri:P.uri,entityType:P.type,entityLabel:(0,c.idV)(P.label)}),[P]),M=(0,i.useMemo)((()=>P&&P.uri?d.filter((0,c.eHk)(!1,P,n,k)):d),[P,d,n,k]),F=(0,i.useMemo)((()=>P&&P.uri?y.filter((0,c.eHk)(!0,P,n,k)):y),[P,y,n,k]);(0,i.useEffect)((()=>{const{type:e,direction:t}=(0,c.z7d)(d,y)||{};!_&&e&&T&&T({type:e.uri,direction:t})}),[_,d,y,T]),(0,o.D)((()=>{const{type:e,direction:t}=(0,c.z7d)(M,F)||{};!_&&e&&T({type:e.uri,direction:t})}),[_,P,M,F,R]);const G=(0,i.useCallback)((e=>{let{type:t,direction:n}=e;T({type:t.uri,direction:n})}),[T]);return a().createElement(a().Fragment,null,T&&a().createElement(h.Z,{className:O.item,relation:Z,metadata:k,inRelationTypes:d,outRelationTypes:y,onChange:G}),R&&a().createElement(g.Z,{errorMessage:v,className:O.item},a().createElement(b.Z,{key:_,className:p()({[O.dense]:v}),entity:B||{},entityTypesUris:U,max:20,globalSearchRequestOptions:z,mode:c.fO_.EDITING,onChange:R,onCreate:void 0,metadata:k,attributeTypesSelectionStrategy:void 0})),_&&a().createElement(u.Z,{attrTypes:D,entity:A,showEmptyEditors:x,mode:c.fO_.EDITING,parentUri:L,onAddAttributes:C,onChangeAttribute:E,onDeleteAttribute:w}))}},7154:(e,t,n)=>{n.d(t,{Z:()=>m});var r=n(24328),o=n.n(r),i=n(13980),a=n.n(i),l=n(99493),s=n(17440),c=n(89846),u=n(27185);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=e=>{let{relation:t={},inRelationTypes:n=[],outRelationTypes:i=[],onChange:a=s.identity,applyFirstByDefault:l=!1,reversedContextLabels:p=!1}=e,m=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(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)&&(o[n]=e[n])}return o}(e,["relation","inRelationTypes","outRelationTypes","onChange","applyFirstByDefault","reversedContextLabels"]);const{getRelationTypesOptions:h,fromEditorValue:g,toEditorValue:b}=(0,c.n)({reversedContextLabels:p}),f=(0,r.useMemo)((()=>h(n,i)),[h,n,i]),y=(0,r.useCallback)((0,s.pipe)(g(n,i),a),[g,n,i,a]),x=!!t.relationType;return(0,r.useEffect)((()=>{l&&f.length&&!x&&y(f[0])}),[f,l,y,x]),o().createElement(u.Z,d({value:b(t,f),options:f,onChange:y},m))};p.propTypes={className:a().string,relation:l.bNA,inRelationTypes:a().arrayOf(l.IYE),outRelationTypes:a().arrayOf(l.IYE),applyFirstByDefault:a().bool,reversedContextLabels:a().bool,onChange:a().func};const m=p},68439:(e,t,n)=>{n.d(t,{Z:()=>p});var r=n(24328),o=n.n(r),i=n(52730),a=n(71153),l=n.n(a),s=n(94079),c=n(99493),u=n(87638);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 a=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 o().createElement(s.Typography,{style:{backgroundColor:g,color:c.P6Y.Colors.getColor(g)?"#FFFFFF":"#212121"},className:l()(a[`entityType-${r}`],n),component:"div"},(0,c.jFi)(p,t))}},59725:(e,t,n)=>{n.d(t,{Q:()=>c});var r=n(24328),o=n.n(r),i=n(87918),a=n.n(i),l=n(99493),s=n(42520);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 o().createElement(s.S,{items:g,selectedItemsUris:n,single:i,placeholder:c,enableEmptyValueUnderline:u,onChange:d,classes:p,ListLabelProps:m,disabled:h,label:a().text("Entity type"),dataReltioId:"entity-type-selector",selectionPopupTitle:a().text("Select entity types")})}));c.displayName="EntityTypesSelector"},93416:(e,t,n)=>{n.d(t,{Z:()=>c});var r=n(24328),o=n.n(r),i=n(71153),a=n.n(i),l=n(92778);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 o().createElement(l.Z,{title:n,classes:{root:a()(i.container,t),title:i.title}},r)}},42520:(e,t,n)=>{n.d(t,{S:()=>L});var r=n(24328),o=n.n(r),i=n(71153),a=n.n(i),l=n(17440),s=n(99493),c=n(94079),u=n(83543),d=n(79692);const p=(0,d.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)"}}),m=(e,t)=>{const{childNodes:n,clientLeft:r,clientWidth:o}=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:a}=i.getBoundingClientRect();if(r+a>o)return n;n!==e.length-1&&i.setEnd(t,i.endOffset+", ".length)}}return-1},h=e=>e.join(", "),g=e=>`calc(${(0,l.isNil)(e)?"100%":`${e}px`} - 35px)`,b=e=>{let{list:t,maxWidth:n}=e;const i=p(),a=(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=m(e,t);return-1===n?0:e.length-n}return 0})(e,t);return n-Math.max(1,n-r)})(t,a.current))}),[t]);const u=h(t),d=l>0,b=d?h(t.slice(0,-l)):u;return o().createElement(c.Tooltip,{title:d?u:""},o().createElement("div",{className:i.listLabelContainer},o().createElement("div",{style:{width:g(n)},className:i.listLabel,ref:a},u),o().createElement("div",{className:i.visibleItemsLabel},b),d&&o().createElement("div",{className:i.hiddenCount},`+${l}`)))};var f=n(22385),y=n(97820),x=n(54763),v=n(7785),E=n(27239),w=n(44890);function C(){return C=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},C.apply(this,arguments)}const T=(0,l.always)(32),R=(0,r.memo)((e=>{let{selectedItems:t,onItemClick:n,focusIndex:r,width:i,height:a}=e,l=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(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)&&(o[n]=e[n])}return o}(e,["selectedItems","onItemClick","focusIndex","width","height"]);return o().createElement(w.Z,C({getItemSize:T,renderItem:(e,i,a)=>{let{item:l}=i;const s=!!t.find((e=>l.uri===e)),c=a===r;return o().createElement(v.Z,{key:l.uri,onClick:n,checked:s,data:l,label:o().createElement(E.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:a},l))}));R.displayName="SelectMetadataTypesList";const O=(0,d.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 S(){return S=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},S.apply(this,arguments)}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){N(e,t,n[t])}))}return e}function N(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const L=(0,r.memo)((e=>{let{placeholder:t,classes:n={},items:i,selectedItemsUris:d,onChange:p,ListLabelProps:m={},disabled:h,enableEmptyValueUnderline:g,single:v,label:E,dataReltioId:w,selectionPopupTitle:C}=e;const T=O(),[N,L]=(0,r.useState)(!1),_=(0,r.useCallback)((()=>L(!0)),[]),j=(0,r.useCallback)((()=>L(!1)),[]),[I,k]=(0,r.useState)(""),A=(0,r.useCallback)((()=>k("")),[]),D=(0,r.useCallback)((0,l.pipe)(A,j),[j,A]),U=i.filter((e=>{let{label:t}=e;return s.P6Y.strings.search(t,I)})).map(((e,t)=>({item:{item:P({},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]),Z=(0,r.useCallback)(((e,t)=>{v?(p(t?[e.uri]:[]),D()):p(t?d.concat(e.uri):d.filter((t=>t!==e.uri)))}),[d,p,v,D]),B=(0,r.useCallback)((e=>{let{item:t}=e;const n=!d.includes(t.uri);Z(t,n)}),[d,Z]),{focusIndex:M,handleKeyDown:F}=(0,x.t)({items:U,open:N,onSelectFocusedItem:B,selectedItems:d,onClose:D}),G=(0,r.useRef)(),H=G.current?G.current.getBoundingClientRect().width:0,q=Math.max(H,255),W=0===d.length;return o().createElement(o().Fragment,null,o().createElement(c.TextField,{label:E,ref:G,InputProps:{startAdornment:W&&!t?null:o().createElement("div",{className:a()(T.inputText,n.inputText)},W?o().createElement("div",null,t):o().createElement(b,S({},m,{list:z}))),classes:{root:T.inputRoot,input:a()(T.input,n.input,{[T.emptyInput]:W&&!t}),disabled:a()(T.disabledInput,{[T.disabledPointer]:h}),underline:T.disabledUnderline},endAdornment:o().createElement(f.Z,{size:"L",icon:u.Z,iconClassName:a()(T.icon,{[T["popup-opened-icon"]]:N}),disabled:h}),readOnly:!0,disabled:!0,disableUnderline:W&&!g},inputProps:{tabIndex:-1},InputLabelProps:{classes:{root:a()(T.inputLabel,n.label)}},value:"",onClick:h?void 0:_,classes:{root:a()(T.root,n.root)},margin:"dense",variant:"filled",disabled:h,"data-reltio-id":w}),o().createElement(y.Z,{open:N,anchorEl:G.current,onClose:D,onSearch:k,title:C,containerWidth:q,containerHeight:355,searchInputOnKeyDown:F,transformOrigin:{horizontal:"left",vertical:"top"},anchorOrigin:{horizontal:"left",vertical:"bottom"},PaperProps:{"data-reltio-id":`${w}-popup`}},o().createElement(R,{items:U,onItemClick:Z,selectedItems:d,width:q,height:245,focusIndex:M})))}));L.displayName="MetadataTypesSelector"},57304:(e,t,n)=>{n.d(t,{Z:()=>v});var r=n(24328),o=n.n(r),i=n(13980),a=n.n(i),l=n(71153),s=n.n(l),c=n(52730),u=n(17440),d=n(94079),p=n(87918),m=n.n(p),h=n(99493),g=n(87638),b=n(53180),f=n(68439);const y=(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:a}=e;const l=y({classes:a}),p=(0,c.useSelector)(g.ZP.selectors.getMetadata),x=(0,r.useCallback)((()=>{navigator.clipboard.writeText((0,h.BTI)(n))}),[n]);if((0,u.isNil)(n))return null;const v=(0,h.idV)(n.label),E=n.secondaryLabel,w=(0,h.ptG)(p,n),C=(0,h.Fn9)(n),T=n.uri,R=(0,h.BTI)(n);return o().createElement("div",{className:s()(l.profileBandWrapper,t)},o().createElement("div",{className:s()(l.profileBand,{[l.inactive]:!C}),"data-entity-uri":T},o().createElement(b.Z,{key:n.uri,entity:n,avatarClassName:l.profileIcon,imageClassName:l.imageProfileIcon}),o().createElement("div",{className:l.profileInfo},o().createElement("div",null,o().createElement(d.Typography,{variant:"h6",className:l.label},v),E&&o().createElement(d.Typography,{variant:"subtitle2",className:l.secondaryLabel},E),w&&o().createElement(d.Typography,{variant:"subtitle1",className:l.businessCard},w)),o().createElement("div",{className:l.specialInfo},o().createElement("div",{className:l.entityType},o().createElement(f.Z,{entity:n,size:"medium",className:l.badge}),!(0,h.ZiX)(T)&&o().createElement(d.Tooltip,{title:m().text("Copy to clipboard")},o().createElement(d.Typography,{display:"inline",variant:"body2",className:l.entityId,onClick:x},m().text("Entity ID"),": ",R))))),i&&o().createElement("div",null,i)))};x.propTypes={className:a().string,entity:a().object,children:a().node,classes:a().object};const v=x},32371:(e,t,n)=>{n.d(t,{U:()=>c});var r=n(24328),o=n.n(r),i=n(87918),a=n.n(i),l=n(99493),s=n(42520);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 o().createElement(s.S,{items:g,selectedItemsUris:n,single:i,placeholder:c,enableEmptyValueUnderline:u,onChange:d,classes:p,ListLabelProps:m,disabled:h,label:a().text("Relation type"),dataReltioId:"relation-type-selector",selectionPopupTitle:a().text("Select relation types")})}));c.displayName="RelationTypesSelector"},39827:(e,t,n)=>{n.d(t,{G:()=>m});var r=n(24328),o=n.n(r),i=n(71153),a=n.n(i),l=n(8818),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,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(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)&&(o[n]=e[n])}return o}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 o().createElement("div",{className:a()(c.container,r)},t.map((e=>{let{id:t}=e,r=p(e,["id"]);return o().createElement(l.k,d({},r,{classes:g,size:"S",key:t,className:a()({[a()(c.active,m)]:n===t},c.buttonWrapper,h),onClick:()=>i(t),"data-reltio-id":`reltio-profile-right-side-button-${t}`}))})))}},52043:(e,t,n)=>{n.d(t,{h:()=>a});var r=n(24328),o=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})}}))),a=e=>{let{width:t,open:n,children:r}=e;const a=i();return o().createElement("div",{className:a.contentWrapper,style:{width:`${n?t:0}px`}},n&&o().createElement(o().Fragment,null,r))}},8962:(e,t,n)=>{n.d(t,{Z:()=>_});var r=n(52730),o=n(87638),i=n(24328),a=n.n(i),l=n(99493),s=n(71153),c=n.n(s),u=n(87918),d=n.n(u),p=n(94079),m=n(60995),h=n(10237),g=n(93416),b=n(80931),f=n(8261),y=n(79692);const x=(0,y.Z)({attributesContainer:{padding:"0 16px 16px 16px"},header:{marginBottom:"4px"},noCaption:{paddingTop:"16px"},noData:{fontSize:"13px",color:"rgba(0,0,0,0.54)"}}),v=(0,r.connect)((e=>({metadata:o.ZP.selectors.getMetadata(e)})))((e=>{let{className:t,entity:n={},metadata:s,caption:u="",excludeUris:y=[],includeUris:v=[],attributesCount:E=16}=e;const w=x(),C=(0,r.useSelector)(o.ZP.selectors.getPivotingAttributes),T=(0,i.useMemo)((()=>(0,f.U)(s,n.type,v,y)),[y,v,s,n.type]),R=(0,l.fyF)(T,n).filter((e=>{let{values:t}=e;return!(0,l.O27)(t)})).length>0;return R||!(0,l.O27)(u)?a().createElement(m.J.Provider,{value:C},a().createElement(h.Z,{className:t},u&&a().createElement(g.Z,{className:w.header,title:u}),a().createElement(p.Box,{className:c()(w.attributesContainer,{[w.noCaption]:!u})},R?a().createElement(b.Z,{entity:n,attrTypes:T,parentUri:n.uri,drawLines:!1,max:E}):a().createElement(p.Typography,{className:w.noData},d().text("No data found"))))):null}));var E=n(17440),w=n(91262),C=n(39450),T=n(66784);const R=(0,y.Z)({attributesContainer:{padding:"0 16px 16px 16px"},header:{marginBottom:"4px"},noCaption:{paddingTop:"16px"}});function O(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}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=(0,r.connect)((e=>({metadata:o.ZP.selectors.getMetadata(e)})))((e=>{let{className:t,entity:n={},mode:s,metadata:u,caption:d="",excludeUris:m=[],includeUris:b=[],pinnedAttributes:y}=e;const x=R(),v=(0,r.useDispatch)(),S=(0,i.useContext)(C.m),P=(0,r.useSelector)(o.ZP.selectors.getUserRoles),N=(0,i.useMemo)((()=>(0,l.mC3)(y,P)),[y,P]),L=(0,r.useSelector)((e=>o.ZP.selectors.getModifiedEntity(e,n.uri)||{})),_=(0,i.useMemo)((()=>(0,f.U)(u,L.type,b,m)),[m,b,u,L.type]),j=(0,i.useCallback)((e=>(0,E.pipe)(o.N5.actions.addAttributes,v)(e.map((e=>O({},e,{viewId:S}))))),[S,v]),I=(0,i.useCallback)((e=>(0,E.pipe)(o.N5.actions.modifyAttribute,v)(O({},e,{viewId:S}))),[S,v]),k=(0,i.useCallback)((e=>(0,E.pipe)(o.N5.actions.removeAttribute,v)(O({},e,{viewId:S}))),[S,v]);return a().createElement(h.Z,{className:t},d&&a().createElement(g.Z,{className:x.header,title:d}),a().createElement(p.Box,{className:c()(x.attributesContainer,{[x.noCaption]:!d})},a().createElement(T.c.Provider,{value:N},a().createElement(w.Z,{entity:L,attrTypes:_,parentUri:L.uri,drawLines:!1,mode:s,showEmptyEditors:(0,l.ZiX)(L.uri),crosswalks:L.crosswalks,onAddAttributes:j,onChangeAttribute:I,onDeleteAttribute:k}))))}));var N=n(3185);function L(){return L=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},L.apply(this,arguments)}const _=(0,r.connect)(((e,t)=>({entity:t.entity||o.ZP.selectors.getEntityWithDiff(e),mode:t.mode||o.ZP.selectors.getMode(e)})))((e=>{let{mode:t=l.ARY.Viewing,attributesCount:n,pinnedAttributes:r,entity:o}=e,i=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(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)&&(o[n]=e[n])}return o}(e,["mode","attributesCount","pinnedAttributes","entity"]);return a().createElement(N.u.Provider,{value:o},(0,l.uzs)(t)?a().createElement(v,L({attributesCount:n,entity:o},i)):a().createElement(P,L({mode:t,pinnedAttributes:r,entity:o},i)))}))},27185:(e,t,n)=>{n.d(t,{Z:()=>T});var r=n(24328),o=n.n(r),i=n(13980),a=n.n(i),l=n(87918),s=n.n(l),c=n(17440),u=n(71153),d=n.n(u),p=n(94079);const m=(0,n(79692).Z)({container:{display:"flex",alignItems:"center",height:"32px",minHeight:"32px",padding:0},text:{display:"flex",width:"calc(100% - 68px)"},textItem:{fontSize:"13px",lineHeight:"15px",marginRight:10},primaryTextItem:{flex:"1 0",flexBasis:0,maxWidth:"50%",overflow:"hidden",textOverflow:"ellipsis"},secondaryTextItem:{flex:"1 0",flexBasis:0,overflow:"hidden",textOverflow:"ellipsis"},icons:{transform:"scale(0.5)",position:"relative",flexShrink:0,width:"68px",bottom:"10px"},iconTop:{position:"absolute",top:0,left:0,zIndex:1},iconBottom:{position:"absolute",top:0,left:26,zIndex:0}});var h=n(31254),g=n(88611);function b(){return b=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},b.apply(this,arguments)}const f=e=>{let{innerRef:t,innerProps:n,selectOption:r,data:i}=e;const a=m(),{value:l,label:s,startObject:c,endObject:u}=i,f=c.objectType.label+" ↔ "+u.objectType.label;return o().createElement(p.MenuItem,b({className:a.container,ref:t,key:l,onClick:()=>r({label:s,value:l,startObject:c,endObject:u})},n),o().createElement("div",{className:a.icons},o().createElement(h.Z,{className:a.iconTop,entityType:c.objectType}),o().createElement(h.Z,{className:a.iconBottom,entityType:u.objectType})),o().createElement("div",{className:a.text},o().createElement(g.C,{value:s},o().createElement(p.Typography,{className:d()(a.textItem,a.primaryTextItem)},s)),o().createElement(g.C,{value:f},o().createElement(p.Typography,{color:"textSecondary",className:d()(a.textItem,a.secondaryTextItem)},f))))};f.propTypes={innerRef:a().oneOfType([a().oneOf([null]),a().func,a().shape({current:a().any.isRequired})]),innerProps:a().object.isRequired,selectOption:a().func.isRequired,data:a().shape({value:a().string.isRequired,label:a().string.isRequired,startObject:a().object,endObject:a().object})};const y=f;var x=n(24737);function v(){return v=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},v.apply(this,arguments)}function E(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const w=e=>{let{value:t={},options:n=[],onChange:i=c.identity,TextFieldProps:a}=e,l=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(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)&&(o[n]=e[n])}return o}(e,["value","options","onChange","TextFieldProps"]);const u=(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){E(e,t,n[t])}))}return e}({},(0,c.defaultTo)({},a),{"data-reltio-id":"relation-type-selector"})),[a]);return o().createElement(x.Z,v({value:t,options:n,onChange:i,label:s().text("Select relationship type "),components:{Option:y},TextFieldProps:u},l))},C=a().shape({label:a().string.isRequired,value:a().string.isRequired,startObject:a().object,endObject:a().object});w.propTypes={value:C,options:a().arrayOf(C),onChange:a().func};const T=w},78620:(e,t,n)=>{n.d(t,{R:()=>u});var r=n(24328),o=n(99493),i=n(17440),a=n(52730),l=n(87638);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=e=>{let{connection:t,onConnectionChange:n,relatedEntity:c}=e;const u=(0,a.useSelector)(l.ZP.selectors.getMetadata),d=(0,r.useCallback)((e=>n(s({},t,{relation:e}))),[t,n]),p=(0,r.useCallback)((0,i.pipe)((0,o.zE1)(t.relation),d),[t.relation,d]),m=(0,r.useCallback)((0,i.pipe)((0,o.lIv)(t.relation),d),[t.relation,d]),h=(0,r.useCallback)((0,i.pipe)((0,o.Ilm)(t.relation),d),[t.relation,d]),g=(0,r.useCallback)((e=>{let{type:r,direction:i}=e;const a={entity:t.entity&&(0,o.eHk)(i===o.Nsj.OUT,t.entity,c,u,(0,o.V3K)(u,r))?t.entity:null,relation:s({},t.relation,{attributes:{},type:r,direction:i})};n(a)}),[t,n,c,u]);return{onAddAttributes:p,onChangeAttribute:m,onRemoveAttribute:h,onChangeEntity:(0,r.useCallback)((e=>n(s({},t,{entity:e}))),[t,n]),onChangeRelationType:g}}},89846:(e,t,n)=>{n.d(t,{n:()=>a});var r=n(24328),o=n(99493),i=n(17440);const a=e=>{let{reversedContextLabels:t}=e;return{getRelationTypesOptions:(0,r.useCallback)(((e,n)=>{const r={},a=(0,i.pipe)(o.PjQ,(0,i.tap)((e=>r[e]=(0,i.propOr)(0,e,r)+1))),l=(0,i.ascend)((0,i.prop)("label")),s=(0,i.curry)(((e,n)=>{let{uri:r,label:i,startObject:l,endObject:s}=n;const c=e===(t?o.Nsj.OUT:o.Nsj.IN)?l:s;return{label:{directionalLabel:a(c),typeLabel:i},value:`${r},${e}`,startObject:l,endObject:s}}));return e.map(s(o.Nsj.IN)).concat(n.map(s(o.Nsj.OUT))).map((0,i.evolve)({label:e=>{let{directionalLabel:t,typeLabel:n}=e;return t?r[t]>1?`${t} (${n})`:t:n}})).sort(l)}),[t]),fromEditorValue:(0,r.useCallback)(((e,t)=>n=>{const[r,a]=n.value.split(",");return{type:(a===o.Nsj.IN?e:t).find((0,i.propEq)("uri",r)),direction:a}}),[]),toEditorValue:(0,r.useCallback)(((e,t)=>t.find((0,i.propEq)("value",`${e.relationType},${e.direction}`))),[])}}},12274:(e,t,n)=>{n.r(t),n.d(t,{default:()=>kn});var r=n(24328),o=n.n(r),i=n(52730),a=n(36138),l=n(585),s=n(22664),c=n(52844),u=n(87638),d=n(99136),p=n(98996),m=n(17440),h=n(99493),g=n(87918),b=n.n(g),f=n(60715),y=n(35174);function x(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){v(e,t,n[t])}))}return e}function v(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const E=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,m.either)((0,m.pipe)(h.nqN,(0,m.equals)(e)),(0,m.pipe)(h.j5q,(0,m.equals)(e))));n.push(...r);const o=(0,m.pipe)(w,(0,m.without)([e]))(r);return o.forEach((e=>E(e,t,n))),n},w=e=>(0,m.pipe)((0,m.chain)((e=>[(0,h.nqN)(e),(0,h.j5q)(e)])),m.uniq)(e),C=(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}--${e.direction}`)}));const o=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,o,a]=e.split("--");i.push({from:t,to:n,key:r,relationTypeUri:o,direction:a})})),{nodes:o,edges:i}})(t);n.nodes.forEach((t=>{e.hasNode(t.id)||e.addNode(t.id,{label:(0,h.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,direction:t.direction})}))},T=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const r=t.neighbors(e).filter((e=>!n.includes(e)));return n.push(...r),r.forEach((e=>T(e,t,n))),n};var R=n(67218);const O=e=>{const[t,n]=(0,r.useState)(null),[o,a]=(0,r.useState)(null),l=(0,i.useDispatch)(),[s,c]=(0,r.useState)(null),[d,g]=(0,r.useState)(!1),v=null==e?void 0:e.uri,O=(0,h.biM)(e),S=(0,i.useSelector)(u.ZP.selectors.getMetadata),P=(0,R._)(),N=(0,r.useCallback)((function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return P((0,h.ZYI)({uri:e,deep:n,limitCreditsConsumption:!0,graphTypes:t?[(0,h.nIW)(t)]:null,activenessDate:null,max:t?200:3e3}))}),[t,P]);(0,r.useEffect)((()=>(!v||(0,h.ZiX)(v)||O||(g(!0),(0,h.ZYI)({uri:v,deep:t?2:1,limitCreditsConsumption:!0,graphTypes:t?[(0,h.nIW)(t)]:null,activenessDate:null,max:t?200:3e3}).then((e=>{const t=new p.MultiGraph;C(t,e),a(t),c(e)})).catch((e=>{console.error(e),c(null),l(u.ui.actions.errorSet((0,h.xU7)(e,b().text("Something went wrong"))))})).finally((()=>{g(!1)}))),()=>{a(null),c(null),g(!1)})),[v,O,l,t]);const L=(0,r.useCallback)((e=>{let{startEntityUri:t,endEntityUri:n,relationType:r,attributes:i,startDate:a,endDate:d}=e;return g(!0),(0,h.DsR)({startEntityUri:t,endEntityUri:n,relationType:r,attributes:i,startDate:a,endDate:d}).then((e=>{var t;if(null==e||null===(t=e[0])||void 0===t||!t.successful)throw null==e?void 0:e[0];const n=e[0].object,r=((e,t,n)=>{const r=t.startObject.objectURI,o=t.endObject.objectURI,i=[r,o],a=e.entities.map((0,m.prop)("uri")),l=(0,h.V3K)(n,t.type),s=i.find((e=>!(0,m.includes)(e,a))),c=s&&(t.startObject.objectURI===s?t.startObject:t.endObject),u=c&&{type:c.type,label:c.label,uri:c.objectURI,traversedRelations:0,untraversedRelations:1},d=x({},(0,m.pick)(["uri","type","attributes","startDate","endDate","crosswalks","direction"],t),{startObject:(0,m.pick)(["objectURI","directionalLabel"],t.startObject),endObject:(0,m.pick)(["objectURI","directionalLabel"],t.endObject),direction:null==l?void 0:l.direction});return{entities:(u?e.entities.concat([u]):e.entities).map((e=>e.uri===r||e.uri===o?x({},e,{traversedRelations:e.traversedRelations+1}):e)),relations:e.relations.concat([d])}})(s,n,S);C(o,r);const i=[n.startObject.objectURI,n.endObject.objectURI],a=s.entities.map((0,m.prop)("uri"));i.map((e=>{if(a.includes(e)){const t=o.getNodeAttribute(e,"traversedRelationsCount");o.setNodeAttribute(e,"traversedRelationsCount",t+1)}})),c(r)})).catch((e=>{throw l(u.ui.actions.errorSet((0,h.xU7)(e,b().text("Something went wrong")))),e})).finally((()=>{g(!1)}))}),[l,s,o,S]),_=(0,r.useCallback)((e=>{g(!0),(0,h.VGk)(e).then((()=>{o.extremities(e).map((e=>{const t=o.getNodeAttribute(e,"traversedRelationsCount");o.setNodeAttribute(e,"traversedRelationsCount",t-1)})),o.dropEdge(e);const{updatedData:t,removedEntitiesUris:n}=((e,t,n,r)=>{const o=r.relations.find((0,m.propEq)("uri",t)),i=(0,h.nqN)(o),a=(0,h.j5q)(o),l=(0,y.toUndirected)(n),s=(0,m.cond)([[()=>!(0,f.Ar)(l,e,i),(0,m.always)(i)],[()=>!(0,f.Ar)(l,e,a),(0,m.always)(a)],[m.T,(0,m.always)(null)]])(),c=(0,m.evolve)({entities:(0,m.map)((e=>e.uri===i||e.uri===a?x({},e,{traversedRelations:e.traversedRelations-1}):e)),relations:(0,m.reject)((0,m.propEq)("uri",t))})(r),{updatedData:u,removedEntitiesUris:d}=s?((e,t)=>{const n=E(e,t),r=(0,m.pipe)(w,(0,m.append)(e),m.uniq)(n);return{updatedData:(0,m.evolve)({relations:(0,m.reject)((e=>n.includes(e))),entities:(0,m.reject)((e=>r.includes(e.uri)))})(t),removedEntitiesUris:r}})(s,c):{updatedData:c,removedEntitiesUris:[]};return{updatedData:u,removedEntitiesUris:d}})(v,e,o,s);((e,t)=>{(t||[]).forEach((t=>{e.dropNode(t)}))})(o,n),c(t)})).catch((e=>{l(u.ui.actions.errorSet((0,h.xU7)(e,b().text("Something went wrong"))))})).finally((()=>{g(!1)}))}),[l,o,v,s]),j=(0,r.useCallback)(((e,t)=>{const{nodes:n=[]}=t,r=(0,m.difference)(o.neighbors(e),n);((e,t,n,r)=>{const o=(0,y.toUndirected)(r),i=(e,t)=>{o.filterEdges(e,t,(e=>!!e)).forEach((e=>o.dropEdge(e)))};n.forEach((e=>{i(t,e),o.forEachNeighbor(e,(t=>{i(e,t)}))}));const a=[];return o.nodes().forEach((t=>{((e,t,n)=>(0,f.Ar)(e,t,n)?null:n)(o,e,t)&&a.push(t)})),(0,m.uniq)(a.reduce(((e,t)=>T(t,o,e)),[...a]))})(v,e,r,o).forEach((t=>{t!==v&&t!==e&&o.setNodeAttribute(t,"hidden",!0)}))}),[v,o]),I=(0,r.useCallback)((e=>{if(e&&!(0,h.ZiX)(e)&&!O){const t=o.getNodeAttribute(e,"untraversedRelationsCount");o.neighbors(e).forEach((e=>{o.setNodeAttribute(e,"hidden",!1)})),t>0&&(g(!0),N(e).then((t=>{const n=((e,t,n)=>{const{entities:r=[],relations:o=[]}=t;return{entities:r.reduce(((e,t)=>{if(e.some((e=>{let{uri:n}=e;return n===t.uri}))){if(t.uri===n){const r=e.findIndex((e=>{let{uri:t}=e;return t===n}));e[r]=x({},e[r],{traversedRelations:t.traversedRelations,untraversedRelations:t.untraversedRelations})}}else e.push(t);return e}),[...e.entities||[]]),relations:o.reduce(((e,t)=>(e.some((e=>{let{uri:n}=e;return n===t.uri}))||e.push(t),e)),[...e.relations||[]])}})(s,t,e);C(o,t);const r=t.entities.find((t=>t.uri===e));o.setNodeAttribute(e,"untraversedRelationsCount",r.untraversedRelations),o.setNodeAttribute(e,"traversedRelationsCount",r.traversedRelations),c(n)})).catch((e=>{console.error(e),l(u.ui.actions.errorSet((0,h.xU7)(e,b().text("Something went wrong"))))})).finally((()=>{g(!1)})))}}),[s,l,o,O,N]);return{graphLoading:d,data:s,graphologyGraph:o,graphTypeUri:t,setGraphTypeUri:n,onAddRelation:L,onDeleteRelation:_,onCollapseEntity:j,onExpandEntity:I}};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)=>{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){S(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},N=[25,50,100];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 _=(e,t,n)=>{const{startObject:r,endObject:o,type:i}=t,{directionalLabel:a}=(0,h.nqN)(t)===n?r:o;return a||(0,h.Lmx)(e,i)},j=e=>{let{data:t,selectedEntityUri:n,mainEntityUri:o,graphTypeUri:a}=e;const[l,s]=(0,r.useState)({field:"",order:"asc"}),[c,d]=(0,r.useState)(0),[p,g]=(0,r.useState)(N[0]),[f,y]=(0,r.useState)([]),[x,v]=(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,m.zipObj)(e.map((0,m.prop)("uri")),e)}),[null==t?void 0:t.entities]),T=(0,r.useMemo)((()=>(0,m.pipe)((0,m.filter)((0,m.either)((0,m.pipe)(h.nqN,(0,m.equals)(n)),(0,m.pipe)(h.j5q,(0,m.equals)(n)))),(0,m.uniqBy)((0,m.prop)("uri")),(0,m.map)((e=>{const t=C[((e,t)=>{const n=(0,h.nqN)(t),r=(0,h.j5q)(t);return n===e?r:n})(n,e)];return{relation:e,entity:t,entityLabel:(0,h.idV)(t.label),entityTypeLabel:(0,h.jFi)(w,t),relationTypeLabel:_(w,e,t.uri)}})))((null==t?void 0:t.relations)||[])),[t,n,C,w]),{searchText:R,onChangeSearchText:O,filters:S,onFilter:P,relationTypesOptions:j,entityTypesOptions:I}=(e=>{const[t,n]=(0,r.useState)(""),[o,a]=(0,r.useState)({entityTypesUris:[],relationTypesUris:[]}),l=(0,i.useSelector)(u.ZP.selectors.getMetadata),s=(0,r.useMemo)((()=>(0,m.pipe)((0,m.map)((e=>{let{entity:t}=e;return t.type})),(0,m.concat)(m.__,o.entityTypesUris),m.uniq,(0,m.map)((0,h.nt9)(l)))(e)),[e,l,o.entityTypesUris]),c=(0,r.useMemo)((()=>(0,m.pipe)((0,m.map)((e=>{let{relation:t}=e;return t.type})),(0,m.concat)(m.__,o.relationTypesUris),m.uniq,(0,m.map)((0,h.V3K)(l)))(e)),[e,l,o.relationTypesUris]);return{searchText:t,onChangeSearchText:n,filters:o,onFilter:a,entityTypesOptions:s,relationTypesOptions:c}})(T),k=(0,r.useMemo)((()=>(0,m.pipe)((0,m.filter)((e=>{let{entityLabel:t,entity:n,relation:r}=e;const{entityTypesUris:o,relationTypesUris:i}=S;return h.P6Y.strings.search(t,R)&&(0,m.ifElse)((0,m.prop)("length"),(0,m.includes)(r.type),m.T)(i)&&(0,m.ifElse)((0,m.prop)("length"),(0,m.includes)(n.type),m.T)(o)})),l.field?(0,m.sort)(((e,t)=>h.P6Y.strings.sort(l.order,e[l.field],t[l.field]))):m.identity)(T)),[T,l,R,S]),A=(0,r.useMemo)((()=>k.slice(c*p,c*p+p)),[k,c,p]),D=(0,r.useCallback)((e=>{v(!0),(0,h._vs)(e).then((e=>{y((t=>[...t,{initialRelation:e,relation:e}]))})).catch((e=>{E(u.ui.actions.errorSet((0,h.xU7)(e,b().text("Can't load relationship's attributes"))))})).finally((()=>v(!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){L(e,t,n[t])}))}return e}({},t,{relation:e}):t))))}),[]);(0,r.useEffect)((()=>{d(0),O("")}),[n,a,O,P]),(0,r.useEffect)((()=>{P({entityTypesUris:[],relationTypesUris:[]})}),[a,o,P]),(0,r.useEffect)((()=>{d(0)}),[l,R,S]);const z=(0,r.useCallback)((e=>{y((t=>t.filter((t=>t.relation.uri!==e))))}),[]),Z=(0,r.useCallback)(((e,t)=>{v(!0),(0,h.HH7)({oldRelation:e,newRelation:t}).then((()=>{z(t.uri)})).catch((e=>{E(u.ui.actions.errorSet((0,h.xU7)(e,b().text("Can't edit relationship"))))})).finally((()=>v(!1)))}),[z,E]);return{rowsData:A,onSort:s,sorting:l,searchText:R,onChangeSearchText:O,filters:S,onFilter:P,entityTypesOptions:I,relationTypesOptions:j,editingRelations:f,onStartRelationEditing:D,onCancelRelationEditing:z,onUpdateEditingRelation:U,total:k.length,page:c,rowsPerPage:p,onPageChange:d,onRowsPerPageChange:g,onSaveEditingRelation:Z,loading:x}},I=o().createContext({graphLoading:!1,data:null,graphologyGraph:null,selectedEntityLoading:!1,selectedEntity:null,onEntitySelect:()=>{},relationshipTable:{},onCollapseEntity:()=>{},onExpandEntity:()=>{}});I.displayName="GraphStateContext";var k=n(71153),A=n.n(k),D=n(57304),U=n(19603),z=n(94646),Z=n(94079),B=n(79692);const M=(0,B.Z)({comments:{display:"flex",justifyContent:"flex-end",marginTop:"10px"}}),F=(0,r.memo)((e=>{let{className:t}=e;const n=M(),r=(0,i.useSelector)(u.ZP.selectors.getEntity),a=(0,i.useSelector)(u.ZP.selectors.getEntityUriWithDataTenant);return o().createElement(D.Z,{className:A()(t,U.U),entity:r},o().createElement(Z.Box,{className:n.comments},o().createElement(z.Z,{uri:a,relatedObjectUris:(0,h.wp9)(h.q7e.ENTITY,{entityUri:a}),objectType:h.q7e.ENTITY})))}));F.displayName="GraphProfileBand";const G=F;var H=n(52043),q=n(39827),W=n(82726);const V=(0,B.Z)({wrapper:{display:"flex",overflow:"hidden",marginLeft:"auto",flexShrink:0}});function Y(){return Y=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},Y.apply(this,arguments)}const $=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(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)&&(o[n]=e[n])}return o}(e,["styles"]);return o().createElement("svg",Y({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),o().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 X=n(48852);const K=(0,X.l)(I,(0,m.pick)(["selectedEntity"]),(e=>{let{selectedEntity:t}=e;return o().createElement(D.Z,{entity:t})}));var Q=n(8962);const J=(0,B.Z)({noShadowBlock:{boxShadow:"none"},wrapper:{position:"relative",paddingRight:"1px",overflow:"auto"}}),ee=(0,X.l)(I,(0,m.pick)(["selectedEntity","selectedEntityLoading"]),(e=>{let{selectedEntity:t,selectedEntityLoading:n}=e;const r=J();return o().createElement("div",{className:r.wrapper},n&&o().createElement(d.Z,null),o().createElement(Q.Z,{entity:t,caption:b().text("Entity details"),className:r.noShadowBlock}))}));var te=n(58662),ne=n(44443),re=n(30739),oe=n(31276);const ie="1px solid rgba(0, 0, 0, 0.05)",ae=(0,B.Z)({table:{flex:1,height:"100%",display:"flex",flexDirection:"column",overflow:"hidden"},tableBody:{height:"100%",overflow:"auto"},tableBodyWrapper:{height:"100%",overflow:"hidden"},tableRowWrapper:{borderBottom:ie},tableRow:{display:"flex",alignItems:"center","& > div":{flexShrink:0}},editingRow:{paddingTop:"8px"},headRow:{borderBottom:ie}});function le(){return le=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},le.apply(this,arguments)}const se=(0,r.memo)((e=>{let{columnsData:t,sorting:n,onSort:r}=e;const i=ae();return o().createElement("div",{className:A()(i.tableRow,i.headRow)},t.map((e=>{const{id:t,sortable:i,headCellRenderer:a,columnClassName:l}=e,s=a,c=i?{sortField:n.field,sortOrder:n.order,sortHandler:()=>{r({field:t,order:n.field===t?(0,oe.Dh)(n.order):"asc"})}}:{};return o().createElement("div",{key:t,className:l},o().createElement(s,le({headCellData:e},c)))})))})),ce=(0,r.forwardRef)(((e,t)=>{let{classes:n,columnsData:i,rowsData:a,sorting:l,onSort:s,getRowKey:c,ExpandedRowRenderer:u,defaultRowHeight:d}=e;const p=ae(),[m,h]=(0,r.useState)({width:0,height:0}),g=(0,r.useCallback)((e=>{let{data:t,index:r}=e;const a=t[r];return o().createElement("div",{className:A()(p.tableRowWrapper,null==n?void 0:n.tableRowWrapper)},o().createElement("div",{className:A()(p.tableRow,null==n?void 0:n.tableRow,{[p.editingRow]:a.expanded})},i.map((e=>{let{id:t,rowCellValueRenderer:n,columnClassName:r}=e;const i=n;return o().createElement("div",{key:t,className:r},o().createElement(i,{value:a[t],rowValue:a}))}))),a.expanded&&u&&o().createElement(u,{open:a.expanded,rowValue:a}))}),[i,u]),b=(0,r.useCallback)(((e,t)=>{h({width:e,height:t})}),[]),f=(0,r.useRef)(null);return(0,r.useImperativeHandle)(t,(()=>({resetScrollbarPosition:()=>{var e;null===(e=f.current)||void 0===e||e.scrollTo(0)}}))),o().createElement("div",{className:p.table},o().createElement(se,{columnsData:i,sorting:l,onSort:s}),o().createElement("div",{className:p.tableBodyWrapper},o().createElement(ne.Z,{handleHeight:!0,handleWidth:!0,onResize:b}),o().createElement("div",{className:p.tableBody},o().createElement(re.Z,{listRef:f,width:m.width,height:m.height,data:a,defaultItemSize:d,itemKey:c,showNotMeasuredItems:!0},g))))})),ue=(0,r.memo)(ce);var de=n(92332),pe=n(88611);const me="rgba(238, 238, 238, 1)",he=(0,B.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:me}}});function ge(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const be={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"},fe=".collapsibleTableRow:hover &",ye=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){ge(e,t,n[t])}))}return e}({},be,{[fe]:{background:`linear-gradient(to right, rgba(238, 238, 238, 0), ${me} 100%)`}}),xe=(0,B.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":be},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":ye},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",[fe]:{visibility:"visible",background:me}},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 ve(){return ve=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},ve.apply(this,arguments)}function Ee(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){we(e,t,n[t])}))}return e}function we(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ce=e=>{let{className:t,headCellData:n}=e,r=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(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)&&(o[n]=e[n])}return o}(e,["className","headCellData"]);const i=xe();return o().createElement("div",{className:A()(i.headCell,t)},o().createElement(de.default,ve({},r,{headCellData:Ee({},n,{label:o().createElement(pe.C,{value:n.label},o().createElement("div",{className:i.headLabel},n.label))})})))},Te=(0,r.memo)((e=>{let{value:t="",tooltip:n,onClick:r,className:i}=e;const a=xe();return n=n||t,o().createElement(pe.C,{value:n},o().createElement("div",{className:A()(a.defaultCell,i,{[a.clickable]:!!r}),onClick:r},t))}));var Re=n(53180);const Oe=(0,X.l)(I,(e=>{let{onEntitySelect:t}=e;return{onClick:t}}),(e=>{let{value:t,rowValue:{entity:n},className:r,onClick:i}=e;const a=xe(),l=o().createElement(o().Fragment,null,o().createElement(Re.Z,{entity:n,avatarClassName:a.entityAvatar}),t);return o().createElement(Te,{value:l,tooltip:t,className:A()(a.profileCell,r),onClick:()=>i(n.uri)})}));var Se=n(78620),Pe=n(14363);const Ne=(0,X.l)(I,((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:a,onCancelRelationEditing:l,onSaveEditingRelation:s}=e;const c=(0,i.useDispatch)(),d=(0,i.useSelector)(u.ZP.selectors.getMetadata),{relation:p,initialRelation:g}=n,f=(0,r.useMemo)((()=>!(0,m.equals)(g,p)),[p,g]),y=xe(),x=(0,r.useCallback)((e=>{let{relation:t}=e;return a(t)}),[a]),v=(0,r.useCallback)((()=>l(p.uri)),[l,p.uri]),E=(0,r.useMemo)((()=>({relation:p})),[p]),{onAddAttributes:w,onChangeAttribute:C,onRemoveAttribute:T}=(0,Se.R)({connection:E,onConnectionChange:x});return t?o().createElement("div",{className:y.expandedRow},o().createElement(Pe.n,{connection:E,onAddAttributes:w,onChangeAttribute:C,onRemoveAttribute:T}),o().createElement("div",{className:y.actionButtons},o().createElement(Z.Button,{onClick:v},b().text("Cancel")),o().createElement(Z.Button,{color:"primary",disabled:!f,onClick:()=>{(e=>{const t=(0,h.xkB)(d,{relation:{object:e}});return c(u.N5.errors.actions.errorsSet(t)),0===t.length})(p)&&s(g,p)}},b().text("Save")))):null}));var Le=n(8818),_e=n(27604),je=n(22983),Ie=n(81137);const ke=(0,X.l)(I,(0,m.pick)(["onDeleteRelation"]),(e=>{let{uri:t,open:n,onClose:r,onDeleteRelation:i}=e;return o().createElement(Ie.Z,{open:n,title:b().text("Do you want to make a clean break?"),content:b().text("To end this relationship, click Delete Relationship. To keep the connection, click Cancel."),saveCaption:b().text("Delete relationship"),discardCaption:b().text("Cancel"),onDiscard:r,onSave:()=>{i(t),r()}})})),Ae=(0,r.memo)((e=>{let{uri:t}=e;const[n,i]=(0,r.useState)(!1),a=(0,r.useCallback)((()=>i(!0)),[]),l=(0,r.useCallback)((()=>i(!1)),[]);return o().createElement(o().Fragment,null,o().createElement(Le.k,{icon:je.Z,size:"XXS",tooltipTitle:b().text("Delete"),onClick:a}),o().createElement(ke,{open:n,onClose:l,uri:t}))}));Ae.displayName="DeleteRelationButton";const De=Ae,Ue=(0,X.l)(I,((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,type:n}},className:r,onEdit:a,isEditing:l}=e;const s=xe(),c=(0,i.useSelector)(u.ZP.selectors.getMetadata),d=(0,h.V3K)(c,n),p=(0,h.Z5t)(h.ARY.Editing,d),m=(0,h.Edd)(h.ARY.Editing,d);return o().createElement("div",{className:A()(s.controlsCell,r,{[s.editingMode]:l})},p&&o().createElement(Le.k,{className:A()(s.editButton,{[s.hidden]:l}),icon:_e.Z,size:"XXS",tooltipTitle:b().text("Edit"),onClick:()=>a(t)}),m&&o().createElement(De,{uri:t}))}));function ze(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 Be=(e,t)=>t[e].relation.uri||`${e}`,Me=(0,X.l)(I,(e=>{let{relationshipTable:t}=e;return ze({},t)}),(e=>{let{rowsData:t,sorting:n,onSort:i,total:a,page:l,rowsPerPage:s,onPageChange:c,onRowsPerPageChange:u,editingRelations:p,loading:m}=e;const h=he(),g=(0,r.useMemo)((()=>[{id:"entityLabel",label:b().text("Profile"),headCellRenderer:Ce,rowCellValueRenderer:Oe,sortable:!0,columnClassName:h.profileColumn},{id:"relationTypeLabel",label:b().text("Relationship type"),headCellRenderer:Ce,rowCellValueRenderer:Te,sortable:!0,columnClassName:h.relationshipTypeColumn},{id:"entityTypeLabel",label:b().text("Entity Type"),headCellRenderer:Ce,rowCellValueRenderer:Te,sortable:!0,columnClassName:h.entityTypeColumn},{id:"controls",label:"",headCellRenderer:Ce,rowCellValueRenderer:Ue}]),[h]),f=(0,r.useRef)(null);(0,r.useEffect)((()=>{var e;null===(e=f.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)}))?ze({},e,{expanded:!0}):e))),[t,p]),x=(0,r.useMemo)((()=>({tableRow:A()(h.row,"collapsibleTableRow")})),[h]);return o().createElement("div",{className:h.tableWithPagination},o().createElement("div",{className:h.tableContainer},o().createElement(ue,{ref:f,columnsData:g,rowsData:y,sorting:n,onSort:i,getRowKey:Be,ExpandedRowRenderer:Ne,defaultRowHeight:28,classes:x})),a>N[0]&&o().createElement(te.Z,{count:a,rowsPerPageOptions:N,rowsPerPage:s,onChangeRowsPerPage:u,page:l,onChangePage:c,basicTableRef:f}),m&&o().createElement(d.Z,null))}));var Fe=n(36444),Ge=n(94574);const He=(0,B.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}}}))),qe=(0,X.l)(I,(0,m.pipe)((0,m.prop)("relationshipTable"),(0,m.pick)(["searchText","onChangeSearchText"])),(e=>{let{searchText:t,onChangeSearchText:n}=e;const r=He();return o().createElement(Ge.Z,{fullWidth:!0,height:40,autofocus:!1,value:t,onSearch:n,placeholder:b().text("Search profiles"),classes:{input:r.input}})}));var We=n(59725),Ve=n(32371);const Ye=(0,B.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"}}))),$e=(0,X.l)(I,(0,m.pipe)((0,m.prop)("relationshipTable"),(0,m.pick)(["onFilter","filters","entityTypesOptions","relationTypesOptions"])),(e=>{let{open:t,onClose:n,filters:i,onFilter:a,entityTypesOptions:l,relationTypesOptions:s}=e;const c=Ye(),[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]),o().createElement(Z.Dialog,{classes:{paper:c.dialogPaper},onClose:h,open:t},o().createElement(Z.Typography,{className:c.title},b().text("Filter")),o().createElement(We.Q,{classes:{root:c.entityTypesSelector},entityTypes:l,selectedEntityTypes:u,enableEmptyValueUnderline:!0,onChange:d}),o().createElement(Ve.U,{classes:{root:c.relationTypesSelector},relationTypes:s,selectedRelationTypes:p,enableEmptyValueUnderline:!0,onChange:m}),o().createElement("div",{className:c.footer},o().createElement(Z.Button,{className:c.clearAllButton,onClick:()=>{d([]),m([])}},b().text("Clear All")),o().createElement(Z.Button,{className:c.cancelButton,onClick:h},b().text("Cancel")),o().createElement(Z.Button,{onClick:()=>{a({entityTypesUris:u,relationTypesUris:p}),n()},color:"primary"},b().text("Apply"))))})),Xe=(0,B.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,X.l)(I,(0,m.pipe)((0,m.prop)("relationshipTable"),(0,m.pick)(["filters"])),(e=>{let{filters:t}=e;const n=Xe(),[i,a]=(0,r.useState)(!1),{entityTypesUris:l,relationTypesUris:s}=t,c=l.length||s.length;return o().createElement("div",{className:n.wrapper},o().createElement(qe,null),o().createElement(Z.IconButton,{className:n.iconButton,onClick:()=>a(!0)},o().createElement(Fe.Z,{className:c?n.activeFiltersIcon:n.inactiveFiltersIcon})),o().createElement($e,{open:i,onClose:()=>a(!1)}))}));var Qe=n(65549),Je=n(98808);const et=e=>{const t=(0,i.useSelector)(u.ZP.selectors.getMetadata),{inRelations:n=[],outRelations:o=[]}=(0,r.useMemo)((()=>(0,h.UWq)(t,e,(0,h.d89)(h.ARY.Editing))),[t,e]);return{inRelationTypes:n,outRelationTypes:o}},tt=(0,B.Z)((e=>({dialogPaper:{height:"600px",maxWidth:"600px"},dialogTitle:{padding:"12px 16px"},titleText:{color:e.palette.text.primary,fontSize:"18px",letterSpacing:0,lineHeight:"21px",fontWeight:"bold"},content:{padding:"8px 16px 0px",borderBottom:"1px solid rgba(0, 0, 0, 0.12)"},attributeList:{paddingTop:"22px"}}))),nt=(0,X.l)(I,(e=>{let{selectedEntity:t,onAddRelation:n}=e;return{selectedEntity:t,onAddRelation:n}}),(e=>{let{selectedEntity:t,open:n,onClose:a,onAddRelation:l}=e;const s=tt(),c=(0,i.useSelector)(u.ZP.selectors.getMetadata),[d,p]=(0,r.useState)({}),{relation:m,entity:g}=d,{type:f,direction:y}=m||{},[x,v]=(0,r.useState)(!1),E=(0,i.useDispatch)();(0,r.useEffect)((()=>{n&&p({relation:{uri:(0,h.ncP)(),type:null,attributes:{}}})}),[n]);const{inRelationTypes:w,outRelationTypes:C}=et(t.type),T=(0,r.useCallback)((()=>{const e=(0,h.xkB)(c,{relation:{object:m}});return E(u.N5.errors.actions.errorsSet(e)),0===e.length}),[m,c,E]),{onAddAttributes:R,onChangeAttribute:O,onRemoveAttribute:S,onChangeEntity:P,onChangeRelationType:N}=(0,Se.R)({connection:d,onConnectionChange:p,relatedEntity:t});return o().createElement(Z.Dialog,{open:n,fullWidth:!0,maxWidth:"sm",onClose:a,classes:{paper:s.dialogPaper}},o().createElement(Z.DialogTitle,{disableTypography:!0,classes:{root:s.dialogTitle}},o().createElement(Z.Typography,{variant:"subtitle1",classes:{root:s.titleText}},b().text("Add relationship"))),o().createElement(Z.DialogContent,{classes:{root:s.content}},o().createElement(Pe.n,{connection:d,onAddAttributes:R,onChangeAttribute:O,onRemoveAttribute:S,relatedEntity:t,inRelationTypes:w,outRelationTypes:C,onChangeRelationType:N,onChangeEntity:P})),o().createElement(Z.DialogActions,null,o().createElement(Z.Button,{onClick:a},b().text("Cancel")),o().createElement(Z.Button,{disabled:!(null!=d&&d.entity)||!f||x,color:"primary",onClick:()=>{const{type:e,attributes:n={},startDate:r,endDate:o}=m,i=y===h.Nsj.OUT?t.uri:g.uri,s=y===h.Nsj.OUT?g.uri:t.uri;T()&&(v(!0),l({startEntityUri:i,endEntityUri:s,relationType:e,attributes:n,startDate:r,endDate:o}).then((()=>{a()})).catch((e=>{console.error(e)})).finally((()=>{v(!1)})))}},b().text("Add"))))})),rt=(0,X.l)(I,(0,m.pick)(["selectedEntity"]),(e=>{let{selectedEntity:t}=e;const{inRelationTypes:n,outRelationTypes:i}=et(t.type),a=n.length+i.length>0,[l,s]=(0,r.useState)(!1);return a&&o().createElement(o().Fragment,null,o().createElement(Je.K,{mode:Je.N.button,label:b().text("Add relationship"),icon:Qe.Z,onClick:()=>{s(!0)}}),o().createElement(nt,{open:l,onClose:()=>{s(!1)}}))})),ot=(0,B.Z)({caption:{marginLeft:"16px",marginTop:"12px",display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"14px",fontSize:"16px",lineHeight:"24px"},wrapper:{flex:1,display:"flex",flexDirection:"column",height:0}}),it=()=>{const e=ot();return o().createElement("div",{className:e.wrapper},o().createElement("div",{className:e.caption},o().createElement(Z.Typography,{variant:"subtitle1"},b().text("Relationships")),o().createElement(rt,null)),o().createElement(Ke,null),o().createElement(Me,null))};let at;!function(e){e[e.Relationship=0]="Relationship",e[e.EntityDetails=1]="EntityDetails"}(at||(at={}));const lt=(0,r.memo)((()=>{var e;const t=V(),[n,i]=(0,r.useState)(null),a=(0,r.useCallback)((e=>{i((t=>t===e?null:e))}),[]),l=null!==n,s=(0,r.useMemo)((()=>[{buttonProps:{id:at.Relationship,icon:$,tooltipTitle:b().text("Relationship")},content:o().createElement(it,null)},{buttonProps:{id:at.EntityDetails,icon:W.Z,tooltipTitle:b().text("Entity Details")},content:o().createElement(ee,null)}]),[]);return o().createElement("div",{className:t.wrapper},o().createElement(H.h,{open:l,width:480},o().createElement(K,null),null===(e=s[n])||void 0===e?void 0:e.content),o().createElement(q.G,{buttonsProps:(0,m.pluck)("buttonProps",s),onButtonClick:a,activeIndexId:n}))}));lt.displayName="GraphRightSidePanel";const st=lt;var ct=n(46339),ut=n(23304),dt=n(64488),pt=n(46680),mt=n.n(pt);const ht=(e,t,n)=>{var r;if(!t.label)return;const o=n.labelSize,i=n.labelFont,a=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=`${a} ${o}px ${i}`,e.fillText(t.label,t.x+t.size+11,t.y+o/3)},gt=(e,t,n)=>{const r=n.labelSize,o=n.labelFont,i=n.labelWeight;if(e.font=`${i} ${r}px ${o}`,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,o=Math.round(n+16),i=Math.round(r+2+4),a=Math.max(t.size,r/2)+2,l=Math.asin(i/2/a),s=Math.sqrt(Math.abs(Math.pow(a,2)-Math.pow(i/2,2)));e.beginPath(),e.moveTo(t.x+s,t.y+i/2),e.lineTo(t.x+a+o,t.y+i/2),e.lineTo(t.x+a+o,t.y-i/2),e.lineTo(t.x+s,t.y-i/2),e.arc(t.x,t.y,a,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,ht(e,t,n)};var bt=n(88586);class ft extends ut.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 o=1*n*5;if(t||!e.inPath)return r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,void(r[o++]=0);r[o++]=e.x,r[o++]=e.y,r[o++]=e.size,r[o++]=(0,bt.floatColor)(e.color),r[o]=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 yt{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:o,size:i}=e;const a=Math.min(128,i);let l=0,s=0;(o.width||0)>(o.height||0)?l=(o.width-o.height)/2:s=(o.height-o.width)/2,n.drawImage(o,l,s,i,i,r,0,a,a),this.images[t]={status:"ready",x:r,y:0,width:a,height:a},r+=a})),this.textureImage=n.getImageData(0,0,t.width,t.height),this.hasReceivedImages=!0,this.rebindTextureFns.forEach((e=>e()))}}}const xt={id:"defaultImage",path:(0,h.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 vt extends ut.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 yt,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(xt.id,xt.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 o=1*n*9;const i=e.image;let a=i&&this.imageLoader.images[i];if("string"!=typeof i||a||this.imageLoader.loadImage(i,i),t)return r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,void(r[o++]=0);if(r[o++]=e.x,r[o++]=e.y,r[o++]=e.size,r[o++]=(0,bt.floatColor)(e.color),r[o++]=e.inactive?1:0,a&&"ready"===a.status||(a=this.imageLoader.images[xt.id]),a&&"ready"===a.status){const{width:e,height:t}=this.imageLoader.textureImage;r[o++]=a.x/e,r[o++]=a.y/t,r[o++]=a.width/e,r[o++]=a.height/t}else r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=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 Et=[{id:"expandIcon",path:(0,h.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,h.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 wt extends ut.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 yt,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 o=e.getUniformLocation(this.program,"u_atlas");if(null===o)throw new Error("NodeButtonsProgram: error while getting atlasLocation");this.atlasLocation=o,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])),Et.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 o=2*n*11;const i=t||e.inactive&&!e.highlighted,[a,l]=e.buttonOffset||[0,0];let s=a*a+l*l,c=0,u=0;if(s&&(s=1/Math.sqrt(s),c=l*s,u=a*s),i||!e.showExpand)r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0;else{const t=this.imageLoader.images.expandIcon;if(r[o++]=e.x,r[o++]=e.y,r[o++]=e.size,r[o++]=(0,bt.floatColor)(e.color),r[o++]=e.buttonSize||0,r[o++]=c,r[o++]=-u,t&&"ready"===t.status){const{width:e,height:n}=this.imageLoader.textureImage;r[o++]=t.x/e,r[o++]=t.y/n,r[o++]=t.width/e,r[o++]=t.height/n}else r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0}if(i||!e.showCollapse)r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0;else{const t=this.imageLoader.images.collapseIcon;if(r[o++]=e.x,r[o++]=e.y,r[o++]=e.size,r[o++]=(0,bt.floatColor)(e.color),r[o++]=e.buttonSize||0,r[o++]=-c,r[o++]=-u,t&&"ready"===t.status){const{width:e,height:n}=this.imageLoader.textureImage;r[o++]=t.x/e,r[o++]=t.y/n,r[o++]=t.width/e,r[o++]=t.height/n}else r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=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))}}var Ct=n(23193),Tt=n.n(Ct);class Rt extends(Tt()){process(e,t,n,r,o){if(r){for(let e=27*o,t=e+27;e<t;e++)this.array[e]=0;return}const i=n.arrowSizeRatio||1,a=n.size*i||1,l=t.size||1,s=e.x,c=e.y,u=t.x,d=t.y,p=(0,bt.floatColor)(n.color),m=u-s,h=d-c;let g=m*m+h*h,b=0,f=0;g&&(g=1/Math.sqrt(g),b=-h*g*a,f=m*g*a);let y=27*o;const x=this.array;x[y++]=u,x[y++]=d,x[y++]=-b,x[y++]=-f,x[y++]=l,x[y++]=p,x[y++]=1,x[y++]=0,x[y++]=0,x[y++]=u,x[y++]=d,x[y++]=-b,x[y++]=-f,x[y++]=l,x[y++]=p,x[y++]=0,x[y++]=1,x[y++]=0,x[y++]=u,x[y++]=d,x[y++]=-b,x[y++]=-f,x[y++]=l,x[y++]=p,x[y++]=0,x[y++]=0,x[y]=1}}class Ot extends Rt{process(e,t,n,r,o){super.process(t,e,n,r,o)}}var St=n(73343),Pt=n.n(St);class Nt extends dt.AbstractEdgeProgram{constructor(e){super(e,"\nattribute vec4 a_color;\nattribute vec2 a_normal;\nattribute vec2 a_position;\nattribute float a_radius;\nattribute float a_arrowSizeRatio;\n\nuniform mat3 u_matrix;\nuniform float u_sqrtZoomRatio;\nuniform float u_correctionRatio;\n\nvarying vec4 v_color;\nvarying vec2 v_normal;\nvarying float v_thickness;\n\nconst float minThickness = 1.7;\nconst float bias = 255.0 / 254.0;\nconst float arrowHeadLengthThicknessRatio = 2.5;\n\nvoid main() {\n float normalLength = length(a_normal);\n vec2 unitNormal = a_normal / normalLength;\n\n // These first computations are taken from edge.vert.glsl. Please read it to\n // get better comments on what's happening:\n float pixelsThickness = max(normalLength, minThickness * u_sqrtZoomRatio);\n float webGLThickness = pixelsThickness * u_correctionRatio;\n float adaptedWebGLThickness = webGLThickness * u_sqrtZoomRatio;\n\n // our change - apply a_arrowSizeRatio depending on current zoom and minThickness\n float arrowSizeCoefficient = min(a_arrowSizeRatio, a_arrowSizeRatio / (u_sqrtZoomRatio * minThickness));\n\n // Here, we move the point to leave space for the arrow head:\n float direction = sign(a_radius);\n float adaptedWebGLNodeRadius = direction * a_radius * 2.0 * u_correctionRatio * u_sqrtZoomRatio;\n\n float adaptedWebGLArrowHeadLength = adaptedWebGLThickness * 2.0 * arrowHeadLengthThicknessRatio * arrowSizeCoefficient;\n\n\n vec2 compensationVector = vec2(-direction * unitNormal.y, direction * unitNormal.x) * (adaptedWebGLNodeRadius + adaptedWebGLArrowHeadLength);\n\n // Here is the proper position of the vertex\n gl_Position = vec4((u_matrix * vec3(a_position + unitNormal * adaptedWebGLThickness + compensationVector, 1)).xy, 0, 1);\n\n v_thickness = webGLThickness / u_sqrtZoomRatio;\n\n v_normal = unitNormal;\n v_color = a_color;\n v_color.a *= bias;\n}",Pt(),4,7),this.IndicesArray=void 0,this.indicesArray=void 0,this.indicesBuffer=void 0,this.indicesType=void 0,this.positionLocation=void 0,this.colorLocation=void 0,this.normalLocation=void 0,this.radiusLocation=void 0,this.arrowSizeRatioLocation=void 0,this.matrixLocation=void 0,this.sqrtZoomRatioLocation=void 0,this.correctionRatioLocation=void 0,this.canUse32BitsIndices=void 0;const t=e.createBuffer();if(null===t)throw new Error("EdgeClampedProgram: error while getting resolutionLocation");this.indicesBuffer=t,this.positionLocation=e.getAttribLocation(this.program,"a_position"),this.colorLocation=e.getAttribLocation(this.program,"a_color"),this.normalLocation=e.getAttribLocation(this.program,"a_normal"),this.radiusLocation=e.getAttribLocation(this.program,"a_radius"),this.arrowSizeRatioLocation=e.getAttribLocation(this.program,"a_arrowSizeRatio");const n=e.getUniformLocation(this.program,"u_matrix");if(null===n)throw new Error("EdgeClampedProgram: error while getting matrixLocation");this.matrixLocation=n;const r=e.getUniformLocation(this.program,"u_sqrtZoomRatio");if(null===r)throw new Error("EdgeClampedProgram: error while getting cameraRatioLocation");this.sqrtZoomRatioLocation=r;const o=e.getUniformLocation(this.program,"u_correctionRatio");if(null===o)throw new Error("EdgeClampedProgram: error while getting viewportRatioLocation");this.correctionRatioLocation=o,this.canUse32BitsIndices=(0,bt.canUse32BitsIndices)(e),this.IndicesArray=this.canUse32BitsIndices?Uint32Array:Uint16Array,this.indicesArray=new this.IndicesArray,this.indicesType=this.canUse32BitsIndices?e.UNSIGNED_INT:e.UNSIGNED_SHORT,this.bind()}bind(){const e=this.gl;e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,this.indicesBuffer),e.enableVertexAttribArray(this.positionLocation),e.enableVertexAttribArray(this.normalLocation),e.enableVertexAttribArray(this.colorLocation),e.enableVertexAttribArray(this.radiusLocation),e.enableVertexAttribArray(this.arrowSizeRatioLocation),e.vertexAttribPointer(this.positionLocation,2,e.FLOAT,!1,7*Float32Array.BYTES_PER_ELEMENT,0),e.vertexAttribPointer(this.normalLocation,2,e.FLOAT,!1,7*Float32Array.BYTES_PER_ELEMENT,8),e.vertexAttribPointer(this.colorLocation,4,e.UNSIGNED_BYTE,!0,7*Float32Array.BYTES_PER_ELEMENT,16),e.vertexAttribPointer(this.radiusLocation,1,e.FLOAT,!1,7*Float32Array.BYTES_PER_ELEMENT,20),e.vertexAttribPointer(this.arrowSizeRatioLocation,1,e.FLOAT,!1,7*Float32Array.BYTES_PER_ELEMENT,24)}process(e,t,n,r,o){if(r){for(let e=28*o,t=e+28;e<t;e++)this.array[e]=0;return}const i=n.arrowSizeRatio||1,a=n.size||1,l=e.x,s=e.y,c=t.x,u=t.y,d="doubleArrow"===n.type?e.size||1:0,p=t.size||1,m=(0,bt.floatColor)(n.color),h=c-l,g=u-s;let b=h*h+g*g,f=0,y=0;b&&(b=1/Math.sqrt(b),f=-g*b*a,y=h*b*a);let x=28*o;const v=this.array;v[x++]=l,v[x++]=s,v[x++]=f,v[x++]=y,v[x++]=m,v[x++]=-d,v[x++]=i,v[x++]=l,v[x++]=s,v[x++]=-f,v[x++]=-y,v[x++]=m,v[x++]=d,v[x++]=i,v[x++]=c,v[x++]=u,v[x++]=f,v[x++]=y,v[x++]=m,v[x++]=p,v[x++]=i,v[x++]=c,v[x++]=u,v[x++]=-f,v[x++]=-y,v[x++]=m,v[x++]=-p,v[x]=i}computeIndices(){const e=this.array.length/7,t=e+e/2,n=new this.IndicesArray(t);for(let t=0,r=0;t<e;t+=4)n[r++]=t,n[r++]=t+1,n[r++]=t+2,n[r++]=t+2,n[r++]=t+1,n[r++]=t+3;this.indicesArray=n}bufferData(){super.bufferData();const e=this.gl;e.bufferData(e.ELEMENT_ARRAY_BUFFER,this.indicesArray,e.STATIC_DRAW)}render(e){if(this.hasNothingToRender())return;const t=this.gl,n=this.program;t.useProgram(n),t.uniformMatrix3fv(this.matrixLocation,!1,e.matrix),t.uniform1f(this.sqrtZoomRatioLocation,Math.sqrt(e.ratio)),t.uniform1f(this.correctionRatioLocation,e.correctionRatio),t.drawElements(t.TRIANGLES,this.indicesArray.length,this.indicesType,0)}}const Lt=e=>{let{children:t}=e;const n=(0,r.useMemo)((()=>({allowInvalidContainer:!0,defaultNodeType:"image",hoverRenderer:gt,labelRenderer:ht,nodeProgramClasses:{image:(0,ut.createNodeCompoundProgram)([vt,ft,wt])},edgeProgramClasses:{line:mt(),arrow:(0,dt.createEdgeCompoundProgram)([Nt,Rt]),doubleArrow:(0,dt.createEdgeCompoundProgram)([Nt,Rt,Ot])},labelFont:"Roboto",labelSize:13,labelColor:{color:"rgba(0, 0, 0, 0.87)"}})),[]);return o().createElement(ct.C6,{graph:p.MultiGraph,style:{background:"transparent"},initialSettings:n},t)};var _t=n(28833),jt=n.n(_t),It=n(3660),kt=n.n(It),At=n(28301),Dt=n.n(At),Ut=n(30634),zt=n(20562),Zt=n(31181),Bt=n(30284);const Mt=(e,t,n,r,o,i,a)=>({aX:e+(r-e)*(n-a-i)/n,aY:t+(o-t)*(n-a-i)/n,vX:(r-e)*a/n,vY:(o-t)*a/n}),Ft=(e,t,n,r,o)=>{e.beginPath(),e.moveTo(t+r,n+o),e.lineTo(t+o*Gt,n-r*Gt),e.lineTo(t-o*Gt,n+r*Gt),e.lineTo(t+r,n+o),e.closePath(),e.fill()},Gt=.4,Ht=(e,t,n,r,o)=>{if(t.loop){const{size:r,color:o,arrowSizeRatio:i=1}=t,a=n.x,l=n.y,s=n.size,c=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)}}(a,l,.6*s);if(e.strokeStyle=o,e.lineWidth=r,"arrow"===t.type||"doubleArrow"===t.type){if(e.fillStyle=o,"doubleArrow"===t.type){const{aX:t,aY:n,vX:o,vY:u}=((e,t,n,r,o)=>{const i=Math.sqrt(Math.pow(t-e.x1,2)+Math.pow(n-e.y1,2));return Mt(e.x2,e.y2,i,t,n,r,o)})(c,a,l,s,r*i*2.2);Ft(e,t,n,o,u),e.beginPath(),e.moveTo(t,n)}else e.beginPath(),e.moveTo(a,l);const{aX:n,aY:u,vX:d,vY:p}=((e,t,n,r,o)=>{const i=Math.sqrt(Math.pow(t-e.x1,2)+Math.pow(n-e.y1,2));return Mt(e.x1,e.y1,i,t,n,r,o)})(c,a,l,s,r*i*2.2);e.bezierCurveTo(c.x2,c.y2,c.x1,c.y1,n,u),e.stroke(),Ft(e,n,u,d,p)}else e.beginPath(),e.moveTo(a,l),e.bezierCurveTo(c.x1,c.y1,c.x2,c.y2,a,l),e.stroke()}(0,Bt.default)(e,t,n,r,o)};function qt(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){Wt(e,t,n[t])}))}return e}function Wt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Vt=(e,t,n,r,o)=>e>n-o&&e<n+o&&t>r-o&&t<r+o&&Math.sqrt(Math.pow(e-n,2)+Math.pow(t-r,2))<o,Yt=(0,m.memoizeWith)(((e,t,n)=>n.type),h.uie),$t={size:24,buttonSize:8,buttonOffset:[19,19]},Xt={size:12,buttonSize:6,buttonOffset:[8,13]},Kt=e=>{let{data:t,graph:n,syncLayout:o,workerLayout:a,layoutSettings:l,selectedNode:s,isDirected:c=!1,onNodeClick:d,onNodeCollapse:p,onNodeExpand:m,filters:g}=e;const b=(0,ct.Ys)(),x=(0,ct.sG)(),v=(0,ct.$j)(),E=(0,ct.eP)(),w=(0,i.useSelector)(u.ZP.selectors.getEntity),C=(0,i.useSelector)(u.ZP.selectors.getMetadata),T=(0,i.useSelector)(u.ZP.selectors.getAbsoluteImagePath)||"",[R,O]=(0,r.useState)(void 0),[S,P]=(0,r.useState)(null),[N,L]=(0,r.useState)({});(0,r.useEffect)((()=>{b.getCamera().setState({ratio:1.2})}),[n,b]),(0,r.useEffect)((()=>{if(P((0,y.toUndirected)(n)),x(n),o){const e=o(b.getGraph(),l);(0,Zt.animateNodes)(b.getGraph(),e,{duration:1e3})}if(a){const e=new a(b.getGraph(),l);e.start();const t=setTimeout((()=>{e.stop()}),5e3);return()=>{clearTimeout(t),e.kill()}}}),[t,n,o,a,b,l,x,c]);const _=(0,r.useCallback)((e=>{const t=b.getGraph(),n=null==w?void 0:w.uri;if(t&&S&&n&&e&&n!==e){const r=(0,f.Ar)(S,n,e),o=function(e,t){const n=[],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2]?"findOutEdge":"findEdge";return t&&t.reduce(((t,o)=>(n.push(e[r](t,o,(e=>!!e))),o))),n}(t,r);return r?{edges:o,nodes:r}:{}}return{}}),[b,null==w?void 0:w.uri,S]);(0,r.useEffect)((()=>{L(_(s))}),[s,_]),(0,r.useEffect)((()=>{v({enterNode:e=>{let{node:t}=e;O(t)},leaveNode:()=>{O(void 0)},clickNode:e=>{let{node:t}=e;d(t)},click:e=>{const t=(e=>{let{x:t,y:n}=e;const r=b.viewportToGraph({x:t,y:n}),o=b.getGraph(),i=o.nodes().map((e=>{const t=o.getNodeAttributes(e);return{nodeId:e,distance:Math.pow(r.x-t.x,2)+Math.pow(r.y-t.y,2),hidden:t.hidden}})).sort(((e,t)=>e.distance-t.distance)).filter((e=>{let{hidden:t}=e;return!t}));return i.length>0?i[0].nodeId:null})(e);if(t){const n=b.getNodeDisplayData(t),r=b.framedGraphToViewport({x:n.x,y:n.y}),o=b.scaleSize(n.buttonOffset[0]),i=b.scaleSize(n.buttonOffset[1]),a=b.scaleSize(n.buttonSize),l=Vt(e.x,e.y,r.x+o,r.y-i,a),s=Vt(e.x,e.y,r.x+o,r.y+i,a);n.showExpand&&l&&(m(t),d(t)),n.showCollapse&&s&&(p(t,_(t)),d(t))}}})}),[b,v,d,p,m,_]),(0,r.useEffect)((()=>{const e=b.getGraph(),t=e.neighbors(s);E({nodeReducer:(n,r)=>{const{entityTypesUris:o=[]}=g||{},i=Yt(C,T,{type:r.entityTypeUri}),a=n===s?$t:Xt,l=e.neighbors(n),c=l.map((t=>e.getNodeAttribute(t,"hidden"))).filter((e=>!!e)).length,u=qt({},r,a,{color:"#0072CE",image:i,showExpand:r.untraversedRelationsCount>0||c>0,showCollapse:r.traversedRelationsCount>1&&l.length-c>1}),d=(N.nodes||[]).includes(n),p=R===n;return d||n===s||n===(null==w?void 0:w.uri)?(u.inPath=!0,n===(null==w?void 0:w.uri)&&(u.color="#00FFFF")):!t||t.includes(n)||s===n||s===(null==w?void 0:w.uri)||d||(p||(u.label=""),u.inactive=!0),p&&(u.highlighted=!0),![s,null==w?void 0:w.uri].includes(n)&&o.length>0&&!o.includes(r.entityTypeUri)&&(u.hidden=!0),u},edgeReducer:(t,n)=>{const{relationTypesUris:r=[]}=g||{},o=qt({},n,{hidden:!1}),i=(N.edges||[]).includes(t);var a;return(s&&s!==(null==w?void 0:w.uri)&&!e.hasExtremity(t,s)&&!i||r.length>0&&!r.includes(n.relationTypeUri))&&(o.hidden=!0),c&&(o.arrowSizeRatio=4),i&&(o.color="#0072CE",o.size=4,c&&(o.arrowSizeRatio=1.4)),o.type=(a=c?n.direction:h.MCv.undirected,{[h.MCv.bidirectional]:"doubleArrow",[h.MCv.directed]:"arrow",[h.MCv.undirected]:"line"}[a]||"line"),o},renderEdgeLabels:!0,edgeLabelRenderer:Ht})}),[b,E,R,s,N,null==w?void 0:w.uri,C,T,c,g])};let Qt;function Jt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){en(e,t,n[t])}))}return e}function en(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}!function(e){e.SIMPLE_NETWORK="Simple network",e.VERTICAL_TB="Vertical hierarchy",e.HORIZONTAL_LR="Horizontal hierarchy",e.DIRECTED_NETWORK="Directed Network"}(Qt||(Qt={}));const tn=e=>{let{data:t,graph:n,selectedNode:o,layout:i,onNodeClick:a,onNodeCollapse:l,onNodeExpand:s,filters:c}=e;const u=(0,Ut.D)(t);(0,zt.D)((()=>{if(u){const e=(0,m.difference)(t.entities.map((0,m.prop)("uri")),u.entities.map((0,m.prop)("uri")));if(e.length){const t=n.copy();jt().assign(t),e.forEach((e=>{n.setNodeAttribute(e,"x",t.getNodeAttribute(e,"x")),n.setNodeAttribute(e,"y",t.getNodeAttribute(e,"y"))}))}}}),[t]);const d=(0,r.useMemo)((()=>(jt().assign(n),{settings:Jt({},kt().inferSettings(n),{gravity:1})})),[n]);return Kt({workerLayout:Dt(),layoutSettings:d,data:t,graph:n,selectedNode:o,onNodeClick:a,isDirected:i===Qt.DIRECTED_NETWORK,onNodeCollapse:l,onNodeExpand:s,filters:c}),null};var nn=n(36039);const rn=(e,t,n,r)=>{const o=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)||o.add(r.to)}))})),o.size&&t.push(Array.from(o)),((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})(o,r,n)?rn(o,t,n,r):t},on=(e,t,n,r)=>{if(e.length<10&&(t[r]=[...e]),e.length>10){const o=e.slice(10),i=e.slice(0,10);t[r]=i,t[r+1]=n[r+1]?[...n[r+1],...o]:o}if(t[r+1]||n[r+1]){const e=t[++r]||n[r];return on(e,t,n,r)}return t};function an(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ln=e=>{let{data:t,graph:n,selectedNode:o,layout:i,onNodeClick:a,onNodeCollapse:l,onNodeExpand:s,filters:c}=e;const u=(0,r.useCallback)((e=>{const t=e.copy(),n=(e=>{switch(e){case Qt.VERTICAL_TB:return 180;case Qt.HORIZONTAL_LR:return 270}})(i),r=((e,t)=>{const n=e.nodes,r=e.edges.filter((e=>e.from!==e.to)),o=((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=rn(o,[],new Set,r);return on(i[0],[],i,0)})((e=>{const t=e.nodes().map((e=>({id:e,name:""}))),n=e.mapEdges(((e,t,n,r)=>({from:n,to:r,key:e,relationTypeUri:t.relationTypeUri,direction:t.direction})));return{nodes:t,edges:n}})(t),o),a=(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=a)?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 nn.rotation.assign(t,n,{degrees:!0}),t.reduceNodes(((e,t,n)=>{let{x:r,y:o}=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){an(e,t,n[t])}))}return e}({},e,{[t]:{x:r,y:o}})}),{})}),[i,o]);return Kt({syncLayout:u,data:t,graph:n,selectedNode:o,onNodeClick:a,onNodeCollapse:l,onNodeExpand:s,filters:c}),null};var sn=n(24737);const cn=(0,B.Z)({graphTypeSelector:{minWidth:"200px",backgroundColor:"#FAFAFA",opacity:1,height:"40px"},filledInputRoot:{borderRadius:"4px"},valueContainer:{width:"auto",marginLeft:"16px"}}),un=(0,X.l)(I,(e=>{let{graphTypeUri:t,setGraphTypeUri:n}=e;return{setGraphTypeUri:n,graphTypeUri:t}}),(e=>{let{graphTypeUri:t,setGraphTypeUri:n}=e;const a=cn(),l=(0,i.useSelector)(u.ZP.selectors.getMetadata),s=(0,i.useSelector)(u.ZP.selectors.getEntity),c=(0,r.useMemo)((()=>[{label:b().text("All"),value:null},...(0,h.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 o().createElement(sn.Z,{classes:{valueContainer:a.valueContainer},className:a.graphTypeSelector,height:42,label:b().text("Graph type"),value:d,options:c,onChange:e=>n(e.value),TextFieldProps:{InputProps:{disableUnderline:!0,classes:{root:a.filledInputRoot}}}})})),dn=(0,B.Z)({graphLayoutSelector:{minWidth:"202px",backgroundColor:"#FAFAFA",opacity:1,marginLeft:"10px"},filledInputRoot:{borderRadius:"4px",height:"42px"}}),pn=(0,r.memo)((e=>{let{value:t,onChangeHandler:n}=e;const r=dn(),i=[{label:b().text("Simple network"),value:Qt.SIMPLE_NETWORK},{label:b().text("Vertical hierarchy"),value:Qt.VERTICAL_TB},{label:b().text("Horizontal hierarchy"),value:Qt.HORIZONTAL_LR},{label:b().text("Directed network"),value:Qt.DIRECTED_NETWORK}];return o().createElement(sn.Z,{className:r.graphLayoutSelector,label:b().text("Graph layout"),value:i.find((0,m.propEq)("value",t)),options:i,onChange:e=>n(e.value),TextFieldProps:{InputProps:{disableUnderline:!0,classes:{root:r.filledInputRoot}}}})})),mn=()=>{const e=(0,ct.Ys)(),t=(0,r.useCallback)((()=>{e.refresh()}),[e]);return o().createElement(ne.Z,{handleWidth:!0,onResize:t})};var hn=n(17373);function gn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){bn(e,t,n[t])}))}return e}function bn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const fn="0 1px 1px rgba(0,0,0,0.14), 0 2px 1px rgba(0,0,0,0.12), 0 1px 3px rgba(0,0,0,0.2)",yn={background:"#FFFFFF",boxShadow:fn,width:"28px",height:"28px"},xn=(0,B.Z)({container:{display:"flex",alignItems:"center"},maxButton:gn({},yn,{borderRadius:"2px 4px 4px 2px"}),minButton:gn({},yn,{borderRadius:"4px 2px 2px 4px"}),thumb:{position:"absolute",boxShadow:fn,borderRadius:"2px",width:"8px",height:"28px",marginTop:"-13px",marginLeft:"1px",color:"rgba(0,0,0,0.54)",backgroundColor:"#FFFFFF",boxSizing:"border-box",outline:0,display:"flex",alignItems:"center",justifyContent:"center"},thumbIcon:{transform:"rotate(90deg)"},icon:{width:"18px",height:"18px"},rail:{opacity:1,height:"4px",paddingRight:"10px"},sliderRoot:{color:"#EDEDED",marginRight:"10px"}});function vn(){return vn=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},vn.apply(this,arguments)}const En=e=>Math.pow(100/e,2),wn=e=>100/Math.sqrt(e),Cn=e=>{const t=xn(),n=(0,m.omit)(["className"],e);return o().createElement("div",vn({className:t.thumb},n),o().createElement(hn.Z,{className:A()(t.icon,t.thumbIcon)}))},Tn=e=>{let{className:t,max:n,min:i}=e;const a=xn(),l=(0,ct.eP)(),s=(0,ct.$j)(),c=(0,ct.Ys)().getCamera(),{zoomIn:u,zoomOut:d}=(0,ct.AH)({factor:1.2}),[p,h]=(0,r.useState)((0,m.clamp)(i,n,wn(c.getState().ratio))),g=(0,r.useMemo)((()=>i>0?En(i):null),[i]),b=(0,r.useMemo)((()=>n>0?En(n):null),[n]);return(0,r.useEffect)((()=>(l({maxCameraRatio:g,minCameraRatio:b}),()=>{l({maxCameraRatio:null,minCameraRatio:null})})),[l,b,g]),(0,r.useEffect)((()=>{s({cameraUpdated:e=>h(wn(e.ratio))})}),[s]),o().createElement("div",{className:A()(a.container,t)},o().createElement(Z.IconButton,{className:a.minButton,onClick:()=>d()},o().createElement(hn.Z,{className:a.icon})),o().createElement(Z.Slider,{ThumbComponent:Cn,classes:{root:a.sliderRoot,rail:a.rail},track:!1,value:p,min:i,max:n,onChange:(e,t)=>c.setState({ratio:c.getBoundedRatio(En(t))})}),o().createElement(Z.IconButton,{className:a.maxButton,onClick:()=>u()},o().createElement(Qe.Z,{className:a.icon})))};var Rn=n(25156);const On=(0,B.Z)({button:{background:"#FFFFFF",boxShadow:"0 1px 1px rgba(0,0,0,0.14), 0 2px 1px rgba(0,0,0,0.12), 0 1px 3px rgba(0,0,0,0.2)",width:"28px",height:"28px",borderRadius:"4px"},icon:{width:"18px",height:"18px"}}),Sn=e=>{let{node:t}=e;const n=On(),{gotoNode:r}=(0,ct.AH)();return o().createElement(Z.IconButton,{className:n.button,onClick:()=>r(t)},o().createElement(Rn.Z,{className:n.icon}))},Pn=(0,B.Z)({wrapper:{height:"100%",position:"relative"},selectors:{display:"flex",position:"absolute",top:"12px",right:"16px",zIndex:2},graph:{height:"calc(100% - 5px)"},rightBottomControls:{position:"absolute",zIndex:100,right:"18px",bottom:"16px",display:"flex",width:"200px"},zoomSlider:{flexGrow:1,marginRight:"8px"}}),Nn=(0,X.l)(I,(e=>{let{data:t,graphologyGraph:n,selectedEntity:r,onEntitySelect:o,onCollapseEntity:i,onExpandEntity:a,relationshipTable:{filters:l}}=e;return{data:t,graph:n,selectedNode:null==r?void 0:r.uri,onNodeSelect:o,onNodeCollapse:i,onNodeExpand:a,filters:l}}),(e=>{let{data:t,graph:n,selectedNode:i,onNodeSelect:a,onNodeCollapse:l,onNodeExpand:s,filters:c}=e;const u=Pn(),[d,p]=(0,r.useState)(Qt.SIMPLE_NETWORK),m={data:t,graph:n,selectedNode:i,layout:d,onNodeClick:a,onNodeCollapse:l,onNodeExpand:s,filters:c};return o().createElement("div",{className:u.wrapper},o().createElement("div",{className:u.selectors},o().createElement(un,null),o().createElement(pn,{value:d,onChangeHandler:p})),o().createElement("div",{className:u.graph},n&&o().createElement(Lt,null,o().createElement(o().Fragment,null,o().createElement(mn,null),d===Qt.SIMPLE_NETWORK||d===Qt.DIRECTED_NETWORK?o().createElement(tn,m):o().createElement(ln,m),o().createElement("div",{className:u.rightBottomControls},o().createElement(Tn,{className:u.zoomSlider,min:30,max:300}),o().createElement(Sn,{node:i}))))))})),Ln=(0,B.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"}}))),_n=(0,r.memo)((()=>{const e=Ln(),t=(0,i.useSelector)(u.ZP.selectors.getEntity),n=(e=>{const{graphLoading:t,data:n,graphologyGraph:o,graphTypeUri:a,setGraphTypeUri:l,onAddRelation:s,onDeleteRelation:c,onCollapseEntity:d,onExpandEntity:p}=O(e),{selectedEntity:g,onEntitySelect:f,selectedEntityLoading:y}=((e,t)=>{const n=(0,R._)(),o=(0,i.useDispatch)(),[a,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,h.HvW)(e).then((e=>(s.current=P(s.current,e),e)))}),[]),g=(0,r.useCallback)((e=>{var r;const i=null==t||null===(r=t.entities)||void 0===r?void 0:r.find((0,m.propEq)("uri",e));i&&l(i),d(!0),n(p(e)).then(l).catch((e=>{o(u.ui.actions.errorSet((0,h.xU7)(e,b().text("Something went wrong"))))})).finally((()=>{d(!1)}))}),[o,t,n,p]);return(0,r.useEffect)((()=>{null!=e&&e.uri&&(s.current=P({},e),g(e.uri))}),[null==e?void 0:e.uri]),(0,r.useEffect)((()=>{const n=null==t?void 0:t.entities.find((e=>(null==a?void 0:a.uri)===e.uri));n||(null!=e&&e.uri?(s.current=P({},e),g(e.uri)):(s.current={},l(null)))}),[t]),{selectedEntityLoading:c,selectedEntity:a,onEntitySelect:g}})(e,n);return{graphLoading:t,data:n,graphologyGraph:o,selectedEntity:g,selectedEntityLoading:y,graphTypeUri:a,relationshipTable:j({data:n,selectedEntityUri:null==g?void 0:g.uri,mainEntityUri:null==e?void 0:e.uri,graphTypeUri:a}),onAddRelation:s,onDeleteRelation:c,onCollapseEntity:d,onExpandEntity:p,onEntitySelect:f,setGraphTypeUri:l}})(t),{graphLoading:a}=n;return o().createElement(I.Provider,{value:n},o().createElement("div",{className:e.perspectiveView},a&&o().createElement(d.Z,null),(null==t?void 0:t.uri)&&o().createElement("div",{className:e.graphContainer},o().createElement("div",{className:e.graphWrapper},o().createElement(G,null),o().createElement(Nn,null)),o().createElement(st,null))))}));_n.displayName="GraphPerspectiveView";const jn=_n,In=(0,a.createGenerateClassName)({productionPrefix:"graph",disableGlobal:!0}),kn=e=>{let{store:t}=e;return o().createElement(i.Provider,{store:t},o().createElement(a.StylesProvider,{generateClassName:In},o().createElement(s.MuiPickersUtilsProvider,{utils:c.Z},o().createElement(jn,null),o().createElement(l.Z,{showErrorFromStore:!0}))))}}}]);
|