@reltio/remotes 1.4.1101 → 1.4.1104

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/7854.js DELETED
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[7854],{48852:(e,t,n)=>{n.d(t,{l:()=>i});var r=n(24328),o=n.n(r);function a(){return a=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},a.apply(this,arguments)}const i=(e,t,n)=>{if(e&&t){const i=(0,r.memo)(n);return n=>o().createElement(e.Consumer,null,(e=>o().createElement(i,a({},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),a=n(71153),i=n.n(a),l=n(94079);const s=(0,n(79692).Z)((e=>({button:{padding:"9px 16px 9px 12px","& svg g path":{fill:e.palette.primary.main,fillOpacity:1}},iconButton:{"& svg g 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),p=n(8818);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)}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:a,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={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["className","mode","label","disabled","icon","onClick","onMenuClose"]);const v=s();return(()=>{switch(r){case"iconButton":return o().createElement(p.k,d({disabled:h,className:i()(v.iconButton,n),size:"S",tooltipTitle:a,onClick:b,icon:g},y));case"button":return o().createElement(l.Button,d({className:i()(v.button,n),disabled:h,startIcon:o().createElement(g,null),onClick:b,color:"primary",classes:{startIcon:v.startIcon,label:v.label}},y),o().createElement(u.C,{value:a},o().createElement("div",{className:v.overflowStyle},a)));case"menuItem":{const e=()=>{f(),b()};return o().createElement(l.MenuItem,d({classes:{root:v.menuItem},onClick:e,disabled:h,ref:t},y),o().createElement(o().Fragment,null,o().createElement(g,{className:v.menuIcon}),o().createElement(l.Typography,{classes:{root:v.menuText}},a)))}}})()}));h.displayName="ActionButton"},30739:(e,t,n)=>{n.d(t,{Z:()=>p});var r=n(24328),o=n.n(r),a=n(50166),i=n(44443),l=n(16299);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 p=(0,r.memo)((e=>{let{width:t=0,height:n=0,defaultItemSize:u,data:p,children:d,itemKey:m,showNotMeasuredItems:h,listRef:g}=e;const b=s(),f=(0,r.useRef)({}),[y,v]=(0,r.useState)({}),x=(0,r.useCallback)((0,l.DsO)((()=>{v(c({},f.current))})),[]),E=(0,r.useCallback)(((e,t)=>m?m(t,e):t),[m]),C=(0,r.useRef)(),w=g||C;w.current&&w.current.resetAfterIndex(0,!1);const O=(0,r.useMemo)((()=>e=>{let{data:t,index:n,style:r}=e;const a=E(t,n);return o().createElement("div",{style:r,className:b.item},o().createElement("div",{style:h?void 0:{visibility:a in y?void 0:"hidden"}},o().createElement(i.Z,{handleHeight:!0,onResize:(e,t)=>{f.current[a]!==t&&(((e,t)=>{f.current=c({},f.current,{[e]:t})})(a,t),x())}}),d({data:t,index:n})))}),[d,h,E,x,!h&&y]);return o().createElement(a.VariableSizeList,{ref:w,width:t,height:n,itemCount:p.length,itemData:p,itemSize:e=>y[(e=>E(p,e))(e)]||u,itemKey:m},O)}))},58662:(e,t,n)=>{n.d(t,{Z:()=>y});var r=n(13980),o=n.n(r),a=n(24328),i=n.n(a),l=n(71153),s=n.n(l),c=n(94079),u=n(87918),p=n.n(u),d=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 v=h(),x=(0,a.useCallback)((()=>{(0,m.pathOr)(m.identity,["current","resetScrollbarPosition"],f)()}),[f]),E=(0,a.useCallback)((e=>{l(e),x()}),[l,x]),C=(0,a.useCallback)((e=>{l(0),b(e),x()}),[l,b,x]);return i().createElement(c.TablePagination,{classes:g({},t,{root:s()(v.pagination,t.root),select:s()(v.select,t.select),caption:v.caption,selectRoot:v.selectRoot,actions:v.actions}),component:"div",labelRowsPerPage:y||p().text("Rows per page:"),labelDisplayedRows:e=>{let{from:t,to:n,count:r}=e;return p().text("${fromRow}-${toRow} of ${countRows}",{fromRow:p().number(t,"0,0"),toRow:p().number(n,"0,0"),countRows:p().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)(d.NA,C)})};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=i().memo(f)},10237:(e,t,n)=>{n.d(t,{Z:()=>m});var r=n(27556),o=n(13980),a=n.n(o),i=n(24328),l=n.n(i);function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){c(e,t,n[t])}))}return e}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const u=(0,n(79692).Z)((e=>({"basic-view__paper":s({display:"flex",flexDirection:"column"},e.basicView)})));function p(){return p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},p.apply(this,arguments)}const d=(0,i.forwardRef)(((e,t)=>{let{children:n,className:o}=e,a=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["children","className"]);const i=u();return l().createElement(r.Z,p({ref:t,className:o,classes:{root:i["basic-view__paper"]}},a),n)}));d.displayName="BasicView",d.propTypes={children:a().node,className:a().string};const m=d},81137:(e,t,n)=>{n.d(t,{Z:()=>c});var r=n(24328),o=n.n(r),a=n(87918),i=n.n(a),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:a,cancelCaption:c=i().text("Cancel"),onDiscard:u,discardCaption:p="",onSave:d,saveCaption:m=i().text("Save"),disabledSave:h=!1}=e;const g=s();return o().createElement(l.Dialog,{open:t,onClose:a,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},a&&o().createElement(l.Button,{onClick:a},c),o().createElement("div",null,u&&o().createElement(l.Button,{onClick:u,classes:{root:g.discardButton}},p),o().createElement(l.Button,{onClick:d,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),a=n(24328),i=n.n(a),l=n(52730),s=n(87638),c=n(16299),u=n(91262),p=n(71153),d=n.n(p),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:p=[],outRelationTypes:y=[],showEmptyEditors:v,entityErrorMessage:x,onChangeAttribute:E,onRemoveAttribute:C,onAddAttributes:w,onChangeRelationType:O,onChangeEntity:T}=e;const R=r(),{relation:S,entity:P}=t,{attributes:N,uri:j,type:I="",direction:k}=S||{},_=Boolean(I),L=(0,l.useSelector)(s.ZP.selectors.getMetadata),A=(0,a.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,a.useMemo)((()=>(0,c.xF8)(L,I)),[I,L]),U=(0,a.useMemo)((()=>_?(0,c.jWj)(k===c.Nsj.OUT,L,[(0,c.V3K)(L,I)]):(0,m.uniq)((0,c.jWj)(!0,L,y).concat((0,c.jWj)(!1,L,p)))),[_,I,L,p,y]),Z=(0,l.useSelector)((e=>s.ZP.selectors.getGlobalSearchRequestOptions(e,["ovOnly"]))),z=(0,a.useMemo)((()=>S&&{relationType:S.type,direction:S.direction}),[S]),B=(0,a.useMemo)((()=>P&&{entityUri:P.uri,entityType:P.type,entityLabel:(0,c.idV)(P.label)}),[P]),M=(0,a.useMemo)((()=>P&&P.uri?p.filter((0,c.eHk)(!1,P,n,L)):p),[P,p,n,L]),F=(0,a.useMemo)((()=>P&&P.uri?y.filter((0,c.eHk)(!0,P,n,L)):y),[P,y,n,L]);(0,a.useEffect)((()=>{const{type:e,direction:t}=(0,c.z7d)(p,y)||{};!I&&e&&O&&O({type:e.uri,direction:t})}),[I,p,y,O]),(0,o.D)((()=>{const{type:e,direction:t}=(0,c.z7d)(M,F)||{};!I&&e&&O({type:e.uri,direction:t})}),[I,P,M,F,T]);const H=(0,a.useCallback)((e=>{let{type:t,direction:n}=e;O({type:t.uri,direction:n})}),[O]);return i().createElement(i().Fragment,null,O&&i().createElement(h.Z,{className:R.item,relation:z,metadata:L,inRelationTypes:p,outRelationTypes:y,onChange:H}),T&&i().createElement(g.Z,{errorMessage:x,className:R.item},i().createElement(b.Z,{key:I,className:d()({[R.dense]:x}),entity:B||{},entityTypesUris:U,max:20,globalSearchRequestOptions:Z,mode:c.fO_.EDITING,onChange:T,onCreate:void 0,metadata:L,attributeTypesSelectionStrategy:void 0})),I&&i().createElement(u.Z,{attrTypes:D,entity:A,showEmptyEditors:v,mode:c.fO_.EDITING,parentUri:j,onAddAttributes:w,onChangeAttribute:E,onDeleteAttribute:C}))}},7154:(e,t,n)=>{n.d(t,{Z:()=>m});var r=n(24328),o=n.n(r),a=n(13980),i=n.n(a),l=n(16299),s=n(17440),c=n(89846),u=n(27185);function p(){return p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},p.apply(this,arguments)}const d=e=>{let{relation:t={},inRelationTypes:n=[],outRelationTypes:a=[],onChange:i=s.identity,applyFirstByDefault:l=!1,reversedContextLabels:d=!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={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["relation","inRelationTypes","outRelationTypes","onChange","applyFirstByDefault","reversedContextLabels"]);const{getRelationTypesOptions:h,fromEditorValue:g,toEditorValue:b}=(0,c.n)({reversedContextLabels:d}),f=(0,r.useMemo)((()=>h(n,a)),[h,n,a]),y=(0,r.useCallback)((0,s.pipe)(g(n,a),i),[g,n,a,i]),v=!!t.relationType;return(0,r.useEffect)((()=>{l&&f.length&&!v&&y(f[0])}),[f,l,y,v]),o().createElement(u.Z,p({value:b(t,f),options:f,onChange:y},m))};d.propTypes={className:i().string,relation:l.bNA,inRelationTypes:i().arrayOf(l.IYE),outRelationTypes:i().arrayOf(l.IYE),applyFirstByDefault:i().bool,reversedContextLabels:i().bool,onChange:i().func};const m=d},68439:(e,t,n)=>{n.d(t,{Z:()=>d});var r=n(24328),o=n.n(r),a=n(52730),i=n(71153),l=n.n(i),s=n(94079),c=n(16299),u=n(87638);const p=(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"}}),d=e=>{let{entity:t,className:n,size:r="small"}=e;const i=p(),d=(0,a.useSelector)(u.ZP.selectors.getMetadata),m=t.type,h=(0,c.nt9)(d,m)||{},g=(0,c.VD3)(d,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()(i[`entityType-${r}`],n),component:"div"},(0,c.jFi)(d,t))}},59725:(e,t,n)=>{n.d(t,{Q:()=>c});var r=n(24328),o=n.n(r),a=n(87918),i=n.n(a),l=n(16299),s=n(42520);const c=(0,r.memo)((e=>{let{entityTypes:t,selectedEntityTypes:n,single:a,placeholder:c,enableEmptyValueUnderline:u,onChange:p,classes:d={},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:a,placeholder:c,enableEmptyValueUnderline:u,onChange:p,classes:d,ListLabelProps:m,disabled:h,label:i().text("Entity type"),dataReltioId:"entity-type-selector",selectionPopupTitle:i().text("Select entity types")})}));c.displayName="EntityTypesSelector"},93416:(e,t,n)=>{n.d(t,{Z:()=>c});var r=n(24328),o=n.n(r),a=n(71153),i=n.n(a),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 a=s();return o().createElement(l.Z,{title:n,classes:{root:i()(a.container,t),title:a.title}},r)}},42520:(e,t,n)=>{n.d(t,{S:()=>j});var r=n(24328),o=n.n(r),a=n(71153),i=n.n(a),l=n(17440),s=n(16299),c=n(94079),u=n(83543),p=n(79692);const d=(0,p.Z)({listLabelContainer:{display:"flex",alignItems:"center",position:"relative",overflow:"hidden",whiteSpace:"nowrap",justifyContent:"space-between",height:"100%",width:"100%"},listLabel:{visibility:"hidden",position:"absolute",overflow:"hidden"},visibleItemsLabel:{textOverflow:"ellipsis",marginRight:"5px",overflow:"hidden",flex:1,flexBasis:"auto"},hiddenCount:{color:"rgba(0,0,0,0.87)",fontSize:"13px",lineHeight:"15px",padding:"5px 8px",borderRadius:"16px",backgroundColor:"rgba(0,0,0,.12)"}}),m=(e,t)=>{const{childNodes:n,clientLeft:r,clientWidth:o}=t;if(n.length>0){const[t]=Array.from(n),a=document.createRange();a.setStart(t,0);for(let n=0;n<e.length;n++){a.setEnd(t,a.endOffset+e[n].length);const{width:i}=a.getBoundingClientRect();if(r+i>o)return n;n!==e.length-1&&a.setEnd(t,a.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 a=d(),i=(0,r.useRef)(),[l,s]=(0,r.useState)(0);(0,r.useEffect)((()=>{s(((e,t)=>{const n=e.length,r=((e,t)=>{if(t){const n=m(e,t);return-1===n?0:e.length-n}return 0})(e,t);return n-Math.max(1,n-r)})(t,i.current))}),[t]);const u=h(t),p=l>0,b=p?h(t.slice(0,-l)):u;return o().createElement(c.Tooltip,{title:p?u:""},o().createElement("div",{className:a.listLabelContainer},o().createElement("div",{style:{width:g(n)},className:a.listLabel,ref:i},u),o().createElement("div",{className:a.visibleItemsLabel},b),p&&o().createElement("div",{className:a.hiddenCount},`+${l}`)))};var f=n(22385),y=n(97820),v=n(54763),x=n(7785),E=n(27239),C=n(44890);function w(){return w=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},w.apply(this,arguments)}const O=(0,l.always)(32),T=(0,r.memo)((e=>{let{selectedItems:t,onItemClick:n,focusIndex:r,width:a,height:i}=e,l=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["selectedItems","onItemClick","focusIndex","width","height"]);return o().createElement(C.Z,w({getItemSize:O,renderItem:(e,a,i)=>{let{item:l}=a;const s=!!t.find((e=>l.uri===e)),c=i===r;return o().createElement(x.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:a,height:i},l))}));T.displayName="SelectMetadataTypesList";const R=(0,p.Z)({root:{borderRadius:"4px 4px 0 0",margin:0,fontSize:"14px",letterSpacing:0,lineHeight:"16px"},inputLabel:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",width:"100%",top:"calc(50% - 23px)"},inputText:{display:"flex",flexGrow:1,alignItems:"center",height:"25px",width:"calc(100% - 53px)",paddingTop:"18px",paddingBottom:"4px",color:"rgba(0,0,0,0.87)",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},input:{width:0,cursor:"pointer","&[disabled]":{backgroundColor:"transparent",cursor:"default"},"&$emptyInput":{width:"100%"}},emptyInput:{},disabledInput:{},disabledPointer:{},disabledUnderline:{},inputRoot:{flex:1,paddingRight:"4px",fontSize:"14px",letterSpacing:0,lineHeight:"16px","&$disabledInput":{backgroundColor:"rgba(0, 0, 0, 0.03)",cursor:"pointer","&$disabledPointer":{cursor:"default"},"&$disabledUnderline::before":{borderBottomStyle:"solid"}}},icon:{transform:"rotate(0deg)",transition:"transform 0.35s ease"},"popup-opened-icon":{transform:"rotate(-180deg)"}});function 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 j=(0,r.memo)((e=>{let{placeholder:t,classes:n={},items:a,selectedItemsUris:p,onChange:d,ListLabelProps:m={},disabled:h,enableEmptyValueUnderline:g,single:x,label:E,dataReltioId:C,selectionPopupTitle:w}=e;const O=R(),[N,j]=(0,r.useState)(!1),I=(0,r.useCallback)((()=>j(!0)),[]),k=(0,r.useCallback)((()=>j(!1)),[]),[_,L]=(0,r.useState)(""),A=(0,r.useCallback)((()=>L("")),[]),D=(0,r.useCallback)((0,l.pipe)(A,k),[k,A]),U=a.filter((e=>{let{label:t}=e;return s.P6Y.strings.search(t,_)})).map(((e,t)=>({item:{item:P({},e,{filterText:_})},index:t}))),Z=(0,r.useMemo)((()=>p.map((e=>a.find((0,l.propEq)("uri",e)))).map((0,l.prop)("label"))),[p,a]),z=(0,r.useCallback)(((e,t)=>{x?(d(t?[e.uri]:[]),D()):d(t?p.concat(e.uri):p.filter((t=>t!==e.uri)))}),[p,d,x,D]),B=(0,r.useCallback)((e=>{let{item:t}=e;const n=!p.includes(t.uri);z(t,n)}),[p,z]),{focusIndex:M,handleKeyDown:F}=(0,v.t)({items:U,open:N,onSelectFocusedItem:B,selectedItems:p,onClose:D}),H=(0,r.useRef)(),G=H.current?H.current.getBoundingClientRect().width:0,V=Math.max(G,255),W=0===p.length;return o().createElement(o().Fragment,null,o().createElement(c.TextField,{label:E,ref:H,InputProps:{startAdornment:W&&!t?null:o().createElement("div",{className:i()(O.inputText,n.inputText)},W?o().createElement("div",null,t):o().createElement(b,S({},m,{list:Z}))),classes:{root:O.inputRoot,input:i()(O.input,n.input,{[O.emptyInput]:W&&!t}),disabled:i()(O.disabledInput,{[O.disabledPointer]:h}),underline:O.disabledUnderline},endAdornment:o().createElement(f.Z,{size:"L",icon:u.Z,iconClassName:i()(O.icon,{[O["popup-opened-icon"]]:N}),disabled:h}),readOnly:!0,disabled:!0,disableUnderline:W&&!g},inputProps:{tabIndex:-1},InputLabelProps:{classes:{root:i()(O.inputLabel,n.label)}},value:"",onClick:h?void 0:I,classes:{root:i()(O.root,n.root)},margin:"dense",variant:"filled",disabled:h,"data-reltio-id":C}),o().createElement(y.Z,{open:N,anchorEl:H.current,onClose:D,onSearch:L,title:w,containerWidth:V,containerHeight:355,searchInputOnKeyDown:F,transformOrigin:{horizontal:"left",vertical:"top"},anchorOrigin:{horizontal:"left",vertical:"bottom"},PaperProps:{"data-reltio-id":`${C}-popup`}},o().createElement(T,{items:U,onItemClick:z,selectedItems:p,width:V,height:245,focusIndex:M})))}));j.displayName="MetadataTypesSelector"},57304:(e,t,n)=>{n.d(t,{Z:()=>x});var r=n(24328),o=n.n(r),a=n(13980),i=n.n(a),l=n(71153),s=n.n(l),c=n(52730),u=n(17440),p=n(94079),d=n(87918),m=n.n(d),h=n(16299),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"}}}))),v=e=>{let{className:t,entity:n,children:a,classes:i}=e;const l=y({classes:i}),d=(0,c.useSelector)(g.ZP.selectors.getMetadata),v=(0,r.useCallback)((()=>{navigator.clipboard.writeText((0,h.BTI)(n))}),[n]);if((0,u.isNil)(n))return null;const x=(0,h.idV)(n.label),E=n.secondaryLabel,C=(0,h.ptG)(d,n),w=(0,h.Fn9)(n),O=n.uri,T=(0,h.BTI)(n);return o().createElement("div",{className:s()(l.profileBandWrapper,t)},o().createElement("div",{className:s()(l.profileBand,{[l.inactive]:!w}),"data-entity-uri":O},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(p.Typography,{variant:"h6",className:l.label},x),E&&o().createElement(p.Typography,{variant:"subtitle2",className:l.secondaryLabel},E),C&&o().createElement(p.Typography,{variant:"subtitle1",className:l.businessCard},C)),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)(O)&&o().createElement(p.Tooltip,{title:m().text("Copy to clipboard")},o().createElement(p.Typography,{display:"inline",variant:"body2",className:l.entityId,onClick:v},m().text("Entity ID"),": ",T))))),a&&o().createElement("div",null,a)))};v.propTypes={className:i().string,entity:i().object,children:i().node,classes:i().object};const x=v},32371:(e,t,n)=>{n.d(t,{U:()=>c});var r=n(24328),o=n.n(r),a=n(87918),i=n.n(a),l=n(16299),s=n(42520);const c=(0,r.memo)((e=>{let{relationTypes:t,selectedRelationTypes:n,single:a,placeholder:c,enableEmptyValueUnderline:u,onChange:p,classes:d={},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:a,placeholder:c,enableEmptyValueUnderline:u,onChange:p,classes:d,ListLabelProps:m,disabled:h,label:i().text("Relation type"),dataReltioId:"relation-type-selector",selectionPopupTitle:i().text("Select relation types")})}));c.displayName="RelationTypesSelector"},39827:(e,t,n)=>{n.d(t,{G:()=>m});var r=n(24328),o=n.n(r),a=n(71153),i=n.n(a),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 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)}function d(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}const m=e=>{let{buttonsProps:t,activeIndexId:n,className:r,onButtonClick:a,classes:s={}}=e;const c=u(),{active:m,buttonWrapper:h}=s,g=d(s,["active","buttonWrapper"]);return o().createElement("div",{className:i()(c.container,r)},t.map((e=>{let{id:t}=e,r=d(e,["id"]);return o().createElement(l.k,p({},r,{classes:g,size:"S",key:t,className:i()({[i()(c.active,m)]:n===t},c.buttonWrapper,h),onClick:()=>a(t),"data-reltio-id":`reltio-profile-right-side-button-${t}`}))})))}},52043:(e,t,n)=>{n.d(t,{h:()=>i});var r=n(24328),o=n.n(r);const a=(0,n(79692).Z)((e=>({contentWrapper:{display:"flex",flexDirection:"column",backgroundColor:e.palette.background.paper,boxShadow:"0 1px 1px 0 rgba(0,0,0,0.14), 0 2px 1px -1px rgba(0,0,0,0.12), 0 1px 3px 0 rgba(0,0,0,0.2)",marginLeft:"3px",transition:e.transitions.create(["width"],{duration:e.transitions.duration.enteringScreen})}}))),i=e=>{let{width:t,open:n,children:r}=e;const i=a();return o().createElement("div",{className:i.contentWrapper,style:{width:`${n?t:0}px`}},n&&o().createElement(o().Fragment,null,r))}},8962:(e,t,n)=>{n.d(t,{Z:()=>I});var r=n(52730),o=n(87638),a=n(24328),i=n.n(a),l=n(16299),s=n(71153),c=n.n(s),u=n(87918),p=n.n(u),d=n(94079),m=n(60995),h=n(10237),g=n(93416),b=n(80931),f=n(8261),y=n(79692);const v=(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)"}}),x=(0,r.connect)((e=>({metadata:o.ZP.selectors.getMetadata(e)})))((e=>{let{className:t,entity:n={},metadata:s,caption:u="",excludeUris:y=[],includeUris:x=[],attributesCount:E=16}=e;const C=v(),w=(0,r.useSelector)(o.ZP.selectors.getPivotingAttributes),O=(0,a.useMemo)((()=>(0,f.U)(s,n.type,x,y)),[y,x,s,n.type]),T=(0,l.fyF)(O,n).filter((e=>{let{values:t}=e;return!(0,l.O27)(t)})).length>0;return T||!(0,l.O27)(u)?i().createElement(m.J.Provider,{value:w},i().createElement(h.Z,{className:t},u&&i().createElement(g.Z,{className:C.header,title:u}),i().createElement(d.Box,{className:c()(C.attributesContainer,{[C.noCaption]:!u})},T?i().createElement(b.Z,{entity:n,attrTypes:O,parentUri:n.uri,drawLines:!1,max:E}):i().createElement(d.Typography,{className:C.noData},p().text("No data found"))))):null}));var E=n(17440),C=n(91262),w=n(39450),O=n(66784);const T=(0,y.Z)({attributesContainer:{padding:"0 16px 16px 16px"},header:{marginBottom:"4px"},noCaption:{paddingTop:"16px"}});function R(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:p="",excludeUris:m=[],includeUris:b=[],pinnedAttributes:y}=e;const v=T(),x=(0,r.useDispatch)(),S=(0,a.useContext)(w.m),P=(0,r.useSelector)(o.ZP.selectors.getUserRoles),N=(0,a.useMemo)((()=>(0,l.mC3)(y,P)),[y,P]),j=(0,r.useSelector)((e=>o.ZP.selectors.getModifiedEntity(e,n.uri)||{})),I=(0,a.useMemo)((()=>(0,f.U)(u,j.type,b,m)),[m,b,u,j.type]),k=(0,a.useCallback)((e=>(0,E.pipe)(o.N5.actions.addAttributes,x)(e.map((e=>R({},e,{viewId:S}))))),[S,x]),_=(0,a.useCallback)((e=>(0,E.pipe)(o.N5.actions.modifyAttribute,x)(R({},e,{viewId:S}))),[S,x]),L=(0,a.useCallback)((e=>(0,E.pipe)(o.N5.actions.removeAttribute,x)(R({},e,{viewId:S}))),[S,x]);return i().createElement(h.Z,{className:t},p&&i().createElement(g.Z,{className:v.header,title:p}),i().createElement(d.Box,{className:c()(v.attributesContainer,{[v.noCaption]:!p})},i().createElement(O.c.Provider,{value:N},i().createElement(C.Z,{entity:j,attrTypes:I,parentUri:j.uri,drawLines:!1,mode:s,showEmptyEditors:(0,l.ZiX)(j.uri),crosswalks:j.crosswalks,onAddAttributes:k,onChangeAttribute:_,onDeleteAttribute:L}))))}));var N=n(3185);function j(){return j=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},j.apply(this,arguments)}const I=(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,a=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["mode","attributesCount","pinnedAttributes","entity"]);return i().createElement(N.u.Provider,{value:o},(0,l.uzs)(t)?i().createElement(x,j({attributesCount:n,entity:o},a)):i().createElement(P,j({mode:t,pinnedAttributes:r,entity:o},a)))}))},27185:(e,t,n)=>{n.d(t,{Z:()=>O});var r=n(24328),o=n.n(r),a=n(13980),i=n.n(a),l=n(87918),s=n.n(l),c=n(17440),u=n(71153),p=n.n(u),d=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:a}=e;const i=m(),{value:l,label:s,startObject:c,endObject:u}=a,f=c.objectType.label+" ↔ "+u.objectType.label;return o().createElement(d.MenuItem,b({className:i.container,ref:t,key:l,onClick:()=>r({label:s,value:l,startObject:c,endObject:u})},n),o().createElement("div",{className:i.icons},o().createElement(h.Z,{className:i.iconTop,entityType:c.objectType}),o().createElement(h.Z,{className:i.iconBottom,entityType:u.objectType})),o().createElement("div",{className:i.text},o().createElement(g.C,{value:s},o().createElement(d.Typography,{className:p()(i.textItem,i.primaryTextItem)},s)),o().createElement(g.C,{value:f},o().createElement(d.Typography,{color:"textSecondary",className:p()(i.textItem,i.secondaryTextItem)},f))))};f.propTypes={innerRef:i().oneOfType([i().oneOf([null]),i().func,i().shape({current:i().any.isRequired})]),innerProps:i().object.isRequired,selectOption:i().func.isRequired,data:i().shape({value:i().string.isRequired,label:i().string.isRequired,startObject:i().object,endObject:i().object})};const y=f;var v=n(24737);function x(){return x=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},x.apply(this,arguments)}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 C=e=>{let{value:t={},options:n=[],onChange:a=c.identity,TextFieldProps:i}=e,l=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["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)({},i),{"data-reltio-id":"relation-type-selector"})),[i]);return o().createElement(v.Z,x({value:t,options:n,onChange:a,label:s().text("Select relationship type "),components:{Option:y},TextFieldProps:u},l))},w=i().shape({label:i().string.isRequired,value:i().string.isRequired,startObject:i().object,endObject:i().object});C.propTypes={value:w,options:i().arrayOf(w),onChange:i().func};const O=C},78620:(e,t,n)=>{n.d(t,{R:()=>u});var r=n(24328),o=n(16299),a=n(17440),i=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,i.useSelector)(l.ZP.selectors.getMetadata),p=(0,r.useCallback)((e=>n(s({},t,{relation:e}))),[t,n]),d=(0,r.useCallback)((0,a.pipe)((0,o.zE1)(t.relation),p),[t.relation,p]),m=(0,r.useCallback)((0,a.pipe)((0,o.lIv)(t.relation),p),[t.relation,p]),h=(0,r.useCallback)((0,a.pipe)((0,o.Ilm)(t.relation),p),[t.relation,p]),g=(0,r.useCallback)((e=>{let{type:r,direction:a}=e;const i={entity:t.entity&&(0,o.eHk)(a===o.Nsj.OUT,t.entity,c,u,(0,o.V3K)(u,r))?t.entity:null,relation:s({},t.relation,{attributes:{},type:r,direction:a})};n(i)}),[t,n,c,u]);return{onAddAttributes:d,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:()=>i});var r=n(24328),o=n(16299),a=n(17440);const i=e=>{let{reversedContextLabels:t}=e;return{getRelationTypesOptions:(0,r.useCallback)(((e,n)=>{const r={},i=(0,a.pipe)(o.PjQ,(0,a.tap)((e=>r[e]=(0,a.propOr)(0,e,r)+1))),l=(0,a.ascend)((0,a.prop)("label")),s=(0,a.curry)(((e,n)=>{let{uri:r,label:a,startObject:l,endObject:s}=n;const c=e===(t?o.Nsj.OUT:o.Nsj.IN)?l:s;return{label:{directionalLabel:i(c),typeLabel:a},value:`${r},${e}`,startObject:l,endObject:s}}));return e.map(s(o.Nsj.IN)).concat(n.map(s(o.Nsj.OUT))).map((0,a.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,i]=n.value.split(",");return{type:(i===o.Nsj.IN?e:t).find((0,a.propEq)("uri",r)),direction:i}}),[]),toEditorValue:(0,r.useCallback)(((e,t)=>t.find((0,a.propEq)("value",`${e.relationType},${e.direction}`))),[])}}},47854:(e,t,n)=>{n.r(t),n.d(t,{default:()=>sn});var r=n(24328),o=n.n(r),a=n(52730),i=n(36138),l=n(585),s=n(22664),c=n(52844),u=n(87638),p=n(99136),d=n(98996),m=n(17440),h=n(16299),g=n(87918),b=n.n(g),f=n(60715),y=n(35174);function v(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){x(e,t,n[t])}))}return e}function x(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)(C,(0,m.without)([e]))(r);return o.forEach((e=>E(e,t,n))),n},C=e=>(0,m.pipe)((0,m.chain)((e=>[(0,h.nqN)(e),(0,h.j5q)(e)])),m.uniq)(e),w=(e,t)=>{const n=(e=>{var t;const n=new Set,r=new Set;e.entities.forEach((e=>n.add(e.uri))),((null===(t=e.relations)||void 0===t?void 0:t.filter((e=>n.has(e.startObject.objectURI)&&n.has(e.endObject.objectURI))))||[]).forEach((e=>{r.add(`${e.startObject.objectURI}--${e.endObject.objectURI}--${e.uri}--${e.type}`)}));const o=e.entities.map((e=>({id:e.uri,name:e.label,entityTypeUri:e.type,traversedRelationsCount:e.traversedRelations,untraversedRelationsCount:e.untraversedRelations}))),a=[];return r.forEach((e=>{const[t,n,r,o]=e.split("--");a.push({from:t,to:n,key:r,relationTypeUri:o})})),{nodes:o,edges:a}})(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})}))},O=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=>O(e,t,n))),n};var T=n(67218);const R=e=>{const[t,n]=(0,r.useState)(null),[o,i]=(0,r.useState)(null),l=(0,a.useDispatch)(),[s,c]=(0,r.useState)(null),[p,g]=(0,r.useState)(!1),x=null==e?void 0:e.uri,R=(0,h.biM)(e),S=(0,T._)(),P=(0,r.useCallback)((function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return S((0,h.ZYI)({uri:e,deep:n,limitCreditsConsumption:!0,graphTypes:t?[(0,h.nIW)(t)]:null,activenessDate:null,max:t?200:3e3}))}),[t,S]);(0,r.useEffect)((()=>(!x||(0,h.ZiX)(x)||R||(g(!0),(0,h.ZYI)({uri:x,deep:t?2:1,limitCreditsConsumption:!0,graphTypes:t?[(0,h.nIW)(t)]:null,activenessDate:null,max:t?200:3e3}).then((e=>{const t=new d.MultiGraph;w(t,e),i(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)}))),()=>{i(null),c(null),g(!1)})),[x,R,l,t]);const N=(0,r.useCallback)((e=>{let{startEntityUri:t,endEntityUri:n,relationType:r,attributes:a,startDate:i,endDate:p}=e;return g(!0),(0,h.DsR)({startEntityUri:t,endEntityUri:n,relationType:r,attributes:a,startDate:i,endDate:p}).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)=>{const n=t.startObject.objectURI,r=t.endObject.objectURI,o=[n,r],a=e.entities.map((0,m.prop)("uri")),i=o.find((e=>!(0,m.includes)(e,a))),l=i&&(t.startObject.objectURI===i?t.startObject:t.endObject),s=l&&{type:l.type,label:l.label,uri:l.objectURI,traversedRelations:0,untraversedRelations:1},c=v({},(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)});return{entities:(s?e.entities.concat([s]):e.entities).map((e=>e.uri===n||e.uri===r?v({},e,{traversedRelations:e.traversedRelations+1}):e)),relations:e.relations.concat([c])}})(s,n);w(o,r);const a=[n.startObject.objectURI,n.endObject.objectURI],i=s.entities.map((0,m.prop)("uri"));a.map((e=>{if(i.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]),j=(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)),a=(0,h.nqN)(o),i=(0,h.j5q)(o),l=(0,y.toUndirected)(n),s=(0,m.cond)([[()=>!(0,f.Ar)(l,e,a),(0,m.always)(a)],[()=>!(0,f.Ar)(l,e,i),(0,m.always)(i)],[m.T,(0,m.always)(null)]])(),c=(0,m.evolve)({entities:(0,m.map)((e=>e.uri===a||e.uri===i?v({},e,{traversedRelations:e.traversedRelations-1}):e)),relations:(0,m.reject)((0,m.propEq)("uri",t))})(r),{updatedData:u,removedEntitiesUris:p}=s?((e,t)=>{const n=E(e,t),r=(0,m.pipe)(C,(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:p}})(x,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,x,s]),I=(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),a=(e,t)=>{o.filterEdges(e,t,(e=>!!e)).forEach((e=>o.dropEdge(e)))};n.forEach((e=>{a(t,e),o.forEachNeighbor(e,(t=>{a(e,t)}))}));const i=[];return o.nodes().forEach((t=>{((e,t,n)=>(0,f.Ar)(e,t,n)?null:n)(o,e,t)&&i.push(t)})),(0,m.uniq)(i.reduce(((e,t)=>O(t,o,e)),[...i]))})(x,e,r,o).forEach((t=>{t!==x&&t!==e&&o.setNodeAttribute(t,"hidden",!0)}))}),[x,o]),k=(0,r.useCallback)((e=>{if(e&&!(0,h.ZiX)(e)&&!R){const t=o.getNodeAttribute(e,"untraversedRelationsCount");o.neighbors(e).forEach((e=>{o.setNodeAttribute(e,"hidden",!1)})),t>0&&(g(!0),P(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]=v({},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);w(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,R,P]);return{graphLoading:p,data:s,graphologyGraph:o,graphTypeUri:t,setGraphTypeUri:n,onAddRelation:N,onDeleteRelation:j,onCollapseEntity:I,onExpandEntity:k}};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 j(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const I=(e,t,n)=>{const{startObject:r,endObject:o,type:a}=t,{directionalLabel:i}=(0,h.nqN)(t)===n?r:o;return i||(0,h.Lmx)(e,a)},k=e=>{let{data:t,selectedEntityUri:n,mainEntityUri:o,graphTypeUri:i}=e;const[l,s]=(0,r.useState)({field:"",order:"asc"}),[c,p]=(0,r.useState)(0),[d,g]=(0,r.useState)(N[0]),[f,y]=(0,r.useState)([]),[v,x]=(0,r.useState)(!1),E=(0,a.useDispatch)(),C=(0,a.useSelector)(u.ZP.selectors.getMetadata),w=(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]),O=(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=w[((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)(C,t),relationTypeLabel:I(C,e,t.uri)}})))((null==t?void 0:t.relations)||[])),[t,n,w,C]),{searchText:T,onChangeSearchText:R,filters:S,onFilter:P,relationTypesOptions:k,entityTypesOptions:_}=(e=>{const[t,n]=(0,r.useState)(""),[o,i]=(0,r.useState)({entityTypesUris:[],relationTypesUris:[]}),l=(0,a.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:i,entityTypesOptions:s,relationTypesOptions:c}})(O),L=(0,r.useMemo)((()=>(0,m.pipe)((0,m.filter)((e=>{let{entityLabel:t,entity:n,relation:r}=e;const{entityTypesUris:o,relationTypesUris:a}=S;return h.P6Y.strings.search(t,T)&&(0,m.ifElse)((0,m.prop)("length"),(0,m.includes)(r.type),m.T)(a)&&(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)(O)),[O,l,T,S]),A=(0,r.useMemo)((()=>L.slice(c*d,c*d+d)),[L,c,d]),D=(0,r.useCallback)((e=>{x(!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((()=>x(!1)))}),[E]),U=(0,r.useCallback)((e=>{y((t=>t.map((t=>t.relation.uri===e.uri?function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){j(e,t,n[t])}))}return e}({},t,{relation:e}):t))))}),[]);(0,r.useEffect)((()=>{p(0),R("")}),[n,i,R,P]),(0,r.useEffect)((()=>{P({entityTypesUris:[],relationTypesUris:[]})}),[i,o,P]),(0,r.useEffect)((()=>{p(0)}),[l,T,S]);const Z=(0,r.useCallback)((e=>{y((t=>t.filter((t=>t.relation.uri!==e))))}),[]),z=(0,r.useCallback)(((e,t)=>{x(!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((()=>x(!1)))}),[Z,E]);return{rowsData:A,onSort:s,sorting:l,searchText:T,onChangeSearchText:R,filters:S,onFilter:P,entityTypesOptions:_,relationTypesOptions:k,editingRelations:f,onStartRelationEditing:D,onCancelRelationEditing:Z,onUpdateEditingRelation:U,total:L.length,page:c,rowsPerPage:d,onPageChange:p,onRowsPerPageChange:g,onSaveEditingRelation:z,loading:v}},_=o().createContext({graphLoading:!1,data:null,graphologyGraph:null,selectedEntityLoading:!1,selectedEntity:null,onEntitySelect:()=>{},relationshipTable:{},onCollapseEntity:()=>{},onExpandEntity:()=>{}});_.displayName="GraphStateContext";var L=n(71153),A=n.n(L),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,a.useSelector)(u.ZP.selectors.getEntity);return o().createElement(D.Z,{className:A()(t,U.U),entity:r},o().createElement(z.Box,{className:n.comments},o().createElement(Z.Z,{uri:r.uri,relatedObjectUris:(0,h.wp9)(h.q7e.ENTITY,{entityUri:r.uri}),objectType:h.q7e.ENTITY})))}));F.displayName="GraphProfileBand";const H=F;var G=n(52043),V=n(39827),W=n(82726);const q=(0,B.Z)({wrapper:{display:"flex",overflow:"hidden",marginLeft:"auto",flexShrink:0}});function $(){return $=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},$.apply(this,arguments)}const Y=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return o().createElement("svg",$({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)(_,(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)(_,(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(p.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 ae="1px solid rgba(0, 0, 0, 0.05)",ie=(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:ae},tableRow:{display:"flex",alignItems:"center","& > div":{flexShrink:0}},editingRow:{paddingTop:"8px"},headRow:{borderBottom:ae}});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 a=ie();return o().createElement("div",{className:A()(a.tableRow,a.headRow)},t.map((e=>{const{id:t,sortable:a,headCellRenderer:i,columnClassName:l}=e,s=i,c=a?{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:a,rowsData:i,sorting:l,onSort:s,getRowKey:c,ExpandedRowRenderer:u,defaultRowHeight:p}=e;const d=ie(),[m,h]=(0,r.useState)({width:0,height:0}),g=(0,r.useCallback)((e=>{let{data:t,index:r}=e;const i=t[r];return o().createElement("div",{className:A()(d.tableRowWrapper,null==n?void 0:n.tableRowWrapper)},o().createElement("div",{className:A()(d.tableRow,null==n?void 0:n.tableRow,{[d.editingRow]:i.expanded})},a.map((e=>{let{id:t,rowCellValueRenderer:n,columnClassName:r}=e;const a=n;return o().createElement("div",{key:t,className:r},o().createElement(a,{value:i[t],rowValue:i}))}))),i.expanded&&u&&o().createElement(u,{open:i.expanded,rowValue:i}))}),[a,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:d.table},o().createElement(se,{columnsData:a,sorting:l,onSort:s}),o().createElement("div",{className:d.tableBodyWrapper},o().createElement(ne.Z,{handleHeight:!0,handleWidth:!0,onResize:b}),o().createElement("div",{className:d.tableBody},o().createElement(re.Z,{listRef:f,width:m.width,height:m.height,data:i,defaultItemSize:p,itemKey:c,showNotMeasuredItems:!0},g))))})),ue=(0,r.memo)(ce);var pe=n(92332),de=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%)`}}),ve=(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 xe(){return xe=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xe.apply(this,arguments)}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){Ce(e,t,n[t])}))}return e}function Ce(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const we=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={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["className","headCellData"]);const a=ve();return o().createElement("div",{className:A()(a.headCell,t)},o().createElement(pe.default,xe({},r,{headCellData:Ee({},n,{label:o().createElement(de.C,{value:n.label},o().createElement("div",{className:a.headLabel},n.label))})})))},Oe=(0,r.memo)((e=>{let{value:t="",tooltip:n,onClick:r,className:a}=e;const i=ve();return n=n||t,o().createElement(de.C,{value:n},o().createElement("div",{className:A()(i.defaultCell,a,{[i.clickable]:!!r}),onClick:r},t))}));var Te=n(53180);const Re=(0,X.l)(_,(e=>{let{onEntitySelect:t}=e;return{onClick:t}}),(e=>{let{value:t,rowValue:{entity:n},className:r,onClick:a}=e;const i=ve(),l=o().createElement(o().Fragment,null,o().createElement(Te.Z,{entity:n,avatarClassName:i.entityAvatar}),t);return o().createElement(Oe,{value:l,tooltip:t,className:A()(i.profileCell,r),onClick:()=>a(n.uri)})}));var Se=n(78620),Pe=n(14363);const Ne=(0,X.l)(_,((e,t)=>{let{relationshipTable:n}=e;return{editingRelationObject:n.editingRelations.find((e=>{var n;return e.initialRelation.uri===(null==t||null===(n=t.rowValue.relation)||void 0===n?void 0:n.uri)})),onUpdateEditingRelation:n.onUpdateEditingRelation,onCancelRelationEditing:n.onCancelRelationEditing,onSaveEditingRelation:n.onSaveEditingRelation}}),(e=>{let{open:t,editingRelationObject:n,onUpdateEditingRelation:i,onCancelRelationEditing:l,onSaveEditingRelation:s}=e;const c=(0,a.useDispatch)(),p=(0,a.useSelector)(u.ZP.selectors.getMetadata),{relation:d,initialRelation:g}=n,f=(0,r.useMemo)((()=>!(0,m.equals)(g,d)),[d,g]),y=ve(),v=(0,r.useCallback)((e=>{let{relation:t}=e;return i(t)}),[i]),x=(0,r.useCallback)((()=>l(d.uri)),[l,d.uri]),E=(0,r.useMemo)((()=>({relation:d})),[d]),{onAddAttributes:C,onChangeAttribute:w,onRemoveAttribute:O}=(0,Se.R)({connection:E,onConnectionChange:v});return t?o().createElement("div",{className:y.expandedRow},o().createElement(Pe.n,{connection:E,onAddAttributes:C,onChangeAttribute:w,onRemoveAttribute:O}),o().createElement("div",{className:y.actionButtons},o().createElement(z.Button,{onClick:x},b().text("Cancel")),o().createElement(z.Button,{color:"primary",disabled:!f,onClick:()=>{(e=>{const t=(0,h.xkB)(p,{relation:{object:e}});return c(u.N5.errors.actions.errorsSet(t)),0===t.length})(d)&&s(g,d)}},b().text("Save")))):null}));var je=n(8818),Ie=n(27604),ke=n(22983),_e=n(81137);const Le=(0,X.l)(_,(0,m.pick)(["onDeleteRelation"]),(e=>{let{uri:t,open:n,onClose:r,onDeleteRelation:a}=e;return o().createElement(_e.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:()=>{a(t),r()}})})),Ae=(0,r.memo)((e=>{let{uri:t}=e;const[n,a]=(0,r.useState)(!1),i=(0,r.useCallback)((()=>a(!0)),[]),l=(0,r.useCallback)((()=>a(!1)),[]);return o().createElement(o().Fragment,null,o().createElement(je.k,{icon:ke.Z,size:"XXS",tooltipTitle:b().text("Delete"),onClick:i}),o().createElement(Le,{open:n,onClose:l,uri:t}))}));Ae.displayName="DeleteRelationButton";const De=Ae,Ue=(0,X.l)(_,((e,t)=>{let{relationshipTable:{onStartRelationEditing:n,editingRelations:r}}=e;return{onEdit:n,isEditing:r.some((e=>{var n;return e.initialRelation.uri===(null==t||null===(n=t.rowValue.relation)||void 0===n?void 0:n.uri)}))}}),(e=>{let{rowValue:{relation:{uri:t,type:n}},className:r,onEdit:i,isEditing:l}=e;const s=ve(),c=(0,a.useSelector)(u.ZP.selectors.getMetadata),p=(0,h.V3K)(c,n),d=(0,h.Z5t)(h.ARY.Editing,p),m=(0,h.Edd)(h.ARY.Editing,p);return o().createElement("div",{className:A()(s.controlsCell,r,{[s.editingMode]:l})},d&&o().createElement(je.k,{className:A()(s.editButton,{[s.hidden]:l}),icon:Ie.Z,size:"XXS",tooltipTitle:b().text("Edit"),onClick:()=>i(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)(_,(e=>{let{relationshipTable:t}=e;return Ze({},t)}),(e=>{let{rowsData:t,sorting:n,onSort:a,total:i,page:l,rowsPerPage:s,onPageChange:c,onRowsPerPageChange:u,editingRelations:d,loading:m}=e;const h=he(),g=(0,r.useMemo)((()=>[{id:"entityLabel",label:b().text("Profile"),headCellRenderer:we,rowCellValueRenderer:Re,sortable:!0,columnClassName:h.profileColumn},{id:"relationTypeLabel",label:b().text("Relationship type"),headCellRenderer:we,rowCellValueRenderer:Oe,sortable:!0,columnClassName:h.relationshipTypeColumn},{id:"entityTypeLabel",label:b().text("Entity Type"),headCellRenderer:we,rowCellValueRenderer:Oe,sortable:!0,columnClassName:h.entityTypeColumn},{id:"controls",label:"",headCellRenderer:we,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!=d&&d.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,d]),v=(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:a,getRowKey:Be,ExpandedRowRenderer:Ne,defaultRowHeight:28,classes:v})),i>N[0]&&o().createElement(te.Z,{count:i,rowsPerPageOptions:N,rowsPerPage:s,onChangeRowsPerPage:u,page:l,onChangePage:c,basicTableRef:f}),m&&o().createElement(p.Z,null))}));var Fe=n(36444),He=n(94574);const Ge=(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}}}))),Ve=(0,X.l)(_,(0,m.pipe)((0,m.prop)("relationshipTable"),(0,m.pick)(["searchText","onChangeSearchText"])),(e=>{let{searchText:t,onChangeSearchText:n}=e;const r=Ge();return o().createElement(He.Z,{fullWidth:!0,height:40,autofocus:!1,value:t,onSearch:n,placeholder:b().text("Search profiles"),classes:{input:r.input}})}));var We=n(59725),qe=n(32371);const $e=(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"}}))),Ye=(0,X.l)(_,(0,m.pipe)((0,m.prop)("relationshipTable"),(0,m.pick)(["onFilter","filters","entityTypesOptions","relationTypesOptions"])),(e=>{let{open:t,onClose:n,filters:a,onFilter:i,entityTypesOptions:l,relationTypesOptions:s}=e;const c=$e(),[u,p]=(0,r.useState)([]),[d,m]=(0,r.useState)([]),h=()=>{p(a.entityTypesUris),m(a.relationTypesUris),n()};return(0,r.useEffect)((()=>{p(a.entityTypesUris),m(a.relationTypesUris)}),[a.entityTypesUris,a.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:p}),o().createElement(qe.U,{classes:{root:c.relationTypesSelector},relationTypes:s,selectedRelationTypes:d,enableEmptyValueUnderline:!0,onChange:m}),o().createElement("div",{className:c.footer},o().createElement(z.Button,{className:c.clearAllButton,onClick:()=>{p([]),m([])}},b().text("Clear All")),o().createElement(z.Button,{className:c.cancelButton,onClick:h},b().text("Cancel")),o().createElement(z.Button,{onClick:()=>{i({entityTypesUris:u,relationTypesUris:d}),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)(_,(0,m.pipe)((0,m.prop)("relationshipTable"),(0,m.pick)(["filters"])),(e=>{let{filters:t}=e;const n=Xe(),[a,i]=(0,r.useState)(!1),{entityTypesUris:l,relationTypesUris:s}=t,c=l.length||s.length;return o().createElement("div",{className:n.wrapper},o().createElement(Ve,null),o().createElement(z.IconButton,{className:n.iconButton,onClick:()=>i(!0)},o().createElement(Fe.Z,{className:c?n.activeFiltersIcon:n.inactiveFiltersIcon})),o().createElement(Ye,{open:a,onClose:()=>i(!1)}))}));var Qe=n(65549),Je=n(98808);const et=e=>{const t=(0,a.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)(_,(e=>{let{selectedEntity:t,onAddRelation:n}=e;return{selectedEntity:t,onAddRelation:n}}),(e=>{let{selectedEntity:t,open:n,onClose:i,onAddRelation:l}=e;const s=tt(),c=(0,a.useSelector)(u.ZP.selectors.getMetadata),[p,d]=(0,r.useState)({}),{relation:m,entity:g}=p,{type:f,direction:y}=m||{},[v,x]=(0,r.useState)(!1),E=(0,a.useDispatch)();(0,r.useEffect)((()=>{n&&d({relation:{uri:(0,h.ncP)(),type:null,attributes:{}}})}),[n]);const{inRelationTypes:C,outRelationTypes:w}=et(t.type),O=(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:T,onChangeAttribute:R,onRemoveAttribute:S,onChangeEntity:P,onChangeRelationType:N}=(0,Se.R)({connection:p,onConnectionChange:d,relatedEntity:t});return o().createElement(z.Dialog,{open:n,fullWidth:!0,maxWidth:"sm",onClose:i,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:p,onAddAttributes:T,onChangeAttribute:R,onRemoveAttribute:S,relatedEntity:t,inRelationTypes:C,outRelationTypes:w,onChangeRelationType:N,onChangeEntity:P})),o().createElement(z.DialogActions,null,o().createElement(z.Button,{onClick:i},b().text("Cancel")),o().createElement(z.Button,{disabled:!(null!=p&&p.entity)||!f||v,color:"primary",onClick:()=>{const{type:e,attributes:n={},startDate:r,endDate:o}=m,a=y===h.Nsj.OUT?t.uri:g.uri,s=y===h.Nsj.OUT?g.uri:t.uri;O()&&(x(!0),l({startEntityUri:a,endEntityUri:s,relationType:e,attributes:n,startDate:r,endDate:o}).then((()=>{i()})).catch((e=>{console.error(e)})).finally((()=>{x(!1)})))}},b().text("Add"))))})),rt=(0,X.l)(_,(0,m.pick)(["selectedEntity"]),(e=>{let{selectedEntity:t}=e;const{inRelationTypes:n,outRelationTypes:a}=et(t.type),i=n.length+a.length>0,[l,s]=(0,r.useState)(!1);return i&&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}}),at=()=>{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 it;!function(e){e[e.Relationship=0]="Relationship",e[e.EntityDetails=1]="EntityDetails"}(it||(it={}));const lt=(0,r.memo)((()=>{var e;const t=q(),[n,a]=(0,r.useState)(null),i=(0,r.useCallback)((e=>{a((t=>t===e?null:e))}),[]),l=null!==n,s=(0,r.useMemo)((()=>[{buttonProps:{id:it.Relationship,icon:Y,tooltipTitle:b().text("Relationship")},content:o().createElement(at,null)},{buttonProps:{id:it.EntityDetails,icon:W.Z,tooltipTitle:b().text("Entity Details")},content:o().createElement(ee,null)}]),[]);return o().createElement("div",{className:t.wrapper},o().createElement(G.h,{open:l,width:480},o().createElement(K,null),null===(e=s[n])||void 0===e?void 0:e.content),o().createElement(V.G,{buttonsProps:(0,m.pluck)("buttonProps",s),onButtonClick:i,activeIndexId:n}))}));lt.displayName="GraphRightSidePanel";const st=lt;var ct=n(46339),ut=n(23304);const pt=(e,t,n)=>{var r;if(!t.label)return;const o=n.labelSize,a=n.labelFont,i=n.labelWeight;e.fillStyle=null!==(r=n.labelColor)&&void 0!==r&&r.attribute?t[n.labelColor.attribute]||n.labelColor.color||"#000":n.labelColor.color,e.font=`${i} ${o}px ${a}`,e.fillText(t.label,t.x+t.size+11,t.y+o/3)},dt=(e,t,n)=>{const r=n.labelSize,o=n.labelFont,a=n.labelWeight;if(e.font=`${a} ${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),a=Math.round(r+2+4),i=Math.max(t.size,r/2)+2,l=Math.asin(a/2/i),s=Math.sqrt(Math.abs(Math.pow(i,2)-Math.pow(a/2,2)));e.beginPath(),e.moveTo(t.x+s,t.y+a/2),e.lineTo(t.x+i+o,t.y+a/2),e.lineTo(t.x+i+o,t.y-a/2),e.lineTo(t.x+s,t.y-a/2),e.arc(t.x,t.y,i,l,-l),e.closePath(),e.fill()}else e.beginPath(),e.arc(t.x,t.y,t.size+2,0,2*Math.PI),e.closePath(),e.fill();e.shadowOffsetX=0,e.shadowOffsetY=0,e.shadowBlur=0,pt(e,t,n)};var mt=n(88586);class ht 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,mt.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 gt{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:a}=e;const i=Math.min(128,a);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,a,a,r,0,i,i),this.images[t]={status:"ready",x:r,y:0,width:i,height:i},r+=i})),this.textureImage=n.getImageData(0,0,t.width,t.height),this.hasReceivedImages=!0,this.rebindTextureFns.forEach((e=>e()))}}}const bt={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 ft 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 gt,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(bt.id,bt.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 a=e.image;let i=a&&this.imageLoader.images[a];if("string"!=typeof a||i||this.imageLoader.loadImage(a,a),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,mt.floatColor)(e.color),r[o++]=e.inactive?1:0,i&&"ready"===i.status||(i=this.imageLoader.images[bt.id]),i&&"ready"===i.status){const{width:e,height:t}=this.imageLoader.textureImage;r[o++]=i.x/e,r[o++]=i.y/t,r[o++]=i.width/e,r[o++]=i.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 yt=[{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 vt 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 gt,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])),yt.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 a=t||e.inactive&&!e.highlighted,[i,l]=e.buttonOffset||[0,0];let s=i*i+l*l,c=0,u=0;if(s&&(s=1/Math.sqrt(s),c=l*s,u=i*s),a||!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,mt.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(a||!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,mt.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))}}const xt=e=>{let{children:t}=e;const n=(0,r.useMemo)((()=>({allowInvalidContainer:!0,defaultNodeType:"image",hoverRenderer:dt,labelRenderer:pt,nodeProgramClasses:{image:(0,ut.createNodeCompoundProgram)([ft,ht,vt])},labelFont:"Roboto",labelSize:13,labelColor:{color:"rgba(0, 0, 0, 0.87)"}})),[]);return o().createElement(ct.C6,{graph:d.MultiGraph,style:{background:"transparent"},initialSettings:n},t)};var Et=n(28833),Ct=n.n(Et),wt=n(3660),Ot=n.n(wt),Tt=n(28301),Rt=n.n(Tt),St=n(30634),Pt=n(20562),Nt=n(31181),jt=n(30284);const It=.6,kt=(e,t,n,r,o)=>{if(t.loop){const{size:r,color:o}=t,a=n.x,i=n.y,l=n.size,s=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return{x1:e-7*(n+r),y1:t,x2:e,y2:t+7*(n+r)}}(a,i,.6*l);if(e.strokeStyle=o,e.lineWidth=r,"arrow"===t.type){const{aX:t,aY:n,vX:c,vY:u}=((e,t,n,r,o)=>{const a=o+2,i=Math.sqrt(Math.pow(t-e.x1,2)+Math.pow(n-e.y1,2));return{aX:e.x1+(t-e.x1)*(i-a-r)/i,aY:e.y1+(n-e.y1)*(i-a-r)/i,vX:(t-e.x1)*a/i,vY:(n-e.y1)*a/i}})(s,a,i,l,r);e.beginPath(),e.moveTo(a,i),e.bezierCurveTo(s.x2,s.y2,s.x1,s.y1,t,n),e.stroke(),e.fillStyle=o,e.beginPath(),e.moveTo(t+c,n+u),e.lineTo(t+u*It,n-c*It),e.lineTo(t-u*It,n+c*It),e.lineTo(t+c,n+u),e.closePath(),e.fill()}else e.beginPath(),e.moveTo(a,i),e.bezierCurveTo(s.x1,s.y1,s.x2,s.y2,a,i),e.stroke()}(0,jt.default)(e,t,n,r,o)};function _t(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Lt(e,t,n[t])}))}return e}function Lt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const At=(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,Dt=(0,m.memoizeWith)(((e,t,n)=>n.type),h.uie),Ut={size:24,buttonSize:8,buttonOffset:[19,19]},Zt={size:12,buttonSize:6,buttonOffset:[8,13]},zt=e=>{let{data:t,graph:n,syncLayout:o,workerLayout:i,layoutSettings:l,selectedNode:s,isDirected:c=!1,onNodeClick:p,onNodeCollapse:d,onNodeExpand:m,filters:h}=e;const g=(0,ct.Ys)(),b=(0,ct.sG)(),v=(0,ct.$j)(),x=(0,ct.eP)(),E=(0,a.useSelector)(u.ZP.selectors.getEntity),C=(0,a.useSelector)(u.ZP.selectors.getMetadata),w=(0,a.useSelector)(u.ZP.selectors.getAbsoluteImagePath)||"",[O,T]=(0,r.useState)(void 0),[R,S]=(0,r.useState)(null),[P,N]=(0,r.useState)({});(0,r.useEffect)((()=>{g.getCamera().setState({ratio:1.2})}),[n,g]),(0,r.useEffect)((()=>{if(S((0,y.toUndirected)(n)),b(n),o){const e=o(g.getGraph(),l);(0,Nt.animateNodes)(g.getGraph(),e,{duration:1e3})}if(i){const e=new i(g.getGraph(),l);e.start();const t=setTimeout((()=>{e.stop()}),5e3);return()=>{clearTimeout(t),e.kill()}}}),[t,n,o,i,g,l,b,c]);const j=(0,r.useCallback)((e=>{const t=g.getGraph(),n=null==E?void 0:E.uri;if(t&&R&&n&&e&&n!==e){const r=(0,f.Ar)(c?t:R,n,e),o=((e,t,n)=>{const r=[],o=n?"findOutEdge":"findEdge";return t&&t.reduce(((t,n)=>(r.push(e[o](t,n,(e=>!!e))),n))),r})(t,r,c);return r?{edges:o,nodes:r}:{}}return{}}),[g,null==E?void 0:E.uri,R,c]);(0,r.useEffect)((()=>{N(j(s))}),[s,j]),(0,r.useEffect)((()=>{v({enterNode:e=>{let{node:t}=e;T(t)},leaveNode:()=>{T(void 0)},clickNode:e=>{let{node:t}=e;p(t)},click:e=>{const t=(e=>{let{x:t,y:n}=e;const r=g.viewportToGraph({x:t,y:n}),o=g.getGraph(),a=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 a.length>0?a[0].nodeId:null})(e);if(t){const n=g.getNodeDisplayData(t),r=g.framedGraphToViewport({x:n.x,y:n.y}),o=g.scaleSize(n.buttonOffset[0]),a=g.scaleSize(n.buttonOffset[1]),i=g.scaleSize(n.buttonSize),l=At(e.x,e.y,r.x+o,r.y-a,i),s=At(e.x,e.y,r.x+o,r.y+a,i);n.showExpand&&l&&(m(t),p(t)),n.showCollapse&&s&&(d(t,j(t)),p(t))}}})}),[g,v,p,d,m,j]),(0,r.useEffect)((()=>{const e=g.getGraph(),t=e.neighbors(s);x({nodeReducer:(n,r)=>{const{entityTypesUris:o=[]}=h||{},a=Dt(C,w,{type:r.entityTypeUri}),i=n===s?Ut:Zt,l=e.neighbors(n),c=l.map((t=>e.getNodeAttribute(t,"hidden"))).filter((e=>!!e)).length,u=_t({},r,i,{color:"#0072CE",image:a,showExpand:r.untraversedRelationsCount>0||c>0,showCollapse:r.traversedRelationsCount>1&&l.length-c>1}),p=(P.nodes||[]).includes(n),d=O===n;return p||n===s||n===(null==E?void 0:E.uri)?(u.inPath=!0,n===(null==E?void 0:E.uri)&&(u.color="#00FFFF")):!t||t.includes(n)||s===n||s===(null==E?void 0:E.uri)||p||(d||(u.label=""),u.inactive=!0),d&&(u.highlighted=!0),![s,null==E?void 0:E.uri].includes(n)&&o.length>0&&!o.includes(r.entityTypeUri)&&(u.hidden=!0),u},edgeReducer:(t,n)=>{const{relationTypesUris:r=[]}=h||{},o=_t({},n,{hidden:!1}),a=(P.edges||[]).includes(t);return(s&&s!==(null==E?void 0:E.uri)&&!e.hasExtremity(t,s)&&!a||r.length>0&&!r.includes(n.relationTypeUri))&&(o.hidden=!0),c&&(o.size=3),a&&(o.color="#0072CE",o.size=4),o},renderEdgeLabels:!0,edgeLabelRenderer:kt,defaultEdgeType:c?"arrow":"line"})}),[g,x,O,s,P,null==E?void 0:E.uri,C,w,c,h])};let Bt;function Mt(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){Ft(e,t,n[t])}))}return e}function Ft(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"}(Bt||(Bt={}));const Ht=e=>{let{data:t,graph:n,selectedNode:o,layout:a,onNodeClick:i,onNodeCollapse:l,onNodeExpand:s,filters:c}=e;const u=(0,St.D)(t);(0,Pt.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();Ct().assign(t),e.forEach((e=>{n.setNodeAttribute(e,"x",t.getNodeAttribute(e,"x")),n.setNodeAttribute(e,"y",t.getNodeAttribute(e,"y"))}))}}}),[t]);const p=(0,r.useMemo)((()=>(Ct().assign(n),{settings:Mt({},Ot().inferSettings(n),{gravity:1})})),[n]);return zt({workerLayout:Rt(),layoutSettings:p,data:t,graph:n,selectedNode:o,onNodeClick:i,isDirected:a===Bt.DIRECTED_NETWORK,onNodeCollapse:l,onNodeExpand:s,filters:c}),null};var Gt=n(36039);const Vt=(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)?Vt(o,t,n,r):t},Wt=(e,t,n,r)=>{if(e.length<10&&(t[r]=[...e]),e.length>10){const o=e.slice(10),a=e.slice(0,10);t[r]=a,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 Wt(e,t,n,r)}return t};function qt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const $t=e=>{let{data:t,graph:n,selectedNode:o,layout:a,onNodeClick:i,onNodeCollapse:l,onNodeExpand:s,filters:c}=e;const u=(0,r.useCallback)((e=>{const t=e.copy(),n=(e=>{switch(e){case Bt.VERTICAL_TB:return 180;case Bt.HORIZONTAL_LR:return 270}})(a),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),a=Vt(o,[],new Set,r);return Wt(a[0],[],a,0)})((e=>({nodes:e.nodes().map((e=>({id:e,name:""}))),edges:e.mapEdges(((e,t,n,r)=>({from:n,to:r,key:e,relationTypeUri:""})))}))(t),o),i=(e=>{const t=e.map((e=>e.length));return Math.max(...t)})(r);for(let e=0;e<r.length;++e)for(let n=0;n<r[e].length;++n)t.setNodeAttribute(r[e][n],"x",(s=n,(l=r[e].length)===(c=i)?5*s:1===l?5*(c-1)/2:5*(c-1)/(l+1)*(s+1))),t.setNodeAttribute(r[e][n],"y",10*e);var l,s,c;return Gt.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){qt(e,t,n[t])}))}return e}({},e,{[t]:{x:r,y:o}})}),{})}),[a,o]);return zt({syncLayout:u,data:t,graph:n,selectedNode:o,onNodeClick:i,onNodeCollapse:l,onNodeExpand:s,filters:c}),null};var Yt=n(24737);const Xt=(0,B.Z)({graphTypeSelector:{minWidth:"200px",backgroundColor:"#FAFAFA",opacity:1,height:"40px"},filledInputRoot:{borderRadius:"4px"},valueContainer:{width:"auto",marginLeft:"16px"}}),Kt=(0,X.l)(_,(e=>{let{graphTypeUri:t,setGraphTypeUri:n}=e;return{setGraphTypeUri:n,graphTypeUri:t}}),(e=>{let{graphTypeUri:t,setGraphTypeUri:n}=e;const i=Xt(),l=(0,a.useSelector)(u.ZP.selectors.getMetadata),s=(0,a.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]),p=(0,r.useMemo)((()=>c.find((e=>e.value===t))),[c,t]);return o().createElement(Yt.Z,{classes:{valueContainer:i.valueContainer},className:i.graphTypeSelector,height:42,label:b().text("Graph type"),value:p,options:c,onChange:e=>n(e.value),TextFieldProps:{InputProps:{disableUnderline:!0,classes:{root:i.filledInputRoot}}}})})),Qt=(0,B.Z)({graphLayoutSelector:{minWidth:"202px",backgroundColor:"#FAFAFA",opacity:1,marginLeft:"10px"},filledInputRoot:{borderRadius:"4px",height:"42px"}}),Jt=(0,r.memo)((e=>{let{value:t,onChangeHandler:n}=e;const r=Qt(),a=[{label:b().text("Simple network"),value:Bt.SIMPLE_NETWORK},{label:b().text("Vertical hierarchy"),value:Bt.VERTICAL_TB},{label:b().text("Horizontal hierarchy"),value:Bt.HORIZONTAL_LR},{label:b().text("Directed network"),value:Bt.DIRECTED_NETWORK}];return o().createElement(Yt.Z,{className:r.graphLayoutSelector,label:b().text("Graph layout"),value:a.find((0,m.propEq)("value",t)),options:a,onChange:e=>n(e.value),TextFieldProps:{InputProps:{disableUnderline:!0,classes:{root:r.filledInputRoot}}}})})),en=()=>{const e=(0,ct.Ys)(),t=(0,r.useCallback)((()=>{e.refresh()}),[e]);return o().createElement(ne.Z,{handleWidth:!0,onResize:t})},tn=(0,B.Z)({wrapper:{height:"100%",position:"relative"},selectors:{display:"flex",position:"absolute",top:"12px",right:"16px",zIndex:2},graph:{height:"calc(100% - 5px)"}}),nn=(0,X.l)(_,(e=>{let{data:t,graphologyGraph:n,selectedEntity:r,onEntitySelect:o,onCollapseEntity:a,onExpandEntity:i,relationshipTable:{filters:l}}=e;return{data:t,graph:n,selectedNode:null==r?void 0:r.uri,onNodeSelect:o,onNodeCollapse:a,onNodeExpand:i,filters:l}}),(e=>{let{data:t,graph:n,selectedNode:a,onNodeSelect:i,onNodeCollapse:l,onNodeExpand:s,filters:c}=e;const[u,p]=(0,r.useState)(Bt.SIMPLE_NETWORK),d=tn(),m={data:t,graph:n,selectedNode:a,layout:u,onNodeClick:i,onNodeCollapse:l,onNodeExpand:s,filters:c};return o().createElement("div",{className:d.wrapper},o().createElement("div",{className:d.selectors},o().createElement(Kt,null),o().createElement(Jt,{value:u,onChangeHandler:p})),o().createElement("div",{className:d.graph},n&&o().createElement(xt,null,o().createElement(o().Fragment,null,o().createElement(en,null),u===Bt.SIMPLE_NETWORK||u===Bt.DIRECTED_NETWORK?o().createElement(Ht,m):o().createElement($t,m)))))})),rn=(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"}}))),on=(0,r.memo)((()=>{const e=rn(),t=(0,a.useSelector)(u.ZP.selectors.getEntity),n=(e=>{const{graphLoading:t,data:n,graphologyGraph:o,graphTypeUri:i,setGraphTypeUri:l,onAddRelation:s,onDeleteRelation:c,onCollapseEntity:p,onExpandEntity:d}=R(e),{selectedEntity:g,onEntitySelect:f,selectedEntityLoading:y}=((e,t)=>{const n=(0,T._)(),o=(0,a.useDispatch)(),[i,l]=(0,r.useState)(null),s=(0,r.useRef)({}),[c,p]=(0,r.useState)(!1),d=(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 a=null==t||null===(r=t.entities)||void 0===r?void 0:r.find((0,m.propEq)("uri",e));a&&l(a),p(!0),n(d(e)).then(l).catch((e=>{o(u.ui.actions.errorSet((0,h.xU7)(e,b().text("Something went wrong"))))})).finally((()=>{p(!1)}))}),[o,t,n,d]);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==i?void 0:i.uri)===e.uri));n||(null!=e&&e.uri?(s.current=P({},e),g(e.uri)):(s.current={},l(null)))}),[t]),{selectedEntityLoading:c,selectedEntity:i,onEntitySelect:g}})(e,n);return{graphLoading:t,data:n,graphologyGraph:o,selectedEntity:g,selectedEntityLoading:y,graphTypeUri:i,relationshipTable:k({data:n,selectedEntityUri:null==g?void 0:g.uri,mainEntityUri:null==e?void 0:e.uri,graphTypeUri:i}),onAddRelation:s,onDeleteRelation:c,onCollapseEntity:p,onExpandEntity:d,onEntitySelect:f,setGraphTypeUri:l}})(t),{graphLoading:i}=n;return o().createElement(_.Provider,{value:n},o().createElement("div",{className:e.perspectiveView},i&&o().createElement(p.Z,null),(null==t?void 0:t.uri)&&o().createElement("div",{className:e.graphContainer},o().createElement("div",{className:e.graphWrapper},o().createElement(H,null),o().createElement(nn,null)),o().createElement(st,null))))}));on.displayName="GraphPerspectiveView";const an=on,ln=(0,i.createGenerateClassName)({productionPrefix:"graph",disableGlobal:!0}),sn=e=>{let{store:t}=e;return o().createElement(a.Provider,{store:t},o().createElement(i.StylesProvider,{generateClassName:ln},o().createElement(s.MuiPickersUtilsProvider,{utils:c.Z},o().createElement(an,null),o().createElement(l.Z,{showErrorFromStore:!0}))))}}}]);
package/845.js DELETED
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[845],{20845:(e,t,n)=>{n.d(t,{_:()=>ba,t:()=>Ra});var r=n(24328),o=n.n(r),a=n(52730),l=n(8598),i=n(17440),s=n(36138),c=n(44443),u=n(22664),p=n(39450),m=n(585),d=n(16299);const g=o().createContext({getCurrentPerspectiveId:()=>"",setEntityUri:()=>{},showPerspective:()=>{}});var f=n(87918),b=n.n(f),h=n(3096),y=n.n(h),E=n(87638),v=n(2804),x=n(7718),w=n(3515),S=n(17554),C=n(61756),P=n(57730),O=n(76536),N=n(26481),T=n(49759),k=n(94150),Z=n(26005),R=n(99136),I=n(21077),j=n(67268),D=n(71153),L=n.n(D),A=n(8962);const M=o().createContext(null);M.displayName="SingleAttributeContext";var U=n(60995),F=n(10237),H=n(58662),V=n(94079),z=n(93416),B=n(75512),W=n(30553),_=n(91181),G=n(32152),q=n(36444),$=n(79692);const Q=(0,$.Z)((()=>({triggerButton:{minWidth:0,color:"rgba(0,0,0,0.54)",width:"36px"},popupContent:{paddingTop:"19px",paddingBottom:"23px",paddingLeft:"23px",paddingRight:"23px",maxWidth:"180px",width:"40%"},checkboxControlRoot:{marginTop:"6px",marginLeft:"-12px"},checkboxControlLabel:{fontSize:"0.85rem"},checkboxControlCheckbox:{marginRight:"5px"}}))),X=e=>{let{className:t}=e;const n=Q(),a=(0,r.useRef)(),[l,i]=(0,r.useState)(!1),{showInactive:s,toggleShowInactive:c}=(0,r.useContext)(M),u=()=>i((e=>!e));return o().createElement(o().Fragment,null,o().createElement(V.Button,{ref:a,classes:{root:L()(n.triggerButton,t)},onClick:u},o().createElement(q.Z,null)),o().createElement(V.Popover,{open:l,classes:{paper:n.popupContent},anchorEl:a.current,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},o().createElement(V.FormControlLabel,{classes:{root:n.checkboxControlRoot,label:n.checkboxControlLabel},control:o().createElement(V.Checkbox,{className:n.checkboxControlCheckbox,checked:s,onChange:e=>c(e.target.checked)}),label:b().text("Show inactive values")})))},Y=(0,$.Z)((()=>({root:{padding:"0 4px 0 16px"},totalCaption:{lineHeight:"19px",fontSize:"14px",letterSpacing:"0.24px",color:"rgba(0,0,0,0.6)",flexShrink:0,justifyContent:"flex-start",paddingTop:"16px",paddingBottom:"13px"},ovIcon:{marginTop:"2px",marginLeft:"5px"}}))),K=e=>{let{caption:t,totalVisibleValues:n,showInactiveValuesMenu:a}=e;const l=Y(),{searchQuery:i,setSearchQuery:s,setPage:c,totalNonVisibleValues:u,nonVisibleValues:p,attributeType:m}=(0,r.useContext)(M);return o().createElement(z.Z,{title:b().text(t),className:l.root},o().createElement(B.Z,{widthToHide:500},o().createElement(W.Z,{height:24,margin:16}),o().createElement(V.Typography,{className:l.totalCaption,variant:"caption"},b().number(n)," ",1===n?b().text("item"):b().text("items"))),o().createElement(_.Z,{nonOvTotal:u,className:l.ovIcon,nonOvValues:p,attributeType:m}),o().createElement(G.i,{query:i,onChange:e=>{s(e),c(0)}}),a&&o().createElement(X,null))};var J=n(65549),ee=n(93140),te=n(76134),ne=n(96698);const re=(0,$.Z)((e=>({moreButton:{padding:"9px 16px 9px 12px",backgroundColor:"rgba(98, 2, 238, 0)",marginBottom:"4px"},buttonLabel:{fontSize:"14px",fontWeight:500,lineHeight:"16px"},icon:{fontSize:"18px",marginRight:"8px"},divider:{margin:"0 -16px 8px",backgroundColor:"rgba(0,0,0,0.12)"},ovFalse:e.inactive}))),oe=d.nIW,ae=(e,t)=>"object"==typeof e?Object.values(e).some((e=>e.some((e=>{let{value:n}=e;return ae(n,t)})))):d.P6Y.strings.search(String(e),t),le=async e=>{let{metadata:t,entity:n,attributeTypeUri:r,defaultMaxValues:o=1/0,offset:a=0,searchQuery:l=""}=e;const s=(0,i.pipe)(d.XtP,(0,i.filter)((e=>{let{value:t}=e;return ae(t,l)})))(t,n,r),c=(0,i.filter)(d.OXP,s);return{[(0,d.xy8)(r)]:{[oe(r)]:c.slice(a,a+o),paging:{[r]:{totalOvValues:c.length,totalValues:s.length}}}}};function ie(){return ie=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ie.apply(this,arguments)}function se(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){ce(e,t,n[t])}))}return e}function ce(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ue=[],pe=e=>{let{values:t,attributeType:n,parentUri:l,showInactive:s}=e;const c=re(),{uri:u,required:m,cardinality:g,name:f}=n,h=(0,a.useDispatch)(),y=(0,r.useContext)(p.m),v=(0,a.useSelector)(E.ZP.selectors.getEntity),x=(0,a.useSelector)((e=>E.ZP.selectors.getModifiedEntity(e,v.uri)||{})),w=(0,a.useSelector)((e=>E.ZP.selectors.getActiveErrorsForAttributesPager(e,l,n))),S=(0,a.useSelector)((e=>(0,d.tQX)(l,n,E.ZP.selectors.getProfileErrors(e)))),C=(0,a.useSelector)(E.ZP.selectors.getMode),P=(0,d.xy8)(n),O=(0,i.pipe)((0,i.pathOr)(ue,[P,f]),(0,i.map)((0,i.prop)("uri")))(v),N=(0,i.pathOr)(ue,[P,f],x),T=N.map((0,i.prop)("uri")),k=(0,d.ZiX)(v.uri),Z=(0,r.useRef)((0,d.gjI)({parentUri:l,attributeType:n})),R=(0,d.O27)(N),I=m&&R,j=I?[Z.current]:N.filter((0,i.pipe)((0,i.prop)("uri"),d.ZiX)),D=(0,r.useCallback)((e=>(0,i.pipe)(E.N5.actions.addAttributes,h)(e.map((e=>se({},e,{viewId:y}))))),[y,h]),A=(0,r.useCallback)((e=>(0,i.pipe)(E.N5.actions.modifyAttribute,h)(se({},e,{viewId:y}))),[y,h]),M=(0,r.useCallback)((e=>(0,i.pipe)(E.N5.actions.removeAttribute,h)(se({},e,{viewId:y}))),[y,h]),U=(0,r.useCallback)((0,i.pipe)(E.N5.errors.actions.errorDeactivated,h),[h]),F=(0,r.useCallback)((()=>{const e={parentUri:l,attributeType:n};return D(I&&!(0,d.YkM)(n.type)?[e,e]:[e])}),[D,l,n,I]),H=(0,d.Vg3)({attributeType:n,mode:C}),z={attributeType:n,errors:w,crosswalks:x.crosswalks,mode:C,onAddAttributes:D,onChangeAttribute:A,onDeactivateError:U,showNonOv:s};return o().createElement("div",null,o().createElement(ee.Z,{cardinality:g}),o().createElement(te.Z,{message:S}),H&&o().createElement(V.Button,{color:"primary",onClick:F,className:c.moreButton},o().createElement(J.Z,{classes:{root:c.icon}}),o().createElement("div",{className:c.buttonLabel},b().text("Add"))),j.map(((e,t)=>o().createElement(ne.Z,ie({key:e.uri},z,{attributeValue:e,lazy:I&&!m,showEmptyEditors:k,ownError:(0,d.ADq)(e,t,u,w),onDeleteAttribute:M})))),j.length>0&&t.length>0&&o().createElement(V.Divider,{className:c.divider}),t.map((e=>{const t=N.find((0,i.propEq)("uri",e.uri)),n=t||e,r=O.includes(n.uri)&&!T.includes(n.uri),a=!r&&t&&!((e,t)=>{const n=(0,i.is)(Object,e.value)||(0,i.is)(Object,t.value)?(0,i.over)((0,i.lensPath)(["value"]),(0,d.vKJ)({valueTransformer:(0,i.unless)(d.OXP,(0,i.omit)(["value"])),deleteEmptyComplex:!0})):i.identity;return(0,i.equals)(n(e),n(t))})(t,e),l=(0,i.cond)([[(0,i.always)(r),(0,i.always)("deleted")],[(0,i.always)(a),(0,i.always)("edited")]])();return o().createElement("div",{key:n.uri,className:L()({[c.ovFalse]:!(0,d.OXP)(n)})},o().createElement(ne.Z,ie({},z,{attributeValue:n,ownError:(0,d.ADq)(n,null,u,w),onDeleteAttribute:M,state:l})))})))};var me=n(81303);const de=(0,$.Z)((e=>({ovFalse:e.inactive}))),ge=e=>{let{values:t,attributeType:n,showInactive:r}=e;const a=de();return o().createElement(o().Fragment,null,t.map((e=>o().createElement("div",{key:e.uri,className:L()({[a.ovFalse]:!(0,d.OXP)(e)})},o().createElement(me.Z,{attributeValue:e,attributeType:n,showNonOv:r})))))},fe=(0,$.Z)((()=>({root:{display:"flex",flexDirection:"column"},content:{position:"relative",padding:"4px 16px 9px",overflow:"auto",flexGrow:1},noData:{fontSize:"13px",color:"rgba(0,0,0,0.54)"},pagination:{flexGrow:0,flexShrink:0}}))),be=e=>{let{config:t,className:n}=e;const{caption:l,max:i,showInactiveValuesMenu:s}=t,c=fe(),{values:u,totalVisibleValues:p,page:m,setPage:d,isLoading:g,hasPaging:f,attributeType:h,showInactive:y}=(0,r.useContext)(M),v=(0,a.useSelector)(E.ZP.selectors.getEntityUri),x=(0,a.useSelector)(E.ZP.selectors.getIsViewMode),w=(0,a.useSelector)(E.ZP.selectors.getIsEditableMode),S=(0,a.useSelector)(E.ZP.selectors.getPivotingAttributes),C=0!==u.length;return o().createElement(U.J.Provider,{value:S},o().createElement(F.Z,{className:L()(c.root,n)},o().createElement(K,{totalVisibleValues:p,caption:l,showInactiveValuesMenu:s}),o().createElement(V.Box,{className:c.content},(()=>{if(g)return o().createElement(R.Z,null);if(h){if(x&&C){const e={values:u,attributeType:h,showInactive:y};return o().createElement(ge,e)}if(w){const e={values:u,attributeType:h,parentUri:v,showInactive:y};return o().createElement(pe,e)}}return o().createElement(V.Typography,{className:c.noData},b().text("No data"))})()),f&&o().createElement(H.Z,{count:p,page:m,rowsPerPage:i,rowsPerPageOptions:[],onChangePage:d,classes:{root:c.pagination}})))};var he=n(67218),ye=n(20562);function Ee(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ve=(e,t,n)=>{const{attributeUri:o,max:l=15}=e,s=(0,a.useSelector)(E.ZP.selectors.getMetadata),[c,u]=(0,r.useState)([]),[p,m]=(0,r.useState)(null),[g,f]=(0,r.useState)(!1),b=(0,he._)(),h=(0,r.useRef)(null),y=(0,a.useDispatch)(),v=(0,a.useSelector)(E.ZP.selectors.getApiPath),x=(0,a.useSelector)(E.ZP.selectors.getTenant),w=n?E.ZP.selectors.getEntityWithDiff:E.ZP.selectors.getEntityWithoutDiff,S=(0,a.useSelector)(w),C=(0,a.useSelector)(E.ZP.selectors.getIsViewMode),P=(0,a.useSelector)(E.ZP.selectors.getIsHistoryModeEnabled),O=(0,a.useSelector)(E.ZP.selectors.getHistoryDiff),N=S.uri,T=oe(o),k=(0,d.xy8)(o);h.current=(0,d.JQy)(S,N,T);const Z=(0,r.useMemo)((()=>(0,d.zeJ)(s,o)),[s,o]),{globalFilter:R}=(0,a.useSelector)(E.ZP.selectors.getGlobalSearchRequestOptions),{showInactive:I}=t,j=(0,r.useCallback)((()=>{if(Z&&(0,d.Uty)(Z)&&!(0,d.ZiX)(N)&&(0,d.YOQ)(o)){f(!0);const{page:e,showInactive:n}=t,r=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,["page","showInactive"]),a=(0,d.biM)(S)||P?le:d.KbL;b(a(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Ee(e,t,n[t])}))}return e}({metadata:s,entity:S,apiPath:v,tenant:x,parentUri:N,defaultMaxValues:l,attributeTypeUri:o,offset:l*e,globalFilter:R,options:n?"":void 0},r))).then((e=>{const t=(0,i.path)([k],e),n=(0,i.pathOr)([],[T],t);P||y(E.N5.actions.processNextPageOfAttributeValues({parentUri:N,attributeTypeUri:o,attributeTypeName:T,values:n})),u(n.map((e=>{var t;return(null===(t=h.current)||void 0===t?void 0:t.find((0,i.propEq)("uri",e.uri)))||e}))),m((0,i.path)(["paging",o],t))})).finally((()=>{f(!1)}))}else u([]),m(null)}),[v,N,x,o,l,s,t,R,Z,P,O]);(0,r.useEffect)((()=>{j()}),[j]),(0,ye.D)((()=>{C&&j()}),[C]);const D=(0,i.partition)(d.OXP),[,L]=D(h.current||[]),A=I?[]:L,M=I?"totalValues":"totalOvValues",U=(0,i.ifElse)((0,i.has)(M),(0,i.prop)(M),(0,i.always)(c.length))(p),F=l<U,H=null!=p&&p.totalValues?p.totalValues-U:A.length;return{values:c,isLoading:g,hasPaging:F,totalVisibleValues:U,attributeType:Z,totalNonVisibleValues:H,nonVisibleValues:A}};function xe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var we=n(37152),Se=n(31274),Ce=n(79026),Pe=n(8818),Oe=n(90324),Ne=n(70595);const Te=o().createContext(null);Te.displayName="RelationsViewStateContext";const ke=(0,$.Z)((e=>({button:{color:e.palette.text.secondary,width:"36px",minWidth:"36px"},popupContent:{padding:"19px 23px"},checkboxControlLabel:{fontSize:"0.85rem"},checkboxControlCheckbox:{marginRight:"5px"},divider:{backgroundColor:"rgba(0,0,0,0.1)",margin:"19px -23px"},title:{marginBottom:"30px"},sortControls:{display:"flex",alignItems:"center"},sortSelectorRoot:{flex:1,padding:"13px 16px",fontSize:"0.85rem"},sortSelectorMenuItem:{fontSize:"0.85rem"},sortOrderButton:{flexShrink:0,margin:"0 8px 0 7px"}}))),Ze=e=>{let{className:t}=e;const n=ke(),a=(0,r.useRef)(),{showInactive:l,toggleShowInactive:i,sortOrder:s,toggleSortOrder:c,sortOption:u,changeSortOption:p,sortOptions:m}=(0,r.useContext)(Te),[g,f]=(0,r.useState)(!1),h=()=>f((e=>!e)),y=!(0,d.O27)(m),E="asc"===s;return o().createElement(o().Fragment,null,o().createElement(V.Button,{ref:a,classes:{root:L()(n.button,t)},onClick:h},o().createElement(q.Z,null)),o().createElement(V.Popover,{open:g,classes:{paper:n.popupContent},anchorEl:a.current,onClose:h,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},o().createElement(V.FormControlLabel,{classes:{label:n.checkboxControlLabel},control:o().createElement(V.Checkbox,{className:n.checkboxControlCheckbox,checked:l||!1,onChange:i}),label:b().text("Show inactive Relationships")}),y&&o().createElement(o().Fragment,null,o().createElement(V.Divider,{className:n.divider}),o().createElement(V.Typography,{className:n.title,variant:"h6"},b().text("Sort by")),o().createElement("div",{className:n.sortControls},o().createElement(Ce.Z,{entries:m,TextFieldProps:{variant:"filled"},classes:{root:n.sortSelectorRoot,menuItem:n.sortSelectorMenuItem},fullWidth:!0,disableUnderline:!0,value:u,onChange:p,MenuProps:{getContentAnchorEl:null,anchorOrigin:{vertical:"bottom",horizontal:"left"}}}),o().createElement(Pe.k,{tooltipTitle:E?b().text("Ascending"):b().text("Descending"),icon:E?Oe.Z:Ne.Z,onClick:c,className:n.sortOrderButton,size:"L"})))))};Ze.displayName="FilterButton";const Re=Ze,Ie=(0,$.Z)({header:{padding:"0 6px 0 16px"},totalCaption:{lineHeight:"19px",fontSize:"14px",letterSpacing:"0.24px",color:"rgba(0,0,0,0.6)",flexShrink:0,marginRight:"5px",justifyContent:"flex-start",paddingTop:"16px",paddingBottom:"13px"}});var je=n(61932),De=n(55847);const Le=o().createContext(null);function Ae(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Me(e,t,n[t])}))}return e}function Me(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ue=Math.pow(2,31)-1,Fe=(0,$.Z)((()=>({tenant:{backgroundColor:"#0000EE",cursor:"pointer",position:"absolute",top:"8px",left:"22px",width:"10px",height:"10px",color:"white",fontSize:"10px",fontWeight:"bold",userSelect:"text",zIndex:1,display:"flex",alignItems:"center",justifyContent:"center"},button:{position:"relative"},badge:{fontSize:"10px",height:"14px",minWidth:"14px",width:"14px",fontWeight:"bold",backgroundColor:"#FF4081",color:"#FFF"},badgePosition:{right:"5px",top:"4px"}})));var He=n(81137);const Ve=e=>{let{label:t}=e;const n=Fe();return o().createElement(V.Badge,{classes:{anchorOriginTopRightRectangle:n.badgePosition,badge:n.badge},badgeContent:t},o().createElement(je.Z,null))},ze=()=>{const{tenants:e,selectedTenant:t,onConfirmImport:n,onCancelConfirmation:l,onImportClick:i}=(()=>{var e;const t=(0,a.useSelector)(E.ZP.selectors.getDataTenants),n=(0,a.useDispatch)(),{config:o,reloadRelations:l}=(0,r.useContext)(Le),i=(0,a.useSelector)(E.ZP.selectors.getEntityUri),[s,c]=(0,r.useState)([]),[u,p]=(0,r.useState)(null),m=(0,a.useSelector)(E.ZP.selectors.getDtssPath),g=(0,a.useSelector)(E.ZP.selectors.getTenant),f=[Ae({},o.content,{offset:0,max:null!==(e=o.maxDtssImport)&&void 0!==e?e:Ue})],h=(0,r.useCallback)((()=>{c([]),o.importFromDT&&!(0,d.ZiX)(i)&&Promise.all((t||[]).map((e=>(0,d.QXb)({entityUri:i,content:f,dtssPath:m,customerTenant:g,dataTenant:e.id}).then((t=>{let{hasNonImportedConnections:n}=t;return Ae({},e,{hasNonImportedConnections:n})}))))).then((e=>e.filter((e=>e.hasNonImportedConnections)))).then(c)}),[i,m,g,o,t]),y=(0,r.useCallback)((()=>{(0,d.MOC)({entityUri:i,content:f,dtssPath:m,customerTenant:g,dataTenant:u.id}).then((()=>{l(),h()})).catch((e=>n(E.ui.actions.errorSet((0,d.xU7)(e,b().text("Something went wrong")))))),p(null)}),[i,m,g,o,h,l,u,p]);(0,r.useEffect)((()=>{h()}),[h]);const v=(0,r.useCallback)((()=>p(null)),[]),x=(0,r.useCallback)((e=>p(e)),[]);return{tenants:s,selectedTenant:u,onConfirmImport:y,onCancelConfirmation:v,onImportClick:x}})(),s=Fe(),c=1===e.length,u=c?0===e[0].label.indexOf("DT:")?e[0].label[3]:e[0].label[0]:e.length;return o().createElement(o().Fragment,null,!!e.length&&o().createElement(o().Fragment,null,c?o().createElement("div",{className:s.button},o().createElement(Pe.k,{size:"L",icon:je.Z,tooltipTitle:b().text("Import connections from ${label}",{label:e[0].label}),onClick:()=>i(e[0])}),o().createElement("div",{className:L()(s.tenant)},u)):o().createElement(De.Z,{menuId:"importDT-table-actions",buttonComponent:Pe.k,buttonProps:{tooltipTitle:b().text("Import connections"),size:"L",icon:()=>o().createElement(Ve,{label:u})},menuItems:e.map((e=>({onClick:()=>{i(e)},text:e.label})))}),o().createElement(He.Z,{open:!!t,title:b().text("Confirmation"),content:b().text("Import connections from ${label}?",{label:null==t?void 0:t.label}),discardCaption:b().text("Cancel"),saveCaption:b().text("Import"),onDiscard:l,onSave:n})))},Be=e=>{let{title:t,total:n}=e;const a=Ie(),{searchQuery:l,changeSearchQuery:i}=(0,r.useContext)(Te);return o().createElement(z.Z,{title:t||"",className:a.header},n>0&&o().createElement(B.Z,{widthToHide:400},o().createElement(W.Z,{height:24,margin:16}),o().createElement(V.Typography,{className:a.totalCaption,variant:"caption"},n>1?b().text("${count} items",{count:n}):b().text("${count} item",{count:n}))),o().createElement(G.i,{query:l,onChange:i}),o().createElement(ze,null),o().createElement(Re,null))};var We=n(11013),_e=n(27604),Ge=n(22983),qe=n(31254),$e=n(31039);const Qe=(0,$.Z)((e=>({tooltip:e.tooltip,tooltipContent:{minWidth:"165px",padding:"4px 2px 2px"},label:{fontSize:"11px",lineHeight:"13px",fontWeight:500,margin:0,color:"white"},secondaryLabel:{color:"rgba(255, 255, 255, 0.7)",fontSize:"10px",marginTop:"4px",fontWeight:500,lineHeight:"11px"},progress:{marginTop:"4px",color:"#FFFFFF"}})));function Xe(){return Xe=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xe.apply(this,arguments)}const Ye=e=>{let{label:t,entity:n,children:l}=e,s=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["label","entity","children"]);const c=Qe(),u=(0,he._)(),p=(0,a.useSelector)(E.ZP.selectors.getTenant),m=(0,a.useSelector)(E.ZP.selectors.getDtssPath),[g,f]=(0,r.useState)(!1),[b,h]=(0,r.useState)(null);(0,r.useEffect)((()=>{h(null)}),[n]);const y=(0,r.useCallback)((()=>{if(null!=n&&n.entityUri&&(0,i.isNil)(b)){const e=(0,i.ifElse)(d.biM,(e=>(0,d.vTU)({entityUri:e.entityUri,dataTenant:e.dataTenant,customerTenant:p,dtssPath:m})),(e=>(0,d.XkT)(e.entityUri)));f(!0),u(e(n)).then((e=>{let{secondaryLabel:t}=e;h(t)})).finally((()=>{f(!1)}))}}),[m,n,p,u,b]),v=o().createElement("div",{className:c.tooltipContent},o().createElement("div",{className:c.label},t),g&&o().createElement(V.CircularProgress,{size:16,classes:{colorPrimary:c.progress}}),b&&o().createElement("div",{className:c.secondaryLabel},b));return o().createElement(V.Tooltip,Xe({onOpen:y,title:v,disableFocusListener:!0,classes:{tooltip:c.tooltip}},s),l)},Ke=(e,t)=>{const{entity:n,relation:r}=e;return{entityType:(0,d.nt9)(t,null==n?void 0:n.entityType),entityLabel:(0,d.idV)(null==n?void 0:n.entityLabel),preparedUri:(0,d.wwR)({uri:null==n?void 0:n.entityUri,dataTenant:null==n?void 0:n.dataTenant}),relationLabel:(null==r?void 0:r.relationLabel)||(0,d.Lmx)(t,null==r?void 0:r.relationType)}};var Je=n(77277);const et=(0,$.Z)((()=>({container:{display:"flex"}})));function tt(){return tt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tt.apply(this,arguments)}const nt=e=>{let{acceptRelation:t,ignoreRelation:n}=e,r=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["acceptRelation","ignoreRelation"]);const a=et();return o().createElement("div",{className:a.container},o().createElement(Je.Z,tt({onClick:t,variant:"text",color:"primary"},r,{style:{alignSelf:"center"}}),b().text("Accept")),o().createElement(Je.Z,tt({onClick:n,variant:"text",color:"primary"},r,{style:{alignSelf:"center"}}),b().text("Ignore")))},rt=(0,$.Z)((e=>({container:{display:"flex",flexDirection:"column",marginBottom:"2px"},row:{display:"flex",alignItems:"center",flexDirection:"row",minHeight:"24px",padding:"0 16px"},rowInactive:{background:e.inactiveBackground},entityAvatar:{height:"12px",width:"12px",fontSize:"11px",marginRight:"8px"},entityLabelContainer:{textDecoration:"none",cursor:"pointer",paddingRight:"8px"},entityLabel:{color:e.palette.primary.main,fontSize:"13px",letterSpacing:0,lineHeight:"15px"},relationLabel:{color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0,lineHeight:"15px"},editButtonsContent:{marginLeft:"auto",flex:"0 0 40px"},editButtons:{padding:0},removed:{color:e.palette.text.secondary,textDecoration:"line-through"},editedLabel:{fontStyle:"italic",color:e.palette.text.secondary,margin:"0 5px"}}))),ot=(0,r.memo)((e=>{let{connection:t,metadata:n,showControls:a,onRemoveRelation:l,onEditRelation:i,onAcceptRelation:s,onIgnoreRelation:c,renderRelationArrowButton:u}=e;const p=rt(),{entity:m,relation:g}=t,f=(0,d.$qe)(t),h=(0,d.xr3)(t),y=(0,d.iJH)(t),{entityType:E,entityLabel:v,preparedUri:x,relationLabel:w}=Ke(t,n),S=(0,d.Fn9)(g)&&(0,d.Fn9)(m),{canRemove:C,canUpdate:P}=(e=>{let{metadata:t,mode:n,connection:r,onRemoveRelation:o,onEditRelation:a}=e;if((n===d.ARY.Editing||n===d.ARY.Suggesting)&&r){const{relation:{relationType:e}}=r,l=(0,d.$qe)(r),i=(0,d.V3K)(t,e);return{canRemove:o&&!l&&(0,d.Edd)(n,i),canUpdate:a&&!l&&(0,d.Z5t)(n,i)}}return{canRemove:!1,canUpdate:!1}})({mode:d.ARY.Editing,onRemoveRelation:l,onEditRelation:i,metadata:n,connection:t}),O=(0,r.useCallback)((()=>l(t.relation.relationUri)),[l,t]),N=(0,r.useCallback)((()=>i(t)),[i,t]),T=(0,r.useCallback)((()=>{s(t)}),[s,t]),k=(0,r.useCallback)((()=>c(t)),[c,t]),Z=(C||P)&&a&&!t.suggested?o().createElement(o().Fragment,null,P&&o().createElement(Pe.k,{icon:_e.Z,size:"XS",onClick:N,tooltipTitle:b().text("Edit")}),C&&o().createElement(Pe.k,{icon:Ge.Z,size:"XS",onClick:O,tooltipTitle:b().text("Remove")})):void 0,R=t.suggested?o().createElement(nt,{acceptRelation:T,ignoreRelation:k,size:"small",disabled:y}):void 0,I=y?b().text("ignored"):b().text("edited");return o().createElement("div",{className:L()(p.container,{[p.rowInactive]:!S},{[p.removed]:f||y})},o().createElement("div",{className:p.row},u&&u(),o().createElement(qe.Z,{className:p.entityAvatar,entityType:E}),o().createElement($e.Z,{value:x,className:p.entityLabelContainer},o().createElement(Ye,{label:v,entity:m},o().createElement("span",{className:p.entityLabel},v)),(h||y)&&o().createElement(V.Typography,{variant:"caption",className:p.editedLabel},"(",I,")"),w&&o().createElement("span",{className:p.relationLabel},`, ${w}`)),o().createElement("div",{className:p.editButtonsContent},Z),R))})),at=(e,t)=>{const n=(e,t)=>(t?(0,d.VGB)(t):[]).map((t=>({type:t,direction:e===d.Nsj.IN?d.Nsj.IN:d.Nsj.OUT})));return n(d.Nsj.IN,e).concat(n(d.Nsj.OUT,t))[0]};function lt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var it=n(98989),st=n(83543);const ct=(0,$.Z)({arrowIcon:{fontSize:"16px",marginRight:"6px"}}),ut=e=>{let{onClick:t,connection:n,config:r,showSecondLevel:a}=e;const l=ct(),{parentEntityUri:i}=n,{contentSecondLevel:s}=r,c={onClick:t,className:l.arrowIcon};return i||!s||(0,d.xvW)(n)?null:a?o().createElement(st.Z,c):o().createElement(it.Z,c)},pt=(0,$.Z)({row:{display:"flex",alignItems:"center",width:"100%"},secondLevelContent:{paddingLeft:"24px"}}),mt=e=>{let{config:t,connection:n,children:l}=e;const i=pt(),{showInactive:s}=(0,r.useContext)(Te),{connections:c,showSecondLevel:u,toggleShowSecondLevel:p,loadRelations:m,loading:g,total:f}=(e=>{let{config:t,connection:n,relationActivityFilter:o}=e;const l=(0,a.useDispatch)(),[i,s]=(0,r.useState)(!1),[c,u]=(0,r.useState)(!1),[p,m]=(0,r.useState)(0),{contentSecondLevel:g}=t,{entity:f}=n,b=(0,a.useSelector)((e=>E.ZP.selectors.getConnectionsWithDraftsByViewId(e,t.id,f.entityUri)))||[],{activityFilter:h}=(0,a.useSelector)(E.ZP.selectors.getGlobalSearchRequestOptions)||{},y=(0,r.useCallback)((()=>{const e=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){lt(e,t,n[t])}))}return e}({},g,{returnObjects:!0,returnDates:!0,activeness:{relation:o||d.Ng6.ALL,entity:h}});u(!0),(0,d.N6e)(f.entityUri,[e]).then((e=>{const{connections:n,total:r}=e[0];n&&l(E.N5.relations.actions.secondLevelRelationsLoaded({connections:n,parentEntityUri:f.entityUri,id:t.id})),m(r),u(!1)}))}),[t.id,g,l,f.entityUri,h,o]),v=(0,r.useCallback)((()=>{i||n.connections||y(),s((e=>!e))}),[y,n.connections,i]);return{connections:b,showSecondLevel:i,toggleShowSecondLevel:v,loadRelations:y,loading:c,total:p}})({config:t,connection:n,relationActivityFilter:s?d.Ng6.ALL:d.Ng6.ACTIVE_ONLY}),b=(0,r.useMemo)((()=>(0,d.Px$)(c)),[c]);return o().createElement(o().Fragment,null,l((()=>o().createElement(ut,{onClick:p,connection:n,config:t,showSecondLevel:u}))),u&&o().createElement(Se.X.Provider,{value:b},o().createElement("div",{className:i.secondLevelContent},o().createElement(Bt,{isLoading:g,config:t,loadRelations:m,connections:c,total:f,parentEntityUri:n.entity.entityUri}))))},dt=(0,$.Z)((e=>({moreButton:{padding:"9px 16px 9px 12px",backgroundColor:"rgba(98, 2, 238, 0)",marginBottom:"4px",marginLeft:"16px"},buttonLabel:{fontSize:"14px",fontWeight:500,lineHeight:"16px"},icon:{fontSize:"18px",marginRight:"8px"},divider:{margin:"0 0 8px",backgroundColor:"rgba(0,0,0,0.12)"},noData:{fontSize:"13px",color:e.palette.text.secondary,padding:"8px 16px"}}))),gt=e=>{let{className:t,connections:n=[],config:l,mode:s,noDataText:c,parentEntityUri:u}=e;const p=(0,a.useSelector)(E.ZP.selectors.getMetadata),m=(0,a.useSelector)((e=>E.ZP.selectors.getRelationToAddByViewId(e,l.id))),g=(0,a.useSelector)((e=>E.ZP.selectors.getRelationsToEditByViewId(e,l.id))),f=(0,a.useSelector)(E.ZP.selectors.getEntity),h=(0,a.useSelector)((e=>E.ZP.selectors.getCheckIfCanAddRelations(e,l.content))),y=(0,a.useDispatch)(),v=dt(),x=(0,r.useCallback)((()=>{const e=(0,d.vlo)({config:l,mode:s,metadata:p,parentEntityUri:u});(0,i.pipe)(E.N5.relations.actions.openRelationEditor(l.id),y)(e)}),[l,s,p,y,u]),w=(0,r.useCallback)((e=>{y(E.N5.relations.actions.closeRelationEditor(l.id,e)),y(E.N5.relations.actions.removeRelation(l.id,e));const t=n.find((t=>E.N5.relations.selectors.getRelationUriFromConnection(t)===e)),r=E.N5.relations.selectors.getEntityUriFromConnection(t);(0,d.ZiX)(r)&&y(E.N5.modifiedEntities.actions.entityDeleted(r))}),[l,n,y]),S=l.content,C=at(S.inRelations,S.outRelations),P=(0,r.useCallback)((e=>{const t=(0,i.pipe)((0,i.omit)(["suggested"]),(0,i.evolve)({relation:{relationType:(0,i.always)(C.type),object:(0,i.evolve)({type:(0,i.always)(C.type),attributes:(0,i.always)(null)})}}))(e);y(E.N5.relations.actions.addRelation(l.id,t))}),[y,l,C]),O=(0,r.useCallback)((e=>{y(E.N5.relations.actions.ignoreRelation(l.id,{relationType:C.type,relationDirection:C.direction,entityUri:e.entity.entityUri,relationUri:e.relation.relationUri}))}),[y,l,C]),[N,T]=(0,i.partition)(d.xvW,n),k=f&&h,Z=0===N.length&&0===T.length,R=e=>{var t,n;const r=g.find((t=>{var n,r;return(null==t||null===(n=t.relation)||void 0===n?void 0:n.relationUri)===(null==e||null===(r=e.relation)||void 0===r?void 0:r.relationUri)})),a=!l.allowOnlyCreateNew||(0,d.xvW)(e),c=`${null==e||null===(t=e.relation)||void 0===t?void 0:t.relationUri}-${null==e||null===(n=e.relation)||void 0===n?void 0:n.direction}`;return o().createElement(mt,{config:l,connection:e,key:c},(t=>r?o().createElement(We.Z,{connection:r,config:l,mode:s,metadata:p}):o().createElement(ot,{renderRelationArrowButton:t,connection:e,metadata:p,showControls:a,onRemoveRelation:w,onEditRelation:(0,i.pipe)(E.N5.relations.actions.openRelationEditor(l.id),y),onAcceptRelation:P,onIgnoreRelation:O})))},I=k&&(!m||m&&m.parentEntityUri===u),j=m&&m.parentEntityUri===u;return o().createElement("div",{className:t},I&&o().createElement(V.Button,{color:"primary",onClick:x,className:v.moreButton},o().createElement(J.Z,{classes:{root:v.icon}}),o().createElement("div",{className:v.buttonLabel},b().text("Add"))),j&&o().createElement(We.Z,{connection:m,config:l,mode:s,metadata:p}),N.map(R),N.length>0&&T.length>0&&o().createElement(V.Divider,{className:v.divider}),T.map(R),Z&&o().createElement(V.Typography,{className:v.noData},c))};var ft=n(19603),bt=n(94646),ht=n(78101),yt=n(80931);const Et=(0,$.Z)((e=>({attributesList:{paddingLeft:"46px",paddingRight:"16px",marginBottom:"10px",color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0}})));function vt(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){xt(e,t,n[t])}))}return e}function xt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const wt=e=>{let{connection:t,className:n}=e;const l=Et(),{relation:s}=t,c=(0,a.useSelector)(E.ZP.selectors.getEntityUri),u=(0,a.useSelector)(E.ZP.selectors.getMetadata),p=(0,r.useMemo)((()=>(0,d.xF8)(u,null==s?void 0:s.relationType)),[null==s?void 0:s.relationType,u]),m=(0,r.useMemo)((()=>vt({attributes:vt({},E.N5.relations.selectors.getRelationAttributesFromConnection(t))},(0,d.p2l)((null==t?void 0:t.relation)||{}))),[t]),g=(0,r.useMemo)((()=>(0,d.fyF)(p,m)),[p,m]).filter((e=>{let{values:t}=e;return!(0,d.O27)(t)})).length>0,f=(0,r.useMemo)((()=>(0,d.R$r)(m.attributes)),[m]),{getCommentsCount:h}=(0,r.useContext)(w.h);(0,r.useEffect)((()=>{!(0,i.isEmpty)(f)&&h(f)}),[h,f]);const y=(0,r.useMemo)((()=>(0,d.wp9)(d.q7e.RELATION,{entityUri:c,connection:t})),[t,c]);return g?o().createElement(ht.A.Provider,{value:y},o().createElement(yt.Z,{className:L()(l.attributesList,n),entity:m,attrTypes:p})):o().createElement("div",{className:L()(l.attributesList,n)},b().text("No attributes"))};var St=n(86602),Ct=n(82726);const Pt=e=>{let{show:t,onToggle:n,className:r}=e;return o().createElement(Pe.k,{className:r,tooltipTitle:t?b().text("Hide attributes of the relationship"):b().text("Show attributes of the relationship"),tooltipPlacement:"bottom-end",size:"XXS",icon:t?St.Z:Ct.Z,onClick:n})},Ot=(0,$.Z)((e=>({container:{display:"flex",flexDirection:"column",paddingBottom:"2px"},row:{display:"flex",alignItems:"flex-start",flexDirection:"row",minHeight:"16px",padding:"3px 16px 0 "},rowInactive:{background:e.inactiveBackground},entityAvatar:{height:"12px",width:"12px",fontSize:"11px",marginRight:"8px"},entityLabelContainer:{textDecoration:"none",cursor:"pointer",paddingRight:"8px"},entityLabel:{color:e.palette.primary.main,fontSize:"13px",letterSpacing:0,lineHeight:"15px"},relationLabel:{color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0,lineHeight:"15px"},showDetails:{marginLeft:"auto"},attributesList:{paddingLeft:"46px",marginBottom:"10px",color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0},suggestedWrapper:{backgroundColor:e.suggested},commentsContainer:{marginLeft:"auto",alignItems:"center","& + $showDetails":{marginLeft:"4px"}},additionalButtonsWrapper:{marginLeft:"auto",display:"flex"},suggestedLabelWrapper:{marginTop:"6px"},labelWrapper:{display:"flex"}}))),Nt=(0,r.memo)((e=>{let{connection:t,renderRelationArrowButton:n,acceptRelation:l,ignoreRelation:s}=e;const c=Ot(),u=t.suggested,{entity:p,relation:m}=t,[g,f]=(0,r.useState)(!1),b=(0,a.useSelector)(E.ZP.selectors.getMetadata),{entityType:h,entityLabel:y,preparedUri:v,relationLabel:x}=Ke(t,b),w=(0,d.Fn9)(m)&&(0,d.Fn9)(p),S=(0,a.useSelector)(E.ZP.selectors.getEntityUri),C=p&&m&&(0,d.wp9)(d.q7e.RELATION,{entityUri:S,connection:t})||[];return o().createElement("div",{className:L()(c.container,{[c.rowInactive]:!w},{[c.suggestedWrapper]:u})},o().createElement("div",{className:L()(c.row,ft.U)},n&&n(),o().createElement("div",{className:L()(c.labelWrapper,{[c.suggestedLabelWrapper]:u})},o().createElement(qe.Z,{className:c.entityAvatar,entityType:h}),o().createElement($e.Z,{value:v,className:c.entityLabelContainer},o().createElement(Ye,{label:y,entity:p},o().createElement("span",{className:c.entityLabel},y)),x&&o().createElement("span",{className:c.relationLabel},`, ${x}`))),o().createElement("div",{className:c.additionalButtonsWrapper},!(0,i.isEmpty)(C)&&o().createElement(bt.Z,{className:c.commentsContainer,uri:null==m?void 0:m.relationUri,relatedObjectUris:C,objectType:d.q7e.RELATION,allowOnlyOneComment:!0}),u&&o().createElement(nt,{size:"small",acceptRelation:l(t),ignoreRelation:s(t)}),!u&&o().createElement(Pt,{show:g,onToggle:()=>{f((e=>!e))},className:c.showDetails}))),g&&o().createElement(wt,{connection:t}))}));var Tt=n(52691),kt=n(16208);const Zt=e=>e.filter((e=>5===e.value)).length,Rt=e=>e.filter((e=>1===e.value)).length,It=e=>0===e.length?"0%":Zt(e)/e.length*100+"%",jt=e=>0===e.length?"0%":Rt(e)/e.length*100+"%",Dt=(0,$.Z)((e=>({wrapper:{display:"flex",flexDirection:"column",alignItems:"flex-end"},averageRating:{marginBottom:"7px",fontSize:"16px",letterSpacing:"0.15px",lineHeight:"19px",color:e.palette.text.primary},scale:{display:"flex",marginBottom:"6px",width:"128px",height:"4px"},likesScale:{height:"100%",backgroundColor:"#8CC152"},dislikesScale:{height:"100%",backgroundColor:"rgb(255, 112, 112)"},counts:{display:"flex"},likesCount:{marginRight:"32px"},count:{display:"flex",alignItems:"center",color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0,lineHeight:"15px"},icon:{marginRight:"4px",width:"14px",height:"14px",color:"rgba(0,0,0,0.38)"}}))),Lt=e=>{let{ratings:t,className:n}=e;const r=Dt();return o().createElement("div",{className:L()(r.wrapper,n)},o().createElement(V.Typography,{className:r.averageRating},(e=>(0,i.pipe)((0,i.pluck)("value"),i.mean,(0,i.defaultTo)(0))(e))(t).toFixed(1)),o().createElement("div",{className:r.scale},o().createElement("div",{className:r.likesScale,style:{width:It(t)}}),o().createElement("div",{className:r.dislikesScale,style:{width:jt(t)}})),o().createElement("div",{className:r.counts},o().createElement("div",{className:L()(r.likesCount,r.count)},o().createElement(Tt.Z,{className:r.icon}),Zt(t)),o().createElement("div",{className:r.count},o().createElement(kt.Z,{className:r.icon}),Rt(t))))},At=(0,$.Z)((e=>({wrapper:{display:"flex"},button:{fontSize:"14px",textTransform:"none",color:e.palette.text.secondary},likeButton:{marginLeft:"-12px",marginRight:"8px"},isActive:{color:e.palette.text.primary}}))),Mt=e=>{let{ratings:t,onAgree:n,onDisagree:r}=e;const l=At(),i=(0,a.useSelector)(E.ZP.selectors.getUserName),s=t.find((e=>{let{user:t}=e;return t===i})),c=[{text:b().text("Has left the practice"),onClick:()=>r(b().text("Has left the practice"))},{text:b().text("Has moved away"),onClick:()=>r(b().text("Has moved away"))},{text:b().text("Has passed away"),onClick:()=>r(b().text("Has passed away"))},{text:b().text("Has retired"),onClick:()=>r(b().text("Has retired"))},{text:b().text("Other"),onClick:()=>r(b().text("Other"))}];return o().createElement("div",{className:l.wrapper},o().createElement(V.Button,{onClick:n,variant:"text",size:"small",className:L()(l.button,l.likeButton,{[l.isActive]:5===(null==s?void 0:s.value)})},"Agree"),o().createElement(De.Z,{buttonProps:{endIcon:o().createElement(st.Z,null),variant:"text",size:"small",className:L()(l.button,{[l.isActive]:1===(null==s?void 0:s.value)})},buttonContent:1===(null==s?void 0:s.value)?s.comment:"Disagree",menuItems:c,menuId:"disagree-dropdown-menu-button"}))},Ut=(0,$.Z)((e=>({wrapper:{padding:"6px 16px 3px"},entityTypeIcon:{marginRight:"16px"},entityLabel:{color:e.palette.primary.main,fontSize:"14px",letterSpacing:0,lineHeight:"16px"},entityLabelContainer:{textDecoration:"none"},relationLabel:{color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0,lineHeight:"15px"},ratings:{marginLeft:"auto"},showDetailsButton:{marginLeft:"16px",marginTop:"18px"},relationAttributes:{paddingLeft:"60px"},suggestedWrapper:{padding:"6px 16px 3px",backgroundColor:e.suggested},commentsContainer:{marginTop:"21px","& + $ratings":{marginLeft:"16px"}},additionalButtonsWrapper:{marginLeft:"auto",display:"flex"}}))),Ft=e=>{let{connection:t,loadRelations:n,renderRelationArrowButton:l,acceptRelation:s,ignoreRelation:c}=e;const u=Ut(),p=t.suggested,[m,g]=(0,r.useState)(!1),{entity:f,relation:b}=t,h=(0,a.useSelector)(E.ZP.selectors.getMetadata),{entityLabel:y,entityType:v,preparedUri:x,relationLabel:w}=Ke(t,h),S=(null==b?void 0:b.ratings)||[],C=(0,a.useSelector)(E.ZP.selectors.getEntityUri),P=f&&b&&(0,d.wp9)(d.q7e.RELATION,{entityUri:C,connection:t})||[];return o().createElement("div",{className:L()(u.wrapper,{[u.suggestedWrapper]:p})},o().createElement(V.Box,{display:"flex",minHeight:"62px",className:ft.U},o().createElement(V.Box,{display:"flex",alignItems:"flex-start"},o().createElement(V.Box,{display:"flex",alignItems:"center"},l&&l(),o().createElement(qe.Z,{entityType:v,className:u.entityTypeIcon})),o().createElement(V.Box,{display:"flex",flexDirection:"column"},o().createElement($e.Z,{value:x,className:u.entityLabelContainer},o().createElement(Ye,{label:y,entity:f},o().createElement("span",{className:u.entityLabel},y))),w&&o().createElement("span",{className:u.relationLabel},w),!p&&o().createElement(Mt,{ratings:S,onAgree:()=>{(0,d.Buf)(null==b?void 0:b.relationUri,{comment:"",value:5}).then(n)},onDisagree:e=>{(0,d.Buf)(null==b?void 0:b.relationUri,{comment:e,value:1}).then(n)}}))),o().createElement("div",{className:u.additionalButtonsWrapper},!(0,i.isEmpty)(P)&&o().createElement(bt.Z,{className:u.commentsContainer,uri:null==b?void 0:b.relationUri,relatedObjectUris:P,objectType:d.q7e.RELATION,allowOnlyOneComment:!0}),p&&o().createElement(nt,{acceptRelation:s(t),ignoreRelation:c(t)}),!p&&o().createElement(o().Fragment,null,o().createElement(Lt,{ratings:S,className:u.ratings}),o().createElement(Pt,{show:m,onToggle:()=>{g((e=>!e))},className:u.showDetailsButton})))),m&&o().createElement(wt,{connection:t,className:u.relationAttributes}))},Ht=e=>{let{className:t,connections:n=[],loadRelations:l,config:i,mainEnityUri:s}=e;const{isComplex:c,content:u}=i,{ignoreRelation:p,acceptRelation:m}=((e,t,n)=>{const r=at(e.inRelations,e.outRelations),o=(0,a.useDispatch)();return{ignoreRelation:e=>()=>{const{entity:a}=e;(0,d.iiD)(n,{relatedEntityUri:a.entityUri,relationType:r.type,relationDirection:r.direction}).then(t).catch((e=>{o(E.ui.actions.errorSet((0,d.xU7)(e,b().text("Something went wrong"))))}))},acceptRelation:e=>()=>{const{entity:a,relation:l}=e,{startDate:i,endDate:s}=l,c=r.direction===d.Nsj.IN,u=c?a.entityUri:n,p=c?n:a.entityUri;(0,d.DsR)({startEntityUri:u,endEntityUri:p,relationType:r.type,attributes:null,startDate:i,endDate:s}).then(t).catch((e=>{o(E.ui.actions.errorSet((0,d.xU7)(e,b().text("Something went wrong"))))}))}}})(u,l,s),g=(0,r.useMemo)((()=>(0,d.w3p)(n)),[n]),{getCommentsCount:f}=(0,r.useContext)(w.h);return(0,r.useEffect)((()=>{f(g)}),[f,g]),o().createElement("div",{className:t},n.map((e=>{var t,n;const r=`${null==e||null===(t=e.relation)||void 0===t?void 0:t.relationUri}-${null==e||null===(n=e.relation)||void 0===n?void 0:n.direction}`;return o().createElement(mt,{config:i,connection:e,key:r},(t=>c?o().createElement(Ft,{loadRelations:l,connection:e,acceptRelation:m,ignoreRelation:p,renderRelationArrowButton:t}):o().createElement(Nt,{acceptRelation:m,ignoreRelation:p,connection:e,renderRelationArrowButton:t})))})))};Ht.displayName="RelationsList";const Vt=Ht,zt=(0,$.Z)((e=>({list:{paddingTop:"8px",paddingBottom:"10px",overflow:"auto",flexGrow:1},noData:{fontSize:"13px",color:e.palette.text.secondary,padding:"8px 16px"}}))),Bt=e=>{let{isLoading:t,config:n,loadRelations:r,connections:l,total:i,parentEntityUri:s}=e;const c=zt(),{selectors:u}=E.ZP,p=(0,a.useSelector)(u.getEntity),m=(0,a.useSelector)(u.getMode),g=n["text-empty"]||b().text("No data found");return t?o().createElement(R.Z,null):(0,d.KIu)(m)?o().createElement(gt,{connections:l,className:c.list,key:null==p?void 0:p.uri,config:n,mode:m,noDataText:g,parentEntityUri:s}):i>0?o().createElement(Vt,{config:n,loadRelations:r,connections:l,className:c.list,key:null==p?void 0:p.uri,mainEnityUri:p.uri}):o().createElement(V.Typography,{className:c.noData},g)},Wt=(0,$.Z)({container:{flexGrow:1,display:"flex",flexDirection:"column",minHeight:0},content:{position:"relative",display:"flex",flexGrow:1,flexDirection:"column",minHeight:0},pagination:{height:"52px",flexGrow:0,flexShrink:0}}),_t=e=>{let{config:t,className:n}=e;const l=Wt(),{page:s,setPage:c,rowsPerPage:u,sortOrder:p,sortOption:m,showInactive:g,searchQuery:f,changeSearchQuery:b}=(0,r.useContext)(Te),{selectors:h}=E.ZP,y=(0,a.useSelector)((e=>h.getConnectionsWithDraftsByViewId(e,t.id))),v=(0,a.useSelector)(h.getEntity),x=(0,a.useSelector)((e=>h.getTotalByViewId(e,t.id))),w=(0,a.useSelector)(h.getMode),S=(0,r.useMemo)((()=>({order:p,field:m})),[p,m]);(0,r.useEffect)((()=>{b("")}),[null==v?void 0:v.uri]);const C=(0,r.useMemo)((()=>(e=>{const t=d.wSh.fromFalsy(e).map(d.zHo).map((e=>`containsWordStartingWith(entity.label,${e}) or containsWordStartingWith(relation.label,${e})`)).orSome("");return(new d.MEy).addClause(t).build()})(f)),[f]),{isLoading:P,reload:O}=(0,we.a)({sorting:S,filter:C,page:s,rowsPerPage:u,config:t,entity:v,relationActivityFilter:g?d.Ng6.ALL:d.Ng6.ACTIVE_ONLY,mode:w}),N=(0,r.useMemo)((()=>(0,d.Px$)(y)),[y]),T=(0,r.useMemo)((()=>({reloadRelations:O,config:(0,i.pick)(["content","importFromDT","maxDtssImport"],t)})),[O,t]);return o().createElement(Se.X.Provider,{value:N},o().createElement(F.Z,{className:n},o().createElement("div",{className:l.container},o().createElement(Le.Provider,{value:T},o().createElement(Be,{title:t.caption,total:x})),o().createElement("div",{className:l.content},o().createElement(Bt,{isLoading:P,config:t,loadRelations:O,connections:y,total:x}),x>u&&o().createElement(H.Z,{classes:{root:l.pagination},count:x,rowsPerPageOptions:[],rowsPerPage:u,page:s,onChangePage:c})))))};_t.displayName="RelationsView";const Gt=o().createContext(null);Gt.displayName="SingleAttributeContext";var qt=n(86361),$t=n(26180),Qt=n(31276);function Xt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Yt(e,t,n[t])}))}return e}function Yt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Kt="CHANGE_SEARCH_QUERY",Jt=Xt({},$t.ZP.actions,{changeSearchQuery:(0,Qt.zD)(Kt)}),en=(e,t)=>t.type===Kt?Xt({},e,{searchQuery:t.payload,page:0}):$t.ZP.reducer(e,t);var tn=n(92332),nn=n(67353);const rn={textDecoration:"line-through",color:"rgba(0,0,0,.54)"},on=(0,$.Z)((()=>({tableContainer:{height:"477px",display:"flex",fontFamily:"Roboto",color:"rgba(0,0,0,0.54)"},rowCell:{fontSize:"13px",overflow:"hidden"},"row-cell--sorted":{color:"rgba(0,0,0,0.87)"},"row-cell__buttons-container":{position:"absolute"},"row-cell__buttons-wrapper":{display:"flex",paddingLeft:"10px","& > button":{marginLeft:"-10px",transform:"scale(0.9)"}},headCell:{display:"flex",alignItems:"center",height:"100%",fontSize:"12px"},"row-cell--removed":{pointerEvents:"none","& > div":rn}}))),an=(0,nn.Z)((e=>{const t=on();return o().createElement("div",{className:t.headCell},o().createElement(tn.default,e))}));var ln=n(64091);function sn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const cn=(0,i.pipe)((0,i.map)((e=>({id:(0,d.Tde)(e.uri),label:e.label,dataTypeDefinition:(0,d.PFL)(e)}))),(0,i.uniqBy)((0,i.prop)("id"))),un=(0,i.pipe)(d.DK$,cn),pn=(0,i.pipe)((0,i.split)("."),(0,i.slice)(2,1/0)),mn=e=>{if((0,d.vZp)(e)){const t=pn(e);return t.length>1?t.slice(0,-1):null}return null},dn=(0,i.map)((e=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){sn(e,t,n[t])}))}return e}({},e,{sortable:!0,resizable:!0,nestedPath:mn(e.id),headCellRenderer:an,rowCellValueRenderer:ln.Z})));var gn=n(99341);function fn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var bn=n(52016),hn=n(1876),yn=n(60894);const En=(0,$.Z)((()=>({header:{padding:"0 4px 0 16px"}}))),vn=e=>{let{title:t,searchQuery:n,onChangeSearchQuery:r,filtersEnabled:a,onToggleFilters:l,columnsData:i,selectedColumns:s,onChangeColumns:c}=e;const u=En();return o().createElement(z.Z,{title:t,className:u.header},o().createElement(G.i,{query:n,onChange:r}),o().createElement(hn.Z,{enabled:a,onClick:l}),o().createElement(W.Z,{height:24,margin:4}),o().createElement(yn.Z,{columnsData:i,selectedColumns:s,onChangeColumns:c}))};function xn(){return xn=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},xn.apply(this,arguments)}const wn=(0,n(32528).Z)(((e,t)=>{let{deletedUris:n}=e,{rowValue:{value:r}}=t;return{isRemoved:Boolean(n.find((e=>r.uri===e)))}}))((e=>{let{cell:t,CellValueRenderer:n,isRemoved:r,isSorted:a}=e,l=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["cell","CellValueRenderer","isRemoved","isSorted"]);const i=on();return o().createElement("div",{className:L()({[i["row-cell--sorted"]]:a,[i["row-cell--removed"]]:r},i.rowCell)},t.values.map(((e,t)=>o().createElement(n,xn({key:t,value:e},l)))))}));var Sn=n(85709);const Cn=e=>{let{onEdit:t,onRemove:n}=e;return o().createElement(o().Fragment,null,t&&o().createElement(Pe.k,{tooltipTitle:b().text("Edit"),icon:_e.Z,size:"L",onClick:t}),n&&o().createElement(Pe.k,{tooltipTitle:b().text("Remove"),icon:Ge.Z,size:"L",onClick:n}))};function Pn(){return Pn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Pn.apply(this,arguments)}const On=e=>{let{columnsData:t,values:n,sorting:l,onSort:s,filters:c,onFilter:u,config:p,onEdit:m,onDeleteAttribute:g,deletedUris:f}=e;const b=(0,r.useMemo)((()=>((e,t)=>e.map((e=>(0,i.pipe)((0,i.reduce)(((t,n)=>{let{id:r}=n;return(0,i.assoc)(r,((e,t)=>((e,t)=>(0,i.pipe)((0,i.path)(["value"]),(0,d.tT_)(e))(t))(pn(e),t))(r,e),t)}),{}),(0,i.assoc)("value",e))(t))))(n,t)),[n,t]),h=(0,r.useMemo)((()=>dn(t)),[t]),y=on(),v=(0,a.useSelector)(E.ZP.selectors.getMode),x=(0,d.KIu)(v),w=(0,a.useSelector)(E.ZP.selectors.getMetadata),S=(0,a.useSelector)(E.ZP.selectors.getEntityUri),C=(0,a.useSelector)((e=>E.ZP.selectors.getModifiedEntity(e,S)||{})),{attributeType:P}=(0,r.useContext)(Gt),O=(0,r.useCallback)((e=>o().createElement(wn,Pn({},e,{isSorted:!!l&&l.field===e.columnData.id}))),[l]),[N,T]=(0,r.useState)(null),{canUpdate:k,canDelete:Z}=(0,bn.l)(),R=(0,r.useMemo)((()=>"number"!=typeof N||!x||f.includes((0,i.pipe)((0,i.path)([N]),(0,i.prop)("uri"))(n))),[N,f,n,x]),I="number"==typeof N&&(j=(0,i.path)([N],n),Z(p)&&(0,d.xv5)({attributeType:P,mode:v,attributeValue:j,metadata:w,isReltioCrosswalk:(0,d.KVV)(C.crosswalks,j)}));var j;const D="number"==typeof N&&(e=>k(p)&&(0,d.yv0)({attributeType:P,mode:v,attributeValue:e,isReltioCrosswalk:(0,d.KVV)(C.crosswalks,e)}))((0,i.path)([N],n)),L=(0,r.useCallback)((()=>{const e=(0,i.path)([N],n);D&&m(e)}),[m,N,n,D]),A=(0,r.useCallback)((()=>{const e=(0,i.path)([N],n);if(!I)return;const t={parentUri:S,attributeType:P,uri:e.uri,value:e};g(t),T(null)}),[N,n,g,I,P,S]),M=R||!I&&!D?void 0:o().createElement(Cn,{onEdit:D?L:void 0,onRemove:I?A:void 0}),U=(0,r.useMemo)((()=>({deletedUris:f})),[f]);return o().createElement("div",{className:y.tableContainer},o().createElement(Sn.Z,{columnsData:h,rowsData:b,sorting:l,onSort:s,filters:c,onFilter:u,hoverStateEnabled:!0,defaultColumnWidth:250,defaultColumnMinWidth:200,headRowHeight:56,renderRowCell:O,onRowHover:T,hoverRowIndex:N,hoveredRowRightContent:M,context:U,classes:{hoveredRowRightContentWrapper:y["row-cell__buttons-wrapper"],hoveredRowRightContentContainer:y["row-cell__buttons-container"]}}))},Nn=(0,$.Z)((()=>({actionButtons:{display:"flex",justifyContent:"flex-end",margin:"0 8px 10px","& > button":{fontSize:"14px",lineHeight:"16px",marginLeft:"8px",padding:"10px 8px",backgroundColor:"rgba(98, 2, 238, 0)"}}})));function Tn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const kn=e=>{let{onChangeAttribute:t,onCancel:n,onApply:l,onDeleteAttribute:s,hasChanges:c,attributeValue:u}=e;const m=Nn(),g=(0,a.useSelector)(E.ZP.selectors.getEntityUri),{attributeType:f}=(0,r.useContext)(Gt),h=(0,a.useSelector)((e=>E.ZP.selectors.getModifiedEntity(e,g)||{})),y=(0,a.useSelector)(E.ZP.selectors.getMode),v=(0,a.useDispatch)(),x=(0,r.useContext)(p.m),w=(0,r.useCallback)((e=>(0,i.pipe)(E.N5.actions.addAttributes,v)(e.map((e=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Tn(e,t,n[t])}))}return e}({},e,{viewId:x}))))),[x,v]),S=(0,d.ZiX)(g),C=(0,a.useSelector)((e=>E.ZP.selectors.getActiveErrorsForAttributesPager(e,g,f))),P=(0,r.useCallback)((0,i.pipe)(E.N5.errors.actions.errorDeactivated,v),[v]);return o().createElement(o().Fragment,null,o().createElement(ne.Z,{attributeValue:u,showEmptyEditors:S,onDeleteAttribute:s,onDeactivateError:P,onChangeAttribute:t,onAddAttributes:w,mode:y,crosswalks:h.crosswalks,errors:C,attributeType:f,ownError:(0,d.ADq)(u,null,f.uri,C)}),o().createElement("div",{className:m.actionButtons},o().createElement(V.Button,{onClick:()=>{n(u)}},b().text("Cancel")),o().createElement(V.Button,{color:"primary",disabled:!c,onClick:()=>{l(u)}},b().text("Apply"))))},Zn=(0,$.Z)((()=>({root:{display:"flex",flexDirection:"column"},content:{position:"relative",padding:"4px 16px 9px",flex:1,overflow:"auto"},noData:{fontSize:"13px",paddingLeft:"20px",color:"rgba(0,0,0,0.54)"},tableContainer:{height:"477px",display:"flex",fontFamily:"Roboto",color:"rgba(0,0,0,0.54)"},header:{padding:"0 4px 0 16px"},addButton:{padding:"9px 16px 9px 12px",backgroundColor:"rgba(98, 2, 238, 0)",marginBottom:"4px"},buttonLabel:{fontSize:"14px",fontWeight:500,lineHeight:"16px"},icon:{fontSize:"18px",marginRight:"8px"},editor:{padding:"4px 16px"}})));function Rn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){In(e,t,n[t])}))}return e}function In(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const jn=[],Dn=e=>{let{config:t,className:n}=e;const{caption:l,max:s}=t,c=Zn(),{values:u,page:m,setPage:g,isLoading:f,searchQuery:h,setSearchQuery:y,visibleColumns:v,onFilter:x,onSort:w,onToggleFilters:S,onChangeColumns:C,filters:P,sorting:O,totalVisibleValues:N,hasPaging:T,attributeType:k,showTable:Z}=(0,r.useContext)(Gt),I=(0,r.useMemo)((()=>un(k)),[k]),{checkHasChanges:j,onChangeAttribute:D,onDeleteAttribute:A,onAdd:M,onCancel:U,onApply:B,onStartEditing:W,modifiedValues:_,editingValues:G,deletedUris:q}=(()=>{const[e,t]=(0,r.useState)(),[n,o]=(0,r.useState)([]),l=(0,a.useSelector)(E.ZP.selectors.getMode);(0,r.useEffect)((()=>{o([]),t(null)}),[l]);const s=(0,a.useDispatch)(),c=(0,r.useContext)(p.m),{attributeType:u,values:m}=(0,r.useContext)(Gt),g=(0,a.useSelector)(E.ZP.selectors.getEntityUri),f=(0,a.useSelector)(E.ZP.selectors.getMetadata),b=(0,r.useCallback)((e=>{(0,i.pipe)(E.N5.actions.modifyAttribute,s)(Rn({},e,{viewId:c}))}),[c,s]),h=(0,r.useCallback)((e=>(0,i.pipe)(E.N5.actions.removeAttribute,s)(Rn({},e,{viewId:c}))),[c,s]),y=(0,r.useCallback)((()=>{const e=(0,d.gjI)({parentUri:g,attributeType:u});t(e.uri),b(Rn({},e,{value:(0,d.GPx)({attributeTypes:u.attributes,parentUri:e.uri,mode:l,metadata:f}),attributeType:u}))}),[g,u]),v=(0,r.useCallback)((e=>{o((t=>t.find((0,i.propEq)("uri",e.uri))?t:[...t,e]))}),[o]),x=(0,r.useCallback)((e=>{const r=n.find((0,i.propEq)("uri",e.uri));if(r){const t=Rn({},e,{value:r,attributeType:u,uri:e.uri});o((e=>(0,i.without)([r],e))),b(t)}else{const n={value:e,attributeType:u,uri:e.uri};t(null),h(n)}}),[h,b,o,n]),w=(0,r.useCallback)((e=>{t(null),o((t=>{const n=t.find((0,i.propEq)("uri",e.uri));return n?(0,i.without)([n],t):t}))}),[o,t]),S=(0,a.useSelector)((e=>E.ZP.selectors.getModifiedEntity(e,g)||{})),C=(0,d.KIu)(l),P=(0,d.xy8)(u),O=(0,i.pathOr)(jn,[P,null==u?void 0:u.name],S),N=(0,r.useMemo)((()=>[...O.filter((0,i.pipe)((0,i.prop)("uri"),(0,i.both)(d.ZiX,(0,i.pipe)((0,i.equals)(e),i.not)))),...(0,i.map)((e=>O.find((0,i.propEq)("uri",e.uri))||e))(m)].map((e=>{var t;return null!==(t=n.find((0,i.propEq)("uri",e.uri)))&&void 0!==t?t:e}))),[O,n,e,m]),T=(0,r.useMemo)((()=>C?(0,i.pipe)((0,i.map)((0,i.prop)("uri")),(0,i.filter)((e=>!O.find((0,i.propEq)("uri",e)))))(m):[]),[O,m]),k=O.filter((t=>{let{uri:r}=t;return r===e||n.find((0,i.propEq)("uri",r))}));return{checkHasChanges:e=>n.find((0,i.propEq)("uri",e.uri))!==e,onChangeAttribute:b,onDeleteAttribute:h,onAdd:y,onCancel:x,onApply:w,onStartEditing:v,modifiedValues:N,editingValues:k,deletedUris:T}})(),$=(0,a.useSelector)(E.ZP.selectors.getMode),Q=(0,d.KIu)($),X=Q?_:u,{canCreate:Y}=(0,bn.l)(),K=Y(t)&&k&&(0,d.Vg3)({attributeType:k,mode:$})&&!G.length,ee=(0,r.useMemo)((()=>v.map((e=>I.find((0,i.propEq)("id",e))))),[v,I]);return o().createElement(F.Z,{className:L()(c.root,n)},Z?o().createElement(o().Fragment,null,o().createElement(vn,{title:l,total:N,columnsData:I,selectedColumns:v,onChangeColumns:C,searchQuery:h,onChangeSearchQuery:y,filtersEnabled:!!P,onToggleFilters:S}),o().createElement("div",{style:{position:"relative"}},Q&&o().createElement("div",{className:c.editor},K&&o().createElement(V.Button,{color:"primary",onClick:M,className:c.addButton},o().createElement(J.Z,{classes:{root:c.icon}}),o().createElement("div",{className:c.buttonLabel},b().text("Add"))),G.map((e=>o().createElement(kn,{key:e.uri,attributeValue:e,onChangeAttribute:D,onDeleteAttribute:A,onCancel:U,onApply:B,hasChanges:j(e)})))),o().createElement(On,{columnsData:ee,config:t,values:X,filters:P,onFilter:x,sorting:O,onSort:w,onEdit:W,onDeleteAttribute:A,deletedUris:q}),T&&o().createElement(H.Z,{count:N,rowsPerPageOptions:[],rowsPerPage:s,page:m,onChangePage:g}),f&&o().createElement(R.Z,null))):o().createElement(o().Fragment,null,o().createElement(z.Z,{title:l,className:c.header}),o().createElement(V.Typography,{className:c.noData},b().text("No data"))))};var Ln=n(58600);let An=0;const Mn=()=>An++,Un=e=>{const t={children:[],nodeId:Mn()};if(e.parentPaths)for(let n=0;n<e.parentPaths.length;n++){const r=e.parentPaths[n];let o=t;for(let t=r.length-1;t>=0;t--){const a=r[t],l=e.entities[a.entityUri],i=t===r.length-1,s={entity:l,children:[],nodeId:Mn(),expanded:!0,rootIndex:i?n+1:void 0};i&&(s.root=i),o.children.push(s),o=s}}return t.children},Fn=(0,$.Z)((e=>({container:{fontSize:"13px",display:"flex",paddingTop:"6px",position:"relative"},title:{flexGrow:1,minHeight:"15px",color:e.palette.secondary.main,lineHeight:"15px"},link:{cursor:"pointer",color:e.palette.secondary.main,lineHeight:"15px"},selected:{fontWeight:"bold"},wrapper:{width:"100%"},avatar:{height:"16px",width:"16px",marginRight:"8px",marginLeft:"8px"},header:{padding:"0 4px 0 16px"},treeContainer:{flexGrow:1,display:"flex",flexDirection:"column",height:"100%",minHeight:"372px",maxHeight:"507px",overflow:"auto"},tree:{flexGrow:1,height:0},buttonsContainer:{flexShrink:0,marginLeft:"auto","& > * + *":{marginLeft:"-4px"}},button:{padding:"8px"}})));var Hn=n(1242);const Vn=o().createContext(null);var zn=n(55400);const Bn=e=>{e.target.src=Hn},Wn=e=>{let{node:t}=e;const n=Fn(),l=(0,a.useDispatch)(),i=t.entity.uri,s=(0,a.useSelector)(E.ZP.selectors.getAbsoluteImagePath),c=(0,a.useSelector)(E.ZP.selectors.getMetadata),u=(0,r.useContext)(Vn),p=(0,a.useSelector)(E.ZP.selectors.getUIPath),{uri:m}=(0,a.useSelector)(E.ZP.selectors.getEntity),g=(0,d.ChB)({uiPath:p,uri:i}),f=i===m,b=(0,r.useCallback)((()=>{l(E.ui.actions.openEntity({uri:i,viewId:u.id}))}),[l,u,i]),{entity:{label:h},nodeId:y}=t,v=(0,d.nt9)(c,t.entity.type)||{},x=(0,d.VD3)(c,v,"typeGraphIcon"),w=x&&(0,d.vPL)(s,x);return o().createElement("div",{className:n.wrapper,"data-node-id":y},o().createElement("div",{className:n.container},o().createElement(V.Avatar,{className:L()(n.avatar),src:w||Hn,onError:Bn}),o().createElement("span",{className:L()(n.link,{[n.selected]:f})},o().createElement(zn.Z,{to:g,onClick:b},h))))},_n=((0,r.memo)(Wn),e=>{let{node:t}=e;return t.nodeId}),Gn=(0,$.Z)((()=>({lineBlock:{height:"100%",position:"relative",display:"inline-block"},lineChildren:{height:"100%",position:"absolute",display:"inline-block"},rootIndex:{display:"flex",alignItems:"center",color:"rgba(0,0,0,0.54)",height:"100%"},verticalLine:{width:"1px",left:"50%",top:0,height:"50%",position:"absolute",backgroundColor:"rgba(0,122,193,0.3)"},horizontalLineRight:{height:"1px",top:"14px",left:"50%",width:"24%",position:"absolute",backgroundColor:"rgba(0,122,193,0.3)"},node:{minWidth:"100%",position:"relative",textAlign:"left",padding:"0 24px 0 18px",boxSizing:"border-box",whiteSpace:"normal","&:hover":{backgroundColor:"rgba(0,0,0,0.06)"}},nodeContent:{position:"absolute",top:0,bottom:0,paddingLeft:"18px",boxSizing:"border-box"},row:{display:"flex"},rowContents:{position:"relative",borderLeft:"none",paddingLeft:"4px",flex:"1 1 auto",width:0,display:"flex",verticalAlign:"middle",boxSizing:"border-box"},buttonWrapper:{display:"flex",paddingTop:"13px",width:"12px",cursor:"pointer"},collapsedButton:{transform:"rotate(-90deg)"},expandedButton:{transform:"rotate(0deg)"},button:{transition:"transform .15s ease",width:0,height:0,borderLeft:"4px solid transparent",borderRight:"4px solid transparent",borderTop:"4px solid rgba(0, 0, 0, 0.54)"},rowTitle:{flex:"1 1 auto",width:0,paddingRight:"11px"}})));function qn(){return qn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qn.apply(this,arguments)}function $n(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qn(){return Qn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Qn.apply(this,arguments)}const Xn={nodeContentRenderer:e=>{const t=(0,i.omit)(["connectDragPreview","connectDragSource","isDragging","canDrop","canDrag","draggedNode","isSearchMatch","isSearchFocus","buttons","didDrop","children","treeId","isOver","parentNode","rowDirection"],e),{scaffoldBlockPxWidth:n,toggleChildrenVisibility:r,node:a,title:l,path:s,treeIndex:c,style:u}=t,p=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,["scaffoldBlockPxWidth","toggleChildrenVisibility","node","title","path","treeIndex","style"]),m=l,d=r&&!a.root&&a.children&&a.children.length>0,g=Gn();return o().createElement("div",Qn({style:{height:"100%"}},p,{key:a.nodeId}),d&&a.expanded&&o().createElement("div",{style:{width:n-2},className:g.lineChildren}),o().createElement("div",{className:g.row,style:u},o().createElement("div",{className:g.rowContents},d&&o().createElement("div",{className:g.buttonWrapper,onClick:()=>{r({node:a,path:s,treeIndex:c})}},o().createElement("div",{"aria-label":a.expanded?"Collapse":"Expand",className:L()(g.button,a.expanded?g.expandedButton:g.collapsedButton)})),o().createElement("div",{className:g.rowTitle},"function"==typeof m?m({node:a,path:s,treeIndex:c}):m))))},treeNodeRenderer:e=>{const t=(0,i.omit)(["listIndex","swapFrom","swapLength","swapDepth","draggedNode","getPrevRow","connectDropTarget","isOver","canDrop","treeIndex","treeId","path","rowDirection"],e),{children:n,scaffoldBlockPxWidth:r,lowerSiblingCounts:a,node:l}=t,s=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,["children","scaffoldBlockPxWidth","lowerSiblingCounts","node"]),c=Gn(),u=a.length,p=[];a.forEach(((e,t)=>{p.push(o().createElement("div",{key:`pre_${1+t}`,style:{width:r},className:c.lineBlock},l.root&&o().createElement("div",{className:c.rootIndex},l.rootIndex,"."),t===u-1&&0!==t&&o().createElement(o().Fragment,null,o().createElement("div",{className:c.verticalLine}),o().createElement("div",{className:c.horizontalLineRight}))))}));const m=l.root?r-4:0,d=r*u-m,g={left:d,width:`calc(100% - ${d}px`},f=`${d+250}px`,b=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){$n(e,t,n[t])}))}return e}({},s.style,{width:f});return o().createElement("div",qn({},s,{className:c.node,style:b}),p,o().createElement("div",{className:c.nodeContent,style:g},n))},scaffoldBlockPxWidth:16,rowHeight:28,slideRegionSize:50};function Yn(){return Yn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Yn.apply(this,arguments)}const Kn=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return o().createElement("svg",Yn({width:"20",height:"20",viewBox:"0 0 20 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},n),o().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",fillOpacity:".54"},o().createElement("path",{d:"M14.5 5a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm4 5a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm-17 1a1.5 1.5 0 110-3 1.5 1.5 0 010 3zM4 4a2 2 0 110-4 2 2 0 010 4zm1 16a2 2 0 110-4 2 2 0 010 4zm4.5-6a4.5 4.5 0 110-9 4.5 4.5 0 010 9zm0-2a2.5 2.5 0 100-5 2.5 2.5 0 000 5zm6 5a1.5 1.5 0 110-3 1.5 1.5 0 010 3z",fill:"#000"})))},Jn=e=>{let{title:t,onGraphOpen:n}=e;const r=Fn();return o().createElement(z.Z,{title:t,className:r.header},o().createElement("div",{className:r.buttonsContainer},o().createElement(Pe.k,{className:r.button,tooltipTitle:b().text("Show Graph"),icon:Kn,onClick:n,size:"L"})))};var er=n(59601);const tr=(0,$.Z)((()=>({root:{position:"relative"},bodyWrapper:{paddingTop:"21px"}})));let nr,rr;function or(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){ar(e,t,n[t])}))}return e}function ar(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}!function(e){e.WORKFLOW="workflow",e.WORKFLOW_START_PROCESS_FROM_QUERY="workflow/startProcessFromQuery",e.API="api",e.GET_ENTITY_URI="getEntityUri",e.GET_ENTITY="getEntity",e.GET_API_PATH="getApiPath",e.WORKFLOW_GET_WORKFLOW_PATH="workflow/getWorkflowPath",e.GET_SEARCH_QUERY="getSearchQuery",e.GET_TENANT="getTenant",e.GET_USER="getUser",e.GET_PERSPECTIVE="getPerspective",e.SET_PERSPECTIVE="setPerspective",e.SET_ENTITY_URI="setEntityUri",e.ALERT="alert",e.CONFIRM="confirm",e.PROMPT="prompt",e.OPEN_WINDOW="openWindow",e.GET_CONFIGURATION="getConfiguration",e.GET_UI_CONFIGURATION="getUiConfiguration",e.OPEN_SEARCH="openSearch",e.WORKFLOW_CHECK_PERMISSION="workflow/checkPermission"}(nr||(nr={})),function(e){e.SET_HTML="setHtml",e.LOG="log",e.SET_VISIBILITY="setVisibility",e.MESSAGE="message",e.SET_ENABLED="setEnabled",e.SET_TOOLTIP="setToolTip",e.SET_LABEL="setLabel",e.SET_HEIGHT="setHeight",e.SET_WIDTH="setWidth",e.RETURN_PROCESSED_API_RESPONSE="returnProcessedApiResponse",e.RETURN_PROCESSED_API_REQUEST="returnProcessedApiRequest",e.REQUEST="request"}(rr||(rr={}));const lr=(e,t)=>{const{url:n}=e;return n?(!(null==t?void 0:t.some((e=>{const t=e.match(/^(?:([^:?#]+):)?(?:\/\/((?:(([^:@?]*)(?::([^:@?]*))?)?@)?((?:\[[0-9A-Fa-f:]+)|(?:[^:?#]*))(?::(\d*))?))?((((?:[^?#]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/),r=t[1],o=t[6],a=`${r}://${o}`,l=new RegExp("^"+e+"$"),i=e.replace(/\/*$/,"");return i===n||o&&o===i||o&&a===i||i&&0===i.indexOf("/")&&n&&0===n.indexOf(i)||i&&l.test(n)})))||0===((null==t?void 0:t.length)||0))&&{errorMessage:"Not enough permissions"}:{errorMessage:"URL is empty"}};var ir=n(22994);function sr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){cr(e,t,n[t])}))}return e}function cr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ur=(e,t)=>{let{files:n,permissions:o}=e;const[l,i]=(0,r.useState)(),[s,c]=(0,r.useState)([]),[u,p]=(0,r.useState)(!0),[m,f]=(0,r.useState)(null),[b,h]=(0,r.useState)(null),[y,v]=(0,r.useState)(""),x=(0,a.useDispatch)(),w=(0,a.useSelector)(E.ZP.selectors.getMetadata),S=(0,a.useSelector)(E.ZP.selectors.getEntity)||{},C=`${(0,a.useSelector)(E.ZP.selectors.getUIPath)}worker_api.js`,P=(0,a.useSelector)(E.ZP.selectors.getTenant),O=(0,a.useSelector)(E.ZP.selectors.getApiPath),N=(0,a.useSelector)(E.ZP.selectors.getWorkflowPath),T=(0,a.useSelector)(E.ZP.selectors.getUser),k=(0,a.useSelector)(E.ZP.selectors.getEntityUri),Z=(0,a.useSelector)(E.ZP.selectors.getWorkflowEnvironmentUrl),R=(0,r.useContext)(g),I=(0,ir.Z)(),{type:j,data:D}=(0,a.useSelector)(E.ZP.selectors.getSearchProviderData)||{},L=e=>x(E.ui.actions.openSearch(e)),A=(e,n,r)=>{if(e){const a=[],l=e=>{const t=e.getAttribute("ui-actions"),r=e.getAttribute("ui-tooltip"),o=e.getAttribute("id")||e.getAttribute("name");t&&(t.split(",").forEach((t=>{const r=()=>{const e={action:"event",type:"uiAction",data:{type:t,id:o}};n.postMessage(e)};e.addEventListener(t,r),a.push((()=>{e.removeEventListener(t,r)}))})),e.removeAttribute("ui-actions")),r&&f(r),e.childNodes.forEach((e=>{1===e.nodeType&&l(e)}))},s=e=>{const t=document.createElement("div");t.innerHTML=e||r,l(t),c(a),i(t)};switch(e.action===rr.SET_HTML&&r!==e.params.html&&s(e.params.html),e.action){case rr.LOG:console.log(e.params);break;case rr.SET_VISIBILITY:"visible"===e.params?(p(!0),s()):p(!1);break;case rr.SET_TOOLTIP:f(e.params),s();break;case rr.SET_HEIGHT:h((t=>sr({},t||{},{height:e.params})));break;case rr.SET_WIDTH:h((t=>sr({},t||{},{width:e.params})));break;case rr.SET_ENABLED:h((t=>{const n=sr({},t||{});return e.params?delete n["pointer-events"]:n["pointer-events"]="none",n}));break;case rr.MESSAGE:v(e.params);break;case rr.REQUEST:(e=>{let{name:t,paramObject:n,permissions:r,worker:o,metadata:a,config:l,apiPath:i,user:s,workflowPath:c,entity:u,tenant:p,entityUri:m,query:g,openSearch:f,environment:b,getCurrentPerspectiveId:h,showPerspective:y,workflowCheckPermission:E,setEntityUri:v}=e;const x=e=>{e.then((e=>{o.postMessage(or({action:"response",result:{data:e}},n.params))})).catch((()=>{o.postMessage(or({action:"response",result:{data:{},headers:"",status:0}},n.params))}))};switch(t){case nr.API:{const e=((e,t)=>{const n=lr(e,t);return n?new Promise((e=>e(n))):(0,d.SL_)({url:e.url,method:e.method,data:e.data,headers:e.headers})})(n.params,r);x(e);break}case nr.WORKFLOW:{const e=((e,t,n,r)=>{const{url:o}=e,a=lr(e,t);if(a)return new Promise((e=>e(a)));const l=o.includes("http:")||o.includes("https:");return n||l?(0,d.oUH)({url:o,method:e.method||"GET",data:e.data,tenant:r,headers:e.headers,workflowPath:n}):new Promise((e=>e({errorMessage:"Workflow path is not defined"})))})(n.params,r,c,p);x(e);break}case nr.WORKFLOW_START_PROCESS_FROM_QUERY:{const e=((e,t,n,r,o)=>{if(!e.processDefinitionId)return new Promise((e=>e({errorMessage:"processDefinitionId is empty"})));if(!e.searchString)return new Promise((e=>e({errorMessage:"searchString is empty"})));if(!n)return new Promise((e=>e({errorMessage:"Workflow path is not defined"})));const a=lr(or({url:"/processInstances/_generateFromQuery"},e),t);return a?new Promise((e=>e(a))):(0,d.FuV)({workflowPath:n,processType:e.processDefinitionId,searchString:e.searchString,tenant:r,environment:o})})(n.params,r,c,p,b);x(e);break}case nr.GET_CONFIGURATION:o.postMessage(or({action:"response",result:a},n.params));break;case nr.GET_UI_CONFIGURATION:{const e=or({},l,{action:or({},l.action)});e.action.permissions&&delete e.action.permissions,o.postMessage(or({action:"response",result:e},n.params));break}case nr.SET_ENTITY_URI:v(m,(()=>o.postMessage(or({action:"response",result:u},n.params))));break;case nr.SET_PERSPECTIVE:y(n.params.perspective),o.postMessage(or({action:"response",result:h()},n.params));break;case nr.GET_PERSPECTIVE:h&&o.postMessage(or({action:"response",result:h()},n.params));break;case nr.WORKFLOW_CHECK_PERMISSION:o.postMessage(or({action:"response",result:E(n.params.permission)},n.params));break;case nr.GET_SEARCH_QUERY:o.postMessage(or({action:"response",result:g},n.params));break;case nr.OPEN_SEARCH:f({viewId:l.id,searchState:n.params.searchState});break;case nr.GET_ENTITY_URI:o.postMessage(or({action:"response",result:m},n.params));break;case nr.GET_ENTITY:o.postMessage(or({action:"response",result:u},n.params));break;case nr.GET_API_PATH:o.postMessage(or({action:"response",result:i},n.params));break;case nr.WORKFLOW_GET_WORKFLOW_PATH:o.postMessage(or({action:"response",result:c},n.params));break;case nr.GET_TENANT:o.postMessage(or({action:"response",result:p},n.params));break;case nr.GET_USER:o.postMessage(or({action:"response",result:s},n.params));break;case nr.ALERT:window.alert(n.params.text);break;case nr.CONFIRM:window.confirm(n.params.text);break;case nr.PROMPT:window.prompt(n.params.text,n.params.defaultText||"");break;case nr.OPEN_WINDOW:window.open(n.params.url,"_blank")}})(sr({name:e.params.name,paramObject:e,permissions:o,worker:n,metadata:w,config:t,user:T,apiPath:O,tenant:P,workflowPath:N,entity:S,entityUri:k,environment:Z,query:"search"===j?null==D?void 0:D.query:null,openSearch:L,workflowCheckPermission:I},R))}}};return(0,r.useEffect)((()=>{const e=((e,t,n)=>{const r=`\n importScripts("${e}");\n importScripts("${t.join('","')}");\n postMessage({action:'loaded'});`;let o;try{const e=window.webkitURL||window.URL;o=new Worker(e.createObjectURL(new Blob([r],{type:"application/javascript"})))}catch(e){o=new Worker("data:application/javascript,"+encodeURIComponent(r))}if(o){let e="";o.addEventListener("message",(t=>{if("loaded"!==t.data.action){const r=JSON.parse(t.data);n(r,o,e),"setHtml"===r.action&&(e=r.params.html)}}))}return o})(C,n,A);return()=>{e.terminate()}}),[]),(0,r.useEffect)((()=>()=>{s.forEach((e=>e()))}),[s]),{html:l,visible:u,tooltip:m,customStyles:b,message:y,onClosePopup:()=>v("")}};function pr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){mr(e,t,n[t])}))}return e}function mr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var dr=n(14940);const gr=(0,$.Z)({resizableHandleContainer:{position:"relative",width:"100%",height:"inherit"},resizableHandleVisibilityArea:{position:"absolute",top:0,left:0,width:"100%",height:"24px",zIndex:11,"&:hover $resizableHandle":{visibility:"visible"},".react-grid-item.static &:hover $resizableHandle":{visibility:"hidden"}},resizableHandle:{position:"absolute",width:"100%",display:"flex",justifyContent:"center",top:"-3px",zIndex:11,cursor:"move",visibility:"hidden"},dragIcon:{transform:"translateX(-50%) rotate(90deg)",color:"rgba(0, 0, 0, 0.3)"}}),fr=e=>{const t=t=>{const n=gr();return o().createElement("div",{className:n.resizableHandleContainer},o().createElement("div",{className:n.resizableHandleVisibilityArea},o().createElement("div",{className:L()("viewDraggableHandle",n.resizableHandle)},o().createElement(dr.Z,{className:n.dragIcon}))),o().createElement(e,t))};return t.displayName="WithResizableHandle",t},br=(0,$.Z)({stubView:{padding:"20px"},fullHeight:{height:"100%"},component:{boxSizing:"border-box",overflow:"auto",boxShadow:"none",borderRadius:"unset"}});var hr=n(29103),yr=n(83911),Er=n(79485),vr=n(22385);const xr=(0,i.pipe)((0,i.path)(["point","lat"]),(0,i.both)((0,i.gt)(90),(0,i.lt)(-90))),wr=(0,$.Z)((()=>({root:{height:"100%",display:"flex",flexDirection:"column"},fullHeight:{height:"100%"},fullscreenBtn:{position:"absolute",right:"5px",top:"5px",zIndex:100}})));var Sr=n(13074),Cr=n(24338);const Pr=(0,$.Z)((e=>({caption:{color:e.palette.text.secondary,fontSize:"13px"}}))),Or=Pr,Nr=e=>{let{totalImages:t}=e;const n=Or(),r=t>1?b().text("photos"):b().text("photo");return o().createElement(V.Typography,{variant:"caption",className:n.caption},`${t} ${r}`)};function Tr(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){kr(e,t,n[t])}))}return e}function kr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Zr=e=>{let{config:t,attributeType:n,paging:r,requestNextPageOfAttributeValues:l}=e;const s=(0,a.useDispatch)(),c=(0,a.useSelector)(E.ZP.selectors.getEntity),u=(0,a.useSelector)((e=>E.ZP.selectors.getModifiedEntity(e,c.uri)||{})),p=(0,i.pathOr)([],["attributes",n.name],u),m=t.id;return o().createElement(o().Fragment,null,o().createElement(Cr.Z,{attributeValues:p,attributeType:n,onDeleteAttribute:e=>(0,i.pipe)(E.N5.actions.removeAttribute,s)(Tr({},e,{viewId:m})),parentUri:u.uri,onChangeAttribute:e=>(0,i.pipe)(E.N5.actions.modifyAttribute,s)(Tr({},e,{viewId:m})),imageSize:jr,paging:r,requestNextPageOfAttributeValues:l}),o().createElement(Nr,{totalImages:p.length}))},Rr=(0,$.Z)((e=>({container:{padding:"8px 16px"},noData:{fontSize:"13px",color:e.palette.text.secondary}}))),Ir=Rr,jr={imageMargin:4,imageWidth:162,imageHeight:162};var Dr=n(28741);const Lr=(0,$.Z)((e=>({root:{display:"flex",flexDirection:"column"},matchesContainer:{position:"relative"},footer:{display:"flex",alignItems:"end",flexGrow:1,justifyContent:"flex-start",borderTop:"1px solid rgba(0,0,0, 0.12)",padding:"8px 16px",color:e.palette.primary.main,fontSize:"13px",letterSpacing:"0",lineHeight:"15px"},noData:{paddingLeft:"16px",paddingBottom:"16px",fontSize:"13px",color:"rgba(0,0,0,0.54)"}})));var Ar=n(49734),Mr=n(98808),Ur=n(93428),Fr=n(30885);function Hr(){return Hr=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},Hr.apply(this,arguments)}const Vr=e=>{let{config:t,match:n,onStartRequest:l,onFinishRequest:i}=e;const s=(0,a.useDispatch)(),c=(0,a.useSelector)(E.ZP.selectors.getMetadata),u=(0,a.useSelector)(E.ZP.selectors.getEntity),{canMerge:m,canMark:g}=(0,d.hXd)(c,t,n.object,u,n.matchRules),f=(0,r.useMemo)((()=>[n.object]),[n.object]),b={entity:u,entities:f,mode:Mr.N.iconButton,onStartRequest:l},h=(0,r.useContext)(p.m),y=(0,r.useCallback)((()=>{i(),s(E.N5.entity.actions.loadEntity({viewId:h,uri:u.uri}))}),[s,u.uri,i,h]);return o().createElement(o().Fragment,null,m&&o().createElement(Ur.H,Hr({},b,{onFinishRequest:y})),g&&o().createElement(Fr.i,Hr({},b,{onFinishRequest:i})))},zr=e=>{let{config:t,entitiesMap:n,match:r,onFinishRequest:l,onStartRequest:i}=e;const s=(0,a.useSelector)(E.ZP.selectors.getMetadata),c=(0,a.useSelector)(E.ZP.selectors.getEntity);return o().createElement(Ar.M,{match:r,entity:c,entitiesMap:n,metadata:s,className:ft.U},o().createElement(bt.Z,{uri:(0,d.E_P)(c.uri,r.object.uri),relatedObjectUris:(0,d.wp9)(d.q7e.POTENTIAL_MATCH,{entityUri:c.uri,matchEntityUri:r.object.uri}),objectType:d.q7e.POTENTIAL_MATCH}),o().createElement(Vr,{match:r,config:t,onStartRequest:i,onFinishRequest:l}))},Br={showTransitiveMatches:!0,showInactiveEntities:!1},Wr={order:"asc",field:"score"};var _r;!function(e){e[e.Loading=0]="Loading",e[e.NoData=1]="NoData",e[e.Loaded=2]="Loaded"}(_r||(_r={}));const Gr=fr((e=>{let{className:t}=e;const n=br();return o().createElement(F.Z,{className:L()(n.stubView,"viewDraggableHandle",t)},"NOT IMPLEMENTED")})),qr=fr((e=>{let{className:t,config:n}=e;return o().createElement(A.Z,{className:t,caption:n.caption,excludeUris:n.excludeUris,includeUris:n.includeUris,attributesCount:n.attributesCount,pinnedAttributes:n.pinnedAttributes})})),$r=fr((e=>{let{className:t,config:n}=e;const a=(e=>{const[t,n]=(0,r.useState)(""),[o,a]=(0,r.useState)(0),[l,i]=(0,r.useState)(!1),s=(0,r.useMemo)((()=>({page:o,searchQuery:t,showInactive:l})),[o,t,l]),c=ve(e,s,!0),u=(0,r.useCallback)((()=>{a(0),i((e=>!e))}),[]);return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){xe(e,t,n[t])}))}return e}({setSearchQuery:n,searchQuery:t,setPage:a,page:o,toggleShowInactive:u,showInactive:l},c)})(n);return o().createElement(M.Provider,{value:a},o().createElement(be,{config:n,className:t}))})),Qr=fr((e=>{let{config:t,className:n}=e;const l=(e=>{var t;const{attributeUri:n}=e,o=(0,a.useSelector)(E.ZP.selectors.getMetadata),l=(0,r.useMemo)((()=>(0,d.zeJ)(o,n)),[o,n]),s=(0,r.useMemo)((()=>un(l)),[l]),c=(0,r.useMemo)((()=>({searchQuery:"",filters:null,sorting:void 0,visibleColumns:s.filter((0,i.pipe)((0,i.prop)("dataTypeDefinition"),d.YkM,i.not)).map((e=>{let{id:t}=e;return t})).slice(0,5),page:0})),[s]),[u,p]=(0,r.useReducer)(en,c),{searchQuery:m,filters:g,sorting:f,page:b}=u,h=(0,a.useSelector)(E.ZP.selectors.getIsEditableMode),y=(0,r.useMemo)((()=>{const e=((e,t)=>d.wSh.fromNull(t).map((t=>Object.entries(t).map((t=>{let[n,r]=t;const o=e.find((0,i.propEq)("id",n));return(0,gn.su)(o,r)})))).orSome([]))(s,g);return e.length?e:null}),[g,s]),v=(0,r.useMemo)((()=>(0,i.reject)(i.isNil,{filters:y,page:b,sorting:f,searchQuery:m})),[y,b,f,m]),{changeSearchQuery:x,changePage:w,toggleSort:S,changeFilter:C,toggleFilters:P,changeColumns:O}=(0,qt.o)({actions:Jt,dispatch:p}),N=ve(e,v,!1);return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){fn(e,t,n[t])}))}return e}({},u,{setSearchQuery:x,setPage:w,onSort:S,onFilter:C,onToggleFilters:P,onChangeColumns:O,showTable:Boolean(((null==N||null===(t=N.values)||void 0===t?void 0:t.length)||y||m||h)&&l&&!l.hidden)},N)})(t);return o().createElement(Gt.Provider,{value:l},t&&o().createElement(Dn,{config:t,className:n}))})),Xr=fr((e=>{let{config:t,className:n}=e;const a=(e=>{var t;const n=(0,r.useMemo)((()=>Object.entries(e.sortOptions||{}).map((e=>{let[t,n]=e;return{value:t,label:n}}))),[e.sortOptions]),o=e.max||15,[a,l]=(0,r.useState)(0),[i,s]=(0,r.useState)(e.sortOrder||"asc"),[c,u]=(0,r.useState)(null===(t=n[0])||void 0===t?void 0:t.value),[p,m]=(0,r.useState)(""),[d,g]=(0,r.useState)(!1),f=(0,r.useCallback)((()=>{l(0),g((e=>!e))}),[]),b=(0,r.useCallback)((()=>{l(0),s((e=>"asc"===e?"desc":"asc"))}),[]),h=(0,r.useCallback)((e=>{l(0),u(e)}),[]);return{searchQuery:p,changeSearchQuery:(0,r.useCallback)((e=>{l(0),m(e)}),[]),sortOrder:i,toggleSortOrder:b,sortOption:c,changeSortOption:h,sortOptions:n,page:a,setPage:l,rowsPerPage:o,showInactive:d,toggleShowInactive:f}})(t);return o().createElement(Te.Provider,{value:a},o().createElement(_t,{config:t,className:n}))})),Yr=fr((e=>{let{config:t,className:n}=e;const a=(0,r.useRef)(),[l,s]=(0,r.useState)(null),{height:c,width:u,tooltip:p}=t,{html:m,visible:d,tooltip:g,customStyles:f,onClosePopup:b,message:h}=ur(t.action,t),y=tr(),E=g||p;if((0,r.useEffect)((()=>{a.current&&m&&(a.current.innerHTML="",m.childNodes.forEach((e=>{a.current.appendChild(e)})),s(a.current))}),[m]),!d)return null;const v=(0,i.reject)(i.isNil,{width:u,height:c}),x=o().createElement("div",{ref:a,style:pr({},v,f),className:L()(y.root,n)});return o().createElement("div",{className:y.bodyWrapper},E?o().createElement(V.Tooltip,{title:E},x):x,o().createElement(er.Z,{placement:"bottom",anchorEl:l,open:!!h,onClose:b},h))})),Kr=fr((e=>{let{config:t,className:n}=e;const l=(0,a.useSelector)(E.ZP.selectors.getEntityUri),{treeData:i,setTreeData:s}=((e,t)=>{const n=(0,he._)(),[o,a]=(0,r.useState)([]);return(0,r.useEffect)((()=>((0,d.ZiX)(e)||n((0,d.RFJ)({uri:e,graphUri:t})).then(Un).then(a).catch((e=>{console.warn(e)})),()=>{a([])})),[e,t,n]),{treeData:o,setTreeData:a}})(l,t.graph.type),c=Fn(),u=(0,a.useDispatch)(),{id:p,graph:m}=t,g=(0,r.useCallback)((()=>{u(E.ui.actions.openGraph({viewId:p,graphType:m.type}))}),[u,p,m]),f=(0,r.useCallback)((e=>({title:o().createElement(Wn,{node:e.node})})),[]);return o().createElement(F.Z,{className:n},o().createElement(Jn,{onGraphOpen:g,title:t.caption}),o().createElement(Vn.Provider,{value:t},o().createElement("div",{className:c.treeContainer},o().createElement("div",{className:c.tree},o().createElement(Ln.ZP,{isVirtualized:!1,treeData:i,canDrag:!1,theme:Xn,generateNodeProps:f,onChange:s,getNodeKey:_n})))))})),Jr=fr((e=>{let{config:t,className:n}=e;const l=Lr(),s=(0,a.useSelector)(E.ZP.selectors.getEntity),c=null==s?void 0:s.uri,[u,m]=(0,r.useState)(!1),g=(0,r.useCallback)((()=>{m(!0)}),[]),f=(0,r.useCallback)((()=>{m(!1)}),[]),{matches:h,entitiesMap:y,loadMatches:v,total:x}=(0,Dr.s)({enabled:!!c,entity:s,options:Br,filter:"",page:0,sorting:Wr,rowsPerPage:3,onStartLoading:g,onFinishLoading:f}),S=(0,r.useCallback)((()=>{v()}),[v]),C=(0,a.useDispatch)(),P=(0,r.useContext)(p.m),O=(0,r.useCallback)((()=>{C(E.ui.actions.openPerspective({perspectiveId:"potentialMatches",viewId:P}))}),[C,P]),N=(0,r.useMemo)((()=>(0,d.NVY)(c,(0,i.map)(d.ev7,h))),[c,h]),{getCommentsCount:T}=(0,r.useContext)(w.h);(0,r.useEffect)((()=>{T(N)}),[T,N]);const k=x>3&&!(0,i.isEmpty)(h),Z=u?_r.Loading:(0,i.isEmpty)(h)?_r.NoData:_r.Loaded;return o().createElement(Se.X.Provider,{value:y},o().createElement(F.Z,{className:L()(l.root,n)},o().createElement(z.Z,{title:t.caption}),o().createElement("div",{className:l.matchesContainer},Z===_r.Loading&&o().createElement(R.Z,null),Z===_r.NoData&&o().createElement(V.Typography,{className:l.noData},b().text("No matches found")),Z===_r.Loaded&&h.map((e=>o().createElement(zr,{config:t,entitiesMap:y,match:e,onFinishRequest:S,onStartRequest:g,key:e.object.uri})))),k&&o().createElement(o().Fragment,null,o().createElement("div",{className:l.footer},o().createElement(V.Link,{component:"button",variant:"caption",onClick:O,underline:"none"},b().text("See all"))))))})),eo=(0,r.lazy)((()=>n.e(6596).then(n.bind(n,46596)).then((e=>({default:fr(e.HierarchyTreeView)}))))),to=(0,r.lazy)((()=>n.e(4361).then(n.bind(n,14361)).then((e=>({default:fr(e.RelationshipsTableView)}))))),no=fr((e=>{let{config:t,isFullscreen:n,onToggleFullscreen:l,className:i}=e;const s=wr(),c=(0,a.useSelector)(E.ZP.selectors.getMetadata),u=(0,a.useSelector)(E.ZP.selectors.getEntity),p=(0,a.useSelector)(E.ZP.selectors.getGoogleMapKey),{markers:m,loading:g}=((e,t,n)=>{const[o,a]=(0,r.useState)([]),[l,i]=(0,r.useState)(!0),s=(0,he._)();return(0,r.useEffect)((()=>{i(!0),s((0,d.DBr)(t,[e],n)).then((e=>{a(e.filter(xr))})).catch((()=>{a([])})).finally((()=>{i(!1)}))}),[e,t,n,s]),{markers:o,loading:l}})(u,c,p),f=(0,r.useMemo)((()=>o().createElement("div",{className:s.fullHeight},o().createElement(R.Z,null))),[s]),b=(0,r.useMemo)((()=>({lat:0,lng:0})),[]);return p&&o().createElement(F.Z,{className:L()(s.root,i)},g&&o().createElement(R.Z,null),o().createElement(vr.Z,{size:"S",icon:n?yr.Z:hr.Z,onClick:()=>l(t.id),className:s.fullscreenBtn}),o().createElement(Er.Z,{loadingElement:f,defaultZoom:1,defaultCenter:b,markers:m,mapContainerClassName:s.fullHeight,mapKey:p}))})),ro=fr((e=>{let{config:t,className:n}=e;const{attributeUri:l}=t,s=Ir(),c=(0,a.useDispatch)(),u=(0,a.useSelector)(E.ZP.selectors.getMode),p=(0,a.useSelector)(E.ZP.selectors.getEntityWithDiff),m=(0,a.useSelector)(E.ZP.selectors.getMetadata),g=(0,d.zeJ)(m,l),f=(0,i.pathOr)([],["attributes",null==g?void 0:g.name],p),h=(0,i.path)(["attributes","paging",l],p),y=f.length,v=t["text-empty"]||b().text("No data found"),x=(0,r.useCallback)((e=>c(E.N5.actions.requestNextPageOfAttributeValues(e))),[c]);return o().createElement(F.Z,{className:n},o().createElement(z.Z,{title:t.caption}),o().createElement("div",{className:s.container},(()=>{if(g){if((0,d.KIu)(u)){const e={attributeType:g,config:t,paging:h,requestNextPageOfAttributeValues:x};return o().createElement(Zr,e)}if(y>0){const e={attributeValues:f,attributeType:g,imageSize:jr,paging:h,parentUri:p.uri,requestNextPageOfAttributeValues:x};return o().createElement(o().Fragment,null,o().createElement(Sr.Z,e),o().createElement(Nr,{totalImages:y}))}}return o().createElement(V.Typography,{className:s.noData},v)})()))}));class oo{}oo.ViewTypes=d.ZIY,oo.getComponentBy=(e,t)=>{let{store:n,config:r,className:a,isFullscreen:l,onToggleFullscreen:i}=t;switch(r[e]){case oo.ViewTypes.HierarchyTree:return o().createElement(eo,{config:r,store:n,className:a});case oo.ViewTypes.HierarchyPaths:return o().createElement(Kr,{config:r,className:a});case oo.ViewTypes.RelationsTable:return o().createElement(to,{config:r,store:n,className:a});case oo.ViewTypes.Relations:return o().createElement(Xr,{config:r,className:a});case oo.ViewTypes.Attributes:return o().createElement(qr,{className:a,config:r});case oo.ViewTypes.SingleAttributeView:return o().createElement($r,{config:r,className:a});case oo.ViewTypes.TableAttributeView:return o().createElement(Qr,{config:r,className:a});case oo.ViewTypes.MapView:return o().createElement(no,{config:r,isFullscreen:l,onToggleFullscreen:i,className:a});case oo.ViewTypes.CustomView:return o().createElement(Yr,{config:r,className:a});case oo.ViewTypes.ImageAttributeView:return o().createElement(ro,{config:r,className:a});case oo.ViewTypes.PotentialMatchesView:return o().createElement(Jr,{config:r,className:a})}},oo.getComponent=e=>oo.getComponentBy("class",e)||oo.getComponentBy("react-class",e)||o().createElement(Gr,{className:e.className});const ao=oo,lo=()=>null,io=(0,r.memo)((e=>{let{config:t,store:n,isFullscreen:a,isAutosize:l,onToggleFullscreen:i}=e;const s=br();return o().createElement(r.Suspense,{fallback:o().createElement(lo,null)},ao.getComponent({config:t,store:n,className:L()(s.component,{[s.fullHeight]:!l}),isFullscreen:a,onToggleFullscreen:i}))}));io.displayName="ViewComponent";const so=(0,$.Z)((e=>({item:e.basicView,fixedSizeContainer:{height:"100%"}})));function co(){return co=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},co.apply(this,arguments)}const uo=["onConfigChanged","onRemove"],po=e=>{let{layoutItemConfig:t,views:n,className:l,children:s,style:c,isFullscreen:u,onToggleFullscreen:p,AutosizeComponent:m}=e,d=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["layoutItemConfig","views","className","children","style","isFullscreen","onToggleFullscreen","AutosizeComponent"]);const g=n.find((e=>{let{id:n}=e;return t.i===n})),f=so(),{store:b}=(0,r.useContext)(a.ReactReduxContext);if(!g)return null;const h=g.class===ao.ViewTypes.CustomView;return o().createElement("div",co({},(0,i.omit)(uo,d),{style:c,className:L()(l,{[f.item]:!h})}),o().createElement("div",{className:L()({[f.fixedSizeContainer]:!m})},m,o().createElement(io,{store:b,config:g,isFullscreen:u,onToggleFullscreen:p,isAutosize:Boolean(m)})),s)},mo=e=>{let{views:t,layout:n,layoutOptions:r,onLayoutChanged:a}=e;return o().createElement(j.Z,{LayoutItem:po,views:t,layout:n,layoutOptions:r,onLayoutChanged:a,draggableHandle:".viewDraggableHandle"})};var go=n(57304),fo=n(3409),bo=n(93873),ho=n(22860),yo=n(72753),Eo=n(43576);function vo(){return vo=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},vo.apply(this,arguments)}const xo=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return o().createElement("svg",vo({width:"19",height:"17",viewBox:"0 0 19 17",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},n),o().createElement("defs",null,o().createElement("path",{d:"M14 17v2H4v-2h10zm6-4v2H4v-2l12.884.001H17l.116-.002L20 13zm-8.457-2H4V9h5.82a8.465 8.465 0 001.723 2zM9.139 6.178l-.289.733.035.088L4 7V5l5.713-.002c-.22.375-.412.768-.574 1.18zM17 2.82a6.451 6.451 0 00-6 4.09 6.451 6.451 0 006 4.092 6.451 6.451 0 006-4.091 6.451 6.451 0 00-6-4.091zm0 6.815a2.728 2.728 0 010-5.455 2.728 2.728 0 010 5.455zm0-4.365c-.905 0-1.636.73-1.636 1.636 0 .906.73 1.637 1.636 1.637.905 0 1.636-.731 1.636-1.637 0-.905-.73-1.636-1.636-1.636z",id:"svg1467685497a"})),o().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},o().createElement("g",{transform:"translate(-4 -2.5)"},o().createElement("mask",{id:"svg1467685497b",fill:"#fff"},o().createElement("use",{xlinkHref:"#svg1467685497a"})),o().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg1467685497b)",d:"M0 0h24v24H0z"}))))},wo=(0,$.Z)({editingButtons:{display:"flex","& button + button":{width:"88px",marginLeft:"8px"}},searchResults:{width:"150px",height:"25px",backgroundColor:"#ccc"},comments:{display:"flex",justifyContent:"flex-end",marginTop:"10px"}}),So=e=>o().createElement(V.SvgIcon,e,o().createElement(xo,null)),Co=(e,t,n,r,o)=>e.filter((e=>{let{value:a,permission:l}=e;return!(n&&!(0,d.KIu)(a))&&!!(r&&o||!(0,d.fnZ)(a))&&(0,d.uGe)(l,t)})),Po=e=>{let{className:t}=e;const n=wo(),l=(0,a.useDispatch)(),i=(0,a.useSelector)(E.ZP.selectors.getCanUserStartProcessFromQuery),s=(0,a.useSelector)(E.ZP.selectors.getEntityWithoutDiff),c=(0,a.useSelector)((e=>E.ZP.selectors.getModifiedEntity(e,s.uri))),u=(0,a.useSelector)(E.ZP.selectors.getMetadata),p=(0,a.useSelector)(E.ZP.selectors.isWorkflowEnabled),m=(0,a.useSelector)(E.ZP.selectors.getMode),g=(0,a.useSelector)(E.ZP.selectors.getIsEditableMode),f=(0,a.useSelector)(E.ZP.selectors.getIsViewMode),h=(0,a.useSelector)(E.ZP.selectors.getIsHistoryModeEnabled),y=(0,a.useSelector)(E.ZP.selectors.getProfileOperation)===d.OXy.Saving,v=null==s?void 0:s.type,x=(0,r.useMemo)((()=>[{label:b().text("Editing"),value:d.fO_.EDITING,description:b().text("Edit profile directly"),icon:Eo.Z,permission:"UPDATE"},{label:b().text("Suggesting"),value:d.fO_.SUGGESTING,description:b().text("Suggest changes and initiate a workflow review"),icon:So,permission:"INITIATE_CHANGE_REQUEST"},{label:b().text("Viewing"),value:d.fO_.VIEWING,description:b().text("Suggest changes and initiate a workflow review"),icon:yo.Z,permission:"READ"}]),[]),w=(0,r.useMemo)((()=>[{label:b().text("Delete"),value:"Delete",description:b().text("Permanently delete profile"),icon:Ge.Z,onClick:()=>{window.confirm(b().text("Are you sure you want to delete this?"))&&l(E.N5.entity.actions.entityRemoveRequested({entityUri:s.uri}))},permission:"DELETE"}]),[l,s.uri]),S=(0,r.useMemo)((()=>(0,d.nt9)(u,v)||{}),[u,v]),C=!h&&!(0,d.biM)(s)&&!(e=>(0,d.uGe)(d.BDP.READ,e)&&!(0,d.uGe)(d.BDP.UPDATE,e)&&!(0,d.uGe)(d.BDP.DELETE,e)&&!(0,d.uGe)(d.BDP.INITIATE_CHANGE_REQUEST,e))(S),P=(0,d.ZiX)(null==s?void 0:s.uri),O=(0,r.useMemo)((()=>Co(x,S,P,p,i)),[x,S,p,i,P]),N=(0,r.useMemo)((()=>Co(w,S,P,p,i)),[w,S,p,i,P]),T=(0,r.useCallback)((e=>{l(E.N5.mode.actions.modeUpdated(e))}),[l]),k=(0,r.useCallback)((()=>{l(E.N5.mode.actions.modeCancelEditing())}),[l]),Z=(0,r.useCallback)((()=>{l(E.N5.actions.saveProfile())}),[l]);return o().createElement(go.Z,{className:L()(t,ft.U),entity:g&&c?c:s},o().createElement(V.Box,{display:"flex",alignItems:"center"},o().createElement(V.Box,{mr:3},g&&o().createElement(V.Box,{className:n.editingButtons},o().createElement(V.Button,{variant:"outlined",onClick:k,"data-reltio-id":"reltio-profile-cancel-editing",disabled:y},b().text("Cancel")),o().createElement(V.Button,{variant:"contained",color:"primary","data-reltio-id":"reltio-profile-save-profile",onClick:Z,disabled:y},(0,d.fnZ)(m)?b().text("Suggest"):b().text("Save"))),h&&f?o().createElement(fo.Z,null):f&&o().createElement(bo.a,null)),C&&o().createElement(ho.T,{optionsGroup:O,buttonsGroup:N,value:m,onChange:T,disabled:y})),o().createElement(V.Box,{className:n.comments},o().createElement(bt.Z,{uri:s.uri,relatedObjectUris:(0,d.wp9)(d.q7e.ENTITY,{entityUri:s.uri}),objectType:d.q7e.ENTITY})))};var Oo=n(71820),No=n(85890),To=n(26789),ko=n(54362),Zo=n(6674),Ro=n(91515),Io=n(52043),jo=n(17308),Do=n(39827),Lo=n(80147),Ao=n(76569);const Mo=(0,$.Z)({wrapper:{display:"flex",overflow:"hidden",marginLeft:"auto",flexShrink:0},badge:{fontSize:"12px",height:"18px",minWidth:"18px",backgroundColor:"#FF4081",color:"#FFF"},badgePosition:{right:"5px"}}),Uo=()=>{const{total:e}=(0,r.useContext)(k.O),t=Mo();return o().createElement(V.Badge,{badgeContent:e,classes:{anchorOriginTopRightRectangle:t.badgePosition,badge:t.badge}},o().createElement(Ao.Z,null))};var Fo=n(9371),Ho=n(4426);const Vo=(0,$.Z)({wrapper:{overflow:"auto",paddingRight:"12px"},showMoreLink:{display:"flex",margin:"16px"},showMoreIcon:{fontSize:"1rem"}}),zo=()=>{const e=Vo(),{getComments:t,comments:n,pageToken:l}=(0,r.useContext)(w.h),i=(0,a.useSelector)(E.ZP.selectors.getEntityUri);return(0,r.useEffect)((()=>{t(i)}),[t,i]),o().createElement(V.Box,{className:e.wrapper},n.map((e=>{const{objectId:t,relatedObjectUris:n,objectType:r,commentId:a}=e;return o().createElement(Fo.J,{key:a,uri:t,relatedObjectUris:n,objectType:r,comment:e})})),l&&o().createElement(V.Link,{component:"button",variant:"caption",className:e.showMoreLink,onClick:()=>{t(i,l)},underline:"none"},o().createElement(Ho.Z,{className:e.showMoreIcon}),b().text("Show more")))};var Bo=n(34120);const Wo=(0,$.Z)({wrapper:{overflow:"auto",position:"relative",height:"100%"}}),_o=()=>{const e=Wo(),{tasks:t,loading:n}=(0,r.useContext)(k.O);return o().createElement("div",{className:e.wrapper},n&&o().createElement(R.Z,null),t&&t.map((e=>o().createElement(Bo.s,{key:e.taskId,task:e}))))};function Go(){return Go=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},Go.apply(this,arguments)}const qo=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return o().createElement("svg",Go({width:"20",height:"20",viewBox:"0 0 20 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},n),o().createElement("defs",null,o().createElement("path",{d:"M4 17.17L5.17 16H20V4H4v13.17zM20 2c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H6l-4 4V4c0-1.1.9-2 2-2h16zm-3 9H7v2h10v-2zm0-4H7v2h10V7z",id:"svg2697213709a"})),o().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},o().createElement("g",null,o().createElement("g",{transform:"translate(-2 -2)"},o().createElement("mask",{id:"svg2697213709b",fill:"#fff"},o().createElement("use",{xlinkHref:"#svg2697213709a"})),o().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg2697213709b)",d:"M0 0h24v24H0z"})))))},$o=()=>{const{commentsMap:e}=(0,r.useContext)(w.h),t=Mo();return o().createElement(V.Badge,{badgeContent:(0,d.mdt)(e),classes:{anchorOriginTopRightRectangle:t.badgePosition,badge:t.badge}},o().createElement(qo,null))};var Qo=n(10159);const Xo=()=>o().createElement(Qo.Z,{text:b().text("Ready to go with the flow?"),secondaryText:b().text("Suggest a change or submit a match review, and we’ll kick off a workflow task to get things going.")}),Yo=()=>o().createElement(Qo.Z,{text:b().text("Care to join the conversation?"),secondaryText:b().text("Leave comments for team members anywhere in the Profile page, and we’ll record it here.")});function Ko(){return Ko=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},Ko.apply(this,arguments)}let Jo;!function(e){e[e.Workflow=0]="Workflow",e[e.Collaboration=1]="Collaboration",e[e.History=2]="History"}(Jo||(Jo={}));const ea=e=>{if(e)return 1===e?b().text("${total} item",{total:e}):b().text("${total} items",{total:e})},ta=()=>{var e,t,n;const l=Mo(),s=(0,a.useSelector)(E.ZP.selectors.isWorkflowSideViewEnabled),c=(0,a.useSelector)(E.ZP.selectors.isWorkflowEnabled),u=(0,a.useSelector)(E.ZP.selectors.isCollaborationSideViewEnabled),p=(0,a.useSelector)(E.ZP.selectors.isCollaborationEnabled),m=(0,a.useSelector)(E.ZP.selectors.getHistoryEvent),g=(0,a.useSelector)(E.ZP.selectors.getMetadata),f=(0,a.useSelector)(E.ZP.selectors.getEntity),h=(0,r.useContext)(k.O),y=(0,r.useContext)(w.h),[v,x]=(0,r.useState)(null),S=(0,r.useCallback)((e=>{x((t=>t===e?null:e))}),[]),C=(0,r.useCallback)((()=>{x(null)}),[]),P=null!==v,O=v===Jo.History,{isHistoryEnabled:N,isProfilePersisted:T}=(0,Oo.C)({isHistoryTabActive:O,entity:f}),{historyFilter:Z,onApplyFilter:R,onClearFilter:I,isLoading:j,historicUris:D,historyWithTotal:L,canLoadMore:A,onLoadMore:M}=(0,No.k)({entity:f,enabled:N}),U=s&&c&&!(0,d.ZiX)(null==f?void 0:f.uri),F=u&&p,H=(0,d.mdt)(null==y?void 0:y.commentsMap),V=[{buttonProps:{id:Jo.Workflow,icon:Uo,tooltipTitle:b().text("Workflow")},content:null!=h&&h.total?o().createElement(_o,null):o().createElement(Xo,null),headerProps:{mainTitle:b().text("Workflow"),secondTitle:ea(null==h?void 0:h.total),rightContent:o().createElement(To.G,null)},hidden:!U},{buttonProps:{id:Jo.Collaboration,icon:$o,tooltipTitle:b().text("Collaboration")},content:H?o().createElement(zo,null):o().createElement(Yo,null),headerProps:{mainTitle:b().text("Collaboration"),secondTitle:ea(H)},hidden:!F},{buttonProps:{id:Jo.History,icon:Lo.Z,tooltipTitle:b().text("History")},content:T?o().createElement(ko.Z,{isLoading:j,historyWithTotal:L,contributorsUris:D,entityUri:null==f?void 0:f.uri,historyEvent:m,onLoadMore:M,canLoadMore:A}):o().createElement(Zo.Z,null),headerProps:{content:o().createElement(Ro.Z,{total:T?((null==D?void 0:D.length)||0)+1:void 0,entityType:(0,d.nt9)(g,null==f?void 0:f.type),filter:Z,onApplyFilter:R,onClearFilter:I})}}],z=(0,i.reject)((0,i.propEq)("hidden",!0))(V);return(0,r.useEffect)((()=>{var e;null!==(e=V[v])&&void 0!==e&&e.hidden&&C()}),[v,V,C,z]),o().createElement("div",{className:l.wrapper},o().createElement(Io.h,{open:P,width:480},!(null!==(e=V[v])&&void 0!==e&&e.hidden)&&o().createElement(o().Fragment,null,o().createElement(jo.P,Ko({},null===(t=V[v])||void 0===t?void 0:t.headerProps,{onClose:C})),null===(n=V[v])||void 0===n?void 0:n.content)),o().createElement(Do.G,{buttonsProps:(0,i.pipe)((0,i.reject)((0,i.propEq)("hidden",!0)),(0,i.pluck)("buttonProps"))(V),onButtonClick:S,activeIndexId:v}))};var na=n(39781),ra=n(16715);const oa="48px",aa="1px solid rgba(0, 0, 0, .125)",la=(0,$.Z)((e=>({accordion:{borderTop:aa,borderBottom:aa,fontSize:"13px",boxShadow:"none","&:not(:first-child)":{borderTop:0},"&:before":{display:"none"},"&$accordionExpanded":{margin:"auto"}},accordionExpanded:{},accordionSummary:{display:"flex",alignItems:"center",height:oa,minHeight:oa,"&$accordionSummaryExpanded":{height:oa,minHeight:oa}},accordionSummaryHeading:{flex:1,fontSize:e.typography.pxToRem(13),fontWeight:e.typography.fontWeightRegular},accordionSummaryExpanded:{},accordionSummaryContent:{display:"flex",alignItems:"center"},accordionDetails:{maxHeight:"21vh",overflow:"auto",paddingTop:0,paddingBottom:0,"& ul":{paddingLeft:"23px",marginTop:"3px"},"& li":{paddingLeft:"9px",paddingBottom:"8px"}},parents:{color:e.palette.text.primary},errorsAccordion:{backgroundColor:"#FFF4F6",borderColor:"#FFB8B3"},errorsAccordionDetails:{color:"#DD2C00"},warningsAccordion:{backgroundColor:"#FFF9ED",borderColor:"#FFDD91"},warningsAccordionDetails:{color:"#CC7500"},icon:{marginRight:"8px"},errorIcon:{fill:"#FF1744"},warningIcon:{fill:"#F9A825"}}))),ia=la;var sa=n(38016);const ca=(0,r.memo)((e=>{let{panels:t,expandedPanelId:n,onToggle:r,ErrorComponent:a}=e;const l=ia();return t.length>0?o().createElement("div",null,t.map((e=>{let{id:t,icon:i,title:s,items:c,accordionClassName:u,accordionDetailsClassName:p}=e;return o().createElement(V.Accordion,{key:t,square:!0,expanded:n===t,onChange:r(t),className:u,classes:{root:l.accordion,expanded:l.accordionExpanded}},o().createElement(V.AccordionSummary,{classes:{root:l.accordionSummary,expanded:l.accordionSummaryExpanded,content:l.accordionSummaryContent},expandIcon:o().createElement(sa.Z,null)},i,o().createElement(V.Typography,{className:l.accordionSummaryHeading},s)),o().createElement(V.AccordionDetails,{className:L()(l.accordionDetails,p)},o().createElement("ul",null,c.map(((e,t)=>o().createElement(a,{key:t,error:e}))))))}))):null}));ca.displayName="ErrorsPanel";const ua=(0,i.omit)(["deactivated","path"]),pa=(0,r.memo)((e=>{let{error:t}=e;const n=ia(),r=((e,t)=>{let{type:n,source:r,message:o,attributeTypeUri:a="",attributeType:l}=t;if(n===d.NIO.missed&&r===d.zHr.local){const t=l||(0,d.zeJ)(e,a);return t?b().text("${attribute} is required",{attribute:t.label}):o}return o})((0,a.useSelector)(E.ZP.selectors.getMetadata),t),l=(e=>{let{path:t,uri:n}=e;return null==t?void 0:t.slice(0,n?t.length-1:t.length).filter((e=>{let{type:t}=e;return[d.HAc.attributeValue,d.HAc.relationConnection].includes(t)})).map((e=>{let{label:t}=e;return t})).filter(i.identity).join(" / ")})(t);return o().createElement("li",null,o().createElement("span",null,r),l&&o().createElement(o().Fragment,null,o().createElement("br",null),o().createElement("span",{className:n.parents},l)))}));pa.displayName="Error";const ma=()=>{const e=ia(),t=(e=>{const t=(0,r.useRef)(e);return function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.length===t.length&&(0,i.equals)(e.map(ua),t.map(ua))}(e,t.current)||(t.current=e),t.current})((0,a.useSelector)(E.ZP.selectors.getProfileErrors)),[n,l]=(0,r.useMemo)((()=>(0,i.partition)(d.IT0,t)),[t]),[s,c]=(0,r.useState)(null),u=(0,r.useMemo)((()=>[{id:"errors",title:b().text("${number} ${errors}",{number:n.length,errors:1===n.length?b().text("error"):b().text("errors")}),icon:o().createElement(na.Z,{className:L()(e.icon,e.errorIcon)}),items:n,accordionClassName:e.errorsAccordion,accordionDetailsClassName:e.errorsAccordionDetails},{id:"warnings",title:b().text("${number} ${warnings}",{number:l.length,warnings:1===l.length?b().text("warning"):b().text("warnings")}),icon:o().createElement(ra.Z,{className:L()(e.icon,e.warningIcon)}),items:l,accordionClassName:e.warningsAccordion,accordionDetailsClassName:e.warningsAccordionDetails}].filter((e=>{let{items:t}=e;return t.length>0}))),[n,l,e]);(0,r.useEffect)((()=>{c("errors")}),[n]);const p=(0,r.useCallback)((e=>(t,n)=>{c(n?e:null)}),[]);return u.length>0?o().createElement(ca,{panels:u,expandedPanelId:s,onToggle:p,ErrorComponent:pa}):null},da=(0,$.Z)((e=>({perspectiveView:{position:"absolute",top:0,left:0,right:0,bottom:0,fontFamily:"Roboto, Helvetica, Arial, sans-serif",overflowX:"hidden",overflowY:"auto",display:"flex",flexDirection:"column",backgroundColor:e.palette.background.default},scrollWrapper:{flexGrow:1,overflowY:"auto"},emptyState:{backgroundColor:"#FAFAFA",height:"100%"},profileWrapper:e=>{let{maxWidth:t}=e;return{display:"flex",flexDirection:"column",overflow:"hidden",flexGrow:1,maxWidth:t?`${t}px`:"100%"}},profileContainer:{display:"flex",overflow:"hidden",flexGrow:1},"@global div[role=tooltip]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"},"@global div[role=presentation]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"}}))),ga=(0,r.memo)((e=>{let{config:t,saveState:n,getSavedState:l}=e;const i=da({maxWidth:null==t?void 0:t.maxWidth}),s=(0,a.useDispatch)(),c=(0,r.useRef)(),u=(0,r.useCallback)((0,d.DsO)(n,5e3),[n]),{isLoaded:p,savedState:m}=(0,v.a)(l),[g,f]=(0,r.useState)([]),[h,j]=(0,r.useState)([]),D=(0,r.useMemo)((()=>y()(t)),[t]),L=(0,a.useSelector)(E.ZP.selectors.getEntity),A=(0,a.useSelector)(E.ZP.selectors.getIsHistoryModeEnabled),M=(0,r.useMemo)((()=>(0,d.dvH)(L)),[L]),U=(0,x.C)({objectIds:M}),F=(0,r.useContext)(w.h),H=(0,S.U)(),V=(0,C.v)(null==t?void 0:t.workflow),z=(0,a.useSelector)(E.ZP.selectors.getHistoryEvent);(0,P.a)({entity:L,historyEvent:z});const B=(0,O.u)();(0,r.useEffect)((()=>{if(p){const e=D!==m.configHash,{views:n,layout:r}=(0,d.Mfk)({views:e||!m.views?t.views:m.views,layout:e?t.layout:m.layout});j(n),f(r)}}),[p]),(0,r.useEffect)((()=>{s(E.N5.views.actions.profileViewsSet(h))}),[s,h]),(0,r.useEffect)((()=>{t.sidePanelViews&&s(E.N5.sidePanelViews.actions.sidePanelViewsLoaded(t.sidePanelViews))}),[t]),(0,r.useEffect)((()=>{c.current&&(c.current.scrollTop=0)}),[null==L?void 0:L.uri]),(()=>{const e=(0,a.useDispatch)(),t=(0,a.useSelector)(E.ZP.selectors.getValidateReadMode),n=(0,a.useSelector)(E.ZP.selectors.getEntity)||{},{uri:o,updatedTime:l}=n,i=(0,d.biM)(n),s=(0,a.useSelector)(E.ZP.selectors.getMode),c=(0,a.useSelector)(E.ZP.selectors.getProfileViews),u=c&&c.length>0,p=(0,r.useCallback)((0,d.DsO)((t=>{t&&e(E.N5.actions.validateProfile())}),500),[e]);(0,r.useEffect)((()=>{const e=t&&!i&&o&&!(0,d.ZiX)(o)&&s===d.ARY.Viewing&&u;p(e)}),[p,i,t,l,o,s,u])})();const W=(0,r.useCallback)((e=>{u({layout:e,views:h,configHash:D}),f(e)}),[u,D,h]);return o().createElement(N.j.Provider,{value:!0},o().createElement(T.s.Provider,{value:H},o().createElement(w.h.Provider,{value:A?F:U},o().createElement(k.O.Provider,{value:V},o().createElement(Z.m.Provider,{value:B},o().createElement("div",{className:i.perspectiveView},(!p||!(null!=L&&L.uri))&&o().createElement(R.Z,null),p&&null!=L&&L.uri?o().createElement("div",{className:i.profileContainer},o().createElement("div",{className:i.profileWrapper},o().createElement(Po,null),!A&&o().createElement(ma,null),o().createElement("div",{ref:c,className:i.scrollWrapper},o().createElement(mo,{layout:g,onLayoutChanged:W,views:h}))),o().createElement(ta,null)):o().createElement("div",{className:i.emptyState},o().createElement(I.ZP,{LogoRenderer:I.B9.NO_DATA,text:b().text("No data to display."),variant:I.tC.embedded}))))))))}));ga.displayName="ProfilePerspectiveView";const fa=(0,s.createGenerateClassName)({productionPrefix:"profilePerspective",disableGlobal:!0}),ba=e=>{let{config:t,store:n,onResize:f=i.identity,saveState:b,getSavedState:h,qxSandboxApi:y}=e;const E=(0,r.useCallback)((0,d.aYu)(h),[h]),v=(0,r.useMemo)((()=>(0,d.Vr9)(t)),[t]);return o().createElement(a.Provider,{store:n},o().createElement(p.m.Provider,{value:v.id},o().createElement(g.Provider,{value:y},o().createElement(s.StylesProvider,{generateClassName:fa},o().createElement(u.MuiPickersUtilsProvider,{utils:l.Z},o().createElement(c.Z,{handleHeight:!0,onResize:(e,t)=>f(Math.floor(e),Math.floor(t))}),v&&o().createElement(ga,{config:v,saveState:b,getSavedState:E}),o().createElement(m.Z,{showErrorFromStore:!0}))))))};var ha=n(82842),ya=n(51229),Ea=n(91131);const va=(0,$.Z)((e=>({titleContainer:{overflow:"hidden",fontSize:"16px",fontWeight:"normal",whiteSpace:"nowrap",textOverflow:"ellipsis",alignItems:"center",display:"flex",minHeight:"48px",color:e.palette.text.secondary},link:{fontSize:"16px",fontWeight:"normal"},icon:{height:"18px",color:e.palette.text.secondary},totalCaption:{lineHeight:"inherit",fontSize:"14px",color:"rgba(0,0,0,0.6)",flexShrink:0,marginRight:"5px"},totalNumber:{fontSize:"16px",color:"rgba(0,0,0,0.87)",marginRight:"5px",fontWeight:500}}))),xa=e=>{let{total:t=0}=e;const n=va(),l=(0,a.useDispatch)(),i=(0,r.useContext)(p.m),s=(0,r.useCallback)((()=>{l(E.ui.actions.openPerspective({perspectiveId:"profile",viewId:i}))}),[l,i]);return o().createElement(z.Z,{title:""},o().createElement("div",{className:n.titleContainer},o().createElement(V.Link,{component:"button",variant:"caption",className:n.link,onClick:s,underline:"none"},b().text("Profile")),o().createElement(Ea.Z,{className:n.icon}),b().text("Tags")),o().createElement(ya.Z,null),o().createElement(V.Typography,{className:n.totalCaption,variant:"caption"},o().createElement("span",{className:n.totalNumber},b().number(t,"0,0")),b().text("total profiles")))};var wa=n(20404);const Sa=(0,$.Z)((e=>({toolbar:{display:"flex",flexShrink:0,background:"white",borderBottom:"1px solid rgba(0,0,0,0.1)",boxSizing:"border-box",paddingLeft:"16px"},avatar:{color:"rgba(0, 0, 0, 0.38)",marginRight:"12px"},label:{fontSize:"20px",letterSpacing:"0.25px",lineHeight:"1.2",fontWeight:500,color:e.palette.text.primary,wordBreak:"break-word"}}))),Ca=e=>{let{label:t}=e;const n=Sa();return o().createElement(V.Toolbar,{className:n.toolbar},o().createElement(wa.Z,{className:n.avatar}),o().createElement(V.Typography,{variant:"h6",className:n.label},t))};function Pa(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){Oa(e,t,n[t])}))}return e}function Oa(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Na=(0,$.Z)((e=>({perspectiveView:{position:"absolute",top:0,left:0,right:0,bottom:0,fontFamily:"Roboto, Helvetica, Arial, sans-serif",overflow:"hidden",display:"flex",flexDirection:"column",backgroundColor:e.palette.background.default},tagsContainer:{display:"flex"},fullHeight:{flexGrow:1,height:0},tagsView:{margin:"16px",width:"100%",paddingTop:"4px"},listContainer:{flex:1,display:"flex",overflow:"hidden",position:"relative",flexDirection:"column",minHeight:"4px"},entitiesList:{overflowY:"auto",flexGrow:1},pagination:{flexGrow:0}}))),Ta=[25,50,100],ka=(0,r.memo)((e=>{let{tag:t,entityUri:n}=e;const l=Na(),[s,c]=(0,r.useState)(Ta[0]),[u,p]=(0,r.useState)(0),m=(0,a.useSelector)(E.ZP.selectors.getGlobalSearchRequestOptions);(0,r.useEffect)((()=>{p(0)}),[t,n,m]);const{isLoading:g,total:f,entities:h}=(e=>{let{tag:t,entityUri:n,page:o=0,rowsPerPage:l=50}=e;const s=(0,a.useDispatch)(),c=(0,he._)(),u=(0,he._)(),[p,m]=(0,r.useState)(!1),[g,f]=(0,r.useState)(0),[h,y]=(0,r.useState)([]),{requestEntities:v,requestTotal:x}=(e=>{let{entityUri:t,tag:n}=e;const o=(0,a.useSelector)(E.ZP.selectors.getGlobalSearchRequestOptions),l=(0,a.useSelector)(E.ZP.selectors.getTenant),s=(0,a.useSelector)(E.ZP.selectors.getDtssPath),c=(0,r.useMemo)((()=>(0,d.Do$)(t)),[t]),u=(0,r.useMemo)((()=>[{filter:"equals",fieldName:"tags",values:[n]}]),[n]),p=!!c,m=(0,r.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=Pa({select:"uri,label,type,secondaryLabel,defaultProfilePicValue,startDate,endDate"},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{});return p?(0,d.uqV)({filters:e,options:t,customerTenant:l,dataTenant:c,dtssPath:s}).then((0,i.map)((0,i.assoc)("dataTenant",c))):(0,d.ZOr)(e,t)}),[p,c,l,s]);return{requestEntities:(0,r.useCallback)(((e,t)=>m(u,Pa({offset:t,max:e},o))),[u,o,m]),requestTotal:(0,r.useCallback)((()=>{const e=o;return(p?(0,d.J$m)({filters:u,options:e,customerTenant:l,dataTenant:c,dtssPath:s}):(0,d.j_Q)(u,e)).then((e=>e.total))}),[u,o,p,c,l,s])}})({entityUri:n,tag:t}),w=(0,r.useCallback)((e=>{s(E.ui.actions.errorSet((0,d.xU7)(e,b().text("Something went wrong")))),f(0)}),[s]);return(0,r.useEffect)((()=>{c(x()).then(f).catch(w)}),[x,c,w]),(0,r.useEffect)((()=>{m(!0),u(v(l,o*l)).then(y).catch(w).finally((()=>m(!1)))}),[o,l,v,u,w]),{isLoading:p,total:g,entities:h}})({tag:t,entityUri:n,page:u,rowsPerPage:s}),y=(0,r.useRef)(null);(0,r.useEffect)((()=>{y.current&&(y.current.scrollTop=0)}),[h]);const v=f>Ta[0];return o().createElement("div",{className:l.perspectiveView},o().createElement(Ca,{label:t}),o().createElement("div",{className:L()(l.tagsContainer,{[l.fullHeight]:v})},o().createElement(F.Z,{className:l.tagsView},o().createElement(xa,{total:f}),o().createElement("div",{className:l.listContainer},g&&o().createElement(R.Z,null),f>0&&o().createElement("div",{className:l.entitiesList,ref:y},o().createElement(ha.Z,{entities:h})),v&&o().createElement("div",{className:l.pagination},o().createElement(H.Z,{count:f,rowsPerPageOptions:Ta,rowsPerPage:s,page:u,onChangePage:p,onChangeRowsPerPage:c}))))))}));ka.displayName="TagPerspectiveView";const Za=(0,s.createGenerateClassName)({productionPrefix:"tagPerspective",disableGlobal:!0}),Ra=e=>{let{config:t,tag:n,entityUri:r,store:l,onResize:u=i.identity}=e;return o().createElement(a.Provider,{store:l},o().createElement(p.m.Provider,{value:t.id},o().createElement(s.StylesProvider,{generateClassName:Za},o().createElement(c.Z,{handleHeight:!0,onResize:(e,t)=>u(Math.floor(e),Math.floor(t))}),t&&o().createElement(ka,{tag:n,entityUri:r}),o().createElement(m.Z,{showErrorFromStore:!0}))))}},1242:(e,t,n)=>{e.exports=n.p+"5271a9e7b6651c852e93.png"}}]);