@reltio/remotes 1.4.1102 → 1.4.1105

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/5818.js CHANGED
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[5818],{93873:(e,t,n)=>{n.d(t,{a:()=>C});var r=n(24328),i=n.n(r),l=n(87918),a=n.n(l),o=n(94079),s=n(83348),c=n(8818),u=n(67766),d=n(42767),p=n(16299);const h=(0,n(79692).Z)({container:{display:"flex",alignItems:"center"},link:{whiteSpace:"nowrap",marginRight:"9px"}}),f=(0,s.Z)(o.Link),m=e=>{let{total:t=0,onPrev:n,onNext:r,onSearchResultsClick:l,isPrevDisabled:o,isNextDisabled:s}=e;const m=h();return i().createElement("div",{className:m.container},i().createElement(f,{className:m.link,component:"button",variant:"caption",onClick:l,underline:"none",tooltipTitle:a().text("Go to search results")},(0,p.k7L)(t,1e6)," ",1===t?a().text("Search result"):a().text("Search results")),i().createElement(c.k,{size:"L",icon:u.Z,tooltipTitle:a().text("Go to previous profile"),onClick:n,disabled:o,showForDisabled:!0}),i().createElement(c.k,{size:"L",icon:d.Z,tooltipTitle:a().text("Go to next profile"),onClick:r,disabled:s,showForDisabled:!0}))};var E=n(52730),y=n(87638),v=n(17440),g=n(39450),b=n(67218);function x(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){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 I{constructor(e){var t=this;let{data:{query:n,sortField:r,sortOrder:i},tenant:l,searchTenant:a,apiPath:o,dtssPath:s,globalSearchRequestOptions:c}=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 r=[t.getQueryFilter(),...e],i=x({},t.globalSearchRequestOptions,{sort:t.sortField,order:t.sortOrder,select:"uri,label,type",scoreEnabled:!1},n);return t.isDT()?(0,p.uqV)({filters:r,options:i,customerTenant:t.tenant,dataTenant:t.searchTenant,dtssPath:t.dtssPath}):(0,p.ZOr)(r,i)},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,p.J$m)({filters:e,options:t,customerTenant:this.tenant,dataTenant:this.searchTenant,dtssPath:this.dtssPath}):(0,p.j_Q)(e,t)).then((e=>e.total))},this.query=n,this.sortField=r,this.sortOrder=i,this.tenant=l,this.searchTenant=a,this.apiPath=o,this.dtssPath=s,this.globalSearchRequestOptions=c}}function O(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){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}class w{constructor(e){var t=this;let{data:n,tenant:r,apiPath:i}=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 r=[{rawFilter:t.searchBody.filter},...e];return(0,p.P2h)({apiPath:t.apiPath,tenant:t.tenant,searchBody:O({},t.searchBody,{filter:e.length?(0,p.Uqd)()(r):t.searchBody.filter}),options:n})},this.checkEntity=e=>this.getEntities([{filter:"equals",fieldName:"id",values:[(0,p.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,p.dED)({apiPath:this.apiPath,tenant:this.tenant,searchBody:this.searchBody}).then((e=>e.count)),this.searchBody=n,this.tenant=r,this.apiPath=i}}const S=(e,t)=>(0,v.pipe)((0,v.map)((0,v.prop)("uri")),(0,v.reject)((e=>t.includes(e))))(e),C=()=>{const{total:e,onPrev:t,onNext:n,onSearchResultsClick:l,isPrevDisabled:a,isNextDisabled:o}=(()=>{const e=(0,b._)(),t=(0,b._)(),n=(0,b._)(),{uri:i,index:l,total:a,tenant:o,cache:s}=(0,E.useSelector)(y.ZP.selectors.getSearchNavigationData)||{},{type:c,data:u}=(0,E.useSelector)(y.ZP.selectors.getSearchProviderData)||{},d=(0,E.useSelector)(y.ZP.selectors.getTenant),h=(0,E.useSelector)(y.ZP.selectors.getApiPath),f=(0,E.useSelector)(y.ZP.selectors.getDtssPath),m=(0,E.useSelector)((e=>y.ZP.selectors.getGlobalSearchRequestOptions(e,["ovOnly"]))),v=(0,r.useContext)(g.m),x=(0,E.useDispatch)(),[T,O]=(0,r.useState)(!1),N=(0,r.useMemo)((()=>((e,t)=>{switch(e){case"search":return new I(t);case"graphsearch":return new w(t)}})(c,{data:u,tenant:d,searchTenant:o,apiPath:h,dtssPath:f,globalSearchRequestOptions:m})),[c,u,d,o,h,f,m]),C=(0,r.useCallback)((e=>{x(y.yC.actions.updateSearchNavigationDataFields(e))}),[x]),P=(0,r.useCallback)((e=>{const t=d!==o?(0,p.wwR)({uri:e,dataTenant:o}):e;x(y.ui.actions.openEntity({uri:t,viewId:v,source:"navigation"}))}),[x,v,d,o]),D=(0,r.useCallback)((()=>{x(y.ui.actions.openPerspective({perspectiveId:c,viewId:v}))}),[x,c,v]);(0,r.useEffect)((()=>{l>=a?C({index:a-1}):l<0&&C({index:0})}),[a,l,C]);const R=(0,r.useCallback)(((e,r,i)=>{O(!0),t(N.requestTotal()).then((e=>C({total:e})));const l=i+1;return n(N.requestEntities(15,l)).then((t=>{if(t){if(t.length){const n=S(t,e);if(n.length>0)return C({cache:e.concat(n),uri:n[0],index:l+t.length-n.length}),void P(n[0]);if(i+t.length<r-1)return R(e,r-t.length,i+t.length)}C({index:l})}})).finally((()=>{O(!1)}))}),[N,C,P]),k=(0,r.useCallback)(((e,r)=>{O(!0),t(N.requestTotal()).then((e=>C({total:e})));const i=r-1,l=Math.max(0,r-15),a=15+Math.min(0,r-15);return n(N.requestEntities(a,l)).then((t=>{if(t){if(t.length){const n=S(t,e);if(n.length>0)return C({cache:n.concat(e),uri:n[n.length-1],index:i-(t.length-n.length)}),void P(n[n.length-1]);if(r-t.length>0)return k(e,r-t.length)}C({index:0})}})).finally((()=>{O(!1)}))}),[N,C,P]),M=(0,r.useCallback)(((t,n,r,i)=>{if(n<t.length){const l=t[n];return O(!0),e(N.checkEntity(l)).then((e=>{if(!e){const e=[...t];return e.splice(n,1),M(e,n,r-1,i)}C({index:i+1,uri:l,cache:t,total:r}),P(l)})).finally((()=>{O(!1)}))}if(!(i>=r-1))return R(t,r,i);C({cache:t,total:r,index:r-1})}),[N,C,P,R]),_=(0,r.useCallback)(((t,n,r,i)=>{if(n>-1){const l=t[n];return O(!0),e(N.checkEntity(l)).then((e=>{if(!e){const e=[...t];return e.splice(n,1),_(e,n-1,r-1,i-1)}C({index:i-1,uri:l,cache:t,total:r}),P(l)})).finally((()=>{O(!1)}))}if(!(i<=0))return k(t,i);C({index:0,cache:t,total:r})}),[N,C,P,k]),L=(0,r.useCallback)((()=>{if(s&&i){const e=s.indexOf(i)-1;_(s,e,a,l)}}),[_,s,i,a,l]),A=(0,r.useCallback)((()=>{if(s&&i){const e=s.indexOf(i)+1;M(s,e,a,l)}}),[M,s,i,a,l]);return{total:a,onPrev:L,onNext:A,onSearchResultsClick:D,isPrevDisabled:T||l<=0,isNextDisabled:T||l>=a-1}})();return(()=>{const{cache:e}=(0,E.useSelector)(y.ZP.selectors.getSearchNavigationData)||{},t=(0,E.useSelector)(y.ZP.selectors.getMode),n=(0,E.useSelector)(y.ZP.selectors.getEntity);return(0,p.uzs)(t)&&(null==e?void 0:e.includes(null==n?void 0:n.uri))})()?i().createElement(m,{total:e,onPrev:t,onNext:n,onSearchResultsClick:l,isPrevDisabled:a,isNextDisabled:o}):null}},10159:(e,t,n)=>{n.d(t,{Z:()=>c});var r=n(24328),i=n.n(r),l=n(94079);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 o=e=>i().createElement("svg",a({width:256,height:256,viewBox:"0 0 256 256",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),i().createElement("circle",{cx:128,cy:128,r:128,fill:"#0072CE",fillOpacity:.1}),i().createElement("mask",{id:"AttributesList_svg__a",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:0,y:0,width:256,height:256},i().createElement("circle",{cx:128,cy:128,r:128,fill:"#fff"})),i().createElement("g",{mask:"url(#AttributesList_svg__a)"},i().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M-16 9h256v247H-16V9z",fill:"url(#AttributesList_svg__b)"}),i().createElement("path",{opacity:.05,fillRule:"evenodd",clipRule:"evenodd",d:"M187.761 56.865l58.639 58.639v148.871H93.383L52 225.083V56.865h135.761z",fill:"url(#AttributesList_svg__c)"}),i().createElement("path",{opacity:.06,fillRule:"evenodd",clipRule:"evenodd",d:"M47 58h202a7 7 0 017 7v157a7 7 0 01-7 7H47a7 7 0 01-7-7V65a7 7 0 017-7z",fill:"#000"}),i().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M50 56h201a5 5 0 015 5v157a5 5 0 01-5 5H50a5 5 0 01-5-5V61a5 5 0 015-5z",fill:"#fff"}),i().createElement("path",{opacity:.8,fillRule:"evenodd",clipRule:"evenodd",d:"M105.376 72.635a3 3 0 013-3H150a3 3 0 110 6h-41.624a3 3 0 01-3-3z",fill:"#B6C7DB"}),i().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M105 84.635a3 3 0 013-3h64.205a3 3 0 110 6H108a3 3 0 01-3-3z",fill:"#979797"}),i().createElement("path",{opacity:.8,fillRule:"evenodd",clipRule:"evenodd",d:"M105.376 163a3 3 0 013-3H150a3 3 0 110 6h-41.624a3 3 0 01-3-3z",fill:"#B6C7DB"}),i().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M105 175a3 3 0 013-3h64.205a3 3 0 110 6H108a3 3 0 01-3-3z",fill:"#979797"}),i().createElement("path",{opacity:.8,fillRule:"evenodd",clipRule:"evenodd",d:"M105.376 193a3 3 0 013-3H190a3 3 0 110 6h-81.624a3 3 0 01-3-3z",fill:"#B6C7DB"}),i().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M105 205a3 3 0 013-3h74.205a3 3 0 110 6H108a3 3 0 01-3-3z",fill:"#979797"}),i().createElement("path",{opacity:.8,fillRule:"evenodd",clipRule:"evenodd",d:"M138.376 103a3 3 0 013-3H223a3 3 0 110 6h-81.624a3 3 0 01-3-3z",fill:"#B6C7DB"}),i().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M138 115a3 3 0 013-3h64.205a3 3 0 110 6H141a3 3 0 01-3-3z",fill:"#979797"}),i().createElement("circle",{cx:67,cy:79,r:9,fill:"#B6C7DB"}),i().createElement("circle",{cx:67,cy:79,r:9,fill:"#B6C7DB"}),i().createElement("circle",{cx:120,cy:106,r:6,fill:"#B6C7DB"}),i().createElement("circle",{cx:120,cy:136,r:6,fill:"#B6C7DB"}),i().createElement("circle",{cx:67,cy:169,r:9,fill:"#B6C7DB"}),i().createElement("circle",{cx:67,cy:199,r:9,fill:"#B6C7DB"}),i().createElement("path",{opacity:.8,fillRule:"evenodd",clipRule:"evenodd",d:"M138.376 133a3 3 0 013-3H223a3 3 0 110 6h-81.624a3 3 0 01-3-3z",fill:"#B6C7DB"}),i().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M138 145a3 3 0 013-3h74.205a3 3 0 110 6H141a3 3 0 01-3-3z",fill:"#979797"}),i().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M92.514 108v-8h-2v40.365h11.178v-2h-9.178V110h9.178v-2h-9.178z",fill:"#2B98F0"}),i().createElement("path",{opacity:.54,fillRule:"evenodd",clipRule:"evenodd",d:"M95.071 77l-3.535 3.535L88 77h7.071z",fill:"#000"}),i().createElement("path",{opacity:.6,fillRule:"evenodd",clipRule:"evenodd",d:"M50 22h186a6 6 0 016 6v18a6 6 0 01-6 6H50a6 6 0 01-6-6V28a6 6 0 016-6z",fill:"#fff"}),i().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M58 37a6 6 0 016-6h70a6 6 0 110 12H64a6 6 0 01-6-6zm90 0a6 6 0 016-6h10a6 6 0 110 12h-10a6 6 0 01-6-6z",fill:"#979797"})),i().createElement("defs",null,i().createElement("linearGradient",{id:"AttributesList_svg__b",x1:-16,y1:9,x2:-16,y2:256,gradientUnits:"userSpaceOnUse"},i().createElement("stop",{stopColor:"#FAFAFA",stopOpacity:.01}),i().createElement("stop",{offset:1,stopColor:"#F4F4F4"})),i().createElement("linearGradient",{id:"AttributesList_svg__c",x1:266.117,y1:181.111,x2:154.882,y2:77.681,gradientUnits:"userSpaceOnUse"},i().createElement("stop",{stopOpacity:.01}),i().createElement("stop",{offset:1})))),s=(0,n(79692).Z)((e=>({root:{display:"flex",flex:"1 1 auto",flexWrap:"nowrap",flexDirection:"column",alignItems:"center",justifyContent:"center",overflow:"auto",height:"100%",minHeight:"350px",boxSizing:"border-box",padding:"40px"},logo:{width:"190px",height:"190px"},textBox:{display:"flex",flexDirection:"column",alignItems:"center",maxWidth:400,marginTop:"24px"},text:{color:e.palette.text.primary,fontSize:"20px",fontWeight:500,lineHeight:"23px",textAlign:"center"},secondaryText:{color:e.palette.text.primary,fontSize:"14px",fontWeight:"normal",lineHeight:"16px",letterSpacing:"0.24px",textAlign:"center",paddingTop:"8px"}}))),c=e=>{let{IconRenderer:t=o,text:n,secondaryText:r}=e;const a=s();return i().createElement("div",{className:a.root},i().createElement(t,{className:a.logo}),i().createElement("div",{className:a.textBox},i().createElement(l.Typography,{className:a.text},n),r&&i().createElement(l.Typography,{className:a.secondaryText},r)))}},91515:(e,t,n)=>{n.d(t,{Z:()=>Q});var r=n(24328),i=n.n(r),l=n(87918),a=n.n(l),o=n(94079),s=n(17440),c=n(51229),u=n(36444),d=n(22385),p=n(48465),h=n(85451),f=n(27815),m=n(71153),E=n.n(m),y=n(31517),v=n(67885);const g=[v.K.WITHIN,v.K.AGO,v.K.BETWEEN],b=e=>({[v.K.WITHIN]:a().text("Within the last"),[v.K.AGO]:a().text("More than"),[v.K.BETWEEN]:a().text("Date range")}[e]||"");var x=n(39621),T=n(20562),I=n(51843),O=n(79692);const N=(0,O.Z)({root:{flex:1},title:{paddingBottom:"10px",paddingLeft:"5px",fontSize:"14px"},intervalContainer:{display:"flex",justifyContent:"space-between"},typeInput:{width:160,marginRight:10}}),w=[null,null],S=[null,"hours"],C=e=>{let{value:t,onChange:n,className:l}=e;const s=N(),c=e=>e===v.K.WITHIN||e===v.K.AGO,u=e=>e===v.K.BETWEEN,d=u(null==t?void 0:t.type)?t.period:w,p=c(null==t?void 0:t.type)?t.period:S,[h,f]=(0,r.useState)(d),[m,O]=(0,r.useState)(p),C=(null==t?void 0:t.type)||v.K.WITHIN,P=e=>c(e)?m:u(e)?h:void 0,D=e=>{n({type:C,period:e})};return(0,T.D)((()=>{t?c(t.type)?O(t.period):u(t.type)&&f(t.period):(f(w),O(S))}),[t]),i().createElement("div",{className:E()(s.root,l)},i().createElement(o.Typography,{className:s.title,variant:"subtitle1"},a().text("Date")),i().createElement("div",{className:s.intervalContainer},i().createElement(y.Z,{label:"",className:s.typeInput,value:{value:C,label:b(C)},options:g.map((e=>({value:e,label:b(e)}))),onChange:e=>{let{value:r}=e;(null==t?void 0:t.type)!==r&&n({period:P(r),type:r})}}),c(C)?i().createElement(x.Z,{interval:m,onChange:D}):i().createElement(I.Z,{values:h,onChange:D})))};var P=n(92575),D=n(96808),R=n(65942);const k=[R.M.UPDATE,R.M.MERGE,R.M.UNMERGE];function M(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,t,n[t])}))}return e}function _(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={input:e=>M({},e,{fontSize:"14px"}),menuPortal:e=>M({},e,{zIndex:1300})},A=(0,O.Z)({root:{flex:1},title:{paddingBottom:"10px",paddingLeft:"5px",fontSize:"14px"},dropDownInput:{width:"100%",justifyContent:"center",backgroundColor:"rgba(0, 0, 0, 0.03)",borderTop:"4px"},valueContainer:{overflowY:"auto",height:44},option:{fontSize:"14px",height:"32px"}}),j=e=>{let{selectedHistoryActivityTypes:t,onChange:n,className:r}=e;const l=A(),c=e=>{return{value:e,label:(t=e,{[R.M.UPDATE]:a().text("Update"),[R.M.MERGE]:a().text("Merge"),[R.M.UNMERGE]:a().text("Unmerge")}[t]||"")};var t},u=e=>e.map(c),d=u(k);return i().createElement("div",{className:E()(l.root,r)},i().createElement(o.Typography,{className:l.title,variant:"subtitle1"},a().text("Activity")),i().createElement(P.Z,{value:u(t),onChange:(0,s.pipe)((0,s.defaultTo)([]),(0,s.pluck)("value"),n),options:d,TextFieldProps:{classes:{root:l.dropDownInput}},components:{DropdownIndicator:D.Z},styles:L,classes:l,menuPlacement:"bottom",menuPortalTarget:document.body}))},F=(0,O.Z)({popup:{width:500,height:500,overflowY:"hidden",display:"flex",flexDirection:"column"},filterContainer:{padding:20,height:410,display:"flex",flexDirection:"column"},filterContainerScrollable:{overflowY:"auto"},filterItem:{marginTop:15},filterControls:{display:"flex",padding:"10px 12px 0",borderTop:"solid 1px rgba(0, 0, 0, 0.12)"},clearButton:{marginRight:"auto"},input:{height:"100%",paddingLeft:"12px",paddingRight:"8px"}});function G(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const H=e=>{let{className:t,filter:n,onApplyFilter:l,onClearFilter:c,entityType:m}=e;const E=F(),[y,v]=(0,r.useState)(null),g=()=>v(null),[b,x]=(0,r.useState)(n);(0,r.useEffect)((()=>{x(n)}),[n]);const T=(0,s.curry)(((e,t)=>{x((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){G(e,t,n[t])}))}return e}({},n,{[e]:t})))})),{activities:I=[],attributes:O=[],dateRange:N=null,users:w=[]}=b||{};return i().createElement(i().Fragment,null,i().createElement(d.Z,{icon:u.Z,size:"L",onClick:e=>v(e.currentTarget),className:t}),i().createElement(o.Popover,{classes:{paper:E.popup},open:!!y,anchorEl:y,onClose:g,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},i().createElement("div",{className:E.filterContainer},i().createElement(o.Typography,{variant:"h6"},a().text("Filter")),i().createElement("div",{className:E.filterContainerScrollable},i().createElement(C,{value:N,onChange:T("dateRange"),className:E.filterItem}),i().createElement(h.Z,{selectedUsers:w,onChange:T("users"),className:E.filterItem}),i().createElement(j,{selectedHistoryActivityTypes:I,onChange:T("activities"),className:E.filterItem}),i().createElement(f.Z,{selectedAttributes:O,entityType:m,onChange:T("attributes"),className:E.filterItem,title:a().text("Attribute updated")}))),i().createElement("div",{className:E.filterControls},i().createElement(o.Button,{onClick:c,className:E.clearButton},a().text("Clear all")),i().createElement(o.Button,{onClick:g},a().text("Cancel")),i().createElement(o.Button,{color:"primary",onClick:()=>{N&&(0,p.R)(N)?l(b):l((0,s.dissoc)("dateRange",b)),g()}},a().text("Apply")))))};var Z=n(52730),B=n(43054),U=n(87638),z=n(55847),$=n(98281),K=n(31276);const W=(0,O.Z)({menuItem:{minHeight:"32px"},menuText:{fontSize:"13px",lineHeight:"15px",letterSpacing:0,marginLeft:"30px"},checkIcon:{position:"absolute",color:"rgba(0, 0, 0, 0.54)"}}),q=(0,r.forwardRef)(((e,t)=>{let{item:n,onMenuClose:r=K.ZT}=e;const l=W(),{text:a,selected:s,onClick:c}=n;return i().createElement(o.MenuItem,{classes:{root:l.menuItem},onClick:e=>{r(),c(e)},ref:t},s&&i().createElement($.Z,{className:l.checkIcon}),i().createElement(o.Typography,{classes:{root:l.menuText}},a))}));q.displayName="MenuItemRenderer";const Y=q,V=()=>{const e=(0,Z.useSelector)(U.ZP.selectors.getHistoryMode),t=(0,Z.useDispatch)(),n=e=>{t(U.N5.history.actions.setHistoryMode(e))},r=[{text:a().text("Compare to Current view"),selected:e===U.Z9.Current,onClick:()=>n(U.Z9.Current)},{text:a().text("Compare to Previous view"),selected:e===U.Z9.Previous,onClick:()=>n(U.Z9.Previous)}];return i().createElement(z.Z,{MenuItemRenderer:Y,buttonComponent:d.Z,buttonProps:{icon:B.Z,size:"L"},menuId:"history-menu",menuItems:r})},X=(0,O.Z)({root:{display:"flex",flex:1,alignItems:"center"},icon:{margin:4},divider:{backgroundColor:"rgba(0,0,0,0.12)",margin:"3px 19px"},count:{fontSize:14},filterButton:{marginRight:"-4px"}}),Q=e=>{let{total:t,entityType:n,filter:r,onApplyFilter:l,onClearFilter:u}=e;const d=X();return i().createElement("div",{className:d.root},i().createElement(o.Typography,{variant:"h6"},a().text("History")),!(0,s.isNil)(t)&&i().createElement(i().Fragment,null,i().createElement(o.Divider,{orientation:"vertical",flexItem:!0,className:d.divider}),i().createElement(o.Typography,{variant:"body1",color:"textSecondary",className:d.count},1===t?a().text("${count} contributing profile",{count:t}):a().text("${count} contributing profiles",{count:t}))),i().createElement(c.Z,null),i().createElement(H,{className:d.filterButton,entityType:n,filter:r,onApplyFilter:l,onClearFilter:u}),i().createElement(V,null))}},6674:(e,t,n)=>{n.d(t,{Z:()=>s});var r=n(24328),i=n.n(r),l=n(87918),a=n.n(l),o=n(10159);const s=()=>i().createElement(o.Z,{text:a().text("History in the making"),secondaryText:a().text("When you create an event or perform an activity, it will show up here.")})},54362:(e,t,n)=>{n.d(t,{Z:()=>F});var r=n(24328),i=n.n(r),l=n(52730),a=n(44443),o=n(87918),s=n.n(o),c=n(17440),u=n(71153),d=n.n(u),p=n(16299),h=n(87638),f=n(94079),m=n(34606),E=n(79692);const y=(0,E.Z)((()=>({historyRow:{position:"relative",padding:"8px 12px 16px",cursor:"pointer"},selected:{background:"rgba(0,0,0,0.05)","&:before":{content:'""',background:"rgba(0,0,0,0.05)",width:"100%",height:"100%",position:"absolute",left:"-100%",top:0}},rowHeader:{display:"flex",position:"relative"},badge:e=>{let{color:t}=e;return{position:"absolute",width:"2px",height:"100%",left:"-9px",pointerEvents:"none",background:t,"&:before":{height:"100%",width:"3px",content:'""',left:"-3px",background:t,position:"absolute",opacity:.06}}},title:{color:"rgba(0,0,0,0.87)",fontSize:"13px",letterSpacing:0,lineHeight:"16px",fontWeight:400,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap","&.bold":{fontWeight:500}},date:{marginLeft:"auto",color:"rgba(0,0,0,0.54)",fontSize:"11px",letterSpacing:0,lineHeight:"16px"},user:{color:"rgba(0,0,0,0.38)",fontSize:"12px",letterSpacing:0,lineHeight:"14px"}}))),v=e=>{let{change:t,isCurrent:n,isSelected:r,onClick:l}=e;const{uri:a,type:o,matchGroups:c,user:u,timestamp:h}=t,E=(0,p.GtP)(a),v=y({color:E});return i().createElement("div",{className:d()(v.historyRow,{[v.selected]:r}),onClick:l},i().createElement("div",{className:v.rowHeader},i().createElement("div",{className:v.badge}),i().createElement(f.Typography,{className:d()(v.title,{bold:n})},n?s().text("Current view"):(0,m.Xr)(o)),!n&&i().createElement(f.Typography,{className:v.date},s().date(h,"L LT"))),c&&i().createElement(f.Typography,{className:v.title},s().text("Match rule:")," ",c.join(", ")),i().createElement(f.Typography,{className:v.user},u))};var g=n(55912);const b=e=>e===g.b.FAKE_FILTERED_INCOMING||e===g.b.FAKE_FILTERED_OUTGOING,x=e=>{let{x:t,y:n,toX:r,toY:l,color:a,isDashed:o}=e;const s=((e,t,n,r)=>{const i=t>r,l=e<n,a=i?-6:6;return`M${e} ${t} L${l?n-12:n+12} ${t} ${l?`c 6 0 12 ${a} 12`:`c -6 0 -12 ${a} -12`} ${i?-12:12} L${n} ${r}`})(t,n,r,l);return i().createElement("path",{d:s,stroke:a,strokeWidth:2,fill:"none",strokeDasharray:o?"3,3":void 0})};function T(){return T=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},T.apply(this,arguments)}const I=(0,r.forwardRef)(((e,t)=>{let{x:n,y:r,color:l,isDashed:a,isCollapsed:o,showCollapseIcon:s,showLine:c}=e,u=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},l=Object.keys(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,["x","y","color","isDashed","isCollapsed","showCollapseIcon","showLine"]);const d=s?6:3;return i().createElement("g",T({},u,{ref:t}),c&&i().createElement("rect",{id:"line",x:n-d-4,y:r-d-4,width:2*d+8,height:2,fill:l}),i().createElement("circle",{cx:n,cy:r,r:d,fill:a?"#fff":l,stroke:l,strokeDasharray:a?"1,1":void 0,strokeWidth:2}),s&&i().createElement("g",{id:"icon"},i().createElement("rect",{x:n-4,y:r-1,width:8,height:2,fill:"#fff"}),o&&i().createElement("rect",{x:n-1,y:r-4,width:2,height:8,fill:"#fff"})))}));const O=(0,n(83348).Z)(I),N=(0,r.memo)((e=>{let{graphData:t,onHistoryCircleMouseOver:n}=e;const{historyLanes:r,rows:l}=t,a=[16],{links:o,rowLines:s,circles:c}=l.reduce(((e,t,o)=>{let{uri:s,height:c,uris:u,type:d,fakeType:h,index:f,timestamp:m,label:E}=t;const y=16*r[s].index+24,v=a[o];a.push(v+c);const T=b(h),I=T?u[0]:s,N=!(null!=u&&u.some((e=>r[e])));e.circles.push(i().createElement(O,{tooltipTitle:E,tooltipPlacement:"top",onMouseOver:n?()=>n(s,m,f):void 0,key:`circle-${I}-${o}`,x:y,y:v,color:(0,p.GtP)(I),isDashed:T,isCollapsed:N,showCollapseIcon:!!u,showLine:h===g.b.FAKE_NAVIGATE_PROFILE})),e.rowLines.push(i().createElement("rect",{key:`${I}-${f}`,x:y,y:v-8,width:"100%",height:16,fill:(0,p.GtP)(I),opacity:.06}));const w=d===g.b.ENTITIES_SPLITTED;return null==u||u.forEach((t=>{const n=r[t];if(!n)return;const a=l[o].height,s=16*n.index+24,c=w?v-a:v+a;y!==s&&e.links.push(i().createElement(x,{key:`link-${t}-${f}`,x:y,y:v,toX:s,toY:c,isDashed:b(h),color:(0,p.GtP)(t)}))})),e}),{links:[],circles:[],rowLines:[]}),u=16*Object.keys(r).length+24,d=a[a.length-1]-16;return Object.entries(r).forEach((e=>{let[t,n]=e;const r=16*n.index+24;n.lifeTime.forEach(((e,s)=>{var u;let{start:d,end:h}=e;if((null===(u=l[null==h?void 0:h.index])||void 0===u?void 0:u.type)===g.b.ENTITIES_SPLITTED)return;const f=(null==d?void 0:d.type)===g.b.ENTITIES_SPLITTED?(null==d?void 0:d.index)-1:null==d?void 0:d.index,m=(null==h?void 0:h.type)===g.b.ENTITIES_MERGED_MANUALLY||(null==h?void 0:h.type)===g.b.ENTITIES_MERGED?(null==h?void 0:h.index)+1:null==h?void 0:h.index,E=a[f]||a[a.length-2],y=a[m]||16;if(E<=y)return;const v=(0,p.GtP)(t);!h&&n.index>0&&c.push(i().createElement(I,{key:`initCircle-${t}-${s}`,x:r,y,color:v,showLine:!0})),o.unshift(i().createElement("path",{key:`line-${t}-${s}`,d:`M${r} ${E} L${r} ${y}`,stroke:v,strokeWidth:2}))}))})),i().createElement("svg",{className:"chart",width:u,height:d},i().createElement("g",{id:"rowLines"},s),i().createElement("g",{id:"links"},o),i().createElement("g",{id:"circles"},c))}));var w=n(99136);const S=(0,E.Z)({historyTree:{display:"grid",gridTemplateColumns:"auto 1fr",overflowY:"auto"},graph:{overflowX:"scroll",overflowY:"hidden"},history:{minWidth:344},buttonContainer:{gridColumnStart:1,gridColumnEnd:3,padding:"8px 16px"},shadow:{boxShadow:"inset -8px 0px 5px -5px rgba(0,0,0,0.1)"}});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){P(e,t,n[t])}))}return e}function P(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const D=e=>{let{historyData:t,isLoading:n,canLoadMore:o,onLoadMore:u,entityUri:m,historyEvent:E,findPreviousChange:y}=e;const g=S(),b=(0,l.useDispatch)(),x=(0,l.useSelector)(h.ZP.selectors.getIsEditableMode),T=(0,l.useSelector)(h.ZP.selectors.getMetadata),[I,O]=(0,r.useState)({historyLanes:{},rows:[]}),[P,D]=(0,r.useState)(!1),[R,k]=(0,r.useState)(-1);(0,r.useEffect)((()=>{if((0,c.isNil)(E))return void k(0);const e=e=>(null==e?void 0:e.uri)===((null==E?void 0:E.overrideUri)||m)&&(null==e?void 0:e.timestamp)===(null==E?void 0:E.aStamp),n=-1!==R?t.rows[R]:null,r=t.rows.findIndex((t=>e(t)));k(e(n)?R:r)}),[t.rows,E]);const M=(0,r.useRef)(null),_=(0,r.useCallback)((e=>{if(!(0,c.isNil)(e)){var n;const r=null===(n=t.rows)||void 0===n?void 0:n.map(((t,n)=>{var r;return C({},t,{height:null===(r=e.childNodes[n])||void 0===r?void 0:r.clientHeight})}));O({historyLanes:t.historyLanes,rows:r})}}),[t]),L=()=>{const{scrollWidth:e,clientWidth:t,scrollLeft:n}=(null==M?void 0:M.current)||{};D(n<e-t)};return i().createElement("div",{className:g.historyTree},n&&i().createElement(w.Z,null),i().createElement("div",{className:d()(g.graph,{[g.shadow]:P}),onScroll:L,ref:M},i().createElement(N,{onHistoryCircleMouseOver:(e,t,n)=>{if((0,c.isNil)(I.rows[n].label)){const r={time:t,select:"crosswalks"};(0,p.HvW)(e,r).then((e=>{let{crosswalks:t}=e;const r=t?(0,c.uniqBy)((0,c.prop)("type"),t).map((e=>{const t=(0,p.s5)(T,e.type);return t?t.label:null})).filter(c.identity).join(", "):s().text("No data");O((e=>C({},e,{rows:e.rows.map((e=>e.index===n?C({},e,{label:r}):e))})))}))}},graphData:I}),i().createElement(a.Z,{handleWidth:!0,onResize:L})),i().createElement("div",{ref:_,className:g.history},t.rows.map(((e,t)=>{const n=t===R,r=0===t;return i().createElement(v,{key:`row-${t}`,change:e,isCurrent:r,isSelected:n,onClick:()=>((e,t,n,r)=>{if(x){if(!window.confirm(s().text("Are you sure you want to go in history mode? All your changes will be lost.")))return;b(h.N5.mode.actions.modeUpdated(p.ARY.Viewing))}if(r&&!n||!r&&n)b(h.N5.history.actions.clearHistoryEvent()),k(0);else if(!r&&!n){const n=y(e-1,t.uri||m),r=y(e,t.uri||m),i=null==n?void 0:n.timestamp,l=null==r?void 0:r.timestamp,a=(null==t?void 0:t.uri)===m?null:null==t?void 0:t.uri;b(h.N5.history.actions.setHistoryEvent({aStamp:i,bStamp:l,overrideUri:a})),k(e)}})(t,e,n,r)})}))),o&&i().createElement("div",{className:g.buttonContainer},i().createElement(f.Button,{color:"primary",onClick:()=>u()},s().text("Show more"))))},R=(0,E.Z)({root:{display:"flex",flexWrap:"wrap",padding:"10px 15px"}}),k=(0,E.Z)({icon:e=>{let{color:t}=e;return{boxSizing:"border-box",borderWidth:2,borderStyle:"solid",borderColor:t,height:12,width:12,borderRadius:30,transition:"opacity 0.3s",margin:4}},active:e=>{let{color:t}=e;return{backgroundColor:t}},inactive:{backgroundColor:"white"},clickable:{cursor:"pointer"}}),M=e=>{let{value:t,isSelected:n=!0,onClick:r}=e;const l=(0,p.GtP)(t),a=k({color:l});return i().createElement("div",{className:d()(a.icon,{[a.inactive]:!n,[a.active]:n,[a.clickable]:!!r}),onClick:r})},_=e=>{let{values:t,selectedValues:n,entityUri:r,onSelectValues:l,className:a}=e;const o=R();return i().createElement("div",{className:d()(o.root,a)},i().createElement(M,{value:r}),(null==t?void 0:t.length)>0&&t.map((e=>i().createElement(M,{key:e,value:e,isSelected:null==n?void 0:n.includes(e),onClick:()=>(e=>{null!=n&&n.includes(e)?l((0,c.without)([e],n)):l([...n||[],e])})(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 A=(e,t)=>e.reduce(((e,n,r)=>{let{start:i,end:l}=n;if(i){const n=t-i.timestamp;((0,c.isNil)(e.startDistance)||Math.abs(e.startDistance)>Math.abs(n)&&n>0)&&(e.startIndex=r,e.startDistance=n)}if(l){const n=t-l.timestamp;((0,c.isNil)(e.endDistance)||Math.abs(e.endDistance)>Math.abs(n)&&n<0)&&(e.endIndex=r,e.endDistance=n)}return e}),{startIndex:null,endIndex:null,startDistance:null,endDistance:null}),j=(0,E.Z)({root:{display:"flex",flexDirection:"column",overflow:"hidden",position:"relative",height:"100%"},borderBottom:{borderBottom:"1px solid rgba(0, 0, 0, 0.12)"}}),F=(0,r.memo)((e=>{let{isLoading:t,historyWithTotal:n,contributorsUris:l,entityUri:a,canLoadMore:o,onLoadMore:s,historyEvent:u}=e;const d=j(),[p,h]=(0,r.useState)(null);(0,r.useEffect)((()=>{h(l)}),[l]);const{historyData:f,findPreviousChange:m}=(e=>{let{entityUri:t,historyChanges:n,selectedUris:i}=e;return(0,r.useMemo)((()=>{const e={[t]:{index:0,lifeTime:[]}},r=[{user:"",timestamp:0,uri:t}],l=(0,c.curry)(((e,n,r)=>{const i=r.uri||t;if(e)if(Array.isArray(e)){if(r.type!==g.b.ENTITY_LOST_MERGE)return null;if(e.includes(i))return r;if(n&&r.uris)return e.some((e=>r.uris.includes(e)))?r:null}else{var l;if(i===e||n&&null!==(l=r.uris)&&void 0!==l&&l.includes(e))return r}return null})),a=(e,t,r)=>(0,c.pipe)((0,c.drop)(e+1),(0,c.find)(l(t,r)))(n),o=t=>(e[t]||i&&!i.includes(t)||(e[t]={index:Object.keys(e).length,lifeTime:[]}),e[t]),s=(e,t)=>{const n=e[e.length-1];!n||n.start&&(n.start.type!==g.b.ENTITY_CREATED||t.type!==g.b.ENTITIES_SPLITTED)?e.push({start:t,end:null}):n.start=t},u=(e,t)=>{let n=!0;if(e.length){const r=e[e.length-1];n=!((!r.start||r.start.timestamp<t.timestamp)&&(!r.end||r.end.timestamp>t.timestamp))}n&&e.push({start:null,end:null})},d=(e,t)=>{if(e.length){const n=e[e.length-1];n.start||(n.start=t)}e.push({start:null,end:t})},p=[];return null==n||n.forEach(((n,i)=>{var l;switch(n.type){case g.b.ENTITIES_SPLITTED:if(!a(i,n.uri||t,!1))return;{const e=n.uri,t=n.uris?[n.uris,e]:[e],r=a(i,t,!0);if(r&&(!e||e===r.uri))return}break;case g.b.ENTITY_LOST_MERGE:case g.b.RELATIONSHIP_CREATED:case g.b.RELATIONSHIP_REMOVED:case g.b.RELATIONSHIP_CHANGED:return}let c=!1;null===(l=n.uris)||void 0===l||l.forEach((e=>{o(e)||(c=!0)}));const h=o(n.uri||t);if(!h)return;const f=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){L(e,t,n[t])}))}return e}({},n);((t,n)=>{var i,l;switch(n.type){case g.b.ENTITY_CREATED:s(t,n);break;case g.b.ENTITIES_MERGED_ON_THE_FLY:case g.b.ENTITY_CHANGED:u(t,n);break;case g.b.ENTITY_LOST_MERGE:case g.b.ENTITY_REMOVED:d(t,n);break;case g.b.ENTITIES_SPLITTED:u(t,n),null===(i=n.uris)||void 0===i||i.forEach((t=>{const i=e[t];if(!i)return;const l=i.lifeTime.length;l?s(i.lifeTime,n):d(i.lifeTime,n),r.push({uri:t,user:n.user,type:n.type,fakeType:l?g.b.FAKE_UPDATE:g.b.FAKE_NAVIGATE_PROFILE,timestamp:n.timestamp})}));break;case g.b.ENTITIES_MERGED:case g.b.ENTITIES_MERGED_MANUALLY:u(t,n),null===(l=n.uris)||void 0===l||l.forEach((t=>{const r=e[t];r&&d(r.lifeTime,n)}))}})(h.lifeTime,f),c&&p.push(f),r.push(f)})),p.forEach((t=>{t.uris.forEach((i=>{e[i]||n.forEach((n=>{let{uri:l,uris:a,timestamp:o,user:s,type:u}=n;l===i&&(null==a||a.forEach((n=>{const i=e[n];if(!i)return;let l=null;switch(u){case g.b.ENTITIES_MERGED:case g.b.ENTITIES_MERGED_MANUALLY:l=g.b.FAKE_FILTERED_INCOMING;break;case g.b.ENTITIES_SPLITTED:l=g.b.FAKE_FILTERED_OUTGOING;break;default:return}const a={fakeType:l,uri:t.uri,uris:[n],type:u,user:s,timestamp:o},d=A(i.lifeTime,t.timestamp);l===g.b.FAKE_FILTERED_INCOMING?(0,c.isNil)(d.endIndex)||(i.lifeTime[d.endIndex].end=a):(0,c.isNil)(d.startIndex)||(i.lifeTime[d.startIndex].start=a),r.splice(r.indexOf(t),0,a)})))}))}))})),r.forEach(((e,n)=>{e.index=n,e.uri=e.uri||t})),{historyData:{historyLanes:e,rows:r},findPreviousChange:(e,t)=>(0,c.pipe)((0,c.slice)(e+1,1/0),(0,c.find)(l(t,!1)))(r)}}),[t,n,i])})({entityUri:a,historyChanges:null==n?void 0:n.changes,selectedUris:p});return i().createElement("div",{className:d.root},i().createElement(_,{values:l,selectedValues:p,onSelectValues:h,entityUri:a,className:d.borderBottom}),i().createElement(D,{historyData:f,isLoading:t,onLoadMore:s,canLoadMore:o,entityUri:a,historyEvent:u,findPreviousChange:m}))}))},3409:(e,t,n)=>{n.d(t,{Z:()=>p});var r=n(24328),i=n.n(r),l=n(52730),a=n(87638),o=n(94079),s=n(17440),c=n(87918),u=n.n(c);const d=(0,n(79692).Z)({root:{display:"flex",alignItems:"flex-start"},slice:{fontWeight:500},cancelButton:{width:"88px",flexShrink:0,marginLeft:"15px"}}),p=()=>{const e=d(),t=(0,l.useSelector)(a.ZP.selectors.getHistoryEvent),n=(0,l.useDispatch)(),r=(0,s.pipe)(a.N5.history.actions.clearHistoryEvent,n);return t?i().createElement("div",{className:e.root},i().createElement(o.Typography,{component:"div"},u().text("You are viewing a historic slice:")," ",i().createElement("span",{className:e.slice},u().date(t.aStamp,"llll"))),i().createElement(o.Button,{className:e.cancelButton,variant:"contained",color:"primary",onClick:r},u().text("Cancel"))):null}},85890:(e,t,n)=>{n.d(t,{k:()=>d});var r=n(24328),i=n(16299),l=n(65942),a=n(48465),o=n(67218);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={activities:[l.M.MERGE,l.M.UNMERGE,l.M.UPDATE]},d=e=>{let{entity:t,enabled:n}=e;const[l,c]=(0,r.useState)(u),[d,p]=(0,r.useState)(0),h=(0,r.useMemo)((()=>(0,a.Z)(l)),[l]),[f,m]=(0,r.useState)(null),[E,y]=(0,r.useState)(null),[v,g]=(0,r.useState)(!1),b=(0,o._)(),x=null==t?void 0:t.uri,T={max:32,order:"desc"},I=(0,i.O27)(null==l?void 0:l.attributes)||void 0;(0,r.useEffect)((()=>{x&&n&&(g(!0),b((0,i.kgP)(s({entityUri:x,historicUris:f,filter:h,showAll:I},T))).then(y).catch((e=>{console.warn("Failed to load history data",e),y(null)})).finally((()=>{g(!1)})))}),[h,I,f]),(0,r.useEffect)((()=>{x&&n&&(g(!0),b((0,i.wdF)({entityUri:x})).then((e=>{m(e)})).catch((e=>{console.warn("Failed to load history data",e),m(null)})).finally((()=>{g(!1)})),p(0))}),[x,null==t?void 0:t.updatedTime,n]);const O=(0,r.useCallback)((e=>{x&&f&&n&&(g(!0),b((0,i.kgP)(s({entityUri:x,historicUris:f,filter:h,showAll:I,offset:e},T))).then((e=>{y((t=>s({},t,{changes:[...null==t?void 0:t.changes,...e.changes]})))})).catch((e=>{console.warn("Failed to load history data",e)})).finally((()=>{g(!1)})))}),[f,h,n]),N=(0,r.useMemo)((()=>32*(d+1)<(null==E?void 0:E.total)),[E,d]),w=(0,r.useCallback)((e=>{p(0),c(e)}),[]),S=(0,r.useCallback)((()=>{w(s({},u))}),[]),C=(0,r.useCallback)((()=>{N&&(O(32*(d+1)),p(d+1))}),[O,d,N]);return{isLoading:v,canLoadMore:N,onLoadMore:C,onApplyFilter:w,onClearFilter:S,historicUris:f,historyWithTotal:E,historyFilter:l}}},71820:(e,t,n)=>{n.d(t,{C:()=>l});var r=n(24328),i=n(16299);const l=e=>{let{isHistoryTabActive:t,entity:n}=e;const[l,a]=(0,r.useState)(!1),o=null==n?void 0:n.uri;(0,r.useEffect)((()=>{t||a(!1)}),[o]),(0,r.useEffect)((()=>{t&&a(!0)}),[t]);const s=o&&!(0,i.ZiX)(o)&&!(0,i.biM)(n);return{isHistoryEnabled:l&&s,isProfilePersisted:s}}},57730:(e,t,n)=>{n.d(t,{a:()=>s});var r=n(24328),i=n(52730),l=n(87638),a=n(16299),o=n(67218);const s=e=>{let{entity:t,historyEvent:n}=e;const[s,c]=(0,r.useState)(!1),u=(0,i.useSelector)(l.ZP.selectors.getHistorySlice),d=(0,i.useDispatch)(),p=(0,o._)(),{aStamp:h,bStamp:f,overrideUri:m}=n||{},E=m||(null==t?void 0:t.uri);return(0,r.useEffect)((()=>{n&&E&&(c(!0),p(Promise.all([(0,a.lrH)(E,h),f&&1!==f?(0,a.lrH)(E,f):Promise.resolve(null)])).then((e=>{let[t,n]=e;d(l.N5.history.actions.setHistorySlice({aEntity:t,bEntity:n}))})).catch((e=>{console.warn("Failed to load entity slice",e)})).finally((()=>{c(!1)})))}),[h,f,E]),{isLoading:s,historySlice:u}}},55912:(e,t,n)=>{n.d(t,{b:()=>a});var r,i=n(31537);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}!function(e){e.FAKE_NAVIGATE_PROFILE="FAKE_NAVIGATE_PROFILE",e.FAKE_FILTERED_INCOMING="FAKE_FILTERED_INCOMING",e.FAKE_FILTERED_OUTGOING="FAKE_FILTERED_OUTGOING",e.FAKE_UPDATE="FAKE_UPDATE"}(r||(r={}));const 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){l(e,t,n[t])}))}return e}({},i.I,r)},65942:(e,t,n)=>{let r;n.d(t,{M:()=>r}),function(e){e.UPDATE="UPDATE",e.MERGE="MERGE",e.UNMERGE="UNMERGE"}(r||(r={}))},48465:(e,t,n)=>{n.d(t,{Z:()=>f,R:()=>m});var r=n(95038),i=n.n(r),l=n(17440),a=n(16299),o=n(65942),s=n(31537),c=n(67885);const u=e=>(0,l.pipe)((0,l.map)(e),(0,l.join)(" or ")),d=e=>{const[t,n]=e;return i()().subtract(t,n).valueOf()},p=(0,l.chain)((0,l.cond)([[(0,l.equals)(o.M.MERGE),()=>[s.I.ENTITIES_MERGED,s.I.ENTITIES_MERGED_MANUALLY,s.I.ENTITIES_MERGED_ON_THE_FLY]],[(0,l.equals)(o.M.UNMERGE),()=>[s.I.ENTITIES_SPLITTED]],[(0,l.equals)(o.M.UPDATE),()=>[s.I.ENTITY_CHANGED]]])),h=(0,l.pipe)((0,l.defaultTo)([]),p,(0,l.concat)([s.I.ENTITY_CREATED,s.I.ENTITY_REMOVED,s.I.ENTITY_LOST_MERGE]),u((e=>`equals(type, '${e}')`))),f=(0,l.pipe)((0,l.defaultTo)({}),(0,l.reject)(a.O27),(0,l.evolve)({users:u((e=>`equals(user, '${(0,a.HRH)(e)}')`)),attributes:u((e=>`changes(${(0,a.HRH)(e.value)})`)),dateRange:e=>{let{type:t,period:n}=e;switch(t){case c.K.WITHIN:return`gte(timestamp, ${d(n)})`;case c.K.AGO:return`lte(timestamp, ${d(n)})`;case c.K.BETWEEN:{const[e,t]=n;return`gte(timestamp, ${e.valueOf()}) and lte(timestamp, ${i()(t).endOf("date").valueOf()})`}default:return""}}}),(0,l.over)((0,l.lensProp)("activities"),h),l.values,(0,l.reject)(a.O27),(0,l.append)("not equals(user, 'collaboration-service')"),(0,l.map)((e=>`(${e})`)),(0,l.join)(" and ")),m=e=>{if(e.type===c.K.AGO||e.type===c.K.WITHIN){const[t,n]=e.period;return"Number"===(0,l.type)(t)&&"String"===(0,l.type)(n)&&t>0}if(e.type===c.K.BETWEEN){const[t,n]=e.period;return t instanceof Date&&n instanceof Date}}},2804:(e,t,n)=>{n.d(t,{a:()=>i});var r=n(24328);const i=e=>{const[t,n]=(0,r.useState)(!1),[i,l]=(0,r.useState)({});return(0,r.useEffect)((()=>{e().then((e=>{l(e||{})})).then((e=>n(!0))).catch((e=>n(!0)))}),[]),{isLoaded:t,savedState:i}}}}]);
1
+ "use strict";(self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[5818],{93873:(e,t,n)=>{n.d(t,{a:()=>C});var r=n(24328),i=n.n(r),l=n(87918),a=n.n(l),o=n(94079),s=n(83348),c=n(8818),u=n(67766),d=n(42767),p=n(99493);const h=(0,n(79692).Z)({container:{display:"flex",alignItems:"center"},link:{whiteSpace:"nowrap",marginRight:"9px"}}),f=(0,s.Z)(o.Link),m=e=>{let{total:t=0,onPrev:n,onNext:r,onSearchResultsClick:l,isPrevDisabled:o,isNextDisabled:s}=e;const m=h();return i().createElement("div",{className:m.container},i().createElement(f,{className:m.link,component:"button",variant:"caption",onClick:l,underline:"none",tooltipTitle:a().text("Go to search results")},(0,p.k7L)(t,1e6)," ",1===t?a().text("Search result"):a().text("Search results")),i().createElement(c.k,{size:"L",icon:u.Z,tooltipTitle:a().text("Go to previous profile"),onClick:n,disabled:o,showForDisabled:!0}),i().createElement(c.k,{size:"L",icon:d.Z,tooltipTitle:a().text("Go to next profile"),onClick:r,disabled:s,showForDisabled:!0}))};var E=n(52730),y=n(87638),v=n(17440),g=n(39450),b=n(67218);function x(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){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 I{constructor(e){var t=this;let{data:{query:n,sortField:r,sortOrder:i},tenant:l,searchTenant:a,apiPath:o,dtssPath:s,globalSearchRequestOptions:c}=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 r=[t.getQueryFilter(),...e],i=x({},t.globalSearchRequestOptions,{sort:t.sortField,order:t.sortOrder,select:"uri,label,type",scoreEnabled:!1},n);return t.isDT()?(0,p.uqV)({filters:r,options:i,customerTenant:t.tenant,dataTenant:t.searchTenant,dtssPath:t.dtssPath}):(0,p.ZOr)(r,i)},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,p.J$m)({filters:e,options:t,customerTenant:this.tenant,dataTenant:this.searchTenant,dtssPath:this.dtssPath}):(0,p.j_Q)(e,t)).then((e=>e.total))},this.query=n,this.sortField=r,this.sortOrder=i,this.tenant=l,this.searchTenant=a,this.apiPath=o,this.dtssPath=s,this.globalSearchRequestOptions=c}}function O(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){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}class w{constructor(e){var t=this;let{data:n,tenant:r,apiPath:i}=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 r=[{rawFilter:t.searchBody.filter},...e];return(0,p.P2h)({apiPath:t.apiPath,tenant:t.tenant,searchBody:O({},t.searchBody,{filter:e.length?(0,p.Uqd)()(r):t.searchBody.filter}),options:n})},this.checkEntity=e=>this.getEntities([{filter:"equals",fieldName:"id",values:[(0,p.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,p.dED)({apiPath:this.apiPath,tenant:this.tenant,searchBody:this.searchBody}).then((e=>e.count)),this.searchBody=n,this.tenant=r,this.apiPath=i}}const S=(e,t)=>(0,v.pipe)((0,v.map)((0,v.prop)("uri")),(0,v.reject)((e=>t.includes(e))))(e),C=()=>{const{total:e,onPrev:t,onNext:n,onSearchResultsClick:l,isPrevDisabled:a,isNextDisabled:o}=(()=>{const e=(0,b._)(),t=(0,b._)(),n=(0,b._)(),{uri:i,index:l,total:a,tenant:o,cache:s}=(0,E.useSelector)(y.ZP.selectors.getSearchNavigationData)||{},{type:c,data:u}=(0,E.useSelector)(y.ZP.selectors.getSearchProviderData)||{},d=(0,E.useSelector)(y.ZP.selectors.getTenant),h=(0,E.useSelector)(y.ZP.selectors.getApiPath),f=(0,E.useSelector)(y.ZP.selectors.getDtssPath),m=(0,E.useSelector)((e=>y.ZP.selectors.getGlobalSearchRequestOptions(e,["ovOnly"]))),v=(0,r.useContext)(g.m),x=(0,E.useDispatch)(),[T,O]=(0,r.useState)(!1),N=(0,r.useMemo)((()=>((e,t)=>{switch(e){case"search":return new I(t);case"graphsearch":return new w(t)}})(c,{data:u,tenant:d,searchTenant:o,apiPath:h,dtssPath:f,globalSearchRequestOptions:m})),[c,u,d,o,h,f,m]),C=(0,r.useCallback)((e=>{x(y.yC.actions.updateSearchNavigationDataFields(e))}),[x]),P=(0,r.useCallback)((e=>{const t=d!==o?(0,p.wwR)({uri:e,dataTenant:o}):e;x(y.ui.actions.openEntity({uri:t,viewId:v,source:"navigation"}))}),[x,v,d,o]),D=(0,r.useCallback)((()=>{x(y.ui.actions.openPerspective({perspectiveId:c,viewId:v}))}),[x,c,v]);(0,r.useEffect)((()=>{l>=a?C({index:a-1}):l<0&&C({index:0})}),[a,l,C]);const R=(0,r.useCallback)(((e,r,i)=>{O(!0),t(N.requestTotal()).then((e=>C({total:e})));const l=i+1;return n(N.requestEntities(15,l)).then((t=>{if(t){if(t.length){const n=S(t,e);if(n.length>0)return C({cache:e.concat(n),uri:n[0],index:l+t.length-n.length}),void P(n[0]);if(i+t.length<r-1)return R(e,r-t.length,i+t.length)}C({index:l})}})).finally((()=>{O(!1)}))}),[N,C,P]),k=(0,r.useCallback)(((e,r)=>{O(!0),t(N.requestTotal()).then((e=>C({total:e})));const i=r-1,l=Math.max(0,r-15),a=15+Math.min(0,r-15);return n(N.requestEntities(a,l)).then((t=>{if(t){if(t.length){const n=S(t,e);if(n.length>0)return C({cache:n.concat(e),uri:n[n.length-1],index:i-(t.length-n.length)}),void P(n[n.length-1]);if(r-t.length>0)return k(e,r-t.length)}C({index:0})}})).finally((()=>{O(!1)}))}),[N,C,P]),M=(0,r.useCallback)(((t,n,r,i)=>{if(n<t.length){const l=t[n];return O(!0),e(N.checkEntity(l)).then((e=>{if(!e){const e=[...t];return e.splice(n,1),M(e,n,r-1,i)}C({index:i+1,uri:l,cache:t,total:r}),P(l)})).finally((()=>{O(!1)}))}if(!(i>=r-1))return R(t,r,i);C({cache:t,total:r,index:r-1})}),[N,C,P,R]),_=(0,r.useCallback)(((t,n,r,i)=>{if(n>-1){const l=t[n];return O(!0),e(N.checkEntity(l)).then((e=>{if(!e){const e=[...t];return e.splice(n,1),_(e,n-1,r-1,i-1)}C({index:i-1,uri:l,cache:t,total:r}),P(l)})).finally((()=>{O(!1)}))}if(!(i<=0))return k(t,i);C({index:0,cache:t,total:r})}),[N,C,P,k]),L=(0,r.useCallback)((()=>{if(s&&i){const e=s.indexOf(i)-1;_(s,e,a,l)}}),[_,s,i,a,l]),A=(0,r.useCallback)((()=>{if(s&&i){const e=s.indexOf(i)+1;M(s,e,a,l)}}),[M,s,i,a,l]);return{total:a,onPrev:L,onNext:A,onSearchResultsClick:D,isPrevDisabled:T||l<=0,isNextDisabled:T||l>=a-1}})();return(()=>{const{cache:e}=(0,E.useSelector)(y.ZP.selectors.getSearchNavigationData)||{},t=(0,E.useSelector)(y.ZP.selectors.getMode),n=(0,E.useSelector)(y.ZP.selectors.getEntity);return(0,p.uzs)(t)&&(null==e?void 0:e.includes(null==n?void 0:n.uri))})()?i().createElement(m,{total:e,onPrev:t,onNext:n,onSearchResultsClick:l,isPrevDisabled:a,isNextDisabled:o}):null}},10159:(e,t,n)=>{n.d(t,{Z:()=>c});var r=n(24328),i=n.n(r),l=n(94079);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 o=e=>i().createElement("svg",a({width:256,height:256,viewBox:"0 0 256 256",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),i().createElement("circle",{cx:128,cy:128,r:128,fill:"#0072CE",fillOpacity:.1}),i().createElement("mask",{id:"AttributesList_svg__a",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:0,y:0,width:256,height:256},i().createElement("circle",{cx:128,cy:128,r:128,fill:"#fff"})),i().createElement("g",{mask:"url(#AttributesList_svg__a)"},i().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M-16 9h256v247H-16V9z",fill:"url(#AttributesList_svg__b)"}),i().createElement("path",{opacity:.05,fillRule:"evenodd",clipRule:"evenodd",d:"M187.761 56.865l58.639 58.639v148.871H93.383L52 225.083V56.865h135.761z",fill:"url(#AttributesList_svg__c)"}),i().createElement("path",{opacity:.06,fillRule:"evenodd",clipRule:"evenodd",d:"M47 58h202a7 7 0 017 7v157a7 7 0 01-7 7H47a7 7 0 01-7-7V65a7 7 0 017-7z",fill:"#000"}),i().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M50 56h201a5 5 0 015 5v157a5 5 0 01-5 5H50a5 5 0 01-5-5V61a5 5 0 015-5z",fill:"#fff"}),i().createElement("path",{opacity:.8,fillRule:"evenodd",clipRule:"evenodd",d:"M105.376 72.635a3 3 0 013-3H150a3 3 0 110 6h-41.624a3 3 0 01-3-3z",fill:"#B6C7DB"}),i().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M105 84.635a3 3 0 013-3h64.205a3 3 0 110 6H108a3 3 0 01-3-3z",fill:"#979797"}),i().createElement("path",{opacity:.8,fillRule:"evenodd",clipRule:"evenodd",d:"M105.376 163a3 3 0 013-3H150a3 3 0 110 6h-41.624a3 3 0 01-3-3z",fill:"#B6C7DB"}),i().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M105 175a3 3 0 013-3h64.205a3 3 0 110 6H108a3 3 0 01-3-3z",fill:"#979797"}),i().createElement("path",{opacity:.8,fillRule:"evenodd",clipRule:"evenodd",d:"M105.376 193a3 3 0 013-3H190a3 3 0 110 6h-81.624a3 3 0 01-3-3z",fill:"#B6C7DB"}),i().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M105 205a3 3 0 013-3h74.205a3 3 0 110 6H108a3 3 0 01-3-3z",fill:"#979797"}),i().createElement("path",{opacity:.8,fillRule:"evenodd",clipRule:"evenodd",d:"M138.376 103a3 3 0 013-3H223a3 3 0 110 6h-81.624a3 3 0 01-3-3z",fill:"#B6C7DB"}),i().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M138 115a3 3 0 013-3h64.205a3 3 0 110 6H141a3 3 0 01-3-3z",fill:"#979797"}),i().createElement("circle",{cx:67,cy:79,r:9,fill:"#B6C7DB"}),i().createElement("circle",{cx:67,cy:79,r:9,fill:"#B6C7DB"}),i().createElement("circle",{cx:120,cy:106,r:6,fill:"#B6C7DB"}),i().createElement("circle",{cx:120,cy:136,r:6,fill:"#B6C7DB"}),i().createElement("circle",{cx:67,cy:169,r:9,fill:"#B6C7DB"}),i().createElement("circle",{cx:67,cy:199,r:9,fill:"#B6C7DB"}),i().createElement("path",{opacity:.8,fillRule:"evenodd",clipRule:"evenodd",d:"M138.376 133a3 3 0 013-3H223a3 3 0 110 6h-81.624a3 3 0 01-3-3z",fill:"#B6C7DB"}),i().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M138 145a3 3 0 013-3h74.205a3 3 0 110 6H141a3 3 0 01-3-3z",fill:"#979797"}),i().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M92.514 108v-8h-2v40.365h11.178v-2h-9.178V110h9.178v-2h-9.178z",fill:"#2B98F0"}),i().createElement("path",{opacity:.54,fillRule:"evenodd",clipRule:"evenodd",d:"M95.071 77l-3.535 3.535L88 77h7.071z",fill:"#000"}),i().createElement("path",{opacity:.6,fillRule:"evenodd",clipRule:"evenodd",d:"M50 22h186a6 6 0 016 6v18a6 6 0 01-6 6H50a6 6 0 01-6-6V28a6 6 0 016-6z",fill:"#fff"}),i().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M58 37a6 6 0 016-6h70a6 6 0 110 12H64a6 6 0 01-6-6zm90 0a6 6 0 016-6h10a6 6 0 110 12h-10a6 6 0 01-6-6z",fill:"#979797"})),i().createElement("defs",null,i().createElement("linearGradient",{id:"AttributesList_svg__b",x1:-16,y1:9,x2:-16,y2:256,gradientUnits:"userSpaceOnUse"},i().createElement("stop",{stopColor:"#FAFAFA",stopOpacity:.01}),i().createElement("stop",{offset:1,stopColor:"#F4F4F4"})),i().createElement("linearGradient",{id:"AttributesList_svg__c",x1:266.117,y1:181.111,x2:154.882,y2:77.681,gradientUnits:"userSpaceOnUse"},i().createElement("stop",{stopOpacity:.01}),i().createElement("stop",{offset:1})))),s=(0,n(79692).Z)((e=>({root:{display:"flex",flex:"1 1 auto",flexWrap:"nowrap",flexDirection:"column",alignItems:"center",justifyContent:"center",overflow:"auto",height:"100%",minHeight:"350px",boxSizing:"border-box",padding:"40px"},logo:{width:"190px",height:"190px"},textBox:{display:"flex",flexDirection:"column",alignItems:"center",maxWidth:400,marginTop:"24px"},text:{color:e.palette.text.primary,fontSize:"20px",fontWeight:500,lineHeight:"23px",textAlign:"center"},secondaryText:{color:e.palette.text.primary,fontSize:"14px",fontWeight:"normal",lineHeight:"16px",letterSpacing:"0.24px",textAlign:"center",paddingTop:"8px"}}))),c=e=>{let{IconRenderer:t=o,text:n,secondaryText:r}=e;const a=s();return i().createElement("div",{className:a.root},i().createElement(t,{className:a.logo}),i().createElement("div",{className:a.textBox},i().createElement(l.Typography,{className:a.text},n),r&&i().createElement(l.Typography,{className:a.secondaryText},r)))}},91515:(e,t,n)=>{n.d(t,{Z:()=>Q});var r=n(24328),i=n.n(r),l=n(87918),a=n.n(l),o=n(94079),s=n(17440),c=n(51229),u=n(36444),d=n(22385),p=n(48465),h=n(85451),f=n(27815),m=n(71153),E=n.n(m),y=n(31517),v=n(67885);const g=[v.K.WITHIN,v.K.AGO,v.K.BETWEEN],b=e=>({[v.K.WITHIN]:a().text("Within the last"),[v.K.AGO]:a().text("More than"),[v.K.BETWEEN]:a().text("Date range")}[e]||"");var x=n(39621),T=n(20562),I=n(51843),O=n(79692);const N=(0,O.Z)({root:{flex:1},title:{paddingBottom:"10px",paddingLeft:"5px",fontSize:"14px"},intervalContainer:{display:"flex",justifyContent:"space-between"},typeInput:{width:160,marginRight:10}}),w=[null,null],S=[null,"hours"],C=e=>{let{value:t,onChange:n,className:l}=e;const s=N(),c=e=>e===v.K.WITHIN||e===v.K.AGO,u=e=>e===v.K.BETWEEN,d=u(null==t?void 0:t.type)?t.period:w,p=c(null==t?void 0:t.type)?t.period:S,[h,f]=(0,r.useState)(d),[m,O]=(0,r.useState)(p),C=(null==t?void 0:t.type)||v.K.WITHIN,P=e=>c(e)?m:u(e)?h:void 0,D=e=>{n({type:C,period:e})};return(0,T.D)((()=>{t?c(t.type)?O(t.period):u(t.type)&&f(t.period):(f(w),O(S))}),[t]),i().createElement("div",{className:E()(s.root,l)},i().createElement(o.Typography,{className:s.title,variant:"subtitle1"},a().text("Date")),i().createElement("div",{className:s.intervalContainer},i().createElement(y.Z,{label:"",className:s.typeInput,value:{value:C,label:b(C)},options:g.map((e=>({value:e,label:b(e)}))),onChange:e=>{let{value:r}=e;(null==t?void 0:t.type)!==r&&n({period:P(r),type:r})}}),c(C)?i().createElement(x.Z,{interval:m,onChange:D}):i().createElement(I.Z,{values:h,onChange:D})))};var P=n(92575),D=n(96808),R=n(65942);const k=[R.M.UPDATE,R.M.MERGE,R.M.UNMERGE];function M(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,t,n[t])}))}return e}function _(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={input:e=>M({},e,{fontSize:"14px"}),menuPortal:e=>M({},e,{zIndex:1300})},A=(0,O.Z)({root:{flex:1},title:{paddingBottom:"10px",paddingLeft:"5px",fontSize:"14px"},dropDownInput:{width:"100%",justifyContent:"center",backgroundColor:"rgba(0, 0, 0, 0.03)",borderTop:"4px"},valueContainer:{overflowY:"auto",height:44},option:{fontSize:"14px",height:"32px"}}),j=e=>{let{selectedHistoryActivityTypes:t,onChange:n,className:r}=e;const l=A(),c=e=>{return{value:e,label:(t=e,{[R.M.UPDATE]:a().text("Update"),[R.M.MERGE]:a().text("Merge"),[R.M.UNMERGE]:a().text("Unmerge")}[t]||"")};var t},u=e=>e.map(c),d=u(k);return i().createElement("div",{className:E()(l.root,r)},i().createElement(o.Typography,{className:l.title,variant:"subtitle1"},a().text("Activity")),i().createElement(P.Z,{value:u(t),onChange:(0,s.pipe)((0,s.defaultTo)([]),(0,s.pluck)("value"),n),options:d,TextFieldProps:{classes:{root:l.dropDownInput}},components:{DropdownIndicator:D.Z},styles:L,classes:l,menuPlacement:"bottom",menuPortalTarget:document.body}))},F=(0,O.Z)({popup:{width:500,height:500,overflowY:"hidden",display:"flex",flexDirection:"column"},filterContainer:{padding:20,height:410,display:"flex",flexDirection:"column"},filterContainerScrollable:{overflowY:"auto"},filterItem:{marginTop:15},filterControls:{display:"flex",padding:"10px 12px 0",borderTop:"solid 1px rgba(0, 0, 0, 0.12)"},clearButton:{marginRight:"auto"},input:{height:"100%",paddingLeft:"12px",paddingRight:"8px"}});function G(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const H=e=>{let{className:t,filter:n,onApplyFilter:l,onClearFilter:c,entityType:m}=e;const E=F(),[y,v]=(0,r.useState)(null),g=()=>v(null),[b,x]=(0,r.useState)(n);(0,r.useEffect)((()=>{x(n)}),[n]);const T=(0,s.curry)(((e,t)=>{x((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){G(e,t,n[t])}))}return e}({},n,{[e]:t})))})),{activities:I=[],attributes:O=[],dateRange:N=null,users:w=[]}=b||{};return i().createElement(i().Fragment,null,i().createElement(d.Z,{icon:u.Z,size:"L",onClick:e=>v(e.currentTarget),className:t}),i().createElement(o.Popover,{classes:{paper:E.popup},open:!!y,anchorEl:y,onClose:g,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},i().createElement("div",{className:E.filterContainer},i().createElement(o.Typography,{variant:"h6"},a().text("Filter")),i().createElement("div",{className:E.filterContainerScrollable},i().createElement(C,{value:N,onChange:T("dateRange"),className:E.filterItem}),i().createElement(h.Z,{selectedUsers:w,onChange:T("users"),className:E.filterItem}),i().createElement(j,{selectedHistoryActivityTypes:I,onChange:T("activities"),className:E.filterItem}),i().createElement(f.Z,{selectedAttributes:O,entityType:m,onChange:T("attributes"),className:E.filterItem,title:a().text("Attribute updated")}))),i().createElement("div",{className:E.filterControls},i().createElement(o.Button,{onClick:c,className:E.clearButton},a().text("Clear all")),i().createElement(o.Button,{onClick:g},a().text("Cancel")),i().createElement(o.Button,{color:"primary",onClick:()=>{N&&(0,p.R)(N)?l(b):l((0,s.dissoc)("dateRange",b)),g()}},a().text("Apply")))))};var Z=n(52730),B=n(43054),U=n(87638),z=n(55847),$=n(98281),K=n(31276);const W=(0,O.Z)({menuItem:{minHeight:"32px"},menuText:{fontSize:"13px",lineHeight:"15px",letterSpacing:0,marginLeft:"30px"},checkIcon:{position:"absolute",color:"rgba(0, 0, 0, 0.54)"}}),q=(0,r.forwardRef)(((e,t)=>{let{item:n,onMenuClose:r=K.ZT}=e;const l=W(),{text:a,selected:s,onClick:c}=n;return i().createElement(o.MenuItem,{classes:{root:l.menuItem},onClick:e=>{r(),c(e)},ref:t},s&&i().createElement($.Z,{className:l.checkIcon}),i().createElement(o.Typography,{classes:{root:l.menuText}},a))}));q.displayName="MenuItemRenderer";const Y=q,V=()=>{const e=(0,Z.useSelector)(U.ZP.selectors.getHistoryMode),t=(0,Z.useDispatch)(),n=e=>{t(U.N5.history.actions.setHistoryMode(e))},r=[{text:a().text("Compare to Current view"),selected:e===U.Z9.Current,onClick:()=>n(U.Z9.Current)},{text:a().text("Compare to Previous view"),selected:e===U.Z9.Previous,onClick:()=>n(U.Z9.Previous)}];return i().createElement(z.Z,{MenuItemRenderer:Y,buttonComponent:d.Z,buttonProps:{icon:B.Z,size:"L"},menuId:"history-menu",menuItems:r})},X=(0,O.Z)({root:{display:"flex",flex:1,alignItems:"center"},icon:{margin:4},divider:{backgroundColor:"rgba(0,0,0,0.12)",margin:"3px 19px"},count:{fontSize:14},filterButton:{marginRight:"-4px"}}),Q=e=>{let{total:t,entityType:n,filter:r,onApplyFilter:l,onClearFilter:u}=e;const d=X();return i().createElement("div",{className:d.root},i().createElement(o.Typography,{variant:"h6"},a().text("History")),!(0,s.isNil)(t)&&i().createElement(i().Fragment,null,i().createElement(o.Divider,{orientation:"vertical",flexItem:!0,className:d.divider}),i().createElement(o.Typography,{variant:"body1",color:"textSecondary",className:d.count},1===t?a().text("${count} contributing profile",{count:t}):a().text("${count} contributing profiles",{count:t}))),i().createElement(c.Z,null),i().createElement(H,{className:d.filterButton,entityType:n,filter:r,onApplyFilter:l,onClearFilter:u}),i().createElement(V,null))}},6674:(e,t,n)=>{n.d(t,{Z:()=>s});var r=n(24328),i=n.n(r),l=n(87918),a=n.n(l),o=n(10159);const s=()=>i().createElement(o.Z,{text:a().text("History in the making"),secondaryText:a().text("When you create an event or perform an activity, it will show up here.")})},54362:(e,t,n)=>{n.d(t,{Z:()=>F});var r=n(24328),i=n.n(r),l=n(52730),a=n(44443),o=n(87918),s=n.n(o),c=n(17440),u=n(71153),d=n.n(u),p=n(99493),h=n(87638),f=n(94079),m=n(34606),E=n(79692);const y=(0,E.Z)((()=>({historyRow:{position:"relative",padding:"8px 12px 16px",cursor:"pointer"},selected:{background:"rgba(0,0,0,0.05)","&:before":{content:'""',background:"rgba(0,0,0,0.05)",width:"100%",height:"100%",position:"absolute",left:"-100%",top:0}},rowHeader:{display:"flex",position:"relative"},badge:e=>{let{color:t}=e;return{position:"absolute",width:"2px",height:"100%",left:"-9px",pointerEvents:"none",background:t,"&:before":{height:"100%",width:"3px",content:'""',left:"-3px",background:t,position:"absolute",opacity:.06}}},title:{color:"rgba(0,0,0,0.87)",fontSize:"13px",letterSpacing:0,lineHeight:"16px",fontWeight:400,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap","&.bold":{fontWeight:500}},date:{marginLeft:"auto",color:"rgba(0,0,0,0.54)",fontSize:"11px",letterSpacing:0,lineHeight:"16px"},user:{color:"rgba(0,0,0,0.38)",fontSize:"12px",letterSpacing:0,lineHeight:"14px"}}))),v=e=>{let{change:t,isCurrent:n,isSelected:r,onClick:l}=e;const{uri:a,type:o,matchGroups:c,user:u,timestamp:h}=t,E=(0,p.GtP)(a),v=y({color:E});return i().createElement("div",{className:d()(v.historyRow,{[v.selected]:r}),onClick:l},i().createElement("div",{className:v.rowHeader},i().createElement("div",{className:v.badge}),i().createElement(f.Typography,{className:d()(v.title,{bold:n})},n?s().text("Current view"):(0,m.Xr)(o)),!n&&i().createElement(f.Typography,{className:v.date},s().date(h,"L LT"))),c&&i().createElement(f.Typography,{className:v.title},s().text("Match rule:")," ",c.join(", ")),i().createElement(f.Typography,{className:v.user},u))};var g=n(55912);const b=e=>e===g.b.FAKE_FILTERED_INCOMING||e===g.b.FAKE_FILTERED_OUTGOING,x=e=>{let{x:t,y:n,toX:r,toY:l,color:a,isDashed:o}=e;const s=((e,t,n,r)=>{const i=t>r,l=e<n,a=i?-6:6;return`M${e} ${t} L${l?n-12:n+12} ${t} ${l?`c 6 0 12 ${a} 12`:`c -6 0 -12 ${a} -12`} ${i?-12:12} L${n} ${r}`})(t,n,r,l);return i().createElement("path",{d:s,stroke:a,strokeWidth:2,fill:"none",strokeDasharray:o?"3,3":void 0})};function T(){return T=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},T.apply(this,arguments)}const I=(0,r.forwardRef)(((e,t)=>{let{x:n,y:r,color:l,isDashed:a,isCollapsed:o,showCollapseIcon:s,showLine:c}=e,u=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},l=Object.keys(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,["x","y","color","isDashed","isCollapsed","showCollapseIcon","showLine"]);const d=s?6:3;return i().createElement("g",T({},u,{ref:t}),c&&i().createElement("rect",{id:"line",x:n-d-4,y:r-d-4,width:2*d+8,height:2,fill:l}),i().createElement("circle",{cx:n,cy:r,r:d,fill:a?"#fff":l,stroke:l,strokeDasharray:a?"1,1":void 0,strokeWidth:2}),s&&i().createElement("g",{id:"icon"},i().createElement("rect",{x:n-4,y:r-1,width:8,height:2,fill:"#fff"}),o&&i().createElement("rect",{x:n-1,y:r-4,width:2,height:8,fill:"#fff"})))}));const O=(0,n(83348).Z)(I),N=(0,r.memo)((e=>{let{graphData:t,onHistoryCircleMouseOver:n}=e;const{historyLanes:r,rows:l}=t,a=[16],{links:o,rowLines:s,circles:c}=l.reduce(((e,t,o)=>{let{uri:s,height:c,uris:u,type:d,fakeType:h,index:f,timestamp:m,label:E}=t;const y=16*r[s].index+24,v=a[o];a.push(v+c);const T=b(h),I=T?u[0]:s,N=!(null!=u&&u.some((e=>r[e])));e.circles.push(i().createElement(O,{tooltipTitle:E,tooltipPlacement:"top",onMouseOver:n?()=>n(s,m,f):void 0,key:`circle-${I}-${o}`,x:y,y:v,color:(0,p.GtP)(I),isDashed:T,isCollapsed:N,showCollapseIcon:!!u,showLine:h===g.b.FAKE_NAVIGATE_PROFILE})),e.rowLines.push(i().createElement("rect",{key:`${I}-${f}`,x:y,y:v-8,width:"100%",height:16,fill:(0,p.GtP)(I),opacity:.06}));const w=d===g.b.ENTITIES_SPLITTED;return null==u||u.forEach((t=>{const n=r[t];if(!n)return;const a=l[o].height,s=16*n.index+24,c=w?v-a:v+a;y!==s&&e.links.push(i().createElement(x,{key:`link-${t}-${f}`,x:y,y:v,toX:s,toY:c,isDashed:b(h),color:(0,p.GtP)(t)}))})),e}),{links:[],circles:[],rowLines:[]}),u=16*Object.keys(r).length+24,d=a[a.length-1]-16;return Object.entries(r).forEach((e=>{let[t,n]=e;const r=16*n.index+24;n.lifeTime.forEach(((e,s)=>{var u;let{start:d,end:h}=e;if((null===(u=l[null==h?void 0:h.index])||void 0===u?void 0:u.type)===g.b.ENTITIES_SPLITTED)return;const f=(null==d?void 0:d.type)===g.b.ENTITIES_SPLITTED?(null==d?void 0:d.index)-1:null==d?void 0:d.index,m=(null==h?void 0:h.type)===g.b.ENTITIES_MERGED_MANUALLY||(null==h?void 0:h.type)===g.b.ENTITIES_MERGED?(null==h?void 0:h.index)+1:null==h?void 0:h.index,E=a[f]||a[a.length-2],y=a[m]||16;if(E<=y)return;const v=(0,p.GtP)(t);!h&&n.index>0&&c.push(i().createElement(I,{key:`initCircle-${t}-${s}`,x:r,y,color:v,showLine:!0})),o.unshift(i().createElement("path",{key:`line-${t}-${s}`,d:`M${r} ${E} L${r} ${y}`,stroke:v,strokeWidth:2}))}))})),i().createElement("svg",{className:"chart",width:u,height:d},i().createElement("g",{id:"rowLines"},s),i().createElement("g",{id:"links"},o),i().createElement("g",{id:"circles"},c))}));var w=n(99136);const S=(0,E.Z)({historyTree:{display:"grid",gridTemplateColumns:"auto 1fr",overflowY:"auto"},graph:{overflowX:"scroll",overflowY:"hidden"},history:{minWidth:344},buttonContainer:{gridColumnStart:1,gridColumnEnd:3,padding:"8px 16px"},shadow:{boxShadow:"inset -8px 0px 5px -5px rgba(0,0,0,0.1)"}});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){P(e,t,n[t])}))}return e}function P(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const D=e=>{let{historyData:t,isLoading:n,canLoadMore:o,onLoadMore:u,entityUri:m,historyEvent:E,findPreviousChange:y}=e;const g=S(),b=(0,l.useDispatch)(),x=(0,l.useSelector)(h.ZP.selectors.getIsEditableMode),T=(0,l.useSelector)(h.ZP.selectors.getMetadata),[I,O]=(0,r.useState)({historyLanes:{},rows:[]}),[P,D]=(0,r.useState)(!1),[R,k]=(0,r.useState)(-1);(0,r.useEffect)((()=>{if((0,c.isNil)(E))return void k(0);const e=e=>(null==e?void 0:e.uri)===((null==E?void 0:E.overrideUri)||m)&&(null==e?void 0:e.timestamp)===(null==E?void 0:E.aStamp),n=-1!==R?t.rows[R]:null,r=t.rows.findIndex((t=>e(t)));k(e(n)?R:r)}),[t.rows,E]);const M=(0,r.useRef)(null),_=(0,r.useCallback)((e=>{if(!(0,c.isNil)(e)){var n;const r=null===(n=t.rows)||void 0===n?void 0:n.map(((t,n)=>{var r;return C({},t,{height:null===(r=e.childNodes[n])||void 0===r?void 0:r.clientHeight})}));O({historyLanes:t.historyLanes,rows:r})}}),[t]),L=()=>{const{scrollWidth:e,clientWidth:t,scrollLeft:n}=(null==M?void 0:M.current)||{};D(n<e-t)};return i().createElement("div",{className:g.historyTree},n&&i().createElement(w.Z,null),i().createElement("div",{className:d()(g.graph,{[g.shadow]:P}),onScroll:L,ref:M},i().createElement(N,{onHistoryCircleMouseOver:(e,t,n)=>{if((0,c.isNil)(I.rows[n].label)){const r={time:t,select:"crosswalks"};(0,p.HvW)(e,r).then((e=>{let{crosswalks:t}=e;const r=t?(0,c.uniqBy)((0,c.prop)("type"),t).map((e=>{const t=(0,p.s5)(T,e.type);return t?t.label:null})).filter(c.identity).join(", "):s().text("No data");O((e=>C({},e,{rows:e.rows.map((e=>e.index===n?C({},e,{label:r}):e))})))}))}},graphData:I}),i().createElement(a.Z,{handleWidth:!0,onResize:L})),i().createElement("div",{ref:_,className:g.history},t.rows.map(((e,t)=>{const n=t===R,r=0===t;return i().createElement(v,{key:`row-${t}`,change:e,isCurrent:r,isSelected:n,onClick:()=>((e,t,n,r)=>{if(x){if(!window.confirm(s().text("Are you sure you want to go in history mode? All your changes will be lost.")))return;b(h.N5.mode.actions.modeUpdated(p.ARY.Viewing))}if(r&&!n||!r&&n)b(h.N5.history.actions.clearHistoryEvent()),k(0);else if(!r&&!n){const n=y(e-1,t.uri||m),r=y(e,t.uri||m),i=null==n?void 0:n.timestamp,l=null==r?void 0:r.timestamp,a=(null==t?void 0:t.uri)===m?null:null==t?void 0:t.uri;b(h.N5.history.actions.setHistoryEvent({aStamp:i,bStamp:l,overrideUri:a})),k(e)}})(t,e,n,r)})}))),o&&i().createElement("div",{className:g.buttonContainer},i().createElement(f.Button,{color:"primary",onClick:()=>u()},s().text("Show more"))))},R=(0,E.Z)({root:{display:"flex",flexWrap:"wrap",padding:"10px 15px"}}),k=(0,E.Z)({icon:e=>{let{color:t}=e;return{boxSizing:"border-box",borderWidth:2,borderStyle:"solid",borderColor:t,height:12,width:12,borderRadius:30,transition:"opacity 0.3s",margin:4}},active:e=>{let{color:t}=e;return{backgroundColor:t}},inactive:{backgroundColor:"white"},clickable:{cursor:"pointer"}}),M=e=>{let{value:t,isSelected:n=!0,onClick:r}=e;const l=(0,p.GtP)(t),a=k({color:l});return i().createElement("div",{className:d()(a.icon,{[a.inactive]:!n,[a.active]:n,[a.clickable]:!!r}),onClick:r})},_=e=>{let{values:t,selectedValues:n,entityUri:r,onSelectValues:l,className:a}=e;const o=R();return i().createElement("div",{className:d()(o.root,a)},i().createElement(M,{value:r}),(null==t?void 0:t.length)>0&&t.map((e=>i().createElement(M,{key:e,value:e,isSelected:null==n?void 0:n.includes(e),onClick:()=>(e=>{null!=n&&n.includes(e)?l((0,c.without)([e],n)):l([...n||[],e])})(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 A=(e,t)=>e.reduce(((e,n,r)=>{let{start:i,end:l}=n;if(i){const n=t-i.timestamp;((0,c.isNil)(e.startDistance)||Math.abs(e.startDistance)>Math.abs(n)&&n>0)&&(e.startIndex=r,e.startDistance=n)}if(l){const n=t-l.timestamp;((0,c.isNil)(e.endDistance)||Math.abs(e.endDistance)>Math.abs(n)&&n<0)&&(e.endIndex=r,e.endDistance=n)}return e}),{startIndex:null,endIndex:null,startDistance:null,endDistance:null}),j=(0,E.Z)({root:{display:"flex",flexDirection:"column",overflow:"hidden",position:"relative",height:"100%"},borderBottom:{borderBottom:"1px solid rgba(0, 0, 0, 0.12)"}}),F=(0,r.memo)((e=>{let{isLoading:t,historyWithTotal:n,contributorsUris:l,entityUri:a,canLoadMore:o,onLoadMore:s,historyEvent:u}=e;const d=j(),[p,h]=(0,r.useState)(null);(0,r.useEffect)((()=>{h(l)}),[l]);const{historyData:f,findPreviousChange:m}=(e=>{let{entityUri:t,historyChanges:n,selectedUris:i}=e;return(0,r.useMemo)((()=>{const e={[t]:{index:0,lifeTime:[]}},r=[{user:"",timestamp:0,uri:t}],l=(0,c.curry)(((e,n,r)=>{const i=r.uri||t;if(e)if(Array.isArray(e)){if(r.type!==g.b.ENTITY_LOST_MERGE)return null;if(e.includes(i))return r;if(n&&r.uris)return e.some((e=>r.uris.includes(e)))?r:null}else{var l;if(i===e||n&&null!==(l=r.uris)&&void 0!==l&&l.includes(e))return r}return null})),a=(e,t,r)=>(0,c.pipe)((0,c.drop)(e+1),(0,c.find)(l(t,r)))(n),o=t=>(e[t]||i&&!i.includes(t)||(e[t]={index:Object.keys(e).length,lifeTime:[]}),e[t]),s=(e,t)=>{const n=e[e.length-1];!n||n.start&&(n.start.type!==g.b.ENTITY_CREATED||t.type!==g.b.ENTITIES_SPLITTED)?e.push({start:t,end:null}):n.start=t},u=(e,t)=>{let n=!0;if(e.length){const r=e[e.length-1];n=!((!r.start||r.start.timestamp<t.timestamp)&&(!r.end||r.end.timestamp>t.timestamp))}n&&e.push({start:null,end:null})},d=(e,t)=>{if(e.length){const n=e[e.length-1];n.start||(n.start=t)}e.push({start:null,end:t})},p=[];return null==n||n.forEach(((n,i)=>{var l;switch(n.type){case g.b.ENTITIES_SPLITTED:if(!a(i,n.uri||t,!1))return;{const e=n.uri,t=n.uris?[n.uris,e]:[e],r=a(i,t,!0);if(r&&(!e||e===r.uri))return}break;case g.b.ENTITY_LOST_MERGE:case g.b.RELATIONSHIP_CREATED:case g.b.RELATIONSHIP_REMOVED:case g.b.RELATIONSHIP_CHANGED:return}let c=!1;null===(l=n.uris)||void 0===l||l.forEach((e=>{o(e)||(c=!0)}));const h=o(n.uri||t);if(!h)return;const f=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){L(e,t,n[t])}))}return e}({},n);((t,n)=>{var i,l;switch(n.type){case g.b.ENTITY_CREATED:s(t,n);break;case g.b.ENTITIES_MERGED_ON_THE_FLY:case g.b.ENTITY_CHANGED:u(t,n);break;case g.b.ENTITY_LOST_MERGE:case g.b.ENTITY_REMOVED:d(t,n);break;case g.b.ENTITIES_SPLITTED:u(t,n),null===(i=n.uris)||void 0===i||i.forEach((t=>{const i=e[t];if(!i)return;const l=i.lifeTime.length;l?s(i.lifeTime,n):d(i.lifeTime,n),r.push({uri:t,user:n.user,type:n.type,fakeType:l?g.b.FAKE_UPDATE:g.b.FAKE_NAVIGATE_PROFILE,timestamp:n.timestamp})}));break;case g.b.ENTITIES_MERGED:case g.b.ENTITIES_MERGED_MANUALLY:u(t,n),null===(l=n.uris)||void 0===l||l.forEach((t=>{const r=e[t];r&&d(r.lifeTime,n)}))}})(h.lifeTime,f),c&&p.push(f),r.push(f)})),p.forEach((t=>{t.uris.forEach((i=>{e[i]||n.forEach((n=>{let{uri:l,uris:a,timestamp:o,user:s,type:u}=n;l===i&&(null==a||a.forEach((n=>{const i=e[n];if(!i)return;let l=null;switch(u){case g.b.ENTITIES_MERGED:case g.b.ENTITIES_MERGED_MANUALLY:l=g.b.FAKE_FILTERED_INCOMING;break;case g.b.ENTITIES_SPLITTED:l=g.b.FAKE_FILTERED_OUTGOING;break;default:return}const a={fakeType:l,uri:t.uri,uris:[n],type:u,user:s,timestamp:o},d=A(i.lifeTime,t.timestamp);l===g.b.FAKE_FILTERED_INCOMING?(0,c.isNil)(d.endIndex)||(i.lifeTime[d.endIndex].end=a):(0,c.isNil)(d.startIndex)||(i.lifeTime[d.startIndex].start=a),r.splice(r.indexOf(t),0,a)})))}))}))})),r.forEach(((e,n)=>{e.index=n,e.uri=e.uri||t})),{historyData:{historyLanes:e,rows:r},findPreviousChange:(e,t)=>(0,c.pipe)((0,c.slice)(e+1,1/0),(0,c.find)(l(t,!1)))(r)}}),[t,n,i])})({entityUri:a,historyChanges:null==n?void 0:n.changes,selectedUris:p});return i().createElement("div",{className:d.root},i().createElement(_,{values:l,selectedValues:p,onSelectValues:h,entityUri:a,className:d.borderBottom}),i().createElement(D,{historyData:f,isLoading:t,onLoadMore:s,canLoadMore:o,entityUri:a,historyEvent:u,findPreviousChange:m}))}))},3409:(e,t,n)=>{n.d(t,{Z:()=>p});var r=n(24328),i=n.n(r),l=n(52730),a=n(87638),o=n(94079),s=n(17440),c=n(87918),u=n.n(c);const d=(0,n(79692).Z)({root:{display:"flex",alignItems:"flex-start"},slice:{fontWeight:500},cancelButton:{width:"88px",flexShrink:0,marginLeft:"15px"}}),p=()=>{const e=d(),t=(0,l.useSelector)(a.ZP.selectors.getHistoryEvent),n=(0,l.useDispatch)(),r=(0,s.pipe)(a.N5.history.actions.clearHistoryEvent,n);return t?i().createElement("div",{className:e.root},i().createElement(o.Typography,{component:"div"},u().text("You are viewing a historic slice:")," ",i().createElement("span",{className:e.slice},u().date(t.aStamp,"llll"))),i().createElement(o.Button,{className:e.cancelButton,variant:"contained",color:"primary",onClick:r},u().text("Cancel"))):null}},85890:(e,t,n)=>{n.d(t,{k:()=>d});var r=n(24328),i=n(99493),l=n(65942),a=n(48465),o=n(67218);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={activities:[l.M.MERGE,l.M.UNMERGE,l.M.UPDATE]},d=e=>{let{entity:t,enabled:n}=e;const[l,c]=(0,r.useState)(u),[d,p]=(0,r.useState)(0),h=(0,r.useMemo)((()=>(0,a.Z)(l)),[l]),[f,m]=(0,r.useState)(null),[E,y]=(0,r.useState)(null),[v,g]=(0,r.useState)(!1),b=(0,o._)(),x=null==t?void 0:t.uri,T={max:32,order:"desc"},I=(0,i.O27)(null==l?void 0:l.attributes)||void 0;(0,r.useEffect)((()=>{x&&n&&(g(!0),b((0,i.kgP)(s({entityUri:x,historicUris:f,filter:h,showAll:I},T))).then(y).catch((e=>{console.warn("Failed to load history data",e),y(null)})).finally((()=>{g(!1)})))}),[h,I,f]),(0,r.useEffect)((()=>{x&&n&&(g(!0),b((0,i.wdF)({entityUri:x})).then((e=>{m(e)})).catch((e=>{console.warn("Failed to load history data",e),m(null)})).finally((()=>{g(!1)})),p(0))}),[x,null==t?void 0:t.updatedTime,n]);const O=(0,r.useCallback)((e=>{x&&f&&n&&(g(!0),b((0,i.kgP)(s({entityUri:x,historicUris:f,filter:h,showAll:I,offset:e},T))).then((e=>{y((t=>s({},t,{changes:[...null==t?void 0:t.changes,...e.changes]})))})).catch((e=>{console.warn("Failed to load history data",e)})).finally((()=>{g(!1)})))}),[f,h,n]),N=(0,r.useMemo)((()=>32*(d+1)<(null==E?void 0:E.total)),[E,d]),w=(0,r.useCallback)((e=>{p(0),c(e)}),[]),S=(0,r.useCallback)((()=>{w(s({},u))}),[]),C=(0,r.useCallback)((()=>{N&&(O(32*(d+1)),p(d+1))}),[O,d,N]);return{isLoading:v,canLoadMore:N,onLoadMore:C,onApplyFilter:w,onClearFilter:S,historicUris:f,historyWithTotal:E,historyFilter:l}}},71820:(e,t,n)=>{n.d(t,{C:()=>l});var r=n(24328),i=n(99493);const l=e=>{let{isHistoryTabActive:t,entity:n}=e;const[l,a]=(0,r.useState)(!1),o=null==n?void 0:n.uri;(0,r.useEffect)((()=>{t||a(!1)}),[o]),(0,r.useEffect)((()=>{t&&a(!0)}),[t]);const s=o&&!(0,i.ZiX)(o)&&!(0,i.biM)(n);return{isHistoryEnabled:l&&s,isProfilePersisted:s}}},57730:(e,t,n)=>{n.d(t,{a:()=>s});var r=n(24328),i=n(52730),l=n(87638),a=n(99493),o=n(67218);const s=e=>{let{entity:t,historyEvent:n}=e;const[s,c]=(0,r.useState)(!1),u=(0,i.useSelector)(l.ZP.selectors.getHistorySlice),d=(0,i.useDispatch)(),p=(0,o._)(),{aStamp:h,bStamp:f,overrideUri:m}=n||{},E=m||(null==t?void 0:t.uri);return(0,r.useEffect)((()=>{n&&E&&(c(!0),p(Promise.all([(0,a.lrH)(E,h),f&&1!==f?(0,a.lrH)(E,f):Promise.resolve(null)])).then((e=>{let[t,n]=e;d(l.N5.history.actions.setHistorySlice({aEntity:t,bEntity:n}))})).catch((e=>{console.warn("Failed to load entity slice",e)})).finally((()=>{c(!1)})))}),[h,f,E]),{isLoading:s,historySlice:u}}},55912:(e,t,n)=>{n.d(t,{b:()=>a});var r,i=n(31537);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}!function(e){e.FAKE_NAVIGATE_PROFILE="FAKE_NAVIGATE_PROFILE",e.FAKE_FILTERED_INCOMING="FAKE_FILTERED_INCOMING",e.FAKE_FILTERED_OUTGOING="FAKE_FILTERED_OUTGOING",e.FAKE_UPDATE="FAKE_UPDATE"}(r||(r={}));const 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){l(e,t,n[t])}))}return e}({},i.I,r)},65942:(e,t,n)=>{let r;n.d(t,{M:()=>r}),function(e){e.UPDATE="UPDATE",e.MERGE="MERGE",e.UNMERGE="UNMERGE"}(r||(r={}))},48465:(e,t,n)=>{n.d(t,{Z:()=>f,R:()=>m});var r=n(95038),i=n.n(r),l=n(17440),a=n(99493),o=n(65942),s=n(31537),c=n(67885);const u=e=>(0,l.pipe)((0,l.map)(e),(0,l.join)(" or ")),d=e=>{const[t,n]=e;return i()().subtract(t,n).valueOf()},p=(0,l.chain)((0,l.cond)([[(0,l.equals)(o.M.MERGE),()=>[s.I.ENTITIES_MERGED,s.I.ENTITIES_MERGED_MANUALLY,s.I.ENTITIES_MERGED_ON_THE_FLY]],[(0,l.equals)(o.M.UNMERGE),()=>[s.I.ENTITIES_SPLITTED]],[(0,l.equals)(o.M.UPDATE),()=>[s.I.ENTITY_CHANGED]]])),h=(0,l.pipe)((0,l.defaultTo)([]),p,(0,l.concat)([s.I.ENTITY_CREATED,s.I.ENTITY_REMOVED,s.I.ENTITY_LOST_MERGE]),u((e=>`equals(type, '${e}')`))),f=(0,l.pipe)((0,l.defaultTo)({}),(0,l.reject)(a.O27),(0,l.evolve)({users:u((e=>`equals(user, '${(0,a.HRH)(e)}')`)),attributes:u((e=>`changes(${(0,a.HRH)(e.value)})`)),dateRange:e=>{let{type:t,period:n}=e;switch(t){case c.K.WITHIN:return`gte(timestamp, ${d(n)})`;case c.K.AGO:return`lte(timestamp, ${d(n)})`;case c.K.BETWEEN:{const[e,t]=n;return`gte(timestamp, ${e.valueOf()}) and lte(timestamp, ${i()(t).endOf("date").valueOf()})`}default:return""}}}),(0,l.over)((0,l.lensProp)("activities"),h),l.values,(0,l.reject)(a.O27),(0,l.append)("not equals(user, 'collaboration-service')"),(0,l.map)((e=>`(${e})`)),(0,l.join)(" and ")),m=e=>{if(e.type===c.K.AGO||e.type===c.K.WITHIN){const[t,n]=e.period;return"Number"===(0,l.type)(t)&&"String"===(0,l.type)(n)&&t>0}if(e.type===c.K.BETWEEN){const[t,n]=e.period;return t instanceof Date&&n instanceof Date}}},2804:(e,t,n)=>{n.d(t,{a:()=>i});var r=n(24328);const i=e=>{const[t,n]=(0,r.useState)(!1),[i,l]=(0,r.useState)({});return(0,r.useEffect)((()=>{e().then((e=>{l(e||{})})).then((e=>n(!0))).catch((e=>n(!0)))}),[]),{isLoaded:t,savedState:i}}}}]);