@reltio/remotes 1.4.1519 → 1.4.1521

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/9481.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";(self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[9481],{98808:(e,t,n)=>{n.d(t,{K:()=>h,N:()=>m});var a=n(24328),r=n.n(a),o=n(71153),l=n.n(o),i=n(94079);const s=(0,n(79692).Z)((e=>({button:{padding:"9px 16px 9px 12px","& svg g path, & svg path":{fill:e.palette.primary.main,fillOpacity:1}},iconButton:{"& svg g path, & svg path":{fill:e.palette.primary.main,fillOpacity:1}},startIcon:{marginLeft:0,marginRight:"8px",width:"18px",height:"18px",alignItems:"center"},label:{whiteSpace:"nowrap",fontSize:"14px",lineHeight:"16px",letterSpacing:0},overflowStyle:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},menuIcon:{marginRight:"12px"},menuItem:{minHeight:"28px",padding:"2px 16px 2px 12px"},menuText:{color:e.palette.text.primary,fontSize:"13px",lineHeight:"15px",letterSpacing:0}})));var c=n(31276),p=n(95613),u=n(8818);function d(){return d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},d.apply(this,arguments)}let m;!function(e){e.iconButton="iconButton",e.button="button",e.menuItem="menuItem"}(m||(m={}));const h=(0,a.forwardRef)(((e,t)=>{let{className:n,mode:a=m.iconButton,label:o,disabled:h,icon:f,onClick:b=c.ZT,onMenuClose:g=c.ZT}=e,y=function(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},o=Object.keys(e);for(a=0;a<o.length;a++)n=o[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)n=o[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}(e,["className","mode","label","disabled","icon","onClick","onMenuClose"]);const x=s();return(()=>{switch(a){case"iconButton":return r().createElement(u.k,d({disabled:h,className:l()(x.iconButton,n),size:"S",tooltipTitle:o,onClick:b,icon:f,showForDisabled:!0},y));case"button":return r().createElement(i.Button,d({className:l()(x.button,n),disabled:h,startIcon:r().createElement(f,null),onClick:b,color:"primary",classes:{startIcon:x.startIcon,label:x.label}},y),r().createElement(p.Z,{value:o},r().createElement("div",{className:x.overflowStyle},o)));case"menuItem":{const e=()=>{g(),b()};return r().createElement(i.MenuItem,d({classes:{root:x.menuItem},onClick:e,disabled:h,ref:t},y),r().createElement(r().Fragment,null,r().createElement(f,{className:x.menuIcon}),r().createElement(i.Typography,{classes:{root:x.menuText}},o)))}}})()}));h.displayName="ActionButton"},58662:(e,t,n)=>{n.d(t,{Z:()=>y});var a=n(13980),r=n.n(a),o=n(24328),l=n.n(o),i=n(71153),s=n.n(i),c=n(94079),p=n(87918),u=n.n(p),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 f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},a=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),a.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 g=e=>{let{classes:t={},count:n,rowsPerPageOptions:a,page:r,onChangePage:i,rowsPerPage:p,onChangeRowsPerPage:b,basicTableRef:g,labelRowsPerPage:y}=e;const x=h(),v=(0,o.useCallback)((()=>{(0,m.pathOr)(m.identity,["current","resetScrollbarPosition"],g)()}),[g]),O=(0,o.useCallback)((e=>{i(e),v()}),[i,v]),w=(0,o.useCallback)((e=>{i(0),b(e),v()}),[i,b,v]);return l().createElement(c.TablePagination,{classes:f({},t,{root:s()(x.pagination,t.root),select:s()(x.select,t.select),caption:x.caption,selectRoot:x.selectRoot,actions:x.actions}),component:"div",labelRowsPerPage:y||u().text("Rows per page:"),labelDisplayedRows:e=>{let{from:t,to:n,count:a}=e;return u().text("${fromRow}-${toRow} of ${countRows}",{fromRow:u().number(t,"0,0"),toRow:u().number(n,"0,0"),countRows:u().number(a,"0,0")})},count:n,rowsPerPageOptions:a,page:r,onChangePage:(0,m.pipe)((0,m.nthArg)(1),O),rowsPerPage:p,onChangeRowsPerPage:(0,m.pipe)(d.NA,w)})};g.propTypes={classes:r().object,rowsPerPageOptions:r().arrayOf(r().number),count:r().number,page:r().number,onChangePage:r().func,rowsPerPage:r().number,onChangeRowsPerPage:r().func,basicTableRef:r().shape({current:r().object}),labelRowsPerPage:r().string};const y=l().memo(g)},81137:(e,t,n)=>{n.d(t,{Z:()=>c});var a=n(24328),r=n.n(a),o=n(87918),l=n.n(o),i=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:a,onCancel:o,cancelCaption:c=l().text("Cancel"),onDiscard:p,discardCaption:u="",onSave:d,saveCaption:m=l().text("Save"),disabledSave:h=!1}=e;const f=s();return r().createElement(i.Dialog,{open:t,onClose:o,classes:{paperScrollPaper:f.paper}},r().createElement(i.DialogTitle,{classes:{root:f.title}},n),r().createElement(i.DialogContent,{classes:{root:f.content}},r().createElement(i.DialogContentText,{classes:{root:f.contentText}},a)),r().createElement(i.DialogActions,{className:f.actionButtons,disableSpacing:!0},o&&r().createElement(i.Button,{onClick:o},c),r().createElement("div",null,p&&r().createElement(i.Button,{onClick:p,classes:{root:f.discardButton}},u),r().createElement(i.Button,{onClick:d,color:"primary",disabled:h,autoFocus:!0},m))))}},7154:(e,t,n)=>{n.d(t,{Z:()=>m});var a=n(24328),r=n.n(a),o=n(13980),l=n.n(o),i=n(67958),s=n(17440),c=n(89846),p=n(27185);function u(){return u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},u.apply(this,arguments)}const d=e=>{let{relation:t={},inRelationTypes:n=[],outRelationTypes:o=[],onChange:l=s.identity,applyFirstByDefault:i=!1,reversedContextLabels:d=!1}=e,m=function(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},o=Object.keys(e);for(a=0;a<o.length;a++)n=o[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)n=o[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}(e,["relation","inRelationTypes","outRelationTypes","onChange","applyFirstByDefault","reversedContextLabels"]);const{getRelationTypesOptions:h,fromEditorValue:f,toEditorValue:b}=(0,c.n)({reversedContextLabels:d}),g=(0,a.useMemo)((()=>h(n,o)),[h,n,o]),y=(0,a.useCallback)((0,s.pipe)(f(n,o),l),[f,n,o,l]),x=!!t.relationType;return(0,a.useEffect)((()=>{i&&g.length&&!x&&y(g[0])}),[g,i,y,x]),r().createElement(p.Z,u({value:b(t,g),options:g,onChange:y},m))};d.propTypes={className:l().string,relation:i.bNA,inRelationTypes:l().arrayOf(i.IYE),outRelationTypes:l().arrayOf(i.IYE),applyFirstByDefault:l().bool,reversedContextLabels:l().bool,onChange:l().func};const m=d},68439:(e,t,n)=>{n.d(t,{Z:()=>m});var a=n(24328),r=n.n(a),o=n(52730),l=n(71153),i=n.n(l),s=n(94079),c=n(67958),p=n(49885),u=n(95613);const d=(0,n(79692).Z)({"entityType-overflow":{textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},"entityType-small":{padding:"1px 4px",fontSize:"10px",lineHeight:"normal",marginRight:"12px",borderRadius:"2px",flexShrink:0},"entityType-medium":{padding:"2px 8px 3px",borderRadius:"2px",fontSize:"13px",fontWeight:500,lineHeight:"15px",marginRight:"16px",flexShrink:0}}),m=e=>{let{entity:t,className:n,size:a="small"}=e;const l=d(),m=(0,o.useSelector)(p.ZP.selectors.getMetadata),h=t.type,f=(0,c.nt9)(m,h)||{},b=(0,c.VD3)(m,f,"typeColor")||c.rSc.palette.primary.main,g=(0,c.jFi)(m,t);return r().createElement(u.Z,{value:g,placement:"top"},r().createElement(s.Typography,{style:{backgroundColor:b,color:c.P6Y.Colors.getColor(b)?"#FFFFFF":"#212121"},className:i()(l[`entityType-${a}`],l["entityType-overflow"],n),component:"div"},g))}},64459:(e,t,n)=>{n.d(t,{Z:()=>g});var a=n(24328),r=n.n(a),o=n(71153),l=n.n(o),i=n(52730),s=n(17440),c=n(94079),p=n(87918),u=n.n(p),d=n(67958),m=n(49885),h=n(53180),f=n(68439);const b=(0,n(79692).Z)((e=>({profileBandWrapper:{flexShrink:0},profileBand:{display:"flex",padding:"16px 12px 16px 16px",alignItems:"flex-start",backgroundColor:"#fff",boxShadow:"0px 1px 0px rgba(0, 0, 0, 0.12)",marginBottom:"1px","&: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"}}}))),g=e=>{let{className:t,entity:n,children:o,classes:p,renderLabel:g=s.identity}=e;const y=b({classes:p}),x=(0,i.useSelector)(m.ZP.selectors.getMetadata),v=(0,i.useSelector)(m.ZP.selectors.getShowEntityId),O=(0,a.useCallback)((()=>{navigator.clipboard.writeText((0,d.BTI)(n))}),[n]);if((0,s.isNil)(n))return null;const w=(0,d.idV)(n.label),E=n.secondaryLabel,P=(0,d.ptG)(x,n),C=(0,d.Fn9)(n),S=n.uri,T=(0,d.BTI)(n);return r().createElement("div",{className:l()(y.profileBandWrapper,t)},r().createElement("div",{className:l()(y.profileBand,{[y.inactive]:!C}),"data-entity-uri":S},r().createElement(h.Z,{key:n.uri,entity:n,avatarClassName:y.profileIcon,imageClassName:y.imageProfileIcon}),r().createElement("div",{className:y.profileInfo},r().createElement("div",null,r().createElement(c.Typography,{variant:"h6",className:y.label},g(w)),E&&r().createElement(c.Typography,{variant:"subtitle2",className:y.secondaryLabel},E),P&&r().createElement(c.Typography,{variant:"subtitle1",className:y.businessCard},P)),r().createElement("div",{className:y.specialInfo},r().createElement("div",{className:y.entityType},r().createElement(f.Z,{entity:n,size:"medium",className:y.badge}),!(0,d.ZiX)(S)&&v&&r().createElement(c.Tooltip,{title:u().text("Copy to clipboard")},r().createElement(c.Typography,{display:"inline",variant:"body2",className:y.entityId,onClick:O},u().text("Entity ID"),": ",T))))),o&&r().createElement("div",null,o)))}},79618:(e,t,n)=>{n.d(t,{a:()=>D});var a=n(24328),r=n.n(a),o=n(94079),l=n(67766),i=n(42767),s=n(67958),c=n(71153),p=n.n(c),u=n(17440),d=n(87918),m=n.n(d),h=n(79468),f=n(83348),b=n(8818);const g=(0,n(79692).Z)({container:{display:"flex",alignItems:"center"},link:{whiteSpace:"nowrap",marginRight:"9px"}}),y=(0,f.Z)(o.Link),x=e=>{var t;let{className:n,total:o=0,onPrev:c,onNext:d,onSearchResultsClick:f,isPrevDisabled:x,isNextDisabled:v}=e;const O=g(),w=(0,a.useContext)(h.T),{OPEN_RESULTS:E,SEARCH_RESULT:P,SEARCH_RESULTS:C,NEXT_PROFILE:S,PREVIOUS_PROFILE:T}=(0,u.mergeRight)({OPEN_RESULTS:m().text("Go to search results"),SEARCH_RESULT:m().text("Search result"),SEARCH_RESULTS:m().text("Search results"),PREVIOUS_PROFILE:m().text("Go to previous profile"),NEXT_PROFILE:m().text("Go to next profile")},null!==(t=null==w?void 0:w.profileBand)&&void 0!==t?t:{});return r().createElement("div",{className:p()(O.container,n)},r().createElement(y,{className:O.link,component:"button",variant:"caption",onClick:f,underline:"none",tooltipTitle:E},(0,s.k7L)(o,1e6)," ",1===o?P:C),r().createElement(b.k,{size:"L",icon:l.Z,tooltipTitle:T,onClick:c,disabled:x,showForDisabled:!0}),r().createElement(b.k,{size:"L",icon:i.Z,tooltipTitle:S,onClick:d,disabled:v,showForDisabled:!0}))};var v=n(52730),O=n(49885),w=n(39450),E=n(54198),P=n(85229);function C(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},a=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),a.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}class T{constructor(e){var t=this;let{data:{query:n,sortField:a,sortOrder:r},tenant:o,searchTenant:l,apiPath:i,dtssPath:c,globalSearchRequestOptions:p}=e;this.query=void 0,this.sortField=void 0,this.sortOrder=void 0,this.tenant=void 0,this.searchTenant=void 0,this.apiPath=void 0,this.dtssPath=void 0,this.globalSearchRequestOptions=void 0,this.isDT=()=>this.tenant!==this.searchTenant,this.getQueryFilter=()=>({rawFilter:this.query}),this.getEntities=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const a=[t.getQueryFilter(),...e],r=C({},t.globalSearchRequestOptions,{sort:t.sortField,order:t.sortOrder,select:"uri,label,type",scoreEnabled:!1},n);return t.isDT()?(0,s.uqV)({filters:a,options:r,customerTenant:t.tenant,dataTenant:t.searchTenant,dtssPath:t.dtssPath}):(0,s.ZOr)(a,r)},this.checkEntity=e=>this.getEntities([{filter:"equals",fieldName:"uri",values:[e]}],{offset:0,max:1}).then((t=>t&&t.length>0&&t[0].uri===e)),this.requestEntities=(e,t)=>this.getEntities([],{offset:t,max:e}),this.requestTotal=()=>{const e=[this.getQueryFilter()],t=this.globalSearchRequestOptions;return(this.isDT()?(0,s.J$m)({filters:e,options:t,customerTenant:this.tenant,dataTenant:this.searchTenant,dtssPath:this.dtssPath}):(0,s.j_Q)(e,t)).then((e=>e.total))},this.query=n,this.sortField=a,this.sortOrder=r,this.tenant=o,this.searchTenant=l,this.apiPath=i,this.dtssPath=c,this.globalSearchRequestOptions=p}}function I(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},a=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),a.forEach((function(t){k(e,t,n[t])}))}return e}function k(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class j{constructor(e){var t=this;let{data:n,tenant:a,apiPath:r}=e;this.searchBody=void 0,this.tenant=void 0,this.apiPath=void 0,this.getEntities=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const a=[{rawFilter:t.searchBody.filter},...e];return(0,s.P2h)({apiPath:t.apiPath,tenant:t.tenant,searchBody:I({},t.searchBody,{filter:e.length?(0,s.Uqd)()(a):t.searchBody.filter}),options:n})},this.checkEntity=e=>this.getEntities([{filter:"equals",fieldName:"id",values:[(0,s.BTI)({uri:e})]}],{from:0,max:1}).then((t=>t&&t.length>0&&t[0].uri===e)),this.requestEntities=(e,t)=>this.getEntities([],{from:t,max:e}),this.requestTotal=()=>(0,s.dED)({apiPath:this.apiPath,tenant:this.tenant,searchBody:this.searchBody}).then((e=>e.count)),this.searchBody=n,this.tenant=a,this.apiPath=r}}function R(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},a=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),a.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 Z=(e,t)=>(0,u.pipe)((0,u.map)((0,u.prop)("uri")),(0,u.reject)((e=>t.includes(e))))(e),B=()=>{const e=(0,P._)(),t=(0,P._)(),n=(0,P._)(),{uri:r,index:o,total:l,tenant:i,cache:c}=(0,v.useSelector)(O.ZP.selectors.getSearchNavigationData)||{},{type:p,data:u}=(0,v.useSelector)(O.ZP.selectors.getSearchProviderData)||{},d=(0,v.useSelector)(O.ZP.selectors.getTenant),m=(0,v.useSelector)(O.ZP.selectors.getApiPath),h=(0,v.useSelector)(O.ZP.selectors.getDtssPath),f=(0,v.useSelector)((e=>O.ZP.selectors.getGlobalSearchRequestOptions(e,["ovOnly"]))),b=(0,a.useContext)(w.m),g=(0,v.useDispatch)(),[y,x]=(0,a.useState)(!1),C=(0,a.useMemo)((()=>((e,t)=>{switch(e){case"search":return new T(t);case"graphsearch":return new j(t)}})(p,{data:u,tenant:d,searchTenant:i,apiPath:m,dtssPath:h,globalSearchRequestOptions:f})),[p,u,d,i,m,h,f]),S=(0,a.useCallback)((e=>{g(O.yC.actions.updateSearchNavigationDataFields(e))}),[g]),I=(0,a.useCallback)((e=>{const t=d!==i?(0,s.wwR)({uri:e,dataTenant:i}):e;g(O.ui.actions.openEntity({uri:t,viewId:b,source:"navigation"}))}),[g,b,d,i]),k=(0,a.useCallback)((()=>{g(O.ui.actions.openPerspective({perspectiveId:p,viewId:b}))}),[g,p,b]);(0,a.useEffect)((()=>{o>=l?S({index:l-1}):o<0&&S({index:0})}),[l,o,S]);const N=(0,E.u)();(0,a.useEffect)((()=>{const e=N(((e,t)=>{switch(e.type){case O.yC.constants.UPDATE_SEARCH_NAVIGATION_DATA_ON_MERGE:{const n=O.ZP.selectors.getSearchNavigationData(t);n&&S(((e,t)=>{const{winnerUri:n,losersUris:a=[]}=t,r=((e,t)=>{let{uri:n,index:a,total:r,cache:o}=e;if(t&&t!==n){if(o&&o.includes(n)){o=[...o];const e=o.indexOf(t);let l=o.indexOf(n);e>=0&&(o.splice(e,1),r--,e<l&&a--),l=o.indexOf(n),o.splice(l,1,t)}return n=t,R({},e,{uri:n,index:a,cache:o,total:r})}return e})(e,n);return((e,t)=>{const{cache:n=[],index:a,total:r,uri:o}=e,l=t.filter((e=>n.includes(e)));if(0===l.length)return e;const i=r-l.length,s=n.indexOf(o);let c=a;for(const e of l)n.indexOf(e)<s&&c--;const p=n.filter((e=>!l.includes(e)));return R({},e,{cache:p,index:c,total:i})})(r,a)})(n,e.payload));break}}}));return()=>e()}),[N,S]);const B=(0,a.useCallback)(((e,a,r)=>{x(!0),t(C.requestTotal()).then((e=>S({total:e})));const o=r+1;return n(C.requestEntities(15,o)).then((t=>{if(t){if(t.length){const n=Z(t,e);if(n.length>0)return S({cache:e.concat(n),uri:n[0],index:o+t.length-n.length}),void I(n[0]);if(r+t.length<a-1)return B(e,a-t.length,r+t.length)}S({index:o})}})).finally((()=>{x(!1)}))}),[C,S,I]),D=(0,a.useCallback)(((e,a)=>{x(!0),t(C.requestTotal()).then((e=>S({total:e})));const r=a-1,o=Math.max(0,a-15),l=15+Math.min(0,a-15);return n(C.requestEntities(l,o)).then((t=>{if(t){if(t.length){const n=Z(t,e);if(n.length>0)return S({cache:n.concat(e),uri:n[n.length-1],index:r-(t.length-n.length)}),void I(n[n.length-1]);if(a-t.length>0)return D(e,a-t.length)}S({index:0})}})).finally((()=>{x(!1)}))}),[C,S,I]),L=(0,a.useCallback)(((t,n,a,r)=>{if(n<t.length){const o=t[n];return x(!0),e(C.checkEntity(o)).then((e=>{if(!e){const e=[...t];return e.splice(n,1),L(e,n,a-1,r)}S({index:r+1,uri:o,cache:t,total:a}),I(o)})).finally((()=>{x(!1)}))}if(!(r>=a-1))return B(t,a,r);S({cache:t,total:a,index:a-1})}),[C,S,I,B]),F=(0,a.useCallback)(((t,n,a,r)=>{if(n>-1){const o=t[n];return x(!0),e(C.checkEntity(o)).then((e=>{if(!e){const e=[...t];return e.splice(n,1),F(e,n-1,a-1,r-1)}S({index:r-1,uri:o,cache:t,total:a}),I(o)})).finally((()=>{x(!1)}))}if(!(r<=0))return D(t,r);S({index:0,cache:t,total:a})}),[C,S,I,D]),q=(0,a.useCallback)((()=>{if(c&&r){const e=c.indexOf(r)-1;F(c,e,l,o)}}),[F,c,r,l,o]),H=(0,a.useCallback)((()=>{if(c&&r){const e=c.indexOf(r)+1;L(c,e,l,o)}}),[L,c,r,l,o]);return{total:l,onPrev:q,onNext:H,onSearchResultsClick:k,isPrevDisabled:y||o<=0,isNextDisabled:y||o>=l-1}},D=e=>{let{className:t}=e;const{total:n,onPrev:a,onNext:o,onSearchResultsClick:l,isPrevDisabled:i,isNextDisabled:c}=B();return(()=>{const{cache:e}=(0,v.useSelector)(O.ZP.selectors.getSearchNavigationData)||{},t=(0,v.useSelector)(O.ZP.selectors.getMode),n=(0,v.useSelector)(O.ZP.selectors.getEntity);return(0,s.uzs)(t)&&(null==e?void 0:e.includes(null==n?void 0:n.uri))})()?r().createElement(x,{className:t,total:n,onPrev:a,onNext:o,onSearchResultsClick:l,isPrevDisabled:i,isNextDisabled:c}):null}},33310:(e,t,n)=>{n.d(t,{Z:()=>O});var a=n(24328),r=n.n(a),o=n(71153),l=n.n(o),i=n(87918),s=n.n(i),c=n(67958),p=n(53180),u=n(31039),d=n(95613),m=n(68439),h=n(79692);const f=(0,h.Z)((e=>({image:{width:"40px",height:"40px"},info:{marginLeft:"12px",overflow:"hidden",display:"flex",flexDirection:"column"},label:{textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",fontWeight:400,fontSize:"13px",lineHeight:"15px",color:e.palette.primary.main},secondaryLabel:{marginTop:"4px",fontWeight:400,fontSize:"10px",lineHeight:"12px",color:e.palette.text.secondary,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},link:{textDecoration:"none"},thirdRow:{display:"flex",overflow:"hidden",alignItems:"center",marginTop:"auto",paddingTop:"4px"},entityId:{display:"flex",overflow:"hidden",alignItems:"baseline",whiteSpace:"nowrap",fontWeight:400,fontSize:"12px",lineHeight:"16px"},entityIdLabel:{color:e.palette.text.secondary},entityIdValue:{marginLeft:"8px",color:e.palette.text.primary,overflow:"hidden",textOverflow:"ellipsis","&[aria-describedby]":{cursor:"pointer","&:hover":{textDecoration:"underline"}}}}))),b=e=>{let{entity:t,classes:n={}}=e;const o=f(),{secondaryLabel:i,label:h}=n,b=(0,c.idV)(t.label),{secondaryLabel:g}=t,y=(0,a.useCallback)((()=>{navigator.clipboard.writeText((0,c.BTI)(t))}),[t]);return r().createElement(r().Fragment,null,r().createElement(p.Z,{entity:t,imageClassName:o.image}),r().createElement("div",{className:o.info},r().createElement(u.Z,{value:(0,c.wwR)(t),className:o.link},r().createElement(d.Z,{value:b,placement:"top",showOnExceededHeight:!0},r().createElement("div",{className:l()(o.label,h)},b))),g&&r().createElement(d.Z,{value:g,placement:"top",showOnExceededHeight:!0},r().createElement("div",{className:l()(o.secondaryLabel,i)},g)),r().createElement("div",{className:o.thirdRow},r().createElement(m.Z,{entity:t,size:"medium"}),r().createElement("div",{className:o.entityId,onClick:y},r().createElement("div",{className:o.entityIdLabel},s().text("ID:")),r().createElement(d.Z,{value:`Copy to clipboard ${(0,c.BTI)(t)}`,placement:"top"},r().createElement("div",{className:o.entityIdValue},(0,c.BTI)(t)))))))},g=(0,h.Z)({"@keyframes keyframes-wave":{"0%":{transform:"translateX(-100%)"},"60%":{transform:"translateX(100%)"},"100%":{transform:"translateX(100%)"}},wave:{overflow:"hidden",position:"relative","&:after":{top:"0",left:"0",right:"0",bottom:"0",content:'""',position:"absolute",animation:"$keyframes-wave 1.6s linear 0.5s infinite",transform:"translateX(-100%)",background:"linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.04), transparent);"}},avatar:{flex:"none",width:"40px",height:"40px",borderRadius:"50%",backgroundColor:"rgba(0, 0, 0, 0.11)"},info:{marginLeft:"12px",flex:"auto"},label:{width:"40%",height:"15px",borderRadius:"2px",backgroundColor:"rgba(0, 0, 0, 0.11)"},secondaryLabel:{marginTop:"4px",width:"100%",height:"12px",borderRadius:"2px",backgroundColor:"rgba(0, 0, 0, 0.11)"},thirdRow:{marginTop:"4px",width:"60%",height:"24px",borderRadius:"2px",backgroundColor:"rgba(0, 0, 0, 0.11)"}}),y=()=>{const e=g();return r().createElement(r().Fragment,null,r().createElement("div",{className:l()(e.avatar,e.wave)}),r().createElement("div",{className:e.info},r().createElement("div",{className:l()(e.label,e.wave)}),r().createElement("div",{className:l()(e.secondaryLabel,e.wave)}),r().createElement("div",{className:l()(e.thirdRow,e.wave)})))},x=(0,h.Z)({container:{display:"flex",padding:"16px",overflow:"hidden"}});function v(){return v=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},v.apply(this,arguments)}const O=(0,a.memo)((e=>{let{entity:t,classes:n={},variant:a="normal"}=e,o=function(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},o=Object.keys(e);for(a=0;a<o.length;a++)n=o[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)n=o[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}(e,["entity","classes","variant"]);const i=x(),{container:s}=n;return r().createElement("div",v({className:l()(i.container,s)},o),"normal"===a?r().createElement(b,{entity:t,classes:n}):r().createElement(y,null))}))},39827:(e,t,n)=>{n.d(t,{G:()=>m});var a=n(24328),r=n.n(a),o=n(71153),l=n.n(o),i=n(8818),s=n(79692),c=n(41128);const p=(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 u(){return u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},u.apply(this,arguments)}function d(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},o=Object.keys(e);for(a=0;a<o.length;a++)n=o[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)n=o[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}const m=e=>{let{buttonsProps:t,activeIndexId:n,className:a,onButtonClick:o,classes:s={}}=e;const c=p(),{active:m,buttonWrapper:h}=s,f=d(s,["active","buttonWrapper"]);return r().createElement("div",{className:l()(c.container,a)},t.map((e=>{let{id:t}=e,a=d(e,["id"]);return r().createElement(i.k,u({},a,{classes:f,size:"S",key:t,className:l()({[l()(c.active,m)]:n===t},c.buttonWrapper,h),onClick:()=>o(t),"data-reltio-id":`reltio-profile-right-side-button-${t}`}))})))}},52043:(e,t,n)=>{n.d(t,{h:()=>l});var a=n(24328),r=n.n(a);const o=(0,n(79692).Z)((e=>({contentWrapper:{display:"flex",flexDirection:"column",backgroundColor:e.palette.background.paper,boxShadow:"0 1px 1px 0 rgba(0,0,0,0.14), 0 2px 1px -1px rgba(0,0,0,0.12), 0 1px 3px 0 rgba(0,0,0,0.2)",marginLeft:"3px",transition:e.transitions.create(["width"],{duration:e.transitions.duration.enteringScreen})}}))),l=e=>{let{width:t,open:n,children:a}=e;const l=o();return r().createElement("div",{className:l.contentWrapper,style:{width:`${n?t:0}px`}},n&&r().createElement(r().Fragment,null,a))}},27185:(e,t,n)=>{n.d(t,{Z:()=>P});var a=n(24328),r=n.n(a),o=n(13980),l=n.n(o),i=n(87918),s=n.n(i),c=n(17440),p=n(71153),u=n.n(p),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(34e3),f=n(95613);function b(){return b=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},b.apply(this,arguments)}const g=e=>{let{innerRef:t,innerProps:n,selectOption:a,data:o}=e;const l=m(),{value:i,label:s,startObject:c,endObject:p}=o,g=c.objectType.label+" ↔ "+p.objectType.label;return r().createElement(d.MenuItem,b({className:l.container,ref:t,key:i,onClick:()=>a({label:s,value:i,startObject:c,endObject:p})},n),r().createElement("div",{className:l.icons},r().createElement(h.Z,{className:l.iconTop,entityType:c.objectType}),r().createElement(h.Z,{className:l.iconBottom,entityType:p.objectType})),r().createElement("div",{className:l.text},r().createElement(f.Z,{value:s},r().createElement(d.Typography,{className:u()(l.textItem,l.primaryTextItem)},s)),r().createElement(f.Z,{value:g},r().createElement(d.Typography,{color:"textSecondary",className:u()(l.textItem,l.secondaryTextItem)},g))))};g.propTypes={innerRef:l().oneOfType([l().oneOf([null]),l().func,l().shape({current:l().any.isRequired})]),innerProps:l().object.isRequired,selectOption:l().func.isRequired,data:l().shape({value:l().string.isRequired,label:l().string.isRequired,startObject:l().object,endObject:l().object})};const y=g;var x=n(24737);function v(){return v=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},v.apply(this,arguments)}function O(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const w=e=>{let{value:t={},options:n=[],onChange:o=c.identity,TextFieldProps:l}=e,i=function(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},o=Object.keys(e);for(a=0;a<o.length;a++)n=o[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)n=o[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}(e,["value","options","onChange","TextFieldProps"]);const p=(0,a.useMemo)((()=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},a=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),a.forEach((function(t){O(e,t,n[t])}))}return e}({},(0,c.defaultTo)({},l),{"data-reltio-id":"relation-type-selector"})),[l]);return r().createElement(x.Z,v({value:t,options:n,onChange:o,label:s().text("Select relationship type "),components:{Option:y},TextFieldProps:p},i))},E=l().shape({label:l().string.isRequired,value:l().string.isRequired,startObject:l().object,endObject:l().object});w.propTypes={value:E,options:l().arrayOf(E),onChange:l().func};const P=w},3409:(e,t,n)=>{n.d(t,{Z:()=>d});var a=n(24328),r=n.n(a),o=n(52730),l=n(49885),i=n(94079),s=n(17440),c=n(87918),p=n.n(c);const u=(0,n(79692).Z)({root:{display:"flex",alignItems:"flex-start"},slice:{fontWeight:500},cancelButton:{width:"88px",flexShrink:0,marginLeft:"15px"}}),d=()=>{const e=u(),t=(0,o.useSelector)(l.ZP.selectors.getHistoryEvent),n=(0,o.useDispatch)(),a=(0,s.pipe)(l.N5.history.actions.clearHistoryEvent,n);return t?r().createElement("div",{className:e.root},r().createElement(i.Typography,{component:"div"},p().text("You are viewing a historic slice:")," ",r().createElement("span",{className:e.slice},p().date(t.aStamp,"llll"))),r().createElement(i.Button,{className:e.cancelButton,variant:"contained",color:"primary",onClick:a},p().text("Cancel"))):null}},54198:(e,t,n)=>{n.d(t,{G:()=>l,u:()=>i});var a=n(24328),r=n.n(a);const o=(0,a.createContext)(null);o.displayName="ActionsHookContext";const l=e=>{let{children:t,hook:n}=e;return r().createElement(o.Provider,{value:n},t)},i=()=>{const e=(0,a.useContext)(o);if(!e)throw new Error("ActionsHookContext must be provided");return e}},79468:(e,t,n)=>{n.d(t,{T:()=>r});var a=n(24328);const r=n.n(a)().createContext({profileBand:{}});r.displayName="LabelsContext"},7718:(e,t,n)=>{n.d(t,{C:()=>h});var a=n(24328),r=n(52730),o=n(17440),l=n(67958),i=n(49885);function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},a=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),a.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 p=(e,t)=>t.filter((t=>t.replyId!==e)),u=(e,t)=>{const n=e.replies.findIndex((e=>{let{replyId:n}=e;return n===t.replyId})),a=[...e.replies];return a[n]=t,a},d=[],m=e=>console.error("Collaboration error",e),h=e=>{let{objectIds:t=d,objectTypes:n,enabled:c=!0}=e;const h=(0,r.useSelector)(i.ZP.selectors.getEntity),f=(0,r.useSelector)(i.ZP.selectors.getTenant),b=(0,r.useSelector)(i.ZP.selectors.getCollaborationPath),g=(0,r.useSelector)(i.ZP.selectors.isCollaborationEnabled)&&c,[y,x]=(0,a.useState)(null),[v,O]=(0,a.useState)([]),[w,E]=(0,a.useState)(null),[P,C]=(0,a.useState)(null),[S,T]=(0,a.useState)(!1),[I,k]=(0,a.useState)(!1),[j,R]=(0,a.useState)({}),N=(0,a.useCallback)((e=>{E((t=>s({},t,e)))}),[]),Z=null==h?void 0:h.uri,B=(0,a.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(g&&Z&&!(0,l.ZiX)(Z)){const n=e=>{console.warn("Collaboration error",e),E(null)};(0,o.pipe)(l.$oF,(0,o.andThen)((0,o.map)((0,o.props)(["objectId","comments"]))),(0,o.andThen)(o.fromPairs),(0,o.andThen)(t?E:N),(0,o.otherwise)(n))({uris:e,tenant:f,collaborationPath:b})}else E(null)}),[N,b,Z,g,f]);(0,a.useEffect)((()=>{B(t,!0)}),[t,B]);const D=(0,a.useCallback)(((e,t)=>{(0,l.liG)({collaborationPath:b,tenant:f,relatedObjectUri:e,pageToken:t}).then((e=>{let{items:n,nextPageToken:a}=e;O((e=>t?(0,o.uniqBy)((0,o.prop)("commentId"),[...e,...n]):n)),x(a)})).catch(m)}),[b,f]),L=(0,a.useCallback)((e=>{k(!0),(0,l.d7q)({collaborationPath:b,tenant:f,commentId:e}).then(C).catch(m).finally((()=>k(!1)))}),[b,f]),F=(0,a.useCallback)((e=>{let{content:t,namedUsers:n,objectType:a,uri:r,relatedObjectUris:o}=e;T(!0);const i={objectId:r,content:t,relatedObjectUris:o,objectType:a,visibility:"public",namedUsers:n,permanentLink:`${window.location.href}&commentId=${encodeURIComponent("{commentId}")}`};return(0,l.Yrx)({collaborationPath:b,tenant:f,data:i}).then((e=>{let[t]=e;return((e,t)=>{C(e),E((n=>s({},n,{[t]:[...n[t]||[],{commentId:e.commentId,replies:0,status:"open"}]}))),O((t=>[e,...t]))})(t,r)})).catch(m).finally((()=>T(!1)))}),[b,f]),q=(0,a.useCallback)((e=>{let{content:t,namedUsers:n,objectType:a,uri:r,relatedObjectUris:i,commentId:c,replies:p}=e;T(!0);const u={objectId:r,content:t,relatedObjectUris:i,objectType:a,visibility:"public",namedUsers:n,commentId:c,replies:p};return(0,l.uAg)({collaborationPath:b,tenant:f,data:u}).then((e=>(e=>{C(e),O((0,o.map)((0,o.when)((0,o.propEq)("commentId",e.commentId),(0,o.always)(e))))})(s({},e,{replies:p})))).catch(m).finally((()=>T(!1)))}),[b,f]),H=(0,a.useCallback)((e=>{let{uri:t,commentId:n}=e;T(!0),(0,l.YFy)({collaborationPath:b,tenant:f,commentId:n}).then((()=>((e,t)=>{C(null),E((n=>{const a=n[t]||[];return s({},n,{[t]:a.filter((t=>t.commentId!==e))})})),O((t=>t.filter((t=>t.commentId!==e))))})(n,t))).catch(m).finally((()=>T(!1)))}),[b,f]),U=(0,a.useCallback)(((e,t,n,a)=>{const r="resolve"===e.action?"resolved":"open",{replyId:o}=e;C("resolved"===r?e=>{if(e)return null}:t=>{if(t)return s({},t,{replies:a?p(o,t.replies):[...t.replies,e]})}),E((e=>s({},e,{[t]:(e[t]||[]).map((e=>e.commentId===n?s({},e,{status:r,replies:a?e.replies-1:e.replies+1}):e))}))),O((t=>t.map((t=>t.commentId===n?s({},t,{status:r,replies:a?p(e.replyId,t.replies):[...t.replies,e]}):t))))}),[]),z=(0,a.useCallback)((e=>{let{uri:t,commentId:n,reply:a}=e;T(!0),(0,l.Mfr)({collaborationPath:b,tenant:f,commentId:n,replyId:a.replyId}).then((()=>U(a,t,n,!0))).catch(m).finally((()=>T(!1)))}),[b,U,f]),_=(0,a.useCallback)(((e,t)=>{C((t=>{if(t)return s({},t,{replies:u(t,e)})})),O((n=>n.map((n=>n.commentId===t?s({},n,{replies:u(n,e)}):n))))}),[]),A=(0,a.useCallback)((e=>{let{content:t,namedUsers:n,commentId:a,replyId:r}=e;T(!0);const o={content:t,namedUsers:n};return(0,l.ufV)({collaborationPath:b,tenant:f,commentId:a,replyId:r,data:o}).then((e=>_(e,a))).catch(m).finally((()=>T(!1)))}),[b,f,_]),$=(0,a.useCallback)((e=>{let{content:t,namedUsers:n,commentId:a,action:r,uri:o}=e;T(!0);const i={content:t,action:r,namedUsers:n};return(0,l.PP2)({collaborationPath:b,tenant:f,commentId:a,data:i}).then((e=>{let[t]=e;return U(t,o,a)})).catch(m).finally((()=>T(!1)))}),[b,f,U]),W=(0,a.useCallback)((e=>{let{commentId:t,uri:n}=e;$({content:"",namedUsers:[],commentId:t,action:"resolve",uri:n})}),[$]),M=(0,a.useCallback)((e=>{let{commentId:t,uri:n}=e;$({content:"",namedUsers:[],commentId:t,action:"reopen",uri:n})}),[$]);return{clearCurrentComment:(0,a.useCallback)((()=>{C(null)}),[]),comments:v,commentsMap:w,getCommentState:(e,t)=>(0,o.pathOr)({},[e,t],j),updateCommentState:(e,t,n)=>{R((a=>{const r=[e,t],l=(0,o.path)(r,a);return(0,o.assocPath)(r,(0,o.mergeRight)(l,n),a)}))},clearCommentState:(e,t)=>R((0,o.dissocPath)([e,t])),createComment:F,createReply:$,currentComment:P,deleteComment:H,editComment:q,getComment:L,getComments:D,getCommentsCount:B,loading:I,objectTypes:n,pageToken:y,reOpenThread:M,resolveThread:W,sending:S,deleteReply:z,editReply:A}}},89846:(e,t,n)=>{n.d(t,{n:()=>l});var a=n(24328),r=n(67958),o=n(17440);const l=e=>{let{reversedContextLabels:t}=e;return{getRelationTypesOptions:(0,a.useCallback)(((e,n)=>{const a={},l=(0,o.pipe)(r.PjQ,(0,o.tap)((e=>a[e]=(0,o.propOr)(0,e,a)+1))),i=(0,o.ascend)((0,o.prop)("label")),s=(0,o.curry)(((e,n)=>{let{uri:a,label:o,startObject:i,endObject:s}=n;const c=e===(t?r.Nsj.OUT:r.Nsj.IN)?i:s;return{label:{directionalLabel:l(c),typeLabel:o},value:`${a},${e}`,startObject:i,endObject:s}}));return e.map(s(r.Nsj.IN)).concat(n.map(s(r.Nsj.OUT))).map((0,o.evolve)({label:e=>{let{directionalLabel:t,typeLabel:n}=e;return t?a[t]>1?`${t} (${n})`:t:n}})).sort(i)}),[t]),fromEditorValue:(0,a.useCallback)(((e,t)=>n=>{const[a,l]=n.value.split(",");return{type:(l===r.Nsj.IN?e:t).find((0,o.propEq)("uri",a)),direction:l}}),[]),toEditorValue:(0,a.useCallback)(((e,t)=>t.find((0,o.propEq)("value",`${e.relationType},${e.direction}`))),[])}}}}]);
1
+ "use strict";(self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[9481],{98808:(e,t,n)=>{n.d(t,{K:()=>h,N:()=>m});var a=n(24328),r=n.n(a),o=n(71153),i=n.n(o),l=n(94079);const s=(0,n(79692).Z)((e=>({button:{padding:"9px 16px 9px 12px","& svg g path, & svg path":{fill:e.palette.primary.main,fillOpacity:1}},iconButton:{"& svg g path, & svg path":{fill:e.palette.primary.main,fillOpacity:1}},startIcon:{marginLeft:0,marginRight:"8px",width:"18px",height:"18px",alignItems:"center"},label:{whiteSpace:"nowrap",fontSize:"14px",lineHeight:"16px",letterSpacing:0},overflowStyle:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},menuIcon:{marginRight:"12px"},menuItem:{minHeight:"28px",padding:"2px 16px 2px 12px"},menuText:{color:e.palette.text.primary,fontSize:"13px",lineHeight:"15px",letterSpacing:0}})));var c=n(31276),p=n(95613),u=n(8818);function d(){return d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},d.apply(this,arguments)}let m;!function(e){e.iconButton="iconButton",e.button="button",e.menuItem="menuItem"}(m||(m={}));const h=(0,a.forwardRef)(((e,t)=>{let{className:n,mode:a=m.iconButton,label:o,disabled:h,icon:f,onClick:b=c.ZT,onMenuClose:g=c.ZT}=e,y=function(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},o=Object.keys(e);for(a=0;a<o.length;a++)n=o[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)n=o[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}(e,["className","mode","label","disabled","icon","onClick","onMenuClose"]);const x=s();return(()=>{switch(a){case"iconButton":return r().createElement(u.k,d({disabled:h,className:i()(x.iconButton,n),size:"S",tooltipTitle:o,onClick:b,icon:f,showForDisabled:!0},y));case"button":return r().createElement(l.Button,d({className:i()(x.button,n),disabled:h,startIcon:r().createElement(f,null),onClick:b,color:"primary",classes:{startIcon:x.startIcon,label:x.label}},y),r().createElement(p.Z,{value:o},r().createElement("div",{className:x.overflowStyle},o)));case"menuItem":{const e=()=>{g(),b()};return r().createElement(l.MenuItem,d({classes:{root:x.menuItem},onClick:e,disabled:h,ref:t},y),r().createElement(r().Fragment,null,r().createElement(f,{className:x.menuIcon}),r().createElement(l.Typography,{classes:{root:x.menuText}},o)))}}})()}));h.displayName="ActionButton"},58662:(e,t,n)=>{n.d(t,{Z:()=>y});var a=n(13980),r=n.n(a),o=n(24328),i=n.n(o),l=n(71153),s=n.n(l),c=n(94079),p=n(87918),u=n.n(p),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 f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},a=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),a.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 g=e=>{let{classes:t={},count:n,rowsPerPageOptions:a,page:r,onChangePage:l,rowsPerPage:p,onChangeRowsPerPage:b,basicTableRef:g,labelRowsPerPage:y}=e;const x=h(),v=(0,o.useCallback)((()=>{(0,m.pathOr)(m.identity,["current","resetScrollbarPosition"],g)()}),[g]),O=(0,o.useCallback)((e=>{l(e),v()}),[l,v]),w=(0,o.useCallback)((e=>{l(0),b(e),v()}),[l,b,v]);return i().createElement(c.TablePagination,{classes:f({},t,{root:s()(x.pagination,t.root),select:s()(x.select,t.select),caption:x.caption,selectRoot:x.selectRoot,actions:x.actions}),component:"div",labelRowsPerPage:y||u().text("Rows per page:"),labelDisplayedRows:e=>{let{from:t,to:n,count:a}=e;return u().text("${fromRow}-${toRow} of ${countRows}",{fromRow:u().number(t,"0,0"),toRow:u().number(n,"0,0"),countRows:u().number(a,"0,0")})},count:n,rowsPerPageOptions:a,page:r,onChangePage:(0,m.pipe)((0,m.nthArg)(1),O),rowsPerPage:p,onChangeRowsPerPage:(0,m.pipe)(d.NA,w)})};g.propTypes={classes:r().object,rowsPerPageOptions:r().arrayOf(r().number),count:r().number,page:r().number,onChangePage:r().func,rowsPerPage:r().number,onChangeRowsPerPage:r().func,basicTableRef:r().shape({current:r().object}),labelRowsPerPage:r().string};const y=i().memo(g)},81137:(e,t,n)=>{n.d(t,{Z:()=>c});var a=n(24328),r=n.n(a),o=n(87918),i=n.n(o),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:a,onCancel:o,cancelCaption:c=i().text("Cancel"),onDiscard:p,discardCaption:u="",onSave:d,saveCaption:m=i().text("Save"),disabledSave:h=!1}=e;const f=s();return r().createElement(l.Dialog,{open:t,onClose:o,classes:{paperScrollPaper:f.paper}},r().createElement(l.DialogTitle,{classes:{root:f.title}},n),r().createElement(l.DialogContent,{classes:{root:f.content}},r().createElement(l.DialogContentText,{classes:{root:f.contentText}},a)),r().createElement(l.DialogActions,{className:f.actionButtons,disableSpacing:!0},o&&r().createElement(l.Button,{onClick:o},c),r().createElement("div",null,p&&r().createElement(l.Button,{onClick:p,classes:{root:f.discardButton}},u),r().createElement(l.Button,{onClick:d,color:"primary",disabled:h,autoFocus:!0},m))))}},7154:(e,t,n)=>{n.d(t,{Z:()=>m});var a=n(24328),r=n.n(a),o=n(13980),i=n.n(o),l=n(67958),s=n(17440),c=n(89846),p=n(27185);function u(){return u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},u.apply(this,arguments)}const d=e=>{let{relation:t={},inRelationTypes:n=[],outRelationTypes:o=[],onChange:i=s.identity,applyFirstByDefault:l=!1,reversedContextLabels:d=!1}=e,m=function(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},o=Object.keys(e);for(a=0;a<o.length;a++)n=o[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)n=o[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}(e,["relation","inRelationTypes","outRelationTypes","onChange","applyFirstByDefault","reversedContextLabels"]);const{getRelationTypesOptions:h,fromEditorValue:f,toEditorValue:b}=(0,c.n)({reversedContextLabels:d}),g=(0,a.useMemo)((()=>h(n,o)),[h,n,o]),y=(0,a.useCallback)((0,s.pipe)(f(n,o),i),[f,n,o,i]),x=!!t.relationType;return(0,a.useEffect)((()=>{l&&g.length&&!x&&y(g[0])}),[g,l,y,x]),r().createElement(p.Z,u({value:b(t,g),options:g,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:()=>m});var a=n(24328),r=n.n(a),o=n(52730),i=n(71153),l=n.n(i),s=n(94079),c=n(67958),p=n(49885),u=n(95613);const d=(0,n(79692).Z)({"entityType-overflow":{textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},"entityType-small":{padding:"1px 4px",fontSize:"10px",lineHeight:"normal",marginRight:"12px",borderRadius:"2px",flexShrink:0},"entityType-medium":{padding:"2px 8px 3px",borderRadius:"2px",fontSize:"13px",fontWeight:500,lineHeight:"15px",marginRight:"16px",flexShrink:0}}),m=e=>{let{entity:t,className:n,size:a="small"}=e;const i=d(),m=(0,o.useSelector)(p.ZP.selectors.getMetadata),h=t.type,f=(0,c.nt9)(m,h)||{},b=(0,c.VD3)(m,f,"typeColor")||c.rSc.palette.primary.main,g=(0,c.jFi)(m,t);return r().createElement(u.Z,{value:g,placement:"top"},r().createElement(s.Typography,{style:{backgroundColor:b,color:c.P6Y.Colors.getColor(b)?"#FFFFFF":"#212121"},className:l()(i[`entityType-${a}`],i["entityType-overflow"],n),component:"div"},g))}},64459:(e,t,n)=>{n.d(t,{Z:()=>g});var a=n(24328),r=n.n(a),o=n(71153),i=n.n(o),l=n(52730),s=n(17440),c=n(94079),p=n(87918),u=n.n(p),d=n(67958),m=n(49885),h=n(53180),f=n(68439);const b=(0,n(79692).Z)((e=>({profileBandWrapper:{flexShrink:0},profileBand:{display:"flex",padding:"16px 12px 16px 16px",alignItems:"flex-start",backgroundColor:"#fff",boxShadow:"0px 1px 0px rgba(0, 0, 0, 0.12)",marginBottom:"1px","&: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"}}}))),g=e=>{let{className:t,entity:n,children:o,classes:p,renderLabel:g=s.identity}=e;const y=b({classes:p}),x=(0,l.useSelector)(m.ZP.selectors.getMetadata),v=(0,l.useSelector)(m.ZP.selectors.getShowEntityId),O=(0,a.useCallback)((()=>{navigator.clipboard.writeText((0,d.BTI)(n))}),[n]);if((0,s.isNil)(n))return null;const w=(0,d.idV)(n.label),E=n.secondaryLabel,P=(0,d.ptG)(x,n),S=(0,d.Fn9)(n),C=n.uri,T=(0,d.BTI)(n);return r().createElement("div",{className:i()(y.profileBandWrapper,t)},r().createElement("div",{className:i()(y.profileBand,{[y.inactive]:!S}),"data-entity-uri":C},r().createElement(h.Z,{key:n.uri,entity:n,avatarClassName:y.profileIcon,imageClassName:y.imageProfileIcon}),r().createElement("div",{className:y.profileInfo},r().createElement("div",null,r().createElement(c.Typography,{variant:"h6",className:y.label},g(w)),E&&r().createElement(c.Typography,{variant:"subtitle2",className:y.secondaryLabel},E),P&&r().createElement(c.Typography,{variant:"subtitle1",className:y.businessCard},P)),r().createElement("div",{className:y.specialInfo},r().createElement("div",{className:y.entityType},r().createElement(f.Z,{entity:n,size:"medium",className:y.badge}),!(0,d.ZiX)(C)&&v&&r().createElement(c.Tooltip,{title:u().text("Copy to clipboard")},r().createElement(c.Typography,{display:"inline",variant:"body2",className:y.entityId,onClick:O},u().text("Entity ID"),": ",T))))),o&&r().createElement("div",null,o)))}},79618:(e,t,n)=>{n.d(t,{a:()=>B});var a=n(24328),r=n.n(a),o=n(94079),i=n(67766),l=n(42767),s=n(67958),c=n(71153),p=n.n(c),u=n(17440),d=n(87918),m=n.n(d),h=n(79468),f=n(83348),b=n(8818);const g=(0,n(79692).Z)({container:{display:"flex",alignItems:"center"},link:{whiteSpace:"nowrap",marginRight:"9px"}}),y=(0,f.Z)(o.Link),x=e=>{var t;let{className:n,total:o=0,onPrev:c,onNext:d,onSearchResultsClick:f,isPrevDisabled:x,isNextDisabled:v}=e;const O=g(),w=(0,a.useContext)(h.T),{OPEN_RESULTS:E,SEARCH_RESULT:P,SEARCH_RESULTS:S,NEXT_PROFILE:C,PREVIOUS_PROFILE:T}=(0,u.mergeRight)({OPEN_RESULTS:m().text("Go to search results"),SEARCH_RESULT:m().text("Search result"),SEARCH_RESULTS:m().text("Search results"),PREVIOUS_PROFILE:m().text("Go to previous profile"),NEXT_PROFILE:m().text("Go to next profile")},null!==(t=null==w?void 0:w.profileBand)&&void 0!==t?t:{});return r().createElement("div",{className:p()(O.container,n)},r().createElement(y,{className:O.link,component:"button",variant:"caption",onClick:f,underline:"none",tooltipTitle:E},(0,s.k7L)(o,1e6)," ",1===o?P:S),r().createElement(b.k,{size:"L",icon:i.Z,tooltipTitle:T,onClick:c,disabled:x,showForDisabled:!0}),r().createElement(b.k,{size:"L",icon:l.Z,tooltipTitle:C,onClick:d,disabled:v,showForDisabled:!0}))};var v=n(52730),O=n(49885),w=n(94622),E=n(47898),P=n(54198),S=n(85229);function C(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},a=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),a.forEach((function(t){T(e,t,n[t])}))}return e}function T(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class j{constructor(e){var t=this;let{data:{query:n,sortField:a,sortOrder:r},tenant:o,searchTenant:i,apiPath:l,dtssPath:c,globalSearchRequestOptions:p}=e;this.query=void 0,this.sortField=void 0,this.sortOrder=void 0,this.tenant=void 0,this.searchTenant=void 0,this.apiPath=void 0,this.dtssPath=void 0,this.globalSearchRequestOptions=void 0,this.isDT=()=>this.tenant!==this.searchTenant,this.getQueryFilter=()=>({rawFilter:this.query}),this.getEntities=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const a=[t.getQueryFilter(),...e],r=C({},t.globalSearchRequestOptions,{sort:t.sortField,order:t.sortOrder,select:"uri,label,type",scoreEnabled:!1},n);return t.isDT()?(0,s.uqV)({filters:a,options:r,customerTenant:t.tenant,dataTenant:t.searchTenant,dtssPath:t.dtssPath}):(0,s.ZOr)(a,r)},this.checkEntity=e=>this.getEntities([{filter:"equals",fieldName:"uri",values:[e]}],{offset:0,max:1}).then((t=>t&&t.length>0&&t[0].uri===e)),this.requestEntities=(e,t)=>this.getEntities([],{offset:t,max:e}),this.requestTotal=()=>{const e=[this.getQueryFilter()],t=this.globalSearchRequestOptions;return(this.isDT()?(0,s.J$m)({filters:e,options:t,customerTenant:this.tenant,dataTenant:this.searchTenant,dtssPath:this.dtssPath}):(0,s.j_Q)(e,t)).then((e=>e.total))},this.query=n,this.sortField=a,this.sortOrder=r,this.tenant=o,this.searchTenant=i,this.apiPath=l,this.dtssPath=c,this.globalSearchRequestOptions=p}}function k(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},a=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),a.forEach((function(t){I(e,t,n[t])}))}return e}function I(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class N{constructor(e){var t=this;let{data:n,tenant:a,apiPath:r}=e;this.searchBody=void 0,this.tenant=void 0,this.apiPath=void 0,this.getEntities=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const a=[{rawFilter:t.searchBody.filter},...e];return(0,s.P2h)({apiPath:t.apiPath,tenant:t.tenant,searchBody:k({},t.searchBody,{filter:e.length?(0,s.Uqd)()(a):t.searchBody.filter}),options:n})},this.checkEntity=e=>this.getEntities([{filter:"equals",fieldName:"id",values:[(0,s.BTI)({uri:e})]}],{from:0,max:1}).then((t=>t&&t.length>0&&t[0].uri===e)),this.requestEntities=(e,t)=>this.getEntities([],{from:t,max:e}),this.requestTotal=()=>(0,s.dED)({apiPath:this.apiPath,tenant:this.tenant,searchBody:this.searchBody}).then((e=>e.count)),this.searchBody=n,this.tenant=a,this.apiPath=r}}function R(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},a=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),a.forEach((function(t){Z(e,t,n[t])}))}return e}function Z(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const L=(e,t)=>(0,u.pipe)((0,u.map)((0,u.prop)("uri")),(0,u.reject)((e=>t.includes(e))))(e),D=()=>{const e=(0,S._)(),t=(0,S._)(),n=(0,S._)(),{uri:r,index:o,total:i,tenant:l,cache:c}=(0,v.useSelector)(O.ZP.selectors.getSearchNavigationData)||{},{type:p,data:u}=(0,v.useSelector)(O.ZP.selectors.getSearchProviderData)||{},d=(0,v.useSelector)(O.ZP.selectors.getTenant),m=(0,v.useSelector)(O.ZP.selectors.getApiPath),h=(0,v.useSelector)(O.ZP.selectors.getDtssPath),f=(0,v.useSelector)((e=>O.ZP.selectors.getGlobalSearchRequestOptions(e,["ovOnly"]))),{updateEntitiesNavigationLoadingState:b}=(0,w.M)(),g=(0,a.useContext)(E.m),y=(0,v.useDispatch)(),[x,C]=(0,a.useState)(!1),T=(0,a.useMemo)((()=>((e,t)=>{switch(e){case"search":return new j(t);case"graphsearch":return new N(t)}})(p,{data:u,tenant:d,searchTenant:l,apiPath:m,dtssPath:h,globalSearchRequestOptions:f})),[p,u,d,l,m,h,f]),k=(0,a.useCallback)((e=>{y(O.yC.actions.updateSearchNavigationDataFields(e))}),[y]),I=(0,a.useCallback)((e=>{const t=d!==l?(0,s.wwR)({uri:e,dataTenant:l}):e;y(O.ui.actions.openEntity({uri:t,viewId:g,source:"navigation"}))}),[y,g,d,l]),Z=(0,a.useCallback)((()=>{y(O.ui.actions.openPerspective({perspectiveId:p,viewId:g}))}),[y,p,g]);(0,a.useEffect)((()=>{o>=i?k({index:i-1}):o<0&&k({index:0})}),[i,o,k]);const D=(0,P.u)();(0,a.useEffect)((()=>{const e=D(((e,t)=>{switch(e.type){case O.yC.constants.UPDATE_SEARCH_NAVIGATION_DATA_ON_MERGE:{const n=O.ZP.selectors.getSearchNavigationData(t);n&&k(((e,t)=>{const{winnerUri:n,losersUris:a=[]}=t,r=((e,t)=>{let{uri:n,index:a,total:r,cache:o}=e;if(t&&t!==n){if(o&&o.includes(n)){o=[...o];const e=o.indexOf(t);let i=o.indexOf(n);e>=0&&(o.splice(e,1),r--,e<i&&a--),i=o.indexOf(n),o.splice(i,1,t)}return n=t,R({},e,{uri:n,index:a,cache:o,total:r})}return e})(e,n);return((e,t)=>{const{cache:n=[],index:a,total:r,uri:o}=e,i=t.filter((e=>n.includes(e)));if(0===i.length)return e;const l=r-i.length,s=n.indexOf(o);let c=a;for(const e of i)n.indexOf(e)<s&&c--;const p=n.filter((e=>!i.includes(e)));return R({},e,{cache:p,index:c,total:l})})(r,a)})(n,e.payload));break}}}));return()=>e()}),[D,k]);const B=(0,a.useCallback)(((e,a,r)=>{C(!0),t(T.requestTotal()).then((e=>k({total:e})));const o=r+1;return n(T.requestEntities(15,o)).then((t=>{if(t){if(t.length){const n=L(t,e);if(n.length>0)return k({cache:e.concat(n),uri:n[0],index:o+t.length-n.length}),void I(n[0]);if(r+t.length<a-1)return B(e,a-t.length,r+t.length)}k({index:o})}})).finally((()=>{C(!1)}))}),[T,k,I]),F=(0,a.useCallback)(((e,a)=>{C(!0),t(T.requestTotal()).then((e=>k({total:e})));const r=a-1,o=Math.max(0,a-15),i=15+Math.min(0,a-15);return n(T.requestEntities(i,o)).then((t=>{if(t){if(t.length){const n=L(t,e);if(n.length>0)return k({cache:n.concat(e),uri:n[n.length-1],index:r-(t.length-n.length)}),void I(n[n.length-1]);if(a-t.length>0)return F(e,a-t.length)}k({index:0})}})).finally((()=>{C(!1)}))}),[T,k,I]),q=(0,a.useCallback)(((t,n,a,r)=>{if(n<t.length){const o=t[n];return C(!0),e(T.checkEntity(o)).then((e=>{if(!e){const e=[...t];return e.splice(n,1),q(e,n,a-1,r)}k({index:r+1,uri:o,cache:t,total:a}),I(o)})).finally((()=>{C(!1)}))}if(!(r>=a-1))return B(t,a,r);k({cache:t,total:a,index:a-1})}),[T,k,I,B]),H=(0,a.useCallback)(((t,n,a,r)=>{if(n>-1){const o=t[n];return C(!0),e(T.checkEntity(o)).then((e=>{if(!e){const e=[...t];return e.splice(n,1),H(e,n-1,a-1,r-1)}k({index:r-1,uri:o,cache:t,total:a}),I(o)})).finally((()=>{C(!1)}))}if(!(r<=0))return F(t,r);k({index:0,cache:t,total:a})}),[T,k,I,F]),U=(0,a.useCallback)((()=>{if(c&&r){const e=c.indexOf(r)-1;H(c,e,i,o)}}),[H,c,r,i,o]),z=(0,a.useCallback)((()=>{if(c&&r){const e=c.indexOf(r)+1;q(c,e,i,o)}}),[q,c,r,i,o]);return(0,a.useEffect)((()=>{b(x)}),[b,x]),(0,a.useEffect)((()=>()=>b(!1)),[]),{total:i,onPrev:U,onNext:z,onSearchResultsClick:Z,isPrevDisabled:x||o<=0,isNextDisabled:x||o>=i-1}},B=e=>{let{className:t}=e;const{total:n,onPrev:a,onNext:o,onSearchResultsClick:i,isPrevDisabled:l,isNextDisabled:c}=D();return(()=>{const{cache:e}=(0,v.useSelector)(O.ZP.selectors.getSearchNavigationData)||{},t=(0,v.useSelector)(O.ZP.selectors.getMode),n=(0,v.useSelector)(O.ZP.selectors.getEntity);return(0,s.uzs)(t)&&(null==e?void 0:e.includes(null==n?void 0:n.uri))})()?r().createElement(x,{className:t,total:n,onPrev:a,onNext:o,onSearchResultsClick:i,isPrevDisabled:l,isNextDisabled:c}):null}},33310:(e,t,n)=>{n.d(t,{Z:()=>O});var a=n(24328),r=n.n(a),o=n(71153),i=n.n(o),l=n(87918),s=n.n(l),c=n(67958),p=n(53180),u=n(31039),d=n(95613),m=n(68439),h=n(79692);const f=(0,h.Z)((e=>({image:{width:"40px",height:"40px"},info:{marginLeft:"12px",overflow:"hidden",display:"flex",flexDirection:"column"},label:{textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",fontWeight:400,fontSize:"13px",lineHeight:"15px",color:e.palette.primary.main},secondaryLabel:{marginTop:"4px",fontWeight:400,fontSize:"10px",lineHeight:"12px",color:e.palette.text.secondary,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},link:{textDecoration:"none"},thirdRow:{display:"flex",overflow:"hidden",alignItems:"center",marginTop:"auto",paddingTop:"4px"},entityId:{display:"flex",overflow:"hidden",alignItems:"baseline",whiteSpace:"nowrap",fontWeight:400,fontSize:"12px",lineHeight:"16px"},entityIdLabel:{color:e.palette.text.secondary},entityIdValue:{marginLeft:"8px",color:e.palette.text.primary,overflow:"hidden",textOverflow:"ellipsis","&[aria-describedby]":{cursor:"pointer","&:hover":{textDecoration:"underline"}}}}))),b=e=>{let{entity:t,classes:n={}}=e;const o=f(),{secondaryLabel:l,label:h}=n,b=(0,c.idV)(t.label),{secondaryLabel:g}=t,y=(0,a.useCallback)((()=>{navigator.clipboard.writeText((0,c.BTI)(t))}),[t]);return r().createElement(r().Fragment,null,r().createElement(p.Z,{entity:t,imageClassName:o.image}),r().createElement("div",{className:o.info},r().createElement(u.Z,{value:(0,c.wwR)(t),className:o.link},r().createElement(d.Z,{value:b,placement:"top",showOnExceededHeight:!0},r().createElement("div",{className:i()(o.label,h)},b))),g&&r().createElement(d.Z,{value:g,placement:"top",showOnExceededHeight:!0},r().createElement("div",{className:i()(o.secondaryLabel,l)},g)),r().createElement("div",{className:o.thirdRow},r().createElement(m.Z,{entity:t,size:"medium"}),r().createElement("div",{className:o.entityId,onClick:y},r().createElement("div",{className:o.entityIdLabel},s().text("ID:")),r().createElement(d.Z,{value:`Copy to clipboard ${(0,c.BTI)(t)}`,placement:"top"},r().createElement("div",{className:o.entityIdValue},(0,c.BTI)(t)))))))},g=(0,h.Z)({"@keyframes keyframes-wave":{"0%":{transform:"translateX(-100%)"},"60%":{transform:"translateX(100%)"},"100%":{transform:"translateX(100%)"}},wave:{overflow:"hidden",position:"relative","&:after":{top:"0",left:"0",right:"0",bottom:"0",content:'""',position:"absolute",animation:"$keyframes-wave 1.6s linear 0.5s infinite",transform:"translateX(-100%)",background:"linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.04), transparent);"}},avatar:{flex:"none",width:"40px",height:"40px",borderRadius:"50%",backgroundColor:"rgba(0, 0, 0, 0.11)"},info:{marginLeft:"12px",flex:"auto"},label:{width:"40%",height:"15px",borderRadius:"2px",backgroundColor:"rgba(0, 0, 0, 0.11)"},secondaryLabel:{marginTop:"4px",width:"100%",height:"12px",borderRadius:"2px",backgroundColor:"rgba(0, 0, 0, 0.11)"},thirdRow:{marginTop:"4px",width:"60%",height:"24px",borderRadius:"2px",backgroundColor:"rgba(0, 0, 0, 0.11)"}}),y=()=>{const e=g();return r().createElement(r().Fragment,null,r().createElement("div",{className:i()(e.avatar,e.wave)}),r().createElement("div",{className:e.info},r().createElement("div",{className:i()(e.label,e.wave)}),r().createElement("div",{className:i()(e.secondaryLabel,e.wave)}),r().createElement("div",{className:i()(e.thirdRow,e.wave)})))},x=(0,h.Z)({container:{display:"flex",padding:"16px",overflow:"hidden"}});function v(){return v=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},v.apply(this,arguments)}const O=(0,a.memo)((e=>{let{entity:t,classes:n={},variant:a="normal"}=e,o=function(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},o=Object.keys(e);for(a=0;a<o.length;a++)n=o[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)n=o[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}(e,["entity","classes","variant"]);const l=x(),{container:s}=n;return r().createElement("div",v({className:i()(l.container,s)},o),"normal"===a?r().createElement(b,{entity:t,classes:n}):r().createElement(y,null))}))},39827:(e,t,n)=>{n.d(t,{G:()=>m});var a=n(24328),r=n.n(a),o=n(71153),i=n.n(o),l=n(8818),s=n(79692),c=n(41128);const p=(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 u(){return u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},u.apply(this,arguments)}function d(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},o=Object.keys(e);for(a=0;a<o.length;a++)n=o[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)n=o[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}const m=e=>{let{buttonsProps:t,activeIndexId:n,className:a,onButtonClick:o,classes:s={}}=e;const c=p(),{active:m,buttonWrapper:h}=s,f=d(s,["active","buttonWrapper"]);return r().createElement("div",{className:i()(c.container,a)},t.map((e=>{let{id:t}=e,a=d(e,["id"]);return r().createElement(l.k,u({},a,{classes:f,size:"S",key:t,className:i()({[i()(c.active,m)]:n===t},c.buttonWrapper,h),onClick:()=>o(t),"data-reltio-id":`reltio-profile-right-side-button-${t}`}))})))}},52043:(e,t,n)=>{n.d(t,{h:()=>i});var a=n(24328),r=n.n(a);const o=(0,n(79692).Z)((e=>({contentWrapper:{display:"flex",flexDirection:"column",backgroundColor:e.palette.background.paper,boxShadow:"0 1px 1px 0 rgba(0,0,0,0.14), 0 2px 1px -1px rgba(0,0,0,0.12), 0 1px 3px 0 rgba(0,0,0,0.2)",marginLeft:"3px",transition:e.transitions.create(["width"],{duration:e.transitions.duration.enteringScreen})}}))),i=e=>{let{width:t,open:n,children:a}=e;const i=o();return r().createElement("div",{className:i.contentWrapper,style:{width:`${n?t:0}px`}},n&&r().createElement(r().Fragment,null,a))}},27185:(e,t,n)=>{n.d(t,{Z:()=>P});var a=n(24328),r=n.n(a),o=n(13980),i=n.n(o),l=n(87918),s=n.n(l),c=n(17440),p=n(71153),u=n.n(p),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(34e3),f=n(95613);function b(){return b=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},b.apply(this,arguments)}const g=e=>{let{innerRef:t,innerProps:n,selectOption:a,data:o}=e;const i=m(),{value:l,label:s,startObject:c,endObject:p}=o,g=c.objectType.label+" ↔ "+p.objectType.label;return r().createElement(d.MenuItem,b({className:i.container,ref:t,key:l,onClick:()=>a({label:s,value:l,startObject:c,endObject:p})},n),r().createElement("div",{className:i.icons},r().createElement(h.Z,{className:i.iconTop,entityType:c.objectType}),r().createElement(h.Z,{className:i.iconBottom,entityType:p.objectType})),r().createElement("div",{className:i.text},r().createElement(f.Z,{value:s},r().createElement(d.Typography,{className:u()(i.textItem,i.primaryTextItem)},s)),r().createElement(f.Z,{value:g},r().createElement(d.Typography,{color:"textSecondary",className:u()(i.textItem,i.secondaryTextItem)},g))))};g.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=g;var x=n(24737);function v(){return v=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},v.apply(this,arguments)}function O(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const w=e=>{let{value:t={},options:n=[],onChange:o=c.identity,TextFieldProps:i}=e,l=function(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},o=Object.keys(e);for(a=0;a<o.length;a++)n=o[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)n=o[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}(e,["value","options","onChange","TextFieldProps"]);const p=(0,a.useMemo)((()=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},a=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),a.forEach((function(t){O(e,t,n[t])}))}return e}({},(0,c.defaultTo)({},i),{"data-reltio-id":"relation-type-selector"})),[i]);return r().createElement(x.Z,v({value:t,options:n,onChange:o,label:s().text("Select relationship type "),components:{Option:y},TextFieldProps:p},l))},E=i().shape({label:i().string.isRequired,value:i().string.isRequired,startObject:i().object,endObject:i().object});w.propTypes={value:E,options:i().arrayOf(E),onChange:i().func};const P=w},3409:(e,t,n)=>{n.d(t,{Z:()=>d});var a=n(24328),r=n.n(a),o=n(52730),i=n(49885),l=n(94079),s=n(17440),c=n(87918),p=n.n(c);const u=(0,n(79692).Z)({root:{display:"flex",alignItems:"flex-start"},slice:{fontWeight:500},cancelButton:{width:"88px",flexShrink:0,marginLeft:"15px"}}),d=()=>{const e=u(),t=(0,o.useSelector)(i.ZP.selectors.getHistoryEvent),n=(0,o.useDispatch)(),a=(0,s.pipe)(i.N5.history.actions.clearHistoryEvent,n);return t?r().createElement("div",{className:e.root},r().createElement(l.Typography,{component:"div"},p().text("You are viewing a historic slice:")," ",r().createElement("span",{className:e.slice},p().date(t.aStamp,"llll"))),r().createElement(l.Button,{className:e.cancelButton,variant:"contained",color:"primary",onClick:a},p().text("Cancel"))):null}},54198:(e,t,n)=>{n.d(t,{G:()=>i,u:()=>l});var a=n(24328),r=n.n(a);const o=(0,a.createContext)(null);o.displayName="ActionsHookContext";const i=e=>{let{children:t,hook:n}=e;return r().createElement(o.Provider,{value:n},t)},l=()=>{const e=(0,a.useContext)(o);if(!e)throw new Error("ActionsHookContext must be provided");return e}},94622:(e,t,n)=>{n.d(t,{f:()=>p,M:()=>u});var a=n(24328),r=n.n(a),o=n(31276);function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},a=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),a.forEach((function(t){l(e,t,n[t])}))}return e}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const s=r().createContext({isLoading:!1,updateEntityLoadingState:o.ZT,updateEntitiesNavigationLoadingState:o.ZT,resetLoadingState:o.ZT}),c={entitiesNavigation:!1,entity:!1},p=e=>{let{children:t}=e;const n=(()=>{const[e,t]=(0,a.useState)(c),n=(0,a.useCallback)((e=>{t((t=>i({},t,{entity:e})))}),[]),r=(0,a.useCallback)((e=>{t((t=>i({},t,{entitiesNavigation:e})))}),[]),o=(0,a.useCallback)((()=>{t(c)}),[]);return{isLoading:Object.values(e).includes(!0),updateEntityLoadingState:n,updateEntitiesNavigationLoadingState:r,resetLoadingState:o}})();return r().createElement(s.Provider,{value:n},t)},u=()=>(0,a.useContext)(s)},79468:(e,t,n)=>{n.d(t,{T:()=>r});var a=n(24328);const r=n.n(a)().createContext({profileBand:{}});r.displayName="LabelsContext"},7718:(e,t,n)=>{n.d(t,{C:()=>h});var a=n(24328),r=n(52730),o=n(17440),i=n(67958),l=n(49885);function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},a=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),a.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 p=(e,t)=>t.filter((t=>t.replyId!==e)),u=(e,t)=>{const n=e.replies.findIndex((e=>{let{replyId:n}=e;return n===t.replyId})),a=[...e.replies];return a[n]=t,a},d=[],m=e=>console.error("Collaboration error",e),h=e=>{let{objectIds:t=d,objectTypes:n,enabled:c=!0}=e;const h=(0,r.useSelector)(l.ZP.selectors.getEntity),f=(0,r.useSelector)(l.ZP.selectors.getTenant),b=(0,r.useSelector)(l.ZP.selectors.getCollaborationPath),g=(0,r.useSelector)(l.ZP.selectors.isCollaborationEnabled)&&c,[y,x]=(0,a.useState)(null),[v,O]=(0,a.useState)([]),[w,E]=(0,a.useState)(null),[P,S]=(0,a.useState)(null),[C,T]=(0,a.useState)(!1),[j,k]=(0,a.useState)(!1),[I,N]=(0,a.useState)({}),R=(0,a.useCallback)((e=>{E((t=>s({},t,e)))}),[]),Z=null==h?void 0:h.uri,L=(0,a.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(g&&Z&&!(0,i.ZiX)(Z)){const n=e=>{console.warn("Collaboration error",e),E(null)};(0,o.pipe)(i.$oF,(0,o.andThen)((0,o.map)((0,o.props)(["objectId","comments"]))),(0,o.andThen)(o.fromPairs),(0,o.andThen)(t?E:R),(0,o.otherwise)(n))({uris:e,tenant:f,collaborationPath:b})}else E(null)}),[R,b,Z,g,f]);(0,a.useEffect)((()=>{L(t,!0)}),[t,L]);const D=(0,a.useCallback)(((e,t)=>{(0,i.liG)({collaborationPath:b,tenant:f,relatedObjectUri:e,pageToken:t}).then((e=>{let{items:n,nextPageToken:a}=e;O((e=>t?(0,o.uniqBy)((0,o.prop)("commentId"),[...e,...n]):n)),x(a)})).catch(m)}),[b,f]),B=(0,a.useCallback)((e=>{k(!0),(0,i.d7q)({collaborationPath:b,tenant:f,commentId:e}).then(S).catch(m).finally((()=>k(!1)))}),[b,f]),F=(0,a.useCallback)((e=>{let{content:t,namedUsers:n,objectType:a,uri:r,relatedObjectUris:o}=e;T(!0);const l={objectId:r,content:t,relatedObjectUris:o,objectType:a,visibility:"public",namedUsers:n,permanentLink:`${window.location.href}&commentId=${encodeURIComponent("{commentId}")}`};return(0,i.Yrx)({collaborationPath:b,tenant:f,data:l}).then((e=>{let[t]=e;return((e,t)=>{S(e),E((n=>s({},n,{[t]:[...n[t]||[],{commentId:e.commentId,replies:0,status:"open"}]}))),O((t=>[e,...t]))})(t,r)})).catch(m).finally((()=>T(!1)))}),[b,f]),q=(0,a.useCallback)((e=>{let{content:t,namedUsers:n,objectType:a,uri:r,relatedObjectUris:l,commentId:c,replies:p}=e;T(!0);const u={objectId:r,content:t,relatedObjectUris:l,objectType:a,visibility:"public",namedUsers:n,commentId:c,replies:p};return(0,i.uAg)({collaborationPath:b,tenant:f,data:u}).then((e=>(e=>{S(e),O((0,o.map)((0,o.when)((0,o.propEq)("commentId",e.commentId),(0,o.always)(e))))})(s({},e,{replies:p})))).catch(m).finally((()=>T(!1)))}),[b,f]),H=(0,a.useCallback)((e=>{let{uri:t,commentId:n}=e;T(!0),(0,i.YFy)({collaborationPath:b,tenant:f,commentId:n}).then((()=>((e,t)=>{S(null),E((n=>{const a=n[t]||[];return s({},n,{[t]:a.filter((t=>t.commentId!==e))})})),O((t=>t.filter((t=>t.commentId!==e))))})(n,t))).catch(m).finally((()=>T(!1)))}),[b,f]),U=(0,a.useCallback)(((e,t,n,a)=>{const r="resolve"===e.action?"resolved":"open",{replyId:o}=e;S("resolved"===r?e=>{if(e)return null}:t=>{if(t)return s({},t,{replies:a?p(o,t.replies):[...t.replies,e]})}),E((e=>s({},e,{[t]:(e[t]||[]).map((e=>e.commentId===n?s({},e,{status:r,replies:a?e.replies-1:e.replies+1}):e))}))),O((t=>t.map((t=>t.commentId===n?s({},t,{status:r,replies:a?p(e.replyId,t.replies):[...t.replies,e]}):t))))}),[]),z=(0,a.useCallback)((e=>{let{uri:t,commentId:n,reply:a}=e;T(!0),(0,i.Mfr)({collaborationPath:b,tenant:f,commentId:n,replyId:a.replyId}).then((()=>U(a,t,n,!0))).catch(m).finally((()=>T(!1)))}),[b,U,f]),_=(0,a.useCallback)(((e,t)=>{S((t=>{if(t)return s({},t,{replies:u(t,e)})})),O((n=>n.map((n=>n.commentId===t?s({},n,{replies:u(n,e)}):n))))}),[]),A=(0,a.useCallback)((e=>{let{content:t,namedUsers:n,commentId:a,replyId:r}=e;T(!0);const o={content:t,namedUsers:n};return(0,i.ufV)({collaborationPath:b,tenant:f,commentId:a,replyId:r,data:o}).then((e=>_(e,a))).catch(m).finally((()=>T(!1)))}),[b,f,_]),$=(0,a.useCallback)((e=>{let{content:t,namedUsers:n,commentId:a,action:r,uri:o}=e;T(!0);const l={content:t,action:r,namedUsers:n};return(0,i.PP2)({collaborationPath:b,tenant:f,commentId:a,data:l}).then((e=>{let[t]=e;return U(t,o,a)})).catch(m).finally((()=>T(!1)))}),[b,f,U]),W=(0,a.useCallback)((e=>{let{commentId:t,uri:n}=e;$({content:"",namedUsers:[],commentId:t,action:"resolve",uri:n})}),[$]),M=(0,a.useCallback)((e=>{let{commentId:t,uri:n}=e;$({content:"",namedUsers:[],commentId:t,action:"reopen",uri:n})}),[$]);return{clearCurrentComment:(0,a.useCallback)((()=>{S(null)}),[]),comments:v,commentsMap:w,getCommentState:(e,t)=>(0,o.pathOr)({},[e,t],I),updateCommentState:(e,t,n)=>{N((a=>{const r=[e,t],i=(0,o.path)(r,a);return(0,o.assocPath)(r,(0,o.mergeRight)(i,n),a)}))},clearCommentState:(e,t)=>N((0,o.dissocPath)([e,t])),createComment:F,createReply:$,currentComment:P,deleteComment:H,editComment:q,getComment:B,getComments:D,getCommentsCount:L,loading:j,objectTypes:n,pageToken:y,reOpenThread:M,resolveThread:W,sending:C,deleteReply:z,editReply:A}}},89846:(e,t,n)=>{n.d(t,{n:()=>i});var a=n(24328),r=n(67958),o=n(17440);const i=e=>{let{reversedContextLabels:t}=e;return{getRelationTypesOptions:(0,a.useCallback)(((e,n)=>{const a={},i=(0,o.pipe)(r.PjQ,(0,o.tap)((e=>a[e]=(0,o.propOr)(0,e,a)+1))),l=(0,o.ascend)((0,o.prop)("label")),s=(0,o.curry)(((e,n)=>{let{uri:a,label:o,startObject:l,endObject:s}=n;const c=e===(t?r.Nsj.OUT:r.Nsj.IN)?l:s;return{label:{directionalLabel:i(c),typeLabel:o},value:`${a},${e}`,startObject:l,endObject:s}}));return e.map(s(r.Nsj.IN)).concat(n.map(s(r.Nsj.OUT))).map((0,o.evolve)({label:e=>{let{directionalLabel:t,typeLabel:n}=e;return t?a[t]>1?`${t} (${n})`:t:n}})).sort(l)}),[t]),fromEditorValue:(0,a.useCallback)(((e,t)=>n=>{const[a,i]=n.value.split(",");return{type:(i===r.Nsj.IN?e:t).find((0,o.propEq)("uri",a)),direction:i}}),[]),toEditorValue:(0,a.useCallback)(((e,t)=>t.find((0,o.propEq)("value",`${e.relationType},${e.direction}`))),[])}}}}]);
2
2
  //# sourceMappingURL=9481.js.map