@reltio/segmentation 1.4.86 → 1.4.88

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.
Files changed (2) hide show
  1. package/210.bundle.js +1 -1
  2. package/package.json +5 -5
package/210.bundle.js CHANGED
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_reltio_segmentation=self.webpackChunk_reltio_segmentation||[]).push([[210],{39210:(e,t,r)=>{r.r(t),r.d(t,{ConfigureColumnsButton:()=>kd,DEFAULT_SEARCH_SELECT:()=>K.Tv,EntitiesTableWithConfigurableColumns:()=>gg,EntityAvatar:()=>A,ROWS_PER_PAGE_OPTIONS:()=>K.Tu,buildQueryForAdvancedSearchGroups:()=>Ba.Jk,buildSelectFromColumns:()=>Pi.vw,collectSpecialColumns:()=>Pi.oX,createRecentSearch:()=>Cs,default:()=>Wq,getActiveEntityTypeTab:()=>ki.tB,getAdditionalColumns:()=>Pi.oq,getDataTenant:()=>ui.lF,getEntityTypeLabel:()=>x.getEntityTypeLabel,getEntityTypeTab:()=>ki.o4,getModule:()=>Ep,getPage:()=>ui.fx,getRowsPerPage:()=>ui.Uz,getSearchResultsMode:()=>ki.XM,getSearchUrlQuery:()=>xo.Cc,getSerializedSearchState:()=>So.Z,getTotal:()=>ui.NU,needRequestAfterColumnsChanges:()=>Pi.tU,parseSearchState:()=>_s.Z,queryBuilderHelpers:()=>n,queryBuilderSagas:()=>a,replaceSearchResultsColumns:()=>_s.f,showMoreResultsForEntityTypeAction:()=>Ja,showSavedSearchesDialogAction:()=>Ti});var n={};r.r(n),r.d(n,{PROP_NAME_FILTER:()=>xt,PROP_NAME_OPERATOR:()=>Tt,PROP_NAME_VALUES:()=>Ot,addAttributeAfter:()=>kt,changeAttributeData:()=>Lt,createGetAttributeIndex:()=>It,createGetAttributeLens:()=>Nt,createGetAttributeProp:()=>Pt,createGetAttributesLens:()=>_t,createGetGroupLens:()=>Rt,createSetAttributeProp:()=>Dt,defaultFindGroupPath:()=>At,deleteAttribute:()=>jt,duplicateAttribute:()=>Ft,getAttributeData:()=>wt,getAttributeObject:()=>St,getEmptyAttributeObject:()=>Ct,setAttributeOperator:()=>Ut,setFilter:()=>Mt,setValues:()=>Vt});var a={};r.r(a),r.d(a,{toggleQueryBuilderAttributeSelect:()=>ol});var i={};r.r(i),r.d(i,{addAttributes:()=>Eb,addDefaultValuesAction:()=>bb,addNextPageOfAttributeValues:()=>Ob,modifyAttribute:()=>vb,processNextPageOfAttributeValues:()=>xb,profileSaved:()=>Rb,removeAttribute:()=>Tb,requestNextPageOfAttributeValues:()=>Cb,runAuthoringTaskAction:()=>wb,saveDraft:()=>Ab,saveProfile:()=>Sb,validateProfile:()=>_b});var o={};r.r(o),r.d(o,{dependentLookupsEditorTouched:()=>kb,dependentLookupsEditorsBlocked:()=>Pb,dependentLookupsInitedTypeUrisAdded:()=>Db,dependentLookupsStructureSet:()=>Nb});var l={};r.r(l),r.d(l,{activityFilterUpdated:()=>Jb,globalFilterUpdated:()=>ev,keywordUpdated:()=>Kb,saveState:()=>Qb,searchResultsSet:()=>$b,setSearchNavigationData:()=>av,setSearchOptionsConfig:()=>rv,setSearchProviderData:()=>nv,updateSearchNavigationDataFields:()=>iv,updateSearchNavigationDataOnMerge:()=>ov,updateSearchOptions:()=>tv,updateState:()=>Xb});var s={};r.r(s),r.d(s,{addDashboardExternalView:()=>qv,autocloseIntervalLoaded:()=>Rv,clearNotifications:()=>Ov,closeNotification:()=>Tv,dateMaskUpdated:()=>Lv,dateTimeMaskUpdated:()=>Uv,documentationSet:()=>Gv,entityDeletionFinished:()=>Ev,errorSet:()=>Wv,keysSet:()=>Hv,localeAttributePresentationLoaded:()=>Av,localizationLoaded:()=>kv,navigateTo:()=>zv,newEntityShown:()=>hv,newUiConfigLoaded:()=>wv,numberFormatUpdated:()=>Iv,openAppFromChocolateBar:()=>Dv,openConsoleApp:()=>Nv,openDashboard:()=>Fv,openEntity:()=>fv,openGraph:()=>Pv,openHistoryEvent:()=>Mv,openNewEntityWithAuthoring:()=>Vv,openPerspective:()=>bv,openPivotingPerspective:()=>Yv,openPreviousPage:()=>Bv,openSearch:()=>jv,pathsSet:()=>xv,setPreferReact:()=>_v,setUseSharedPreferences:()=>Zv,showNotification:()=>vv,uiConfigLoaded:()=>Sv,uiPathSet:()=>Cv});var c={};r.r(c),r.d(c,{getAbsoluteImagePath:()=>Qx,getActiveErrorsForAttributesPager:()=>JO,getActivityFilter:()=>Nx,getAdminToolsPath:()=>ox,getAiAssistantEnabled:()=>Cx,getAiAssistantHistoryBufferSize:()=>Ax,getAiAssistantLimitPerDay:()=>Sx,getAiAssistantSkills:()=>wx,getAllRelationsToAddAndEdit:()=>qx,getAllRelationsToSave:()=>Zx,getAllServicesPaths:()=>bC,getAllTreesEditingConnections:()=>lC,getApiPath:()=>tx,getAttributeTypeErrors:()=>XO,getAttributesErrors:()=>QO,getAttributesPresentation:()=>lx,getAttributesSortingStrategy:()=>IS,getAuthoringByEntityType:()=>DS,getAutoCloseInterval:()=>ux,getCanSuggestAuthoring:()=>FS,getCanUserCreateWorkflowConfigJar:()=>AC,getCanUserCreateWorkflowEnvironmentConfigJar:()=>RC,getCanUserDeleteProfiles:()=>KC,getCanUserExecuteWorkflowJobs:()=>_C,getCanUserExecuteWorkflowJobsSyncBusinessProcessData:()=>IC,getCanUserExecuteWorkflowJobsTerminateProcessInstance:()=>NC,getCanUserExecuteWorkflowJobsUpdateTasks:()=>DC,getCanUserExecuteWorkflowJobsValidateTasks:()=>PC,getCanUserGetDQStatistic:()=>QC,getCanUserImportEntitiesFromDT:()=>GC,getCanUserMakeActivitiesExport:()=>WC,getCanUserMakeBulkUpdate:()=>$C,getCanUserMakeExport:()=>YC,getCanUserManageWorkflowDefinition:()=>kC,getCanUserManageWorkflowEnvironmentDefinition:()=>LC,getCanUserOpenDataLoader:()=>XC,getCanUserReadDVF:()=>JC,getCanUserReadEntitiesFromDT:()=>qC,getCanUserReadWorkflowDataTask:()=>UC,getCanUserRegisterConfigEnvironments:()=>wC,getCanUserStartProcessFromQuery:()=>ZC,getCanUserUpdateProcessInstance:()=>jC,getCanUserUpdateWorkflowDataTask:()=>FC,getCanUserViewProcessInstanceSearchQuery:()=>MC,getCanUserViewWorkflowConfigJar:()=>VC,getCanUserViewWorkflowDefinition:()=>BC,getCanUserViewWorkflowEnvironmentConfigJar:()=>zC,getCanUserViewWorkflowJobs:()=>HC,getCheckIfCanAddRelations:()=>fS,getCleanseByEntityType:()=>PS,getCollaborationPath:()=>OC,getConnectionsByViewId:()=>DO,getConnectionsTemporaryUrisForCreation:()=>jO,getConnectionsWithDraftsByViewId:()=>LO,getControlAttributes:()=>jS,getDBConnectorSideViews:()=>sS,getDVFPath:()=>xC,getDataTenants:()=>vO,getDateMask:()=>px,getDateTimeMask:()=>dx,getDependentLookupEditorState:()=>gS,getDependentLookupEditorsState:()=>mS,getDependentLookups:()=>cS,getDependentLookupsInitedTypeUris:()=>dS,getDependentLookupsStructure:()=>uS,getDependentLookupsStructureNode:()=>pS,getDocReleaseNotes:()=>SS,getDraftsForSaveByViewId:()=>UO,getDtssPath:()=>fC,getEditingOrAddingConnectionByViewIdAndRelationUri:()=>PO,getEditingOrAddingConnectionRelationObjectByViewIdAndRelationUri:()=>kO,getEntity:()=>_O,getEntityRelatedAttributesByAttributeTypeUri:()=>KO,getEntityUri:()=>IO,getEntityUriWithDataTenant:()=>NO,getEntityWithDiff:()=>hS,getEntityWithoutDiff:()=>ES,getEnvironment:()=>gC,getEnvironmentAlias:()=>yC,getEnvironmentObject:()=>CO,getExportDQPath:()=>hC,getExportPath:()=>rx,getGlobalFilter:()=>jx,getGlobalFilterQuery:()=>Fx,getGlobalFilterSavedSearchesUris:()=>Mx,getGlobalSearchRequestOptions:()=>Lx,getGoogleMapKey:()=>Ex,getHeaderColor:()=>AS,getHiddenAttributes:()=>US,getHistoryDiff:()=>zO,getHistoryEvent:()=>HO,getHistoryMode:()=>GO,getHistorySlice:()=>YO,getIcpLicenseKey:()=>bx,getImageAttributesFieldsOrder:()=>fx,getImagePath:()=>ex,getImageServicePath:()=>ix,getInitialConnection:()=>Kx,getInitialConnectionTempEntity:()=>$x,getIsAuthoringMode:()=>kS,getIsEditableMode:()=>Bx,getIsHistoryModeEnabled:()=>WO,getIsSuggestMode:()=>Hx,getIsViewMode:()=>zx,getLogo:()=>wS,getLookupAutocomplete:()=>hx,getLookups:()=>MO,getMaxValuesInResponse:()=>cx,getMetadata:()=>OO,getMlDqPath:()=>SC,getMode:()=>Vx,getModifiedEntities:()=>$O,getModifiedEntity:()=>qO,getModifiedEntityDefaultProfilePic:()=>ZO,getNotifications:()=>gx,getPivotingAttributes:()=>yx,getProfile:()=>AO,getProfileCancelNeedConfirm:()=>pC,getProfileCheckUpdate:()=>NS,getProfileErrors:()=>VO,getProfileLastLoadedTime:()=>sC,getProfileOperation:()=>cC,getProfileViews:()=>uC,getQueryEstimatorEnabled:()=>LS,getRelationToAddByViewId:()=>Wx,getRelations:()=>Yx,getRelationsToEditByViewId:()=>Gx,getRelationsViewIds:()=>BO,getReleaseVersion:()=>CS,getReltioPath:()=>ax,getRequestProviderConfiguration:()=>mx,getSearch:()=>RO,getSearchKeyword:()=>Ix,getSearchNavigationData:()=>kx,getSearchOptions:()=>Dx,getSearchProviderData:()=>Px,getSearchResults:()=>_x,getServicesPath:()=>bS,getSharedPreferencesEnabled:()=>Rx,getShowAttributeDescription:()=>_S,getShowEntityId:()=>xS,getShowSearchByOv:()=>RS,getStringifiedSearchOptions:()=>Ux,getTenant:()=>dC,getTenantName:()=>mC,getTenantObject:()=>xO,getTenants:()=>TO,getTotalByViewId:()=>FO,getTree:()=>rC,getTreeCommands:()=>iC,getTreeEditingConnection:()=>oC,getTreeRoot:()=>nC,getTreeTotal:()=>aC,getTrees:()=>tC,getUIConfig:()=>vS,getUIConfigLayout:()=>TS,getUIConfigProfile:()=>OS,getUIPath:()=>nx,getUi:()=>wO,getUiError:()=>yS,getUiNumberFormat:()=>sx,getUser:()=>SO,getUserName:()=>Jx,getUserRoles:()=>eC,getValidateReadMode:()=>Tx,getValidateReferenceEntityInReadMode:()=>xx,getValidateRelations:()=>Ox,getValidationServicePath:()=>CC,getValidationServiceSeverityLevels:()=>vx,getViewIdsForOpenRelation:()=>Xx,getWorkflowConfigurationEnabled:()=>TC,getWorkflowEnvironmentUrl:()=>vC,getWorkflowPath:()=>EC,isCollaborationEnabled:()=>eS,isCollaborationSideViewEnabled:()=>iS,isDBConnectorSideViewEnabled:()=>lS,isHistorySideViewEnabled:()=>oS,isWorkflowEnabled:()=>tS,isWorkflowSideViewEnabled:()=>aS});var u={};r.r(u),r.d(u,{authoringDcrResolved:()=>yw,authoringDraftEntitiesLoaded:()=>gw,clearEntity:()=>Ew,entityCloneRequested:()=>hw,entityCreationRequested:()=>dw,entityCreationWithAuthoringRequested:()=>mw,entityLoaded:()=>cw,entityRemoveRequested:()=>fw,loadEntity:()=>pw,setDefaultProfilePic:()=>uw});var p={};r.r(p),r.d(p,{errorDeactivated:()=>Sw,errorsSet:()=>ww});var d={};r.r(d),r.d(d,{clearHistoryDiff:()=>Dw,clearHistoryEvent:()=>kw,setHistoryDiff:()=>Nw,setHistoryEvent:()=>Pw,setHistoryMode:()=>Uw,setHistorySlice:()=>Lw});var m={};r.r(m),r.d(m,{lookupsForTypeResolved:()=>Hw,lookupsListResolved:()=>Yw,lookupsLoaded:()=>zw});var g={};r.r(g),r.d(g,{modeEditingCanceled:()=>Kw,modeUpdateRequested:()=>$w,modeUpdated:()=>Zw});var y={};r.r(y),r.d(y,{cleanseLoading:()=>iA,entityCreated:()=>tA,entityDeleted:()=>rA,modifiedEntitiesReset:()=>aA,setDefaultProfilePic:()=>nA});var f={};r.r(f),r.d(f,{addRelation:()=>vA,closeRelationEditor:()=>xA,editRelation:()=>TA,ignoreRelation:()=>bA,openRelationEditor:()=>OA,relationsLoaded:()=>fA,removeRelation:()=>EA,secondLevelRelationsLoaded:()=>hA,setInitialInfo:()=>wA,setRelationEntity:()=>SA,setRelationType:()=>CA});var h={};r.r(h),r.d(h,{hiddenAttributesReset:()=>hI,hiddenAttributesUpdated:()=>fI});var E={};r.r(E),r.d(E,{controlAttributesUpdated:()=>vI}),r(69448);var b=r(8156),v=r.n(b),T=r(78310),O=r.n(T),x=r(2396),C=r(55743),S=r.n(C),w=r(13639);const A=e=>{let{entity:t,avatarClassName:r,imageClassName:n}=e;const a=(0,w.AH)(),i=(0,w.$H)()||"",o=(0,x.getEntityImage)(a,i,t),l=(0,x.getAbsoluteImageUrl)(i,(0,x.getEntityTypeImage)(a,t.type)),s=e=>{e.target.onError=null,e.target.src=(0,x.svg2Url)('\n<svg width="400px" height="400px" viewBox="0 0 400 400" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>Group</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="Group" fill-rule="nonzero">\n <rect id="Rectangle" fill="#DFE5E9" x="0" y="0" width="400" height="400"></rect>\n <path d="M0,387.023257 L0,399.918908 L400,399.918908 L400,386.023594 C366.631,377.336524 321.866,364.269931 315.979,359.161654 C308.985,353.083704 270.481,310.508063 270.481,310.508063 L270.481,286.186267 C270.481,286.186267 284.478,266.204006 284.478,261.854473 C284.478,257.515936 285.353,246.219746 291.481,241.011503 C297.61,235.792263 311.607,211.471466 312.481,206.253226 C313.355,201.043983 319.484,188.009379 312.481,185.400259 C305.478,182.801135 307.236,173.244359 308.984,168.026119 C310.733,162.817875 319.484,139.355788 322.981,133.277838 C326.488,127.199888 312.481,108.956041 312.481,108.956041 C312.481,108.956041 294.978,80.2857109 245.975,53.3547939 C196.971,26.4138803 168.967,42.9283105 168.967,42.9283105 L161.964,60.3024507 C161.964,60.3024507 138.341,64.6409874 123.46,77.6765909 C108.589,90.7121943 99.837,106.346921 98.963,115.903698 C98.088,125.460475 103.334,159.339048 105.966,164.557289 C108.589,169.765532 112.96,185.400259 112.96,185.400259 C112.96,185.400259 108.589,183.670842 105.966,188.879085 C103.334,194.097325 112.085,218.419122 112.96,220.159535 C113.834,221.897949 114.718,238.403382 119.963,237.532676 C125.218,236.663969 130.463,251.42799 130.463,251.42799 C130.463,251.42799 143.596,271.41125 144.47,275.759783 C145.344,280.09832 147.967,307.039233 147.967,307.039233 L126.967,331.36103 L102.46,355.682827 C102.459,355.682827 34.042,375.886013 0,387.023257 Z" id="Path" fill="#B3BCC4"></path>\n <path d="M0,387.023257 L0,399.918908 L400,399.918908 L400,386.023594 C366.631,377.336524 321.866,364.269931 315.979,359.161654 C308.985,353.083704 270.481,310.508063 270.481,310.508063 L270.481,286.186267 C270.481,286.186267 284.478,266.204006 284.478,261.854473 C284.478,257.515936 285.353,246.219746 291.481,241.011503 C297.61,235.792263 311.607,211.471466 312.481,206.253226 C313.355,201.043983 319.484,188.009379 312.481,185.400259 C305.478,182.801135 307.236,173.244359 308.984,168.026119 C310.733,162.817875 319.484,139.355788 322.981,133.277838 C326.488,127.199888 312.481,108.956041 312.481,108.956041 C312.481,108.956041 294.978,80.2857109 245.975,53.3547939 C196.971,26.4138803 168.967,42.9283105 168.967,42.9283105 L161.964,60.3024507 C161.964,60.3024507 138.341,64.6409874 123.46,77.6765909 C108.589,90.7121943 99.837,106.346921 98.963,115.903698 C98.088,125.460475 103.334,159.339048 105.966,164.557289 C108.589,169.765532 112.96,185.400259 112.96,185.400259 C112.96,185.400259 108.589,183.670842 105.966,188.879085 C103.334,194.097325 112.085,218.419122 112.96,220.159535 C113.834,221.897949 114.718,238.403382 119.963,237.532676 C125.218,236.663969 130.463,251.42799 130.463,251.42799 C130.463,251.42799 143.596,271.41125 144.47,275.759783 C145.344,280.09832 147.967,307.039233 147.967,307.039233 L126.967,331.36103 L102.46,355.682827 C102.459,355.682827 34.042,375.886013 0,387.023257 Z" id="Path" fill="#B3BCC4"></path>\n <path d="M5.68434189e-14,387.023257 L5.68434189e-14,399.918908 L400,399.918908 L400,386.023594 C366.631,377.336524 321.866,364.269931 315.979,359.161654 C308.985,353.083704 270.481,310.508063 270.481,310.508063 L270.481,286.186267 C270.481,286.186267 284.478,266.204006 284.478,261.854473 C284.478,257.515936 285.353,246.219746 291.481,241.011503 C297.61,235.792263 311.607,211.471466 312.481,206.253226 C313.355,201.043983 319.484,188.009379 312.481,185.400259 C305.478,182.801135 307.236,173.244359 308.984,168.026119 C310.733,162.817875 319.484,139.355788 322.981,133.277838 C326.488,127.199888 312.481,108.956041 312.481,108.956041 C312.481,108.956041 294.978,80.2857109 245.975,53.3547939 C196.971,26.4138803 168.967,42.9283105 168.967,42.9283105 L161.964,60.3024507 C161.964,60.3024507 138.341,64.6409874 123.46,77.6765909 C108.589,90.7121943 99.837,106.346921 98.963,115.903698 C98.088,125.460475 103.334,159.339048 105.966,164.557289 C108.589,169.765532 112.96,185.400259 112.96,185.400259 C112.96,185.400259 108.589,183.670842 105.966,188.879085 C103.334,194.097325 112.085,218.419122 112.96,220.159535 C113.834,221.897949 114.718,238.403382 119.963,237.532676 C125.218,236.663969 130.463,251.42799 130.463,251.42799 C130.463,251.42799 143.596,271.41125 144.47,275.759783 C145.344,280.09832 147.967,307.039233 147.967,307.039233 L126.967,331.36103 L102.46,355.682827 C102.459,355.682827 34.042,375.886013 5.68434189e-14,387.023257 Z" id="Path" fill="#B3BCC4"></path>\n </g>\n </g>\n</svg>\n')};return v().createElement(S(),{className:O()(r,n),src:o,imgProps:{onError:s}},v().createElement("img",{className:n,src:l,alt:"fallback entity avatar",onError:s}))};var R=r(75580),_=r(73288),I=r(62391),N=r(9400),D=r(8523),P=r(42308),k=r.n(P),L=r(61882),U=r(26040),j=r(5950);function F(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){M(e,t,r[t])}))}return e}function M(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const V={facetsConfigs:[],facetsData:{},recommendedFacets:[],addedFacets:[]},B=(0,I.Ic)("facetsConfigs"),z=(0,I.Ic)("facetsData"),H=(0,I.Ic)("recommendedFacets"),Y=(0,I.Ic)("addedFacets"),W=(e,t,r)=>Object.keys(e).reduce(((t,n)=>(0,_.prop)(n,t)?(0,I.ET)(n,r).set(t,e[n]):t),F({},t)),G=e=>{let{state:t,facetsConfigs:r,addToEnd:n=!1,facetsData:a={}}=e;const i=r.filter((e=>e.fieldName)),o=B.get(t),l=B.set(t,n?o.concat(i):i.concat(o)),s=z.get(t),c=i.reduce(((e,t)=>F({},e,{[t.fieldName]:(0,N.DV)(t.fieldName,a[t.fieldName])})),F({},s));return z.set(l,c)},q=(e,t)=>{const r=z.get(e),n=B.get(e),a=F({},r);t.forEach((e=>{delete a[e]}));const i=z.set(e,a);return B.set(i,n.filter((e=>!t.includes(e.fieldName))))},Z=e=>{let{facetFieldName:t,values:r,state:n}=e;const a=[...(0,D.jK)(t),"values"];return(0,I.ET)(...a).set(n,r)},$=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:V,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case L.k.CREATE_FACETS:{const{facetsConfigs:r,addToEnd:n}=t.payload;return G({state:e,facetsConfigs:r,addToEnd:n})}case P.search.constants.UPDATE_STATE:{const{facetsConfigs:e=[],facetsData:r={}}=t.payload.facets||{facetsConfigs:[]};return G({state:V,facetsConfigs:e,facetsData:r})}case L.k.DESTROY_FACETS:{const r=t.payload||[];return q(e,r)}case L.k.CHANGE_VALUES:{const{facetFieldName:r,values:n}=t.payload;return Z({facetFieldName:r,values:n,state:e})}case L.k.SHOW_MORE_ENTITY_TYPES:{const{show:r}=t.payload,n="type",a=(0,D.jK)(n);if(r)return(0,I.ET)(...a,"showAllItems").set(e,r);{const t=(0,I.ET)(...a);return t.set(e,(0,_.omit)(["showAllItems"],t.get(e)))}}case L.k.CLEAR_ALL_VALUES:case U.Z.CLEAR_ALL:{const t=z.get(e),r=Object.keys(t).reduce(((e,t)=>F({},e,{[t]:[]})),{}),n=W(r,t,"values");return z.set(e,n)}case L.k.UPDATE_DATA:{const r=t.payload||{},n=z.get(e),a=W(r,n,"data");return z.set(e,a)}case L.k.UPDATE_FILTERED_DATA:{const r=t.payload||{},n=z.get(e),a=W(r,n,"filteredData");return z.set(e,a)}case L.k.DESTROY_FILTERED_DATA:{const r=t.payload||{},n=(0,D.jK)(r);if((0,_.path)(n,e)){const t=(0,I.ET)(...n),r=F({},t.get(e));if(r.filteredData)return delete r.filteredData,t.set(e,r)}break}case L.k.SET_RECOMMENDED_FACETS_LIST:return H.set(e,t.payload||[]);case L.k.HIGHLIGHT_ADDED_FACETS:return Y.set(e,t.payload);case L.k.CLEAR_HIGHLIGHT_ADDED_FACETS:return Y.set(e,[]);case"UI_RESET":return F({},V);case U.Z.CHANGE_CURRENT_TENANT:{const{isDataTenant:r,tenantObject:n}=t.payload;if(r){const t=B.get(e),r=z.get(e),a=(0,j.ci)(n,t),i=(0,_.pluck)("fieldName",a),o=(0,_.pipe)((0,_.pick)(i),(0,j.AZ)(n))(r);return z.set(B.set(e,a),o)}return e}}return e};var K=r(33950);function X(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Q(e,t,r[t])}))}return e}function Q(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const J={searchResults:null,searchResultsByEntityTypes:{},total:0,page:0,sortField:null,sortOrder:null,rowsPerPage:K.Tu[0],loading:!1,searchParams:{searchBoxInput:{fieldName:"attributes",filter:"containsWordStartingWith"},mapSearch:{fieldName:"geoLocation",type:"geoLocation",filter:"range",values:[]}},currentTenant:null},ee=(0,I.Ic)("searchResults"),te=(0,I.Ic)("total"),re=(0,I.Ic)("page"),ne=(0,I.Ic)("rowsPerPage"),ae=(0,I.Ic)("sortField"),ie=(0,I.Ic)("sortOrder"),oe=(0,I.Ic)("loading"),le=(0,I.ET)("searchParams","mapSearch","values"),se=(0,I.ET)("searchParams","mapSearch","type"),ce=(0,I.ET)("searchParams","mapSearch","fieldName"),ue=(0,I.Ic)("searchResultsByEntityTypes"),pe=e=>ue.compose((0,I.ET)(e,"page")),de=(e,t)=>{let{entityTypeUri:r,field:n,order:a}=e;if(r){const e=ue.compose((0,I.ET)(r,"sortField")),i=ue.compose((0,I.ET)(r,"sortOrder")),o=e.set(t,n);return i.set(o,a)}{const e=ae.set(t,n);return ie.set(e,a)}},me=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:J,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case U.Z.UPDATE_ENTITIES:{const{searchResults:r,entityTypeUri:n}=t.payload;return n?ue.compose((0,I.ET)(n,"searchResults")).set(e,r):ee.set(e,r)}case U.Z.UPDATE_TOTAL:return te.set(e,t.payload);case U.Z.CHANGE_PAGE:{const{entityTypeUri:r,pageNumber:n}=t.payload;return r?pe(r).set(e,n):re.set(e,n)}case U.Z.RESET_PAGE:{const{entityTypeUri:r}=t.payload,n=re.set(e,0);return r?pe(r).set(n,0):n}case U.Z.CHANGE_ROWS_PER_PAGE:{const{entityTypeUri:r,number:n}=t.payload;if(r){const t=ue.compose((0,I.ET)(r,"rowsPerPage")),a=pe(r).set(e,0);return t.set(a,n)}{const t=re.set(e,0);return ne.set(t,n)}}case U.Z.CHANGE_SORT:return de(t.payload,e);case U.Z.CHANGE_LOADING:return oe.set(e,t.payload);case P.search.constants.UPDATE_STATE:{const{values:r=[],searchType:n=x.MapSearch.geoPolygon}=t.payload.map||{};let a=le.set(J,r);if(a=se.set(a,n),a=ce.set(a,(0,x.mapSearchTypeToFieldName)(n)),t.payload.view){const{entityTypeTab:e,sortField:r,sortOrder:n}=t.payload.view;a=de({entityTypeUri:e,field:r,order:n},a)}return X({},a,{currentTenant:t.payload.currentTenant||e.currentTenant,searchOptions:t.payload.searchOptions||e.searchOptions})}case"UI_RESET":return X({},J);case U.Z.MAP_CHANGE_VALUE:{const{value:r,searchType:n}=t.payload;let a=se.set(e,n);return a=ce.set(a,(0,x.mapSearchTypeToFieldName)(n)),le.set(a,r?[r]:[])}case U.Z.CLEAR_RESULTS:{const r=t.payload;if(r){let t=ee.set(e,void 0);const n=ue.get(e);return ue.set(t,{[r]:n[r]})}return ue.set(e,{})}case U.Z.CLEAR_ALL:return le.set(e,[]);case U.Z.CHANGE_CURRENT_TENANT:return X({},e,{currentTenant:t.payload.tenantObject.id})}return e},ge="UI_SHOW_MORE_FACETS_POPUP",ye="UI_SHOW_SAVED_SEARCHES_DIALOG",fe="UI_SHOW_SAVE_SEARCH_DIALOG",he="UI_SHOW_ADVANCED_SEARCH",Ee="UI_SHOW_BULK_UPDATE",be="UI_SET_MARKER",ve="UI_SET_HOVERED_ENTITY_URI",Te="UI_SET_ACTIVE_ADDITIONAL_SEARCH",Oe="UI_SET_SEARCH_RESULTS_COLUMNS",xe="UI_CHANGE_SEARCH_RESULTS_COLUMNS",Ce="UI_SET_ENTITY_TYPE_TAB",Se="UI_UPDATE_TABLE_VIEW_TABS",we="UI_CHANGE_ORDER_SEARCH_RESULTS_COLUMNS",Ae="UI_CHANGE_SIZES_SEARCH_RESULTS_COLUMNS",Re="UI_SET_LOADING",_e="UI_CLEAR_NOTIFICATION",Ie="UI_SET_NOTIFICATION",Ne="UI_SET_SEARCH_RESULTS_MODE",De="UI_SET_PREVIEW_PANEL_MODE",Pe={showMoreFacetsPopup:!1,showSavedSearchesDialog:!1,showAdvancedSearch:!1,showSaveSearchDialog:!1,showBulkUpdate:!1,activeAdditionalSearch:null,activeMarker:null,hoveredEntityUri:null,searchResultsMode:null,previewPanelMode:null,searchResultsColumns:{},entityTypeTab:null,tableViewTabs:[],notification:null},ke=(0,I.Ic)("showMoreFacetsPopup"),Le=(0,I.Ic)("showSavedSearchesDialog"),Ue=(0,I.Ic)("showSaveSearchDialog"),je=(0,I.Ic)("showAdvancedSearch"),Fe=(0,I.Ic)("showBulkUpdate"),Me=(0,I.Ic)("activeAdditionalSearch"),Ve=(0,I.Ic)("activeMarker"),Be=(0,I.Ic)("hoveredEntityUri"),ze=(0,I.Ic)("searchResultsMode"),He=(0,I.Ic)("previewPanelMode"),Ye=(0,I.Ic)("searchResultsColumns"),We=(0,I.Ic)("entityTypeTab"),Ge=(0,I.Ic)("tableViewTabs"),qe=(0,I.Ic)("loading"),Ze=(0,I.Ic)("notification"),$e=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Pe,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ge:return ke.set(e,t.payload);case ye:return Le.set(e,t.payload);case fe:return Ue.set(e,t.payload.show);case he:return je.set(e,t.payload);case Ee:return Fe.set(e,t.payload);case Te:{const r=Me.get(e)===t.payload?null:t.payload;return Me.set(e,r)}case be:return Ve.set(e,t.payload);case ve:return Be.set(e,t.payload);case Ne:return ze.set(e,t.payload);case Oe:return Ye.set(e,t.payload);case xe:{const{entityTypeUri:r,columns:n}=t.payload;return Ye.compose((0,I.Ic)(r)).set(e,n)}case Ae:{const{entityTypeUri:r,columns:n}=t.payload;return Ye.compose((0,I.Ic)(r)).set(e,n)}case we:{const{entityTypeUri:r,columns:n}=t.payload;return Ye.compose((0,I.Ic)(r)).set(e,n)}case De:return He.set(e,t.payload);case Ce:return We.set(e,t.payload.entityTypeUri);case Se:return Ge.set(e,t.payload);case L.k.UPDATE_DATA:if((0,_.has)("type",t.payload))return Ge.set(e,t.payload.type);break;case L.k.CHANGE_VALUES:{const{facetFieldName:r,values:n}=t.payload;if("type"===r&&n.length){const t=We.get(e);if(!n.includes(t))return We.set(e,n[0])}break}case"UI_RESET":return Pe;case Re:return qe.set(e,t.payload);case Ie:return Ze.set(e,t.payload);case _e:return Ze.set(e,null);case P.search.constants.UPDATE_STATE:{let r=je.set(e,(0,_.has)("advanced",t.payload));if(t.payload.view){const{searchResultsMode:e,entityTypeTab:n,searchResultsColumns:a,previewPanelMode:i}=t.payload.view;r=ze.set(r,e),r=We.set(r,n),(0,x.isEmptyValue)(a)||(r=Ye.set(r,a)),r=He.set(r,i)}return t.payload.showSavedSearchesDialog&&(r=Le.set(r,t.payload.showSavedSearchesDialog)),r}}return e};var Ke=r(37164);const Xe="ADVANCED_SEARCH_SET_GROUP_ENTITY_TYPES",Qe="ADVANCED_SEARCH_VERIFY_GROUP_ENTITY_TYPES",Je="ADVANCED_SEARCH_SET_GROUP_OPERATOR",et="ADVANCED_SEARCH_DELETE_GROUP",tt="ADVANCED_SEARCH_ADD_GROUP",rt="ADVANCED_SEARCH_DUPLICATE_GROUP",nt="ADVANCED_SEARCH_ADD_ATTRIBUTE_AFTER",at="ADVANCED_SEARCH_CHANGE_ATTRIBUTE_DATA",it="ADVANCED_SEARCH_TOGGLE_ATTRIBUTE_SELECT",ot="ADVANCED_SEARCH_SET_ATTRIBUTE_OPERATOR",lt="ADVANCED_SEARCH_DELETE_ATTRIBUTE",st="ADVANCED_DELETE_ATTRIBUTE_AND_VERIFY_GROUP_ENTITY_TYPES",ct="ADVANCED_SEARCH_DUPLICATE_ATTRIBUTE",ut="ADVANCED_SEARCH_SET_FILTER",pt="ADVANCED_SEARCH_SET_VALUES",dt="ADVANCED_SEARCH_ATTRIBUTE_SET_VALUES",mt="ADVANCED_SEARCH_ATTRIBUTE_FILTER_VALUES",gt="ADVANCED_SEARCH_ATTRIBUTE_SET_FILTERED_VALUES",yt="ADVANCED_SEARCH_ATTRIBUTE_UPDATE_VALUES",ft="ADVANCED_SEARCH_UPDATE",ht="ADVANCED_SEARCH_CONVERT_FROM_FACETS";var Et=r(81253);function bt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){vt(e,t,r[t])}))}return e}function vt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Tt="operator",Ot="values",xt="filter",Ct=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,Ke.x0)();return{[Tt]:K.YL.value,id:e}},St=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,Ke.x0)();const r=wt(e);return{data:r,[Tt]:K.YL.value,[xt]:(0,_.pathOr)("",["filterOptions",0],r),id:t}},wt=e=>bt({},e,{filterOptions:e.enforcedFilterOptions||(0,x.getFilterOptionsForQueryBuilder)(e.attrType,e.fieldName,!0)}),At=(0,_.curry)(((e,t)=>{const r=t.findIndex((t=>t.id===e));return r>-1?[r]:null})),Rt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:At;return(r,n)=>{const a=(0,I.ET)(...e).get(r),i=t(n,a);return!!i&&(0,I.ET)(...e,...i)}},_t=(e,t)=>(r,n)=>{const a=e(r,n);return a&&a.compose((0,I.Ic)(t))},It=e=>(t,r,n)=>{const a=e(t,r);return a?a.get(t).findIndex((e=>e.id===n)):-1},Nt=e=>(t,r,n)=>{const a=e(t,r),i=It(e)(t,r,n);return-1!==i?a.compose((0,I.ET)(i)):null},Dt=e=>(t,r,n,a,i)=>{const o=e(t,r,n);if(o){const e=bt({},o.get(t));return e[a]=i,o.set(t,e)}return t},Pt=e=>(t,r,n,a)=>{const i=e(t,r,n);if(i)return i.get(t)[a]},kt=e=>{let{state:t,groupId:r,attributeId:n,attribute:a,getAttributesLens:i,getAttributeIndex:o}=e;const l=i(t,r);if(l){let e=[...l.get(t)];const i=o(t,r,n),s=!e[i+1];return-1!==i&&s?e.splice(i+1,0,a):-1!==i?(e.splice(i+1,0,bt({},a,{operator:e[i].operator})),e[i]=bt({},e[i],{operator:K.YL.value})):e.push(a),l.set(t,e)}return t},Lt=e=>{let{state:t,groupId:r,attributeId:n,attributeData:a,setAttributeProp:i,getAttributeLens:o}=e,l=t;if(a)return((e,t,r,n,a)=>{const i=a(e,t,r);let o;return i&&(o=i.get(e).filter),n.filterOptions.length&&(!o||!n.filterOptions.includes(o))})(t,r,n,a,o)&&(l=i(t,r,n,xt,a.filterOptions[0])),l=i(l,r,n,Ot,[]),i(l,r,n,"data",a);{const e=o(t,r,n);return e&&(l=e.set(l,Ct(n))),l}},Ut=e=>{let{state:t,groupId:r,attributeId:n,operator:a,setAttributeProp:i}=e;return i(t,r,n,Tt,a)},jt=e=>{let{state:t,groupId:r,attributeId:n,getAttributesLens:a}=e;const i=a(t,r);if(i){const e=[...i.get(t)],r=e.findIndex((e=>e.id===n));if(r>-1){const n=(0,_.remove)(r,1,e),a=n[r-1],o=e[r];return a&&(n[r-1]=bt({},a,{operator:o.operator})),i.set(t,n)}}return t},Ft=e=>{let{state:t,groupId:r,attributeId:n,id:a,getAttributesLens:i}=e;const o=i(t,r);if(o){const e=[...o.get(t)],r=e.findIndex((e=>e.id===n));if(r>-1)return e.push(bt({},e[r],{id:a})),o.set(t,e)}return t},Mt=e=>{let{state:t,groupId:r,attributeId:n,filter:a,getAttributeProp:i,setAttributeProp:o}=e;const l=i(t,r,n,xt),s=(0,x.isCompatibleFilters)(l,a)?t:o(t,r,n,Ot,[]);return o(s,r,n,xt,a)},Vt=e=>{let{state:t,groupId:r,attributeId:n,values:a,setAttributeProp:i}=e;return i(t,r,n,Ot,a)};function Bt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){zt(e,t,r[t])}))}return e}function zt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ht={searchParams:{groups:[]},attributesData:{}},Yt="entityTypes",Wt="attributes",Gt="autoAddedEntityTypes",qt=["groups"],Zt=(0,I.ET)(...qt),$t=Rt(qt),Kt=_t($t,Wt),Xt=It(Kt),Qt=Nt(Kt),Jt=Dt(Qt),er=Pt(Qt),tr=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:(0,Ke.x0)();return{[Wt]:e.map((e=>St(e))),[Tt]:K.qx.value,[Yt]:t,id:r}},rr=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ht.attributesData,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case gt:{const{groupId:r,attributeId:n,values:a}=t.payload;return(0,_.assocPath)([r,n,"filtered"],a,e)}case et:{const{groupId:r}=t.payload;return(0,_.dissoc)(r,e)}case lt:{const{groupId:r,attributeId:n}=t.payload;return(0,_.dissocPath)([r,n],e)}case rt:{const{groupId:r,id:n}=t.payload,a=e[r];return a?(0,_.assoc)(n,a,e):e}case ct:{const{groupId:r,attributeId:n,id:a}=t.payload,i=(0,_.path)([r,n],e);return i?(0,_.assocPath)([r,a],i,e):e}case U.Z.CLEAR_ALL:case P.search.constants.UPDATE_STATE:return Ht.attributesData;default:return e}},nr=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ht.searchParams,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case tt:{const{group:r}=t.payload,n=[...Zt.get(e)];return n.push(r),Zt.set(e,n)}case Je:{const{groupId:r,operator:n}=t.payload,a=$t(e,r);if(a){const t=Bt({},a.get(e));return t[Tt]=n,a.set(e,t)}return e}case Xe:{const{groupId:r,entityTypes:n}=t.payload,a=$t(e,r);if(a){const t=Bt({},a.get(e));return t.entityTypes=n,t.autoAddedEntityTypes=[],t.attributes=[],a.set(e,t)}return e}case Qe:{const{groupId:r}=t.payload,n=$t(e,r);if(n){const t=n.get(e),{entityTypes:r,autoAddedEntityTypes:a}=(0,Et.tg)((0,Et.r8)(t.attributes||[]),t.entityTypes,t.autoAddedEntityTypes);return n.set(e,Bt({},t,{[Yt]:r,[Gt]:a}))}return e}case et:{const{groupId:r}=t.payload,n=[...Zt.get(e)],a=n.findIndex((e=>e.id===r));if(a>-1){const t=(0,_.remove)(a,1,n),r=t[a-1],i=n[a];return r&&(t[a-1]=Bt({},r,{operator:i.operator})),Zt.set(e,t)}return e}case rt:{const{groupId:r,id:n}=t.payload,a=[...Zt.get(e)],i=a.findIndex((e=>e.id===r));return i>-1?(a.push(Bt({},a[i],{id:n})),Zt.set(e,a)):e}case nt:{const{groupId:r,attributeId:n,attribute:a}=t.payload;return kt({state:e,groupId:r,attributeId:n,attribute:a,getAttributesLens:Kt,getAttributeIndex:Xt})}case at:{const{groupId:r,attributeId:n,attributeData:a}=t.payload;return Lt({state:e,groupId:r,attributeId:n,attributeData:a,setAttributeProp:Jt,getAttributeLens:Qt})}case ot:{const{groupId:r,attributeId:n,operator:a}=t.payload;return Ut({state:e,groupId:r,attributeId:n,operator:a,setAttributeProp:Jt})}case lt:{const{groupId:r,attributeId:n}=t.payload;return jt({state:e,groupId:r,attributeId:n,getAttributesLens:Kt})}case ct:{const{groupId:r,attributeId:n,id:a}=t.payload;return Ft({state:e,groupId:r,attributeId:n,id:a,getAttributesLens:Kt})}case ut:{const{groupId:r,attributeId:n,filter:a}=t.payload;return Mt({state:e,groupId:r,attributeId:n,filter:a,getAttributeProp:er,setAttributeProp:Jt})}case pt:{const{groupId:r,attributeId:n,values:a}=t.payload;return Vt({state:e,groupId:r,attributeId:n,values:a,setAttributeProp:Jt})}case U.Z.CLEAR_ALL:return Ht.searchParams;case P.search.constants.UPDATE_STATE:{const{advanced:e=[]}=t.payload;return Zt.set(Ht.searchParams,e)}default:return e}},ar=(e,t)=>{const r=((e,t)=>{if(t.type===dt){var r;const{groupId:n,attributeId:a,values:i}=t.payload;return((null===(r=[...Zt.get(e.searchParams)].find((e=>e.id===n)))||void 0===r?void 0:r.attributes)||[]).some((e=>{let{id:t}=e;return t===a}))?(0,_.assocPath)(["attributesData",n,a,"default"],i,e):e}return e})((0,R.combineReducers)({searchParams:nr,attributesData:rr})(e,t),t);return r},ir="SAVED_SEARCHES_CREATE",or="SAVED_SEARCHES_SET_CURRENT",lr="SAVED_SEARCHES_SET_CHANGE_INDICATOR",sr="SAVED_SEARCHES_UPDATE",cr="SAVED_SEARCHES_LOAD",ur="SAVED_SEARCHES_SET_TOTAL",pr="SAVED_SEARCHES_SET_ITEMS",dr="SAVED_SEARCHES_SET_ITEM_TOTAL",mr="SAVED_SEARCHES_SET_PAGE",gr="SAVED_SEARCHES_SET_ROWS_PER_PAGE",yr="SAVED_SEARCHES_SET_FILTERS",fr="SAVED_SEARCHES_SELECT_ITEM",hr="SAVED_SEARCHES_SELECT_ALL_ITEMS",Er="SAVED_SEARCHES_DESELECT_ALL_ITEMS",br="SAVED_SEARCHES_MARK_PUBLIC_REQUEST",vr="SAVED_SEARCHES_MARK_PUBLIC",Tr="SAVED_SEARCHES_MARK_FAVORITE_REQUEST",Or="SAVED_SEARCHES_MARK_FAVORITE",xr="SAVED_SEARCHES_MARK_GLOBAL_FILTER_REQUEST",Cr="SAVED_SEARCHES_CHANGE_ITEM_NAME_REQUEST",Sr="SAVED_SEARCHES_CHANGE_ITEM_NAME",wr="SAVED_SEARCHES_SET_EDITING",Ar="SAVED_SEARCHES_DELETE_SELECTED_ITEMS_REQUEST",Rr="SAVED_SEARCHES_DELETE_ITEM_REQUEST",_r="SAVED_SEARCHES_DELETE_ITEMS",Ir="SAVED_SEARCHES_SET_LOADING",Nr="SAVED_SEARCHES_SET_SEARCH_VALUE",Dr="SAVED_SEARCHES_APPLY_ITEM",Pr="SAVED_SEARCHES_SET_TOTAL_LOADING",kr="SAVED_SEARCHES_LOAD_TOTAL",Lr="SAVED_SEARCHES_TOGGLE_SORT",Ur="RECENT_SEARCHES_CREATE",jr="RECENT_SEARCHES_LOAD",Fr="RECENT_SEARCHES_SET_ITEMS",Mr="RECENT_SEARCHES_SET_ITEM_TOTAL",Vr="RECENT_SEARCHES_SELECT_ITEM",Br="RECENT_SEARCHES_SELECT_ALL_ITEMS",zr="RECENT_SEARCHES_DESELECT_ALL_ITEMS",Hr="RECENT_SEARCHES_DELETE_SELECTED_ITEMS_REQUEST",Yr="RECENT_SEARCHES_DELETE_ITEMS",Wr="RECENT_SEARCHES_DELETE_ITEM_REQUEST",Gr="RECENT_SEARCHES_SET_LOADING",qr="RECENT_SEARCHES_SET_SEARCH_VALUE",Zr="RECENT_SEARCHES_SET_LAST_SAVED",$r="RECENT_SEARCHES_SET_TOTAL_LOADING",Kr="RECENT_SEARCHES_LOAD_TOTAL",Xr="RECENT_SEARCHES_APPLY_ITEM";function Qr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Jr(e,t,r[t])}))}return e}function Jr(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const en={currentSearch:null,postSavingAction:null,changeIndicator:!1,items:[],loading:!1,total:0,page:0,rowsPerPage:K.Tu[0],searchValue:"",findPublic:!0,favoriteOnly:!1,sorting:{order:K.rX.DESC,field:K.KY.updateDate}},tn=(0,I.Ic)("changeIndicator"),rn=(0,I.Ic)("items"),nn=(0,I.Ic)("total"),an=(0,I.Ic)("page"),on=(0,I.Ic)("loading"),ln=(0,I.Ic)("postSavingAction"),sn=(0,I.Ic)("sorting"),cn=(e,t,r)=>{const n=rn.get(r).findIndex((e=>e.uri===t)),a=rn.compose((0,I.ET)([n])),i=a.get(r);return a.set(r,e(i))},un=e=>e===K.rX.DESC?K.rX.ASC:K.rX.DESC,pn=(e,t,r)=>(0,_.evolve)({page:(0,_.always)(0),[e]:(0,_.always)(t)},r),dn=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:en,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case or:return(0,_.evolve)({currentSearch:(0,_.always)(t.payload),changeIndicator:null===t.payload?(0,_.always)(!1):_.identity},e);case U.Z.CLEAR_ALL:return(0,_.evolve)({currentSearch:(0,_.always)(null),changeIndicator:(0,_.always)(!1)},e);case lr:return tn.set(e,t.payload);case ur:return nn.set(e,t.payload);case mr:return an.set(e,t.payload);case gr:return pn("rowsPerPage",t.payload,e);case yr:{const{findPublic:r,favoriteOnly:n}=t.payload;return(0,_.evolve)({page:(0,_.always)(0),findPublic:(0,_.always)(r),favoriteOnly:(0,_.always)(n)},e)}case pr:return rn.set(e,t.payload);case fr:{const{uri:r,checked:n}=t.payload;return cn((e=>Qr({},e,{checked:n})),r,e)}case Er:{const t=rn.get(e);return rn.set(e,t.map((0,_.omit)(["checked"])))}case hr:{const t=rn.get(e);return rn.set(e,t.map((0,_.ifElse)((0,_.prop)("isOwnSearch"),(0,_.assoc)("checked",!0),_.identity)))}case _r:{const r=t.payload,n=rn.get(e),a=nn.set(e,nn.get(e)-r.length);return rn.set(a,n.filter((e=>!r.includes(e.uri))))}case vr:{const{uri:r,isPublic:n}=t.payload;return cn((e=>Qr({},e,{isPublic:n})),r,e)}case Or:{const{uri:r,isFavorite:n}=t.payload;return cn((e=>Qr({},e,{isFavorite:n})),r,e)}case dr:{const{uri:r,total:n}=t.payload;return cn((e=>Qr({},e,{total:n})),r,e)}case wr:{const{uri:r,isEditing:n}=t.payload;return cn((e=>Qr({},e,{isEditing:n})),r,e)}case Cr:{const{uri:r}=t.payload;return cn((0,_.omit)(["isEditing"]),r,e)}case Sr:{const{uri:r,name:n}=t.payload;return cn((e=>Qr({},e,{name:n})),r,e)}case Ir:return on.set(e,t.payload);case qr:case Nr:return pn("searchValue",t.payload,e);case cr:return Qr({},e,{page:0,findPublic:!0,favoriteOnly:!1});case Lr:{const r=t.payload,n=(0,_.path)(["sorting","field"],e),a=(0,_.path)(["sorting","order"],e);return sn.set(e,{field:r,order:un(r===n?a:null)})}case Pr:{const{uri:r,isLoading:n}=t.payload;return cn((e=>Qr({},e,{isTotalLoading:n})),r,e)}case fe:return ln.set(e,t.payload.postSavingAction);case ye:return pn("searchValue",en.searchValue,e)}return e};function mn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){gn(e,t,r[t])}))}return e}function gn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const yn={items:[],filterWord:null,loading:!1,lastSavedRecentSearch:null},fn=(0,I.Ic)("items"),hn=(0,I.Ic)("loading"),En=(0,I.Ic)("filterWord"),bn=(0,I.Ic)("lastSavedRecentSearch"),vn=(e,t,r)=>{const n=fn.get(r).findIndex((e=>e.createdDate===t)),a=fn.compose((0,I.ET)([n])),i=a.get(r);return a.set(r,e(i))},Tn=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:yn,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Nr:case qr:return En.set(e,t.payload);case Fr:return fn.set(e,t.payload);case Vr:{const{searchCreatedDate:r,checked:n}=t.payload;return vn((e=>mn({},e,{checked:n})),r,e)}case zr:{const t=fn.get(e);return fn.set(e,t.map((0,_.omit)(["checked"])))}case Br:{const t=fn.get(e);return fn.set(e,t.map((0,_.assoc)("checked",!0)))}case Yr:{const r=(t.payload||[]).map((0,_.prop)("createdDate")),n=fn.get(e);return fn.set(e,n.filter((e=>!r.includes(e.createdDate))))}case Mr:{const{searchCreatedDate:r,total:n}=t.payload;return vn((e=>mn({},e,{total:n})),r,e)}case Gr:return hn.set(e,t.payload);case Zr:return bn.set(e,t.payload);case $r:{const{searchCreatedDate:r,isLoading:n}=t.payload;return vn((e=>mn({},e,{isTotalLoading:n})),r,e)}case ye:return En.set(e,yn.filterWord)}return e},On="ENTITY_SET_LOADING",xn="ENTITY_LOAD_ENTITY_REQUEST",Cn="ENTITY_SET_SELECTED_ENTITY_URI",Sn="ENTITY_SET_ENTITY",wn={loading:!1,selectedEntityUri:null,entity:null},An=(0,I.Ic)("loading"),Rn=(0,I.Ic)("selectedEntityUri"),_n=(0,I.Ic)("entity"),In=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:wn,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case On:return An.set(e,t.payload);case Cn:return Rn.set(e,t.payload);case Sn:return _n.set(e,t.payload);case P.profile.constants.ProfileActions.ADD_NEXT_PAGE_ATTRIBUTE_VALUES:{const{parentUri:r,attributeTypeName:n,attributeTypeUri:a,values:i}=t.payload,o=(0,x.getAttributeSource)(a);if(e.entity&&r===e.entity.uri){const t=(0,_.lensPath)(["entity",o,n]);return(0,_.over)(t,(0,_.pipe)((0,_.defaultTo)([]),(0,_.concat)(_.__,i)),e)}return e}case P.search.constants.SEARCH_RESULTS_SET:if((0,x.isEmptyValue)(t.payload)){const t=_n.set(e,wn.entity);return Rn.set(t,wn.selectedEntityUri)}return e}return e},Nn="BULK_UPDATE_SET_ACTIVE_STEP",Dn="BULK_UPDATE_INIT",Pn="BULK_UPDATE_TOGGLE_SELECTION_MODE",kn="BULK_UPDATE_SELECT_ENTITY",Ln="BULK_UPDATE_SELECT_ALL_ENTITIES_ON_PAGE",Un="BULK_UPDATE_SET_LOADING",jn="BULK_UPDATE_CHANGE_ROWS_PER_PAGE",Fn="BULK_UPDATE_CHANGE_PAGE",Mn="BULK_UPDATE_CHANGE_SORT",Vn="BULK_UPDATE_CHANGE_COLUMNS",Bn="BULK_UPDATE_UPDATE_ENTITIES",zn="BULK_UPDATE_SET_FILTER_TEXT",Hn="BULK_UPDATE_SET_TOTAL",Yn="UPDATE_BULK_UPDATE_CURRENT_ENTITIES",Wn="BULK_UPDATE_SET_OPERATION",Gn="BULK_UPDATE_SET_ACTION_ATTRIBUTE",qn="BULK_UPDATE_SET_ACTION_OPERATION",Zn="BULK_UPDATE_ADD_OPERATION_PARAMETERS",$n="BULK_UPDATE_DELETE_ACTION",Kn="BULK_UPDATE_TOGGLE_CONDITIONS",Xn="BULK_UPDATE_ADD_CONDITION_AFTER",Qn="BULK_UPDATE_CHANGE_CONDITION_DATA",Jn="BULK_UPDATE_TOGGLE_CONDITION_SELECT",ea="BULK_UPDATE_DELETE_CONDITION",ta="BULK_UPDATE_SET_CONDITION_FILTER",ra="BULK_UPDATE_SET_CONDITION_VALUES",na="BULK_UPDATE_TOGGLE_ACTION_PIN",aa="BULK_UPDATE_TOGGLE_ACTION_ADD_NESTED",ia="BULK_UPDATE_CONFIRM",oa="BULK_UPDATE_SET_REQUEST_PENDING";var la=r(39705);function sa(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ca(e,t,r[t])}))}return e}function ca(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ua={objects:{selectionMode:K.v6.exclude,selectedEntities:[],entities:[],total:0,page:0,rowsPerPage:K.Tu[0],filterText:"",sortOrder:null,sortField:null,selectedColumns:[]},actions:[],operation:null,activeStep:0,loading:!1,requestPending:!1},pa=(0,I.Ic)("activeStep"),da=(0,I.Ic)("operation"),ma=(0,I.Ic)("loading"),ga=(0,I.Ic)("requestPending"),ya=(0,I.ET)("objects","total"),fa=(0,I.ET)("objects","page"),ha=(0,I.ET)("objects","rowsPerPage"),Ea=(0,I.ET)("objects","selectionMode"),ba=(0,I.ET)("objects","entities"),va=(0,I.ET)("objects","selectedEntities"),Ta=(0,I.ET)("objects","filterText"),Oa=e=>Ea.get(e)===K.v6.include,xa=(0,I.ET)("objects","sortOrder"),Ca=(0,I.ET)("objects","sortField"),Sa=(0,I.ET)("objects","selectedColumns"),wa=["actions"],Aa=(0,I.ET)(...wa),Ra=e=>{let{groupId:t,state:r}=e;if(t){const e=Aa.get(r).findIndex((e=>e.id===t));if(-1!==e)return[...wa,e,"actions"]}return wa},_a=(e,t)=>({id:(0,Ke.x0)(),operation:e,operationParameters:t}),Ia=e=>((0,_.path)(["attributeTypeData","fieldName"],e)||[]).split(".").slice(0,2).join("."),Na=(e,t)=>({id:(0,Ke.x0)(),fieldName:Ia(t),actions:[_a(e,t)]}),Da=e=>{let{state:t,id:r,groupId:n,operation:a,operationParameters:i,togglePin:o,toggleAddNested:l}=e;const s=Ra({state:t,groupId:n}),c=(0,I.ET)(...s).get(t),u=!n&&(0,_.prop)("attributeTypeData",i)&&(e=>{let{attributeType:t,fieldName:r=""}=e;return(0,x.isComplexAttribute)(t)||r.split(".").length>2})(i.attributeTypeData);if(r){const e=c.findIndex((e=>e.id===r)),n=(0,I.ET)(...s,e),d=sa({},n.get(t));if(a&&d.operation!==a){if(d.operationParameters){const e=[d.operation,a].includes(la.d.RepointReference)?[]:K.KJ[a];d.operationParameters=(0,_.omit)((0,_.without)(e,["attributeValue","attributeValueToFind"]),d.operationParameters)}d.operation=a}return i&&(d.operationParameters=(0,_.reject)(_.isNil,sa({},d.operationParameters,i))),o&&(d.operationParameters=sa({},d.operationParameters,{pin:!(0,_.path)(["operationParameters","pin"],d)})),l&&(d.operationParameters=sa({},d.operationParameters,{addNestedAttribute:!(0,_.path)(["operationParameters","addNestedAttribute"],d)})),n.set(t,u?Na((p=d).operation,p.operationParameters):d)}{const e=(0,_.reject)(_.isNil,i),r=u?Na(a,e):_a(a,e);return(0,I.ET)(...s,c.length).set(t,r)}var p},Pa=Rt(wa),ka=_t(Pa,"conditions"),La=It(ka),Ua=Nt(ka),ja=Dt(Ua),Fa=Pt(Ua),Ma=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ua,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Nn:return pa.set(e,t.payload);case Dn:return sa({},ua,{objects:sa({},ua.objects,t.payload)});case Bn:return ba.set(e,t.payload);case Pn:{const t=Ea.set(e,Oa(e)?K.v6.exclude:K.v6.include);return va.set(t,[])}case kn:{const{uri:r,checked:n}=t.payload,a=va.get(e),i=Oa(e);return va.set(e,!!n==!!i?(0,_.uniq)(a.concat(r)):(0,_.without)(r,a))}case Ln:{const r=t.payload,n=Oa(e),a=va.get(e),i=ba.get(e).map((0,_.prop)("uri"));return va.set(e,!!r==!!n?(0,_.uniq)(a.concat(i)):(0,_.without)(i,a))}case Un:return ma.set(e,t.payload);case Fn:return fa.set(e,t.payload);case jn:{const r=fa.set(e,0);return ha.set(r,t.payload)}case Mn:{const{order:r,field:n}=t.payload,a=Ca.set(e,n);return xa.set(a,r)}case Vn:return Sa.set(e,t.payload);case Hn:return ya.set(e,t.payload);case zn:{const{filterText:r}=t.payload;return Ta.set(e,r)}case Wn:return da.set(e,t.payload);case Gn:{const{id:r,groupId:n,attribute:a}=t.payload;return Da({state:e,id:r,groupId:n,operationParameters:{attributeTypeData:a,attributeValue:null,attributeValueToFind:null,pin:null,addNestedAttribute:null}})}case qn:{const{id:r,groupId:n,operation:a}=t.payload;return Da({state:e,id:r,groupId:n,operation:a})}case Zn:{const{id:r,groupId:n,operationParameters:a}=t.payload;return Da({state:e,id:r,groupId:n,operationParameters:a})}case na:{const{id:r,groupId:n}=t.payload;return Da({state:e,id:r,groupId:n,togglePin:!0})}case aa:{const{id:r,groupId:n}=t.payload;return Da({state:e,id:r,groupId:n,toggleAddNested:!0})}case $n:{const{id:r,groupId:n}=t.payload,a=Ra({state:e,groupId:n}),i=(0,I.ET)(...a),o=i.get(e);return i.set(e,o.filter((e=>e.id!==r)))}case Kn:{const r=t.payload,n=Aa.get(e).findIndex((e=>e.id===r)),a=(0,I.ET)(...wa,n),i=a.get(e);return a.set(e,i.conditions?(0,_.omit)(["conditions"],i):(0,_.assoc)("conditions",[],i))}case Xn:{const{groupId:r,attributeId:n,attribute:a}=t.payload;return kt({state:e,groupId:r,attributeId:n,attribute:a,getAttributesLens:ka,getAttributeIndex:La})}case Qn:{const{groupId:r,attributeId:n,attributeData:a}=t.payload;return Lt({state:e,groupId:r,attributeId:n,attributeData:a,setAttributeProp:ja,getAttributeLens:Ua})}case ea:{const{groupId:r,attributeId:n}=t.payload;return jt({state:e,groupId:r,attributeId:n,getAttributesLens:ka})}case ta:{const{groupId:r,attributeId:n,filter:a}=t.payload;return Mt({state:e,groupId:r,attributeId:n,filter:a,getAttributeProp:Fa,setAttributeProp:ja})}case ra:{const{groupId:r,attributeId:n,values:a}=t.payload;return Vt({state:e,groupId:r,attributeId:n,values:a,setAttributeProp:ja})}case oa:return ga.set(e,t.payload)}return e};var Va=r(85383),Ba=r(82349),za=r(12848),Ha=r(33192),Ya=r.n(Ha),Wa=r(43717);const Ga=(e,t,r)=>{const n=qa(t);if(n.length){const i=$a(e,t,r),o=Za(e,t,r),l=o.every((e=>(0,x.isTypeSearchGroupAttribute)({data:e})||i.some((0,_.eqProps)("fieldName",e)))),s=(0,x.areAllOperatorsAnd)(t),c=(0,x.areAllOperatorsAnd)(n),u=n.every((e=>{let{filter:t,data:{attrType:r={}}}=e;return[x.FilterOptions.EQUALS,x.FilterOptions.IN_RANGE,x.FilterOptions.FULL_TEXT,x.FilterOptions.ON,x.FilterOptions.WITHIN].includes(t)||x.FilterOptions.EXISTS===t&&(0,x.isBooleanType)(r.type)})),p=(a=n,!Object.values(a.reduce(((e,t)=>{let{data:{fieldName:r},filter:n,values:a}=t;return n===x.FilterOptions.EQUALS&&(0,_.path)([0,"length"],a)&&(e[r]=e[r]&&e[r]+1||1),e}),{})).some((e=>e>1)));return o.length&&s&&c&&u&&n.every((e=>e.data.attrType.faceted))&&l&&p}var a;return!0},qa=e=>e.flatMap((e=>e.attributes)).filter((0,_.has)("data")),Za=(e,t,r)=>{const n=qa(t).map((e=>{let{data:{fieldName:t,entityTypeUri:r},filter:n,values:a}=e;return{entityTypeUri:r,fieldName:t,filter:n,values:a}})).reduce(((t,n)=>{let{entityTypeUri:a,fieldName:i,filter:o,values:l}=n;const{attrType:s}=a?(0,N.eC)(e,[a],[],r).find((e=>e.fieldName===i))||{}:(0,Wa.zH)(i,r)||{},c=!(0,_.isNil)(s)&&s.faceted?((e,t,r,n)=>{if(![x.FilterOptions.EQUALS,x.FilterOptions.IN_RANGE].includes(t)&&![x.FilterOptions.ON,x.FilterOptions.WITHIN].includes(t)||!Array.isArray(e)||(0,x.isEmptyValue)(e[0]))return(0,x.isBooleanType)(n)&&t===x.FilterOptions.EXISTS?[!0,!1]:e&&!(0,x.isEmptyValue)(e[0])?[e[0]]:[];switch(r){case x.FACET_TYPES.NUMERIC_RANGE_FACET:return((e,t)=>{switch(t){case x.FilterOptions.EQUALS:return e.map((e=>[e,e]));case x.FilterOptions.IN_RANGE:return e.some(x.isEmptyValue)?[]:[e]}})(e[0],t);case x.FACET_TYPES.DATE_RANGE_FACET:return((e,t)=>{switch(t){case x.FilterOptions.ON:{const t=Ya()(e),r=!(0,x.isTimestampBasedType)(n);return[[x.utils.dates.getStartOfDay(t,r),x.utils.dates.getEndOfDay(t,r)]]}case x.FilterOptions.WITHIN:return(0,x.isDateRangeValue)(e)?[(0,x.getDateRangeByValue)(e)]:e.some(x.isEmptyValue)?[]:[e]}})(e[0],t);default:return e[0]}})(l,o,(0,x.getFacetTypeForAttrType)(s),s.type):l;return(0,_.isNil)(c)||(t[i]=(0,_.uniq)((t[i]||[]).concat(c))),t}),{}),a=Object.keys(n).map((e=>({fieldName:e,values:n[e]})));return a.some((e=>{let{values:t}=e;return t&&Array.isArray(t[0])&&t.length>1}))?[]:a},$a=(e,t,r)=>{const n=(0,Et.VO)(t);return(0,N.eC)(e,n,[],r)},Ka=(e,t)=>({type:U.Z.UPDATE_ENTITIES,payload:{searchResults:e,entityTypeUri:t}}),Xa=()=>({type:U.Z.REFRESH_DISPLAYED_ENTITIES}),Qa=e=>{let{silent:t}=e;return{type:U.Z.CLEAR_ALL,payload:{silent:t}}},Ja=e=>{let{entityTypeUri:t,keywordValue:r}=e;return{type:U.Z.SHOW_MORE_RESULTS_FOR_ENTITY_TYPE,payload:{entityTypeUri:t,keywordValue:r}}},ei=e=>({type:U.Z.UPDATE_TOTAL,payload:e}),ti=e=>({type:U.Z.CHANGE_LOADING,payload:e}),ri=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:U.Z.MAP_CHANGE_VALUE,payload:{value:e,searchType:t,silent:r}}},ni=(e,t)=>({type:L.k.CREATE_FACETS,payload:{facetsConfigs:e,addToEnd:t}}),ai=e=>({type:L.k.DESTROY_FACETS,payload:e}),ii=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:L.k.CHANGE_VALUES,payload:{facetFieldName:e,values:t,silent:r}}},oi=e=>({type:L.k.UPDATE_DATA,payload:e}),li=e=>({type:L.k.UPDATE_FILTERED_DATA,payload:e}),si=e=>{let{facetsToAdd:t,fieldNamesToDelete:r,changedEntityTypes:n,addToEnd:a}=e;return{type:L.k.HANDLE_CONFIGS_CHANGES,payload:{facetsToAdd:t,fieldNamesToDelete:r,changedEntityTypes:n,addToEnd:a}}};var ci=r(5236),ui=r(54145),pi=r(55443),di=r(65751),mi=r.n(di);const gi=e=>{(0,pi.U)(e,{title:mi().text("Server Error"),defaultMessage:mi().text("Something went wrong...")})};var yi=r(69021);const fi=(e,t,r)=>`${e}/recommend/${r}/${t}`,hi=e=>e&&1===e.length?e[0]:null,Ei=e=>[e].filter((0,_.complement)(x.isComplexAttribute)).map((0,_.compose)(Ba.$9,(0,_.prop)("uri"))).concat((e.children||[]).map(Ei)).flat(1/0);function*bi(){const e=yield(0,Va.RE)(Xl),t=yield(0,Va.Ys)(k().selectors.getTenant),r=yield(0,Va.Ys)(k().selectors.getEnvironment),n=((e,t,r,n,a)=>{const i=e.map((e=>{let{fieldName:t,values:r}=e;return{fieldName:t,values:r.map((e=>Array.isArray(e)?JSON.stringify(e):e))}})),o={facets:(0,Ba._e)(i).reduce(((e,t)=>{const r=(t.children||[]).map((e=>JSON.stringify(e)));return e[t.fieldName]=r.length>0?r:t.values.slice().sort(),e}),{}),max:5};return{url:fi(r,n,a),options:{method:"POST",body:JSON.stringify(o),headers:{"Content-Type":"application/json"}}}})(e,0,yield(0,Va.Ys)(k().selectors.getServicesPath),t,r);let a;try{a=yield(0,Va.RE)(x.rawRequest,n.url,n.options),a=a.filter((e=>"type"!==e)).slice(0,5)}catch(e){a=[]}const i=yield(0,Va.Ys)(k().selectors.getMetadata),o=yield(0,Va.Ys)(D.DX);a=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const r=hi(arguments.length>2?arguments[2]:void 0),n=r&&(0,x.getEntityType)(e,r),a=(0,yi.vf)(e,n||{}).map(Ei).flat(1/0);return t.filter((e=>r||!e.startsWith("attributes."))).filter((e=>!e.startsWith("attributes.")||a.includes(e)))}(i,a,o);const l=((e,t,r,n)=>{const a=e=>!t.includes(e);let i=[];const o=Math.max(0,5-t.length);if(o){const t=hi(n);if(t){const r=((0,x.getEntityType)(e,t).defaultFacetedAttributes||[]).map((r=>(0,x.findAttributeTypeByUri)(e,r,t))).filter((e=>e&&(0,x.isReadableAttribute)(e)&&!(0,x.isComplexAttribute)(e))).map((0,_.prop)("uri")).map(Ba.$9).filter(a);i=i.concat(r)}if(i.length<o){const e=(0,N.Xk)().map((e=>e.fieldName)).filter(a);i=i.concat(e)}}return i.slice(0,o)})(i,a,0,o);var s;a=a.concat(l),yield(0,Va.gz)((s=a,{type:L.k.SET_RECOMMENDED_FACETS_LIST,payload:s}))}const vi=e=>({type:ge,payload:e}),Ti=e=>({type:ye,payload:e}),Oi=(e,t)=>({type:fe,payload:{show:e,postSavingAction:t}}),xi=e=>({type:he,payload:e}),Ci=(e,t,r)=>({type:xe,payload:{entityTypeUri:e,columns:t,prevColumns:r}}),Si=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return{type:Ce,payload:{entityTypeUri:e,silent:t}}},wi=e=>({type:Se,payload:e}),Ai=()=>({type:_e}),Ri=e=>({type:Ie,payload:e}),_i=e=>Ri({payload:{message:e,action:null},type:K.GT.info}),Ii=e=>{let{message:t,actionLabel:r,actionToDispatch:n,autoHideDuration:a}=e;return Ri({payload:{message:t,action:{actionLabel:r,actionToDispatch:n},autoHideDuration:a},type:K.GT.info})},Ni=e=>({type:De,payload:e}),Di=e=>({type:Ee,payload:e});var Pi=r(90503),ki=r(82877);const Li=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object.keys(e).filter((r=>x.utils.strings.search(r,t)||x.utils.strings.search(e[r].displayName,t)))},Ui=new class{constructor(){this._lookupsCodesResolveTasks=Object.create(null)}addTask(e,t){this._lookupsCodesResolveTasks[e]=t}deleteTask(e){delete this._lookupsCodesResolveTasks[e]}getRunningTask(e){return this._lookupsCodesResolveTasks[e]}clearTasks(){this._lookupsCodesResolveTasks=Object.create(null)}},ji=(e,t)=>e===t,Fi=new class{constructor(){this.isLookupValueResolveTaskRunning=(0,_.curry)(((e,t)=>(0,_.hasPath)([e,t],this._lookupValuesResolveTasks))),this._lookupValuesResolveTasks=Object.create(null)}addTask(e,t){e.forEach((e=>{let{type:r,codeValues:n}=e;!this._lookupValuesResolveTasks[r]&&(this._lookupValuesResolveTasks[r]={}),n.forEach((e=>{this._lookupValuesResolveTasks[r][e]=t}))}))}deleteTask(e){e.forEach((e=>{let{type:t,codeValues:r}=e;this._lookupValuesResolveTasks[t]&&r.forEach((e=>{delete this._lookupValuesResolveTasks[t][e]})),(0,_.isEmpty)(this._lookupValuesResolveTasks[t])&&delete this._lookupValuesResolveTasks[t]}))}getRunningTasks(e){const t=e.flatMap((e=>{let{type:t,codeValues:r}=e;return this._lookupValuesResolveTasks[t]?r.reduce(((e,r)=>{const n=this._lookupValuesResolveTasks[t][r];return n&&e.push(n),e}),[]):[]}));return(0,_.uniqWith)(ji,t)}clearTasks(){this._lookupValuesResolveTasks=Object.create(null)}};function*Mi(e){const t=Fi.getRunningTasks(e);t.length>0&&(yield(0,Va.v_)(t))}function*Vi(e){try{const t=e.flatMap((e=>{let{type:t,codeValues:r}=e;return r.map((e=>({type:t,codeValue:e})))})),r=yield(0,Va.rM)(x.resolveLookupsList,t);Fi.addTask(e,r);const n=(yield(0,Va.v_)(r)).reduce(((e,t)=>{const[r]=Object.keys(t),[n]=Object.keys(t[r]),a=(0,_.lensPath)([r,n]),i=(0,_.path)([r,n],t);return(0,_.set)(a,i,e)}),{});for(const e in n)yield(0,Va.gz)(P.profile.lookups.actions.lookupsForTypeResolved({type:e,values:n[e]}))}catch(e){console.warn(e)}finally{Fi.deleteTask(e)}}function*Bi(e){if((0,_.isEmpty)(e))return;const t=e.map((e=>{let{type:t,codeValues:r}=e;const n=Fi.isLookupValueResolveTaskRunning(t);return{type:t,codeValues:r.filter((0,_.complement)(n))}})).filter((e=>{let{codeValues:t}=e;return t.length>0}));t.length>0&&(yield(0,Va.RE)(Vi,t)),yield(0,Va.RE)(Mi,e)}function*zi(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:K.cu,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;const a=!t&&1===n,i=`${e}${r}`,o=a&&Ui.getRunningTask(i);if(o)yield(0,Va.v_)(o);else try{const o=yield(0,Va.rM)(x.getDependentLookups,{type:e,displayNamePrefix:t,max:r,offset:r*(n-1)});a&&Ui.addTask(i,o);const l=yield(0,Va.v_)(o);yield(0,Va.gz)(P.profile.lookups.actions.lookupsForTypeResolved({type:e,values:l.codeValues[e]}))}catch(e){console.warn(e)}finally{a&&Ui.deleteTask(i)}}const Hi=(e,t,r)=>e.slice((r-1)*t,t*r);function*Yi(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;const a=yield(0,Va.Ys)(k().selectors.getLookups),i=Li(a[e],t);if(i.length>=r*n)return Hi(i,r,n);yield(0,Va.RE)(zi,e,t,r,n);const o=yield(0,Va.Ys)(k().selectors.getLookups);return Hi(Li(o[e],t),r,n)}const Wi=(e,t)=>Object.keys(e).filter((e=>(0,za.iL)(e,t))).reduce(((r,n)=>(r[(0,za.iL)(n,t).fieldName]=e[n],r)),{});function Gi(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){qi(e,t,r[t])}))}return e}function qi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*Zi(e,t,r){if((0,_.isEmpty)(e))return;const n=yield(0,Va.Ys)(k().selectors.getLookups),a=yield(0,Va.Ys)(k().selectors.getMetadata),i=Wi(r,e),o=yield(0,Va.Ys)(ki.Xf);yield(0,Va.gz)(t((0,za.HC)(a,i,e,n,{allowedEntityTypes:o})))}function*$i(e,t,r){try{const n=yield(0,Va.RE)(jl,e.url,e.options),[a,i]=(0,_.partition)(N._H,t);yield(0,Va.rM)(Zi,i,r,n),yield(0,Va.RE)(to,a,n),yield(0,Va.RE)(Zi,a,r,n)}catch(e){console.warn(e)}}function*Ki(e,t,r){e=Gi({},e,{includeFilter:[]});const n=yield(0,Va.Ys)(k().selectors.getGlobalSearchRequestOptions),a=(0,Ba.aw)([e],t,[e.fieldName],n);yield(0,Va.RE)($i,a,[e],r)}const Xi=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t.filter((t=>{let{label:r}=t;return x.utils.strings.search(r,e)}))},Qi=(e,t)=>Xi(t,e).map((0,_.prop)("value"));function*Ji(e,t,r,n){const a=Gi({},e),i=[...t];if((0,N._H)(a)){const t=(0,x.getAttrTypeLookupCode)(e.attrType);a.includeFilter=yield(0,Va.RE)(Yi,t,r,(0,_.propOr)(K.cu,"pageSize",a),a.pageNumber)}else if("sourceSystems"===a.fieldName){const{sources:e}=yield(0,Va.Ys)(k().selectors.getMetadata);a.includeFilter=((e,t)=>Xi(t,e).map((e=>{let{uri:t}=e;return(0,x.getLastUriPart)(t)})))(e,r)}else if((0,N.S9)(a)){const t=yield(0,Va.Ys)(k().selectors.getMetadata),n=(0,x.getEntityType)(t,a.entityTypeUri)||{},i=(0,_.pipe)((0,_.propOr)([],"displayedItems"),(0,_.filter)((0,_.propEq)("isRaw",!0)))(e);a.includeFilter=[...(o=n.matchGroups,l=r,Xi(l,o).map((0,_.prop)("uri"))),...Qi(i,r)]}else a.disableIncludeFilter=!0,i.push({values:[r],fieldName:e.fieldName,filter:"containsWordStartingWith",forceInclude:!0});var o,l;const s=yield(0,Va.Ys)(k().selectors.getGlobalSearchRequestOptions),c=(0,Ba.aw)([a],i,[e.fieldName],s);yield(0,Va.RE)(eo,c,e,a.includeFilter,n)}function*eo(e,t,r,n){try{const a=yield(0,Va.RE)(jl,e.url,e.options),i=yield(0,Va.Ys)(k().selectors.getLookups),o=Wi(a,[t]);if(r){const e=t.fieldName;o[e]=(0,za.AX)(o[e],r)}const l=yield(0,Va.Ys)(k().selectors.getMetadata),s=yield(0,Va.Ys)(ki.Xf);yield(0,Va.gz)(n((0,za.HC)(l,o,[t],i,{allowedEntityTypes:s})))}catch(e){console.warn(e)}}function*to(e,t){const r=yield(0,Va.Ys)(k().selectors.getLookups),n=(0,za.U4)(e,r),a=((e,t,r)=>{const n=((e,t)=>(0,_.pipe)(Object.entries,(0,_.reduce)(((e,r)=>{let[n,a]=r;const i=t.find((0,_.propEq)("fieldName",n));if(!i)return e;const{attrType:o}=i,l=(0,x.getAttrTypeLookupCode)(o);return e[l]={type:l,codeValues:(0,_.uniq)([...(0,_.pathOr)([],[l,"codeValues"],e),...Object.keys(a)])},e}),{}),_.values)(e))(e,t);return(0,x.getUnresolvedLookupsList)(r,n)})(t,e,r),i=(0,x.mergeLookupsLists)(n,a);i.length&&(yield(0,Va.RE)(Bi,i))}var ro=r(59295);function no(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ao(e,t,r[t])}))}return e}function ao(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*io(){const e=yield(0,Va.Ys)(k().selectors.getMetadata),t=yield(0,Va.Ys)(ki.Xf),r=yield(0,Va.Ys)(ki.sl);return(0,Pi.wM)(e,t,r)}const oo=e=>t=>{let{value:r}=t;return!e.length||e.includes(r)};function*lo(e){e=e||(yield(0,Va.Ys)(ui.FR));const t=yield(0,Va.Ys)(ki.XM);if((0,Pi.gj)(t)){const t=yield(0,Va.Ys)(k().selectors.getMetadata),r=yield(0,Va.Ys)(ro.V6),n=(0,N.$t)(t),a=yield(0,Va.Ys)(k().selectors.getGlobalSearchRequestOptions),i=(0,Ba.aw)([n],e,[n.fieldName],a),o=e=>{let{type:t=[]}=e;const n=t.filter(oo(r));return wi(n)};yield(0,Va.RE)($i,i,[n],o)}else yield(0,Va.gz)(wi([]))}function*so(){const e=yield(0,Va.Ys)(k().selectors.getMetadata),t=yield(0,Va.Ys)(ki.Xf),r=yield(0,Va.Ys)(ro.V6);return(0,za.wW)(e,{},t).filter(oo(r))}function*co(){const e=yield(0,Va.Ys)(k().selectors.getMetadata),t=yield(0,Va.RE)(io),r=yield(0,Va.Ys)(ki.uJ),n=(0,Pi.oX)().map((0,_.prop)("id")),a=(0,_.pipe)((0,_.map)((0,_.filter)((0,_.pipe)((0,_.prop)("id"),(0,_.cond)([[(0,_.includes)("."),_.T],[(0,_.includes)(_.__,n),_.T],[_.T,_.F]])))),_.toPairs,(0,_.map)((t=>{let[r,n]=t;return[r,(0,Pi.Wh)(e,r,(0,_.map)((0,_.prop)("id"),n)).map(((e,t)=>{const r=n.find((0,_.propEq)("id",e.id)),{size:a,autoResize:i=0!==t&&!a}=r||{};return(0,_.reject)(_.isNil,no({},e,{size:a,autoResize:i}))}))]})),_.fromPairs)(r),i=!(0,_.equals)(r,a),o=Object.keys(t),l=Object.keys(a);var s;!i&&(0,_.equals)(new Set(o),new Set(l))||(yield(0,Va.gz)((s=no({},t,(0,_.pick)(o,a)),{type:Oe,payload:s})))}function*uo(){const e=yield(0,Va.Ys)(k().selectors.getMetadata),t=yield(0,Va.Ys)(D.DX),r=(yield(0,Va.Ys)(ki.IJ))?yield(0,Va.RE)(so):yield(0,Va.RE)(ss),n=(0,Pi.nx)(e,r,t).map((0,_.prop)("value")),a=yield(0,Va.Ys)(ki.o4);n.includes(a)||(yield(0,Va.gz)(Si(n[0],!0)))}function*po(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{silent:t}=e.payload||{};if(!t){const e=yield(0,Va.Ys)(ki.tB),t=yield(0,Va.Ys)(ui.t9);if((0,x.isAvailableEntityTypeForDataTenant)(t,e)){const t=yield(0,Va.Ys)(ui.BP,{entityTypeUri:e});(0,_.isNil)(t)&&(yield(0,Va.gz)(Xa()))}else yield(0,Va.gz)(Ka([],e))}}function*mo(e){const t=e.payload;yield(0,Va.RE)(po,e);const r=yield(0,Va.Ys)(ki.gu);if((0,Pi.gj)(t)&&0===r.length){const e=yield(0,Va.RE)(so);yield(0,Va.gz)(wi(e)),yield(0,Va.RE)(lo)}}function*go(){const e=yield(0,Va.Ys)(ki.qx),t=yield(0,Va.Ys)(ui.Qy);e!==K.om.MAP&&t.length&&(yield(0,Va.gz)(ri(null)))}function*yo(e){const t=(0,x.removeDtssPrefixFromEntityUri)(e.payload.uri),r=yield(0,Va.Ys)(ki.tB),n=((yield(0,Va.Ys)(ui.BP,{entityTypeUri:r}))||[]).map((0,_.prop)("uri")),a=(yield(0,Va.Ys)(ui.fx,{entityTypeUri:r}))||0,i=(yield(0,Va.Ys)(ui.Uz,{entityTypeUri:r}))||K.Tu[0],o=n.indexOf(t)+a*i,l=yield(0,Va.Ys)(ui.NU,{entityTypeUri:r}),s=yield(0,Va.Ys)(k().selectors.getTenant),c=yield(0,Va.Ys)(ui.lF);yield(0,Va.gz)(P.search.actions.setSearchNavigationData({uri:t,index:o,total:l,tenant:c||s,cache:n}))}const fo=[function*(){yield(0,Va.Fm)(Ce,po)},function*(){yield(0,Va.Fm)(Ne,mo)},function*(){yield(0,Va.Fm)([Xe,Qe,et],uo)},function*(){yield(0,Va.Fm)(De,go)},function*(){yield(0,Va.Fm)(P.ui.constants.UIActions.OPEN_ENTITY,yo)}],ho=e=>({type:or,payload:e}),Eo=e=>({type:lr,payload:e}),bo=()=>({type:Er}),vo=e=>({type:_r,payload:e}),To=e=>({type:Ir,payload:e}),Oo=(e,t)=>({type:Pr,payload:{uri:e,isLoading:t}});var xo=r(90533),Co=r(86374),So=r(4898);function wo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ao(e,t,r[t])}))}return e}function Ao(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*Ro(){yield(0,Va.gz)(To(!0));try{const t=yield(0,Va.Ys)(k().selectors.getUserName),r=e=>wo({},e,{isOwnSearch:t===e.owner}),n=yield(0,Va.RE)(_o),{result:a=[],total:i}=yield(0,Va.RE)(x.getSavedSearches,n);yield(0,Va.gz)((e=>({type:ur,payload:e}))(i));const o=yield(0,Va.Ys)(k().selectors.getMetadata),l=yield(0,Va.Ys)(k().selectors.getDataTenants),s=yield(0,Va.Ys)(k().selectors.getCanUserReadWorkflowDataTask);yield(0,Va.gz)((e=a.map(r).map((0,Co.z7)(o,l,s)),{type:pr,payload:e})),yield(0,Va.gz)(To(!1)),yield(0,Va.RE)(Do,a)}catch(e){yield(0,Va.gz)(To(!1))}var e}function*_o(){const e=yield(0,Va.Ys)(xo.s6),t=yield(0,Va.Ys)(xo.wH),r=yield(0,Va.Ys)(xo.U3),n=yield(0,Va.Ys)(xo.VS),a=yield(0,Va.Ys)(xo.kU),{field:i,order:o}=yield(0,Va.Ys)(xo.rT);return{offset:e*t,max:e,containsWordStartingWith:r,favoriteOnly:n,findPublic:a,countResults:!1,sortBy:K.PW[i],sortOrder:o}}function*Io(e){const t=yield(0,Va.Ys)(xo.EH,e.payload);yield(0,Va.RE)(No,t)}function*No(e,t){yield(0,Va.gz)(Oo(e.uri,!0));try{const{total:r}=yield(0,Va.RE)(x.getTotalsForQuery,(0,x.replacePlaceholdersInQuery)(e.query),Boolean(t));yield(0,Va.gz)(((e,t)=>({type:dr,payload:{uri:e,total:t}}))(e.uri,r))}catch(e){gi(e)}yield(0,Va.gz)(Oo(e.uri,!1))}function*Do(e){const t=yield(0,Va.Ys)(k().selectors.getQueryEstimatorEnabled);return yield(0,Va.$6)(e.map((e=>(0,Va.RE)(No,e,t))))}function*Po(e){const{uri:t,isPublic:r}=e.payload,n=yield(0,Va.Ys)(xo.EH,t);if(n){yield(0,Va.gz)(To(!0));try{yield(0,Va.RE)(x.markSavedSearchAsPublic,(0,Co.Tp)(n),r),yield(0,Va.gz)(((e,t)=>({type:vr,payload:{uri:e,isPublic:t}}))(t,r))}catch(e){gi(e)}yield(0,Va.gz)(To(!1))}}function*ko(e){const{uri:t,isFavorite:r}=e.payload,n=yield(0,Va.Ys)(xo.EH,t);if(n){yield(0,Va.gz)(To(!0));try{yield(0,Va.RE)(x.markSavedSearchAsFavorite,(0,Co.Tp)(n),r),yield(0,Va.gz)(((e,t)=>({type:Or,payload:{uri:e,isFavorite:t}}))(t,r))}catch(e){gi(e)}yield(0,Va.gz)(To(!1))}}function*Lo(e){const{uri:t,isGlobalFilter:r}=e.payload,n=yield(0,Va.Ys)(xo.EH,t);if(n){const e=(0,Co.V2)(n),{uiState:t}=e,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["uiState"]);(0,x.isObject)("2.0"===t.version?t:t.state)||!r?yield(0,Va.gz)(((e,t)=>({type:"SAVED_SEARCHES_MARK_GLOBAL_FILTER",payload:{savedSearch:e,isGlobalFilter:t}}))(wo({},a,{uiState:t,query:(0,x.replacePlaceholdersInQuery)((0,_.propOr)("","query",a))}),r)):(0,pi.U)({errorMessage:"Saved Search is incorrect"},{title:mi().text("Saved Search can't be mark as global")})}}function*Uo(e){const{uri:t,name:r}=e.payload,n=yield(0,Va.Ys)(xo.EH,t);if(n&&r!==n.name){yield(0,Va.gz)(To(!0));try{yield(0,Va.RE)(x.updateSavedSearch,wo({},(0,Co.Tp)(n),{name:r})),yield(0,Va.gz)(((e,t)=>({type:Sr,payload:{uri:e,name:t}}))(t,r))}catch(e){gi(e)}yield(0,Va.gz)(To(!1))}}function*jo(){const e=yield(0,Va.Ys)(xo.Kh);yield(0,Va.gz)(To(!0));try{yield(0,Va.$6)(e.map((e=>(0,Va.RE)(x.deleteSavedSearch,e)))),yield(0,Va.gz)(vo(e.map((0,_.prop)("uri"))))}catch(e){gi(e)}yield(0,Va.gz)(To(!1))}function*Fo(e){const t=e.payload;yield(0,Va.gz)(To(!0));try{yield(0,Va.RE)(x.deleteSavedSearch,{uri:t}),yield(0,Va.gz)(vo([t]))}catch(e){gi(e)}yield(0,Va.gz)(To(!1))}function*Mo(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const r=yield(0,Va.Ys)(xo.Cc,e),n=yield(0,Va.Ys)(So.Z,t);return{query:r,uiState:n}}function*Vo(e){let{payload:{name:t,share:r}}=e;const{query:n,uiState:a}=yield(0,Va.RE)(Mo,!0),i={isFavorite:!1,isPublic:r===K.ib.public,name:t,query:n,uiState:a},o=yield(0,Va.Ys)(xo.tp);yield(0,Va.gz)(Oi(!1));try{yield(0,Va.gz)(_i(mi().text("Saving search...")));const e=yield(0,Va.RE)(x.createSavedSearch,[i]);e[0].successful?(yield(0,Va.gz)(ho(e[0].object)),yield(0,Va.gz)(Eo(!1)),yield(0,Va.gz)(_i(mi().text("Search saved successfully"))),o&&(yield(0,Va.gz)(o))):gi(e)}catch(e){gi(e)}}function*Bo(e){const{uri:t,debounceTime:r}=e.payload;yield(0,Va.gz)(Ti(!1));const n=yield(0,Va.Ys)(xo.EH,t),a=(0,xo.In)(n)||{},{errors:i}=a;i&&i.length?function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];(0,pi.U)(e,{message:mi().text("Saved Search can't be applied")})}(i):(yield(0,Va.gz)(ho(n)),(yield(0,Va.Ys)(ui.lF))&&(a.currentTenant=yield(0,Va.Ys)(k().selectors.getTenant)),yield(0,Va.gz)(P.search.actions.updateState(wo({},a,{debounceTime:r}))),yield(0,Va.qn)(U.Z.STATE_UPDATED))}const zo=[function*(){yield(0,Va.Fm)([cr,mr,gr,Nr,yr,Lr],Ro)},function*(){const e={[br]:Po,[Tr]:ko,[Rr]:Fo,[Ar]:jo,[Cr]:Uo,[xr]:Lo},t=yield(0,Va.ZO)(Object.keys(e));for(;;){const r=yield(0,Va.qn)(t);yield(0,Va.RE)(e[r.type],r)}},function*(){yield(0,Va.Fm)([ir],Vo)},function*(){yield(0,Va.Fm)([Dr],Bo)},function*(){yield(0,Va.ib)([kr],Io)}];function*Ho(e){try{yield(0,Va.RE)(x.createActivity,{label:x.ACTIVITY_TYPES.userSearch,description:JSON.stringify({activity:e,version:"2.0"})})}catch(e){console.warn(e)}}const Yo=e=>({type:Qe,payload:{groupId:e}}),Wo=(e,t)=>({type:nt,payload:{groupId:e,attributeId:t,attribute:Ct()}}),Go=(e,t,r)=>({type:nt,payload:{groupId:e,attributeId:t,attribute:St(r)}}),qo=(e,t,r)=>({type:at,payload:{groupId:e,attributeId:t,attributeData:wt(r)}}),Zo=(e,t)=>({type:at,payload:{groupId:e,attributeId:t,attributeData:null}}),$o=(e,t,r)=>({type:it,payload:{groupId:e,attributeId:t,selectInfo:r}}),Ko=(e,t,r)=>({type:ot,payload:{groupId:e,attributeId:t,operator:r}}),Xo=(e,t)=>({type:lt,payload:{groupId:e,attributeId:t}}),Qo=(e,t)=>({type:st,payload:{groupId:e,attributeId:t}}),Jo=(e,t)=>({type:ct,payload:{groupId:e,attributeId:t,id:(0,Ke.x0)()}}),el=(e,t,r)=>({type:ut,payload:{groupId:e,attributeId:t,filter:r}}),tl=(e,t,r)=>({type:pt,payload:{groupId:e,attributeId:t,values:r}}),rl=(e,t)=>{let{attribute:r,value:n,debounceTime:a=0,pageNumber:i=1,currentOptions:o}=t;return{type:mt,payload:{groupId:e,attribute:r,value:n,debounceTime:a,pageNumber:i,currentOptions:o}}},nl=(e,t,r)=>({type:gt,payload:{groupId:e,attributeId:t,values:r}}),al=(e,t)=>({type:yt,payload:{groupId:e,attribute:t}});var il=r(44006);function*ol(e){let{groups:t,findGroupPath:r=At,attributesPropName:n,groupId:a,attributeId:i,selectInfo:o,actions:l}=e;const{checked:s,attribute:c,index:u,selectedAttributes:p}=o,{addAttributeAfter:d,changeAttribute:m,clearAttribute:g,deleteAttribute:y}=l,f=(0,_.pipe)(r(a),(0,_.path)(_.__,t),(0,_.propOr)([],n))(t),h=e=>(0,_.path)([e,"id"],f),E=f.findIndex((0,_.propEq)("id",i));if(i&&0===u)if(s)yield(0,Va.gz)(m(a,i,c));else{let e=p[u+1];e?(yield(0,Va.gz)(m(a,i,e)),yield(0,Va.gz)(y(a,h(E+1)))):yield(0,Va.gz)(g(a,i))}else{const e=p.length-u,t=i?E+u:f.length-e;s?yield(0,Va.gz)(d(a,h(t-1),c)):yield(0,Va.gz)(y(a,h(t)))}}function ll(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){sl(e,t,r[t])}))}return e}function sl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*cl(e){const{groupId:t,attributeId:r,selectInfo:n}=e.payload,a=yield(0,Va.Ys)(ro.go),i={addAttributeAfter:Go,changeAttribute:qo,clearAttribute:Zo,deleteAttribute:Xo};yield(0,Va.RE)(ol,{groups:a,attributesPropName:"attributes",groupId:t,attributeId:r,selectInfo:n,actions:i}),yield(0,Va.gz)(Yo(t))}function*ul(e){const{attribute:t,groupId:r}=e.payload,n=yield(0,Va.Ys)(ro._7,r),a=yield(0,Va.Ys)(k().selectors.getGlobalSearchRequestOptions),{data:{fieldName:i},values:o}=t,l=yield(0,Va.Ys)(ui.L7,n,i),s=ll({},t.data,{values:o?(0,_.flatten)(o):void 0,pageSize:t.data.pageSize+1}),c=(0,Ba.aw)([s],l,[],a);yield(0,Va.RE)($i,c,[s],(e=>((e,t,r)=>({type:dt,payload:{groupId:e,attributeId:t,values:r}}))(r,t.id,e[i])))}function*pl(e){const{attribute:t,value:r,pageNumber:n=1,debounceTime:a,groupId:i,currentOptions:o=[]}=e.payload,{entityTypeUri:l,fieldName:s}=t.data;if(""===r&&1===n)yield(0,Va.gz)(nl(i,t.id,void 0));else{a&&(yield(0,Va.gw)(a));const e=yield(0,Va.Ys)(ro.ad,i,t.id),c=e=>nl(i,t.id,o.concat(e[s]));if(r){const a=l?[{values:[l],fieldName:"type",filter:"equals"}]:[],i=yield(0,Va.Ys)(ui.L7,a,s);yield(0,Va.rM)(Ji,ll({},t.data,{displayedItems:e,pageNumber:n,pageSize:t.data.pageSize+1}),i,r,c)}else{const r=yield(0,Va.Ys)(ro._7,i),a=yield(0,Va.Ys)(ui.L7,r,s);yield(0,Va.rM)(Ki,ll({},t.data,{displayedItems:e,pageNumber:n,pageSize:t.data.pageSize+1}),a,c)}}}function*dl(){const e=yield(0,Va.Ys)(k().selectors.getSearchKeyword),t=yield(0,Va.Ys)(ui.vH),r=yield(0,Va.RE)(Xl),n=yield(0,Va.Ys)(k().selectors.getMetadata),a=yield(0,Va.Ys)(k().selectors.getDataTenants),i=(0,il.h)(n,a,r);yield(0,Va.gz)(P.search.actions.updateState({advanced:i,keyword:e,map:t}))}function*ml(e){const{groupId:t,attributeId:r}=e.payload;yield(0,Va.gz)(Xo(t,r)),yield(0,Va.gz)(Yo(t))}function*gl(){if(yield(0,Va.Ys)(ki.IJ)){const e=yield(0,Va.Ys)(ro.go),t=yield(0,Va.Ys)(ki.Xf);for(const r of e){const e=r.entityTypes||[];if((t?e.filter((e=>t.includes(e))):e).length!==e.length){yield(0,Va.gz)(Qa({silent:!0}));break}}}}const yl=[function*(){yield(0,Va.ib)([it],cl)},function*(){yield(0,Va.Fm)([mt],pl)},function*(){yield(0,Va.ib)(ht,dl)},function*(){yield(0,Va.ib)(yt,ul)},function*(){yield(0,Va.ib)([st],ml)}];function fl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){hl(e,t,r[t])}))}return e}function hl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*El(){const e=yield(0,Va.Ys)(ui.FR);yield(0,Va.RE)(vl);const t=yield(0,Va.Ys)(ki.tB);var r;yield(0,Va.gz)((r=t,{type:U.Z.RESET_PAGE,payload:{entityTypeUri:r}})),yield(0,Va.rM)(Ql,e),yield(0,Va.rM)(Al,e),(yield(0,Va.Ys)(ki.IJ))?yield(0,Va.rM)(lo,e):yield(0,Va.rM)(bi)}function*bl(e){const{debounceTime:t}=e.payload||{};t&&(yield(0,Va.gw)(t));const r=yield(0,Va.Ys)(ui.FR);yield(0,Va.rM)(Tl,r)}function*vl(){const e=yield(0,Va.Ys)(ki.tB);var t;yield(0,Va.gz)((t=e,{type:U.Z.CLEAR_RESULTS,payload:t}))}function*Tl(e){const t=yield(0,Va.Ys)(k().selectors.getMetadata),r=yield(0,Va.Ys)(ki.tB),n=yield(0,Va.Ys)(ui.fx,{entityTypeUri:r}),a=yield(0,Va.Ys)(ui.Uz,{entityTypeUri:r}),i=yield(0,Va.Ys)(ui.L9,{entityTypeUri:r}),o=yield(0,Va.Ys)(ui.NW,{entityTypeUri:r});let l,s=e,c=[];if(r){const n={fieldName:"type",filter:"equals",values:[r]};s=e.filter((e=>"type"!==e.fieldName)).concat(n);const a=yield(0,Va.RE)(wl,r);c=(0,_.uniq)(c.concat(a).concat((0,Ba.kx)(t,s,[Ba.cI]))),l=!0}else c=(0,_.uniq)(c.concat((0,Ba.kx)(t,s,[Ba.Bo,Ba.cI]))),l=!1;const u=fl({page:n,rowsPerPage:a,sortOrder:i,sortField:o,forceOvOnly:l},yield(0,Va.Ys)(k().selectors.getGlobalSearchRequestOptions),{select:c}),p=(0,Ba.XP)(s,u),d=yield(0,Va.Ys)(ui.lF);yield(0,Va.gz)(ti(!0));try{let e;if(d){const t=(0,Ba.kH)(s,u);e=yield(0,Va.RE)(jl,t)}else{const t=(0,Ba.Lv)(s,u);e=yield(0,Va.RE)(jl,K.NV,t)}Array.isArray(e)||(e=[]),yield(0,Va.RE)(Ol,(0,_.reject)(_.isNil,{query:p,sortField:o,sortOrder:i,dataTenant:d})),e=yield(0,Va.RE)(Ul,e),yield(0,Va.gz)(Ka(e,r))}catch(e){yield(0,Va.gz)(Ka([],r))}yield(0,Va.gz)(ti(!1))}function*Ol(e){var t;yield(0,Va.gz)((t=e.query,{type:U.Z.UPDATE_URL,payload:t}));const r=yield(0,Va.Ys)(k().selectors.getSearchProviderData);(0,_.equals)(null==r?void 0:r.data,e)||(yield(0,Va.gz)(P.search.actions.setSearchNavigationData(null))),yield(0,Va.gz)(P.search.actions.setSearchProviderData({type:"search",data:e}))}function*xl(e){const{columns:t,prevColumns:r}=e.payload;if((0,Pi.tU)(t,r)){const e=yield(0,Va.Ys)(ki.o4),t=(yield(0,Va.Ys)(ui.BP,{entityTypeUri:e})).map((e=>e.uri)),r=yield(0,Va.RE)(wl,e),n=yield(0,Va.Ys)(ui.FR),a=yield(0,Va.Ys)(k().selectors.getGlobalSearchRequestOptions),i=(0,Ba.aG)(t,n,fl({select:r},a));yield(0,Va.gz)(ti(!0));try{let t=yield(0,Va.RE)(jl,i.url,i.options);t=yield(0,Va.RE)(Ul,t),yield(0,Va.gz)(Ka(t,e))}catch(t){yield(0,Va.gz)(Ka([],e)),gi(t)}yield(0,Va.gz)(ti(!1))}}function*Cl(){const e=yield(0,Va.Ys)(ki.tB),t=yield(0,Va.Ys)(ui.BP,{entityTypeUri:e});t&&(yield(0,Va.gz)(P.search.actions.searchResultsSet(t)))}function*Sl(e){const{entityTypeUri:t,keywordValue:r}=e.payload;yield(0,Va.gz)(function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return{type:L.k.CLEAR_ALL_VALUES,payload:{silent:e}}}(!0)),yield(0,Va.gz)(ii("type",[t],!0)),yield(0,Va.gz)(P.search.actions.keywordUpdated({value:r,isRawFilter:!1}))}function*wl(e){const t=yield(0,Va.Ys)(ki.Gv,e);return(0,Pi.vw)(t)}function*Al(e){const t=yield(0,Va.Ys)(k().selectors.getGlobalSearchRequestOptions),r=(0,Ba.Vg)(e,[],t);try{const e=yield(0,Va.RE)(jl,K.jS,{method:"POST",body:JSON.stringify(r)});yield(0,Va.gz)(ei(e.total))}catch(e){yield(0,Va.gz)(ei(0))}}function*Rl(){yield(0,Va.RE)(Il);const e=yield(0,Va.RE)(Mo,!0);(0,_.isEmpty)(e.query)||(yield(0,Va.RE)(Ho,e))}const _l=[dt];function*Il(){for(;yield(0,Va.Ys)(ro.UM);)yield(0,Va.qn)(_l)}function*Nl(e){const{debounceTime:t}=e.payload||{};t&&(yield(0,Va.gw)(t)),(0,za.$L)(e)&&(yield(0,Va.RE)(as)),(0,_.pathOr)(!1,["payload","silent"],e)||(yield(0,Va.RE)(El),yield(0,Va.RE)(Rl))}function*Dl(e){var t;const r=(0,_.path)(["payload","searchOptions"],e),n=(0,_.path)(["payload","errors"],e),a=(0,_.pathOr)(0,["payload","debounceTime"],e);n&&n.length&&function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];(0,pi.U)(e,{message:mi().text("Can't apply search state")})}(n),!(null!==(t=yield(0,Va.Ys)(k().selectors.getShowSearchByOv))&&void 0!==t?t:yield(0,Va.Ys)(ki.cC))&&r&&r.searchByOv&&(yield(0,Va.gz)(P.search.actions.updateSearchOptions({searchByOv:!1,ovOnly:!1}))),yield(0,Va.RE)(ls),yield(0,Va.RE)(gl),yield(0,Va.RE)(co),yield(0,Va.RE)(uo),yield(0,Va.RE)(Pl),yield(0,Va.gz)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return{type:U.Z.STATE_UPDATED,payload:{debounceTime:e}}}(a))}function*Pl(){const e=yield(0,Va.Ys)(ki.d7),t=yield(0,Va.Ys)(ui.Qy);!e&&t.length&&(yield(0,Va.gz)(ri(null,null,!0)))}function*kl(){const e=yield(0,Va.Ys)(ui.A7),{activityFilter:t,globalFilter:r}=yield(0,Va.Ys)(k().selectors.getGlobalSearchRequestOptions),n=yield(0,Va.Ys)(k().selectors.getSearchOptions),a=n&&n.searchByOv,i=[(0,Ba.s4)(e,[],{globalFilter:r})];a&&i.push("options=searchByOv"),t&&i.push(`activeness=${t}`);const o=i.filter(_.identity).join("&"),l=new URLSearchParams(o);if(yield(0,Va.Ys)(k().selectors.getSharedPreferencesEnabled)){const e=yield(0,Va.Ys)(k().selectors.getServicesPath),t=yield(0,Va.Ys)(k().selectors.getTenant),r=yield(0,Va.Ys)(k().selectors.getEnvironment),n=yield(0,Va.Ys)(k().selectors.getUserName),a=yield(0,Va.Ys)(ki.XM),i=yield(0,Va.Ys)(ki.uJ),o=(0,_.pipe)((0,_.map)((0,_.pipe)((0,_.map)((0,_.path)(["attrType","uri"])),(0,_.reject)(x.isEmptyValue))),(0,_.reject)(_.isEmpty)),s="searchExportData",c={name:s,tenant:t,environment:r,user:n,servicesPath:e,value:{searchResultsColumnsUris:(0,Pi.gj)(a)?o(i):void 0}};try{yield(0,Va.RE)(x.setSharedPreferences,c),l.set("sharedPreferenceName",s)}catch(e){gi(e)}}yield(0,Va.gz)(P.ui.actions.openConsoleApp("Export","entities",l.toString()))}function*Ll(){yield(0,Va.gz)(P.ui.actions.openConsoleApp("Data Loader","projects"))}function*Ul(e){const t=yield(0,Va.Ys)(ui.lF);return e&&t?e.map((0,x.enrichEntityWithDataTenant)(t)):e}function*jl(e,t){const r=yield(0,Va.Ys)(k().selectors.getTenant),n=yield(0,Va.Ys)(ui.lF),a=yield(0,Va.Ys)(k().selectors.getDtssPath);return yield(0,Va.RE)(Ba.Es,{url:e,options:t,customerTenant:r,dataTenant:n,dtssPath:a})}const Fl=[L.k.CHANGE_VALUES,P.search.constants.KEYWORD_UPDATED,U.Z.REFRESH,L.k.CLEAR_ALL_VALUES,U.Z.MAP_CHANGE_VALUE,U.Z.CLEAR_ALL,U.Z.STATE_UPDATED,ft,P.search.constants.SEARCH_OPTIONS_UPDATED,P.search.constants.ACTIVITY_FILTER_UPDATED,P.search.constants.GLOBAL_FILTER_UPDATED,U.Z.CHANGE_CURRENT_TENANT],Ml=[function*(){yield(0,Va.Fm)(Fl,Nl)},function*(){yield(0,Va.Fm)([U.Z.CHANGE_PAGE,U.Z.RESET_PAGE,U.Z.CHANGE_ROWS_PER_PAGE,U.Z.REFRESH_DISPLAYED_ENTITIES,U.Z.CHANGE_SORT],bl)},function*(){yield(0,Va.Fm)(xe,xl)},function*(){yield(0,Va.Fm)([U.Z.UPDATE_ENTITIES,Ce,Ne],Cl)},function*(){yield(0,Va.Fm)(U.Z.SHOW_MORE_RESULTS_FOR_ENTITY_TYPE,Sl)},function*(){yield(0,Va.Fm)(P.search.constants.UPDATE_STATE,Dl)},function*(){yield(0,Va.Fm)(U.Z.EXPORT_RESULTS,kl)},function*(){yield(0,Va.Fm)(U.Z.OPEN_DATA_LOADER,Ll)}];var Vl=r(56906);function Bl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*zl(e,t){try{const[r,n]=yield(0,Va.RE)(Hl,e,[]);if((0,_.isNil)(r)||(0,_.isNil)(n))yield(0,Va.gz)(oi({[e.fieldName]:[]}));else{const[a,i]=(0,za.dG)(e.type),o=(0,za.q7)(a,r),l=(0,za.q7)(i,n),s=(0,ci.Oz)(e.attrType&&e.attrType.type),[c,u]=s.greaterThan(o,l)?[l,o]:[o,l],p=yield(0,Va.RE)(Yl,e,c,u,t),d={[e.fieldName]:p};yield(0,Va.gz)(oi(d))}}catch(e){console.warn(e)}}function*Hl(e,t){const r=yield(0,Va.Ys)(k().selectors.getGlobalSearchRequestOptions),n=(0,Ba.rN)(e,t,[e.fieldName],r),a=yield(0,Va.RE)(jl,n.url,n.options),i=Wi(a,[e]),{min:o,max:l,count:s}=(0,za.Kn)(i,[e])[e.fieldName];return s?[(0,N.bB)(e)?0:o,l]:[]}function*Yl(e,t,r,n){const a=e.attrType&&e.attrType.type,i=(0,Vl.C)(a),o=i.getInterval(t,r,50),l=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Bl(e,t,r[t])}))}return e}({interval:o,offset:t},yield(0,Va.Ys)(k().selectors.getGlobalSearchRequestOptions)),s=(0,Ba.ti)(e,n,[e.fieldName],l),c=yield(0,Va.RE)(jl,s.url,s.options),u=yield(0,Va.Ys)(k().selectors.getMetadata),p=Wi(c,[e]),d=(0,za.HC)(u,p,[e]);return i.addRanges(d[e.fieldName],t,r,o).map(((e,t,n)=>({value:[e.value,t<n.length-1?n[t+1].value:r],number:e.number})))}function Wl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Gl={matches:Ba.dW,"dtPotentialMatches.matches":Ba.dW,"potentialMatches.matchScore":Ba._9};function*ql(e,t){try{const[r,n]=yield(0,Va.RE)(Hl,e,[]);if((0,_.isNil)(r)||(0,_.isNil)(n))yield(0,Va.gz)(oi({[e.fieldName]:[]}));else{const[a,i]=(0,za.dG)(e.type),o=(0,za.q7)(a,r),l=(0,za.q7)(i,n),s=yield(0,Va.RE)(Zl,e,o,l,t),c={[e.fieldName]:s};yield(0,Va.gz)(oi(c))}}catch(e){console.warn(e)}}function*Zl(e,t,r,n){const a=yield(0,Va.Ys)(k().selectors.getGlobalSearchRequestOptions),i=Math.min(5,r-t+1),o=yield(0,Va.RE)(x.rawRequest,Gl[e.fieldNameForRequest||e.fieldName](t,r,i,n,[e.fieldName],function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Wl(e,t,r[t])}))}return e}({},a,{dataTenant:e.dataTenant})));return o.map((e=>({number:e.count,value:[e.from,e.to]})))}function $l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Kl(e,t,r[t])}))}return e}function Kl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*Xl(){const e=yield(0,Va.Ys)(D.X0),t=yield(0,Va.Ys)(D.Mp);return Object.values((0,za.t8)(e,t))}function*Ql(e){const t=yield(0,Va.RE)(Xl),[r,n]=(0,_.partition)(N.bB,t);let[a,i]=(0,_.partition)(x.isRangeFacet,n);for(let t=0;t<r.length;t++)yield(0,Va.rM)(ql,r[t],e);for(let t=0;t<a.length;t++)yield(0,Va.rM)(zl,a[t],e);const[o,l]=(0,_.partition)((e=>e.values&&e.values.length),i);for(let t=0;t<o.length;t++)yield(0,Va.rM)(es,o[t],e);const[s,c]=(0,_.partition)(N.DT,l);for(const t of s)yield(0,Va.rM)(ts,[t],e);c.length&&(yield(0,Va.rM)(ts,c,e))}function*Jl(e){const t=yield(0,Va.Ys)(ui.FR),[r,n]=(0,_.partition)(N.bB,e.payload),[a,i]=(0,_.partition)(x.isRangeFacet,n),[o,l]=(0,_.partition)(N.DT,i);for(let e=0;e<r.length;e++)yield(0,Va.rM)(ql,r[e],t);for(let e=0;e<a.length;e++)yield(0,Va.rM)(zl,a[e],t);for(const e of o)yield(0,Va.rM)(ts,[e],t);l.length&&(yield(0,Va.rM)(ts,l,t))}function*es(e,t,r){const n=yield(0,Va.Ys)(k().selectors.getGlobalSearchRequestOptions),a=(0,Ba.aw)([$l({},e,{pageSize:e.pageSize+1})],t,[e.fieldName],n,r);yield(0,Va.RE)(rs,a,[e])}function*ts(e,t,r){const n=yield(0,Va.Ys)(k().selectors.getGlobalSearchRequestOptions),a=(0,Ba.aw)(e.map((e=>$l({},e,{pageSize:e.pageSize+1}))),t,[],n,r);yield(0,Va.RE)(rs,a,e)}function*rs(e,t){yield(0,Va.RE)($i,e,t,oi)}function*ns(e){const{facetFieldName:t,value:r,debounceTime:n,pageNumber:a=1,currentOptions:i=[]}=e.payload;if(""===r&&1===a)yield(0,Va.gz)((e=>({type:L.k.DESTROY_FILTERED_DATA,payload:e}))(t));else{const e=yield(0,Va.Ys)(D.X0),o=yield(0,Va.Ys)(D.Mp),l=$l({},(0,za.t8)(e,o)[t]);if("type"===t){const e={[t]:[...l.data.filter((e=>e.label.toLowerCase().includes(r.toLowerCase())))]};yield(0,Va.gz)(li(e))}else{n&&(yield(0,Va.gw)(n));const e=yield(0,Va.Ys)(ui.FR),o=yield(0,Va.Ys)(D.rM,t),s=e=>li({[t]:i.concat(e[t])});r?yield(0,Va.rM)(Ji,$l({},l,{displayedItems:o,pageNumber:a,pageSize:l.pageSize+1}),e,r,s):yield(0,Va.rM)(Ki,$l({},l,{pageNumber:a,pageSize:l.pageSize+1}),e,s)}}}function*as(){const e=yield(0,Va.Ys)(D.DX),t=t=>t.entityTypeUri&&t.entityTypeUri!==e[0],r=yield(0,Va.Ys)(D.Mp);if(1!==e.length||r.some(t)){const n=r.filter((r=>1!==e.length&&!!r.entityTypeUri||1===e.length&&t(r))).map((e=>e.fieldName));n.length&&(yield(0,Va.gz)(ai(n)))}}function*is(e){const{facetsToAdd:t=[],fieldNamesToDelete:r=[],changedEntityTypes:n,addToEnd:a=!1}=e.payload;if(t.length||r.length){t.length&&(yield(0,Va.gz)(ni(t,a)));const e=yield(0,Va.RE)(Xl);let o=!1;if(r.length){const t=e.filter((e=>e.values&&e.values.length));o=r.some((e=>t.some((t=>t.fieldName.startsWith(e))))),yield(0,Va.gz)(ai(r))}if(null!=n)yield(0,Va.gz)(ii("type",n));else if(o)yield(0,Va.gz)(function(){let{debounceTime:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{type:U.Z.REFRESH,payload:{debounceTime:e}}}());else if(t.length){const r=e.filter((e=>t.some((t=>e.fieldName.startsWith(t.fieldName)))));yield(0,Va.gz)((i=r,{type:L.k.REQUEST_GIVEN_FACETS_DATA,payload:i}))}}var i}function*os(){const e=yield(0,Va.Ys)(k().selectors.getSearchKeyword),t=yield(0,Va.Ys)(ui.vH),r=yield(0,Va.Ys)(ro.go),n=yield(0,Va.Ys)(k().selectors.getMetadata),a=yield(0,Va.Ys)(k().selectors.getDataTenants);if(Ga(n,r,a)){const i=((e,t,r)=>{const n=$a(e,t,r),a=Za(e,t,r),i=(0,_.pipe)(_.flatten,_.uniq)((0,Et.VO)(t)),o=(0,N.$t)(e);return a.reduce(((e,t)=>{let{fieldName:r,values:a}=t;const i=n.find((e=>e.fieldName===r));return i&&(e.facetsConfigs.push(i),e.facetsData[r]={values:a}),e}),{facetsConfigs:[o],facetsData:{[o.fieldName]:(l=i,(0,za.Kk)({values:l})?{values:l,showAllItems:!0}:{values:l})}});var l})(n,r,a);yield(0,Va.gz)(P.search.actions.updateState({facets:i,keyword:e,map:t}))}}function*ls(){if(!(yield(0,Va.Ys)(ki.IJ))){const e=yield(0,Va.Ys)(k().selectors.getMetadata);if((yield(0,Va.Ys)(D.Mp)).some(x.isTypeFacet)){const e=yield(0,Va.Ys)(ki.Xf),t=yield(0,Va.Ys)(D.DX);(e?t.filter((t=>e.includes(t))):t).length!==t.length&&(yield(0,Va.gz)(Qa({silent:!0})))}else{const t=[(0,N.$t)(e)];yield(0,Va.gz)(ni(t))}}}function*ss(){const e=yield(0,Va.Ys)(k().selectors.getMetadata),t=yield(0,Va.Ys)(D.X0),r=(0,za.t8)({type:t.type},[(0,N.$t)(e)]).type.data.reduce(((e,t)=>(e[(0,x.getLastUriPart)(t.value)]=t.number,e)),{}),n=yield(0,Va.Ys)(ki.Xf);return(0,za.wW)(e,r,n)}const cs=[function*(){yield(0,Va.Fm)([L.k.FILTER_FACET_DATA],ns)},function*(){yield(0,Va.ib)(L.k.REQUEST_GIVEN_FACETS_DATA,Jl)},function*(){yield(0,Va.ib)(L.k.HANDLE_CONFIGS_CHANGES,is)},function*(){yield(0,Va.ib)(L.k.CONVERT_FROM_ADVANCED_SEARCH,os)}];function us(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ps=e=>{const t=["view","searchResultsColumns"],r=(0,_.pathOr)({},t,e),n=(0,_.map)((0,_.map)((0,_.pipe)((0,_.omit)(["size"]),(e=>e.attrType?function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){us(e,t,r[t])}))}return e}({},e,{attrType:{uri:(0,_.pathOr)("",["attrType","uri"],e)}}):e))),r),a=(0,_.lensPath)(t),i=(0,_.omit)(["sortField","sortOrder","entityTypeTab"],e.view),o=(0,_.lensPath)(["view"]),l=["keyword"],s=(0,_.pathOr)("",l,e),c=(0,_.lensPath)(l),u=["map"],p=(0,_.pathOr)("",u,e),d=(0,_.lensPath)(u);return(0,_.pipe)((0,_.omit)(["searchOptions"]),(0,_.set)(o,i),(0,_.set)(a,n),(0,_.set)(c,s),(0,_.set)(d,p))(e)};function ds(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ms(e,t,r[t])}))}return e}function ms(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*gs(e){let{payload:{share:t}}=e;const{query:r,uiState:n}=yield(0,Va.RE)(Mo,!0),a=ds({},yield(0,Va.Ys)(xo.LA),{isPublic:t===K.ib.public,query:r,uiState:n}),i=yield(0,Va.Ys)(xo.tp);yield(0,Va.gz)(Oi(!1));try{yield(0,Va.gz)(_i(mi().text("Updating search..."))),yield(0,Va.RE)(x.updateSavedSearch,a),yield(0,Va.gz)(Eo(!1)),yield(0,Va.gz)(_i(mi().text("Search updated successfully"))),i&&(yield(0,Va.gz)(i))}catch(e){gi(e)}}function*ys(){const e=yield(0,Va.Ys)(xo.LA);if(!e)return void(yield(0,Va.gz)(Eo(!1)));const t=yield(0,Va.Ys)(k().selectors.getMetadata),r=yield(0,Va.Ys)(k().selectors.getDataTenants),n=yield(0,Va.Ys)(k().selectors.getCanUserReadWorkflowDataTask),{uiState:a}=(0,Co.z7)(t,r,n,yield(0,Va.RE)(Mo)),i=(e=>{let{savedUiState:t,actualUiState:r}=e;const n=ps(t),a=ps(r);if(!(0,_.equals)(n,a))return!1;if((0,_.path)(["view","searchResultsMode"],t)===K.ll.TABLE){const e=["view","sortField"],n=["view","sortOrder"],a=["view","entityTypeTab"],i=(0,_.path)(e,t),o=(0,_.path)(e,r),l=(0,_.path)(n,t),s=(0,_.path)(n,r),c=(0,_.path)(a,t),u=(0,_.path)(a,r);if(!(0,_.equals)(i,o)||!(0,_.equals)(l,s)||!(0,_.equals)(c,u))return!1}const i=["searchOptions"],o=(0,_.pathOr)(null,i,t),l=(0,_.pathOr)(null,i,r);return!!((0,_.isNil)(o)||(0,_.isNil)(l)||(0,_.equals)(o,l))})({savedUiState:e.uiState,actualUiState:a});yield(0,Va.gz)(Eo(!i))}function*fs(e){const t=yield(0,Va.Ys)(xo.LA);if(t)switch(e.type){case Sr:case vr:case Or:t.uri===e.payload.uri&&(yield(0,Va.gz)(ho(ds({},t,e.payload))));break;case _r:(0,_.includes)(t.uri,e.payload)&&(yield(0,Va.gz)(ho(null)));break;case sr:yield(0,Va.gz)(ho(ds({},t,{isPublic:e.payload.share===K.ib.public})));break;default:(yield(0,Va.Ys)(ui.kw))&&(yield(0,Va.gz)(ho(null)))}}function*hs(e){const t=yield(0,Va.Ys)(xo.EH,e);if(t)return t;const r=yield(0,Va.Ys)(k().selectors.getMetadata),n=yield(0,Va.Ys)(k().selectors.getDataTenants),a=yield(0,Va.Ys)(k().selectors.getCanUserReadWorkflowDataTask);try{const t=yield(0,Va.RE)(x.getSavedSearch,(0,Co.tk)(e));return(0,Co.z7)(r,n,a,t)}catch(e){return gi(e),null}}function*Es(e){const t=(0,_.path)(["payload","currentSavedSearchUri"],e);if(!t)return;const r=yield(0,Va.Ys)(xo.LA);if((0,_.prop)("uri",r)===t)return;const n=yield(0,Va.RE)(hs,t);n&&(yield(0,Va.gz)(ho(n)),yield(0,Va.RE)(ys))}const bs=[...Fl,Ce,U.Z.CHANGE_SORT,Ne,xe,Ae,we,De,L.k.CREATE_FACETS,L.k.DESTROY_FACETS,L.k.SHOW_MORE_ENTITY_TYPES],vs=[function*(){yield(0,Va.Fm)(bs,ys)},function*(){yield(0,Va.Fm)([sr],gs)},function*(){yield(0,Va.Fm)([Sr,vr,Or,_r,sr,...Fl],fs)},function*(){yield(0,Va.Fm)(P.search.constants.UPDATE_STATE,Es)}];function Ts(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*Os(){yield(0,Va.gw)(500);const{uiState:e,query:t}=yield(0,Va.RE)(Mo,!1,!0),r=yield(0,Va.Ys)(xo.LA);yield(0,Va.gz)(P.search.actions.saveState(function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ts(e,t,r[t])}))}return e}({},e,{query:t,currentSavedSearchUri:(0,_.path)(["uri"],r)})))}function*xs(){yield(0,Va.qn)(P.search.constants.UPDATE_STATE);const e=(0,_.reject)((0,_.includes)(_.__,[U.Z.REFRESH]),bs);yield(0,Va.Fm)([or,...e],Os)}const Cs=e=>({type:Ur,payload:e}),Ss=()=>({type:zr}),ws=e=>({type:Yr,payload:e}),As=e=>({type:Gr,payload:e}),Rs=(e,t)=>({type:$r,payload:{searchCreatedDate:e,isLoading:t}});var _s=r(97010),Is=r(73667);const Ns=(0,_.path)([K.Jf,"recentSearches"]),Ds=e=>Ns(e).items,Ps=e=>Ns(e).filterWord,ks=(0,_.curry)(((e,t)=>!e||t&&t.name.toLocaleLowerCase().includes(e.toLocaleLowerCase()))),Ls=e=>(0,_.pipe)(Ds,(0,_.filter)(ks(Ps(e))))(e),Us=e=>Ns(e).loading,js=(0,Is.Rm)(Ds),Fs=(0,Is.d1)(Ds),Ms=(0,Is.Ky)(Ds),Vs=(0,Is.$y)(Ds),Bs=e=>Ns(e).lastSavedRecentSearch,zs=(e,t)=>Ds(e).find((0,_.propEq)("createdDate",t)),Hs=(0,_.path)(["advancedSearch","searchParams","groups"]),Ys=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,_.chain)((0,_.prop)("attributes")),r=(0,_.filter)((0,_.has)("values")),n=(0,_.pipe)(Hs,t,r),a=(0,_.pipe)((0,_.prop)("values"),(0,_.map)((0,_.prop)("label")),(0,_.join)(", ")),i=(0,_.path)(["data","title"]),o=(0,_.pathEq)(["data","fieldName"],"type"),l=(0,_.find)(o),s=(0,_.pipe)(l,(0,_.when)(_.identity,a)),c=(0,_.pipe)((0,_.reject)(o),(0,_.map)(i),(0,_.reject)(_.isNil),(0,_.join)(", ")),u=e=>[s(e),c(e)].filter(_.identity).join(" - ");return u(n(e))},Ws=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,_.prop)("facets"),r=(0,_.prop)("facetsData"),n=(0,_.prop)("facetsConfigs"),a=(0,_.prop)("values"),i=(0,_.prop)("label"),o=(0,_.prop)("title"),l=(0,_.pipe)(a,(e=>e&&e.length>0)),s=e=>(0,_.pipe)((0,_.propOr)([],"data"),(0,_.find)((0,_.propEq)("value",e)),(0,_.defaultTo)({}),i),c=(0,_.curry)(((e,r)=>(0,_.pipe)(t,n,(0,_.find)((0,_.propEq)("fieldName",r)),(0,_.defaultTo)({}),o)(e))),u=(0,za.XK)(e),p=[];u&&p.push(a(u).map(s).map((e=>e(u))).join(", "));const d=(0,_.pipe)(t,r,_.values,(0,_.reject)(x.isTypeFacet),(0,_.filter)(l),(0,_.map)((0,_.prop)("fieldName"))),m=(0,_.pipe)(d,(0,_.map)(c(e))),g=m(e);return g.length>0&&p.push(g.join(", ")),p.filter(_.identity).join(" - ")};function Gs(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){qs(e,t,r[t])}))}return e}function qs(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*Zs(){yield(0,Va.gz)(As(!0));try{const t=yield(0,Va.Ys)(k().selectors.getTenant),r=yield(0,Va.Ys)(k().selectors.getEnvironment),n=yield(0,Va.Ys)(k().selectors.getServicesPath),{result:a=[]}=yield(0,Va.RE)(x.getRecentSearches,{environment:r,tenant:t,servicesPath:n}),i=(0,_.sort)((0,_.descend)((0,_.prop)("createdDate")))(a);yield(0,Va.gz)((e=i,{type:Fr,payload:e})),yield(0,Va.gz)(As(!1)),yield(0,Va.RE)(Xs,i)}catch(e){gi(e),yield(0,Va.gz)(As(!1))}var e}function*$s(e){const t=yield(0,Va.Ys)(zs,e.payload);yield(0,Va.RE)(Ks,t)}function*Ks(e,t){yield(0,Va.gz)(Rs(e.createdDate,!0));try{const{total:r}=yield(0,Va.RE)(x.getTotalsForQuery,(0,x.replacePlaceholdersInQuery)(e.query),Boolean(t));yield(0,Va.gz)(((e,t)=>({type:Mr,payload:{searchCreatedDate:e,total:t}}))(e.createdDate,r))}catch(e){gi(e)}yield(0,Va.gz)(Rs(e.createdDate,!1))}function*Xs(e){const t=yield(0,Va.Ys)(k().selectors.getQueryEstimatorEnabled);return yield(0,Va.$6)(e.map((e=>(0,Va.RE)(Ks,e,t))))}function*Qs(){const e=yield(0,Va.Ys)(Vs),t=yield(0,Va.Ys)(k().selectors.getServicesPath);yield(0,Va.gz)(As(!0));try{yield(0,Va.$6)(e.map((e=>(0,Va.RE)(x.deleteRecentSearch,Gs({},e,{servicesPath:t}))))),yield(0,Va.gz)(ws(e))}catch(e){gi(e)}yield(0,Va.gz)(As(!1))}function*Js(e){const t=e.payload,r=yield(0,Va.Ys)(k().selectors.getServicesPath);yield(0,Va.gz)(As(!0));try{yield(0,Va.RE)(x.deleteRecentSearch,Gs({},t,{servicesPath:r})),yield(0,Va.gz)(ws([t]))}catch(e){gi(e)}yield(0,Va.gz)(As(!1))}function*ec(){const{query:e,uiState:t}=yield(0,Va.RE)(Mo,!0),r=yield(0,Va.Ys)(ki.$s),n=yield(0,Va.Ys)(Bs),a=yield(0,Va.Ys)(ui.kw),i=yield(0,Va.Ys)(k().selectors.getTenant),o=yield(0,Va.Ys)(k().selectors.getEnvironment),l=yield(0,Va.Ys)(k().selectors.getServicesPath),s=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Hs(e);return t&&t.length>0?Ys(e):Ws(e)}(r),c=(0,x.getHash)(e),u={query:e,state:t,name:s,environment:o,tenant:i};try{if(n!==c&&!a){const e=yield(0,Va.RE)(x.createRecentSearch,u,l);e.success?yield(0,Va.gz)((e=>({type:Zr,payload:e}))(c)):gi(e)}}catch(e){gi(e)}}function*tc(e){const{search:t,debounceTime:r}=e.payload;yield(0,Va.gz)(Ti(!1));const n=yield(0,Va.Ys)(k().selectors.getMetadata),a=yield(0,Va.Ys)(k().selectors.getDataTenants),i=yield(0,Va.Ys)(k().selectors.getCanUserReadWorkflowDataTask);let o={};try{o=(0,_.pipe)(_s.Z,(0,_s.f)(null))(n,JSON.parse(t.state),{},a,i)}catch(e){o={}}(yield(0,Va.Ys)(ui.lF))&&(o.currentTenant=yield(0,Va.Ys)(k().selectors.getTenant)),yield(0,Va.gz)(P.search.actions.updateState(Gs({},o,{debounceTime:r})))}const rc=e=>{let{type:t,payload:r={}}=e;return t===P.search.constants.KEYWORD_UPDATED&&!(null==r||!r.saveToRecent)},nc=[function*(){yield(0,Va.Fm)([jr],Zs)},function*(){yield(0,Va.ib)(Hr,Qs)},function*(){yield(0,Va.Fm)([P.ui.constants.UIActions.OPEN_ENTITY,ir,sr,Ur,U.Z.CHANGE_PAGE,U.Z.CHANGE_ROWS_PER_PAGE,U.Z.EXPORT_RESULTS,rc],ec)},function*(){yield(0,Va.Fm)([Xr],tc)},function*(){yield(0,Va.ib)([Kr],$s)},function*(){yield(0,Va.ib)(Wr,Js)}],ac=e=>e[K.Jf].entity.loading,ic=e=>e[K.Jf].entity.selectedEntityUri,oc=e=>e[K.Jf].entity.entity,lc=e=>({type:On,payload:e}),sc=e=>({type:xn,payload:e}),cc=e=>({type:Cn,payload:e}),uc=e=>({type:Sn,payload:e});function*pc(e){if(yield(0,Va.Ys)(ui.lF)){const t=yield(0,Va.RE)(jl,(0,x.getDtssEntityUrl)(e));return(yield(0,Va.RE)(Ul,t))[0]}{const t=yield(0,Va.Ys)(k().selectors.getMetadata),r=(0,x.addMetadataSpecificGetEntityOptions)(t);return yield(0,Va.RE)(x.getEntity,e,r)}}function*dc(e){const t=e.payload;(yield(0,Va.Ys)(ic))!==t&&(yield(0,Va.gz)(cc(t)));const r=yield(0,Va.Ys)(oc);if(yield(0,Va.gz)(lc(!0)),(0,_.isNil)(t))yield(0,Va.gz)(uc(null));else if(!r||r.uri!==t)try{const e=yield(0,Va.RE)(pc,t);yield(0,Va.gz)(uc(e))}catch(e){n=e,(0,pi.U)(n,{defaultMessage:mi().text("Can't load entity")}),yield(0,Va.gz)(uc(null))}var n;yield(0,Va.gz)(lc(!1))}const mc=[function*(){yield(0,Va.Fm)(xn,dc)}];function*gc(e){const t="type"===(0,_.path)(["payload","facetFieldName"],e),r=(0,_.path)(["payload","values"],e);if(!t||1!==(0,_.length)(r))return;const n=yield(0,Va.Ys)(k().selectors.getMetadata),a=(0,x.getEntityType)(n,r[0]),i=a.defaultFacetedAttributes||[];if(i.length>0){const e=yield(0,Va.Ys)(D.Mp),t=t=>{let{fieldName:r}=t;return(0,_.none)((0,_.propEq)("fieldName",r),e)},r=(0,yi.vf)(n,a).map((e=>(0,yi.NG)(n,e,a.uri,"",N.u7))),o=i.reduce(((e,n)=>{const a=(0,x.attributeUriToSearchUri)(n),i=(0,N.zy)(r,a);return i&&t(i)?e.concat(i.children?(0,yi.jj)(i).filter(t):i):e}),[]);o.length>0&&(yield(0,Va.gz)(ni(o,!0)))}}const yc=[function*(){yield(0,Va.Fm)(L.k.CHANGE_VALUES,gc)}],fc=e=>({type:Bn,payload:e}),hc=()=>({type:Yn}),Ec=()=>({type:Pn}),bc=e=>({type:Un,payload:e}),vc=e=>({type:Fn,payload:e}),Tc=e=>({type:Vn,payload:e}),Oc=e=>({type:Hn,payload:e}),xc=e=>({type:Wn,payload:e}),Cc=e=>{let{id:t,groupId:r}=e;return{type:$n,payload:{id:t,groupId:r}}},Sc=e=>{let{id:t,groupId:r,operationParameters:n}=e;return{type:Zn,payload:{id:t,groupId:r,operationParameters:n}}},wc=(e,t,r)=>({type:Xn,payload:{groupId:e,attributeId:t,attribute:St(r)}}),Ac=(e,t,r)=>({type:Qn,payload:{groupId:e,attributeId:t,attributeData:wt(r)}}),Rc=(e,t)=>({type:Qn,payload:{groupId:e,attributeId:t,attributeData:null}}),_c=(e,t,r)=>({type:Jn,payload:{groupId:e,attributeId:t,selectInfo:r}}),Ic=(e,t)=>({type:ea,payload:{groupId:e,attributeId:t}}),Nc=(e,t,r)=>({type:ta,payload:{groupId:e,attributeId:t,filter:r}}),Dc=(e,t,r)=>({type:ra,payload:{groupId:e,attributeId:t,values:r}}),Pc=e=>({type:oa,payload:e});var kc=r(97698);const Lc=(0,_.has)("actions"),Uc=e=>e.actions.map((0,_.assocPath)(["operationParameters","conditions"],e.conditions)),jc=(0,_.path)(["operationParameters","attributeTypeData","attributeType"]),Fc=(0,_.path)(["operationParameters","attributeTypeData","fieldName"]),Mc=(0,_.path)(["operationParameters","pin"]),Vc=(0,_.path)(["operationParameters","addNestedAttribute"]),Bc=(0,_.path)(["operationParameters","attributeValue"]),zc=(0,_.path)(["operationParameters","attributeValueToFind"]),Hc=(0,_.anyPass)([(0,_.equals)(la.d.AddNew),(0,_.equals)(la.d.ReplaceAllWith)]),Yc=(0,_.anyPass)([(0,_.equals)(la.d.AddNew),(0,_.equals)(la.d.ReplaceAllWith),(0,_.equals)(la.d.FindAndReplace)]),Wc=(0,_.equals)(la.d.AddNew),Gc=(0,_.both)((0,_.pipe)(jc,x.isNested),(0,_.pipe)((0,_.prop)("operation"),Hc)),qc=(0,_.both)((0,_.pipe)(jc,x.isReference),(0,_.pipe)((0,_.prop)("operation"),Wc)),Zc=(0,_.both)((0,_.pipe)(Bc,x.isLookupAttrType),(0,_.pipe)((0,_.prop)("operation"),Yc)),$c=(0,_.pipe)(jc,x.isLookupAttrType),Kc=e=>{switch(e){case la.d.AddNew:case la.d.RepointReference:case la.d.ReplaceAllWith:return["attributeValue"];case la.d.FindAndReplace:return["attributeValueToFind","attributeValue"];case la.d.FindAndRemove:return["attributeValueToFind"];default:return[]}},Xc=e=>{if(!e.operation||!e.operationParameters)return!1;const t=Gc(e),r=qc(e),n=$c(e),a=Kc(e.operation);for(let i of a){const a=e.operationParameters[i];if((0,x.isEmptyValue)(a)||n&&(0,x.isEmptyValue)((0,x.getAttrTypeLookupCode)(a))||r&&(0,x.isEmptyValue)((0,x.getReferencedEntityFromAttrValue)(a))||t&&(0,x.isEmptyValue)((0,x.cleanAttributesWith)({deleteEmptyComplex:!0})(a.value)))return!1}return!0},Qc=e=>{const t=Gc(e),r=qc(e);return t||r?Kc(e.operation).reduce(((e,t)=>{const r=["operationParameters",t,"value"];if((0,_.path)(r,e)){const t=(0,_.lensPath)(r);return(0,_.over)(t,(0,x.cleanAttributesWith)({deleteEmptyComplex:!0}),e)}return e}),e):e},Jc=e=>e[K.Jf].bulkUpdate.operation,eu=e=>e[K.Jf].bulkUpdate.activeStep,tu=e=>e[K.Jf].bulkUpdate.loading,ru=e=>{const t=(0,ki.IJ)(e)?(0,ro.V6)(e):(0,D.DX)(e),r=(0,ki.tB)(e);return r||1===t.length?r||t[0]:null},nu=(0,_.path)([K.Jf,"bulkUpdate","objects"]),au=e=>nu(e).total,iu=e=>nu(e).selectionMode,ou=e=>nu(e).entities,lu=e=>nu(e).selectedEntities,su=e=>nu(e).page,cu=e=>nu(e).rowsPerPage,uu=e=>nu(e).sortField,pu=e=>nu(e).sortOrder,du=e=>nu(e).selectedColumns,mu=e=>nu(e).filterText,gu=(0,_.pipe)(iu,(0,_.equals)(K.v6.include)),yu=(0,_.ifElse)(gu,(0,_.pipe)(lu,_.length),(e=>{const t=lu(e).length;return(0,ui.hX)(e)-t})),fu=(0,_.pipe)(yu,(0,_.gt)(_.__,0)),hu=e=>e[K.Jf].bulkUpdate.actions,Eu=(0,kc.createSelector)(hu,(0,_.pipe)((0,_.map)((0,_.ifElse)(Lc,(0,_.evolve)({actions:(0,_.pipe)((0,_.map)(Qc),(0,_.filter)(Xc))}),Qc)),(0,_.filter)((0,_.ifElse)(Lc,(0,_.pipe)((0,_.path)(["actions","length"]),(0,_.gt)(_.__,0)),Xc)))),bu=(0,kc.createSelector)(hu,(0,_.pipe)((0,_.map)((0,_.when)(Lc,(0,_.prop)("actions"))),_.flatten)),vu=e=>{const t=bu(e);return 0!==t.length&&t.every(Xc)},Tu=e=>e[K.Jf].bulkUpdate.requestPending,Ou=(0,x.getUrisForSaving)((e=>(0,_.equals)(e.slice(-3),["operationParameters","attributeValue","entityUri"]))),xu=(0,_.curry)(((e,t,r)=>{const n=(0,_.pipe)(Ou,(0,_.find)((t=>(0,_.pathSatisfies)((t=>t===e),t,r))))(r);return n?(0,_.set)((0,_.lensPath)(n),t,r):r})),Cu=(e,t,r)=>(0,_.pipe)(xu(e,t),(0,_.when)((e=>e===r),(0,x.replaceTemporaryRefEntityURI)(e,t)))(r),Su=(0,_.pathEq)(["data","fieldName"],K.E_),wu=(0,_.pipe)((0,_.path)(["values",0,"entityUri"]),(0,_.objOf)("uri"),x.getEntityId,x.wrapInQuotes),Au=e=>[{attributes:e,operator:"or"}],Ru=(0,_.curry)(((e,t,r)=>r.map((r=>{const{data:{fieldName:n}}=r,a=n.split(".");let[i,o]=((e,t)=>{let r=0;for(;r<Math.min(e.length,t.length)&&e[r]===t[r];r++);return[e.slice(r),t.slice(r)]})(a,e.split(".")),l=o.length;t===K.Vp.AddAttribute&&l--,i.length||(i=a.slice(-1),l++);const s=`${(0,_.repeat)("parent.",Math.max(0,l)).join("")}attributes.${i.join(".")}`;return(0,_.assocPath)(["data","fieldName"],s,r)})))),_u=(0,_.curry)(((e,t,r)=>{const n=((e,t,r)=>{const[n,a]=(0,_.partition)(Su,e),i=(0,_.pipe)(Ru(t,r),Au,Ba.Jk)(a),o=n.length?(e=>`in(${K.E_}, ${e.map(wu).join(",")})`)(n):"";return i&&o?`${i} and ${o}`:i||o})(e,t,r.operation);return(0,_.isEmpty)(n)?r:(0,_.ifElse)((0,_.pipe)((0,_.path)(["operationParameters","valueFilter"]),x.isEmptyValue),(0,_.assocPath)(["operationParameters","valueFilter"],n),(0,_.evolve)({operationParameters:{valueFilter:(0,_.concat)(_.__,` and (${n})`)}}))(r)}));var Iu=r(9828);function Nu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Du(e,t,r[t])}))}return e}function Du(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Pu=e=>{const t=(0,_.pipe)((0,_.pick)(["pin"]),(0,_.assoc)("value",ku(e)))(e);return(0,Iu.Kn)(t.value)?Object.keys(t.value).reduce(((e,r)=>(e.value=Nu({},e.value,{[r]:t.value[r].map(Pu)}),e)),t):t},ku=(0,_.when)(Iu.Kn,(0,_.ifElse)((0,_.has)("lookupCode"),(0,_.prop)("lookupCode"),(0,_.prop)("value"))),Lu=(0,_.cond)([[Gc,(0,_.pipe)(Bc,Pu)],[qc,(0,_.pipe)(Bc,(e=>{const{refEntity:t=[],refRelation:r=[]}=e;return Nu({refEntity:(0,_.pipe)(_.head,(0,_.pick)(["objectURI"]))(t),refRelation:(0,_.pipe)(_.head,(0,_.pick)(["type"]))(r)},Pu(e))}))],[Zc,(0,_.pipe)(Bc,ku)],[_.T,Bc]]),Uu=(0,_.pipe)(Lu,(0,_.assocPath)(["operationParameters","attributeValue"])),ju=(0,_.ifElse)(Mc,(()=>(0,_.assocPath)(["operationParameters","pin"],!0)),(()=>_.identity)),Fu=(0,_.ifElse)(Vc,(()=>(0,_.assocPath)(["operationParameters","addNestedAttribute"],!0)),(()=>_.identity)),Mu=(0,_.pipe)(zc,(0,_.ifElse)(_.isNil,(()=>_.identity),(0,_.pipe)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return`equals(value, '${ku(e)}')`}),(0,_.assocPath)(["operationParameters","valueFilter"])))),Vu=(0,_.pipe)(Bc,(0,_.prop)("entityUri"),(0,_.assocPath)(["operationParameters","referencedEntity","uri"])),Bu=(e,t)=>({operationParameters:{attributeURI:e},operation:t}),zu=(e,t)=>(0,_.pipe)(Bu,Uu(e),ju(e),Fu(e))(t,K.Vp.AddAttribute),Hu=(e,t)=>(0,_.pipe)(Bu,Mu(e))(t,K.Vp.DeleteAttribute),Yu=(e,t)=>(0,_.pipe)(Bu,Uu(e),ju(e),Mu(e))(t,K.Vp.UpdateAttribute),Wu=(e,t)=>(0,_.pipe)(Bu,Vu(e))(t,K.Vp.RepointReferencedEntity),Gu=(e,t)=>(0,_.reject)(_.isNil,{operationParameters:e,operation:t}),qu=e=>Gu({tags:[Bc(e)]},K.Vp.AddTags),Zu=e=>Gu({newValue:Bc(e),oldValue:zc(e)},K.Vp.ReplaceTag),$u=e=>Gu({tags:[zc(e)]},K.Vp.DeleteTags),Ku=()=>Gu(null,K.Vp.ClearTags),Xu=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{selectionMode:n,selectedEntities:a=[]}=e,{searchOptions:i,activityFilter:o,globalFilter:l}=r;return n===K.v6.include?{list:a,activeness:o}:{filter:(0,_.pipe)(Ba.XP,(0,x.addGlobalFilterToQuery)(l))(t),excludeList:a,options:i,activeness:o}},Qu=(0,_.curry)(((e,t)=>(0,_.chain)((0,_.ifElse)(Lc,(0,_.pipe)(Uc,Qu(e)),Ju(e)))(t))),Ju=(0,_.curry)(((e,t)=>{const r=(0,_.pathOr)([],["operationParameters","conditions"],t),n=Fc(t);return(0,_.pipe)(tp(e),(0,_.map)(_u(r,n)))(t)})),ep=(0,_.curry)((e=>(0,_.propEq)("operation",e))),tp=(0,_.curry)(((e,t)=>{const r=Fc(t),n=r.includes(".")?(0,x.searchUriToAttrUri)(r,e):r,a=r===x.EntityAttrTypes.tags.uri;return(0,_.cond)([[(0,_.both)((0,_.always)(a),ep(la.d.AddNew)),()=>[qu(t)]],[(0,_.both)((0,_.always)(a),ep(la.d.Clear)),()=>[Ku()]],[(0,_.both)((0,_.always)(a),ep(la.d.ReplaceAllWith)),()=>[Ku(),qu(t)]],[(0,_.both)((0,_.always)(a),ep(la.d.FindAndReplace)),()=>[Zu(t)]],[(0,_.both)((0,_.always)(a),ep(la.d.FindAndRemove)),()=>[$u(t)]],[ep(la.d.AddNew),()=>[zu(t,n)]],[ep(la.d.Clear),()=>[Hu(t,n)]],[ep(la.d.ReplaceAllWith),()=>[Hu(t,n),zu(t,n)]],[ep(la.d.FindAndReplace),()=>[Yu(t,n)]],[ep(la.d.FindAndRemove),()=>[Hu(t,n)]],[ep(la.d.RepointReference),()=>[Wu(t,n)]]])(t)}));function rp(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){np(e,t,r[t])}))}return e}function np(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*ap(e){if(e.payload){const e=yield(0,Va.Ys)(ki.tB);let r;do{if(r=yield(0,Va.Ys)(ui.BP,{entityTypeUri:e}),r)break;yield(0,Va.qn)(U.Z.UPDATE_ENTITIES)}while(!r);const n=yield(0,Va.Ys)(ru),a=yield(0,Va.Ys)(ui.fx,{entityTypeUri:e}),i=yield(0,Va.Ys)(ui.Uz,{entityTypeUri:e}),o=(yield(0,Va.Ys)(ui.L9,{entityTypeUri:e}))||void 0,l=yield(0,Va.Ys)(ui.NW,{entityTypeUri:e}),s=(yield(0,Va.RE)(io))[n].filter((0,_.pipe)((0,_.prop)("id"),x.isAttributeSearchUri,_.not)),c=e?yield(0,Va.Ys)(ki.Gv,e):s,u=yield(0,Va.Ys)(ui.NU,{entityTypeUri:e});yield(0,Va.gz)((t={page:a,rowsPerPage:i,sortOrder:o,sortField:l,selectedColumns:c,total:u,entities:r},{type:Dn,payload:t}))}var t}function*ip(e){const t=yield(0,Va.Ys)(k().selectors.getMetadata),r=yield(0,Va.Ys)(su),n=yield(0,Va.Ys)(cu),a=yield(0,Va.Ys)(pu),i=yield(0,Va.Ys)(uu),o=yield(0,Va.RE)(yp),l=(0,_.uniq)(o.concat((0,Ba.kx)(t,e))),s=rp({page:r,rowsPerPage:n,sortOrder:a,sortField:i,forceOvOnly:!0},yield(0,Va.Ys)(k().selectors.getGlobalSearchRequestOptions),{select:l}),c=(0,Ba.Lv)(e,s);yield(0,Va.gz)(bc(!0));try{const e=yield(0,Va.RE)(x.rawRequest,K.NV,c);yield(0,Va.gz)(fc(e))}catch(e){console.warn(e),yield(0,Va.gz)(fc([]))}yield(0,Va.gz)(bc(!1))}function*op(){const e=yield(0,Va.Ys)(mu),t=yield(0,Va.RE)(gp,e);yield(0,Va.rM)(ip,t)}function*lp(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{debounceTime:t}=e.payload||{};t&&(yield(0,Va.gw)(t));const r=yield(0,Va.Ys)(mu),n=yield(0,Va.RE)(gp,r);yield(0,Va.gz)(vc(0)),yield(0,Va.rM)(sp,n)}function*sp(e){const t=yield(0,Va.Ys)(k().selectors.getGlobalSearchRequestOptions),r=(0,Ba.Vg)(e,[],t);try{const e=yield(0,Va.RE)(x.rawRequest,K.jS,{method:"POST",body:JSON.stringify(r)});yield(0,Va.gz)(Oc(e.total))}catch(e){console.warn(e),yield(0,Va.gz)(Oc(0))}}function*cp(){const e=(yield(0,Va.Ys)(ou)).map((e=>e.uri)),t=yield(0,Va.RE)(yp),r=yield(0,Va.Ys)(mu),n=yield(0,Va.RE)(gp,r),a=yield(0,Va.Ys)(k().selectors.getGlobalSearchRequestOptions),i=(0,Ba.aG)(e,n,rp({select:t},a));yield(0,Va.gz)(bc(!0));try{const e=yield(0,Va.RE)(x.rawRequest,i.url,i.options);yield(0,Va.gz)(fc(e))}catch(e){console.warn(e),yield(0,Va.gz)(fc([]))}yield(0,Va.gz)(bc(!1))}function*up(e){try{yield(0,Va.RE)(x.rawRequest,e.url,e.options),yield(0,Va.gz)(Di(!1)),yield(0,Va.gz)(Ii({message:mi().text("Bulk update is currently in progress. You'll receive an email notification once completed.\nGo to Tenant Management to view the status."),actionLabel:mi().text("Tenant Management"),actionToDispatch:P.ui.actions.openConsoleApp("Tenant Management","jobs/pending"),autoHideDuration:1e4}))}catch(e){let r=e;e&&"object"==typeof e&&(r="errorCode"in e&&441===e.errorCode?mi().text("You already have a bulk update job in progress. You can start a new job when the current job is finished.\nWe will send you an update via email once the current job is finished."):e.errorMessage||e.error_description||mi().text("Something went wrong...")),yield(0,Va.gz)((t=r,Ri({payload:{message:t,action:{actionToDispatch:Ai()}},type:K.GT.error})))}var t}function*pp(){const e=yield(0,Va.Ys)(Jc);e===K.dV.UpdateProfiles?yield(0,Va.RE)(dp):e===K.dV.DeleteProfiles&&(yield(0,Va.RE)(mp))}function*dp(){yield(0,Va.gz)(Pc(!0));const e=yield(0,Va.Ys)(ru),t=yield(0,Va.Ys)(nu);let r=yield(0,Va.Ys)(Eu);const n=yield(0,Va.RE)(gp),a=yield(0,Va.Ys)(k().selectors.getGlobalSearchRequestOptions),i=yield(0,Va.Ys)(k().selectors.getModifiedEntities),o=((e,t)=>{const r=(0,x.findAllTemporaryRefEntityURI)(t),n=(a=t,(0,_.pipe)(Ou,(0,x.getPathsWithTempUri)(a),(0,_.map)((e=>(0,_.path)(e,a))))(a));var a;return r.concat(n).filter((t=>e[t]))})(i,r);if(o.length>0){const e=yield(0,Va.RE)(x.saveTemporaryEntities,i,o);for(const[t,n]of Object.entries(e))r=Cu(t,n,r)}const l=function(e,t,r,n,a){const i=function(e){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return{objects:Xu(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],arguments.length>4&&void 0!==arguments[4]?arguments[4]:{}),actions:Qu(e,t)}}(e,t,r,n,a);return{url:"/entities/_update?sendMail=true",options:{method:"POST",body:JSON.stringify(i),headers:{"Content-Type":"application/json"}}}}(e,t,r,n,a);yield(0,Va.RE)(up,l),yield(0,Va.gz)(Pc(!1))}function*mp(){yield(0,Va.gz)(Pc(!0));const e=function(e,t,r){const n={objects:Xu(e,t,r)};return{url:"/entities/_delete?sendMail=true",options:{method:"POST",body:JSON.stringify(n),headers:{"Content-Type":"application/json"}}}}(yield(0,Va.Ys)(nu),yield(0,Va.RE)(gp),yield(0,Va.Ys)(k().selectors.getGlobalSearchRequestOptions));yield(0,Va.RE)(up,e),yield(0,Va.gz)(Pc(!1))}function*gp(e){const t=yield(0,Va.Ys)(ui.FR),r={fieldName:"type",filter:"equals",values:[yield(0,Va.Ys)(ru)]};let n=t.filter((e=>"type"!==e.fieldName)).concat(r);return e&&(n=n.concat({fieldName:"attributes",filter:"containsWordStartingWith",values:[e]})),n}function*yp(){const e=yield(0,Va.Ys)(du);return(0,Pi.vw)(e)}function*fp(e){const{groupId:t,attributeId:r,selectInfo:n}=e.payload,a=yield(0,Va.Ys)(hu),i={addAttributeAfter:wc,changeAttribute:Ac,clearAttribute:Rc,deleteAttribute:Ic};yield(0,Va.RE)(ol,{groups:a,attributesPropName:"conditions",groupId:t,attributeId:r,selectInfo:n,actions:i})}const hp=[function*(){yield(0,Va.Fm)(Ee,ap)},function*(){yield(0,Va.Fm)([Fn,jn,Mn],op)},function*(){yield(0,Va.Fm)(zn,lp)},function*(){yield(0,Va.Fm)(Yn,cp)},function*(){yield(0,Va.ib)(Jn,fp)},function*(){yield(0,Va.ib)(ia,pp)}],Ep=()=>({id:K.Jf,reducerMap:{[K.Jf]:(0,R.combineReducers)({ui:$e,search:me,facets:$,advancedSearch:ar,savedSearches:dn,recentSearches:Tn,entity:In,bulkUpdate:Ma})},sagas:[...Ml,...cs,...fo,...yl,...zo,...nc,...vs,xs,...mc,...yc,...hp]});var bp=r(95099),vp=r.n(bp),Tp=r(34756),Op=r(23625),xp=r.n(Op),Cp=r(53732),Sp=r.n(Cp),wp=r(88214),Ap=r.n(wp),Rp=r(14294),_p=r.n(Rp),Ip=r(4501),Np=r.n(Ip),Dp=r(87925),Pp=r(18538),kp=r(42950);const Lp=(0,kp.Z)((()=>({container:e=>{let{height:t=36}=e;return{height:t,borderRadius:"2px",alignItems:"center",backgroundColor:"rgba(0,0,0,0.03)",minWidth:"100px"}},icon:{opacity:.67,marginLeft:"10px",marginRight:"6px"},input:{fontSize:"13px",width:"100%"},clearButton:{marginRight:"10px"},white:{backgroundColor:"rgb(255, 255, 255)",boxShadow:"0 1px 3px 0 rgba(0,0,0,0.24)"}})));function Up(){return Up=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Up.apply(this,arguments)}function jp(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Fp(e,t,r[t])}))}return e}function Fp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Mp=(0,b.memo)((e=>{let{value:t,autofocus:r,onSearch:n=_.identity,rootRef:a,classes:i={},height:o,placeholder:l=mi().text("Search")}=e,s=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["value","autofocus","onSearch","rootRef","classes","height","placeholder"]);const c=Lp({height:o}),[u,p]=(0,b.useState)(""),d=(0,_.pipe)((0,_.tap)(n),p),m=(0,_.isNil)(t)?u:t;return v().createElement(Sp(),Up({startAdornment:v().createElement(Ap(),{position:"start"},v().createElement(Np(),{className:c.icon})),endAdornment:v().createElement(Ap(),{position:"end"},m.length>0&&v().createElement(Pp.T,{icon:_p(),className:c.clearButton,onClick:()=>d("")})),autoFocus:r,classes:jp({},i,{input:O()(c.input,i.input),root:O()(c.container,i.root)}),placeholder:l,value:m,onChange:(0,_.pipe)(Dp.NA,d),disableUnderline:!0,ref:a},s))})),Vp=(0,kp.Z)((()=>({container:e=>{let{containerHeight:t=553,containerWidth:r}=e;return{display:"flex",flexDirection:"column",height:t,width:r,flexGrow:1}},header:{marginLeft:"16px",marginTop:"16px",marginBottom:"12px",fontSize:"16px",fontWeight:500,letterSpacing:"0.15px",lineHeight:"24px"},searchInputContainer:{margin:"0 16px 12px 16px",flexShrink:"0"},list:{flexGrow:1,height:0,overflow:"hidden",width:"100%",position:"relative","& ul":{paddingBottom:0,paddingTop:0}}})));function Bp(){return Bp=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Bp.apply(this,arguments)}const zp=e=>{let{title:t,className:r,onSearch:n,hideTitle:a,hideSearchInput:i,headerPlacement:o="top",containerWidth:l,containerHeight:s,searchInputOnKeyDown:c,children:u,searchInputRef:p,anchorOrigin:d={vertical:"top",horizontal:"right"},transformOrigin:m={vertical:"top",horizontal:"right"}}=e,g=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["title","className","onSearch","hideTitle","hideSearchInput","headerPlacement","containerWidth","containerHeight","searchInputOnKeyDown","children","searchInputRef","anchorOrigin","transformOrigin"]);const y=Vp({containerWidth:l,containerHeight:s}),f=v().createElement(v().Fragment,null,!a&&v().createElement("div",{className:y.header},t),!i&&v().createElement(Mp,{onSearch:n,autofocus:!0,onKeyDown:c,inputRef:p,classes:{root:y.searchInputContainer},placeholder:mi().text("Search & add attributes"),height:40}));return v().createElement(xp(),Bp({anchorOrigin:d,transformOrigin:m},g),v().createElement("div",{className:O()(y.container,r),style:{width:l}},"top"===o&&f,v().createElement("div",{className:y.list},u),"bottom"===o&&f))},Hp=e=>{const t=e=>(0,_.flatten)(e.map((e=>[e].concat(e.items?t(e.items):[]))));let r=null;return t(e).map(((e,t)=>(e&&e.items&&(r=t),{item:e,index:t,titleItemIndex:r})))},Yp=e=>e.titleItemIndex===e.index;var Wp=r(50166),Gp=r(88267);const qp=(0,kp.Z)({stickyTitlesWrapper:{position:"absolute",top:0,"& > div":{zIndex:1,position:"absolute",top:0,width:"100%",visibility:"hidden"}}}),Zp=e=>{let{items:t,getItemSize:r,renderItem:n,renderGroupTitle:a,width:i="100%",height:o,fixedTitle:l=!0,itemKey:s=(e=>e),disableHorizontalScrollbar:c,hideSubtitles:u,focusIndex:p=null,onInnerContainerResize:d}=e;const m=qp(),g=(0,b.useRef)(null),y=(0,b.useRef)(null),f=(0,b.useRef)(null),h=(0,b.useRef)([0]),E={topMargin:0},T=(0,b.useMemo)((()=>!u||(t||[]).some((e=>null!==e.titleItemIndex))),[t,u]),O=(0,b.useCallback)((e=>{const n=h.current.length;let a=0;t.slice(n-1,e+1).forEach(((e,t)=>{const i=n+t-1;t>0&&(h.current[i]=h.current[i-1]+a),a=r(i,e.item)}))}),[r,t]),x=(0,b.useCallback)((e=>t[e].titleItemIndex),[t]),C=(0,b.useCallback)((e=>t[e]),[t]);(0,b.useEffect)((()=>{requestAnimationFrame((()=>{g.current&&g.current.scrollTo(0)}))}),[t.length]),(0,b.useEffect)((()=>{g.current&&g.current.resetAfterIndex(0),S();const e=(e=>{const t=e.findIndex((e=>e.item.moveTo));if(t>-1){O(t);const e=x(t);return{offset:h.current[t],titleHeight:r(e,C(e).item)}}})(t);if(e&&e.offset&&g.current){const{titleHeight:t}=e,r=e.offset-t;(r<g.current.state.scrollOffset||r>g.current.state.scrollOffset+o)&&requestAnimationFrame((()=>{g.current&&g.current.scrollTo(r-(o-t)/2)}))}}),[O,C,r,x,o,h,t,g]);const S=()=>{f.current&&y.current&&(f.current.style.width=y.current.offsetWidth+"px")},w=(0,b.useCallback)((e=>{let r=null,n=0;return t.some(((t,a)=>{O(a+10);const i=h.current[a+1];return e>=n&&e<i&&(r={index:a,offset:n,listItem:t}),n=i,r})),r}),[O,h,t]),A=(0,b.useCallback)((e=>r(e,C(e).item)),[C,r]),R=(0,b.useCallback)((e=>{let{index:t,style:r,data:i}=e;const o=C(t);return o.item&&(Yp(o)&&a(r,o.item)||n(r,o.item,t,i))}),[C,a,n]),{handleOnItemsRendered:_}=(e=>{let{focusIndex:t,listRef:r,items:n}=e;const a=(0,b.useRef)(null),i=(0,b.useRef)(null),o=(0,b.useCallback)((e=>{let{visibleStartIndex:t,visibleStopIndex:r}=e;a.current=t,i.current=r}),[]);return(0,b.useEffect)((()=>{r.current&&null!==t&&0!==n.length&&(t<Math.max(a.current+3,0)?r.current.scrollToItem(Math.max(t-3,0),"start"):t>Math.min(i.current-3,n.length-1)&&r.current.scrollToItem(Math.min(t+3,n.length-1),"end"))}),[t,n.length,r]),{handleOnItemsRendered:o}})({items:t,focusIndex:p,listRef:g}),I=(0,b.useCallback)((()=>t.filter((e=>Yp(e))).map((e=>(e=>v().createElement("div",{className:"stickyTitleItem",style:{visibility:"hidden"},"data-index":e.index,key:e.index},a({height:r(e.index,e.item)},e.item)))(e)))),[r,t,a]);return v().createElement(v().Fragment,null,v().createElement("div",{ref:f,className:m.stickyTitlesWrapper},l&&I()),d&&y.current&&v().createElement(Gp.Z,{handleHeight:!0,onResize:d,targetDomEl:y.current}),v().createElement(Wp.VariableSizeList,{ref:g,itemCount:t.length,itemSize:A,width:i,height:o,itemKey:s,innerRef:y,onScroll:e=>{let{scrollOffset:n,scrollDirection:a}=e;if(!l||!T)return;const i=w(n),o=i&&x(i.index);var s;null!==o&&(s=o,f.current&&[...f.current.querySelectorAll(".stickyTitleItem")].forEach((e=>{e.dataset.index===s.toString()?(e.style.visibility="visible",E.index=s):e.style.visibility="hidden"}))),S();const c=null!==o&&r(o,C(o).item),u=w(n+c+E.topMargin);let p=0;if(u){switch(a){case"forward":u.offset-n>0&&Yp(u.listItem)&&(p=c-(u.offset-n));break;case"backward":{const e=o>-1&&(d=o,t.findIndex(((e,t)=>Yp(e)&&d<t))),r=(e=>(O(e),h.current[e]))(e);e>-1&&n<r&&c>=r-n&&(p=c-(r-n))}}(e=>{f.current&&(E.topMargin=-e,f.current.style.top=-e+"px")})(p)}var d},style:c?{overflowX:"hidden"}:void 0,overscanCount:5,onItemsRendered:_},R))};Zp.propTypes={items:vp().arrayOf(vp().object).isRequired,getItemSize:vp().func.isRequired,renderItem:vp().func.isRequired,width:vp().oneOfType([vp().number,vp().string]),height:vp().number.isRequired,renderGroupTitle:vp().func,fixedTitle:vp().bool,hideSubtitles:vp().bool,itemKey:vp().func,disableHorizontalScrollbar:vp().bool,focusIndex:vp().number,onInnerContainerResize:vp().func};const $p=e=>{let{items:t,open:r,onSelectFocusedItem:n,selectedItems:a,onClose:i}=e;const[o,l]=(0,b.useState)(null),s=(0,b.useRef)(!1),c=(0,b.useCallback)((e=>{let r=null===e?c(-1):e;for(;null!==e&&r<t.length&&(r<=e||r>=0&&Yp(t[r]));)r+=1;return r!==t.length?r:c(-1)}),[t]),u=(0,b.useCallback)((e=>{let r=null===e?t.length-1:e;for(;null!==e&&r>=0&&(r>=e||Yp(t[r]));)r-=1;return r<0?t.length-1:r}),[t]),p=(0,b.useCallback)((()=>{if(!(0,_.isNil)(o)){const e=t[o].item;!e.item.notSelectable&&n({item:e.item,groupData:e})}}),[n,t,o]),d=(0,b.useCallback)((e=>{if(0!==t.length)switch(e.key){case"Down":case"ArrowDown":return l(c),e.preventDefault(),!1;case"Up":case"ArrowUp":return l(u),e.preventDefault(),!1;case"Enter":s.current=!0,p();break;case"Tab":i&&i(e);break;default:return}}),[t,c,u,p,i]);return(0,b.useEffect)((()=>{if(s.current){s.current=!1;const e=t.findIndex((e=>e.item.moveTo));e>-1&&l(e)}else l(null)}),[t,r,a]),{focusIndex:o,handleKeyDown:d}};var Kp=r(85746),Xp=r.n(Kp),Qp=r(22811),Jp=r.n(Qp),ed=r(93222),td=r.n(ed);function rd(){return rd=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},rd.apply(this,arguments)}function nd(){return nd=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},nd.apply(this,arguments)}const ad=e=>v().createElement("svg",nd({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgNestedAttribute"},e),v().createElement("path",{d:"M14 11v-1a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 01-1-1v-1h-3v1a1 1 0 01-1 1H6a1 1 0 01-1-1v-4a1 1 0 011-1h4a1 1 0 011 1v1h3z",fill:"#000",stroke:"none",strokeWidth:1,fillRule:"evenodd"}));function id(){return id=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},id.apply(this,arguments)}const od=e=>v().createElement("svg",id({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgReferenceAttribute"},e),v().createElement("path",{d:"M10 18h3v-1a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 01-1-1v-1H8V8H6a1 1 0 01-1-1V3a1 1 0 011-1h6a1 1 0 011 1v4a1 1 0 01-1 1h-2v3h3v-1a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 01-1-1v-1h-3v5z",fill:"#000",stroke:"none",strokeWidth:1,fillRule:"evenodd"}));function ld(){return ld=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ld.apply(this,arguments)}const sd=e=>v().createElement("svg",ld({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgSimpleAttribute"},e),v().createElement("rect",{fill:"#000",x:9,y:9,width:6,height:6,rx:1,stroke:"none",strokeWidth:1,fillRule:"evenodd"})),cd=(0,kp.Z)({icon:{opacity:.29,width:"16px",height:"16px",flexShrink:0,marginRight:"6px",marginLeft:"8px"}}),ud=e=>{let{attrType:t={}}=e;const r=cd(),n=(e=>{switch(e.type){case x.DataTypes.TYPE_IMAGE:case x.DataTypes.TYPE_NESTED:return ad;case x.DataTypes.TYPE_REFERENCE:return od;default:return sd}})(t);return v().createElement(n,{className:r.icon})},pd=(0,kp.Z)({mark:{color:"red"}}),dd=()=>{const e=pd();return v().createElement("span",{className:e.mark},"*")},md=e=>{let{margin:t,level:r,className:n,children:a}=e;return null!=r?v().createElement("div",{style:{marginLeft:r*t},className:n},a):a};var gd=r(1063),yd=r(85740);const fd=(0,kp.Z)({container:{"& > $marginWrapper:first-child":{paddingLeft:"4px"}},listItem:{paddingLeft:"1px",paddingTop:"2px",paddingBottom:"2px",transition:"none","&:hover":{"& $itemAfter":{background:"linear-gradient(to right, rgba(235, 235, 235, 0.2), rgba(235, 235, 235, 1) 100%)"}},"&$listItemFocus":{"& $itemAfter":{background:"linear-gradient(to right, rgba(219, 219, 219, 0.2), rgba(219, 219, 219, 1) 100%)"}},"&:focus":{outline:"none"}},listItemFocus:{},recommendedIcon:{width:"18px",height:"18px",marginRight:"5px",marginLeft:"7px",flexShrink:0},logoIcon:{width:"18px",height:"18px",flexShrink:0,marginRight:"4px"},itemAfter:{position:"absolute",right:0,top:0,width:"40px",height:"100%",pointerEvents:"none",background:"linear-gradient(to right, rgba(255, 255, 255, 0.2), #fff 100%)"},itemText:{padding:"0",margin:0,"& span":{fontSize:"0.8125rem",letterSpacing:"normal",whiteSpace:"nowrap"}},checkbox:{opacity:.34,padding:0,marginLeft:"14px","&$checked":{opacity:1,background:"none"}},checked:{},marginWrapper:{display:"flex",alignItems:"center"},defaultCursor:{cursor:"default"},itemTooltip:{margin:"4px 0"},marginText:{marginLeft:"21px"},itemTextWrapper:{display:"flex",alignItems:"center"}}),hd=(0,yd.T)((e=>v().createElement("svg",rd({width:13,height:18,viewBox:"0 0 13 18",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgRecommended"},e),v().createElement("g",{transform:"translate(-3 -1)",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},v().createElement("path",{fill:"#FF4081",d:"M5.833 10h3.75v6.667l-3.75 1.666z"}),v().createElement("path",{fill:"#CE0C4E",d:"M13.333 10v8.333l-3.75-1.666V10z"}),v().createElement("circle",{fill:"#FFC058",cx:9.583,cy:7.917,r:6.25}),v().createElement("circle",{fill:"#FFCD7B",cx:9.583,cy:7.917,r:5.417}),v().createElement("path",{fill:"#FFFBB5",d:"M8.333 11.667L5 8.462l.933-.898 2.4 2.308L13.4 5l.933.897z"}))))),Ed=e=>{let{groupId:t,data:r,checked:n=!1,isFocused:a=!1,isRequired:i=!1,label:o,labelInText:l,level:s,onClick:c=_.identity,hideCheckBox:u=!1,hideIcon:p=!1,notSelectable:d=!1,disableHorizontalScrollbar:m=!1,style:g={},subItemMargin:y=20,LogoIcon:f,className:h,disableNonSelectable:E,disableGutters:b}=e;const T=fd(),{attrType:C}=r||{},S=!(u&&(0,x.isNested)(C)||d),w=!!f;return v().createElement(gd.Y,{value:l||o,className:T.itemTooltip,placement:"bottom-end"},v().createElement(td(),{className:O()(T.container,T.listItem,{[T.defaultCursor]:!S},h),onClick:S?()=>c(r,!n,t):void 0,style:g,dense:!0,disabled:E&&d,classes:{focusVisible:T.listItemFocus,selected:T.listItemFocus},selected:a,tabIndex:-1,disableGutters:b},!u&&v().createElement(Jp(),{checked:n,disableRipple:!0,disabled:!S,className:O()(T.checkbox,{[T.checked]:n}),tabIndex:-1}),v().createElement(md,{margin:y,level:s,className:T.marginWrapper},v().createElement(v().Fragment,null,!p&&(e=>"recommended"===t?v().createElement(hd,{className:T.recommendedIcon,tooltipTitle:mi().text("Recommended"),showForDisabled:!0}):v().createElement(ud,{attrType:e}))(C),v().createElement("div",{className:O()(T.itemTextWrapper,{[T.marginText]:p})},w&&v().createElement(f,{className:T.logoIcon}),v().createElement(Xp(),{primary:v().createElement(v().Fragment,null,o,i&&v().createElement(dd,null)),className:T.itemText})))),S&&m&&v().createElement("div",{className:T.itemAfter})))};Ed.defaultName="AttributeListItem";const bd=(0,b.memo)(Ed);var vd=r(49940);const Td=(0,kp.Z)({popupContainer:{},container:{"&$popupContainer":{height:"408px",minWidth:"200px"}}});function Od(){return Od=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Od.apply(this,arguments)}function xd(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Cd(e,t,r[t])}))}return e}function Cd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Sd=e=>{let{open:t,anchorEl:r,data:n,onSearch:a,onClose:i,titleText:o,filterText:l,onListItemClick:s,selected:c,hideCheckBox:u,renderGroupTitle:p}=e,d=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["open","anchorEl","data","onSearch","onClose","titleText","filterText","onListItemClick","selected","hideCheckBox","renderGroupTitle"]);const m=(0,b.useCallback)((e=>e.label.toLowerCase().includes(l.toLowerCase())),[l]),g=(0,b.useCallback)((e=>m(e)||(e.children||[]).some(g)),[m]),y=(0,b.useMemo)((()=>{const e=(0,_.curry)(((e,r,n,a)=>[{item:xd({},r,{filterText:l}),level:e,groupId:n,groupName:a},...t(r.children||[],n,a,e+1)])),t=function(t,r,n){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const i=t=>e(a,t,r,n),o=t.filter(g);return(p?_.map:_.chain)(i,o)};return t}),[l,p,g]),f=(0,b.useCallback)((e=>e.map((e=>({item:e,items:y(e.attributes,e.id,e.label)}))).filter((e=>e.items.length))),[y]),h=(0,b.useCallback)((e=>{let{item:t}=e;s(t,!c.find((e=>e.id===t.id||e.id.includes(`${t.id}.`))))}),[s,c]),E=(0,b.useMemo)((()=>(p?f:y)(n)),[n,p,f,y]),T=(0,b.useMemo)((()=>Hp(E)),[E]),{focusIndex:C,handleKeyDown:S}=$p({items:T,open:t,onSelectFocusedItem:h,selectedItems:c}),w=(0,b.useRef)(null);w.current=C;const A=(0,b.useCallback)(((e,t,r)=>{let{item:n,level:a=0}=t;const i=!!c.find((e=>e.id===n.id||e.id.includes(`${n.id}.`))),o=w.current===r;return v().createElement(bd,{key:n.id,onClick:s,checked:i,level:a,data:n,label:v().createElement(vd.o,{text:n.label,highlight:n.filterText}),labelInText:n.label,style:e,hideCheckBox:u,isFocused:o,notSelectable:n.notSelectable,LogoIcon:n.LogoIcon})}),[u,s,c]),R=(0,x.getMaxItemWidth)("label")(E)||308,I=Td();return v().createElement(zp,Od({open:t,className:O()(I.container,I.popupContainer),anchorEl:r,onClose:i,onSearch:a,title:o,containerWidth:R,searchInputOnKeyDown:S},d),v().createElement(Zp,{height:300,renderItem:A,items:T,hideSubtitles:!0,getItemSize:()=>32,containerWidth:R,focusIndex:C,renderGroupTitle:p}))};Sd.propTypes={open:vp().bool,hideCheckBox:vp().bool,anchorEl:vp().any,selected:vp().array,data:vp().array,filterText:vp().string,titleText:vp().string,onClose:vp().func,onListItemClick:vp().func,onSearch:vp().func,renderGroupTitle:vp().func},Sd.defaultProps={data:[],selected:[],titleText:mi().text("Show/hide columns"),filterText:""};var wd=r(97179);function Ad(){return Ad=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ad.apply(this,arguments)}const Rd=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",Ad({width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},r),v().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",opacity:".54"},v().createElement("path",{d:"M19 11.24V10h-4v1.24a8.417 8.417 0 00-2 .768V10H9v6h.29a8.497 8.497 0 00-.15.358l-.29.733.29.733.07.176H5c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2h14c1.1 0 2 .9 2 2v6.008a8.417 8.417 0 00-2-.768zM7 16v-6H5v6h2zm0-8V6H5v2h2zm6 0V6H9v2h4zm6 0V6h-4v2h4zm-2 5a6.451 6.451 0 00-6 4.09 6.451 6.451 0 006 4.092 6.451 6.451 0 006-4.091A6.451 6.451 0 0017 13zm0 6.818a2.728 2.728 0 010-5.454 2.728 2.728 0 010 5.454zm0-4.363c-.905 0-1.636.73-1.636 1.636 0 .905.73 1.636 1.636 1.636.905 0 1.636-.73 1.636-1.636 0-.906-.73-1.636-1.636-1.636z",fill:"#000",fillRule:"nonzero"})))},_d="Headers-styles-container--Zbdka",Id="Headers-styles-actionsBar--RXMy4",Nd="Headers-styles-previewSwitcher--Ppqem";function Dd(){return Dd=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Dd.apply(this,arguments)}const Pd=e=>{let{entityTypeUri:t,headColumns:r=[],onSelectColumns:n=_.identity}=e,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["entityTypeUri","headColumns","onSelectColumns"]);const[i,o]=(0,b.useState)(null),[l,s]=(0,b.useState)(""),c=(0,Tp.useSelector)(k().selectors.getMetadata),u=()=>{o(null),s("")},p=(0,b.useCallback)(((e,a)=>{const i=(0,Pi.kF)(c,t),o=(0,Pi.m5)(i,e.id);let l;l=o.length?a?r.concat(o):r.filter((e=>!o.find((t=>t.id===e.id)))):a?r.concat(e):r.filter((t=>t.id!==e.id)),n(l)}),[c,t,r,n]);return v().createElement(v().Fragment,null,v().createElement(wd.k,Dd({tooltipTitle:mi().text("Show/hide columns"),size:"M",icon:Rd,onClick:e=>o(e.currentTarget),className:"Headers-styles-headerIcon--c2qe7"},a)),(()=>{const e=(0,Pi.kF)(c,t);return v().createElement(Sd,{open:!!i,anchorEl:i,data:e,onListItemClick:p,selected:r,filterText:l,onClose:u,onSearch:s})})())};Pd.propTypes={entityTypeUri:vp().string,headColumns:vp().array,onSelectColumns:vp().func};const kd=Pd;var Ld=r(45053),Ud=r(72897),jd=r(27618),Fd=r.n(jd),Md=r(98515),Vd=r.n(Md),Bd=r(29289);const zd=e=>{let{headCellData:t,headIndex:r,sortOrder:n,sortField:a,sortHandler:i,canCheck:o,onCheck:l,headerCheckboxState:s,openConfigColumnPopup:c}=e;return v().createElement("div",{className:O()("HeadCellRenderer-styles-headCellContentWrapper--L6RrQ",(0,_.path)(["wrapperClassName"],t))},t&&o&&v().createElement(Jp(),{className:"HeadCellRenderer-styles-checkbox--qQEHg",checked:s||!1,indeterminate:null===s,onChange:()=>l()}),v().createElement("div",{className:"HeadCellRenderer-styles-labelWrapper--cmclk"},t&&(t.sortable?v().createElement(Fd(),{active:Boolean(n&&a===t.id),direction:n,onClick:i,classes:{root:"HeadCellRenderer-styles-sortLabel--NZx3o"},component:"div"},t.label):t.label)),c&&v().createElement("div",{className:"HeadCellRenderer-styles-menuButtonWrapper--aBNeR"},v().createElement(Pp.T,{icon:Vd(),onClick:c,size:"S","data-column-index":r})))};zd.propTypes={headCellData:vp().shape({id:vp().string,label:vp().oneOfType([vp().string,vp().node]),sortable:vp().bool}),headIndex:vp().number,sortOrder:vp().string,sortField:vp().string,sortHandler:vp().func,canCheck:vp().bool,onCheck:vp().func,headerCheckboxState:vp().oneOf([!0,!1,null]),openConfigColumnPopup:vp().func};const Hd=(0,Bd.q)((0,_.pick)(["openConfigColumnPopup"]))(zd),Yd=(0,Bd.q)((0,_.pick)(["openConfigColumnPopup","canCheck","onCheck","headerCheckboxState"]))(zd),Wd=v().createContext({generateEntityUrl:x.generateEntityUrlForOldMode,generatePivotingUrl:x.generatePivotingUrlForOldMode,generateTagUrl:x.generateTagUrlForOldMode});function Gd(){return Gd=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Gd.apply(this,arguments)}Wd.displayName="UrlGeneratorsContext";const qd=(0,b.forwardRef)(((e,t)=>{let{value:r,children:n,screen:a,className:i,shouldOpenInNewTab:o=!1}=e,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["value","children","screen","className","shouldOpenInNewTab"]);const{generateEntityUrl:s}=(0,b.useContext)(Wd),c=(0,w.ax)("openEntity"),u=(0,w.Qh)(),p=(0,b.useCallback)((e=>{(0,Dp.rR)(e)||(c({uri:r,screen:a}),e.preventDefault()),e.stopPropagation()}),[c,a,r]);return v().createElement("a",Gd({ref:t,href:(d=r,s({uiPath:u,uri:d,screen:a})),onClick:o?void 0:p,target:o?"_blank":"_self",rel:"noreferrer",className:i},l),n);var d}));qd.displayName="EntityUriLink";const Zd={popupBackdrop:"EntitiesTable-styles-popupBackdrop--nEX1F",popupContent:"EntitiesTable-styles-popupContent--PLSPL",complexPopupContent:"EntitiesTable-styles-complexPopupContent--wqOGI",highlighted:"EntitiesTable-styles-highlighted--GHk6T",highlightAnimate:"EntitiesTable-styles-highlightAnimate--oR7ki",inactiveBackground:"EntitiesTable-styles-inactiveBackground--nAfS3",inactiveHoverBackground:"EntitiesTable-styles-inactiveHoverBackground--qe__Y",inactiveSelectedBackground:"EntitiesTable-styles-inactiveSelectedBackground--WkWtD",inactiveSelectedHoverBackground:"EntitiesTable-styles-inactiveSelectedHoverBackground--oFAbX",textOverflow:"EntitiesTable-styles-textOverflow--AAABW",textOverflowInactive:"EntitiesTable-styles-textOverflowInactive--eU4xE",link:"EntitiesTable-styles-link--JNCz5",defaultWrapper:"EntitiesTable-styles-defaultWrapper--EP4tA",table:"EntitiesTable-styles-table--jmlbo",imageWrapper:"EntitiesTable-styles-imageWrapper--xmq8R",blobWrapper:"EntitiesTable-styles-blobWrapper--ruHVs",highlightAnimateForEllipsis:"EntitiesTable-styles-highlightAnimateForEllipsis--r1Fmq",referenceWrapper:"EntitiesTable-styles-referenceWrapper--Q5RqZ",referenceContent:"EntitiesTable-styles-referenceContent--wkahK",referenceIcon:"EntitiesTable-styles-referenceIcon--b8M3n",nestedCellWrapper:"EntitiesTable-styles-nestedCellWrapper--I4J6A",nestedAttributeWrapper:"EntitiesTable-styles-nestedAttributeWrapper--dvfn3",profileWrapper:"EntitiesTable-styles-profileWrapper--lGPma",entityAvatar:"EntitiesTable-styles-entityAvatar--GiuUS",entityAvatarImage:"EntitiesTable-styles-entityAvatarImage--UHIRm",entityLabel:"EntitiesTable-styles-entityLabel--OyjLV",scores:"EntitiesTable-styles-scores--RqsDU",dragColumnHead:"EntitiesTable-styles-dragColumnHead--oDlFz",dragColumnBody:"EntitiesTable-styles-dragColumnBody--_HZDV",draggableHeadCell:"EntitiesTable-styles-draggableHeadCell--DbfHi",cellWrapper:"EntitiesTable-styles-cellWrapper--dUWGQ",entityButtons:"EntitiesTable-styles-entityButtons--tYSvC",selectedEntityButtons:"EntitiesTable-styles-selectedEntityButtons--mZJfv",justImportedEntityButtons:"EntitiesTable-styles-justImportedEntityButtons--q5bPw",highlightedEntityButtons:"EntitiesTable-styles-highlightedEntityButtons--PvzNM"},$d=e=>{let{value:t={}}=e;const r=(0,x.getLabel)(t.label);return v().createElement("div",{className:O()(Zd.defaultWrapper,Zd.profileWrapper)},v().createElement(A,{avatarClassName:Zd.entityAvatar,imageClassName:Zd.entityAvatarImage,entity:t}),v().createElement(qd,{value:(0,x.getEntityUriForLink)(t),className:Zd.entityLabel},r))};$d.propTypes={value:vp().object};const Kd=$d;var Xd=r(56755);const Qd=e=>{let{value:t,columnData:{dataTypeDefinition:r}}=e;return v().createElement("div",{className:Zd.defaultWrapper},r?v().createElement(Xd.x,{value:t,dataTypeDefinition:r}):t)};Qd.propTypes={value:vp().any,columnData:vp().object};const Jd=Qd,em=(e,t,r)=>{const n=(0,x.getEntityTypeGraphIcon)(e,{type:t});return(0,x.getAbsoluteImageUrl)(r,n)};let tm=function(e){return e[e.ICON_MODE=0]="ICON_MODE",e[e.TEXT_MODE=1]="TEXT_MODE",e[e.ERROR_MODE=2]="ERROR_MODE",e}({});function rm(){return rm=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},rm.apply(this,arguments)}const nm=e=>{let{className:t,icon:r,avatarText:n,rootClasses:a}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","icon","avatarText","rootClasses"]);const[o,l]=(0,b.useState)(null);(0,b.useEffect)((()=>{l(r?tm.ICON_MODE:tm.TEXT_MODE)}),[r,n]);const s=()=>{l(tm.ERROR_MODE)};switch(o){case tm.ICON_MODE:return v().createElement(S(),rm({className:O()(t,null==a?void 0:a.iconRoot),src:r,onError:s},i));case tm.TEXT_MODE:case tm.ERROR_MODE:return v().createElement(S(),rm({className:O()(t,null==a?void 0:a.textRoot)},i),n);default:return null}},am=e=>{let{value:t}=e;const r=(0,Tp.useSelector)(k().selectors.getMetadata),n=(0,Tp.useSelector)(k().selectors.getApiPath),a=(0,Tp.useSelector)(k().selectors.getImagePath);return t&&v().createElement("div",{className:O()(Zd.defaultWrapper,Zd.referenceWrapper)},v().createElement(nm,{className:Zd.referenceIcon,icon:em(r,t.refEntity.type,a||n)}),v().createElement(qd,{value:t.refEntity.objectURI,className:Zd.referenceContent},(0,x.getLabel)(t.label)))};am.propTypes={value:vp().object};const im=am,om=e=>{e.stopPropagation()},lm=e=>{const{value:t}=e;return v().createElement("div",{className:Zd.blobWrapper,onScroll:om},t)};lm.propTypes={value:vp().any};const sm=lm,cm=e=>{let{value:t}=e;const r=(0,x.getImageAttributeOvThumbnailUrl)({value:t});return r&&v().createElement("div",{className:Zd.imageWrapper},v().createElement("img",{src:r}))};cm.propTypes={value:vp().object};const um=cm,pm=e=>{if("label"===e.id)return Kd;switch((0,_.path)(["attrType","type"],e)){case"Reference":return im;case"Blob":return sm;case"Image":return um}return Jd};function dm(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){mm(e,t,r[t])}))}return e}function mm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function gm(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}const ym=(0,_.split)("."),fm=["entityId"],hm=e=>!fm.includes(e.id),Em=e=>{if((0,x.isAttributeSearchUri)(e)){const[,...t]=ym(e);return t.length>1?t.slice(0,-1):null}return null};var bm=r(39034),vm=r(57526),Tm=r.n(vm),Om=r(18567),xm=r.n(Om),Cm=r(99272),Sm=r.n(Cm);const wm=(0,kp.Z)({root:{display:"flex",alignItems:"center",justifyContent:"center",width:"24px",height:"24px"},check:{color:"#8CC152"}}),Am=e=>{let{classes:t={},tooltip:r="",onClick:n=_.identity,mode:a=bm.Eh.Init}=e;const i=wm();return v().createElement("div",{className:O()(i.root,t.root)},(()=>{switch(a){case bm.Eh.Init:return v().createElement(wd.k,{className:t.button,size:"M",tooltipTitle:r,icon:xm(),onClick:n});case bm.Eh.Progress:return v().createElement(Tm(),{className:t.spinner,size:24});case bm.Eh.Success:return v().createElement(Sm(),{className:O()(i.check,t.check)});default:return null}})())};function Rm(){return Rm=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Rm.apply(this,arguments)}const _m=e=>{let{entity:t,importStatus:r,onImportStatusChange:n,hideDelay:a=3e3}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["entity","importStatus","onImportStatusChange","hideDelay"]);const o=(0,Tp.useSelector)(k().selectors.getDtssPath),l=(0,Tp.useSelector)(k().selectors.getTenant);return v().createElement(Am,Rm({},i,{mode:r,tooltip:mi().text("Import this record"),onClick:e=>{e.stopPropagation(),n(bm.Eh.Progress),(0,x.importEntityFromDataTenant)({dtssPath:o,customerTenant:l,entity:t}).then((e=>{let{success:r,uris:i}=e;if(!r)throw new Error("Failed to import entity");t.ctSubscribedUris=i,n(bm.Eh.Success),setTimeout((()=>n(bm.Eh.Done)),a)})).catch((()=>{n(bm.Eh.Init),(0,pi.U)(undefined,{title:mi().text("Import Error"),message:mi().text("Record can't be imported")})}))}}))},Im=(0,kp.Z)({importButtonPlaceholder:{display:"flex",alignItems:"center",padding:"0 10px",width:"24px",flexShrink:0,position:"relative"}}),Nm=e=>{let{entity:t,entityImportStatus:r,onEntityImportStatusChange:n}=e;const a=Im(),i=(0,Tp.useSelector)(k().selectors.getMetadata),o=(0,Tp.useSelector)(k().selectors.getCanUserImportEntitiesFromDT),l=(0,x.isDataTenantEntity)(t)&&o,s=(0,x.getEntityType)(i,t.type),c=(0,x.checkCanImportEntityOfType)(s)&&!(0,x.isEntityImportedToCT)(t),u=r&&r!==bm.Eh.Done||c;return v().createElement(v().Fragment,null,l&&v().createElement("div",{className:a.importButtonPlaceholder},u&&v().createElement(_m,{entity:t,importStatus:r,onImportStatusChange:e=>n(t.uri,e)})))},Dm=e=>{let{entity:t,isSelectedEntity:r,isHighlightedEntity:n,entityImportStatus:a,onEntityImportStatusChange:i}=e;return v().createElement("div",{className:O()(Zd.entityButtons,{[Zd.selectedEntityButtons]:r,[Zd.justImportedEntityButtons]:a===bm.Eh.Success,[Zd.highlightedEntityButtons]:n})},v().createElement(Nm,{entity:t,entityImportStatus:a,onEntityImportStatusChange:i}))};Dm.propTypes={entity:vp().object,isSelectedEntity:vp().bool,isHighlightedEntity:vp().bool,entityImportStatus:vp().oneOf(Object.values(bm.Eh)),onEntityImportStatusChange:vp().func};const Pm=(0,Bd.q)(((e,t)=>{let{entitiesImportStatus:r,onEntityImportStatusChange:n,selectedEntityUri:a,highlightedEntityIndex:i}=e,{entity:o,rowIndex:l}=t;return{entityImportStatus:o&&r[o.uri],onEntityImportStatusChange:n,isSelectedEntity:a===o.uri,isHighlightedEntity:i===l}}))(Dm);var km=r(72326),Lm=r(67655);function Um(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){jm(e,t,r[t])}))}return e}function jm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Fm={height:"100%",display:"flex",flexDirection:"column"},Mm=(0,kp.Z)((e=>({inactiveCell:Um({background:e.inactiveBackground},Fm,{"&$selectedRowCell":{background:e.inactiveSelectedBackground}}),selectedRowCell:Um({background:(0,Lm.lighten)(e.palette.primary.main,.88)},Fm),clickable:Um({cursor:"pointer"},Fm),justImported:Um({backgroundColor:"#FFFBEB !important"},Fm)}))),Vm={entity:vp().object,isSelected:vp().bool,onEntityClick:vp().func,isJustImported:vp().bool},Bm=(0,kp.Z)({checkboxWrapper:{display:"flex",alignItems:"center"},checkbox:{marginRight:"-8px",marginLeft:"11px"}});const zm={onCheck:vp().func,isChecked:vp().bool,hasCheckbox:vp().bool},Hm=(0,kp.Z)({collapser:{marginLeft:"-2px"}});var Ym=r(18021),Wm=r(8835),Gm=r.n(Wm);const qm=(0,kp.Z)({collapseButton:{cursor:"pointer"},expandLess:{transform:"rotate( -180deg )"}});function Zm(){return Zm=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Zm.apply(this,arguments)}const $m=e=>{let{isOpen:t=!1,tooltipTitle:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["isOpen","tooltipTitle"]);const a=qm(),i={icon:Gm(),className:a.collapseButton,iconClassName:O()({[a.expandLess]:t})},o={tooltipTitle:r};return v().createElement(wd.k,Zm({"data-reltio-id":"collapse-button"},i,o,n))},Km=(0,kp.Z)((()=>({hidden:{visibility:"hidden"}}))),Xm=e=>{let{rowIndex:t,rowValue:r,className:n}=e;const a=Km(),{toggleRowCollapse:i,getIsRowCollapsible:o,getIsRowCollapsed:l}=(0,b.useContext)(Ym.x),s=o(r),c=l(t);return v().createElement($m,{className:O()(n,{[a.hidden]:!s}),isOpen:!c,onClick:e=>{i(t),e.stopPropagation()}})};const Qm={hasCollapseButton:vp().bool},Jm=(0,_.pipe)((e=>{const t=t=>{const r=Hm(),{hasCollapseButton:n}=t,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(t,["hasCollapseButton"]),{rowValue:i,rowIndex:o}=a;return n?v().createElement("div",{className:"cellWithCollapser"},v().createElement(Xm,{className:r.collapser,rowIndex:o,rowValue:i}),v().createElement(e,a)):v().createElement(e,a)};return t.propTypes=Qm,t}),(e=>{const t=t=>{const r=Bm(),{onCheck:n,isChecked:a,hasCheckbox:i}=t,o=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(t,["onCheck","isChecked","hasCheckbox"]),{rowValue:{rawValue:l}}=o;return i?v().createElement("div",{className:O()(r.checkboxWrapper,"cellWithCheckbox")},v().createElement(Jp(),{className:r.checkbox,checked:a,onClick:e=>e.stopPropagation(),onChange:e=>n(l.uri,e.target.checked)}),v().createElement(e,o)):v().createElement(e,o)};return t.propTypes=zm,t}),(e=>{const t=t=>{const r=Mm(),{rowValue:{rawValue:n},isSelected:a,onEntityClick:i,isJustImported:o}=t,l=i?()=>i(n.uri):void 0,s=n&&!(0,x.isActiveObject)(n);return l||s||a||o?v().createElement("div",{className:O()({[r.inactiveCell]:s},{inactiveCell:s},{[r.selectedRowCell]:a},{selectedRowCell:a},{[r.clickable]:!!l},{[r.justImported]:o},{justImported:o}),onClick:l},v().createElement(e,t)):v().createElement(e,t)};return t.propTypes=Vm,t}),(0,Bd.q)(((e,t)=>{let{onEntityClick:r,selectedEntityUri:n,entitiesImportStatus:a,canCheck:i,onCheck:o,checkedEntitiesUris:l}=e,{rowValue:s,columnIndex:c}=t;const{rawValue:u}=s,p=0===c;return{onCheck:o,isChecked:l&&l.includes(u.uri),hasCheckbox:i&&p,hasCollapseButton:p,isSelected:n===u.uri,isJustImported:a[u.uri]===bm.Eh.Success,onEntityClick:r}})))(km.DN),eg=e=>{let{columnData:t,cell:r}=e;const n=r.values.length,a=28*Math.max(n,1)+20;if(!n)return a;switch((0,_.path)(["dataTypeDefinition","type"],t)){case"Reference":return 28*n+17;case"Blob":return 100*n;case"Image":return 76*n+17;default:return a}},tg=(0,b.forwardRef)(((e,t)=>{let{headColumns:r,entities:n,entityToHighlight:a,selectedEntityUri:i,onReorderingColumn:o,dndColumnReorderingEnabled:l,columnsSize:s,onChangeColumnsSize:c,onScroll:u,onSort:p,sortField:d,sortOrder:m,onEntityHover:g,onEntityClick:y,entitiesImportStatus:f,onEntityImportStatusChange:h,logger:E,canCheck:T,checkedEntitiesUris:O,headerCheckboxState:C,onCheck:S,openConfigColumnPopup:w,resizeDebounceDelay:A}=e;const R=(0,b.useMemo)((()=>({highlightRow:"highlightedSelector",dragColumnHead:Zd.dragColumnHead,dragColumnBody:Zd.dragColumnBody,draggableHeadCell:Zd.draggableHeadCell,cellWrapper:Zd.cellWrapper})),[]),I=(0,Tp.useSelector)(k().selectors.getMetadata),[N,D]=(0,b.useState)(null),P=(0,b.useCallback)((e=>{D(e),g&&g((0,_.path)([e,"uri"],n))}),[g,n]),L=(0,b.useRef)();(0,b.useImperativeHandle)(t,(()=>({resetScrollbarPosition:()=>{L.current&&L.current.resetScrollbarPosition({resetLeft:!1})}})));const U=(0,b.useCallback)((e=>{m&&e===d?m===Ld.oy?p({field:e,order:Ld.U9}):p({field:e}):p({field:e,order:Ld.oy})}),[p,d,m]),j=(0,b.useCallback)((e=>{const t=(0,_.prop)(e,n);return t?v().createElement(Pm,{entity:t,rowIndex:e}):null}),[n]),F=(0,b.useCallback)((e=>v().createElement(Jm,e)),[]),M=!!g,V=!!p,B=(0,b.useMemo)((()=>function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e.map(((e,r)=>{var n;let{attrType:a}=e,i=gm(e,["attrType"]);const o=0===r;return dm({},i,{dataTypeDefinition:a&&(0,x.getAttrDataTypeDefinition)(a),resizable:!0,autoResize:null!==(n=i.autoResize)&&void 0!==n?n:!o,draggable:!o,sortable:t&&hm(i),nestedPath:Em(i.id),headCellRenderer:o?Yd:Hd,rowCellValueRenderer:pm(dm({},i,{attrType:a}))})}))}(r,V)),[r,V]),z=(0,b.useMemo)((()=>((e,t,r)=>(r||[]).map((e=>(0,_.pipe)((0,_.reduce)(((t,r)=>(0,_.assoc)(r.id,((e,t,r)=>{switch(t.id){case"label":return r;case"entityId":return(0,x.getEntityId)(r);default:{const[e,...n]=ym(t.id);return(0,_.pipe)((0,_.prop)(e),(0,x.getOvAttributeValuesByPath)(n))(r)}}})(0,r,e),t)),{}),(0,_.assoc)("rawValue",e))(t))))(0,r,n)),[I,r,n]),H=a?n.findIndex((0,_.propEq)("uri",a)):-1,Y=(0,b.useMemo)((()=>({onEntityClick:y,selectedEntityUri:i,highlightedEntityIndex:H,entitiesImportStatus:f,onEntityImportStatusChange:h,canCheck:T,checkedEntitiesUris:O,headerCheckboxState:C,onCheck:S,openConfigColumnPopup:w})),[O,f,C,H,T,S,y,h,i,w]);return v().createElement(Ud.M,{fixFirstColumn:!0,onScroll:u,rowsData:z,columnsData:B,onSort:U,highlightRow:-1!==H?H:null,ref:L,sortFieldClassName:Zd.sortableCell,containerClassName:Zd.table,classes:R,defaultColumnWidth:250,headRowHeight:50,defaultColumnMinWidth:100,defaultRowHeight:48,sorting:{field:d,order:m},dndColumnReorderingHandler:o,dndColumnReorderingEnabled:l,onChangeColumnsSize:c,columnsSize:s,resizeDebounceDelay:null!=A?A:150,onRowHover:M?P:void 0,hoverStateEnabled:M,hoverRowIndex:N,renderRowOverlay:j,logger:E,context:Y,maxRowValuesCount:2,renderRowCell:F,getRowCellHeight:eg})}));tg.propTypes={entities:vp().array,entityToHighlight:vp().string,selectedEntityUri:vp().string,headColumns:vp().array,columnsSize:vp().array,onScroll:vp().func,onSort:vp().func,onReorderingColumn:vp().func,onChangeColumnsSize:vp().func,dndColumnReorderingEnabled:vp().bool,onEntityClick:vp().func,onEntityHover:vp().func,sortField:vp().string,sortOrder:vp().oneOf([Ld.oy,Ld.U9]),entitiesImportStatus:vp().object,onEntityImportStatusChange:vp().func,logger:vp().func,canCheck:vp().bool,checkedEntitiesUris:vp().arrayOf(vp().string),headerCheckboxState:vp().oneOf([!0,!1,null]),onCheck:vp().func,openConfigColumnPopup:vp().func,resizeDebounceDelay:vp().number},tg.defaultProps={entities:[],headColumns:[]},tg.displayName="EntitiesTable";const rg=(0,b.memo)(tg);var ng=r(4437),ag=r.n(ng),ig=r(5106),og=r.n(ig);const lg="left",sg="right",cg="hide",ug={[lg]:mi().text("Insert 1 left"),[sg]:mi().text("Insert 1 right"),[cg]:mi().text("Hide column")},pg=e=>{let{open:t,anchorEl:r,onClick:n,onClose:a,actions:i}=e;return v().createElement(xp(),{open:t,anchorEl:r,onClose:a},v().createElement(ag(),{component:"div"},i.map(((e,t)=>((e,t,r)=>v().createElement(og(),{button:!0,component:"div",key:r,onClick:t},v().createElement(Xp(),{primary:ug[e],primaryTypographyProps:{variant:"body2"}})))(e,(e=>()=>{n(e)})(e),t)))))};pg.propTypes={open:vp().bool,anchorEl:vp().any,onClick:vp().func,onClose:vp().func,actions:vp().array};const dg=pg;class mg extends v().PureComponent{constructor(){super(...arguments),this.state={addColumnPopupOpen:!1,configColumnPopupOpen:!1,configurableColumnIndex:!1,popupAnchor:null,filterText:""},this.addColumnHandler=e=>{const{newColumnPlaceIndex:t}=this.state,{onChangeColumnsList:r,headColumns:n}=this.props,a=n.slice();a.splice(t,0,e),r({columns:a}),this.closeAddColumnPopup()},this.openAddColumnPopup=e=>{let{newColumnPlaceIndex:t}=e;this.setState({newColumnPlaceIndex:t,configColumnPopupOpen:!1,addColumnPopupOpen:!0})},this.closeAddColumnPopup=()=>{this.setState({popupAnchor:null,addColumnPopupOpen:!1,filterText:""})},this.setFilterText=e=>{this.setState({filterText:e})},this.openConfigColumnPopup=e=>{this.setState({popupAnchor:e.currentTarget,configColumnPopupOpen:!0,configurableColumnIndex:parseInt(e.currentTarget.getAttribute("data-column-index"))})},this.closeConfigColumnPopup=()=>{this.setState({configColumnPopupOpen:!1})},this.configColumnHandler=e=>{const{configurableColumnIndex:t}=this.state;switch(e){case lg:this.openAddColumnPopup({newColumnPlaceIndex:t});break;case sg:this.openAddColumnPopup({newColumnPlaceIndex:t+1});break;case cg:this.hideCurrentConfigColumn()}},this.hideCurrentConfigColumn=()=>{const{configurableColumnIndex:e}=this.state,{onChangeColumnsList:t,headColumns:r}=this.props,n=r.slice();n.splice(e,1),t({columns:n}),this.closeConfigColumnPopup()},this.memoizedGetColumnSize=(0,x.memoizeWith)(mg.getMemoIdForColumnSize,mg.getColumnSizeFromHeadColumns)}static getColumnSizeFromHeadColumns(e){return e.map((e=>({id:e.id,size:e.size})))}static getMemoIdForColumnSize(e,t){return`${t}${(0,_.toString)(e.map((e=>(0,_.pick)(["id","size"],e))))}`}render(){const{entities:e,entityToHighlight:t,selectedEntityUri:r,onScroll:n,headColumns:a,sortField:i,sortOrder:o,dndColumnReorderingEnabled:l,onEntityClick:s,onEntityHover:c,entitiesTableRef:u,additionalColumns:p,onChangeColumnsList:d,onReorderingColumn:m,onSort:g,onChangeColumnsSize:y,entityTypeUri:f,entitiesImportStatus:h={},onEntityImportStatusChange:E,logger:b,canCheck:T,checkedEntitiesUris:O,headerCheckboxState:x,onCheck:C,resizeDebounceDelay:S}=this.props,{addColumnPopupOpen:w,configColumnPopupOpen:A,popupAnchor:R,filterText:_,configurableColumnIndex:I}=this.state,N=this.memoizedGetColumnSize(a,f);return v().createElement(v().Fragment,null,v().createElement(rg,{entities:e,entityToHighlight:t,selectedEntityUri:r,onScroll:n,onSort:g,onEntityClick:s,onEntityHover:c,headColumns:a,sortField:i,sortOrder:o,onReorderingColumn:m,ref:u,onChangeColumnsList:d,dndColumnReorderingEnabled:l,onChangeColumnsSize:y,columnsSize:N,entitiesImportStatus:h,onEntityImportStatusChange:E,logger:b,canCheck:T,checkedEntitiesUris:O,headerCheckboxState:x,onCheck:C,openConfigColumnPopup:this.openConfigColumnPopup,resizeDebounceDelay:S}),v().createElement(Sd,{open:w,anchorEl:R,data:p,onListItemClick:this.addColumnHandler,filterText:_,onClose:this.closeAddColumnPopup,onSearch:this.setFilterText,hideCheckBox:!0,titleText:di.text("Add column")}),v().createElement(dg,{onClick:this.configColumnHandler,onClose:this.closeConfigColumnPopup,anchorEl:R,open:A,actions:I>0?[lg,sg,cg]:[sg]}))}}mg.propTypes={entities:vp().array,entityToHighlight:vp().string,selectedEntityUri:vp().string,entityTypeUri:vp().string,headColumns:vp().array,dndColumnReorderingEnabled:vp().bool,onScroll:vp().func,onSort:vp().func,onReorderingColumn:vp().func,onChangeColumnsSize:vp().func,onChangeColumnsList:vp().func,onEntityClick:vp().func,onEntityHover:vp().func,sortField:vp().string,sortOrder:vp().oneOf([Ld.oy,Ld.U9]),entitiesTableRef:vp().shape({current:vp().shape({resetScrollbarPosition:vp().func})}),additionalColumns:vp().arrayOf(vp().shape({id:vp().string,label:vp().string})),entitiesImportStatus:vp().object,onEntityImportStatusChange:vp().func,logger:vp().func,canCheck:vp().bool,checkedEntitiesUris:vp().arrayOf(vp().string),headerCheckboxState:vp().oneOf([!0,!1,null]),onCheck:vp().func};const gg=mg;var yg=r(66780),fg=r(9366),hg=r(41633),Eg=r(79881),bg=r.n(Eg),vg=r(93962),Tg=r.n(vg),Og=r(45995),xg=r.n(Og);function Cg(){return Cg=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Cg.apply(this,arguments)}const Sg=e=>{let{open:t=!0,children:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["open","children"]);const[a,i]=(0,b.useState)(t),o=(0,Lm.useTheme)().transitions.duration.leavingScreen;return(0,b.useEffect)((()=>{if(t!==a){if(!t){const e=setTimeout((()=>{i(!1)}),o);return()=>clearTimeout(e)}i(!0)}}),[t,o,a]),v().createElement(xg(),Cg({open:t},n),a&&r)};Sg.displayName="Drawer";var wg=r(18759),Ag=r.n(wg),Rg=r(30122),_g=r.n(Rg),Ig=r(43410),Ng=r.n(Ig),Dg=r(93416),Pg=r.n(Dg),kg=r(66825),Lg=r.n(kg),Ug=r(17698);const jg=(0,_.allPass)([(0,_.propSatisfies)(_.isEmpty,"configs"),(0,_.pathEq)(["group","hasCollapseButton"],!0)]),Fg=(0,_.reject)(jg),Mg=(0,kp.Z)({titleBox:{display:"flex",flexDirection:"row",flexShrink:0,lineHeight:"24px",paddingTop:"12px",paddingBottom:"8px",alignItems:"center",justifyContent:"space-between"},title:{color:"rgba(0,0,0,0.87)",display:"flex",flexGrow:1,alignItems:"center",fontSize:16,fontWeight:500,paddingLeft:16,letterSpacing:"0.15px",overflow:"hidden"},text:{},avatar:{marginRight:12,width:"32px",height:"32px"},collapseIcon:{marginRight:8},leftIcon:{flexShrink:0,marginRight:"20px"}}),Vg=e=>{let{title:t="",iconSrc:r="",isOpen:n=!0,hasCollapseButton:a=!0,leftIcon:i,onCollapse:o}=e;const l=Mg();return v().createElement("div",{className:l.titleBox},v().createElement("div",{className:l.title},i&&v().createElement("div",{className:l.leftIcon},i),r&&v().createElement(S(),{src:r,className:l.avatar}),v().createElement(gd.Y,{value:t},v().createElement("span",{className:l.text},t))),a&&v().createElement($m,{isOpen:n,onClick:o,className:l.collapseIcon,size:"S"}))};var Bg=r(1230),zg=r.n(Bg),Hg=r(36631);const Yg=e=>{let{facet:t,selectedFacets:r}=e;return!!r.find((e=>e.fieldName===t.fieldName||e.fieldName.includes(`${t.fieldName}.`)))},Wg=e=>{let{facet:t,selectedFacets:r}=e;return Yg({facet:t,selectedFacets:r})||(0,N.OP)(t)&&t.children&&t.children.some((e=>Yg({facet:e,selectedFacets:r})))},Gg=(0,kp.Z)({icon:{maxHeight:"25px",maxWidth:"25px",marginRight:"16px"}}),qg=e=>{let{group:t,metadata:r}=e;const n=Gg(),a=(0,w.$H)(),i=(0,x.getEntityTypeGraphIcon)(r,{type:t.id}),o=(0,x.getAbsoluteImageUrl)(a,i);return v().createElement(nm,{className:n.icon,icon:o,avatarText:t.title[0]})};function Zg(){return Zg=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Zg.apply(this,arguments)}const $g=e=>{let{onListItemClick:t,focusIndex:r,selectedFacets:n,metadata:a}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["onListItemClick","focusIndex","selectedFacets","metadata"]);const o=(0,b.useRef)(null);o.current=n;const l=(0,b.useRef)(null);l.current=r;const s=(0,b.useCallback)(((e,r,n)=>{let{item:a,level:i,groupId:s}=r;const c=Wg({facet:a,selectedFacets:o.current}),u=l.current===n;return v().createElement(bd,{key:`item-${s}-${a.fieldName}`,onClick:t,data:a,label:v().createElement(vd.o,{text:a.title,highlight:a.filterText}),labelInText:a.title,level:i,style:e,checked:c,isFocused:u,groupId:s,LogoIcon:a.LogoIcon})}),[t]),c=(0,b.useCallback)(((e,t)=>v().createElement(og(),{component:"div",className:"MoreFacetsPopup-styles-subHeader--h1vGz",style:e,key:`group-${t.item.id}`},t.item.needGroupIcon&&v().createElement(qg,{metadata:a,group:t.item}),t.item.title)),[a]),u=(0,b.useCallback)(((e,t)=>t.items?40:28),[]);return v().createElement(Zp,Zg({getItemSize:u,renderGroupTitle:c,renderItem:s,focusIndex:r},i,{disableHorizontalScrollbar:!0}))};function Kg(){return Kg=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Kg.apply(this,arguments)}const Xg=574,Qg={},Jg=e=>{let{metadata:t,open:r,selectedFacets:n,data:a=[],onListItemClick:i,lastFacetClicked:o=Qg,width:l,height:s=Xg}=e,c=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["metadata","open","selectedFacets","data","onListItemClick","lastFacetClicked","width","height"]);const[u,p]=(0,b.useState)(464),d=s-110;(0,b.useEffect)((()=>{p(d)}),[d]);const m=(0,b.useCallback)(((e,t)=>p((0,_.clamp)(56,d,t))),[d]),g=(0,b.useRef)();(0,b.useEffect)((()=>{const e=(0,_.path)(["current","updatePosition"],g);e&&e()}),[u]);const y=(0,b.useCallback)((function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return[{type:"item",item:e,moveTo:(0,_.has)("facetConfig")(o)&&o.facetConfig.fieldName===e.fieldName&&t===o.groupId,level:r,groupId:t}].concat(e.children?e.children.flatMap((e=>y(e,t,r+1))):[]).flat().filter((e=>!e.item.hide))}),[o]),f=(0,b.useCallback)((e=>e.map((e=>({type:"group",item:e,items:e.facets.filter((e=>!e.hide)).map((t=>y(t,e.id)))}))).filter((e=>e.items.length))),[y]),h=(0,b.useMemo)((()=>f(a)),[a,f]),E=(0,b.useMemo)((()=>(0,yi.LG)(h)),[h]),T=(0,b.useCallback)((e=>{let{item:t,groupData:r}=e;i(t,!Wg({facet:t,selectedFacets:n}),r.groupId)}),[i,n]),{focusIndex:O,handleKeyDown:C}=$p({items:E,open:r,onSelectFocusedItem:T,selectedItems:n}),S=Math.max(l||(0,x.getMaxItemWidth)("title")(h),240);return v().createElement(zp,Kg({open:r,action:g,title:mi().text("Select attribute"),containerWidth:S,searchInputOnKeyDown:C,containerHeight:110+u},c),v().createElement($g,{focusIndex:O,selectedFacets:n,onListItemClick:i,metadata:t,items:E,height:u,onInnerContainerResize:m}),0===E.length&&v().createElement("div",{className:"MoreFacetsPopup-styles-noResultsCaptionContainer--ChfND"},v().createElement(Ag(),{variant:"caption",display:"block",gutterBottom:!0},mi().text("No results found"))))};function ey(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ty(e,t,r[t])}))}return e}function ty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class ry extends b.PureComponent{constructor(e){super(e),this.state={filterText:"",lastFacetClicked:null,addedFacets:[]},this.searchInputRootRef=v().createRef(),this.showSearchInput=()=>this.searchInputRootRef.current.scrollIntoView(!0),this.openPopup=()=>this.props.dispatch(vi(!0)),this.closePopup=()=>{this.props.dispatch(vi(!1)),this.props.dispatch(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{type:L.k.HIGHLIGHT_ADDED_FACETS,payload:e}}(this.state.addedFacets)),this.setState({addedFacets:[]}),setTimeout((()=>{this.props.dispatch({type:L.k.CLEAR_HIGHLIGHT_ADDED_FACETS})}),3e3)},this.setFilterText=e=>this.setState({filterText:e,lastFacetClicked:null}),this.clearFilterText=()=>this.setFilterText(""),this.setLastFacetClicked=e=>this.setState({lastFacetClicked:e}),this.resetLastFacetClicked=()=>this.setLastFacetClicked(null),this.filterItem=e=>{const{filterText:t=""}=this.state;return e.title.toLowerCase().includes(t.toLowerCase())},this.filterItemsTree=e=>this.filterItem(e)||(e.children||[]).some(this.filterItemsTree),this.getFilteredFacets=e=>(e||[]).map((e=>ey({},e,{hide:!this.filterItemsTree(e),filterText:this.state.filterText}))).map((e=>{const t=this.getFilteredFacets(e.children);return(0,_.isEmpty)(t)?e:ey({},e,{children:t})})),this.filterItemsInGroups=e=>e.map((e=>ey({},e,{facets:this.getFilteredFacets(e.facets)}))),this.rejectNotAllowedEntityTypes=e=>t=>t.filter((t=>{let{id:r}=t;return!(0,x.isEntityTypeUri)(r)||e.includes(r)})),this.toggleSelectedFacet=(e,t)=>{const{facetsConfigs:r,selectedEntityTypes:n,dispatch:a}=this.props,i=(0,yi.jj)(e),o=t?r.concat(e).concat(i):r.filter((t=>t.fieldName!==e.fieldName)).filter((e=>!i.find((t=>t.fieldName===e.fieldName)))),l=(0,_.uniq)(o.filter((e=>e.entityTypeUri)).map((e=>e.entityTypeUri)).concat(n)),s=o.filter((0,_.complement)(N.OP)),c=s.filter((e=>!r.find((t=>t.fieldName===e.fieldName)))),u=r.filter((e=>!s.find((t=>e.fieldName===t.fieldName)))).map((e=>e.fieldName));(c.length||u.length)&&(this.setAddedFacets(c.map((0,_.prop)("fieldName")),u),a(si({facetsToAdd:c,fieldNamesToDelete:u,changedEntityTypes:(0,_.equals)(l,n)?null:l})))},this.setAddedFacets=(e,t)=>{const r=this.state.addedFacets.concat(e).filter((e=>!t.includes(e)));this.setState({addedFacets:r})},this.handleItemClick=(e,t,r)=>{this.setLastFacetClicked({facetConfig:e,groupId:r}),this.toggleSelectedFacet(e,t)},this.handlePopupClose=()=>{this.closePopup(),this.clearFilterText(),this.resetLastFacetClicked()},this.memoizedCollectFacetsList=(0,Hg.Z)(N.tI),this.handleInputFocus=()=>{this.showSearchInput(),this.openPopup()}}get inputWidth(){return this.searchInputRootRef.current?this.searchInputRootRef.current.getBoundingClientRect().width:0}render(){const{filterText:e,lastFacetClicked:t}=this.state,{open:r,recommendedFacets:n,classes:a,metadata:i,selectedEntityTypes:o,facetsConfigs:l,dataTenantObject:s,allowedEntityTypes:c,dataTenants:u}=this.props,p=l.map((e=>({fieldName:e.fieldName,uri:e.uri}))),d=this.memoizedCollectFacetsList(i,o,n,u),m=(0,_.pipe)((0,_.when)((0,_.always)(e),this.filterItemsInGroups),(0,_.when)((0,_.always)(c),this.rejectNotAllowedEntityTypes(c)),(0,j.Eb)(s))(d),{verticalOrigin:g,popupHeight:y}=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:16,n="top";if(e){const a=e.getBoundingClientRect(),i=r,o=window.innerHeight-r;if(a.top+t>o)if(a.bottom-t<i){const e=a.bottom-i,r=o-a.top;t=Math.max(e,r),n=e>r?"bottom":"top"}else n="bottom"}return{verticalOrigin:n,popupHeight:t}}(this.searchInputRootRef.current,Xg),f={vertical:g,horizontal:"right"};return v().createElement(b.Fragment,null,v().createElement(Mp,{classes:{root:a.inputContainer},onSearch:this.setFilterText,onFocus:this.handleInputFocus,rootRef:this.searchInputRootRef,value:e,placeholder:mi().text("Search & add attributes"),height:40,"data-reltio-id":"reltio-search-more-facets-search-input"}),v().createElement(Jg,{open:r,anchorEl:this.searchInputRootRef.current,metadata:i,selectedFacets:p,data:m,onClose:this.handlePopupClose,onListItemClick:this.handleItemClick,lastFacetClicked:t,width:this.inputWidth,height:y,onSearch:this.setFilterText,headerPlacement:"bottom"===g?"bottom":"top",anchorOrigin:f,transformOrigin:f,disableRestoreFocus:!0}))}}ry.defaultProps={selectedEntityTypes:[],facetsConfigs:[]};const ny=(0,Tp.connect)((e=>({metadata:k().selectors.getMetadata(e),open:(0,ki.ds)(e),facetsConfigs:(0,D.Mp)(e),recommendedFacets:(0,D.ER)(e),selectedEntityTypes:(0,D.DX)(e),dataTenantObject:(0,ui.t9)(e),allowedEntityTypes:(0,ki.Xf)(e),dataTenants:k().selectors.getDataTenants(e)})))(zg()((()=>({inputContainer:{margin:"4px 16px 16px",flexShrink:"0"}})))(ry)),ay=(0,kp.Z)({facetGroupContainer:{display:"flex",flexShrink:0,flexDirection:"column","& + hr":{marginTop:8},"& + &":{marginTop:"8px"}}});function iy(){return iy=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},iy.apply(this,arguments)}const oy=e=>{let{hasSearchAttributesField:t,children:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["hasSearchAttributesField","children"]);const a=ay(),[i,o]=(0,b.useState)(!0);return v().createElement("div",{className:a.facetGroupContainer},v().createElement(Vg,iy({isOpen:i,onCollapse:e=>{o(!i)}},n)),t&&v().createElement(v().Fragment,null,v().createElement(ny,null),v().createElement(Lg(),null)),i&&r)};function ly(){return ly=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ly.apply(this,arguments)}const sy=(e,t)=>{const r=r=>{let{dispatch:n}=r,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(r,["dispatch"]);return v().createElement(e,ly({config:t,onChange:(i=t.fieldName,e=>{n(ii(i,e))}),onClose:t.showDeleteButton?(e=>()=>{n(si({fieldNamesToDelete:[e]}))})(t.fieldName):()=>{},onSearch:(e=>t=>{let{value:r,pageNumber:a,currentOptions:i}=t;n((e=>{let{facetFieldName:t,value:r,debounceTime:n=0,pageNumber:a=1,currentOptions:i}=e;return{type:L.k.FILTER_FACET_DATA,payload:{facetFieldName:t,value:r,debounceTime:n,pageNumber:a,currentOptions:i}}})({facetFieldName:e,value:r,debounceTime:250,pageNumber:a,currentOptions:i}))})(t.fieldName)},a));var i};return r.propTypes={dispatch:vp().func,isRecommended:vp().bool},r};var cy=r(52004),uy=r.n(cy),py=r(58282),dy=r.n(py);const my=(0,kp.Z)((()=>({viewMoreLessLink:{display:"flex",alignItems:"center",cursor:"pointer"},arrow:{marginRight:"8px",marginLeft:"-2px",transform:"rotate(0deg)",transition:"transform 0.35s ease"},rotated:{transform:"rotate(-180deg)"}}))),gy=e=>{let{active:t,onClick:r,className:n}=e;const a=my();return v().createElement(uy(),{className:O()(a.viewMoreLessLink,n),onClick:r,underline:"none"},v().createElement(dy(),{"data-reltio-id":"more-arrow-icon",className:O()(a.arrow,{[a.rotated]:t})}),t?mi().text("View less"):mi().text("View more"))};var yy=r(50592),fy=r(23888),hy=r.n(fy);const Ey=(0,kp.Z)((e=>({bar:{backgroundColor:e.palette.secondary.main,opacity:.12,position:"absolute",minHeight:"20px",minWidth:"5px",borderRadius:"2px",top:0,left:0,height:"100%"}}))),by=e=>(0,_.is)(Number,e),vy=e=>{let{className:t,width:r=0,maxWidth:n}=e;const a=Ey(),i=(0,b.useCallback)((e=>(n?100*e/n:0)+"%"),[n]);return r?v().createElement("div",{className:O()(a.bar,t),style:{width:by(r)?i(r):r}}):null},Ty=(0,kp.Z)((e=>({listContainer:{display:"flex",flexDirection:"column",paddingLeft:18,"& $disabled":{pointerEvents:"none",opacity:.4}},disabled:{},item:{display:"flex",flexGrow:1,flexShrink:0,flexDirection:"row",marginRight:10,marginTop:2,marginBottom:2},info:{display:"flex",flexGrow:1,position:"relative",minWidth:0,marginTop:2,marginBottom:2,"&:hover":{cursor:"pointer","& $buttonONLY":{display:"block"}}},buttonONLY:{display:"none",position:"absolute",height:24,width:59,borderRadius:3,backgroundColor:"#DFDFDF",fontSize:14,fontWeight:600,lineHeight:"16px",color:"rgba(0,0,0,0.54)",boxShadow:"none",top:0,right:0,zIndex:3},avatar:{marginRight:8,height:24,width:24},checkbox:{marginRight:14,padding:0,"& $checked":{opacity:1}},checked:{},textInfo:{display:"flex",flexGrow:1,lineHeight:"16px",backgroundColor:"transparent",minWidth:0,alignItems:"center",zIndex:2},text:{flexGrow:1,marginLeft:7,marginRight:4,color:e.palette.text.primary,width:"100%",maxHeight:"32px",wordBreak:"break-word",wordWrap:"break-word",overflow:"hidden"},count:{flexShrink:0,fontSize:12,color:e.palette.text.secondary,textAlign:"right",marginRight:4},toggleContainer:{height:28,padding:"2px 2px",display:"flex",alignItems:"center",justifyContent:"flex-start",margin:"0",background:e.palette.background.default},toggleButton:{padding:"0",minWidth:"28",height:"28",border:"0","&:last-child":{paddingLeft:"0"}},checkedBar:{opacity:.4}})));function Oy(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const xy={showColorBar:!0,hasOnlyButton:!1},Cy=e=>{let{config:t,data:r=[],values:n=[],onChange:a=_.identity}=e;const i=Ty();t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Oy(e,t,r[t])}))}return e}({},xy,t);const o=e=>()=>{const t=n.includes(e)?n.filter((t=>t!==e)):n.concat(e);a(t)},l=Math.max(...r.map((e=>e.number)));return v().createElement("div",{className:i.listContainer},r.map((e=>v().createElement("div",{key:e.value,className:O()(i.item,{[i.disabled]:!e.number&&!n.includes(e.value)}),"data-reltio-id":"search-facets-list-row"},(e=>v().createElement(Jp(),{className:O()(i.checkbox,{[i.checked]:n.includes(e.value)}),checked:n.includes(e.value),onChange:o(e.value),value:e.value,color:"primary"}))(e),v().createElement("div",{className:i.info,onClick:o(e.value)},(e=>v().createElement(vy,{className:O()({[i.checkedBar]:n.includes(e.value)}),width:e.number,maxWidth:l}))(e),v().createElement("div",{className:O()(i.textInfo)},v().createElement("div",{className:i.text},e.label),v().createElement("div",{className:i.count},void 0===e.number?mi().text("N/A"):(0,ci.k7)(e.number,5e3))),t.hasOnlyButton&&(e=>{return v().createElement(hy(),{className:i.buttonONLY,onClick:(t=e.value,e=>{e.stopPropagation(),a([t])})},mi().text("ONLY"));var t})(e))))))};var Sy=r(1441);const wy=(0,kp.Z)((()=>({container:{overflow:"hidden",display:"flex",flexGrow:1,flexDirection:"column",fontSize:"13px"},noData:{marginLeft:"16px"},viewMoreLess:{paddingLeft:"20px"}}))),Ay=e=>{let{config:t,data:r=[],values:n=[],onChange:a}=e;const i=wy(),o=(0,Tp.useDispatch)(),l=(0,b.useCallback)((e=>{let{show:t}=e;o((e=>{let{show:t,silent:r}=e;return{type:L.k.SHOW_MORE_ENTITY_TYPES,payload:{show:t,silent:r}}})({show:t}))}),[o]),s=(0,Tp.useSelector)((e=>(0,D.jC)(t,e))),c=(0,Tp.useSelector)(ui.t9),u=r.length>K.wP,p=(0,b.useCallback)((()=>{l({show:!s})}),[l,s]),d=(0,b.useMemo)((()=>{const e=s?r:r.slice(0,K.wP);return(0,Sy.ZK)(e,c)}),[r,s,c]);return v().createElement("div",{className:i.container},r.length>0?v().createElement(v().Fragment,null,v().createElement(Cy,{data:d,values:n,onChange:a,config:t}),u&&v().createElement(gy,{active:s,onClick:p,className:i.viewMoreLess})):v().createElement(yy.K,{variant:"noData",className:i.noData}))};var Ry=r(70347),_y=r(94852);const Iy=(0,_y.M)(Ry.ZP);var Ny=r(75237),Dy=r(27308);const Py=(0,_y.M)(Dy.ZP);var ky=r(22507),Ly=r(14658);function Uy(){return Uy=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Uy.apply(this,arguments)}const jy={Option:e=>{let{innerProps:t,innerRef:r,children:n,isFocused:a,isSelected:i,selectProps:{classes:o},label:l}=e;return v().createElement(td(),Uy({className:O()(o.option,{[o["option--selected"]]:i}),ref:r,selected:a,component:"div"},t),v().createElement(Jp(),{color:"primary",checked:i}),v().createElement(gd.Y,{value:l},v().createElement("div",{className:o["option--item"]},n)))}},Fy=e=>{let t=null==e?void 0:e.parentElement;for(;t;){if(t.scrollHeight>t.clientHeight)return t;t=t.parentElement}return null},My=(e,t,r,n)=>e&&t<e&&n.getBoundingClientRect().bottom>r.getBoundingClientRect().bottom,Vy=(0,kp.Z)((e=>({label:{top:6,left:16},placeholder:e=>{let{placeholder:t,label:r}=e;return{display:!t||r?"none":void 0}},"option--selected":{fontWeight:400},clearIndicator:{padding:e.spacing(1),margin:e.spacing(.25,.5)},dropdownIndicator:{padding:e.spacing(1),margin:e.spacing(.25,.5)}})));function By(){return By=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},By.apply(this,arguments)}function zy(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Hy(e,t,r[t])}))}return e}function Hy(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let Yy=0;const Wy=e=>{const{label:t,creatable:r,getOptions:n,loadingIndicator:a,components:i,classes:o,styles:l,onChange:s,onInputChange:c,menuPlacement:u="auto"}=e,p=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["label","creatable","getOptions","loadingIndicator","components","classes","styles","onChange","onInputChange","menuPlacement"]),d=r?Iy:n?Py:Ny.J,[m,g]=(0,b.useState)(""),y=Vy((0,_.omit)(["classes"],e)),f="custom-select-"+Yy++,h=(0,b.useRef)();!function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;const r=(0,Ly.D)(null==e?void 0:e.length);(0,b.useEffect)((()=>{const n=setTimeout((()=>{const n=Fy(null==t?void 0:t.current);var a;n&&My(null==e?void 0:e.length,r,n,t.current)&&(null===(a=t.current)||void 0===a||a.scrollIntoView(!1))}),0);return()=>{clearTimeout(n)}}),[null==e?void 0:e.length])}(e.value,(e=>{const t={};return e.current&&(t.current=(0,_.either)((0,_.path)(["select","controlRef"]),(0,_.path)(["select","select","controlRef"]))(e.current)),t})(h));const E=zy({},jy,i),T=(0,ky.z)(y,o),O=zy({indicatorSeparator:e=>zy({},e,{margin:"10px 0"}),loadingIndicator:e=>zy({},e,{display:a?e.display:"none"}),loadingMessage:e=>zy({},e,{fontFamily:'"Roboto", "Helvetica", "Arial", sans-serif'})},l),x=t?{inputId:f,TextFieldProps:zy({label:t,InputLabelProps:{htmlFor:f,shrink:!(!e.value||!e.value.length)||void 0,className:T.label}},e.TextFieldProps)}:{};return v().createElement(d,By({isMulti:!0,inputId:f,inputValue:m,onChange:function(e,t){s(e,t),"create-option"===t.action&&(g(""),c("",{action:"input-change"}))},onInputChange:function(e,t){let{action:r}=t;c(e,{action:r}),"set-value"!==r&&g(e)},closeMenuOnSelect:!1,hideSelectedOptions:!1,classes:T,components:E,styles:O,menuPlacement:u,loadOptions:n,innerRef:h},x,p))};Wy.defaultProps={creatable:!1,cacheOptions:!0,components:{},classes:{},placeholder:"",loadingIndicator:!1,onInputChange:()=>{},onChange:()=>{}},Wy.propTypes={creatable:vp().bool,cacheOptions:vp().bool,defaultOptions:vp().bool,value:vp().arrayOf(vp().shape({label:vp().string.isRequired,value:vp().any})),options:vp().arrayOf(vp().shape({label:vp().string.isRequired,value:vp().any})),onChange:vp().func,onInputChange:vp().func,placeholder:vp().string,label:vp().string,loadingIndicator:vp().bool,components:vp().shape({ClearIndicator:vp().func,Control:vp().func,DropdownIndicator:vp().func,DownChevron:vp().func,CrossIcon:vp().func,Group:vp().func,GroupHeading:vp().func,IndicatorsContainer:vp().func,IndicatorSeparator:vp().func,Input:vp().func,LoadingIndicator:vp().func,Menu:vp().func,MenuList:vp().func,MenuPortal:vp().func,LoadingMessage:vp().func,NoOptionsMessage:vp().func,MultiValue:vp().func,MultiValueContainer:vp().func,MultiValueLabel:vp().func,MultiValueRemove:vp().func,Option:vp().func,Placeholder:vp().func,SelectContainer:vp().func,SingleValue:vp().func,ValueContainer:vp().func}),classes:vp().shape({control:vp().string,valueContainer:vp().string,multiValue:vp().string,noOptionsMessage:vp().string,singleValue:vp().string,placeholder:vp().string,menu:vp().string,clearIndicator:vp().string,dropdownIndicator:vp().string,option:vp().string,"option--selected":vp().string,label:vp().string}),styles:vp().shape({clearIndicator:vp().func,container:vp().func,control:vp().func,dropdownIndicator:vp().func,group:vp().func,groupHeading:vp().func,indicatorsContainer:vp().func,indicatorSeparator:vp().func,input:vp().func,loadingIndicator:vp().func,loadingMessage:vp().func,menu:vp().func,menuList:vp().func,menuPortal:vp().func,multiValue:vp().func,multiValueLabel:vp().func,multiValueRemove:vp().func,noOptionsMessage:vp().func,option:vp().func,placeholder:vp().func,singleValue:vp().func,valueContainer:vp().func}),TextFieldProps:vp().object,getOptions:vp().func,menuPlacement:vp().string,menuPortalTarget:vp().object,menuShouldBlockScroll:vp().bool,captureMenuScroll:vp().bool,getOptionValue:vp().func,isSearchable:vp().bool,inputRef:vp().shape({current:vp().object})};var Gy=r(80959),qy=r(88640),Zy=r(25386),$y=r(59428),Ky=r(47823);const Xy=(0,kp.Z)({item:{display:"flex",minHeight:"28px",flexGrow:1,flexDirection:"row",alignItems:"center",borderRadius:"1px",padding:0,opacity:1},checkbox:{marginRight:"14px",marginLeft:"18px",padding:0},infobox:{display:"flex",flexGrow:1,alignItems:"center",position:"relative",height:"20px",margin:"2px 10px 2px 0",minWidth:0},textbox:{display:"flex",flexDirection:"row",alignItems:"center",flexGrow:1,minWidth:0,zIndex:2},text:{flexGrow:1,width:0,height:"15px",color:"rgba(0,0,0,0.87)",fontSize:"13px",lineHeight:"16px",letterSpacing:0,fontWeight:"normal",paddingLeft:"7px",paddingRight:"8px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",minWidth:0},number:{flexGrow:0,flexShrink:0,height:"16px",color:"rgba(0,0,0,0.6)",fontSize:"12px",lineHeight:"16px",textAlign:"right",paddingRight:"4px"},colorBar:{height:"20px"},selectedColorBar:{opacity:.4},itemSelected:{backgroundColor:"rgba(0, 0, 0, 0.04) !important"}});function Qy(){return Qy=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Qy.apply(this,arguments)}const Jy=e=>{const{innerProps:t,innerRef:r,data:n,isSelected:a,isFocused:i,selectProps:{classes:o}}=e,l=Xy(),s=(0,_.has)("width",n),c=(0,_.has)("number",n);return v().createElement(td(),Qy({className:o.option,classes:{root:l.item,selected:l.itemSelected},ref:r,component:"div",selected:i,disableGutters:!0},t),v().createElement(Jp(),{checked:a,color:"primary",disableRipple:!0,classes:{root:l.checkbox}}),v().createElement("div",{className:l.infobox},v().createElement("div",{className:l.textbox},v().createElement(gd.Y,{value:n.label},v().createElement("div",{className:l.text},n.label)),c&&v().createElement("div",{className:l.number},(0,ci.k7)(n.number,5e3))),s&&v().createElement(vy,{className:O()(l.colorBar,{[l.selectedColorBar]:a}),width:n.width})))};Jy.propTypes={innerProps:vp().shape({id:vp().string.isRequired,key:vp().string,onClick:vp().func.isRequired,onMouseMove:vp().func.isRequired,onMouseOver:vp().func.isRequired,tabIndex:vp().number.isRequired}).isRequired,innerRef:vp().oneOfType([vp().oneOf([null]),vp().func,vp().shape({current:vp().any.isRequired})]),isSelected:vp().bool.isRequired,isFocused:vp().bool.isRequired,selectProps:vp().shape({classes:vp().shape({option:vp().string})}),data:vp().shape({value:vp().string,label:vp().string.isRequired,number:vp().number}).isRequired};const ef=Jy,tf=e=>{const{selectProps:{classes:t}}=e;return v().createElement(yy.K,{variant:"noData",className:t.noOptionsMessage})};tf.propTypes={selectProps:vp().object.isRequired};const rf=tf;function nf(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){af(e,t,r[t])}))}return e}function af(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const of={container:e=>nf({},e,{width:"100%"}),menuList:e=>nf({},e,{maxHeight:"240px",padding:"8px 0"}),menu:e=>nf({},e,{maxHeight:"240px"})},lf=(0,kp.Z)((()=>({control:{minHeight:"46px",backgroundColor:"rgba(0,0,0, 0.0267)",height:"auto",padding:0},option:{minHeight:"28px",display:"flex",flexGrow:1,flexShrink:0,flexDirection:"row",padding:0},noOptionsMessage:{padding:"0 16px 0 18px"},multiValue:{backgroundColor:"rgba(43, 152, 240, 0.12)"}}))),sf=vp().shape({value:vp().string.isRequired,label:vp().string.isRequired,number:vp().number});function cf(){return cf=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},cf.apply(this,arguments)}function uf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const pf=e=>{let{values:t=[],defaultOptions:r=[],filteredOptions:n,onChange:a=_.identity,getSuggestions:i,showBar:o=!0,showNumberInValue:l=!1,classes:s={},styles:c={},canLoadMore:u=!0,max:p=K.cu}=e,d=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["values","defaultOptions","filteredOptions","onChange","getSuggestions","showBar","showNumberInValue","classes","styles","canLoadMore","max"]);const m=lf(),[g,y]=(0,b.useState)(""),[f,h]=(0,b.useState)(1),[E,T]=(0,b.useState)(!1),O=(0,b.useRef)(null),C=(0,b.useRef)(!1),S=(0,b.useRef)(!1),w=(n||[]).concat(r),A=e=>w.find((t=>t.value===e))||{value:e,label:e},R=e=>l&&(0,_.has)("number",e)?(0,_.assoc)("formattedNumber",(0,x.formatNumberAsMetric)((0,_.prop)("number",e),5e3),e):e,I=(0,_.pipe)((e=>{if(o&&e.length&&(0,_.has)("number",e[0])){const t=Math.max(...e.map((e=>e.number)));return e.map((e=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){uf(e,t,r[t])}))}return e}({},e,{width:N(e.number,t)})))}return e}),(0,_.uniqBy)((0,_.prop)("value"))),N=(e,t)=>(t?100*e/t:0)+"%",D=(0,x.debounce)(((e,t)=>{let{action:r}=t;e!==g&&"set-value"!==r&&(y(e),h(1),C.current=!1,T(!0),i({value:e,pageNumber:1}))}),250),P=n||r,k=(0,b.useCallback)((()=>{T(!0),i({value:g,pageNumber:f+1,currentOptions:P}),C.current=!0}),[g,f,i,P]);(0,b.useEffect)((()=>{T(!1),C.current&&(h((e=>e+1)),C.current=!1)}),[n]),(0,b.useEffect)((()=>{S.current||(T(!1),h(1),C.current=!1,i({value:"",pageNumber:1})),S.current=!1}),[r]);const L=(0,b.useMemo)((()=>P.slice(0,f*p)),[P,f,p]),U=u&&P.length>L.length;return v().createElement(Wy,cf({filterOption:(e,t)=>{let{label:r,value:n}=e;return x.utils.strings.search(r,t)||x.utils.strings.search(n,t)},value:(e=>(0,x.wrapInArrayIfNeeded)(e).map(A).map(R))(t),onChange:(0,_.pipe)((0,_.tap)((()=>{S.current=!0})),(0,_.defaultTo)([]),(0,_.pluck)("value"),a),options:I(L),onInputChange:D,classes:(0,_.mergeRight)(m,s),styles:(0,_.mergeRight)(of,c),TextFieldProps:{InputProps:{disableUnderline:!0},ref:O},inputRef:O,components:{Option:ef,NoOptionsMessage:rf,Menu:Gy.h,DropdownIndicator:qy.K,MultiValue:Zy._,MenuList:$y.d},menuPlacement:"bottom",menuListFooter:U&&v().createElement(Ky.X,{loading:E,onClick:k})},d))};pf.propTypes={values:vp().array,defaultOptions:vp().arrayOf(sf),filteredOptions:vp().arrayOf(sf),onChange:vp().func.isRequired,getSuggestions:vp().func.isRequired,showBar:vp().bool,showNumberInValue:vp().bool,classes:vp().object,styles:vp().object,canLoadMore:vp().bool,max:vp().number};const df=(0,b.memo)(pf);var mf=r(43627),gf=r.n(mf);function yf(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ff(e,t,r[t])}))}return e}function ff(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const hf=(0,_.range)(2,10).reduce(((e,t)=>yf({},e,{[`&:nth-child(${t})`]:{paddingLeft:`calc(1em * (${t} - 2))`,"&::before":{content:'"└"',display:"inline-block",fontSize:"1em",marginRight:"5px",color:"rgba(255, 255, 255, 0.28)"}}})),{}),Ef=(0,kp.Z)((e=>({tooltip:e.tooltip,tooltipContent:{minWidth:"165px",padding:"4px 2px 2px","& p":{fontSize:"11px",lineHeight:"13px",fontWeight:500,margin:0,color:"white"},"& ul":{listStyleType:"none",padding:0,margin:0,"& li":yf({fontSize:"10px",lineHeight:"11px",fontWeight:500,color:"rgba(255, 255, 255, 0.7)",marginTop:"4px"},hf,{"&:last-child":{color:"white"}}),"& li + li":{marginTop:"2px"}}}})));function bf(){return bf=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},bf.apply(this,arguments)}const vf=e=>{let{pathToTitle:t,children:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["pathToTitle","children"]);const a=Ef(),i=null!=t&&t.length?v().createElement("div",{className:a.tooltipContent},v().createElement("p",null,(0,_.last)(t)),t.length>2&&v().createElement("ul",null,t.map((e=>v().createElement("li",{key:e},e))))):"";return v().createElement(gf(),bf({title:i,disableFocusListener:!0,classes:{tooltip:a.tooltip}},n),r)};var Tf=r(96091),Of=r.n(Tf),xf=r(35635),Cf=r.n(xf);const Sf=(0,kp.Z)({root:{boxSizing:"border-box",height:"18px",border:"1px solid rgba(0,0,0,0.12)",borderRadius:"16px",backgroundColor:"transparent","& $deleteIcon":{margin:"0",height:"12px",width:"12px",color:"rgba(0,0,0,0.38)"}},outlined:{"& $deleteIcon":{marginRight:2}},deleteIcon:{},label:{color:"rgba(0,0,0,0.38)",fontSize:"12px",fontWeight:500,lineHeight:"16px",paddingLeft:"4px",paddingRight:"4px"}});function wf(){return wf=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},wf.apply(this,arguments)}const Af=(0,yd.T)(Cf()),Rf=e=>{let{label:t,onDelete:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["label","onDelete"]);const a=Sf();return v().createElement(Of(),wf({className:a.root,label:mi().number(t),onDelete:r,variant:"outlined",classes:{root:a.root,outlined:a.outlined,deleteIcon:a.deleteIcon,label:a.label},deleteIcon:v().createElement(Af,{tooltipTitle:mi().text("Clear")})},n))},_f=(0,kp.Z)((e=>({container:{display:"flex",flexDirection:"column",flexGrow:1,justifyContent:"center",height:"100%",minWidth:0,cursor:"pointer"},parent:{color:e.palette.text.secondary,fontSize:"13px",lineHeight:"15px",letterSpacing:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},titleContainer:{display:"flex",flexDirection:"row",overflow:"hidden",alignItems:"flex-end",height:"18px",width:"100%"},title:{color:e.palette.text.primary,fontSize:"14px",lineHeight:"16px",fontWeight:500,letterSpacing:"0.24px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},chip:{display:"inline",marginLeft:"6px"}})));function If(){return If=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},If.apply(this,arguments)}const Nf=e=>{let{title:t="",chipLabel:r=0,onDelete:n,pathToTitle:a,onClick:i}=e;const o=_f(),l=Boolean(a&&a.length>2),s=l?vf:gd.Y,c=l?{pathToTitle:a}:{value:t};return v().createElement("div",{className:o.container,onClick:i},l&&v().createElement(vf,If({placement:"bottom-start"},c),v().createElement("div",{className:o.parent},a[a.length-2])),v().createElement("div",{className:o.titleContainer},v().createElement(s,If({placement:"bottom-start"},c),v().createElement("span",{className:o.title},t)),0!==r&&v().createElement("div",{className:o.chip},v().createElement(Rf,{label:r,onDelete:n}))))};function Df(){return Df=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Df.apply(this,arguments)}const Pf=(0,kp.Z)((()=>({facetContainer:{display:"flex",flexGrow:1,flexShrink:0,flexDirection:"column",padding:"0 16px",borderRadius:"1px",position:"relative",borderBottom:"solid 1px rgba(0,0,0, 0.33)","&:last-child":{borderBottom:"solid 1px rgb(255,255,255)"}},openedFacetContainer:{paddingBottom:"15px"},closedFacetContainer:{paddingBottom:"5px"},iconButton:{"&:first-child":{marginLeft:"-16px",height:24,width:24},visibility:"hidden"},recommendedIcon:{width:"18px",height:"18px",marginRight:"6px",flexShrink:0},titleContainer:{display:"flex",flexDirection:"row",flexShrink:0,alignItems:"center",height:"42px",borderRadius:"1px","&:hover $iconButton":{visibility:"visible"},marginLeft:"-16px",paddingLeft:"16px"},expandIcon:{transition:"transform .15s ease",margin:"0 2px",color:"rgba(0, 0, 0, 0.54)"},expanded:{transform:"rotate(180deg)"},"@keyframes animate":{from:{background:"#FFFBEB"},"66%":{background:"#FFFBEB"},"100%":{background:"transparent"}},highlighted:{animationName:"$animate",animationDuration:"3s",animationIterationCount:1}}))),kf=(0,yd.T)((e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",Df({width:"13",height:"18",viewBox:"0 0 13 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},r),v().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},v().createElement("g",null,v().createElement("g",null,v().createElement("g",null,v().createElement("g",{transform:"translate(-3 -1)"},v().createElement("g",null,v().createElement("path",{fill:"#FF4081",d:"M5.833 10h3.75v6.667l-3.75 1.666z"}),v().createElement("path",{fill:"#CE0C4E",d:"M13.333 10v8.333l-3.75-1.666V10z"})),v().createElement("circle",{fill:"#FFC058",cx:"9.583",cy:"7.917",r:"6.25"}),v().createElement("circle",{fill:"#FFCD7B",cx:"9.583",cy:"7.917",r:"5.417"}),v().createElement("path",{fill:"#FFFBB5",d:"M8.333 11.667L5 8.462l.933-.898 2.4 2.308L13.4 5l.933.897z"})))))))})),Lf=e=>{let{title:t,chipLabel:r,onDeleteChip:n,pathToTitle:a,onClose:i,children:o,isOpenByDefault:l=!0,isHighlighted:s=!1,isRecommended:c=!1}=e;const u=Pf(),[p,d]=(0,b.useState)(l),m=()=>{d(!p)};return v().createElement("div",{className:O()(u.facetContainer,{[u.openedFacetContainer]:p,[u.closedFacetContainer]:!p,[u.highlighted]:s}),"data-reltio-id":`search-facet-container-${t}`},v().createElement("div",{className:u.titleContainer},v().createElement(wd.k,{tooltipTitle:mi().text("Remove"),icon:_p(),onClick:i,className:u.iconButton,size:"XXS"}),c&&v().createElement(kf,{className:u.recommendedIcon,tooltipTitle:mi().text("Recommended"),showForDisabled:!0}),v().createElement(Nf,{title:t,pathToTitle:a,chipLabel:r,onDelete:n,onClick:m}),v().createElement($m,{onClick:m,isOpen:p,className:u.iconButton,size:"S",tooltipTitle:p?mi().text("Collapse attribute"):mi().text("Expand attribute"),tooltipPlacement:"bottom-end"})),p?o:null)},Uf=(0,kp.Z)((()=>({control:{minHeight:"40px",backgroundColor:"rgba(0, 0, 0, 0.03)",height:"auto",padding:0},valueContainer:{margin:"4px 6px"},placeholder:{color:"rgba(0,0,0,0.6)",fontSize:"13px",letterSpacing:0,lineHeight:"15px",left:"16px",bottom:"14px"},dropdownIndicator:{margin:"0px 2px 0px 0px"}}))),jf=e=>{let{config:t,data:r=[],filteredData:n,values:a=[],isHighlighted:i,isRecommended:o,onSearch:l=_.identity,onChange:s,onClose:c}=e;const u=Uf();return v().createElement(Lf,{title:t.title,pathToTitle:t.pathToTitle,onClose:c,chipLabel:a.length,onDeleteChip:()=>s([]),isHighlighted:i,isRecommended:o},v().createElement(df,{values:a,defaultOptions:r,filteredOptions:n,onChange:s,getSuggestions:l,isClearable:!1,showBar:!1,showNumberInValue:!0,classes:u,placeholder:mi().text("All values"),canLoadMore:!(0,za.tW)(t)}))};var Ff=r(19014),Mf=r(15608),Vf=r.n(Mf);const Bf=(0,kp.Z)((e=>({root:{borderRadius:4,padding:"15px 0"},rail:{backgroundColor:(0,Lm.alpha)(e.palette.primary.main,.12),borderRadius:4},thumb:{width:"14px",height:"14px",border:"1px solid #FFFFFF","&$focusVisible,&:hover":{boxShadow:`0px 0px 0px 9px ${(0,Lm.alpha)(e.palette.primary.main,.12)}`,"@media (hover: none)":{boxShadow:"none"}},"&$active":{boxShadow:`0px 0px 0px 9px ${(0,Lm.alpha)(e.palette.primary.main,.12)}`},"&::after":{left:-10,top:-10,right:-10,bottom:-10}},focusVisible:{},active:{},track:{borderRadius:4}}))),zf=(0,kp.Z)((e=>({tooltipPlacementTop:{margin:"3px 0"},tooltip:{color:"#FFFFFF",fontSize:"9px",letterSpacing:0,lineHeight:"10px",textAlign:"right",padding:"3px 4px",backgroundColor:e.palette.primary.main,borderRadius:"4px"}}))),Hf=e=>{let{children:t,open:r,value:n}=e;const a=zf();return v().createElement(gf(),{open:r,enterTouchDelay:0,placement:"top",title:n,classes:{tooltipPlacementTop:a.tooltipPlacementTop,tooltip:a.tooltip}},t)};function Yf(){return Yf=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Yf.apply(this,arguments)}Hf.propTypes={children:vp().element.isRequired,open:vp().bool.isRequired,value:vp().string.isRequired};const Wf=e=>{let{min:t,max:r,range:n,onChange:a,onAfterChange:i,className:o}=e,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["min","max","range","onChange","onAfterChange","className"]);const s=Bf();return v().createElement("div",{className:o},v().createElement(Vf(),Yf({min:t,max:r,value:n,classes:{root:s.root,rail:s.rail,track:s.track,thumb:s.thumb},onChange:(e,t)=>{a&&a(t)},onChangeCommitted:(e,t)=>{i&&i(t)},valueLabelDisplay:"auto","aria-labelledby":"range-slider",components:{ValueLabel:Hf},size:"small",component:"div"},l)))};Wf.propTypes={min:vp().oneOfType([vp().number,vp().string]).isRequired,max:vp().oneOfType([vp().number,vp().string]).isRequired,range:vp().array.isRequired,onChange:vp().func,onAfterChange:vp().func,className:vp().string};const Gf=Wf;var qf=r(18205),Zf=r(19406),$f=r(55484),Kf=r(25556),Xf=r(3131),Qf=r(27741),Jf=r(42400),eh=r(11011);const th=(0,kp.Z)((()=>({tooltip:{borderRadius:"1px",backgroundColor:"rgba(97,97,97,0.9)",padding:"8px"},number:{color:"#FFFFFF",fontSize:"11px",fontWeight:500,letterSpacing:0,lineHeight:"13px"},value:{opacity:.7,color:"#FFFFFF",fontSize:"10px",letterSpacing:0,lineHeight:"11px",marginTop:"4px"}}))),rh=e=>{let{payload:t,formatter:r,active:n}=e;const a=th();if(n){const{payload:{label:e},value:n}=t[0];return v().createElement("div",{className:a.tooltip},v().createElement("div",{className:a.number},r(n)),v().createElement("div",{className:a.value},e))}return null},nh=(0,kp.Z)((()=>({barChart:{"& text":{stroke:"none",fill:"rgba(0, 0, 0, 0.54)",textAnchor:"end"},"& .recharts-yAxis":{fontSize:"10px",fill:"rgba(0, 0, 0, 0.54)",textAnchor:"end"},"& .recharts-xAxis .recharts-cartesian-axis-tick:first-child text":{fontSize:"10px",fill:"rgba(0, 0, 0, 0.54)",textAnchor:"start"},"& .recharts-xAxis .recharts-cartesian-axis-tick:last-child text":{fontSize:"10px",fill:"rgba(0, 0, 0, 0.54)",textAnchor:"end"},"& .recharts-cartesian-axis-line":{stroke:"rgba(0, 0, 0, 0.54)"}}})));function ah(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ih=e=>{let{data:t=[],range:r=[],domain:n,color:a=x.theme.palette.primary.main,tickFormatterX:i,tickFormatterY:o}=e;const l=nh(),[s,c]=(0,b.useState)(null),u=(e,t)=>(s===t?.2:0)+((e=>{let{value:t}=e;return t[0]>=r[0]&&t[1]<=r[1]})(e)?.6:.2),p=t.map(((e,t,r)=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ah(e,t,r[t])}))}return e}({},e,{value:t<r.length-1?e.value[0]:e.value[1]}))),d=e=>{e.isTooltipActive?c(e.activeTooltipIndex):c(null)};return v().createElement(qf.h,null,v().createElement(Zf.v,{data:p,margin:{top:12,right:0,left:0,bottom:0},onMouseEnter:d,onMouseLeave:d,onMouseMove:d,className:l.barChart},v().createElement($f.q,{vertical:!1,stroke:"#f2f2f2"}),v().createElement(Kf.K,{dataKey:"value",interval:0,padding:{left:4,right:4},height:15,tickLine:!1,ticks:n,tick:e=>{const{x:t,y:r,index:n,payload:{value:a,offset:o}}=e;return v().createElement("text",{x:0===n?t-o:t+o,y:r+4,textAnchor:0===n?"start":"end"},`${i(a)}`)}}),v().createElement(Xf.B,{width:38,domain:[0,"auto"],axisLine:!1,tickLine:!1,tickSize:0,tickMargin:4,tickCount:6,tickFormatter:o}),v().createElement(Qf.u,{cursor:{fill:"rgb(255,255,255)"},content:v().createElement(rh,{formatter:o}),isAnimationActive:!1}),v().createElement(Jf.$,{dataKey:"number",isAnimationActive:!1},t.map(((e,t)=>v().createElement(eh.b,{key:`cell-${t}`,fill:a,fillOpacity:u(e,t)}))))))},oh="NumericRangeFacet-styles-numberEditorInputRoot--djW3k",lh="NumericRangeFacet-styles-numberEditorRoot--DVXqx",sh="NumericRangeFacet-styles-input--Nl2tx";function ch(){return ch=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ch.apply(this,arguments)}class uh extends b.PureComponent{constructor(){super(...arguments),this.state={range:[],data:[],values:[],lowerBound:0,upperBound:0},this.handleOnChangeValue=e=>{if(!this.props.onChange)return;const{data:t,values:r}=this.props,{rangeService:n}=this.state,[a,i]=n.getBarDomain(t),o=n.adjustRange(e,a,i);0!==r.length&&n.equals(o[0],(0,_.path)([0,0],r))&&n.equals(o[1],(0,_.path)([0,1],r))||this.props.onChange([o])},this.onLowerBoundChanged=e=>{const{range:t,NumMath:r,isFloating:n}=this.state;this.setState({lowerBound:n?e:r.toFixed(e,0)},(()=>{const a=(0,_.head)(this.props.data).value[0],i=""===e||isNaN(e)?a:e,o=r.clamp(a,t[1],n?i:r.floor(i));this.setState((e=>({lowerBound:o.toString(),range:[o,e.range[1]]}))),this.handleOnChangeValue([o,t[1]])}))},this.onUpperBoundChanged=e=>{const{range:t,NumMath:r,isFloating:n}=this.state;this.setState({upperBound:n?e:r.toFixed(e,0)},(()=>{const a=(0,_.last)(this.props.data).value[1],i=""===e||isNaN(e)?a:e,o=r.clamp(t[0],a,n?i:r.ceil(i));this.setState((e=>({upperBound:o.toString(),range:[e.range[0],o]}))),this.handleOnChangeValue([t[0],o])}))},this.onChangeRange=e=>{const{isFloating:t,NumMath:r}=this.state,n=e.map((e=>t?e:r.toFixed(this.revertScale(e),0)));this.setState({range:n,lowerBound:n[0],upperBound:n[1]})},this.onRevertedChange=e=>{const{isFloating:t,NumMath:r}=this.state,n=e.map((e=>t?e:r.toFixed(this.revertScale(e),0)));this.handleOnChangeValue(n)},this.applyScale=e=>{const{isScaled:t,scale:r,rangeService:n}=this.state;return t?n.applyScale(e,r):e},this.revertScale=e=>{const{isScaled:t,scale:r,rangeService:n}=this.state;return t?n.revertScale(e,r):e},this.onFocus=e=>e.target.select()}static getDerivedStateFromProps(e,t){if(e.data!==t.data||e.values!==t.values){const{config:t,values:r,data:n}=e,a=t.attrType&&t.attrType.type,i="Long"===a,o=(0,Vl.C)(a),l=(0,ci.Oz)(a),s=o.getRange(r,n);return{range:s,data:n,values:r,lowerBound:s.length>0?s[0].toString():0,upperBound:s.length>0?s[1].toString():0,NumMath:l,rangeService:o,isScaled:i,isFloating:(0,x.isFloatingType)(a),scale:n.length>0?o.calcScale(...o.getBarDomain(n)):{ratio:1,offset:0}}}return null}render(){const{config:e,data:t,isHighlighted:r,isRecommended:n,onClose:a,numberFormat:i}=this.props,{isScaled:o,scale:l,range:s,lowerBound:c,upperBound:u,rangeService:p,isFloating:d}=this.state,m=o?p.bigNumbersTickFormatterX(p.formatNumberForRangeFacet,l):p.formatNumberForRangeFacet,g=t.map((e=>({value:e.value.map(this.applyScale),label:e.value.map(p.formatNumberForRangeFacet).join(" - "),number:e.number}))),y=s.map((e=>+this.applyScale(e))),[f,h]=p.getBarDomain(t).map((e=>this.applyScale(e)));return v().createElement(Lf,{title:e.title,pathToTitle:e.pathToTitle,onClose:a,isHighlighted:r,isRecommended:n},v().createElement("div",{className:"NumericRangeFacet-styles-data--kL9q5"},g.length>0?v().createElement(v().Fragment,null,v().createElement("div",{className:"NumericRangeFacet-styles-barChartContainer--t9NkG","data-reltio-id":"search-bar-chart-with-selection"},v().createElement(ih,{data:g,range:y,tickFormatterX:m,tickFormatterY:p.formatNumberForRangeFacet,domain:[f,h]})),v().createElement(Gf,{min:f,max:h,range:y,onAfterChange:this.onRevertedChange,onChange:this.onChangeRange,className:"NumericRangeFacet-styles-slider--XbmKe",valueLabelFormat:m,step:d?(h-f)/200:1}),v().createElement("div",{className:"NumericRangeFacet-styles-inputsContainer--mU0_m"},v().createElement(Ff.c,{value:c,onChange:this.onLowerBoundChanged,onFocus:this.onFocus,integer:!d,format:i,variant:"filled",classes:{root:lh},InputProps:{classes:{root:oh,input:sh}}}),v().createElement(Ff.c,{value:u,onChange:this.onUpperBoundChanged,onFocus:this.onFocus,integer:!d,format:i,variant:"filled",classes:{root:lh},InputProps:{classes:{root:oh,input:sh}}}))):v().createElement(yy.K,{variant:"noData"})))}}uh.propTypes={data:vp().array,values:vp().array,config:vp().object,isHighlighted:vp().bool,isRecommended:vp().bool,onClose:vp().func,onChange:vp().func,numberFormat:vp().shape({decimalSeparator:vp().string,thousandSeparator:vp().string,prefix:vp().string,suffix:vp().string,decimalScale:vp().number})},uh.defaultProps={config:{},data:[],values:[]};const ph=(0,Tp.connect)((e=>({numberFormat:k().selectors.getUiNumberFormat(e)})))((e=>{const t=t=>{let{config:r,values:n,data:a,onChange:i,numberFormat:o}=t,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(t,["config","values","data","onChange","numberFormat"]);const s=(0,Tp.useSelector)(k().selectors.getAttributesPresentation),{strategy:c}=(0,x.getNumberFormat)((0,x.getAttrDataTypeDefinition)(r.attrType),s,x.intl.getLocale()),u=(0,b.useMemo)((()=>null==a?void 0:a.map((0,_.evolve)({value:(0,_.map)((0,x.applyPresentationStrategyToValue)(c))}))),[a,c]),p=(0,b.useMemo)((()=>null==n?void 0:n.map((0,x.mapFilterValue)((0,x.applyPresentationStrategyToValue)(c)))),[n,c]),d=(0,b.useCallback)((e=>{const t=null==e?void 0:e.map((0,x.mapFilterValue)((0,x.revertPresentationStrategyForValue)(c)));i(t)}),[c,i]);return v().createElement(e,ch({data:u,values:p,onChange:d,config:r,numberFormat:o&&(0,_.omit)(["strategy",o])},l))};return t.displayName="WithCustomizedData",t})(uh));var dh=r(21669);const mh=(0,kp.Z)((()=>({container:{display:"flex",flexGrow:1,whiteSpace:"nowrap",cursor:"default",width:"100%"},dateEditor:{margin:0,width:"50%",whiteSpace:"normal","&:first-child":{marginRight:"4px"},"& .MuiInputAdornment-root":{paddingRight:0}}})));function gh(){return gh=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gh.apply(this,arguments)}const yh=(e,t)=>(0,_.pathOr)(null,[t],e),fh=e=>e&&new Date(e),hh=e=>e&&e.getTime(),Eh=e=>{let{values:t,minDate:r,maxDate:n,onChange:a}=e;const[i,o]=(0,b.useState)(null),[l,s]=(0,b.useState)(null),c=(0,b.useRef)((0,Ke.x0)()),u=(0,b.useRef)((0,Ke.x0)()),p=mh();v().useEffect((()=>{o(yh(t,0)),s(yh(t,1))}),[t]);const d=(e,t)=>{(0,_.isNil)(e)||(0,_.isNil)(t)||a(e>t?[[t,e]]:[[e,t]])},m={minDate:fh(r),maxDate:fh(n)};return v().createElement("div",{className:p.container},v().createElement(dh.Q,gh({label:mi().text("Start Date"),value:fh(i),onChange:e=>{const t=hh(e);o(t),d(t,l)},slotProps:{textField:{id:c.current,className:p.dateEditor}}},m)),v().createElement(dh.Q,gh({label:mi().text("End Date"),value:fh(l),onChange:e=>{const t=hh(e);s(t),d(i,t)},slotProps:{textField:{id:u.current,className:p.dateEditor},popper:{placement:"bottom-end"}}},m)))};function bh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const vh=e=>t=>e===x.DataTypes.TYPE_DATE?x.utils.dates.toLocalDate(t).getTime():t,Th=(0,kp.Z)({barChartContainer:{position:"relative",height:"190px",paddingTop:"6px",width:"100%",overflow:"hidden"},dateRangeChooserWrapper:{display:"flex",flexDirection:"column",alignItems:"center",marginTop:"12px",width:"100%"}}),Oh=(0,Vl.C)(),xh=e=>{let{data:t=[],values:r=[],config:n,onChange:a,isHighlighted:i,isRecommended:o,onClose:l}=e;const s=Th(),c=(0,_.path)(["attrType","type"],n),u=(0,b.useCallback)((e=>{const n=e.map((0,x.mapFilterValue)((i=c,e=>i===x.DataTypes.TYPE_DATE?x.utils.dates.toUtcDate(e).getTime():e)));var i;if(!(0,_.equals)(r,n)){const[e,r]=Oh.getBarDomain(t),i=c===x.DataTypes.TYPE_DATE,o=n.map((e=>[x.utils.dates.getStartOfDay(e[0],i),x.utils.dates.getEndOfDay(e[1],i)])),l=Oh.getRange(o,t);a([l.length?l:[e,r]])}}),[t,a,c,r]),p=(0,b.useMemo)((()=>{return t.map((e=c,t=>{if(Array.isArray(t.value)){const r=t.value.map(vh(e));return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){bh(e,t,r[t])}))}return e}({},t,{value:r,label:r.map(x.formatDate).join(" - ")})}}));var e}),[t,c]),[d,m]=(0,b.useMemo)((()=>[Oh.getBarDomain(p),Oh.getRange(r.map((0,x.mapFilterValue)(vh(c))),p)]),[p,c,r]);return v().createElement(Lf,{title:n.title,pathToTitle:n.pathToTitle,onClose:l,isHighlighted:i,isRecommended:o},t.length>0?v().createElement(v().Fragment,null,v().createElement("div",{className:s.barChartContainer},v().createElement(ih,{data:p,range:m,tickFormatterX:x.formatDate,tickFormatterY:Oh.formatNumberForRangeFacet,domain:d})),v().createElement("div",{className:s.dateRangeChooserWrapper},v().createElement(Eh,{values:m,onChange:u}))):v().createElement(yy.K,{variant:"noData"}))};function Ch(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class Sh{static getWidget(e){switch(e.type){case x.FACET_TYPES.ENTITY_TYPE_FACET:return Ay;case x.FACET_TYPES.WITH_DROPDOWN_CHECKBOXES_FACET:return jf;case x.FACET_TYPES.NUMERIC_RANGE_FACET:return ph;case x.FACET_TYPES.DATE_RANGE_FACET:return xh;default:return null}}static build(e){const t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ch(e,t,r[t])}))}return e}({},Sh.getDefaultConfig(),e),r=Sh.getWidget(t);return r?(e=>{const r=sy(e,t);return Sh.connectData(r,t)})(r):null}}Sh.getDefaultConfig=()=>({autofocus:!1,showDeleteButton:!0}),Sh.connectData=(e,t)=>(0,Tp.connect)((e=>({data:(0,D.X7)(t,e),values:(0,D.N1)(t,e),filteredData:(0,D.VP)(t,e),isHighlighted:(0,D.$t)(t.fieldName,e),isRecommended:(0,D.TH)(t.fieldName,e)})))(e);var wh=r(64927),Ah=r.n(wh),Rh=r(73707),_h=r.n(Rh),Ih=r(93463),Nh=r.n(Ih);const Dh=(0,kp.Z)((()=>({tenantFacet:{flexShrink:0},radioGroup:{padding:"0 15px 10px 20px",overflow:"hidden"},radioLabelRoot:{overflow:"hidden"},radioLabel:{paddingLeft:"12px",fontSize:"13px",lineHeight:"16px",overflowWrap:"break-word",wordWrap:"break-word",overflow:"hidden"},radioButton:{padding:"0 9px"},tenantContainer:{display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%",marginBottom:"5px"},total:{color:"rgba(0,0,0,0.6)",fontSize:"13px",lineHeight:"16px"}})));var Ph=r(44244);const kh=e=>{let{tenantObject:t,isDataTenant:r,className:n}=e;const a=(e=>{let{tenantObject:t,isDataTenant:r}=e;const n=(0,Ph._)(),[a,i]=(0,b.useState)(0),o=(0,Tp.useSelector)(k().selectors.getGlobalSearchRequestOptions),l=r?t:null,s=(0,Tp.useSelector)((e=>(0,ui.E2)(e,[],l))),c=JSON.stringify((0,Ba.Vg)(s,[],o)),u=(0,Tp.useSelector)(k().selectors.getDtssPath),p=(0,Tp.useSelector)(k().selectors.getTenant);return(0,b.useEffect)((()=>{n((0,Ba.Es)({url:K.jS,options:{method:"POST",body:c},customerTenant:p,dataTenant:(0,_.prop)("id",l),dtssPath:u})).then((e=>{let{total:t}=e;i(t)})).catch((e=>{console.warn(e)}))}),[l,p,u,c]),a})({tenantObject:t,isDataTenant:r});return v().createElement("div",{className:n},(0,ci.k7)(a))};kh.propTypes={className:vp().string,tenantObject:vp().object.isRequired,isDataTenant:vp().bool};const Lh=kh;function Uh(){return Uh=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Uh.apply(this,arguments)}const jh={changeCurrentTenant:e=>{let{tenantObject:t,isDataTenant:r}=e;return{type:U.Z.CHANGE_CURRENT_TENANT,payload:{tenantObject:t,isDataTenant:r}}}},Fh=(0,Tp.connect)((e=>({dataTenants:k().selectors.getDataTenants(e),customerTenantObject:k().selectors.getTenantObject(e),currentTenant:(0,ui.RO)(e),openAdvancedSearch:(0,ki.IJ)(e)})),jh)((e=>{let{customerTenantObject:t,currentTenant:r,dataTenants:n,changeCurrentTenant:a,openAdvancedSearch:i}=e;const o=Dh(),l=(0,_.pipe)((0,_.map)((e=>{let{id:t,label:r}=e;return{value:t,label:r}})),(0,_.prepend)({value:t.id,label:t.name}))(n),s=e=>{const r=e!==t.id;return{isDataTenant:r,tenantObject:r?n.find((0,_.propEq)("id",e)):t}},c=r||t.id;return v().createElement("div",{className:o.tenantFacet},v().createElement(Vg,{title:mi().text("Tenants"),hasCollapseButton:!1}),v().createElement(_h(),{className:o.radioGroup,value:c,onChange:(0,_.pipe)(Dp.NA,s,a)},l.map((e=>{let{value:t,label:r}=e;return v().createElement("div",{className:o.tenantContainer,key:t},v().createElement(Nh(),{classes:{root:o.radioLabelRoot,label:o.radioLabel},value:t,label:r||t,control:v().createElement(Ah(),{className:o.radioButton,color:"primary"})}),!i&&v().createElement(Lh,Uh({className:o.total},s(t))))}))))})),Mh=(0,kp.Z)({root:{display:"flex",flexShrink:0,flexDirection:"row",overflow:"hidden",alignItems:"center",marginBottom:"4px"},labelRoot:{fontSize:"13px",paddingLeft:"3px",cursor:"pointer",letterSpacing:"normal",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",marginRight:"16px"},checkboxRoot:{padding:"0",margin:"0 18px"},checkboxRootQueryGroups:{marginRight:9}}),Vh=e=>{let{variant:t="facetsPanel",searchOptions:r={},dispatch:n}=e;const{root:a,labelRoot:i,checkboxRoot:o,checkboxRootQueryGroups:l}=Mh(),s=r.searchByOv,c=(0,b.useCallback)((()=>{n(P.search.actions.updateSearchOptions({searchByOv:!s,ovOnly:!s}))}),[s,n]),u=mi().text("Search by OV only");return v().createElement("div",{className:a,onClick:c},v().createElement(Jp(),{classes:{root:O()(o,{[l]:"queryGroups"===t})},checked:s,color:"primary"}),v().createElement(gd.Y,{value:u},v().createElement(Ag(),{variant:"body2",classes:{root:i}},u)))};Vh.propTypes={searchOptions:vp().shape({searchByOv:vp().bool,ovOnly:vp().bool}),variant:vp().oneOf(["facetsPanel","queryGroups"]),dispatch:vp().func};const Bh=(0,Tp.connect)((e=>({searchOptions:k().selectors.getSearchOptions(e)})))(Vh),zh=(0,kp.Z)({root:{display:"flex",flexDirection:"column",overflow:"auto",height:"100%"}});function Hh(){return Hh=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Hh.apply(this,arguments)}const Yh=(0,x.memoizeWith)((e=>e.fieldName),Sh.build),Wh=e=>{let{group:t,configs:r}=e;return v().createElement(oy,Hh({},t,{key:t.title}),(e=>e.map((e=>({Facet:Yh(e),id:e.fieldName}))).filter((e=>{let{Facet:t}=e;return t})).map((e=>{let{Facet:t,id:r}=e;return v().createElement(t,{key:r})})))(r))},Gh=(0,Tp.connect)((e=>{var t;const r=k().selectors.getDataTenants(e);return{metadata:k().selectors.getMetadata(e),facetsConfigs:(0,D.Mp)(e),uiConfigShowSearchByOv:null!==(t=k().selectors.getShowSearchByOv(e))&&void 0!==t?t:(0,ki.cC)(e),showTenantFacet:r&&r.length>0,tenant:k().selectors.getTenant(e)}}))((e=>{let{facetsConfigs:t=[],metadata:r,onScroll:n,uiConfigShowSearchByOv:a,showTenantFacet:i}=e;const{root:o}=zh(),l=(0,b.useRef)(null),s=(0,b.useCallback)((e=>{n(l.current.scrollTop,e)}),[n]),c=((e,t)=>{const[r,n]=(0,_.partition)(x.isTypeFacet,t),a=[{group:{title:mi().text("Entity types"),hasCollapseButton:!1},configs:r},{group:{title:mi().text("Attributes"),hasCollapseButton:!1,hasSearchAttributesField:!0},configs:n}];return Fg(a)})(0,t),u=(0,_.head)(c),p=(0,_.tail)(c),d=l.current,m=(0,b.useMemo)((()=>({element:d,priority:["top","bottom"]})),[d]);return v().createElement("div",{ref:l,className:o,onScroll:s},v().createElement(Ug.p.Provider,{value:m},a&&v().createElement(Bh,null),i&&v().createElement(v().Fragment,null,v().createElement(Fh,null),v().createElement(Lg(),null)),u&&Wh(u),v().createElement(Lg(),null),p.map(((e,t)=>v().createElement(Wh,Hh({},e,{key:t}))))))})),qh=e=>{let{children:t,className:r}=e;return v().createElement("div",{className:O()("MainContent-styles-mainContent--Ha5me",r)},t)};qh.propTypes={children:vp().node,className:vp().string};const Zh=qh;var $h=r(33788);const Kh=(0,kp.Z)({container:{backgroundColor:"#fff",opacity:.37,position:"fixed",width:"100%",height:"100%",top:0,left:0,display:"flex",justifyContent:"center",alignItems:"center"}}),Xh=()=>{const e=(0,Tp.useSelector)(ki.Kv),{container:t}=Kh();return e?v().createElement("div",{className:t},v().createElement($h.Z,{size:160})):null};var Qh=r(54596),Jh=r.n(Qh),eE=r(49233),tE=r.n(eE),rE=r(35206),nE=r.n(rE),aE=r(81733),iE=r.n(aE),oE=r(68290),lE=r.n(oE);const sE=(0,kp.Z)((e=>({snackbar:{display:"flex",flexWrap:"nowrap",backgroundColor:"rgba(0,0,0,0.87)",boxShadow:"0 2px 4px 0 rgba(0,0,0,0.25)",padding:"8px 16px",minHeight:"48px","&:after":{content:'""',minHeight:"inherit",fontSize:0}},anchorSnackBar:{zIndex:11e3,"@media (min-width: 960px)":{bottom:8}},message:{color:"#FFFFFF",fontSize:14,fontWeight:500,lineHeight:"16px",display:"flex",alignItems:"center",flex:1},messageContent:{display:"flex",alignItems:"center",whiteSpace:"pre"},icon:{opacity:.9,marginRight:"12px"},[K.GT.error]:{backgroundColor:e.palette.error.dark}})));function cE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const uE=()=>{const e=(0,Tp.useDispatch)(),t=(0,Tp.useSelector)(ki.v6),r=(0,Tp.useSelector)(k().selectors.getAutoCloseInterval),n=t&&t.payload.autoHideDuration||r&&1e3*r||5e3,a=sE(),i=(0,b.useRef)(null),o=(0,b.useCallback)((()=>{e(Ai())}),[e]);t&&(i.current=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){cE(e,t,r[t])}))}return e}({},t));const{type:l,payload:s}=i.current||{},{message:c,action:u}=s||{},p=u&&u.actionToDispatch,d=(0,b.useCallback)((()=>{p&&e(p)}),[p,e]),m=(0,b.useMemo)((()=>l===K.GT.error?v().createElement(tE(),{key:"close","aria-label":"Close",color:"inherit",className:a.close,onClick:d,size:"large"},v().createElement(_p(),null)):u?v().createElement(nE(),{color:"primary",size:"small",onClick:d},u.actionLabel):null),[a,l,u,d]);return v().createElement(iE(),{container:document.body},v().createElement(Jh(),{key:c+l,anchorOrigin:{vertical:"bottom",horizontal:"center"},autoHideDuration:n,open:Boolean(t),onClose:o,ContentProps:{classes:{root:O()(a.snackbar,a[l]),message:a.message}},message:v().createElement("div",{className:a.messageContent},l===K.GT.error&&v().createElement(lE(),{className:a.icon}),c),classes:{anchorOriginBottomCenter:a.anchorSnackBar},action:m}))},pE=(0,kp.Z)((()=>({resizablePanesWrapper:{flex:"1 0 0px"},pane:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",flexDirection:"column",overflow:"hidden"},divider:{height:"1px"}})));var dE=r(31396);const mE=(0,kp.Z)((()=>({container:{position:"relative","& .Resizer":{zIndex:1,boxSizing:"border-box",backgroundClip:"padding-box","&.disabled":{cursor:"initial",height:0,margin:0},"&.horizontal":{height:"11px",backgroundImage:"linear-gradient(rgba(0,0,0,0.33), rgba(0,0,0,0.33))",backgroundRepeat:"no-repeat",backgroundSize:"100% 1px",backgroundPosition:"top",width:"100%",marginBottom:"-10px","&.disabled":{background:"transparent"},"&:not(.disabled):hover":{cursor:"row-resize",backgroundImage:"linear-gradient(rgba(0, 114, 206, 0), rgba(0, 114, 206, 0.35), rgba(0, 114, 206, 1))",backgroundSize:"100% 3px"}},"&.vertical":{width:"11px",backgroundImage:"linear-gradient(rgba(0,0,0,0.33), rgba(0,0,0,0.33))",backgroundRepeat:"no-repeat",backgroundSize:"1px 100%",backgroundPosition:"left",height:"100%",marginRight:"-10px","&:not(.disabled):hover":{cursor:"col-resize",backgroundImage:"linear-gradient(to left, rgba(0, 114, 206, 0.35), rgba(0, 114, 206, 1), rgba(0, 114, 206, 0.35))",backgroundSize:"3px 100%"}}}}}))),gE=250,yE=e=>"horizontal"===e,fE=e=>{let{className:t,children:r,orientation:n,primary:a,defaultSize:i,size:o,minSize:l,maxSize:s,allowResize:c,debounceInterval:u=gE,onChange:p}=e;const d=mE(),m=(0,Lm.useTheme)(),[g,y]=(0,b.useState)(null),[f,h]=(0,b.useState)(!0),E=(0,b.useCallback)((()=>h(!0)),[]),T=(0,b.useCallback)((()=>h(!1)),[]),C=()=>yE(n)?null==g?void 0:g.clientHeight:null==g?void 0:g.clientWidth,S=(0,b.useCallback)((0,x.debounce)((e=>{const t=C();p({percentageSize:e/t*100+"%",isMaxSize:+s>0?e===s:e===t+s,isMinSize:e===l,size:e})}),u),[p,n,s,g]),w=(0,b.useMemo)((()=>({transition:m.transitions.create(yE(n)?"height":"width",{easing:m.transitions.easing.sharp,duration:m.transitions.duration.leavingScreen})})),[n,m]);return"number"==typeof o&&o<0&&(o=(C()||0)+o),v().createElement("div",{ref:y,className:O()(d.container,t)},v().createElement(dE.Z,{split:n,size:o,primary:a,allowResize:c,onChange:S,defaultSize:i,minSize:l,maxSize:s,onDragStarted:T,onDragFinished:E,pane1Style:f?w:void 0},r))};fE.displayName="ResizablePanes";const hE=(0,kp.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 7px",borderRadius:"2px",fontSize:"13px",fontWeight:500,lineHeight:"16px",marginRight:"16px",flexShrink:0}}),EE=e=>{let{entity:t,className:r,size:n="small"}=e;const a=hE(),i=(0,w.AH)(),o=(0,x.getEntityType)(i,t.type),l=(o?(0,x.getPropWithInheritance)(i,o,"typeColor"):null)||x.theme.palette.primary.main,s=(0,x.getEntityTypeLabel)(i,t);return v().createElement(gd.Y,{value:s,placement:"top"},v().createElement(Ag(),{style:{backgroundColor:l,color:x.utils.Colors.getColor(l)?"#FFFFFF":"#212121"},className:O()(a[`entityType-${n}`],a["entityType-overflow"],r),component:"div"},s))},bE=e=>e&&e.scrollIntoView({block:"end",behavior:"smooth"}),vE=e=>{e&&clearTimeout(e)},TE=(e,t)=>{if(e&&t){const r=e.offsetTop,n=e.offsetTop+e.clientHeight,{clientHeight:a,scrollTop:i}=t;return r>=0&&n>i&&n<i+a}};var OE=r(600);const xE=(0,kp.Z)((e=>({"@keyframes animate":{from:{background:"transparent"},"66%":{background:"#f2e68e"},"100%":{background:"transparent"}},highlighted:{animationName:"$animate",animationDuration:"3s",animationIterationCount:1},item:{display:"flex",minHeight:"40px",borderBottom:"1px solid rgba(0, 0, 0, 0.1)",flexDirection:"row","&:after":{content:"",minHeight:"inherit",fontSize:0},"&:hover":{backgroundColor:"rgba(0, 0, 0, 0.03)"}},clickable:{cursor:"pointer"},selected:{background:(0,Lm.alpha)(e.palette.primary.main,.12),"&:hover":{background:(0,Lm.alpha)(e.palette.primary.main,.24)}},inactive:{background:e.inactiveBackground,"&:hover":{background:e.inactiveHoverBackground},"&$selected":{background:e.inactiveSelectedBackground,"&:hover":{background:e.inactiveSelectedHoverBackground}}},justImported:{backgroundColor:"#FFFBEB !important"},avatar:{marginLeft:"20px"},image:{height:"32px",width:"32px",marginTop:"8px",marginBottom:"7px"},info:{marginLeft:"20px",flexGrow:1,display:"flex",flexDirection:"column",justifyContent:"center",fontSize:"13px",width:"100%",overflow:"hidden",overflowWrap:"break-word",wordWrap:"break-word"},label:{fontSize:"13px",lineHeight:"15px",fontWeight:500,color:e.palette.primary.main,marginRight:"17px",textDecoration:"none"},secondaryLabel:{marginRight:"12px"},businessCard:{color:"rgba(0, 0, 0, 0.54)"},secondRow:{display:"flex",marginTop:"2px",alignItems:"center",color:"rgba(0, 0, 0, 0.54)",fontSize:"12px"}}))),CE=e=>{let{entities:t,entityToHighlight:r,selectedEntityUri:n,onEntityClick:a,onEntityHover:i,entitiesImportStatus:o,entityButtonsRenderer:l}=e;const s=xE(),c=(0,b.useRef)(null),u=(0,b.useRef)(null),p=(0,w.AH)();return(0,OE.D)((()=>{if(r){var e;const n=null===(e=c.current)||void 0===e?void 0:e.querySelectorAll(`[data-entity-uri='${r}']`);if(vE(u.current),(null==n?void 0:n.length)>0){var t;const e=null===(t=c.current)||void 0===t?void 0:t.parentElement;TE(n[0],e)||(bE(n[0]),u.current=setTimeout((()=>{TE(n[0],e)||bE(n[0])}),1e3))}}return()=>{vE(u.current)}}),[r]),v().createElement("div",{ref:c},(t||[]).map((e=>{const t=(0,x.getLabel)(e.label),c=e.secondaryLabel,u=(0,x.getBusinessCardAttributesText)(p,e),d=(0,x.isActiveObject)(e),m=e.uri,g=(0,x.getEntityUriForLink)(e),y=(0,_.prop)(m,o);return v().createElement("div",{key:m,className:O()(s.item,{[s.clickable]:!!a,[s.selected]:m===n,[s.highlighted]:m===r,[s.inactive]:!d,[s.justImported]:y===bm.Eh.Success}),onClick:a?()=>a(m):void 0,onMouseEnter:i?()=>i(m):void 0,onMouseLeave:i?()=>i(null):void 0,"data-entity-uri":m},v().createElement(A,{entity:e,avatarClassName:s.avatar,imageClassName:s.image}),v().createElement("div",{className:s.info},v().createElement("div",null,v().createElement(qd,{value:g,className:s.label},t),c&&v().createElement("span",{className:s.secondaryLabel},c," "),u&&v().createElement("span",{className:s.businessCard},u)),v().createElement("div",{className:s.secondRow},v().createElement(EE,{entity:e}),v().createElement("div",null,(0,x.getEntityId)(e)))),l&&l(e))})))};var SE=r(92255);function wE(){return wE=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},wE.apply(this,arguments)}function AE(){return AE=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},AE.apply(this,arguments)}function RE(){return RE=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},RE.apply(this,arguments)}function _E(){return _E=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},_E.apply(this,arguments)}const IE=(0,kp.Z)((e=>({root:{display:"flex",flex:"1 1 auto",flexWrap:"nowrap",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"10px",overflow:"auto",height:"100%",minHeight:"350px",boxSizing:"border-box","&$root_small":{minHeight:"160px"},"& $text":{color:e.palette.text.primary,fontSize:"20px",fontWeight:500,lineHeight:"24px",letterSpacing:"0.25px",textAlign:"center"},"& $secondaryText":{color:e.palette.text.secondary,fontSize:"15px",fontWeight:300,lineHeight:"18px",letterSpacing:"0.11px",textAlign:"center",paddingTop:"3px"}},root_small:{},embedded:{flexShrink:0,width:"190px",height:"190px",padding:"8px"},full:{width:"256px",height:"256px"},textBox:{display:"flex",flexDirection:"column",alignItems:"center",maxWidth:500,marginTop:"16px"},text:{},secondaryText:{},button:{minHeight:36,minWidth:64,maxWidth:500,padding:"10px 16px",borderRadius:"2px",boxShadow:"0 0 2px 0 rgba(0,0,0,0.12), 0 2px 2px 0 rgba(0,0,0,0.24), 0 0 8px 0 rgba(0,0,0,0.12), 0 8px 8px 0 rgba(0,0,0,0.24)",fontSize:"14px",fontWeight:500,lineHeight:"16px",marginTop:"24px"}})));function NE(){return NE=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},NE.apply(this,arguments)}let DE=function(e){return e.full="full",e.embedded="embedded",e.small="small",e}({});const PE={SEARCH_RESULTS:e=>v().createElement("svg",wE({width:256,height:256,viewBox:"0 0 256 256",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","data-reltio-id":"SvgEmptySearchResults"},e),v().createElement("defs",null,v().createElement("radialGradient",{cx:"50%",cy:"100%",fx:"50%",fy:"100%",r:"81.681%",gradientTransform:"matrix(.98998 0 0 .612 .005 .388)",id:"EmptySearchResults_svg__c"},v().createElement("stop",{stopColor:"#00BFFF",stopOpacity:.5,offset:"0%"}),v().createElement("stop",{stopColor:"#9EE8FF",stopOpacity:0,offset:"100%"})),v().createElement("radialGradient",{cx:"50%",cy:"111.651%",fx:"50%",fy:"111.651%",r:"87.693%",gradientTransform:"matrix(0 -.97693 .7263 0 -.31 1.605)",id:"EmptySearchResults_svg__f"},v().createElement("stop",{stopColor:"#91F8E5",stopOpacity:.6,offset:"0%"}),v().createElement("stop",{stopColor:"#14F7FF",stopOpacity:0,offset:"100%"})),v().createElement("radialGradient",{cx:"50%",cy:"103.659%",fx:"50%",fy:"103.659%",r:"90.207%",gradientTransform:"matrix(0 -1 2.23905 0 -1.821 1.537)",id:"EmptySearchResults_svg__g"},v().createElement("stop",{stopColor:"#FFF",offset:"0%"}),v().createElement("stop",{stopColor:"#73FAFF",stopOpacity:.21,offset:"59.38%"}),v().createElement("stop",{stopColor:"#14F7FF",stopOpacity:0,offset:"100%"})),v().createElement("linearGradient",{x1:"50%",y1:"170.771%",x2:"50%",y2:"10.303%",id:"EmptySearchResults_svg__e"},v().createElement("stop",{stopColor:"#91F8E5",offset:"0%"}),v().createElement("stop",{stopColor:"#99FCFF",stopOpacity:0,offset:"100%"})),v().createElement("filter",{x:"-25.9%",y:"-26.2%",width:"151.8%",height:"152.3%",filterUnits:"objectBoundingBox",id:"EmptySearchResults_svg__d"},v().createElement("feGaussianBlur",{stdDeviation:15,in:"SourceGraphic"})),v().createElement("circle",{id:"EmptySearchResults_svg__a",cx:128,cy:128,r:128})),v().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},v().createElement("mask",{id:"EmptySearchResults_svg__b",fill:"#fff"},v().createElement("use",{xlinkHref:"#EmptySearchResults_svg__a"})),v().createElement("use",{fillOpacity:.2,fill:"#A792CD",xlinkHref:"#EmptySearchResults_svg__a"}),v().createElement("g",{mask:"url(#EmptySearchResults_svg__b)"},v().createElement("g",{transform:"translate(56 34)"},v().createElement("g",{opacity:.9,strokeWidth:1,fill:"#FFF"},v().createElement("path",{d:"M0 6.99C0 3.13 3.137 0 7 0h247.067c3.866 0 7 3.144 7 6.99v169.353c0 3.86-3.137 6.99-7 6.99H7c-3.866 0-7-3.143-7-6.99V6.99z"}),v().createElement("path",{d:"M13 25.99c0-3.86 3.137-6.99 7-6.99h247.067c3.866 0 7 3.144 7 6.99v169.353c0 3.86-3.137 6.99-7 6.99H20c-3.866 0-7-3.143-7-6.99V25.99z",opacity:.4})),v().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(21.756 45.833)"},v().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:213.204,cy:5.456,rx:4.351,ry:4.365}),v().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:197.976,cy:5.456,rx:4.351,ry:4.365}),v().createElement("path",{d:"M10.334 1.091c5.707 0 10.334 4.627 10.334 10.334v.067c0 5.707-4.627 10.333-10.334 10.333S0 17.2 0 11.492v-.067C0 5.718 4.627 1.091 10.334 1.091z",fill:"#E3EBF4"}),v().createElement("path",{d:"M35.365.861h69.768a3.82 3.82 0 010 7.639H35.365a3.82 3.82 0 010-7.639z",fill:"#B1AABD",opacity:.5}),v().createElement("path",{d:"M34.274 15.048h126.164a2.728 2.728 0 010 5.456H34.274a2.728 2.728 0 110-5.456z",fill:"#B1AABD",opacity:.43}),v().createElement("path",{d:"M33.182 24.869H73.89a1.637 1.637 0 110 3.274H33.182a1.637 1.637 0 010-3.274z",fill:"#B1AABD",opacity:.2})),v().createElement("rect",{fill:"#645F6D",opacity:.5,x:21.756,y:17.46,width:87.022,height:12.004,rx:6.002}),v().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(21.756 87.302)"},v().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:213.204,cy:5.456,rx:4.351,ry:4.365}),v().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:197.976,cy:5.456,rx:4.351,ry:4.365}),v().createElement("rect",{fill:"#E3EBF4",x:0,y:1.091,width:20.668,height:20.734,rx:10.334}),v().createElement("path",{d:"M35.365.861h82.647a3.82 3.82 0 010 7.639H35.365a3.82 3.82 0 010-7.639z",fill:"#B1AABD",opacity:.5}),v().createElement("path",{d:"M34.274 15.048H174.58a2.728 2.728 0 010 5.456H34.274a2.728 2.728 0 110-5.456z",fill:"#B1AABD",opacity:.43}),v().createElement("path",{d:"M33.182 24.869h113.119a1.637 1.637 0 110 3.274H33.182a1.637 1.637 0 010-3.274z",fill:"#B1AABD",opacity:.2})),v().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(21.756 128.77)"},v().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:213.204,cy:5.456,rx:4.351,ry:4.365}),v().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:197.976,cy:5.456,rx:4.351,ry:4.365}),v().createElement("path",{d:"M10.334 1.091c5.707 0 10.334 4.627 10.334 10.334v.067c0 5.707-4.627 10.333-10.334 10.333S0 17.2 0 11.492v-.067C0 5.718 4.627 1.091 10.334 1.091z",fill:"#E3EBF4"}),v().createElement("path",{d:"M35.365.861h110.929a3.82 3.82 0 010 7.639H35.365a3.82 3.82 0 010-7.639z",fill:"#B1AABD",opacity:.5}),v().createElement("path",{d:"M34.274 15.048h92.443a2.728 2.728 0 010 5.456H34.274a2.728 2.728 0 110-5.456z",fill:"#B1AABD",opacity:.43}),v().createElement("path",{d:"M33.182 24.869H73.89a1.637 1.637 0 110 3.274H33.182a1.637 1.637 0 010-3.274z",fill:"#B1AABD",opacity:.2})))),v().createElement("g",{mask:"url(#EmptySearchResults_svg__b)"},v().createElement("path",{fill:"#446275",d:"M72.246 84.033l8.66 5-35.5 61.488-8.66-5-12.556-24.729-51.307-29.622 20.431-35.388 50.648 29.242z"}),v().createElement("path",{d:"M62.906 120.21l-80.091-46.24 10.5-18.188 50.647 29.242 28.284-.99 8.66 5-18 31.176z",fillOpacity:.2,fill:"#FFF"}),v().createElement("path",{d:"M27.566 75.558L3.877 109.065l-5.013-2.895 26.045-32.146 2.657 1.534zm9.467 5.466L13.345 114.53l-5.014-2.895L34.377 79.49l2.656 1.534zm8.158 4.71l-22.32 34.297-5.013-2.895L43.903 84.99l1.288.744z",fill:"#527585"}),v().createElement("path",{d:"M11.524 90.544l13.385-16.52 2.657 1.534-12.174 17.22-3.868-2.234zm9.467 5.467L34.377 79.49l2.656 1.534-12.174 17.22-3.868-2.233zm9.527 5.5L43.903 84.99l1.288.744-11.47 17.626-3.203-1.85z",fill:"#76A2B5",opacity:.6}),v().createElement("path",{d:"M.355 59.848l-23.689 33.507-5.013-2.895 26.045-32.146 2.657 1.534zm9.468 5.466L-13.866 98.82l-5.013-2.895L7.166 63.78l2.657 1.534zm8.158 4.71L-4.34 104.32l-5.014-2.895L16.692 69.28l1.289.744z",fillOpacity:.1,fill:"#000"}),v().createElement("g",null,v().createElement("path",{fill:"url(#EmptySearchResults_svg__c)",opacity:.993,filter:"url(#EmptySearchResults_svg__d)",d:"M.63 0h173.74L123 172H52z",transform:"rotate(120 90.404 138.861)"}),v().createElement("path",{fill:"url(#EmptySearchResults_svg__e)",opacity:.3,d:"M4 9h166.37L120.73 172.299H53.64z",transform:"rotate(120 90.404 138.861)"}),v().createElement("path",{fill:"url(#EmptySearchResults_svg__f)",opacity:.3,d:"M4 2h166.37L120.73 172.299H53.64z",transform:"rotate(120 90.404 138.861)"}),v().createElement("path",{fill:"url(#EmptySearchResults_svg__g)",d:"M4 9h166.37L120.73 172.299H53.64z",transform:"rotate(120 90.404 138.861)"}),v().createElement("path",{fill:"#FFF",opacity:.196,d:"M212.363 205.344l-1 1.732L60.418 124.52l4.977-8.62z"})),v().createElement("path",{fill:"#76A2B5",d:"M73.112 84.533l-35.5 61.488-.866-.5 35.5-61.488z"}),v().createElement("path",{fill:"#F3F3F3",d:"M80.906 89.033l-35.5 61.488-.866-.5 35.5-61.488z"}),v().createElement("path",{fill:"#538196",d:"M55.112 115.71l-17.5 30.311-.866-.5 17.5-30.31z"})))),SELECT_ATTRIBUTES:e=>v().createElement("svg",AE({width:256,height:256,viewBox:"0 0 256 256",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgSelectAttributes"},e),v().createElement("circle",{cx:128,cy:128,r:128,fill:"#0072CE",fillOpacity:.1}),v().createElement("mask",{id:"SelectAttributes_svg__a",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:0,y:0,width:256,height:256},v().createElement("circle",{cx:128,cy:128,r:128,fill:"#fff"})),v().createElement("g",{mask:"url(#SelectAttributes_svg__a)"},v().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M-16 9h256v247H-16V9z",fill:"url(#SelectAttributes_svg__paint0_linear_0_19219)"}),v().createElement("path",{opacity:.05,fillRule:"evenodd",clipRule:"evenodd",d:"M187.761 56.865l58.639 58.639v148.871H93.383L52 225.083V56.865h135.761z",fill:"url(#SelectAttributes_svg__paint1_linear_0_19219)"}),v().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"}),v().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"}),v().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"}),v().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"}),v().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"}),v().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"}),v().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"}),v().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"}),v().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"}),v().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"}),v().createElement("circle",{cx:67,cy:79,r:9,fill:"#B6C7DB"}),v().createElement("circle",{cx:67,cy:79,r:9,fill:"#B6C7DB"}),v().createElement("circle",{cx:120,cy:106,r:6,fill:"#B6C7DB"}),v().createElement("circle",{cx:120,cy:136,r:6,fill:"#B6C7DB"}),v().createElement("circle",{cx:67,cy:169,r:9,fill:"#B6C7DB"}),v().createElement("circle",{cx:67,cy:199,r:9,fill:"#B6C7DB"}),v().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"}),v().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"}),v().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M92.514 108v-8h-2V140.365h11.178v-2h-9.178V110h9.178v-2h-9.178z",fill:"#2B98F0"}),v().createElement("path",{opacity:.54,fillRule:"evenodd",clipRule:"evenodd",d:"M95.071 77l-3.535 3.535L88 77h7.071z",fill:"#000"}),v().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"}),v().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M58 37a6 6 0 016-6h70a6 6 0 110 12H64a6 6 0 01-6-6zM148 37a6 6 0 016-6h10a6 6 0 110 12h-10a6 6 0 01-6-6z",fill:"#979797"})),v().createElement("defs",null,v().createElement("linearGradient",{id:"SelectAttributes_svg__paint0_linear_0_19219",x1:-16,y1:9,x2:-16,y2:256,gradientUnits:"userSpaceOnUse"},v().createElement("stop",{stopColor:"#FAFAFA",stopOpacity:.01}),v().createElement("stop",{offset:1,stopColor:"#F4F4F4"})),v().createElement("linearGradient",{id:"SelectAttributes_svg__paint1_linear_0_19219",x1:266.117,y1:181.111,x2:154.882,y2:77.681,gradientUnits:"userSpaceOnUse"},v().createElement("stop",{stopOpacity:.01}),v().createElement("stop",{offset:1})))),NO_DATA:e=>v().createElement("svg",RE({width:256,height:256,viewBox:"0 0 256 256",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","data-reltio-id":"SvgNoData"},e),v().createElement("defs",null,v().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"NoData_svg__b"},v().createElement("stop",{stopColor:"#FAFAFA",stopOpacity:0,offset:"0%"}),v().createElement("stop",{stopColor:"#F4F4F4",offset:"100%"})),v().createElement("linearGradient",{x1:"69.573%",y1:"86.747%",x2:"38.144%",y2:"33.403%",id:"NoData_svg__d"},v().createElement("stop",{stopColor:"#000",stopOpacity:0,offset:"0%"}),v().createElement("stop",{stopColor:"#000",offset:"100%"})),v().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"NoData_svg__e"},v().createElement("stop",{stopColor:"#EEFBFF",offset:"0%"}),v().createElement("stop",{stopColor:"#0072CE",offset:"100%"})),v().createElement("filter",{x:"-7.7%",y:"-7.5%",width:"115.3%",height:"115%",filterUnits:"objectBoundingBox",id:"NoData_svg__f"},v().createElement("feOffset",{dx:0,dy:2,in:"SourceAlpha",result:"shadowOffsetOuter1"}),v().createElement("feGaussianBlur",{stdDeviation:2,in:"shadowOffsetOuter1",result:"shadowBlurOuter1"}),v().createElement("feColorMatrix",{values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0",type:"matrix",in:"shadowBlurOuter1",result:"shadowMatrixOuter1"}),v().createElement("feMerge",null,v().createElement("feMergeNode",{in:"shadowMatrixOuter1"}),v().createElement("feMergeNode",{in:"SourceGraphic"}))),v().createElement("circle",{id:"NoData_svg__a",cx:128,cy:128,r:128})),v().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},v().createElement("mask",{id:"NoData_svg__c",fill:"#fff"},v().createElement("use",{xlinkHref:"#NoData_svg__a"})),v().createElement("use",{fillOpacity:.1,fill:"#0072CE",xlinkHref:"#NoData_svg__a"}),v().createElement("path",{fill:"url(#NoData_svg__b)",mask:"url(#NoData_svg__c)",d:"M0 9h256v247H0z"}),v().createElement("g",{mask:"url(#NoData_svg__c)"},v().createElement("g",{transform:"translate(29 37)"},v().createElement("g",{opacity:.9,strokeWidth:1,fill:"#FFF"},v().createElement("path",{fillOpacity:.8,opacity:.5,d:"M14.565 8h228.144v176.476H14.565z"}),v().createElement("path",{d:"M0 8.01C0 3.586 3.576 0 7.997 0h223.838a7.997 7.997 0 017.997 8.01v152.401c0 4.424-3.577 8.01-7.997 8.01H7.997A7.997 7.997 0 010 160.411V8.01z"})),v().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(19.986 42.105)"},v().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:195.862,cy:5.013,rx:3.997,ry:4.01}),v().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:181.872,cy:5.013,rx:3.997,ry:4.01}),v().createElement("path",{d:"M9.493 1.003a9.493 9.493 0 019.494 9.493v.06a9.493 9.493 0 01-18.987 0v-.06a9.493 9.493 0 019.493-9.493z",fill:"#E3EBF4"}),v().createElement("path",{d:"M32.488.791h64.093a3.509 3.509 0 110 7.018H32.488a3.509 3.509 0 110-7.018z",fill:"#B1AABD",opacity:.5}),v().createElement("path",{d:"M31.486 13.824h115.902a2.506 2.506 0 010 5.012H31.486a2.506 2.506 0 010-5.012z",fill:"#B1AABD",opacity:.43}),v().createElement("path",{d:"M30.483 22.846H67.88a1.504 1.504 0 110 3.008H30.483a1.504 1.504 0 110-3.008z",fill:"#B1AABD",opacity:.2})),v().createElement("rect",{fill:"#645F6D",opacity:.5,x:19.986,y:16.04,width:79.944,height:11.028,rx:5.514}),v().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(19.986 80.2)"},v().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:195.862,cy:5.013,rx:3.997,ry:4.01}),v().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:181.872,cy:5.013,rx:3.997,ry:4.01}),v().createElement("rect",{fill:"#E3EBF4",x:0,y:1.003,width:18.987,height:19.048,rx:9.493}),v().createElement("path",{d:"M32.488.791h75.925a3.509 3.509 0 010 7.018H32.488a3.509 3.509 0 110-7.018z",fill:"#B1AABD",opacity:.5}),v().createElement("path",{d:"M31.486 13.824h128.893a2.506 2.506 0 110 5.012H31.486a2.506 2.506 0 010-5.012z",fill:"#B1AABD",opacity:.43}),v().createElement("path",{d:"M30.483 22.846h103.918a1.504 1.504 0 010 3.008H30.483a1.504 1.504 0 110-3.008z",fill:"#B1AABD",opacity:.2})),v().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(19.986 118.296)"},v().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:195.862,cy:5.013,rx:3.997,ry:4.01}),v().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:181.872,cy:5.013,rx:3.997,ry:4.01}),v().createElement("path",{d:"M9.493 1.003a9.493 9.493 0 019.494 9.493v.06a9.493 9.493 0 01-18.987 0v-.06a9.493 9.493 0 019.493-9.493z",fill:"#E3EBF4"}),v().createElement("path",{d:"M32.488.791h101.906a3.509 3.509 0 010 7.018H32.488a3.509 3.509 0 110-7.018z",fill:"#B1AABD",opacity:.5}),v().createElement("path",{d:"M31.486 13.824h84.924a2.506 2.506 0 010 5.012H31.486a2.506 2.506 0 010-5.012z",fill:"#B1AABD",opacity:.43}),v().createElement("path",{d:"M30.483 22.846H67.88a1.504 1.504 0 110 3.008H30.483a1.504 1.504 0 110-3.008z",fill:"#B1AABD",opacity:.2})))),v().createElement("g",{mask:"url(#NoData_svg__c)"},v().createElement("path",{d:"M154.445 45.134v154.072H36.625V45.134h.811C35.508 62.52 41.07 80.609 54.12 93.944c22.74 23.235 59.61 23.235 82.352 0 13.05-13.335 18.612-31.424 16.683-48.81h1.29z",fill:"url(#NoData_svg__d)",opacity:.1,transform:"rotate(-30 291.014 34.548)"}),v().createElement("path",{d:"M27.473 93.234c17.964 18.355 47.09 18.355 65.054 0s17.964-48.113 0-66.468c-17.964-18.355-47.09-18.355-65.054 0s-17.964 48.113 0 66.468z",fill:"url(#NoData_svg__e)",opacity:.2,transform:"translate(70 86)"}),v().createElement("g",{filter:"url(#NoData_svg__f)",strokeWidth:1,fill:"none",transform:"translate(70 86)"},v().createElement("path",{d:"M59.697 0c32.97 0 59.697 26.746 59.697 59.738 0 15.185-5.662 29.047-14.988 39.587l51.204 51.24a89.336 89.336 0 01-10.097 9.392l-51.38-51.416c-9.73 6.888-21.61 10.936-34.436 10.936C26.727 119.477 0 92.73 0 59.738 0 26.746 26.727 0 59.697 0zm0 17.756c-23.17 0-41.953 18.796-41.953 41.982s18.783 41.982 41.953 41.982 41.953-18.796 41.953-41.982-18.783-41.982-41.953-41.982z",fill:"#B5C8C9"}),v().createElement("path",{d:"M21.508 105.656C8.365 94.698 0 78.196 0 59.738 0 26.746 26.727 0 59.697 0c18.444 0 34.935 8.37 45.885 21.523l-9.794 9.8c-8.408-10.68-21.45-17.537-36.091-17.537-25.361 0-45.92 20.573-45.92 45.952 0 14.652 6.852 27.702 17.525 36.117l-9.794 9.8z",fillOpacity:.4,fill:"#FFF"})),v().createElement("path",{d:"M97.473 179.234c17.964 18.355 47.09 18.355 65.054 0s17.964-48.113 0-66.468c-17.964-18.355-47.09-18.355-65.054 0s-17.964 48.113 0 66.468z",fill:"#D9F5FF",opacity:.4,style:{mixBlendMode:"soft-light"}}),v().createElement("path",{d:"M123.885 158.736c0-3.929.444-7.03 1.332-9.304.888-2.274 2.328-4.245 4.32-5.914 1.99-1.668 3.504-3.195 4.54-4.581 1.037-1.386 1.555-2.913 1.555-4.581 0-4.064-1.75-6.095-5.248-6.095-1.614 0-2.92.592-3.915 1.776-.996 1.184-1.52 2.785-1.574 4.803H111.25c.054-5.382 1.75-9.573 5.086-12.574 3.337-3 8.02-4.5 14.047-4.5 6.001 0 10.65 1.386 13.946 4.157 3.297 2.772 4.945 6.714 4.945 11.827 0 2.234-.444 4.265-1.332 6.095-.888 1.83-2.315 3.7-4.279 5.61l-4.642 4.32c-1.318 1.265-2.233 2.563-2.745 3.895-.51 1.332-.793 3.02-.847 5.066h-11.545zm-1.655 12.27c0-1.99.72-3.625 2.16-4.904 1.44-1.278 3.236-1.917 5.389-1.917 2.152 0 3.949.64 5.388 1.917 1.44 1.279 2.16 2.913 2.16 4.905 0 1.991-.72 3.626-2.16 4.904-1.44 1.278-3.236 1.917-5.388 1.917-2.153 0-3.95-.639-5.389-1.917-1.44-1.278-2.16-2.913-2.16-4.904z",fillOpacity:.87,fill:"#000",style:{mixBlendMode:"overlay"}}),v().createElement("path",{d:"M123.885 158.736c0-3.929.444-7.03 1.332-9.304.888-2.274 2.328-4.245 4.32-5.914 1.99-1.668 3.504-3.195 4.54-4.581 1.037-1.386 1.555-2.913 1.555-4.581 0-4.064-1.75-6.095-5.248-6.095-1.614 0-2.92.592-3.915 1.776-.996 1.184-1.52 2.785-1.574 4.803H111.25c.054-5.382 1.75-9.573 5.086-12.574 3.337-3 8.02-4.5 14.047-4.5 6.001 0 10.65 1.386 13.946 4.157 3.297 2.772 4.945 6.714 4.945 11.827 0 2.234-.444 4.265-1.332 6.095-.888 1.83-2.315 3.7-4.279 5.61l-4.642 4.32c-1.318 1.265-2.233 2.563-2.745 3.895-.51 1.332-.793 3.02-.847 5.066h-11.545zm-1.655 12.27c0-1.99.72-3.625 2.16-4.904 1.44-1.278 3.236-1.917 5.389-1.917 2.152 0 3.949.64 5.388 1.917 1.44 1.279 2.16 2.913 2.16 4.905 0 1.991-.72 3.626-2.16 4.904-1.44 1.278-3.236 1.917-5.388 1.917-2.153 0-3.95-.639-5.389-1.917-1.44-1.278-2.16-2.913-2.16-4.904z",fillOpacity:.38,fill:"#3C74B4"})))),ERROR:e=>v().createElement("svg",_E({width:88,height:88,viewBox:"0 0 88 88",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgError"},e),v().createElement("mask",{id:"Error_svg__a",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:0,y:0,width:88,height:88},v().createElement("path",{d:"M44 88c24.3 0 44-19.7 44-44S68.3 0 44 0 0 19.7 0 44s19.7 44 44 44z",fill:"#fff"})),v().createElement("g",{mask:"url(#Error_svg__a)"},v().createElement("path",{d:"M44 88c24.3 0 44-19.7 44-44S68.3 0 44 0 0 19.7 0 44s19.7 44 44 44z",fill:"#CAC4D5",fillOpacity:.3}),v().createElement("path",{opacity:.3,fillRule:"evenodd",clipRule:"evenodd",d:"M19.987 6.73l49.449 6.072a.687.687 0 01.596.767l-7.845 63.888a.688.688 0 01-.766.6L7.214 71.4a.688.688 0 01-.599-.763l.408-3.326L19.987 6.73z",fill:"#fff"}),v().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M1.267 25.921l45.86-19.466a.687.687 0 01.9.366l25.15 59.251a.61.61 0 01-.386.84L22.34 82.765a.719.719 0 01-.887-.445l-20.185-56.4z",fill:"#fff"}),v().createElement("path",{d:"M65.631 9.23H11.017a.688.688 0 00-.687.687v64.37c0 .38.307.687.687.687h54.614c.38 0 .688-.308.688-.687V9.917a.688.688 0 00-.688-.688z",fill:"#F9F9F9"}),v().createElement("path",{opacity:.1,fillRule:"evenodd",clipRule:"evenodd",d:"M14.885 34.95l3.105-1.666 7.31-4.025 8.852 3.472 7.89-5.223 8.036-2.628 8.113 5.193 3.352-10.255v16.967H14.935l-.05-1.835z",fill:"#9C6CF0"}),v().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M14.885 32.331l3.105-3.761 7.31 4.31 8.852 1.656 7.89-2.205 8.036 1.827 8.113-12.643 3.352.742V36.36H14.935l-.05-4.029z",fill:"#FA82AA"}),v().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M14.885 34.946l3.105.432 7.31 1.01 8.852-5.117 7.89 3.675 8.036 1.839 8.113-1.839 3.352.811v1.028H14.935l-.05-1.839z",fill:"#4DBEE9"}),v().createElement("path",{opacity:.1,fillRule:"evenodd",clipRule:"evenodd",d:"M61.543 35.288l-.05 1.497H14.885v-5.239l3.352-.276 8.114 4.697 8.036-.679 7.889.82 8.852-.616 7.31-1.601 3.105 1.397z",fill:"#4DBEE9"}),v().createElement("path",{d:"M21.036 40.178h-5.09a.636.636 0 000 1.272h5.09a.636.636 0 100-1.272z",fill:"#ACACAC"}),v().createElement("path",{opacity:.3,fillRule:"evenodd",clipRule:"evenodd",d:"M16.582 55.872c.703 0 1.273.57 1.273 1.273V69.02a1.272 1.272 0 11-2.545 0V57.144c0-.702.57-1.272 1.272-1.272zM25.914 55.872c.702 0 1.272.57 1.272 1.273V69.02a1.272 1.272 0 11-2.545 0V57.144c0-.702.57-1.272 1.273-1.272zM39.91 55.872c.703 0 1.273.57 1.273 1.273V69.02a1.272 1.272 0 11-2.545 0V57.144c0-.702.57-1.272 1.273-1.272zM21.248 55.872c.702 0 1.272.57 1.272 1.273V69.02a1.273 1.273 0 01-2.545 0V57.144c0-.702.57-1.272 1.273-1.272zM35.245 55.872c.703 0 1.273.57 1.273 1.273V69.02a1.272 1.272 0 11-2.545 0V57.144c0-.702.57-1.272 1.272-1.272zM30.58 55.872c.702 0 1.272.57 1.272 1.273V69.02a1.272 1.272 0 11-2.545 0V57.144c0-.702.57-1.272 1.272-1.272zM44.577 55.872c.702 0 1.272.57 1.272 1.273V69.02a1.273 1.273 0 01-2.545 0V57.144c0-.702.57-1.272 1.273-1.272z",fill:"#BDBDBD"}),v().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.582 65.628c.703 0 1.273.57 1.273 1.272v2.121a1.272 1.272 0 11-2.545 0v-2.12c0-.703.57-1.273 1.272-1.273zM25.914 62.658c.702 0 1.272.57 1.272 1.273v5.09a1.272 1.272 0 11-2.545 0v-5.09c0-.703.57-1.273 1.273-1.273zM39.91 65.628c.703 0 1.273.57 1.273 1.272v2.121a1.272 1.272 0 11-2.545 0v-2.12c0-.703.57-1.273 1.273-1.273zM21.248 66.477c.702 0 1.272.57 1.272 1.272v1.273a1.273 1.273 0 01-2.545 0v-1.273c0-.703.57-1.272 1.273-1.272z",fill:"#4DBEE9"}),v().createElement("path",{d:"M36.518 65.628a1.272 1.272 0 00-2.545 0v3.393a1.272 1.272 0 102.545 0v-3.393zM31.852 62.234a1.272 1.272 0 10-2.545 0v6.787a1.272 1.272 0 102.545 0v-6.787z",fill:"#4DBEE9"}),v().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M44.577 60.962c.702 0 1.272.57 1.272 1.272v6.787a1.273 1.273 0 01-2.545 0v-6.787c0-.702.57-1.272 1.273-1.272z",fill:"#4DBEE9"}),v().createElement("path",{d:"M18.915 18.546a1.909 1.909 0 100-3.817 1.909 1.909 0 000 3.817z",fill:"#9C6CF0"}),v().createElement("path",{opacity:.5,d:"M34.185 18.546a1.909 1.909 0 100-3.817 1.909 1.909 0 000 3.817z",fill:"#4DBEE9"}),v().createElement("path",{opacity:.3,d:"M49.454 18.546a1.909 1.909 0 100-3.817 1.909 1.909 0 000 3.817z",fill:"#4DBEE9"}),v().createElement("path",{opacity:.8,d:"M26.55 18.546a1.909 1.909 0 100-3.817 1.909 1.909 0 000 3.817z",fill:"#FB6597"}),v().createElement("path",{d:"M41.82 18.546a1.909 1.909 0 100-3.817 1.909 1.909 0 000 3.817z",fill:"#4DBEE9"}),v().createElement("path",{opacity:.2,d:"M57.09 18.546a1.909 1.909 0 100-3.817 1.909 1.909 0 000 3.817z",fill:"#4DBEE9"}),v().createElement("path",{opacity:.5,fillRule:"evenodd",clipRule:"evenodd",d:"M16.582 19.818h4.666a.424.424 0 110 .849h-4.666a.424.424 0 110-.849zM31.851 19.818h4.666a.424.424 0 010 .849h-4.666a.424.424 0 110-.849zM47.121 19.818h4.666a.424.424 0 010 .849h-4.666a.424.424 0 010-.849zM24.217 19.818h4.665a.424.424 0 010 .849h-4.665a.424.424 0 010-.849zM39.486 19.818h4.666a.424.424 0 110 .849h-4.666a.424.424 0 110-.849zM54.756 19.818h4.666a.424.424 0 110 .849h-4.666a.424.424 0 110-.849z",fill:"#ACACAC"}),v().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.946 43.571h5.09a.636.636 0 110 1.273h-5.09a.636.636 0 010-1.273zM15.946 46.116h5.09a.636.636 0 010 1.273h-5.09a.636.636 0 010-1.273zM15.946 48.661h5.09a.636.636 0 010 1.273h-5.09a.636.636 0 110-1.273zM23.58 43.571h5.09a.636.636 0 110 1.273h-5.09a.636.636 0 010-1.273zM23.58 46.116h5.09a.636.636 0 010 1.273h-5.09a.636.636 0 010-1.273zM23.58 48.661h5.09a.636.636 0 010 1.273h-5.09a.636.636 0 110-1.273zM49.454 43.571h11.028a.636.636 0 010 1.273H49.454a.636.636 0 010-1.273zM49.454 46.116h11.028a.636.636 0 010 1.273H49.454a.636.636 0 010-1.273zM49.454 48.661h11.028a.636.636 0 010 1.273H49.454a.636.636 0 110-1.273zM31.215 43.571h15.27a.636.636 0 110 1.273h-15.27a.636.636 0 010-1.273zM31.215 46.116h15.27a.636.636 0 010 1.273h-15.27a.636.636 0 010-1.273zM31.215 48.661h15.27a.636.636 0 010 1.273h-15.27a.636.636 0 010-1.273zM15.946 51.206h5.09a.636.636 0 110 1.272h-5.09a.636.636 0 110-1.272zM23.58 51.206h5.09a.636.636 0 110 1.272h-5.09a.636.636 0 110-1.272zM49.454 51.206h11.028a.636.636 0 010 1.272H49.454a.636.636 0 110-1.272zM31.215 51.206h15.27a.636.636 0 110 1.272h-15.27a.636.636 0 010-1.272z",fill:"#E9E9E9"}),v().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M49.878 55.872h5.09a.636.636 0 110 1.273h-5.09a.636.636 0 110-1.273z",fill:"#ACACAC"}),v().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M49.878 59.69h11.029a.636.636 0 010 1.272H49.878a.636.636 0 110-1.273zM49.878 62.234h11.029a.636.636 0 010 1.273H49.878a.636.636 0 010-1.273zM49.878 64.78h11.029a.636.636 0 010 1.272H49.878a.636.636 0 010-1.273z",fill:"#E9E9E9"}),v().createElement("path",{d:"M54.968 67.324h-5.09a.636.636 0 000 1.273h5.09a.636.636 0 000-1.273z",fill:"#E9E9E9"}),v().createElement("g",{filter:"url(#Error_svg__filter0_d)"},v().createElement("path",{d:"M57.406 74.25c9.493 0 17.188-7.695 17.188-17.188 0-9.492-7.695-17.187-17.188-17.187-9.492 0-17.187 7.695-17.187 17.188 0 9.492 7.695 17.187 17.187 17.187z",fill:"#000"})),v().createElement("path",{d:"M57.406 74.25c9.493 0 17.188-7.695 17.188-17.188 0-9.492-7.695-17.187-17.188-17.187-9.492 0-17.187 7.695-17.187 17.188 0 9.492 7.695 17.187 17.187 17.187z",fill:"#F25252"}),v().createElement("path",{opacity:.15,fillRule:"evenodd",clipRule:"evenodd",d:"M57.406 34.719c12.34 0 22.344 10.003 22.344 22.343S69.746 79.406 57.406 79.406c-12.34 0-22.343-10.003-22.343-22.344 0-12.34 10.003-22.343 22.343-22.343zm-.172 2.406c-10.916 0-19.765 8.85-19.765 19.766 0 10.916 8.85 19.765 19.765 19.765C68.151 76.656 77 67.806 77 56.891c0-10.917-8.85-19.766-19.766-19.766z",fill:"#F25252"}),v().createElement("path",{opacity:.3,fillRule:"evenodd",clipRule:"evenodd",d:"M57.406 38.844c10.062 0 18.219 8.157 18.219 18.218 0 10.062-8.157 18.22-18.219 18.22-10.062 0-18.218-8.158-18.218-18.22 0-10.061 8.156-18.218 18.218-18.218zm0 2.043c-8.933 0-16.175 7.242-16.175 16.175 0 8.934 7.242 16.176 16.175 16.176 8.934 0 16.176-7.242 16.176-16.175 0-8.934-7.242-16.176-16.176-16.176z",fill:"#F25252"}),v().createElement("path",{opacity:.05,fillRule:"evenodd",clipRule:"evenodd",d:"M57.406 26.469C74.303 26.469 88 40.166 88 57.062c0 16.897-13.697 30.594-30.594 30.594-16.896 0-30.593-13.697-30.593-30.594 0-16.896 13.697-30.593 30.593-30.593zm-.172 3.437c-14.903 0-26.984 12.082-26.984 26.985 0 14.903 12.081 26.984 26.984 26.984 14.903 0 26.985-12.081 26.985-26.984 0-14.903-12.082-26.985-26.985-26.985z",fill:"#F25252"}),v().createElement("path",{d:"M57.406 71.844c8.164 0 14.782-6.618 14.782-14.781 0-8.164-6.618-14.782-14.782-14.782-8.163 0-14.781 6.618-14.781 14.782 0 8.163 6.618 14.78 14.781 14.78z",fill:"#FF6A6A"}),v().createElement("path",{opacity:.05,fillRule:"evenodd",clipRule:"evenodd",d:"M58.298 46.448L75.18 63.331l-9.114 12.078h-2.029l-7.582-7.582 1.006-3.178.837-18.2z",fill:"url(#Error_svg__paint0_linear)"}),v().createElement("g",{filter:"url(#Error_svg__filter1_d)"},v().createElement("path",{d:"M57.406 68.063a1.719 1.719 0 100-3.438 1.719 1.719 0 000 3.438z",fill:"#000"})),v().createElement("path",{d:"M57.406 68.063a1.719 1.719 0 100-3.438 1.719 1.719 0 000 3.438z",fill:"#fff"}),v().createElement("g",{filter:"url(#Error_svg__filter2_d)"},v().createElement("path",{d:"M57.406 46.063c.95 0 1.719.769 1.719 1.718v12.375a1.719 1.719 0 11-3.438 0V47.781c0-.949.77-1.718 1.72-1.718z",fill:"#000"})),v().createElement("path",{d:"M57.406 46.063c.95 0 1.719.769 1.719 1.718v12.375a1.719 1.719 0 11-3.438 0V47.781c0-.949.77-1.718 1.72-1.718z",fill:"#fff"})),v().createElement("defs",null,v().createElement("filter",{id:"Error_svg__filter0_d",x:36.219,y:37.875,width:42.375,height:42.375,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},v().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),v().createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),v().createElement("feOffset",{dy:2}),v().createElement("feGaussianBlur",{stdDeviation:2}),v().createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0"}),v().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),v().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})),v().createElement("filter",{id:"Error_svg__filter1_d",x:51.688,y:62.625,width:11.438,height:11.438,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},v().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),v().createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),v().createElement("feOffset",{dy:2}),v().createElement("feGaussianBlur",{stdDeviation:2}),v().createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0"}),v().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),v().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})),v().createElement("filter",{id:"Error_svg__filter2_d",x:51.688,y:44.063,width:11.438,height:23.813,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},v().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),v().createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),v().createElement("feOffset",{dy:2}),v().createElement("feGaussianBlur",{stdDeviation:2}),v().createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0"}),v().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),v().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})),v().createElement("linearGradient",{id:"Error_svg__paint0_linear",x1:68.438,y1:71.571,x2:60.119,y2:58.801,gradientUnits:"userSpaceOnUse"},v().createElement("stop",{stopOpacity:0}),v().createElement("stop",{offset:1})))),LOADING:e=>v().createElement("svg",NE({width:256,height:256,viewBox:"0 0 256 256",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgEmptyLoading"},e),v().createElement("circle",{cx:128,cy:128,r:128,fill:"#0072CE",fillOpacity:.03}),v().createElement("mask",{id:"EmptyLoading_svg__a",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:0,y:0,width:256,height:256},v().createElement("circle",{cx:128,cy:128,r:128,fill:"#fff"})),v().createElement("g",{mask:"url(#EmptyLoading_svg__a)"},v().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M-16 9h256v247H-16V9z",fill:"url(#EmptyLoading_svg__paint0_linear_2978_41880)"}),v().createElement("g",{fillRule:"evenodd",clipRule:"evenodd"},v().createElement("path",{d:"M40.755 44.17C40.755 38.002 45.76 33 51.92 33h251.675c6.167 0 11.166 5.001 11.166 11.17v160.596H40.755V44.171z",fill:"#5E7282"}),v().createElement("path",{d:"M50.371 43.106h255.685V195.71H50.371V43.106z",fill:"url(#EmptyLoading_svg__paint1_linear_2978_41880)"}),v().createElement("path",{d:"M15.545 208.914c2.321.469 4.723.716 7.183.716H338.75c.22 0 .439-.002.658-.006-7.061 8.445-17.67 13.816-29.524 13.816H45.655c-12.111 0-22.916-5.597-29.968-14.349l-.142-.177z",fill:"#BDCBD8"}),v().createElement("path",{d:"M339.015 204.883v4.966H15v-4.966h324.015z",fill:"#D4DCDF"}),v().createElement("path",{d:"M201.107 213.991h-45.221a11.176 11.176 0 01-11.046-9.449h67.314a11.172 11.172 0 01-11.047 9.449z",fill:"url(#EmptyLoading_svg__paint2_linear_2978_41880)"})),v().createElement("g",{filter:"url(#EmptyLoading_svg__filter0_d_2978_41880)"},v().createElement("rect",{x:81.703,y:99,width:170,height:26,rx:8,fill:"#D1E6FF"}),v().createElement("rect",{x:84.703,y:102,width:164,height:20,rx:5,stroke:"#fff",strokeWidth:6})),v().createElement("g",{filter:"url(#EmptyLoading_svg__filter1_d_2978_41880)"},v().createElement("mask",{id:"EmptyLoading_svg__b",fill:"#fff"},v().createElement("rect",{x:81,y:105,width:108,height:14,rx:2})),v().createElement("rect",{x:81,y:105,width:108,height:14,rx:2,fill:"#61A3F1"}),v().createElement("rect",{x:81,y:105,width:108,height:14,rx:2,stroke:"#4A90E2",strokeWidth:8,mask:"url(#EmptyLoading_svg__b)"})),v().createElement("path",{opacity:.8,fillRule:"evenodd",clipRule:"evenodd",d:"M122.703 74a3 3 0 013-3h81.625a3 3 0 010 6h-81.625a3 3 0 01-3-3z",fill:"#B6C7DB"}),v().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M146.703 86a3 3 0 013-3h34a3 3 0 110 6h-34a3 3 0 01-3-3zM136.703 139a3 3 0 013-3h54a3 3 0 110 6h-54a3 3 0 01-3-3z",fill:"#979797"}),v().createElement("path",{opacity:.1,fillRule:"evenodd",clipRule:"evenodd",d:"M112.703 151a3 3 0 013-3h103a3 3 0 110 6h-103a3 3 0 01-3-3zM124.703 163a3 3 0 013-3h79a3 3 0 110 6h-79a3 3 0 01-3-3z",fill:"#979797"}),v().createElement("g",{filter:"url(#EmptyLoading_svg__filter2_ddd_2978_41880)"},v().createElement("path",{fill:"#A0C1D7",d:"M70.703 64h11v8h-11z"}),v().createElement("rect",{x:62,y:59,width:28,height:8,rx:1,fill:"#BDD4E3"}),v().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M38.23 160.5c20.704 20.703 54.27 20.703 74.973 0 20.703-20.703 20.703-54.27 0-74.973-20.703-20.703-54.27-20.703-74.973 0-20.703 20.703-20.703 54.27 0 74.973z",fill:"#BDD4E3"}),v().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M113.427 85.988c20.463 20.652 20.404 53.981-.175 74.561-20.432 20.431-53.432 20.635-74.115.613l-.446-.439 74.736-74.735z",fill:"#A0C1D7"}),v().createElement("path",{opacity:.144,fillRule:"evenodd",clipRule:"evenodd",d:"M75.037 175.385c29.402 0 53.236-23.834 53.236-53.236a54.67 54.67 0 00-.106-3.399L100.45 91.037l-55.142 58.396 25.814 25.811c1.293.094 2.598.141 3.915.141z",fill:"url(#EmptyLoading_svg__paint3_linear_2978_41880)"}),v().createElement("circle",{cx:75.94,cy:123.237,r:44.723,fill:"#91B0C2"}),v().createElement("g",{filter:"url(#EmptyLoading_svg__filter3_d_2978_41880)"},v().createElement("circle",{r:42.793,transform:"matrix(-1 0 0 1 75.94 123.237)",fill:"#F7F4FF"})),v().createElement("path",{opacity:.05,fillRule:"evenodd",clipRule:"evenodd",d:"M105.043 175.309l-10.298.861-20.313-20.152.863-2.292-9.973-9.982 18.679-6.882h-4.308l-8.943-8.951 4.545-10.532L94.35 90.74l37.888 37.162c-.343 20.088-11.146 37.627-27.195 47.407z",fill:"url(#EmptyLoading_svg__paint4_linear_2978_41880)"}),v().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M67.703 123a8 8 0 0112.362-6.707l14.477-25.145A36.828 36.828 0 0075.703 86c-20.434 0-37 16.565-37 37h29z",fill:"url(#EmptyLoading_svg__paint5_angular_2978_41880)"}),v().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M94.297 90.6l.24.138s-12.45 35.125-12.811 35.752a6.92 6.92 0 01-11.985-6.92c.361-.626 24.556-28.97 24.556-28.97z",fill:"#323232"}),v().createElement("circle",{cx:75.94,cy:123.237,r:2.896,fill:"#EEEBF6"}),v().createElement("circle",{cx:96.211,cy:148.655,r:2.574,fill:"#A0C3D7"}),v().createElement("circle",{cx:107.15,cy:131.924,r:2.574,fill:"#A0C3D7"}),v().createElement("rect",{x:62.427,y:135.592,width:27.027,height:10.039,rx:3,fill:"#A0C3D7"}),v().createElement("path",{opacity:.05,fillRule:"evenodd",clipRule:"evenodd",d:"M85.914 170.534H75.112l-21.605-21.472 2.126-2.775v-1.01L42.8 132.523l2.853-2.529 40.261 40.54z",fill:"url(#EmptyLoading_svg__paint6_linear_2978_41880)"}),v().createElement("path",{opacity:.02,fillRule:"evenodd",clipRule:"evenodd",d:"M96.362 136.555h-4.988l-38.126-38.01 2.853-2.53 40.261 40.54z",fill:"url(#EmptyLoading_svg__paint7_linear_2978_41880)"}),v().createElement("path",{opacity:.02,fillRule:"evenodd",clipRule:"evenodd",d:"M116.746 129.006h-4.988L73.632 90.995l2.853-2.53 40.261 40.541z",fill:"url(#EmptyLoading_svg__paint8_linear_2978_41880)"}),v().createElement("path",{opacity:.02,fillRule:"evenodd",clipRule:"evenodd",d:"M85.793 152.41h-4.988l-38.126-38.011 2.852-2.53 40.262 40.541z",fill:"url(#EmptyLoading_svg__paint9_linear_2978_41880)"}),v().createElement("circle",{cx:75.618,cy:155.734,r:2.574,fill:"#A0C3D7"}),v().createElement("circle",{cx:55.026,cy:148.655,r:2.574,fill:"#A0C3D7"}),v().createElement("circle",{cx:44.73,cy:131.924,r:2.574,fill:"#A0C3D7"}),v().createElement("g",{fill:"#A0C3D7"},v().createElement("circle",{r:2.574,transform:"matrix(1 0 0 -1 96.21 97.363)"}),v().createElement("circle",{r:2.574,transform:"matrix(1 0 0 -1 107.149 114.094)"}),v().createElement("circle",{r:2.574,transform:"matrix(1 0 0 -1 75.618 90.284)"}),v().createElement("circle",{r:2.574,transform:"matrix(1 0 0 -1 55.026 97.363)"}),v().createElement("circle",{r:2.574,transform:"matrix(1 0 0 -1 44.73 114.094)"})))),v().createElement("defs",null,v().createElement("linearGradient",{id:"EmptyLoading_svg__paint0_linear_2978_41880",x1:-16,y1:9,x2:-16,y2:256,gradientUnits:"userSpaceOnUse"},v().createElement("stop",{stopColor:"#FAFAFA",stopOpacity:.01}),v().createElement("stop",{offset:1,stopColor:"#F4F4F4"})),v().createElement("linearGradient",{id:"EmptyLoading_svg__paint1_linear_2978_41880",x1:178.214,y1:43.106,x2:178.214,y2:195.709,gradientUnits:"userSpaceOnUse"},v().createElement("stop",{stopColor:"#F2F9FB"}),v().createElement("stop",{offset:1,stopColor:"#fff"})),v().createElement("linearGradient",{id:"EmptyLoading_svg__paint2_linear_2978_41880",x1:178.497,y1:204.542,x2:178.497,y2:213.991,gradientUnits:"userSpaceOnUse"},v().createElement("stop",{stopColor:"#90AABF"}),v().createElement("stop",{offset:1,stopColor:"#869DAE"})),v().createElement("linearGradient",{id:"EmptyLoading_svg__paint3_linear_2978_41880",x1:154.275,y1:146.574,x2:96.683,y2:91.352,gradientUnits:"userSpaceOnUse"},v().createElement("stop",{stopOpacity:.01}),v().createElement("stop",{offset:1})),v().createElement("linearGradient",{id:"EmptyLoading_svg__paint4_linear_2978_41880",x1:60.762,y1:143.327,x2:114.747,y2:176.019,gradientUnits:"userSpaceOnUse"},v().createElement("stop",{stopOpacity:.87}),v().createElement("stop",{offset:1,stopOpacity:.01})),v().createElement("linearGradient",{id:"EmptyLoading_svg__paint6_linear_2978_41880",x1:90.287,y1:154.267,x2:68.53,y2:131.301,gradientUnits:"userSpaceOnUse"},v().createElement("stop",{stopOpacity:.01}),v().createElement("stop",{offset:1})),v().createElement("linearGradient",{id:"EmptyLoading_svg__paint7_linear_2978_41880",x1:100.735,y1:120.288,x2:78.978,y2:97.322,gradientUnits:"userSpaceOnUse"},v().createElement("stop",{stopOpacity:.01}),v().createElement("stop",{offset:1})),v().createElement("linearGradient",{id:"EmptyLoading_svg__paint8_linear_2978_41880",x1:121.119,y1:112.739,x2:99.362,y2:89.773,gradientUnits:"userSpaceOnUse"},v().createElement("stop",{stopOpacity:.01}),v().createElement("stop",{offset:1})),v().createElement("linearGradient",{id:"EmptyLoading_svg__paint9_linear_2978_41880",x1:90.166,y1:136.143,x2:68.409,y2:113.177,gradientUnits:"userSpaceOnUse"},v().createElement("stop",{stopOpacity:.01}),v().createElement("stop",{offset:1})),v().createElement("filter",{id:"EmptyLoading_svg__filter0_d_2978_41880",x:77.703,y:96,width:178,height:34,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},v().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),v().createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),v().createElement("feOffset",{dy:1}),v().createElement("feGaussianBlur",{stdDeviation:2}),v().createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.06 0"}),v().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_2978_41880"}),v().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_2978_41880",result:"shape"})),v().createElement("filter",{id:"EmptyLoading_svg__filter1_d_2978_41880",x:77,y:102,width:116,height:22,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},v().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),v().createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),v().createElement("feOffset",{dy:1}),v().createElement("feGaussianBlur",{stdDeviation:2}),v().createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.06 0"}),v().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_2978_41880"}),v().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_2978_41880",result:"shape"})),v().createElement("filter",{id:"EmptyLoading_svg__filter2_ddd_2978_41880",x:-13.297,y:28,width:181.534,height:189.17,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},v().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),v().createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),v().createElement("feMorphology",{radius:4,operator:"erode",in:"SourceAlpha",result:"effect1_dropShadow_2978_41880"}),v().createElement("feOffset",{dy:7}),v().createElement("feGaussianBlur",{stdDeviation:4}),v().createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0.600156 0 0 0 0 0.745337 0 0 0 0 0.8625 0 0 0 0.1 0"}),v().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_2978_41880"}),v().createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),v().createElement("feMorphology",{radius:4,operator:"dilate",in:"SourceAlpha",result:"effect2_dropShadow_2978_41880"}),v().createElement("feOffset",{dy:5}),v().createElement("feGaussianBlur",{stdDeviation:16}),v().createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0.447059 0 0 0 0 0.807843 0 0 0 0.06 0"}),v().createElement("feBlend",{mode:"normal",in2:"effect1_dropShadow_2978_41880",result:"effect2_dropShadow_2978_41880"}),v().createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),v().createElement("feMorphology",{radius:2,operator:"dilate",in:"SourceAlpha",result:"effect3_dropShadow_2978_41880"}),v().createElement("feOffset",{dy:12}),v().createElement("feGaussianBlur",{stdDeviation:8.5}),v().createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0.447059 0 0 0 0 0.807843 0 0 0 0.06 0"}),v().createElement("feBlend",{mode:"normal",in2:"effect2_dropShadow_2978_41880",result:"effect3_dropShadow_2978_41880"}),v().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect3_dropShadow_2978_41880",result:"shape"})),v().createElement("filter",{id:"EmptyLoading_svg__filter3_d_2978_41880",x:29.148,y:78.444,width:93.585,height:93.585,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},v().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),v().createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),v().createElement("feOffset",{dy:2}),v().createElement("feGaussianBlur",{stdDeviation:2}),v().createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0"}),v().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_2978_41880"}),v().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_2978_41880",result:"shape"})),v().createElement("radialGradient",{id:"EmptyLoading_svg__paint5_angular_2978_41880",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"rotate(-56.035 152.55 -12.515) scale(43.4058 65.5062)"},v().createElement("stop",{stopColor:"#CFE8FF"}),v().createElement("stop",{offset:.599,stopColor:"#D1F2F9",stopOpacity:0}))))},kE=e=>{let{variant:t=DE.full,LogoRenderer:r=PE.SEARCH_RESULTS,text:n,secondaryText:a,buttonTitle:i,onClick:o=_.identity,access:l}=e;const s=IE(),c=l&&i;return v().createElement("div",{className:O()(s.root,s[`root_${t}`])},v().createElement(r,{className:s[`${t}`]}),v().createElement("div",{className:s.textBox},v().createElement(Ag(),{variant:"h5",classes:{h5:s.text}},n),a&&v().createElement(Ag(),{variant:"subtitle1",classes:{subtitle1:s.secondaryText}},a)),c&&v().createElement(nE(),{className:s.button,variant:"contained",color:"primary",onClick:o},i))};var LE=r(15503);class UE extends v().Component{constructor(e){super(e),this.state={error:null}}componentDidCatch(e){this.setState({error:e}),console.error(e)}render(){const{children:e,error:t}=this.props;return this.state.error?t:e}}const jE=(0,kp.Z)({container:{flexGrow:1,display:"flex",flexDirection:"column",position:"relative",overflow:"hidden","& .Resizer.disabled":{display:"none"}},pagination:{flexGrow:0,height:"52px"},listContainer:{overflowY:"auto"},tableContainer:{display:"flex",flexDirection:"column",height:"100%"},resizablePanesWrapper:{flexGrow:1,height:0},pane:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",flexDirection:"column",overflow:"hidden"}});var FE=r(46089),ME=r.n(FE);const VE=(0,kp.Z)((e=>({button:{"&.MuiButtonGroup-grouped":{minWidth:"30px",padding:"8px 8px",justifyContent:"start",fill:"rgba(0,0,0,0.54)",textTransform:"none",color:"rgba(0,0,0,0.87)",borderColor:"rgba(0,0,0,0.12)","&:hover":{backgroundColor:"rgba(0, 0, 0, 0.04)"},"&:not(:last-of-type):hover":{borderRightColor:"transparent"},"&$current":{"& $icon":{color:e.palette.primary.main},backgroundColor:(0,Lm.alpha)(e.palette.primary.main,.12),fill:e.palette.primary.main,color:e.palette.primary.main,"&:hover":{backgroundColor:(0,Lm.alpha)(e.palette.primary.main,.24),borderRightColor:"transparent"}}}},icon:{color:"rgba(0,0,0,0.54)",width:"20px",height:"20px","& + $title":{marginLeft:"8px"}},title:{fontSize:"13px",lineHeight:"15px",letterSpacing:0},current:{}}))),BE=(0,yd.T)(nE()),zE=e=>{let{className:t,classes:r={},modes:n=[],modeId:a,onChange:i}=e;const o=VE();return v().createElement(ME(),{className:t},n.map((e=>{let{id:t,title:n,tooltipTitle:l,Icon:s,disabled:c}=e;return v().createElement(BE,{disabled:c,showForDisabled:c&&!!l,key:String(t),className:O()(o.button,{[o.current]:a===t},r.button),tooltipTitle:l,onClick:(u=t,()=>i(u)),"data-reltio-id":`reltio-search-mode-${t}`},s&&v().createElement(s,{className:o.icon}),n&&v().createElement("div",{className:o.title},n));var u})))},HE=(0,kp.Z)((()=>({button:{"&.MuiButtonGroup-grouped":{minWidth:"90px",padding:"8px 12px"}}})));function YE(){return YE=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},YE.apply(this,arguments)}const WE=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",YE({width:"25",height:"24",viewBox:"0 0 25 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},r),v().createElement("defs",null,v().createElement("path",{d:"M19 4H5c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zM7 18H5v-8h2v8zM7 8H5V6h2v2zm6 10H9v-8h4v8zm0-10H9V6h4v2zm6 10h-4v-8h4v8zm0-10h-4V6h4v2z",id:"svg3365802068a"})),v().createElement("g",{stroke:"none",strokeWidth:"1"},v().createElement("g",{transform:"translate(.2)"},v().createElement("mask",{id:"svg3365802068b",fill:"#fff"},v().createElement("use",{xlinkHref:"#svg3365802068a"})),v().createElement("g",{mask:"url(#svg3365802068b)"},v().createElement("g",null,v().createElement("g",null,v().createElement("path",{d:"M0 0h24v24H0z"})))))))};function GE(){return GE=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},GE.apply(this,arguments)}const qE=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",GE({width:"25",height:"24",viewBox:"0 0 25 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},r),v().createElement("defs",null,v().createElement("path",{d:"M20 15.5v3H9v-3h11zm-14 0a1 1 0 011 1v1a1 1 0 01-1 1H5a1 1 0 01-1-1v-1a1 1 0 011-1h1zm14-5v3H9v-3h11zm-14 0a1 1 0 011 1v1a1 1 0 01-1 1H5a1 1 0 01-1-1v-1a1 1 0 011-1h1zm14-5v3H9v-3h11zm-14 0a1 1 0 011 1v1a1 1 0 01-1 1H5a1 1 0 01-1-1v-1a1 1 0 011-1h1z",id:"svg4195527304a"})),v().createElement("g",{stroke:"none",strokeWidth:"1"},v().createElement("g",{transform:"translate(.2)"},v().createElement("mask",{id:"svg4195527304b",fill:"#fff"},v().createElement("use",{xlinkHref:"#svg4195527304a"})),v().createElement("g",{mask:"url(#svg4195527304b)"},v().createElement("path",{d:"M0 0h24v24H0z"})))))},ZE=e=>{switch(e){case K.ll.TABLE:return WE;case K.ll.LIST:return qE;default:return lE()}},$E=[{id:K.ll.TABLE,tooltipTitle:mi().text("Table view"),title:mi().text("Table"),Icon:ZE(K.ll.TABLE)},{id:K.ll.LIST,tooltipTitle:mi().text("List view"),title:mi().text("List"),Icon:ZE(K.ll.LIST)}],KE=e=>{let{className:t}=e;const r=HE(),n=(0,Tp.useDispatch)(),a=(0,Tp.useSelector)(ki.XM);return v().createElement(zE,{className:t,classes:{button:r.button},modes:$E,modeId:a,onChange:e=>{a!==e&&n((e=>({type:Ne,payload:e}))(e))}})};KE.propTypes={className:vp().string};const XE=KE;var QE=r(81085),JE=r.n(QE),eb=r(48139),tb=r.n(eb);const rb="DATA_TENANTS_UPDATED",nb=e=>t=>({type:e,payload:t}),ab=(nb(rb),null),ib=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ab,t=arguments.length>1?arguments[1]:void 0;return t.type===rb?t.payload||ab:e},ob="TENANTS_UPDATED",lb=(nb(ob),null),sb=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:lb,t=arguments.length>1?arguments[1]:void 0;return t.type===ob?t.payload||lb:e},cb="METADATA_LOADED";let ub=function(e){return e.OPEN_ENTITY="OPEN_ENTITY",e.NEW_ENTITY_SHOWN="NEW_ENTITY_SHOWN",e.ENTITY_DELETION_FINISHED="ENTITY_DELETION_FINISHED",e.OPEN_PERSPECTIVE="OPEN_PERSPECTIVE",e.UI_CONFIG_LOADED="UI_CONFIG_LOADED",e.NEW_UI_CONFIG_LOADED="NEW_UI_CONFIG_LOADED",e.PATHS_SET="PATHS_SET",e.UI_PATH_SET="UI_PATH_SET",e.LOCALIZATION_LOADED="LOCALIZATION_LOADED",e.LOCALE_ATTRIBUTE_PRESENTATION_LOADED="LOCALE_ATTRIBUTE_PRESENTATION_LOADED",e.AUTOCLOSE_INTERVAL_LOADED="AUTOCLOSE_INTERVAL_LOADED",e.SET_PREFER_REACT="SET_PREFER_REACT",e.OPEN_CONSOLE_APP="OPEN_CONSOLE_APP",e.OPEN_APP_FROM_CHOCOLATE_BAR="OPEN_APP_FROM_CHOCOLATE_BAR",e.NUMBER_FORMAT_UPDATED="NUMBER_FORMAT_UPDATED",e.OPEN_GRAPH="OPEN_GRAPH",e.DATE_MASK_UPDATED="DATE_MASK_UPDATED",e.DATE_TIME_MASK_UPDATED="DATE_TIME_MASK_UPDATED",e.OPEN_SEARCH="OPEN_SEARCH",e.OPEN_DASHBOARD="OPEN_DASHBOARD",e.OPEN_HISTORY_EVENT="OPEN_HISTORY_EVENT",e.KEYS_SET="KEYS_SET",e.OPEN_PIVOTING_PERSPECTIVE="OPEN_PIVOTING_PERSPECTIVE",e.ERROR_SET="ERROR_SET",e.SHOW_NOTIFICATION="SHOW_NOTIFICATION",e.CLOSE_NOTIFICATION="CLOSE_NOTIFICATION",e.CLEAR_NOTIFICATIONS="CLEAR_NOTIFICATIONS",e.DOCUMENTATION_SET="DOCUMENTATION_SET",e.OPEN_NEW_ENTITY_WITH_AUTHORING="OPEN_NEW_ENTITY_WITH_AUTHORING",e.OPEN_PREVIOUS_PAGE="OPEN_PREVIOUS_PAGE",e.NAVIGATE="NAVIGATE",e.ADD_DASHBOARD_EXTERNAL_VIEW="ADD_DASHBOARD_EXTERNAL_VIEW",e.SET_USE_SHARED_PREFERENCES="SET_USE_SHARED_PREFERENCES",e}({});function pb(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){db(e,t,r[t])}))}return e}function db(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const mb={},gb=(0,_.pipe)(x.normalizeMetadata,x.parseMetadata,x.localizeMetadata),yb=(0,_.map)(x.localizeMetadata),fb=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:mb,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case cb:{const{tenant:r,metadata:n}=t.payload;return pb({},e,{[r]:gb(n)})}case ub.LOCALIZATION_LOADED:return yb(e);default:return e}};let hb=function(e){return e.ADD_ATTRIBUTES="ADD_ATTRIBUTES",e.MODIFY_ATTRIBUTE="MODIFY_ATTRIBUTE",e.REMOVE_ATTRIBUTE="REMOVE_ATTRIBUTE",e.REQUEST_NEXT_PAGE_ATTRIBUTE_VALUES="REQUEST_NEXT_PAGE_ATTRIBUTE_VALUES",e.ADD_NEXT_PAGE_ATTRIBUTE_VALUES="ADD_NEXT_PAGE_ATTRIBUTE_VALUES",e.PROCESS_NEXT_PAGE_ATTRIBUTE_VALUES="PROCESS_NEXT_PAGE_ATTRIBUTE_VALUES",e.ADD_DEFAULT_VALUES="ADD_DEFAULT_VALUES",e.SAVE_PROFILE="SAVE_PROFILE",e.SAVE_DRAFT="SAVE_DRAFT",e.VALIDATE_PROFILE="VALIDATE_PROFILE",e.PROFILE_SAVED="PROFILE_SAVED",e.RUN_AUTHORING_TASK_ACTION="RUN_AUTHORING_TASK_ACTION",e}({});const Eb=nb(hb.ADD_ATTRIBUTES),bb=nb(hb.ADD_DEFAULT_VALUES),vb=nb(hb.MODIFY_ATTRIBUTE),Tb=nb(hb.REMOVE_ATTRIBUTE),Ob=nb(hb.ADD_NEXT_PAGE_ATTRIBUTE_VALUES),xb=nb(hb.PROCESS_NEXT_PAGE_ATTRIBUTE_VALUES),Cb=nb(hb.REQUEST_NEXT_PAGE_ATTRIBUTE_VALUES),Sb=nb(hb.SAVE_PROFILE),wb=nb(hb.RUN_AUTHORING_TASK_ACTION),Ab=nb(hb.SAVE_DRAFT),Rb=nb(hb.PROFILE_SAVED),_b=nb(hb.VALIDATE_PROFILE);let Ib=function(e){return e.DEPENDENT_LOOKUPS_STRUCTURE_SET="DEPENDENT_LOOKUPS_STRUCTURE_SET",e.DEPENDENT_LOOKUPS_INITED_TYPE_URIS_ADDED="DEPENDENT_LOOKUPS_INITED_TYPE_URIS_ADDED",e.DEPENDENT_LOOKUPS_EDITORS_BLOCKED="DEPENDENT_LOOKUPS_EDITORS_BLOCKED",e.DEPENDENT_LOOKUPS_EDITOR_TOUCHED="DEPENDENT_LOOKUPS_EDITOR_TOUCHED",e}({});const Nb=nb(Ib.DEPENDENT_LOOKUPS_STRUCTURE_SET),Db=nb(Ib.DEPENDENT_LOOKUPS_INITED_TYPE_URIS_ADDED),Pb=nb(Ib.DEPENDENT_LOOKUPS_EDITORS_BLOCKED),kb=nb(Ib.DEPENDENT_LOOKUPS_EDITOR_TOUCHED);let Lb=function(e){return e.MODE_UPDATED="MODE_UPDATED",e.MODE_EDITING_CANCELED="MODE_EDITING_CANCELED",e.MODE_UPDATE_REQUESTED="MODE_UPDATE_REQUESTED",e}({});function Ub(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){jb(e,t,r[t])}))}return e}function jb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Fb={structure:{},editors:{},initedTypeUris:[]},Mb="SEARCH_RESULTS_SET",Vb="KEYWORD_UPDATED",Bb="UPDATE_STATE",zb="ACTIVITY_FILTER_UPDATED",Hb="GLOBAL_FILTER_UPDATED",Yb="SEARCH_OPTIONS_UPDATED",Wb="SET_SEARCH_OPTIONS_CONFIG",Gb="SET_SEARCH_PROVIDER_DATA",qb="SET_SEARCH_NAVIGATION_DATA",Zb="UPDATE_SEARCH_NAVIGATION_DATA_FIELDS",$b=nb(Mb),Kb=nb(Vb),Xb=nb(Bb),Qb=nb("SAVE_STATE"),Jb=nb(zb),ev=nb(Hb),tv=nb(Yb),rv=nb(Wb),nv=nb(Gb),av=nb(qb),iv=nb(Zb),ov=nb("UPDATE_SEARCH_NAVIGATION_DATA_ON_MERGE"),lv=(0,_.path)(["globalFilter","savedSearchesUris"]),sv="searchNavigation";function*cv(){const e=yield(0,Va.Ys)(xI.selectors.getSearchNavigationData),t=yield(0,Va.Ys)(xI.selectors.getSearchProviderData);sessionStorage.setItem(sv,JSON.stringify({searchNavigationData:e,searchProviderData:t}))}function*uv(){let e;try{e=JSON.parse(sessionStorage.getItem(sv))||{}}catch(t){e={}}const{searchNavigationData:t,searchProviderData:r}=e;t&&r&&(yield(0,Va.gz)(nv(r)),yield(0,Va.gz)(av(t)))}const pv=[function*(){yield(0,Va.Fm)([qb,Zb,ub.OPEN_ENTITY],cv)},function*(){yield(0,Va.RE)(uv)}];function dv(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){mv(e,t,r[t])}))}return e}function mv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const gv={searchResults:[],keyword:null,searchOptions:{searchByOv:!1,ovOnly:!1},activityFilter:"active",globalFilter:{query:null,savedSearchesUris:[],isMuted:!0},searchProviderData:null,searchNavigationData:null},yv=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:gv,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Mb:return dv({},e,{searchResults:t.payload});case Vb:{const r=(0,_.pick)(["value","isRawFilter"],t.payload||{});return dv({},e,{keyword:(0,_.isEmpty)(r)?null:r})}case Bb:return dv({},gv,{keyword:(0,_.isNil)(t.payload.keyword)||(0,_.isEmpty)(t.payload.keyword)?null:t.payload.keyword,searchOptions:t.payload.searchOptions||e.searchOptions,activityFilter:e.activityFilter,globalFilter:e.globalFilter,searchNavigationData:e.searchNavigationData,searchProviderData:e.searchProviderData});case zb:return dv({},e,{activityFilter:t.payload});case Hb:return dv({},e,{globalFilter:(0,x.isEmptyValue)(t.payload)?gv.globalFilter:t.payload});case Yb:return dv({},e,{searchOptions:dv({},e.searchOptions,t.payload)});case Wb:{const r=!!t.payload.showSearchByOv;return dv({},e,{searchOptions:{searchByOv:r,ovOnly:r}})}case Gb:return dv({},e,{searchProviderData:t.payload});case qb:return dv({},e,{searchNavigationData:t.payload});case Zb:return dv({},e,{searchNavigationData:dv({},e.searchNavigationData,t.payload)});case ub.OPEN_ENTITY:{var r;const n=(0,x.removeDtssPrefixFromEntityUri)(t.payload.uri);return"navigation"===t.payload.source||n===(null===(r=e.searchNavigationData)||void 0===r?void 0:r.uri)?e:dv({},e,{searchNavigationData:null})}default:return e}},fv=e=>{let{uri:t,source:r=null,screen:n="profile"}=e;return{type:ub.OPEN_ENTITY,payload:{uri:t,source:r,screen:n}}},hv=e=>{let{entity:t}=e;return{type:ub.NEW_ENTITY_SHOWN,payload:{entity:t}}},Ev=nb(ub.ENTITY_DELETION_FINISHED),bv=nb(ub.OPEN_PERSPECTIVE),vv=e=>({type:ub.SHOW_NOTIFICATION,payload:e}),Tv=e=>({type:ub.CLOSE_NOTIFICATION,payload:e}),Ov=nb(ub.CLEAR_NOTIFICATIONS),xv=nb(ub.PATHS_SET),Cv=nb(ub.UI_PATH_SET),Sv=nb(ub.UI_CONFIG_LOADED),wv=nb(ub.NEW_UI_CONFIG_LOADED),Av=nb(ub.LOCALE_ATTRIBUTE_PRESENTATION_LOADED),Rv=nb(ub.AUTOCLOSE_INTERVAL_LOADED),_v=nb(ub.SET_PREFER_REACT),Iv=nb(ub.NUMBER_FORMAT_UPDATED),Nv=(e,t,r)=>({type:ub.OPEN_CONSOLE_APP,payload:{name:e,path:t,query:r}}),Dv=nb(ub.OPEN_APP_FROM_CHOCOLATE_BAR),Pv=nb(ub.OPEN_GRAPH),kv=nb(ub.LOCALIZATION_LOADED),Lv=nb(ub.DATE_MASK_UPDATED),Uv=nb(ub.DATE_TIME_MASK_UPDATED),jv=e=>({type:ub.OPEN_SEARCH,payload:"searchState"in e?e:{searchState:e}}),Fv=e=>({type:ub.OPEN_DASHBOARD,payload:e}),Mv=nb(ub.OPEN_HISTORY_EVENT),Vv=nb(ub.OPEN_NEW_ENTITY_WITH_AUTHORING),Bv=nb(ub.OPEN_PREVIOUS_PAGE),zv=nb(ub.NAVIGATE),Hv=nb(ub.KEYS_SET),Yv=nb(ub.OPEN_PIVOTING_PERSPECTIVE),Wv=nb(ub.ERROR_SET),Gv=nb(ub.DOCUMENTATION_SET),qv=nb(ub.ADD_DASHBOARD_EXTERNAL_VIEW),Zv=nb(ub.SET_USE_SHARED_PREFERENCES);function $v(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Kv(e,t,r[t])}))}return e}function Kv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Xv=(0,_.path)(["paths","imagePath"]),Qv=(0,_.path)(["paths","exportPath"]),Jv=(0,_.path)(["paths","apiPath"]),eT=(0,_.path)(["paths","uiPath"]),tT=(0,_.path)(["paths","reltioPath"]),rT=(0,_.path)(["paths","dtssPath"]),nT=(0,_.path)(["paths","exportDQPath"]),aT=(0,_.either)((0,_.path)(["newConfig","properties","workflow","path"]),(0,_.path)(["paths","workflowPath"])),iT=(0,_.prop)("paths"),oT=(0,_.path)(["paths","workflowEnvironmentURL"]),lT=(0,_.path)(["paths","collaborationPath"]),sT=(0,_.path)(["paths","imageServicePath"]),cT=(0,_.path)(["paths","dvfPath"]),uT=(0,_.path)(["paths","validationServicePath"]),pT=(0,_.path)(["paths","adminToolsPath"]),dT=(0,_.path)(["paths","mlDqPath"]),mT=(0,kc.createSelector)((e=>(0,_.path)(["newConfig","properties","attributes","presentation"])(e)),(()=>x.intl.getLocale()),(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return $v({},e,(0,x.getSpecialAttributesPresentation)(e,t))})),gT=(0,_.either)((0,_.path)(["config","com.reltio.plugins.entity.EntityRequestSettings","defaultMaxValues"]),(0,_.path)(["newConfig","properties","entity","maxValuesInResponse"])),yT=(0,_.path)(["numberFormat"]),fT=(0,_.either)((0,_.path)(["newConfig","properties","masks","dateMask"]),(0,_.path)(["dateMask"])),hT=(0,_.path)(["notifications"]),ET=(0,_.either)((0,_.path)(["newConfig","properties","masks","dateTimeMask"]),(0,_.path)(["dateTimeMask"])),bT=(0,_.path)(["newConfig","properties","requestProvider"]),vT=["config","com.reltio.plugins.pivoting.PivotingSettings","pivotingAttributes"],TT=(0,_.chain)((0,_.prop)("attributeTypes")),OT=(0,_.ifElse)((0,_.hasPath)(vT),(0,_.path)(vT),(0,_.pipe)((0,_.pathOr)([],["newConfig","pivoting"]),TT)),xT=(0,_.either)((0,_.path)(["config","com.reltio.plugins.imageattribute.fieldsorder"]),(0,_.path)(["newConfig","properties","image","attributeFieldsOrder"])),CT=(0,_.either)((0,_.path)(["config","com.reltio.plugins.ui.LookupAutocomplete"]),(0,_.path)(["newConfig","properties","lookups","autocomplete"])),ST=(0,_.path)(["keys","googleMapKey"]),wT=(0,_.path)(["keys","icpLicenseKey"]),AT=(0,_.pathOr)("",["documentation","releaseNotes"]),RT=["config","com.reltio.plugins.entity.ValidationServiceLevels","levels"],_T=(0,_.ifElse)((0,_.hasPath)(RT),(0,_.path)(RT),(0,_.path)(["newConfig","properties","validation","levels"])),IT=(0,_.ifElse)((0,_.hasPath)(["config","com.reltio.plugins.entity.Validation","validateReadMode"]),(0,_.path)(["config","com.reltio.plugins.entity.Validation","validateReadMode"]),(0,_.pathOr)(!0,["newConfig","properties","validation","validateReadMode"])),NT=(0,_.pathOr)(!1,["newConfig","properties","validation","validateRelations"]),DT=(0,_.pathOr)(!1,["newConfig","properties","validation","validateReferenceEntityInReadMode"]),PT=(0,_.either)((0,_.path)(["config","com.reltio.plugins.workflow.configuration","enabled"]),(0,_.path)(["newConfig","properties","workflow","enabled"])),kT=(0,_.path)(["error"]),LT=(0,_.path)(["paths","servicesPath"]),UT=(0,_.path)(["newConfig"]),jT=(0,_.path)(["newConfig","layout"]),FT=(0,_.path)(["newConfig","profile"]),MT=(0,_.pathOr)(!0,["newConfig","properties","showEntityId"]),VT=(0,_.path)(["newConfig","properties","release"]),BT=(0,_.path)(["newConfig","properties","logo"]),zT=(0,_.path)(["newConfig","properties","headerColor"]),HT=(0,_.path)(["newConfig","properties","showSearchByOv"]),YT=(0,_.path)(["newConfig","properties","showAttributeDescription"]),WT=(0,_.path)(["newConfig","properties","attributes","sorting"]),GT=(0,_.path)(["newConfig","properties","profileCheckUpdate"]),qT=(0,_.pathOr)(!1,["newConfig","properties","aiAssistant","enabled"]),ZT=(0,_.pathOr)(500,["newConfig","properties","aiAssistant","messagesPerDay"]),$T=(0,_.path)(["newConfig","properties","aiAssistant","skills"]),KT=(0,_.path)(["newConfig","properties","aiAssistant","historyBufferSize"]),XT=(0,_.pathOr)(!1,["newConfig","properties","queryEstimator","enabled"]),QT=(0,_.pathOr)(!1,["newConfig","properties","sharedPreferences","enabled"]);function JT(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){eO(e,t,r[t])}))}return e}function eO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const tO={},rO=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:tO,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ub.PATHS_SET:return JT({},e,{paths:t.payload});case ub.UI_PATH_SET:return(0,_.evolve)({paths:(0,_.assoc)("uiPath",t.payload)},e);case ub.UI_CONFIG_LOADED:return JT({},e,{config:t.payload});case ub.NEW_UI_CONFIG_LOADED:return JT({},e,{newConfig:t.payload});case ub.LOCALE_ATTRIBUTE_PRESENTATION_LOADED:return(0,_.evolve)({newConfig:{properties:{attributes:{presentation:(0,_.assoc)(x.LOCALE_ATTRIBUTE_PRESENTATION,t.payload)}}}},e);case ub.AUTOCLOSE_INTERVAL_LOADED:return JT({},e,{autoCloseInterval:t.payload});case ub.NUMBER_FORMAT_UPDATED:return JT({},e,{numberFormat:t.payload});case ub.DATE_MASK_UPDATED:return JT({},e,{dateMask:t.payload});case ub.DATE_TIME_MASK_UPDATED:return JT({},e,{dateTimeMask:t.payload});case ub.KEYS_SET:return JT({},e,{keys:t.payload});case ub.ERROR_SET:return JT({},e,{error:t.payload});case ub.DOCUMENTATION_SET:return JT({},e,{documentation:t.payload});case ub.SHOW_NOTIFICATION:return JT({},e,{notifications:[...e.notifications||[],t.payload]});case ub.CLOSE_NOTIFICATION:return(0,_.evolve)({notifications:(0,_.reject)((0,_.propEq)("id",t.payload))},e);case ub.CLEAR_NOTIFICATIONS:return JT({},e,{notifications:[]});case ub.SET_USE_SHARED_PREFERENCES:return JT({},e,{useSharedPreferences:t.payload});default:return e}},nO="USER_UPDATED",aO=(nb(nO),null),iO=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:aO,t=arguments.length>1?arguments[1]:void 0;return t.type===nO?t.payload||aO:e},oO="TENANT_UPDATED",lO="TENANT_NAME_UPDATED",sO=(nb(oO),nb(lO),(0,_.prop)("id")),cO=(0,_.prop)("name");function uO(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){pO(e,t,r[t])}))}return e}function pO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const dO=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case oO:return uO({},e,{id:t.payload});case lO:return uO({},e,{name:t.payload});default:return e}},mO="ENVIRONMENT_UPDATED",gO="ENVIRONMENT_ALIAS_UPDATED",yO=(nb(mO),nb(gO),(0,_.prop)("id")),fO=(0,_.prop)("alias");function hO(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){EO(e,t,r[t])}))}return e}function EO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const bO=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case mO:return hO({},e,{id:t.payload});case gO:return hO({},e,{alias:t.payload});default:return e}},vO=e=>e.dataTenants,TO=e=>e.tenants,OO=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:dC(e);return e.metadata&&e.metadata[t]},xO=e=>e.tenant,CO=e=>e.environment,SO=e=>e.user,wO=e=>e.ui,AO=e=>e.profile,RO=e=>e.search,_O=e=>mR(AO(e)),IO=e=>RR(AO(e)),NO=e=>_R(AO(e)),DO=(e,t)=>jR(AO(e),t),PO=(e,t,r)=>kR(AO(e),t,r),kO=(e,t,r)=>LR(AO(e),t,r),LO=(e,t,r)=>PR(AO(e),t,r),UO=(e,t)=>FR(AO(e),t),jO=e=>MR(AO(e)),FO=(e,t,r)=>UR(AO(e),t,r),MO=e=>ER(AO(e)),VO=e=>yR(AO(e)),BO=e=>DR(AO(e)),zO=e=>u_(AO(e)),HO=e=>p_(AO(e)),YO=e=>d_(AO(e)),WO=e=>m_(AO(e)),GO=e=>g_(AO(e)),qO=(e,t)=>IR(AO(e),t),ZO=(e,t)=>NR(AO(e),t),$O=e=>gR(AO(e)),KO=(e,t)=>y_(AO(e),t),XO=(e,t,r)=>{let{uri:n}=r;return KR(AO(e),t,n)},QO=(e,t,r)=>{let{uri:n}=r;return XR(AO(e),t,n)},JO=(e,t,r)=>QR(AO(e),t,r),ex=e=>Xv(wO(e)),tx=e=>Jv(wO(e)),rx=e=>Qv(wO(e)),nx=e=>eT(wO(e)),ax=e=>tT(wO(e)),ix=e=>sT(wO(e)),ox=e=>pT(wO(e)),lx=e=>mT(wO(e)),sx=e=>yT(wO(e)),cx=e=>gT(wO(e)),ux=e=>(e=>e.autoCloseInterval)(wO(e)),px=e=>fT(wO(e)),dx=e=>ET(wO(e)),mx=e=>bT(wO(e)),gx=e=>hT(wO(e)),yx=e=>OT(wO(e)),fx=e=>xT(wO(e)),hx=e=>CT(wO(e)),Ex=e=>ST(wO(e)),bx=e=>wT(wO(e)),vx=e=>_T(wO(e)),Tx=e=>IT(wO(e)),Ox=e=>NT(wO(e)),xx=e=>DT(wO(e)),Cx=e=>qT(wO(e)),Sx=e=>ZT(wO(e)),wx=e=>$T(wO(e)),Ax=e=>KT(wO(e)),Rx=e=>QT(wO(e)),_x=e=>(e=>e.searchResults)(RO(e)),Ix=e=>(e=>e.keyword)(RO(e)),Nx=e=>x.getActivityFilter(RO(e)),Dx=e=>x.getSearchOptions(RO(e)),Px=e=>(e=>e.searchProviderData)(RO(e)),kx=e=>(e=>e.searchNavigationData)(RO(e)),Lx=(e,t)=>x.getGlobalSearchRequestOptions(RO(e),t),Ux=e=>x.getStringifiedSearchOptions(RO(e)),jx=e=>(e=>e.globalFilter)(RO(e)),Fx=e=>x.getGlobalFilterQuery(RO(e)),Mx=e=>lv(RO(e)),Vx=e=>vR(AO(e)),Bx=e=>VR(AO(e)),zx=e=>BR(AO(e)),Hx=e=>zR(AO(e)),Yx=e=>fR(AO(e)),Wx=(e,t)=>HR(AO(e),t),Gx=(e,t)=>YR(AO(e),t),qx=(e,t)=>WR(AO(e),t),Zx=(e,t,r)=>GR(AO(e),t,r),$x=(e,t,r)=>qR(AO(e),t,r),Kx=(e,t,r)=>ZR(AO(e),t,r),Xx=(e,t)=>$R(AO(e),t),Qx=e=>Xv(wO(e))||Jv(wO(e)),Jx=e=>(e=>null==e?void 0:e.username)(SO(e)),eC=e=>(e=>null==e?void 0:e.roles)(SO(e)),tC=e=>hR(AO(e)),rC=(e,t)=>JR(AO(e),t),nC=(e,t)=>e_(AO(e),t),aC=(e,t)=>t_(AO(e),t),iC=e=>r_(AO(e)),oC=(e,t,r)=>n_(AO(e),t,r),lC=(e,t)=>a_(AO(e),t),sC=e=>TR(AO(e)),cC=e=>xR(AO(e)),uC=e=>CR(AO(e)),pC=e=>v_(AO(e),kS(e)),dC=e=>sO(xO(e)),mC=e=>cO(xO(e)),gC=e=>yO(CO(e)),yC=e=>fO(CO(e)),fC=e=>rT(wO(e)),hC=e=>nT(wO(e)),EC=e=>aT(wO(e)),bC=e=>iT(wO(e)),vC=e=>oT(wO(e)),TC=e=>PT(wO(e)),OC=e=>lT(wO(e)),xC=e=>cT(wO(e)),CC=e=>uT(wO(e)),SC=e=>dT(wO(e)),wC=(0,kc.createSelector)(SO,dC,x.canUserRegisterConfigEnvironments),AC=(0,kc.createSelector)(SO,dC,x.canUserCreateWorkflowConfigJar),RC=(0,kc.createSelector)(SO,dC,x.canUserCreateWorkflowEnvironmentConfigJar),_C=(0,kc.createSelector)(SO,dC,x.canUserExecuteWorkflowJobs),IC=(0,kc.createSelector)(SO,dC,x.canUserExecuteWorkflowJobsSyncBusinessProcessData),NC=(0,kc.createSelector)(SO,dC,x.canUserExecuteWorkflowJobsTerminateProcessInstance),DC=(0,kc.createSelector)(SO,dC,x.canUserExecuteWorkflowJobsUpdateTasks),PC=(0,kc.createSelector)(SO,dC,x.canUserExecuteWorkflowJobsValidateTasks),kC=(0,kc.createSelector)(SO,dC,x.canUserManageWorkflowDefinition),LC=(0,kc.createSelector)(SO,dC,x.canUserManageWorkflowEnvironmentDefinition),UC=(0,kc.createSelector)(SO,dC,x.canUserReadWorkflowDataTask),jC=(0,kc.createSelector)(SO,dC,x.canUserUpdateProcessInstance),FC=(0,kc.createSelector)(SO,dC,x.canUserUpdateWorkflowDataTask),MC=(0,kc.createSelector)(SO,dC,x.canUserViewProcessInstanceSearchQuery),VC=(0,kc.createSelector)(SO,dC,x.canUserViewWorkflowConfigJar),BC=(0,kc.createSelector)(SO,dC,x.canUserViewWorkflowDefinition),zC=(0,kc.createSelector)(SO,dC,x.canUserViewWorkflowEnvironmentConfigJar),HC=(0,kc.createSelector)(SO,dC,x.canUserViewWorkflowJobs),YC=(0,kc.createSelector)(SO,dC,x.canUserMakeExport),WC=(0,kc.createSelector)(SO,dC,x.canUserMakeActivitiesExport),GC=(0,kc.createSelector)(SO,dC,x.canUserImportEntitiesFromDT),qC=(0,kc.createSelector)(SO,dC,x.canUserReadEntitiesFromDT),ZC=(0,kc.createSelector)(SO,dC,x.canUserStartProcessInstanceFromQuery),$C=(0,kc.createSelector)(SO,dC,x.canUserMakeBulkUpdate),KC=(0,kc.createSelector)(SO,dC,x.canUserDeleteProfiles),XC=(0,kc.createSelector)(SO,dC,x.canUserOpenDataLoader),QC=(0,kc.createSelector)(SO,dC,x.canUserGetDQStatistic),JC=(0,kc.createSelector)(SO,dC,x.canUserReadDVF),eS=(0,kc.createSelector)(OC,WO,((e,t)=>!!e&&!t)),tS=(0,kc.createSelector)(EC,TC,((e,t)=>!!e&&!!t)),rS=(e,t)=>{var r;return null===(r=SR(AO(e)))||void 0===r?void 0:r.find((0,_.propEq)("id",t))},nS=(e,t)=>Boolean(rS(e,t)),aS=e=>nS(e,x.SidePanelViewId.Workflow),iS=e=>nS(e,x.SidePanelViewId.Discussion),oS=e=>nS(e,x.SidePanelViewId.History),lS=e=>nS(e,x.SidePanelViewId.DB),sS=e=>{var t,r;return null!==(t=null===(r=rS(e,x.SidePanelViewId.DB))||void 0===r?void 0:r.views)&&void 0!==t?t:[]},cS=e=>bR(AO(e)),uS=e=>i_(AO(e)),pS=(e,t)=>o_(AO(e),t),dS=e=>l_(AO(e)),mS=e=>s_(AO(e)),gS=(e,t)=>c_(AO(e),t),yS=e=>kT(wO(e)),fS=(e,t)=>{const r=OO(e),n=Vx(e),a=_O(e),{nextEntry:i,inRelations:o=[],outRelations:l=[]}=t,s=n===x.Mode.Editing||n===x.Mode.Suggesting,c=n===x.Mode.Suggesting&&(0,x.isTempUri)(null==a?void 0:a.uri),u=kS(e);if(!s||c&&!u||i||!a)return!1;{const e=(0,x.checkMetadataForUpdate)(n,(0,x.getEntityType)(r,a.type)),t=o.concat(l).map((e=>(0,x.getRelationType)(r,e.uri||e))).some((0,_.both)((0,x.checkMetadataForCreate)(n),(0,x.checkMetadataForUpdate)(n)));return e&&t}},hS=(0,kc.createSelector)(_O,zx,YO,zO,x.getProfileEntityWithHistoryDiff),ES=(0,kc.createSelector)(_O,zx,YO,x.getProfileEntityWithoutHistoryDiff),bS=e=>LT(wO(e)),vS=e=>UT(wO(e)),TS=e=>jT(wO(e)),OS=e=>FT(wO(e)),xS=e=>MT(wO(e)),CS=e=>VT(wO(e)),SS=e=>AT(wO(e)),wS=e=>BT(wO(e)),AS=e=>zT(wO(e)),RS=e=>HT(wO(e)),_S=e=>YT(wO(e)),IS=e=>WT(wO(e)),NS=e=>GT(wO(e)),DS=(e,t)=>((e,t)=>(0,x.getAuthoringItemsFromLayoutByEntityType)(FT(e),t))(wO(e),t),PS=(e,t)=>((e,t)=>(0,_.path)(["newConfig","properties","cleanse",t])(e))(wO(e),t),kS=e=>{const t=_O(e),r=DS(e,null==t?void 0:t.type);return!(0,x.isEmptyValue)(r)},LS=e=>XT(wO(e)),US=e=>wR(AO(e)),jS=e=>AR(AO(e)),FS=(e,t)=>tS(e)&&ZC(e)&&(0,x.checkMetadataPermission)(x.MetadataPermissions.INITIATE_CHANGE_REQUEST,t);let MS=function(e){return e.MODIFIED_ENTITY_CREATED="MODIFIED_ENTITY_CREATED",e.MODIFIED_ENTITY_DELETED="MODIFIED_ENTITY_DELETED",e.MODIFIED_ENTITY_DEFAULT_PROFILE_PIC_SET="MODIFIED_ENTITY_DEFAULT_PROFILE_PIC_SET",e.MODIFIED_ENTITIES_RESET="MODIFIED_ENTITIES_RESET",e.CLEANSE_LOADING="CLEANSE_LOADING",e}({}),VS=function(e){return e.RELATIONS_LOADED="RELATIONS_LOADED",e.REMOVE_RELATION="REMOVE_RELATION",e.EDIT_RELATION="EDIT_RELATION",e.ADD_RELATION="ADD_RELATION",e.OPEN_RELATION_EDITOR="OPEN_RELATION_EDITOR",e.CLOSE_RELATION_EDITOR="CLOSE_RELATION_EDITOR",e.SET_RELATION_TYPE="SET_RELATION_TYPE",e.SET_RELATION_ENTITY="SET_RELATION_ENTITY",e.SET_INITIAL_INFO="SET_INITIAL_INFO",e.IGNORE_RELATION="IGNORE_RELATION",e.SECOND_LEVEL_RELATIONS_LOADED="SECOND_LEVEL_RELATIONS_LOADED",e}({});var BS=r(51095);const zS=(e,t)=>e.find((0,_.pipe)(x.getRelationUriFromConnection,(0,_.equals)(t))),HS=(e,t)=>(0,_.path)([t,"connections"],e),YS=r.n(BS)()(HS,((e,t)=>(0,_.path)([t,"drafts"],e)),((e,t,r)=>r),(function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const{addedConnections:a=[],editedConnections:i=[],removedUris:o=[],ignoredRelationData:l=[]}=r,s=(0,_.pipe)(x.getRelationUriFromConnection,_.equals,(0,_.find)(_.__,o)),c=l.map((e=>e.relationUri)),u=(0,_.pipe)(x.getRelationUriFromConnection,_.equals,(0,_.find)(_.__,c)),p=e=>(0,_.pipe)((0,_.eqBy)(x.getRelationUriFromConnection),(0,_.find)(_.__,i),(0,_.unless)(_.isNil,x.markEdited))(e),d=n?(null===(e=t.find((e=>e.entity.entityUri===n)))||void 0===e?void 0:e.connections)||[]:t,m=a.filter((0,_.propEq)("parentEntityUri",n));return m.map(x.markNew).concat(d.filter((e=>!m.some((0,_.pipe)(x.getRelationUriFromConnection,(0,_.equals)((0,x.getRelationUriFromConnection)(e)))))).map((0,_.pipe)((0,_.either)(p,_.identity),(0,_.when)(s,x.markRemoved),(0,_.when)(u,x.markIgnored))))}))(((e,t,r)=>t+r)),WS=(e,t,r)=>{const n=(0,x.getTempRelations)(e,t);return zS(n,r)};function*GS(e){yield(0,Va.gw)(0);const t=e.payload,r=yield(0,Va.Ys)(OO),n=yield(0,Va.Ys)(uS),a=[t.type],i=yield(0,Va.Ys)(dS),o=(0,x.initDependentLookups)({structure:n,metadata:r,typeUris:a,alreadyAddedTypeUris:i}),l=(0,x.populateDependentLookupsFromEntity)({structure:o,metadata:r,entityOrRelation:t});yield(0,Va.gz)(Nb(l)),yield(0,Va.gz)(Db(a))}function*qS(e,t){const r=(0,x.getBaseUri)(e);return(0,x.isRelationUri)(r)?yield(0,Va.Ys)(kO,t,r):yield(0,Va.Ys)(qO,r)}function*ZS(e){const{attributeType:t,metadata:r,parentUri:n,viewId:a}=e.payload,i=yield(0,Va.RE)(qS,n,a),o=yield(0,Va.Ys)(uS);if(i)if(t){const e=(0,x.findAttributeValuesByTypeUri)(r,i,t.uri).filter((e=>{let{uri:t}=e;return t.startsWith(n)}))[0],a=(0,x.addValueToDependentLookups)({structure:o,attributeValue:e});yield(0,Va.gz)(Nb(a))}else{const e=[i.type],t=yield(0,Va.Ys)(dS),n=(0,x.initDependentLookups)({structure:o,metadata:r,typeUris:e,alreadyAddedTypeUris:t}),a=(0,x.populateDependentLookupsFromEntity)({structure:n,metadata:r,entityOrRelation:i});yield(0,Va.gz)(Nb(a)),yield(0,Va.gz)(Db(e))}}function*$S(e){const t=e.payload,r=yield(0,Va.Ys)(OO),n=yield(0,Va.Ys)(uS);let a=n;for(const e of t){const{attributeType:t,parentUri:i,viewId:o}=e;if((0,x.isAttributeTypeInDependentLookups)(n,t.uri)){const e=yield(0,Va.RE)(qS,i,o);e&&(a=(0,x.syncAttributeTypeWithDependentLookups)({structure:a,entityOrRelation:e,attrTypeUri:t.uri,metadata:r}))}}a!==n&&(yield(0,Va.gz)(Nb(a)))}function*KS(e){let{structure:t,attributeType:r,value:n}=e;if((0,x.isReference)(r)&&n){const e=(0,x.getReferencedEntityUriFromAttrValue)(n);if((0,x.isTempUri)(e))return yield(0,Va.RE)(ew,t,e)}return t}function*XS(e){let{structure:t,uri:r,attributeType:n,value:a}=e,i=(0,x.removeValuesFromDependentLookups)({structure:t,uri:r});if(i=yield(0,Va.RE)(KS,{structure:i,attributeType:n,value:a}),i=(0,x.addValueToDependentLookups)({structure:i,attributeValue:a}),(0,x.isReference)(n)&&a){const e=(0,x.getReferencedEntityUriFromAttrValue)(a);(0,x.isTempUri)(e)&&(i=yield(0,Va.RE)(JS,i,e))}i!==t&&(yield(0,Va.gz)(Nb(i)))}function*QS(e){yield(0,Va.gw)(0);const{attributeType:t,uri:r,viewId:n,silent:a,value:i}=e.payload,o=yield(0,Va.Ys)(uS),l=yield(0,Va.RE)(qS,r,n);if(l&&(0,x.isAttributeTypeInDependentLookups)(o,t.uri)){const{value:n,lookupCode:i}=e.payload.value,l=i||n;a||(yield(0,Va.rM)(nw,o,{type:t.uri,uri:r,lookupValue:l}));const s=(0,x.addValueToDependentLookups)({structure:o,attributeValue:{type:t.uri,value:l,uri:r}});yield(0,Va.gz)(Nb(s))}l&&(0,x.isComplexAttribute)(t.type)&&(yield(0,Va.RE)(XS,{structure:o,uri:r,attributeType:t,value:i}))}function*JS(e,t){const r=yield(0,Va.Ys)(OO),n=yield(0,Va.Ys)(qO,t);if(!n)return e;const a=yield(0,Va.Ys)($O),i=(0,x.findRelatedTemporaryEntities)(a,n);let o=e;for(const e of[n,...i])o=(0,x.populateDependentLookupsFromEntity)({structure:o,metadata:r,entityOrRelation:e});return o}function*ew(e,t){const r=yield(0,Va.Ys)(qO,t),n=yield(0,Va.Ys)($O),a=(0,x.findRelatedTemporaryEntities)(n,r).map((0,_.prop)("uri"));let i=e;for(const e of[t,...a])i=(0,x.removeValuesFromDependentLookups)({structure:i,uri:e});return i}function*tw(e){const{attributeType:t,uri:r,attributeValue:n,viewId:a}=e.payload,i=yield(0,Va.Ys)(uS),o=(0,x.isAttributeTypeInDependentLookups)(i,t.uri);if(yield(0,Va.RE)(qS,r,a)){o&&(yield(0,Va.rM)(nw,i,{type:t.uri,uri:r,lookupValue:""}));let e=o||(0,x.isComplexAttribute)(t)?(0,x.removeValuesFromDependentLookups)({structure:i,uri:r}):i;e=yield(0,Va.RE)(KS,{structure:e,attributeType:t,value:n}),e!==i&&(yield(0,Va.gz)(Nb(e)))}}function*rw(e){yield(0,Va.gw)(0);const t=yield(0,Va.Ys)(uS),r=yield(0,Va.RE)(ew,t,e.payload);yield(0,Va.gz)(Nb(r))}function*nw(e,t){var r;const n=yield(0,Va.Ys)(OO),a=yield(0,Va.Ys)($O),i=yield(0,Va.Ys)(qx),o=yield(0,Va.Ys)(IO),l=yield(0,Va.Ys)(hx),s=yield(0,Va.Ys)(mS),c=yield(0,Va.Ys)(US),u=(0,x.getDependentLookupStateForValueUri)({structure:e,typeUri:t.type,valueUri:t.uri,modifiedEntities:a,connections:i,entityUri:o,config:l,editorsState:s,hiddenAttributes:null!==(r=c[o])&&void 0!==r?r:[]});if(u.length>0){const e=u.map((e=>e.uri));yield(0,Va.gz)(Pb({uris:e,isBlocked:!0}));try{const e=yield(0,Va.RE)(x.cascadeUpdate,u,t);for(const r of e){const{type:e,uri:a,lookupValue:i,displayName:o}=r,l=(yield(0,Va.Ys)(Xx,(0,x.getBaseUri)(a)))[0],s=yield(0,Va.RE)(qS,a,l);s&&(0,x.findAttributeValueByUri)(s,a)&&a!==t.uri&&(yield(0,Va.gz)(vb({attributeType:(0,x.findAttributeTypeByUri)(n,e),uri:a,value:{value:o||"",lookupCode:i||""},silent:!0,viewId:l})))}}catch(e){console.warn(e)}yield(0,Va.gz)(Pb({uris:e,isBlocked:!1}))}}function*aw(e){const t=e.payload.connection,r=(0,x.getEntityUriFromConnection)(t);if((0,x.isTempUri)(r)&&(yield(0,Va.Ys)(qO,r))){yield(0,Va.qn)(Ib.DEPENDENT_LOOKUPS_STRUCTURE_SET);const e=yield(0,Va.Ys)(uS),t=yield(0,Va.RE)(JS,e,r);yield(0,Va.gz)(Nb(t))}}function*iw(e){const t=e.payload.relationUri,r=yield(0,Va.Ys)(uS),n=(0,x.removeValuesFromDependentLookups)({structure:r,uri:t});yield(0,Va.gz)(Nb(n))}function*ow(e){const t=e.payload.id,r=e.payload.relationUri;if(0===(yield(0,Va.Ys)(Xx,r)).length){const e=yield(0,Va.Ys)(uS);let n=(0,x.removeValuesFromDependentLookups)({structure:e,uri:r});const a=yield(0,Va.Ys)(LO,t),i=zS(a,r),o=(0,x.getEntityUriFromConnection)(i);(0,x.isTempUri)(o)&&(n=yield(0,Va.RE)(ew,n,o)),yield(0,Va.gz)(Nb(n))}}const lw=[function*(){yield(0,Va.ib)(MS.MODIFIED_ENTITY_CREATED,GS)},function*(){yield(0,Va.ib)(MS.MODIFIED_ENTITY_DELETED,rw)},function*(){yield(0,Va.ib)(hb.ADD_DEFAULT_VALUES,ZS)},function*(){yield(0,Va.ib)(hb.ADD_ATTRIBUTES,$S)},function*(){yield(0,Va.ib)(hb.MODIFY_ATTRIBUTE,QS)},function*(){yield(0,Va.ib)(hb.REMOVE_ATTRIBUTE,tw)},function*(){yield(0,Va.ib)(VS.OPEN_RELATION_EDITOR,aw)},function*(){yield(0,Va.ib)(VS.SET_RELATION_TYPE,iw)},function*(){yield(0,Va.ib)(VS.CLOSE_RELATION_EDITOR,ow)}];let sw=function(e){return e.ENTITY_LOADED="ENTITY_LOADED",e.DEFAULT_PROFILE_PIC_SET="DEFAULT_PROFILE_PIC_SET",e.LOAD_ENTITY="LOAD_ENTITY",e.ENTITY_CREATION_REQUESTED="ENTITY_CREATION_REQUESTED",e.ENTITY_CREATION_WITH_AUTHORING_REQUESTED="ENTITY_CREATION_WITH_AUTHORING_REQUESTED",e.ENTITY_REMOVE_REQUESTED="ENTITY_REMOVE_REQUESTED",e.CLEAR_ENTITY="CLEAR_ENTITY",e.CLONE_ENTITY="CLONE_ENTITY",e.ENTITY_AUTHORING_DRAFT_ENTITIES_LOADED="ENTITY_AUTHORING_DRAFT_ENTITIES_LOADED",e.AUTHORING_DCR_RESOLVED="AUTHORING_DCR_RESOLVED",e}({});const cw=(e,t)=>({type:sw.ENTITY_LOADED,payload:{entity:e,silent:t}}),uw=nb(sw.DEFAULT_PROFILE_PIC_SET),pw=nb(sw.LOAD_ENTITY),dw=nb(sw.ENTITY_CREATION_REQUESTED),mw=nb(sw.ENTITY_CREATION_WITH_AUTHORING_REQUESTED),gw=nb(sw.ENTITY_AUTHORING_DRAFT_ENTITIES_LOADED),yw=nb(sw.AUTHORING_DCR_RESOLVED),fw=nb(sw.ENTITY_REMOVE_REQUESTED),hw=nb(sw.CLONE_ENTITY),Ew=nb(sw.CLEAR_ENTITY),bw=e=>null==e?void 0:e.uri,vw=(0,kc.createSelector)((e=>null==e?void 0:e.dataTenant),bw,((e,t)=>(0,x.getEntityUriForLink)({dataTenant:e,uri:t})));function Tw(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ow(e,t,r[t])}))}return e}function Ow(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const xw={};let Cw=function(e){return e.ERRORS_SET="ERRORS_SET",e.REMOVE_ERROR="REMOVE_ERROR",e.ERROR_DEACTIVATED="ERROR_DEACTIVATED",e}({});const Sw=nb(Cw.ERROR_DEACTIVATED),ww=nb(Cw.ERRORS_SET);function Aw(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Rw(e,t,r[t])}))}return e}function Rw(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const _w=[];let Iw=function(e){return e.HISTORY_DIFF_SET="HISTORY_DIFF_SET",e.HISTORY_DIFF_CLEARED="HISTORY_DIFF_CLEARED",e.HISTORY_EVENT_SET="HISTORY_EVENT_SET",e.HISTORY_EVENT_CLEARED="HISTORY_EVENT_CLEARED",e.HISTORY_SLICE_SET="HISTORY_SLICE_SET",e.HISTORY_MODE_SET="HISTORY_MODE_SET",e}({});const Nw=nb(Iw.HISTORY_DIFF_SET),Dw=nb(Iw.HISTORY_DIFF_CLEARED),Pw=nb(Iw.HISTORY_EVENT_SET),kw=nb(Iw.HISTORY_EVENT_CLEARED),Lw=nb(Iw.HISTORY_SLICE_SET),Uw=nb(Iw.HISTORY_MODE_SET);function jw(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Fw(e,t,r[t])}))}return e}function Fw(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Mw={mode:x.HistoryMode.Current};let Vw=function(e){return e.PROFILE_LAST_LOADED_TIME_UPDATE="PROFILE_LAST_LOADED_TIME_UPDATE",e}({});nb(Vw.PROFILE_LAST_LOADED_TIME_UPDATE);let Bw=function(e){return e.LOOKUPS_LOADED="LOOKUPS_LOADED",e.LOOKUPS_FOR_TYPE_RESOLVED="LOOKUPS_FOR_TYPE_RESOLVED",e.LOOKUPS_LIST_RESOLVED="LOOKUPS_LIST_RESOLVED",e}({});const zw=nb(Bw.LOOKUPS_LOADED),Hw=nb(Bw.LOOKUPS_FOR_TYPE_RESOLVED),Yw=nb(Bw.LOOKUPS_LIST_RESOLVED);function Ww(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Gw(e,t,r[t])}))}return e}function Gw(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const qw={},Zw=(e,t)=>({type:Lb.MODE_UPDATED,payload:{mode:e,silent:t}}),$w=nb(Lb.MODE_UPDATE_REQUESTED),Kw=nb(Lb.MODE_EDITING_CANCELED),Xw=x.isSuggestMode,Qw=(x.isEditMode,x.isViewMode),Jw=x.isEditableMode,eA=x.Mode.Viewing,tA=nb(MS.MODIFIED_ENTITY_CREATED),rA=nb(MS.MODIFIED_ENTITY_DELETED),nA=nb(MS.MODIFIED_ENTITY_DEFAULT_PROFILE_PIC_SET),aA=nb(MS.MODIFIED_ENTITIES_RESET),iA=nb(MS.CLEANSE_LOADING);function oA(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){lA(e,t,r[t])}))}return e}function lA(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const sA={};function cA(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){uA(e,t,r[t])}))}return e}function uA(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*pA(e){const{values:t,parentUri:r,attributeTypeUri:n,attributeTypeName:a}=e.payload;let i=t;const o=yield(0,Va.Ys)(_O);if(r===o.uri){const e=(0,x.getAttributeSource)(n),r=(0,_.pipe)((0,_.pathOr)([],[e,a]),(0,_.map)((0,_.prop)("uri")))(o),l=(0,_.intersection)(r,t.map((0,_.prop)("uri")));i=t.filter((e=>!l.includes(e.uri)))}i.length&&(yield(0,Va.gz)(Ob(cA({},e.payload,{values:i}))))}function*dA(){return{apiPath:yield(0,Va.Ys)(tx),tenant:yield(0,Va.Ys)(dC)}}function*mA(e){const{attributeTypeName:t,attributeTypeUri:r}=e.payload,n=yield(0,Va.RE)(dA);try{const a=yield(0,Va.RE)(x.getPagedEntity,cA({},e.payload,n)),i=(0,x.getAttributeSource)(r),o=(0,_.pathOr)([],[i,t],a);yield(0,Va.gz)(xb(cA({},e.payload,{values:o})))}catch(e){console.warn(e),yield(0,Va.gz)(Wv((0,x.getRequestErrorMessage)(e,mi().text("Something went wrong"))))}}function*gA(e){var t;const{attributeType:r,value:n,uri:a}=e.payload,i=r.uri,o=(0,x.getBaseUri)(i),l=yield(0,Va.Ys)(PS,o);if(!l)return;const s=yield(0,Va.Ys)(OO),c=(0,x.getEntityType)(s,o),u=null==c||null===(t=c.cleanseConfig)||void 0===t?void 0:t.infos;if(!u)return;const p=(0,x.getCleanseType)(l,i);if(!(0,x.hasCleanseTypeInEntityType)(p,u))return;const d=(0,x.getCleanseAttributes)(l);if(null!=d&&d.includes(i)){yield(0,Va.gz)(iA({isLoading:!0}));try{const e=yield(0,Va.RE)(x.cleanseData,{cleanseType:p.split("/cleanse/infos/")[1],type:o,attributes:{[r.name]:[{type:i,value:n}]}}),t=(0,x.getBaseUri)(a),l=yield(0,Va.Ys)(qO,t);if((0,x.hasCleanseStatus)(e))if((0,x.isUnverifiedCleanse)(e))yield(0,Va.gz)(Wv((0,_.path)(x.CLEANSE_STATUS_ERROR_PATH,e)));else if(l){const{attributes:r}=e,n=(0,x.prepareCleansedAttributes)(t,r);yield(0,Va.gz)(tA(cA({},l,{attributes:cA({},l.attributes,n)})))}}catch(e){console.warn(e),yield(0,Va.gz)(Wv((0,x.getRequestErrorMessage)(e,mi().text("Something went wrong"))))}yield(0,Va.gz)(iA({isLoading:!1}))}}const yA=[function*(){yield(0,Va.ib)(hb.REQUEST_NEXT_PAGE_ATTRIBUTE_VALUES,mA)},function*(){yield(0,Va.ib)(hb.PROCESS_NEXT_PAGE_ATTRIBUTE_VALUES,pA)},function*(){yield(0,Va.ib)(hb.MODIFY_ATTRIBUTE,gA)}],fA=nb(VS.RELATIONS_LOADED),hA=nb(VS.SECOND_LEVEL_RELATIONS_LOADED),EA=(0,_.curry)(((e,t)=>({type:VS.REMOVE_RELATION,payload:{id:e,relationUri:t}}))),bA=(0,_.curry)(((e,t)=>({type:VS.IGNORE_RELATION,payload:{id:e,ignoredRelationData:t}}))),vA=(0,_.curry)(((e,t)=>({type:VS.ADD_RELATION,payload:{id:e,connection:t}}))),TA=(0,_.curry)(((e,t)=>({type:VS.EDIT_RELATION,payload:{id:e,connection:t}}))),OA=(0,_.curry)(((e,t)=>({type:VS.OPEN_RELATION_EDITOR,payload:{id:e,connection:t}}))),xA=(0,_.curry)(((e,t)=>({type:VS.CLOSE_RELATION_EDITOR,payload:{id:e,relationUri:t}}))),CA=(0,_.curry)(((e,t,r)=>({type:VS.SET_RELATION_TYPE,payload:{id:e,relationUri:t,relationType:r}}))),SA=(0,_.curry)(((e,t,r)=>({type:VS.SET_RELATION_ENTITY,payload:{id:e,relationUri:t,entityInfo:r}}))),wA=(0,_.curry)(((e,t,r)=>({type:VS.SET_INITIAL_INFO,payload:{id:e,relationUri:t,tempEntity:r}})));function AA(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){RA(e,t,r[t])}))}return e}function RA(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const _A={},IA={removedUris:[],addedConnections:[],editedConnections:[],ignoredRelationData:[]},NA=(e,t,r)=>{if((0,_.pathEq)([...(0,x.getRelationToAddPath)(e),"relation","relationUri"],t,r))return(0,x.getRelationToAddPath)(e);{const n=((0,_.path)((0,x.getRelationsToEditPath)(e),r)||[]).findIndex((0,_.pathEq)(["relation","relationUri"],t));return n>=0?[...(0,x.getRelationsToEditPath)(e),n]:null}},DA=(e,t,r)=>{const n=NA(e,t,r);return n?(0,_.lensPath)([...n,"relation"]):null},PA=(0,_.pipe)(DA,(e=>(0,_.compose)(e,(0,_.lensProp)("object"))));let kA=function(e){return e.TREES_RESET_INITIAL_TREES="TREES_RESET_INITIAL_TREES",e.TREES_RESTORE_FROM_INITIAL_TREES="TREES_RESTORE_FROM_INITIAL_TREES",e.TREES_STATE_RESTORED="TREES_STATE_RESTORED",e.TREES_STATE_SAVED="TREES_STATE_SAVED",e.TREE_ACTIVENESS_DATE_CHANGED="TREE_ACTIVENESS_DATE_CHANGED",e.TREE_CHANGED="TREE_CHANGED",e.TREE_CHILDREN_LOADED="TREE_CHILDREN_LOADED",e.TREE_CHILDREN_LOADING="TREE_CHILDREN_LOADING",e.TREE_COMMANDS_CLEARED="TREE_COMMANDS_CLEARED",e.TREE_CURRENT_ENTITY_SHOWN="TREE_CURRENT_ENTITY_SHOWN",e.TREE_ENTITIES_MAPPING_LOADED="TREE_ENTITIES_MAPPING_LOADED",e.TREE_LOADED="TREE_LOADED",e.TREE_LOADED_WITH_ERROR="TREE_LOADED_WITH_ERROR",e.TREE_LOADING="TREE_LOADING",e.TREE_NODE_CREATED="TREE_NODE_CREATED",e.TREE_NODE_EDITED="TREE_NODE_EDITED",e.TREE_NODE_EDITING_APPLIED="TREE_NODE_EDITING_APPLIED",e.TREE_NODE_EDITING_CANCELED="TREE_NODE_EDITING_CANCELED",e.TREE_NODE_EDITING_STARTED="TREE_NODE_EDITING_STARTED",e.TREE_NODE_ENTITY_CHANGED="TREE_NODE_ENTITY_CHANGED",e.TREE_NODE_EXPANDED="TREE_NODE_EXPANDED",e.TREE_NODE_NEW_CHILD_EDITING_APPLIED="TREE_NODE_NEW_CHILD_EDITING_APPLIED",e.TREE_NODE_NEW_CHILD_EDITING_CANCELED="TREE_NODE_NEW_CHILD_EDITING_CANCELED",e.TREE_NODE_NEW_CHILD_EDITING_STARTED="TREE_NODE_NEW_CHILD_EDITING_STARTED",e.TREE_NODE_NEW_PARENT_EDITING_APPLIED="TREE_NODE_NEW_PARENT_EDITING_APPLIED",e.TREE_NODE_NEW_PARENT_EDITING_CANCELED="TREE_NODE_NEW_PARENT_EDITING_CANCELED",e.TREE_NODE_NEW_PARENT_EDITING_STARTED="TREE_NODE_NEW_PARENT_EDITING_STARTED",e.TREE_NODE_RELATION_TYPE_CHANGED="TREE_NODE_RELATION_TYPE_CHANGED",e.TREE_NODE_REMOVED="TREE_NODE_REMOVED",e.TREE_SECONDARY_LABEL_SHOWN="TREE_SECONDARY_LABEL_SHOWN",e.TREE_SCROLL_TO_NODE_RESET="TREE_SCROLL_TO_NODE_RESET",e.TREE_SORTED="TREE_SORTED",e.TREE_REFRESHED="TREE_REFRESHED",e.TREE_RELATION_CREATED="TREE_RELATION_CREATED",e.TREE_RELATION_EDITED="TREE_RELATION_EDITED",e.TREE_RELATION_REMOVED="TREE_RELATION_REMOVED",e.TREE_RELATION_REPOINTED="TREE_RELATION_REPOINTED",e.TREE_CANCEL_CHILDREN_LOADING="TREE_CANCEL_CHILDREN_LOADING",e}({});nb(kA.TREE_LOADED),nb(kA.TREE_LOADED_WITH_ERROR),nb(kA.TREE_LOADING),nb(kA.TREE_SCROLL_TO_NODE_RESET);const LA=nb(kA.TREE_COMMANDS_CLEARED),UA=(nb(kA.TREE_CHILDREN_LOADING),nb(kA.TREE_CURRENT_ENTITY_SHOWN),nb(kA.TREE_REFRESHED),nb(kA.TREE_NODE_EXPANDED),nb(kA.TREE_RELATION_REMOVED),nb(kA.TREE_NODE_REMOVED),nb(kA.TREE_SECONDARY_LABEL_SHOWN),nb(kA.TREE_ENTITIES_MAPPING_LOADED),nb(kA.TREE_CHANGED)),jA=(nb(kA.TREE_NODE_EDITED),nb(kA.TREE_ACTIVENESS_DATE_CHANGED),nb(kA.TREE_RELATION_REPOINTED),nb(kA.TREE_RELATION_CREATED),nb(kA.TREE_NODE_CREATED),nb(kA.TREE_RELATION_EDITED),nb(kA.TREE_NODE_EDITED),nb(kA.TREE_NODE_EDITING_STARTED),nb(kA.TREE_NODE_EDITING_APPLIED),nb(kA.TREE_NODE_EDITING_CANCELED),nb(kA.TREE_NODE_NEW_PARENT_EDITING_STARTED),nb(kA.TREE_NODE_NEW_PARENT_EDITING_APPLIED),nb(kA.TREE_NODE_NEW_PARENT_EDITING_CANCELED),nb(kA.TREE_NODE_NEW_CHILD_EDITING_STARTED),nb(kA.TREE_NODE_NEW_CHILD_EDITING_APPLIED),nb(kA.TREE_NODE_NEW_CHILD_EDITING_CANCELED),nb(kA.TREE_NODE_RELATION_TYPE_CHANGED),nb(kA.TREE_NODE_ENTITY_CHANGED),nb(kA.TREE_SORTED),nb(kA.TREES_STATE_SAVED),nb(kA.TREES_STATE_RESTORED),nb(kA.TREE_CHILDREN_LOADED),nb(kA.TREES_RESTORE_FROM_INITIAL_TREES)),FA=nb(kA.TREES_RESET_INITIAL_TREES),MA=(nb(kA.TREE_CANCEL_CHILDREN_LOADING),(0,_.path)(["common","commands"]));var VA=r(76665);function BA(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){zA(e,t,r[t])}))}return e}function zA(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const HA=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if((0,_.path)(["entity","uri"],e)===t)return r.forEach((e=>e.expanded=!0)),e;if(e.children)for(const n of e.children){const a=HA(n,t,r.concat(e));if(a)return a}},YA=(e,t)=>{const r=Object.keys(e).reduce(((r,n)=>{const a=e[n];return t[n]&&(a.parent=(0,_.uniq)([].concat(a.parent).concat(t[n].parent).filter(_.identity))),r[n]=a,r}),{});return Object.keys(t).forEach((e=>{r[e]||(r[e]=t[e])})),r},WA=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const r=(0,_.reject)((0,_.prop)("loading")),n=r(e);return t.forEach((t=>{e.find((e=>(0,_.path)(["entity","uri"],e)===t.entity.uri))||n.push(t)})),n},GA=(e,t)=>{if(e&&e.children){const r=e.children.findIndex((e=>{let{nodeId:r}=e;return r===t}));r>-1&&e.children.splice(r,1)}},qA=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;e&&e.children&&e.children.splice(r,0,t)},ZA=e=>{let{path:t,value:r,object:n}=e,a=n;for(let e=0;e<t.length;e++){const n=t[e];e===t.length-1?a[n]="function"==typeof r?r(a[n]):r:(a[n]=a[n]||("number"==typeof n?[]:{}),a=a[n])}},$A=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;e[t]=r,e.children&&e.children.forEach((e=>$A(e,t,r)))},KA=e=>({entity:e.entity,relation:e.relation}),XA=e=>{let{id:t,draft:r,node:n}=e;ZA({path:["editingConnections",n.relation.uri],object:r[t],value:KA(n)})},QA=e=>{let{id:t,draft:r,node:n,entity:a}=e;ZA({path:["editingConnections",n.relation.uri,"entity"],object:r[t],value:a})},JA=e=>{let{id:t,draft:r,node:n,relationTypeUri:a}=e;ZA({path:["editingConnections",n.relation.uri,"relation"],object:r[t],value:e=>BA({},e,{type:a,attributes:{}})})},eR=e=>{let{id:t,draft:r,relationUri:n}=e;delete r[t].editingConnections[n]},tR=e=>{let{id:t,draft:r,relationUri:n}=e;return r[t].editingConnections[n]},rR=e=>{delete e.editingMode,delete e.relatedEntity,delete e.initialConnection},nR=e=>{let{id:t,draft:r,currentNode:n}=e;const a=r[t].root;if(a===n)r[t].root=n.children[0],r[t].root.children=r[t].root.children||[],r[t].root.children.push(...n.children.slice(1));else{const e=(0,x.findParentNodeById)(a,n.nodeId);GA(e,n.nodeId)}},aR=(e,t,r)=>{const n=[e,"editingConnections",t,"relation"];return(0,_.path)(n,r)?(0,_.lensPath)(n):null},iR=(0,_.pick)(["showSecondaryLabel","sortField","sortOrder"]),oR=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return YA(e,t.reduce(((e,t)=>BA({},e,{[t.entity.uri]:(0,_.pick)(["entity","parent","relations"],t)})),{}))},lR=e=>({entity:(0,_.pick)(["uri","type","label","secondaryLabel"],e.entity),parent:[],relations:[(0,_.pick)(["uri","type"],e.relation)]});function sR(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){cR(e,t,r[t])}))}return e}function cR(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const uR={common:{commands:[]},trees:{},initialTrees:{}};let pR=function(e){return e.ENTITY_RELATED_ATTRIBUTES_ADDED="ENTITY_RELATED_ATTRIBUTES_ADDED",e}({});nb(pR.ENTITY_RELATED_ATTRIBUTES_ADDED);const dR={},mR=e=>e.entity,gR=e=>e.modifiedEntities,yR=e=>e.errors,fR=e=>e.relations,hR=e=>e.trees,ER=e=>e.lookups,bR=e=>e.dependentLookups,vR=e=>e.mode,TR=e=>e.lastLoadedTime,OR=e=>e.history,xR=e=>e.operation,CR=e=>e.views,SR=e=>e.sidePanelViews,wR=e=>e.hiddenAttributes,AR=e=>e.controlAttributes,RR=e=>bw(mR(e)),_R=e=>vw(mR(e)),IR=(e,t)=>((e,t)=>t&&e[t])(gR(e),t),NR=(e,t)=>((e,t)=>t&&e[t]&&e[t].defaultProfilePic)(gR(e),t),DR=e=>(0,_.keys)(fR(e)),PR=(e,t,r)=>YS(fR(e),t,r),kR=(e,t,r)=>WS(fR(e),t,r),LR=(e,t,r)=>((e,t,r)=>{const n=WS(e,t,r);return(0,x.getRelationObjectFromConnection)(n)})(fR(e),t,r),UR=(e,t,r)=>((e,t,r)=>{const n=(0,_.pipe)((0,_.pathOr)([],[t,"drafts","addedConnections"]),(0,_.filter)((0,_.pipe)(x.getRelationUriFromConnection,x.isTempUri)),(0,_.when)((0,_.always)(r),(0,_.filter)((0,_.propEq)("parentEntityUri",r))),_.length)(e);return((e,t,r)=>r?(0,_.pipe)((0,_.path)([t,"connections"]),(0,_.find)((e=>{let{entity:t}=e;return t.entityUri===r})),(0,_.pathOr)(0,["total"]))(e):(0,_.pathOr)(0,[t,"total"],e))(e,t,r)+n})(fR(e),t,r),jR=(e,t)=>HS(fR(e),t),FR=(e,t)=>x.getDraftsForSaveByViewId(fR(e),t),MR=e=>(e=>(0,_.keys)(e).reduce(((t,r)=>{const{addedConnections:n,editedConnections:a}=(0,x.getDraftsForSaveByViewId)(e,r);return(0,_.pipe)(_.concat,(0,_.map)(x.getEntityUriFromConnection),(0,_.filter)(x.isTempUri),(0,_.concat)(t))(n,a)}),[]))(fR(e)),VR=e=>Jw(vR(e)),BR=e=>Qw(vR(e)),zR=e=>Xw(vR(e)),HR=(e,t)=>x.getRelationToAddByViewId(fR(e),t),YR=(e,t)=>x.getRelationsToEditByViewId(fR(e),t),WR=(e,t)=>x.getAllRelationsToAddAndEdit(fR(e),t),GR=(e,t,r)=>x.getAllRelationsToSave(fR(e),t,r),qR=(e,t,r)=>x.getInitialConnectionTempEntity(e.relations,t,r),ZR=(e,t,r)=>x.getInitialConnection(e.relations,t,r),$R=(e,t)=>((e,t)=>Object.keys(e).filter((r=>{const n=(0,x.getTempRelations)(e,r);return!!zS(n,t)})))(fR(e),t),KR=(e,t,r)=>((e,t,r)=>(0,_.pipe)((0,_.filter)((0,_.allPass)([(0,_.propEq)("parentUri",t),(0,_.propEq)("attributeTypeUri",r),(0,_.pipe)((0,_.prop)("uri"),_.isEmpty)])),(0,_.map)((0,_.prop)("message")),(0,_.join)(". "))(e))(yR(e),t,r),XR=(e,t,r)=>((e,t,r)=>(0,_.filter)((0,_.allPass)([(0,_.propEq)("parentUri",t),(0,_.propEq)("attributeTypeUri",r),(0,_.pipe)((0,_.prop)("uri"),_.isEmpty,_.not)]))(e))(yR(e),t,r),QR=(e,t,r)=>x.getCachedActiveErrorsForAttributesPager(yR(e),t,r),JR=(e,t)=>((e,t)=>e.trees[t])(hR(e),t),e_=(e,t)=>((e,t)=>(0,_.path)(["trees",t,"root"],e))(hR(e),t),t_=(e,t)=>((e,t)=>(0,_.path)(["trees",t,"total"],e))(hR(e),t),r_=e=>MA(hR(e)),n_=(e,t,r)=>((e,t,r)=>(0,_.path)(["trees",t,"editingConnections",r],e))(hR(e),t,r),a_=(e,t)=>((e,t)=>(0,_.pipe)((0,_.prop)("trees"),(0,_.when)((0,_.always)(t),(0,_.pick)(t)),_.values,(0,_.map)((0,_.pipe)((0,_.prop)("editingConnections"),_.values)),_.flatten,(0,_.reject)(_.isNil))(e))(hR(e),t),i_=e=>(e=>e.structure)(bR(e)),o_=(e,t)=>x.getDependentLookupsStructureNode(bR(e),t),l_=e=>(e=>e.initedTypeUris)(bR(e)),s_=e=>(e=>e.editors)(bR(e)),c_=(e,t)=>x.getDependentLookupEditorState(bR(e),t),u_=e=>(e=>e.diff)(OR(e)),p_=e=>(e=>e.event)(OR(e)),d_=e=>(e=>e.slice)(OR(e)),m_=e=>(e=>!(0,x.isEmptyValue)(e.slice))(OR(e)),g_=e=>(e=>e.mode)(OR(e)),y_=(e,t)=>((e,t)=>e[t])((e=>e.entityRelatedAttributes)(e),t),f_=(0,kc.createSelector)(mR,(e=>IR(e,RR(e))),((e,t)=>!(!e||!t||(0,x.isEmptyValue)((0,x.collectAllDiffs)(e,t,!0))))),h_=(0,kc.createSelector)(hR,(e=>{const t=MA(e),r=(0,x.getNotAppliedTreeCommands)((0,_.reject)((0,_.propSatisfies)(x.isEmptyValue,"root"),e.trees));return!(0,x.isEmptyValue)(t)||!(0,x.isEmptyValue)(r)})),E_=(0,kc.createSelector)(fR,(e=>(0,_.keys)(e).reduce(((t,r)=>t||!(0,_.all)(x.isEmptyValue)((0,_.values)(x.getDraftsForSaveByViewId(e,r)))),!1))),b_=(0,kc.createSelector)(f_,E_,h_,((e,t,r)=>e||t||r)),v_=(0,kc.createSelector)(vR,mR,b_,((e,t)=>t),((e,t,r,n)=>!(e===x.Mode.Viewing||!t)&&((0,x.isTempUri)(t.uri)&&!n||r)));let T_=function(e){return e.PROFILE_OPERATION_UPDATE="PROFILE_OPERATION_UPDATE",e}({});const O_=nb(T_.PROFILE_OPERATION_UPDATE),x_=e=>{let{metadata:t,modifiedEntities:r,connections:n=[],errors:a}=e;return a.filter((e=>{let{attributeType:t,type:r}=e;return t&&!(0,x.isRequired)(t)&&r===x.ErrorType.missed})).filter((e=>{let{attributeType:a,parentUri:i}=e;const o=(0,x.getBaseUri)(i),l=(0,x.isEntityUri)(i)?r[o]:(0,x.findConnectionRelationObjectByRelationUri)(n,o),s=l&&(0,x.findAttributeValuesByTypeUri)(t,l,a.uri,!0);return null==s?void 0:s.some((e=>{let{parent:t,attrValues:r}=e;return t.uri===i&&0===r.length}))})).map((e=>{let{attributeType:t,parentUri:r}=e;return{attributeType:t,parentUri:r}}))},C_=e=>(0,x.getProfileViewsIdsByTypes)(e,[x.ProfileViewType.Relations,x.ProfileViewType.RelationsTable]);function S_(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){w_(e,t,r[t])}))}return e}function w_(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*A_(){const e=yield(0,Va.Ys)(xI.selectors.getEntity),t=yield(0,Va.Ys)(xI.selectors.getMode),r=yield(0,Va.Ys)(xI.selectors.getEntityUri),n=yield(0,Va.Ys)(xI.selectors.getMetadata),a=yield(0,Va.Ys)(xI.selectors.getModifiedEntity,r),i=yield(0,Va.Ys)(xI.selectors.getModifiedEntities),o=yield(0,Va.Ys)(xI.selectors.getProfileViews);return{entity:e,modifiedEntity:t===x.Mode.Viewing?e:a,entityUri:r,metadata:n,modifiedEntities:t===x.Mode.Viewing?{[r]:e}:i,profileViews:o,mode:t}}function*R_(){return S_({},yield(0,Va.RE)(A_),{validationServicePath:yield(0,Va.Ys)(xI.selectors.getValidationServicePath),tenant:yield(0,Va.Ys)(xI.selectors.getTenant),severity:yield(0,Va.Ys)(xI.selectors.getValidationServiceSeverityLevels)})}function*__(){const{entityUri:e,metadata:t,modifiedEntities:r,modifiedEntity:n,profileViews:a}=yield(0,Va.RE)(A_);if(!e)return[];const i=C_(a),o=(0,x.getProfileViewsIdsByTypes)(a,[x.ProfileViewType.HierarchyTree]),l=yield(0,Va.Ys)(Zx,i,!0),s=yield(0,Va.Ys)(xI.selectors.getRelations),c=yield(0,Va.Ys)(xI.selectors.getAllTreesEditingConnections,o);return[...(0,x.validateEntityLocally)(t,r,n,(0,x.isAvailableAttributeTypeForProfile)(a)),...l.flatMap((e=>(0,x.validateConnection)(t,r,e))),...c.flatMap((e=>(0,x.validateHierarchyConnection)(t,e)))].map((n=>S_({},n,{path:(0,x.evaluateErrorPath)({entityUri:e,metadata:t,connections:l,entitiesMap:r,relationsState:s,relationViewsIds:i},n.uri||n.parentUri)})))}function*I_(){const{entityUri:e,metadata:t,modifiedEntity:r,mode:n,validationServicePath:a}=yield(0,Va.RE)(R_);if(a&&e&&(0,x.shouldUseValidationService)(t,null==r?void 0:r.type)){const r=yield(0,Va.RE)((0,x.isTempUri)(e)?D_:P_),{modifiedEntities:a}=yield(0,Va.RE)(A_),i=(0,_.pipe)(x.convertValidationServiceErrors,(0,_.uniqBy)(x.getErrorUniqKey))(r,{entityUri:e,metadata:t,entitiesMap:a});if(n!==x.Mode.Viewing){const e=x_({metadata:t,modifiedEntities:a,errors:i});e.length&&(yield(0,Va.gz)(Eb(e)))}return i}return[]}function N_(e){return console.warn("Validation service error",e),[]}function*D_(){const{mode:e,modifiedEntity:t,modifiedEntities:r,validationServicePath:n,tenant:a,severity:i}=yield(0,Va.RE)(R_),o=(0,x.prepareEntityForValidation)(t,r);try{return yield(0,Va.RE)(x.validateEntity,{validationServicePath:n,entity:o,tenant:a,severity:i,options:(0,_.reject)(_.isNil,[x.ValidationServiceOption.preserveURIs,e===x.Mode.Editing?x.ValidationServiceOption.validateDataPermissions:null])})}catch(e){return N_(e)}}function*P_(){var e;const{entityUri:t,mode:r,entity:n,modifiedEntity:a,modifiedEntities:i,validationServicePath:o,metadata:l,tenant:s,severity:c}=yield(0,Va.RE)(R_),u=yield(0,Va.Ys)(xI.selectors.getValidateReferenceEntityInReadMode),p=(0,x.getEntityType)(l,n.type),d=null===(e=null==p?void 0:p.forceOvForUiUpdates)||void 0===e||e,m=r===x.Mode.Viewing?[]:(0,x.collectDiffForValidation)(n,a,i,d);try{return yield(0,Va.RE)(x.validateEntityChanges,{validationServicePath:o,uri:t,diff:m,tenant:s,severity:c,options:(0,_.reject)(_.isNil,[x.ValidationServiceOption.preserveURIs,x.ValidationServiceOption.updateAttributeUpdateDates,r===x.Mode.Editing?x.ValidationServiceOption.validateDataPermissions:null,r===x.Mode.Viewing&&u?x.ValidationServiceOption.validateReferenceEntityAttribute:null])})}catch(e){return N_(e)}}function*k_(){const{entityUri:e,metadata:t,mode:r,modifiedEntity:n,modifiedEntities:a,validationServicePath:i,tenant:o,severity:l,profileViews:s}=yield(0,Va.RE)(R_),c=yield(0,Va.Ys)(xI.selectors.getValidateRelations);if(i&&c){const c=C_(s),u=(yield(0,Va.Ys)(Zx,c)).filter((e=>(0,x.shouldUseValidationService)(t,e.relation.relationType)));if(u.length>0){let s=[];const p=(0,x.prepareConnectionsForValidation)(u,n,a,t);try{const e=yield(0,Va.RE)(x.validateRelations,{validationServicePath:i,body:p,tenant:o,severity:l,options:(0,_.reject)(_.isNil,[x.ValidationServiceOption.preserveURIs,r===x.Mode.Editing?x.ValidationServiceOption.validateDataPermissions:null])});s=Object.values(e.validated).flat()}catch(e){return N_(e)}const d=yield(0,Va.Ys)(xI.selectors.getModifiedEntities),m=yield(0,Va.Ys)(xI.selectors.getRelations),g=(0,_.pipe)(x.convertValidationServiceErrors,(0,_.uniqBy)(x.getErrorUniqKey))(s,{entityUri:e,metadata:t,entitiesMap:d,connections:u,relationsState:m,relationViewsIds:c}),y=x_({metadata:t,modifiedEntities:d,connections:u,errors:g});return y.length&&(yield(0,Va.gz)(Eb(y))),g}}return[]}function*L_(){const e=yield(0,Va.RE)(__),[t,r]=yield(0,Va.$6)([(0,Va.RE)(I_),(0,Va.RE)(k_)]),n=(0,_.uniqBy)(x.getErrorUniqKey,[...e,...t,...r]),a=yield(0,Va.Ys)(xI.selectors.getEntityUri),i=yield(0,Va.Ys)(xI.selectors.getHiddenAttributes),o=(null==i?void 0:i[a])||[],l=(0,x.filterErrorsForHiddenAttributes)(n,o);return yield(0,Va.gz)(ww(n)),0===l.filter(x.isCriticalError).length}let U_=function(e){return e.PROFILE_VIEWS_SET="PROFILE_VIEWS_SET",e}({});const j_=nb(U_.PROFILE_VIEWS_SET);function F_(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){M_(e,t,r[t])}))}return e}function M_(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*V_(e){const t=yield(0,Va.Ys)(xI.selectors.getMetadata),r=yield(0,Va.Ys)(xI.selectors.getMode);switch(e.type){case VS.OPEN_RELATION_EDITOR:{const{id:n,connection:a}=e.payload;a.relation.relationType&&(yield(0,Va.gz)(bb({viewId:n,metadata:t,mode:r,parentUri:a.relation.object.uri})));break}case hb.ADD_ATTRIBUTES:{const n=e.payload;for(const e of n){const{attributeType:n,parentUri:a,viewId:i}=e;(0,x.isComplexAttribute)(n)&&(yield(0,Va.gz)(bb({viewId:i,attributeType:n,parentUri:a,metadata:t,mode:r})))}break}case VS.SET_RELATION_TYPE:{const{id:n,relationUri:a}=e.payload;yield(0,Va.gz)(bb({viewId:n,metadata:t,mode:r,parentUri:a}));break}case kA.TREE_NODE_RELATION_TYPE_CHANGED:{var n;const{id:a,node:i}=e.payload;yield(0,Va.gz)(bb({viewId:a,metadata:t,mode:r,parentUri:null==i||null===(n=i.relation)||void 0===n?void 0:n.uri}));break}}}function*B_(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const r=yield(0,Va.Ys)(tC),n=(0,x.getNotAppliedTreeCommands)(null==r?void 0:r.trees),a=yield(0,Va.Ys)(iC),i=(0,x.optimizeCommands)([...a,...n]);if(null!=i&&i.length){const r=(0,_.when)((0,_.always)(t),(0,x.replaceTempUriInCommands)(t))(i);yield(0,Va.RE)(e,r),yield(0,Va.gz)(LA())}}function*z_(e){var t;const r=yield(0,Va.Ys)(_O),n=yield(0,Va.Ys)(IO),a=yield(0,Va.Ys)(qO,n),i=yield(0,Va.Ys)(OO),o=(0,x.getEntityType)(i,r.type),l=null===(t=null==o?void 0:o.forceOvForUiUpdates)||void 0===t||t,s=(0,x.collectAllDiffs)(r,a,l);return(0,x.prepareAttrDiff)(e,s)}function*H_(e){const t=yield(0,Va.Ys)(jO),r=yield(0,Va.Ys)($O),n=yield(0,Va.Ys)(IO),a=yield(0,Va.Ys)(qO,n),i=(0,x.findAllTemporaryRefEntityURI)(a),o=(0,_.concat)(i,t);return yield(0,Va.RE)(x.saveTemporaryEntities,r,o,e)}function*Y_(e,t,r){const n=e.getDCRObjectUris(),a=yield(0,Va.Ys)(EC),i=yield(0,Va.Ys)(vC),o=yield(0,Va.Ys)(dC);if(null!=n&&n.length){const l=yield(0,Va.RE)(x.startProcessInstance,{workflowPath:a,processType:t?"authoring":"dataChangeRequestReview",objectURIs:(0,_.uniq)([r,...n,e.getDCRUri()]).filter((0,_.complement)(_.isNil)),tenant:o,environment:i});"OK"!==(null==l?void 0:l.status)&&console.warn(l)}}function*W_(e,t,r,n){const a=yield(0,Va.Ys)(UO,r),i=(0,x.createRelationsCommandsFromConnections)(a,n,t);i.length&&(yield(0,Va.RE)(e,i))}function*G_(e,t,r){const n=yield(0,Va.Ys)(BO),a=yield(0,Va.Ys)(IO);for(const i of n)yield(0,Va.rM)(W_,e,r||a,i,t)}function*q_(e){if(!e.hasNewUri())return;const t=yield(0,Va.Ys)(tC);for(const[r,n]of Object.entries(t.trees))if(n.root){const t=t=>(0,_.when)((0,_.prop)("uri"),(0,_.assoc)("uri",e.getUri(null==t?void 0:t.uri)))(t),a=(0,x.mapTree)(n.root,{nodeProcessing:e=>(0,_.pipe)((e=>F_({},e)),(0,_.unless)((0,_.has)("editingMode"),(0,_.evolve)({relation:t,relations:(0,_.map)(t)})))(e)});(0,_.equals)(n.root,a)||(yield(0,Va.gz)(UA({id:r,tree:a})))}}function*Z_(){try{var e;const t=yield(0,Va.Ys)(Hx),{commandExecutor:r,dcrProcessor:n,relationUriProcessor:a}=(0,x.createCommandExecutor)({alwaysCreateDCR:t,dcrUri:null}),i=yield(0,Va.RE)(H_,n);yield(0,Va.$6)([(0,Va.RE)(B_,r),(0,Va.RE)(G_,r,i)]),yield(0,Va.RE)(q_,a);const o=yield(0,Va.RE)(z_,i),l=yield(0,Va.Ys)(IO),s=yield(0,Va.Ys)(xI.selectors.getMetadata),c=(0,x.hasAttributeMasking)(s);let u;if(null!=o&&o.length&&(u=yield(0,Va.RE)(x.entityCumulativeUpdate,{uri:l,diff:o,uriPreprocessor:n.enhanceUriWithDCR,sendMasked:c})),t||(0,x.isChangeRequestUri)(null===(e=u)||void 0===e?void 0:e.uri))u&&n.updateDCRUriFromResponse(u),yield(0,Va.RE)(Y_,n,!1,l),yield(0,Va.gz)(jA()),c&&(yield(0,Va.RE)(nI,!0)),window.alert(mi().text("Your changes are saved as pending and have been sent for review"));else if(u){yield(0,Va.gz)(cw(u));const{trees:e}=yield(0,Va.Ys)(xI.selectors.getTrees),t=(0,x.updateTreesWithNewEntity)((0,_.pick)(["uri","label","secondaryLabel","type"],u),e);for(const e of t)yield(0,Va.gz)(UA({id:e.id,tree:e.root}))}else!u&&c&&(yield(0,Va.RE)(nI,!0));yield(0,Va.gz)(Zw(x.Mode.Viewing)),yield(0,Va.gz)(Rb())}catch(e){yield(0,Va.gz)(Wv((0,x.getRequestErrorMessage)(e,mi().text("Something went wrong"))))}}function*$_(){yield(0,Va.qn)(sw.ENTITY_LOADED),yield(0,Va.gz)(Rb())}function*K_(e,t){const r=yield(0,Va.Ys)(IO),n=yield(0,Va.Ys)(xI.selectors.getModifiedEntity,r),{commandExecutor:a,dcrProcessor:i}=(0,x.createCommandExecutor)({alwaysCreateDCR:t,dcrUri:e}),o=yield(0,Va.RE)(H_,i),l=yield(0,Va.RE)(x.saveTemporaryEntity,n,o,i);return yield(0,Va.$6)([(0,Va.RE)(B_,a,{[r]:l}),(0,Va.RE)(G_,a,o,l)]),{savedEntityUri:l,dcrProcessor:i}}function*X_(){const e=yield(0,Va.Ys)(IO),t=yield(0,Va.Ys)(xI.selectors.getModifiedEntity,e);if((0,x.isEmptyEntity)(t)){const e=(0,Ke.x0)();return yield(0,Va.gz)(vv({id:e,text:mi().text("Please fill out some fields."),actions:[]})),!1}return!0}function*Q_(){try{const e=yield(0,Va.Ys)(Hx);if(!(yield(0,Va.RE)(X_)))return;const{dcrProcessor:t,savedEntityUri:r}=yield(0,Va.RE)(K_,null,e);e&&(yield(0,Va.RE)(Y_,t),window.alert(mi().text("Your changes are saved as pending and have been sent for review"))),yield(0,Va.gz)(Zw(x.Mode.Viewing)),e?(yield(0,Va.gz)(bv()),yield(0,Va.gz)(Ew())):(yield(0,Va.gz)(fv({uri:r})),yield(0,Va.rM)($_))}catch(e){yield(0,Va.gz)(Wv((0,x.getRequestErrorMessage)(e,mi().text("Something went wrong"))))}}function*J_(e){const t=yield(0,Va.RE)(x.getDataChangeRequest,e),r=(0,_.pipe)((0,_.prop)("changes"),_.values,_.flatten,(0,_.pluck)("id"))(t);try{yield(0,Va.$6)(r.map((t=>(0,Va.RE)(x.deleteChangeRequestItem,{dcrUri:e,changeItemId:t}))))}catch(e){yield(0,Va.gz)(Wv((0,x.getRequestErrorMessage)(e,mi().text("Something went wrong"))))}}function*eI(e){const{dcrUri:t,action:r,taskId:n}=e.payload;try{if(!(yield(0,Va.RE)(X_)))return;if(yield(0,Va.gz)(O_(x.Operation.Saving)),yield(0,Va.RE)(J_,t),yield(0,Va.RE)(K_,t,!0),"Approve"!==r||(yield(0,Va.RE)(L_))){const e=yield(0,Va.Ys)(EC),t=yield(0,Va.Ys)(vC),a=yield(0,Va.Ys)(dC);yield(0,Va.RE)(x.runTaskAction,{workflowPath:e,environment:t,tenant:a,taskId:n,action:r}),yield(0,Va.gz)(yw())}}catch(e){yield(0,Va.gz)(Wv((0,x.getRequestErrorMessage)(e,mi().text("Something went wrong"))))}yield(0,Va.gz)(O_(null))}function*tI(e){const{dcrUri:t,userAction:r}=e.payload,n=yield(0,Va.Ys)(Vx);try{if(!(yield(0,Va.RE)(X_)))return;yield(0,Va.gz)(Zw("saveDraft"===r?x.Mode.Suggesting:x.Mode.Editing,!0)),yield(0,Va.gz)(O_(x.Operation.Saving));const e=yield(0,Va.RE)(L_);if("saveDraft"===r){if(t)yield(0,Va.RE)(J_,t),yield(0,Va.RE)(K_,t,!0);else{const{dcrProcessor:e}=yield(0,Va.RE)(K_,null,!0);yield(0,Va.RE)(Y_,e,!0);const t=e.getDCRUri();yield(0,Va.gz)(zv({url:"../authoring",searchParams:{entityUri:`${t}`},options:{replace:!0,state:{keepErrors:!0}}}))}window.alert(mi().text("Your changes are saved as pending and have been sent for review"))}else if(e){const{savedEntityUri:e}=yield(0,Va.RE)(K_,null,!1);yield(0,Va.gz)(Zw(x.Mode.Viewing)),yield(0,Va.gz)(fv({uri:e})),yield(0,Va.rM)($_)}else e||(yield(0,Va.gz)(Zw(n,!0)))}catch(e){yield(0,Va.gz)(Zw(n,!0)),yield(0,Va.gz)(Wv((0,x.getRequestErrorMessage)(e,mi().text("Something went wrong"))))}yield(0,Va.gz)(O_(null))}function*rI(){if(yield(0,Va.gz)(O_(x.Operation.Saving)),yield(0,Va.RE)(L_)){const e=yield(0,Va.Ys)(IO);(0,x.isTempUri)(e)?yield(0,Va.RE)(Q_):yield(0,Va.RE)(Z_)}yield(0,Va.gz)(O_(null))}function*nI(e){try{let t;if(e){const e=yield(0,Va.Ys)(xI.selectors.getMetadata);t=(0,x.addMetadataSpecificGetEntityOptions)(e)}yield(0,Va.gz)(O_(x.Operation.Fetching));const r=yield(0,Va.Ys)(IO),n=yield(0,Va.RE)(x.getEntity,r,t);if(!n)throw new Error("Failed to request entity");return yield(0,Va.gz)(cw(n,!0)),n}catch(e){throw yield(0,Va.gz)(Wv((0,x.getRequestErrorMessage)(e,mi().text("Something went wrong")))),e}finally{yield(0,Va.gz)(O_(null))}}function*aI(e){const{mode:t,silent:r}=e.payload;try{if(t!==x.Mode.Viewing&&!r){const e=yield(0,Va.Ys)(xI.selectors.getEntity),r=yield(0,Va.Ys)(xI.selectors.getModifiedEntity,null==e?void 0:e.uri),n=yield(0,Va.Ys)(xI.selectors.getMetadata);if(e&&!r&&n){const r=yield(0,Va.Ys)(xI.selectors.getProfileViews),a=yield(0,Va.Ys)(xI.selectors.getUIConfig),i=yield(0,Va.Ys)(xI.selectors.getUserRoles),o=(0,x.addToEntityRequiredAttributes)({entity:e,metadata:n,mode:t,attrTypeFilter:(0,_.both)((0,x.isAvailableAttributeTypeForProfile)(r||[]),(0,x.getProfileAttributeConfigPermissionsChecker)(a,e.type,i,[x.ConfigPermissions.READ,x.ConfigPermissions.CREATE]))});yield(0,Va.gz)(tA(o));const l=yield(0,Va.Ys)(xI.selectors.getModifiedEntities),s=yield(0,Va.Ys)(xI.selectors.getProfileErrors),c=x_({metadata:n,modifiedEntities:l,errors:s});c.length&&(yield(0,Va.gz)(Eb(c)))}}}catch(e){yield(0,Va.gz)(Zw(x.Mode.Viewing,!0))}}function*iI(e){const{entityTypeUri:t}=e.payload,r=yield(0,Va.Ys)(xI.selectors.getMetadata),n=(0,x.getEntityType)(r,t),a=yield(0,Va.Ys)(xI.selectors.getUIConfig),i=yield(0,Va.Ys)(xI.selectors.getUserRoles),o=(0,x.getProfileAttributeConfigPermissionsChecker)(a,t,i,[x.ConfigPermissions.READ,x.ConfigPermissions.CREATE]),l=((null==n?void 0:n.attributes)||[]).filter((e=>o(e))),s=(0,x.checkMetadataForCreate)(x.Mode.Editing,n)?x.Mode.Editing:x.Mode.Suggesting,c=(0,x.createTemporaryEntity)({entityTypeUri:t,attributeTypes:l,metadata:r,mode:s});yield(0,Va.gz)(hv({entity:c})),yield(0,Va.gz)(cw(c)),yield(0,Va.gz)(Zw(x.Mode.Viewing)),yield(0,Va.gw)(0),(yield(0,Va.Ys)(xI.selectors.getProfileViews))||(yield(0,Va.qn)(U_.PROFILE_VIEWS_SET)),yield(0,Va.gz)(Zw(s)),yield(0,Va.gz)(FA())}function*oI(e){const t=yield(0,Va.Ys)(xI.selectors.getMetadata),r=yield(0,Va.Ys)(xI.selectors.getAuthoringByEntityType,e),n=(0,x.getPreparedAuthoringItems)(t,r,e).map((e=>{let{views:t}=e;return t})).flat();yield(0,Va.gz)(j_(n))}function*lI(e){const{entityTypeUri:t}=e.payload,r=yield(0,Va.Ys)(xI.selectors.getMetadata),n=(0,x.getEntityType)(r,t),a=(0,_.prop)("attributes",n),i=(yield(0,Va.Ys)(xI.selectors.getCanSuggestAuthoring,n))?x.Mode.Suggesting:x.Mode.Editing,o=(0,x.createTemporaryEntity)({entityTypeUri:t,attributeTypes:a,metadata:r,mode:i});yield(0,Va.gz)(Vv({entity:o})),yield(0,Va.gz)(cw(o)),yield(0,Va.RE)(oI,o.type),yield(0,Va.gz)(Zw(i))}function*sI(e){const{mainEntityUri:t,tempEntities:r,keepErrors:n}=e.payload,[[a],i]=(0,_.partition)((0,_.propEq)("uri",t),r);yield(0,Va.gz)(cw(a,n)),yield(0,Va.RE)(oI,a.type),yield(0,Va.gz)(Zw(x.Mode.Suggesting));for(const e of i)yield(0,Va.gz)(tA(e))}function*cI(e){const{payload:{entityUri:t,data:r}}=e;yield(0,Va.gz)(O_(x.Operation.Cloning));try{const e=yield(0,Va.RE)(x.cloneEntity,t,r);yield(0,Va.gz)(hv({entity:e})),yield(0,Va.gz)(cw(e)),yield(0,Va.gz)(Zw(x.Mode.Editing)),yield(0,Va.gz)(FA());const n=(0,Ke.x0)(),a=yield(0,Va.Ys)(xI.selectors.getMetadata),i=(0,x.getEntityType)(a,e.type),o=(0,x.checkMetadataForDelete)(x.Mode.Editing,i);yield(0,Va.gz)(vv({id:n,type:"cloneAction",autoHideDuration:1e4,text:mi().text("Profile is cloned successfully. You can modify the attributes if required."),actions:o?[{label:mi().text("Undo"),needConfirmation:!0,confirmationText:mi().text("Are you sure you want to undo the cloning process?"),confirmationDescription:mi().text("Undoing the cloning process will delete the cloned profile. Are you sure you want to proceed?"),applyAction:fw({entityUri:e.uri}),cancelAction:Tv(n)}]:[]}))}catch(e){yield(0,Va.gz)(Wv((0,x.getRequestErrorMessage)(e,mi().text("Something went wrong"))))}yield(0,Va.gz)(O_(null))}function*uI(e){const{entityUri:t}=e.payload;if(!(0,x.isTempUri)(t))try{yield(0,Va.RE)(x.removeEntity,t),yield(0,Va.gz)(Ev())}catch(e){yield(0,Va.gz)(Wv((0,x.getRequestErrorMessage)(e,mi().text("Something went wrong"))))}}function*pI(e){const t=e.payload;try{if((yield(0,Va.Ys)(pC))&&!confirm(mi().text("Are you sure you want to cancel changes for this Profile?")))return;const e=yield(0,Va.Ys)(Vx),r=yield(0,Va.Ys)(xI.selectors.getMetadata),n=yield(0,Va.Ys)(IO),a=(0,x.hasAttributeMasking)(r),i=(0,x.isTempUri)(n),o=(0,x.isViewMode)(t),l=(0,x.isEditableMode)(e)&&(0,x.isViewMode)(t),s=(0,x.isViewMode)(e)&&(0,x.isEditableMode)(t);(l||s)&&a&&!i&&(yield(0,Va.RE)(nI,o)),yield(0,Va.gz)(Zw(t)),l&&(yield(0,Va.gz)(Kw()))}catch{}}const dI=[function*(){yield(0,Va.A7)([Lb.MODE_UPDATE_REQUESTED],pI)},function*(){yield(0,Va.A7)([hb.RUN_AUTHORING_TASK_ACTION],eI)},function*(){yield(0,Va.ib)([VS.OPEN_RELATION_EDITOR,hb.ADD_ATTRIBUTES,VS.SET_RELATION_TYPE,kA.TREE_NODE_RELATION_TYPE_CHANGED],V_)},function*(){yield(0,Va.A7)([hb.SAVE_PROFILE],rI)},function*(){yield(0,Va.ib)([Lb.MODE_UPDATED],aI)},function*(){yield(0,Va.ib)([sw.ENTITY_CREATION_REQUESTED],iI)},function*(){yield(0,Va.Fm)([hb.VALIDATE_PROFILE],L_)},function*(){yield(0,Va.ib)([sw.ENTITY_REMOVE_REQUESTED],uI)},function*(){yield(0,Va.ib)([sw.CLONE_ENTITY],cI)},function*(){yield(0,Va.ib)([sw.ENTITY_CREATION_WITH_AUTHORING_REQUESTED],lI)},function*(){yield(0,Va.ib)([sw.ENTITY_AUTHORING_DRAFT_ENTITIES_LOADED],sI)},function*(){yield(0,Va.A7)([hb.SAVE_DRAFT],tI)}];let mI=function(e){return e.SIDE_PANEL_VIEWS_LOADED="SIDE_PANEL_VIEWS_LOADED",e}({});nb(mI.SIDE_PANEL_VIEWS_LOADED);const gI=[];let yI=function(e){return e.HIDDEN_ATTRIBUTES_UPDATED="HIDDEN_ATTRIBUTES_UPDATED",e.HIDDEN_ATTRIBUTES_RESET="HIDDEN_ATTRIBUTES_RESET",e}({});const fI=nb(yI.HIDDEN_ATTRIBUTES_UPDATED),hI=nb(yI.HIDDEN_ATTRIBUTES_RESET),EI={};let bI=function(e){return e.CONTROL_ATTRIBUTES_UPDATED="CONTROL_ATTRIBUTES_UPDATED",e}({});const vI=nb(bI.CONTROL_ATTRIBUTES_UPDATED),TI=[],OI=(0,R.combineReducers)({dependentLookups:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Fb,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Lb.MODE_UPDATED:{const{mode:r,silent:n}=t.payload;return(0,x.isViewMode)(r)&&!n?Fb:e}case Ib.DEPENDENT_LOOKUPS_STRUCTURE_SET:return Ub({},e,{structure:t.payload});case Ib.DEPENDENT_LOOKUPS_INITED_TYPE_URIS_ADDED:{const r=t.payload;return Ub({},e,{initedTypeUris:(0,_.uniq)(e.initedTypeUris.concat(r))})}case Ib.DEPENDENT_LOOKUPS_EDITORS_BLOCKED:{const{uris:r,isBlocked:n}=t.payload,a=e.editors,i=r.reduce(((e,t)=>Ub({},e,{[t]:Ub({},e[t],{isBlocked:n})})),a);return Ub({},e,{editors:i})}case Ib.DEPENDENT_LOOKUPS_EDITOR_TOUCHED:{const{uri:r,isTouched:n}=t.payload;return(0,_.assocPath)(["editors",r,"isTouched"],n,e)}default:return e}},entity:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:xw,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case sw.ENTITY_LOADED:return t.payload.entity;case sw.DEFAULT_PROFILE_PIC_SET:return"object"==typeof t.payload&&null!==t.payload?Tw({},e,{defaultProfilePic:t.payload.uri,defaultProfilePicValue:t.payload}):e;case hb.ADD_NEXT_PAGE_ATTRIBUTE_VALUES:{const{parentUri:r,attributeTypeName:n,attributeTypeUri:a,values:i}=t.payload,o=(0,x.getAttributeSource)(a);if(r===e.uri){const t=(0,_.lensPath)([o,n]);return(0,_.over)(t,(0,_.pipe)((0,_.defaultTo)([]),(0,_.concat)(_.__,i)),e)}return e}case sw.CLEAR_ENTITY:return xw;default:return e}},errors:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_w,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Cw.ERRORS_SET:return t.payload;case Cw.ERROR_DEACTIVATED:{const r=t.payload,n=e.findIndex((e=>(0,x.getErrorId)(e)===r)),a=(0,_.lensPath)([n]);return(0,_.over)(a,(0,_.assoc)("deactivated",!0),e)}case hb.REMOVE_ATTRIBUTE:{const{uri:r}=t.payload;return e.map((e=>e.uri===r||(0,x.areOneHierarchyUris)(e.parentUri,r)?Aw({},e,{deactivated:!0}):e))}case Lb.MODE_UPDATED:{const{mode:r,silent:n}=t.payload;return(0,x.isViewMode)(r)&&!n?_w:e}case sw.ENTITY_LOADED:{const{silent:r}=t.payload;return r?e:_w}default:return e}},history:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Mw,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Iw.HISTORY_DIFF_SET:return jw({},e,{diff:t.payload});case Iw.HISTORY_DIFF_CLEARED:return jw({},e,{diff:Mw.diff});case Iw.HISTORY_EVENT_SET:return jw({},e,{event:t.payload});case ub.NEW_ENTITY_SHOWN:case ub.OPEN_ENTITY:case Iw.HISTORY_EVENT_CLEARED:return jw({},Mw,{mode:e.mode});case Iw.HISTORY_SLICE_SET:return jw({},e,{slice:t.payload});case Iw.HISTORY_MODE_SET:return jw({},e,{mode:t.payload});default:return e}},lastLoadedTime:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Vw.PROFILE_LAST_LOADED_TIME_UPDATE:case sw.ENTITY_LOADED:return Date.now();default:return e}},lookups:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:qw,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Bw.LOOKUPS_LOADED:return t.payload;case Bw.LOOKUPS_FOR_TYPE_RESOLVED:{const{type:r,values:n}=t.payload;return Ww({},e,{[r]:Ww({},e[r],n)})}case Bw.LOOKUPS_LIST_RESOLVED:return t.payload.reduce(((e,t)=>Object.keys(t).reduce(((e,r)=>Ww({},e,{[r]:Ww({},e[r],t[r])})),e)),e);case"UI_RESET":return Ww({},qw);default:return e}},mode:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:eA,t=arguments.length>1?arguments[1]:void 0;return t.type===Lb.MODE_UPDATED?t.payload.mode:e},modifiedEntities:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:sA,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case MS.MODIFIED_ENTITY_CREATED:{const r=t.payload;return oA({},e,{[r.uri]:r})}case MS.MODIFIED_ENTITY_DELETED:{const r=t.payload;return(0,_.omit)([r],e)}case MS.MODIFIED_ENTITIES_RESET:return sA;case Lb.MODE_UPDATED:{const{silent:r}=t.payload;return r?e:sA}case MS.MODIFIED_ENTITY_DEFAULT_PROFILE_PIC_SET:{const{entityUri:r,value:n}=t.payload;return r?oA({},e,{[r]:oA({},e[r],{defaultProfilePic:n.uri,defaultProfilePicValue:n})}):e}case hb.ADD_ATTRIBUTES:return t.payload.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:a}=t,i=(0,x.getBaseUri)(n);if((0,x.isEntityUri)(i)){const t=e[i];return e[i]||console.error(`ADD_ATTRIBUTES. parentUri - ${n}, state: ${JSON.stringify(e)}`),(0,x.isEntitySpecialAttrType)(r)?oA({},e,{[i]:(0,x.addEntitySpecialAttribute)({entity:t,attributeType:r})}):oA({},e,{[i]:(0,x.addAttribute)({entity:t,attributeType:r,parentUri:n,index:a})})}return e}),e);case hb.ADD_NEXT_PAGE_ATTRIBUTE_VALUES:{const{parentUri:r,attributeTypeName:n,attributeTypeUri:a,values:i}=t.payload,o=(0,x.getAttributeSource)(a);if((0,x.isEntityUri)(r)&&r in e){const t=(0,_.lensPath)([r,o,n]);return(0,_.over)(t,(0,_.pipe)((0,_.defaultTo)([]),(0,_.concat)(_.__,i)),e)}return e}case hb.MODIFY_ATTRIBUTE:{const{attributeType:r,uri:n,value:a}=t.payload,i=(0,x.getBaseUri)(n);if((0,x.isEntityUri)(i)){const t=e[i];return e[i]&&e[i].attributes||console.error(`MODIFY_ATTRIBUTE. uri - ${n}, state: ${JSON.stringify(e)}`),(0,x.isEntitySpecialAttrType)(r)?oA({},e,{[i]:(0,x.editEntitySpecialAttribute)({entity:t,attributeType:r,value:a})}):oA({},e,{[i]:(0,x.editAttribute)({entity:t,attributeType:r,uri:n,value:a})})}return e}case hb.REMOVE_ATTRIBUTE:{const{attributeType:r,uri:n}=t.payload,a=(0,x.getBaseUri)(n);if((0,x.isEntityUri)(n)){const t=e[a];return e[a]||console.error(`REMOVE_ATTRIBUTE. uri - ${n}, state: ${JSON.stringify(e)}`),(0,x.isEntitySpecialAttrType)(r)?oA({},e,{[a]:(0,x.removeEntitySpecialAttribute)({entity:t,attributeType:r})}):oA({},e,{[a]:(0,x.removeAttribute)({entity:t,attributeType:r,uri:n})})}return e}case hb.ADD_DEFAULT_VALUES:{const{attributeType:r,parentUri:n,metadata:a,mode:i}=t.payload,o=(0,x.getBaseUri)(n);if((0,x.isEntityUri)(o)){const t=(0,x.getEditableAttributeTypeSubAttributes)(a,r);return(0,_.over)((0,_.lensProp)(o),(0,x.addDefaultValuesToComplexAttribute)({attributeType:r,subAttributes:t,metadata:a,mode:i,parentUri:n}),e)}return e}default:return e}},relations:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_A,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case sw.ENTITY_LOADED:{const{silent:r}=t.payload;return r?e:_A}case VS.RELATIONS_LOADED:{const{id:r,connections:n=[],total:a,mode:i}=t.payload;return(0,_.pipe)((0,_.assocPath)([r,"connections"],n),(0,_.assocPath)([r,"total"],a),(0,_.when)((0,_.both)((0,_.complement)((0,_.hasPath)([r,"drafts"])),(0,_.always)((0,x.isEditableMode)(i))),(0,_.assocPath)([r,"drafts"],IA)))(e)}case VS.SECOND_LEVEL_RELATIONS_LOADED:{const{id:r,connections:n,parentEntityUri:a,total:i}=t.payload,o=(0,_.path)([r,"connections"],e).map((e=>{const{entityUri:t}=e.entity;return t===a?AA({},e,{total:i,connections:n.map((e=>AA({},e,{parentEntityUri:a})))}):e}));return(0,_.assocPath)([r,"connections"],o,e)}case Lb.MODE_UPDATED:{const{mode:r,silent:n}=t.payload;return n?e:(0,_.map)(Qw(r)?(0,_.omit)(["drafts","relationsToEdit","relationToAdd"]):(0,_.assoc)("drafts",IA),e)}case VS.REMOVE_RELATION:{const{id:r,relationUri:n}=t.payload,a=(0,_.pipe)(x.getRelationUriFromConnection,(0,_.equals)(n)),i=(0,_.path)([r,"connections"],e),o=!((0,x.isTempUri)(n)||null!=i&&i.some((e=>e.suggested&&e.relation.relationUri===n)));return(0,_.evolve)({[r]:{drafts:(0,_.evolve)({removedUris:o?(0,_.append)(n):_.identity,addedConnections:(0,_.reject)(a),editedConnections:(0,_.reject)(a)})}},e)}case VS.IGNORE_RELATION:{const{id:r,ignoredRelationData:n}=t.payload;return(0,_.evolve)({[r]:{drafts:(0,_.evolve)({ignoredRelationData:(0,_.append)(n)})}},e)}case VS.ADD_RELATION:{const{id:r,connection:n}=t.payload,a=(0,_.omit)(["isNew"],n);return(0,_.evolve)({[r]:(0,_.pipe)((0,_.when)((0,_.propSatisfies)(_.isNil,"drafts"),(0,_.assocPath)(["drafts"],IA)),(0,_.evolve)({drafts:{addedConnections:(0,_.prepend)(a)}}))},e)}case VS.EDIT_RELATION:{const{id:r,connection:n}=t.payload,a=(0,_.eqBy)(x.getRelationUriFromConnection,n);if((0,x.isTempUri)((0,x.getRelationUriFromConnection)(n))){const t=e=>{const t=e.findIndex(a);return t>=0?(0,_.update)(t,n,e):e};return(0,_.evolve)({[r]:{drafts:(0,_.evolve)({addedConnections:t})}},e)}{const t=e=>{const t=e.findIndex(a);return t>=0?(0,_.update)(t,n,e):[...e,n]};return(0,_.evolve)({[r]:{drafts:(0,_.evolve)({editedConnections:t})}},e)}}case VS.OPEN_RELATION_EDITOR:{const{id:r,connection:n}=t.payload,a=n.initial?n:AA({},n,{initial:{connection:n}});if(a.isNew){const t=(0,x.getRelationToAddPath)(r);return(0,_.path)(t,e)?e:(0,_.assocPath)(t,a,e)}{const t=(0,_.lensPath)((0,x.getRelationsToEditPath)(r)),n=(0,_.eqBy)((0,_.path)(["relation","relationUri"]),a);return(0,_.over)(t,(0,_.pipe)((0,_.defaultTo)([]),(0,_.unless)((0,_.find)(n),(0,_.append)(a))),e)}}case VS.SET_INITIAL_INFO:{const{id:r,relationUri:n,tempEntity:a}=t.payload,i=NA(r,n,e);return(0,_.assocPath)([...i,"initial","modifiedEntity"],a,e)}case VS.CLOSE_RELATION_EDITOR:{const{id:r,relationUri:n}=t.payload,a=(0,_.pathEq)(["relation","relationUri"],n);return(0,_.evolve)({[r]:{relationToAdd:(0,_.when)(a,(0,_.always)(null)),relationsToEdit:(0,_.reject)(a)}},e)}case VS.SET_RELATION_TYPE:{const{id:r,relationUri:n,relationType:a}=t.payload,i=NA(r,n,e);if(i){const t=[...i,"relation"],r=(0,_.lensPath)(t);return(0,_.over)(r,(0,x.applyRelationTypeObject)(a),e)}return e}case hb.ADD_ATTRIBUTES:return t.payload.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:a,viewId:i}=t,o=(0,x.getBaseUri)(n),l=DA(i,o,e);if(l&&(0,x.isRelationUri)(o)){if((0,x.isActivenessAttrType)(r)){const t=(0,_.view)(l,e),n=(0,x.addEntitySpecialAttribute)({entity:t,attributeType:r});return(0,_.set)(l,n,e)}{const t=PA(i,o,e),l=(0,_.view)(t,e);l||console.error(`relations.ADD_ATTRIBUTES. viewId - ${i}, relationUri - ${o}, state: ${JSON.stringify(e)}`);const s=(0,x.addAttribute)({entity:l,attributeType:r,parentUri:n,index:a});return(0,_.set)(t,s,e)}}return e}),e);case hb.ADD_NEXT_PAGE_ATTRIBUTE_VALUES:{const{parentUri:r,attributeTypeName:n,values:a,viewId:i}=t.payload;if(!(0,x.isRelationUri)(r))return e;const o=(0,x.getBaseUri)(r),l=NA(i,o,e),s=(0,_.lensPath)([...l,"relation","object","attributes",n]);return(0,_.over)(s,(0,_.pipe)((0,_.defaultTo)([]),(0,_.append)(a)),e)}case hb.MODIFY_ATTRIBUTE:{const{attributeType:r,viewId:n,uri:a,value:i}=t.payload,o=(0,x.getBaseUri)(a),l=DA(n,o,e);if(l&&(0,x.isRelationUri)(o)){if((0,x.isActivenessAttrType)(r)){const t=(0,_.view)(l,e),n=(0,x.editEntitySpecialAttribute)({entity:t,attributeType:r,value:i});return(0,_.set)(l,n,e)}{const t=PA(n,o,e),l=(0,_.view)(t,e);l||console.error(`relations.MODIFY_ATTRIBUTE. viewId - ${n}, relationUri - ${o}, state: ${JSON.stringify(e)}`);const s=(0,x.editAttribute)({entity:l,attributeType:r,uri:a,value:i});return(0,_.set)(t,s,e)}}return e}case hb.REMOVE_ATTRIBUTE:{const{attributeType:r,uri:n,viewId:a}=t.payload,i=(0,x.getBaseUri)(n),o=DA(a,i,e);if(o&&(0,x.isRelationUri)(i)){if((0,x.isActivenessAttrType)(r)){const t=(0,_.view)(o,e),n=(0,x.removeEntitySpecialAttribute)({entity:t,attributeType:r});return(0,_.set)(o,n,e)}{const t=PA(a,i,e),o=(0,_.view)(t,e);o||console.error(`relations.REMOVE_ATTRIBUTE. viewId - ${a}, relationUri - ${i}, state: ${JSON.stringify(e)}`);const l=(0,x.removeAttribute)({entity:o,attributeType:r,uri:n});return(0,_.set)(t,l,e)}}return e}case VS.SET_RELATION_ENTITY:{const{id:r,relationUri:n,entityInfo:a}=t.payload,i=NA(r,n,e);if(i){const t=[...i,"entity"],r=(0,_.lensPath)(t),{uri:n,label:o,type:l}=a,s=(0,_.isEmpty)(a)?{}:{entityUri:n,entityLabel:o,entityType:l,object:{uri:n,label:o,type:l}};return(0,_.set)(r,s,e)}return e}case hb.ADD_DEFAULT_VALUES:{const{viewId:r,attributeType:n,parentUri:a,metadata:i,mode:o}=t.payload,l=(0,x.getBaseUri)(a);if((0,x.isRelationUri)(l)){const t=NA(r,l,e);if(t){if(n){const r=[...t,"relation","object"],l=(0,x.getAttributeTypeSubAttributes)(i,n);return(0,_.over)((0,_.lensPath)(r),(0,x.addDefaultValuesToComplexAttribute)({attributeType:n,subAttributes:l,metadata:i,mode:o,parentUri:a}),e)}{const r=[...t,"relation","object","attributes"],n=[...t,"relation","object","type"],l=(0,_.view)((0,_.lensPath)(n),e),{attributes:s=[]}=(0,x.getRelationType)(i,l);return(0,_.over)((0,_.lensPath)(r),(0,x.addDefaultValuesToAttributes)({metadata:i,mode:o,attributeTypes:s,parentUri:a}),e)}}return e}return e}default:return e}},trees:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:uR,t=arguments.length>1?arguments[1]:void 0;return(0,VA.ZP)(e,(r=>{switch(t.type){case Lb.MODE_UPDATED:{const{mode:e,silent:n}=t.payload;if(n)break;Object.keys(null==r?void 0:r.trees).forEach((e=>{$A(r.trees[e].root,"showDetails",!1)})),(0,x.isViewMode)(e)?(r.common.commands=[],r.initialTrees={}):(0,x.isEditableMode)(e)&&((0,x.isEmptyValue)(r.initialTrees)?r.initialTrees=sR({},r.trees):(r.common.commands=[],r.trees=sR({},r.initialTrees)));break}case Lb.MODE_EDITING_CANCELED:case kA.TREES_RESTORE_FROM_INITIAL_TREES:r.trees=sR({},r.initialTrees);break;case kA.TREES_RESET_INITIAL_TREES:r.initialTrees={};break;case sw.ENTITY_LOADED:{const{silent:r}=t.payload;return r?e:uR}case kA.TREE_LOADED_WITH_ERROR:{const{id:e,errorMessage:n}=t.payload;r.trees[e]=r.trees[e]||{},r.trees[e].errorMessage=n,r.trees[e].loading=!1,delete r.trees[e].root,delete r.trees[e].entitiesMap;break}case kA.TREE_LOADING:{const e=t.payload;r.trees[e]=r.trees[e]||{},r.trees[e].loading=!0;break}case kA.TREE_CHILDREN_LOADING:{const{id:e,parentId:n,nodeId:a}=t.payload,i=r.trees[e].root,o=(0,x.findNodeById)(i,n);o.pending=!1,o.children=(o.children||[]).concat({entity:{},loading:!0,nodeId:a});break}case kA.TREE_CHILDREN_LOADED:{const{children:e,id:n,parentId:a}=t.payload,i=r.trees[n].root,o=(0,x.findNodeById)(i,a);o&&(o.children=WA(o.children,e),delete o.pending);break}case kA.TREE_NODE_REMOVED:{const{id:e,nodeId:n}=t.payload,a=r.trees[e].root,i=(0,x.findParentNodeById)(a,n);GA(i||a,n);break}case kA.TREE_NODE_CREATED:{const{id:e,parentId:n,node:a}=t.payload,i=r.trees[e].root,o=(0,x.findNodeById)(i,n)||i,l=o.children.length;qA(o,a,l);break}case kA.TREE_NODE_EDITED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,x.findNodeById)(a,n.nodeId),o=Object.keys(n);for(const e of o)i[e]=n[e];break}case kA.TREE_NODE_EDITING_STARTED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,x.findNodeById)(a,n.nodeId),o=(0,x.findParentNodeById)(a,n.nodeId);i&&o&&(i.editingMode=x.NODE_EDITING_MODES.editing,i.relatedEntity=o.entity,delete i.loading,i.initialConnection=KA(i),XA({id:e,draft:r.trees,node:i}));break}case kA.TREE_NODE_EDITING_APPLIED:{const{id:e,node:a}=t.payload,i=r.trees[e].root,o=(0,x.findNodeById)(i,a.nodeId),l=tR({id:e,draft:r.trees,relationUri:a.relation.uri});var n;o&&l&&(rR(o),o.entity.uri!==l.entity.uri&&null!==(n=o.children)&&void 0!==n&&n.length&&(delete o.children,o.pending=!0),o.entity=l.entity,o.relation=l.relation,eR({id:e,draft:r.trees,relationUri:a.relation.uri}));break}case kA.TREE_NODE_EDITING_CANCELED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,x.findNodeById)(a,n.nodeId);i&&(rR(i),eR({id:e,draft:r.trees,relationUri:n.relation.uri}));break}case kA.TREE_NODE_NEW_PARENT_EDITING_STARTED:{const{id:e,node:n,newNode:a}=t.payload,i=r.trees[e].root,o=(0,x.findNodeById)(i,n.nodeId);if(a.relatedEntity=o.entity,a.relatedNodeId=o.nodeId,a.editingMode=x.NODE_EDITING_MODES.addingParent,i===o)a.children=[i],r.trees[e].root=a;else{const e=(0,x.findParentNodeById)(i,n.nodeId),t=e.children.findIndex((e=>o===e));qA(e,a,t)}a.initialConnection=KA(a),XA({id:e,draft:r.trees,node:a});break}case kA.TREE_NODE_NEW_PARENT_EDITING_APPLIED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,x.findNodeById)(a,n.nodeId),o=(0,x.findNodeById)(a,n.relatedNodeId),l=tR({id:e,draft:r.trees,relationUri:n.relation.uri});i&&l&&(nR({id:e,draft:r.trees,currentNode:i}),o.parent=o.parent||[],o.parent.push(l.entity.uri),o.relations=o.relations||[],o.relations.push(l.relation),r.trees[e].entitiesMap=oR(r.trees[e].entitiesMap,[o,lR(l)]),eR({id:e,draft:r.trees,relationUri:i.relation.uri}));break}case kA.TREE_NODE_NEW_PARENT_EDITING_CANCELED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,x.findNodeById)(a,n.nodeId);i&&(nR({id:e,draft:r.trees,currentNode:i}),eR({id:e,draft:r.trees,relationUri:i.relation.uri}));break}case kA.TREE_NODE_NEW_CHILD_EDITING_STARTED:{const{id:e,node:n,newNode:a}=t.payload,i=r.trees[e].root,o=(0,x.findNodeById)(i,n.nodeId);a.relatedEntity=o.entity,a.editingMode=x.NODE_EDITING_MODES.addingChild,a.parent=[o.entity.uri],a.directParentUri=o.entity.uri,o.children=o.children||[],o.children.unshift(a),o.expanded=!0,a.initialConnection=KA(a),XA({id:e,draft:r.trees,node:a});break}case kA.TREE_NODE_NEW_CHILD_EDITING_APPLIED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,x.findParentNodeById)(a,n.nodeId),o=(0,x.findNodeById)(i,n.nodeId),l=tR({id:e,draft:r.trees,relationUri:n.relation.uri});i&&o&&l&&(rR(o),o.entity=l.entity,o.relation=l.relation,o.relations=[l.relation],eR({id:e,draft:r.trees,relationUri:n.relation.uri}));break}case kA.TREE_NODE_NEW_CHILD_EDITING_CANCELED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,x.findParentNodeById)(a,n.nodeId);i&&(GA(i,n.nodeId),eR({id:e,draft:r.trees,relationUri:n.relation.uri}));break}case kA.TREE_NODE_RELATION_TYPE_CHANGED:{const{id:e,node:n,relationTypeUri:a}=t.payload,i=tR({id:e,draft:r.trees,relationUri:n.relation.uri}).relation.type;i!==a&&(i&&QA({id:e,draft:r.trees,node:n,entity:null}),JA({id:e,draft:r.trees,node:n,relationTypeUri:a}));break}case kA.TREE_NODE_ENTITY_CHANGED:{const{id:e,node:n,entity:a}=t.payload;QA({id:e,draft:r.trees,node:n,entity:a});break}case hb.ADD_ATTRIBUTES:return t.payload.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:a,viewId:i}=t,o=(0,x.getBaseUri)(n),l=aR(i,o,e.trees);if(l&&(0,x.isRelationUri)(o)){const t=(0,_.view)(l,e.trees);if((0,x.isActivenessAttrType)(r)){const n=(0,x.addEntitySpecialAttribute)({entity:t,attributeType:r});return sR({},e,{trees:(0,_.set)(l,n,e.trees)})}{const i=(0,x.addAttribute)({entity:t,attributeType:r,parentUri:n,index:a});return sR({},e,{trees:(0,_.set)(l,i,e.trees)})}}return e}),e);case hb.MODIFY_ATTRIBUTE:{const{attributeType:r,viewId:n,uri:a,value:i}=t.payload,o=(0,x.getBaseUri)(a),l=aR(n,o,e.trees);if(l&&(0,x.isRelationUri)(o)){const t=(0,_.view)(l,e.trees);if((0,x.isActivenessAttrType)(r)){const n=(0,x.editEntitySpecialAttribute)({entity:t,attributeType:r,value:i});return sR({},e,{trees:(0,_.set)(l,n,e.trees)})}{const n=(0,x.editAttribute)({entity:t,attributeType:r,uri:a,value:i});return sR({},e,{trees:(0,_.set)(l,n,e.trees)})}}return e}case hb.REMOVE_ATTRIBUTE:{const{attributeType:r,uri:n,viewId:a}=t.payload,i=(0,x.getBaseUri)(n),o=aR(a,i,e.trees);if(o&&(0,x.isRelationUri)(i)){const t=(0,_.view)(o,e.trees);if((0,x.isActivenessAttrType)(r)){const n=(0,x.removeEntitySpecialAttribute)({entity:t,attributeType:r});return sR({},e,{trees:(0,_.set)(o,n,e.trees)})}{const a=(0,x.removeAttribute)({entity:t,attributeType:r,uri:n});return sR({},e,{trees:(0,_.set)(o,a,e.trees)})}}return e}case hb.ADD_DEFAULT_VALUES:{const{viewId:r,attributeType:n,parentUri:a,metadata:i,mode:o}=t.payload,l=(0,x.getBaseUri)(a),s=aR(r,l,e.trees);if((0,x.isRelationUri)(l)&&s){if(n){const t=(0,x.getAttributeTypeSubAttributes)(i,n);return sR({},e,{trees:(0,_.over)(s,(0,x.addDefaultValuesToComplexAttribute)({attributeType:n,subAttributes:t,metadata:i,mode:o,parentUri:a}),e.trees)})}{const t=(0,_.compose)(s,(0,_.lensPath)(["attributes"])),r=(0,_.compose)(s,(0,_.lensPath)(["type"])),n=(0,_.view)(r,e.trees),{attributes:l=[]}=(0,x.getRelationType)(i,n);return sR({},e,{trees:(0,_.over)(t,(0,x.addDefaultValuesToAttributes)({metadata:i,mode:o,attributeTypes:l,parentUri:a}),e.trees)})}}return e}case kA.TREE_ENTITIES_MAPPING_LOADED:{const{id:e,entitiesSubMap:n}=t.payload,a=r.trees[e].entitiesMap;r.trees[e].entitiesMap=YA(a,n);break}case kA.TREE_LOADED:{const{tree:e,id:n,graphTypes:a,activenessDate:i,isReversed:o}=t.payload,l=iR(r.trees[n]||{});r.trees[n]=sR({},l,e,{graphTypes:a,activenessDate:i,isReversed:o}),delete r.trees[n].errorMessage,r.trees[n].loading=!1;break}case kA.TREE_SORTED:{const{id:e,typesLabelsMap:n={},sortField:a,sortOrder:i}=t.payload;r.trees[e]=r.trees[e]||{},r.trees[e].sortField=a,r.trees[e].sortOrder=i,r.trees[e].root&&(r.trees[e].root=(0,x.mapTree)(r.trees[e].root,{childrenProcessing:(0,x.sortTreeChildren)({sortField:a,sortOrder:i,typesLabelsMap:n})}));break}case kA.TREE_SECONDARY_LABEL_SHOWN:{const{id:e,show:n}=t.payload;r.trees[e].showSecondaryLabel=n,r.trees[e].root=sR({},r.trees[e].root);break}case kA.TREES_STATE_RESTORED:{const e=t.payload;Object.keys(e).forEach((t=>{r.trees[t]=r.trees[t]||{},r.trees[t]=sR({},r.trees[t],e[t]),r.trees[t].root&&(r.trees[t].root=sR({},r.trees[t].root))}));break}case kA.TREE_CHANGED:{const{id:e,tree:n}=t.payload;r.trees[e].root=n;break}case kA.TREE_REFRESHED:{const e=t.payload;r.trees[e].root=sR({},r.trees[e].root);break}case kA.TREE_NODE_EXPANDED:{const{id:e,nodeId:n}=t.payload,a=r.trees[e].root;(0,x.findNodeById)(a,n).expanded=!0;break}case kA.TREE_CURRENT_ENTITY_SHOWN:{const{id:n,uri:a=(0,_.path)(["entity","uri"],e)}=t.payload;if(r.trees[n]){const e=HA(r.trees[n].root,a);r.trees[n].scrollTo=e}break}case kA.TREE_SCROLL_TO_NODE_RESET:{const e=t.payload;r.trees[e]&&(r.trees[e].scrollTo=null);break}case kA.TREE_ACTIVENESS_DATE_CHANGED:{const{id:e,activenessDate:n}=t.payload;r.trees[e].activenessDate=n;break}case kA.TREE_RELATION_REPOINTED:{const{entity:e,relation:n,newParent:a,isReversed:i}=t.payload,o=(0,_.prop)("uri"),l=o(e),s=o(a),c=(0,x.createRelationRepointCommand)({entityUri:l,relation:n,newEntityUri:s,isReversed:i});r.common.commands.push(c);break}case kA.TREE_RELATION_REMOVED:{const{relationUri:e}=t.payload;if((0,x.isTempUri)(e))r.common.commands=(0,_.reject)((0,x.isRelationCommandForUri)(e),r.common.commands);else{const t=(0,x.createRelationDeleteCommand)({relationUri:e});r.common.commands.push(t)}break}case kA.TREE_RELATION_CREATED:{const{entityUri:e,relation:n,parentEntityUri:a}=t.payload,i=(0,x.createRelationCreateCommand)({parentUri:a,relation:n,entityUri:e});r.common.commands.push(i);break}case kA.TREE_RELATION_EDITED:{const{oldRelation:e,newRelation:n,entityUri:a,newEntityUri:i,isReversed:o}=t.payload,l=i?(0,x.createRelationRepointCommand)({entityUri:a,newEntityUri:i,relation:n,isReversed:o}):(0,x.createRelationUpdateCommand)({oldRelation:e,newRelation:n});r.common.commands.push(l);break}case kA.TREE_COMMANDS_CLEARED:r.common.commands=[];break;case kA.TREE_CANCEL_CHILDREN_LOADING:{const{id:e,parentId:n}=t.payload,a=r.trees[e].root,i=(0,x.findNodeById)(a,n);i&&(i.pending=!0,delete i.expanded,delete i.children);break}}}))},operation:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return t.type===T_.PROFILE_OPERATION_UPDATE?t.payload:e},views:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return t.type===U_.PROFILE_VIEWS_SET?t.payload:e},sidePanelViews:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:gI,t=arguments.length>1?arguments[1]:void 0;return t.type===mI.SIDE_PANEL_VIEWS_LOADED?t.payload:e},entityRelatedAttributes:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:dR,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case pR.ENTITY_RELATED_ATTRIBUTES_ADDED:{const{attributeTypeUri:r,entityUri:n,attributes:a}=t.payload;return(0,_.assocPath)([r,n],a,e)}case Lb.MODE_UPDATED:{const{mode:r,silent:n}=t.payload;return(0,x.isViewMode)(r)&&!n?dR:e}default:return e}},hiddenAttributes:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:EI,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case yI.HIDDEN_ATTRIBUTES_UPDATED:{const{uri:r,hiddenAttributes:n}=t.payload;return(0,_.assoc)(r,n,e)}case yI.HIDDEN_ATTRIBUTES_RESET:return(0,_.dissoc)(t.payload,e);default:return e}},controlAttributes:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:TI,t=arguments.length>1?arguments[1]:void 0;return t.type===bI.CONTROL_ATTRIBUTES_UPDATED?t.payload:e}}),xI={getModule:()=>({id:"mdm",reducerMap:{dataTenants:ib,tenants:sb,metadata:fb,profile:OI,tenant:dO,environment:bO,user:iO,ui:rO,search:yv},sagas:[...yA,...lw,...dI,...pv]}),selectors:c},CI=xI,SI=e=>{let{className:t}=e;const r=(0,Tp.useDispatch)(),n=(0,Tp.useSelector)(ki.qx),a=(0,Tp.useSelector)(CI.selectors.getGoogleMapKey),i=(0,b.useMemo)((()=>((e,t)=>(0,_.when)((0,_.always)(!t),(0,_.reject)((0,_.propEq)("id",K.om.MAP)))(e))([{id:K.om.MAP,tooltipTitle:mi().text("View map"),Icon:tb()},{id:K.om.PROFILE,tooltipTitle:mi().text("View entity details"),Icon:JE()}],a)),[a]);return v().createElement(zE,{className:t,modes:i,modeId:n,onChange:e=>{r(Ni(n!==e?e:null))}})};SI.propTypes={className:vp().string};const wI=SI,AI=()=>v().createElement("div",{className:_d},v().createElement("div",{className:"Headers-styles-title--TvsMA"},mi().text("Profiles")),v().createElement("div",{className:Id},v().createElement(XE,null),v().createElement(wI,{className:Nd})));var RI=r(12932),_I=r.n(RI),II=r(83754),NI=r.n(II);const DI=(0,kp.Z)({tabsRoot:{width:"100%"},tabsScrollButton:{flex:"0 0 24px"},tabRoot:{fontSize:"0.875rem",padding:"7px 18px 5px","@media (min-width: 960px)":{minWidth:"inherit"},"&$disabled":{pointerEvents:"auto"}},labelWrapper:{whiteSpace:"nowrap",letterSpacing:"normal",display:"flex",flexDirection:"row",width:"100%"},label:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",fontWeight:500},disabled:{}});function PI(){return PI=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},PI.apply(this,arguments)}function kI(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}const LI=e=>{let{value:t,tabs:r=[],onChange:n,tabClasses:a}=e,i=kI(e,["value","tabs","onChange","tabClasses"]);const o=DI(),l=(e,t)=>v().createElement("span",{className:o.labelWrapper},v().createElement(gd.Y,{value:e},v().createElement("span",{className:o.label},e)),t);return v().createElement(_I(),PI({value:t,onChange:(e,t)=>n(t),classes:{root:o.tabsRoot,scrollButtons:o.tabsScrollButton},indicatorColor:"primary",textColor:"primary",variant:"scrollable",scrollButtons:!0},i,{allowScrollButtonsMobile:!0}),r.map((e=>{let{label:t,value:r,additionalLabel:n,dataReltioId:i}=e,s=kI(e,["label","value","additionalLabel","dataReltioId"]);return v().createElement(NI(),PI({classes:a||{root:o.tabRoot,disabled:o.disabled},key:r,value:r,label:l(t,n),"data-reltio-id":i},s))})))};function UI(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class jI extends b.PureComponent{constructor(){super(...arguments),this.getTabsData=()=>{const{tenantObject:e,tableViewTabs:t,selectedEntityTypes:r,metadata:n}=this.props,a=(0,Sy.ZK)(t,e);return(0,Pi.nx)(n,a,r).map((e=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){UI(e,t,r[t])}))}return e}({},e,{additionalLabel:v().createElement("span",{className:"Headers-styles-number--trErH"},"(",void 0===e.number?mi().text("N/A"):(0,ci.k7)(e.number),")")})))},this.onTabChange=e=>{this.props.dispatch(Si(e))},this.onSelectColumns=e=>{const{dispatch:t,entityTypeTab:r,columnsForEntityType:n}=this.props;return t(Ci(r,e,n))},this.renderTabs=()=>{const{entityTypeTab:e}=this.props;return v().createElement("div",{className:"Headers-styles-tabsContainer--lhDXc"},v().createElement(LI,{value:e,tabs:this.getTabsData(),onChange:this.onTabChange}))}}render(){const{entityTypeTab:e,columnsForEntityType:t}=this.props;return v().createElement("div",{className:_d},this.renderTabs(),v().createElement("div",{className:Id},v().createElement(kd,{entityTypeUri:e,headColumns:t,onSelectColumns:this.onSelectColumns,"data-reltio-id":"reltio-search-table-add-remove-column",disabled:!e,showForDisabled:!0}),v().createElement(Lg(),{orientation:"vertical",className:"Headers-styles-splitter--sCvn6"}),v().createElement(XE,null),v().createElement(wI,{className:Nd})))}}const FI=(0,Tp.connect)((e=>{const t=(0,ki.o4)(e);return{metadata:k().selectors.getMetadata(e),selectedEntityTypes:(0,D.DX)(e),tableViewTabs:(0,ki.gu)(e),entityTypeTab:t,columnsForEntityType:(0,ki.Gv)(e,t),tenantObject:(0,ui.t9)(e)}}))(jI);function MI(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class VI extends v().PureComponent{constructor(){super(...arguments),this.entitiesTableRef=this.props.basicTableRef||v().createRef(),this.state={resizeDebounceDelay:void 0},this.sortHandle=e=>{let{field:t,order:r}=e;this.props.dispatch((e=>{let{field:t,order:r,entityTypeUri:n}=e;return{type:U.Z.CHANGE_SORT,payload:{field:t,order:r,entityTypeUri:n}}})({field:r?t:null,order:r,entityTypeUri:this.props.entityTypeUri}))},this.reorderingHandle=e=>{let{what:t,where:r}=e;const{entityTypeUri:n,dispatch:a,headColumns:i}=this.props;a(((e,t)=>({type:we,payload:{entityTypeUri:e,columns:t}}))(n,(0,_.move)(t.columnIndex,r.columnIndex,i)))},this.changeColumnsListHandle=e=>{let{columns:t}=e;const{entityTypeUri:r,dispatch:n,headColumns:a}=this.props;n(Ci(r,t,a))},this.changeColumnsSizeHandle=e=>{const{headColumns:t,entityTypeUri:r,dispatch:n}=this.props,a=t.map(((t,r)=>{var n;return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){MI(e,t,r[t])}))}return e}({},t,{size:e[r].size,autoResize:(null!==(n=t.autoResize)&&void 0!==n?n:0!==r)&&!e[r].manuallyChanged})}));n(((e,t)=>({type:Ae,payload:{entityTypeUri:e,columns:t}}))(r,a)),this.setState({resizeDebounceDelay:void 0})},this.logger=e=>{this.props.dispatch({type:"TABLE_LOG",payload:e})}}componentDidUpdate(e){const{headColumns:t,sortField:r,sortOrder:n,entities:a,entityTypeUri:i}=this.props;this.entitiesTableRef.current&&(t.length!==(0,_.path)(["headColumns","length"],e)||(0,_.difference)((0,_.omit)(["size"],t),(0,_.omit)(["size"],e.headColumns)).length>0||r!==e.sortField||n!==e.sortOrder||a!==e.entities)&&this.entitiesTableRef.current.resetScrollbarPosition(),e.entityTypeUri!==i&&this.setState({resizeDebounceDelay:0})}render(){const{entities:e,entityToHighlight:t,onScroll:r,entityTypeUri:n,headColumns:a,sortField:i,sortOrder:o,additionalColumns:l,selectedEntityUri:s,dndColumnReorderingEnabled:c,onEntityClick:u,onEntityHover:p,entitiesImportStatus:d,onEntityImportStatusChange:m}=this.props;return v().createElement(gg,{entities:e,entityToHighlight:t,selectedEntityUri:s,onScroll:r,onSort:this.sortHandle,onEntityClick:u,onEntityHover:p,entityTypeUri:n,headColumns:a,sortField:i,sortOrder:o,dndColumnReorderingEnabled:c,onReorderingColumn:this.reorderingHandle,entitiesTableRef:this.entitiesTableRef,onChangeColumnsList:this.changeColumnsListHandle,onChangeColumnsSize:this.changeColumnsSizeHandle,additionalColumns:l,entitiesImportStatus:d,onEntityImportStatusChange:m,logger:this.logger,resizeDebounceDelay:this.state.resizeDebounceDelay})}}VI.propTypes={entities:vp().array,entityToHighlight:vp().string,selectedEntityUri:vp().string,headColumns:vp().array,onScroll:vp().func,entityTypeUri:vp().string,sortField:vp().string,sortOrder:vp().oneOf([Ld.oy,Ld.U9]),dndColumnReorderingEnabled:vp().bool,dispatch:vp().func,additionalColumns:vp().arrayOf(vp().shape({id:vp().string,label:vp().string})),onEntityClick:vp().func,onEntityHover:vp().func,entitiesImportStatus:vp().object,onEntityImportStatusChange:vp().func,basicTableRef:vp().shape({current:vp().object})},VI.defaultProps={entities:[],headColumns:[]};const BI=(0,Hg.Z)(Pi.oq),zI=(0,Tp.connect)((e=>{const t=(0,ki.tB)(e),r=(0,ki.Gv)(e,t),n=k().selectors.getMetadata(e),a=BI(n,t,r);return{sortField:(0,ui.NW)(e,{entityTypeUri:(0,ki.o4)(e)}),sortOrder:(0,ui.L9)(e,{entityTypeUri:(0,ki.o4)(e)}),dndColumnReorderingEnabled:!(0,ki.Ue)(e),headColumns:r,entityTypeUri:t,additionalColumns:a}}))(VI);var HI=r(14058),YI=r.n(HI);const WI=(0,kp.Z)((()=>({container:{position:"relative",height:"100%",width:"100%"},closeButton:{position:"absolute",top:"7px",left:"7px",zIndex:1}}))),GI=(0,kp.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"}}}))),qI=e=>{let{className:t,entity:r,children:n,classes:a,renderLabel:i=_.identity}=e;const o=GI({classes:a}),l=(0,w.AH)(),s=(0,w.QQ)(),c=(0,b.useCallback)((()=>{navigator.clipboard.writeText((0,x.getEntityId)(r))}),[r]);if((0,_.isNil)(r))return null;const u=(0,x.getLabel)(r.label),p=r.secondaryLabel,d=(0,x.getBusinessCardAttributesText)(l,r),m=(0,x.isActiveObject)(r),g=r.uri,y=(0,x.getEntityId)(r);return v().createElement("div",{className:O()(o.profileBandWrapper,t)},v().createElement("div",{className:O()(o.profileBand,{[o.inactive]:!m}),"data-entity-uri":g},v().createElement(A,{key:r.uri,entity:r,avatarClassName:o.profileIcon,imageClassName:o.imageProfileIcon}),v().createElement("div",{className:o.profileInfo},v().createElement("div",null,v().createElement(Ag(),{variant:"h6",className:o.label},i(u)),p&&v().createElement(Ag(),{variant:"subtitle2",className:o.secondaryLabel},p),d&&v().createElement(Ag(),{variant:"subtitle1",className:o.businessCard},d)),v().createElement("div",{className:o.specialInfo},v().createElement("div",{className:o.entityType},v().createElement(EE,{entity:r,size:"medium",className:o.badge}),!(0,x.isTempUri)(g)&&s&&v().createElement(gf(),{title:mi().text("Copy to clipboard")},v().createElement(Ag(),{display:"inline",variant:"body2",className:o.entityId,onClick:c},mi().text("Entity ID"),": ",y))))),n&&v().createElement("div",null,n)))},ZI=v().createContext(!1);ZI.displayName="BlockImageGalleryDialogContext";var $I=r(31574),KI=r.n($I);const XI=v().createContext([]);var QI=r(24436),JI=r.n(QI);function eN(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){tN(e,t,r[t])}))}return e}function tN(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const rN=(0,kp.Z)((e=>({basicViewPaper:eN({display:"flex",flexDirection:"column"},e.basicView)})));function nN(){return nN=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},nN.apply(this,arguments)}const aN=(0,b.forwardRef)(((e,t)=>{let{children:r,className:n}=e,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["children","className"]);const i=rN();return v().createElement(JI(),nN({ref:t,className:n,classes:{root:i.basicViewPaper}},a),r)}));aN.displayName="BasicView";var iN=r(52574);const oN="1px solid #AFD4E9",lN=(0,kp.Z)({decorator:{marginLeft:8,borderLeft:oN,"&:last-child":{borderLeft:"none","&:before":{borderLeft:oN}},"&:before":{top:0,height:14,width:5,borderBottom:oN,content:'""',display:"block",left:"0"},"&$plain":{"&:before":{width:0}}},plain:{},wrapper:{marginLeft:16,marginTop:-8}}),sN=e=>{let{className:t,children:r,plain:n=!1,enabled:a=!1}=e;const i=lN();return a?v().createElement("div",{"data-reltio-id":"branch-decorator",className:O()(i.decorator,{[i.plain]:n},t)},v().createElement("div",{className:i.wrapper},r)):v().createElement(v().Fragment,null,r)},cN="commentsContainerVisibilityArea",uN=v().createContext([]);uN.displayName="RelatedObjectUrisContext";const pN=v().createContext({comments:[],commentsMap:null,currentComment:null,updateCommentState:_.identity,clearCommentState:_.identity,getCommentState:()=>({}),getComment:_.identity,getComments:()=>new Promise(_.identity),getCommentsCount:_.identity,createComment:()=>new Promise(_.identity),editComment:()=>new Promise(_.identity),createReply:()=>new Promise(_.identity),resolveThread:_.identity,reOpenThread:_.identity,clearCurrentComment:_.identity,deleteComment:_.identity,sending:!1,loading:!1,pageToken:null,deleteReply:_.identity,editReply:()=>new Promise(_.identity)});function dN(){return dN=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},dN.apply(this,arguments)}pN.displayName="CollaborationContext";const mN=e=>v().createElement("svg",dN({width:20,height:20,fillOpacity:.54,fill:"#000",fillRule:"nonzero",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgCommentBubble"},e),v().createElement("path",{d:"M2.8 1h14.4c.99 0 1.8.81 1.8 1.8v10.8c0 .99-.81 1.8-1.8 1.8H4.6L1 19V2.8C1 1.81 1.81 1 2.8 1z"})),gN=(0,kp.Z)((()=>({root:{position:"relative",height:"18px",display:"flex",alignItems:"center",justifyContent:"center",marginLeft:"4px",cursor:"pointer"},icon:{"&:hover":{fillOpacity:.7}}})));function yN(){return yN=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},yN.apply(this,arguments)}const fN=v().forwardRef(((e,t)=>{let{children:r,tooltipTitle:n,icon:a,onClick:i,className:o}=e,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["children","tooltipTitle","icon","onClick","className"]);const s=gN();return v().createElement(gf(),{title:n},v().createElement("div",yN({ref:t,className:O()(s.root,o),onClick:i},l),v().createElement(a,{className:s.icon}),r))}));fN.displayName="BasicCommentButton";const hN=(0,kp.Z)({childrenWrapper:{position:"absolute",width:"100%",height:"100%",lineHeight:"15px",display:"flex",alignItems:"center",justifyContent:"center",top:"-2px",left:0,right:0,bottom:0,color:"white",fontSize:"10px",pointerEvents:"none"}}),EN=v().forwardRef(((e,t)=>{let{children:r,onClick:n}=e;const a=hN();return v().createElement(fN,{ref:t,tooltipTitle:mi().text("Show comment"),icon:mN,onClick:n,"data-reltio-id":"reltio-comment-button"},v().createElement("div",{className:a.childrenWrapper},r))}));function bN(){return bN=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},bN.apply(this,arguments)}EN.displayName="CommentButton";const vN=e=>v().createElement("svg",bN({width:20,height:20,fillOpacity:.54,fill:"#000",fillRule:"nonzero",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgAddComment"},e),v().createElement("path",{d:"M2.8 14.653L3.853 13.6H17.2V2.8H2.8v11.853zM17.2 1c.99 0 1.8.81 1.8 1.8v10.8c0 .99-.81 1.8-1.8 1.8H4.6L1 19V2.8C1 1.81 1.81 1 2.8 1h14.4zm-6.3 3.6H9.1v2.699L6.4 7.3v1.8l2.7-.001V11.8h1.8V9.099l2.7.001V7.3l-2.7-.001V4.6z"})),TN=e=>{let{className:t,onClick:r}=e;return v().createElement(fN,{className:t,onClick:r,tooltipTitle:mi().text("Add comment"),icon:vN})};var ON=r(94511),xN=r.n(ON),CN=r(59674);const SN=(0,kp.Z)((e=>{const t=e.palette.background.paper;return{paper:{backgroundColor:t,maxWidth:1e3},popper:{'&[data-popper-placement*="bottom"] $arrow':{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},'&[data-popper-placement*="top"] $arrow':{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},'&[data-popper-placement*="right"] $arrow':{left:0,marginLeft:"-0.71em",height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}},'&[data-popper-placement*="left"] $arrow':{right:0,marginRight:"-0.71em",height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}}},arrow:{overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:t,"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",boxShadow:e.shadows[1],backgroundColor:"currentColor",transform:"rotate(45deg)"}}}}));function wN(){return wN=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},wN.apply(this,arguments)}const AN=e=>{let{children:t,className:r,classes:n,transition:a}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["children","className","classes","transition"]);const o=SN(),l=a?xN():v().Fragment,[s,c]=(0,b.useState)(null);return v().createElement(CN.r,wN({className:O()(o.popper,r),modifiers:[{name:"preventOverflow",enabled:!0,options:{rootBoundary:"viewport",padding:14,altAxis:!0}},{name:"arrow",enabled:!0,options:{element:s,padding:4}}],transition:a,excludeAnchorFromBackdrop:!1},i),(e=>{let{TransitionProps:r}=e;return v().createElement(l,r,v().createElement(JI(),{className:O()(o.paper,null==n?void 0:n.root)},v().createElement("span",{className:O()(o.arrow,null==n?void 0:n.arrow),ref:c}),t))}))};var RN=r(93526),_N=r.n(RN);const IN=(0,kp.Z)((e=>({menuItem:{minHeight:"32px"},menuText:{color:e.palette.text.primary,fontSize:"13px",lineHeight:"15px",letterSpacing:0}}))),NN=(0,yd.T)(td()),DN=(0,b.forwardRef)(((e,t)=>{let{item:r,onMenuClose:n=_.identity}=e;const a=IN(),{disabled:i,text:o,tooltip:l,onClick:s,id:c="",selectable:u,selected:p}=r;return v().createElement(NN,{tooltipTitle:l,showForDisabled:!0,classes:{root:a.menuItem},onClick:e=>{n(e),s(e)},disabled:i,ref:t,"data-modal":!0,"data-reltio-id":`reltio-search-menu-item${c}`},u&&v().createElement(Jp(),{checked:p,color:"primary"}),v().createElement(Ag(),{classes:{root:a.menuText}},o))}));DN.displayName="DefaultMenuItemRenderer";const PN=(0,kp.Z)((e=>({buttonRoot:{"&$selected":{color:e.palette.action.active,backgroundColor:(0,Lm.alpha)(e.palette.action.active,.12),"&:hover":{backgroundColor:(0,Lm.alpha)(e.palette.action.active,.15)}}},selected:{},paper:{minWidth:"112px"}})));function kN(){return kN=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},kN.apply(this,arguments)}function LN(e){let{className:t,menuId:r,buttonComponent:n=nE(),buttonContent:a,menuItems:i=[],buttonProps:o={},popoverProps:l={},onMenuOpen:s=_.identity,onMenuClose:c=_.identity,MenuItemRenderer:u=DN}=e;const p=n,d=PN(),m=(0,b.useRef)(),[g,y]=(0,b.useState)(!1);(0,OE.D)((()=>{g?s():c()}),[g]);const f=(0,b.useCallback)((e=>{null==e||e.stopPropagation(),y((e=>!e))}),[]);return v().createElement(v().Fragment,null,v().createElement(p,kN({"data-reltio-id":"drop-down-menu-button",ref:m,className:O()(d.buttonRoot,{[d.selected]:g},t),onClick:f,"aria-pressed":g,"aria-controls":g?r:void 0,"aria-haspopup":"true"},o),a),v().createElement(_N(),kN({id:r,variant:"menu",open:g,autoFocus:!1,classes:{paper:d.paper},anchorEl:m.current,onClose:f,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},elevation:2,MenuListProps:{autoFocusItem:g}},l),i.map(((e,t)=>v().createElement(u,{item:e,key:t,onMenuClose:f})))))}const UN=(e,t)=>{(0,b.useEffect)((()=>{if(t){var r,n,a,i;const t=null===(r=e.current)||void 0===r||null===(n=r.value)||void 0===n?void 0:n.length;null===(a=e.current)||void 0===a||a.focus(),null===(i=e.current)||void 0===i||i.setSelectionRange(t,t)}}),[e,t])},jN=(e,t)=>{const r=e.relatedObjectUris.indexOf(t);if(r>=0)return e.relatedObjectUris[1-r]},FN=e=>`${mi().date(e,"LT")} ${mi().date(e,"LL")}`,MN=e=>`comment/${e.commentId}`,VN=(e,t)=>`comment/${e.commentId}/reply/${t.replyId}`,BN=(e,t)=>{let r=e;for(const e of t)r=r.split(`+${e}`).join(`@[${e}](${e})`);return r},zN=v().createContext({});zN.displayName="EntitiesMapContext";const HN=(0,kp.Z)((e=>({title:{marginBottom:"10px",color:e.palette.divider,fontSize:"12px",lineHeight:"14px"},label:{paddingLeft:"9px",borderLeft:"1px solid #D8D8D8",fontSize:"13px",color:e.palette.text.primary,lineHeight:"15px"},link:{color:e.palette.primary.main,textDecoration:"none"}})));function YN(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const WN=e=>{let{comment:t,className:r}=e;const n=HN(),a=(0,b.useContext)(zN),i=(0,w.AH)(),o=(0,w.eh)();return v().createElement(KI(),{className:r},(()=>{switch(t.objectType){case x.CollaborationObjectTypes.ENTITY_ATTRIBUTE:{const e=(0,x.getAttributeTypeUriByValueUri)(t.objectId,o.type),r=(0,x.findAttributeTypeByUri)(i,e);return v().createElement(v().Fragment,null,v().createElement(Ag(),{className:n.title},mi().text("Selected attribute:")),v().createElement(Ag(),{className:n.label},null==r?void 0:r.label))}case x.CollaborationObjectTypes.RELATION_ATTRIBUTE:{const e=t.relatedObjectUris.find((0,_.startsWith)("configuration/relationTypes")),r=e&&(0,x.getAttributeTypeUriByValueUri)(t.objectId,e),a=r&&(0,x.findAttributeTypeByUri)(i,r);return v().createElement(v().Fragment,null,v().createElement(Ag(),{className:n.title},mi().text("Selected attribute:")),v().createElement(Ag(),{className:n.label},null==a?void 0:a.label))}case x.CollaborationObjectTypes.ENTITY:return v().createElement(v().Fragment,null,v().createElement(Ag(),{className:n.title},mi().text("Selected profile:")),v().createElement(qd,{className:O()(n.label,n.link),value:(0,x.getEntityUriForLink)(o)},(0,x.getLabel)(o.label)));case x.CollaborationObjectTypes.RELATION:{const e=jN(t,o.uri),r=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){YN(e,t,r[t])}))}return e}({},a[e]||{},{uri:e});return v().createElement(v().Fragment,null,v().createElement(Ag(),{className:n.title},mi().text("Selected relation:")),v().createElement(Ag(),{className:n.label},v().createElement(qd,{className:n.link,value:(0,x.getEntityUriForLink)(o)},(0,x.getLabel)(o.label)),e&&v().createElement(v().Fragment,null,` ${mi().text("to")} `,v().createElement(qd,{className:n.link,value:(0,x.getEntityUriForLink)(r)},r.label?(0,x.getLabel)(r.label):(0,x.getEntityId)(r)))))}case x.CollaborationObjectTypes.POTENTIAL_MATCH:{var e;const r=jN(t,o.uri),i={uri:r,label:null===(e=a[r])||void 0===e?void 0:e.label};return v().createElement(v().Fragment,null,v().createElement(Ag(),{className:n.title},mi().text("Selected potential match:")),v().createElement(Ag(),{className:n.label},v().createElement(qd,{className:n.link,value:(0,x.getEntityUriForLink)(o)},(0,x.getLabel)(o.label)),r&&v().createElement(v().Fragment,null,` ${mi().text("and")} `,v().createElement(qd,{className:n.link,value:(0,x.getEntityUriForLink)(i)},i.label?(0,x.getLabel)(i.label):(0,x.getEntityId)(i)))))}default:return null}})())},GN=v().createContext([]);GN.displayName="UsersContext";const qN=(0,kp.Z)((e=>({root:{color:e.palette.text.primary,fontSize:"13px",lineHeight:"15px",wordBreak:"break-word"}}))),ZN=e=>{let{comment:t,className:r}=e;const n=qN(),a=(0,b.useContext)(GN);return v().createElement(Ag(),{className:O()(n.root,r)},function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e=>e,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"+";const a=[];let i="",o=!1;for(let l=0;l<=e.length;l++){const s=e[l],c=e[l+1],u=l===e.length-1;i+=s,s===n&&0===l&&(o=!0),o&&t.includes(i.slice(n.length))&&(o=!1,a.push(r(i)),i=""),c===n&&(o=!0,a.push(i),i=""),u&&a.push(i)}return a}(t.content,t.namedUsers,(e=>{const t=a.find((t=>t.username===e.slice(1)));return t?v().createElement(uy(),{href:`mailto:${t.email}`,underline:"hover"},e):e})).map(((e,t)=>v().createElement(b.Fragment,{key:t},e))))},$N=(0,kp.Z)((e=>({root:{width:"32px",height:"32px",fontSize:"12px",color:e.palette.text.secondary,backgroundColor:"rgba(144, 164, 174, 0.2)"}})));function KN(){return KN=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},KN.apply(this,arguments)}const XN=e=>{let{className:t,children:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","children"]);const a=$N();return v().createElement(S(),KN({},n,{className:O()(a.root,t)}),r.split(".").map((e=>e[0].toUpperCase())).join(""))};var QN=r(2271);const JN=r(47503).$+1,eD=(0,kp.Z)((e=>({root:{backgroundColor:"#fff",fontFamily:"Roboto"},mentionsControl:{fontSize:"13px"},mentionsHighlighter:{padding:"10px 22px",border:"1px solid transparent !important","&::before":{content:e=>{let{placeholder:t}=e;return t&&`"${t}"`}}},mentionsInput:{borderRadius:"2px",border:"1px solid rgba(0,0,0,0.12)",padding:"10px 22px",outline:0,overflow:"auto !important"},mentionsSuggestions:{padding:"8px 0",zIndex:JN+"!important",borderRadius:"4px",backgroundColor:"#fafafa !important",boxShadow:"0 2px 2px 0 rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.12), 0 1px 5px 0 rgba(0,0,0,0.2)"},mentionsSuggestionsList:{maxHeight:"200px",overflowY:"scroll"},mentionsSuggestionsItem:{padding:"6px 12px",color:e.palette.text.primary,fontSize:"13px",transition:e.transitions.create(["background-color"]),"&:hover, &--focused":{backgroundColor:"rgba(0,0,0,0.04)"}},mention:{position:"relative",zIndex:1,color:e.palette.primary.main,textShadow:"1px 1px 1px white, 1px -1px 1px white, -1px 1px 1px white, -1px -1px 1px white",pointerEvents:"none"}})));function tD(){return tD=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},tD.apply(this,arguments)}const rD=e=>{let{onChange:t,className:r,value:n,placeholder:a}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["onChange","className","value","placeholder"]);const o=eD({placeholder:n?"":a}),l=(0,b.useContext)(GN);return v().createElement("div",{className:O()(o.root,r)},v().createElement(QN.r,tD({},i,{value:n,placeholder:a,onChange:(e,r,n,a)=>{t(r,n,(0,_.uniq)(a.map((e=>{let{display:t}=e;return t.slice(1)}))))},className:"mentionsTextArea",suggestionsPortalHost:document.body,allowSuggestionsAboveCursor:!0,classNames:{mentionsTextArea__input:o.mentionsInput,mentionsTextArea__highlighter:o.mentionsHighlighter,mentionsTextArea__control:o.mentionsControl,mentionsTextArea__suggestions:o.mentionsSuggestions,mentionsTextArea__suggestions__list:o.mentionsSuggestionsList,mentionsTextArea__suggestions__item:o.mentionsSuggestionsItem}}),v().createElement(QN.p,{trigger:"+",data:l.map((e=>{let{username:t}=e;return{id:t,display:t}})),displayTransform:(e,t)=>`+${t}`,appendSpaceOnAdd:!0,className:o.mention})))},nD=(0,kp.Z)({root:e=>{let{isEditing:t}=e;return{padding:t?"6px 6px 6px 0":" 6px 6px 6px 8px",borderRadius:"4px",backgroundColor:t?"transparent":"rgba(0,114,206,0.06)"}},textField:e=>{let{isEditing:t}=e;return{width:t?"100%":"calc(100% - 40px)"}},form:{marginBottom:0},main:{display:"flex",alignItems:"center"},avatar:{marginRight:"8px"},buttons:e=>{let{isEditing:t}=e;return{marginLeft:t?"0":"40px",marginTop:"8px"}},button:{"& + $button":{marginLeft:"8px"}}}),aD=e=>{switch(e){case"open":return mi().text("Reply...");case"resolved":return mi().text("Adding a comment will re-open this");default:return""}},iD=e=>{let{inputRef:t,className:r,uri:n,relatedObjectUris:a,objectType:i,popperRef:o,comment:l,reply:s,isEditingComment:c,isEditingReply:u,onCancel:p}=e;const d=c||u,m=nD({isEditing:d}),[g,y]=(0,b.useState)(!1),{createReply:f,createComment:h,sending:E,editComment:T,editReply:x,getCommentState:C,updateCommentState:S,clearCommentState:A}=(0,b.useContext)(pN),R=(0,w.qg)(),I=(e=>{let{comment:t,reply:r,isEditingComment:n,isEditingReply:a}=e;return(0,_.isNil)(t)?"comment/new":n?MN(t):a?VN(t,r):(e=>`comment/${e.commentId}/reply/new`)(t)})({comment:l,reply:s,isEditingComment:c,isEditingReply:u}),N=(e=>{let{comment:t,reply:r,isEditingComment:n,isEditingReply:a}=e;const i=n?t:a?r:null,{content:o="",namedUsers:l=[]}=i||{};return{value:BN(o,l),plainTextValue:o,mentions:l}})({comment:l,reply:s,isEditingComment:c,isEditingReply:u}),{value:D=N.value,plainTextValue:P=N.plainTextValue,mentions:k=N.mentions}=C(n,I),L=""!==N.value.trim(),U=""!==D.trim(),j=g||U||L,F=null==l?void 0:l.status,M=()=>{null==p||p(),A(n,I)};(0,b.useEffect)((()=>{o&&o.current.forceUpdate()}),[o,j]);const V=d?"small":"medium";return v().createElement(KI(),{className:O()(m.root,r)},v().createElement("form",{onSubmit:e=>(e.preventDefault(),(0,_.cond)([[(0,_.always)(!l),()=>h({content:P,namedUsers:k,objectType:i,uri:n,relatedObjectUris:a})],[(0,_.always)(c),()=>T({content:P,namedUsers:k,commentId:l.commentId,objectType:i,replies:l.replies,relatedObjectUris:a,uri:n})],[(0,_.always)(u),()=>x({content:P,namedUsers:k,commentId:l.commentId,replyId:s.replyId})],[_.T,()=>f({content:P,namedUsers:k,commentId:l.commentId,action:"open"===l.status?"none":"reopen",uri:n})]])().then(M).catch(console.log)),className:m.form},v().createElement(KI(),{className:m.main},!d&&v().createElement(XN,{classes:{root:m.avatar}},R),v().createElement(rD,{className:m.textField,disabled:E,onChange:(e,t,r)=>S(n,I,{value:e,plainTextValue:t,mentions:r}),inputRef:t,value:D,onFocus:()=>y(!0),onBlur:()=>y(!1),placeholder:aD(F)})),j&&v().createElement(KI(),{className:m.buttons},v().createElement(nE(),{className:m.button,variant:"contained",color:"primary",disabled:!U||E,type:"submit",size:V},((e,t,r)=>t||r?mi().text("Edit"):"open"===e||"resolved"===e?mi().text("Reply"):mi().text("Comment"))(F,c,u)),v().createElement(nE(),{disabled:E,onClick:()=>M(),className:m.button,variant:"outlined",color:"primary",size:V},mi().text("Cancel")))))},oD=(0,kp.Z)((e=>({header:{display:"flex"},avatar:{marginRight:"8px"},username:{marginBottom:"1px",color:e.palette.text.primary,fontSize:"13px",fontWeight:500,lineHeight:"15px"},createdAt:{marginTop:"3px",marginRight:"4px",color:e.palette.text.secondary,fontSize:"11px",lineHeight:"13px",whiteSpace:"nowrap"},body:{marginLeft:"40px"},commentTarget:{marginTop:"-15px",overflowWrap:"break-word"},message:{marginTop:"12px"},dropdownMenu:{zIndex:"3000 !important"},buttons:{marginTop:"15px",marginBottom:"12px",display:"flex","& $button + $button":{marginLeft:"10px"}},button:{fontSize:"13px",lineHeight:"15px"}}))),lD=e=>{let{onReply:t,className:r,uri:n,comment:a,relatedObjectUris:i,objectType:o}=e;const l=oD(),s=(0,b.useRef)(),c=(0,w.qg)(),{commentId:u,createdBy:p,createdTime:d,status:m}=a,g="resolved"===m,y=p===c,{resolveThread:f,reOpenThread:h,sending:E,deleteComment:T,updateCommentState:O,getCommentState:x}=(0,b.useContext)(pN),C=MN(a),{isEditing:S}=x(n,C),A=(0,b.useCallback)((e=>O(n,C,{isEditing:e})),[C,O,n]);UN(s,S);const R=(0,b.useMemo)((()=>g?[{text:mi().text("Delete"),onClick:()=>T({uri:n,commentId:u})}]:[{text:mi().text("Edit"),onClick:()=>A(!0)},{text:mi().text("Delete"),onClick:()=>T({uri:n,commentId:u})}]),[u,T,g,A,n]),_=v().createElement(iD,{inputRef:s,uri:n,relatedObjectUris:i,objectType:o,onCancel:()=>A(!1),isEditingComment:S,comment:a});return v().createElement(KI(),{className:r},v().createElement(KI(),{className:l.header},v().createElement(XN,{classes:{root:l.avatar}},p),v().createElement(KI(),{width:"100%"},v().createElement(Ag(),{className:l.username},p)),v().createElement(Ag(),{className:l.createdAt},FN(d)),y&&v().createElement(LN,{buttonComponent:wd.k,buttonProps:{icon:Vd(),tooltipTitle:mi().text("Open menu")},popoverProps:{PopoverClasses:{root:l.dropdownMenu}},menuItems:R,menuId:"collaboration-comment-menu"})),v().createElement(KI(),{className:l.body},v().createElement(WN,{comment:a,className:l.commentTarget}),S?_:v().createElement(ZN,{comment:a,className:l.message}),v().createElement(KI(),{className:l.buttons},v().createElement(uy(),{className:l.button,onClick:t,component:"button",underline:"hover"},mi().text("Reply")),!g&&v().createElement(uy(),{disabled:E,className:l.button,onClick:()=>{f({commentId:u,uri:n})},component:"button",underline:"hover"},mi().text("Resolve")),g&&v().createElement(uy(),{disabled:E,className:l.button,onClick:()=>{h({commentId:u,uri:n})},component:"button",underline:"hover"},mi().text("Re-open")))))},sD=(0,kp.Z)((e=>({root:{display:"flex",padding:"8px",borderRadius:"4px",backgroundColor:"rgba(0,114,206,0.06)"},avatar:{marginRight:"8px"},replyArea:{width:"calc(100% - 60px)"},header:{display:"flex",marginBottom:"8px"},username:{color:e.palette.text.primary,fontSize:"13px",fontWeight:500,lineHeight:"15px"},message:{marginBottom:"8px",color:e.palette.text.primary,fontSize:"13px",lineHeight:"15px"},createdAt:{color:e.palette.text.secondary,fontSize:"11px",lineHeight:"13px",whiteSpace:"nowrap"},marked:{marginLeft:"8px",color:e.palette.text.secondary,fontSize:"13px",fontStyle:"italic",lineHeight:"15px"}}))),cD=e=>{let{className:t,reply:r,uri:n,comment:a,popperRef:i}=e;const o=(0,b.useRef)(),l=(0,w.qg)(),{createdBy:s,action:c,createdTime:u}=r,p=s===l&&"resolved"!==a.status,{deleteReply:d,updateCommentState:m,getCommentState:g}=(0,b.useContext)(pN),y=VN(a,r),{isEditing:f}=g(n,y),h=(0,b.useCallback)((e=>m(n,y,{isEditing:e})),[y,m,n]);UN(o,f);const E=sD(),T=(0,b.useMemo)((()=>[{text:mi().text("Edit"),onClick:()=>h(!0)},{text:mi().text("Delete"),onClick:()=>d({uri:n,commentId:a.commentId,reply:r})}]),[d,n,a.commentId,r,h]),x=v().createElement(iD,{inputRef:o,popperRef:i,uri:n,onCancel:()=>h(!1),isEditingReply:f,reply:r,comment:a});return v().createElement(KI(),{className:O()(E.root,t)},v().createElement(XN,{classes:{root:E.avatar}},s),v().createElement(KI(),{className:E.replyArea},v().createElement(KI(),{className:E.header},v().createElement(Ag(),{className:E.username},s),"resolve"===c&&v().createElement(Ag(),{className:E.marked},mi().text("Marked as resolved")),"reopen"===c&&v().createElement(Ag(),{className:E.marked},mi().text("Re-opened"))),"resolve"!==c&&(f?x:v().createElement(ZN,{className:E.message,comment:r})),v().createElement(Ag(),{className:E.createdAt},FN(u))),p&&v().createElement(LN,{buttonComponent:wd.k,buttonProps:{icon:Vd(),tooltipTitle:mi().text("Open menu")},menuItems:T,menuId:"collaboration-comment-menu"}))},uD=(0,kp.Z)((()=>({root:{maxWidth:"100%",padding:"8px 4px 10px 16px"},messages:{},repliedComment:{marginBottom:"2px"},replies:{marginLeft:"40px"},sendMessageArea:{marginLeft:"40px"},comment:{}}))),pD=(0,b.memo)((e=>{let{uri:t,relatedObjectUris:r,objectType:n,classes:a,popperRef:i,messagesRef:o,comment:l}=e;const s=(0,b.useRef)(),c=uD({classes:a}),u=v().createElement(iD,{className:c.sendMessageArea,inputRef:s,popperRef:i,uri:t,relatedObjectUris:r,objectType:n,comment:l});return v().createElement(KI(),{className:c.root},l&&v().createElement(v().Fragment,null,v().createElement("div",{className:c.messages,ref:o},v().createElement(lD,{comment:l,uri:t,onReply:()=>{s.current.focus()},className:c.comment,relatedObjectUris:r,objectType:n}),v().createElement(KI(),{className:c.replies},l.replies.map((e=>v().createElement(cD,{key:e.replyId,className:c.repliedComment,reply:e,uri:t,comment:l}))))),u),!l&&u)})),dD=(0,kp.Z)((e=>({root:{},header:{display:"flex",alignItems:"center",height:"48px",paddingLeft:"16px",paddingRight:"8px"},headerInfo:{marginRight:"auto",display:"flex",alignItems:"center"},title:{marginRight:"15px",color:e.palette.text.primary,fontSize:"16px"},counter:{paddingLeft:"15px",borderLeft:"1px solid rgba(0,0,0,0.12)",color:e.palette.text.secondary,fontSize:"14px",lineHeight:"24px"},resolveButton:{zIndex:3e3,"&:hover":{backgroundColor:"transparent"}},popper:{width:"424px",borderRadius:"0 0 4px 4px"},collaborationItem:{padding:"0 0 10px 0"},comment:e=>{let{hasScroll:t}=e;return{marginLeft:"16px",marginRight:t?"2px":"8px"}},replies:e=>{let{hasScroll:t}=e;return{marginLeft:"8px",marginRight:t?"2px":"8px"}},sendMessageArea:e=>{let{hasScroll:t,scrollWidth:r}=e;return{marginLeft:"8px",marginRight:t?r+2:"8px"}},messages:{maxHeight:"400px",overflowY:"auto"}}))),mD=e=>{let{uri:t,relatedObjectUris:r,objectType:n,anchorEl:a,onClose:i,open:o,comment:l}=e;const[s,c]=(0,b.useState)(0),u=dD({scrollWidth:s,hasScroll:0!==s}),p=(0,b.useRef)(null),{resolveThread:d,loading:m,sending:g}=(0,b.useContext)(pN),y=1+(null==l?void 0:l.replies.length);return v().createElement(AN,{popperRef:p,anchorEl:a,open:o,placement:"right-start",onClose:i,className:u.popper},v().createElement(KI(),{className:u.header},v().createElement(KI(),{className:u.headerInfo},v().createElement(Ag(),{className:u.title},mi().text("Comments")),l&&!m&&v().createElement(Ag(),{className:u.counter},mi().number(y)," ",1===y?mi().text("item"):mi().text("items"))),l&&!m&&v().createElement(wd.k,{className:u.resolveButton,size:"S",onClick:()=>{d({commentId:l.commentId,uri:t})},disabled:g,showForDisabled:!0,tooltipTitle:mi().text("Resolve"),icon:Sm(),color:"primary"})),!m&&v().createElement(pD,{popperRef:p,messagesRef:e=>{e&&c(e.offsetWidth-e.clientWidth)},classes:{root:u.collaborationItem,replies:u.replies,sendMessageArea:u.sendMessageArea,messages:u.messages,comment:u.comment},uri:t,relatedObjectUris:r,objectType:n,comment:l}))},gD=(0,kp.Z)((()=>({root:{display:"flex",alignItems:"start"},addButton:{visibility:"hidden","&$showAlways":{visibility:"visible"},".commentsContainerVisibilityArea:hover &":{visibility:"visible"}},showAlways:{}}))),yD=e=>{let{className:t,uri:r,objectType:n,relatedObjectUris:a,onChangePopupVisibility:i,allowOnlyOneComment:o=!1,showAlways:l=!1}=e;const s=gD(),[c,u]=(0,b.useState)(null),[p,d]=(0,b.useState)(!1),m=p&&Boolean(c),{currentComment:g,commentsMap:y,getComment:f,clearCurrentComment:h,objectTypes:E}=(0,b.useContext)(pN),T=!!y&&(!E||E.includes(n)),x=((null==y?void 0:y[r])||[]).filter((e=>{let{status:t}=e;return"resolved"!==t})).reverse(),C=!o||o&&0===x.length,S=null===g&&m;(0,OE.D)((()=>{i&&i(m)}),[m]);const w=(0,b.useContext)(uN),A=(0,b.useMemo)((()=>w?[...a,...w]:a),[w,a]);return T&&v().createElement("div",{className:O()(s.root,t)},C&&v().createElement(TN,{className:O()(s.addButton,{[s.showAlways]:l||S}),onClick:e=>{u(e.currentTarget),d(!0)}}),x.map((e=>{let{replies:t,commentId:r}=e;return v().createElement(EN,{ref:r===(null==g?void 0:g.commentId)?u:null,key:r,onClick:()=>(e=>{f(e),d(!0)})(r)},1+t)})),v().createElement(mD,{anchorEl:c,open:m,onClose:()=>{u(null),h(),d(!1)},uri:r,relatedObjectUris:A,objectType:n,comment:g}))},fD=(0,kp.Z)({label:{color:"rgba(0,0,0,0.6)",fontSize:"13px",lineHeight:"16px"}});function hD(){return hD=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hD.apply(this,arguments)}const ED=e=>{let{label:t,isRequired:r,className:n}=e,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["label","isRequired","className"]);const i=fD();return v().createElement(Ag(),hD({className:O()(i.label,n),component:"span"},a),t,r&&v().createElement(dd,null))},bD=v().createContext(null);bD.displayName="EntityContext";const vD=(0,kp.Z)((e=>({container:{height:"16px",borderColor:(0,Lm.alpha)(e.palette.primary.main,.54)},label:{paddingLeft:"4px",paddingRight:"4px",fontSize:"10px",lineHeight:"11px",color:e.palette.primary.main}}))),TD=(0,yd.T)(Of()),OD=e=>{let{className:t,attributeType:r,nonOvValues:n=[],nonOvTotal:a}=e;const i=vD(),o=(0,w.ax)("openEntity"),l=((e,t,r)=>{var n;const a=null==t||null===(n=t[0])||void 0===n?void 0:n.uri,i=a?(0,x.getEntityUriFromAttributeUri)(a):null;if(i&&(0,x.isEntityUri)(i)){const t=(0,x.getEntityUriFromAttributeUri)(r.uri);if(!e||e.type===t)return{uri:i,type:t};const n=(0,x.getParentUri)(a),o=(0,x.findAttributeValueByUri)(e,n);return{uri:(0,x.getReferencedEntityUriFromAttrValue)(o),type:t}}return e?{uri:e.uri,type:e.type}:null})((0,b.useContext)(bD),n,r),s=(0,w.fC)(null==l?void 0:l.type),c=(0,b.useCallback)((()=>{o({uri:l.uri,screen:"sources"})}),[o,l]);if(!a)return null;const u=n.length?n.map(((e,t)=>v().createElement("div",{key:t},(0,x.isComplexAttribute)(r)?(0,x.getLabel)(e.label):v().createElement(Xd.x,{value:(0,x.getAttributeValue)(e),dataTypeDefinition:(0,x.getAttrDataTypeDefinition)(r),rich:!1})))):null;return v().createElement(TD,{tooltipTitle:u,tooltipPlacement:"bottom",label:`+ ${a}`,variant:"outlined",onClick:null!=l&&l.uri&&s?c:void 0,classes:{root:O()(i.container,t),label:i.label}})};function xD(){return xD=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},xD.apply(this,arguments)}const CD=e=>v().createElement("svg",xD({width:12,height:12,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgDescription"},e),v().createElement("path",{d:"M5.417 9.5h1.166V8.333H5.417V9.5zM6 .167A5.835 5.835 0 00.167 6 5.835 5.835 0 006 11.833 5.835 5.835 0 0011.833 6 5.835 5.835 0 006 .167zm0 10.5A4.673 4.673 0 011.333 6 4.673 4.673 0 016 1.333 4.673 4.673 0 0110.667 6 4.673 4.673 0 016 10.667zM6 2.5a2.333 2.333 0 00-2.333 2.333h1.166A1.17 1.17 0 016 3.667a1.17 1.17 0 011.167 1.166c0 1.167-1.75 1.021-1.75 2.917h1.166c0-1.313 1.75-1.458 1.75-2.917A2.333 2.333 0 006 2.5z",fill:"#000",fillOpacity:.54})),SD=v().createContext({showDescription:!1,showNavigateToGraph:!0});SD.displayName="FeaturesContext";const wD=(0,kp.Z)((()=>({icon:{display:"inline-flex",marginLeft:"8px",verticalAlign:"middle"}}))),AD=e=>{let{className:t,description:r}=e;const{showDescription:n}=(0,b.useContext)(SD),a=wD();return r&&n?v().createElement(gf(),{title:r,placement:"bottom"},v().createElement("span",{"data-reltio-id":"reltio-description-icon",className:O()(a.icon,t)},v().createElement(CD,null))):null};var RD=r(87558);const _D=(0,r(87171).k)({unmaskedAttributes:{},unmaskAttributeValue:void 0,maskAttributeValue:void 0}),ID=e=>(0,RD.S)(_D,e),ND=v().createContext({appearance:void 0,attributes:void 0,roles:void 0,tags:void 0});ND.displayName="HistoryDiffContext";const DD=v().createContext({highlightedValuesUris:[],highlightedClassName:""});function PD(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}DD.displayName="HighlightedValuesContext";const kD=(e,t,r,n)=>{const a=((e,t)=>{const r=t.find((t=>t.uri===e.uri));return r&&Array.isArray(r.children)?r.children:[]})(e,r);let i=(null==e?void 0:e.attributes)||(null==e?void 0:e.analyticsAttributes)||[];return a.length&&(i=i.filter((e=>a.includes(e.uri)))),i.reduce(((e,a)=>{const i=LD(t[a.name],n,r);return i&&i.length&&(Array.isArray(i[0])?e.push({[a.uri]:i[0]}):e.push({[a.uri]:i})),e}),[])},LD=(e,t,r)=>{if(e&&0!==e.length)return e.reduce(((e,n)=>{if("type"in n&&n.type){const a="lookupCode"in n?n.lookupCode:n.value,i=(0,x.findAttributeTypeByUri)(t,n.type);a&&"object"!=typeof a&&(0,x.isOv)(n)?e.push(UD(a,i)):a&&"object"==typeof a&&!Array.isArray(a)&&e.push(kD(i,a,r,t))}return e}),[])},UD=(e,t)=>{switch(null==t?void 0:t.type){case x.DataTypes.TYPE_DATE:return new Date(e).getTime();case x.DataTypes.TYPE_TIMESTAMP:return isNaN(Number(e))?new Date(e).getTime():new Date(Number(e)).getTime();default:return e}};function jD(){return jD=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},jD.apply(this,arguments)}const FD=e=>v().createElement("svg",jD({width:11,height:11,viewBox:"0 0 11 11","data-reltio-id":"SvgPivotingIcon"},e),v().createElement("path",{d:"M2.514 5h2.314V3l2.5 2.5-2.5 2.5V6h-3.8a4.5 4.5 0 10.73-3H.6a5.5 5.5 0 11-.577 3H0V5H2.514z",fill:"#6CACE4",stroke:"none",strokeWidth:1,fillRule:"evenodd"})),MD=(0,kp.Z)((e=>({link:{color:e.palette.primary.main,textDecoration:"none"}}))),VD=(0,b.forwardRef)(((e,t)=>{let{value:r,attributeType:n,children:a,className:i,onClick:o}=e;const l=MD(),{generatePivotingUrl:s}=(0,b.useContext)(Wd),c=s({uiPath:(0,w.Qh)(),uri:n.uri,value:JSON.stringify(r)}),u=(0,b.useCallback)((e=>{(0,Dp.rR)(e)||(o(),e.preventDefault()),e.stopPropagation()}),[o]);return v().createElement("a",{ref:t,href:c,onClick:u,className:O()(l.link,i)},a)}));VD.displayName="PivotingUriLink";const BD=(0,kp.Z)((e=>({container:{backgroundColor:"white",width:"360px",minWidth:"360px",maxWidth:"720px"},header:{display:"flex",height:"48px",alignItems:"center",justifyContent:"space-between",paddingLeft:"16px"},title:{color:e.palette.text.primary,fontSize:"16px",letterSpacing:"0.15px",lineHeight:"19px"},entityTypeLabel:{color:"rgba(0,0,0,0.67)",fontSize:"14px",paddingLeft:"16px",paddingBottom:"12px",lineHeight:"16px"},divider:{height:"24px",width:"1px",backgroundColor:"rgba(0,0,0,0.12)"},headerCount:{color:e.palette.text.secondary,fontSize:"14px",letterSpacing:"0.24px",lineHeight:"28px",width:"210px"},body:{borderBottom:"1px solid rgba(0,0,0,0.12)",padding:"0 16px 8px"},footer:{display:"flex",alignItems:"center",height:"32px",paddingLeft:"16px",color:e.palette.primary.main,fontSize:"13px",letterSpacing:"0",lineHeight:"16px"},profileIcon:{height:"16px",width:"16px"},entityContainer:{display:"flex",flexDirection:"row",alignItems:"center"},entityLabel:{color:e.palette.primary.main,fontSize:"13px",letterSpacing:"0",lineHeight:"15px",textDecoration:"none",paddingLeft:"8px",wordBreak:"break-word"},seeAllButton:{cursor:"pointer"}}))),zD=e=>{let{attributeType:t,label:r,entities:n,generatedValue:a,onSeeAllClick:i,total:o}=e;const l=BD(),s=o>6,c=Boolean(r);return v().createElement("div",{className:l.container},v().createElement("div",{className:l.header},v().createElement("div",{className:l.title},mi().text("Pivot profiles")),v().createElement("div",{className:l.divider}),v().createElement("div",{className:l.headerCount},mi().number(o,"0,0")+" "+(1===o?mi().text("item"):mi().text("items")))),c&&v().createElement("div",{className:l.entityTypeLabel},r),v().createElement("div",{className:l.body},n.map((e=>v().createElement("div",{key:e.uri,className:l.entityContainer},v().createElement(A,{entity:e,avatarClassName:l.profileIcon}),v().createElement(qd,{className:l.entityLabel,value:(0,x.getEntityUriForLink)(e)},(0,x.getLabel)(e.label)))))),s&&v().createElement("div",{className:l.footer},v().createElement(VD,{value:a,attributeType:t,className:l.seeAllButton,onClick:i},mi().text("See all"))))},HD=(0,kp.Z)((e=>({icon:{marginRight:"8px",verticalAlign:"middle",width:"12px",height:"12px"},content:{color:e.palette.primary.main,cursor:"pointer",lineHeight:"16px"}}))),YD=(0,kp.Z)({tooltip:{backgroundColor:"white",boxShadow:"0 4px 5px 0 rgba(0,0,0,0.14), 0 1px 10px 0 rgba(0,0,0,0.12), 0 2px 4px -1px rgba(0,0,0,0.2)",padding:0,borderRadius:"4px",maxWidth:"none"},arrow:{"&::before":{backgroundColor:"white"}}}),WD=e=>{let{value:t,attributeType:r,children:n,className:a}=e;const i=YD(),o=HD(),l=(0,b.useContext)(XI)||[],s=(0,w.ax)("openPivotingPerspective"),c=(0,w.AH)()||{},u=(0,x.isNested)(r)?kD(r,t.value,l,c):UD(t.lookupCode||t.value,r),p=l.some((e=>{let{uri:t}=e;return t===r.uri}))&&(Array.isArray(u)&&u.length||!Array.isArray(u)&&!(0,_.isNil)(u)),d=l.find((e=>{let{uri:t}=e;return t===r.uri})),m=null==d?void 0:d.popup,g=p?Array.isArray(u)?u.map((e=>Object.fromEntries(Object.entries(e).map((e=>{let[t,r]=e;return[(0,x.getLastUriPart)(t),r]}))))):((e,t)=>[{[e.name]:t}])(r,u):void 0,y=()=>{s({value:g,attributeType:r})},{entities:f,total:h,loadPivotingData:E}=(e=>{let{value:t,attributeType:r,entityType:n}=e;const[a,i]=(0,b.useState)([]),[o,l]=(0,b.useState)(0),s=(0,Ph._)(),c=(0,w.eh)(),u=(0,w.mU)(),p=n||(null==c?void 0:c.type),d=(0,b.useMemo)((()=>(0,x.convertPivotingValueToSearchFilters)({value:t,attributeType:r,entityType:p})),[r,p,t]),m=(0,b.useMemo)((()=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){PD(e,t,r[t])}))}return e}({max:6,sort:"label"},u||{})),[u]),g=(0,b.useCallback)((()=>{s(Promise.all([(0,x.getFilteredEntities)({filters:d,options:m}),(0,x.getTotals)({filters:d,options:m})])).then((e=>{const[t,{total:r}]=e;i(Array.isArray(t)?t:[]),l(r)})).catch((()=>{i([]),l(0)}))}),[d,m,s]);return{entities:a,total:o,loadPivotingData:g}})({attributeType:r,value:u,entityType:null==m?void 0:m.entityType});return p?v().createElement(gf(),{arrow:!0,placement:"right-start",classes:i,disableInteractive:!1,onOpen:E,title:v().createElement(zD,{generatedValue:g,attributeType:r,label:null==m?void 0:m.label,onSeeAllClick:y,entities:f,total:h})},v().createElement("span",{className:a},v().createElement(FD,{className:o.icon}),v().createElement(VD,{onClick:y,className:o.content,value:g,attributeType:r},n))):v().createElement(v().Fragment,null,n)};var GD=r(78577),qD=r.n(GD),ZD=r(46157),$D=r.n(ZD);const KD=(0,kp.Z)((e=>({icon:{color:e.palette.text.secondary,fontSize:18},switcherWrapper:{verticalAlign:"middle",marginLeft:8,width:"16px",height:"16px"}}))),XD=e=>{let{className:t,isMasked:r,isUnmasking:n,onToggleMasking:a}=e;const i=KD(),o=r?mi().text("Show"):mi().text("Hide");return n?v().createElement(Tm(),{size:16,className:O()(t,i.switcherWrapper)}):v().createElement(gf(),{key:String(r),title:o},v().createElement(tE(),{"aria-label":o,onClick:a,className:O()(t,i.switcherWrapper)},r?v().createElement($D(),{className:i.icon}):v().createElement(qD(),{className:i.icon})))};function QD(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){JD(e,t,r[t])}))}return e}function JD(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const eP=(0,kp.Z)((e=>({root:{display:"flex",alignItems:"start",justifyContent:"space-between"},commentsContainer:{height:"15px",marginRight:"-4px"},attributeValue:{verticalAlign:"middle",wordBreak:"break-all"},updateAttribute:QD({width:"fit-content",padding:"0 4px",marginLeft:"-4px"},x.historyPalettes[x.HistoryOperations.updateAttribute],{"& > a":{color:x.historyPalettes[x.HistoryOperations.updateAttribute].color}}),insertAttribute:QD({width:"fit-content"},x.historyPalettes[x.HistoryOperations.insertAttribute],{"& > a":{color:x.historyPalettes[x.HistoryOperations.insertAttribute].color}}),deleteAttribute:QD({width:"fit-content",padding:"0 4px",marginLeft:"-4px",textDecoration:"line-through"},x.historyPalettes[x.HistoryOperations.deleteAttribute],{"& > a":{color:x.historyPalettes[x.HistoryOperations.deleteAttribute].color}}),multilineAttribute:{width:"fit-content"},ovFalse:e.inactive}))),tP=e=>{let{className:t,attributeType:r=null,attributeValue:n,inlined:a}=e;const{isUnmaskingNeeded:i,isMasked:o,toggleMasking:l,attributeValue:s,isUnmasking:c}=(e=>{let{attributeType:t,attributeValue:r}=e;const n=ID((e=>{let{unmaskAttributeValue:t}=e;return t})),a=ID((e=>{let{maskAttributeValue:t}=e;return t})),{attributeValue:i,isUnmasked:o=!1,loading:l=!1}=(s=r.uri,ID((e=>{let{unmaskedAttributes:t}=e;return t[s]}))||{});var s;const c=n&&a&&!!t.masking,u=(0,b.useCallback)((()=>c?n(r.uri):Promise.resolve()),[n,r.uri,c]),p=(0,b.useCallback)((()=>{o?a(r.uri):u()}),[r.uri,o,a,u]);return{isUnmaskingNeeded:c,isMasked:!o,toggleMasking:p,isUnmasking:l,unmask:u,attributeValue:c&&o&&i||r}})({attributeType:r,attributeValue:n}),u=eP(),{highlightedValuesUris:p=[],highlightedClassName:d}=(0,b.useContext)(DD),{appearance:m}=(0,b.useContext)(ND),g=(0,x.getHistoryAppearanceByUri)(s.uri,m),y=(0,x.getHistoryAttributeClassName)(g),f=(0,b.useMemo)((()=>v().createElement(Xd.x,{value:(0,x.getAttributeValue)(s),dataTypeDefinition:(0,x.getAttrDataTypeDefinition)(r)})),[s,r]),h=(0,x.isRelationUri)(s.uri)?x.CollaborationObjectTypes.RELATION_ATTRIBUTE:x.CollaborationObjectTypes.ENTITY_ATTRIBUTE,E=i&&v().createElement(XD,{isMasked:o,onToggleMasking:l,isUnmasking:c});return a||y?v().createElement("div",{className:O()(t,{[d]:p.includes(s.uri)})},v().createElement(WD,{value:s,attributeType:r,key:s.uri,className:O()({[u.multilineAttribute]:!a})},v().createElement("span",{className:O()(u.attributeValue,u[y],{[u.ovFalse]:!(0,x.isOv)(s)}),"data-reltio-id":"reltio-attribute-value"},f,E))):v().createElement("div",{className:O()(t,u.root,cN,{[d]:p.includes(s.uri)})},v().createElement(WD,{value:s,attributeType:r,key:s.uri},v().createElement("span",{className:O()(u.attributeValue,{[u.ovFalse]:!(0,x.isOv)(s)}),"data-reltio-id":"reltio-attribute-value"},f,E)),v().createElement(yD,{className:u.commentsContainer,uri:s.uri,relatedObjectUris:(0,x.createRelatedObjectUris)(h,{uri:s.uri}),objectType:h}))};var rP=r(84419),nP=r.n(rP);const aP=(0,kp.Z)({expandButton:{"&:hover":{backgroundColor:"transparent"}},expandIcon:{transition:"transform .15s ease"},expanded:{transform:"rotate(90deg)"}});function iP(){return iP=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},iP.apply(this,arguments)}const oP=e=>{const t=aP(),{expanded:r,className:n}=e,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["expanded","className"]);return v().createElement(Pp.T,iP({icon:nP(),size:"XXS",disableRipple:!0,iconClassName:O()(t.expandIcon,{[t.expanded]:r}),className:O()(n,t.expandButton),"data-reltio-id":"arrow-expand-button"},a))},lP=(0,kp.Z)((e=>({complexContainer:{marginTop:"1px"},labelContainer:{display:"flex",minHeight:"18px"},label:{display:"inline-flex",fontSize:"13px",lineHeight:"16px",letterSpacing:"normal",marginLeft:"2px"},spacer:{flex:1},ovFalse:e.inactive})));function sP(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const cP=e=>{let{attributeTypesList:t,attributeValue:r,label:n,expanded:a=!1,children:i,showNonOv:o,attributeType:l,LabelRenderer:s,RightSlot:c}=e;const u=lP(),p=r.uri,[d,m]=(0,b.useState)(!1),{highlightedValuesUris:g=[],highlightedClassName:y}=(0,b.useContext)(DD);(0,b.useEffect)((()=>{m(a)}),[a]);const f=(t||[]).some((e=>(0,x.isAnalyticAttribute)(e))),h=(0,b.useMemo)((()=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){sP(e,t,r[t])}))}return e}({attributes:f?null:r.value,analyticsAttributes:f?r.value:null},(0,x.isSpecialAttribute)(l)?r.value:{})),[r,f,l]),E=(0,x.isRelationUri)(r.uri)?x.CollaborationObjectTypes.RELATION_ATTRIBUTE:x.CollaborationObjectTypes.ENTITY_ATTRIBUTE;return v().createElement("div",{className:u.complexContainer},v().createElement("div",{className:O()(u.labelContainer,cN)},v().createElement(oP,{onClick:()=>m((e=>!e)),expanded:d}),s?v().createElement(s,{attributeType:l,attributeValue:r}):v().createElement(v().Fragment,null,v().createElement(Ag(),{component:"span",variant:"body2",classes:{body2:u.label},className:O()({[y]:g.includes(r.uri),[u.ovFalse]:!(0,x.isOv)(r)}),"data-reltio-id":"reltio-attribute-complex-label"},n),v().createElement("div",{className:u.spacer}),c&&v().createElement(c,{attributeType:l,attributeValue:r}),v().createElement(yD,{uri:r.uri,relatedObjectUris:(0,x.createRelatedObjectUris)(E,{uri:r.uri}),objectType:E}))),d&&v().createElement(KF,{attrTypes:t,entity:h,drawLines:!0,parentUri:p,showNonOv:o},i))};var uP=r(29195);function pP(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){dP(e,t,r[t])}))}return e}function dP(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const mP=(0,kp.Z)({label:{textDecoration:"none",verticalAlign:"middle"},updateAttribute:pP({width:"fit-content",padding:"0 4px",marginLeft:"-4px"},x.historyPalettes[x.HistoryOperations.updateAttribute]),insertAttribute:pP({width:"fit-content"},x.historyPalettes[x.HistoryOperations.insertAttribute]),deleteAttribute:pP({width:"fit-content",textDecoration:"line-through",padding:"0 4px",marginLeft:"-4px"},x.historyPalettes[x.HistoryOperations.deleteAttribute]),pivotingTooltip:{marginLeft:"4px"}});function gP(){return gP=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gP.apply(this,arguments)}const yP=(0,b.memo)((e=>{let{attributeValue:t,attributeType:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeValue","attributeType"]);const a=mP(),{appearance:i}=(0,b.useContext)(ND),o=(0,b.useMemo)((()=>{const e=(0,x.getHistoryAppearanceByUri)(t.uri,i),n=(0,x.getHistoryAttributeClassName)(e),o=t.label?t.label:(0,x.evaluateDeepEntityLabel)(t,r.dataLabelPattern);return v().createElement(WD,{className:a.pivotingTooltip,value:t,attributeType:r},v().createElement(KI(),{component:"span",className:O()(a[n],a.label)},v().createElement(uP.b,{text:(0,x.getLabel)(o)})))}),[i,a,t,r]);return v().createElement(cP,gP({label:o,attributeValue:t,attributeTypesList:(0,x.getAttributeTypeSubAttributes)({},r),attributeType:r},n))}));var fP=r(24217),hP=r(16782);const EP=(0,kp.Z)((e=>({link:{color:e.palette.primary.main,textDecoration:"none"}})));function bP(){return bP=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},bP.apply(this,arguments)}const vP=e=>{const t=EP(),r=(0,hP.GV)(),{href:n,className:a}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["href","className"]),o=O()(t.link,a);return r&&n?v().createElement(fP.rU,bP({to:n.replace(window.location.origin,""),className:o},i)):v().createElement("a",bP({href:n,className:o},i))};function TP(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){OP(e,t,r[t])}))}return e}function OP(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const xP=(0,kp.Z)((e=>({relationshipLabel:{marginLeft:"4px",color:e.palette.text.primary},updateAttribute:TP({width:"fit-content",padding:"0 4px",marginLeft:"-4px"},x.historyPalettes[x.HistoryOperations.updateAttribute]),insertAttribute:TP({width:"fit-content"},x.historyPalettes[x.HistoryOperations.insertAttribute]),deleteAttribute:TP({width:"fit-content",textDecoration:"line-through",padding:"0 4px",marginLeft:"-4px"},x.historyPalettes[x.HistoryOperations.deleteAttribute]),ovFalse:e.inactive})));function CP(){return CP=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},CP.apply(this,arguments)}const SP=(0,b.memo)((e=>{let{attributeValue:t,attributeType:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeValue","attributeType"]);const a=xP(),i=(0,w.AH)(),o=(0,w.Qh)(),l=(0,x.getReferencedEntityUriFromAttrValue)(t),s=(0,b.useMemo)((()=>(0,x.getAttributeTypeSubAttributes)(i,r)),[r,i]),{appearance:c}=(0,b.useContext)(ND),{generateEntityUrl:u}=(0,b.useContext)(Wd),p=(0,b.useMemo)((()=>{const e=(0,x.getHistoryAppearanceByUri)(t.uri,c),r=(0,x.getHistoryAttributeClassName)(e),n=null!=l&&l.startsWith("changeRequests")?"dcrReview":"profile";return v().createElement(vP,{href:(0,x.isEmptyValue)(c)?u({uiPath:o,uri:l,screen:n}):void 0,className:O()(a[r],{[a.ovFalse]:!(0,x.isOv)(t)})},v().createElement(uP.b,{text:(0,x.getLabel)(t.label)}),t.relationshipLabel&&v().createElement("span",{className:a.relationshipLabel},v().createElement(uP.b,{text:t.relationshipLabel})))}),[t,c,o,l,a,u]);return v().createElement(cP,CP({attributeTypesList:s,attributeValue:t,label:p,attributeType:r},n))}));SP.displayName="ReferenceAttribute";const wP=e=>{const{attributeType:t}=e;return class{static build(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};switch(e.type){case x.DataTypes.TYPE_NESTED:return v().createElement(yP,t);case x.DataTypes.TYPE_REFERENCE:return v().createElement(SP,t);default:return v().createElement(tP,t)}}}.build(t,e)};function AP(){return AP=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},AP.apply(this,arguments)}const RP=e=>v().createElement("svg",AP({width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgControlAttribute"},e),v().createElement("mask",{id:"ControlAttribute_svg__a",fill:"#fff"},v().createElement("path",{d:"M10.966 9.203a3.2 3.2 0 11-.018-2.449l-1.375.581a1.707 1.707 0 10.01 1.307l1.383.561z"})),v().createElement("path",{d:"M10.966 9.203a3.2 3.2 0 11-.018-2.449l-1.375.581a1.707 1.707 0 10.01 1.307l1.383.561z",stroke:"#72828B",strokeWidth:4,mask:"url(#ControlAttribute_svg__a)"}),v().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.297 8.965a4.804 4.804 0 004.068 3.793v1.61a6.403 6.403 0 01-5.693-5.403h1.625zm4.068-5.724a4.803 4.803 0 00-4.124 4.124h-1.61a6.402 6.402 0 015.734-5.734v1.61zm5.393 4.124a4.804 4.804 0 00-3.793-4.068V1.672a6.403 6.403 0 015.404 5.693h-1.61zm-.055 1.6a4.806 4.806 0 01-3.738 3.738v1.625a6.405 6.405 0 005.363-5.363h-1.625z",fill:"#72828B"})),_P=(0,kp.Z)({icon:{display:"inline-flex",marginLeft:"8px",verticalAlign:"middle"}});function IP(){return IP=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},IP.apply(this,arguments)}const NP=(0,b.forwardRef)(((e,t)=>v().createElement("span",IP({},e,{ref:t}),v().createElement(RP,null))));NP.displayName="ControlAttributeForwarded";const DP=(0,yd.T)(NP),PP=()=>{const e=_P();return v().createElement(DP,{"data-reltio-id":"reltio-control-attribute-icon",tooltipTitle:mi().text("This is a control attribute. Changing this value will affect availability of other conditional attributes."),className:e.icon})};function kP(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){LP(e,t,r[t])}))}return e}function LP(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const UP="13px",jP="16px",FP={titleRow:{display:"inline-block",minHeight:"16px"},title:{wordBreak:"break-all",verticalAlign:"middle"},ovIcon:{marginLeft:"8px",textIndent:0},descriptionIcon:{textIndent:0}},MP=(0,kp.Z)({paddingWrapper:{paddingTop:"3px",paddingBottom:"5px","&:last-child":{paddingBottom:"2px"}},paddingWrapperWithLines:{paddingBottom:"1px","&:last-child":{paddingBottom:"2px"}}}),VP=(0,kp.Z)(kP({wrapper:{fontSize:UP,lineHeight:jP},collaborationWrapper:{display:"flex",alignItems:"start",minHeight:"18px",justifyContent:"space-between"},attribute:{marginLeft:"8px",paddingLeft:"4px",paddingRight:"4px",display:"inline",overflow:"hidden",whiteSpace:"pre-wrap",wordBreak:"break-word"},titleIcon:{width:"16px",height:"16px",marginRight:"8px",marginLeft:"1px",color:"rgba(0, 0, 0, 0.38)",verticalAlign:"middle"}},FP)),BP=(0,kp.Z)(kP({wrapper:{display:"flex",flexDirection:"column",alignItems:"flex-start",fontSize:UP,lineHeight:jP},attribute:{"&:last-child":{marginBottom:0},paddingLeft:"4px",paddingRight:"4px",marginLeft:"5px",marginBottom:"4px",whiteSpace:"pre-wrap",wordBreak:"break-word"},attributes:{alignSelf:"stretch"},titleRow:kP({},FP.titleRow,{marginBottom:"3px"})},FP)),zP=e=>{let{value:t,nonVisibleValues:r,attributeType:n,titleClassName:a,contentClassName:i,showNonOv:o,totalNonVisibleValues:l}=e;const s=VP(),{label:c,description:u}=n,p=(0,w.Ws)(),d=(0,b.useMemo)((()=>p.includes(n.uri)),[p,n.uri]),m=(0,x.isRelationUri)(t.uri)?x.CollaborationObjectTypes.RELATION_ATTRIBUTE:x.CollaborationObjectTypes.ENTITY_ATTRIBUTE;return v().createElement("div",{"data-reltio-id":"one-line-renderer",className:O()(s.collaborationWrapper,cN)},v().createElement("div",{className:O()(s.titleRow,s.wrapper)},v().createElement(ED,{label:c,className:O()(s.title,a),"data-reltio-id":"reltio-attribute-label"}),v().createElement(AD,{description:u,className:s.descriptionIcon}),d&&v().createElement(PP,null),v().createElement(OD,{nonOvValues:r,attributeType:n,className:s.ovIcon,nonOvTotal:l}),v().createElement(wP,{className:O()(s.attribute,i),attributeValue:t,attributeType:n,showNonOv:o,inlined:!0})),v().createElement(yD,{uri:t.uri,relatedObjectUris:(0,x.createRelatedObjectUris)(m,{uri:t.uri}),objectType:m}))};var HP=r(33062),YP=r.n(HP);const WP=(0,kp.Z)({link:{display:"flex",marginTop:4},icon:{fontSize:"1rem"}}),GP=e=>{let{moreNumber:t,valueNumber:r,onClick:n}=e;const a=WP();return v().createElement(uy(),{"data-reltio-id":"show-more",component:"button",variant:"caption",className:a.link,onClick:n,underline:"none"},v().createElement(YP(),{className:a.icon}),t&&r?mi().text("Show ${moreNumber} more of remaining ${valueNumber} value",{moreNumber:t,valueNumber:r}):mi().text("Show more"))};var qP=r(86800),ZP=r.n(qP);const $P=(0,kp.Z)({link:{display:"flex",marginTop:4},icon:{fontSize:"1rem"}}),KP=e=>{let{onClick:t}=e;const r=$P();return v().createElement(uy(),{component:"button",variant:"caption",className:r.link,onClick:t,underline:"none"},v().createElement(ZP(),{className:r.icon}),mi().text("Show less"))},XP=e=>{let{max:t,values:r,nonVisibleValues:n,totalVisibleValues:a,attributeType:i,parentUri:o,requestNextPageOfAttributeValues:l,titleClassName:s,contentClassName:c,showNonOv:u,totalNonVisibleValues:p}=e;const d=BP(),[m,g]=(0,b.useState)(t),y=(0,w.Ws)(),f=(0,b.useMemo)((()=>y.includes(i.uri)),[y,i.uri]),h=t<a,E=h&&m<a,T=h&&m>=a,{label:x,description:C}=i,S=r.slice(0,m),A=a-m;return v().createElement("div",{"data-reltio-id":"multi-line-renderer",className:d.wrapper},v().createElement("div",{className:d.titleRow},v().createElement(ED,{label:x,className:O()(d.title,s),"data-reltio-id":"reltio-attribute-label"}),v().createElement(AD,{description:C}),f&&v().createElement(PP,null),v().createElement(OD,{nonOvValues:n,attributeType:i,className:d.ovIcon,nonOvTotal:p})),v().createElement("div",{className:d.attributes},S.map((e=>v().createElement(wP,{key:e.uri,className:O()(d.attribute,c),attributeValue:e,attributeType:i,showNonOv:u})))),E&&v().createElement(GP,{moreNumber:(0,_.min)(t,A),valueNumber:A,onClick:()=>{r.length<a&&l({parentUri:o,attributeTypeUri:i.uri,attributeTypeName:i.name,values:r,defaultMaxValues:t}),g(m+t)}}),T&&v().createElement(KP,{onClick:()=>{g(t)}}))};var QP=r(88941),JP=r.n(QP);function ek(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){tk(e,t,r[t])}))}return e}function tk(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const rk=(0,kp.Z)({attributeValue:{verticalAlign:"middle"},insertAttribute:ek({width:"fit-content"},x.historyPalettes[x.HistoryOperations.insertAttribute]),deleteAttribute:ek({width:"fit-content",textDecoration:"line-through",padding:"0 4px"},x.historyPalettes[x.HistoryOperations.deleteAttribute])}),nk=e=>{let{value:t}=e;const r=rk(),{appearance:n}=(0,b.useContext)(ND),a=(0,w.AH)(),i=(0,x.getHistoryAppearanceBySpecialAttributeValue)("roles",t,n),o=(0,x.getHistoryAttributeClassName)(i);return v().createElement("span",{className:O()(r.attributeValue,r[o])},(0,x.getRoleLabel)(a,t))},ak=e=>{let{className:t,values:r,Component:n,dataReltioId:a}=e;return v().createElement("div",{className:t,"data-reltio-id":a},r.map(((e,t)=>v().createElement(b.Fragment,{key:e},v().createElement(n,{value:e}),t<r.length-1&&", "))))},ik=e=>{let{className:t,values:r}=e;return v().createElement(ak,{values:r,className:t,dataReltioId:"reltio-attribute-value",Component:nk})};function ok(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){lk(e,t,r[t])}))}return e}function lk(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const sk=(0,kp.Z)({attributeValue:{verticalAlign:"middle"},insertAttribute:ok({width:"fit-content"},x.historyPalettes[x.HistoryOperations.insertAttribute]),deleteAttribute:ok({width:"fit-content",textDecoration:"line-through",padding:"0 4px"},x.historyPalettes[x.HistoryOperations.deleteAttribute])}),ck=e=>{let{value:t}=e;const r=sk(),n=(0,b.useContext)(bD),{appearance:a}=(0,b.useContext)(ND),{generateTagUrl:i}=(0,b.useContext)(Wd),o=(0,w.eh)(),l=(0,w.Qh)(),s=(0,x.getHistoryAppearanceBySpecialAttributeValue)("tags",t,a),c=(0,x.getHistoryAttributeClassName)(s),u=n||o;return v().createElement(vP,{className:O()(r.attributeValue,r[c]),href:i({uiPath:l,tag:t,entityUri:u.dataTenant?(0,x.getDataTenantEntityUri)(u):u.uri})},t)},uk=e=>{let{className:t,values:r}=e;return v().createElement(ak,{values:r,className:t,dataReltioId:"reltio-attribute-value",Component:ck})},pk=e=>{let{values:t,attributeType:r}=e;const n=VP(),{label:a}=r;return v().createElement("div",{"data-reltio-id":"special-renderer",className:O()(n.titleRow,n.wrapper)},(i=n.titleIcon,r.uri===x.EntityAttrTypes.tags.uri?v().createElement(JP(),{className:i}):null),v().createElement(ED,{label:a,className:n.title,"data-reltio-id":"reltio-attribute-label"}),(e=>{switch(r.uri){case x.EntityAttrTypes.tags.uri:return v().createElement(uk,{className:e,values:t});case x.EntityAttrTypes.roles.uri:return v().createElement(ik,{className:e,values:t});default:return v().createElement(wP,{className:e,attributeValue:{value:t[0],uri:""},attributeType:r,inlined:!0})}})(n.attribute));var i};var dk=r(97986),mk=r.n(dk);function gk(){return gk=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gk.apply(this,arguments)}const yk=e=>v().createElement("svg",gk({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgDefaultImage"},e),v().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},v().createElement("path",{d:"M0 0h24v24H0z"}),v().createElement("path",{d:"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zm-4.5-9l2.5 3.096V18H5l4.5-5.5 2.5 3.01L16.5 10zm-8-4a1.5 1.5 0 110 3 1.5 1.5 0 010-3z",fillOpacity:.12,fill:"#000",fillRule:"nonzero"}))),fk={SMALL:{imageWidth:114,imageHeight:114},MEDIUM:{imageWidth:162,imageHeight:162},LARGE:{imageWidth:192,imageHeight:192},OVERRIDE:{imageWidth:"unset",imageHeight:"unset"}},hk=(0,kp.Z)((e=>({root:{position:"relative"},image:e=>{let{imageWidth:t,imageHeight:r}=e;return{width:t,height:r,objectFit:"cover",verticalAlign:"bottom"}},defaultContainer:{display:"flex",alignItems:"center",backgroundColor:"rgb(247, 247, 247)"},defaultImage:{width:"40px",height:"40px",marginLeft:"auto",marginRight:"auto",color:e.palette.text.secondary},hideImage:{display:"none"}})));function Ek(){return Ek=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ek.apply(this,arguments)}const bk=(0,b.memo)((e=>{const{src:t,className:r,containerClassName:n,size:a=fk.SMALL,overlay:i=null}=e,o=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["src","className","containerClassName","size","overlay"]),l=a||fk.SMALL,s=hk(l),[c,u]=(0,b.useState)(bm.oA.LOADING);(0,b.useEffect)((()=>{u(bm.oA.LOADING)}),[t]);const p=c===bm.oA.LOADING,d=c===bm.oA.LOADED;return c===bm.oA.ERROR?v().createElement("div",Ek({className:O()(s.defaultContainer,s.image,r)},o),v().createElement(mk(),{className:s.defaultImage})):v().createElement("div",{className:O()(s.root,n)},!(0,x.isEmptyValue)(t)&&v().createElement("img",Ek({src:t,className:O()(s.image,r,{[s.hideImage]:p}),onLoad:()=>{u(bm.oA.LOADED)},onError:()=>{u(bm.oA.ERROR)},alt:"image"},o)),p&&v().createElement("div",Ek({className:O()(s.defaultContainer,s.image,r)},o),v().createElement(yk,{className:s.defaultImage})),d&&i)})),vk={imageMargin:4,imageWidth:fk.SMALL.imageWidth,imageHeight:fk.SMALL.imageHeight};var Tk=r(59849),Ok=r.n(Tk),xk=r(47867),Ck=r.n(xk),Sk=r(93643),wk=r.n(Sk);const Ak=(0,kp.Z)((()=>({thumbnails:{marginLeft:"12px",marginBottom:"12px",marginTop:"auto",width:"calc(100vw - 364px)",overflowX:"auto",overflowY:"hidden"},gridContainer:{width:"100%"},thumb:{width:"96px",height:"96px",cursor:"pointer",userSelect:"none"},inactiveThumb:{filter:"brightness(0.5)"}}))),Rk=e=>{let{attributeValues:t,setAttributeValueIndex:r,attributeValueIndex:n}=e;const a=Ak(),i=(0,b.useRef)(null);return(0,b.useEffect)((()=>{if(null!=i&&i.current){const e=i.current.scrollLeft,t=i.current.offsetWidth+e,r=96*n+16*n+12;t<r?i.current.scroll&&(r>t+96+16?i.current.scroll(r,0):i.current.scroll(112+e,0)):e+96>r&&i.current.scroll&&i.current.scroll(r-96,0)}}),[n,i]),v().createElement("div",{ref:i,className:a.thumbnails},v().createElement(wk(),{container:!0,wrap:"nowrap",direction:"row",spacing:1,className:a.gridContainer},t.map(((e,t)=>{let{uri:i,value:o}=e;return v().createElement(wk(),{item:!0,key:i},v().createElement(bk,{onClick:()=>r(t),className:O()(a.thumb,{[a.inactiveThumb]:n!==t}),src:(0,x.getImageAttributeOvThumbnailUrl)({value:o})}))}))))},_k=(0,kp.Z)((e=>({root:{display:"flex",alignContent:"center",flexDirection:"column"},main:{position:"relative",padding:"0 86px",marginTop:"auto"},mainImageContainer:{display:"flex",alignContent:"center",height:"100%",width:"100%"},mainImage:{maxWidth:"calc(100vw - 512px)",maxHeight:"calc(100vh - 192px)",margin:"0 auto",userSelect:"none"},arrowButton:{backgroundColor:e.palette.divider,color:"white","&:hover":{backgroundColor:e.palette.divider}},arrowButtonPrev:{position:"absolute",top:"50%",left:"16px",transform:"translateY(-50%)"},arrowButtonNext:{position:"absolute",top:"50%",right:"16px",transform:"translateY(-50%)"}}))),Ik=e=>{let{className:t,attributeValues:r,attributeValueIndex:n,setAttributeValueIndex:a}=e;const i=_k(),o=r[n],l=(0,x.getImageAttributeOvPreviewUrl)(o);return v().createElement("div",{className:O()(i.root,t)},v().createElement("div",{className:i.main},n>0&&v().createElement(Pp.T,{icon:Ok(),className:O()(i.arrowButton,i.arrowButtonPrev),onClick:()=>{a(n-1)},size:"XL"}),v().createElement(bk,{containerClassName:i.mainImageContainer,className:i.mainImage,size:l&&fk.OVERRIDE,src:l}),n!==r.length-1&&v().createElement(Pp.T,{icon:Ck(),className:O()(i.arrowButton,i.arrowButtonNext),onClick:()=>{a(n+1)},size:"XL"})),v().createElement(Rk,{attributeValues:r,attributeValueIndex:n,setAttributeValueIndex:a}))};var Nk=r(71884),Dk=r.n(Nk);const Pk=(0,_.curry)(((e,t)=>(0,_.filter)((t=>(t.label||t.name).toLowerCase().includes(e.toLowerCase())))(t))),kk=e=>{let{attrTypes:t,filter:r="",sortingFn:n}=e;return(0,_.pipe)(Pk(r),(0,_.sort)(n),(0,_.map)((e=>({item:{id:e.uri,label:e.label||e.name,attrType:e}}))))(t)};var Lk=function(e){return e.parent="parent",e.attributes="attributes",e}(Lk||{});const Uk=(0,kp.Z)({moreAttributes:{display:"flex",paddingBottom:"6px","&$dense":{padding:0}},dense:{},popupContainer:{},moreAttributesPopup:{"&$popupContainer":{}},moreButton:{padding:"9px 16px 9px 12px",backgroundColor:"rgba(98, 2, 238, 0)",marginTop:"8px",marginLeft:"-4px",marginBottom:"4px"},buttonLabel:{fontSize:"14px",fontWeight:500,lineHeight:"16px"},icon:{fontSize:"18px",marginRight:"8px"},subHeader:{backgroundColor:"rgb(245, 245, 245)",padding:"0 16px",margin:0,display:"flex",alignItems:"center",color:"rgba(0,0,0,0.84)",fontSize:"14px",fontWeight:500},noResultsCaptionContainer:{position:"absolute",top:0,bottom:0,left:0,right:0,display:"flex",justifyContent:"center",alignItems:"center"}}),jk=e=>{let{label:t,popupTitle:r=t,data:n,parent:a,dense:i,onApply:o}=e;const l=Uk(),s=(0,b.useRef)(),[c,u]=(0,b.useState)(!1),[p,d]=(0,b.useState)(""),[m,g]=(0,b.useState)([]),{items:y,hasGroups:f,parentGroupLength:h,attributesGroupLength:E}=(e=>{let{data:t,parent:r,filter:n}=e;const a=(0,w.mT)(),i=Boolean(r),o=(0,b.useMemo)((()=>a===x.SortingStrategy.ASC_BY_NAME?(e,t)=>{var r;return null==e||null===(r=e.label)||void 0===r?void 0:r.localeCompare(null==t?void 0:t.label)}:(e,t)=>0),[a]),l=(0,b.useMemo)((()=>i?kk({attrTypes:[r],filter:n,sortingFn:o}):[]),[i,r,n,o]),s=(0,b.useMemo)((()=>i&&null!=l&&l.length?[{item:{id:Lk.parent,label:mi().text("Parent")},items:l}]:[]),[i,l]),c=(0,b.useMemo)((()=>kk({attrTypes:t,filter:n,sortingFn:o})),[t,n,o]),u=(0,b.useMemo)((()=>i&&null!=c&&c.length?[{item:{id:Lk.attributes,label:mi().text("Attributes")},items:c}]:c),[i,c]),p=(0,b.useMemo)((()=>Hp((s||[]).concat(u))),[s,u]),d=s.length,m=u.length;return{items:p,hasGroups:i,parentGroupLength:d,attributesGroupLength:m}})({data:n,parent:a,filter:p}),T=(0,b.useCallback)(((e,t)=>{g((0,_.ifElse)((0,_.always)(t),(0,_.append)(e),(0,_.reject)((0,_.propEq)("id",e.id)))(m))}),[m]),C=(0,b.useCallback)(((e,t)=>t.items?40:28),[]),S=(0,b.useCallback)((e=>{let{item:t}=e;T(t,(0,_.not)((0,_.any)((0,_.propEq)("id",t.id))(m)))}),[T,m]),{focusIndex:A,handleKeyDown:R}=$p({items:y,open:c,onSelectFocusedItem:S,selectedItems:m}),I=(0,b.useRef)(null);I.current=A;const N=f?(h?1:0)+(E?1:0):0,D=y.length-N,P=Math.min(255,28*D+40*N),k=Math.max(140,P+112),L=(0,b.useCallback)(((e,t,r)=>{var n;let{item:a,level:i=0}=t;const o=(0,_.any)((0,_.propEq)("id",a.id))(m),l=I.current===r;return v().createElement(bd,{key:a.uri,onClick:T,checked:o,level:i,data:a,label:v().createElement(vd.o,{text:a.label,highlight:p}),labelInText:a.label,style:e,isFocused:l,isRequired:!(null===(n=a.attrType)||void 0===n||!n.required),LogoIcon:a.LogoIcon})}),[p,T,m]),U=(0,b.useCallback)(((e,t)=>v().createElement(og(),{component:"div",className:l.subHeader,style:e,key:`group-${t.item.id}`},t.item.label)),[]);return v().createElement("div",{className:O()(l.moreAttributes,{[l.dense]:i})},v().createElement(nE(),{color:"primary",onClick:()=>u(!c),ref:s,className:l.moreButton},v().createElement(Dk(),{classes:{root:l.icon}}),v().createElement("div",{className:l.buttonLabel},t)),v().createElement(zp,{open:c,className:O()(l.moreAttributesPopup,l.popupContainer),anchorEl:s.current,onClose:(0,_.pipe)((()=>{m.length>0&&o((0,_.pluck)("attrType",m))}),(()=>u(!1)),(()=>d("")),(()=>g([]))),onSearch:d,containerHeight:k,title:r,containerWidth:320,searchInputOnKeyDown:R},v().createElement(Zp,{getItemSize:C,renderItem:L,renderGroupTitle:U,disableHorizontalScrollbar:!0,items:y,height:P,focusIndex:A}),0===y.length&&v().createElement("div",{className:l.noResultsCaptionContainer},v().createElement(Ag(),{variant:"caption",display:"block",gutterBottom:!0},mi().text("No results found")))))},Fk=v().createContext({canCreate:!0,canUpdate:!0,canDelete:!0});Fk.displayName="ConfigPermissionsContext";const Mk=e=>{const{canCreate:t,canUpdate:r,canDelete:n}=(0,b.useContext)(Fk),a=(0,x.isTempUri)(e);return(0,b.useMemo)((()=>({canCreate:t,canUpdate:a||r,canDelete:a||n})),[a,t,r,n])},Vk={get CreationTime(){return mi().text("Creation Time")},get CreationDate(){return mi().text("Creation Date")},get Dimensions(){return mi().text("Dimensions")},get MimeType(){return mi().text("Mime Type")},get Size(){return mi().text("Size")},get Url(){return mi().text("Full image URL (S3)")},get UrlPreview(){return mi().text("Preview image URL (S3)")},get UrlThumbnail(){return mi().text("Small image URL (S3)")},get CdnUrl(){return mi().text("Full image URL (CDN)")},get CdnUrlPreview(){return mi().text("Preview image URL (CDN)")},get CdnUrlThumbnail(){return mi().text("Small image URL (CDN)")}},Bk=function(){let{value:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return["Url","UrlPreview","UrlThumbnail","CdnUrl","CdnUrlPreview","CdnUrlThumbnail","MimeType"].includes(t)?(0,_.path)([t,0,"value"],e):"CreationDate"===t&&(0,_.path)(["CreationTimestamp",0,"value"],e)?Ya()(e.CreationTimestamp[0].value).format("MM-DD-YYYY"):"CreationTime"===t&&(0,_.path)(["CreationTimestamp",0,"value"],e)?Ya()(e.CreationTimestamp[0].value).format("HH:mm:ss"):"Dimensions"===t&&(0,_.path)(["Height",0,"value"],e)&&(0,_.path)(["Width",0,"value"],e)?`${e.Height[0].value} x ${e.Width[0].value} ${mi().text("pixels")}`:"Size"===t&&(0,_.path)(["Size",0,"value"],e)?`${(Number(e.Size[0].value)/1e3).toFixed(2)} KB`:void 0},zk=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.filter((e=>{let{system:t}=e;return!t}))},Hk=(e,t)=>{const{includeNames:r=[],excludeNames:n=[],order:a=[]}=t,i=r.length?e.filter((e=>r.includes(e))):e.filter((e=>!n.includes(e)));return 0===a.length?i:i.sort(((e,t)=>{const r=a.indexOf(e),n=a.indexOf(t);return-1===r&&-1!==n?1:-1===n&&-1!==r?-1:r-n}))},Yk=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;const n=zk(t.attributes);return Hk(Object.keys(e.value||{}),r).reduce(((t,r)=>{const a=n.find((e=>{let{name:t}=e;return t===r}));return a?[...t,{attrType:a,values:e.value[r]}]:t}),[])},Wk=e=>["Url","UrlPreview","UrlThumbnail","CdnUrl","CdnUrlPreview","CdnUrlThumbnail"].includes(e),Gk=(0,kp.Z)({title:{marginBottom:"10px",color:"white",fontSize:"18px",lineHeight:"21px","&$canAdd":{marginBottom:"3px"}},divider:{width:"100%",height:"1px",borderColor:"rgba(255,255,255,0.12)"},canAdd:{}}),qk=e=>{let{attributeType:t,onAddAttributes:r,uri:n}=e;const a=Gk(),i=zk(t.attributes),{canCreate:o}=(0,b.useContext)(Fk),l=o&&Boolean(r);return v().createElement(KI(),null,v().createElement(Ag(),{className:O()(a.title,{[a.canAdd]:l})},mi().text("Meta info")),l&&v().createElement(b.Fragment,null,v().createElement(jk,{label:mi().text("Attributes"),data:i,dense:!1,onApply:e=>{r&&r(e.map((e=>({attributeType:e,parentUri:n}))))}}),v().createElement(Lg(),{className:a.divider})))},Zk=(0,kp.Z)((e=>({root:{fontSize:"13px",letterSpacing:0,lineHeight:"15px",marginBottom:"11px"},title:{color:"rgba(255,255,255,0.54)",marginRight:"12px",float:"left"},content:{color:"rgba(255,255,255,0.87)",wordWrap:"break-word"},link:{color:e.palette.primary.main,textDecoration:"none"}}))),$k=e=>{let{title:t,content:r,isLink:n,children:a}=e;const i=Zk();return v().createElement("div",{className:i.root},v().createElement("span",{className:i.title},t),n?v().createElement("a",{className:i.link,href:r},mi().text("link")):v().createElement("span",{className:i.content},r||a))},Kk=(0,kp.Z)({root:{padding:"10px 0"},title:{color:"rgba(255,255,255,0.54)",fontSize:"13px"},content:{color:"rgba(255,255,255,0.87)",wordWrap:"break-word"}}),Xk=e=>{let{attributeValue:t,attributeType:r,imageAttributeFieldsOrder:n}=e;const a=Kk(),i=(0,w.xH)(),o=(l=t,s=n,Hk(Object.keys(Vk),s).map((e=>Bk(l,e)?{title:Vk[e],value:Bk(l,e),isLink:Wk(e)}:null)).filter(Boolean));var l,s;const c=Yk(t,r,n);return v().createElement(KI(),{className:a.root},o.map((e=>{let{title:t,value:r,isLink:n}=e;return v().createElement($k,{key:t,isLink:n,title:t,content:r})})),i&&c.map((e=>{let{attrType:r,values:n}=e;return v().createElement(ZF,{key:r.uri,attributeType:r,drawLines:!1,values:n,titleClassName:a.title,contentClassName:a.content,parentUri:t.uri})})))},Qk=(0,kp.Z)((e=>({caption:{display:"flex",color:e.palette.error.main,fontSize:"12px",lineHeight:"16px"}}))),Jk=e=>{let{className:t,message:r}=e;const n=Qk();return r?v().createElement(Ag(),{variant:"caption",className:O()(n.caption,t)},r):null};var eL=r(66826),tL=r.n(eL),rL=r(95210),nL=r(70485),aL=r.n(nL),iL=r(53167),oL=r.n(iL);const lL=(0,kp.Z)({wrapper:{width:"100%"},helperText:{margin:"3px 0 1px 12px"}});function sL(){return sL=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},sL.apply(this,arguments)}const cL=(0,b.memo)((e=>{let{errorMessage:t,children:r,className:n,classes:a}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["errorMessage","children","className","classes"]);const o=lL(),l=!!t;return v().createElement(aL(),sL({variant:"standard",className:O()(o.wrapper,n,null==a?void 0:a.root),error:!0},i),r,l&&v().createElement(oL(),{className:O()(o.helperText,null==a?void 0:a.helperText)},v().createElement(Jk,{message:t})))}));cL.displayName="ErrorWrapper";const uL=(e,t,r,n)=>{const a=(0,_.pipe)(x.getEntityType,(0,_.defaultTo)({}),(0,_.props)(["attributes","analyticsAttributes"]),(0,_.reject)(_.isNil),_.flatten,(0,_.concat)(_.__,(0,_.pipe)(_.values,(0,_.reject)((0,_.propEq)("uri",x.EntityAttrTypes.id.uri)))(x.EntityAttrTypes)))(e,t);return r.length?a.filter((e=>{let{uri:t}=e;return r.includes(t)})):a.filter((e=>{let{uri:t}=e;return!n.includes(t)}))},pL=(e,t)=>(0,_.partition)((0,_.pipe)((0,_.path)(["attrType","uri"]),(0,_.includes)(_.__,e)),t),dL=(0,_.eqBy)((0,_.pick)(["fieldName","uri","entityTypeUri"])),mL=(e,t)=>t&&!!t.find(dL(e)),gL=(0,_.curry)(((e,t,r)=>{const n=((e,t)=>{const{type:r}=(0,x.getAttrDataTypeDefinition)(e);switch(r){case x.DataTypes.TYPE_BOOLEAN:case x.DataTypes.TYPE_BOOLEAN_RADIO:case x.DataTypes.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return t.toString();case x.DataTypes.TYPE_DATE:return t&&Ya()(t).format("YYYY-MM-DD")||"";case x.DataTypes.TYPE_TIMESTAMP:return t&&Ya()(t).utc().format()||"";case x.DataTypes.TYPE_ACTIVENESS_DATE:case x.DataTypes.TYPE_LOCAL_DATE:return t&&t.valueOf();default:return t||""}})(t,r);return{value:n,uri:e.uri,attributeType:t}})),yL=v().createContext({enabled:!1,queueSizeThreshold:0});yL.displayName="AsyncMountContext";let fL=0;const hL=()=>{const e=(0,b.useRef)(!0),{enabled:t,queueSizeThreshold:r=0}=(0,b.useContext)(yL),[n,a]=(0,b.useState)(!t||t&&fL<r);e.current&&fL++;const i=(0,b.useRef)();return(0,b.useEffect)((()=>{if(fL--,!n)return i.current=setTimeout((()=>{a(!0)}),0),()=>clearTimeout(i.current)}),[]),e.current=!1,n};function EL(){return EL=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},EL.apply(this,arguments)}var bL=r(50548);const vL=v().createContext(!1);vL.displayName="ProfilePerspectiveViewContext";let TL=function(e){return e.Error="Error",e.NewAttribute="NewAttribute",e.NewView="NewView",e}({});const OL=e=>e===TL.Error,xL=v().createContext({element:null,type:null,highlightView:_.identity,highlightError:_.identity,highlightAttribute:_.identity,scrollIntoRef:_.identity});function CL(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){SL(e,t,r[t])}))}return e}function SL(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const wL={content:'""',position:"absolute",left:"-1000px",top:"0px",width:"5000px",height:"calc(100% - 10px)",animationName:"$highlightAnimation",animationDuration:"2s",animationIterationCount:1,opacity:0},AL=(0,kp.Z)((()=>({"@keyframes highlightAnimation":{"0%":{opacity:0},"50%":{opacity:1},"100%":{opacity:0}},highlightError:{"&::before":CL({},wL,{background:"rgba(255, 0, 0, 0.06)"})},highlightWarning:{"&::before":CL({},wL,{background:"rgba(228, 151, 0, 0.08)"})},simpleAttribute:{position:"relative","&::before":{top:"-4px",height:"calc(100% + 8px)"}}}))),RL=e=>{let{highlightedError:t,isSimple:r=!1}=e;const n=AL(),a=(0,b.useRef)(null),i=(0,_.pathOr)(x.ErrorSeverity.ERROR,["element","severity"])(t),o=O()({[n.highlightError]:i===x.ErrorSeverity.ERROR,[n.highlightWarning]:i===x.ErrorSeverity.WARNING,[n.simpleAttribute]:r});return(0,b.useEffect)((()=>{t&&t.scrollIntoRef(a)}),[t]),t?{ref:a,errorClassName:o}:{ref:a}};var _L=r(51894);const IL=(0,kp.Z)((e=>({wrapper:{width:"100%"},errorWrapper:{alignSelf:"stretch"},editor:{display:"flex",flex:1,alignItems:"flex-start",marginBottom:"10px",position:"relative"},"editor-value":{flex:"1 1 auto"},"editor-read-only-value":{marginLeft:"12px",display:"flex",alignItems:"center",color:e.palette.text.primary},"editor-actions":{display:"flex",alignItems:"center",paddingLeft:"8px"},addButton:{marginRight:"-8px"},button:{color:e.palette.text.secondary},placeholder:{height:"50px"},deleted:{color:e.palette.text.secondary,textDecoration:"line-through"},editedLabel:{fontStyle:"italic",color:e.palette.text.secondary}})));function NL(){return NL=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},NL.apply(this,arguments)}const DL=(0,bL.l)(xL,((e,t)=>{let{attributeValue:r}=t;const{element:n,type:a}=e||{};return{highlightedError:OL(a)&&(null==n?void 0:n.uri)===r.uri?e:null}}),(e=>{let{className:t,attributeValue:r,attributeType:n,isReltioCrosswalk:a,ownError:i,mode:o,onAddOneMore:l,onDeleteAttribute:s,onChangeAttribute:c,onDeactivateError:u,additionalControlsRenderer:p,state:d,highlightedError:m,isEmptyEditor:g=!1}=e,y=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","attributeValue","attributeType","isReltioCrosswalk","ownError","mode","onAddOneMore","onDeleteAttribute","onChangeAttribute","onDeactivateError","additionalControlsRenderer","state","highlightedError","isEmptyEditor"]);const f=IL(),h="deleted"===d,E="edited"===d,T=(0,x.isEditableMode)(o),{canCreate:C,canEdit:S,canDelete:A}=(e=>{let{attributeType:t,attributeValue:r,isReltioCrosswalk:n,mode:a}=e;const{canCreate:i,canUpdate:o,canDelete:l}=Mk(r.uri);return{canCreate:i&&(0,x.checkCanCreateAttribute)({attributeType:t,mode:a}),canEdit:o&&(0,x.checkCanEditAttribute)({attributeType:t,attributeValue:r,mode:a,isReltioCrosswalk:n}),canDelete:l&&(0,x.checkCanDeleteAttribute)({attributeType:t,attributeValue:r,mode:a,isReltioCrosswalk:n})}})({attributeValue:r,attributeType:n,mode:o,isReltioCrosswalk:a}),R=S&&T,I=(0,x.getErrorMessage)(i),N=(0,w.ZI)(r,n),{ref:D,errorClassName:P}=RL({highlightedError:m,isSimple:!0});(0,b.useEffect)((()=>{g&&(0,x.isDependentLookupAttrType)(n)&&!(0,_.has)("lookupCode",r)&&c({attributeType:n,uri:r.uri,value:r.value,silent:!0})}),[g]);const k=(0,b.useMemo)((()=>(0,x.getAttrDataTypeDefinition)(n)),[n]),L=(0,b.useMemo)((()=>((e,t)=>{let{type:r}=t;const{value:n,lookupCode:a}=e||{};switch(r){case x.DataTypes.TYPE_BOOLEAN:case x.DataTypes.TYPE_BOOLEAN_RADIO:case x.DataTypes.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return(0,x.parseBoolean)(n);case x.DataTypes.TYPE_DATE:return n&&x.utils.dates.toLocalDate(n)||null;case x.DataTypes.TYPE_LOCAL_DATE:case x.DataTypes.TYPE_TIMESTAMP:case x.DataTypes.TYPE_ACTIVENESS_DATE:return n&&new Date(n)||null;case x.DataTypes.TYPE_DEPENDENT_LOOKUP:case x.DataTypes.TYPE_LOOKUP:return{value:n,lookupCode:a};default:return n}})(r,k)),[r,k]),U=(0,b.useCallback)((()=>{i&&u((0,x.getErrorId)(i))}),[i,u]),j=(0,b.useCallback)((0,_.pipe)(gL(r,n),c,U),[r,n,c,U]),F=!!l&&C&&!n.singleValue,M=!h&&!!s&&A,V=!!I,B=h?{disabled:!0,isCrossedOut:!0}:{},z=(0,b.useContext)(vL),{autopopulationContextValue:H}=(e=>{let{enabled:t,attributeTypeUri:r,valueUri:n}=e;const a=(0,w.ax)("dependentLookupsEditorTouched"),i=(0,w.Pl)(),o=(0,w.h0)(n),l=t&&(0,x.isAutopopulationEnabled)(i,r),s=l?n:null,{isTouched:c=!1}=l&&o||{},u=(0,b.useCallback)((e=>{a({uri:e,isTouched:!0})}),[a]);return{autopopulationContextValue:(0,b.useMemo)((()=>s?{id:s,isTouched:c,onTouch:u}:null),[s,c,u])}})({enabled:z&&(0,x.isDependentLookupAttrType)(n),attributeTypeUri:null==n?void 0:n.uri,valueUri:r.uri});return v().createElement("div",{ref:D,className:O()(f.editor,t,P)},v().createElement(cL,{errorMessage:I,className:f.errorWrapper},v().createElement("div",{className:O()(f["editor-value"],{[f.deleted]:h},{[f["editor-read-only-value"]]:!R}),"data-reltio-id":"reltio-attribute-value"},R?v().createElement(_L.m.Provider,{value:H},v().createElement(rL.Z,NL({fieldName:(0,x.attributeUriToSearchUri)(n.uri),value:L,dataTypeDefinition:k,error:V,onChange:j,fullWidth:!0},N,y,B))):v().createElement(Xd.x,{value:(0,x.getAttributeValue)(r),dataTypeDefinition:k}))),v().createElement("div",{className:f["editor-actions"]},E&&v().createElement(Ag(),{variant:"caption",className:f.editedLabel},"(",mi().text("edited"),")"),F&&v().createElement(Pp.T,{icon:Dk(),onClick:l,size:"L",className:O()(f.addButton,f.button),"data-reltio-id":"reltio-add-one-more-simple-attribute-button"}),p&&p({attributeType:n,attributeValue:r}),M&&v().createElement(Pp.T,{className:f.button,icon:tL(),onClick:()=>{s({uri:r.uri,attributeType:n}),(0,x.getErrorType)(i)!==x.ErrorType.missed&&U()},size:"L","data-reltio-id":"reltio-delete-simple-attribute-button"})))})),PL=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const r=(0,b.forwardRef)(((r,n)=>hL()?v().createElement(e,EL({},r,{ref:n})):t&&v().createElement(t,EL({},r,{ref:n}))));return r.displayName="WithAsyncMount",r}(DL,(()=>{const e=IL();return v().createElement("div",{className:e.placeholder})})),kL=[x.EntityAttrTypes.roles.uri,x.EntityAttrTypes.tags.uri],LL=v().createContext(null),UL=v().createContext(null),jL=(0,b.createContext)({});function FL(){return FL=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},FL.apply(this,arguments)}function ML(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const VL=(0,bL.l)(xL,(e=>{const{highlightAttribute:t}=e||{};return{highlightAttribute:t}}),(e=>{let{parentAttributeType:t,attrTypes:r,entity:n,parentUri:a,showEmptyEditors:i,mode:o,crosswalks:l,drawLines:s,children:c,className:u,alwaysVisibleTypeUris:p=kL,onAddAttributes:d,onChangeAttribute:m,onDeleteAttribute:g,additionalControlsRenderer:y,showNonOv:f,highlightAttribute:h}=e;const E=(0,b.useContext)(jL),T=a&&(0,x.getBaseUri)(a),O=(0,b.useMemo)((()=>E[T]||[]),[E,T]),C=(0,b.useMemo)((()=>r.filter((e=>!O.includes(e.uri)))),[r,O]),{attributes:S={}}=n,[w,A]=(0,b.useState)({}),R=(0,b.useCallback)(((e,t)=>{A((r=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ML(e,t,r[t])}))}return e}({},r,{[e]:t})))}),[]);(0,b.useEffect)((()=>{A({})}),[a]);const{canCreate:I}=(0,b.useContext)(Fk),N=(0,b.useMemo)((()=>I&&t&&(0,x.checkCanCreateAttribute)({attributeType:t,mode:o})),[t,o,I]),D=((e,t,r,n)=>e.filter((e=>{const a=((e,t)=>{const{attributes:r={},analyticsAttributes:n={}}=t;return(0,_.cond)([[x.isSpecialAttribute,(0,_.always)(t)],[(0,_.both)(x.isAnalyticAttribute,(0,_.always)(n)),(0,_.always)(n)],[_.T,(0,_.always)(r)]])(e)})(e,t),i=(e=>(0,x.isSpecialAttribute)(e)?"uri":"name")(e);return!((e.singleValue||(0,x.isRoleAttrType)(e)||(0,x.isTagAttrType)(e))&&((0,_.has)(e[i])(a)||r&&(null==n||!n[e.uri])))})))((0,b.useMemo)((()=>I?(0,x.getCreatableAttributeTypes)(o,C):[]),[C,o,I]),n,i,w),P=(0,b.useContext)(LL),k=(0,b.useMemo)((()=>(0,x.getAttributesListForEditMode)(C,o,n,i,f,P,I)),[C,o,n,i,f,P,I]),[L,U]=(0,b.useMemo)((()=>pL(p,k)),[k,p]),j=(0,b.useCallback)((e=>{d(e.map((e=>({attributeType:e,parentUri:e===t?(0,x.getParentUri)(a):a})))),h((0,_.last)(e),TL.NewAttribute)}),[d,a,t]),F={enabled:s},M=(0,b.useMemo)((()=>({hasDeletionsMap:w,setHasDeletions:R})),[w,R]);return v().createElement("div",{className:u},c&&v().createElement(sN,F,c),v().createElement(sN,FL({},F,{plain:!0}),D.length>0&&v().createElement(jk,{label:mi().text("More attributes"),onApply:j,dense:s,data:D,parent:N&&t})),v().createElement(UL.Provider,{value:M},U.concat(L).map((e=>{let{attrType:t,values:r}=e;return v().createElement(oF,{key:`${t.uri}_${a}`,attributeType:t,drawLines:s,values:r,paging:(0,_.path)(["paging",t.uri],S),parentUri:a,showEmptyEditors:i,mode:o,crosswalks:l,onAddAttributes:d,onChangeAttribute:m,onDeleteAttribute:g,additionalControlsRenderer:y,showNonOv:f})}))))})),BL=(0,kp.Z)((e=>({complexWrapper:{position:"relative"},editor:{display:"flex",flex:1,height:"36px",alignItems:"center"},label:{flex:1,marginLeft:"2px",marginTop:"2px",fontSize:"13px",lineHeight:"15px"},actions:{display:"flex",alignItems:"center"},titleContainer:{display:"flex",flex:1,minHeight:"20px"},expandButton:{marginTop:"2px"},deleted:{color:e.palette.text.secondary,textDecoration:"line-through"},editedLabel:{fontStyle:"italic",color:e.palette.text.secondary},errorWrapperHelperText:{marginLeft:0}}))),zL=(0,bL.l)(xL,((e,t)=>{let{attributeValue:r}=t;const{element:n,type:a}=e||{},i=OL(a);return{highlightedError:i&&(null==n?void 0:n.uri)===r.uri?e:null,isHighlightedPath:i&&(0,_.pipe)((0,_.propOr)([],"path"),(0,_.any)((0,_.pathEq)(["value","uri"],r.uri)))(n)}}),(e=>{let{label:t,attributeTypesList:r,attributeType:n,attributeValue:a,children:i,errors:o,ownError:l,mode:s,metadata:c,crosswalks:u,lazy:p,showEmptyEditors:d,onAddOneMore:m,onAddAttributes:g,onDeleteAttribute:y,onChangeAttribute:f,additionalControlsRenderer:h,hideDeleteButton:E,state:T,showNonOv:C,isHighlightedPath:S,highlightedError:w,expanded:A=!1}=e;const R=BL(),_="deleted"===T,I="edited"===T,N=a.uri,D=(0,x.isTempUri)(N),P=D||A,[k,L]=(0,b.useState)(P),{ref:U,errorClassName:j}=RL({highlightedError:w});(0,b.useEffect)((()=>{S&&L(!0)}),[S]),(0,b.useEffect)((()=>{L(P)}),[P]);const{canDelete:F}=Mk(a.uri),M=(0,b.useMemo)((()=>F&&(0,x.checkCanDeleteAttribute)({attributeType:n,attributeValue:a,mode:s,metadata:c,isReltioCrosswalk:(0,x.isReltioCrosswalk)(u,a)})),[n,a,s,c,u,F]),V=!_&&!E&&!!y&&M,B=(0,b.useMemo)((()=>(0,x.hasAttributeDescendantsWithErrors)(a,o)),[o,a]);(0,b.useEffect)((()=>{B&&L(!0)}),[o,B]),(0,b.useEffect)((()=>{_&&L(!1)}),[_]);const z=(r||[]).some((e=>(0,x.isAnalyticAttribute)(e))),H=(0,b.useMemo)((()=>({attributes:z?null:a.value,analyticsAttributes:z?a.value:null})),[a,z]),Y=(0,x.getErrorMessage)(l)||B&&mi().text("Has an incorrect value")||"";return p?v().createElement(nE(),{variant:"text",color:"primary",onClick:m},"Create attribute"):v().createElement("div",{ref:U,"data-reltio-id":"reltio-edit-mode-complex-attribute",className:O()(R.complexWrapper,j)},v().createElement("div",{className:R.editor},v().createElement("div",{className:R.titleContainer},v().createElement(oP,{onClick:()=>L((e=>!e)),expanded:k,className:R.expandButton,disabled:_}),v().createElement(cL,{errorMessage:Y,classes:{helperText:R.errorWrapperHelperText}},v().createElement("div",{className:O()(R.label,{[R.deleted]:_}),"data-reltio-id":"reltio-attribute-complex-label"},t))),v().createElement("div",{className:R.actions},I&&v().createElement(Ag(),{variant:"caption",className:R.editedLabel},"(",mi().text("edited"),")"),h&&h({attributeType:n,attributeValue:a}),V&&v().createElement(Pp.T,{icon:tL(),onClick:()=>y({uri:N,attributeType:n,attributeValue:a}),size:"L","data-reltio-id":"reltio-delete-complex-attribute-button"}))),k&&v().createElement(VL,{parentAttributeType:n,attrTypes:r,entity:H,showEmptyEditors:d||D,drawLines:!0,parentUri:N,mode:s,crosswalks:u,onAddAttributes:g,onChangeAttribute:f,onDeleteAttribute:y,additionalControlsRenderer:h,showNonOv:C},i))}));function HL(){return HL=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},HL.apply(this,arguments)}const YL=(0,b.memo)((e=>{const{attributeValue:t,attributeType:r}=e,n=(0,x.evaluateDeepEntityLabel)(t,r.dataLabelPattern);return v().createElement(zL,HL({label:(0,x.getLabel)(n),attributeTypesList:r.attributes||r.analyticsAttributes},e))}));YL.displayName="NestedAttributeEditor";var WL=r(84199),GL=r(62880);const qL=(0,kp.Z)((e=>({addLabel:{display:"flex",padding:"0 7px",height:"35px",alignItems:"center",fontSize:"13px",fontWeight:"500",color:e.palette.primary.main,cursor:"pointer",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",borderTop:"solid 1px rgba(0, 0, 0, 0.14)",backgroundColor:"rgba(0, 0, 0, 0.03)"},addIcon:{height:"18px",width:"18px",padding:"0 9px"}}))),ZL=e=>{const{selectProps:{onCreate:t,createLabel:r,inputValue:n,components:a},children:i}=e,o=qL();return v().createElement(Gy.h,e,i,r&&!(0,_.prop)("Group",a)&&v().createElement("span",{className:o.addLabel,onClick:()=>t(n)},v().createElement(Dk(),{className:o.addIcon}),r))};ZL.propTypes={children:vp().element.isRequired,selectProps:vp().object.isRequired};const $L=(0,kp.Z)({singleValue:{fontSize:"14px",lineHeight:"16px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",marginTop:"17px"}});function KL(){return KL=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},KL.apply(this,arguments)}const XL=e=>{const{selectProps:{menuIsOpen:t},innerProps:r,children:n}=e,a=$L();return!t&&v().createElement(Ag(),KL({className:a.singleValue},r),n)};function QL(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){JL(e,t,r[t])}))}return e}function JL(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}XL.propTypes={children:vp().node,innerProps:vp().object};const eU=(0,kp.Z)({control:{height:"auto"},dropdownIndicator:{boxSizing:"content-box",transition:"transform .15s ease",padding:e=>(e.height-24)/2+"px 12px",cursor:"pointer",color:"rgba(0, 0, 0, 0.54)"},valueContainer:{marginLeft:"16px",width:0},formControl:{margin:0},filledInputRoot:{backgroundColor:"rgba(0, 0, 0, 0.03)","&:hover":{backgroundColor:"rgba(0, 0, 0, 0.03)"},"&.focused":{backgroundColor:"rgba(0, 0, 0, 0.03)"}},filledInputUnderline:{"&:before":{display:"none"}},inputLabel:{color:"rgba(0,0,0,0.6)",fontSize:"14px",paddingLeft:"4px","&.shrink":{paddingLeft:"4px"}}}),tU={menu:e=>QL({},e,{borderRadius:"0 0 4px 4px",backgroundColor:"#FFFFFFFF",boxShadow:"0 2px 2px 0 rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.12), 0 1px 5px 0 rgba(0,0,0,0.2)",margin:0}),menuList:e=>QL({},e,{maxHeight:"208px",padding:"8px 0"}),group:e=>QL({},e,{padding:"0 0 8px 0"}),input:e=>QL({},e,{height:"16px",color:"rgba(0, 0, 0, 0.87)",fontSize:"14px",lineHeight:"16px",margin:"16px 0 0",padding:0}),option:e=>QL({},e,{fontSize:"13px",lineHeight:"15px",height:"32px"})},rU={menuList:e=>QL({},e,{padding:0})},nU={input:e=>QL({},e,{height:"16px",color:"rgba(0, 0, 0, 0.87)",fontSize:"14px",lineHeight:"16px",margin:0,padding:0})};function aU(){return aU=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},aU.apply(this,arguments)}function iU(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){oU(e,t,r[t])}))}return e}function oU(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const lU=e=>{let{value:t,label:r,createLabel:n,getOptions:a,options:i,height:o=46,onChange:l=_.identity,onCreate:s,onClear:c=_.identity,components:u,textFieldInputRef:p,TextFieldProps:d,classes:m}=e,g=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["value","label","createLabel","getOptions","options","height","onChange","onCreate","onClear","components","textFieldInputRef","TextFieldProps","classes"]);const y=eU({height:o}),[f,h]=(0,b.useState)(!1),E=(0,b.useRef)(null),T=a?Py:Ny.J,C=(0,_.prop)("ClearIndicator",u)?{}:{IndicatorSeparator:WL.V,ClearIndicator:WL.V},S=s?(e,t)=>{s(e,t),h(!1)}:void 0,w=(0,_.prop)("Group",u)?rU:{},A=(0,_.isEmpty)(r)?nU:{},R=iU({},tU,w,A),I=iU({},y,m);return v().createElement(T,aU({placeholder:"",defaultOptions:!0},g,{value:(0,_.defaultTo)(null,t),loadOptions:a,options:i,cacheOptions:!0,onChange:l,onCreate:S,onClear:c,createLabel:n,classes:I,styles:R,components:iU({DropdownIndicator:GL.G,LoadingIndicator:WL.V,SingleValue:XL,Menu:ZL},C,u),menuPlacement:"auto",TextFieldProps:iU({},d,{label:r,variant:"filled",size:"small",classes:iU({},(0,_.prop)("classes",d),{root:O()(y.formControl,(0,_.path)(["classes","root"],d))}),inputProps:iU({},(0,_.prop)("inputProps",d)),InputProps:iU({},(0,_.prop)("InputProps",d),{classes:iU({},(0,_.path)(["InputProps","classes"],d),{root:O()(y.filledInputRoot,(0,_.path)(["InputProps","classes","root"],d)),underline:O()({[y.filledInputUnderline]:(0,x.isEmptyValue)(t)},(0,_.path)(["InputProps","classes","underline"],d)),focused:O()("focused",(0,_.path)(["InputProps","classes","focused"],d))})}),InputLabelProps:iU({},(0,_.prop)("InputLabelProps",d),{classes:iU({},(0,_.path)(["InputLabelProps","classes"],d),{root:O()(y.inputLabel,(0,_.path)(["InputLabelProps","classes","root"],d)),shrink:O()("shrink",(0,_.path)(["InputLabelProps","classes","shrink"],d))}),shrink:!(0,x.isEmptyValue)(t)||void 0}),ref:p||E}),inputRef:p||E,menuIsOpen:f,onMenuOpen:()=>h(!0),onMenuClose:()=>h(!1)}))},sU={value:vp().oneOfType([vp().object,vp().array]),label:vp().string.isRequired,getOptions:vp().func,options:vp().array,onChange:vp().func,onCreate:vp().func,onClear:vp().func,createLabel:vp().string,components:vp().object,textFieldInputRef:vp().object,TextFieldProps:vp().object,height:vp().number,classes:vp().object};lU.propTypes=sU;var cU=r(98018);function uU(){return uU=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},uU.apply(this,arguments)}const pU=e=>{const t=(0,w.$H)()||"";return v().createElement(cU.ZP,uU({},e,{storagePath:(r=t,r.endsWith("/")?r:r+"/")}));var r},dU=(0,kp.Z)({entityContainer:{display:"flex",alignItems:"center",height:"32px",minHeight:"32px",padding:0},entityLabel:{height:"15px",fontSize:"13px",color:"rgba(0,0,0,0.87)",cursor:"pointer",lineHeight:"15px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},emptyEntityLabel:{height:"15px",fontSize:"13px",color:"rgba(0,0,0,0.6)",lineHeight:"15px",marginLeft:"16px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",cursor:"default"},entityAvatar:{transform:"scale(0.5)",marginLeft:"8px",marginRight:"11px"},entitySecondaryLabel:{color:"rgba(0,0,0,0.6)"}});function mU(){return mU=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},mU.apply(this,arguments)}const gU=e=>{let{innerRef:t,innerProps:r,selectOption:n,data:a}=e;const i=dU(),{uri:o,entityType:l,label:s,secondaryLabel:c}=a;return""!==o?v().createElement(td(),mU({className:i.entityContainer,ref:t,key:o,onClick:()=>n({label:s,uri:o,entityType:l})},r),v().createElement(pU,{className:i.entityAvatar,entityType:l}),v().createElement(gd.Y,{value:`${s}${c?", "+c:""}`},v().createElement("span",{className:i.entityLabel},s,c&&v().createElement("span",{className:i.entitySecondaryLabel},", ",c)))):v().createElement(td(),mU({className:i.entityContainer,ref:t,key:o},r,{disabled:!0}),v().createElement("span",{className:i.emptyEntityLabel},mi().text("No results found")))},yU=(0,kp.Z)((e=>({singleValue:{color:"rgba(0, 0, 0, 0.87)",fontSize:"14px",paddingTop:"18px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},linkValue:{cursor:"pointer",color:e.palette.primary.main,textDecoration:"none",pointerEvents:"all"}}))),fU=e=>{let{selectProps:{currentEntityType:t,menuIsOpen:r,disableLinkClick:n},children:a,data:i}=e;const o=yU(),l=(0,w.ax)("openEntity"),s=(0,w.Qh)(),{generateEntityUrl:c}=(0,b.useContext)(Wd),u=(0,x.isTempUri)(i.entityUri)?{className:o.singleValue,component:"span"}:{className:O()(o.singleValue,o.linkValue),onMouseDown:e=>{e.stopPropagation()},onClick:e=>{e.stopPropagation(),n?e.preventDefault():(0,Dp.rR)(e)||(l({uri:i.entityUri}),e.preventDefault())},href:c({uiPath:s,uri:i.entityUri}),component:"a"};return r?null:v().createElement(Ag(),u,(0,x.isTempUri)(i.entityUri)?mi().text(`New ${t.label} will be created`):(0,x.getLabel)(a))},hU=(0,kp.Z)({clearIcon:{cursor:"pointer",height:"20px",width:"20px"}}),EU=e=>{const{selectProps:{onClear:t}}=e,r=hU();return v().createElement(tE(),{onClick:t,size:"large"},v().createElement(YI(),{className:r.clearIcon}))};EU.propTypes={selectProps:vp().object.isRequired};var bU=r(81997);const vU=(0,kp.Z)((e=>({addLabel:{color:e.palette.primary.main,display:"flex",fontWeight:"500",cursor:"pointer",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},groupHeading:{fontSize:"13px",height:"36px",padding:"0 16px",display:"flex",justifyContent:"space-between",alignItems:"center",backgroundColor:"rgba(0, 0, 0, 0.03)"},addIcon:{height:"18px",width:"18px",padding:"0 9px"}}))),{Group:TU}=bU.F,OU=e=>{const{selectProps:{inputValue:t,onCreate:r},data:n,children:a}=e,i=vU();return v().createElement(TU,e,v().createElement("div",{className:i.groupHeading},v().createElement("span",null,n.label),r&&v().createElement("span",{onClick:()=>r(t,n.entityType),className:i.addLabel},v().createElement(Dk(),{className:i.addIcon}),mi().text(`Create ${t?`"${t}" as `:""}new ${n.label}`))),a)};OU.propTypes={selectProps:vp().object.isRequired,data:vp().object,children:vp().array};const xU=e=>e&&e.attributes,CU=e=>{let{entityUri:t,entityType:r,mode:n,attributeTypesSelectionStrategy:a=xU}=e;const i=(0,w.ax)("addAttributes"),o=(0,w.ax)("removeAttribute"),l=(0,w.ax)("modifyAttribute"),s=(0,w.vc)(t),c=(0,b.useMemo)((()=>a(r)),[a,r]);return s?v().createElement(VL,{key:s.uri,attrTypes:c,entity:s,showEmptyEditors:!0,drawLines:!0,parentUri:s.uri,mode:n,crosswalks:s.crosswalks,onAddAttributes:i,onChangeAttribute:l,onDeleteAttribute:o}):null};function SU(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const wU=(0,kp.Z)({creatorWrapper:{marginTop:"20px"}});function AU(){return AU=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},AU.apply(this,arguments)}function RU(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){_U(e,t,r[t])}))}return e}function _U(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function IU(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}const NU=20,DU=e=>{let{entity:t={},entityTypesUris:r=[],mode:n,max:a=NU,onChange:i,onCreate:o,metadata:l,globalSearchRequestOptions:s,attributeTypesSelectionStrategy:c,disableLinkClick:u=!1}=e,p=IU(e,["entity","entityTypesUris","mode","max","onChange","onCreate","metadata","globalSearchRequestOptions","attributeTypesSelectionStrategy","disableLinkClick"]);const d=wU(),[m,g]=(0,b.useState)(""),y=(0,b.useMemo)((()=>r.map((e=>(0,x.getEntityType)(l,e))).filter(x.isAvailableEntityType)),[r,l]),f=RU({},s,{max:a}),h=o?(e,t)=>{o(t||r[0],e),g("")}:void 0,E=e=>{null!==e&&(g(""),i(e))},T=(0,b.useMemo)((()=>1!==y.length),[y]),O=((0,_.isEmpty)(t)?y[0]:(0,x.getEntityType)(l,t.entityType))||{},C=o&&mi().text(`Create ${m?`"${m}" as `:""}new ${O.label}`),S=mi().text(`Select ${1===y.length?`${y[0].label} `:""}profile`),w=!(0,_.isEmpty)(t)&&(0,x.isTempUri)(t.entityUri),A=T?{Group:OU,GroupHeading:WL.V}:{},R=w?{ClearIndicator:EU}:{},{TextFieldProps:I}=p,N=IU(p,["TextFieldProps"]),D=(0,b.useMemo)((()=>RU({},I||{},{"data-reltio-id":"reltio-entity-selector"})),[I]);return v().createElement(v().Fragment,null,v().createElement(lU,AU({value:(0,_.isEmpty)(t)?void 0:t,inputValue:m,onInputChange:e=>{g(e)},getOptions:e=>(0,x.typeAheadSearch)(y,e,f).then(((e,t)=>r=>{const n=r.map((t=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){SU(e,t,r[t])}))}return e}({},t,{label:(0,x.getLabel)(t.label),entityType:e.find((e=>{let{uri:r}=e;return r===t.type}))}))),a=e=>(0,_.isEmpty)(e)?[{label:"",uri:"",entityType:{}}]:e,i=t?e:e.filter((e=>n.some((t=>t.type===e.uri))));return i.length>1?i.map((e=>({label:e.label,entityType:e.uri,options:a(n.filter((t=>t.type===e.uri)))}))):a(n)})(y,o)),getOptionLabel:(0,_.prop)("entityLabel"),onChange:E,onCreate:h,onClear:()=>{E({})},label:S,createLabel:C,components:RU({Option:gU,SingleValue:fU},A,R),currentEntityType:O,isClearable:!0,disableLinkClick:u,TextFieldProps:D},N)),w&&v().createElement("div",{className:d.creatorWrapper},v().createElement(CU,{mode:n,attributeTypesSelectionStrategy:c,entityType:O,entityUri:t.entityUri})))},PU=(0,kp.Z)({item:{marginBottom:"20px"},dense:{marginBottom:0}});function kU(){return kU=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},kU.apply(this,arguments)}function LU(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const UU=(0,bL.l)(xL,((e,t)=>{let{attributeValue:r,attributeType:n}=t;const{element:a,type:i}=e||{};return{highlightedError:OL(i)&&(0,x.isAttributeTypeError)(a,r.uri,n.uri)?e:null}}),(e=>{const t=PU(),{highlightedError:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["highlightedError"]),{attributeValue:a,attributeType:i,mode:o,crosswalks:l,errors:s,onChangeAttribute:c}=n,u=(0,b.useRef)(a),{ref:p,errorClassName:d}=RL({highlightedError:r,isSimple:!0}),m=(0,x.getReferencedEntityUriFromAttrValue)(a),g=(0,w.ax)("entityDeleted"),y=(0,w.ax)("entityCreated"),f=(0,w.ax)("errorDeactivated"),h=(0,w.vc)(m),E=(0,x.isTempUri)(m)?h:null,T=(0,w.AH)(),C=(0,w.mU)(["ovOnly"]),S=(0,x.getReferencedEntityFromAttrValue)(a),A=(0,x.getReferencedRelationFromAttrValue)(a),R=(0,x.getReferencedEntityTypeUriFromAttrType)(i),I=(0,x.getEntityType)(T,R),N=E?(0,x.evaluateDeepEntityLabel)(E,I.dataLabelPattern):a.label,D=(0,b.useMemo)((()=>[R]),[R]),P=(0,b.useMemo)((()=>(0,x.addReferencedRelationCrosswalks)(l,A)),[l,A]),k=(0,b.useMemo)((()=>(0,x.getReferencedEntityActiveError)(a,s)),[a,s]),L=(0,b.useMemo)((()=>S&&{entityUri:(0,x.getReferencedEntityUri)(S),entityType:(0,x.getReferencedEntityTypeUri)(S),entityLabel:a.label}),[S,a.label]),U=(0,b.useMemo)((()=>(0,x.getReferencedRelationAttrTypesUris)(i).map((e=>(0,x.findAttributeTypeByUri)(T,e))).filter(_.identity)),[i,T]),j=(0,b.useCallback)((e=>(0,x.referencedEntityAttributeTypesSelectionStrategy)(i,e)),[i]),F=(0,b.useCallback)((e=>{E&&g(E.uri);const t=u.current,r=!(0,_.isEmpty)(e)&&e.uri===(0,x.getReferencedEntityUriFromAttrValue)(t),n=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){LU(e,t,r[t])}))}return e}({},a,{label:e.label,refEntity:r?t.refEntity:(0,x.convertReferencedEntityForAttrValue)(e),refRelation:r?t.refRelation:(0,x.createReferencedRelationForAttrValue)(a)});c({value:n,attributeType:i,uri:a.uri}),k&&f((0,x.getErrorId)(k))}),[a,i,E,c,g,f,k]),M=(0,b.useCallback)(((e,t)=>{const r=(0,_.pipe)(j,(0,x.getCreatableAttributeTypes)(o))(I),n=(0,x.createTemporaryEntity)({entityTypeUri:e,initValue:t,attributeTypes:r,metadata:T,mode:o});F(n),y(n)}),[j,o,I,T,F,y]),{canCreate:V,canUpdate:B}=Mk(a.uri),z=(0,b.useMemo)((()=>B&&(0,x.checkCanEditAttribute)({attributeType:i,attributeValue:a,mode:o,isReltioCrosswalk:(0,x.isReltioCrosswalk)(l,a)})),[i,a,o,l,B]),H=(0,b.useMemo)((()=>V&&(0,x.checkMetadataForCreate)(o,I)),[o,I,V]),Y=(0,x.getErrorMessage)(k);return v().createElement(zL,kU({},n,{label:(0,x.getLabel)(N),attributeTypesList:U,crosswalks:P,metadata:T}),v().createElement("div",{ref:p,className:d},v().createElement(cL,{errorMessage:Y},v().createElement(DU,{className:O()(t.item,{[t.dense]:Y||L&&(0,x.isTempUri)(L.entityUri)}),entity:L||{},entityTypesUris:D,globalSearchRequestOptions:C,mode:o,isDisabled:!z,onChange:F,onCreate:H?M:void 0,metadata:T,attributeTypesSelectionStrategy:j}))))}));function jU(){return jU=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},jU.apply(this,arguments)}const FU=(0,b.forwardRef)(((e,t)=>{const{className:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className"]);return v().createElement("div",{ref:t,"data-reltio-id":"reltio-edit-attribute",className:r},class{static build(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};switch(e.type){case x.DataTypes.TYPE_NESTED:return v().createElement(YL,t);case x.DataTypes.TYPE_REFERENCE:return v().createElement(UU,t);default:{const e=(0,_.omit)(["showEmptyEditors","onAddAttributes","lazy","errors","crosswalks","showNonOv","expanded"],t);return v().createElement(PL,jU({isReltioCrosswalk:(0,x.isReltioCrosswalk)(t.crosswalks,t.attributeValue)},e))}}}}.build(e.attributeType,n))}));FU.displayName="EditModeAttribute";const MU=e=>mi().text("${value}",{value:1===e?mi().text("value"):mi().text("values")}),VU=(0,_.has)("minValue"),BU=(0,_.has)("maxValue"),zU=(0,_.pipe)(BU,_.not),HU=(0,_.propSatisfies)((e=>1===e),"minValue"),YU=e=>{let{minValue:t}=e;return mi().text("This attribute can have minimum ${minValue} ${minValueCaption}",{minValue:mi().number(t,"0"),minValueCaption:MU(t)})},WU=e=>{let{maxValue:t}=e;return mi().text("This attribute can have maximum ${maxValue} ${maxValueCaption}",{maxValue:mi().number(t,"0"),maxValueCaption:MU(t)})},GU=(0,_.cond)([[_.isNil,(0,_.always)("")],[e=>{let{minValue:t,maxValue:r}=e;return t&&t===r},e=>{let{minValue:t}=e;return mi().text("This attribute should have ${minValue} ${minValueCaption}",{minValue:mi().number(t,"0"),minValueCaption:MU(t)})}],[(0,_.allPass)([HU,BU]),WU],[(0,_.allPass)([HU,zU]),(0,_.always)("")],[(0,_.allPass)([VU,BU]),e=>{let{minValue:t,maxValue:r}=e;return mi().text("${minCardinality} and maximum ${maxValue} ${maxValueCaption}",{minCardinality:YU({minValue:t}),maxValue:mi().number(r,"0"),maxValueCaption:MU(r)})}],[BU,WU],[VU,YU],[_.T,(0,_.always)("")]]),qU=(0,kp.Z)((()=>({caption:{fontSize:"0.7rem",opacity:.54}}))),ZU=e=>{let{cardinality:t}=e;const r=qU(),n=GU(t);return n?v().createElement(Ag(),{variant:"caption",className:r.caption},n):null};function $U(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){KU(e,t,r[t])}))}return e}function KU(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const XU={content:'""',position:"absolute",left:"-1000px",top:"-4px",width:"5000px",height:"calc(100% + 8px)",animationName:"$highlightAnimation",animationDuration:"2s",animationIterationCount:1,opacity:0},QU=(0,kp.Z)((()=>({"@keyframes highlightAnimation":{"0%":{opacity:0},"50%":{opacity:1},"100%":{opacity:0}},highlighted:{"&::before":$U({},XU,{background:"rgba(228, 151, 0, 0.08)"}),position:"relative"}}))),JU=e=>{const t=QU(),r=(0,b.useRef)(null);return(0,b.useEffect)((()=>{e&&e.scrollIntoRef(r)}),[e]),e?{ref:r,highlightedClassName:t.highlighted}:{ref:r}},ej=(0,_.filter)((0,_.propSatisfies)(x.isTempUri,"uri")),tj=(0,kp.Z)((e=>({caption:{fontSize:"0.7rem",opacity:.54},wrapper:{display:"flex",flexDirection:"column",alignItems:"flex-start",position:"relative"},attributesWrapper:{width:"100%",marginBottom:"10px"},imagesWrapper:{paddingBottom:"10px",width:"100%"},link:{display:"flex",marginTop:4},"svg-icon__root":{fontSize:"1rem"},title:{fontSize:"12px",lineHeight:"14px",paddingLeft:"12px",verticalAlign:"middle",wordBreak:"break-all",color:e.palette.text.secondary},typeError:{marginLeft:"12px"},ovIcon:{marginLeft:"8px",textIndent:0},titleWrapper:{display:"inline-block",paddingBottom:"3px"},errorWrapper:{paddingBottom:"10px"}}))),rj=e=>{let{max:t,values:r,attributeType:n,parentUri:a,mode:i,drawLines:o,showEmptyEditors:l,errorMessage:s,errors:c,paging:u,crosswalks:p,showNonOv:d,nonVisibleValues:m,highlightedError:g,highlightedAttribute:y,onAddAttributes:f,onDeleteAttribute:h,onChangeAttribute:E,onDeactivateError:T,additionalControlsRenderer:C,requestNextPageOfAttributeValues:S}=e;const A=tj(),[R,I]=(0,b.useState)(t),[N,D]=(0,b.useState)(!1),{label:P,required:k,cardinality:L,name:U,uri:j,description:F}=n,M=(0,x.isEditableMode)(i),{ref:V,errorClassName:B}=RL({highlightedError:g}),{ref:z,highlightedClassName:H}=JU(y),Y=(0,b.useContext)(LL),W=(0,b.useMemo)((()=>null==Y?void 0:Y.includes(j)),[j,Y]),G=(0,x.isEmptyValue)(r),q=(!N&&l||k||W)&&G,Z=(0,w.Ws)(),$=(0,b.useMemo)((()=>Z.includes(n.uri)),[Z,n.uri]),K=(0,b.useRef)((0,x.createNewAttribute)({parentUri:a,attributeType:(0,_.omit)(["defaultValue"],n)})),X=(0,b.useCallback)((()=>{I(R+1);const e=e=>({parentUri:a,index:R,attributeType:e});if(q&&!(0,x.isComplexAttribute)(n.type)){const t=[e((0,_.omit)(["defaultValue"],n)),e(n)];return f(t)}return f([e(n)])}),[R,f,a,n,q]),Q=(0,b.useCallback)((0,_.pipe)(h,_.T,D),[h,D]);if(G&&!q)return null;if(q&&G&&(r=[K.current]),(0,x.isEmptyValue)(r))return null;const J=(ej(r)||[]).length,ee=d?"totalValues":"totalOvValues",te=(0,_.ifElse)((0,_.has)(ee),(0,_.pipe)((0,_.prop)(ee),(0,_.add)(J)),(0,_.always)(r.length))(u),re=null!=u&&u.totalValues?u.totalValues-te:null==m?void 0:m.length,ne=t<te,ae=ne&&R<te,ie=ne&&R>=te,oe=r.slice(0,R),le=oe?oe.length-1:0,se=te-R;return v().createElement(sN,{enabled:o},v().createElement("div",{ref:V,className:O()(A.wrapper,B)},v().createElement("div",{className:A.titleWrapper},v().createElement(ED,{label:P,isRequired:k,className:A.title,"data-reltio-id":"reltio-attribute-label"}),v().createElement(AD,{description:F}),$&&v().createElement(PP,null),v().createElement(OD,{nonOvValues:m,attributeType:n,className:A.ovIcon,nonOvTotal:re})),M&&v().createElement(ZU,{cardinality:L}),M&&v().createElement(Jk,{message:s,className:A.typeError}),v().createElement("div",{className:A.attributesWrapper},oe.map(((e,t)=>v().createElement(FU,{key:e.uri,attributeValue:e,attributeType:n,lazy:q&&!k,showEmptyEditors:l,errors:c,ownError:(0,x.getAttributeOwnError)(e,t,n.uri,c),mode:i,crosswalks:p,onAddOneMore:le===t?X:null,onAddAttributes:f,onDeleteAttribute:Q,onChangeAttribute:E,onDeactivateError:T,additionalControlsRenderer:C,className:0===t?H:null,ref:0===t?z:null,isEmptyEditor:q}))),ae&&v().createElement(GP,{moreNumber:(0,_.min)(t,se),valueNumber:se,onClick:()=>{r.length<te&&S({parentUri:a,attributeTypeUri:j,attributeTypeName:U,values:r,defaultMaxValues:t}),I(R+t)}}),ie&&v().createElement(KP,{onClick:()=>{I(t)}}))))};rj.displayName="AttributeRenderer";const nj=(0,b.memo)(rj),aj=(0,kp.Z)({value:{color:"rgba(0, 0, 0, 0.87)"}}),ij=(0,kp.Z)({placeholder:{color:"rgba(0, 0, 0, 0.38)",fontSize:"14px !important"}});function oj(){return oj=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},oj.apply(this,arguments)}function lj(){return lj=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},lj.apply(this,arguments)}const sj={SingleValue:e=>{let{selectProps:{menuIsOpen:t},data:{label:r}}=e;const n=aj();return!t&&v().createElement(Ag(),{variant:"body2",classes:{root:n.value}},r)},Placeholder:e=>{let{innerProps:t,children:r}=e;const n=ij();return v().createElement(Ag(),oj({className:n.placeholder},t),r)}},cj=(0,b.memo)((e=>v().createElement(lU,lj({components:sj},e)))),uj=(0,kp.Z)({container:{display:"flex",flex:1,alignItems:"flex-start",marginBottom:"10px"},roleContainer:{width:"100%"},valueContainer:{marginLeft:"8px",width:0},deleteButton:{marginLeft:"8px"}}),pj={MultiValue:Zy._},dj=e=>{let{values:t,onChange:r,onDelete:n}=e;const a=uj(),i=(0,w.AH)(),o=(0,w.eh)(),l=o.uri,s=(0,x.getRolesForEntityType)(i,o.type).map((e=>({value:e.uri,label:e.label}))),c=(t||[]).map((e=>{var t;return{value:e,label:(null===(t=s.find((0,_.propEq)("value",e)))||void 0===t?void 0:t.label)||(0,x.getLastUriPart)(e)}})),u=(0,b.useCallback)((e=>{const t=(null==e?void 0:e.map((0,_.prop)("value")))||[];r({value:t,attributeType:x.EntityAttrTypes.roles,uri:l})}),[l,r]),p=(0,b.useCallback)((()=>{n({uri:l,attributeType:x.EntityAttrTypes.roles})}),[l,n]);return v().createElement("div",{className:a.container,"data-reltio-id":"reltio-attribute-value"},v().createElement(cj,{label:"",height:40,isMulti:!0,options:s,value:c,onChange:u,components:pj,classes:a,className:a.roleContainer}),!!n&&v().createElement(Pp.T,{"data-reltio-id":"reltio-roles-delete-button",className:a.deleteButton,icon:tL(),onClick:p,size:"L"}))};var mj=r(56333);const gj=(0,kp.Z)({container:{display:"flex",flex:1,alignItems:"flex-start",marginBottom:"10px"},deleteButton:{marginLeft:"8px"}});function yj(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){fj(e,t,r[t])}))}return e}function fj(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const hj=e=>{let{className:t,values:r,onChange:n,onDelete:a}=e;const i=gj(),o=(0,w.lG)(),l=(0,w.mU)(),s=(0,b.useCallback)((async(e,t,r)=>{const n=await(0,x.getFacetedAttributeData)({fieldName:"tags",searchValue:e,options:yj({},l,{max:t,pageNo:r})});return Object.keys(n.tags)}),[l]),c=(0,b.useCallback)((e=>{n({value:e,attributeType:x.EntityAttrTypes.tags,uri:o})}),[n,o]),u=(0,b.useCallback)((()=>{a({uri:o,attributeType:x.EntityAttrTypes.tags})}),[o,a]);return v().createElement("div",{className:i.container,"data-reltio-id":"reltio-attribute-value"},v().createElement(mj.p,{fullWidth:!0,multiple:!0,variant:"filled",className:t,value:r||[],onChange:c,getSuggestions:s}),!!a&&v().createElement(Pp.T,{"data-reltio-id":"reltio-tags-delete-button",className:i.deleteButton,icon:tL(),onClick:u,size:"L"}))};function Ej(){return Ej=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ej.apply(this,arguments)}function bj(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const vj=(0,bL.l)(UL,((e,t)=>{let{attributeType:r}=t;const{hasDeletionsMap:n,setHasDeletions:a}=e||{};return{hasDeletions:n?Boolean(n[null==r?void 0:r.uri]):void 0,setHasDeletions:a}}),(e=>{let{values:t,attributeType:r,parentUri:n,mode:a,errorMessage:i,onDeleteAttribute:o,onChangeAttribute:l,showEmptyEditors:s,hasDeletions:c,setHasDeletions:u,highlightedAttribute:p}=e,d=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["values","attributeType","parentUri","mode","errorMessage","onDeleteAttribute","onChangeAttribute","showEmptyEditors","hasDeletions","setHasDeletions","highlightedAttribute"]);const m=tj(),{label:g,required:y,cardinality:f}=r,h=(0,x.isEditableMode)(a),[E,T]=(0,b.useState)(!1),C=(0,b.useCallback)((e=>{T(e),null==u||u(r.uri,e)}),[r.uri,u]),S=void 0!==c?c:E,w=(0,b.useCallback)((0,_.pipe)(o,_.T,C),[o,C]),A=(0,x.isEmptyValue)(t),R=!S&&s&&A,I=(0,b.useRef)((0,x.createNewAttribute)({parentUri:n,attributeType:r})),{ref:N,highlightedClassName:D}=JU(p);return(0,x.isActivenessAttrType)(r)&&A&&!R?null:v().createElement("div",{ref:N,className:O()(D,m.wrapper)},v().createElement(ED,{label:g,isRequired:y,className:O()(m.title,m.titleWrapper),"data-reltio-id":"reltio-attribute-label"}),h&&v().createElement(ZU,{cardinality:f}),h&&v().createElement(Jk,{message:i}),v().createElement(KI(),{className:m.attributesWrapper},(()=>{switch(r.uri){case x.EntityAttrTypes.tags.uri:return v().createElement(hj,{values:t,onDelete:w,onChange:l});case x.EntityAttrTypes.roles.uri:return v().createElement(dj,{values:t,onDelete:w,onChange:l});default:{const e=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){bj(e,t,r[t])}))}return e}({},I.current,{value:t[0]||""});return v().createElement(FU,Ej({attributeValue:e,attributeType:r,mode:a,onDeleteAttribute:w,onChangeAttribute:l},d))}}})()))}));var Tj=r(57517),Oj=r.n(Tj);function xj(){return xj=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},xj.apply(this,arguments)}const Cj=e=>v().createElement("svg",xj({width:18,height:18,viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","data-reltio-id":"SvgDownload"},e),v().createElement("defs",null,v().createElement("path",{d:"M19 16v3H5v-3H3v3c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-3h-2zm-6-3.33l2.59-2.58L17 11.5l-5 5-5-5 1.41-1.41L11 12.67V3h2v9.67z",id:"Download_svg__a"})),v().createElement("g",{transform:"translate(-3 -3)",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},v().createElement("mask",{id:"Download_svg__b",fill:"#fff"},v().createElement("use",{xlinkHref:"#Download_svg__a"})),v().createElement("path",{fillOpacity:.54,fill:"#fff",mask:"url(#Download_svg__b)",d:"M0 0h24v24H0z"})));var Sj=r(76550),wj=r.n(Sj),Aj=r(29367),Rj=r.n(Aj);const _j=(0,kp.Z)((()=>({root:{fontSize:"24px",color:"#fff"}}))),Ij=e=>{let{checked:t,className:r,onClick:n}=e;const a=_j(),i=t?Rj():wj();return v().createElement(i,{className:O()(a.root,r),onClick:n})},Nj=(0,kp.Z)((()=>({overlay:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",transition:"0.2s linear all","&:not($selected):not($selectionMode):hover":{backgroundColor:"rgba(0,0,0,0.6)"},userSelect:"none"},selected:{backgroundColor:"rgba(0,114,206,0.6)"},selectionMode:{cursor:"pointer","&:not($selected)":{backgroundColor:"rgba(0,0,0,0.6)"}},button:{padding:0,width:"100px",height:"36px",color:"#fff",fontSize:"14px",fontWeight:500,lineHeight:"16px",border:"1px solid rgba(255,255,255,0.25)",backgroundColor:"rgba(98,2,238,0)"},checkedIcon:{position:"absolute",left:"4px",top:"4px",cursor:"pointer"},actions:{display:"flex",alignItems:"center",position:"absolute",top:"4px",right:"4px"},actionButton:{color:"#fff",fontSize:"24px"},dropDownMenuButton:{margin:"0 2px 0 8px"}}))),Dj=(0,b.memo)((e=>{const{id:t,canBeSelected:r=!1,selected:n=!1,selectionMode:a=!1,onDeselect:i=_.identity,onSelect:o=_.identity,onShareLink:l,onSetAsDefault:s,onDelete:c,onDownload:u=_.identity,onClick:p}=e,d=Nj(),[m,g]=(0,b.useState)(!1),{canDelete:y}=Mk(t),f=(0,b.useMemo)((()=>[{text:mi().text("Share link"),onClick:l},{text:mi().text("Set as default"),onClick:s},{text:mi().text("Delete"),onClick:y&&c}].filter((0,_.prop)("onClick"))),[l,s,c,y]),h=e=>()=>(0,_.ifElse)((0,_.equals)(!0),i,o)(e),E=r&&(n||m||a),T=!a&&!n&&m,x=r&&n;return v().createElement("div",{className:O()(d.overlay,{[d.selected]:n,[d.selectionMode]:a}),onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),onClick:a?h(n):e=>{e.currentTarget===e.target&&p()},"data-reltio-id":"image-actions-overlay"},E&&v().createElement(Ij,{className:d.checkedIcon,checked:n,onClick:h(n)}),T&&v().createElement("div",{className:d.actions},v().createElement(Pp.T,{onClick:u,className:d.actionButton,icon:Cj}),v().createElement(LN,{menuId:`image-overlay-actions-${t}`,buttonComponent:Pp.T,buttonProps:{icon:Vd(),className:O()(d.actionButton,d.dropDownMenuButton)},menuItems:f})),x&&v().createElement(nE(),{className:d.button,variant:"outlined",onClick:i},mi().text("Deselect")))}));var Pj=r(70251),kj=r.n(Pj),Lj=r(1937),Uj=r.n(Lj);const jj=(0,kp.Z)((e=>({root:{width:"328px"},paper:{width:"100%",height:"40px",display:"flex",alignItems:"center",boxShadow:"none",backgroundColor:"rgba(0,0,0,0.03)"},inputRoot:{flex:1},input:{padding:"0 12px",fontSize:"14px","&:placeholder":{color:e.palette.text.secondary}},errorMessage:{marginTop:"8px",fontSize:"12px",color:e.palette.error.main}}))),Fj=e=>0===e.trim().length,Mj=e=>{let{onSend:t}=e;const r=jj(),[n,a]=(0,b.useState)(""),[i,o]=(0,b.useState)(null);return v().createElement(KI(),{className:r.root},v().createElement(JI(),{className:r.paper},v().createElement(Uj(),{value:n,onChange:e=>{const t=e.target.value,r=new RegExp(/^(ftp|http|https):\/\/[^ "]+$/).test(t);a(t),r||Fj(t)?o(null):o(mi().text("URL is not correct"))},classes:{root:r.inputRoot,input:r.input},placeholder:mi().text("Paste an image URL here")}),v().createElement(nE(),{disabled:Boolean(i)||Fj(n),variant:"outlined",color:"primary",onClick:()=>{t(n),a(""),o(null)}},mi().text("Send"))),i&&v().createElement(Ag(),{className:r.errorMessage},i))};var Vj=r(65680),Bj=r(83997);const zj=["image/png","image/jpeg","image/tiff","image/gif","image/bmp"],Hj=e=>{let{className:t,onAppendFile:r}=e;return v().createElement(v().Fragment,null,v().createElement("input",{onInput:e=>{r&&r(e.currentTarget.files[0])},style:{display:"none"},accept:zj.join(","),id:"upload-image-button","data-reltio-id":"upload-image-button",type:"file"}),v().createElement("label",{htmlFor:"upload-image-button"},v().createElement(nE(),{className:t,variant:"contained",color:"primary",component:"span"},mi().text("Select image"))))};function Yj(){return Yj=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Yj.apply(this,arguments)}const Wj=e=>v().createElement("svg",Yj({width:256,height:256,viewBox:"0 0 256 256",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","data-reltio-id":"SvgUploadIcon"},e),v().createElement("defs",null,v().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"UploadIcon_svg__c"},v().createElement("stop",{stopColor:"#FFF",offset:"0%"}),v().createElement("stop",{stopColor:"#FFF",stopOpacity:0,offset:"100%"})),v().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"UploadIcon_svg__d"},v().createElement("stop",{stopColor:"#FFF",offset:"0%"}),v().createElement("stop",{stopColor:"#FFF",stopOpacity:0,offset:"100%"})),v().createElement("linearGradient",{x1:"67.572%",y1:"54.952%",x2:"15.212%",y2:"13.907%",id:"UploadIcon_svg__e"},v().createElement("stop",{stopColor:"#000",stopOpacity:0,offset:"0%"}),v().createElement("stop",{stopColor:"#000",offset:"100%"})),v().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"UploadIcon_svg__f"},v().createElement("stop",{stopColor:"#B8EDFF",offset:"0%"}),v().createElement("stop",{stopColor:"#53ACDE",offset:"100%"})),v().createElement("circle",{id:"UploadIcon_svg__a",cx:128,cy:128,r:128})),v().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},v().createElement("mask",{id:"UploadIcon_svg__b",fill:"#fff"},v().createElement("use",{xlinkHref:"#UploadIcon_svg__a"})),v().createElement("use",{fillOpacity:.1,fill:"#0072CE",xlinkHref:"#UploadIcon_svg__a"}),v().createElement("g",{mask:"url(#UploadIcon_svg__b)"},v().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(-1 9)"},v().createElement("path",{d:"M0 107.268c0 35.579 28.703 64.409 64.173 64.409h139.021c29.578 0 53.497-24.035 53.497-53.635 0-28.356-21.935-51.562-49.705-53.515C199.577 27.705 167.2 0 128.346 0 97.425 0 70.59 17.582 57.171 43.274 25.027 46.767 0 74.117 0 107.268z",fill:"#FFF",opacity:.3}),v().createElement("ellipse",{fill:"url(#UploadIcon_svg__c)",opacity:.4,cx:64.553,cy:107.664,rx:61.43,ry:62.336}),v().createElement("path",{d:"M127.979 8.91c38.773 0 70.206 31.895 70.206 71.24 0 39.346-31.433 71.241-70.206 71.241-6.067 0-11.954-.78-17.57-2.249 9.688-11.019 15.574-25.551 15.574-41.478 0-33.7-26.352-61.153-59.286-62.299C78.714 23.611 101.654 8.91 127.98 8.91z",fill:"url(#UploadIcon_svg__d)",opacity:.4})),v().createElement("path",{fill:"url(#UploadIcon_svg__e)",opacity:.12,d:"M82.093 128.474l38.374 37.966-10.666 18.958 72.714 71.94 63.578-57.537v-6.11l-71.107-70.352H97.22z",transform:"translate(-1 9)"}),v().createElement("path",{fill:"url(#UploadIcon_svg__f)",d:"M151.004 128.29v57.591h-40.836V128.29H81l49.5-49.409L180 128.29z",transform:"translate(-1 9)"})))),Gj=(0,kp.Z)((e=>({root:{padding:"36px 0 29px"},isActive:{backgroundColor:"rgba(0,114,206,0.12)"},icon:{width:"190px",height:"190px",marginBottom:"24px"},title:{marginBottom:"8px",color:e.palette.text.primary,fontSize:"20px",fontWeight:500,lineHeight:"24px"},description:{marginBottom:"24px",color:e.palette.text.secondary,fontSize:"14px",lineHeight:"16px"}}))),qj=e=>{let{onAppendFile:t,className:r}=e;const n=Gj(),[{canDrop:a,isOver:i},o]=(0,Vj.useDrop)({accept:[Bj.FILE],drop:e=>{e&&t(e.files[0])},collect:e=>({isOver:e.isOver(),canDrop:e.canDrop()})}),l=a&&i;return v().createElement("div",{ref:o,className:O()(n.root,{[n.isActive]:l},r)},v().createElement(Wj,{className:n.icon}),v().createElement(Ag(),{className:n.title},mi().text("Drag an image here")),v().createElement(Ag(),{className:n.description},mi().text("Acceptable image types would include JPG, PNG, TIFF, GIF, BMP. Maximum image size: ${MAX_IMAGE_SIZE}Mb",{MAX_IMAGE_SIZE:20})),v().createElement(Hj,{onAppendFile:t}))},Zj=(0,kp.Z)((e=>({root:{width:"100%",display:"flex",alignItems:"center",padding:"0 30px",boxSizing:"border-box"},border:{borderBottom:`1px solid ${e.palette.text.primary}`,flex:1,opacity:.12},text:{padding:"0 10px",color:e.palette.text.secondary,fontSize:"14px",lineHeight:"16px"}}))),$j=e=>{let{children:t,className:r}=e;const n=Zj();return v().createElement(KI(),{className:O()(n.root,r)},v().createElement(KI(),{className:n.border}),v().createElement(Ag(),{className:n.text},t),v().createElement(KI(),{className:n.border}))},Kj=(0,kp.Z)({closeIcon:{color:"#fff"}}),Xj=e=>{let{error:t,onClose:r}=e;const n=Kj();return v().createElement(Jh(),{open:Boolean(t),onClose:r,message:t,action:v().createElement(wd.k,{className:n.closeIcon,tooltipTitle:mi().text("Close"),icon:_p(),onClick:r})})},Qj=(0,kp.Z)((e=>({root:{},dialogPaper:{position:"relative",maxWidth:"480px"},title:{color:e.palette.text.primary,fontSize:"20px",fontWeight:500,letterSpacing:"0.25px",lineHeight:"24px",padding:"16px"},body:{display:"flex",flexDirection:"column",alignItems:"center",padding:"0 8px 49px",textAlign:"center"},targetBox:{marginBottom:"8px"},divider:{marginBottom:"28px"}}))),Jj=e=>{let{open:t,onClose:r,onUpload:n}=e;const a=Qj(),[i,o]=(0,b.useState)(!1),[l,s]=(0,b.useState)(null),c=(0,w.qD)(),u=(0,w.fN)(),p=(0,w.Uv)(),d=e=>{o(!0),(0,x.uploadImage)({image:e,imageServicePath:c,environment:u,tenant:p}).then((e=>{n(e),r()})).catch((e=>{s((0,x.getRequestErrorMessage)(e,mi().text("Something went wrong")))})).finally((()=>o(!1)))};return v().createElement(kj(),{open:t,onClose:r,classes:{paper:a.dialogPaper}},v().createElement(Ag(),{className:a.title},mi().text("Add new image")),v().createElement(KI(),{className:a.body},v().createElement(qj,{className:a.targetBox,onAppendFile:e=>{if(!e)return s(mi().text("No image selected."));const t=Number((e.size/1024/1024).toFixed(2)),r=zj.includes(e.type);t>20?s(mi().text("File size exceeds configured max file size.")):r?d(e):s(mi().text("File format is not supported."))}}),v().createElement($j,{className:a.divider},mi().text("or")),v().createElement(Mj,{onSend:e=>{d(e)}})),i&&v().createElement(LE.z,null),v().createElement(Xj,{error:l,onClose:()=>s(null)}))},eF=(0,kp.Z)((()=>({root:{width:"100%"},image:e=>{let{imageMargin:t}=e;return{marginRight:t,cursor:"pointer","&:last-child":{marginRight:0}}},uploadContainer:e=>{let{imageMargin:t,imageWidth:r,imageHeight:n}=e;return{backgroundColor:"white",width:r,height:n,cursor:"pointer",border:"1px dashed #0072CE",boxSizing:"border-box",marginRight:t,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}},uploadButton:{width:"50px",height:"50px"},uploadIcon:{fontSize:"36px"}}))),tF={},rF=e=>{let{attributeType:t={},attributeValues:r=[],onDeleteAttribute:n,onChangeAttribute:a,requestNextPageOfAttributeValues:i,parentUri:o,paging:l,showNonOv:s,imageSize:c=vk}=e;const u=eF(c),[p,d]=(0,b.useState)(!1),m=(0,w.ax)("setDefaultProfilePicForModifiedEntity"),g=(0,w.eh)()||tF,y=(0,w.AU)(g.uri),{canCreate:f}=(0,b.useContext)(Fk),h=(0,b.useCallback)((()=>{d((e=>!e))}),[]),E=(0,b.useCallback)((e=>{const r=(0,x.generateUri)(o,t.name),n={};for(const a in e){const i=(t.attributes||[]).find((e=>{let{name:t}=e;return t===a}));i&&(n[a]=[{uri:(0,x.generateUri)(r,i.name),ov:!0,value:e[a],type:i.uri}])}a({attributeType:t,uri:r,value:n})}),[a,o,t]),T=(0,b.useCallback)((e=>{if(n(e),y===e.uri){var t;const n=(null===(t=r[0])||void 0===t?void 0:t.uri)===e.uri?r[1]:r[0];m({entityUri:g.uri,value:n||{}})}}),[n,g,y,r,m]),O=(e,r)=>{const{onOpenImageGalleryDialog:n,onDownload:a,onShareLink:i,onSetAsDefault:o}=e,l=(0,x.getImageAttributeOvUrl)(r),{uri:s}=r;return v().createElement(Dj,{id:s,onShareLink:()=>i(l),onSetAsDefault:()=>o(r),onDelete:()=>T({uri:s,attributeType:t}),onDownload:()=>a([l]),onClick:()=>n(s)})};return v().createElement("div",{className:u.root,"data-reltio-id":"image-line-edit-mode"},v().createElement(VF,{attributeValues:r,attributeType:t,renderImage:e=>function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=(0,x.getImageAttributeOvThumbnailUrl)(t),{uri:n}=t,{onOpenImageGalleryDialog:a}=e;return v().createElement("div",{className:u.image,key:n},v().createElement(bk,{src:r,overlay:O(e,t),onClick:()=>a(n),size:{imageWidth:c.imageWidth,imageHeight:c.imageHeight},"data-reltio-id":"reltio-attribute-value"}))},overlay:!0,countFixedItems:f?1:0,onUpload:h,onDeleteAttribute:T,imageSize:c,requestNextPageOfAttributeValues:i,paging:l,parentUri:o,showNonOv:s},f&&v().createElement("div",{className:u.uploadContainer,onClick:h},v().createElement(Pp.T,{className:u.uploadButton,iconClassName:u.uploadIcon,icon:Oj(),"data-reltio-id":"reltio-upload-image-button"}))),v().createElement(Jj,{open:p,onUpload:E,onClose:h}))},nF=e=>{let{attributeType:t,attributeValues:r,paging:n,parentUri:a,showNonOv:i,onDeleteAttribute:o,onChangeAttribute:l,requestNextPageOfAttributeValues:s,highlightedAttribute:c,error:u,highlightedError:p,onDeactivateError:d}=e;const m=tj(),{label:g,description:y,required:f}=t,{ref:h,highlightedClassName:E}=JU(c),{ref:T,errorClassName:C}=RL({highlightedError:p}),S=(0,b.useCallback)((()=>{u&&d&&d((0,x.getErrorId)(u))}),[u,d]);return v().createElement("div",{ref:h,className:O()(m.wrapper,E)},v().createElement("div",{ref:T,className:O()(m.imagesWrapper,C)},v().createElement("div",{className:m.titleWrapper},v().createElement(ED,{className:m.title,label:g,"data-reltio-id":"reltio-attribute-label",isRequired:f}),v().createElement(AD,{description:y})),v().createElement(cL,{errorMessage:null==u?void 0:u.message,className:m.errorWrapper},v().createElement(rF,{attributeValues:r,attributeType:t,paging:n,onDeleteAttribute:o,parentUri:a,onChangeAttribute:(0,_.pipe)(l,S),requestNextPageOfAttributeValues:s,showNonOv:i}))))};let aF=function(e){return e.imageLine="imageLine",e.special="special",e.default="default",e}({});function iF(){return iF=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},iF.apply(this,arguments)}const oF=(0,bL.l)(xL,((e,t)=>{let{attributeType:r,parentUri:n}=t;const{element:a,type:i}=e||{},o=(e=>e===TL.NewAttribute)(i)&&a.uri===r.uri;return{highlightedAttribute:o?e:null,highlightedError:OL(i)&&(0,x.isAttributeTypeError)(a,n,r.uri)?e:null}}),(e=>{var t;let{values:r,attributeType:n,mode:a=x.Mode.Viewing,crosswalks:i,drawLines:o,paging:l={},parentUri:s,max:c,showEmptyEditors:u,showNonOv:p,highlightedError:d,highlightedAttribute:m,onAddAttributes:g,onDeleteAttribute:y,onChangeAttribute:f,additionalControlsRenderer:h}=e;const E=(0,w.ax)("errorDeactivated"),T=(0,w.ax)("requestNextPageOfAttributeValues"),O=(0,b.useContext)(jL),C=s&&(0,x.getBaseUri)(s),S=(0,b.useMemo)((()=>O[C]||[]),[O,C]),A=(0,w.Jz)(s,n),R=(0,b.useMemo)((()=>(0,x.filterErrorsForHiddenAttributes)(A,S)),[A,S]),I=(0,w.Xj)(),N=(0,w.vd)(),D=(0,x.getAttributePagerActiveTypeErrorMessage)(s,n,I),P=null!==(t=null!=c?c:N)&&void 0!==t?t:1/0,k=(0,_.partition)(x.isOv),[L,U]=k(r),j=p?r:L,F=p?[]:U,M={errorMessage:D,errors:R,mode:a,parentUri:s,onAddAttributes:g,onDeleteAttribute:y,onChangeAttribute:f,onDeactivateError:E,additionalControlsRenderer:h,showEmptyEditors:u,highlightedError:d,highlightedAttribute:m};return(()=>{switch((0,_.cond)([[x.isSpecialAttribute,(0,_.always)(aF.special)],[x.isImage,(0,_.always)(aF.imageLine)],[_.T,(0,_.always)(aF.default)]])(n)){case aF.special:return v().createElement(sN,{enabled:o},v().createElement(vj,iF({values:j,attributeType:n},M)));case aF.imageLine:return v().createElement(sN,{enabled:o},v().createElement(nF,{attributeValues:j,attributeType:n,paging:l,onDeleteAttribute:y,parentUri:s,onChangeAttribute:f,requestNextPageOfAttributeValues:T,showNonOv:p,highlightedAttribute:m,error:(0,x.getAttributeErrorByTypeUri)(n.uri,R),highlightedError:d,onDeactivateError:E}));default:return v().createElement(nj,iF({values:j,attributeType:n,max:P,paging:l,crosswalks:i,drawLines:o,requestNextPageOfAttributeValues:T,showNonOv:p,nonVisibleValues:F},M))}})()})),lF=(0,kp.Z)({root:{},form:{padding:"10px 0"},divider:{width:"100%",height:"1px",borderColor:"rgba(255,255,255,0.12)"},actions:{display:"flex",justifyContent:"flex-end",marginTop:"4px"},cancelButton:{color:"white",marginRight:"8px"}}),sF=e=>{let{attributeType:t,imageAttributeFieldsOrder:r,attributeValue:n,hasChanges:a,onDeleteAttribute:i,onChangeAttribute:o,onAddAttributes:l,onCancel:s,onApply:c,mode:u}=e;const p=lF(),d=Yk(n,t,r),m=0!==d.length||0===d.length&&a;return v().createElement(KI(),{className:p.root},v().createElement(KI(),{className:p.form},d.map((e=>{let{attrType:t,values:r}=e;return v().createElement(oF,{key:t.uri,parentUri:n.uri,attributeType:t,values:r,showEmptyEditors:(0,x.isTempUri)(n.uri),mode:u,drawLines:!1,onDeleteAttribute:i,onChangeAttribute:o,onAddAttributes:l})}))),m&&v().createElement(v().Fragment,null,v().createElement(Lg(),{className:p.divider}),v().createElement(KI(),{className:p.actions},v().createElement(nE(),{disabled:!a,onClick:s,className:p.cancelButton},mi().text("Cancel")),v().createElement(nE(),{disabled:!a,onClick:c,color:"primary"},mi().text("Apply")))))},cF={palette:{mode:"dark",primary:x.theme.palette.primary,secondary:x.theme.palette.secondary}},uF=(0,Lm.createTheme)(cF),pF=e=>{let{imageAttributeFieldsOrder:t,attributeType:r,attributeValue:n}=e;const a=(0,w.YA)(),i=(0,w.o_)(),{addAttributes:o,changeAttribute:l,deleteAttribute:s,clearLocalChanges:c,applyLocalChanges:u,attributeValue:p,hasChanges:d}=(e=>{let{initialAttributeValue:t,attributeType:r}=e;const n=(0,w.ax)("modifyAttribute"),[a,i]=(0,b.useState)(t);(0,b.useEffect)((()=>{i(t)}),[t]);const o=!(0,_.equals)(a,t),l=(0,b.useCallback)((e=>{i((t=>e.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:a}=t;return(0,x.addAttribute)({entity:e,attributeType:r,parentUri:n,index:a,nestingLevel:1})}),t)))}),[]),s=(0,b.useCallback)((e=>{let{value:t,attributeType:r,uri:n}=e;i((e=>(0,x.editAttribute)({entity:e,attributeType:r,uri:n,value:t,nestingLevel:1})))}),[]),c=(0,b.useCallback)((e=>{let{attributeType:t,uri:r}=e;i((e=>(0,x.removeAttribute)({entity:e,attributeType:t,uri:r,nestingLevel:1})))}),[]);return{addAttributes:l,changeAttribute:s,deleteAttribute:c,clearLocalChanges:(0,b.useCallback)((()=>{i(t)}),[t]),applyLocalChanges:(0,b.useCallback)((()=>{n({value:a,attributeType:r,uri:a.uri})}),[a,r,n]),attributeValue:a,hasChanges:o}})({attributeType:r,initialAttributeValue:n});return v().createElement(Lm.ThemeProvider,{theme:uF},v().createElement(KI(),null,v().createElement(qk,{attributeType:r,uri:null==p?void 0:p.uri,onAddAttributes:i?o:void 0}),v().createElement(Xk,{attributeType:r,attributeValue:p,imageAttributeFieldsOrder:t}),i&&v().createElement(sF,{mode:a,imageAttributeFieldsOrder:t,attributeType:r,attributeValue:p,hasChanges:d,onDeleteAttribute:s,onChangeAttribute:l,onAddAttributes:o,onCancel:c,onApply:u})))},dF=(0,kp.Z)((e=>({root:{position:"relative",backgroundColor:"#333",maxHeight:"calc(100vh - 64px)",overflow:"hidden"},header:{display:"flex",alignItems:"center",height:"56px",paddingLeft:"16px",boxShadow:`0 1px 0 0 ${e.palette.divider}`},headerTitle:{color:"rgba(255, 255, 255, 0.87)",fontSize:"16px",lineHeight:"19px"},bodyWrapper:{maxHeight:"calc(100% - 56px)",overflow:"auto"},body:{padding:"16px"},formControlLabel:{marginLeft:0,marginBottom:"27px"},checkboxLabel:{marginLeft:"8px",color:"rgba(255,255,255,0.87)",fontSize:"13px",lineHeight:"15px"},checkbox:{color:"white",padding:0}}))),mF=e=>{let{className:t,attributeValue:r,handleSetAsDefault:n,attributeType:a}=e;const i=dF(),[o,l]=(0,b.useState)(!1),s=(0,w.eh)()||{},c=(0,w.vc)(null==s?void 0:s.uri)||{},u=(0,w.xH)(),p=(0,w.uO)()||{},d=u?s:c,m=p[null==s?void 0:s.type]||(null==p?void 0:p.default)||{};(0,b.useEffect)((()=>{l((null==d?void 0:d.defaultProfilePic)===(null==r?void 0:r.uri))}),[null==r?void 0:r.uri,d]);const g=(0,b.useCallback)((()=>{n(r.uri)}),[null==r?void 0:r.uri]);return v().createElement(KI(),{className:O()(i.root,t)},v().createElement(KI(),{className:i.header},v().createElement(Ag(),{className:i.headerTitle},mi().text("Details"))),v().createElement(KI(),{className:i.bodyWrapper},v().createElement(KI(),{className:i.body},v().createElement(Nh(),{classes:{root:i.formControlLabel,label:i.checkboxLabel},control:v().createElement(Jp(),{className:i.checkbox,checked:o,onChange:g}),label:mi().text("Set as default")}),v().createElement(pF,{attributeType:a,imageAttributeFieldsOrder:m,attributeValue:r}))))},gF=(0,kp.Z)((()=>({root:{display:"flex",width:"100%",overflowY:"auto",height:"calc(100vh - 64px)"},main:{flex:"1 0 auto"},details:{width:"340px"}}))),yF=e=>{let{attributeValues:t=[],currentAttributeValueUri:r,setCurrentAttributeValueUri:n,handleSetAsDefault:a,attributeType:i}=e;const[o,l]=(0,b.useState)(0);(0,b.useEffect)((()=>{s(r?t.findIndex((e=>e.uri===r)):0)}),[r,t]);const s=(0,b.useCallback)((e=>{var r;l(e),n(null===(r=t[e])||void 0===r?void 0:r.uri)}),[t]),c=gF();return v().createElement(KI(),{className:c.root},v().createElement(Ik,{attributeValueIndex:o,setAttributeValueIndex:s,attributeValues:t,className:c.main}),v().createElement(mF,{handleSetAsDefault:a,attributeValue:t[o],className:c.details,attributeType:i}))};let fF=function(e){return e.Gallery="gallery",e.Details="details",e}({});var hF=r(60480),EF=r.n(hF),bF=r(54886),vF=r.n(bF),TF=r(86038),OF=r.n(TF),xF=r(39178),CF=r.n(xF);function SF(){return SF=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},SF.apply(this,arguments)}const wF=e=>v().createElement("svg",SF({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","data-reltio-id":"SvgDetails"},e),v().createElement("defs",null,v().createElement("path",{d:"M14 5a1 1 0 011 1v12a1 1 0 01-1 1H4a1 1 0 01-1-1V6a1 1 0 011-1h10zm6 12v2h-3v-2h3zm2-4v2h-5v-2h5zm0-4v2h-5V9h5zm0-4v2h-5V5h5z",id:"Details_svg__a"})),v().createElement("g",{stroke:"none",strokeWidth:1,fillRule:"evenodd"},v().createElement("mask",{id:"Details_svg__b",fill:"#fff"},v().createElement("use",{xlinkHref:"#Details_svg__a"})),v().createElement("path",{mask:"url(#Details_svg__b)",d:"M0 0h24v24H0z"}))),AF=(0,kp.Z)((()=>({paper:{backgroundColor:"rgba(0, 0, 0, .85)"},backdrop:{backgroundColor:"transparent"},toolbar:{paddingLeft:"20px",paddingRight:"20px"},appBar:{position:"relative",background:"linear-gradient(180deg, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0) 100%)"},closeButton:{marginRight:"28px"},closeIcon:{fontSize:"24px",color:"#fff"},headerLeft:{display:"flex",alignItems:"center",flex:2},headerCenter:{display:"flex",justifyContent:"center",flex:1},headerRight:{flex:2,display:"flex",justifyContent:"flex-end",alignItems:"center"},modeSwitcher:{backgroundColor:"#fff"},content:{padding:0}}))),RF=e=>{let{open:t,mode:r,children:n,header:a,onClose:i,onChangeMode:o}=e;const l=AF(),s=(0,b.useMemo)((()=>[{id:fF.Gallery,title:mi().text("Gallery"),Icon:CF()},{id:fF.Details,title:mi().text("Details"),Icon:wF}]),[]);return v().createElement(kj(),{classes:{paper:l.paper},open:t,BackdropProps:{className:l.backdrop},fullScreen:!0},v().createElement(vF(),{classes:{colorPrimary:l.appBar}},v().createElement(OF(),{className:l.toolbar},v().createElement(KI(),{className:l.headerLeft},v().createElement(wd.k,{tooltipTitle:mi().text("Close"),onClick:i,className:l.closeButton,iconClassName:l.closeIcon,icon:_p()}),null==a?void 0:a.left),v().createElement(KI(),{className:l.headerCenter},v().createElement(zE,{modes:s,modeId:r,onChange:o,className:l.modeSwitcher})),v().createElement(KI(),{className:l.headerRight},null==a?void 0:a.right))),v().createElement(EF(),{className:l.content},n))},_F=(0,kp.Z)((()=>({root:{padding:"0 24px",overflowY:"auto",height:"calc(100vh - 64px)"},item:{padding:"2px"}}))),IF=e=>{let{items:t,selectedItems:r,onSelectImage:n,onDeselectImage:a,onShareLink:i,onSetAsDefault:o,onDownload:l,onClickImage:s,onDelete:c}=e;const u=_F(),p=e=>v().createElement(Dj,{id:e,selected:r.includes(e),selectionMode:0!==r.length,onSelect:()=>n(e),onDeselect:()=>a(e),onShareLink:()=>i(e),onSetAsDefault:()=>o(e),onDownload:()=>l(e),onClick:()=>s(e),onDelete:c?()=>c(e):void 0,canBeSelected:!0});return v().createElement(KI(),{className:u.root},v().createElement(wk(),{container:!0},t.map((e=>{let{id:t,src:r}=e;return v().createElement(wk(),{key:t,classes:{item:u.item},item:!0},v().createElement(bk,{size:fk.LARGE,onClick:()=>s(t),src:r,overlay:p(t)}))}))))},NF=(0,kp.Z)((e=>({selectButton:{fontSize:"14px",fontWeight:500,color:e.palette.primary.main,textTransform:"uppercase"}}))),DF=e=>{let{selectedItems:t,items:r,onSelectAll:n,onClearAll:a}=e;const i=NF(),o=t.length===r.length;return v().createElement(uy(),{component:"button",underline:"none",classes:{button:i.selectButton},onClick:o?a:n},o?mi().text("Clear selection"):mi().text("Select all images"))};var PF=r(70997),kF=r.n(PF);const LF=(0,kp.Z)((()=>({downloadButton:{color:"#fff",fontSize:"24px",marginLeft:"30px"},shareButton:{color:"#fff",fontSize:"24px",marginLeft:"21px"},deleteButton:{color:"#fff",fontSize:"24px",marginLeft:"24px"},divider:{height:"31px",width:"1px",marginLeft:"10px",backgroundColor:"rgba(255,255,255,0.38)"}}))),UF=e=>{let{onDownload:t,onShare:r,onUpload:n,onDelete:a}=e;const i=LF();return v().createElement(v().Fragment,null,n&&v().createElement(nE(),{variant:"contained",color:"primary",onClick:n,startIcon:v().createElement(Oj(),null)},mi().text("Upload")),t&&n&&v().createElement("div",{className:i.divider}),t&&v().createElement(wd.k,{className:i.downloadButton,tooltipTitle:mi().text("Download selected items"),icon:Cj,onClick:t}),r&&v().createElement(wd.k,{className:i.shareButton,tooltipTitle:mi().text("Copy link"),icon:kF(),onClick:r}),a&&v().createElement(wd.k,{className:i.deleteButton,tooltipTitle:mi().text("Delete selected items"),icon:tL(),onClick:a}))},jF=e=>{let{attributeValues:t,open:r,onClose:n,currentAttributeValueUri:a,setCurrentAttributeValueUri:i,attributeType:o,onDownload:l,onShareLink:s,onSetAsDefault:c,onUpload:u,onDeleteAttribute:p}=e;const[d,m]=(0,b.useState)([]),[g,y]=(0,b.useState)(fF.Gallery),f=(0,w.xH)();(0,b.useEffect)((()=>{y(a?fF.Details:fF.Gallery)}),[a]);const h=t.map((e=>({src:(0,x.getImageAttributeOvThumbnailUrl)(e),downloadURL:(0,x.getImageAttributeOvUrl)(e),id:e.uri}))),E=e=>{s(h.find((0,_.propEq)("id",e)).downloadURL)},T=e=>{const r=t.find((t=>{let{uri:r}=t;return r===e}));c(r)},O=e=>{p({uri:e,attributeType:o})},{canCreate:C,canDelete:S}=(0,b.useContext)(Fk),A=g===fF.Gallery,R=g===fF.Details,I=d.length>0,N=R||A&&I,D=()=>A?d:[a],P=D().every((e=>(0,x.isTempUri)(e)||S)),k=!f&&N&&P,L=!f&&C&&(R||A&&!I),U=A&&I&&v().createElement(DF,{items:h,selectedItems:d,onClearAll:()=>{m([])},onSelectAll:()=>{m((0,_.pluck)("id",h))}}),j=v().createElement(UF,{onDelete:k?()=>{D().forEach((e=>{O(e)})),d.length&&m([])}:void 0,onDownload:N?()=>{const e=A?(0,_.pipe)((0,_.filter)((e=>{let{id:t}=e;return d.includes(t)})),(0,_.pluck)("downloadURL"))(h):[h.find((0,_.propEq)("id",a)).downloadURL];l(e)}:void 0,onShare:R?()=>{E(a)}:void 0,onUpload:L?u:void 0});return v().createElement(RF,{mode:g,open:r,onChangeMode:y,header:{left:U,right:j},onClose:n},A&&v().createElement(IF,{items:h,selectedItems:d,onSelectImage:e=>{m((t=>[...t,e]))},onDeselectImage:e=>{m((t=>t.filter((t=>t!==e))))},onShareLink:E,onSetAsDefault:T,onDownload:e=>{l([h.find((0,_.propEq)("id",e)).downloadURL])},onClickImage:e=>{i(e),y(fF.Details)},onDelete:f?void 0:O}),R&&v().createElement(yF,{handleSetAsDefault:T,setCurrentAttributeValueUri:i,currentAttributeValueUri:a,attributeValues:t,attributeType:o}))},FF=(0,kp.Z)((e=>({imageBox:{position:"relative",display:"flex",width:"100%",flexGrow:1,flexShrink:0,flexWrap:"nowrap",marginTop:"2px",overflow:"hidden"},moreButtonContainer:e=>{let{imageWidth:t,imageHeight:r}=e;return{backgroundColor:"white",width:t,height:r,position:"absolute",right:0,cursor:"pointer"}},moreButton:t=>{let{imageWidth:r,imageHeight:n}=t;return{display:"flex",justifyContent:"center",alignItems:"center",width:r,height:n,backgroundColor:(0,Lm.alpha)(e.palette.primary.main,.06)}},number:{color:e.palette.primary.main,fontSize:"24px",lineHeight:"42px",letterSpacing:0,textAlign:"center",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}})));function MF(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const VF=e=>{let{attributeType:t,attributeValues:r=[],renderImage:n,overlay:a=!1,countFixedItems:i=0,children:o,onUpload:l,onDeleteAttribute:s,imageSize:c=vk,paging:u,parentUri:p,showNonOv:d,requestNextPageOfAttributeValues:m}=e;const g=FF(c);(0,b.useEffect)((()=>{if(u&&m){const e=d?u.totalOvValues:u.totalValues;e>r.length&&m({parentUri:p,attributeTypeUri:t.uri,attributeTypeName:t.name,values:[],defaultMaxValues:e})}}),[u,m,t,p,r.length,d]);const y=(0,b.useRef)(),[f,h]=(0,b.useState)(0),[E,T]=(0,b.useState)(0),O=(0,b.useContext)(ZI),[C,S]=(0,b.useState)(!1),[A,R]=(0,b.useState)(),_=(0,w.ax)("setDefaultProfilePicForEntity"),I=(0,w.ax)("setDefaultProfilePicForModifiedEntity"),N=(0,w.eh)()||{},D=(0,w.xH)(),P=(0,b.useCallback)((e=>{const{imageMargin:t,imageWidth:n}=c,a=Math.floor((e+t)/(n+t))-i,o=e+t-(a+i)*(n+t)<8;h(a),r.length>a?T(r.length-a+(o?1:0)):T(0)}),[r.length,i,c]),k=(0,b.useCallback)((e=>{P(e),y.current=e}),[P]);(0,b.useEffect)((()=>{y.current&&P(y.current)}),[r.length,P]);const L=(0,b.useCallback)((e=>{O||(R(e),S(!0))}),[O]),U=(0,b.useCallback)((()=>{S(!1)}),[]),j=e=>(e=>{e.forEach(((e,t)=>{try{if((e=>!!(e=>e.indexOf("://")>0||0===e.indexOf("//"))(e)&&new URL(e).host!==location.host)(e)){const r=document.createElement("iframe");r.setAttribute("style","display: none;"),r.setAttribute("src",e),document.body.appendChild(r),setTimeout((()=>document.body.removeChild(r)),3e4*(t+1))}else{const t=document.createElement("a");t.href=e,t.download=(e=>e.split("/").pop())(e),document.body.appendChild(t),t.click(),document.body.removeChild(t)}}catch(e){console.error(e)}}))})(e),F=e=>navigator.clipboard.writeText(e),M=(0,b.useCallback)((e=>{D?(0,x.insertDefaultImageByAttrUri)(N.uri,e.uri).then((t=>{let{status:r}=t;"success"===r&&_(e)})):I({entityUri:N.uri,value:e})}),[D,N.uri,_,I]),V=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){MF(e,t,r[t])}))}return e}({onOpenImageGalleryDialog:L},a&&{onDownload:j,onShareLink:F,onSetAsDefault:M});return v().createElement(v().Fragment,null,v().createElement(Gp.Z,{handleWidth:!0,onResize:k}),v().createElement(jF,{attributeValues:r,open:C,onClose:U,setCurrentAttributeValueUri:R,currentAttributeValueUri:A,attributeType:t,onDownload:j,onShareLink:F,onSetAsDefault:M,onUpload:l,onDeleteAttribute:s}),v().createElement("div",{className:g.imageBox},o,r.slice(0,f).map(n(V)),E>0&&v().createElement("div",{className:g.moreButtonContainer},v().createElement("div",{className:g.moreButton,onClick:()=>L()},v().createElement(Ag(),{className:g.number},`+${E}`)))))},BF=(0,kp.Z)((e=>({image:e=>{let{imageMargin:t,imageHeight:r,imageWidth:n}=e;return{marginRight:t,width:n,height:r,cursor:"pointer","&:last-child":{marginRight:0}}},deleteAttributeImage:{position:"relative","&:before":{content:"''",position:"absolute",left:0,top:0,right:0,bottom:0,background:`url('${(0,x.svg2Url)('<svg xmlns="http://www.w3.org/2000/svg" style="stroke: #D1051E; stroke-width: 1" viewBox="0 0 114 114">\n\t<line x1="5" y1="109" x2="109" y2="5" />\n</svg>')}') no-repeat`,backgroundColor:x.historyPalettes[x.HistoryOperations.deleteAttribute].backgroundColor,pointerEvents:"none"}},updateAttributeImage:{position:"relative","&:before":{content:"''",position:"absolute",left:0,top:0,right:0,bottom:0,backgroundColor:x.historyPalettes[x.HistoryOperations.updateAttribute].backgroundColor,pointerEvents:"none"}},deleteAttribute:e=>{let{imageWidth:t,imageHeight:r}=e;return{width:t,height:r,boxSizing:"border-box",outline:`3px solid ${x.historyPalettes[x.HistoryOperations.deleteAttribute].color}`,outlineOffset:"-3px"}},insertAttribute:e=>{let{imageWidth:t,imageHeight:r}=e;return{width:t,height:r,boxSizing:"border-box",outline:`3px solid ${x.historyPalettes[x.HistoryOperations.insertAttribute].color}`,outlineOffset:"-3px"}},updateAttribute:e=>{let{imageWidth:t,imageHeight:r}=e;return{width:t,height:r,boxSizing:"border-box",outline:`3px solid ${x.historyPalettes[x.HistoryOperations.updateAttribute].color}`,outlineOffset:"-3px"}},number:{color:e.palette.primary.main,fontSize:"24px",lineHeight:"42px",letterSpacing:0,padding:"36px 8px",textAlign:"center",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}}))),zF=e=>{let{attributeType:t,attributeValues:r=[],paging:n,parentUri:a,requestNextPageOfAttributeValues:i,showNonOv:o,imageSize:l=vk}=e;const s=BF(l),{appearance:c}=(0,b.useContext)(ND);return v().createElement(VF,{attributeValues:r,attributeType:t,renderImage:e=>{let{onOpenImageGalleryDialog:t}=e;return e=>{const r=(0,x.getImageAttributeOvThumbnailUrl)(e),{uri:n}=e,a=(0,x.getHistoryAppearanceByUri)(n,c),i=(0,x.getHistoryAttributeClassName)(a);return v().createElement("div",{className:O()(s.image,{[s[i+"Image"]]:i}),key:n,"data-reltio-id":"reltio-attribute-value"},v().createElement(bk,{onClick:()=>t(n),className:s[i],src:r,size:{imageWidth:l.imageWidth,imageHeight:l.imageHeight}}))}},imageSize:l,requestNextPageOfAttributeValues:i,paging:n,parentUri:a,showNonOv:o})},HF=e=>{let{attributeType:t,attributeValues:r,paging:n,parentUri:a,showNonOv:i,requestNextPageOfAttributeValues:o}=e;const l=BP(),{label:s,description:c}=t;return v().createElement(v().Fragment,null,v().createElement("div",{className:l.titleRow},v().createElement(ED,{className:l.title,label:s,"data-reltio-id":"reltio-attribute-label"}),v().createElement(AD,{className:l.descriptionIcon,description:c})),v().createElement(zF,{attributeValues:r,attributeType:t,paging:n,parentUri:a,requestNextPageOfAttributeValues:o,showNonOv:i}))},YF="oneLine",WF="multiLine",GF="imageLine",qF="special",ZF=(0,b.memo)((e=>{var t;let{values:r,attributeType:n,drawLines:a,paging:i={},parentUri:o,max:l,titleClassName:s,contentClassName:c,showNonOv:u}=e;const p=MP(),d=(0,w.ax)("requestNextPageOfAttributeValues"),m=(0,w.vd)(),g=null!==(t=null!=l?l:m)&&void 0!==t?t:1/0,y=(0,_.partition)(x.isOv);if(!r||!r.length)return null;const[f,h]=y(r),E=u?r:f,b=u?[]:h,T=u?"totalValues":"totalOvValues",C=(0,_.ifElse)((0,_.has)(T),(0,_.prop)(T),(0,_.always)(E.length))(i),S=null!=i&&i.totalValues?i.totalValues-C:b.length,A=1===C&&!(0,x.isComplexAttribute)(n);return v().createElement(sN,{enabled:a,className:O()({[p.paddingWrapperWithLines]:a})},v().createElement("div",{className:O()({[p.paddingWrapper]:!a})},(()=>{switch((0,_.cond)([[x.isSpecialAttribute,(0,_.always)(qF)],[x.isImage,(0,_.always)(GF)],[(0,_.always)(A),(0,_.always)(YF)],[_.T,(0,_.always)(WF)]])(n)){case YF:return v().createElement(zP,{value:E[0],nonVisibleValues:b,totalNonVisibleValues:S,attributeType:n,titleClassName:s,contentClassName:c,showNonOv:u});case WF:return v().createElement(XP,{values:E,nonVisibleValues:b,totalVisibleValues:C,totalNonVisibleValues:S,attributeType:n,parentUri:o,max:g,requestNextPageOfAttributeValues:d,titleClassName:s,contentClassName:c,showNonOv:u});case GF:return v().createElement(HF,{attributeValues:E,attributeType:n,paging:i,parentUri:o,requestNextPageOfAttributeValues:d,showNonOv:u});case qF:return v().createElement(pk,{values:E,attributeType:n})}})()))})),$F=e=>{let{attrTypes:t=[],entity:r,parentUri:n,drawLines:a,children:i,className:o,max:l,alwaysVisibleTypeUris:s=kL,showNonOv:c}=e;const u=(0,b.useContext)(jL),p=n&&(0,x.getBaseUri)(n),d=(0,b.useMemo)((()=>u[p]||[]),[u,p]),m=(0,b.useMemo)((()=>(t||[]).filter((e=>!d.includes(e.uri)))),[t,d]),[g,y]=(0,b.useState)(l||1/0),f=(0,b.useMemo)((()=>(0,x.getAttributesListForReadMode)(m,r,c)),[m,r,c]),[h,E]=(0,b.useMemo)((()=>pL(s,f)),[f,s]),T=E.slice(0,g),O=l&&T.length<E.length,C=l&&T.length>=E.length&&l<T.length,S={enabled:a};return v().createElement("div",{className:o},i&&v().createElement(sN,S,i),T.concat(h).map((e=>{let{attrType:t,values:i}=e;return v().createElement(ZF,{key:t.uri,attributeType:t,drawLines:a,values:i,paging:(0,_.path)(["paging",t.uri],r.attributes),parentUri:n,showNonOv:c})})),O&&v().createElement(GP,{onClick:()=>{y(1/0)}}),C&&v().createElement(KP,{onClick:()=>{y(l)}}))};$F.displayName="ReadOnlyAttributesList";const KF=(0,b.memo)($F),XF=(0,kp.Z)({attributesContainer:{padding:"8px 16px"},noCaption:{paddingTop:"16px"},noData:{fontSize:"13px",color:"rgba(0,0,0,0.54)"}}),QF=e=>{let{className:t,entity:r={},caption:n="",excludeUris:a=[],includeUris:i=[],attributesCount:o}=e;const l=XF(),s=(0,w.AH)(),c=(0,w.xK)(),u=(0,b.useMemo)((()=>uL(s,r.type,i,a)),[a,i,s,r]),p=o||16,d=(0,x.getAttributesListForReadMode)(u,r).filter((e=>{let{values:t}=e;return!(0,x.isEmptyValue)(t)})).length>0;return d||!(0,x.isEmptyValue)(n)?v().createElement(XI.Provider,{value:c},v().createElement(aN,{className:t},n&&v().createElement(iN.I,{title:n}),v().createElement(KI(),{className:O()(l.attributesContainer,{[l.noCaption]:!n})},d?v().createElement(KF,{entity:r,attrTypes:u,parentUri:r.uri,drawLines:!1,max:p}):v().createElement(Ag(),{className:l.noData},mi().text("No data found"))))):null},JF=(0,kp.Z)({attributesContainer:{overflow:"hidden",padding:"8px 16px"},noCaption:{paddingTop:"16px"}}),eM=e=>{let{className:t,mode:r,entity:n,caption:a="",excludeUris:i=[],includeUris:o=[],pinnedAttributes:l}=e;const s=JF(),c=(0,w.ax)("addAttributes"),u=(0,w.ax)("modifyAttribute"),p=(0,w.ax)("removeAttribute"),d=(0,w.AH)(),m=(0,w.R2)(),g=(0,w.vc)(n.uri)||{},y=(0,b.useMemo)((()=>(0,x.getPinnedAttributesForUser)(l,m)),[l,m]),f=(0,b.useMemo)((()=>uL(d,g.type,o,i)),[i,o,d,g.type]);return v().createElement(aN,{className:t},a&&v().createElement(iN.I,{title:a}),v().createElement(KI(),{className:O()(s.attributesContainer,{[s.noCaption]:!a})},v().createElement(LL.Provider,{value:y},v().createElement(VL,{entity:g,attrTypes:f,parentUri:g.uri,drawLines:!1,mode:r,showEmptyEditors:(0,x.isTempUri)(g.uri),crosswalks:g.crosswalks,onAddAttributes:c,onChangeAttribute:u,onDeleteAttribute:p}))))};function tM(){return tM=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},tM.apply(this,arguments)}const rM=e=>{let{attributesCount:t,pinnedAttributes:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributesCount","pinnedAttributes"]);const a=(0,w.Fr)(),i=(0,w.YA)(),o=n.entity||a,l=n.mode||i;return v().createElement(bD.Provider,{value:o},(0,x.isViewMode)(l)?v().createElement(QF,tM({},n,{attributesCount:t,entity:o})):v().createElement(eM,tM({},n,{mode:l,pinnedAttributes:r,entity:o})))},nM=(0,kp.Z)((()=>({container:{display:"flex",flexDirection:"column",height:"100%"},scrollWrapper:{flexGrow:1,overflowY:"auto",backgroundColor:"#FAFAFA"},attributesView:{margin:"16px"},emptyState:{height:"100%",backgroundColor:"#FAFAFA"},profileBand:{paddingLeft:48,backgroundColor:"rgba(0,114,206,0.06)"}}))),aM=()=>{const e=nM(),t=(0,Tp.useSelector)(oc),r=(0,Tp.useSelector)(ac);return v().createElement(v().Fragment,null,r&&v().createElement(LE.z,null),t?v().createElement("div",{className:e.container},v().createElement(qI,{entity:t,classes:{profileBand:e.profileBand}}),v().createElement("div",{className:e.scrollWrapper},v().createElement(ZI.Provider,{value:!0},v().createElement(rM,{className:e.attributesView,entity:t,mode:x.Mode.Viewing})))):v().createElement("div",{className:e.emptyState},v().createElement(kE,{LogoRenderer:PE.NO_DATA,text:mi().text("No data to display."),secondaryText:mi().text("Select a profile and view preview details here."),variant:DE.embedded})))},iM="circle",oM="polygon",lM={fillColor:"rgb(242,82,82)",fillOpacity:.1,strokeWeight:2,strokeColor:"#F25252",clickable:!1,editable:!0,zIndex:1},sM={mapTypeControl:!1,streetViewControl:!1,fullscreenControl:!1},cM=.001,uM=v().createContext({});uM.displayName="EntityMarkerContext";var pM=r(17871);const dM=(0,kp.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"}}}}))),mM=e=>{let{entity:t,classes:r={}}=e;const n=dM(),{secondaryLabel:a,label:i}=r,o=(0,x.getLabel)(t.label),{secondaryLabel:l}=t,s=(0,b.useCallback)((()=>{navigator.clipboard.writeText((0,x.getEntityId)(t))}),[t]);return v().createElement(v().Fragment,null,v().createElement(A,{entity:t,imageClassName:n.image}),v().createElement("div",{className:n.info},v().createElement(qd,{value:(0,x.getEntityUriForLink)(t),className:n.link},v().createElement(gd.Y,{value:o,placement:"top",showOnExceededHeight:!0},v().createElement("div",{className:O()(n.label,i)},o))),l&&v().createElement(gd.Y,{value:l,placement:"top",showOnExceededHeight:!0},v().createElement("div",{className:O()(n.secondaryLabel,a)},l)),v().createElement("div",{className:n.thirdRow},v().createElement(EE,{entity:t,size:"medium"}),v().createElement("div",{className:n.entityId,onClick:s},v().createElement("div",{className:n.entityIdLabel},mi().text("ID:")),v().createElement(gd.Y,{value:`Copy to clipboard ${(0,x.getEntityId)(t)}`,placement:"top"},v().createElement("div",{className:n.entityIdValue},(0,x.getEntityId)(t)))))))},gM=(0,kp.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)"}}),yM=()=>{const e=gM();return v().createElement(v().Fragment,null,v().createElement("div",{className:O()(e.avatar,e.wave)}),v().createElement("div",{className:e.info},v().createElement("div",{className:O()(e.label,e.wave)}),v().createElement("div",{className:O()(e.secondaryLabel,e.wave)}),v().createElement("div",{className:O()(e.thirdRow,e.wave)})))},fM=(0,kp.Z)({container:{display:"flex",padding:"16px",overflow:"hidden"}});function hM(){return hM=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hM.apply(this,arguments)}const EM=(0,b.memo)((e=>{let{entity:t,classes:r={},variant:n="normal"}=e,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["entity","classes","variant"]);const i=fM(),{container:o}=r;return v().createElement("div",hM({className:O()(i.container,o)},a),"normal"===n?v().createElement(mM,{entity:t,classes:r}):v().createElement(yM,null))})),bM=(0,kp.Z)({popper:{maxWidth:"263px",minWidth:"150px",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)",backgroundColor:"white",borderRadius:"2px"}});function vM(){return vM=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vM.apply(this,arguments)}const TM=(0,x.svg2Url)('<?xml version="1.0" encoding="UTF-8"?>\n<svg width="22px" height="32px" viewBox="0 0 22 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>View / Map / Marker / Large (hover)</title>\n <defs>\n <radialGradient cx="50%" cy="50.2950175%" fx="50%" fy="50.2950175%" r="49.7049825%" gradientTransform="translate(0.500000,0.502950),scale(0.777778,1.000000),rotate(90.000000),scale(1.000000,1.293560),translate(-0.500000,-0.502950)" id="radialGradient-1">\n <stop stop-color="#000000" offset="0%"></stop>\n <stop stop-color="#000000" stop-opacity="0" offset="100%"></stop>\n </radialGradient>\n <path d="M21,0 C21.5522847,-1.01453063e-16 22,0.44771525 22,1 L22,21 C22,21.5522847 21.5522847,22 21,22 L15.7283832,22.0012846 C15.5422129,22.2445529 15.3664776,22.4802332 15.1984183,22.7122576 C13.7560833,24.7035592 13,26.2846074 13,27.5 L13,27.5 L12.9945143,27.6492623 C12.9181651,28.6841222 12.0543618,29.5 11,29.5 C9.8954305,29.5 9,28.6045695 9,27.5 L9,27.5 L8.99485006,27.3298651 C8.91582184,26.0024976 7.93016704,24.2171459 6.23940611,22.000704 L1,22 C0.44771525,22 6.76353751e-17,21.5522847 0,21 L0,1 C-6.76353751e-17,0.44771525 0.44771525,1.01453063e-16 1,0 L21,0 Z" id="path-2"></path>\n </defs>\n <g id="View-/-Map-/-Marker-/-Large-(hover)" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <ellipse id="Oval" fill="url(#radialGradient-1)" opacity="0.32" cx="11" cy="28.5" rx="6" ry="4.66666667"></ellipse>\n <mask id="mask-3" fill="white">\n <use xlink:href="#path-2"></use>\n </mask>\n <use id="Path-2" fill="#FFFFFF" xlink:href="#path-2"></use>\n <rect id="Entity-type" fill="#24A8E8" mask="url(#mask-3)" x="0" y="0" width="22" height="32"></rect>\n <path d="M20,2 L20,20 L14.755,20 L14.6905172,20.0815309 C14.3562717,20.5012516 14.0578656,20.8886742 13.7817711,21.2616986 L13.5786724,21.5390469 C11.92787,23.8181606 11.079024,25.6311217 11.0052669,27.2674145 L11.0052669,27.2674145 L11,27.5 L10.9968324,27.3203844 C10.9285422,25.3781621 9.75347502,23.1598866 7.22124201,20.0010865 L2,20 L2,2 L20,2 Z" id="Path" fill="#FFFFFF" fill-rule="nonzero" mask="url(#mask-3)"></path>\n </g>\n</svg>'),OM=(0,x.svg2Url)('<?xml version="1.0" encoding="UTF-8"?>\n<svg width="22px" height="32px" viewBox="0 0 22 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>View / Map / Marker / Large</title>\n <defs>\n <radialGradient cx="50%" cy="50.2950175%" fx="50%" fy="50.2950175%" r="49.7049825%" gradientTransform="translate(0.500000,0.502950),scale(0.777778,1.000000),rotate(90.000000),scale(1.000000,1.293560),translate(-0.500000,-0.502950)" id="radialGradient-1">\n <stop stop-color="#000000" offset="0%"></stop>\n <stop stop-color="#000000" stop-opacity="0" offset="100%"></stop>\n </radialGradient>\n <path d="M20,1 C20.5522847,1 21,1.44771525 21,2 L21,20 C21,20.5522847 20.5522847,21 20,21 L15.2374606,21.0021908 C14.9306693,21.3935449 14.6510143,21.7632851 14.3885453,22.1256523 C12.8309725,24.2760522 12,26.0137017 12,27.5 C12,28.0522847 11.5522847,28.5 11,28.5 C10.4477153,28.5 10,28.0522847 10,27.5 C10,25.7886708 8.84033182,23.6810997 6.73798027,21.0014567 L2,21 C1.44771525,21 1,20.5522847 1,20 L1,2 C1,1.44771525 1.44771525,1 2,1 L20,1 Z" id="path-2"></path>\n </defs>\n <g id="View-/-Map-/-Marker-/-Large" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <ellipse id="Oval" fill="url(#radialGradient-1)" opacity="0.12" cx="11" cy="28.5" rx="4.5" ry="3.5"></ellipse>\n <path d="M21,0 C21.5522847,-1.01453063e-16 22,0.44771525 22,1 L22,21 C22,21.5522847 21.5522847,22 21,22 L15.7283832,22.0012846 C15.5422129,22.2445529 15.3664776,22.4802332 15.1984183,22.7122576 C13.7560833,24.7035592 13,26.2846074 13,27.5 L13,27.5 L12.9945143,27.6492623 C12.9181651,28.6841222 12.0543618,29.5 11,29.5 C9.8954305,29.5 9,28.6045695 9,27.5 L9,27.5 L8.99485006,27.3298651 C8.91582184,26.0024976 7.93016704,24.2171459 6.23940611,22.000704 L1,22 C0.44771525,22 6.76353751e-17,21.5522847 0,21 L0,1 C-6.76353751e-17,0.44771525 0.44771525,1.01453063e-16 1,0 L21,0 Z" id="Path-3" fill="#FFFFFF"></path>\n <mask id="mask-3" fill="white">\n <use xlink:href="#path-2"></use>\n </mask>\n <use id="Path-2" fill="#FFFFFF" fill-rule="nonzero" xlink:href="#path-2"></use>\n <rect id="Entity-type" fill="#24A8E8" mask="url(#mask-3)" x="0" y="0" width="22" height="32"></rect>\n </g>\n</svg>'),xM=(0,b.memo)((e=>{let{marker:t,onClick:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["marker","onClick"]);const a=bM(),i=(0,b.useRef)(),[o,l]=(0,b.useState)(!1),{activeEntityUri:s}=(0,b.useContext)(uM),c=(0,_.pathEq)(["entity","uri"],s,t),u={lat:t.point.lat,lng:t.point.lng},p=(0,b.useCallback)((0,x.debounce)(l,50),[]),d=(0,b.useCallback)((()=>p(!0)),[p]),m=(0,b.useCallback)((()=>p(!1)),[p]),g=(0,b.useCallback)((()=>r(t)),[r,t]);return v().createElement(v().Fragment,null,v().createElement(CN.r,{anchorEl:i.current,open:o,className:a.popper,modal:!1,placement:"top"},v().createElement(EM,{entity:t.entity,onMouseOver:d,onMouseOut:m})),v().createElement(pM.Jx,vM({icon:{url:o||c?TM:OM,scaledSize:new google.maps.Size(22,32)},position:u,onClick:g,visible:!1!==t.visible,onMouseOver:d,onMouseOut:m},n)),v().createElement(pM.vD,{options:{alignBottom:!0,pane:"mapPane",pixelOffset:new google.maps.Size(0,-40),closeBoxURL:"",enableEventPropagation:!0,disableAutoPan:!0},position:u},v().createElement("span",{ref:i})))}));var CM=r(47111);const SM=e=>{let{children:t,className:r,position:n,map:a}=e;const[i,o]=(0,b.useState)(null);return(0,b.useEffect)((()=>{const e=document.createElement("div"),t=a.controls[n].length;return a.controls[n].push(e),o(e),()=>{a.controls[n].removeAt(t)}}),[a,n]),(0,b.useEffect)((()=>{i&&r&&i.classList.add(r)}),[r,i]),i?(0,CM.createPortal)(t,i):null};var wM=r(518),AM=r.n(wM);function RM(){return RM=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},RM.apply(this,arguments)}const _M=e=>v().createElement("svg",RM({width:18,height:18,viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgRadius"},e),v().createElement("path",{d:"M10.61 8.568A1.666 1.666 0 119.432 7.39l3.656-3.657a6.668 6.668 0 101.179 1.179L10.61 8.568zm-7.503 6.325A8.333 8.333 0 1114.893 3.107 8.333 8.333 0 013.107 14.893z",fill:"#000",stroke:"none",strokeWidth:1,fillRule:"evenodd",opacity:.54}));function IM(){return IM=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},IM.apply(this,arguments)}const NM=e=>v().createElement("svg",IM({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","data-reltio-id":"SvgDraw"},e),v().createElement("defs",null,v().createElement("path",{d:"M18.29 11.44a1.49 1.49 0 012.12 0l1.15 1.15c.59.58.59 1.53 0 2.12L16.27 20H13v-3.27zM18.174 4c0 1.71-.26 3.285-.932 4.563-.946 1.798-2.609 2.724-4.906 2.46l-.855-.116c-4.382-.544-6.626.53-6.626 3.609 0 1.968 1.105 2.924 3.267 3.304.692.121 1.306.165 2.234.176L11 18v2l-.698-.003c-1.016-.013-1.71-.063-2.526-.206-3.018-.53-4.921-2.176-4.921-5.274 0-4.819 3.71-6.378 9.52-5.505 1.575.237 2.506-.255 3.098-1.38.451-.858.666-2.02.697-3.307L16.174 4h2zM18 13.97l-3.45 3.45v1.03h1.03L19.03 15 18 13.97z",id:"Draw_svg__a"})),v().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},v().createElement("mask",{id:"Draw_svg__b",fill:"#fff"},v().createElement("use",{xlinkHref:"#Draw_svg__a"})),v().createElement("g",{mask:"url(#Draw_svg__b)",fill:"#000",fillOpacity:.54},v().createElement("path",{d:"M0 0h24v24H0z"})))),DM=(0,kp.Z)({container:{margin:"2px",display:"flex",alignItems:"center"},button:{color:"rgba(0,0,0,0.54)",padding:0,height:"24px",width:"24px",minWidth:0},icon:{width:"20px",height:"20px"}}),PM=(0,yd.T)(nE()),kM=e=>{let{drawingMode:t,drawingModes:r=[],hasActiveOverlay:n,onDrawingModeChanged:a,onClearOverlay:i}=e;const o=DM(),l=e=>()=>{a(e)};return v().createElement("div",{className:o.container},t||n?v().createElement(PM,{tooltipTitle:mi().text("Clear area"),className:o.button,onClick:n?i:l(null)},v().createElement(AM(),{className:o.icon})):r.map((e=>{const t=(e=>{switch(e){case iM:return _M;case oM:return NM;default:return null}})(e);return v().createElement(PM,{tooltipTitle:mi().text("Draw area"),key:e,className:o.button,onClick:l(e)},v().createElement(t,{className:o.icon}))})))},LM=(0,kp.Z)({container:{height:"28px",marginRight:"7px",marginLeft:0},label:{fontSize:"11px",alignSelf:"center",lineHeight:"13px",marginLeft:"2px",letterSpacing:0},checkbox:{width:"20px",height:"20px",boxSizing:"content-box",padding:"5px","& svg":{width:"16px",height:"16px"}}}),UM=e=>{let{isSearchOnMapMove:t,onChangeIsSearchOnMapMove:r}=e;const n=LM();return v().createElement(Nh(),{classes:{root:n.container,label:n.label},control:v().createElement(Jp(),{checked:t,onChange:e=>{r(e.target.checked)},className:n.checkbox}),label:mi().text("Search as I move the map")})},jM=e=>{const t=e.getBounds(),r=t.getNorthEast(),n=t.getSouthWest(),a=r.lat(),i=r.lng(),o=n.lat(),l=n.lng(),s=[],c=[];if(!(180===i&&-180===l||-180===i&&180===l)){const e=t.getCenter();s.push([a,e.lng()]),c.push([o,e.lng()])}return[[a,i],...s,[a,l],[o,l],...c,[o,i]]},FM=e=>{switch(e){case iM:return window.google.maps.drawing.OverlayType.CIRCLE;case oM:return window.google.maps.drawing.OverlayType.POLYGON;default:return null}},MM=(e,t,r)=>{if(t.path){const n=r||new window.google.maps.LatLngBounds;t.path.forEach((e=>{let{lat:t,lng:r}=e;return n.extend(new window.google.maps.LatLng(t,r))})),e.fitBounds(n)}},VM=(0,kp.Z)({mapControlContainer:{borderRadius:"2px",backgroundColor:"#FFFFFF",boxShadow:"0 1px 3px 0 rgba(0,0,0,0.15)",margin:"10px"}});function BM(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){zM(e,t,r[t])}))}return e}function zM(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const HM=["drawing"],YM=e=>{let{markers:t=[],mapKey:r,defaultZoom:n,defaultCenter:a,loadingElement:i,isSearchOnMapMove:o,isSearchEnabled:l,activeOverlay:s,overlayOptions:c={},drawingModes:u=[],markerClusterer:p,markerClustererOptions:d,mapOptions:m={},mapContainerClassName:g,onMapBoundsChanged:y=_.identity,onOverlayUpdated:f=_.identity,onMarkerClicked:h=_.identity}=e;const E=VM(),{isLoaded:T,loadError:O}=(0,pM.Ji)({googleMapsApiKey:r,libraries:HM}),x=(0,b.useRef)(null),[C,S]=(0,b.useState)(null),[w,A]=(0,b.useState)(null),[R,I]=(0,b.useState)(null);(e=>{let{markers:t,activeOverlay:r,isSearchOnMapMove:n,map:a}=e;const i=Boolean(a&&window.google),o=(0,Ly.D)(t),l=(0,Ly.D)(r),s=(0,Ly.D)(i);(0,b.useEffect)((()=>{const e=o!==t,c=s!==i,u=i&&r&&(l!==r||c);i&&!n&&t.length&&(e||c)?((e,t,r)=>{const n=new window.google.maps.LatLngBounds;if(e.forEach((e=>n.extend(e.point))),1===e.length){const t=e[0].point;n.extend(new window.google.maps.LatLng(t.lat+cM,t.lng+cM)),n.extend(new window.google.maps.LatLng(t.lat-cM,t.lng-cM))}t.fitBounds(n),r&&MM(t,r,n)})(t,a,r):u&&MM(a,r)}),[i,t,r])})({markers:t,activeOverlay:s,map:C,isSearchOnMapMove:o});const N=(0,b.useMemo)((()=>BM({},lM,c)),[c]),D=(0,b.useMemo)((()=>BM({},sM,m)),[m]),P=(0,b.useCallback)((e=>{y(e?jM(C):null),I(null),clearTimeout(x.current)}),[C,y]),k=(0,b.useCallback)((()=>{clearTimeout(x.current)}),[]),L=(0,b.useCallback)((()=>{o&&y(jM(C))}),[o,C,y]),U=(0,b.useCallback)((()=>{o&&(clearTimeout(x.current),x.current=setTimeout(L,1e3))}),[L,o]),j=(0,b.useCallback)(((e,t)=>{var r;const n=t||w&&{type:oM,overlay:w};if((0,_.isEmpty)(n))return;const{overlay:a,type:i}=n,o={[oM]:()=>a.getPath().getArray().map((e=>[e.lat(),e.lng()])),[iM]:()=>({radius:a.getRadius()/1e3,center:a.getCenter()})},l=null===(r=o[i])||void 0===r?void 0:r.call(o);l&&f({data:l,type:i})}),[f,w]),F=(0,b.useCallback)((e=>t=>{j(null,{type:e,overlay:t}),t.setMap(null),I(null)}),[j]),M=(0,b.useCallback)((()=>{f(null)}),[f]),V=e=>t.filter((0,_.prop)("point")).map((t=>v().createElement(xM,{key:t.id,marker:t,clusterer:e,onClick:h})));if(O)return null;if(!T)return i;const B=l&&Boolean(u.length),z=C&&l&&Boolean(u.length),H=C&&l,Y=!FM(R)&&s&&(0,_.propEq)("type",oM,s);return v().createElement(pM.b6,{mapTypeId:window.google.maps.MapTypeId.ROADMAP,options:D,onLoad:S,zoom:n,center:a,onZoomChanged:k,onDragStart:k,onIdle:U,mapContainerClassName:g},z&&v().createElement(SM,{className:E.mapControlContainer,position:window.google.maps.ControlPosition.TOP_RIGHT,map:C},v().createElement(kM,{hasActiveOverlay:!!s,drawingModes:u,drawingMode:R,onDrawingModeChanged:I,onClearOverlay:M})),H&&v().createElement(SM,{className:E.mapControlContainer,position:window.google.maps.ControlPosition.TOP_CENTER,map:C},v().createElement(UM,{onChangeIsSearchOnMapMove:P,isSearchOnMapMove:o})),p?(W=d,v().createElement(pM.XL,{options:W},V)):V(),Y&&v().createElement(pM.mg,{onLoad:A,path:s.path,editable:!0,options:N,onMouseUp:j,onDragEnd:j}),B&&v().createElement(pM.j_,{onPolygonComplete:F(oM),onCircleComplete:F(iM),drawingMode:FM(R),options:{drawingControl:!1,circleOptions:N,polygonOptions:N}}));var W},WM=(e,t)=>Math.abs(e-t)<1,GM=(0,_.curry)(((e,t,r)=>{const n=t.map((t=>{let{position:r}=t;const n=e.find((e=>{let{point:t}=e;return WM(r.lat(),t.lat)&&WM(r.lng(),t.lng)}));return(0,_.propOr)("","label",n)})),a=(n.length>2?n.slice(0,2).concat("..."):n).join("\n");let i=0;const o=t.length.toString();let l=o;for(;0!==l;)l=parseInt(l/10,10),i++;return i=Math.min(i,r),{text:o,index:i,title:a}})),qM=[],ZM=(0,_.pipe)((0,_.path)(["point","lat"]),(0,_.both)((0,_.gt)(90),(0,_.lt)(-90))),$M={[x.MapSearch.geoPolygon]:oM,[x.MapSearch.geoLocation]:iM},KM=e=>e&&e.length?[...e,e[0]]:e,XM=e=>e[0].map((e=>{let[t,r]=e;return{lat:t,lng:r}})).slice(0,-1),QM=(0,kp.Z)((()=>({container:{height:"100%",width:"100%",position:"relative"},fullHeight:{height:"100%"}}))),JM=()=>{const e=QM(),t=(0,Tp.useSelector)(k().selectors.getMetadata),r=(0,Tp.useSelector)(ui.Qr),n=(0,Tp.useSelector)(ki.AO),a=(0,Tp.useSelector)(k().selectors.getGoogleMapKey),{markers:i,loading:o,onMarkerClicked:l}=(e=>{let{searchResults:t,metadata:r,mapKey:n}=e;t=t||qM;const a=(0,Tp.useDispatch)(),[i,o]=(0,b.useState)([]),[l,s]=(0,b.useState)(!1),c=(0,b.useRef)(),u=(0,b.useRef)(),p=(0,b.useCallback)((e=>{a({type:be,payload:e||null})}),[a]),d=(0,b.useCallback)((()=>{clearTimeout(u.current),clearTimeout(c.current)}),[]);return(0,b.useEffect)((()=>{s(!0),(0,x.resolve)(r,t,n).then((e=>{s(!1),o(e.filter(ZM))})).catch((()=>{s(!1),o([])}))}),[t,r,n]),{markers:i,loading:l,onMarkerClicked:(0,b.useCallback)((e=>{const t=(0,_.path)(["entity","uri"],e);d(),p(),c.current=setTimeout((()=>p(t)),0),u.current=setTimeout(p,3e3)}),[d,p])}})({searchResults:r,metadata:t,mapKey:a}),{isSearchEnabled:s,activeOverlay:c,onOverlayUpdated:u,isSearchOnMapMove:p,onMapBoundsChanged:d}=(()=>{const e=(0,Tp.useDispatch)(),t=(0,Tp.useSelector)(ui.Qy),r=(0,Tp.useSelector)(ui.bt),n=(0,Tp.useSelector)(ki.d7),[a,i]=(0,b.useState)(!1),o=(0,b.useCallback)((t=>{let r=null,n=null;if(t){const{data:e,type:a}=t;switch(a){case iM:{const{center:t,radius:a}=e;r=[t.lng(),t.lat(),a],n=x.MapSearch.geoLocation;break}case oM:r=KM(e),n=x.MapSearch.geoPolygon}}i(!1),e(ri(r,n))}),[e]),l=(0,b.useCallback)((t=>{i(!!t),e(ri(KM(t),t&&x.MapSearch.onMapMove))}),[e]),s=$M[r],c=(0,b.useMemo)((()=>n&&s&&t.length?{path:s===oM?XM(t):null,type:s}:null),[n,t,s]);return(0,b.useEffect)((()=>{(c||0===t.length)&&i(!1)}),[t,c]),{isSearchEnabled:n,onOverlayUpdated:o,activeOverlay:c,isSearchOnMapMove:a,onMapBoundsChanged:l}})(),m=(0,b.useMemo)((()=>v().createElement("div",{className:e.fullHeight},v().createElement(LE.z,null))),[e]),g=(0,b.useMemo)((()=>({gridSize:60,maxZoom:9,calculator:GM(i)})),[i]),y=(0,b.useMemo)((()=>({activeEntityUri:n})),[n]),f=(0,b.useMemo)((()=>({lat:0,lng:0})),[]),h=(0,b.useMemo)((()=>[oM]),[]);return a?v().createElement("div",{className:e.container},o&&v().createElement(LE.z,null),v().createElement(uM.Provider,{value:y},v().createElement(YM,{loadingElement:m,defaultZoom:1,defaultCenter:f,onOverlayUpdated:u,onMarkerClicked:l,activeOverlay:c,markers:i,fullscreenControl:!1,markerClusterer:!0,markerClustererOptions:g,drawingModes:h,isSearchOnMapMove:p,onMapBoundsChanged:d,isSearchEnabled:s,mapContainerClassName:e.fullHeight,mapKey:a}))):null},eV=(0,yd.T)(Pp.T),tV=e=>{switch(e){case K.om.PROFILE:return mi().text("Hide entity details");case K.om.MAP:return mi().text("Hide map")}},rV=()=>{const e=WI(),t=(0,Tp.useDispatch)(),r=(0,Tp.useSelector)(ki.qx),n=r===K.om.MAP,a=(0,Tp.useSelector)(k().selectors.getGoogleMapKey),i=(0,b.useCallback)((()=>t(Ni(null))),[t]);return(0,b.useEffect)((()=>{!a&&n&&i()}),[a,n,i]),v().createElement("div",{className:e.container},v().createElement(eV,{tooltipTitle:tV(r),tooltipPlacement:"bottom-start",size:"L",icon:YI(),className:e.closeButton,onClick:i}),(e=>{switch(e){case K.om.PROFILE:return v().createElement(aM,null);case K.om.MAP:return v().createElement(JM,null)}})(r))},nV=e=>{let{className:t,loading:r,entities:n,entityTypeTab:a,quantity:i,rowsPerPage:o,page:l,entityToHighlight:s,selectedEntityUri:c,mode:u,previewPanelMode:p,isPreviewPanelOpen:d,dispatch:m}=e;const g=jE(),y=(0,b.useRef)(),[f,h]=(0,b.useState)("50%"),E=(0,Pi.gj)(u),T=p===K.om.PROFILE,C=p===K.om.MAP,[S,w]=(0,b.useState)({}),A=(0,b.useCallback)(((e,t)=>{w((0,_.assoc)(e,t))}),[]);(0,b.useEffect)((()=>{y.current&&(y.current.scrollTop=0)}),[n]),(0,b.useEffect)((()=>{T&&((0,x.isEmptyValue)(n)?m(sc(null)):!(0,_.prop)(0,n)||c&&n.map((0,_.prop)("uri")).includes(c)||m(sc(n[0].uri)))}),[m,T,c,n]),(0,b.useEffect)((()=>{!T&&c&&m(cc(null))}),[m,c,T]);const R=(0,b.useCallback)((e=>m(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2?arguments[2]:void 0;return{type:U.Z.CHANGE_PAGE,payload:{pageNumber:e,debounceTime:t,entityTypeUri:r}}}(e,250,a))),[m,a]),I=(0,b.useCallback)((e=>m(((e,t)=>({type:U.Z.CHANGE_ROWS_PER_PAGE,payload:{number:e,entityTypeUri:t}}))(e,a))),[m,a]),N=(0,b.useCallback)((e=>m(sc(e))),[m]),D=(0,b.useCallback)((0,x.debounce)((e=>m({type:ve,payload:e})),50),[m]),P=(0,b.useCallback)((e=>{let{percentageSize:t}=e;return h(t)}),[]),k=e=>{const t=(0,_.prop)(e.uri,S);return v().createElement(Nm,{entity:e,entityImportStatus:t,onEntityImportStatusChange:A})},L=(0,b.useRef)(null);return v().createElement("div",{className:O()(g.container,t)},r&&v().createElement(LE.z,null),(0,Pi.gj)(u)?v().createElement(FI,{quantity:i}):v().createElement(AI,null),v().createElement(fE,{className:g.resizablePanesWrapper,orientation:"vertical",size:d?f:"100%",minSize:480,maxSize:-480,allowResize:d,onChange:P},v().createElement("div",{className:g.pane},v().createElement(UE,{error:v().createElement(kE,{LogoRenderer:PE.ERROR,text:mi().text("Something went wrong."),variant:DE.embedded})},(()=>{const e=s||null;return i?v().createElement("div",{className:E?g.tableContainer:g.listContainer,ref:y},E?v().createElement(zI,{entities:n,entityToHighlight:e,selectedEntityUri:c,entityTypeUri:a,onEntityClick:T?N:void 0,onEntityHover:C?D:void 0,entitiesImportStatus:S,onEntityImportStatusChange:A,basicTableRef:L}):v().createElement(CE,{entities:n,entityToHighlight:e,selectedEntityUri:c,onEntityClick:T?N:void 0,onEntityHover:C?D:void 0,entitiesImportStatus:S,entityButtonsRenderer:k}),i>K.Tu[0]&&v().createElement("div",{className:g.pagination},v().createElement(SE.Z,{count:i,rowsPerPageOptions:K.Tu,rowsPerPage:o||K.Tu[0],page:l||0,onChangePage:R,onChangeRowsPerPage:I,basicTableRef:L}))):v().createElement(kE,{LogoRenderer:PE.SEARCH_RESULTS,text:mi().text("No results found."),secondaryText:mi().text("Try adjusting your search or filter to find what you're looking for."),variant:DE.embedded})})())),v().createElement("div",{className:g.pane},v().createElement(rV,null))))};nV.propTypes={page:vp().number,quantity:vp().number,rowsPerPage:vp().number,entities:vp().array,loading:vp().bool,dispatch:vp().func,entityToHighlight:vp().string,mode:vp().string,entityTypeTab:vp().string,className:vp().string,isPreviewPanelOpen:vp().bool,previewPanelMode:vp().oneOf(Object.values(K.om)),selectedEntityUri:vp().string},nV.defaultProps={quantity:0,entities:[]};const aV=(0,Tp.connect)((e=>{const t=(0,ki.tB)(e);return{quantity:(0,ui.NU)(e,{entityTypeUri:t}),page:(0,ui.fx)(e,{entityTypeUri:t}),rowsPerPage:(0,ui.Uz)(e,{entityTypeUri:t}),entities:(0,ui.BP)(e,{entityTypeUri:t}),loading:(0,ui.gP)(e),entityToHighlight:(0,ki.Dn)(e),mode:(0,ki.XM)(e),entityTypeTab:t,previewPanelMode:(0,ki.qx)(e),isPreviewPanelOpen:(0,ki.jr)(e),selectedEntityUri:ic(e)}}))(nV);var iV=r(4539),oV=r.n(iV),lV=r(4494);const sV=(0,kp.Z)({root:{height:"32px",borderRadius:"18px",backgroundColor:"rgba(0,0,0,0.10)",margin:"4px",maxWidth:"380px",flexShrink:"0",border:"none","&:focus":{"background-color":"rgb(206, 206, 206)"},"&:first-child":{marginLeft:0},"& $deleteIcon":{color:"rgba(0,0,0,0.38)",margin:"0 5px 0 0px",height:"18px",width:"18px"}},deleteIcon:{},label:{paddingLeft:"8px",paddingRight:"8px",overflow:"hidden"},labelContainer:{display:"flex",overflow:"hidden"},title:{color:"rgba(0,0,0,0.67)",marginRight:"6px"},values:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}),cV=e=>{const t=sV(),r=e.values&&e.values.join(", ");return v().createElement(Of(),{label:v().createElement("div",{className:t.labelContainer},e.title&&v().createElement("div",{className:t.title},e.title,": "),e.values&&v().createElement(gd.Y,{value:r},v().createElement("div",{className:t.values},r))),onDelete:e.onDelete,variant:"outlined",deleteIcon:v().createElement(Cf(),{"data-reltio-id":"facet-bar-chip-delete"}),classes:{root:t.root,deleteIcon:t.deleteIcon,label:t.label}})};cV.propTypes={classes:vp().object,title:vp().string,values:vp().array,onDelete:vp().func};const uV=cV;class pV extends b.PureComponent{constructor(){super(...arguments),this.state={anchorEl:null},this.handleClick=e=>{const{currentTarget:t}=e;this.setState((e=>({anchorEl:e.anchorEl?null:t})))},this.handleClose=e=>{e.stopPropagation(),this.setState({anchorEl:null})}}render(){const{classes:e,items:t}=this.props,{anchorEl:r}=this.state,n=Boolean(r),a=n?"moreButtonPopper":null;return v().createElement(b.Fragment,null,v().createElement(nE(),{"aria-describedby":a,color:"primary",variant:"contained",classes:{root:e.root,label:e.label},onClick:this.handleClick},mi().text(`+ ${t.length}`)),v().createElement(CN.r,{id:a,open:n,onClose:this.handleClose,anchorEl:r,placement:"bottom-start"},v().createElement(JI(),{elevation:2,classes:{root:e.popperContent}},this.props.items)))}}pV.propTypes={classes:vp().object,items:vp().array},pV.defaultProps={items:[]};const dV=zg()((()=>({root:{flexShrink:0,minHeight:"32px",opacity:"0.54",padding:"8px",minWidth:"35px",borderRadius:"8px"},label:{fontSize:"13px",lineHeight:"15px"},popperContent:{display:"flex",flexDirection:"column",alignItems:"flex-start",padding:"8px"}})))(pV);var mV=r(74635),gV=r.n(mV),yV=r(60904),fV=r(96177),hV=r.n(fV),EV=r(34319);const bV=(0,kp.Z)({dialogRoot:{minWidth:"600px",minHeight:"280px"},dialogTitle:{paddingTop:"19px"},dialogContentRoot:{paddingTop:"14px",display:"flex",flexDirection:"column"},dialogField:{marginTop:"0px",marginBottom:"24px"},dialogInput:{paddingTop:"21px",paddingBottom:"7px"},dialogFont:{fontSize:"14px"},dialogActions:{padding:"0 8px 8px 0"}});function vV(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){TV(e,t,r[t])}))}return e}function TV(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function OV(){return OV=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},OV.apply(this,arguments)}const xV=e=>{let{isOpen:t,isAvailableUpdate:r,isChangedSavedSearch:n,currentSavedSearch:a,onClose:i,onSave:o,onUpdate:l}=e;const s=bV(),[c,u]=(0,b.useState)(""),[p,d]=(0,b.useState)(K.ib.private),m=r&&a&&c===a.name,g=m&&a.isPublic===(p===K.ib.public)&&!n,y=(0,b.useCallback)((e=>{u(e.target.value)}),[]),f=(0,b.useCallback)((e=>{d(e)}),[]),h=(0,b.useCallback)((()=>m?l({share:p}):o({name:c,share:p})),[c,o,l,p,m]),E={InputProps:{classes:{input:O()(s.dialogInput,s.dialogFont)}},InputLabelProps:{classes:{root:s.dialogFont}}};return(0,b.useEffect)((()=>{if(t){const e=r?a.name:"",t=r&&a.isPublic?K.ib.public:K.ib.private;u(e),d(t)}}),[t,r,a]),v().createElement(kj(),{onClose:i,open:t,PaperProps:{classes:{root:s.dialogRoot}}},v().createElement(gV(),{classes:{root:s.dialogTitle}},mi().text("Save search")),v().createElement(EF(),{classes:{root:s.dialogContentRoot}},v().createElement(yV.H,OV({classes:{root:s.dialogField},label:mi().text("Name"),required:!0,variant:"filled",value:c,onInput:y,size:"small",autoFocus:!0},E)),v().createElement(EV.k,{entries:K.m2,TextFieldProps:vV({classes:{root:s.dialogField},required:!0,label:mi().text("Share with"),variant:"filled",size:"small"},E),value:p,onChange:f})),v().createElement(hV(),{classes:{root:s.dialogActions},disableSpacing:!0},v().createElement(nE(),{onClick:i},mi().text("Cancel")),v().createElement(nE(),{color:"primary",onClick:h,disabled:m?g:0===c.length},m?mi().text("Save"):mi().text("Save as"))))};xV.propTypes={isOpen:vp().bool,isAvailableUpdate:vp().bool,isChangedSavedSearch:vp().bool,currentSavedSearch:vp().object,onClose:vp().func.isRequired,onSave:vp().func.isRequired,onUpdate:vp().func.isRequired};const CV=(0,Tp.connect)((e=>{const t=(0,xo.LA)(e);return{isOpen:(0,ki.jd)(e),isAvailableUpdate:!(0,_.isNil)(t)&&(0,xo.Jv)(e),isChangedSavedSearch:(0,xo.WH)(e),currentSavedSearch:t}}),{onClose:()=>Oi(!1),onSave:e=>({type:ir,payload:e}),onUpdate:e=>({type:sr,payload:e})})(xV);var SV=r(11400);function wV(){return wV=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},wV.apply(this,arguments)}const AV=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",wV({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},r),v().createElement("path",{fill:"#000",fillOpacity:".54",fillRule:"evenodd",d:"M7.596 3.561A5.963 5.963 0 019 3.4c1.164 0 2.195.3 3.093.902l.99-.99a7.287 7.287 0 00-1.353-.76A6.816 6.816 0 009 2c-.74 0-1.447.107-2.12.322l.716 1.239zm-2.007-.675A6.948 6.948 0 002.551 6.27 6.816 6.816 0 002 9c0 .968.184 1.878.551 2.73a7.069 7.069 0 001.497 2.223 7.07 7.07 0 002.222 1.496 6.689 6.689 0 001.73.483v-1.828a6.272 6.272 0 00-.19.356 5.213 5.213 0 01-1.479-.534 5.44 5.44 0 01-1.251-.936 4.848 4.848 0 011.059-.367A5.106 5.106 0 017.25 12.5h.306c.1 0 .219.012.359.035L8 12.451v-1.305a6.4 6.4 0 00-2.308.147 7.568 7.568 0 00-1.487.542 4.735 4.735 0 01-.604-1.33A5.547 5.547 0 013.4 9c0-1.563.542-2.888 1.627-3.973a5.66 5.66 0 011.25-.951l-.688-1.19zm9.86 3.384c.238.552.399 1.129.483 1.73H14.52a5.305 5.305 0 00-1.365-2.781l.98-.98A7.1 7.1 0 0115.45 6.27zm-2.056 1.488c.076.076.145.157.204.242h-2.894c.06-.085.128-.166.205-.242a1.69 1.69 0 011.242-.508c.49 0 .904.17 1.242.508zM9.7 7.6c0 .137-.01.27-.03.4H9a1 1 0 00-1 1v.94c-.235.073-.485.11-.75.11a2.36 2.36 0 01-1.732-.718A2.36 2.36 0 014.8 7.6c0-.677.24-1.254.718-1.732A2.36 2.36 0 017.25 5.15c.677 0 1.254.24 1.732.717A2.36 2.36 0 019.7 7.6zm-1.706.744a1.013 1.013 0 01-.744.306c-.292 0-.54-.102-.744-.306A1.013 1.013 0 016.2 7.6c0-.292.102-.54.306-.744.204-.204.452-.306.744-.306s.54.102.744.306c.204.204.306.452.306.744s-.102.54-.306.744zM22 20.667v-8L19.333 10h-8c-.366 0-.68.13-.941.392a1.284 1.284 0 00-.392.941v9.334c0 .366.13.68.392.941.26.261.575.392.941.392h9.334c.366 0 .68-.13.941-.392.261-.26.392-.575.392-.941zm-4.583-1.25A1.929 1.929 0 0116 20a1.929 1.929 0 01-1.417-.583A1.929 1.929 0 0114 18c0-.556.194-1.028.583-1.417A1.929 1.929 0 0116 16c.556 0 1.028.194 1.417.583.389.39.583.861.583 1.417s-.194 1.028-.583 1.417zm.583-4.75h-6V12h6v2.667z",clipRule:"evenodd"}))},RV=(0,kp.Z)({button:{marginRight:"-4px"},dialogRoot:{minWidth:"600px",minHeight:"280px"},dialogContentRoot:{display:"flex",flexDirection:"column",gap:"20px"}}),_V=()=>{const e=RV(),t=(0,Tp.useStore)(),[r,n]=(0,b.useState)(!1),[a,i]=(0,b.useState)(!1),o=(0,b.useCallback)((()=>n(!1)),[]),l=(0,b.useCallback)((()=>n(!0)),[]),s=(0,b.useCallback)((async(e,r,n)=>{const a=t.getState(),l=(0,So.Z)(a),s=(0,xo.Cc)(a,!0);i(!0);try{await(0,x.createSavedSearch)([{name:e,description:r,isPublic:n,query:s,uiState:l,type:x.SavedSearchType.SEGMENTATION}]),i(!1),o()}catch(e){(0,pi.U)(e,{defaultMessage:mi().text("Something went wrong while saving of the segment")}),i(!1)}}),[t,o]);return v().createElement(v().Fragment,null,v().createElement(wd.k,{icon:AV,size:"L",onClick:l,tooltipTitle:mi().text("Save as segment"),className:e.button}),v().createElement(SV.L,{isOpen:r,isSaving:a,onClose:o,onSave:s}))};function IV(){return IV=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},IV.apply(this,arguments)}const NV=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",IV({xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},r),v().createElement("g",null,v().createElement("path",{fill:"none",d:"M0 0h24v24H0z"})),v().createElement("g",null,v().createElement("path",{fillOpacity:".54",d:"M5 20h14v-2H5v2zM19 9h-4V3H9v6H5l7 7 7-7z"})))};function DV(){return DV=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},DV.apply(this,arguments)}const PV=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",DV({width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},r),v().createElement("defs",null,v().createElement("path",{d:"M17 3H5a2 2 0 00-2 2v14a2 2 0 002 2h14c1.1 0 2-.9 2-2V7l-4-4zm-5 16c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3zm3-10H5V5h10v4z",id:"svg1966704254a"})),v().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},v().createElement("mask",{id:"svg1966704254b",fill:"#fff"},v().createElement("use",{xlinkHref:"#svg1966704254a"})),v().createElement("g",{mask:"url(#svg1966704254b)",fill:"#000",fillOpacity:".54"},v().createElement("path",{d:"M0 0h24v24H0z"}))))};function kV(){return kV=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},kV.apply(this,arguments)}const LV=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",kV({xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},r),v().createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),v().createElement("path",{fillOpacity:".54",d:"M19.35 10.04A7.49 7.49 0 0012 4C9.11 4 6.6 5.64 5.35 8.04A5.994 5.994 0 000 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z"}))};function UV(){return UV=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},UV.apply(this,arguments)}const jV=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",UV({width:"12",height:"24",viewBox:"0 0 12 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},r),v().createElement("defs",null,v().createElement("path",{d:"M6 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z",id:"svg2486556319a"})),v().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},v().createElement("mask",{id:"svg2486556319b",fill:"#fff"},v().createElement("use",{xlinkHref:"#svg2486556319a"})),v().createElement("g",{mask:"url(#svg2486556319b)",fill:"#000",fillOpacity:".54"},v().createElement("path",{d:"M0 0h12v24H0z"}))))};var FV=r(69199),MV=r.n(FV),VV=r(37290),BV=r.n(VV);const zV=e=>navigator.clipboard?navigator.clipboard.writeText(e):(e=>new Promise(((t,r)=>{const n=document.createElement("textarea");n.value=e,n.style.top="0",n.style.left="0",n.style.position="fixed",document.body.appendChild(n),n.focus(),n.select();try{document.execCommand("copy"),t()}catch(e){r(e)}document.body.removeChild(n)})))(e);function HV(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){YV(e,t,r[t])}))}return e}function YV(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const WV=(0,kp.Z)({title:{marginBottom:"-10px"},linkField:{margin:"10px 0"},linkInput:{textOverflow:"ellipsis",fontSize:"14px"}}),GV=e=>{let{open:t,onClose:r=_.identity}=e;const n=WV(),a=(e=>{let{enabled:t}=e;const[r,n]=(0,b.useState)(""),a=(0,Tp.useSelector)(So.Z),i=(0,Tp.useSelector)(ui.RO),o=(0,Tp.useSelector)(k().selectors.getServicesPath),l=(0,Tp.useSelector)(k().selectors.getUIPath);return(0,b.useEffect)((()=>{t?(0,x.rawRequest)(`${o}/searchLink`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(HV({},a,{currentTenant:i}))}).then((0,_.pipe)((0,_.prop)("link"),(0,x.getSearchLink)(l),n)).catch(gi):n("")}),[t]),r})({enabled:t});return v().createElement(kj(),{open:t,onClose:r},v().createElement(gV(),{className:n.title},mi().text("Share link with search results")),v().createElement(EF(),null,v().createElement(MV(),null,mi().text("With the URL link, anyone can view these search results. Paste this link in email or IM for testing, analyze, sharing and more.")),v().createElement(BV(),{className:n.linkField,InputProps:{classes:{input:n.linkInput}},label:a?"URL":"",placeholder:mi().text("Loading URL..."),value:a,variant:"filled",fullWidth:!0,size:"small"})),v().createElement(hV(),null,v().createElement(nE(),{onClick:r},mi().text("Cancel")),v().createElement(nE(),{disabled:!a,onClick:(0,_.pipe)((()=>zV(a)),r),color:"primary",autoFocus:!0},mi().text("Copy link"))))};GV.propTypes={open:vp().bool,onClose:vp().func};const qV=GV,ZV=(0,kp.Z)((()=>({button:{marginRight:"-4px"},exportButtonDisabled:{opacity:"0.54"}}))),$V=e=>{let{customActions:t=[]}=e;const r=ZV(),n=(0,Tp.useDispatch)(),a=(0,Tp.useSelector)(k().selectors.getUIConfig),i=(0,Tp.useSelector)(k().selectors.getCanUserMakeExport),o=(0,Tp.useSelector)(k().selectors.getCanUserOpenDataLoader),l=!!(0,x.findPerspectiveConfig)(x.ScreenType.Segmentation,a),s=!!(0,Tp.useSelector)(ui.lF),{canExport:c}=(0,Tp.useSelector)(ki.MO),u=c&&i,p=(0,b.useCallback)((()=>{n({type:U.Z.EXPORT_RESULTS})}),[n]),d=(0,b.useCallback)((()=>{n({type:U.Z.OPEN_DATA_LOADER})}),[n]),m=(0,Tp.useSelector)(ui.ai),g=(0,b.useCallback)((()=>{n(Oi(!0))}),[n]),y=[],[f]=(()=>{const e=(0,Tp.useSelector)(k().selectors.getCanUserStartProcessFromQuery),t=(0,Tp.useSelector)(k().selectors.getWorkflowPath),r=(0,Tp.useSelector)(k().selectors.getWorkflowEnvironmentUrl),n=(0,Tp.useSelector)(ki.FH),a=(0,Tp.useSelector)(k().selectors.getTenant),i=(0,Tp.useDispatch)(),o=(0,Tp.useSelector)(ui.FR),{globalFilter:l}=(0,Tp.useSelector)(k().selectors.getGlobalSearchRequestOptions),s=(0,Ba._k)(o,[],l),c=(0,b.useCallback)((()=>{const{processType:e}=n;(0,x.startProcessFromQuery)({workflowPath:t,processType:e,searchString:s,tenant:a,environment:r}).then((()=>{i(Ii({message:mi().text("Match reviews successfully submitted. Go to Inbox to view their status."),actionToDispatch:P.ui.actions.openAppFromChocolateBar("Inbox"),actionLabel:mi().text("Go to inbox"),autoHideDuration:null}))})).catch((e=>{gi(e)}))}),[n,t,s,a,r,i]),u=s.includes("matches")||s.includes("matchRules");return[e&&t&&n?{disabled:!u,text:mi().text("Request Match Review"),tooltip:mi().text("Filter on match rules or potential matches to enable Potential Match Review"),onClick:c,id:"-request-match-review"}:null]})();f&&y.push(f);const[h]=(()=>{const e={NO_ENTITY_TYPE:mi().text("Please select exactly one entity type or switch to table mode")},t=(0,Tp.useDispatch)(),r=(0,Tp.useSelector)(ki.MO),n=(0,Tp.useSelector)(k().selectors.getCanUserMakeBulkUpdate),a=!!(0,Tp.useSelector)(ui.lF),i=(0,Tp.useSelector)(ru),o=!!i,l=Boolean(null==r?void 0:r.bulkUpdate),s=(0,Tp.useSelector)(k().selectors.getMetadata),c=(0,Tp.useSelector)(ki.Xf),u=l&&n&&!a?{disabled:!o||!(e=>(0,za.wW)(s,{},c).some((t=>t.value===e)))(i),text:mi().text("Bulk update"),tooltip:o?null:e.NO_ENTITY_TYPE,onClick:()=>t(Di(!0)),id:"-bulk-update"}:null;return[u]})();h&&y.push(h);const[E,T]=(0,b.useState)(!1);return y.push({text:mi().text("Share link"),onClick:()=>T(!0),id:"-share-link"}),y.push(...t),v().createElement(v().Fragment,null,o&&v().createElement(wd.k,{icon:LV,size:"L",onClick:d,tooltipTitle:mi().text("Load data"),className:r.button,"data-reltio-id":"reltio-search-actions-menu-load-data"}),u&&v().createElement(wd.k,{icon:NV,size:"L",onClick:p,tooltipTitle:mi().text("Export"),showForDisabled:!0,classes:{disabled:r.exportButtonDisabled},className:r.button,disabled:s,"data-reltio-id":"reltio-search-actions-menu-export"}),v().createElement(wd.k,{tooltipTitle:mi().text("Save"),showForDisabled:!0,className:O()({[r.button]:y.length>0}),disabled:!m,onClick:g,icon:PV,size:"L","data-reltio-id":"reltio-search-actions-menu-save"}),l&&v().createElement(_V,null),y.length>0&&v().createElement(LN,{buttonComponent:Pp.T,buttonProps:{icon:jV,size:"L","data-reltio-id":"reltio-search-actions-menu"},menuId:"custom-actions",menuItems:y}),v().createElement(CV,null),v().createElement(qV,{open:E,onClose:()=>T(!1)}))},KV="#FF1744",XV=(0,kp.Z)({indicatorWrapper:{width:0,height:"20px",position:"relative"},indicatorTooltipArea:{width:"10px",height:"20px"},indicator:{width:"3px",height:"3px",backgroundColor:KV,border:"1px solid",borderColor:KV,borderRadius:"3px",position:"absolute",right:"-7px"},wrapper:{display:"inline-flex",position:"relative",overflow:"hidden"},for:{color:"rgba(0,0,0,0.6)",marginLeft:"8px",marginRight:"8px"},label:{color:"rgba(0,0,0,0.87)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}}),QV=()=>{const e=(0,Tp.useSelector)(xo.LA),t=(0,Tp.useSelector)(xo.WH),r=(0,b.useContext)(lV._),n=XV();if(!e)return null;const a=e.name,i=r?mi().text("Segment has changed"):mi().text("Saved search has changed");return v().createElement(v().Fragment,null,v().createElement("div",{className:n.wrapper},v().createElement(Ag(),{variant:"body2",component:"span",classes:{root:n.for}},mi().text("for")),v().createElement(gd.Y,{value:a},v().createElement(Ag(),{variant:"body2",classes:{root:n.label}},a))),t&&v().createElement(gf(),{title:i,placement:"bottom"},v().createElement("div",{className:n.indicatorWrapper,"data-reltio-id":"changed-indicator"},v().createElement("div",{className:n.indicator}),v().createElement("div",{className:n.indicatorTooltipArea}))))},JV=(0,kp.Z)({wrapper:{display:"inline-flex",position:"relative",overflow:"hidden",color:"rgba(0,0,0,0.6)"},in:{marginLeft:"8px",marginRight:"8px"},label:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",fontWeight:500}}),eB=()=>{const e=JV(),t=(0,Tp.useSelector)(k().selectors.getDataTenants),r=t&&t.length>0,n=(0,Tp.useSelector)(ui.t9),a=(0,Tp.useSelector)(k().selectors.getTenantName),i=n?n.label:a;return r&&v().createElement("div",{className:e.wrapper},v().createElement(Ag(),{variant:"body2",component:"span",classes:{root:e.in}},mi().text("in")),v().createElement(gd.Y,{value:a},v().createElement(Ag(),{variant:"body2",classes:{root:e.label}},i)))};var tB=r(81877),rB=r.n(tB);const nB=(0,kp.Z)({dialogPaper:{height:"70vh"},contentRoot:{padding:0,display:"flex",flexDirection:"column",overflow:"hidden"},tabContent:{display:"flex",flex:"1 1 auto"},tabsWrapper:{padding:"0 24px"}}),aB=(0,kp.Z)((e=>({container:{display:"flex",alignItems:"center",paddingTop:17,paddingBottom:11,paddingLeft:15,paddingRight:15},selected:{backgroundColor:(0,Lm.alpha)(e.palette.primary.main,.12)}}))),iB=(0,kp.Z)({main:{display:"flex",alignItems:"center",justifyContent:"space-between",flex:1},title:{display:"flex",alignItems:"center"},filterButton:{marginLeft:"10px",minWidth:0},deleteButton:{marginTop:"-5px"},searchBox:{flex:"1 1 auto",width:"100%",maxWidth:"323px"},flex1:{flex:1}}),oB=(0,kp.Z)({closeButton:{marginRight:"10px"}}),lB=e=>{let{onClose:t}=e;const r=oB();return v().createElement(Pp.T,{size:"L",icon:_p(),className:r.closeButton,onClick:t})};lB.propTypes={onClose:vp().func};const sB=lB,cB=e=>{let{selectedNumber:t,onDelete:r,onClose:n}=e;const a=iB();return v().createElement(v().Fragment,null,v().createElement("div",{className:O()(a.title,a.flex1)},v().createElement(sB,{onClose:n}),v().createElement(Ag(),{color:"primary"},mi().text("Selected: ${count}",{count:t}))),v().createElement(wd.k,{tooltipTitle:mi().text("Delete"),size:"L",icon:tL(),className:a.deleteButton,onClick:r}))};cB.propTypes={selectedNumber:vp().number,onClose:vp().func,onDelete:vp().func};const uB=cB,pB=(0,kp.Z)((()=>({white:{backgroundColor:"rgb(255, 255, 255)",boxShadow:"0 1px 3px 0 rgba(0,0,0,0.24)"}})));function dB(){return dB=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},dB.apply(this,arguments)}function mB(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){gB(e,t,r[t])}))}return e}function gB(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const yB=e=>{let{classes:t}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["classes"]);const n=pB({});return v().createElement(Mp,dB({classes:mB({},t,{focused:n.white})},r))};var fB=r(34480),hB=r.n(fB);const EB=(0,kp.Z)((e=>({changedFiltersIndicator:{backgroundColor:(0,Lm.alpha)(e.palette.primary.main,.12)},popupContent:{paddingTop:"19px",paddingBottom:"10px",paddingLeft:"23px",paddingRight:"23px",width:"48%",maxWidth:"480px"},title:{marginBottom:"30px"},favoriteOnlyControlRoot:{marginTop:"27px"},favoriteOnlyControlLabel:{fontSize:"0.8rem"},favoriteOnlyCheckbox:{marginRight:"20px"},buttonsGroup:{display:"flex",justifyContent:"space-between",marginTop:"35px",marginLeft:"-11px",marginRight:"-11px"},cancelButton:{marginRight:"10px"},shareWithRoot:{padding:"20px 16px 7px",fontSize:"0.85rem"},shareWithLabel:{top:"-3px",left:"4px"},shareWithMenuItem:{fontSize:"0.85rem"}}))),bB=e=>e?K.ib.public:K.ib.private,vB=e=>e===K.ib.public,TB=e=>{let{className:t,findPublic:r,favoriteOnly:n,onChangeFilters:a}=e;const i=EB(),o=(0,b.useRef)(),[l,s]=(0,b.useState)(!1),[c,u]=(0,b.useState)(r),[p,d]=(0,b.useState)(n);(0,b.useEffect)((()=>{u(r),d(n)}),[r,n]);const m=(0,b.useCallback)((()=>s((e=>!e))),[]),g=(0,b.useCallback)((e=>d(e.target.checked)),[]),y=(0,b.useCallback)((()=>{a({findPublic:c,favoriteOnly:p}),m()}),[m,a,c,p]),f=(0,b.useCallback)((()=>{u(r),d(n),m()}),[m,r,n]),h=(0,b.useCallback)((()=>{u(!0),d(!1)}),[]),E=!0===c&&!1===p;return v().createElement(v().Fragment,null,v().createElement(nE(),{ref:o,color:E?"inherit":"primary",classes:{root:t,textPrimary:i.changedFiltersIndicator},onClick:m},v().createElement(hB(),null)),v().createElement(xp(),{open:l,classes:{paper:i.popupContent},anchorEl:o.current,onClose:f,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},v().createElement(Ag(),{className:i.title,variant:"h6"},mi().text("Filter")),v().createElement(EV.k,{entries:K.m2,TextFieldProps:{InputLabelProps:{classes:{root:i.shareWithLabel}},label:mi().text("Shared with"),variant:"filled"},classes:{root:i.shareWithRoot,menuItem:i.shareWithMenuItem},fullWidth:!0,value:bB(c),onChange:(0,_.pipe)(vB,u)}),v().createElement(Nh(),{classes:{root:i.favoriteOnlyControlRoot,label:i.favoriteOnlyControlLabel},control:v().createElement(Jp(),{className:i.favoriteOnlyCheckbox,checked:p,onChange:g}),label:mi().text("Show favorites only")}),v().createElement("div",{className:i.buttonsGroup},v().createElement(nE(),{onClick:h,disabled:E},mi().text("Clear all")),v().createElement("div",null,v().createElement(nE(),{onClick:f,className:i.cancelButton},mi().text("Cancel")),v().createElement(nE(),{onClick:y,color:"primary"},mi().text("Apply"))))))};TB.propTypes={className:vp().string,findPublic:vp().bool,favoriteOnly:vp().bool,onChangeFilters:vp().func,onChangeFavoriteOnly:vp().func};const OB=(0,Tp.connect)((e=>({findPublic:(0,xo.kU)(e),favoriteOnly:(0,xo.VS)(e)})),{onChangeFilters:e=>{let{findPublic:t,favoriteOnly:r}=e;return{type:yr,payload:{findPublic:t,favoriteOnly:r}}}})(TB),xB=e=>{let{type:t,onSearch:r,placeholder:n,onClose:a}=e;const i=iB();return v().createElement(v().Fragment,null,v().createElement("div",{className:i.main},v().createElement("div",{className:i.title},v().createElement(sB,{onClose:a}),v().createElement(Ag(),{variant:"h6"},mi().text("Saved & recent searches"))),v().createElement("div",{className:i.searchBox},v().createElement(yB,{fullWidth:!0,onSearch:r,placeholder:n}))),t===K.uJ.saved&&v().createElement(OB,{className:i.filterButton}))};xB.propTypes={type:vp().oneOf(Object.values(K.uJ)),onClose:vp().func,onSearch:vp().func,placeholder:vp().string};const CB=xB,SB=e=>{let{type:t,selectedNumber:r,onClose:n,dispatch:a}=e;const i=aB(),o=(0,b.useCallback)((()=>{const e=t===K.uJ.saved?{type:Ar}:{type:Hr};a(e)}),[t,a]),l=(0,b.useCallback)((0,x.debounce)((e=>{const r=t===K.uJ.saved?{type:Nr,payload:e}:{type:qr,payload:e};a(r)}),500),[t,a]),s=(0,_.cond)([[(0,_.equals)(K.uJ.saved),(0,_.always)(mi().text("Search name"))],[(0,_.equals)(K.uJ.recent),(0,_.always)(mi().text("Search for filtered entity types and attributes"))]])(t);return v().createElement(gV(),{className:O()(i.container,{[i.selected]:r})},r?v().createElement(uB,{selectedNumber:r,onDelete:o,onClose:n}):v().createElement(CB,{type:t,onSearch:l,onClose:n,placeholder:s}))};SB.propTypes={type:vp().oneOf(Object.values(K.uJ)).isRequired,selectedNumber:vp().number,onClose:vp().func,dispatch:vp().func};const wB=(0,Tp.connect)(((e,t)=>({selectedNumber:t.type===K.uJ.saved?(0,xo.g2)(e):js(e)})))(SB),AB="0.75rem",RB=(0,kp.Z)({tableWrapper:{display:"flex",flexDirection:"column",width:"100%",position:"relative","& $cellBorder":{borderLeft:"none",borderRight:"none"}},cellBorder:{},paginationRoot:{flexShrink:0,boxShadow:"none",borderTop:"1px solid rgba(0, 0, 0, 0.1)",fontSize:AB},paginationCaption:{fontSize:AB}});var _B=r(54622);const IB=vp().shape({field:vp().string,order:vp().oneOf(["asc","desc"])}),NB=vp().shape({label:vp().string,name:vp().string,description:vp().string,type:vp().string,hidden:vp().bool,faceted:vp().bool,searchable:vp().bool,uri:vp().string,access:vp().arrayOf(vp().string),cardinality:vp().shape({minValue:vp().number,maxValue:vp().number})}),DB=vp().shape({title:vp().string,pathToTitle:vp().arrayOf(vp().string),fieldName:vp().string,entityTypeUri:vp().string,attrType:NB,uri:vp().string,groupName:vp().string}),PB=vp().shape({id:vp().oneOfType([vp().number,vp().string]),values:vp().array,data:DB,filter:vp().string,operator:vp().string}),kB="0.8rem",LB=(0,kp.Z)((e=>{const t=(0,Lm.lighten)(e.palette.primary.main,.88),r=(0,Lm.alpha)(t,0),n=(0,Lm.lighten)(e.palette.primary.main,.82),a={content:'""',position:"absolute",top:0,right:0,width:"40px",height:"100%",background:"linear-gradient(to right, rgba(255, 255, 255, 0.2), #fff 100%)",pointerEvents:"none","div.hoveredRow &":{background:"linear-gradient(to right, rgba(238, 238, 238, 0), rgba(238, 238, 238, 1) 100%)"},"$checkedRowCell &":{background:`linear-gradient(to right, ${r}, ${t} 100%)`},"div.hoveredRow $checkedRowCell &":{background:`linear-gradient(to right, ${(0,Lm.alpha)(n,0)}, ${n} 100%)`}};return{defaultWrapper:{whiteSpace:"nowrap",overflow:"hidden",padding:"0 22px",fontSize:kB,display:"flex",alignItems:"center",height:"100%","&:after":a},numberWrapper:{whiteSpace:"nowrap",overflow:"hidden",padding:"0 24px 0 22px",fontSize:kB,justifyContent:"flex-end",display:"flex",alignItems:"center",height:"100%"},nameWithStar:{display:"flex",alignItems:"center",height:"100%",paddingLeft:"6px","& $editNameButton":{display:"none"},"div.hoveredRow & $editNameButton":{display:"flex"}},leftButtonWrapper:{},deleteButton:{visibility:"hidden",marginRight:"2px"},totalWithButtonsWrapper:{justifyContent:"flex-end",display:"flex",alignItems:"center",height:"100%","& $numberWrapper":{paddingRight:"8px"},"div.hoveredRow & $deleteButton":{visibility:"visible"}},nameTextEditorRoot:{margin:0},nameInput:{fontSize:kB,"&::-ms-clear":{display:"none"}},nameContainer:{flex:1,overflow:"hidden"},editing:{},editNameButton:{},searchName:{cursor:"pointer",lineHeight:"29px",position:"relative",whiteSpace:"nowrap",overflow:"hidden",fontSize:kB,"&:after":a},clickableArea:{cursor:"pointer"},starButton:{marginLeft:"-7px",marginRight:"3px",visibility:"hidden","div.hoveredRow &$enabledButton":{visibility:"visible"}},checkedStarButton:{visibility:"visible",color:"#F5A623 !important"},filterButton:{"$editing &":{marginRight:"2px"},marginLeft:"-7px",marginRight:"10px",visibility:"hidden","div.hoveredRow &$enabledButton":{visibility:"visible"},"& svg":{fill:"rgba(0,0,0,0.56)"}},checkedFilterButton:{visibility:"visible","& svg":{fill:e.palette.primary.main}},enabledButton:{},headCell:{display:"flex",alignItems:"center",height:"100%",fontSize:"0.75rem",borderBottom:"1px solid rgba(0,0,0,.1)",color:"rgba(0,0,0,0.6)",fontWeight:500,"&>div":{padding:"0 4px 0 22px"},"& $headLabel":{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}},totalHeadCell:{justifyContent:"flex-end",marginRight:"45px"},nameHeadCell:{paddingLeft:"39px"},headLabel:{},checkbox:{paddingLeft:"11px"},sharingWrapper:{paddingLeft:"22px",display:"flex",alignItems:"center",height:"100%"},sharingRoot:{flexShrink:1,maxWidth:"100%"},sharingInput:{fontSize:kB},sharingMenuItem:{fontSize:kB,minWidth:"100px"},sharingDisabled:{color:"rgba(0,0,0,0.89)",paddingRight:"0 !important"},sharingIconDisabled:{display:"none"},rowCell:{height:"100%"},checkedRowCell:{backgroundColor:t,"div.hoveredRow &":{backgroundColor:n}},invisibleOnHoverCommon:{height:"100%","&$invisibleOnHover":{pointerEvents:"none","div.hoveredRow &":{color:"transparent"}}},invisibleOnHover:{},tooltip:e.tooltip,tooltipSection:{marginBottom:"5px"},tooltipSectionHeader:{margin:"5px 0",fontSize:"11px",fontWeight:500},tooltipText:{opacity:.7,fontSize:"10px"}}})),UB=e=>{let{mode:t}=e;const r=LB(),n=(0,Tp.useDispatch)(),a=t===K.uJ.saved?xo.tc:Fs,i=(0,Tp.useSelector)(a),o=t===K.uJ.saved?xo.hY:Ms,l=(0,Tp.useSelector)(o),s=(0,b.useCallback)((()=>{t===K.uJ.saved?n(l?bo():{type:hr}):n(l?Ss():{type:Br})}),[n,l,t]);return v().createElement("div",{className:O()(r.headCell,r.checkbox)},v().createElement(Jp(),{indeterminate:!i&&l,checked:i,onChange:s}))};UB.propTypes={mode:vp().string};const jB=(0,Bd.q)((0,_.pick)(["mode"]))(UB),FB=e=>{const t=t=>{const r=LB(),{rowValue:{checked:n}}=t;return v().createElement("div",{className:O()(r.rowCell,{[r.checkedRowCell]:n})},v().createElement(e,t))};return t.propTypes={rowValue:vp().shape({checked:vp().bool})},t},MB=(0,yd.T)(Jp()),VB=e=>{let{value:t=!1,rowValue:{uri:r,isOwnSearch:n},onClick:a}=e;const i=LB(),o=!n;return v().createElement("div",{className:O()(i.headCell,i.checkbox)},v().createElement(MB,{showForDisabled:!0,tooltipTitle:o&&mi().text("Cannot edit because you're not the owner"),tooltipPlacement:"bottom-start",disabled:o,checked:t,onChange:e=>a(r,e.target.checked)}))};VB.propTypes={value:vp().bool,rowValue:vp().shape({uri:vp().string,isOwnSearch:vp().bool}),onClick:vp().func};const BB=(0,Bd.q)((e=>{let{onSelectItem:t}=e;return{onClick:t}}))(FB(VB));var zB=r(92332);function HB(){return HB=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},HB.apply(this,arguments)}function YB(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){WB(e,t,r[t])}))}return e}function WB(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const GB=e=>{let{className:t}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className"]);const n=LB(),{headCellData:a}=r;return v().createElement("div",{className:O()(n.headCell,t)},v().createElement(zB.default,HB({},r,{headCellData:YB({},a,{label:v().createElement(gd.Y,{value:a.label},v().createElement("div",{className:n.headLabel},a.label))})})))};GB.propTypes={className:vp().string,headCellData:vp().shape({id:vp().string,label:vp().oneOfType([vp().string,vp().node]),sortable:vp().bool,resizable:vp().bool,className:vp().string,initialWidth:vp().number,minWidth:vp().number,autoResize:vp().bool,renderer:vp().func})};const qB=GB;function ZB(){return ZB=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ZB.apply(this,arguments)}const $B=e=>{const t=LB();return v().createElement(qB,ZB({className:t.nameHeadCell},e))};$B.propTypes={headCellData:vp().shape({id:vp().string,label:vp().oneOfType([vp().string,vp().node]),sortable:vp().bool,resizable:vp().bool,className:vp().string,initialWidth:vp().number,minWidth:vp().number,autoResize:vp().bool,renderer:vp().func})};const KB=$B;var XB=r(18122),QB=r.n(XB),JB=r(62839),ez=r.n(JB);function tz(){return tz=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},tz.apply(this,arguments)}const rz=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",tz({xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},r),v().createElement("g",null,v().createElement("path",{d:"M0 0h24m0 24H0",fill:"none"}),v().createElement("path",{d:"M4.25 5.61C6.27 8.2 10 13 10 13v6c0 .55.45 1 1 1h2c.55 0 1-.45 1-1v-6s3.72-4.8 5.74-7.39A.998.998 0 0018.95 4H5.04c-.83 0-1.3.95-.79 1.61z"}),v().createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"})))};function nz(){return nz=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},nz.apply(this,arguments)}const az=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",nz({xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},r),v().createElement("g",null,v().createElement("path",{d:"M0 0h24m0 24H0",fill:"none"}),v().createElement("path",{d:"M7 6h10l-5.01 6.3L7 6zm-2.75-.39C6.27 8.2 10 13 10 13v6c0 .55.45 1 1 1h2c.55 0 1-.45 1-1v-6s3.72-4.8 5.74-7.39A.998.998 0 0018.95 4H5.04c-.83 0-1.3.95-.79 1.61z"}),v().createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"})))};var iz=r(74492),oz=r.n(iz),lz=r(72246),sz=r.n(lz);const cz=e=>{let{value:t,rowValue:{uri:r,isFavorite:n,isOwnSearch:a,isEditing:i,isGlobalFilter:o},onStarClick:l,onGlobalClick:s,onApply:c,onChangeName:u,onSetEditing:p}=e;const d=LB(),m=a&&!i,[g,y]=(0,b.useState)(t);(0,b.useEffect)((()=>{y(t)}),[t]);const f=(0,b.useCallback)((()=>{u(r,g)}),[r,g,u]),h=(0,b.useCallback)((()=>l(r,!n)),[l,r,n]),E=(0,b.useCallback)((()=>s(r,!o)),[s,r,o]),T=(0,b.useCallback)((()=>p(r,!0)),[p,r]),x=(0,b.useCallback)((()=>c(r)),[c,r]),C=(0,_.cond)([[(0,_.always)(a),(0,_.always)(mi().text("Mark as favorite"))],[(0,_.always)(n),(0,_.always)(mi().text("Cannot ummark because you're not the owner"))],[_.T,(0,_.always)("")]])();return v().createElement("div",{className:O()(d.nameWithStar,{[d.editing]:i})},v().createElement(wd.k,{showForDisabled:!0,tooltipTitle:C,tooltipPlacement:a?"bottom":"bottom-start",disabled:!a,className:O()(d.starButton,{[d.checkedStarButton]:n},{[d.enabledButton]:a}),size:"M",icon:n?QB():ez(),onClick:h}),v().createElement(wd.k,{tooltipTitle:o?mi().text("Remove Global filter"):mi().text("Set as Global filter"),className:O()(d.filterButton,d.enabledButton,{[d.checkedFilterButton]:o}),size:"M",icon:o?rz:az,onClick:E}),v().createElement("div",{className:d.nameContainer},i?v().createElement(sz(),{onClickAway:f},v().createElement("div",null,v().createElement(yV.H,{variant:"filled",hiddenLabel:!0,size:"small",fullWidth:!0,autoFocus:!0,classes:{root:d.nameTextEditorRoot},InputProps:{classes:{input:d.nameInput}},value:g,onInput:e=>y(e.target.value),onKeyDown:(0,_.when)((0,_.propEq)("keyCode",13),f)}))):v().createElement(gd.Y,{value:t},v().createElement("div",{className:d.searchName,onClick:x},t))),m&&v().createElement(wd.k,{tooltipTitle:mi().text("Edit"),className:d.editNameButton,size:"M",icon:oz(),onClick:T}))};cz.propTypes={value:vp().string,rowValue:vp().shape({uri:vp().string,isFavorite:vp().bool,isOwnSearch:vp().bool,isEditing:vp().bool,isGlobalFilter:vp().bool}),onStarClick:vp().func,onGlobalClick:vp().func,onApply:vp().func,onChangeName:vp().func,onSetEditing:vp().func};const uz=(0,Bd.q)((e=>{let{onChangeIsFavorite:t,onChangeIsGlobal:r,onSearchApply:n,onSetItemEditing:a,onChangeItemName:i}=e;return{onStarClick:t,onGlobalClick:r,onApply:n,onSetEditing:a,onChangeName:i}}))(FB(cz)),pz=e=>{let{value:t,rowValue:{uri:r,isOwnSearch:n},onChange:a}=e;const i=LB(),o=(0,b.useCallback)((e=>{const n=vB(e);n!==t&&a(r,n)}),[r,t,a]);return v().createElement("div",{className:i.sharingWrapper},v().createElement(EV.k,{entries:K.m2,value:bB(t),onChange:o,disableUnderline:!0,disabled:!n,MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},elevation:3},TextFieldProps:{classes:{root:i.sharingRoot}},classes:{root:i.sharingInput,menuItem:i.sharingMenuItem,disabled:i.sharingDisabled,icon:O()({[i.sharingIconDisabled]:!n})}}))};pz.propTypes={value:vp().bool,rowValue:vp().shape({uri:vp().string,isOwnSearch:vp().bool}),onChange:vp().func};const dz=(0,Bd.q)((e=>{let{onChangeIsPublic:t}=e;return{onChange:t}}))(FB(pz)),mz=e=>{let{value:t,rowValue:r,onClick:n}=e;const a=LB(),i=n?()=>n(r):()=>{};return v().createElement(gd.Y,{value:t},v().createElement("div",{className:O()(a.defaultWrapper,{[a.clickableArea]:n}),onClick:i},t))};mz.propTypes={value:vp().any,rowValue:vp().object,onClick:vp().func};const gz=FB(mz);function yz(){return yz=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},yz.apply(this,arguments)}const fz=e=>{const{rowValue:{updateDate:t,createDate:r}}=e,n=t||r;return v().createElement(gz,yz({},e,{value:n&&mi().date(n,"L")}))};fz.propTypes={rowValue:vp().shape({updateDate:vp().number,createDate:vp().number})};const hz=fz,Ez=e=>{let{values:t}=e;return(0,_.pipe)((0,_.cond)([[_.isNil,_.T],[Array.isArray,(0,_.pipe)(_.flatten,_.isEmpty)],[_.T,_.isEmpty]]),_.not)(t)},bz=(0,_.curry)(((e,t)=>(0,_.path)(["facetsData",t.fieldName,"values","length"],e)>0)),vz=e=>e&&e.slice(1).join(" / "),Tz=(e,t,r)=>(e[t]||(e[t]={title:t,attributes:[]}),e[t].attributes=(0,_.uniq)(e[t].attributes.concat(r)),e),Oz=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.flatMap((e=>e.attributes)).filter(Ez).reduce(((e,t)=>{let{data:{title:r,groupName:n,pathToTitle:a}}=t;const i=vz(a)||r;return Tz(e,n,i)}),{})},xz=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(e.facetsConfigs||[]).filter((0,_.pipe)(x.isTypeFacet,_.not)).filter(bz(e)).reduce(((e,t)=>{const r=(0,_.path)(["pathToTitle",0],t)||mi().text("Special"),n=vz(t.pathToTitle)||t.title;return Tz(e,r,n)}),{})},Cz=e=>{let{rowValue:{uiState:t}}=e;const r=LB(),n=(0,b.useMemo)((()=>function(){let{facets:e,advanced:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{const r=t?Oz(t):xz(e);return Object.values(r)}catch(e){return[]}}(t)),[t]),a=(0,b.useMemo)((()=>(e=>e.flatMap((e=>e.attributes)).length)(n)),[n]),i=!!n.length&&v().createElement("div",null,n.map((e=>{let{title:t,attributes:n}=e;return v().createElement("div",{key:t,className:r.tooltipSection},v().createElement("h6",{className:r.tooltipSectionHeader},t),n.map((e=>v().createElement("div",{key:e,className:r.tooltipText},e))))})));return v().createElement("div",{className:r.numberWrapper},(o=a,i?v().createElement(gf(),{title:i,classes:{tooltip:r.tooltip},disableFocusListener:!0,disableTouchListener:!0},v().createElement("span",null,o)):o));var o};Cz.propTypes={rowValue:vp().shape({uiState:vp().shape({facets:vp().object,advanced:vp().array})})};const Sz=FB(Cz);function wz(){return wz=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},wz.apply(this,arguments)}const Az=e=>{const t=LB();return v().createElement(qB,wz({className:t.totalHeadCell},e))};Az.propTypes={headCellData:vp().shape({id:vp().string,label:vp().oneOfType([vp().string,vp().node]),sortable:vp().bool,resizable:vp().bool,className:vp().string,initialWidth:vp().number,minWidth:vp().number,autoResize:vp().bool,renderer:vp().func})};const Rz=Az;var _z=r(67520),Iz=r.n(_z);const Nz=e=>{let{value:t}=e;const r=LB();return v().createElement(gd.Y,{value:t},v().createElement("div",{className:r.numberWrapper},mi().number(t)))};Nz.propTypes={value:vp().number};const Dz=FB(Nz),Pz=e=>{const t=LB(),{rowValue:{isTotalLoading:r,isOwnSearch:n,uri:a},onDeleteItem:i,onLoadTotalForItem:o,value:l}=e,s=(0,b.useCallback)((()=>{i(a)}),[i,a]),c=n?mi().text("Delete"):mi().text("Cannot delete because you're not the owner"),u=r?mi().text("Loading data"):mi().text("Load data"),p=(0,b.useCallback)((()=>{o(a)}),[o,a]),d=r||-1===l;return v().createElement("div",{className:t.totalWithButtonsWrapper},d?v().createElement(wd.k,{showForDisabled:!0,tooltipTitle:u,tooltipPlacement:"bottom-end",disabled:r,size:"L",icon:Iz(),onClick:p}):v().createElement(Dz,e),v().createElement(wd.k,{showForDisabled:!0,className:t.deleteButton,tooltipTitle:c,tooltipPlacement:"bottom-end",disabled:!n,size:"L",icon:tL(),onClick:s}))};Pz.propTypes={value:vp().number,rowIndex:vp().number,rowValue:vp().shape({isOwnSearch:vp().bool,isTotalLoading:vp().bool,uri:vp().string}),onDeleteItem:vp().func,onLoadTotalForItem:vp().func};const kz=(0,Bd.q)((e=>{let{onDeleteItem:t,onLoadTotalForItem:r}=e;return{onDeleteItem:t,onLoadTotalForItem:r}}))(FB(Pz));function Lz(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Uz={rowCellValueRenderer:gz,headCellRenderer:qB,autoResize:!1},jz=[{id:"checked",label:"",initialWidth:55,headCellRenderer:jB,rowCellValueRenderer:BB},{id:"name",get label(){return mi().text("Name")},autoResize:!0,headCellRenderer:KB,rowCellValueRenderer:uz,sortable:!0},{id:"isPublic",get label(){return mi().text("Shared with")},rowCellValueRenderer:dz},{id:"owner",get label(){return mi().text("Created by")},initialWidth:260},{id:"updateDate",get label(){return mi().text("Last modified")},rowCellValueRenderer:hz,sortable:!0},{id:"attributes",get label(){return mi().text("Filtered attributes")},rowCellValueRenderer:Sz},{id:"total",get label(){return mi().text("Number of profiles")},headCellRenderer:Rz,rowCellValueRenderer:kz,initialWidth:194}].map((e=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Lz(e,t,r[t])}))}return e}({},Uz,e)));function Fz(){return Fz=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Fz.apply(this,arguments)}function Mz(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Vz=e=>{let{items:t,total:r,sorting:n,page:a,rowsPerPage:i,loading:o,searchValue:l,globalFilterSavedSearchesUris:s=[],onSearchApply:c,onChangeIsFavorite:u,onChangeIsPublic:p,onChangeIsGlobal:d,onChangeRowsPerPage:m,onChangePage:g,onSelectItem:y,onDeselectAllItems:f,onDeleteItem:h,onChangeItemName:E,onSetItemEditing:T,onLoadTotalForItem:O,onSort:C}=e;const S=RB(),w=(0,b.useMemo)((()=>({cellBorder:S.cellBorder})),[S]),[A,R]=(0,b.useState)(null),[_,I]=(0,b.useState)(null),N=(0,b.useRef)(null);(0,b.useEffect)((()=>f),[f]);const D=(0,b.useCallback)((e=>{s.includes(e)?I(e):h(e)}),[s,h]),P=(0,b.useMemo)((()=>({mode:K.uJ.saved,onSelectItem:y,onChangeIsFavorite:u,onChangeIsGlobal:d,onSearchApply:c,onSetItemEditing:T,onChangeItemName:E,onDeleteItem:D,onLoadTotalForItem:O,onChangeIsPublic:p})),[D,y,u,d,O,c,T,E,p]),k=(0,b.useMemo)((()=>(0,x.isEmptyValue)(l)?{LogoRenderer:PE.SELECT_ATTRIBUTES,text:mi().text("No saved searches."),secondaryText:mi().text("Save time by creating saved searches for queries you regularly search for.")}:{LogoRenderer:PE.SEARCH_RESULTS,text:mi().text("No results found."),secondaryText:mi().text("Try adjusting your search or filter to find what you're looking for.")}),[l]),L=(0,b.useMemo)((()=>t.map((e=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Mz(e,t,r[t])}))}return e}({},e,{isGlobalFilter:s.includes(e.uri)})))),[t,s]);return v().createElement("div",{className:S.tableWrapper},r>0?v().createElement(v().Fragment,null,v().createElement(Ud.M,{columnsData:jz,rowsData:L,context:P,sorting:n,getRowCellHeight:null,defaultColumnWidth:140,defaultColumnMinWidth:140,defaultRowHeight:48,headRowHeight:47,hoverStateEnabled:!0,onSort:C,hoverRowIndex:A,onRowHover:R,classes:w,ref:N}),v().createElement(SE.Z,{classes:{root:S.paginationRoot,caption:S.paginationCaption},count:r,rowsPerPageOptions:K.Tu,rowsPerPage:i,onChangeRowsPerPage:m,page:a,onChangePage:g,basicTableRef:N}),v().createElement(_B.U,{open:!!_,title:mi().text("Keep the global filter?"),content:mi().text("The saved search you are deleting is being used as a global filter in your tenant. Do you want to keep the global filter?"),discardCaption:mi().text("NO, remove it"),saveCaption:mi().text("YES, KEEP GLOBAL FILTER"),onCancel:()=>I(null),onDiscard:()=>{d(_,!1),h(_),I(null)},onSave:()=>{h(_),I(null)}})):v().createElement(kE,Fz({},k,{variant:DE.embedded})),o&&v().createElement(LE.z,null))};Vz.propTypes={items:vp().arrayOf(vp().shape({uri:vp().string,name:vp().string,isPublic:vp().bool,isFavorite:vp().bool,isOwnSearch:vp().bool,isEditing:vp().bool,checked:vp().bool,owner:vp().string,updateDate:vp().number,query:vp().string})),total:vp().number,sorting:IB,page:vp().number,rowsPerPage:vp().number,loading:vp().bool,searchValue:vp().string,globalFilterSavedSearchesUris:vp().arrayOf(vp().string),onSearchApply:vp().func,onChangeIsFavorite:vp().func,onChangeIsPublic:vp().func,onChangeIsGlobal:vp().func,onChangeRowsPerPage:vp().func,onChangePage:vp().func,onSelectItem:vp().func,onDeselectAllItems:vp().func,onDeleteItem:vp().func,onChangeItemName:vp().func,onSetItemEditing:vp().func,onSort:vp().func};const Bz=(0,Tp.connect)((e=>({items:(0,xo.gg)(e),total:(0,xo.Yi)(e),sorting:(0,xo.rT)(e),page:(0,xo.wH)(e),rowsPerPage:(0,xo.s6)(e),loading:(0,xo.w7)(e),searchValue:(0,xo.U3)(e),globalFilterSavedSearchesUris:k().selectors.getGlobalFilterSavedSearchesUris(e)})),{onSearchApply:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:K.XU;return{type:Dr,payload:{uri:e,debounceTime:t}}},onChangeIsFavorite:(e,t)=>({type:Tr,payload:{uri:e,isFavorite:t}}),onChangeIsPublic:(e,t)=>({type:br,payload:{uri:e,isPublic:t}}),onChangeIsGlobal:(e,t)=>({type:xr,payload:{uri:e,isGlobalFilter:t}}),onChangeRowsPerPage:e=>({type:gr,payload:e}),onChangePage:e=>({type:mr,payload:e}),onSelectItem:(e,t)=>({type:fr,payload:{uri:e,checked:t}}),onDeselectAllItems:bo,onDeleteItem:e=>({type:Rr,payload:e}),onChangeItemName:(e,t)=>({type:Cr,payload:{uri:e,name:t}}),onSetItemEditing:(e,t)=>({type:wr,payload:{uri:e,isEditing:t}}),onLoadTotalForItem:e=>({type:kr,payload:e}),onSort:e=>({type:Lr,payload:e})})(Vz),zz=e=>{let{value:t=!1,rowValue:{createdDate:r},onClick:n}=e;const a=LB();return v().createElement("div",{className:O()(a.headCell,a.checkbox)},v().createElement(Jp(),{checked:t,onChange:e=>n(r,e.target.checked)}))};zz.propTypes={value:vp().bool,rowValue:vp().shape({createdDate:vp().number}),onClick:vp().func};const Hz=(0,Bd.q)((e=>{let{onSelectItem:t}=e;return{onClick:t}}))(FB(zz));function Yz(){return Yz=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Yz.apply(this,arguments)}const Wz=e=>{const{rowValue:{createdDate:t}}=e,r=t;return v().createElement(gz,Yz({},e,{value:r&&mi().date(r,"L LT")}))};Wz.propTypes={rowValue:vp().shape({createdDate:vp().number}),onClick:vp().func};const Gz=(0,Bd.q)((e=>{let{onSearchApply:t}=e;return{onClick:t}}))(Wz),qz=e=>{const t=LB(),{rowValue:r,onDeleteItem:n,onLoadTotalForItem:a,value:i}=e,{isTotalLoading:o,createdDate:l}=r,s=(0,b.useCallback)((()=>{n(r)}),[n,r]),c=o?mi().text("Loading data"):mi().text("Load data"),u=(0,b.useCallback)((()=>{a(l)}),[a,l]),p=o||-1===i;return v().createElement("div",{className:t.totalWithButtonsWrapper},p?v().createElement(wd.k,{showForDisabled:!0,tooltipTitle:c,tooltipPlacement:"bottom-end",disabled:o,size:"L",icon:Iz(),onClick:u}):v().createElement(Dz,e),v().createElement(wd.k,{className:t.deleteButton,tooltipTitle:mi().text("Delete"),tooltipPlacement:"bottom-end",size:"L",icon:tL(),onClick:s}))};qz.propTypes={value:vp().number,rowValue:vp().shape({isTotalLoading:vp().bool,createdDate:vp().number}),onDeleteItem:vp().func,onLoadTotalForItem:vp().func};const Zz=(0,Bd.q)((e=>{let{onDeleteItem:t,onLoadTotalForItem:r}=e;return{onDeleteItem:t,onLoadTotalForItem:r}}))(FB(qz)),$z=(0,Bd.q)((e=>{let{onSearchApply:t}=e;return{onClick:t}}))(gz);function Kz(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Xz={rowCellValueRenderer:gz,headCellRenderer:qB,autoResize:!1},Qz=[{id:"checked",label:"",initialWidth:55,headCellRenderer:jB,rowCellValueRenderer:Hz},{id:"createdDate",get label(){return mi().text("Created")},rowCellValueRenderer:Gz,initialWidth:256},{id:"name",get label(){return mi().text("Query")},autoResize:!0,rowCellValueRenderer:$z,minWidth:150},{id:"total",get label(){return mi().text("Record count")},rowCellValueRenderer:Zz,headCellRenderer:Rz,initialWidth:150}].map((e=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Kz(e,t,r[t])}))}return e}({},Xz,e)));function Jz(){return Jz=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Jz.apply(this,arguments)}const eH=e=>{let{items:t,loading:r,filterWord:n,onSelectItem:a,onDeselectAllItems:i,onSearchApply:o,onDeleteItem:l,onLoadTotalForItem:s}=e;const c=RB(),u=(0,b.useMemo)((()=>({cellBorder:c.cellBorder})),[c]),[p,d]=(0,b.useState)(null);(0,b.useEffect)((()=>i),[i]);const m=(0,b.useMemo)((()=>({mode:K.uJ.recent,onSelectItem:a,onSearchApply:o,onDeleteItem:l,onLoadTotalForItem:s})),[l,s,a,o]),g=(0,b.useMemo)((()=>(0,x.isEmptyValue)(n)?{LogoRenderer:PE.SELECT_ATTRIBUTES,text:mi().text("No recent searches."),secondaryText:mi().text("Your recent search history will appear here.")}:{LogoRenderer:PE.SEARCH_RESULTS,text:mi().text("No results found."),secondaryText:mi().text("Try adjusting your search or filter to find what you're looking for.")}),[n]);return v().createElement("div",{className:c.tableWrapper},t.length>0?v().createElement(Ud.M,{columnsData:Qz,rowsData:t,context:m,getRowCellHeight:null,defaultColumnWidth:50,defaultColumnMinWidth:50,defaultRowHeight:48,headRowHeight:47,hoverStateEnabled:!0,hoverRowIndex:p,onRowHover:d,classes:u}):v().createElement(kE,Jz({},g,{variant:DE.embedded})),r&&v().createElement(LE.z,null))};eH.propTypes={items:vp().arrayOf(vp().shape({uri:vp().string,name:vp().string,isPublic:vp().bool,isFavorite:vp().bool,isOwnSearch:vp().bool,checked:vp().bool,owner:vp().string,createdDate:vp().number,query:vp().string})),loading:vp().bool,filterWord:vp().string,onSelectItem:vp().func,onSearchApply:vp().func,onDeselectAllItems:vp().func,onDeleteItem:vp().func};const tH=(0,Tp.connect)((e=>({items:Ls(e),loading:Us(e),filterWord:Ps(e)})),{onSearchApply:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:K.XU;return{type:Xr,payload:{search:e,debounceTime:t}}},onSelectItem:(e,t)=>({type:Vr,payload:{searchCreatedDate:e,checked:t}}),onDeselectAllItems:Ss,onDeleteItem:e=>({type:Wr,payload:e}),onLoadTotalForItem:e=>({type:Kr,payload:e})})(eH),rH=e=>{let{open:t,onClose:r}=e;const n=nB(),a=(0,Tp.useDispatch)(),i=(0,b.useMemo)((()=>[{value:K.uJ.saved,label:mi().text("Saved searches"),content:v().createElement(Bz,null),dataReltioId:"reltio-search-saved-searches"},{value:K.uJ.recent,label:mi().text("Recent searches"),content:v().createElement(tH,null),dataReltioId:"reltio-search-recent-searches"}]),[]),[o,l]=(0,b.useState)(i[0].value);return(0,b.useEffect)((()=>{t&&(o===K.uJ.saved?a({type:cr}):a({type:jr}))}),[t,a,o]),v().createElement(kj(),{classes:{paper:n.dialogPaper},fullWidth:!0,maxWidth:"lg",open:t,onClose:r},v().createElement(wB,{type:o,onClose:r}),v().createElement(EF(),{classes:{root:n.contentRoot}},v().createElement("div",{className:n.tabsWrapper},v().createElement(LI,{value:o,tabs:i,onChange:l,scrollButtons:"auto"})),v().createElement("div",{className:n.tabContent},i.find((0,_.propEq)("value",o)).content)))};rH.propTypes={open:vp().bool,onClose:vp().func};const nH=rH,aH=(0,kp.Z)((()=>({button:{display:"flex",alignItems:"center",whiteSpace:"nowrap",borderColor:"rgba(0, 0, 0, 0.12)"},buttonText:{letterSpacing:0},compact:{paddingTop:"2px",paddingBottom:"2px",marginRight:"-8px",marginLeft:"4px"}}))),iH=e=>{let{showTypography:t}=e;const r=aH(),n=(0,Tp.useDispatch)(),a=(0,Tp.useSelector)(ki.tm),i=mi().text("Saved & recent searches"),o=(0,b.useCallback)((()=>n(Ti(!0))),[n]),l=(0,b.useCallback)((()=>n(Ti(!1))),[n]);return v().createElement(v().Fragment,null,v().createElement(gf(),{title:t?"":i},v().createElement(nE(),{className:r.button,variant:"outlined",startIcon:v().createElement(rB(),{className:O()({[r.compact]:!t}),color:"action"}),onClick:o,"data-reltio-id":"reltio-search-saved-and-recent-search"},t&&v().createElement(Ag(),{variant:"button",color:"textPrimary",className:r.buttonText},i))),v().createElement(nH,{open:a,onClose:l}))},oH=(0,kp.Z)((()=>({container:{display:"flex",flexDirection:"column",position:"relative",paddingLeft:"16px",paddingRight:"20px"},header:{height:"63px",display:"flex",alignItems:"center"},captionWrapper:{marginTop:"-2px",paddingLeft:"8px",flexShrink:0},profileText:{paddingLeft:"8px",color:"rgba(0,0,0,0.6)"},profileNumber:{fontWeight:600},facetsBar:{display:"flex",alignItems:"center",flexGrow:1,marginBottom:"12px",marginTop:"-8px"},showBar:{display:"flex",overflow:"hidden"},clearButton:{marginRight:"auto",marginLeft:"14px"},splitter:{marginRight:"15px",marginLeft:"1px",height:"32px"},searchBarControls:{display:"flex",alignItems:"center",width:"100%",justifyContent:"flex-end"}}))),lH="search",sH="geoLocation",cH={},uH=()=>{const e=oH(),t=(0,Tp.useDispatch)(),r=(0,Tp.useSelector)(D.Mp),n=(0,Tp.useSelector)(D.X0),a=(0,Tp.useSelector)(ui.Qw)||cH,i=(0,Tp.useSelector)(k().selectors.getSearchKeyword),o=(0,Tp.useSelector)(k().selectors.getDateMask),l=(0,Tp.useSelector)(k().selectors.getDateTimeMask),s=(0,Tp.useSelector)(k().selectors.getAttributesPresentation)||cH,c=(0,Tp.useSelector)(ki.IJ),u=(0,Tp.useSelector)((e=>(0,ui.NU)(e,{entityTypeUri:void 0}))),p=(0,Tp.useSelector)(ro.go),d=(0,b.useContext)(lV._),[m,g]=(0,b.useState)([]),[y,f]=(0,b.useState)(0),[h,E]=(0,b.useState)(!1),T=(0,b.useRef)(null),[O,C]=(0,b.useState)(!0);(0,b.useEffect)((()=>{g(S())}),[r,n,a,i]),(0,b.useEffect)((()=>{f(m.length),E(!0)}),[m]),(0,b.useEffect)((()=>{if(h){const e=R();f(e),E(!1)}}),[h,n]);const S=(0,b.useCallback)((()=>{const e=Object.values((0,za.t8)(n,r)).filter((e=>e.values&&e.values.length)).map((e=>{const t=e.title||e.hiddenTitle,r=(0,za.MI)([...e.data||[],...e.filteredData||[]],(0,_.path)(["attrType","type"],e)===x.DataTypes.TYPE_DATE?e.values.map((e=>e.map((e=>x.utils.dates.toLocalDate(e).getTime())))):e.values.map((0,x.mapFilterValue)((0,x.applyPresentationStrategyToValue)((e=>(0,x.getNumberFormat)((0,x.getAttrDataTypeDefinition)(e.attrType),s,x.intl.getLocale()).strategy)(e)))),e.type,{dateMask:o,dateTimeMask:l});return{fieldName:e.fieldName,title:t,values:r}}));i&&e.push({fieldName:lH,title:mi().text("Search"),values:[i.value]});const{values:[t]=[],type:c}=(0,_.pathOr)({},["mapSearch"],a);return t&&e.push({fieldName:sH,values:(0,x.getMapSearchValues)(c,t),title:(0,x.getMapSearchLabel)(c)}),e}),[r,n,a,i,s,o,l]),w=(0,b.useCallback)((()=>{f(m.length),E(!0)}),[m]),A=(0,b.useCallback)((e=>{C(e>=410)}),[]),R=(0,b.useCallback)((()=>{if(!T.current)return 0;const{firstChild:e,offsetLeft:t,offsetWidth:r}=T.current,n=t+r;return([...e.childNodes]||[]).filter((a=n,e=>e.offsetLeft+e.offsetWidth<=a)).length;var a}),[T]),I=(0,b.useCallback)((e=>r=>{switch(r.stopPropagation(),e){case lH:t(P.search.actions.keywordUpdated(null));break;case sH:t(ri(null));break;default:t(ii(e,[]))}}),[t]),N=(0,b.useCallback)((()=>{t(Qa({silent:!0})),t(P.search.actions.keywordUpdated({debounceTime:K.XU}))}),[t]),L=(0,b.useMemo)((()=>m.map((e=>v().createElement(uV,{key:e.fieldName,title:e.title,values:e.values,onDelete:I(e.fieldName)})))),[m,I]),U=L.slice(0,y),j=L.slice(y),F=(0,_.when)((0,_.propEq)("length",1),(0,_.reject)(x.isEmptySearchGroup))(p),M=0===L.length&&0===F.length;return v().createElement("div",{className:e.container,"data-reltio-id":"search-bar"},v().createElement("div",{className:e.header},v().createElement("div",{className:e.captionWrapper,"data-reltio-id":"search-bar-total-profiles"},v().createElement(Ag(),{component:"span",classes:{body1:e.profileNumber}},mi().number(u,"0,0")),v().createElement(Ag(),{variant:"body2",component:"span",classes:{root:e.profileText}},mi().text("total profiles"))),v().createElement(eB,null),v().createElement(QV,null),v().createElement(nE(),{color:"primary",className:e.clearButton,onClick:N,disabled:M,"data-reltio-id":"reltio-search-clear"},mi().text("clear")),!d&&v().createElement("div",{className:e.searchBarControls,"data-reltio-id":"search-bar-controls"},v().createElement(Gp.Z,{handleWidth:!0,onResize:A}),v().createElement($V,null),v().createElement(Lg(),{orientation:"vertical",className:e.splitter}),v().createElement(iH,{showTypography:O}))),v().createElement(Gp.Z,{handleWidth:!0,onResize:w}),v().createElement(oV(),{in:!c&&y>0,timeout:500},v().createElement("div",{ref:T,className:e.facetsBar,"data-reltio-id":"search-facets-bar"},v().createElement("div",{className:e.showBar},U),j.length>0&&v().createElement(dV,{items:j}))))},pH=(0,kp.Z)({title:{flexGrow:1},collapseIcon:{transform:"rotate(0deg)",transition:"transform 0.35s ease"},"collapseIcon--inverted":{transform:"rotate(-180deg)"},backButtonContainer:{margin:"12px"},collapseButton:{padding:"8px",marginRight:"12px"},toolBar:{minHeight:0,flexShrink:1,overflow:"hidden"}}),dH=e=>{let{onBackBtnClick:t}=e;const r=pH();return v().createElement(OF(),{disableGutters:!0,classes:{root:r.toolBar}},v().createElement(wd.k,{tooltipTitle:mi().text("Switch to basic mode"),size:"L",icon:YI(),className:r.backButtonContainer,onClick:t}),v().createElement(Ag(),{variant:"subtitle1",className:r.title},mi().text("Advanced search")))};dH.propTypes={onBackBtnClick:vp().func};const mH=dH,gH=(0,kp.Z)((e=>({query:{color:e.palette.text.secondary,fontSize:"12px",letterSpacing:0,lineHeight:"16px"},[x.READABLE_QUERY_PRIMITIVE_TYPES.entityTypeLabel]:{color:"#03904A"},[x.READABLE_QUERY_PRIMITIVE_TYPES.attributeLabel]:{color:"#059BEA"},[x.READABLE_QUERY_PRIMITIVE_TYPES.specialAttributeLabel]:{color:"#EA05CF"},[x.READABLE_QUERY_PRIMITIVE_TYPES.attributeFilter]:{color:"#7F00FF"},[x.READABLE_QUERY_PRIMITIVE_TYPES.attributeValue]:{color:"#000000"}})));function yH(){return yH=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},yH.apply(this,arguments)}const fH=(0,b.forwardRef)(((e,t)=>{let{readableQuery:r=[],className:n}=e,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["readableQuery","className"]);const i=gH();return v().createElement("span",yH({ref:t,className:O()(i.query,n),"data-reltio-id":"search-readable-query"},a),r.map(((e,t)=>{let{type:r,text:n}=e;return v().createElement("span",{key:t,className:i[r]},n)})))}));fH.displayName="ReadableSearchQuery";var hH=r(82466),EH=r.n(hH);const bH=(0,kp.Z)({collapseIcon:{transform:"rotate(0deg)",transition:"transform 0.35s ease"},"collapseIcon--inverted":{transform:"rotate(-180deg)"}});function vH(){return vH=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vH.apply(this,arguments)}const TH=e=>{let{collapseBtnActive:t,onCollapseBtnClick:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["collapseBtnActive","onCollapseBtnClick"]);const a=bH();return v().createElement(wd.k,vH({size:"L",icon:EH(),tooltipTitle:t?mi().text("Collapse panel"):mi().text("Expand panel"),onClick:r,iconClassName:O()(a.collapseIcon,{[a["collapseIcon--inverted"]]:!t}),"data-reltio-id":"reltio-search-advanced-search-collapse-panel"},n))};TH.propTypes={backBtnDisabled:vp().bool,onBackBtnClick:vp().func,collapseBtnActive:vp().bool,onCollapseBtnClick:vp().func};const OH=TH;var xH=r(89808),CH=r.n(xH),SH=r(19820),wH=r.n(SH);function AH(){return AH=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},AH.apply(this,arguments)}const RH=e=>{let{isFullscreen:t=!1,onClick:r=_.identity}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["isFullscreen","onClick"]);return v().createElement(wd.k,AH({size:"L",icon:t?wH():CH(),tooltipTitle:t?mi().text("Exit full screen"):mi().text("Full screen"),onClick:r,"data-reltio-id":"reltio-search-advanced-search-full-screen"},n))};RH.propTypes={isFullscreen:vp().bool,onClick:vp().func};const _H=RH,IH=(0,kp.Z)({resultQueryPanel:{background:"#E3E7E9",display:"flex",flex:"0 0 auto",alignItems:"center"},resultQuery:{flexGrow:1,padding:"10px 10px 10px 24px",fontSize:"12px",lineHeight:"16px",color:"rgba(0,0,0,0.38)"},queryContainer:{height:"auto",maxHeight:"48px",paddingRight:"24px",paddingTop:"4px",overflow:"auto"},queryContainerMinHeight:{maxHeight:"18px"},query:{cursor:"pointer"},noQuery:{color:"#000000"},actionsPanel:{display:"flex",paddingRight:"12px"},collapseButton:{marginRight:"-4px"}}),NH=e=>{let{groups:t,hasMinSize:r,lookups:n,metadata:a,attributesPresentation:i,collapseBtnActive:o,isFullscreen:l,onCollapseBtnClick:s,onFullScreenBtnClick:c,keyword:u,map:p,dispatch:d}=e;const m=IH(),[g,y]=(0,b.useState)(0),[f,h]=(0,b.useState)(0),E=(0,b.useMemo)((()=>(0,Ba.Jk)((0,Et.P0)(a,t))),[a,t]),T=(0,x.buildReadableQuery)(a,i,n,t,u,p),C=mi().text("Copy to clipboard"),[S,w]=(0,b.useState)(C),A=(0,b.useCallback)((0,x.debounce)((()=>{d({type:ft})}),500),[d]),R=(0,b.useCallback)((()=>{zV((0,x.buildReadableQueryToString)(a,i,n,t,u,p)).then((()=>w(mi().text("Query was copied")))).catch((()=>w(mi().text("Error"))))}),[t,i,n,a,u,p]),_=(0,b.useCallback)((()=>{w(C)}),[C]),I=(0,b.useCallback)((e=>{y(e.clientX),h(e.clientY)}),[]);(0,OE.D)(A,[A,E]);const N=(0,b.useMemo)((()=>({anchorEl:{clientWidth:1,clientHeight:1,getBoundingClientRect:()=>({left:g,bottom:f,height:1,right:g,width:1,top:f})}})),[g,f]);return v().createElement("div",{className:m.resultQueryPanel},v().createElement("div",{className:m.resultQuery},mi().text("Search query"),v().createElement("div",{className:O()(m.queryContainer,{[m.queryContainerMinHeight]:r})},T.length>0?v().createElement(gf(),{key:S,title:S,onClose:_,PopperProps:N},v().createElement(fH,{readableQuery:T,onMouseEnter:I,onClick:R,className:m.query})):v().createElement("span",{className:m.noQuery},mi().text("Build your search and view your search query here")))),v().createElement("div",{className:m.actionsPanel},v().createElement(OH,{collapseBtnActive:o,onCollapseBtnClick:s,className:m.collapseButton}),v().createElement(_H,{isFullscreen:l,onClick:c})))};var DH=r(28345),PH=r.n(DH),kH=r(68157);const LH=(0,kp.Z)((e=>({readOnlyLogicOperatorContainer:{display:"flex",alignItems:"center",marginRight:"40px",width:"76px",fontSize:"14px",color:e.palette.text.secondary,maxHeight:"46px"}}))),UH=e=>{let{className:t,rowData:r}=e;const n=LH();return v().createElement("div",{className:O()(n.readOnlyLogicOperatorContainer,t)},r&&r.operator?(0,kH.capitalize)(r.operator):mi().text("Where"))},jH=(0,kp.Z)((e=>({readOnlyFilter:{display:"flex",alignItems:"center",fontSize:"14px",color:e.palette.text.secondary,width:"50px",marginLeft:"12px",maxHeight:"46px"}}))),FH=e=>{let{className:t,rowData:r}=e;const n=jH();return v().createElement("div",{className:O()(n.readOnlyFilter,t)},r&&r.filter?(0,x.getFilterOptionLabel)(r.filter):mi().text("equals"))},MH=(0,kp.Z)((()=>({row:{display:"flex",marginBottom:"12px"},rowItem:{paddingRight:"10px",display:"flex"},fullWidth:{flexGrow:"1",flexBasis:"0",overflow:"hidden"},hidden:{visibility:"hidden"}})));const VH=(0,b.memo)((e=>{let{classes:t={},rowData:r,previousRowData:n,LogicOperatorComponent:a=UH,AttributeSelectorComponent:i,FilterSelectorComponent:o=FH,ValuesEditorComponent:l,ActionsComponent:s,filterSelectorRef:c,attributeSelectorProps:u={}}=e,p=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["classes","rowData","previousRowData","LogicOperatorComponent","AttributeSelectorComponent","FilterSelectorComponent","ValuesEditorComponent","ActionsComponent","filterSelectorRef","attributeSelectorProps"]);const d=MH();return v().createElement("div",{className:O()(d.row,t.root),"data-reltio-id":"query-builder-row"},v().createElement(a,{className:t.logicOperatorContainer,rowContext:p,rowData:n}),v().createElement("div",{className:O()(d.rowItem,t.attributeSelectorContainer),"data-reltio-id":"query-builder-row-attribute-selector"},v().createElement(i,{attributeSelectorProps:u,rowContext:p,rowData:r})),v().createElement("div",{className:O()(d.rowItem,t.filterSelectorContainer),"data-reltio-id":"query-builder-row-filter-selector"},v().createElement(o,{textFieldInputRef:c,rowContext:p,rowData:r})),v().createElement("div",{className:O()(d.rowItem,d.fullWidth,t.valuesEditorContainer),"data-reltio-id":"query-builder-row-values-editor"},v().createElement(l,{rowContext:p,rowData:r})),v().createElement("div",{className:O()(d.rowItem,t.actionsContainer,{[d.hidden]:!r}),"data-reltio-id":"query-builder-row-actions"},v().createElement(s,{rowContext:p,rowData:r})))}));function BH(){return BH=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},BH.apply(this,arguments)}const zH=(0,v().memo)((e=>{let{className:t,rowClasses:r,rowsData:n,lastRowAttributeSelectorProps:a,filterSelectorRef:i,filterSelectorRefIndex:o}=e,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","rowClasses","rowsData","lastRowAttributeSelectorProps","filterSelectorRef","filterSelectorRefIndex"]);const s=(e,t,n)=>{const s=t>0?(0,_.path)([t-1],n):null,c=t===n.length?{attributeSelectorProps:a}:{};return v().createElement(VH,BH({key:e&&e.id,rowData:e,previousRowData:s,classes:r,filterSelectorRef:t===o?i:void 0},l,c))};return v().createElement("div",{"data-reltio-id":"reltio-query-builder-rows-group",className:t},n.map(s),s(null,n.length,n))})),HH=(0,kp.Z)((()=>({select:{padding:"6px 16px 7px"},dropDown:{width:"100px","&:before":{content:"none !important"}}}))),YH=e=>{let{className:t,value:r,onChange:n}=e;const a=HH();return v().createElement(EV.k,{className:O()(a.dropDown,t),classes:a,value:r,entries:x.operatorOptions,onChange:n})},WH={position:"absolute",width:1,background:"rgba(43, 152, 240, 0.3)",height:16,left:36};function GH(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){qH(e,t,r[t])}))}return e}function qH(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ZH=(0,kp.Z)((e=>({title:{},rows:{},actions:{},container:{backgroundColor:e.palette.background.paper,padding:"18px 16px 0",position:"relative",margin:"16px 0 19px","& $title":{color:e.palette.text.hint,fontSize:12,marginBottom:20},"& $rows":{display:"flex",flexDirection:"column"},"& $actions":{position:"absolute",top:16,right:16,paddingTop:0},"&:after, &:before":{content:"",width:1,height:16,position:"absolute",top:"100%",left:35,background:"rgba(43, 152, 240, .3)"},"&:before":{top:"initial",bottom:"100%"},"&:first-child":{marginTop:0,"&:before":{content:"none"}}},entityTypeSelector:{width:"394px",height:"46px"},entityTypeSelectorContainer:{marginBottom:"20px"},logicOperator:{position:"relative",paddingLeft:16,"&:before":{}},verticalOperatorLine:GH({},WH),upperLine:{marginTop:-18},lowerLine:{marginBottom:-16,bottom:0}}))),$H="46px",KH=(0,kp.Z)((e=>({row:{marginBottom:"20px","&:hover $actions":{opacity:1}},logicOperatorContainer:{marginTop:"7px",marginRight:"40px",width:"100px"},logicOperator:{fontSize:"14px",color:e.palette.text.secondary},logicOperatorPlaceholder:{paddingLeft:"16px",paddingTop:"10px"},attributeSelect:{width:"254px",height:$H},filterSelect:{width:"190px"},valuesWrapper:{width:"100%",display:"flex",minHeight:$H,alignItems:"flex-start",boxSizing:"border-box"},actions:{opacity:"0",transition:"opacity 0.3s",paddingTop:"13px",width:"88px",height:"24px",display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:"0",marginLeft:"8px","& >span":{cursor:"pointer",display:"flex"},"& $actionIcon":{cursor:"pointer",color:"rgba(0, 0, 0, .54)"}},actionIcon:{}}))),XH=e=>e.join(", "),QH=e=>`calc(${(0,_.isNil)(e)?"100%":`${e}px`} - 35px)`,JH=(0,kp.Z)({listLabelContainer:{display:"flex",alignItems:"center",position:"relative",overflow:"hidden",whiteSpace:"nowrap",justifyContent:"space-between",height:"100%",width:"100%"},listLabel:{visibility:"hidden",position:"absolute",overflow:"hidden"},visibleItemsLabel:{textOverflow:"ellipsis",marginRight:"5px",overflow:"hidden",flex:1,flexBasis:"auto"},hiddenCount:{color:"rgba(0,0,0,0.87)",fontSize:"13px",lineHeight:"15px",padding:"5px 8px",borderRadius:"16px",backgroundColor:"rgba(0,0,0,.12)"}}),eY=e=>{let{list:t,maxWidth:r}=e;const n=JH(),a=(0,b.useRef)(),[i,o]=(0,b.useState)(0);(0,b.useEffect)((()=>{o(((e,t)=>{const r=e.length,n=((e,t)=>{if(t){const r=((e,t)=>{const{childNodes:r,clientLeft:n,clientWidth:a}=t;if(r.length>0){const[t]=Array.from(r),i=document.createRange();i.setStart(t,0);for(let r=0;r<e.length;r++){i.setEnd(t,i.endOffset+e[r].length);const{width:o}=i.getBoundingClientRect();if(n+o>a)return r;r!==e.length-1&&i.setEnd(t,i.endOffset+", ".length)}}return-1})(e,t);return-1===r?0:e.length-r}return 0})(e,t);return r-Math.max(1,r-n)})(t,a.current))}),[t]);const l=XH(t),s=i>0,c=s?XH(t.slice(0,-i)):l;return v().createElement(gf(),{title:s?l:""},v().createElement("div",{className:n.listLabelContainer},v().createElement("div",{style:{width:QH(r)},className:n.listLabel,ref:a},l),v().createElement("div",{className:n.visibleItemsLabel},c),s&&v().createElement("div",{className:n.hiddenCount},`+${i}`)))};function tY(){return tY=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},tY.apply(this,arguments)}const rY=(0,_.always)(32),nY=(0,b.memo)((e=>{let{selectedItems:t,onItemClick:r,focusIndex:n,width:a,height:i}=e,o=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["selectedItems","onItemClick","focusIndex","width","height"]);return v().createElement(Zp,tY({getItemSize:rY,renderItem:(e,a,i)=>{let{item:o}=a;const l=!!t.find((e=>o.uri===e)),s=i===n;return v().createElement(bd,{key:o.uri,onClick:r,checked:l,data:o,label:v().createElement(vd.o,{text:o.label,highlight:o.filterText}),labelInText:o.label,style:e,isFocused:s,hideIcon:!0,LogoIcon:o.LogoIcon})},focusIndex:n,fixedTitle:!1,disableHorizontalScrollbar:!0,width:a,height:i},o))}));nY.displayName="SelectMetadataTypesList";const aY=(0,kp.Z)({root:{borderRadius:"4px 4px 0 0",margin:0,fontSize:"14px",letterSpacing:0,lineHeight:"16px"},inputLabel:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",width:"100%",cursor:"pointer",top:"calc(50% - 23px)"},inputText:{display:"flex",flexGrow:1,alignItems:"center",height:"25px",width:"calc(100% - 53px)",paddingTop:"18px",paddingBottom:"4px",color:"rgba(0,0,0,0.87)",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},input:{width:0,cursor:"pointer","&.Mui-disabled":{backgroundColor:"transparent",cursor:"default"},"&$emptyInput":{width:"100%"}},emptyInput:{},disabledInput:{},disabledPointer:{},disabledUnderline:{},inputRoot:{flex:1,paddingRight:"4px",fontSize:"14px",letterSpacing:0,lineHeight:"16px",cursor:"pointer","&$disabledInput":{backgroundColor:"rgba(0, 0, 0, 0.03)",cursor:"pointer","&$disabledPointer":{cursor:"default"},"&$disabledUnderline::before":{borderBottomStyle:"solid"}}},icon:{transform:"rotate(0deg)",transition:"transform 0.35s ease"},"popup-opened-icon":{transform:"rotate(-180deg)"}});function iY(){return iY=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},iY.apply(this,arguments)}function oY(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){lY(e,t,r[t])}))}return e}function lY(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const sY=(0,b.memo)((e=>{let{placeholder:t,classes:r={},items:n,selectedItemsUris:a,onChange:i,ListLabelProps:o={},disabled:l,enableEmptyValueUnderline:s,single:c,label:u,dataReltioId:p,selectionPopupTitle:d}=e;const m=aY(),[g,y]=(0,b.useState)(!1),f=(0,b.useCallback)((()=>y(!0)),[]),h=(0,b.useCallback)((()=>y(!1)),[]),[E,T]=(0,b.useState)(""),C=(0,b.useCallback)((()=>T("")),[]),S=(0,b.useCallback)((0,_.pipe)(C,h),[h,C]),w=n.filter((e=>{let{label:t}=e;return x.utils.strings.search(t,E)})).map(((e,t)=>({item:{item:oY({},e,{filterText:E})},index:t}))),A=(0,b.useMemo)((()=>(0,_.pipe)((0,_.map)((e=>n.find((0,_.propEq)("uri",e)))),(0,_.reject)(_.isNil),(0,_.pluck)("label"))(a)),[a,n]),R=(0,b.useCallback)(((e,t)=>{c?(i(t?[e.uri]:[]),S()):i(t?a.concat(e.uri):a.filter((t=>t!==e.uri)))}),[a,i,c,S]),I=(0,b.useCallback)((e=>{let{item:t}=e;const r=!a.includes(t.uri);R(t,r)}),[a,R]),{focusIndex:N,handleKeyDown:D}=$p({items:w,open:g,onSelectFocusedItem:I,selectedItems:a,onClose:S}),P=(0,b.useRef)(),k=P.current?P.current.getBoundingClientRect().width:0,L=Math.max(k,255),U=0===a.length;return v().createElement(v().Fragment,null,v().createElement(BV(),{label:u,ref:P,InputProps:{startAdornment:U&&!t?null:v().createElement("div",{className:O()(m.inputText,r.inputText)},U?v().createElement("div",null,t):v().createElement(eY,iY({},o,{list:A}))),classes:{root:m.inputRoot,input:O()(m.input,r.input,{[m.emptyInput]:U&&!t}),disabled:O()(m.disabledInput,{[m.disabledPointer]:l}),underline:m.disabledUnderline},endAdornment:v().createElement(Pp.T,{size:"L",icon:dy(),iconClassName:O()(m.icon,{[m["popup-opened-icon"]]:g}),disabled:l}),readOnly:!0,disableUnderline:U&&!s},inputProps:{tabIndex:-1},InputLabelProps:{classes:{root:O()(m.inputLabel,r.label)}},value:"",onClick:l?void 0:f,classes:{root:O()(m.root,r.root)},size:"small",variant:"filled",disabled:l,"data-reltio-id":p}),v().createElement(zp,{open:g,anchorEl:P.current,onClose:S,onSearch:T,title:d,containerWidth:L,containerHeight:355,searchInputOnKeyDown:D,transformOrigin:{horizontal:"left",vertical:"top"},anchorOrigin:{horizontal:"left",vertical:"bottom"},PaperProps:{"data-reltio-id":`${p}-popup`}},v().createElement(nY,{items:w,onItemClick:R,selectedItems:a,width:L,height:245,focusIndex:N})))}));sY.displayName="MetadataTypesSelector";const cY=(0,b.memo)((e=>{let{entityTypes:t,selectedEntityTypes:r,single:n,placeholder:a,enableEmptyValueUnderline:i,onChange:o,classes:l={},ListLabelProps:s={},disabled:c=!1}=e;const u=(0,b.useMemo)((()=>t.filter(x.isAvailableEntityType)),[t]);return v().createElement(sY,{items:u,selectedItemsUris:r,single:n,placeholder:a,enableEmptyValueUnderline:i,onChange:o,classes:l,ListLabelProps:s,disabled:c,label:mi().text("Entity type"),dataReltioId:"entity-type-selector",selectionPopupTitle:mi().text("Select entity types")})}));cY.displayName="EntityTypesSelector";const uY=e=>{let{selectedEntityTypes:t,onChange:r,classes:n={},ListLabelProps:a={}}=e;const i=(0,Tp.useSelector)(k().selectors.getMetadata),o=(0,Tp.useSelector)(ui.t9),l=(0,Tp.useSelector)(ki.Xf),s=(0,b.useCallback)(l?e=>{let{uri:t}=e;return l.includes(t)}:_.identity,[l]),c=(0,b.useMemo)((()=>i.entityTypes.filter(s).sort(l?(0,x.orderByArrayComparator)(l,"uri"):e=>0).filter((e=>{let{uri:t}=e;return(0,x.isAvailableEntityTypeForDataTenant)(o,t)}))),[i,o,s,l]);return v().createElement(cY,{classes:n,entityTypes:c,onChange:r,selectedEntityTypes:t,ListLabelProps:a,placeholder:mi().text("All"),enableEmptyValueUnderline:!0})};uY.propTypes={selectedEntityTypes:vp().arrayOf(vp().string).isRequired,onChange:vp().func.isRequired,classes:vp().shape({root:vp().string,label:vp().string}),ListLabelProps:vp().shape({maxWidth:vp().number})};const pY=uY,dY=(0,kp.Z)({attribute:{cursor:"pointer",lineHeight:"16px",flexBasis:"100%",display:"flex",alignItems:"center",padding:"0 10px 0 16px",width:"calc(100% - 32px)","&$attributeWithValue":{borderBottom:"1px solid rgba(0,0,0,0.38)"},"&$disabled":{cursor:"default"}},disabled:{},attributeWithValue:{},noSelect:{},name:{fontSize:"14px",color:"rgba(0,0,0,0.87)",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",direction:"rtl",textAlign:"left",flex:"1 0",width:"0","& $noSelect":{color:"rgba(0,0,0,0.38)"},"&$disabled":{color:"rgba(0,0,0,0.26)","& $noSelect":{color:"rgba(0,0,0,0.26)"}}}}),mY=(0,_.either)((0,_.prop)("title"),(0,_.prop)("fieldName")),gY=e=>{let{value:t,getLabel:r=mY,onSelectAttributeClick:n,disabled:a=!1}=e;const i=dY(),o=t&&r(t);return v().createElement("div",{onClick:a?void 0:n,className:O()(i.attribute,{[i.attributeWithValue]:!!o},{[i.disabled]:a})},v().createElement(gd.Y,{value:o},v().createElement("div",{className:O()(i.name,{[i.disabled]:a})},o||v().createElement("span",{className:i.noSelect},mi().text("Select attribute")))),v().createElement(Pp.T,{size:"M",icon:dy(),disabled:a}))},yY=(0,kp.Z)({subHeader:{backgroundColor:"#f5f5f5",padding:"0 16px",margin:0,display:"flex",alignItems:"center",color:"rgba(0,0,0,0.84)",fontSize:"14px",fontWeight:500}});function fY(){return fY=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},fY.apply(this,arguments)}function hY(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){EY(e,t,r[t])}))}return e}function EY(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const bY=(0,b.memo)((e=>{let{selectedAttributes:t,onItemClick:r,focusIndex:n,hideCheckBox:a}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["selectedAttributes","onItemClick","focusIndex","hideCheckBox"]);const o=yY(),l=(0,w.AH)();return v().createElement(Zp,fY({getItemSize:(e,t)=>t.items?40:28,renderItem:(e,i,o)=>{let{item:l,level:s,groupId:c,groupName:u}=i;const p=mL(l,t),d=o===n;return v().createElement(bd,{key:`item-${c}-${l.fieldName}`,onClick:r,checked:p,data:hY({},l,{groupName:u}),notSelectable:l.notSelectable,hideCheckBox:a,label:v().createElement(vd.o,{text:l.title,highlight:l.filterText}),labelInText:l.title,level:s,style:e,isFocused:d,groupId:c,LogoIcon:l.LogoIcon})},renderGroupTitle:(e,t)=>v().createElement(og(),{component:"div",className:o.subHeader,style:e,key:`group-${t.item.id}`},t.item.needGroupIcon&&v().createElement(qg,{group:t.item,metadata:l}),t.item.title),focusIndex:n},i))}));function vY(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){TY(e,t,r[t])}))}return e}function TY(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const OY=(e,t)=>e.title.toLowerCase().includes(t.toLowerCase()),xY=(e,t)=>OY(e,t)||(e.children||[]).some((e=>xY(e,t))),CY=(e,t)=>e.findIndex(dL(t)),SY=(0,x.getMaxItemWidth)("title"),wY=function(e,t,r,n){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,i=arguments.length>5&&void 0!==arguments[5]&&arguments[5];const o=OY(e,n);return[{item:n?vY({},e,{filterText:n}):e,level:a,groupId:t,groupName:r}].concat(e.children?e.children.filter((e=>i||o||xY(e,n))).flatMap((e=>wY(e,t,r,n,a+1,i||o))):[]).flat()},AY=(0,_.curry)(((e,t)=>t.map((t=>({item:t,items:t.attributes.filter((t=>xY(t,e))).map((r=>wY(r,t.id,t.title,e)))}))).filter((e=>e.items.length)))),RY=(0,kp.Z)({selector:{minWidth:"200px",width:"100%",alignItems:"stretch",background:"rgba(0,0,0, 0.0267)",boxSizing:"border-box",borderRadius:"4px",display:"flex"}}),_Y=(0,b.memo)((e=>{let{className:t,itemsGroups:r,value:n,getLabel:a,onSelect:i,onRestoreFocus:o=_.identity,onOpenPopup:l=_.identity,disableRestoreFocus:s=!1,disableEnforceFocus:c=!1,single:u=!1,ungroup:p=!1,disabled:d=!1,hideCheckBox:m=!1}=e;const g=RY(),[y,f]=(0,b.useState)(null),h=(0,b.useCallback)((()=>f(null)),[]),E=!!y,[T,x]=(0,b.useState)(""),C=(0,b.useCallback)((()=>x("")),[]),[S,w]=(0,b.useState)([]),A=(0,b.useCallback)((()=>w([])),[]),R=(0,b.useMemo)((()=>AY(T,r)),[r,T]),I=(0,b.useMemo)((()=>(0,_.pipe)((0,_.when)((0,_.always)(p),(0,_.chain)((0,_.pipe)((0,_.prop)("items"),_.flatten,(0,_.map)((0,_.pick)(["item","level"]))))),Hp)(R)),[p,R]),N=(0,b.useMemo)((()=>Math.max(SY(R),308)),[R]),D=(0,_.pipe)((0,_.tap)((0,_.pipe)(A,C,h)),o),P=(0,b.useRef)(),k=(0,b.useCallback)(((e,t)=>{i({checked:t,attribute:e,index:t?S.length:CY(S,e),selectedAttributes:S}),u?(w(t?[e]:[]),D({})):(w((e=>{let{attribute:t,selectedAttributes:r,checked:n}=e;return n?r.concat(t):r.filter((e=>!dL(t,e)))})({selectedAttributes:S,attribute:e,checked:t})),P.current&&P.current.focus())}),[S,i,u,D,P]),L=(0,b.useCallback)((e=>{let{onListItemClick:t,selectedAttributes:r}=e;return e=>{let{item:n,groupData:a}=e;const i=mL(n,r);t(vY({},n,{groupName:a.groupName}),!i)}})({onListItemClick:k,selectedAttributes:S}),[k,S]),{focusIndex:U,handleKeyDown:j}=$p({items:I,open:E,onSelectFocusedItem:L,selectedItems:S,onClose:D});return v().createElement("div",{className:O()(g.selector,t),"data-reltio-id":"attribute-selector"},v().createElement(gY,{value:n,getLabel:a,onSelectAttributeClick:e=>{l(),f(e.currentTarget)},disabled:d}),v().createElement(zp,{open:E,anchorEl:y,onClose:D,onSearch:x,title:mi().text("Select attribute"),containerWidth:N,containerHeight:507,searchInputOnKeyDown:j,anchorOrigin:{horizontal:"right",vertical:"bottom"},searchInputRef:P,disableRestoreFocus:s,disableEnforceFocus:c},v().createElement(bY,{items:I,onItemClick:k,selectedAttributes:S,width:N,height:400,focusIndex:U,hideCheckBox:m})))}));var IY=r(80349);function NY(){return NY=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},NY.apply(this,arguments)}const DY=(0,b.memo)((e=>{let{entityTypes:t,recommendedAttributes:r,showReferencedEntityAttributes:n=!0,firstLevelAttributesFilter:a}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["entityTypes","recommendedAttributes","showReferencedEntityAttributes","firstLevelAttributesFilter"]);const o=(0,Tp.useSelector)(k().selectors.getMetadata),l=(0,Tp.useSelector)(ui.t9),s=(0,Tp.useSelector)(k().selectors.getCanUserReadWorkflowDataTask),c=(0,Tp.useSelector)(ki.Xf),u=(0,Tp.useSelector)(k().selectors.getDataTenants),p=(0,b.useMemo)((()=>(0,_.pipe)(IY.s1,(0,_.when)((0,_.always)(!n),IY.a),(0,j.ED)(l))({allowedEntityTypes:c,firstLevelAttributesFilter:a},o,t,r,u,s)),[t,o,l,c,a,r,n,u,s]);return v().createElement(_Y,NY({},i,{itemsGroups:p}))})),PY=e=>{let{rowData:t,rowContext:{entityTypes:r,dispatchGroupAction:n},attributeSelectorProps:a={}}=e;const i=KH(),o=t&&t.id,l=(0,b.useCallback)((e=>{n($o,o,e)}),[o,n]),s=(0,b.useCallback)((e=>(0,x.getSearchGroupAttributeLabel)({data:e})),[]);return v().createElement(DY,{className:i.attributeSelect,value:t&&t.data,getLabel:s,entityTypes:r,onSelect:l,onRestoreFocus:a.onRestoreFocus,onOpenPopup:a.onOpen,disableRestoreFocus:a.disablePopoverRestoreFocus,disableEnforceFocus:a.disablePopoverRestoreFocus})};PY.propTypes={rowData:PB,rowContext:vp().shape({entityTypes:vp().arrayOf(vp().string),dispatchGroupAction:vp().func}),attributeSelectorProps:vp().shape({onRestoreFocus:vp().func,onOpen:vp().func,disablePopoverRestoreFocus:vp().bool})};const kY=(0,b.memo)(PY);function LY(){return LY=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},LY.apply(this,arguments)}const UY=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",LY({width:"20",height:"20",viewBox:"0 0 20 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",focusable:"false"},r),v().createElement("defs",null,v().createElement("path",{d:"M20.222 6C21.21 6 22 6.8 22 7.778v12.444C22 21.2 21.209 22 20.222 22H7.778C6.79 22 6 21.2 6 20.222V7.778C6 6.8 6.791 6 7.778 6h12.444zM8 8v12h12V8H8zM4 18H2V4c0-1.1.9-2 2-2h14v2H4v14z",id:"svg397942461a"})),v().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},v().createElement("g",null,v().createElement("g",{transform:"translate(-2 -2)"},v().createElement("mask",{id:"svg397942461b",fill:"#fff"},v().createElement("use",{xlinkHref:"#svg397942461a"})),v().createElement("g",{mask:"url(#svg397942461b)",fill:"#000",fillOpacity:".54"},v().createElement("path",{d:"M0 0h24v24H0z"}))))))},jY=e=>!(e&&e.data),FY=e=>{let{rowData:t,rowContext:{dispatchGroupAction:r}}=e;const n=KH(),a=t&&t.id,i=(0,b.useCallback)((()=>r(Qo,a)),[a,r]),o=(0,b.useCallback)((()=>r(Jo,a)),[a,r]),l=(0,b.useCallback)((()=>r(Wo,a)),[a,r]);return t&&v().createElement("div",{className:O()(n.actions)},v().createElement(gf(),{title:mi().text("Add"),placement:"bottom"},v().createElement(PH(),{className:n.actionIcon,onClick:l})),!jY(t)&&v().createElement(gf(),{title:mi().text("Duplicate"),placement:"bottom"},v().createElement("div",{className:n.actionIcon,tabIndex:-1},v().createElement(UY,{onClick:o,tabIndex:-1}))),v().createElement(gf(),{title:mi().text("Delete"),placement:"bottom"},v().createElement(_p(),{onClick:i,className:n.actionIcon})))};FY.propTypes={rowData:PB,rowContext:vp().shape({dispatchGroupAction:vp().func})};const MY=(0,b.memo)(FY),VY={BY_LABEL:(0,r(51774).c)({stringify:(0,_.prop)("label")})},BY=e=>{let{className:t,attribute:r,textFieldInputRef:n,isDisabled:a,height:i,onChange:o}=e;const l=(0,_.pipe)(x.getFilterOptionLabel,kH.capitalize);return v().createElement(cj,{label:"",placeholder:mi().text("Equals"),className:t,value:a?void 0:{value:r.filter,label:l(r.filter)},options:r&&r.data&&r.data.filterOptions.map((e=>({value:e,label:l(e)})))||[],height:i,onChange:o,isDisabled:a,filterOption:VY.BY_LABEL,textFieldInputRef:n})};BY.propTypes={className:vp().string,attribute:PB,textFieldInputRef:vp().object,isDisabled:vp().bool,onChange:vp().func,height:vp().number};const zY=(0,b.memo)(BY),HY=e=>{let{rowData:t,rowContext:{dispatchGroupAction:r},textFieldInputRef:n}=e;const a=KH(),i=t&&t.id,o=(0,b.useCallback)((e=>r(el,i,e.value)),[r,i]);return v().createElement(zY,{className:a.filterSelect,attribute:t,textFieldInputRef:n,isDisabled:jY(t),onChange:o})};HY.propTypes={rowData:PB,rowContext:vp().shape({dispatchGroupAction:vp().func}),textFieldInputRef:vp().object};const YY=(0,b.memo)(HY);var WY=r(23821);const GY=(0,kp.Z)({input:{margin:0,paddingBottom:"4px !important",paddingTop:"2px !important",borderRadius:"4px"},multipleInput:{minHeight:"46px",margin:0,padding:100},root:{borderRadius:"4px 4px 0 0",padding:0,display:"flex",alignItems:"center",margin:0},boolRoot:{borderRadius:"4px 4px",padding:11,display:"flex",alignItems:"center"},dateRoot:{borderRadius:"4px 4px 0 0",margin:0},booleanRadioEditor:{paddingLeft:"11px"}}),qY=e=>{let{attribute:t,groupId:r,onChange:n,updateValues:a,filterValues:i}=e;const{values:o,data:{attrType:l,fieldName:s}={},id:c}=t,u=(0,Tp.useSelector)((e=>(0,ro.Sw)(e,r,c)))||{},p=(0,Tp.useSelector)((e=>(0,ro.Ly)(e))),d=(0,Tp.useSelector)((e=>(0,ui.Sg)(e,s)));(0,b.useEffect)((()=>{p&&a()}),[o,p,d]),(0,b.useEffect)((()=>{p||a()}),[o,p]);const m=(0,b.useMemo)((()=>(0,_.propOr)([],0,o)),[o]),g=(0,b.useCallback)((0,_.pipe)(x.wrapInArray,n),[n]),{default:y,filtered:f}=u;return!y&&l?v().createElement("div",{className:"ValuesEditor-styles-loadingWrapper--_rOmn"},v().createElement(Tm(),{size:20,className:"ValuesEditor-styles-loading--mLFVu"})):v().createElement(df,{values:m,defaultOptions:y,filteredOptions:f,onChange:g,getSuggestions:i,tabSelectsValue:!1,canLoadMore:!(0,za.tW)(t.data)})};qY.propTypes={attribute:PB.isRequired,groupId:vp().string,onChange:vp().func,updateValues:vp().func,filterValues:vp().func};const ZY=qY,$Y=e=>{let{attribute:t,dispatchGroupAction:r,groupId:n}=e;const{values:a,data:{attrType:i,fieldName:o}={},filter:l}=t,s=GY(),c=(0,x.isTypeaheadAttrType)(i)||(0,_.allPass)([(0,_.propSatisfies)((0,_.either)(_.isNil,x.isEntityTypeUri),"uri"),(0,_.prop)("faceted"),(0,_.propEq)("type",x.DataTypes.TYPE_BLOB)])(i),u=(0,x.isEnumAttrType)(i)||(0,x.isLookupAttrType)(i),p=e=>r(tl,t.id,e);if((c||u)&&(0,x.isMultiValueOption)(l)){const e=()=>r(al,t),a=e=>{let{value:n,pageNumber:a,currentOptions:i}=e;return r(rl,{attribute:t,value:n,debounceTime:500,pageNumber:a,currentOptions:i})};return v().createElement(ZY,{attribute:t,groupId:n,onChange:p,filterValues:a,updateValues:e})}{const e=u?{type:x.DataTypes.TYPE_STRING}:(0,x.getAttrDataTypeDefinition)(i),t=(0,x.getDataTypeDefinitionForFilterValue)(e,l),r=(0,x.isDateType)(t.type)&&!(0,x.isDateRangeFilterOption)(l)&&s.dateRoot||(0,x.isBooleanType)(t.type)&&s.boolRoot||s.root;return v().createElement(WY.n,{filter:{filter:l,fieldName:o,values:a||[]},onChange:p,dataTypeDefinition:t,fullWidth:!0,TextFieldProps:{InputProps:{classes:{root:s.input},disableUnderline:(0,_.isNil)(a)||(0,_.isEmpty)((0,_.flatten)(a))}},color:"primary",booleanRadioEditorClassName:s.booleanRadioEditor,classes:{root:r},orientation:"horizontal"})}};$Y.propTypes={attribute:PB.isRequired,groupId:vp().string,dispatchGroupAction:vp().func};const KY=(0,b.memo)($Y),XY=e=>{let{rowData:t,rowContext:{dispatchGroupAction:r,groupId:n}}=e;const a=KH(),i=t&&(0,x.checkIfOptionHasValues)(t.filter);return v().createElement("div",{className:a.valuesWrapper,"data-reltio-id":"advanced-search-values-editor-wrapper"},!jY(t)&&i&&v().createElement(KY,{attribute:t,dispatchGroupAction:r,groupId:n}))};XY.propTypes={rowData:PB,rowContext:vp().shape({dispatchGroupAction:vp().func,groupId:vp().string})};const QY=(0,b.memo)(XY),JY=e=>{let{rowData:t,rowContext:{dispatchGroupAction:r}}=e;const n=KH(),a=t&&t.id,i=t&&t.operator,o=(0,b.useCallback)((e=>r(Ko,a,e)),[r,a]);return v().createElement("div",{className:n.logicOperatorContainer},i?v().createElement(YH,{className:n.logicOperator,value:i,onChange:o}):v().createElement("div",{className:O()(n.logicOperator,n.logicOperatorPlaceholder)},mi().text("Where")))};JY.propTypes={rowData:PB,rowContext:vp().shape({dispatchGroupAction:vp().func})};const eW=(0,b.memo)(JY);function tW(){return tW=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},tW.apply(this,arguments)}const rW=e=>{let{showLogicOperator:t,group:{id:r,attributes:n,operator:a,entityTypes:i=[]},dispatch:o,onAddEmptyGroup:l}=e,s=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["showLogicOperator","group","dispatch","onAddEmptyGroup"]);const c=ZH(),u=KH(),p=(0,b.useCallback)((()=>o({type:rt,payload:{groupId:r,id:(0,Ke.x0)()}})),[r,o]),d=(0,b.useCallback)((()=>o({type:et,payload:{groupId:r}})),[r,o]),m=(0,b.useCallback)((e=>o(((e,t)=>({type:Je,payload:{groupId:e,operator:t}}))(r,e))),[r,o]),g=(0,b.useCallback)((e=>o(((e,t)=>({type:Xe,payload:{groupId:e,entityTypes:t}}))(r,e))),[r,o]),y=(0,b.useCallback)((function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),a=1;a<t;a++)n[a-1]=arguments[a];return o(e(r,...n))}),[r,o]),f=(0,b.useRef)(null),h=(0,b.useRef)(null),E=(0,b.useRef)(null);E.current=n.length;const T=(0,b.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),f.current&&h.current!==E.current&&(f.current.querySelector("input").focus(),h.current=null)}),[]),x=(0,b.useCallback)((()=>{h.current=n.length}),[n.length]),C=(0,b.useMemo)((()=>[{text:mi().text("Add set"),onClick:l,id:"-group-add-set"},{text:mi().text("Duplicate set"),onClick:p,id:"-group-duplicate-set"},{text:mi().text("Delete set"),onClick:d,id:"-group-delete-set"}]),[l,p,d]),S=(0,b.useMemo)((()=>({root:u.row})),[u]),w=(0,b.useMemo)((()=>({onRestoreFocus:T,onOpen:x,disablePopoverRestoreFocus:!!T})),[T,x]);return v().createElement(v().Fragment,null,v().createElement("div",tW({className:c.container},s),v().createElement("div",{className:c.title},mi().text("Set")),v().createElement("div",{className:c.entityTypeSelectorContainer},v().createElement(pY,{classes:{root:c.entityTypeSelector},selectedEntityTypes:i,onChange:g})),v().createElement("div",{className:c.rows},v().createElement(zH,{rowClasses:S,rowsData:n,AttributeSelectorComponent:kY,FilterSelectorComponent:YY,ValuesEditorComponent:QY,ActionsComponent:MY,LogicOperatorComponent:eW,filterSelectorRefIndex:h.current,filterSelectorRef:f,lastRowAttributeSelectorProps:w,entityTypes:i,groupId:r,dispatchGroupAction:y}),v().createElement("div",{className:c.actions},v().createElement(LN,{menuId:`query-builder-group-actions-${r}`,buttonComponent:Pp.T,buttonProps:{icon:Vd(),size:"L","data-reltio-id":"reltio-search-query-builder-group-actions"},menuItems:C})))),t&&v().createElement("div",{className:c.logicOperator},v().createElement("div",{className:O()(c.verticalOperatorLine,c.upperLine)}),v().createElement("div",{className:O()(c.verticalOperatorLine,c.lowerLine)}),v().createElement(YH,{value:a,onChange:m})))};rW.propTypes={showLogicOperator:vp().bool,group:vp().shape({id:vp().string,attributes:vp().arrayOf(PB),entityTypes:vp().arrayOf(vp().string),operator:vp().string}),onAddEmptyGroup:vp().func,dispatch:vp().func};const nW=(0,b.memo)(rW);function aW(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){iW(e,t,r[t])}))}return e}function iW(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const oW=(0,kp.Z)((e=>({container:{backgroundColor:e.palette.background.default,transition:"flex-grow 0.35s ease",flexGrow:1,flexBasis:0,overflow:"hidden",display:"flex",flexDirection:"column"},button:{paddingLeft:23,fontSize:"14px",position:"relative"},scrollWrapper:{overflow:"auto",flex:"1 0 0px",padding:"0 60px"},groupsContainer:{margin:"0 auto",width:"100%",maxWidth:"1280px"},apply:{background:e.palette.background.default,textAlign:"right",padding:"15px 45px"},icon:{height:18,width:18,marginRight:"9px"},verticalOperatorLine:aW({},WH),upperLine:{marginTop:-18},searchByOvContainer:{marginLeft:-6,marginBottom:-14}}))),lW=e=>{let{groups:t,uiConfigShowSearchByOv:r,dispatch:n}=e;const a=oW(),i=(0,b.useRef)(null),o=(0,b.useRef)(null),l=(0,b.useCallback)((()=>n({type:tt,payload:{group:tr([])}})),[n]);return(0,b.useEffect)((()=>{if(0===t.length)l();else if(!(0,_.isNil)(o.current)&&o.current<t.length&&i.current){const e=i.current.childNodes;e[e.length-2].scrollIntoView({behavior:"smooth"})}o.current=t.length}),[t.length,l]),v().createElement("div",{className:a.scrollWrapper},v().createElement("div",{className:a.groupsContainer,ref:i},r&&v().createElement("div",{className:a.searchByOvContainer},v().createElement(Bh,{variant:"queryGroups"})),t.map(((e,t,r)=>v().createElement(nW,{key:e.id,group:e,dispatch:n,showLogicOperator:t!==r.length-1,onAddEmptyGroup:l,"data-reltio-id":`reltio-search-advansed-search-group-builder-${t}`}))),v().createElement("div",{className:a.button},v().createElement("div",{className:O()(a.verticalOperatorLine,a.upperLine)}),v().createElement(nE(),{onClick:l,color:"primary",size:"small","data-reltio-id":"reltio-search-advanced-search-add-set-button"},v().createElement(PH(),{color:"primary",className:a.icon,fontSize:"small"}),mi().text("ADD SET")))))};lW.propTypes={groups:vp().array,dispatch:vp().func,uiConfigShowSearchByOv:vp().bool};const sW=(0,Tp.connect)((e=>{var t;return{groups:(0,ro.go)(e),uiConfigShowSearchByOv:null!==(t=k().selectors.getShowSearchByOv(e))&&void 0!==t?t:(0,ki.cC)(e)}}))(lW),cW=P.search.actions.updateState({}),uW=e=>{let{open:t,onClose:r}=e;const n=(0,Tp.useDispatch)(),a=(0,b.useCallback)((()=>{r(),n(cW)}),[n,r]),i=(0,b.useCallback)((()=>{r(),n(Oi(!0,cW))}),[n,r]),o=(0,Tp.useSelector)(xo.LA),l=(0,Tp.useSelector)(ui.ai),s=(0,Tp.useSelector)(xo.WH),c=(0,Tp.useSelector)(xo.Jv),u=o?c&&!s:!l;return v().createElement(_B.U,{open:t,title:mi().text("Search filters cannot be displayed in Quick filters"),content:mi().text("You have advanced filters that cannot be displayed in Quick filters. Save your search or clear your filters to go to Quick filters."),discardCaption:mi().text("Clear search"),saveCaption:mi().text("Save search"),disabledSave:u,onCancel:r,onDiscard:a,onSave:i})};uW.propTypes={open:vp().bool,onClose:vp().func};const pW=uW,dW=(0,Tp.connect)((e=>({metadata:k().selectors.getMetadata(e),attributesPresentation:k().selectors.getAttributesPresentation(e),groups:(0,ro.go)(e),lookups:k().selectors.getLookups(e),keyword:k().selectors.getSearchKeyword(e),map:(0,ui.vH)(e),dataTenants:k().selectors.getDataTenants(e)})))((e=>{let{metadata:t,attributesPresentation:r,lookups:n,groups:a,keyword:i,map:o,onClose:l,collapsed:s,isFullscreen:c,onCollapse:u,onExpand:p,onFullscreen:d,dataTenants:m,dispatch:g}=e;const y=oW(),[f,h]=(0,b.useState)(!1),E=(0,_.ifElse)((0,_.always)(Ga(t,a,m)),(0,_.pipe)(l,p),(()=>h(!0)));return v().createElement("div",{className:y.container},v().createElement(mH,{onBackBtnClick:E}),v().createElement(sW,null),v().createElement(NH,{groups:a,lookups:n,dispatch:g,metadata:t,attributesPresentation:r,hasMinSize:s,collapseBtnActive:!s,isFullscreen:c,onCollapseBtnClick:s?p:u,onFullScreenBtnClick:c?p:d,keyword:i,map:o}),v().createElement(pW,{open:f,onClose:()=>h(!1)}))})),mW="calc(100% - 53px)",gW=e=>{let{isOpenAdvancedSearch:t,onCloseAdvancedSearch:r}=e;const n=pE(),[a,i]=(0,b.useState)(!1),[o,l]=(0,b.useState)("50%"),s=(0,b.useCallback)((()=>{i(!0),l("120px")}),[]),c=(0,b.useCallback)((()=>{i(!1),l("50%")}),[]),u=(0,b.useCallback)((e=>{let{percentageSize:t,isMaxSize:r,isMinSize:n}=e;i(n),l(r?mW:t)}),[]),p=(0,b.useCallback)((()=>{i(!1),l(mW)}),[]),d=v().createElement(v().Fragment,null,v().createElement(uH,null),v().createElement(Lg(),{className:n.divider})),m=v().createElement(v().Fragment,null,d,v().createElement(dW,{collapsed:a,isFullscreen:o===mW,onClose:r,onCollapse:s,onExpand:c,onFullscreen:p}));return v().createElement(fE,{className:n.resizablePanesWrapper,orientation:"horizontal",size:t?o:0,minSize:120,maxSize:-53,allowResize:t,onChange:u},v().createElement("div",{className:n.pane},t&&m),v().createElement("div",{className:n.pane},!t&&d,v().createElement(aV,null)))};gW.propTypes={isOpenAdvancedSearch:vp().bool,onCloseAdvancedSearch:vp().func};const yW=gW;function fW(){return fW=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},fW.apply(this,arguments)}const hW=e=>v().createElement("svg",fW({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgTenant"},e),v().createElement("path",{d:"M2 0h13v2H8v19h12V6h-9V4h11v19H2V0zm9 8h7v2h-7V8zm0 4h7v2h-7v-2zm0 4h7v2h-7v-2zM4 4v2h2V4H4zm0 8v2h2v-2H4zm0-4v2h2V8H4zm0 8v2h2v-2H4z",fill:"#000",stroke:"none",strokeWidth:1,fillRule:"evenodd"})),EW=(0,kp.Z)((()=>({labelWrapper:{height:"24px",display:"inline-flex",alignItems:"center"},tenantIcon:{height:"24px",width:"24px",marginRight:"4px",opacity:.38},tenantLabel:{lineHeight:"15px",fontSize:"13px",color:"rgba(0,0,0,0.38)"}}))),bW=e=>{let{className:t}=e;const r=EW(),n=(0,w.xz)(),a=(0,w.fN)(),i=`${n}${a?" - "+a.toUpperCase():""}`;return v().createElement("div",{className:O()(r.labelWrapper,t)},v().createElement(hW,{className:r.tenantIcon,"data-reltio-id":"reltio-tenant-icon"}),v().createElement(Ag(),{className:r.tenantLabel},i))},vW=(0,kp.Z)((e=>({container:{display:"flex",flexDirection:"row",minHeight:"64px",flexShrink:0,alignItems:"center",paddingRight:"14px"},entityTypeTitle:{fontSize:"18px",letterSpacing:0,lineHeight:"21px",marginRight:"16px",flexShrink:0},profileText:{color:e.palette.text.secondary,fontSize:"14px",lineHeight:"28px",flexShrink:0},profileNumber:{color:e.palette.text.secondary,fontWeight:600,paddingLeft:"3px",paddingRight:"8px",flexShrink:0},splitter:{marginRight:"15px",marginLeft:"18px",height:"32px"},clearButton:{marginRight:"auto",marginLeft:"14px",flexShrink:0},searchBox:{flex:"1 1 auto",width:"100%",maxWidth:"538px"},searchQueryContainer:{display:"flex",flexDirection:"column",minHeight:"50px",flexShrink:0,paddingLeft:"24px",paddingRight:"14px",alignItems:"flex-start",color:e.palette.text.secondary,fontSize:"12px",letterSpacing:0,lineHeight:"14px"},searchQuery:{paddingTop:"6px"},borderBottom:{borderBottom:"1px solid rgba(0,0,0,0.1)"}}))),TW=()=>{const e=vW(),t=(0,Tp.useSelector)(k().selectors.getMetadata),r=(0,Tp.useSelector)(ru),n=(0,Tp.useSelector)(eu),a=(0,Tp.useSelector)(gu),i=(0,Tp.useSelector)(ui.hX),o=(0,Tp.useSelector)(yu),l=(0,Tp.useSelector)(du),s=(0,x.getEntityTypeLabel)(t,{type:r}),c=(0,Tp.useSelector)(mu),u=(0,Tp.useDispatch)(),p=(()=>{const e=(0,Tp.useSelector)(k().selectors.getMetadata),t=(0,Tp.useSelector)(k().selectors.getLookups),r=(0,Tp.useSelector)(k().selectors.getAttributesPresentation),n=(0,Tp.useSelector)(ro.go),a=(0,Tp.useSelector)(k().selectors.getSearchKeyword),i=(0,Tp.useSelector)(ui.vH),o=(0,Tp.useSelector)(k().selectors.getDataTenants),l=(0,Tp.useSelector)(D.X0),s=(0,Tp.useSelector)(D.Mp),c=(0,b.useMemo)((()=>Object.values((0,za.t8)(l,s))),[l,s]);return(0,b.useMemo)((()=>{const l=(0,_.isEmpty)(n)?(0,il.h)(e,o,c):n;return(e=>!(1===e.length&&(0,_.isEmpty)(e[0].attributes)&&1===e[0].entityTypes.length))(l)||i||a?(0,x.buildReadableQuery)(e,r,t,l,a,i):[]}),[a,i,e,o,r,n,c,t])})();(0,b.useEffect)((()=>{0!==i&&(a&&o>=i||!a&&o<=0)&&u(Ec())}),[a,i,o,u]);const d=(0,b.useCallback)((e=>u(((e,t)=>({type:zn,payload:{filterText:e,debounceTime:t}}))(e,K.XU))),[u]);return v().createElement(v().Fragment,null,v().createElement(OF(),{className:O()(e.container,{[e.borderBottom]:n>0})},v().createElement(Ag(),{component:"span",className:e.entityTypeTitle},s),v().createElement(Lg(),{orientation:"vertical",className:e.splitter}),v().createElement(Ag(),{component:"span",className:e.profileNumber},mi().number(o,"0,0")),v().createElement(Ag(),{variant:"body2",component:"span",className:e.profileText},mi().text(" profiles are selected for bulk edit.")),0===n&&v().createElement(v().Fragment,null,v().createElement(nE(),{color:"primary",className:e.clearButton,onClick:()=>{u(Ec())},"data-reltio-id":"reltio-search-bulk-update-"+(a?"select-all-profiles":"clear-selection")},a?`${mi().text("Select all")} ${mi().number(i,"0,0")} ${mi().text("profiles")}`:mi().text("Clear selection")),v().createElement(Mp,{classes:{root:e.searchBox},value:c,onSearch:d,"data-reltio-id":"reltio-search-bulk-update-search-input"}),v().createElement(Lg(),{orientation:"vertical",className:e.splitter}),v().createElement(kd,{entityTypeUri:r,headColumns:l,onSelectColumns:e=>{const t=(0,Pi.tU)(e,l);u(Tc(e)),t&&u(hc())},"data-reltio-id":"reltio-search-bulk-update-add-remove-columns"}))),0===n&&!(0,_.isEmpty)(p)&&v().createElement(OF(),{className:e.searchQueryContainer},mi().text("Search query"),v().createElement(fH,{readableQuery:p,className:e.searchQuery})))};function OW(){return OW=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},OW.apply(this,arguments)}const xW=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",OW({width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},r),v().createElement("defs",null,v().createElement("path",{id:"svg3533951039a",d:"M15 6v5l2 2v2h-4v4l-.992 1L11 19v-4H7v-2l2-2V6H8V4h8v2z"})),v().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},v().createElement("mask",{id:"svg3533951039b",fill:"#fff"},v().createElement("use",{xlinkHref:"#svg3533951039a"})),v().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg3533951039b)",d:"M0 0h24v24H0z"})))};function CW(){return CW=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},CW.apply(this,arguments)}const SW=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",CW({width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},r),v().createElement("defs",null,v().createElement("path",{d:"M9 4a5.002 5.002 0 011 9.9V18h5.24a2.2 2.2 0 110 2H10c-1.11 0-2-.89-2-2v-4.1A5.002 5.002 0 019 4zm.5 2.5h-1v2h-2v1h2v2h1v-2h2v-1h-2v-2z",id:"svg1464898421a"})),v().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},v().createElement("mask",{id:"svg1464898421b",fill:"#fff"},v().createElement("use",{xlinkHref:"#svg1464898421a"})),v().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg1464898421b)",d:"M0 0h24v24H0z"})))},wW=(0,kp.Z)({editor:{marginBottom:0},editorValue:{width:"100%",marginRight:"8px"}}),AW=e=>{let{valueProperty:t,emptyEditorValue:r,attributeType:n,value:a,fieldName:i,onChangeValue:o}=e;const l=wW(),s=!n.uri,c=(0,_.pipe)((0,_.ifElse)((0,_.has)("lookupCode"),_.identity,(0,_.objOf)("value")),(0,_.filter)((e=>void 0!==e)),(0,_.mergeRight)(r))(a);return(0,b.useEffect)((()=>{(0,x.isLookupAttrType)(n)||""===r.value||o(t)(r)}),[]),s?v().createElement("div",{key:t,className:O()(l.editor,l.editorValue),"data-reltio-id":"bulk-update-special-attribute-change-editor"},v().createElement(rL.Z,{fieldName:i,value:a,dataTypeDefinition:(0,x.getAttrDataTypeDefinition)(n),onChange:(0,_.pipe)((0,_.objOf)("value"),o(t)),fullWidth:!0})):v().createElement(PL,{key:t,className:l.editor,mode:x.Mode.Editing,attributeType:n,attributeValue:c,onChangeAttribute:o(t)})},RW={flex:"0 0 auto"},_W=(0,kp.Z)({container:{flexGrow:1,display:"flex",alignItems:"center",margin:0},singleEditor:{marginRight:5,maxWidth:334},to:{color:"#696969",padding:"0 16px 0 7px"},type_Timestamp:RW,type_Boolean:RW,type_Date:RW}),IW=(0,b.memo)((e=>{let{id:t,groupId:r,operation:n,operationParameters:a}=e;const i=_W(),o=(0,Tp.useDispatch)(),{attributeType:l,fieldName:s}=a.attributeTypeData,c=(0,b.useMemo)((()=>(0,x.createNewAttribute)({parentUri:"entities/fakeEntity",attributeType:l})),[l]),u=(0,b.useCallback)((e=>n=>{const{value:a}=n,i=""===a&&(0,x.isLookupAttrType)(l)?{lookupCode:"",value:""}:a;o(Sc({id:t,groupId:r,operationParameters:{[e]:i}}))}),[t,r,l,o]),p=Kc(n).map((e=>v().createElement(AW,{key:e,valueProperty:e,value:a[e],emptyEditorValue:c,fieldName:s,attributeType:l,onChangeValue:u})));if(!p.length)return null;const d=v().createElement("div",{key:"to",className:i.to},mi().text("with"));return v().createElement("div",{className:O()(i.container,i[`type_${l.type}`],{[i.singleEditor]:1===p.length})},2===p.length?(0,_.insert)(1,d,p):p)}));IW.displayName="ChangeEditor";const NW=(0,kp.Z)((()=>({entitySelector:{marginTop:"10px",width:"100%",maxWidth:"452px"},label:{"&:not($labelShrink)":{transform:"translate(12px, 10px)"}},labelShrink:{}}))),DW=e=>{let{attributeType:t,value:r,onChange:n}=e;const a=NW(),i=(0,Tp.useDispatch)(),o=(0,Tp.useSelector)(k().selectors.getMetadata),l=(0,Tp.useSelector)((e=>k().selectors.getGlobalSearchRequestOptions(e,["ovOnly"]))),s=x.Mode.Editing,c=null==r?void 0:r.entityUri,u=(0,x.getReferencedEntityTypeUriFromAttrType)(t),p=(0,b.useCallback)((e=>(0,x.referencedEntityAttributeTypesSelectionStrategy)(t,e)),[t]),d=(0,b.useCallback)((e=>{const{uri:t,type:r,label:a}=e;(0,x.isTempUri)(c)&&i(P.profile.modifiedEntities.actions.entityDeleted(c)),n((0,_.isEmpty)(e)?null:{entityUri:t,entityType:r,entityLabel:a})}),[i,n,c]),m=(0,b.useCallback)(((e,t)=>{const r=(0,x.getEntityType)(o,u),n=(0,_.pipe)(p,(0,x.getCreatableAttributeTypes)(s))(r),a=(0,x.createTemporaryEntity)({entityTypeUri:e,initValue:t,attributeTypes:n,metadata:o,mode:s});d(a),i(P.profile.modifiedEntities.actions.entityCreated(a))}),[i,d,p,o,s,u]);return v().createElement(DU,{className:a.entitySelector,entity:r,entityTypesUris:(0,ci.l0)(u),metadata:o,globalSearchRequestOptions:l,onChange:d,onCreate:m,height:40,disableLinkClick:!0,attributeTypesSelectionStrategy:p,mode:s,TextFieldProps:{InputLabelProps:{classes:{root:a.label,shrink:a.labelShrink}}}})},PW=e=>(0,_.last)(e.type.split("/")),kW=e=>({attributes:{[PW(e)]:[e]}}),LW=(e,t)=>{const r=PW(e);return t.attributes[r][0]},UW=e=>{let{attributeValue:t,onChange:r}=e;const n=(0,b.useRef)(t);n.current=t;const a=(0,b.useCallback)((e=>{let{value:t,attributeType:a,uri:i}=e;const o=kW(n.current),l=(0,x.editAttribute)({entity:o,attributeType:a,uri:i,value:t});r(LW(n.current,l))}),[r]),i=(0,b.useCallback)((e=>{let{attributeType:t,uri:a}=e;const i=kW(n.current),o=(0,x.removeAttribute)({entity:i,attributeType:t,uri:a});r(LW(n.current,o))}),[r]),o=(0,b.useCallback)((e=>{const t=kW(n.current),a=e.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:a}=t;return(0,x.addAttribute)({entity:e,attributeType:r,parentUri:n,index:a})}),t);r(LW(n.current,a))}),[r]),l=(0,b.useCallback)((e=>{const t=(e=>{let{parentAttributeValue:t,uri:r}=e;const n=r.split(t.uri+"/")[1].split("/"),a=[];for(;n.length;){a.push("value");const e=n.shift(),r=n.shift();a.push(e);const i=(0,_.view)((0,_.lensPath)(a),t);if(!i)return null;const o=i.findIndex((e=>{let{uri:t}=e;return t.endsWith("/"+r)}));a.push(o)}return a.length?(a.push("pin"),(0,_.over)((0,_.lensPath)(a),_.not,t)):null})({parentAttributeValue:n.current,uri:e});t&&r(t)}),[r]);return{onChangeAttribute:a,onDeleteAttribute:i,onAddAttributes:o,onTogglePin:l}},jW=(0,kp.Z)((e=>({pinIcon:{marginRight:"-8px"},pinIconActive:{"& svg > g > path":{fill:e.palette.primary.main,fillOpacity:1}}}))),FW=e=>{let{onTogglePin:t,subAttributeValue:r}=e;const n=jW();return v().createElement(wd.k,{icon:xW,onClick:()=>t(r.uri),size:"L",className:O()(n.pinIcon,r.pin&&n.pinIconActive)})},MW=(0,_.curry)(((e,t,r)=>{let{attributeValue:n}=r;return n.uri===e?null:v().createElement(FW,{onTogglePin:t,subAttributeValue:n})}));function VW(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const BW=e=>{let{attributeType:t,attributeValue:r,onChange:n}=e;const a=(0,Tp.useSelector)(k().selectors.getMetadata),i=(0,b.useMemo)((()=>{const e=(0,x.getAttributeTypeSubAttributes)(a,t),r=(0,x.createNewAttribute)({parentUri:"entities/fakeEntity",attributeType:t});return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){VW(e,t,r[t])}))}return e}({},r,{value:(0,x.createDefaultValues)({attributeTypes:e,parentUri:r.uri,metadata:a,mode:x.Mode.Editing})})}),[t,a]),o=r||i,{onChangeAttribute:l,onDeleteAttribute:s,onAddAttributes:c,onTogglePin:u}=UW({attributeValue:o,onChange:n}),p=(0,b.useCallback)(MW(o.uri,u),[o.uri,u]);return v().createElement(YL,{attributeType:t,attributeValue:o,showEmptyEditors:!0,mode:x.Mode.Editing,metadata:a,onAddAttributes:c,onDeleteAttribute:s,onChangeAttribute:l,hideDeleteButton:!0,additionalControlsRenderer:p})};function zW(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const HW=e=>{let{attributeType:t,attributeValue:r,onChange:n}=e;const a=(0,Tp.useSelector)(k().selectors.getMetadata),i=(0,b.useMemo)((()=>{const e=(0,x.getEditableAttributeTypeSubAttributes)(a,t),r=(0,x.createNewAttribute)({parentUri:"entities/fakeEntity",attributeType:t});return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){zW(e,t,r[t])}))}return e}({},r,{value:(0,x.createDefaultValues)({attributeTypes:e,parentUri:r.uri,metadata:a,mode:x.Mode.Editing})})}),[t,a]),o=r||i,{onChangeAttribute:l,onDeleteAttribute:s,onAddAttributes:c,onTogglePin:u}=UW({attributeValue:o,onChange:n}),p=(0,b.useCallback)(MW(o.uri,u),[o.uri,u]);return v().createElement(UU,{attributeType:t,attributeValue:o,showEmptyEditors:!0,mode:x.Mode.Editing,metadata:a,onAddAttributes:c,onDeleteAttribute:s,onChangeAttribute:l,hideDeleteButton:!0,additionalControlsRenderer:p})},YW=e=>{let{operation:t,attributeType:r,attributeValue:n,onChange:a}=e;return t===la.d.RepointReference?v().createElement(DW,{attributeType:r,value:n,onChange:a}):(0,x.isNested)(r)?v().createElement(BW,{attributeType:r,attributeValue:n,onChange:a}):(0,x.isReference)(r)?v().createElement(HW,{attributeType:r,attributeValue:n,onChange:a}):null},WW=(0,_.curry)(((e,t,r)=>(0,_.assoc)(t,(0,_.prop)(e,r),(0,_.dissoc)(e,r)))),GW=(0,_.pipe)((0,_.pick)(["fieldName","title","pathToTitle","attrType"]),WW("attrType","attributeType")),qW=(0,_.unless)(_.isNil,WW("attributeType","attrType")),ZW="1px solid #e4e4e4",$W=(0,kp.Z)((e=>({mainRowContent:{display:"flex",alignItems:"center","&>*":{marginRight:8}},row:{borderBottom:ZW,padding:"17px 34px","&:last-child":{borderBottom:"none"},"&$withoutLine":{borderBottom:"none",paddingTop:"9px",paddingBottom:"9px"}},withoutLine:{},attrSelector:{width:254,height:40,flexShrink:0},operationSelector:{width:190,marginRight:26,flexShrink:0},icons:{flexGrow:0,marginLeft:-5,display:"flex"},actionIcon:{marginRight:2},actionIconActive:{"& svg > g > path":{fill:e.palette.primary.main,fillOpacity:1}}}))),KW={enabled:!0,queueSizeThreshold:5},XW=(0,b.memo)((e=>{let{id:t,operation:r,operationParameters:n,groupId:a,groupAttributeType:i,hasConditions:o}=e;const l=$W(),s=(0,Tp.useDispatch)(),c=(0,Tp.useSelector)(ru),u=(0,ci.l0)(c),{pin:p,addNestedAttribute:d,attributeTypeData:m}=n||{},{attributeType:g}=m||{},y=r&&m,f=(0,b.useCallback)((e=>{let{attribute:r,checked:n}=e;n&&s((e=>{let{id:t,groupId:r,attribute:n}=e;return{type:Gn,payload:{id:t,groupId:r,attribute:n}}})({id:t,groupId:a,attribute:GW(r)}))}),[t,a,s]),h=(0,b.useCallback)((e=>{s(Sc({id:t,groupId:a,operationParameters:{attributeValue:e}}))}),[s,t,a]),E=(0,b.useCallback)((()=>{s((e=>{let{id:t,groupId:r}=e;return{type:na,payload:{id:t,groupId:r}}})({id:t,groupId:a}))}),[t,a,s]),T=(0,b.useCallback)((()=>{s((e=>{let{id:t,groupId:r}=e;return{type:aa,payload:{id:t,groupId:r}}})({id:t,groupId:a}))}),[t,a,s]),C=(0,b.useCallback)((()=>{s(Cc({id:t,groupId:a}))}),[t,a,s]),S=(0,b.useCallback)((e=>{s((e=>{let{id:t,groupId:r,operation:n}=e;return{type:qn,payload:{id:t,groupId:r,operation:n}}})({id:t,groupId:a,operation:e.value}))}),[t,a,s]),w=(0,x.isComplexAttribute)(g)&&[la.d.AddNew,la.d.ReplaceAllWith,la.d.RepointReference].includes(r),A=[la.d.AddNew,la.d.ReplaceAllWith,la.d.FindAndReplace].includes(r)&&!(null==g||!g.uri),R=i&&g&&g.uri===i.uri,I=a&&!R&&r===la.d.AddNew&&!(0,x.isReference)(i),N=(0,b.useMemo)((()=>{return g?(e=g,t=o&&R,(0,_.cond)([[(0,_.both)(x.isNested,(0,_.always)(t)),(0,_.always)((0,_.without)([la.d.AddNew,la.d.ReplaceAllWith],K.DY))],[x.isNested,(0,_.always)(K.DY)],[(0,_.both)(x.isReference,(0,_.always)(t)),(0,_.always)((0,_.without)([la.d.AddNew],K.hS))],[x.isReference,(0,_.always)(K.hS)],[_.T,(0,_.always)(K.pG)]])(e)).map((e=>({value:la.d[e],label:K.WN[e]}))):[];var e,t}),[o,g,R]),D=(0,b.useMemo)((()=>N.find((e=>e.value===r))),[r,N]),P=(0,b.useMemo)((()=>qW(m)),[m]),k=(0,b.useCallback)(i?(0,IY.xM)(i):(0,_.ifElse)(IY.XF,(0,_.pipe)((0,_.pathEq)(["fieldName"],"tags")),(0,_.pipe)((0,_.prop)("attrType"),(0,_.both)((0,_.complement)(x.isImage),(0,_.complement)(x.isAnalyticAttribute)))),[i]),L=(0,b.useCallback)((e=>(0,x.getSearchGroupAttributeLabel)({data:e})),[]);return(0,b.useEffect)((()=>{!D&&N[0]&&m&&S(N[0])}),[N,D,m,S]),(0,b.useEffect)((()=>{p&&!A&&E()}),[A,p,E]),(0,b.useEffect)((()=>{d&&!I&&T()}),[I,d,T]),v().createElement("div",{"data-reltio-id":"bulk-update-dialog-action-row",className:O()(l.row,{[l.withoutLine]:!!a})},v().createElement("div",{className:l.mainRowContent},v().createElement(DY,{className:l.attrSelector,single:!0,showReferencedEntityAttributes:!1,entityTypes:u,value:P,onSelect:f,firstLevelAttributesFilter:k,ungroup:!!a,getLabel:L}),v().createElement(cj,{label:"",isDisabled:!P,placeholder:mi().text("Select operation"),className:l.operationSelector,value:D,options:N,height:40,onChange:S}),y&&v().createElement(v().Fragment,null,!w&&v().createElement(IW,{id:t,groupId:a,operation:r,operationParameters:n}),v().createElement("div",{className:l.icons},A&&v().createElement(wd.k,{className:O()(l.actionIcon,{[l.actionIconActive]:p}),size:"M",tooltipTitle:mi().text("Make this Operational Value"),icon:xW,onClick:E}),I&&v().createElement(wd.k,{className:O()(l.actionIcon,{[l.actionIconActive]:d}),size:"M",tooltipTitle:mi().text("Create parent attribute if none exists"),icon:SW,onClick:T}),v().createElement(wd.k,{size:"M",tooltipTitle:mi().text("Delete"),icon:_p(),onClick:C})))),y&&w&&v().createElement(yL.Provider,{value:KW},v().createElement(YW,{operation:r,attributeType:g,attributeValue:n.attributeValue,onChange:h})))}));var QW=r(80510),JW=r.n(QW);function eG(){return eG=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},eG.apply(this,arguments)}const tG=(0,b.memo)((e=>{let{attributeType:t,showReferencedEntityAttributes:r,subattributesGroupTitle:n,additionalItemsGroups:a}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeType","showReferencedEntityAttributes","subattributesGroupTitle","additionalItemsGroups"]);const o=(0,Tp.useSelector)(k().selectors.getMetadata),l=t.uri.split("/").slice(0,3).join("/"),s=(0,ci.l0)(l),c=(0,b.useCallback)((0,IY.xM)(t),[t]),u=(0,b.useMemo)((()=>(0,_.pipe)(IY.s1,(0,_.when)((0,_.always)(!r),IY.a),(0,_.map)((0,_.evolve)({attributes:(0,_.pathOr)([],[0,"children"]),title:(0,_.when)((0,_.always)(n),(0,_.always)(n))})),(0,_.when)((0,_.always)(a),(0,_.concat)(a)))({firstLevelAttributesFilter:c},o,s)),[a,n,r,s,o,c]);return v().createElement(_Y,eG({},i,{ungroup:!a,itemsGroups:u}))}));function rG(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){nG(e,t,r[t])}))}return e}function nG(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const aG=(e,t)=>(0,Wa.nT)(`${K.E_}_group`,mi().text("Profile"),[rG({},(0,Wa.o)(rG({title:(0,x.getEntityTypeLabel)(t,{type:(0,x.getReferencedEntityTypeUriFromAttrType)(e)}),fieldName:K.E_},e)),{enforcedFilterOptions:[x.FilterOptions.EQUALS]})]),iG=(0,kp.Z)({selector:{width:"254px",height:"40px"}}),oG=(0,b.memo)((e=>{let{rowData:t,rowContext:{attributeType:r,dispatchGroupAction:n},attributeSelectorProps:a={}}=e;const i=iG(),o=(0,Tp.useSelector)(k().selectors.getMetadata),l=t&&t.id,s=(0,b.useMemo)((()=>(0,x.isReference)(r)?[aG(r,o)]:null),[r,o]),c=(0,b.useCallback)((e=>{n(_c,l,e)}),[l,n]);return v().createElement(tG,{className:i.selector,value:t&&t.data,attributeType:r,additionalItemsGroups:s,subattributesGroupTitle:(0,x.isReference)(r)?mi().text("Reference attributes"):"",onSelect:c,onRestoreFocus:a.onRestoreFocus,onOpenPopup:a.onOpen,disableRestoreFocus:a.disablePopoverRestoreFocus,disableEnforceFocus:a.disablePopoverRestoreFocus})}));oG.displayName="ConditionAttributeSelector";const lG=e=>!(e&&e.data),sG=(0,_.pathEq)(["data","fieldName"],K.E_),cG=(0,kp.Z)({selector:{width:"190px"}}),uG=(0,b.memo)((e=>{let{rowData:t,rowContext:{dispatchGroupAction:r},textFieldInputRef:n}=e;const a=cG(),i=t&&t.id,o=(0,b.useCallback)((e=>r(Nc,i,e.value)),[r,i]);return v().createElement(zY,{height:40,className:a.selector,attribute:t,textFieldInputRef:n,isDisabled:lG(t),onChange:o})}));uG.displayName="ConditionFilterSelector";const pG=(0,kp.Z)({input:{margin:0,borderRadius:"4px"},root:{borderRadius:"4px 4px 0 0",padding:0,display:"flex",alignItems:"center",margin:0},entitySelector:{width:"100%"},entitySelectorLabel:{"&:not($entitySelectorLabelShrink)":{transform:"translate(12px, 10px)"}},entitySelectorLabelShrink:{}}),dG=(0,b.memo)((e=>{let{condition:t,dispatchGroupAction:r}=e;const{values:n=[],data:{attrType:a,fieldName:i}={},filter:o}=t,l=pG(),s=(0,Tp.useSelector)(k().selectors.getMetadata),c=(0,Tp.useSelector)((e=>k().selectors.getGlobalSearchRequestOptions(e,["ovOnly"]))),u=(0,b.useCallback)((e=>r(Dc,t.id,e)),[r,t.id]),p=(0,b.useCallback)((e=>{let{uri:t,type:r,label:n}=e;u([{entityUri:t,entityType:r,entityLabel:n}])}),[u]),d=(0,x.getAttrDataTypeDefinition)(a),m=(0,x.getDataTypeDefinitionForFilterValue)(d,o);return sG(t)?v().createElement(DU,{className:l.entitySelector,entity:n[0],entityTypesUris:(0,ci.l0)((0,x.getReferencedEntityTypeUriFromAttrType)(a)),metadata:s,mode:x.Mode.Editing,globalSearchRequestOptions:c,onChange:p,height:40,disableLinkClick:!0,TextFieldProps:{InputLabelProps:{classes:{root:l.entitySelectorLabel,shrink:l.entitySelectorLabelShrink}}}}):v().createElement(WY.n,{filter:{filter:o,fieldName:i,values:n||[]},onChange:u,dataTypeDefinition:m,fullWidth:!0,TextFieldProps:{InputProps:{classes:{root:l.input}}},color:"primary",classes:{root:l.root},orientation:"horizontal"})}));dG.displayName="ConditionValuesEditor";const mG=(0,kp.Z)({root:{width:"100%",display:"flex",minHeight:"40px",alignItems:"flex-start",boxSizing:"border-box"}}),gG=(0,b.memo)((e=>{let{rowData:t,rowContext:{dispatchGroupAction:r}}=e;const n=mG(),a=lG(t),i=t&&(0,x.checkIfOptionHasValues)(t.filter);return v().createElement("div",{className:n.root},!a&&i&&v().createElement(dG,{condition:t,dispatchGroupAction:r}))}));gG.displayName="ConditionValuesEditorWrapper";const yG=(0,kp.Z)({root:{paddingTop:"8px",height:"24px",display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:"0"}}),fG=(0,b.memo)((e=>{let{rowData:t,rowContext:{dispatchGroupAction:r}}=e;const n=yG(),a=t&&t.id,i=(0,b.useCallback)((()=>r(Ic,a)),[a,r]);return t?v().createElement("div",{className:n.root},v().createElement(wd.k,{tooltipTitle:mi().text("Delete"),tooltipPlacement:"bottom",icon:_p(),size:"M",onClick:i})):null}));fG.displayName="ConditionActions";const hG=(0,kp.Z)((e=>({row:{"&:hover $actions":{opacity:1}},logicOperatorContainer:{maxHeight:"40px"},caption:{color:e.palette.text.secondary},conditions:{backgroundColor:"rgba(0,0,0,0.032)",padding:"20px 15px",margin:"7px 0"},actions:{opacity:"0",transition:"opacity 0.3s"}}))),EG=e=>{let{attributeType:t,conditions:r,groupId:n}=e;const a=hG(),i=(0,Tp.useDispatch)(),o=(0,b.useCallback)((function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),a=1;a<t;a++)r[a-1]=arguments[a];return i(e(n,...r))}),[n,i]),l=(0,b.useMemo)((()=>({root:a.row,logicOperatorContainer:a.logicOperatorContainer,actionsContainer:a.actions})),[a]);return v().createElement(v().Fragment,null,v().createElement(Ag(),{variant:"caption",component:"div",className:a.caption},mi().text("If the following conditions are met")),v().createElement(zH,{className:a.conditions,rowClasses:l,rowsData:r,AttributeSelectorComponent:oG,FilterSelectorComponent:uG,ValuesEditorComponent:gG,ActionsComponent:fG,attributeType:t,dispatchGroupAction:o}),v().createElement(Ag(),{variant:"caption",component:"div",className:a.caption},mi().text("Then perform the change")))},bG=(0,kp.Z)((e=>({complexRow:{borderBottom:ZW,padding:"10px 34px 17px","&:last-child":{borderBottom:"none"}},header:{display:"flex",alignItems:"center",marginBottom:"4px"},actionsBlock:{marginTop:"2px",marginLeft:"-34px",marginRight:"-34px"},attributeLabel:{fontSize:"14px",fontWeight:500,color:e.palette.text.secondary},conditionsToggleButton:{marginTop:"1px",marginLeft:"6px",display:"flex",alignItems:"center"},conditionsToggleIcon:{marginRight:"8px",width:"18px",height:"18px",marginTop:"-1px"}})));function vG(){return vG=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vG.apply(this,arguments)}const TG=(0,b.memo)((e=>{let{id:t,fieldName:r,actions:n,conditions:a}=e;const i=bG(),o=(0,Tp.useDispatch)(),l=(0,Tp.useSelector)(ru),s=(0,Tp.useSelector)(k().selectors.getMetadata),c=(0,b.useMemo)((()=>{const e=(0,x.searchUriToAttrUri)(r,l);return(0,x.findAttributeTypeByUri)(s,e,l)}),[s,r,l]),u=!!a,p=((e,t)=>(0,_.any)((0,_.both)((0,_.pipe)((0,_.prop)("operation"),(0,_.includes)(_.__,[la.d.AddNew,la.d.ReplaceAllWith])),(0,_.pathEq)(["operationParameters","attributeTypeData","attributeType","uri"],t.uri)))(e))(n,c),d=(0,b.useCallback)((()=>o({type:Kn,payload:t})),[t,o]),m=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return v().createElement(XW,vG({key:e.id},e,{groupId:t,groupAttributeType:c,hasConditions:u}))};return(0,b.useEffect)((()=>{u||0!==n.length||o(Cc({id:t,groupId:void 0}))}),[t,u,n.length,o]),v().createElement("div",{className:i.complexRow},v().createElement("div",{className:i.header},v().createElement("div",{className:i.attributeLabel},c.label),v().createElement(nE(),{disabled:p,color:"primary",className:i.conditionsToggleButton,onClick:d},u?v().createElement(v().Fragment,null,v().createElement(JW(),{className:i.conditionsToggleIcon}),mi().text("Remove")," "):v().createElement(v().Fragment,null,v().createElement(PH(),{className:i.conditionsToggleIcon}),mi().text("Add")," "),mi().text("conditions"))),a&&v().createElement(EG,{attributeType:c,conditions:a,groupId:t}),v().createElement("div",{className:i.actionsBlock},n.map(m),m()))}));TG.displayName="ComplexActionRow";const OG=(0,kp.Z)({wrapper:{flexGrow:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"flex-start",backgroundColor:"#fafafa",boxSizing:"border-box",padding:30},container:{width:"100%",flex:"1 1 auto",maxWidth:1320,backgroundColor:"white",borderRadius:2,padding:"16px 0 50px",display:"flex",flexDirection:"column"}});function xG(){return xG=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},xG.apply(this,arguments)}const CG=e=>"actions"in e?v().createElement(TG,xG({key:e.id},e)):v().createElement(XW,xG({key:e.id},e)),SG=()=>{const e=OG(),t=(0,Tp.useSelector)(hu);return v().createElement("div",{className:e.wrapper},v().createElement("div",{className:e.container},t.map(CG),v().createElement(XW,null)))};var wG=r(99261),AG=r.n(wG),RG=r(26518),_G=r.n(RG),IG=r(60158),NG=r.n(IG),DG=r(61887),PG=r.n(DG);const kG=(0,kp.Z)((()=>({buttonWrapper:{position:"relative"},progress:{position:"absolute",left:"calc(50% - 12px)",top:"calc(50% - 12px)"}})));function LG(){return LG=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},LG.apply(this,arguments)}const UG=e=>{let{isInProgress:t,disabled:r,circularColor:n="primary",className:a,children:i}=e,o=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["isInProgress","disabled","circularColor","className","children"]);const l=kG();return v().createElement(nE(),LG({},o,{className:O()(l.buttonWrapper,a),disabled:r||t}),i,t&&v().createElement("div",{className:l.progress,"data-reltio-id":"reltio-circular-load-indicator"},v().createElement(Tm(),{size:24,color:n})))},jG=(0,kp.Z)((()=>({container:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"},placeholder:{flex:1},stepper:{padding:"0 24px",flex:2},stepButton:{margin:"-20px -16px",padding:"20px 16px","& svg text":{textAnchor:"middle"}},buttons:{flex:1,display:"flex",justifyContent:"flex-end"},backButton:{marginRight:"8px",border:"1px solid rgba(0, 0, 0, 0.23)"},errorLabel:{color:"#dd2c00 !important"},warningLabel:{color:"#f9a825 !important"}}))),FG=e=>{let{activeStep:t,steps:r,isPending:n=!1,shouldCompleteSteps:a=!0,onConfirm:i,onChangeStep:o}=e;const l=jG(),s=t===r.length-1,c=e=>{e!==t&&o(e)},u=(0,_.propOr)(!0,"enabled"),p=e=>{if(e>0){const t=e-1;u(r[t])?c(t):p(t)}},d=e=>{if(e<r.length-1){const t=e+1;u(r[t])?c(t):d(t)}},m=s&&!!i,g=m||(0,_.any)(u,(0,_.drop)(t+1,r));return v().createElement("div",{className:l.container},v().createElement("div",{className:l.placeholder}),v().createElement(AG(),{nonLinear:!0,activeStep:t,className:l.stepper},r.map(((e,r)=>{let{label:i,enabled:o=!0,hasError:s,hasWarning:u}=e;const p=!o||n,d=a&&!p&&r<t;return v().createElement(_G(),{key:i,completed:d,disabled:p},v().createElement(NG(),{className:l.stepButton,onClick:()=>c(r),"data-reltio-id":`reltio-search-bulk-update-${r}`},v().createElement(PG(),{error:s||u,classes:{error:s?l.errorLabel:l.warningLabel}},i)))}))),v().createElement("div",{className:l.buttons},t>0&&v().createElement(nE(),{variant:"outlined",className:l.backButton,onClick:()=>p(t),disabled:n,"data-reltio-id":"reltio-search-bulk-update-back"},mi().text("Back")),v().createElement(UG,{variant:"contained",color:"primary",disabled:!g,isInProgress:n,onClick:s?i:()=>d(t),"data-reltio-id":"reltio-search-bulk-update-"+(s?"confirm":"continue")},m?mi().text("Confirm"):mi().text("Continue"))))},MG=()=>{const e=(0,Tp.useDispatch)(),t=(0,Tp.useSelector)(eu),r=(0,Tp.useSelector)(fu),n=(0,Tp.useSelector)(Jc),a=!(0,_.isNil)(n),i=(0,Tp.useSelector)(vu),o=(0,Tp.useSelector)(Tu),l=[{label:mi().text("Select profiles")},{label:mi().text("Select operation"),enabled:r},{label:mi().text("Define changes"),enabled:r&&a&&n===K.dV.UpdateProfiles},{label:mi().text("Review changes"),enabled:r&&a&&(i||n===K.dV.DeleteProfiles)}];return v().createElement(FG,{activeStep:t,steps:l,isPending:o,onChangeStep:t=>e((e=>({type:Nn,payload:e}))(t)),onConfirm:()=>e({type:ia})})},VG=(0,kp.Z)((()=>({appBar:{boxShadow:"none"},toolbar:{background:"white",borderBottom:"1px solid rgba(0,0,0,0.1)",boxSizing:"border-box",paddingLeft:"21px"},title:{fontSize:"1.1rem",display:"inline-flex",alignItems:"center"},closeButton:{marginRight:"10px"}}))),BG=e=>{let{children:t,onClose:r}=e;const n=VG();return v().createElement(vF(),{position:"static",color:"default",className:n.appBar},v().createElement(OF(),{className:n.toolbar},v().createElement(wd.k,{edge:"start",tooltipTitle:mi().text("Close"),"aria-label":mi().text("Close"),icon:_p(),onClick:r,className:n.closeButton,size:"L","data-reltio-id":"reltio-search-bulk-update-close"}),v().createElement(Ag(),{variant:"h6",className:n.title},t)),v().createElement(OF(),{className:n.toolbar},v().createElement(MG,null)))};BG.propTypes={children:vp().node,onClose:vp().func};const zG=BG,HG=(0,kp.Z)((()=>({tableContainer:{position:"relative",height:"100%",display:"flex",flexDirection:"column",backgroundColor:"#fff"},pagination:{flexGrow:0,borderTop:"1px solid rgba(0, 0, 0, 0.1)",height:"52px",boxShadow:"none"}}))),YG=(0,_.equals)(K.v6.include);function WG(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const GG=()=>{const e=HG(),t=(0,Tp.useDispatch)(),r=(0,Tp.useSelector)(k().selectors.getMetadata),n=(0,Tp.useSelector)(ru),a=(0,Tp.useSelector)(du),i=(0,Tp.useSelector)(ou),o=(0,Tp.useSelector)(uu),l=(0,Tp.useSelector)(pu),s=(0,Tp.useSelector)(au),c=(0,Tp.useSelector)(su),u=(0,Tp.useSelector)(cu),p=(0,Tp.useSelector)(tu),d=(0,Tp.useSelector)(lu),m=(0,Tp.useSelector)(iu),g=(0,b.useMemo)((()=>((e,t,r)=>(0,_.pipe)((0,_.map)((0,_.prop)("uri")),YG(e)?(0,_.intersection)(t):(0,_.without)(t))(r))(m,d,i)),[m,d,i]),y=((e,t)=>0!==e.length&&(e.length===t.length||null))(g,i),f=(0,b.useMemo)((()=>(0,Pi.oq)(r,n,a)),[r,n,a]),h=(0,b.useCallback)((e=>{let{field:r,order:n}=e;return t((e=>{let{field:t,order:r}=e;return{type:Mn,payload:{field:t,order:r}}})({field:n?r:null,order:n}))}),[t]),E=(0,b.useCallback)((e=>{let{what:r,where:n}=e;const i=(0,_.move)(r.columnIndex,n.columnIndex,a);t(Tc(i))}),[t,a]),T=(0,b.useCallback)((e=>{let{columns:r}=e;const n=(0,Pi.tU)(r,a);t(Tc(r)),n&&t(hc())}),[t,a]),O=(0,b.useCallback)((e=>{const r=a.map(((t,r)=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){WG(e,t,r[t])}))}return e}({},t,{size:e[r].size})));t(Tc(r))}),[t,a]),x=(0,b.useCallback)(((e,r)=>{t(e?((e,t)=>({type:kn,payload:{uri:e,checked:t}}))(e,r):{type:Ln,payload:!y})}),[y,t]),C=(0,b.useRef)(null);return v().createElement("div",{className:e.tableContainer},p&&v().createElement(LE.z,null),v().createElement(gg,{entities:i,entityTypeUri:n,headColumns:a,additionalColumns:f,canCheck:!0,onCheck:x,checkedEntitiesUris:g,headerCheckboxState:y,dndColumnReorderingEnabled:!0,sortField:o,sortOrder:l,onSort:h,onReorderingColumn:E,onChangeColumnsList:T,onChangeColumnsSize:O,entitiesTableRef:C}),s>K.Tu[0]&&v().createElement("div",{className:e.pagination},v().createElement(SE.Z,{count:s,rowsPerPageOptions:K.Tu,rowsPerPage:u||K.Tu[0],page:c||0,onChangePage:e=>t(vc(e)),onChangeRowsPerPage:e=>t((e=>({type:jn,payload:e}))(e)),basicTableRef:C})))},qG=(0,kp.Z)((e=>({tableContainer:{display:"flex",flexDirection:"column",backgroundColor:"#fff",width:"100%",margin:"30px 60px",padding:"24px"},title:{fontSize:"14px",fontWeight:500,letterSpacing:"0.1px",lineHeight:"24px",color:e.palette.text.secondary,marginBottom:"6px"},label:{color:e.palette.text.secondary,fontSize:"14px",letterSpacing:0,lineHeight:"32px",paddingLeft:"7px"},radioButton:{padding:"0 9px"}}))),ZG=()=>{const e=qG(),t=(0,Tp.useDispatch)(),r=(0,Tp.useSelector)(Jc),n=(0,Tp.useSelector)(k().selectors.getCanUserDeleteProfiles);(0,b.useEffect)((()=>{(0,_.isNil)(r)&&t(xc(K.dV.UpdateProfiles))}),[r,t]);const a=(0,_.pipe)(Dp.NA,xc,t);return v().createElement("div",{className:e.tableContainer},v().createElement(Ag(),{className:e.title},mi().text("Choose Bulk Update Operation")),v().createElement(_h(),{value:r,onChange:a},v().createElement(Nh(),{classes:{label:e.label},value:K.dV.UpdateProfiles,control:v().createElement(Ah(),{className:e.radioButton}),label:mi().text("Update Profiles - Update attribute values of selected profiles")}),v().createElement(Nh(),{disabled:!n,classes:{label:e.label},value:K.dV.DeleteProfiles,control:v().createElement(Ah(),{className:e.radioButton}),label:mi().text("Delete Profiles - Delete selected profiles")})))};var $G=r(49850),KG=r.n($G),XG=r(28012),QG=r.n(XG),JG=r(18878),eq=r.n(JG),tq=r(70918),rq=r.n(tq),nq=r(51159),aq=r.n(nq),iq=r(35681),oq=r.n(iq);const lq=e=>{let{value:t,attributeType:r,lookups:n}=e;return(0,x.isLookupAttrType)(r)&&"string"==typeof t&&(t={lookupCode:t,value:(0,x.getResolvedLookupValue)(n,(0,x.getAttrTypeLookupCode)(r),t)}),v().createElement(Xd.x,{dataTypeDefinition:(0,x.getAttrDataTypeDefinition)(r),value:t})},sq=e=>{let{operation:t}=e;return v().createElement(v().Fragment,null,K.WN[t])},cq=e=>{let{conditions:t,attributesPresentation:r,metadata:n,lookups:a}=e;if((0,x.isEmptyValue)(t))return v().createElement(v().Fragment,null,"-");const i=(0,x.buildAttributesReadableQuery)(n,r,a,t,!1);return v().createElement(fH,{readableQuery:i})},uq="8px",pq="1px",dq="1px solid #AFD4E9",mq=(0,kp.Z)((e=>({scaffoldsContainer:{height:"calc(100% + 24px)",margin:"-12px 0"},scaffold:{width:"32px",height:"100%",position:"relative",display:"inline-block",verticalAlign:"middle"},scaffoldFullVert:{"&:before":{content:'""',position:"absolute",display:"block",boxSizing:"border-box",height:"100%",width:pq,left:uq,top:0,borderLeft:dq}},scaffoldHalfVert:{"&:before":{content:'""',position:"absolute",display:"block",boxSizing:"border-box",height:"50%",width:pq,left:uq,top:0,borderLeft:dq}},scaffoldHor:{"&:after":{content:'""',position:"absolute",display:"block",boxSizing:"border-box",height:pq,width:"5px",left:uq,top:"50%",borderBottom:dq}},noWrapContainer:{display:"inline-flex",verticalAlign:"middle",height:"100%",alignItems:"center","& > *":{flexShrink:0}},optionContainer:{width:"20px","& svg g path":{fill:e.palette.primary.main,fillOpacity:1},"& + &":{paddingLeft:"4px"}},opaque:{opacity:0},newIcon:{color:"#599E0E",marginLeft:"10px",borderRadius:"16px",padding:"2px 12px",border:"2px solid rgba(89,158,14,0.3)",fontSize:"10px",lineHeight:"16px"},nestedLabel:{width:"100%"}}))),gq=e=>{let{attributeTypeData:{pathToTitle:t,title:r}}=e;const n=mq();return Boolean(t&&t.length>2)?v().createElement(vf,{placement:"bottom-start",pathToTitle:t},v().createElement("span",{className:n.nestedLabel},r)):v().createElement(v().Fragment,null,r)};function yq(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function fq(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){hq(e,t,r[t])}))}return e}function hq(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Eq={EMPTY:"empty",FULL_VERT:"full_vert",FULL_VERT_HOR:"full_vert_hor",HALF_VERT_HOR:"half_vert_hor"},bq=e=>e.map(((t,r)=>(e=>{let{hasLowerSubAttrs:t,isFirstValue:r,isLastScaffold:n}=e;const a=n&&r;return t?a?Eq.FULL_VERT_HOR:Eq.FULL_VERT:a?Eq.HALF_VERT_HOR:Eq.EMPTY})(fq({},t,{isLastScaffold:r===e.length-1})))),vq=e=>{let{operation:t,operationParameters:r}=e;return(0,x.wrapInArrayIfNeeded)(fq({},r,{operation:t}))},Tq=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];const a=(0,x.findAttributeTypeByUri)(e,t.type),i=a.label||a.name,o={attributeTypeData:{attributeType:a,title:i,pathToTitle:[...r,i]},scaffolds:bq(n),pin:t.pin};if((0,x.isComplexAttribute)(a)){const a=Object.values(t.value),l=a.flatMap(((t,o)=>t.flatMap(((t,l)=>{const s={hasLowerSubAttrs:a.length-o-1>0,isFirstValue:0===l};return Tq(e,t,[...r,i],[...n,s])}))));return[o,...l]}return[fq({},o,{attributeValue:(0,x.getAttributeValue)(t)})]},Oq=(0,_.curry)(((e,t)=>{let{operation:r,operationParameters:n}=t;const{attributeValue:a,attributeTypeData:i}=n,o=yq(n,["attributeValue","attributeTypeData"]),[l,...s]=Tq(e,a,i.pathToTitle.slice(0,-1));return[fq({},l,{operation:r},o),...s]})),xq=(0,_.curry)(((e,t)=>{let{operation:r,operationParameters:n}=t;const{attributeValue:a,attributeTypeData:i}=n,o=yq(n,["attributeValue","attributeTypeData"]),[l,...s]=Tq(e,a,i.pathToTitle.slice(0,-1)),{label:c,refEntity:u}=a,[{objectURI:p,type:d}]=u;return[fq({},l,{operation:r},o,{attributeValue:{entityUri:p,entityLabel:c,entityType:d}}),...s]})),Cq=(0,_.curry)(((e,t)=>(0,_.cond)([[Gc,Oq(e)],[qc,xq(e)],[_.T,vq]])(t))),Sq=(0,_.curry)(((e,t)=>(0,_.pipe)((0,_.defaultTo)([]),(0,_.chain)((0,_.ifElse)(Lc,(0,_.pipe)(Uc,Sq(e)),Cq(e))))(t))),wq=e=>{let{scaffold:t}=e;const r=mq();return v().createElement("div",{className:O()(r.scaffold,{[r.scaffoldFullVert]:t===Eq.FULL_VERT||t===Eq.FULL_VERT_HOR,[r.scaffoldHalfVert]:t===Eq.HALF_VERT_HOR,[r.scaffoldHor]:t===Eq.FULL_VERT_HOR||t===Eq.HALF_VERT_HOR})})};wq.propTypes={scaffold:vp().oneOf((0,_.values)(Eq))};const Aq=e=>{let{scaffolds:t}=e;const r=mq();return v().createElement("div",{className:r.scaffoldsContainer},t.map(((e,t)=>v().createElement(wq,{key:t,scaffold:e}))))};Aq.propTypes={scaffolds:vp().arrayOf(wq.propTypes.scaffold)};const Rq=Aq,_q=e=>{let{children:t}=e;const r=mq();return v().createElement("div",{className:r.noWrapContainer},t)};_q.propTypes={children:vp().node};const Iq=_q,Nq=e=>{let{pin:t,addParent:r}=e;const n=mq();return v().createElement(Iq,null,v().createElement("div",{className:O()(n.optionContainer,{[n.opaque]:!t})},v().createElement(xW,null)),v().createElement("div",{className:O()(n.optionContainer,{[n.opaque]:!r})},v().createElement(SW,null)))};Nq.propTypes={pin:vp().bool,addParent:vp().bool};const Dq=Nq,Pq=e=>{let{entity:{entityLabel:t,entityUri:r},attributeType:n}=e;const a=mq(),i=(0,Tp.useSelector)((e=>k().selectors.getModifiedEntity(e,r)))||null,o=(0,Tp.useSelector)(k().selectors.getMetadata),l=(0,b.useCallback)((()=>{const e=(0,x.getReferencedEntityTypeUriFromAttrType)(n),t=(0,x.getEntityType)(o,e);return(0,x.evaluateDeepEntityLabel)(i,t.dataLabelPattern)}),[n,o,i]),s=i?l():t;return v().createElement(Iq,null,(0,x.getLabel)(s),(0,x.isTempUri)(r)&&v().createElement("div",{className:a.newIcon},mi().text("New")))},kq=(0,kp.Z)((()=>({tableContainer:{width:"90%",maxWidth:"1320px",margin:"30px auto",boxShadow:"0 2px 2px 0 rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.12), 0 1px 5px 0 rgba(0,0,0,0.2)"},table:{height:0,"& td, & th":{padding:"12px",overflowWrap:"anywhere"},"& th":{fontSize:"12px"},"& td":{fontSize:"13px"},"& tr":{"& > *:first-child":{paddingLeft:"24px"},"& > *:last-child":{paddingRight:"24px"}}},attributeColumn:{width:"35%"},conditionColumn:{width:"20%"},operatorColumn:{width:"10%"},valueColumn:{width:"15%"},optionsColumn:{width:"5%"}}))),Lq=()=>{const e=kq(),t=(0,Tp.useSelector)(Eu),r=(0,Tp.useSelector)(k().selectors.getMetadata),n=(0,Tp.useSelector)(k().selectors.getAttributesPresentation),a=(0,Tp.useSelector)(k().selectors.getLookups),i=(0,b.useMemo)((()=>Sq(r,t)),[t,r]);return v().createElement(rq(),{className:e.tableContainer,component:JI()},v().createElement(KG(),{className:e.table},v().createElement(aq(),null,v().createElement(oq(),null,v().createElement(eq(),{className:e.attributeColumn},mi().text("Attribute")),v().createElement(eq(),{className:e.conditionColumn},mi().text("Condition")),v().createElement(eq(),{className:e.operatorColumn},mi().text("Operator")),v().createElement(eq(),{className:e.valueColumn,colSpan:2}),v().createElement(eq(),{className:e.valueColumn}),v().createElement(eq(),{className:e.optionsColumn}))),v().createElement(QG(),null,i.map(((e,t)=>{let{scaffolds:i,attributeTypeData:o,conditions:l,operation:s,attributeValueToFind:c,attributeValue:u,pin:p,addNestedAttribute:d}=e;const m=!(0,_.isNil)(u),g=!(0,_.isNil)(c);return v().createElement(oq(),{key:t},v().createElement(eq(),null,v().createElement(Iq,null,i&&v().createElement(Rq,{scaffolds:i}),v().createElement(gq,{attributeTypeData:o}))),v().createElement(eq(),null,v().createElement(cq,{attributesPresentation:n,metadata:r,lookups:a,conditions:l})),v().createElement(eq(),null,s&&v().createElement(sq,{operation:s})),v().createElement(eq(),null,g&&v().createElement(lq,{lookups:a,attributeType:o.attributeType,value:c})),v().createElement(eq(),{align:"right"},g&&m&&v().createElement(Iq,null,v().createElement("span",null,mi().text("with")))),v().createElement(eq(),null,m&&((0,x.isReference)(o.attributeType)?v().createElement(Pq,{entity:u,attributeType:o.attributeType}):v().createElement(lq,{lookups:a,attributeType:o.attributeType,value:u}))),v().createElement(eq(),{align:"right"},v().createElement(Dq,{pin:p,addParent:d})))})))))},Uq=(0,kp.Z)((e=>({tableContainer:{display:"flex",flexDirection:"column",backgroundColor:"#fff",width:"100%",margin:"30px 60px",padding:"24px"},text:{paddingTop:"2px",paddingBottom:"1px","& p":{fontSize:"14px",lineHeight:"16px",margin:0,letterSpacing:0,color:e.palette.text.primary}}}))),jq=()=>{const e=Uq(),t=(0,Tp.useSelector)(Jc),r=(0,Tp.useSelector)(yu);return t===K.dV.UpdateProfiles?v().createElement(Lq,null):v().createElement("div",{className:e.tableContainer},v().createElement("div",{className:e.text},v().createElement("p",null,`${mi().text("Please confirm that you wish to start deletion of the selected")}`,v().createElement("b",null,` ${mi().number(r,"0,0")} `),mi().text(" profiles.")),v().createElement("p",null,mi().text("Click on Confirm to proceed."))))},Fq=(0,kp.Z)((()=>({contentRoot:{padding:"0 0 5px",position:"relative",backgroundColor:"#FAFAFA"},tenantLabel:{marginLeft:"23px"}}))),Mq=()=>{const e=Fq(),t=(0,Tp.useSelector)(ki.Ue),r=(0,Tp.useSelector)(eu),n=(0,Tp.useDispatch)(),a=()=>n(Di(!1));return v().createElement(kj(),{fullScreen:!0,open:t,onClose:a,disableEnforceFocus:!0},v().createElement(zG,{onClose:a},mi().text("Bulk update"),v().createElement(bW,{className:e.tenantLabel})),v().createElement(TW,null),v().createElement(EF(),{classes:{root:e.contentRoot}},(()=>{switch(r){case 0:return v().createElement(GG,null);case 1:return v().createElement(ZG,null);case 2:return v().createElement(SG,null);case 3:return v().createElement(jq,null)}})()))},Vq="1px solid rgba(0, 0, 0, 0.33)",Bq=(0,kp.Z)((e=>({root:{fontFamily:"Roboto, Helvetica, Arial, sans-serif",display:"flex",overflow:"hidden",position:"absolute",top:0,left:0,bottom:0,right:0},drawer:{flex:"0 0 288px!important"},docked:{flex:"0 0 288px"},drawerPaper:{width:288,display:"flex",flexDirection:"column",position:"relative",borderRight:Vq},mainContent:{transition:e.transitions.create("margin",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen}),backgroundColor:"white",marginLeft:-288},"mainContent--shifted":{transition:e.transitions.create("margin",{easing:e.transitions.easing.easeOut,duration:e.transitions.duration.enteringScreen}),marginLeft:0},menuIcon:{width:"24px",height:"24px",flexShrink:0,marginRight:"12px"},goToActionIcon:{marginLeft:"12px"},buttonRoot:{flexShrink:0},buttonExtended:{width:"256px",margin:"8px 16px",padding:"12px",backgroundColor:"rgba(0,0,0,0)",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)","&:hover":{backgroundColor:"rgba(0,0,0,0.1)"}},buttonLabel:{flexGrow:1,textAlign:"left",color:e.palette.text.secondary,fontSize:"14px",fontWeight:500,letterSpacing:0,lineHeight:"16px"},quickFilterRoot:{lineHeight:"16px",fontWeight:100,color:"rgba(0,0,0, 0.54)",letterSpacing:"normal",display:"flex",padding:"8px 0 16px 16px",flexShrink:0},withBottomBorder:{borderBottom:Vq,boxShadow:"0 1px 3px 0 rgba(0,0,0,0.12)"}}))),zq=(0,yd.T)(_g()),Hq=(0,Tp.connect)((e=>({isReadyAppData:!!(0,ki.$s)(e),openAdvancedSearch:(0,ki.IJ)(e),tenant:k().selectors.getTenant(e)})))((e=>{let{openAdvancedSearch:t,isReadyAppData:r,tenant:n,dispatch:a}=e;const i=(0,b.useCallback)((()=>{a({type:L.k.CONVERT_FROM_ADVANCED_SEARCH}),a(xi(!1))}),[a]),o=(0,b.useCallback)((()=>{a(xi(!0)),a({type:ht})}),[a]),[l,s]=(0,b.useState)(!0),c=(0,b.useCallback)((e=>{s(e<=0)}),[]),u=Bq(),p=!t;return(0,b.useEffect)((()=>()=>x.memoizeWith.clearCache()),[n]),r?v().createElement(v().Fragment,null,v().createElement("div",{className:u.root},v().createElement(Sg,{variant:"persistent",anchor:"left",open:p,classes:{root:u.drawer,paper:u.drawerPaper,docked:u.docked},"data-reltio-id":"reltio-search-facet-search-panel"},v().createElement(zq,{tooltipTitle:mi().text("Switch to Advanced search"),tooltipPlacement:"bottom-end",variant:"extended",classes:{root:u.buttonRoot,extended:u.buttonExtended},onClick:o,"data-reltio-id":"reltio-search-advanced-search-button"},v().createElement(Ng(),{color:"primary",className:u.menuIcon}),v().createElement("span",{className:u.buttonLabel},mi().text("Advanced search")),v().createElement(Pg(),{color:"action",className:u.goToActionIcon})),v().createElement(Ag(),{variant:"button",classes:{root:O()(u.quickFilterRoot,{[u.withBottomBorder]:!l})}},mi().text("Quick filters")),v().createElement(Gh,{onScroll:c})),v().createElement(Zh,{className:O()(u.mainContent,{[u["mainContent--shifted"]]:p})},v().createElement(yW,{isOpenAdvancedSearch:t,onCloseAdvancedSearch:i}))),v().createElement(Xh,null),v().createElement(uE,null),v().createElement(Mq,null)):null})),Yq=bg()({productionPrefix:"searchTable",disableGlobal:!0,seed:"srch"});x.userPreferencesComparator.register("searchState",((e,t)=>(0,x.looseEquals)((0,_.omit)(["query"],e),(0,_.omit)(["query"],t))));const Wq=()=>v().createElement(yg.DynamicModuleLoader,{modules:[Ep()]},v().createElement(Tg(),{generateClassName:Yq},v().createElement(hg._,{dateAdapter:fg.Q},v().createElement(Hq,null))))}}]);
1
+ "use strict";(self.webpackChunk_reltio_segmentation=self.webpackChunk_reltio_segmentation||[]).push([[210],{39210:(e,t,r)=>{r.r(t),r.d(t,{ConfigureColumnsButton:()=>kd,DEFAULT_SEARCH_SELECT:()=>K.Tv,EntitiesTableWithConfigurableColumns:()=>gg,EntityAvatar:()=>A,ROWS_PER_PAGE_OPTIONS:()=>K.Tu,buildQueryForAdvancedSearchGroups:()=>Ba.Jk,buildSelectFromColumns:()=>Pi.vw,collectSpecialColumns:()=>Pi.oX,createRecentSearch:()=>Cs,default:()=>Wq,getActiveEntityTypeTab:()=>ki.tB,getAdditionalColumns:()=>Pi.oq,getDataTenant:()=>ui.lF,getEntityTypeLabel:()=>x.getEntityTypeLabel,getEntityTypeTab:()=>ki.o4,getModule:()=>Ep,getPage:()=>ui.fx,getRowsPerPage:()=>ui.Uz,getSearchResultsMode:()=>ki.XM,getSearchUrlQuery:()=>xo.Cc,getSerializedSearchState:()=>So.Z,getTotal:()=>ui.NU,needRequestAfterColumnsChanges:()=>Pi.tU,parseSearchState:()=>_s.Z,queryBuilderHelpers:()=>n,queryBuilderSagas:()=>a,replaceSearchResultsColumns:()=>_s.f,showMoreResultsForEntityTypeAction:()=>Ja,showSavedSearchesDialogAction:()=>Ti});var n={};r.r(n),r.d(n,{PROP_NAME_FILTER:()=>xt,PROP_NAME_OPERATOR:()=>Tt,PROP_NAME_VALUES:()=>Ot,addAttributeAfter:()=>kt,changeAttributeData:()=>Lt,createGetAttributeIndex:()=>It,createGetAttributeLens:()=>Nt,createGetAttributeProp:()=>Pt,createGetAttributesLens:()=>_t,createGetGroupLens:()=>Rt,createSetAttributeProp:()=>Dt,defaultFindGroupPath:()=>At,deleteAttribute:()=>jt,duplicateAttribute:()=>Ft,getAttributeData:()=>wt,getAttributeObject:()=>St,getEmptyAttributeObject:()=>Ct,setAttributeOperator:()=>Ut,setFilter:()=>Mt,setValues:()=>Vt});var a={};r.r(a),r.d(a,{toggleQueryBuilderAttributeSelect:()=>ol});var i={};r.r(i),r.d(i,{addAttributes:()=>Eb,addDefaultValuesAction:()=>bb,addNextPageOfAttributeValues:()=>Ob,modifyAttribute:()=>vb,processNextPageOfAttributeValues:()=>xb,profileSaved:()=>Rb,removeAttribute:()=>Tb,requestNextPageOfAttributeValues:()=>Cb,runAuthoringTaskAction:()=>wb,saveDraft:()=>Ab,saveProfile:()=>Sb,validateProfile:()=>_b});var o={};r.r(o),r.d(o,{dependentLookupsEditorTouched:()=>kb,dependentLookupsEditorsBlocked:()=>Pb,dependentLookupsInitedTypeUrisAdded:()=>Db,dependentLookupsStructureSet:()=>Nb});var l={};r.r(l),r.d(l,{activityFilterUpdated:()=>Jb,globalFilterUpdated:()=>ev,keywordUpdated:()=>Kb,saveState:()=>Qb,searchResultsSet:()=>$b,setSearchNavigationData:()=>av,setSearchOptionsConfig:()=>rv,setSearchProviderData:()=>nv,updateSearchNavigationDataFields:()=>iv,updateSearchNavigationDataOnMerge:()=>ov,updateSearchOptions:()=>tv,updateState:()=>Xb});var s={};r.r(s),r.d(s,{addDashboardExternalView:()=>qv,autocloseIntervalLoaded:()=>Rv,clearNotifications:()=>Ov,closeNotification:()=>Tv,dateMaskUpdated:()=>Lv,dateTimeMaskUpdated:()=>Uv,documentationSet:()=>Gv,entityDeletionFinished:()=>Ev,errorSet:()=>Wv,keysSet:()=>Hv,localeAttributePresentationLoaded:()=>Av,localizationLoaded:()=>kv,navigateTo:()=>zv,newEntityShown:()=>hv,newUiConfigLoaded:()=>wv,numberFormatUpdated:()=>Iv,openAppFromChocolateBar:()=>Dv,openConsoleApp:()=>Nv,openDashboard:()=>Fv,openEntity:()=>fv,openGraph:()=>Pv,openHistoryEvent:()=>Mv,openNewEntityWithAuthoring:()=>Vv,openPerspective:()=>bv,openPivotingPerspective:()=>Yv,openPreviousPage:()=>Bv,openSearch:()=>jv,pathsSet:()=>xv,setPreferReact:()=>_v,setUseSharedPreferences:()=>Zv,showNotification:()=>vv,uiConfigLoaded:()=>Sv,uiPathSet:()=>Cv});var c={};r.r(c),r.d(c,{getAbsoluteImagePath:()=>Qx,getActiveErrorsForAttributesPager:()=>JO,getActivityFilter:()=>Nx,getAdminToolsPath:()=>ox,getAiAssistantEnabled:()=>Cx,getAiAssistantHistoryBufferSize:()=>Ax,getAiAssistantLimitPerDay:()=>Sx,getAiAssistantSkills:()=>wx,getAllRelationsToAddAndEdit:()=>qx,getAllRelationsToSave:()=>Zx,getAllServicesPaths:()=>bC,getAllTreesEditingConnections:()=>lC,getApiPath:()=>tx,getAttributeTypeErrors:()=>XO,getAttributesErrors:()=>QO,getAttributesPresentation:()=>lx,getAttributesSortingStrategy:()=>IS,getAuthoringByEntityType:()=>DS,getAutoCloseInterval:()=>ux,getCanSuggestAuthoring:()=>FS,getCanUserCreateWorkflowConfigJar:()=>AC,getCanUserCreateWorkflowEnvironmentConfigJar:()=>RC,getCanUserDeleteProfiles:()=>KC,getCanUserExecuteWorkflowJobs:()=>_C,getCanUserExecuteWorkflowJobsSyncBusinessProcessData:()=>IC,getCanUserExecuteWorkflowJobsTerminateProcessInstance:()=>NC,getCanUserExecuteWorkflowJobsUpdateTasks:()=>DC,getCanUserExecuteWorkflowJobsValidateTasks:()=>PC,getCanUserGetDQStatistic:()=>QC,getCanUserImportEntitiesFromDT:()=>GC,getCanUserMakeActivitiesExport:()=>WC,getCanUserMakeBulkUpdate:()=>$C,getCanUserMakeExport:()=>YC,getCanUserManageWorkflowDefinition:()=>kC,getCanUserManageWorkflowEnvironmentDefinition:()=>LC,getCanUserOpenDataLoader:()=>XC,getCanUserReadDVF:()=>JC,getCanUserReadEntitiesFromDT:()=>qC,getCanUserReadWorkflowDataTask:()=>UC,getCanUserRegisterConfigEnvironments:()=>wC,getCanUserStartProcessFromQuery:()=>ZC,getCanUserUpdateProcessInstance:()=>jC,getCanUserUpdateWorkflowDataTask:()=>FC,getCanUserViewProcessInstanceSearchQuery:()=>MC,getCanUserViewWorkflowConfigJar:()=>VC,getCanUserViewWorkflowDefinition:()=>BC,getCanUserViewWorkflowEnvironmentConfigJar:()=>zC,getCanUserViewWorkflowJobs:()=>HC,getCheckIfCanAddRelations:()=>fS,getCleanseByEntityType:()=>PS,getCollaborationPath:()=>OC,getConnectionsByViewId:()=>DO,getConnectionsTemporaryUrisForCreation:()=>jO,getConnectionsWithDraftsByViewId:()=>LO,getControlAttributes:()=>jS,getDBConnectorSideViews:()=>sS,getDVFPath:()=>xC,getDataTenants:()=>vO,getDateMask:()=>px,getDateTimeMask:()=>dx,getDependentLookupEditorState:()=>gS,getDependentLookupEditorsState:()=>mS,getDependentLookups:()=>cS,getDependentLookupsInitedTypeUris:()=>dS,getDependentLookupsStructure:()=>uS,getDependentLookupsStructureNode:()=>pS,getDocReleaseNotes:()=>SS,getDraftsForSaveByViewId:()=>UO,getDtssPath:()=>fC,getEditingOrAddingConnectionByViewIdAndRelationUri:()=>PO,getEditingOrAddingConnectionRelationObjectByViewIdAndRelationUri:()=>kO,getEntity:()=>_O,getEntityRelatedAttributesByAttributeTypeUri:()=>KO,getEntityUri:()=>IO,getEntityUriWithDataTenant:()=>NO,getEntityWithDiff:()=>hS,getEntityWithoutDiff:()=>ES,getEnvironment:()=>gC,getEnvironmentAlias:()=>yC,getEnvironmentObject:()=>CO,getExportDQPath:()=>hC,getExportPath:()=>rx,getGlobalFilter:()=>jx,getGlobalFilterQuery:()=>Fx,getGlobalFilterSavedSearchesUris:()=>Mx,getGlobalSearchRequestOptions:()=>Lx,getGoogleMapKey:()=>Ex,getHeaderColor:()=>AS,getHiddenAttributes:()=>US,getHistoryDiff:()=>zO,getHistoryEvent:()=>HO,getHistoryMode:()=>GO,getHistorySlice:()=>YO,getIcpLicenseKey:()=>bx,getImageAttributesFieldsOrder:()=>fx,getImagePath:()=>ex,getImageServicePath:()=>ix,getInitialConnection:()=>Kx,getInitialConnectionTempEntity:()=>$x,getIsAuthoringMode:()=>kS,getIsEditableMode:()=>Bx,getIsHistoryModeEnabled:()=>WO,getIsSuggestMode:()=>Hx,getIsViewMode:()=>zx,getLogo:()=>wS,getLookupAutocomplete:()=>hx,getLookups:()=>MO,getMaxValuesInResponse:()=>cx,getMetadata:()=>OO,getMlDqPath:()=>SC,getMode:()=>Vx,getModifiedEntities:()=>$O,getModifiedEntity:()=>qO,getModifiedEntityDefaultProfilePic:()=>ZO,getNotifications:()=>gx,getPivotingAttributes:()=>yx,getProfile:()=>AO,getProfileCancelNeedConfirm:()=>pC,getProfileCheckUpdate:()=>NS,getProfileErrors:()=>VO,getProfileLastLoadedTime:()=>sC,getProfileOperation:()=>cC,getProfileViews:()=>uC,getQueryEstimatorEnabled:()=>LS,getRelationToAddByViewId:()=>Wx,getRelations:()=>Yx,getRelationsToEditByViewId:()=>Gx,getRelationsViewIds:()=>BO,getReleaseVersion:()=>CS,getReltioPath:()=>ax,getRequestProviderConfiguration:()=>mx,getSearch:()=>RO,getSearchKeyword:()=>Ix,getSearchNavigationData:()=>kx,getSearchOptions:()=>Dx,getSearchProviderData:()=>Px,getSearchResults:()=>_x,getServicesPath:()=>bS,getSharedPreferencesEnabled:()=>Rx,getShowAttributeDescription:()=>_S,getShowEntityId:()=>xS,getShowSearchByOv:()=>RS,getStringifiedSearchOptions:()=>Ux,getTenant:()=>dC,getTenantName:()=>mC,getTenantObject:()=>xO,getTenants:()=>TO,getTotalByViewId:()=>FO,getTree:()=>rC,getTreeCommands:()=>iC,getTreeEditingConnection:()=>oC,getTreeRoot:()=>nC,getTreeTotal:()=>aC,getTrees:()=>tC,getUIConfig:()=>vS,getUIConfigLayout:()=>TS,getUIConfigProfile:()=>OS,getUIPath:()=>nx,getUi:()=>wO,getUiError:()=>yS,getUiNumberFormat:()=>sx,getUser:()=>SO,getUserName:()=>Jx,getUserRoles:()=>eC,getValidateReadMode:()=>Tx,getValidateReferenceEntityInReadMode:()=>xx,getValidateRelations:()=>Ox,getValidationServicePath:()=>CC,getValidationServiceSeverityLevels:()=>vx,getViewIdsForOpenRelation:()=>Xx,getWorkflowConfigurationEnabled:()=>TC,getWorkflowEnvironmentUrl:()=>vC,getWorkflowPath:()=>EC,isCollaborationEnabled:()=>eS,isCollaborationSideViewEnabled:()=>iS,isDBConnectorSideViewEnabled:()=>lS,isHistorySideViewEnabled:()=>oS,isWorkflowEnabled:()=>tS,isWorkflowSideViewEnabled:()=>aS});var u={};r.r(u),r.d(u,{authoringDcrResolved:()=>yw,authoringDraftEntitiesLoaded:()=>gw,clearEntity:()=>Ew,entityCloneRequested:()=>hw,entityCreationRequested:()=>dw,entityCreationWithAuthoringRequested:()=>mw,entityLoaded:()=>cw,entityRemoveRequested:()=>fw,loadEntity:()=>pw,setDefaultProfilePic:()=>uw});var p={};r.r(p),r.d(p,{errorDeactivated:()=>Sw,errorsSet:()=>ww});var d={};r.r(d),r.d(d,{clearHistoryDiff:()=>Dw,clearHistoryEvent:()=>kw,setHistoryDiff:()=>Nw,setHistoryEvent:()=>Pw,setHistoryMode:()=>Uw,setHistorySlice:()=>Lw});var m={};r.r(m),r.d(m,{lookupsForTypeResolved:()=>Hw,lookupsListResolved:()=>Yw,lookupsLoaded:()=>zw});var g={};r.r(g),r.d(g,{modeEditingCanceled:()=>Kw,modeUpdateRequested:()=>$w,modeUpdated:()=>Zw});var y={};r.r(y),r.d(y,{cleanseLoading:()=>iA,entityCreated:()=>tA,entityDeleted:()=>rA,modifiedEntitiesReset:()=>aA,setDefaultProfilePic:()=>nA});var f={};r.r(f),r.d(f,{addRelation:()=>vA,closeRelationEditor:()=>xA,editRelation:()=>TA,ignoreRelation:()=>bA,openRelationEditor:()=>OA,relationsLoaded:()=>fA,removeRelation:()=>EA,secondLevelRelationsLoaded:()=>hA,setInitialInfo:()=>wA,setRelationEntity:()=>SA,setRelationType:()=>CA});var h={};r.r(h),r.d(h,{hiddenAttributesReset:()=>hI,hiddenAttributesUpdated:()=>fI});var E={};r.r(E),r.d(E,{controlAttributesUpdated:()=>vI}),r(69448);var b=r(8156),v=r.n(b),T=r(78310),O=r.n(T),x=r(2396),C=r(55743),S=r.n(C),w=r(13639);const A=e=>{let{entity:t,avatarClassName:r,imageClassName:n}=e;const a=(0,w.AH)(),i=(0,w.$H)()||"",o=(0,x.getEntityImage)(a,i,t),l=(0,x.getAbsoluteImageUrl)(i,(0,x.getEntityTypeImage)(a,t.type)),s=e=>{e.target.onError=null,e.target.src=(0,x.svg2Url)('\n<svg width="400px" height="400px" viewBox="0 0 400 400" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>Group</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="Group" fill-rule="nonzero">\n <rect id="Rectangle" fill="#DFE5E9" x="0" y="0" width="400" height="400"></rect>\n <path d="M0,387.023257 L0,399.918908 L400,399.918908 L400,386.023594 C366.631,377.336524 321.866,364.269931 315.979,359.161654 C308.985,353.083704 270.481,310.508063 270.481,310.508063 L270.481,286.186267 C270.481,286.186267 284.478,266.204006 284.478,261.854473 C284.478,257.515936 285.353,246.219746 291.481,241.011503 C297.61,235.792263 311.607,211.471466 312.481,206.253226 C313.355,201.043983 319.484,188.009379 312.481,185.400259 C305.478,182.801135 307.236,173.244359 308.984,168.026119 C310.733,162.817875 319.484,139.355788 322.981,133.277838 C326.488,127.199888 312.481,108.956041 312.481,108.956041 C312.481,108.956041 294.978,80.2857109 245.975,53.3547939 C196.971,26.4138803 168.967,42.9283105 168.967,42.9283105 L161.964,60.3024507 C161.964,60.3024507 138.341,64.6409874 123.46,77.6765909 C108.589,90.7121943 99.837,106.346921 98.963,115.903698 C98.088,125.460475 103.334,159.339048 105.966,164.557289 C108.589,169.765532 112.96,185.400259 112.96,185.400259 C112.96,185.400259 108.589,183.670842 105.966,188.879085 C103.334,194.097325 112.085,218.419122 112.96,220.159535 C113.834,221.897949 114.718,238.403382 119.963,237.532676 C125.218,236.663969 130.463,251.42799 130.463,251.42799 C130.463,251.42799 143.596,271.41125 144.47,275.759783 C145.344,280.09832 147.967,307.039233 147.967,307.039233 L126.967,331.36103 L102.46,355.682827 C102.459,355.682827 34.042,375.886013 0,387.023257 Z" id="Path" fill="#B3BCC4"></path>\n <path d="M0,387.023257 L0,399.918908 L400,399.918908 L400,386.023594 C366.631,377.336524 321.866,364.269931 315.979,359.161654 C308.985,353.083704 270.481,310.508063 270.481,310.508063 L270.481,286.186267 C270.481,286.186267 284.478,266.204006 284.478,261.854473 C284.478,257.515936 285.353,246.219746 291.481,241.011503 C297.61,235.792263 311.607,211.471466 312.481,206.253226 C313.355,201.043983 319.484,188.009379 312.481,185.400259 C305.478,182.801135 307.236,173.244359 308.984,168.026119 C310.733,162.817875 319.484,139.355788 322.981,133.277838 C326.488,127.199888 312.481,108.956041 312.481,108.956041 C312.481,108.956041 294.978,80.2857109 245.975,53.3547939 C196.971,26.4138803 168.967,42.9283105 168.967,42.9283105 L161.964,60.3024507 C161.964,60.3024507 138.341,64.6409874 123.46,77.6765909 C108.589,90.7121943 99.837,106.346921 98.963,115.903698 C98.088,125.460475 103.334,159.339048 105.966,164.557289 C108.589,169.765532 112.96,185.400259 112.96,185.400259 C112.96,185.400259 108.589,183.670842 105.966,188.879085 C103.334,194.097325 112.085,218.419122 112.96,220.159535 C113.834,221.897949 114.718,238.403382 119.963,237.532676 C125.218,236.663969 130.463,251.42799 130.463,251.42799 C130.463,251.42799 143.596,271.41125 144.47,275.759783 C145.344,280.09832 147.967,307.039233 147.967,307.039233 L126.967,331.36103 L102.46,355.682827 C102.459,355.682827 34.042,375.886013 0,387.023257 Z" id="Path" fill="#B3BCC4"></path>\n <path d="M5.68434189e-14,387.023257 L5.68434189e-14,399.918908 L400,399.918908 L400,386.023594 C366.631,377.336524 321.866,364.269931 315.979,359.161654 C308.985,353.083704 270.481,310.508063 270.481,310.508063 L270.481,286.186267 C270.481,286.186267 284.478,266.204006 284.478,261.854473 C284.478,257.515936 285.353,246.219746 291.481,241.011503 C297.61,235.792263 311.607,211.471466 312.481,206.253226 C313.355,201.043983 319.484,188.009379 312.481,185.400259 C305.478,182.801135 307.236,173.244359 308.984,168.026119 C310.733,162.817875 319.484,139.355788 322.981,133.277838 C326.488,127.199888 312.481,108.956041 312.481,108.956041 C312.481,108.956041 294.978,80.2857109 245.975,53.3547939 C196.971,26.4138803 168.967,42.9283105 168.967,42.9283105 L161.964,60.3024507 C161.964,60.3024507 138.341,64.6409874 123.46,77.6765909 C108.589,90.7121943 99.837,106.346921 98.963,115.903698 C98.088,125.460475 103.334,159.339048 105.966,164.557289 C108.589,169.765532 112.96,185.400259 112.96,185.400259 C112.96,185.400259 108.589,183.670842 105.966,188.879085 C103.334,194.097325 112.085,218.419122 112.96,220.159535 C113.834,221.897949 114.718,238.403382 119.963,237.532676 C125.218,236.663969 130.463,251.42799 130.463,251.42799 C130.463,251.42799 143.596,271.41125 144.47,275.759783 C145.344,280.09832 147.967,307.039233 147.967,307.039233 L126.967,331.36103 L102.46,355.682827 C102.459,355.682827 34.042,375.886013 5.68434189e-14,387.023257 Z" id="Path" fill="#B3BCC4"></path>\n </g>\n </g>\n</svg>\n')};return v().createElement(S(),{className:O()(r,n),src:o,imgProps:{onError:s}},v().createElement("img",{className:n,src:l,alt:"fallback entity avatar",onError:s}))};var R=r(75580),_=r(73288),I=r(62391),N=r(9400),D=r(8523),P=r(42308),k=r.n(P),L=r(61882),U=r(26040),j=r(5950);function F(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){M(e,t,r[t])}))}return e}function M(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const V={facetsConfigs:[],facetsData:{},recommendedFacets:[],addedFacets:[]},B=(0,I.Ic)("facetsConfigs"),z=(0,I.Ic)("facetsData"),H=(0,I.Ic)("recommendedFacets"),Y=(0,I.Ic)("addedFacets"),W=(e,t,r)=>Object.keys(e).reduce(((t,n)=>(0,_.prop)(n,t)?(0,I.ET)(n,r).set(t,e[n]):t),F({},t)),G=e=>{let{state:t,facetsConfigs:r,addToEnd:n=!1,facetsData:a={}}=e;const i=r.filter((e=>e.fieldName)),o=B.get(t),l=B.set(t,n?o.concat(i):i.concat(o)),s=z.get(t),c=i.reduce(((e,t)=>F({},e,{[t.fieldName]:(0,N.DV)(t.fieldName,a[t.fieldName])})),F({},s));return z.set(l,c)},q=(e,t)=>{const r=z.get(e),n=B.get(e),a=F({},r);t.forEach((e=>{delete a[e]}));const i=z.set(e,a);return B.set(i,n.filter((e=>!t.includes(e.fieldName))))},Z=e=>{let{facetFieldName:t,values:r,state:n}=e;const a=[...(0,D.jK)(t),"values"];return(0,I.ET)(...a).set(n,r)},$=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:V,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case L.k.CREATE_FACETS:{const{facetsConfigs:r,addToEnd:n}=t.payload;return G({state:e,facetsConfigs:r,addToEnd:n})}case P.search.constants.UPDATE_STATE:{const{facetsConfigs:e=[],facetsData:r={}}=t.payload.facets||{facetsConfigs:[]};return G({state:V,facetsConfigs:e,facetsData:r})}case L.k.DESTROY_FACETS:{const r=t.payload||[];return q(e,r)}case L.k.CHANGE_VALUES:{const{facetFieldName:r,values:n}=t.payload;return Z({facetFieldName:r,values:n,state:e})}case L.k.SHOW_MORE_ENTITY_TYPES:{const{show:r}=t.payload,n="type",a=(0,D.jK)(n);if(r)return(0,I.ET)(...a,"showAllItems").set(e,r);{const t=(0,I.ET)(...a);return t.set(e,(0,_.omit)(["showAllItems"],t.get(e)))}}case L.k.CLEAR_ALL_VALUES:case U.Z.CLEAR_ALL:{const t=z.get(e),r=Object.keys(t).reduce(((e,t)=>F({},e,{[t]:[]})),{}),n=W(r,t,"values");return z.set(e,n)}case L.k.UPDATE_DATA:{const r=t.payload||{},n=z.get(e),a=W(r,n,"data");return z.set(e,a)}case L.k.UPDATE_FILTERED_DATA:{const r=t.payload||{},n=z.get(e),a=W(r,n,"filteredData");return z.set(e,a)}case L.k.DESTROY_FILTERED_DATA:{const r=t.payload||{},n=(0,D.jK)(r);if((0,_.path)(n,e)){const t=(0,I.ET)(...n),r=F({},t.get(e));if(r.filteredData)return delete r.filteredData,t.set(e,r)}break}case L.k.SET_RECOMMENDED_FACETS_LIST:return H.set(e,t.payload||[]);case L.k.HIGHLIGHT_ADDED_FACETS:return Y.set(e,t.payload);case L.k.CLEAR_HIGHLIGHT_ADDED_FACETS:return Y.set(e,[]);case"UI_RESET":return F({},V);case U.Z.CHANGE_CURRENT_TENANT:{const{isDataTenant:r,tenantObject:n}=t.payload;if(r){const t=B.get(e),r=z.get(e),a=(0,j.ci)(n,t),i=(0,_.pluck)("fieldName",a),o=(0,_.pipe)((0,_.pick)(i),(0,j.AZ)(n))(r);return z.set(B.set(e,a),o)}return e}}return e};var K=r(33950);function X(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Q(e,t,r[t])}))}return e}function Q(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const J={searchResults:null,searchResultsByEntityTypes:{},total:0,page:0,sortField:null,sortOrder:null,rowsPerPage:K.Tu[0],loading:!1,searchParams:{searchBoxInput:{fieldName:"attributes",filter:"containsWordStartingWith"},mapSearch:{fieldName:"geoLocation",type:"geoLocation",filter:"range",values:[]}},currentTenant:null},ee=(0,I.Ic)("searchResults"),te=(0,I.Ic)("total"),re=(0,I.Ic)("page"),ne=(0,I.Ic)("rowsPerPage"),ae=(0,I.Ic)("sortField"),ie=(0,I.Ic)("sortOrder"),oe=(0,I.Ic)("loading"),le=(0,I.ET)("searchParams","mapSearch","values"),se=(0,I.ET)("searchParams","mapSearch","type"),ce=(0,I.ET)("searchParams","mapSearch","fieldName"),ue=(0,I.Ic)("searchResultsByEntityTypes"),pe=e=>ue.compose((0,I.ET)(e,"page")),de=(e,t)=>{let{entityTypeUri:r,field:n,order:a}=e;if(r){const e=ue.compose((0,I.ET)(r,"sortField")),i=ue.compose((0,I.ET)(r,"sortOrder")),o=e.set(t,n);return i.set(o,a)}{const e=ae.set(t,n);return ie.set(e,a)}},me=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:J,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case U.Z.UPDATE_ENTITIES:{const{searchResults:r,entityTypeUri:n}=t.payload;return n?ue.compose((0,I.ET)(n,"searchResults")).set(e,r):ee.set(e,r)}case U.Z.UPDATE_TOTAL:return te.set(e,t.payload);case U.Z.CHANGE_PAGE:{const{entityTypeUri:r,pageNumber:n}=t.payload;return r?pe(r).set(e,n):re.set(e,n)}case U.Z.RESET_PAGE:{const{entityTypeUri:r}=t.payload,n=re.set(e,0);return r?pe(r).set(n,0):n}case U.Z.CHANGE_ROWS_PER_PAGE:{const{entityTypeUri:r,number:n}=t.payload;if(r){const t=ue.compose((0,I.ET)(r,"rowsPerPage")),a=pe(r).set(e,0);return t.set(a,n)}{const t=re.set(e,0);return ne.set(t,n)}}case U.Z.CHANGE_SORT:return de(t.payload,e);case U.Z.CHANGE_LOADING:return oe.set(e,t.payload);case P.search.constants.UPDATE_STATE:{const{values:r=[],searchType:n=x.MapSearch.geoPolygon}=t.payload.map||{};let a=le.set(J,r);if(a=se.set(a,n),a=ce.set(a,(0,x.mapSearchTypeToFieldName)(n)),t.payload.view){const{entityTypeTab:e,sortField:r,sortOrder:n}=t.payload.view;a=de({entityTypeUri:e,field:r,order:n},a)}return X({},a,{currentTenant:t.payload.currentTenant||e.currentTenant,searchOptions:t.payload.searchOptions||e.searchOptions})}case"UI_RESET":return X({},J);case U.Z.MAP_CHANGE_VALUE:{const{value:r,searchType:n}=t.payload;let a=se.set(e,n);return a=ce.set(a,(0,x.mapSearchTypeToFieldName)(n)),le.set(a,r?[r]:[])}case U.Z.CLEAR_RESULTS:{const r=t.payload;if(r){let t=ee.set(e,void 0);const n=ue.get(e);return ue.set(t,{[r]:n[r]})}return ue.set(e,{})}case U.Z.CLEAR_ALL:return le.set(e,[]);case U.Z.CHANGE_CURRENT_TENANT:return X({},e,{currentTenant:t.payload.tenantObject.id})}return e},ge="UI_SHOW_MORE_FACETS_POPUP",ye="UI_SHOW_SAVED_SEARCHES_DIALOG",fe="UI_SHOW_SAVE_SEARCH_DIALOG",he="UI_SHOW_ADVANCED_SEARCH",Ee="UI_SHOW_BULK_UPDATE",be="UI_SET_MARKER",ve="UI_SET_HOVERED_ENTITY_URI",Te="UI_SET_ACTIVE_ADDITIONAL_SEARCH",Oe="UI_SET_SEARCH_RESULTS_COLUMNS",xe="UI_CHANGE_SEARCH_RESULTS_COLUMNS",Ce="UI_SET_ENTITY_TYPE_TAB",Se="UI_UPDATE_TABLE_VIEW_TABS",we="UI_CHANGE_ORDER_SEARCH_RESULTS_COLUMNS",Ae="UI_CHANGE_SIZES_SEARCH_RESULTS_COLUMNS",Re="UI_SET_LOADING",_e="UI_CLEAR_NOTIFICATION",Ie="UI_SET_NOTIFICATION",Ne="UI_SET_SEARCH_RESULTS_MODE",De="UI_SET_PREVIEW_PANEL_MODE",Pe={showMoreFacetsPopup:!1,showSavedSearchesDialog:!1,showAdvancedSearch:!1,showSaveSearchDialog:!1,showBulkUpdate:!1,activeAdditionalSearch:null,activeMarker:null,hoveredEntityUri:null,searchResultsMode:null,previewPanelMode:null,searchResultsColumns:{},entityTypeTab:null,tableViewTabs:[],notification:null},ke=(0,I.Ic)("showMoreFacetsPopup"),Le=(0,I.Ic)("showSavedSearchesDialog"),Ue=(0,I.Ic)("showSaveSearchDialog"),je=(0,I.Ic)("showAdvancedSearch"),Fe=(0,I.Ic)("showBulkUpdate"),Me=(0,I.Ic)("activeAdditionalSearch"),Ve=(0,I.Ic)("activeMarker"),Be=(0,I.Ic)("hoveredEntityUri"),ze=(0,I.Ic)("searchResultsMode"),He=(0,I.Ic)("previewPanelMode"),Ye=(0,I.Ic)("searchResultsColumns"),We=(0,I.Ic)("entityTypeTab"),Ge=(0,I.Ic)("tableViewTabs"),qe=(0,I.Ic)("loading"),Ze=(0,I.Ic)("notification"),$e=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Pe,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ge:return ke.set(e,t.payload);case ye:return Le.set(e,t.payload);case fe:return Ue.set(e,t.payload.show);case he:return je.set(e,t.payload);case Ee:return Fe.set(e,t.payload);case Te:{const r=Me.get(e)===t.payload?null:t.payload;return Me.set(e,r)}case be:return Ve.set(e,t.payload);case ve:return Be.set(e,t.payload);case Ne:return ze.set(e,t.payload);case Oe:return Ye.set(e,t.payload);case xe:{const{entityTypeUri:r,columns:n}=t.payload;return Ye.compose((0,I.Ic)(r)).set(e,n)}case Ae:{const{entityTypeUri:r,columns:n}=t.payload;return Ye.compose((0,I.Ic)(r)).set(e,n)}case we:{const{entityTypeUri:r,columns:n}=t.payload;return Ye.compose((0,I.Ic)(r)).set(e,n)}case De:return He.set(e,t.payload);case Ce:return We.set(e,t.payload.entityTypeUri);case Se:return Ge.set(e,t.payload);case L.k.UPDATE_DATA:if((0,_.has)("type",t.payload))return Ge.set(e,t.payload.type);break;case L.k.CHANGE_VALUES:{const{facetFieldName:r,values:n}=t.payload;if("type"===r&&n.length){const t=We.get(e);if(!n.includes(t))return We.set(e,n[0])}break}case"UI_RESET":return Pe;case Re:return qe.set(e,t.payload);case Ie:return Ze.set(e,t.payload);case _e:return Ze.set(e,null);case P.search.constants.UPDATE_STATE:{let r=je.set(e,(0,_.has)("advanced",t.payload));if(t.payload.view){const{searchResultsMode:e,entityTypeTab:n,searchResultsColumns:a,previewPanelMode:i}=t.payload.view;r=ze.set(r,e),r=We.set(r,n),(0,x.isEmptyValue)(a)||(r=Ye.set(r,a)),r=He.set(r,i)}return t.payload.showSavedSearchesDialog&&(r=Le.set(r,t.payload.showSavedSearchesDialog)),r}}return e};var Ke=r(37164);const Xe="ADVANCED_SEARCH_SET_GROUP_ENTITY_TYPES",Qe="ADVANCED_SEARCH_VERIFY_GROUP_ENTITY_TYPES",Je="ADVANCED_SEARCH_SET_GROUP_OPERATOR",et="ADVANCED_SEARCH_DELETE_GROUP",tt="ADVANCED_SEARCH_ADD_GROUP",rt="ADVANCED_SEARCH_DUPLICATE_GROUP",nt="ADVANCED_SEARCH_ADD_ATTRIBUTE_AFTER",at="ADVANCED_SEARCH_CHANGE_ATTRIBUTE_DATA",it="ADVANCED_SEARCH_TOGGLE_ATTRIBUTE_SELECT",ot="ADVANCED_SEARCH_SET_ATTRIBUTE_OPERATOR",lt="ADVANCED_SEARCH_DELETE_ATTRIBUTE",st="ADVANCED_DELETE_ATTRIBUTE_AND_VERIFY_GROUP_ENTITY_TYPES",ct="ADVANCED_SEARCH_DUPLICATE_ATTRIBUTE",ut="ADVANCED_SEARCH_SET_FILTER",pt="ADVANCED_SEARCH_SET_VALUES",dt="ADVANCED_SEARCH_ATTRIBUTE_SET_VALUES",mt="ADVANCED_SEARCH_ATTRIBUTE_FILTER_VALUES",gt="ADVANCED_SEARCH_ATTRIBUTE_SET_FILTERED_VALUES",yt="ADVANCED_SEARCH_ATTRIBUTE_UPDATE_VALUES",ft="ADVANCED_SEARCH_UPDATE",ht="ADVANCED_SEARCH_CONVERT_FROM_FACETS";var Et=r(81253);function bt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){vt(e,t,r[t])}))}return e}function vt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Tt="operator",Ot="values",xt="filter",Ct=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,Ke.x0)();return{[Tt]:K.YL.value,id:e}},St=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,Ke.x0)();const r=wt(e);return{data:r,[Tt]:K.YL.value,[xt]:(0,_.pathOr)("",["filterOptions",0],r),id:t}},wt=e=>bt({},e,{filterOptions:e.enforcedFilterOptions||(0,x.getFilterOptionsForQueryBuilder)(e.attrType,e.fieldName,!0)}),At=(0,_.curry)(((e,t)=>{const r=t.findIndex((t=>t.id===e));return r>-1?[r]:null})),Rt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:At;return(r,n)=>{const a=(0,I.ET)(...e).get(r),i=t(n,a);return!!i&&(0,I.ET)(...e,...i)}},_t=(e,t)=>(r,n)=>{const a=e(r,n);return a&&a.compose((0,I.Ic)(t))},It=e=>(t,r,n)=>{const a=e(t,r);return a?a.get(t).findIndex((e=>e.id===n)):-1},Nt=e=>(t,r,n)=>{const a=e(t,r),i=It(e)(t,r,n);return-1!==i?a.compose((0,I.ET)(i)):null},Dt=e=>(t,r,n,a,i)=>{const o=e(t,r,n);if(o){const e=bt({},o.get(t));return e[a]=i,o.set(t,e)}return t},Pt=e=>(t,r,n,a)=>{const i=e(t,r,n);if(i)return i.get(t)[a]},kt=e=>{let{state:t,groupId:r,attributeId:n,attribute:a,getAttributesLens:i,getAttributeIndex:o}=e;const l=i(t,r);if(l){let e=[...l.get(t)];const i=o(t,r,n),s=!e[i+1];return-1!==i&&s?e.splice(i+1,0,a):-1!==i?(e.splice(i+1,0,bt({},a,{operator:e[i].operator})),e[i]=bt({},e[i],{operator:K.YL.value})):e.push(a),l.set(t,e)}return t},Lt=e=>{let{state:t,groupId:r,attributeId:n,attributeData:a,setAttributeProp:i,getAttributeLens:o}=e,l=t;if(a)return((e,t,r,n,a)=>{const i=a(e,t,r);let o;return i&&(o=i.get(e).filter),n.filterOptions.length&&(!o||!n.filterOptions.includes(o))})(t,r,n,a,o)&&(l=i(t,r,n,xt,a.filterOptions[0])),l=i(l,r,n,Ot,[]),i(l,r,n,"data",a);{const e=o(t,r,n);return e&&(l=e.set(l,Ct(n))),l}},Ut=e=>{let{state:t,groupId:r,attributeId:n,operator:a,setAttributeProp:i}=e;return i(t,r,n,Tt,a)},jt=e=>{let{state:t,groupId:r,attributeId:n,getAttributesLens:a}=e;const i=a(t,r);if(i){const e=[...i.get(t)],r=e.findIndex((e=>e.id===n));if(r>-1){const n=(0,_.remove)(r,1,e),a=n[r-1],o=e[r];return a&&(n[r-1]=bt({},a,{operator:o.operator})),i.set(t,n)}}return t},Ft=e=>{let{state:t,groupId:r,attributeId:n,id:a,getAttributesLens:i}=e;const o=i(t,r);if(o){const e=[...o.get(t)],r=e.findIndex((e=>e.id===n));if(r>-1)return e.push(bt({},e[r],{id:a})),o.set(t,e)}return t},Mt=e=>{let{state:t,groupId:r,attributeId:n,filter:a,getAttributeProp:i,setAttributeProp:o}=e;const l=i(t,r,n,xt),s=(0,x.isCompatibleFilters)(l,a)?t:o(t,r,n,Ot,[]);return o(s,r,n,xt,a)},Vt=e=>{let{state:t,groupId:r,attributeId:n,values:a,setAttributeProp:i}=e;return i(t,r,n,Ot,a)};function Bt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){zt(e,t,r[t])}))}return e}function zt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ht={searchParams:{groups:[]},attributesData:{}},Yt="entityTypes",Wt="attributes",Gt="autoAddedEntityTypes",qt=["groups"],Zt=(0,I.ET)(...qt),$t=Rt(qt),Kt=_t($t,Wt),Xt=It(Kt),Qt=Nt(Kt),Jt=Dt(Qt),er=Pt(Qt),tr=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:(0,Ke.x0)();return{[Wt]:e.map((e=>St(e))),[Tt]:K.qx.value,[Yt]:t,id:r}},rr=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ht.attributesData,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case gt:{const{groupId:r,attributeId:n,values:a}=t.payload;return(0,_.assocPath)([r,n,"filtered"],a,e)}case et:{const{groupId:r}=t.payload;return(0,_.dissoc)(r,e)}case lt:{const{groupId:r,attributeId:n}=t.payload;return(0,_.dissocPath)([r,n],e)}case rt:{const{groupId:r,id:n}=t.payload,a=e[r];return a?(0,_.assoc)(n,a,e):e}case ct:{const{groupId:r,attributeId:n,id:a}=t.payload,i=(0,_.path)([r,n],e);return i?(0,_.assocPath)([r,a],i,e):e}case U.Z.CLEAR_ALL:case P.search.constants.UPDATE_STATE:return Ht.attributesData;default:return e}},nr=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ht.searchParams,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case tt:{const{group:r}=t.payload,n=[...Zt.get(e)];return n.push(r),Zt.set(e,n)}case Je:{const{groupId:r,operator:n}=t.payload,a=$t(e,r);if(a){const t=Bt({},a.get(e));return t[Tt]=n,a.set(e,t)}return e}case Xe:{const{groupId:r,entityTypes:n}=t.payload,a=$t(e,r);if(a){const t=Bt({},a.get(e));return t.entityTypes=n,t.autoAddedEntityTypes=[],t.attributes=[],a.set(e,t)}return e}case Qe:{const{groupId:r}=t.payload,n=$t(e,r);if(n){const t=n.get(e),{entityTypes:r,autoAddedEntityTypes:a}=(0,Et.tg)((0,Et.r8)(t.attributes||[]),t.entityTypes,t.autoAddedEntityTypes);return n.set(e,Bt({},t,{[Yt]:r,[Gt]:a}))}return e}case et:{const{groupId:r}=t.payload,n=[...Zt.get(e)],a=n.findIndex((e=>e.id===r));if(a>-1){const t=(0,_.remove)(a,1,n),r=t[a-1],i=n[a];return r&&(t[a-1]=Bt({},r,{operator:i.operator})),Zt.set(e,t)}return e}case rt:{const{groupId:r,id:n}=t.payload,a=[...Zt.get(e)],i=a.findIndex((e=>e.id===r));return i>-1?(a.push(Bt({},a[i],{id:n})),Zt.set(e,a)):e}case nt:{const{groupId:r,attributeId:n,attribute:a}=t.payload;return kt({state:e,groupId:r,attributeId:n,attribute:a,getAttributesLens:Kt,getAttributeIndex:Xt})}case at:{const{groupId:r,attributeId:n,attributeData:a}=t.payload;return Lt({state:e,groupId:r,attributeId:n,attributeData:a,setAttributeProp:Jt,getAttributeLens:Qt})}case ot:{const{groupId:r,attributeId:n,operator:a}=t.payload;return Ut({state:e,groupId:r,attributeId:n,operator:a,setAttributeProp:Jt})}case lt:{const{groupId:r,attributeId:n}=t.payload;return jt({state:e,groupId:r,attributeId:n,getAttributesLens:Kt})}case ct:{const{groupId:r,attributeId:n,id:a}=t.payload;return Ft({state:e,groupId:r,attributeId:n,id:a,getAttributesLens:Kt})}case ut:{const{groupId:r,attributeId:n,filter:a}=t.payload;return Mt({state:e,groupId:r,attributeId:n,filter:a,getAttributeProp:er,setAttributeProp:Jt})}case pt:{const{groupId:r,attributeId:n,values:a}=t.payload;return Vt({state:e,groupId:r,attributeId:n,values:a,setAttributeProp:Jt})}case U.Z.CLEAR_ALL:return Ht.searchParams;case P.search.constants.UPDATE_STATE:{const{advanced:e=[]}=t.payload;return Zt.set(Ht.searchParams,e)}default:return e}},ar=(e,t)=>{const r=((e,t)=>{if(t.type===dt){var r;const{groupId:n,attributeId:a,values:i}=t.payload;return((null===(r=[...Zt.get(e.searchParams)].find((e=>e.id===n)))||void 0===r?void 0:r.attributes)||[]).some((e=>{let{id:t}=e;return t===a}))?(0,_.assocPath)(["attributesData",n,a,"default"],i,e):e}return e})((0,R.combineReducers)({searchParams:nr,attributesData:rr})(e,t),t);return r},ir="SAVED_SEARCHES_CREATE",or="SAVED_SEARCHES_SET_CURRENT",lr="SAVED_SEARCHES_SET_CHANGE_INDICATOR",sr="SAVED_SEARCHES_UPDATE",cr="SAVED_SEARCHES_LOAD",ur="SAVED_SEARCHES_SET_TOTAL",pr="SAVED_SEARCHES_SET_ITEMS",dr="SAVED_SEARCHES_SET_ITEM_TOTAL",mr="SAVED_SEARCHES_SET_PAGE",gr="SAVED_SEARCHES_SET_ROWS_PER_PAGE",yr="SAVED_SEARCHES_SET_FILTERS",fr="SAVED_SEARCHES_SELECT_ITEM",hr="SAVED_SEARCHES_SELECT_ALL_ITEMS",Er="SAVED_SEARCHES_DESELECT_ALL_ITEMS",br="SAVED_SEARCHES_MARK_PUBLIC_REQUEST",vr="SAVED_SEARCHES_MARK_PUBLIC",Tr="SAVED_SEARCHES_MARK_FAVORITE_REQUEST",Or="SAVED_SEARCHES_MARK_FAVORITE",xr="SAVED_SEARCHES_MARK_GLOBAL_FILTER_REQUEST",Cr="SAVED_SEARCHES_CHANGE_ITEM_NAME_REQUEST",Sr="SAVED_SEARCHES_CHANGE_ITEM_NAME",wr="SAVED_SEARCHES_SET_EDITING",Ar="SAVED_SEARCHES_DELETE_SELECTED_ITEMS_REQUEST",Rr="SAVED_SEARCHES_DELETE_ITEM_REQUEST",_r="SAVED_SEARCHES_DELETE_ITEMS",Ir="SAVED_SEARCHES_SET_LOADING",Nr="SAVED_SEARCHES_SET_SEARCH_VALUE",Dr="SAVED_SEARCHES_APPLY_ITEM",Pr="SAVED_SEARCHES_SET_TOTAL_LOADING",kr="SAVED_SEARCHES_LOAD_TOTAL",Lr="SAVED_SEARCHES_TOGGLE_SORT",Ur="RECENT_SEARCHES_CREATE",jr="RECENT_SEARCHES_LOAD",Fr="RECENT_SEARCHES_SET_ITEMS",Mr="RECENT_SEARCHES_SET_ITEM_TOTAL",Vr="RECENT_SEARCHES_SELECT_ITEM",Br="RECENT_SEARCHES_SELECT_ALL_ITEMS",zr="RECENT_SEARCHES_DESELECT_ALL_ITEMS",Hr="RECENT_SEARCHES_DELETE_SELECTED_ITEMS_REQUEST",Yr="RECENT_SEARCHES_DELETE_ITEMS",Wr="RECENT_SEARCHES_DELETE_ITEM_REQUEST",Gr="RECENT_SEARCHES_SET_LOADING",qr="RECENT_SEARCHES_SET_SEARCH_VALUE",Zr="RECENT_SEARCHES_SET_LAST_SAVED",$r="RECENT_SEARCHES_SET_TOTAL_LOADING",Kr="RECENT_SEARCHES_LOAD_TOTAL",Xr="RECENT_SEARCHES_APPLY_ITEM";function Qr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Jr(e,t,r[t])}))}return e}function Jr(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const en={currentSearch:null,postSavingAction:null,changeIndicator:!1,items:[],loading:!1,total:0,page:0,rowsPerPage:K.Tu[0],searchValue:"",findPublic:!0,favoriteOnly:!1,sorting:{order:K.rX.DESC,field:K.KY.updateDate}},tn=(0,I.Ic)("changeIndicator"),rn=(0,I.Ic)("items"),nn=(0,I.Ic)("total"),an=(0,I.Ic)("page"),on=(0,I.Ic)("loading"),ln=(0,I.Ic)("postSavingAction"),sn=(0,I.Ic)("sorting"),cn=(e,t,r)=>{const n=rn.get(r).findIndex((e=>e.uri===t)),a=rn.compose((0,I.ET)([n])),i=a.get(r);return a.set(r,e(i))},un=e=>e===K.rX.DESC?K.rX.ASC:K.rX.DESC,pn=(e,t,r)=>(0,_.evolve)({page:(0,_.always)(0),[e]:(0,_.always)(t)},r),dn=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:en,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case or:return(0,_.evolve)({currentSearch:(0,_.always)(t.payload),changeIndicator:null===t.payload?(0,_.always)(!1):_.identity},e);case U.Z.CLEAR_ALL:return(0,_.evolve)({currentSearch:(0,_.always)(null),changeIndicator:(0,_.always)(!1)},e);case lr:return tn.set(e,t.payload);case ur:return nn.set(e,t.payload);case mr:return an.set(e,t.payload);case gr:return pn("rowsPerPage",t.payload,e);case yr:{const{findPublic:r,favoriteOnly:n}=t.payload;return(0,_.evolve)({page:(0,_.always)(0),findPublic:(0,_.always)(r),favoriteOnly:(0,_.always)(n)},e)}case pr:return rn.set(e,t.payload);case fr:{const{uri:r,checked:n}=t.payload;return cn((e=>Qr({},e,{checked:n})),r,e)}case Er:{const t=rn.get(e);return rn.set(e,t.map((0,_.omit)(["checked"])))}case hr:{const t=rn.get(e);return rn.set(e,t.map((0,_.ifElse)((0,_.prop)("isOwnSearch"),(0,_.assoc)("checked",!0),_.identity)))}case _r:{const r=t.payload,n=rn.get(e),a=nn.set(e,nn.get(e)-r.length);return rn.set(a,n.filter((e=>!r.includes(e.uri))))}case vr:{const{uri:r,isPublic:n}=t.payload;return cn((e=>Qr({},e,{isPublic:n})),r,e)}case Or:{const{uri:r,isFavorite:n}=t.payload;return cn((e=>Qr({},e,{isFavorite:n})),r,e)}case dr:{const{uri:r,total:n}=t.payload;return cn((e=>Qr({},e,{total:n})),r,e)}case wr:{const{uri:r,isEditing:n}=t.payload;return cn((e=>Qr({},e,{isEditing:n})),r,e)}case Cr:{const{uri:r}=t.payload;return cn((0,_.omit)(["isEditing"]),r,e)}case Sr:{const{uri:r,name:n}=t.payload;return cn((e=>Qr({},e,{name:n})),r,e)}case Ir:return on.set(e,t.payload);case qr:case Nr:return pn("searchValue",t.payload,e);case cr:return Qr({},e,{page:0,findPublic:!0,favoriteOnly:!1});case Lr:{const r=t.payload,n=(0,_.path)(["sorting","field"],e),a=(0,_.path)(["sorting","order"],e);return sn.set(e,{field:r,order:un(r===n?a:null)})}case Pr:{const{uri:r,isLoading:n}=t.payload;return cn((e=>Qr({},e,{isTotalLoading:n})),r,e)}case fe:return ln.set(e,t.payload.postSavingAction);case ye:return pn("searchValue",en.searchValue,e)}return e};function mn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){gn(e,t,r[t])}))}return e}function gn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const yn={items:[],filterWord:null,loading:!1,lastSavedRecentSearch:null},fn=(0,I.Ic)("items"),hn=(0,I.Ic)("loading"),En=(0,I.Ic)("filterWord"),bn=(0,I.Ic)("lastSavedRecentSearch"),vn=(e,t,r)=>{const n=fn.get(r).findIndex((e=>e.createdDate===t)),a=fn.compose((0,I.ET)([n])),i=a.get(r);return a.set(r,e(i))},Tn=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:yn,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Nr:case qr:return En.set(e,t.payload);case Fr:return fn.set(e,t.payload);case Vr:{const{searchCreatedDate:r,checked:n}=t.payload;return vn((e=>mn({},e,{checked:n})),r,e)}case zr:{const t=fn.get(e);return fn.set(e,t.map((0,_.omit)(["checked"])))}case Br:{const t=fn.get(e);return fn.set(e,t.map((0,_.assoc)("checked",!0)))}case Yr:{const r=(t.payload||[]).map((0,_.prop)("createdDate")),n=fn.get(e);return fn.set(e,n.filter((e=>!r.includes(e.createdDate))))}case Mr:{const{searchCreatedDate:r,total:n}=t.payload;return vn((e=>mn({},e,{total:n})),r,e)}case Gr:return hn.set(e,t.payload);case Zr:return bn.set(e,t.payload);case $r:{const{searchCreatedDate:r,isLoading:n}=t.payload;return vn((e=>mn({},e,{isTotalLoading:n})),r,e)}case ye:return En.set(e,yn.filterWord)}return e},On="ENTITY_SET_LOADING",xn="ENTITY_LOAD_ENTITY_REQUEST",Cn="ENTITY_SET_SELECTED_ENTITY_URI",Sn="ENTITY_SET_ENTITY",wn={loading:!1,selectedEntityUri:null,entity:null},An=(0,I.Ic)("loading"),Rn=(0,I.Ic)("selectedEntityUri"),_n=(0,I.Ic)("entity"),In=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:wn,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case On:return An.set(e,t.payload);case Cn:return Rn.set(e,t.payload);case Sn:return _n.set(e,t.payload);case P.profile.constants.ProfileActions.ADD_NEXT_PAGE_ATTRIBUTE_VALUES:{const{parentUri:r,attributeTypeName:n,attributeTypeUri:a,values:i}=t.payload,o=(0,x.getAttributeSource)(a);if(e.entity&&r===e.entity.uri){const t=(0,_.lensPath)(["entity",o,n]);return(0,_.over)(t,(0,_.pipe)((0,_.defaultTo)([]),(0,_.concat)(_.__,i)),e)}return e}case P.search.constants.SEARCH_RESULTS_SET:if((0,x.isEmptyValue)(t.payload)){const t=_n.set(e,wn.entity);return Rn.set(t,wn.selectedEntityUri)}return e}return e},Nn="BULK_UPDATE_SET_ACTIVE_STEP",Dn="BULK_UPDATE_INIT",Pn="BULK_UPDATE_TOGGLE_SELECTION_MODE",kn="BULK_UPDATE_SELECT_ENTITY",Ln="BULK_UPDATE_SELECT_ALL_ENTITIES_ON_PAGE",Un="BULK_UPDATE_SET_LOADING",jn="BULK_UPDATE_CHANGE_ROWS_PER_PAGE",Fn="BULK_UPDATE_CHANGE_PAGE",Mn="BULK_UPDATE_CHANGE_SORT",Vn="BULK_UPDATE_CHANGE_COLUMNS",Bn="BULK_UPDATE_UPDATE_ENTITIES",zn="BULK_UPDATE_SET_FILTER_TEXT",Hn="BULK_UPDATE_SET_TOTAL",Yn="UPDATE_BULK_UPDATE_CURRENT_ENTITIES",Wn="BULK_UPDATE_SET_OPERATION",Gn="BULK_UPDATE_SET_ACTION_ATTRIBUTE",qn="BULK_UPDATE_SET_ACTION_OPERATION",Zn="BULK_UPDATE_ADD_OPERATION_PARAMETERS",$n="BULK_UPDATE_DELETE_ACTION",Kn="BULK_UPDATE_TOGGLE_CONDITIONS",Xn="BULK_UPDATE_ADD_CONDITION_AFTER",Qn="BULK_UPDATE_CHANGE_CONDITION_DATA",Jn="BULK_UPDATE_TOGGLE_CONDITION_SELECT",ea="BULK_UPDATE_DELETE_CONDITION",ta="BULK_UPDATE_SET_CONDITION_FILTER",ra="BULK_UPDATE_SET_CONDITION_VALUES",na="BULK_UPDATE_TOGGLE_ACTION_PIN",aa="BULK_UPDATE_TOGGLE_ACTION_ADD_NESTED",ia="BULK_UPDATE_CONFIRM",oa="BULK_UPDATE_SET_REQUEST_PENDING";var la=r(39705);function sa(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ca(e,t,r[t])}))}return e}function ca(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ua={objects:{selectionMode:K.v6.exclude,selectedEntities:[],entities:[],total:0,page:0,rowsPerPage:K.Tu[0],filterText:"",sortOrder:null,sortField:null,selectedColumns:[]},actions:[],operation:null,activeStep:0,loading:!1,requestPending:!1},pa=(0,I.Ic)("activeStep"),da=(0,I.Ic)("operation"),ma=(0,I.Ic)("loading"),ga=(0,I.Ic)("requestPending"),ya=(0,I.ET)("objects","total"),fa=(0,I.ET)("objects","page"),ha=(0,I.ET)("objects","rowsPerPage"),Ea=(0,I.ET)("objects","selectionMode"),ba=(0,I.ET)("objects","entities"),va=(0,I.ET)("objects","selectedEntities"),Ta=(0,I.ET)("objects","filterText"),Oa=e=>Ea.get(e)===K.v6.include,xa=(0,I.ET)("objects","sortOrder"),Ca=(0,I.ET)("objects","sortField"),Sa=(0,I.ET)("objects","selectedColumns"),wa=["actions"],Aa=(0,I.ET)(...wa),Ra=e=>{let{groupId:t,state:r}=e;if(t){const e=Aa.get(r).findIndex((e=>e.id===t));if(-1!==e)return[...wa,e,"actions"]}return wa},_a=(e,t)=>({id:(0,Ke.x0)(),operation:e,operationParameters:t}),Ia=e=>((0,_.path)(["attributeTypeData","fieldName"],e)||[]).split(".").slice(0,2).join("."),Na=(e,t)=>({id:(0,Ke.x0)(),fieldName:Ia(t),actions:[_a(e,t)]}),Da=e=>{let{state:t,id:r,groupId:n,operation:a,operationParameters:i,togglePin:o,toggleAddNested:l}=e;const s=Ra({state:t,groupId:n}),c=(0,I.ET)(...s).get(t),u=!n&&(0,_.prop)("attributeTypeData",i)&&(e=>{let{attributeType:t,fieldName:r=""}=e;return(0,x.isComplexAttribute)(t)||r.split(".").length>2})(i.attributeTypeData);if(r){const e=c.findIndex((e=>e.id===r)),n=(0,I.ET)(...s,e),d=sa({},n.get(t));if(a&&d.operation!==a){if(d.operationParameters){const e=[d.operation,a].includes(la.d.RepointReference)?[]:K.KJ[a];d.operationParameters=(0,_.omit)((0,_.without)(e,["attributeValue","attributeValueToFind"]),d.operationParameters)}d.operation=a}return i&&(d.operationParameters=(0,_.reject)(_.isNil,sa({},d.operationParameters,i))),o&&(d.operationParameters=sa({},d.operationParameters,{pin:!(0,_.path)(["operationParameters","pin"],d)})),l&&(d.operationParameters=sa({},d.operationParameters,{addNestedAttribute:!(0,_.path)(["operationParameters","addNestedAttribute"],d)})),n.set(t,u?Na((p=d).operation,p.operationParameters):d)}{const e=(0,_.reject)(_.isNil,i),r=u?Na(a,e):_a(a,e);return(0,I.ET)(...s,c.length).set(t,r)}var p},Pa=Rt(wa),ka=_t(Pa,"conditions"),La=It(ka),Ua=Nt(ka),ja=Dt(Ua),Fa=Pt(Ua),Ma=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ua,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Nn:return pa.set(e,t.payload);case Dn:return sa({},ua,{objects:sa({},ua.objects,t.payload)});case Bn:return ba.set(e,t.payload);case Pn:{const t=Ea.set(e,Oa(e)?K.v6.exclude:K.v6.include);return va.set(t,[])}case kn:{const{uri:r,checked:n}=t.payload,a=va.get(e),i=Oa(e);return va.set(e,!!n==!!i?(0,_.uniq)(a.concat(r)):(0,_.without)(r,a))}case Ln:{const r=t.payload,n=Oa(e),a=va.get(e),i=ba.get(e).map((0,_.prop)("uri"));return va.set(e,!!r==!!n?(0,_.uniq)(a.concat(i)):(0,_.without)(i,a))}case Un:return ma.set(e,t.payload);case Fn:return fa.set(e,t.payload);case jn:{const r=fa.set(e,0);return ha.set(r,t.payload)}case Mn:{const{order:r,field:n}=t.payload,a=Ca.set(e,n);return xa.set(a,r)}case Vn:return Sa.set(e,t.payload);case Hn:return ya.set(e,t.payload);case zn:{const{filterText:r}=t.payload;return Ta.set(e,r)}case Wn:return da.set(e,t.payload);case Gn:{const{id:r,groupId:n,attribute:a}=t.payload;return Da({state:e,id:r,groupId:n,operationParameters:{attributeTypeData:a,attributeValue:null,attributeValueToFind:null,pin:null,addNestedAttribute:null}})}case qn:{const{id:r,groupId:n,operation:a}=t.payload;return Da({state:e,id:r,groupId:n,operation:a})}case Zn:{const{id:r,groupId:n,operationParameters:a}=t.payload;return Da({state:e,id:r,groupId:n,operationParameters:a})}case na:{const{id:r,groupId:n}=t.payload;return Da({state:e,id:r,groupId:n,togglePin:!0})}case aa:{const{id:r,groupId:n}=t.payload;return Da({state:e,id:r,groupId:n,toggleAddNested:!0})}case $n:{const{id:r,groupId:n}=t.payload,a=Ra({state:e,groupId:n}),i=(0,I.ET)(...a),o=i.get(e);return i.set(e,o.filter((e=>e.id!==r)))}case Kn:{const r=t.payload,n=Aa.get(e).findIndex((e=>e.id===r)),a=(0,I.ET)(...wa,n),i=a.get(e);return a.set(e,i.conditions?(0,_.omit)(["conditions"],i):(0,_.assoc)("conditions",[],i))}case Xn:{const{groupId:r,attributeId:n,attribute:a}=t.payload;return kt({state:e,groupId:r,attributeId:n,attribute:a,getAttributesLens:ka,getAttributeIndex:La})}case Qn:{const{groupId:r,attributeId:n,attributeData:a}=t.payload;return Lt({state:e,groupId:r,attributeId:n,attributeData:a,setAttributeProp:ja,getAttributeLens:Ua})}case ea:{const{groupId:r,attributeId:n}=t.payload;return jt({state:e,groupId:r,attributeId:n,getAttributesLens:ka})}case ta:{const{groupId:r,attributeId:n,filter:a}=t.payload;return Mt({state:e,groupId:r,attributeId:n,filter:a,getAttributeProp:Fa,setAttributeProp:ja})}case ra:{const{groupId:r,attributeId:n,values:a}=t.payload;return Vt({state:e,groupId:r,attributeId:n,values:a,setAttributeProp:ja})}case oa:return ga.set(e,t.payload)}return e};var Va=r(85383),Ba=r(82349),za=r(12848),Ha=r(33192),Ya=r.n(Ha),Wa=r(43717);const Ga=(e,t,r)=>{const n=qa(t);if(n.length){const i=$a(e,t,r),o=Za(e,t,r),l=o.every((e=>(0,x.isTypeSearchGroupAttribute)({data:e})||i.some((0,_.eqProps)("fieldName",e)))),s=(0,x.areAllOperatorsAnd)(t),c=(0,x.areAllOperatorsAnd)(n),u=n.every((e=>{let{filter:t,data:{attrType:r={}}}=e;return[x.FilterOptions.EQUALS,x.FilterOptions.IN_RANGE,x.FilterOptions.FULL_TEXT,x.FilterOptions.ON,x.FilterOptions.WITHIN].includes(t)||x.FilterOptions.EXISTS===t&&(0,x.isBooleanType)(r.type)})),p=(a=n,!Object.values(a.reduce(((e,t)=>{let{data:{fieldName:r},filter:n,values:a}=t;return n===x.FilterOptions.EQUALS&&(0,_.path)([0,"length"],a)&&(e[r]=e[r]&&e[r]+1||1),e}),{})).some((e=>e>1)));return o.length&&s&&c&&u&&n.every((e=>e.data.attrType.faceted))&&l&&p}var a;return!0},qa=e=>e.flatMap((e=>e.attributes)).filter((0,_.has)("data")),Za=(e,t,r)=>{const n=qa(t).map((e=>{let{data:{fieldName:t,entityTypeUri:r},filter:n,values:a}=e;return{entityTypeUri:r,fieldName:t,filter:n,values:a}})).reduce(((t,n)=>{let{entityTypeUri:a,fieldName:i,filter:o,values:l}=n;const{attrType:s}=a?(0,N.eC)(e,[a],[],r).find((e=>e.fieldName===i))||{}:(0,Wa.zH)(i,r)||{},c=!(0,_.isNil)(s)&&s.faceted?((e,t,r,n)=>{if(![x.FilterOptions.EQUALS,x.FilterOptions.IN_RANGE].includes(t)&&![x.FilterOptions.ON,x.FilterOptions.WITHIN].includes(t)||!Array.isArray(e)||(0,x.isEmptyValue)(e[0]))return(0,x.isBooleanType)(n)&&t===x.FilterOptions.EXISTS?[!0,!1]:e&&!(0,x.isEmptyValue)(e[0])?[e[0]]:[];switch(r){case x.FACET_TYPES.NUMERIC_RANGE_FACET:return((e,t)=>{switch(t){case x.FilterOptions.EQUALS:return e.map((e=>[e,e]));case x.FilterOptions.IN_RANGE:return e.some(x.isEmptyValue)?[]:[e]}})(e[0],t);case x.FACET_TYPES.DATE_RANGE_FACET:return((e,t)=>{switch(t){case x.FilterOptions.ON:{const t=Ya()(e),r=!(0,x.isTimestampBasedType)(n);return[[x.utils.dates.getStartOfDay(t,r),x.utils.dates.getEndOfDay(t,r)]]}case x.FilterOptions.WITHIN:return(0,x.isDateRangeValue)(e)?[(0,x.getDateRangeByValue)(e)]:e.some(x.isEmptyValue)?[]:[e]}})(e[0],t);default:return e[0]}})(l,o,(0,x.getFacetTypeForAttrType)(s),s.type):l;return(0,_.isNil)(c)||(t[i]=(0,_.uniq)((t[i]||[]).concat(c))),t}),{}),a=Object.keys(n).map((e=>({fieldName:e,values:n[e]})));return a.some((e=>{let{values:t}=e;return t&&Array.isArray(t[0])&&t.length>1}))?[]:a},$a=(e,t,r)=>{const n=(0,Et.VO)(t);return(0,N.eC)(e,n,[],r)},Ka=(e,t)=>({type:U.Z.UPDATE_ENTITIES,payload:{searchResults:e,entityTypeUri:t}}),Xa=()=>({type:U.Z.REFRESH_DISPLAYED_ENTITIES}),Qa=e=>{let{silent:t}=e;return{type:U.Z.CLEAR_ALL,payload:{silent:t}}},Ja=e=>{let{entityTypeUri:t,keywordValue:r}=e;return{type:U.Z.SHOW_MORE_RESULTS_FOR_ENTITY_TYPE,payload:{entityTypeUri:t,keywordValue:r}}},ei=e=>({type:U.Z.UPDATE_TOTAL,payload:e}),ti=e=>({type:U.Z.CHANGE_LOADING,payload:e}),ri=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:U.Z.MAP_CHANGE_VALUE,payload:{value:e,searchType:t,silent:r}}},ni=(e,t)=>({type:L.k.CREATE_FACETS,payload:{facetsConfigs:e,addToEnd:t}}),ai=e=>({type:L.k.DESTROY_FACETS,payload:e}),ii=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:L.k.CHANGE_VALUES,payload:{facetFieldName:e,values:t,silent:r}}},oi=e=>({type:L.k.UPDATE_DATA,payload:e}),li=e=>({type:L.k.UPDATE_FILTERED_DATA,payload:e}),si=e=>{let{facetsToAdd:t,fieldNamesToDelete:r,changedEntityTypes:n,addToEnd:a}=e;return{type:L.k.HANDLE_CONFIGS_CHANGES,payload:{facetsToAdd:t,fieldNamesToDelete:r,changedEntityTypes:n,addToEnd:a}}};var ci=r(5236),ui=r(54145),pi=r(55443),di=r(65751),mi=r.n(di);const gi=e=>{(0,pi.U)(e,{title:mi().text("Server Error"),defaultMessage:mi().text("Something went wrong...")})};var yi=r(69021);const fi=(e,t,r)=>`${e}/recommend/${r}/${t}`,hi=e=>e&&1===e.length?e[0]:null,Ei=e=>[e].filter((0,_.complement)(x.isComplexAttribute)).map((0,_.compose)(Ba.$9,(0,_.prop)("uri"))).concat((e.children||[]).map(Ei)).flat(1/0);function*bi(){const e=yield(0,Va.RE)(Xl),t=yield(0,Va.Ys)(k().selectors.getTenant),r=yield(0,Va.Ys)(k().selectors.getEnvironment),n=((e,t,r,n,a)=>{const i=e.map((e=>{let{fieldName:t,values:r}=e;return{fieldName:t,values:r.map((e=>Array.isArray(e)?JSON.stringify(e):e))}})),o={facets:(0,Ba._e)(i).reduce(((e,t)=>{const r=(t.children||[]).map((e=>JSON.stringify(e)));return e[t.fieldName]=r.length>0?r:t.values.slice().sort(),e}),{}),max:5};return{url:fi(r,n,a),options:{method:"POST",body:JSON.stringify(o),headers:{"Content-Type":"application/json"}}}})(e,0,yield(0,Va.Ys)(k().selectors.getServicesPath),t,r);let a;try{a=yield(0,Va.RE)(x.rawRequest,n.url,n.options),a=a.filter((e=>"type"!==e)).slice(0,5)}catch(e){a=[]}const i=yield(0,Va.Ys)(k().selectors.getMetadata),o=yield(0,Va.Ys)(D.DX);a=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const r=hi(arguments.length>2?arguments[2]:void 0),n=r&&(0,x.getEntityType)(e,r),a=(0,yi.vf)(e,n||{}).map(Ei).flat(1/0);return t.filter((e=>r||!e.startsWith("attributes."))).filter((e=>!e.startsWith("attributes.")||a.includes(e)))}(i,a,o);const l=((e,t,r,n)=>{const a=e=>!t.includes(e);let i=[];const o=Math.max(0,5-t.length);if(o){const t=hi(n);if(t){const r=((0,x.getEntityType)(e,t).defaultFacetedAttributes||[]).map((r=>(0,x.findAttributeTypeByUri)(e,r,t))).filter((e=>e&&(0,x.isReadableAttribute)(e)&&!(0,x.isComplexAttribute)(e))).map((0,_.prop)("uri")).map(Ba.$9).filter(a);i=i.concat(r)}if(i.length<o){const e=(0,N.Xk)().map((e=>e.fieldName)).filter(a);i=i.concat(e)}}return i.slice(0,o)})(i,a,0,o);var s;a=a.concat(l),yield(0,Va.gz)((s=a,{type:L.k.SET_RECOMMENDED_FACETS_LIST,payload:s}))}const vi=e=>({type:ge,payload:e}),Ti=e=>({type:ye,payload:e}),Oi=(e,t)=>({type:fe,payload:{show:e,postSavingAction:t}}),xi=e=>({type:he,payload:e}),Ci=(e,t,r)=>({type:xe,payload:{entityTypeUri:e,columns:t,prevColumns:r}}),Si=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return{type:Ce,payload:{entityTypeUri:e,silent:t}}},wi=e=>({type:Se,payload:e}),Ai=()=>({type:_e}),Ri=e=>({type:Ie,payload:e}),_i=e=>Ri({payload:{message:e,action:null},type:K.GT.info}),Ii=e=>{let{message:t,actionLabel:r,actionToDispatch:n,autoHideDuration:a}=e;return Ri({payload:{message:t,action:{actionLabel:r,actionToDispatch:n},autoHideDuration:a},type:K.GT.info})},Ni=e=>({type:De,payload:e}),Di=e=>({type:Ee,payload:e});var Pi=r(90503),ki=r(82877);const Li=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object.keys(e).filter((r=>x.utils.strings.search(r,t)||x.utils.strings.search(e[r].displayName,t)))},Ui=new class{constructor(){this._lookupsCodesResolveTasks=Object.create(null)}addTask(e,t){this._lookupsCodesResolveTasks[e]=t}deleteTask(e){delete this._lookupsCodesResolveTasks[e]}getRunningTask(e){return this._lookupsCodesResolveTasks[e]}clearTasks(){this._lookupsCodesResolveTasks=Object.create(null)}},ji=(e,t)=>e===t,Fi=new class{constructor(){this.isLookupValueResolveTaskRunning=(0,_.curry)(((e,t)=>(0,_.hasPath)([e,t],this._lookupValuesResolveTasks))),this._lookupValuesResolveTasks=Object.create(null)}addTask(e,t){e.forEach((e=>{let{type:r,codeValues:n}=e;!this._lookupValuesResolveTasks[r]&&(this._lookupValuesResolveTasks[r]={}),n.forEach((e=>{this._lookupValuesResolveTasks[r][e]=t}))}))}deleteTask(e){e.forEach((e=>{let{type:t,codeValues:r}=e;this._lookupValuesResolveTasks[t]&&r.forEach((e=>{delete this._lookupValuesResolveTasks[t][e]})),(0,_.isEmpty)(this._lookupValuesResolveTasks[t])&&delete this._lookupValuesResolveTasks[t]}))}getRunningTasks(e){const t=e.flatMap((e=>{let{type:t,codeValues:r}=e;return this._lookupValuesResolveTasks[t]?r.reduce(((e,r)=>{const n=this._lookupValuesResolveTasks[t][r];return n&&e.push(n),e}),[]):[]}));return(0,_.uniqWith)(ji,t)}clearTasks(){this._lookupValuesResolveTasks=Object.create(null)}};function*Mi(e){const t=Fi.getRunningTasks(e);t.length>0&&(yield(0,Va.v_)(t))}function*Vi(e){try{const t=e.flatMap((e=>{let{type:t,codeValues:r}=e;return r.map((e=>({type:t,codeValue:e})))})),r=yield(0,Va.rM)(x.resolveLookupsList,t);Fi.addTask(e,r);const n=(yield(0,Va.v_)(r)).reduce(((e,t)=>{const[r]=Object.keys(t),[n]=Object.keys(t[r]),a=(0,_.lensPath)([r,n]),i=(0,_.path)([r,n],t);return(0,_.set)(a,i,e)}),{});for(const e in n)yield(0,Va.gz)(P.profile.lookups.actions.lookupsForTypeResolved({type:e,values:n[e]}))}catch(e){console.warn(e)}finally{Fi.deleteTask(e)}}function*Bi(e){if((0,_.isEmpty)(e))return;const t=e.map((e=>{let{type:t,codeValues:r}=e;const n=Fi.isLookupValueResolveTaskRunning(t);return{type:t,codeValues:r.filter((0,_.complement)(n))}})).filter((e=>{let{codeValues:t}=e;return t.length>0}));t.length>0&&(yield(0,Va.RE)(Vi,t)),yield(0,Va.RE)(Mi,e)}function*zi(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:K.cu,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;const a=!t&&1===n,i=`${e}${r}`,o=a&&Ui.getRunningTask(i);if(o)yield(0,Va.v_)(o);else try{const o=yield(0,Va.rM)(x.getDependentLookups,{type:e,displayNamePrefix:t,max:r,offset:r*(n-1)});a&&Ui.addTask(i,o);const l=yield(0,Va.v_)(o);yield(0,Va.gz)(P.profile.lookups.actions.lookupsForTypeResolved({type:e,values:l.codeValues[e]}))}catch(e){console.warn(e)}finally{a&&Ui.deleteTask(i)}}const Hi=(e,t,r)=>e.slice((r-1)*t,t*r);function*Yi(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;const a=yield(0,Va.Ys)(k().selectors.getLookups),i=Li(a[e],t);if(i.length>=r*n)return Hi(i,r,n);yield(0,Va.RE)(zi,e,t,r,n);const o=yield(0,Va.Ys)(k().selectors.getLookups);return Hi(Li(o[e],t),r,n)}const Wi=(e,t)=>Object.keys(e).filter((e=>(0,za.iL)(e,t))).reduce(((r,n)=>(r[(0,za.iL)(n,t).fieldName]=e[n],r)),{});function Gi(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){qi(e,t,r[t])}))}return e}function qi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*Zi(e,t,r){if((0,_.isEmpty)(e))return;const n=yield(0,Va.Ys)(k().selectors.getLookups),a=yield(0,Va.Ys)(k().selectors.getMetadata),i=Wi(r,e),o=yield(0,Va.Ys)(ki.Xf);yield(0,Va.gz)(t((0,za.HC)(a,i,e,n,{allowedEntityTypes:o})))}function*$i(e,t,r){try{const n=yield(0,Va.RE)(jl,e.url,e.options),[a,i]=(0,_.partition)(N._H,t);yield(0,Va.rM)(Zi,i,r,n),yield(0,Va.RE)(to,a,n),yield(0,Va.RE)(Zi,a,r,n)}catch(e){console.warn(e)}}function*Ki(e,t,r){e=Gi({},e,{includeFilter:[]});const n=yield(0,Va.Ys)(k().selectors.getGlobalSearchRequestOptions),a=(0,Ba.aw)([e],t,[e.fieldName],n);yield(0,Va.RE)($i,a,[e],r)}const Xi=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t.filter((t=>{let{label:r}=t;return x.utils.strings.search(r,e)}))},Qi=(e,t)=>Xi(t,e).map((0,_.prop)("value"));function*Ji(e,t,r,n){const a=Gi({},e),i=[...t];if((0,N._H)(a)){const t=(0,x.getAttrTypeLookupCode)(e.attrType);a.includeFilter=yield(0,Va.RE)(Yi,t,r,(0,_.propOr)(K.cu,"pageSize",a),a.pageNumber)}else if("sourceSystems"===a.fieldName){const{sources:e}=yield(0,Va.Ys)(k().selectors.getMetadata);a.includeFilter=((e,t)=>Xi(t,e).map((e=>{let{uri:t}=e;return(0,x.getLastUriPart)(t)})))(e,r)}else if((0,N.S9)(a)){const t=yield(0,Va.Ys)(k().selectors.getMetadata),n=(0,x.getEntityType)(t,a.entityTypeUri)||{},i=(0,_.pipe)((0,_.propOr)([],"displayedItems"),(0,_.filter)((0,_.propEq)("isRaw",!0)))(e);a.includeFilter=[...(o=n.matchGroups,l=r,Xi(l,o).map((0,_.prop)("uri"))),...Qi(i,r)]}else a.disableIncludeFilter=!0,i.push({values:[r],fieldName:e.fieldName,filter:"containsWordStartingWith",forceInclude:!0});var o,l;const s=yield(0,Va.Ys)(k().selectors.getGlobalSearchRequestOptions),c=(0,Ba.aw)([a],i,[e.fieldName],s);yield(0,Va.RE)(eo,c,e,a.includeFilter,n)}function*eo(e,t,r,n){try{const a=yield(0,Va.RE)(jl,e.url,e.options),i=yield(0,Va.Ys)(k().selectors.getLookups),o=Wi(a,[t]);if(r){const e=t.fieldName;o[e]=(0,za.AX)(o[e],r)}const l=yield(0,Va.Ys)(k().selectors.getMetadata),s=yield(0,Va.Ys)(ki.Xf);yield(0,Va.gz)(n((0,za.HC)(l,o,[t],i,{allowedEntityTypes:s})))}catch(e){console.warn(e)}}function*to(e,t){const r=yield(0,Va.Ys)(k().selectors.getLookups),n=(0,za.U4)(e,r),a=((e,t,r)=>{const n=((e,t)=>(0,_.pipe)(Object.entries,(0,_.reduce)(((e,r)=>{let[n,a]=r;const i=t.find((0,_.propEq)("fieldName",n));if(!i)return e;const{attrType:o}=i,l=(0,x.getAttrTypeLookupCode)(o);return e[l]={type:l,codeValues:(0,_.uniq)([...(0,_.pathOr)([],[l,"codeValues"],e),...Object.keys(a)])},e}),{}),_.values)(e))(e,t);return(0,x.getUnresolvedLookupsList)(r,n)})(t,e,r),i=(0,x.mergeLookupsLists)(n,a);i.length&&(yield(0,Va.RE)(Bi,i))}var ro=r(59295);function no(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ao(e,t,r[t])}))}return e}function ao(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*io(){const e=yield(0,Va.Ys)(k().selectors.getMetadata),t=yield(0,Va.Ys)(ki.Xf),r=yield(0,Va.Ys)(ki.sl);return(0,Pi.wM)(e,t,r)}const oo=e=>t=>{let{value:r}=t;return!e.length||e.includes(r)};function*lo(e){e=e||(yield(0,Va.Ys)(ui.FR));const t=yield(0,Va.Ys)(ki.XM);if((0,Pi.gj)(t)){const t=yield(0,Va.Ys)(k().selectors.getMetadata),r=yield(0,Va.Ys)(ro.V6),n=(0,N.$t)(t),a=yield(0,Va.Ys)(k().selectors.getGlobalSearchRequestOptions),i=(0,Ba.aw)([n],e,[n.fieldName],a),o=e=>{let{type:t=[]}=e;const n=t.filter(oo(r));return wi(n)};yield(0,Va.RE)($i,i,[n],o)}else yield(0,Va.gz)(wi([]))}function*so(){const e=yield(0,Va.Ys)(k().selectors.getMetadata),t=yield(0,Va.Ys)(ki.Xf),r=yield(0,Va.Ys)(ro.V6);return(0,za.wW)(e,{},t).filter(oo(r))}function*co(){const e=yield(0,Va.Ys)(k().selectors.getMetadata),t=yield(0,Va.RE)(io),r=yield(0,Va.Ys)(ki.uJ),n=(0,Pi.oX)().map((0,_.prop)("id")),a=(0,_.pipe)((0,_.map)((0,_.filter)((0,_.pipe)((0,_.prop)("id"),(0,_.cond)([[(0,_.includes)("."),_.T],[(0,_.includes)(_.__,n),_.T],[_.T,_.F]])))),_.toPairs,(0,_.map)((t=>{let[r,n]=t;return[r,(0,Pi.Wh)(e,r,(0,_.map)((0,_.prop)("id"),n)).map(((e,t)=>{const r=n.find((0,_.propEq)("id",e.id)),{size:a,autoResize:i=0!==t&&!a}=r||{};return(0,_.reject)(_.isNil,no({},e,{size:a,autoResize:i}))}))]})),_.fromPairs)(r),i=!(0,_.equals)(r,a),o=Object.keys(t),l=Object.keys(a);var s;!i&&(0,_.equals)(new Set(o),new Set(l))||(yield(0,Va.gz)((s=no({},t,(0,_.pick)(o,a)),{type:Oe,payload:s})))}function*uo(){const e=yield(0,Va.Ys)(k().selectors.getMetadata),t=yield(0,Va.Ys)(D.DX),r=(yield(0,Va.Ys)(ki.IJ))?yield(0,Va.RE)(so):yield(0,Va.RE)(ss),n=(0,Pi.nx)(e,r,t).map((0,_.prop)("value")),a=yield(0,Va.Ys)(ki.o4);n.includes(a)||(yield(0,Va.gz)(Si(n[0],!0)))}function*po(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{silent:t}=e.payload||{};if(!t){const e=yield(0,Va.Ys)(ki.tB),t=yield(0,Va.Ys)(ui.t9);if((0,x.isAvailableEntityTypeForDataTenant)(t,e)){const t=yield(0,Va.Ys)(ui.BP,{entityTypeUri:e});(0,_.isNil)(t)&&(yield(0,Va.gz)(Xa()))}else yield(0,Va.gz)(Ka([],e))}}function*mo(e){const t=e.payload;yield(0,Va.RE)(po,e);const r=yield(0,Va.Ys)(ki.gu);if((0,Pi.gj)(t)&&0===r.length){const e=yield(0,Va.RE)(so);yield(0,Va.gz)(wi(e)),yield(0,Va.RE)(lo)}}function*go(){const e=yield(0,Va.Ys)(ki.qx),t=yield(0,Va.Ys)(ui.Qy);e!==K.om.MAP&&t.length&&(yield(0,Va.gz)(ri(null)))}function*yo(e){const t=(0,x.removeDtssPrefixFromEntityUri)(e.payload.uri),r=yield(0,Va.Ys)(ki.tB),n=((yield(0,Va.Ys)(ui.BP,{entityTypeUri:r}))||[]).map((0,_.prop)("uri")),a=(yield(0,Va.Ys)(ui.fx,{entityTypeUri:r}))||0,i=(yield(0,Va.Ys)(ui.Uz,{entityTypeUri:r}))||K.Tu[0],o=n.indexOf(t)+a*i,l=yield(0,Va.Ys)(ui.NU,{entityTypeUri:r}),s=yield(0,Va.Ys)(k().selectors.getTenant),c=yield(0,Va.Ys)(ui.lF);yield(0,Va.gz)(P.search.actions.setSearchNavigationData({uri:t,index:o,total:l,tenant:c||s,cache:n}))}const fo=[function*(){yield(0,Va.Fm)(Ce,po)},function*(){yield(0,Va.Fm)(Ne,mo)},function*(){yield(0,Va.Fm)([Xe,Qe,et],uo)},function*(){yield(0,Va.Fm)(De,go)},function*(){yield(0,Va.Fm)(P.ui.constants.UIActions.OPEN_ENTITY,yo)}],ho=e=>({type:or,payload:e}),Eo=e=>({type:lr,payload:e}),bo=()=>({type:Er}),vo=e=>({type:_r,payload:e}),To=e=>({type:Ir,payload:e}),Oo=(e,t)=>({type:Pr,payload:{uri:e,isLoading:t}});var xo=r(90533),Co=r(86374),So=r(4898);function wo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ao(e,t,r[t])}))}return e}function Ao(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*Ro(){yield(0,Va.gz)(To(!0));try{const t=yield(0,Va.Ys)(k().selectors.getUserName),r=e=>wo({},e,{isOwnSearch:t===e.owner}),n=yield(0,Va.RE)(_o),{result:a=[],total:i}=yield(0,Va.RE)(x.getSavedSearches,n);yield(0,Va.gz)((e=>({type:ur,payload:e}))(i));const o=yield(0,Va.Ys)(k().selectors.getMetadata),l=yield(0,Va.Ys)(k().selectors.getDataTenants),s=yield(0,Va.Ys)(k().selectors.getCanUserReadWorkflowDataTask);yield(0,Va.gz)((e=a.map(r).map((0,Co.z7)(o,l,s)),{type:pr,payload:e})),yield(0,Va.gz)(To(!1)),yield(0,Va.RE)(Do,a)}catch(e){yield(0,Va.gz)(To(!1))}var e}function*_o(){const e=yield(0,Va.Ys)(xo.s6),t=yield(0,Va.Ys)(xo.wH),r=yield(0,Va.Ys)(xo.U3),n=yield(0,Va.Ys)(xo.VS),a=yield(0,Va.Ys)(xo.kU),{field:i,order:o}=yield(0,Va.Ys)(xo.rT);return{offset:e*t,max:e,containsWordStartingWith:r,favoriteOnly:n,findPublic:a,countResults:!1,sortBy:K.PW[i],sortOrder:o}}function*Io(e){const t=yield(0,Va.Ys)(xo.EH,e.payload);yield(0,Va.RE)(No,t)}function*No(e,t){yield(0,Va.gz)(Oo(e.uri,!0));try{const{total:r}=yield(0,Va.RE)(x.getTotalsForQuery,(0,x.replacePlaceholdersInQuery)(e.query),Boolean(t));yield(0,Va.gz)(((e,t)=>({type:dr,payload:{uri:e,total:t}}))(e.uri,r))}catch(e){gi(e)}yield(0,Va.gz)(Oo(e.uri,!1))}function*Do(e){const t=yield(0,Va.Ys)(k().selectors.getQueryEstimatorEnabled);return yield(0,Va.$6)(e.map((e=>(0,Va.RE)(No,e,t))))}function*Po(e){const{uri:t,isPublic:r}=e.payload,n=yield(0,Va.Ys)(xo.EH,t);if(n){yield(0,Va.gz)(To(!0));try{yield(0,Va.RE)(x.markSavedSearchAsPublic,(0,Co.Tp)(n),r),yield(0,Va.gz)(((e,t)=>({type:vr,payload:{uri:e,isPublic:t}}))(t,r))}catch(e){gi(e)}yield(0,Va.gz)(To(!1))}}function*ko(e){const{uri:t,isFavorite:r}=e.payload,n=yield(0,Va.Ys)(xo.EH,t);if(n){yield(0,Va.gz)(To(!0));try{yield(0,Va.RE)(x.markSavedSearchAsFavorite,(0,Co.Tp)(n),r),yield(0,Va.gz)(((e,t)=>({type:Or,payload:{uri:e,isFavorite:t}}))(t,r))}catch(e){gi(e)}yield(0,Va.gz)(To(!1))}}function*Lo(e){const{uri:t,isGlobalFilter:r}=e.payload,n=yield(0,Va.Ys)(xo.EH,t);if(n){const e=(0,Co.V2)(n),{uiState:t}=e,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["uiState"]);(0,x.isObject)("2.0"===t.version?t:t.state)||!r?yield(0,Va.gz)(((e,t)=>({type:"SAVED_SEARCHES_MARK_GLOBAL_FILTER",payload:{savedSearch:e,isGlobalFilter:t}}))(wo({},a,{uiState:t,query:(0,x.replacePlaceholdersInQuery)((0,_.propOr)("","query",a))}),r)):(0,pi.U)({errorMessage:"Saved Search is incorrect"},{title:mi().text("Saved Search can't be mark as global")})}}function*Uo(e){const{uri:t,name:r}=e.payload,n=yield(0,Va.Ys)(xo.EH,t);if(n&&r!==n.name){yield(0,Va.gz)(To(!0));try{yield(0,Va.RE)(x.updateSavedSearch,wo({},(0,Co.Tp)(n),{name:r})),yield(0,Va.gz)(((e,t)=>({type:Sr,payload:{uri:e,name:t}}))(t,r))}catch(e){gi(e)}yield(0,Va.gz)(To(!1))}}function*jo(){const e=yield(0,Va.Ys)(xo.Kh);yield(0,Va.gz)(To(!0));try{yield(0,Va.$6)(e.map((e=>(0,Va.RE)(x.deleteSavedSearch,e)))),yield(0,Va.gz)(vo(e.map((0,_.prop)("uri"))))}catch(e){gi(e)}yield(0,Va.gz)(To(!1))}function*Fo(e){const t=e.payload;yield(0,Va.gz)(To(!0));try{yield(0,Va.RE)(x.deleteSavedSearch,{uri:t}),yield(0,Va.gz)(vo([t]))}catch(e){gi(e)}yield(0,Va.gz)(To(!1))}function*Mo(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const r=yield(0,Va.Ys)(xo.Cc,e),n=yield(0,Va.Ys)(So.Z,t);return{query:r,uiState:n}}function*Vo(e){let{payload:{name:t,share:r}}=e;const{query:n,uiState:a}=yield(0,Va.RE)(Mo,!0),i={isFavorite:!1,isPublic:r===K.ib.public,name:t,query:n,uiState:a},o=yield(0,Va.Ys)(xo.tp);yield(0,Va.gz)(Oi(!1));try{yield(0,Va.gz)(_i(mi().text("Saving search...")));const e=yield(0,Va.RE)(x.createSavedSearch,[i]);e[0].successful?(yield(0,Va.gz)(ho(e[0].object)),yield(0,Va.gz)(Eo(!1)),yield(0,Va.gz)(_i(mi().text("Search saved successfully"))),o&&(yield(0,Va.gz)(o))):gi(e)}catch(e){gi(e)}}function*Bo(e){const{uri:t,debounceTime:r}=e.payload;yield(0,Va.gz)(Ti(!1));const n=yield(0,Va.Ys)(xo.EH,t),a=(0,xo.In)(n)||{},{errors:i}=a;i&&i.length?function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];(0,pi.U)(e,{message:mi().text("Saved Search can't be applied")})}(i):(yield(0,Va.gz)(ho(n)),(yield(0,Va.Ys)(ui.lF))&&(a.currentTenant=yield(0,Va.Ys)(k().selectors.getTenant)),yield(0,Va.gz)(P.search.actions.updateState(wo({},a,{debounceTime:r}))),yield(0,Va.qn)(U.Z.STATE_UPDATED))}const zo=[function*(){yield(0,Va.Fm)([cr,mr,gr,Nr,yr,Lr],Ro)},function*(){const e={[br]:Po,[Tr]:ko,[Rr]:Fo,[Ar]:jo,[Cr]:Uo,[xr]:Lo},t=yield(0,Va.ZO)(Object.keys(e));for(;;){const r=yield(0,Va.qn)(t);yield(0,Va.RE)(e[r.type],r)}},function*(){yield(0,Va.Fm)([ir],Vo)},function*(){yield(0,Va.Fm)([Dr],Bo)},function*(){yield(0,Va.ib)([kr],Io)}];function*Ho(e){try{yield(0,Va.RE)(x.createActivity,{label:x.ACTIVITY_TYPES.userSearch,description:JSON.stringify({activity:e,version:"2.0"})})}catch(e){console.warn(e)}}const Yo=e=>({type:Qe,payload:{groupId:e}}),Wo=(e,t)=>({type:nt,payload:{groupId:e,attributeId:t,attribute:Ct()}}),Go=(e,t,r)=>({type:nt,payload:{groupId:e,attributeId:t,attribute:St(r)}}),qo=(e,t,r)=>({type:at,payload:{groupId:e,attributeId:t,attributeData:wt(r)}}),Zo=(e,t)=>({type:at,payload:{groupId:e,attributeId:t,attributeData:null}}),$o=(e,t,r)=>({type:it,payload:{groupId:e,attributeId:t,selectInfo:r}}),Ko=(e,t,r)=>({type:ot,payload:{groupId:e,attributeId:t,operator:r}}),Xo=(e,t)=>({type:lt,payload:{groupId:e,attributeId:t}}),Qo=(e,t)=>({type:st,payload:{groupId:e,attributeId:t}}),Jo=(e,t)=>({type:ct,payload:{groupId:e,attributeId:t,id:(0,Ke.x0)()}}),el=(e,t,r)=>({type:ut,payload:{groupId:e,attributeId:t,filter:r}}),tl=(e,t,r)=>({type:pt,payload:{groupId:e,attributeId:t,values:r}}),rl=(e,t)=>{let{attribute:r,value:n,debounceTime:a=0,pageNumber:i=1,currentOptions:o}=t;return{type:mt,payload:{groupId:e,attribute:r,value:n,debounceTime:a,pageNumber:i,currentOptions:o}}},nl=(e,t,r)=>({type:gt,payload:{groupId:e,attributeId:t,values:r}}),al=(e,t)=>({type:yt,payload:{groupId:e,attribute:t}});var il=r(44006);function*ol(e){let{groups:t,findGroupPath:r=At,attributesPropName:n,groupId:a,attributeId:i,selectInfo:o,actions:l}=e;const{checked:s,attribute:c,index:u,selectedAttributes:p}=o,{addAttributeAfter:d,changeAttribute:m,clearAttribute:g,deleteAttribute:y}=l,f=(0,_.pipe)(r(a),(0,_.path)(_.__,t),(0,_.propOr)([],n))(t),h=e=>(0,_.path)([e,"id"],f),E=f.findIndex((0,_.propEq)("id",i));if(i&&0===u)if(s)yield(0,Va.gz)(m(a,i,c));else{let e=p[u+1];e?(yield(0,Va.gz)(m(a,i,e)),yield(0,Va.gz)(y(a,h(E+1)))):yield(0,Va.gz)(g(a,i))}else{const e=p.length-u,t=i?E+u:f.length-e;s?yield(0,Va.gz)(d(a,h(t-1),c)):yield(0,Va.gz)(y(a,h(t)))}}function ll(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){sl(e,t,r[t])}))}return e}function sl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*cl(e){const{groupId:t,attributeId:r,selectInfo:n}=e.payload,a=yield(0,Va.Ys)(ro.go),i={addAttributeAfter:Go,changeAttribute:qo,clearAttribute:Zo,deleteAttribute:Xo};yield(0,Va.RE)(ol,{groups:a,attributesPropName:"attributes",groupId:t,attributeId:r,selectInfo:n,actions:i}),yield(0,Va.gz)(Yo(t))}function*ul(e){const{attribute:t,groupId:r}=e.payload,n=yield(0,Va.Ys)(ro._7,r),a=yield(0,Va.Ys)(k().selectors.getGlobalSearchRequestOptions),{data:{fieldName:i},values:o}=t,l=yield(0,Va.Ys)(ui.L7,n,i),s=ll({},t.data,{values:o?(0,_.flatten)(o):void 0,pageSize:t.data.pageSize+1}),c=(0,Ba.aw)([s],l,[],a);yield(0,Va.RE)($i,c,[s],(e=>((e,t,r)=>({type:dt,payload:{groupId:e,attributeId:t,values:r}}))(r,t.id,e[i])))}function*pl(e){const{attribute:t,value:r,pageNumber:n=1,debounceTime:a,groupId:i,currentOptions:o=[]}=e.payload,{entityTypeUri:l,fieldName:s}=t.data;if(""===r&&1===n)yield(0,Va.gz)(nl(i,t.id,void 0));else{a&&(yield(0,Va.gw)(a));const e=yield(0,Va.Ys)(ro.ad,i,t.id),c=e=>nl(i,t.id,o.concat(e[s]));if(r){const a=l?[{values:[l],fieldName:"type",filter:"equals"}]:[],i=yield(0,Va.Ys)(ui.L7,a,s);yield(0,Va.rM)(Ji,ll({},t.data,{displayedItems:e,pageNumber:n,pageSize:t.data.pageSize+1}),i,r,c)}else{const r=yield(0,Va.Ys)(ro._7,i),a=yield(0,Va.Ys)(ui.L7,r,s);yield(0,Va.rM)(Ki,ll({},t.data,{displayedItems:e,pageNumber:n,pageSize:t.data.pageSize+1}),a,c)}}}function*dl(){const e=yield(0,Va.Ys)(k().selectors.getSearchKeyword),t=yield(0,Va.Ys)(ui.vH),r=yield(0,Va.RE)(Xl),n=yield(0,Va.Ys)(k().selectors.getMetadata),a=yield(0,Va.Ys)(k().selectors.getDataTenants),i=(0,il.h)(n,a,r);yield(0,Va.gz)(P.search.actions.updateState({advanced:i,keyword:e,map:t}))}function*ml(e){const{groupId:t,attributeId:r}=e.payload;yield(0,Va.gz)(Xo(t,r)),yield(0,Va.gz)(Yo(t))}function*gl(){if(yield(0,Va.Ys)(ki.IJ)){const e=yield(0,Va.Ys)(ro.go),t=yield(0,Va.Ys)(ki.Xf);for(const r of e){const e=r.entityTypes||[];if((t?e.filter((e=>t.includes(e))):e).length!==e.length){yield(0,Va.gz)(Qa({silent:!0}));break}}}}const yl=[function*(){yield(0,Va.ib)([it],cl)},function*(){yield(0,Va.Fm)([mt],pl)},function*(){yield(0,Va.ib)(ht,dl)},function*(){yield(0,Va.ib)(yt,ul)},function*(){yield(0,Va.ib)([st],ml)}];function fl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){hl(e,t,r[t])}))}return e}function hl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*El(){const e=yield(0,Va.Ys)(ui.FR);yield(0,Va.RE)(vl);const t=yield(0,Va.Ys)(ki.tB);var r;yield(0,Va.gz)((r=t,{type:U.Z.RESET_PAGE,payload:{entityTypeUri:r}})),yield(0,Va.rM)(Ql,e),yield(0,Va.rM)(Al,e),(yield(0,Va.Ys)(ki.IJ))?yield(0,Va.rM)(lo,e):yield(0,Va.rM)(bi)}function*bl(e){const{debounceTime:t}=e.payload||{};t&&(yield(0,Va.gw)(t));const r=yield(0,Va.Ys)(ui.FR);yield(0,Va.rM)(Tl,r)}function*vl(){const e=yield(0,Va.Ys)(ki.tB);var t;yield(0,Va.gz)((t=e,{type:U.Z.CLEAR_RESULTS,payload:t}))}function*Tl(e){const t=yield(0,Va.Ys)(k().selectors.getMetadata),r=yield(0,Va.Ys)(ki.tB),n=yield(0,Va.Ys)(ui.fx,{entityTypeUri:r}),a=yield(0,Va.Ys)(ui.Uz,{entityTypeUri:r}),i=yield(0,Va.Ys)(ui.L9,{entityTypeUri:r}),o=yield(0,Va.Ys)(ui.NW,{entityTypeUri:r});let l,s=e,c=[];if(r){const n={fieldName:"type",filter:"equals",values:[r]};s=e.filter((e=>"type"!==e.fieldName)).concat(n);const a=yield(0,Va.RE)(wl,r);c=(0,_.uniq)(c.concat(a).concat((0,Ba.kx)(t,s,[Ba.cI]))),l=!0}else c=(0,_.uniq)(c.concat((0,Ba.kx)(t,s,[Ba.Bo,Ba.cI]))),l=!1;const u=fl({page:n,rowsPerPage:a,sortOrder:i,sortField:o,forceOvOnly:l},yield(0,Va.Ys)(k().selectors.getGlobalSearchRequestOptions),{select:c}),p=(0,Ba.XP)(s,u),d=yield(0,Va.Ys)(ui.lF);yield(0,Va.gz)(ti(!0));try{let e;if(d){const t=(0,Ba.kH)(s,u);e=yield(0,Va.RE)(jl,t)}else{const t=(0,Ba.Lv)(s,u);e=yield(0,Va.RE)(jl,K.NV,t)}Array.isArray(e)||(e=[]),yield(0,Va.RE)(Ol,(0,_.reject)(_.isNil,{query:p,sortField:o,sortOrder:i,dataTenant:d})),e=yield(0,Va.RE)(Ul,e),yield(0,Va.gz)(Ka(e,r))}catch(e){yield(0,Va.gz)(Ka([],r))}yield(0,Va.gz)(ti(!1))}function*Ol(e){var t;yield(0,Va.gz)((t=e.query,{type:U.Z.UPDATE_URL,payload:t}));const r=yield(0,Va.Ys)(k().selectors.getSearchProviderData);(0,_.equals)(null==r?void 0:r.data,e)||(yield(0,Va.gz)(P.search.actions.setSearchNavigationData(null))),yield(0,Va.gz)(P.search.actions.setSearchProviderData({type:"search",data:e}))}function*xl(e){const{columns:t,prevColumns:r}=e.payload;if((0,Pi.tU)(t,r)){const e=yield(0,Va.Ys)(ki.o4),t=(yield(0,Va.Ys)(ui.BP,{entityTypeUri:e})).map((e=>e.uri)),r=yield(0,Va.RE)(wl,e),n=yield(0,Va.Ys)(ui.FR),a=yield(0,Va.Ys)(k().selectors.getGlobalSearchRequestOptions),i=(0,Ba.aG)(t,n,fl({select:r},a));yield(0,Va.gz)(ti(!0));try{let t=yield(0,Va.RE)(jl,i.url,i.options);t=yield(0,Va.RE)(Ul,t),yield(0,Va.gz)(Ka(t,e))}catch(t){yield(0,Va.gz)(Ka([],e)),gi(t)}yield(0,Va.gz)(ti(!1))}}function*Cl(){const e=yield(0,Va.Ys)(ki.tB),t=yield(0,Va.Ys)(ui.BP,{entityTypeUri:e});t&&(yield(0,Va.gz)(P.search.actions.searchResultsSet(t)))}function*Sl(e){const{entityTypeUri:t,keywordValue:r}=e.payload;yield(0,Va.gz)(function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return{type:L.k.CLEAR_ALL_VALUES,payload:{silent:e}}}(!0)),yield(0,Va.gz)(ii("type",[t],!0)),yield(0,Va.gz)(P.search.actions.keywordUpdated({value:r,isRawFilter:!1}))}function*wl(e){const t=yield(0,Va.Ys)(ki.Gv,e);return(0,Pi.vw)(t)}function*Al(e){const t=yield(0,Va.Ys)(k().selectors.getGlobalSearchRequestOptions),r=(0,Ba.Vg)(e,[],t);try{const e=yield(0,Va.RE)(jl,K.jS,{method:"POST",body:JSON.stringify(r)});yield(0,Va.gz)(ei(e.total))}catch(e){yield(0,Va.gz)(ei(0))}}function*Rl(){yield(0,Va.RE)(Il);const e=yield(0,Va.RE)(Mo,!0);(0,_.isEmpty)(e.query)||(yield(0,Va.RE)(Ho,e))}const _l=[dt];function*Il(){for(;yield(0,Va.Ys)(ro.UM);)yield(0,Va.qn)(_l)}function*Nl(e){const{debounceTime:t}=e.payload||{};t&&(yield(0,Va.gw)(t)),(0,za.$L)(e)&&(yield(0,Va.RE)(as)),(0,_.pathOr)(!1,["payload","silent"],e)||(yield(0,Va.RE)(El),yield(0,Va.RE)(Rl))}function*Dl(e){var t;const r=(0,_.path)(["payload","searchOptions"],e),n=(0,_.path)(["payload","errors"],e),a=(0,_.pathOr)(0,["payload","debounceTime"],e);n&&n.length&&function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];(0,pi.U)(e,{message:mi().text("Can't apply search state")})}(n),!(null!==(t=yield(0,Va.Ys)(k().selectors.getShowSearchByOv))&&void 0!==t?t:yield(0,Va.Ys)(ki.cC))&&r&&r.searchByOv&&(yield(0,Va.gz)(P.search.actions.updateSearchOptions({searchByOv:!1,ovOnly:!1}))),yield(0,Va.RE)(ls),yield(0,Va.RE)(gl),yield(0,Va.RE)(co),yield(0,Va.RE)(uo),yield(0,Va.RE)(Pl),yield(0,Va.gz)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return{type:U.Z.STATE_UPDATED,payload:{debounceTime:e}}}(a))}function*Pl(){const e=yield(0,Va.Ys)(ki.d7),t=yield(0,Va.Ys)(ui.Qy);!e&&t.length&&(yield(0,Va.gz)(ri(null,null,!0)))}function*kl(){const e=yield(0,Va.Ys)(ui.A7),{activityFilter:t,globalFilter:r}=yield(0,Va.Ys)(k().selectors.getGlobalSearchRequestOptions),n=yield(0,Va.Ys)(k().selectors.getSearchOptions),a=n&&n.searchByOv,i=[(0,Ba.s4)(e,[],{globalFilter:r})];a&&i.push("options=searchByOv"),t&&i.push(`activeness=${t}`);const o=i.filter(_.identity).join("&"),l=new URLSearchParams(o);if(yield(0,Va.Ys)(k().selectors.getSharedPreferencesEnabled)){const e=yield(0,Va.Ys)(k().selectors.getServicesPath),t=yield(0,Va.Ys)(k().selectors.getTenant),r=yield(0,Va.Ys)(k().selectors.getEnvironment),n=yield(0,Va.Ys)(k().selectors.getUserName),a=yield(0,Va.Ys)(ki.XM),i=yield(0,Va.Ys)(ki.uJ),o=(0,_.pipe)((0,_.map)((0,_.pipe)((0,_.map)((0,_.path)(["attrType","uri"])),(0,_.reject)(x.isEmptyValue))),(0,_.reject)(_.isEmpty)),s="searchExportData",c={name:s,tenant:t,environment:r,user:n,servicesPath:e,value:{searchResultsColumnsUris:(0,Pi.gj)(a)?o(i):void 0}};try{yield(0,Va.RE)(x.setSharedPreferences,c),l.set("sharedPreferenceName",s)}catch(e){gi(e)}}yield(0,Va.gz)(P.ui.actions.openConsoleApp("Export","entities",l.toString()))}function*Ll(){yield(0,Va.gz)(P.ui.actions.openConsoleApp("Data Loader","projects"))}function*Ul(e){const t=yield(0,Va.Ys)(ui.lF);return e&&t?e.map((0,x.enrichEntityWithDataTenant)(t)):e}function*jl(e,t){const r=yield(0,Va.Ys)(k().selectors.getTenant),n=yield(0,Va.Ys)(ui.lF),a=yield(0,Va.Ys)(k().selectors.getDtssPath);return yield(0,Va.RE)(Ba.Es,{url:e,options:t,customerTenant:r,dataTenant:n,dtssPath:a})}const Fl=[L.k.CHANGE_VALUES,P.search.constants.KEYWORD_UPDATED,U.Z.REFRESH,L.k.CLEAR_ALL_VALUES,U.Z.MAP_CHANGE_VALUE,U.Z.CLEAR_ALL,U.Z.STATE_UPDATED,ft,P.search.constants.SEARCH_OPTIONS_UPDATED,P.search.constants.ACTIVITY_FILTER_UPDATED,P.search.constants.GLOBAL_FILTER_UPDATED,U.Z.CHANGE_CURRENT_TENANT],Ml=[function*(){yield(0,Va.Fm)(Fl,Nl)},function*(){yield(0,Va.Fm)([U.Z.CHANGE_PAGE,U.Z.RESET_PAGE,U.Z.CHANGE_ROWS_PER_PAGE,U.Z.REFRESH_DISPLAYED_ENTITIES,U.Z.CHANGE_SORT],bl)},function*(){yield(0,Va.Fm)(xe,xl)},function*(){yield(0,Va.Fm)([U.Z.UPDATE_ENTITIES,Ce,Ne],Cl)},function*(){yield(0,Va.Fm)(U.Z.SHOW_MORE_RESULTS_FOR_ENTITY_TYPE,Sl)},function*(){yield(0,Va.Fm)(P.search.constants.UPDATE_STATE,Dl)},function*(){yield(0,Va.Fm)(U.Z.EXPORT_RESULTS,kl)},function*(){yield(0,Va.Fm)(U.Z.OPEN_DATA_LOADER,Ll)}];var Vl=r(56906);function Bl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*zl(e,t){try{const[r,n]=yield(0,Va.RE)(Hl,e,[]);if((0,_.isNil)(r)||(0,_.isNil)(n))yield(0,Va.gz)(oi({[e.fieldName]:[]}));else{const[a,i]=(0,za.dG)(e.type),o=(0,za.q7)(a,r),l=(0,za.q7)(i,n),s=(0,ci.Oz)(e.attrType&&e.attrType.type),[c,u]=s.greaterThan(o,l)?[l,o]:[o,l],p=yield(0,Va.RE)(Yl,e,c,u,t),d={[e.fieldName]:p};yield(0,Va.gz)(oi(d))}}catch(e){console.warn(e)}}function*Hl(e,t){const r=yield(0,Va.Ys)(k().selectors.getGlobalSearchRequestOptions),n=(0,Ba.rN)(e,t,[e.fieldName],r),a=yield(0,Va.RE)(jl,n.url,n.options),i=Wi(a,[e]),{min:o,max:l,count:s}=(0,za.Kn)(i,[e])[e.fieldName];return s?[(0,N.bB)(e)?0:o,l]:[]}function*Yl(e,t,r,n){const a=e.attrType&&e.attrType.type,i=(0,Vl.C)(a),o=i.getInterval(t,r,50),l=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Bl(e,t,r[t])}))}return e}({interval:o,offset:t},yield(0,Va.Ys)(k().selectors.getGlobalSearchRequestOptions)),s=(0,Ba.ti)(e,n,[e.fieldName],l),c=yield(0,Va.RE)(jl,s.url,s.options),u=yield(0,Va.Ys)(k().selectors.getMetadata),p=Wi(c,[e]),d=(0,za.HC)(u,p,[e]);return i.addRanges(d[e.fieldName],t,r,o).map(((e,t,n)=>({value:[e.value,t<n.length-1?n[t+1].value:r],number:e.number})))}function Wl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Gl={matches:Ba.dW,"dtPotentialMatches.matches":Ba.dW,"potentialMatches.matchScore":Ba._9};function*ql(e,t){try{const[r,n]=yield(0,Va.RE)(Hl,e,[]);if((0,_.isNil)(r)||(0,_.isNil)(n))yield(0,Va.gz)(oi({[e.fieldName]:[]}));else{const[a,i]=(0,za.dG)(e.type),o=(0,za.q7)(a,r),l=(0,za.q7)(i,n),s=yield(0,Va.RE)(Zl,e,o,l,t),c={[e.fieldName]:s};yield(0,Va.gz)(oi(c))}}catch(e){console.warn(e)}}function*Zl(e,t,r,n){const a=yield(0,Va.Ys)(k().selectors.getGlobalSearchRequestOptions),i=Math.min(5,r-t+1),o=yield(0,Va.RE)(x.rawRequest,Gl[e.fieldNameForRequest||e.fieldName](t,r,i,n,[e.fieldName],function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Wl(e,t,r[t])}))}return e}({},a,{dataTenant:e.dataTenant})));return o.map((e=>({number:e.count,value:[e.from,e.to]})))}function $l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Kl(e,t,r[t])}))}return e}function Kl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*Xl(){const e=yield(0,Va.Ys)(D.X0),t=yield(0,Va.Ys)(D.Mp);return Object.values((0,za.t8)(e,t))}function*Ql(e){const t=yield(0,Va.RE)(Xl),[r,n]=(0,_.partition)(N.bB,t);let[a,i]=(0,_.partition)(x.isRangeFacet,n);for(let t=0;t<r.length;t++)yield(0,Va.rM)(ql,r[t],e);for(let t=0;t<a.length;t++)yield(0,Va.rM)(zl,a[t],e);const[o,l]=(0,_.partition)((e=>e.values&&e.values.length),i);for(let t=0;t<o.length;t++)yield(0,Va.rM)(es,o[t],e);const[s,c]=(0,_.partition)(N.DT,l);for(const t of s)yield(0,Va.rM)(ts,[t],e);c.length&&(yield(0,Va.rM)(ts,c,e))}function*Jl(e){const t=yield(0,Va.Ys)(ui.FR),[r,n]=(0,_.partition)(N.bB,e.payload),[a,i]=(0,_.partition)(x.isRangeFacet,n),[o,l]=(0,_.partition)(N.DT,i);for(let e=0;e<r.length;e++)yield(0,Va.rM)(ql,r[e],t);for(let e=0;e<a.length;e++)yield(0,Va.rM)(zl,a[e],t);for(const e of o)yield(0,Va.rM)(ts,[e],t);l.length&&(yield(0,Va.rM)(ts,l,t))}function*es(e,t,r){const n=yield(0,Va.Ys)(k().selectors.getGlobalSearchRequestOptions),a=(0,Ba.aw)([$l({},e,{pageSize:e.pageSize+1})],t,[e.fieldName],n,r);yield(0,Va.RE)(rs,a,[e])}function*ts(e,t,r){const n=yield(0,Va.Ys)(k().selectors.getGlobalSearchRequestOptions),a=(0,Ba.aw)(e.map((e=>$l({},e,{pageSize:e.pageSize+1}))),t,[],n,r);yield(0,Va.RE)(rs,a,e)}function*rs(e,t){yield(0,Va.RE)($i,e,t,oi)}function*ns(e){const{facetFieldName:t,value:r,debounceTime:n,pageNumber:a=1,currentOptions:i=[]}=e.payload;if(""===r&&1===a)yield(0,Va.gz)((e=>({type:L.k.DESTROY_FILTERED_DATA,payload:e}))(t));else{const e=yield(0,Va.Ys)(D.X0),o=yield(0,Va.Ys)(D.Mp),l=$l({},(0,za.t8)(e,o)[t]);if("type"===t){const e={[t]:[...l.data.filter((e=>e.label.toLowerCase().includes(r.toLowerCase())))]};yield(0,Va.gz)(li(e))}else{n&&(yield(0,Va.gw)(n));const e=yield(0,Va.Ys)(ui.FR),o=yield(0,Va.Ys)(D.rM,t),s=e=>li({[t]:i.concat(e[t])});r?yield(0,Va.rM)(Ji,$l({},l,{displayedItems:o,pageNumber:a,pageSize:l.pageSize+1}),e,r,s):yield(0,Va.rM)(Ki,$l({},l,{pageNumber:a,pageSize:l.pageSize+1}),e,s)}}}function*as(){const e=yield(0,Va.Ys)(D.DX),t=t=>t.entityTypeUri&&t.entityTypeUri!==e[0],r=yield(0,Va.Ys)(D.Mp);if(1!==e.length||r.some(t)){const n=r.filter((r=>1!==e.length&&!!r.entityTypeUri||1===e.length&&t(r))).map((e=>e.fieldName));n.length&&(yield(0,Va.gz)(ai(n)))}}function*is(e){const{facetsToAdd:t=[],fieldNamesToDelete:r=[],changedEntityTypes:n,addToEnd:a=!1}=e.payload;if(t.length||r.length){t.length&&(yield(0,Va.gz)(ni(t,a)));const e=yield(0,Va.RE)(Xl);let o=!1;if(r.length){const t=e.filter((e=>e.values&&e.values.length));o=r.some((e=>t.some((t=>t.fieldName.startsWith(e))))),yield(0,Va.gz)(ai(r))}if(null!=n)yield(0,Va.gz)(ii("type",n));else if(o)yield(0,Va.gz)(function(){let{debounceTime:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{type:U.Z.REFRESH,payload:{debounceTime:e}}}());else if(t.length){const r=e.filter((e=>t.some((t=>e.fieldName.startsWith(t.fieldName)))));yield(0,Va.gz)((i=r,{type:L.k.REQUEST_GIVEN_FACETS_DATA,payload:i}))}}var i}function*os(){const e=yield(0,Va.Ys)(k().selectors.getSearchKeyword),t=yield(0,Va.Ys)(ui.vH),r=yield(0,Va.Ys)(ro.go),n=yield(0,Va.Ys)(k().selectors.getMetadata),a=yield(0,Va.Ys)(k().selectors.getDataTenants);if(Ga(n,r,a)){const i=((e,t,r)=>{const n=$a(e,t,r),a=Za(e,t,r),i=(0,_.pipe)(_.flatten,_.uniq)((0,Et.VO)(t)),o=(0,N.$t)(e);return a.reduce(((e,t)=>{let{fieldName:r,values:a}=t;const i=n.find((e=>e.fieldName===r));return i&&(e.facetsConfigs.push(i),e.facetsData[r]={values:a}),e}),{facetsConfigs:[o],facetsData:{[o.fieldName]:(l=i,(0,za.Kk)({values:l})?{values:l,showAllItems:!0}:{values:l})}});var l})(n,r,a);yield(0,Va.gz)(P.search.actions.updateState({facets:i,keyword:e,map:t}))}}function*ls(){if(!(yield(0,Va.Ys)(ki.IJ))){const e=yield(0,Va.Ys)(k().selectors.getMetadata);if((yield(0,Va.Ys)(D.Mp)).some(x.isTypeFacet)){const e=yield(0,Va.Ys)(ki.Xf),t=yield(0,Va.Ys)(D.DX);(e?t.filter((t=>e.includes(t))):t).length!==t.length&&(yield(0,Va.gz)(Qa({silent:!0})))}else{const t=[(0,N.$t)(e)];yield(0,Va.gz)(ni(t))}}}function*ss(){const e=yield(0,Va.Ys)(k().selectors.getMetadata),t=yield(0,Va.Ys)(D.X0),r=(0,za.t8)({type:t.type},[(0,N.$t)(e)]).type.data.reduce(((e,t)=>(e[(0,x.getLastUriPart)(t.value)]=t.number,e)),{}),n=yield(0,Va.Ys)(ki.Xf);return(0,za.wW)(e,r,n)}const cs=[function*(){yield(0,Va.Fm)([L.k.FILTER_FACET_DATA],ns)},function*(){yield(0,Va.ib)(L.k.REQUEST_GIVEN_FACETS_DATA,Jl)},function*(){yield(0,Va.ib)(L.k.HANDLE_CONFIGS_CHANGES,is)},function*(){yield(0,Va.ib)(L.k.CONVERT_FROM_ADVANCED_SEARCH,os)}];function us(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ps=e=>{const t=["view","searchResultsColumns"],r=(0,_.pathOr)({},t,e),n=(0,_.map)((0,_.map)((0,_.pipe)((0,_.omit)(["size"]),(e=>e.attrType?function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){us(e,t,r[t])}))}return e}({},e,{attrType:{uri:(0,_.pathOr)("",["attrType","uri"],e)}}):e))),r),a=(0,_.lensPath)(t),i=(0,_.omit)(["sortField","sortOrder","entityTypeTab"],e.view),o=(0,_.lensPath)(["view"]),l=["keyword"],s=(0,_.pathOr)("",l,e),c=(0,_.lensPath)(l),u=["map"],p=(0,_.pathOr)("",u,e),d=(0,_.lensPath)(u);return(0,_.pipe)((0,_.omit)(["searchOptions"]),(0,_.set)(o,i),(0,_.set)(a,n),(0,_.set)(c,s),(0,_.set)(d,p))(e)};function ds(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ms(e,t,r[t])}))}return e}function ms(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*gs(e){let{payload:{share:t}}=e;const{query:r,uiState:n}=yield(0,Va.RE)(Mo,!0),a=ds({},yield(0,Va.Ys)(xo.LA),{isPublic:t===K.ib.public,query:r,uiState:n}),i=yield(0,Va.Ys)(xo.tp);yield(0,Va.gz)(Oi(!1));try{yield(0,Va.gz)(_i(mi().text("Updating search..."))),yield(0,Va.RE)(x.updateSavedSearch,a),yield(0,Va.gz)(Eo(!1)),yield(0,Va.gz)(_i(mi().text("Search updated successfully"))),i&&(yield(0,Va.gz)(i))}catch(e){gi(e)}}function*ys(){const e=yield(0,Va.Ys)(xo.LA);if(!e)return void(yield(0,Va.gz)(Eo(!1)));const t=yield(0,Va.Ys)(k().selectors.getMetadata),r=yield(0,Va.Ys)(k().selectors.getDataTenants),n=yield(0,Va.Ys)(k().selectors.getCanUserReadWorkflowDataTask),{uiState:a}=(0,Co.z7)(t,r,n,yield(0,Va.RE)(Mo)),i=(e=>{let{savedUiState:t,actualUiState:r}=e;const n=ps(t),a=ps(r);if(!(0,_.equals)(n,a))return!1;if((0,_.path)(["view","searchResultsMode"],t)===K.ll.TABLE){const e=["view","sortField"],n=["view","sortOrder"],a=["view","entityTypeTab"],i=(0,_.path)(e,t),o=(0,_.path)(e,r),l=(0,_.path)(n,t),s=(0,_.path)(n,r),c=(0,_.path)(a,t),u=(0,_.path)(a,r);if(!(0,_.equals)(i,o)||!(0,_.equals)(l,s)||!(0,_.equals)(c,u))return!1}const i=["searchOptions"],o=(0,_.pathOr)(null,i,t),l=(0,_.pathOr)(null,i,r);return!!((0,_.isNil)(o)||(0,_.isNil)(l)||(0,_.equals)(o,l))})({savedUiState:e.uiState,actualUiState:a});yield(0,Va.gz)(Eo(!i))}function*fs(e){const t=yield(0,Va.Ys)(xo.LA);if(t)switch(e.type){case Sr:case vr:case Or:t.uri===e.payload.uri&&(yield(0,Va.gz)(ho(ds({},t,e.payload))));break;case _r:(0,_.includes)(t.uri,e.payload)&&(yield(0,Va.gz)(ho(null)));break;case sr:yield(0,Va.gz)(ho(ds({},t,{isPublic:e.payload.share===K.ib.public})));break;default:(yield(0,Va.Ys)(ui.kw))&&(yield(0,Va.gz)(ho(null)))}}function*hs(e){const t=yield(0,Va.Ys)(xo.EH,e);if(t)return t;const r=yield(0,Va.Ys)(k().selectors.getMetadata),n=yield(0,Va.Ys)(k().selectors.getDataTenants),a=yield(0,Va.Ys)(k().selectors.getCanUserReadWorkflowDataTask);try{const t=yield(0,Va.RE)(x.getSavedSearch,(0,Co.tk)(e));return(0,Co.z7)(r,n,a,t)}catch(e){return gi(e),null}}function*Es(e){const t=(0,_.path)(["payload","currentSavedSearchUri"],e);if(!t)return;const r=yield(0,Va.Ys)(xo.LA);if((0,_.prop)("uri",r)===t)return;const n=yield(0,Va.RE)(hs,t);n&&(yield(0,Va.gz)(ho(n)),yield(0,Va.RE)(ys))}const bs=[...Fl,Ce,U.Z.CHANGE_SORT,Ne,xe,Ae,we,De,L.k.CREATE_FACETS,L.k.DESTROY_FACETS,L.k.SHOW_MORE_ENTITY_TYPES],vs=[function*(){yield(0,Va.Fm)(bs,ys)},function*(){yield(0,Va.Fm)([sr],gs)},function*(){yield(0,Va.Fm)([Sr,vr,Or,_r,sr,...Fl],fs)},function*(){yield(0,Va.Fm)(P.search.constants.UPDATE_STATE,Es)}];function Ts(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*Os(){yield(0,Va.gw)(500);const{uiState:e,query:t}=yield(0,Va.RE)(Mo,!1,!0),r=yield(0,Va.Ys)(xo.LA);yield(0,Va.gz)(P.search.actions.saveState(function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ts(e,t,r[t])}))}return e}({},e,{query:t,currentSavedSearchUri:(0,_.path)(["uri"],r)})))}function*xs(){yield(0,Va.qn)(P.search.constants.UPDATE_STATE);const e=(0,_.reject)((0,_.includes)(_.__,[U.Z.REFRESH]),bs);yield(0,Va.Fm)([or,...e],Os)}const Cs=e=>({type:Ur,payload:e}),Ss=()=>({type:zr}),ws=e=>({type:Yr,payload:e}),As=e=>({type:Gr,payload:e}),Rs=(e,t)=>({type:$r,payload:{searchCreatedDate:e,isLoading:t}});var _s=r(97010),Is=r(73667);const Ns=(0,_.path)([K.Jf,"recentSearches"]),Ds=e=>Ns(e).items,Ps=e=>Ns(e).filterWord,ks=(0,_.curry)(((e,t)=>!e||t&&t.name.toLocaleLowerCase().includes(e.toLocaleLowerCase()))),Ls=e=>(0,_.pipe)(Ds,(0,_.filter)(ks(Ps(e))))(e),Us=e=>Ns(e).loading,js=(0,Is.Rm)(Ds),Fs=(0,Is.d1)(Ds),Ms=(0,Is.Ky)(Ds),Vs=(0,Is.$y)(Ds),Bs=e=>Ns(e).lastSavedRecentSearch,zs=(e,t)=>Ds(e).find((0,_.propEq)("createdDate",t)),Hs=(0,_.path)(["advancedSearch","searchParams","groups"]),Ys=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,_.chain)((0,_.prop)("attributes")),r=(0,_.filter)((0,_.has)("values")),n=(0,_.pipe)(Hs,t,r),a=(0,_.pipe)((0,_.prop)("values"),(0,_.map)((0,_.prop)("label")),(0,_.join)(", ")),i=(0,_.path)(["data","title"]),o=(0,_.pathEq)(["data","fieldName"],"type"),l=(0,_.find)(o),s=(0,_.pipe)(l,(0,_.when)(_.identity,a)),c=(0,_.pipe)((0,_.reject)(o),(0,_.map)(i),(0,_.reject)(_.isNil),(0,_.join)(", ")),u=e=>[s(e),c(e)].filter(_.identity).join(" - ");return u(n(e))},Ws=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,_.prop)("facets"),r=(0,_.prop)("facetsData"),n=(0,_.prop)("facetsConfigs"),a=(0,_.prop)("values"),i=(0,_.prop)("label"),o=(0,_.prop)("title"),l=(0,_.pipe)(a,(e=>e&&e.length>0)),s=e=>(0,_.pipe)((0,_.propOr)([],"data"),(0,_.find)((0,_.propEq)("value",e)),(0,_.defaultTo)({}),i),c=(0,_.curry)(((e,r)=>(0,_.pipe)(t,n,(0,_.find)((0,_.propEq)("fieldName",r)),(0,_.defaultTo)({}),o)(e))),u=(0,za.XK)(e),p=[];u&&p.push(a(u).map(s).map((e=>e(u))).join(", "));const d=(0,_.pipe)(t,r,_.values,(0,_.reject)(x.isTypeFacet),(0,_.filter)(l),(0,_.map)((0,_.prop)("fieldName"))),m=(0,_.pipe)(d,(0,_.map)(c(e))),g=m(e);return g.length>0&&p.push(g.join(", ")),p.filter(_.identity).join(" - ")};function Gs(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){qs(e,t,r[t])}))}return e}function qs(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*Zs(){yield(0,Va.gz)(As(!0));try{const t=yield(0,Va.Ys)(k().selectors.getTenant),r=yield(0,Va.Ys)(k().selectors.getEnvironment),n=yield(0,Va.Ys)(k().selectors.getServicesPath),{result:a=[]}=yield(0,Va.RE)(x.getRecentSearches,{environment:r,tenant:t,servicesPath:n}),i=(0,_.sort)((0,_.descend)((0,_.prop)("createdDate")))(a);yield(0,Va.gz)((e=i,{type:Fr,payload:e})),yield(0,Va.gz)(As(!1)),yield(0,Va.RE)(Xs,i)}catch(e){gi(e),yield(0,Va.gz)(As(!1))}var e}function*$s(e){const t=yield(0,Va.Ys)(zs,e.payload);yield(0,Va.RE)(Ks,t)}function*Ks(e,t){yield(0,Va.gz)(Rs(e.createdDate,!0));try{const{total:r}=yield(0,Va.RE)(x.getTotalsForQuery,(0,x.replacePlaceholdersInQuery)(e.query),Boolean(t));yield(0,Va.gz)(((e,t)=>({type:Mr,payload:{searchCreatedDate:e,total:t}}))(e.createdDate,r))}catch(e){gi(e)}yield(0,Va.gz)(Rs(e.createdDate,!1))}function*Xs(e){const t=yield(0,Va.Ys)(k().selectors.getQueryEstimatorEnabled);return yield(0,Va.$6)(e.map((e=>(0,Va.RE)(Ks,e,t))))}function*Qs(){const e=yield(0,Va.Ys)(Vs),t=yield(0,Va.Ys)(k().selectors.getServicesPath);yield(0,Va.gz)(As(!0));try{yield(0,Va.$6)(e.map((e=>(0,Va.RE)(x.deleteRecentSearch,Gs({},e,{servicesPath:t}))))),yield(0,Va.gz)(ws(e))}catch(e){gi(e)}yield(0,Va.gz)(As(!1))}function*Js(e){const t=e.payload,r=yield(0,Va.Ys)(k().selectors.getServicesPath);yield(0,Va.gz)(As(!0));try{yield(0,Va.RE)(x.deleteRecentSearch,Gs({},t,{servicesPath:r})),yield(0,Va.gz)(ws([t]))}catch(e){gi(e)}yield(0,Va.gz)(As(!1))}function*ec(){const{query:e,uiState:t}=yield(0,Va.RE)(Mo,!0),r=yield(0,Va.Ys)(ki.$s),n=yield(0,Va.Ys)(Bs),a=yield(0,Va.Ys)(ui.kw),i=yield(0,Va.Ys)(k().selectors.getTenant),o=yield(0,Va.Ys)(k().selectors.getEnvironment),l=yield(0,Va.Ys)(k().selectors.getServicesPath),s=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Hs(e);return t&&t.length>0?Ys(e):Ws(e)}(r),c=(0,x.getHash)(e),u={query:e,state:t,name:s,environment:o,tenant:i};try{if(n!==c&&!a){const e=yield(0,Va.RE)(x.createRecentSearch,u,l);e.success?yield(0,Va.gz)((e=>({type:Zr,payload:e}))(c)):gi(e)}}catch(e){gi(e)}}function*tc(e){const{search:t,debounceTime:r}=e.payload;yield(0,Va.gz)(Ti(!1));const n=yield(0,Va.Ys)(k().selectors.getMetadata),a=yield(0,Va.Ys)(k().selectors.getDataTenants),i=yield(0,Va.Ys)(k().selectors.getCanUserReadWorkflowDataTask);let o={};try{o=(0,_.pipe)(_s.Z,(0,_s.f)(null))(n,JSON.parse(t.state),{},a,i)}catch(e){o={}}(yield(0,Va.Ys)(ui.lF))&&(o.currentTenant=yield(0,Va.Ys)(k().selectors.getTenant)),yield(0,Va.gz)(P.search.actions.updateState(Gs({},o,{debounceTime:r})))}const rc=e=>{let{type:t,payload:r={}}=e;return t===P.search.constants.KEYWORD_UPDATED&&!(null==r||!r.saveToRecent)},nc=[function*(){yield(0,Va.Fm)([jr],Zs)},function*(){yield(0,Va.ib)(Hr,Qs)},function*(){yield(0,Va.Fm)([P.ui.constants.UIActions.OPEN_ENTITY,ir,sr,Ur,U.Z.CHANGE_PAGE,U.Z.CHANGE_ROWS_PER_PAGE,U.Z.EXPORT_RESULTS,rc],ec)},function*(){yield(0,Va.Fm)([Xr],tc)},function*(){yield(0,Va.ib)([Kr],$s)},function*(){yield(0,Va.ib)(Wr,Js)}],ac=e=>e[K.Jf].entity.loading,ic=e=>e[K.Jf].entity.selectedEntityUri,oc=e=>e[K.Jf].entity.entity,lc=e=>({type:On,payload:e}),sc=e=>({type:xn,payload:e}),cc=e=>({type:Cn,payload:e}),uc=e=>({type:Sn,payload:e});function*pc(e){if(yield(0,Va.Ys)(ui.lF)){const t=yield(0,Va.RE)(jl,(0,x.getDtssEntityUrl)(e));return(yield(0,Va.RE)(Ul,t))[0]}{const t=yield(0,Va.Ys)(k().selectors.getMetadata),r=(0,x.addMetadataSpecificGetEntityOptions)(t);return yield(0,Va.RE)(x.getEntity,e,r)}}function*dc(e){const t=e.payload;(yield(0,Va.Ys)(ic))!==t&&(yield(0,Va.gz)(cc(t)));const r=yield(0,Va.Ys)(oc);if(yield(0,Va.gz)(lc(!0)),(0,_.isNil)(t))yield(0,Va.gz)(uc(null));else if(!r||r.uri!==t)try{const e=yield(0,Va.RE)(pc,t);yield(0,Va.gz)(uc(e))}catch(e){n=e,(0,pi.U)(n,{defaultMessage:mi().text("Can't load entity")}),yield(0,Va.gz)(uc(null))}var n;yield(0,Va.gz)(lc(!1))}const mc=[function*(){yield(0,Va.Fm)(xn,dc)}];function*gc(e){const t="type"===(0,_.path)(["payload","facetFieldName"],e),r=(0,_.path)(["payload","values"],e);if(!t||1!==(0,_.length)(r))return;const n=yield(0,Va.Ys)(k().selectors.getMetadata),a=(0,x.getEntityType)(n,r[0]),i=a.defaultFacetedAttributes||[];if(i.length>0){const e=yield(0,Va.Ys)(D.Mp),t=t=>{let{fieldName:r}=t;return(0,_.none)((0,_.propEq)("fieldName",r),e)},r=(0,yi.vf)(n,a).map((e=>(0,yi.NG)(n,e,a.uri,"",N.u7))),o=i.reduce(((e,n)=>{const a=(0,x.attributeUriToSearchUri)(n),i=(0,N.zy)(r,a);return i&&t(i)?e.concat(i.children?(0,yi.jj)(i).filter(t):i):e}),[]);o.length>0&&(yield(0,Va.gz)(ni(o,!0)))}}const yc=[function*(){yield(0,Va.Fm)(L.k.CHANGE_VALUES,gc)}],fc=e=>({type:Bn,payload:e}),hc=()=>({type:Yn}),Ec=()=>({type:Pn}),bc=e=>({type:Un,payload:e}),vc=e=>({type:Fn,payload:e}),Tc=e=>({type:Vn,payload:e}),Oc=e=>({type:Hn,payload:e}),xc=e=>({type:Wn,payload:e}),Cc=e=>{let{id:t,groupId:r}=e;return{type:$n,payload:{id:t,groupId:r}}},Sc=e=>{let{id:t,groupId:r,operationParameters:n}=e;return{type:Zn,payload:{id:t,groupId:r,operationParameters:n}}},wc=(e,t,r)=>({type:Xn,payload:{groupId:e,attributeId:t,attribute:St(r)}}),Ac=(e,t,r)=>({type:Qn,payload:{groupId:e,attributeId:t,attributeData:wt(r)}}),Rc=(e,t)=>({type:Qn,payload:{groupId:e,attributeId:t,attributeData:null}}),_c=(e,t,r)=>({type:Jn,payload:{groupId:e,attributeId:t,selectInfo:r}}),Ic=(e,t)=>({type:ea,payload:{groupId:e,attributeId:t}}),Nc=(e,t,r)=>({type:ta,payload:{groupId:e,attributeId:t,filter:r}}),Dc=(e,t,r)=>({type:ra,payload:{groupId:e,attributeId:t,values:r}}),Pc=e=>({type:oa,payload:e});var kc=r(97698);const Lc=(0,_.has)("actions"),Uc=e=>e.actions.map((0,_.assocPath)(["operationParameters","conditions"],e.conditions)),jc=(0,_.path)(["operationParameters","attributeTypeData","attributeType"]),Fc=(0,_.path)(["operationParameters","attributeTypeData","fieldName"]),Mc=(0,_.path)(["operationParameters","pin"]),Vc=(0,_.path)(["operationParameters","addNestedAttribute"]),Bc=(0,_.path)(["operationParameters","attributeValue"]),zc=(0,_.path)(["operationParameters","attributeValueToFind"]),Hc=(0,_.anyPass)([(0,_.equals)(la.d.AddNew),(0,_.equals)(la.d.ReplaceAllWith)]),Yc=(0,_.anyPass)([(0,_.equals)(la.d.AddNew),(0,_.equals)(la.d.ReplaceAllWith),(0,_.equals)(la.d.FindAndReplace)]),Wc=(0,_.equals)(la.d.AddNew),Gc=(0,_.both)((0,_.pipe)(jc,x.isNested),(0,_.pipe)((0,_.prop)("operation"),Hc)),qc=(0,_.both)((0,_.pipe)(jc,x.isReference),(0,_.pipe)((0,_.prop)("operation"),Wc)),Zc=(0,_.both)((0,_.pipe)(Bc,x.isLookupAttrType),(0,_.pipe)((0,_.prop)("operation"),Yc)),$c=(0,_.pipe)(jc,x.isLookupAttrType),Kc=e=>{switch(e){case la.d.AddNew:case la.d.RepointReference:case la.d.ReplaceAllWith:return["attributeValue"];case la.d.FindAndReplace:return["attributeValueToFind","attributeValue"];case la.d.FindAndRemove:return["attributeValueToFind"];default:return[]}},Xc=e=>{if(!e.operation||!e.operationParameters)return!1;const t=Gc(e),r=qc(e),n=$c(e),a=Kc(e.operation);for(let i of a){const a=e.operationParameters[i];if((0,x.isEmptyValue)(a)||n&&(0,x.isEmptyValue)((0,x.getAttrTypeLookupCode)(a))||r&&(0,x.isEmptyValue)((0,x.getReferencedEntityFromAttrValue)(a))||t&&(0,x.isEmptyValue)((0,x.cleanAttributesWith)({deleteEmptyComplex:!0})(a.value)))return!1}return!0},Qc=e=>{const t=Gc(e),r=qc(e);return t||r?Kc(e.operation).reduce(((e,t)=>{const r=["operationParameters",t,"value"];if((0,_.path)(r,e)){const t=(0,_.lensPath)(r);return(0,_.over)(t,(0,x.cleanAttributesWith)({deleteEmptyComplex:!0}),e)}return e}),e):e},Jc=e=>e[K.Jf].bulkUpdate.operation,eu=e=>e[K.Jf].bulkUpdate.activeStep,tu=e=>e[K.Jf].bulkUpdate.loading,ru=e=>{const t=(0,ki.IJ)(e)?(0,ro.V6)(e):(0,D.DX)(e),r=(0,ki.tB)(e);return r||1===t.length?r||t[0]:null},nu=(0,_.path)([K.Jf,"bulkUpdate","objects"]),au=e=>nu(e).total,iu=e=>nu(e).selectionMode,ou=e=>nu(e).entities,lu=e=>nu(e).selectedEntities,su=e=>nu(e).page,cu=e=>nu(e).rowsPerPage,uu=e=>nu(e).sortField,pu=e=>nu(e).sortOrder,du=e=>nu(e).selectedColumns,mu=e=>nu(e).filterText,gu=(0,_.pipe)(iu,(0,_.equals)(K.v6.include)),yu=(0,_.ifElse)(gu,(0,_.pipe)(lu,_.length),(e=>{const t=lu(e).length;return(0,ui.hX)(e)-t})),fu=(0,_.pipe)(yu,(0,_.gt)(_.__,0)),hu=e=>e[K.Jf].bulkUpdate.actions,Eu=(0,kc.createSelector)(hu,(0,_.pipe)((0,_.map)((0,_.ifElse)(Lc,(0,_.evolve)({actions:(0,_.pipe)((0,_.map)(Qc),(0,_.filter)(Xc))}),Qc)),(0,_.filter)((0,_.ifElse)(Lc,(0,_.pipe)((0,_.path)(["actions","length"]),(0,_.gt)(_.__,0)),Xc)))),bu=(0,kc.createSelector)(hu,(0,_.pipe)((0,_.map)((0,_.when)(Lc,(0,_.prop)("actions"))),_.flatten)),vu=e=>{const t=bu(e);return 0!==t.length&&t.every(Xc)},Tu=e=>e[K.Jf].bulkUpdate.requestPending,Ou=(0,x.getUrisForSaving)((e=>(0,_.equals)(e.slice(-3),["operationParameters","attributeValue","entityUri"]))),xu=(0,_.curry)(((e,t,r)=>{const n=(0,_.pipe)(Ou,(0,_.find)((t=>(0,_.pathSatisfies)((t=>t===e),t,r))))(r);return n?(0,_.set)((0,_.lensPath)(n),t,r):r})),Cu=(e,t,r)=>(0,_.pipe)(xu(e,t),(0,_.when)((e=>e===r),(0,x.replaceTemporaryRefEntityURI)(e,t)))(r),Su=(0,_.pathEq)(["data","fieldName"],K.E_),wu=(0,_.pipe)((0,_.path)(["values",0,"entityUri"]),(0,_.objOf)("uri"),x.getEntityId,x.wrapInQuotes),Au=e=>[{attributes:e,operator:"or"}],Ru=(0,_.curry)(((e,t,r)=>r.map((r=>{const{data:{fieldName:n}}=r,a=n.split(".");let[i,o]=((e,t)=>{let r=0;for(;r<Math.min(e.length,t.length)&&e[r]===t[r];r++);return[e.slice(r),t.slice(r)]})(a,e.split(".")),l=o.length;t===K.Vp.AddAttribute&&l--,i.length||(i=a.slice(-1),l++);const s=`${(0,_.repeat)("parent.",Math.max(0,l)).join("")}attributes.${i.join(".")}`;return(0,_.assocPath)(["data","fieldName"],s,r)})))),_u=(0,_.curry)(((e,t,r)=>{const n=((e,t,r)=>{const[n,a]=(0,_.partition)(Su,e),i=(0,_.pipe)(Ru(t,r),Au,Ba.Jk)(a),o=n.length?(e=>`in(${K.E_}, ${e.map(wu).join(",")})`)(n):"";return i&&o?`${i} and ${o}`:i||o})(e,t,r.operation);return(0,_.isEmpty)(n)?r:(0,_.ifElse)((0,_.pipe)((0,_.path)(["operationParameters","valueFilter"]),x.isEmptyValue),(0,_.assocPath)(["operationParameters","valueFilter"],n),(0,_.evolve)({operationParameters:{valueFilter:(0,_.concat)(_.__,` and (${n})`)}}))(r)}));var Iu=r(9828);function Nu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Du(e,t,r[t])}))}return e}function Du(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Pu=e=>{const t=(0,_.pipe)((0,_.pick)(["pin"]),(0,_.assoc)("value",ku(e)))(e);return(0,Iu.Kn)(t.value)?Object.keys(t.value).reduce(((e,r)=>(e.value=Nu({},e.value,{[r]:t.value[r].map(Pu)}),e)),t):t},ku=(0,_.when)(Iu.Kn,(0,_.ifElse)((0,_.has)("lookupCode"),(0,_.prop)("lookupCode"),(0,_.prop)("value"))),Lu=(0,_.cond)([[Gc,(0,_.pipe)(Bc,Pu)],[qc,(0,_.pipe)(Bc,(e=>{const{refEntity:t=[],refRelation:r=[]}=e;return Nu({refEntity:(0,_.pipe)(_.head,(0,_.pick)(["objectURI"]))(t),refRelation:(0,_.pipe)(_.head,(0,_.pick)(["type"]))(r)},Pu(e))}))],[Zc,(0,_.pipe)(Bc,ku)],[_.T,Bc]]),Uu=(0,_.pipe)(Lu,(0,_.assocPath)(["operationParameters","attributeValue"])),ju=(0,_.ifElse)(Mc,(()=>(0,_.assocPath)(["operationParameters","pin"],!0)),(()=>_.identity)),Fu=(0,_.ifElse)(Vc,(()=>(0,_.assocPath)(["operationParameters","addNestedAttribute"],!0)),(()=>_.identity)),Mu=(0,_.pipe)(zc,(0,_.ifElse)(_.isNil,(()=>_.identity),(0,_.pipe)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return`equals(value, '${ku(e)}')`}),(0,_.assocPath)(["operationParameters","valueFilter"])))),Vu=(0,_.pipe)(Bc,(0,_.prop)("entityUri"),(0,_.assocPath)(["operationParameters","referencedEntity","uri"])),Bu=(e,t)=>({operationParameters:{attributeURI:e},operation:t}),zu=(e,t)=>(0,_.pipe)(Bu,Uu(e),ju(e),Fu(e))(t,K.Vp.AddAttribute),Hu=(e,t)=>(0,_.pipe)(Bu,Mu(e))(t,K.Vp.DeleteAttribute),Yu=(e,t)=>(0,_.pipe)(Bu,Uu(e),ju(e),Mu(e))(t,K.Vp.UpdateAttribute),Wu=(e,t)=>(0,_.pipe)(Bu,Vu(e))(t,K.Vp.RepointReferencedEntity),Gu=(e,t)=>(0,_.reject)(_.isNil,{operationParameters:e,operation:t}),qu=e=>Gu({tags:[Bc(e)]},K.Vp.AddTags),Zu=e=>Gu({newValue:Bc(e),oldValue:zc(e)},K.Vp.ReplaceTag),$u=e=>Gu({tags:[zc(e)]},K.Vp.DeleteTags),Ku=()=>Gu(null,K.Vp.ClearTags),Xu=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{selectionMode:n,selectedEntities:a=[]}=e,{searchOptions:i,activityFilter:o,globalFilter:l}=r;return n===K.v6.include?{list:a,activeness:o}:{filter:(0,_.pipe)(Ba.XP,(0,x.addGlobalFilterToQuery)(l))(t),excludeList:a,options:i,activeness:o}},Qu=(0,_.curry)(((e,t)=>(0,_.chain)((0,_.ifElse)(Lc,(0,_.pipe)(Uc,Qu(e)),Ju(e)))(t))),Ju=(0,_.curry)(((e,t)=>{const r=(0,_.pathOr)([],["operationParameters","conditions"],t),n=Fc(t);return(0,_.pipe)(tp(e),(0,_.map)(_u(r,n)))(t)})),ep=(0,_.curry)((e=>(0,_.propEq)("operation",e))),tp=(0,_.curry)(((e,t)=>{const r=Fc(t),n=r.includes(".")?(0,x.searchUriToAttrUri)(r,e):r,a=r===x.EntityAttrTypes.tags.uri;return(0,_.cond)([[(0,_.both)((0,_.always)(a),ep(la.d.AddNew)),()=>[qu(t)]],[(0,_.both)((0,_.always)(a),ep(la.d.Clear)),()=>[Ku()]],[(0,_.both)((0,_.always)(a),ep(la.d.ReplaceAllWith)),()=>[Ku(),qu(t)]],[(0,_.both)((0,_.always)(a),ep(la.d.FindAndReplace)),()=>[Zu(t)]],[(0,_.both)((0,_.always)(a),ep(la.d.FindAndRemove)),()=>[$u(t)]],[ep(la.d.AddNew),()=>[zu(t,n)]],[ep(la.d.Clear),()=>[Hu(t,n)]],[ep(la.d.ReplaceAllWith),()=>[Hu(t,n),zu(t,n)]],[ep(la.d.FindAndReplace),()=>[Yu(t,n)]],[ep(la.d.FindAndRemove),()=>[Hu(t,n)]],[ep(la.d.RepointReference),()=>[Wu(t,n)]]])(t)}));function rp(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){np(e,t,r[t])}))}return e}function np(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*ap(e){if(e.payload){const e=yield(0,Va.Ys)(ki.tB);let r;do{if(r=yield(0,Va.Ys)(ui.BP,{entityTypeUri:e}),r)break;yield(0,Va.qn)(U.Z.UPDATE_ENTITIES)}while(!r);const n=yield(0,Va.Ys)(ru),a=yield(0,Va.Ys)(ui.fx,{entityTypeUri:e}),i=yield(0,Va.Ys)(ui.Uz,{entityTypeUri:e}),o=(yield(0,Va.Ys)(ui.L9,{entityTypeUri:e}))||void 0,l=yield(0,Va.Ys)(ui.NW,{entityTypeUri:e}),s=(yield(0,Va.RE)(io))[n].filter((0,_.pipe)((0,_.prop)("id"),x.isAttributeSearchUri,_.not)),c=e?yield(0,Va.Ys)(ki.Gv,e):s,u=yield(0,Va.Ys)(ui.NU,{entityTypeUri:e});yield(0,Va.gz)((t={page:a,rowsPerPage:i,sortOrder:o,sortField:l,selectedColumns:c,total:u,entities:r},{type:Dn,payload:t}))}var t}function*ip(e){const t=yield(0,Va.Ys)(k().selectors.getMetadata),r=yield(0,Va.Ys)(su),n=yield(0,Va.Ys)(cu),a=yield(0,Va.Ys)(pu),i=yield(0,Va.Ys)(uu),o=yield(0,Va.RE)(yp),l=(0,_.uniq)(o.concat((0,Ba.kx)(t,e))),s=rp({page:r,rowsPerPage:n,sortOrder:a,sortField:i,forceOvOnly:!0},yield(0,Va.Ys)(k().selectors.getGlobalSearchRequestOptions),{select:l}),c=(0,Ba.Lv)(e,s);yield(0,Va.gz)(bc(!0));try{const e=yield(0,Va.RE)(x.rawRequest,K.NV,c);yield(0,Va.gz)(fc(e))}catch(e){console.warn(e),yield(0,Va.gz)(fc([]))}yield(0,Va.gz)(bc(!1))}function*op(){const e=yield(0,Va.Ys)(mu),t=yield(0,Va.RE)(gp,e);yield(0,Va.rM)(ip,t)}function*lp(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{debounceTime:t}=e.payload||{};t&&(yield(0,Va.gw)(t));const r=yield(0,Va.Ys)(mu),n=yield(0,Va.RE)(gp,r);yield(0,Va.gz)(vc(0)),yield(0,Va.rM)(sp,n)}function*sp(e){const t=yield(0,Va.Ys)(k().selectors.getGlobalSearchRequestOptions),r=(0,Ba.Vg)(e,[],t);try{const e=yield(0,Va.RE)(x.rawRequest,K.jS,{method:"POST",body:JSON.stringify(r)});yield(0,Va.gz)(Oc(e.total))}catch(e){console.warn(e),yield(0,Va.gz)(Oc(0))}}function*cp(){const e=(yield(0,Va.Ys)(ou)).map((e=>e.uri)),t=yield(0,Va.RE)(yp),r=yield(0,Va.Ys)(mu),n=yield(0,Va.RE)(gp,r),a=yield(0,Va.Ys)(k().selectors.getGlobalSearchRequestOptions),i=(0,Ba.aG)(e,n,rp({select:t},a));yield(0,Va.gz)(bc(!0));try{const e=yield(0,Va.RE)(x.rawRequest,i.url,i.options);yield(0,Va.gz)(fc(e))}catch(e){console.warn(e),yield(0,Va.gz)(fc([]))}yield(0,Va.gz)(bc(!1))}function*up(e){try{yield(0,Va.RE)(x.rawRequest,e.url,e.options),yield(0,Va.gz)(Di(!1)),yield(0,Va.gz)(Ii({message:mi().text("Bulk update is currently in progress. You'll receive an email notification once completed.\nGo to Tenant Management to view the status."),actionLabel:mi().text("Tenant Management"),actionToDispatch:P.ui.actions.openConsoleApp("Tenant Management","jobs/pending"),autoHideDuration:1e4}))}catch(e){let r=e;e&&"object"==typeof e&&(r="errorCode"in e&&441===e.errorCode?mi().text("You already have a bulk update job in progress. You can start a new job when the current job is finished.\nWe will send you an update via email once the current job is finished."):e.errorMessage||e.error_description||mi().text("Something went wrong...")),yield(0,Va.gz)((t=r,Ri({payload:{message:t,action:{actionToDispatch:Ai()}},type:K.GT.error})))}var t}function*pp(){const e=yield(0,Va.Ys)(Jc);e===K.dV.UpdateProfiles?yield(0,Va.RE)(dp):e===K.dV.DeleteProfiles&&(yield(0,Va.RE)(mp))}function*dp(){yield(0,Va.gz)(Pc(!0));const e=yield(0,Va.Ys)(ru),t=yield(0,Va.Ys)(nu);let r=yield(0,Va.Ys)(Eu);const n=yield(0,Va.RE)(gp),a=yield(0,Va.Ys)(k().selectors.getGlobalSearchRequestOptions),i=yield(0,Va.Ys)(k().selectors.getModifiedEntities),o=((e,t)=>{const r=(0,x.findAllTemporaryRefEntityURI)(t),n=(a=t,(0,_.pipe)(Ou,(0,x.getPathsWithTempUri)(a),(0,_.map)((e=>(0,_.path)(e,a))))(a));var a;return r.concat(n).filter((t=>e[t]))})(i,r);if(o.length>0){const e=yield(0,Va.RE)(x.saveTemporaryEntities,i,o);for(const[t,n]of Object.entries(e))r=Cu(t,n,r)}const l=function(e,t,r,n,a){const i=function(e){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return{objects:Xu(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],arguments.length>4&&void 0!==arguments[4]?arguments[4]:{}),actions:Qu(e,t)}}(e,t,r,n,a);return{url:"/entities/_update?sendMail=true",options:{method:"POST",body:JSON.stringify(i),headers:{"Content-Type":"application/json"}}}}(e,t,r,n,a);yield(0,Va.RE)(up,l),yield(0,Va.gz)(Pc(!1))}function*mp(){yield(0,Va.gz)(Pc(!0));const e=function(e,t,r){const n={objects:Xu(e,t,r)};return{url:"/entities/_delete?sendMail=true",options:{method:"POST",body:JSON.stringify(n),headers:{"Content-Type":"application/json"}}}}(yield(0,Va.Ys)(nu),yield(0,Va.RE)(gp),yield(0,Va.Ys)(k().selectors.getGlobalSearchRequestOptions));yield(0,Va.RE)(up,e),yield(0,Va.gz)(Pc(!1))}function*gp(e){const t=yield(0,Va.Ys)(ui.FR),r={fieldName:"type",filter:"equals",values:[yield(0,Va.Ys)(ru)]};let n=t.filter((e=>"type"!==e.fieldName)).concat(r);return e&&(n=n.concat({fieldName:"attributes",filter:"containsWordStartingWith",values:[e]})),n}function*yp(){const e=yield(0,Va.Ys)(du);return(0,Pi.vw)(e)}function*fp(e){const{groupId:t,attributeId:r,selectInfo:n}=e.payload,a=yield(0,Va.Ys)(hu),i={addAttributeAfter:wc,changeAttribute:Ac,clearAttribute:Rc,deleteAttribute:Ic};yield(0,Va.RE)(ol,{groups:a,attributesPropName:"conditions",groupId:t,attributeId:r,selectInfo:n,actions:i})}const hp=[function*(){yield(0,Va.Fm)(Ee,ap)},function*(){yield(0,Va.Fm)([Fn,jn,Mn],op)},function*(){yield(0,Va.Fm)(zn,lp)},function*(){yield(0,Va.Fm)(Yn,cp)},function*(){yield(0,Va.ib)(Jn,fp)},function*(){yield(0,Va.ib)(ia,pp)}],Ep=()=>({id:K.Jf,reducerMap:{[K.Jf]:(0,R.combineReducers)({ui:$e,search:me,facets:$,advancedSearch:ar,savedSearches:dn,recentSearches:Tn,entity:In,bulkUpdate:Ma})},sagas:[...Ml,...cs,...fo,...yl,...zo,...nc,...vs,xs,...mc,...yc,...hp]});var bp=r(95099),vp=r.n(bp),Tp=r(34756),Op=r(23625),xp=r.n(Op),Cp=r(53732),Sp=r.n(Cp),wp=r(88214),Ap=r.n(wp),Rp=r(14294),_p=r.n(Rp),Ip=r(4501),Np=r.n(Ip),Dp=r(87925),Pp=r(18538),kp=r(42950);const Lp=(0,kp.Z)((()=>({container:e=>{let{height:t=36}=e;return{height:t,borderRadius:"2px",alignItems:"center",backgroundColor:"rgba(0,0,0,0.03)",minWidth:"100px"}},icon:{opacity:.67,marginLeft:"10px",marginRight:"6px"},input:{fontSize:"13px",width:"100%"},clearButton:{marginRight:"10px"},white:{backgroundColor:"rgb(255, 255, 255)",boxShadow:"0 1px 3px 0 rgba(0,0,0,0.24)"}})));function Up(){return Up=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Up.apply(this,arguments)}function jp(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Fp(e,t,r[t])}))}return e}function Fp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Mp=(0,b.memo)((e=>{let{value:t,autofocus:r,onSearch:n=_.identity,rootRef:a,classes:i={},height:o,placeholder:l=mi().text("Search")}=e,s=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["value","autofocus","onSearch","rootRef","classes","height","placeholder"]);const c=Lp({height:o}),[u,p]=(0,b.useState)(""),d=(0,_.pipe)((0,_.tap)(n),p),m=(0,_.isNil)(t)?u:t;return v().createElement(Sp(),Up({startAdornment:v().createElement(Ap(),{position:"start"},v().createElement(Np(),{className:c.icon})),endAdornment:v().createElement(Ap(),{position:"end"},m.length>0&&v().createElement(Pp.T,{icon:_p(),className:c.clearButton,onClick:()=>d("")})),autoFocus:r,classes:jp({},i,{input:O()(c.input,i.input),root:O()(c.container,i.root)}),placeholder:l,value:m,onChange:(0,_.pipe)(Dp.NA,d),disableUnderline:!0,ref:a},s))})),Vp=(0,kp.Z)((()=>({container:e=>{let{containerHeight:t=553,containerWidth:r}=e;return{display:"flex",flexDirection:"column",height:t,width:r,flexGrow:1}},header:{marginLeft:"16px",marginTop:"16px",marginBottom:"12px",fontSize:"16px",fontWeight:500,letterSpacing:"0.15px",lineHeight:"24px"},searchInputContainer:{margin:"0 16px 12px 16px",flexShrink:"0"},list:{flexGrow:1,height:0,overflow:"hidden",width:"100%",position:"relative","& ul":{paddingBottom:0,paddingTop:0}}})));function Bp(){return Bp=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Bp.apply(this,arguments)}const zp=e=>{let{title:t,className:r,onSearch:n,hideTitle:a,hideSearchInput:i,headerPlacement:o="top",containerWidth:l,containerHeight:s,searchInputOnKeyDown:c,children:u,searchInputRef:p,anchorOrigin:d={vertical:"top",horizontal:"right"},transformOrigin:m={vertical:"top",horizontal:"right"}}=e,g=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["title","className","onSearch","hideTitle","hideSearchInput","headerPlacement","containerWidth","containerHeight","searchInputOnKeyDown","children","searchInputRef","anchorOrigin","transformOrigin"]);const y=Vp({containerWidth:l,containerHeight:s}),f=v().createElement(v().Fragment,null,!a&&v().createElement("div",{className:y.header},t),!i&&v().createElement(Mp,{onSearch:n,autofocus:!0,onKeyDown:c,inputRef:p,classes:{root:y.searchInputContainer},placeholder:mi().text("Search & add attributes"),height:40}));return v().createElement(xp(),Bp({anchorOrigin:d,transformOrigin:m},g),v().createElement("div",{className:O()(y.container,r),style:{width:l}},"top"===o&&f,v().createElement("div",{className:y.list},u),"bottom"===o&&f))},Hp=e=>{const t=e=>(0,_.flatten)(e.map((e=>[e].concat(e.items?t(e.items):[]))));let r=null;return t(e).map(((e,t)=>(e&&e.items&&(r=t),{item:e,index:t,titleItemIndex:r})))},Yp=e=>e.titleItemIndex===e.index;var Wp=r(50166),Gp=r(88267);const qp=(0,kp.Z)({stickyTitlesWrapper:{position:"absolute",top:0,"& > div":{zIndex:1,position:"absolute",top:0,width:"100%",visibility:"hidden"}}}),Zp=e=>{let{items:t,getItemSize:r,renderItem:n,renderGroupTitle:a,width:i="100%",height:o,fixedTitle:l=!0,itemKey:s=(e=>e),disableHorizontalScrollbar:c,hideSubtitles:u,focusIndex:p=null,onInnerContainerResize:d}=e;const m=qp(),g=(0,b.useRef)(null),y=(0,b.useRef)(null),f=(0,b.useRef)(null),h=(0,b.useRef)([0]),E={topMargin:0},T=(0,b.useMemo)((()=>!u||(t||[]).some((e=>null!==e.titleItemIndex))),[t,u]),O=(0,b.useCallback)((e=>{const n=h.current.length;let a=0;t.slice(n-1,e+1).forEach(((e,t)=>{const i=n+t-1;t>0&&(h.current[i]=h.current[i-1]+a),a=r(i,e.item)}))}),[r,t]),x=(0,b.useCallback)((e=>t[e].titleItemIndex),[t]),C=(0,b.useCallback)((e=>t[e]),[t]);(0,b.useEffect)((()=>{requestAnimationFrame((()=>{g.current&&g.current.scrollTo(0)}))}),[t.length]),(0,b.useEffect)((()=>{g.current&&g.current.resetAfterIndex(0),S();const e=(e=>{const t=e.findIndex((e=>e.item.moveTo));if(t>-1){O(t);const e=x(t);return{offset:h.current[t],titleHeight:r(e,C(e).item)}}})(t);if(e&&e.offset&&g.current){const{titleHeight:t}=e,r=e.offset-t;(r<g.current.state.scrollOffset||r>g.current.state.scrollOffset+o)&&requestAnimationFrame((()=>{g.current&&g.current.scrollTo(r-(o-t)/2)}))}}),[O,C,r,x,o,h,t,g]);const S=()=>{f.current&&y.current&&(f.current.style.width=y.current.offsetWidth+"px")},w=(0,b.useCallback)((e=>{let r=null,n=0;return t.some(((t,a)=>{O(a+10);const i=h.current[a+1];return e>=n&&e<i&&(r={index:a,offset:n,listItem:t}),n=i,r})),r}),[O,h,t]),A=(0,b.useCallback)((e=>r(e,C(e).item)),[C,r]),R=(0,b.useCallback)((e=>{let{index:t,style:r,data:i}=e;const o=C(t);return o.item&&(Yp(o)&&a(r,o.item)||n(r,o.item,t,i))}),[C,a,n]),{handleOnItemsRendered:_}=(e=>{let{focusIndex:t,listRef:r,items:n}=e;const a=(0,b.useRef)(null),i=(0,b.useRef)(null),o=(0,b.useCallback)((e=>{let{visibleStartIndex:t,visibleStopIndex:r}=e;a.current=t,i.current=r}),[]);return(0,b.useEffect)((()=>{r.current&&null!==t&&0!==n.length&&(t<Math.max(a.current+3,0)?r.current.scrollToItem(Math.max(t-3,0),"start"):t>Math.min(i.current-3,n.length-1)&&r.current.scrollToItem(Math.min(t+3,n.length-1),"end"))}),[t,n.length,r]),{handleOnItemsRendered:o}})({items:t,focusIndex:p,listRef:g}),I=(0,b.useCallback)((()=>t.filter((e=>Yp(e))).map((e=>(e=>v().createElement("div",{className:"stickyTitleItem",style:{visibility:"hidden"},"data-index":e.index,key:e.index},a({height:r(e.index,e.item)},e.item)))(e)))),[r,t,a]);return v().createElement(v().Fragment,null,v().createElement("div",{ref:f,className:m.stickyTitlesWrapper},l&&I()),d&&y.current&&v().createElement(Gp.Z,{handleHeight:!0,onResize:d,targetDomEl:y.current}),v().createElement(Wp.VariableSizeList,{ref:g,itemCount:t.length,itemSize:A,width:i,height:o,itemKey:s,innerRef:y,onScroll:e=>{let{scrollOffset:n,scrollDirection:a}=e;if(!l||!T)return;const i=w(n),o=i&&x(i.index);var s;null!==o&&(s=o,f.current&&[...f.current.querySelectorAll(".stickyTitleItem")].forEach((e=>{e.dataset.index===s.toString()?(e.style.visibility="visible",E.index=s):e.style.visibility="hidden"}))),S();const c=null!==o&&r(o,C(o).item),u=w(n+c+E.topMargin);let p=0;if(u){switch(a){case"forward":u.offset-n>0&&Yp(u.listItem)&&(p=c-(u.offset-n));break;case"backward":{const e=o>-1&&(d=o,t.findIndex(((e,t)=>Yp(e)&&d<t))),r=(e=>(O(e),h.current[e]))(e);e>-1&&n<r&&c>=r-n&&(p=c-(r-n))}}(e=>{f.current&&(E.topMargin=-e,f.current.style.top=-e+"px")})(p)}var d},style:c?{overflowX:"hidden"}:void 0,overscanCount:5,onItemsRendered:_},R))};Zp.propTypes={items:vp().arrayOf(vp().object).isRequired,getItemSize:vp().func.isRequired,renderItem:vp().func.isRequired,width:vp().oneOfType([vp().number,vp().string]),height:vp().number.isRequired,renderGroupTitle:vp().func,fixedTitle:vp().bool,hideSubtitles:vp().bool,itemKey:vp().func,disableHorizontalScrollbar:vp().bool,focusIndex:vp().number,onInnerContainerResize:vp().func};const $p=e=>{let{items:t,open:r,onSelectFocusedItem:n,selectedItems:a,onClose:i}=e;const[o,l]=(0,b.useState)(null),s=(0,b.useRef)(!1),c=(0,b.useCallback)((e=>{let r=null===e?c(-1):e;for(;null!==e&&r<t.length&&(r<=e||r>=0&&Yp(t[r]));)r+=1;return r!==t.length?r:c(-1)}),[t]),u=(0,b.useCallback)((e=>{let r=null===e?t.length-1:e;for(;null!==e&&r>=0&&(r>=e||Yp(t[r]));)r-=1;return r<0?t.length-1:r}),[t]),p=(0,b.useCallback)((()=>{if(!(0,_.isNil)(o)){const e=t[o].item;!e.item.notSelectable&&n({item:e.item,groupData:e})}}),[n,t,o]),d=(0,b.useCallback)((e=>{if(0!==t.length)switch(e.key){case"Down":case"ArrowDown":return l(c),e.preventDefault(),!1;case"Up":case"ArrowUp":return l(u),e.preventDefault(),!1;case"Enter":s.current=!0,p();break;case"Tab":i&&i(e);break;default:return}}),[t,c,u,p,i]);return(0,b.useEffect)((()=>{if(s.current){s.current=!1;const e=t.findIndex((e=>e.item.moveTo));e>-1&&l(e)}else l(null)}),[t,r,a]),{focusIndex:o,handleKeyDown:d}};var Kp=r(85746),Xp=r.n(Kp),Qp=r(22811),Jp=r.n(Qp),ed=r(93222),td=r.n(ed);function rd(){return rd=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},rd.apply(this,arguments)}function nd(){return nd=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},nd.apply(this,arguments)}const ad=e=>v().createElement("svg",nd({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgNestedAttribute"},e),v().createElement("path",{d:"M14 11v-1a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 01-1-1v-1h-3v1a1 1 0 01-1 1H6a1 1 0 01-1-1v-4a1 1 0 011-1h4a1 1 0 011 1v1h3z",fill:"#000",stroke:"none",strokeWidth:1,fillRule:"evenodd"}));function id(){return id=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},id.apply(this,arguments)}const od=e=>v().createElement("svg",id({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgReferenceAttribute"},e),v().createElement("path",{d:"M10 18h3v-1a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 01-1-1v-1H8V8H6a1 1 0 01-1-1V3a1 1 0 011-1h6a1 1 0 011 1v4a1 1 0 01-1 1h-2v3h3v-1a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 01-1-1v-1h-3v5z",fill:"#000",stroke:"none",strokeWidth:1,fillRule:"evenodd"}));function ld(){return ld=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ld.apply(this,arguments)}const sd=e=>v().createElement("svg",ld({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgSimpleAttribute"},e),v().createElement("rect",{fill:"#000",x:9,y:9,width:6,height:6,rx:1,stroke:"none",strokeWidth:1,fillRule:"evenodd"})),cd=(0,kp.Z)({icon:{opacity:.29,width:"16px",height:"16px",flexShrink:0,marginRight:"6px",marginLeft:"8px"}}),ud=e=>{let{attrType:t={}}=e;const r=cd(),n=(e=>{switch(e.type){case x.DataTypes.TYPE_IMAGE:case x.DataTypes.TYPE_NESTED:return ad;case x.DataTypes.TYPE_REFERENCE:return od;default:return sd}})(t);return v().createElement(n,{className:r.icon})},pd=(0,kp.Z)({mark:{color:"red"}}),dd=()=>{const e=pd();return v().createElement("span",{className:e.mark},"*")},md=e=>{let{margin:t,level:r,className:n,children:a}=e;return null!=r?v().createElement("div",{style:{marginLeft:r*t},className:n},a):a};var gd=r(1063),yd=r(85740);const fd=(0,kp.Z)({container:{"& > $marginWrapper:first-child":{paddingLeft:"4px"}},listItem:{paddingLeft:"1px",paddingTop:"2px",paddingBottom:"2px",transition:"none","&:hover":{"& $itemAfter":{background:"linear-gradient(to right, rgba(235, 235, 235, 0.2), rgba(235, 235, 235, 1) 100%)"}},"&$listItemFocus":{"& $itemAfter":{background:"linear-gradient(to right, rgba(219, 219, 219, 0.2), rgba(219, 219, 219, 1) 100%)"}},"&:focus":{outline:"none"}},listItemFocus:{},recommendedIcon:{width:"18px",height:"18px",marginRight:"5px",marginLeft:"7px",flexShrink:0},logoIcon:{width:"18px",height:"18px",flexShrink:0,marginRight:"4px"},itemAfter:{position:"absolute",right:0,top:0,width:"40px",height:"100%",pointerEvents:"none",background:"linear-gradient(to right, rgba(255, 255, 255, 0.2), #fff 100%)"},itemText:{padding:"0",margin:0,"& span":{fontSize:"0.8125rem",letterSpacing:"normal",whiteSpace:"nowrap"}},checkbox:{opacity:.34,padding:0,marginLeft:"14px","&$checked":{opacity:1,background:"none"}},checked:{},marginWrapper:{display:"flex",alignItems:"center"},defaultCursor:{cursor:"default"},itemTooltip:{margin:"4px 0"},marginText:{marginLeft:"21px"},itemTextWrapper:{display:"flex",alignItems:"center"}}),hd=(0,yd.T)((e=>v().createElement("svg",rd({width:13,height:18,viewBox:"0 0 13 18",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgRecommended"},e),v().createElement("g",{transform:"translate(-3 -1)",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},v().createElement("path",{fill:"#FF4081",d:"M5.833 10h3.75v6.667l-3.75 1.666z"}),v().createElement("path",{fill:"#CE0C4E",d:"M13.333 10v8.333l-3.75-1.666V10z"}),v().createElement("circle",{fill:"#FFC058",cx:9.583,cy:7.917,r:6.25}),v().createElement("circle",{fill:"#FFCD7B",cx:9.583,cy:7.917,r:5.417}),v().createElement("path",{fill:"#FFFBB5",d:"M8.333 11.667L5 8.462l.933-.898 2.4 2.308L13.4 5l.933.897z"}))))),Ed=e=>{let{groupId:t,data:r,checked:n=!1,isFocused:a=!1,isRequired:i=!1,label:o,labelInText:l,level:s,onClick:c=_.identity,hideCheckBox:u=!1,hideIcon:p=!1,notSelectable:d=!1,disableHorizontalScrollbar:m=!1,style:g={},subItemMargin:y=20,LogoIcon:f,className:h,disableNonSelectable:E,disableGutters:b}=e;const T=fd(),{attrType:C}=r||{},S=!(u&&(0,x.isNested)(C)||d),w=!!f;return v().createElement(gd.Y,{value:l||o,className:T.itemTooltip,placement:"bottom-end"},v().createElement(td(),{className:O()(T.container,T.listItem,{[T.defaultCursor]:!S},h),onClick:S?()=>c(r,!n,t):void 0,style:g,dense:!0,disabled:E&&d,classes:{focusVisible:T.listItemFocus,selected:T.listItemFocus},selected:a,tabIndex:-1,disableGutters:b},!u&&v().createElement(Jp(),{checked:n,disableRipple:!0,disabled:!S,className:O()(T.checkbox,{[T.checked]:n}),tabIndex:-1}),v().createElement(md,{margin:y,level:s,className:T.marginWrapper},v().createElement(v().Fragment,null,!p&&(e=>"recommended"===t?v().createElement(hd,{className:T.recommendedIcon,tooltipTitle:mi().text("Recommended"),showForDisabled:!0}):v().createElement(ud,{attrType:e}))(C),v().createElement("div",{className:O()(T.itemTextWrapper,{[T.marginText]:p})},w&&v().createElement(f,{className:T.logoIcon}),v().createElement(Xp(),{primary:v().createElement(v().Fragment,null,o,i&&v().createElement(dd,null)),className:T.itemText})))),S&&m&&v().createElement("div",{className:T.itemAfter})))};Ed.defaultName="AttributeListItem";const bd=(0,b.memo)(Ed);var vd=r(49940);const Td=(0,kp.Z)({popupContainer:{},container:{"&$popupContainer":{height:"408px",minWidth:"200px"}}});function Od(){return Od=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Od.apply(this,arguments)}function xd(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Cd(e,t,r[t])}))}return e}function Cd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Sd=e=>{let{open:t,anchorEl:r,data:n,onSearch:a,onClose:i,titleText:o,filterText:l,onListItemClick:s,selected:c,hideCheckBox:u,renderGroupTitle:p}=e,d=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["open","anchorEl","data","onSearch","onClose","titleText","filterText","onListItemClick","selected","hideCheckBox","renderGroupTitle"]);const m=(0,b.useCallback)((e=>e.label.toLowerCase().includes(l.toLowerCase())),[l]),g=(0,b.useCallback)((e=>m(e)||(e.children||[]).some(g)),[m]),y=(0,b.useMemo)((()=>{const e=(0,_.curry)(((e,r,n,a)=>[{item:xd({},r,{filterText:l}),level:e,groupId:n,groupName:a},...t(r.children||[],n,a,e+1)])),t=function(t,r,n){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const i=t=>e(a,t,r,n),o=t.filter(g);return(p?_.map:_.chain)(i,o)};return t}),[l,p,g]),f=(0,b.useCallback)((e=>e.map((e=>({item:e,items:y(e.attributes,e.id,e.label)}))).filter((e=>e.items.length))),[y]),h=(0,b.useCallback)((e=>{let{item:t}=e;s(t,!c.find((e=>e.id===t.id||e.id.includes(`${t.id}.`))))}),[s,c]),E=(0,b.useMemo)((()=>(p?f:y)(n)),[n,p,f,y]),T=(0,b.useMemo)((()=>Hp(E)),[E]),{focusIndex:C,handleKeyDown:S}=$p({items:T,open:t,onSelectFocusedItem:h,selectedItems:c}),w=(0,b.useRef)(null);w.current=C;const A=(0,b.useCallback)(((e,t,r)=>{let{item:n,level:a=0}=t;const i=!!c.find((e=>e.id===n.id||e.id.includes(`${n.id}.`))),o=w.current===r;return v().createElement(bd,{key:n.id,onClick:s,checked:i,level:a,data:n,label:v().createElement(vd.o,{text:n.label,highlight:n.filterText}),labelInText:n.label,style:e,hideCheckBox:u,isFocused:o,notSelectable:n.notSelectable,LogoIcon:n.LogoIcon})}),[u,s,c]),R=(0,x.getMaxItemWidth)("label")(E)||308,I=Td();return v().createElement(zp,Od({open:t,className:O()(I.container,I.popupContainer),anchorEl:r,onClose:i,onSearch:a,title:o,containerWidth:R,searchInputOnKeyDown:S},d),v().createElement(Zp,{height:300,renderItem:A,items:T,hideSubtitles:!0,getItemSize:()=>32,containerWidth:R,focusIndex:C,renderGroupTitle:p}))};Sd.propTypes={open:vp().bool,hideCheckBox:vp().bool,anchorEl:vp().any,selected:vp().array,data:vp().array,filterText:vp().string,titleText:vp().string,onClose:vp().func,onListItemClick:vp().func,onSearch:vp().func,renderGroupTitle:vp().func},Sd.defaultProps={data:[],selected:[],titleText:mi().text("Show/hide columns"),filterText:""};var wd=r(97179);function Ad(){return Ad=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ad.apply(this,arguments)}const Rd=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",Ad({width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},r),v().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",opacity:".54"},v().createElement("path",{d:"M19 11.24V10h-4v1.24a8.417 8.417 0 00-2 .768V10H9v6h.29a8.497 8.497 0 00-.15.358l-.29.733.29.733.07.176H5c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2h14c1.1 0 2 .9 2 2v6.008a8.417 8.417 0 00-2-.768zM7 16v-6H5v6h2zm0-8V6H5v2h2zm6 0V6H9v2h4zm6 0V6h-4v2h4zm-2 5a6.451 6.451 0 00-6 4.09 6.451 6.451 0 006 4.092 6.451 6.451 0 006-4.091A6.451 6.451 0 0017 13zm0 6.818a2.728 2.728 0 010-5.454 2.728 2.728 0 010 5.454zm0-4.363c-.905 0-1.636.73-1.636 1.636 0 .905.73 1.636 1.636 1.636.905 0 1.636-.73 1.636-1.636 0-.906-.73-1.636-1.636-1.636z",fill:"#000",fillRule:"nonzero"})))},_d="Headers-styles-container--Zbdka",Id="Headers-styles-actionsBar--RXMy4",Nd="Headers-styles-previewSwitcher--Ppqem";function Dd(){return Dd=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Dd.apply(this,arguments)}const Pd=e=>{let{entityTypeUri:t,headColumns:r=[],onSelectColumns:n=_.identity}=e,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["entityTypeUri","headColumns","onSelectColumns"]);const[i,o]=(0,b.useState)(null),[l,s]=(0,b.useState)(""),c=(0,Tp.useSelector)(k().selectors.getMetadata),u=()=>{o(null),s("")},p=(0,b.useCallback)(((e,a)=>{const i=(0,Pi.kF)(c,t),o=(0,Pi.m5)(i,e.id);let l;l=o.length?a?r.concat(o):r.filter((e=>!o.find((t=>t.id===e.id)))):a?r.concat(e):r.filter((t=>t.id!==e.id)),n(l)}),[c,t,r,n]);return v().createElement(v().Fragment,null,v().createElement(wd.k,Dd({tooltipTitle:mi().text("Show/hide columns"),size:"M",icon:Rd,onClick:e=>o(e.currentTarget),className:"Headers-styles-headerIcon--c2qe7"},a)),(()=>{const e=(0,Pi.kF)(c,t);return v().createElement(Sd,{open:!!i,anchorEl:i,data:e,onListItemClick:p,selected:r,filterText:l,onClose:u,onSearch:s})})())};Pd.propTypes={entityTypeUri:vp().string,headColumns:vp().array,onSelectColumns:vp().func};const kd=Pd;var Ld=r(45053),Ud=r(72897),jd=r(27618),Fd=r.n(jd),Md=r(98515),Vd=r.n(Md),Bd=r(29289);const zd=e=>{let{headCellData:t,headIndex:r,sortOrder:n,sortField:a,sortHandler:i,canCheck:o,onCheck:l,headerCheckboxState:s,openConfigColumnPopup:c}=e;return v().createElement("div",{className:O()("HeadCellRenderer-styles-headCellContentWrapper--L6RrQ",(0,_.path)(["wrapperClassName"],t))},t&&o&&v().createElement(Jp(),{className:"HeadCellRenderer-styles-checkbox--qQEHg",checked:s||!1,indeterminate:null===s,onChange:()=>l()}),v().createElement("div",{className:"HeadCellRenderer-styles-labelWrapper--cmclk"},t&&(t.sortable?v().createElement(Fd(),{active:Boolean(n&&a===t.id),direction:n,onClick:i,classes:{root:"HeadCellRenderer-styles-sortLabel--NZx3o"},component:"div"},t.label):t.label)),c&&v().createElement("div",{className:"HeadCellRenderer-styles-menuButtonWrapper--aBNeR"},v().createElement(Pp.T,{icon:Vd(),onClick:c,size:"S","data-column-index":r})))};zd.propTypes={headCellData:vp().shape({id:vp().string,label:vp().oneOfType([vp().string,vp().node]),sortable:vp().bool}),headIndex:vp().number,sortOrder:vp().string,sortField:vp().string,sortHandler:vp().func,canCheck:vp().bool,onCheck:vp().func,headerCheckboxState:vp().oneOf([!0,!1,null]),openConfigColumnPopup:vp().func};const Hd=(0,Bd.q)((0,_.pick)(["openConfigColumnPopup"]))(zd),Yd=(0,Bd.q)((0,_.pick)(["openConfigColumnPopup","canCheck","onCheck","headerCheckboxState"]))(zd),Wd=v().createContext({generateEntityUrl:x.generateEntityUrlForOldMode,generatePivotingUrl:x.generatePivotingUrlForOldMode,generateTagUrl:x.generateTagUrlForOldMode});function Gd(){return Gd=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Gd.apply(this,arguments)}Wd.displayName="UrlGeneratorsContext";const qd=(0,b.forwardRef)(((e,t)=>{let{value:r,children:n,screen:a,className:i,shouldOpenInNewTab:o=!1}=e,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["value","children","screen","className","shouldOpenInNewTab"]);const{generateEntityUrl:s}=(0,b.useContext)(Wd),c=(0,w.ax)("openEntity"),u=(0,w.Qh)(),p=(0,b.useCallback)((e=>{(0,Dp.rR)(e)||(c({uri:r,screen:a}),e.preventDefault()),e.stopPropagation()}),[c,a,r]);return v().createElement("a",Gd({ref:t,href:(d=r,s({uiPath:u,uri:d,screen:a})),onClick:o?void 0:p,target:o?"_blank":"_self",rel:"noreferrer",className:i},l),n);var d}));qd.displayName="EntityUriLink";const Zd={popupBackdrop:"EntitiesTable-styles-popupBackdrop--nEX1F",popupContent:"EntitiesTable-styles-popupContent--PLSPL",complexPopupContent:"EntitiesTable-styles-complexPopupContent--wqOGI",highlighted:"EntitiesTable-styles-highlighted--GHk6T",highlightAnimate:"EntitiesTable-styles-highlightAnimate--oR7ki",inactiveBackground:"EntitiesTable-styles-inactiveBackground--nAfS3",inactiveHoverBackground:"EntitiesTable-styles-inactiveHoverBackground--qe__Y",inactiveSelectedBackground:"EntitiesTable-styles-inactiveSelectedBackground--WkWtD",inactiveSelectedHoverBackground:"EntitiesTable-styles-inactiveSelectedHoverBackground--oFAbX",textOverflow:"EntitiesTable-styles-textOverflow--AAABW",textOverflowInactive:"EntitiesTable-styles-textOverflowInactive--eU4xE",link:"EntitiesTable-styles-link--JNCz5",defaultWrapper:"EntitiesTable-styles-defaultWrapper--EP4tA",table:"EntitiesTable-styles-table--jmlbo",imageWrapper:"EntitiesTable-styles-imageWrapper--xmq8R",blobWrapper:"EntitiesTable-styles-blobWrapper--ruHVs",highlightAnimateForEllipsis:"EntitiesTable-styles-highlightAnimateForEllipsis--r1Fmq",referenceWrapper:"EntitiesTable-styles-referenceWrapper--Q5RqZ",referenceContent:"EntitiesTable-styles-referenceContent--wkahK",referenceIcon:"EntitiesTable-styles-referenceIcon--b8M3n",nestedCellWrapper:"EntitiesTable-styles-nestedCellWrapper--I4J6A",nestedAttributeWrapper:"EntitiesTable-styles-nestedAttributeWrapper--dvfn3",profileWrapper:"EntitiesTable-styles-profileWrapper--lGPma",entityAvatar:"EntitiesTable-styles-entityAvatar--GiuUS",entityAvatarImage:"EntitiesTable-styles-entityAvatarImage--UHIRm",entityLabel:"EntitiesTable-styles-entityLabel--OyjLV",scores:"EntitiesTable-styles-scores--RqsDU",dragColumnHead:"EntitiesTable-styles-dragColumnHead--oDlFz",dragColumnBody:"EntitiesTable-styles-dragColumnBody--_HZDV",draggableHeadCell:"EntitiesTable-styles-draggableHeadCell--DbfHi",cellWrapper:"EntitiesTable-styles-cellWrapper--dUWGQ",entityButtons:"EntitiesTable-styles-entityButtons--tYSvC",selectedEntityButtons:"EntitiesTable-styles-selectedEntityButtons--mZJfv",justImportedEntityButtons:"EntitiesTable-styles-justImportedEntityButtons--q5bPw",highlightedEntityButtons:"EntitiesTable-styles-highlightedEntityButtons--PvzNM"},$d=e=>{let{value:t={}}=e;const r=(0,x.getLabel)(t.label);return v().createElement("div",{className:O()(Zd.defaultWrapper,Zd.profileWrapper)},v().createElement(A,{avatarClassName:Zd.entityAvatar,imageClassName:Zd.entityAvatarImage,entity:t}),v().createElement(qd,{value:(0,x.getEntityUriForLink)(t),className:Zd.entityLabel},r))};$d.propTypes={value:vp().object};const Kd=$d;var Xd=r(56755);const Qd=e=>{let{value:t,columnData:{dataTypeDefinition:r}}=e;return v().createElement("div",{className:Zd.defaultWrapper},r?v().createElement(Xd.x,{value:t,dataTypeDefinition:r}):t)};Qd.propTypes={value:vp().any,columnData:vp().object};const Jd=Qd,em=(e,t,r)=>{const n=(0,x.getEntityTypeGraphIcon)(e,{type:t});return(0,x.getAbsoluteImageUrl)(r,n)};let tm=function(e){return e[e.ICON_MODE=0]="ICON_MODE",e[e.TEXT_MODE=1]="TEXT_MODE",e[e.ERROR_MODE=2]="ERROR_MODE",e}({});function rm(){return rm=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},rm.apply(this,arguments)}const nm=e=>{let{className:t,icon:r,avatarText:n,rootClasses:a}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","icon","avatarText","rootClasses"]);const[o,l]=(0,b.useState)(null);(0,b.useEffect)((()=>{l(r?tm.ICON_MODE:tm.TEXT_MODE)}),[r,n]);const s=()=>{l(tm.ERROR_MODE)};switch(o){case tm.ICON_MODE:return v().createElement(S(),rm({className:O()(t,null==a?void 0:a.iconRoot),src:r,onError:s},i));case tm.TEXT_MODE:case tm.ERROR_MODE:return v().createElement(S(),rm({className:O()(t,null==a?void 0:a.textRoot)},i),n);default:return null}},am=e=>{let{value:t}=e;const r=(0,Tp.useSelector)(k().selectors.getMetadata),n=(0,Tp.useSelector)(k().selectors.getApiPath),a=(0,Tp.useSelector)(k().selectors.getImagePath);return t&&v().createElement("div",{className:O()(Zd.defaultWrapper,Zd.referenceWrapper)},v().createElement(nm,{className:Zd.referenceIcon,icon:em(r,t.refEntity.type,a||n)}),v().createElement(qd,{value:t.refEntity.objectURI,className:Zd.referenceContent},(0,x.getLabel)(t.label)))};am.propTypes={value:vp().object};const im=am,om=e=>{e.stopPropagation()},lm=e=>{const{value:t}=e;return v().createElement("div",{className:Zd.blobWrapper,onScroll:om},t)};lm.propTypes={value:vp().any};const sm=lm,cm=e=>{let{value:t}=e;const r=(0,x.getImageAttributeOvThumbnailUrl)({value:t});return r&&v().createElement("div",{className:Zd.imageWrapper},v().createElement("img",{src:r}))};cm.propTypes={value:vp().object};const um=cm,pm=e=>{if("label"===e.id)return Kd;switch((0,_.path)(["attrType","type"],e)){case"Reference":return im;case"Blob":return sm;case"Image":return um}return Jd};function dm(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){mm(e,t,r[t])}))}return e}function mm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function gm(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}const ym=(0,_.split)("."),fm=["entityId"],hm=e=>!fm.includes(e.id),Em=e=>{if((0,x.isAttributeSearchUri)(e)){const[,...t]=ym(e);return t.length>1?t.slice(0,-1):null}return null};var bm=r(39034),vm=r(57526),Tm=r.n(vm),Om=r(18567),xm=r.n(Om),Cm=r(99272),Sm=r.n(Cm);const wm=(0,kp.Z)({root:{display:"flex",alignItems:"center",justifyContent:"center",width:"24px",height:"24px"},check:{color:"#8CC152"}}),Am=e=>{let{classes:t={},tooltip:r="",onClick:n=_.identity,mode:a=bm.Eh.Init}=e;const i=wm();return v().createElement("div",{className:O()(i.root,t.root)},(()=>{switch(a){case bm.Eh.Init:return v().createElement(wd.k,{className:t.button,size:"M",tooltipTitle:r,icon:xm(),onClick:n});case bm.Eh.Progress:return v().createElement(Tm(),{className:t.spinner,size:24});case bm.Eh.Success:return v().createElement(Sm(),{className:O()(i.check,t.check)});default:return null}})())};function Rm(){return Rm=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Rm.apply(this,arguments)}const _m=e=>{let{entity:t,importStatus:r,onImportStatusChange:n,hideDelay:a=3e3}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["entity","importStatus","onImportStatusChange","hideDelay"]);const o=(0,Tp.useSelector)(k().selectors.getDtssPath),l=(0,Tp.useSelector)(k().selectors.getTenant);return v().createElement(Am,Rm({},i,{mode:r,tooltip:mi().text("Import this record"),onClick:e=>{e.stopPropagation(),n(bm.Eh.Progress),(0,x.importEntityFromDataTenant)({dtssPath:o,customerTenant:l,entity:t}).then((e=>{let{success:r,uris:i}=e;if(!r)throw new Error("Failed to import entity");t.ctSubscribedUris=i,n(bm.Eh.Success),setTimeout((()=>n(bm.Eh.Done)),a)})).catch((()=>{n(bm.Eh.Init),(0,pi.U)(undefined,{title:mi().text("Import Error"),message:mi().text("Record can't be imported")})}))}}))},Im=(0,kp.Z)({importButtonPlaceholder:{display:"flex",alignItems:"center",padding:"0 10px",width:"24px",flexShrink:0,position:"relative"}}),Nm=e=>{let{entity:t,entityImportStatus:r,onEntityImportStatusChange:n}=e;const a=Im(),i=(0,Tp.useSelector)(k().selectors.getMetadata),o=(0,Tp.useSelector)(k().selectors.getCanUserImportEntitiesFromDT),l=(0,x.isDataTenantEntity)(t)&&o,s=(0,x.getEntityType)(i,t.type),c=(0,x.checkCanImportEntityOfType)(s)&&!(0,x.isEntityImportedToCT)(t),u=r&&r!==bm.Eh.Done||c;return v().createElement(v().Fragment,null,l&&v().createElement("div",{className:a.importButtonPlaceholder},u&&v().createElement(_m,{entity:t,importStatus:r,onImportStatusChange:e=>n(t.uri,e)})))},Dm=e=>{let{entity:t,isSelectedEntity:r,isHighlightedEntity:n,entityImportStatus:a,onEntityImportStatusChange:i}=e;return v().createElement("div",{className:O()(Zd.entityButtons,{[Zd.selectedEntityButtons]:r,[Zd.justImportedEntityButtons]:a===bm.Eh.Success,[Zd.highlightedEntityButtons]:n})},v().createElement(Nm,{entity:t,entityImportStatus:a,onEntityImportStatusChange:i}))};Dm.propTypes={entity:vp().object,isSelectedEntity:vp().bool,isHighlightedEntity:vp().bool,entityImportStatus:vp().oneOf(Object.values(bm.Eh)),onEntityImportStatusChange:vp().func};const Pm=(0,Bd.q)(((e,t)=>{let{entitiesImportStatus:r,onEntityImportStatusChange:n,selectedEntityUri:a,highlightedEntityIndex:i}=e,{entity:o,rowIndex:l}=t;return{entityImportStatus:o&&r[o.uri],onEntityImportStatusChange:n,isSelectedEntity:a===o.uri,isHighlightedEntity:i===l}}))(Dm);var km=r(72326),Lm=r(67655);function Um(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){jm(e,t,r[t])}))}return e}function jm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Fm={height:"100%",display:"flex",flexDirection:"column"},Mm=(0,kp.Z)((e=>({inactiveCell:Um({background:e.inactiveBackground},Fm,{"&$selectedRowCell":{background:e.inactiveSelectedBackground}}),selectedRowCell:Um({background:(0,Lm.lighten)(e.palette.primary.main,.88)},Fm),clickable:Um({cursor:"pointer"},Fm),justImported:Um({backgroundColor:"#FFFBEB !important"},Fm)}))),Vm={entity:vp().object,isSelected:vp().bool,onEntityClick:vp().func,isJustImported:vp().bool},Bm=(0,kp.Z)({checkboxWrapper:{display:"flex",alignItems:"center"},checkbox:{marginRight:"-8px",marginLeft:"11px"}});const zm={onCheck:vp().func,isChecked:vp().bool,hasCheckbox:vp().bool},Hm=(0,kp.Z)({collapser:{marginLeft:"-2px"}});var Ym=r(18021),Wm=r(8835),Gm=r.n(Wm);const qm=(0,kp.Z)({collapseButton:{cursor:"pointer"},expandLess:{transform:"rotate( -180deg )"}});function Zm(){return Zm=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Zm.apply(this,arguments)}const $m=e=>{let{isOpen:t=!1,tooltipTitle:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["isOpen","tooltipTitle"]);const a=qm(),i={icon:Gm(),className:a.collapseButton,iconClassName:O()({[a.expandLess]:t})},o={tooltipTitle:r};return v().createElement(wd.k,Zm({"data-reltio-id":"collapse-button"},i,o,n))},Km=(0,kp.Z)((()=>({hidden:{visibility:"hidden"}}))),Xm=e=>{let{rowIndex:t,rowValue:r,className:n}=e;const a=Km(),{toggleRowCollapse:i,getIsRowCollapsible:o,getIsRowCollapsed:l}=(0,b.useContext)(Ym.x),s=o(r),c=l(t);return v().createElement($m,{className:O()(n,{[a.hidden]:!s}),isOpen:!c,onClick:e=>{i(t),e.stopPropagation()}})};const Qm={hasCollapseButton:vp().bool},Jm=(0,_.pipe)((e=>{const t=t=>{const r=Hm(),{hasCollapseButton:n}=t,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(t,["hasCollapseButton"]),{rowValue:i,rowIndex:o}=a;return n?v().createElement("div",{className:"cellWithCollapser"},v().createElement(Xm,{className:r.collapser,rowIndex:o,rowValue:i}),v().createElement(e,a)):v().createElement(e,a)};return t.propTypes=Qm,t}),(e=>{const t=t=>{const r=Bm(),{onCheck:n,isChecked:a,hasCheckbox:i}=t,o=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(t,["onCheck","isChecked","hasCheckbox"]),{rowValue:{rawValue:l}}=o;return i?v().createElement("div",{className:O()(r.checkboxWrapper,"cellWithCheckbox")},v().createElement(Jp(),{className:r.checkbox,checked:a,onClick:e=>e.stopPropagation(),onChange:e=>n(l.uri,e.target.checked)}),v().createElement(e,o)):v().createElement(e,o)};return t.propTypes=zm,t}),(e=>{const t=t=>{const r=Mm(),{rowValue:{rawValue:n},isSelected:a,onEntityClick:i,isJustImported:o}=t,l=i?()=>i(n.uri):void 0,s=n&&!(0,x.isActiveObject)(n);return l||s||a||o?v().createElement("div",{className:O()({[r.inactiveCell]:s},{inactiveCell:s},{[r.selectedRowCell]:a},{selectedRowCell:a},{[r.clickable]:!!l},{[r.justImported]:o},{justImported:o}),onClick:l},v().createElement(e,t)):v().createElement(e,t)};return t.propTypes=Vm,t}),(0,Bd.q)(((e,t)=>{let{onEntityClick:r,selectedEntityUri:n,entitiesImportStatus:a,canCheck:i,onCheck:o,checkedEntitiesUris:l}=e,{rowValue:s,columnIndex:c}=t;const{rawValue:u}=s,p=0===c;return{onCheck:o,isChecked:l&&l.includes(u.uri),hasCheckbox:i&&p,hasCollapseButton:p,isSelected:n===u.uri,isJustImported:a[u.uri]===bm.Eh.Success,onEntityClick:r}})))(km.DN),eg=e=>{let{columnData:t,cell:r}=e;const n=r.values.length,a=28*Math.max(n,1)+20;if(!n)return a;switch((0,_.path)(["dataTypeDefinition","type"],t)){case"Reference":return 28*n+17;case"Blob":return 100*n;case"Image":return 76*n+17;default:return a}},tg=(0,b.forwardRef)(((e,t)=>{let{headColumns:r,entities:n,entityToHighlight:a,selectedEntityUri:i,onReorderingColumn:o,dndColumnReorderingEnabled:l,columnsSize:s,onChangeColumnsSize:c,onScroll:u,onSort:p,sortField:d,sortOrder:m,onEntityHover:g,onEntityClick:y,entitiesImportStatus:f,onEntityImportStatusChange:h,logger:E,canCheck:T,checkedEntitiesUris:O,headerCheckboxState:C,onCheck:S,openConfigColumnPopup:w,resizeDebounceDelay:A}=e;const R=(0,b.useMemo)((()=>({highlightRow:"highlightedSelector",dragColumnHead:Zd.dragColumnHead,dragColumnBody:Zd.dragColumnBody,draggableHeadCell:Zd.draggableHeadCell,cellWrapper:Zd.cellWrapper})),[]),I=(0,Tp.useSelector)(k().selectors.getMetadata),[N,D]=(0,b.useState)(null),P=(0,b.useCallback)((e=>{D(e),g&&g((0,_.path)([e,"uri"],n))}),[g,n]),L=(0,b.useRef)();(0,b.useImperativeHandle)(t,(()=>({resetScrollbarPosition:()=>{L.current&&L.current.resetScrollbarPosition({resetLeft:!1})}})));const U=(0,b.useCallback)((e=>{m&&e===d?m===Ld.oy?p({field:e,order:Ld.U9}):p({field:e}):p({field:e,order:Ld.oy})}),[p,d,m]),j=(0,b.useCallback)((e=>{const t=(0,_.prop)(e,n);return t?v().createElement(Pm,{entity:t,rowIndex:e}):null}),[n]),F=(0,b.useCallback)((e=>v().createElement(Jm,e)),[]),M=!!g,V=!!p,B=(0,b.useMemo)((()=>function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e.map(((e,r)=>{var n;let{attrType:a}=e,i=gm(e,["attrType"]);const o=0===r;return dm({},i,{dataTypeDefinition:a&&(0,x.getAttrDataTypeDefinition)(a),resizable:!0,autoResize:null!==(n=i.autoResize)&&void 0!==n?n:!o,draggable:!o,sortable:t&&hm(i),nestedPath:Em(i.id),headCellRenderer:o?Yd:Hd,rowCellValueRenderer:pm(dm({},i,{attrType:a}))})}))}(r,V)),[r,V]),z=(0,b.useMemo)((()=>((e,t,r)=>(r||[]).map((e=>(0,_.pipe)((0,_.reduce)(((t,r)=>(0,_.assoc)(r.id,((e,t,r)=>{switch(t.id){case"label":return r;case"entityId":return(0,x.getEntityId)(r);default:{const[e,...n]=ym(t.id);return(0,_.pipe)((0,_.prop)(e),(0,x.getOvAttributeValuesByPath)(n))(r)}}})(0,r,e),t)),{}),(0,_.assoc)("rawValue",e))(t))))(0,r,n)),[I,r,n]),H=a?n.findIndex((0,_.propEq)("uri",a)):-1,Y=(0,b.useMemo)((()=>({onEntityClick:y,selectedEntityUri:i,highlightedEntityIndex:H,entitiesImportStatus:f,onEntityImportStatusChange:h,canCheck:T,checkedEntitiesUris:O,headerCheckboxState:C,onCheck:S,openConfigColumnPopup:w})),[O,f,C,H,T,S,y,h,i,w]);return v().createElement(Ud.M,{fixFirstColumn:!0,onScroll:u,rowsData:z,columnsData:B,onSort:U,highlightRow:-1!==H?H:null,ref:L,sortFieldClassName:Zd.sortableCell,containerClassName:Zd.table,classes:R,defaultColumnWidth:250,headRowHeight:50,defaultColumnMinWidth:100,defaultRowHeight:48,sorting:{field:d,order:m},dndColumnReorderingHandler:o,dndColumnReorderingEnabled:l,onChangeColumnsSize:c,columnsSize:s,resizeDebounceDelay:null!=A?A:150,onRowHover:M?P:void 0,hoverStateEnabled:M,hoverRowIndex:N,renderRowOverlay:j,logger:E,context:Y,maxRowValuesCount:2,renderRowCell:F,getRowCellHeight:eg})}));tg.propTypes={entities:vp().array,entityToHighlight:vp().string,selectedEntityUri:vp().string,headColumns:vp().array,columnsSize:vp().array,onScroll:vp().func,onSort:vp().func,onReorderingColumn:vp().func,onChangeColumnsSize:vp().func,dndColumnReorderingEnabled:vp().bool,onEntityClick:vp().func,onEntityHover:vp().func,sortField:vp().string,sortOrder:vp().oneOf([Ld.oy,Ld.U9]),entitiesImportStatus:vp().object,onEntityImportStatusChange:vp().func,logger:vp().func,canCheck:vp().bool,checkedEntitiesUris:vp().arrayOf(vp().string),headerCheckboxState:vp().oneOf([!0,!1,null]),onCheck:vp().func,openConfigColumnPopup:vp().func,resizeDebounceDelay:vp().number},tg.defaultProps={entities:[],headColumns:[]},tg.displayName="EntitiesTable";const rg=(0,b.memo)(tg);var ng=r(4437),ag=r.n(ng),ig=r(5106),og=r.n(ig);const lg="left",sg="right",cg="hide",ug={[lg]:mi().text("Insert 1 left"),[sg]:mi().text("Insert 1 right"),[cg]:mi().text("Hide column")},pg=e=>{let{open:t,anchorEl:r,onClick:n,onClose:a,actions:i}=e;return v().createElement(xp(),{open:t,anchorEl:r,onClose:a},v().createElement(ag(),{component:"div"},i.map(((e,t)=>((e,t,r)=>v().createElement(og(),{button:!0,component:"div",key:r,onClick:t},v().createElement(Xp(),{primary:ug[e],primaryTypographyProps:{variant:"body2"}})))(e,(e=>()=>{n(e)})(e),t)))))};pg.propTypes={open:vp().bool,anchorEl:vp().any,onClick:vp().func,onClose:vp().func,actions:vp().array};const dg=pg;class mg extends v().PureComponent{constructor(){super(...arguments),this.state={addColumnPopupOpen:!1,configColumnPopupOpen:!1,configurableColumnIndex:!1,popupAnchor:null,filterText:""},this.addColumnHandler=e=>{const{newColumnPlaceIndex:t}=this.state,{onChangeColumnsList:r,headColumns:n}=this.props,a=n.slice();a.splice(t,0,e),r({columns:a}),this.closeAddColumnPopup()},this.openAddColumnPopup=e=>{let{newColumnPlaceIndex:t}=e;this.setState({newColumnPlaceIndex:t,configColumnPopupOpen:!1,addColumnPopupOpen:!0})},this.closeAddColumnPopup=()=>{this.setState({popupAnchor:null,addColumnPopupOpen:!1,filterText:""})},this.setFilterText=e=>{this.setState({filterText:e})},this.openConfigColumnPopup=e=>{this.setState({popupAnchor:e.currentTarget,configColumnPopupOpen:!0,configurableColumnIndex:parseInt(e.currentTarget.getAttribute("data-column-index"))})},this.closeConfigColumnPopup=()=>{this.setState({configColumnPopupOpen:!1})},this.configColumnHandler=e=>{const{configurableColumnIndex:t}=this.state;switch(e){case lg:this.openAddColumnPopup({newColumnPlaceIndex:t});break;case sg:this.openAddColumnPopup({newColumnPlaceIndex:t+1});break;case cg:this.hideCurrentConfigColumn()}},this.hideCurrentConfigColumn=()=>{const{configurableColumnIndex:e}=this.state,{onChangeColumnsList:t,headColumns:r}=this.props,n=r.slice();n.splice(e,1),t({columns:n}),this.closeConfigColumnPopup()},this.memoizedGetColumnSize=(0,x.memoizeWith)(mg.getMemoIdForColumnSize,mg.getColumnSizeFromHeadColumns)}static getColumnSizeFromHeadColumns(e){return e.map((e=>({id:e.id,size:e.size})))}static getMemoIdForColumnSize(e,t){return`${t}${(0,_.toString)(e.map((e=>(0,_.pick)(["id","size"],e))))}`}render(){const{entities:e,entityToHighlight:t,selectedEntityUri:r,onScroll:n,headColumns:a,sortField:i,sortOrder:o,dndColumnReorderingEnabled:l,onEntityClick:s,onEntityHover:c,entitiesTableRef:u,additionalColumns:p,onChangeColumnsList:d,onReorderingColumn:m,onSort:g,onChangeColumnsSize:y,entityTypeUri:f,entitiesImportStatus:h={},onEntityImportStatusChange:E,logger:b,canCheck:T,checkedEntitiesUris:O,headerCheckboxState:x,onCheck:C,resizeDebounceDelay:S}=this.props,{addColumnPopupOpen:w,configColumnPopupOpen:A,popupAnchor:R,filterText:_,configurableColumnIndex:I}=this.state,N=this.memoizedGetColumnSize(a,f);return v().createElement(v().Fragment,null,v().createElement(rg,{entities:e,entityToHighlight:t,selectedEntityUri:r,onScroll:n,onSort:g,onEntityClick:s,onEntityHover:c,headColumns:a,sortField:i,sortOrder:o,onReorderingColumn:m,ref:u,onChangeColumnsList:d,dndColumnReorderingEnabled:l,onChangeColumnsSize:y,columnsSize:N,entitiesImportStatus:h,onEntityImportStatusChange:E,logger:b,canCheck:T,checkedEntitiesUris:O,headerCheckboxState:x,onCheck:C,openConfigColumnPopup:this.openConfigColumnPopup,resizeDebounceDelay:S}),v().createElement(Sd,{open:w,anchorEl:R,data:p,onListItemClick:this.addColumnHandler,filterText:_,onClose:this.closeAddColumnPopup,onSearch:this.setFilterText,hideCheckBox:!0,titleText:di.text("Add column")}),v().createElement(dg,{onClick:this.configColumnHandler,onClose:this.closeConfigColumnPopup,anchorEl:R,open:A,actions:I>0?[lg,sg,cg]:[sg]}))}}mg.propTypes={entities:vp().array,entityToHighlight:vp().string,selectedEntityUri:vp().string,entityTypeUri:vp().string,headColumns:vp().array,dndColumnReorderingEnabled:vp().bool,onScroll:vp().func,onSort:vp().func,onReorderingColumn:vp().func,onChangeColumnsSize:vp().func,onChangeColumnsList:vp().func,onEntityClick:vp().func,onEntityHover:vp().func,sortField:vp().string,sortOrder:vp().oneOf([Ld.oy,Ld.U9]),entitiesTableRef:vp().shape({current:vp().shape({resetScrollbarPosition:vp().func})}),additionalColumns:vp().arrayOf(vp().shape({id:vp().string,label:vp().string})),entitiesImportStatus:vp().object,onEntityImportStatusChange:vp().func,logger:vp().func,canCheck:vp().bool,checkedEntitiesUris:vp().arrayOf(vp().string),headerCheckboxState:vp().oneOf([!0,!1,null]),onCheck:vp().func};const gg=mg;var yg=r(66780),fg=r(9366),hg=r(41633),Eg=r(79881),bg=r.n(Eg),vg=r(93962),Tg=r.n(vg),Og=r(45995),xg=r.n(Og);function Cg(){return Cg=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Cg.apply(this,arguments)}const Sg=e=>{let{open:t=!0,children:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["open","children"]);const[a,i]=(0,b.useState)(t),o=(0,Lm.useTheme)().transitions.duration.leavingScreen;return(0,b.useEffect)((()=>{if(t!==a){if(!t){const e=setTimeout((()=>{i(!1)}),o);return()=>clearTimeout(e)}i(!0)}}),[t,o,a]),v().createElement(xg(),Cg({open:t},n),a&&r)};Sg.displayName="Drawer";var wg=r(18759),Ag=r.n(wg),Rg=r(30122),_g=r.n(Rg),Ig=r(43410),Ng=r.n(Ig),Dg=r(93416),Pg=r.n(Dg),kg=r(66825),Lg=r.n(kg),Ug=r(17698);const jg=(0,_.allPass)([(0,_.propSatisfies)(_.isEmpty,"configs"),(0,_.pathEq)(["group","hasCollapseButton"],!0)]),Fg=(0,_.reject)(jg),Mg=(0,kp.Z)({titleBox:{display:"flex",flexDirection:"row",flexShrink:0,lineHeight:"24px",paddingTop:"12px",paddingBottom:"8px",alignItems:"center",justifyContent:"space-between"},title:{color:"rgba(0,0,0,0.87)",display:"flex",flexGrow:1,alignItems:"center",fontSize:16,fontWeight:500,paddingLeft:16,letterSpacing:"0.15px",overflow:"hidden"},text:{},avatar:{marginRight:12,width:"32px",height:"32px"},collapseIcon:{marginRight:8},leftIcon:{flexShrink:0,marginRight:"20px"}}),Vg=e=>{let{title:t="",iconSrc:r="",isOpen:n=!0,hasCollapseButton:a=!0,leftIcon:i,onCollapse:o}=e;const l=Mg();return v().createElement("div",{className:l.titleBox},v().createElement("div",{className:l.title},i&&v().createElement("div",{className:l.leftIcon},i),r&&v().createElement(S(),{src:r,className:l.avatar}),v().createElement(gd.Y,{value:t},v().createElement("span",{className:l.text},t))),a&&v().createElement($m,{isOpen:n,onClick:o,className:l.collapseIcon,size:"S"}))};var Bg=r(1230),zg=r.n(Bg),Hg=r(36631);const Yg=e=>{let{facet:t,selectedFacets:r}=e;return!!r.find((e=>e.fieldName===t.fieldName||e.fieldName.includes(`${t.fieldName}.`)))},Wg=e=>{let{facet:t,selectedFacets:r}=e;return Yg({facet:t,selectedFacets:r})||(0,N.OP)(t)&&t.children&&t.children.some((e=>Yg({facet:e,selectedFacets:r})))},Gg=(0,kp.Z)({icon:{maxHeight:"25px",maxWidth:"25px",marginRight:"16px"}}),qg=e=>{let{group:t,metadata:r}=e;const n=Gg(),a=(0,w.$H)(),i=(0,x.getEntityTypeGraphIcon)(r,{type:t.id}),o=(0,x.getAbsoluteImageUrl)(a,i);return v().createElement(nm,{className:n.icon,icon:o,avatarText:t.title[0]})};function Zg(){return Zg=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Zg.apply(this,arguments)}const $g=e=>{let{onListItemClick:t,focusIndex:r,selectedFacets:n,metadata:a}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["onListItemClick","focusIndex","selectedFacets","metadata"]);const o=(0,b.useRef)(null);o.current=n;const l=(0,b.useRef)(null);l.current=r;const s=(0,b.useCallback)(((e,r,n)=>{let{item:a,level:i,groupId:s}=r;const c=Wg({facet:a,selectedFacets:o.current}),u=l.current===n;return v().createElement(bd,{key:`item-${s}-${a.fieldName}`,onClick:t,data:a,label:v().createElement(vd.o,{text:a.title,highlight:a.filterText}),labelInText:a.title,level:i,style:e,checked:c,isFocused:u,groupId:s,LogoIcon:a.LogoIcon})}),[t]),c=(0,b.useCallback)(((e,t)=>v().createElement(og(),{component:"div",className:"MoreFacetsPopup-styles-subHeader--h1vGz",style:e,key:`group-${t.item.id}`},t.item.needGroupIcon&&v().createElement(qg,{metadata:a,group:t.item}),t.item.title)),[a]),u=(0,b.useCallback)(((e,t)=>t.items?40:28),[]);return v().createElement(Zp,Zg({getItemSize:u,renderGroupTitle:c,renderItem:s,focusIndex:r},i,{disableHorizontalScrollbar:!0}))};function Kg(){return Kg=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Kg.apply(this,arguments)}const Xg=574,Qg={},Jg=e=>{let{metadata:t,open:r,selectedFacets:n,data:a=[],onListItemClick:i,lastFacetClicked:o=Qg,width:l,height:s=Xg}=e,c=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["metadata","open","selectedFacets","data","onListItemClick","lastFacetClicked","width","height"]);const[u,p]=(0,b.useState)(464),d=s-110;(0,b.useEffect)((()=>{p(d)}),[d]);const m=(0,b.useCallback)(((e,t)=>p((0,_.clamp)(56,d,t))),[d]),g=(0,b.useRef)();(0,b.useEffect)((()=>{const e=(0,_.path)(["current","updatePosition"],g);e&&e()}),[u]);const y=(0,b.useCallback)((function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return[{type:"item",item:e,moveTo:(0,_.has)("facetConfig")(o)&&o.facetConfig.fieldName===e.fieldName&&t===o.groupId,level:r,groupId:t}].concat(e.children?e.children.flatMap((e=>y(e,t,r+1))):[]).flat().filter((e=>!e.item.hide))}),[o]),f=(0,b.useCallback)((e=>e.map((e=>({type:"group",item:e,items:e.facets.filter((e=>!e.hide)).map((t=>y(t,e.id)))}))).filter((e=>e.items.length))),[y]),h=(0,b.useMemo)((()=>f(a)),[a,f]),E=(0,b.useMemo)((()=>(0,yi.LG)(h)),[h]),T=(0,b.useCallback)((e=>{let{item:t,groupData:r}=e;i(t,!Wg({facet:t,selectedFacets:n}),r.groupId)}),[i,n]),{focusIndex:O,handleKeyDown:C}=$p({items:E,open:r,onSelectFocusedItem:T,selectedItems:n}),S=Math.max(l||(0,x.getMaxItemWidth)("title")(h),240);return v().createElement(zp,Kg({open:r,action:g,title:mi().text("Select attribute"),containerWidth:S,searchInputOnKeyDown:C,containerHeight:110+u},c),v().createElement($g,{focusIndex:O,selectedFacets:n,onListItemClick:i,metadata:t,items:E,height:u,onInnerContainerResize:m}),0===E.length&&v().createElement("div",{className:"MoreFacetsPopup-styles-noResultsCaptionContainer--ChfND"},v().createElement(Ag(),{variant:"caption",display:"block",gutterBottom:!0},mi().text("No results found"))))};function ey(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ty(e,t,r[t])}))}return e}function ty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class ry extends b.PureComponent{constructor(e){super(e),this.state={filterText:"",lastFacetClicked:null,addedFacets:[]},this.searchInputRootRef=v().createRef(),this.showSearchInput=()=>this.searchInputRootRef.current.scrollIntoView(!0),this.openPopup=()=>this.props.dispatch(vi(!0)),this.closePopup=()=>{this.props.dispatch(vi(!1)),this.props.dispatch(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{type:L.k.HIGHLIGHT_ADDED_FACETS,payload:e}}(this.state.addedFacets)),this.setState({addedFacets:[]}),setTimeout((()=>{this.props.dispatch({type:L.k.CLEAR_HIGHLIGHT_ADDED_FACETS})}),3e3)},this.setFilterText=e=>this.setState({filterText:e,lastFacetClicked:null}),this.clearFilterText=()=>this.setFilterText(""),this.setLastFacetClicked=e=>this.setState({lastFacetClicked:e}),this.resetLastFacetClicked=()=>this.setLastFacetClicked(null),this.filterItem=e=>{const{filterText:t=""}=this.state;return e.title.toLowerCase().includes(t.toLowerCase())},this.filterItemsTree=e=>this.filterItem(e)||(e.children||[]).some(this.filterItemsTree),this.getFilteredFacets=e=>(e||[]).map((e=>ey({},e,{hide:!this.filterItemsTree(e),filterText:this.state.filterText}))).map((e=>{const t=this.getFilteredFacets(e.children);return(0,_.isEmpty)(t)?e:ey({},e,{children:t})})),this.filterItemsInGroups=e=>e.map((e=>ey({},e,{facets:this.getFilteredFacets(e.facets)}))),this.rejectNotAllowedEntityTypes=e=>t=>t.filter((t=>{let{id:r}=t;return!(0,x.isEntityTypeUri)(r)||e.includes(r)})),this.toggleSelectedFacet=(e,t)=>{const{facetsConfigs:r,selectedEntityTypes:n,dispatch:a}=this.props,i=(0,yi.jj)(e),o=t?r.concat(e).concat(i):r.filter((t=>t.fieldName!==e.fieldName)).filter((e=>!i.find((t=>t.fieldName===e.fieldName)))),l=(0,_.uniq)(o.filter((e=>e.entityTypeUri)).map((e=>e.entityTypeUri)).concat(n)),s=o.filter((0,_.complement)(N.OP)),c=s.filter((e=>!r.find((t=>t.fieldName===e.fieldName)))),u=r.filter((e=>!s.find((t=>e.fieldName===t.fieldName)))).map((e=>e.fieldName));(c.length||u.length)&&(this.setAddedFacets(c.map((0,_.prop)("fieldName")),u),a(si({facetsToAdd:c,fieldNamesToDelete:u,changedEntityTypes:(0,_.equals)(l,n)?null:l})))},this.setAddedFacets=(e,t)=>{const r=this.state.addedFacets.concat(e).filter((e=>!t.includes(e)));this.setState({addedFacets:r})},this.handleItemClick=(e,t,r)=>{this.setLastFacetClicked({facetConfig:e,groupId:r}),this.toggleSelectedFacet(e,t)},this.handlePopupClose=()=>{this.closePopup(),this.clearFilterText(),this.resetLastFacetClicked()},this.memoizedCollectFacetsList=(0,Hg.Z)(N.tI),this.handleInputFocus=()=>{this.showSearchInput(),this.openPopup()}}get inputWidth(){return this.searchInputRootRef.current?this.searchInputRootRef.current.getBoundingClientRect().width:0}render(){const{filterText:e,lastFacetClicked:t}=this.state,{open:r,recommendedFacets:n,classes:a,metadata:i,selectedEntityTypes:o,facetsConfigs:l,dataTenantObject:s,allowedEntityTypes:c,dataTenants:u}=this.props,p=l.map((e=>({fieldName:e.fieldName,uri:e.uri}))),d=this.memoizedCollectFacetsList(i,o,n,u),m=(0,_.pipe)((0,_.when)((0,_.always)(e),this.filterItemsInGroups),(0,_.when)((0,_.always)(c),this.rejectNotAllowedEntityTypes(c)),(0,j.Eb)(s))(d),{verticalOrigin:g,popupHeight:y}=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:16,n="top";if(e){const a=e.getBoundingClientRect(),i=r,o=window.innerHeight-r;if(a.top+t>o)if(a.bottom-t<i){const e=a.bottom-i,r=o-a.top;t=Math.max(e,r),n=e>r?"bottom":"top"}else n="bottom"}return{verticalOrigin:n,popupHeight:t}}(this.searchInputRootRef.current,Xg),f={vertical:g,horizontal:"right"};return v().createElement(b.Fragment,null,v().createElement(Mp,{classes:{root:a.inputContainer},onSearch:this.setFilterText,onFocus:this.handleInputFocus,rootRef:this.searchInputRootRef,value:e,placeholder:mi().text("Search & add attributes"),height:40,"data-reltio-id":"reltio-search-more-facets-search-input"}),v().createElement(Jg,{open:r,anchorEl:this.searchInputRootRef.current,metadata:i,selectedFacets:p,data:m,onClose:this.handlePopupClose,onListItemClick:this.handleItemClick,lastFacetClicked:t,width:this.inputWidth,height:y,onSearch:this.setFilterText,headerPlacement:"bottom"===g?"bottom":"top",anchorOrigin:f,transformOrigin:f,disableRestoreFocus:!0}))}}ry.defaultProps={selectedEntityTypes:[],facetsConfigs:[]};const ny=(0,Tp.connect)((e=>({metadata:k().selectors.getMetadata(e),open:(0,ki.ds)(e),facetsConfigs:(0,D.Mp)(e),recommendedFacets:(0,D.ER)(e),selectedEntityTypes:(0,D.DX)(e),dataTenantObject:(0,ui.t9)(e),allowedEntityTypes:(0,ki.Xf)(e),dataTenants:k().selectors.getDataTenants(e)})))(zg()((()=>({inputContainer:{margin:"4px 16px 16px",flexShrink:"0"}})))(ry)),ay=(0,kp.Z)({facetGroupContainer:{display:"flex",flexShrink:0,flexDirection:"column","& + hr":{marginTop:8},"& + &":{marginTop:"8px"}}});function iy(){return iy=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},iy.apply(this,arguments)}const oy=e=>{let{hasSearchAttributesField:t,children:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["hasSearchAttributesField","children"]);const a=ay(),[i,o]=(0,b.useState)(!0);return v().createElement("div",{className:a.facetGroupContainer},v().createElement(Vg,iy({isOpen:i,onCollapse:e=>{o(!i)}},n)),t&&v().createElement(v().Fragment,null,v().createElement(ny,null),v().createElement(Lg(),null)),i&&r)};function ly(){return ly=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ly.apply(this,arguments)}const sy=(e,t)=>{const r=r=>{let{dispatch:n}=r,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(r,["dispatch"]);return v().createElement(e,ly({config:t,onChange:(i=t.fieldName,e=>{n(ii(i,e))}),onClose:t.showDeleteButton?(e=>()=>{n(si({fieldNamesToDelete:[e]}))})(t.fieldName):()=>{},onSearch:(e=>t=>{let{value:r,pageNumber:a,currentOptions:i}=t;n((e=>{let{facetFieldName:t,value:r,debounceTime:n=0,pageNumber:a=1,currentOptions:i}=e;return{type:L.k.FILTER_FACET_DATA,payload:{facetFieldName:t,value:r,debounceTime:n,pageNumber:a,currentOptions:i}}})({facetFieldName:e,value:r,debounceTime:250,pageNumber:a,currentOptions:i}))})(t.fieldName)},a));var i};return r.propTypes={dispatch:vp().func,isRecommended:vp().bool},r};var cy=r(52004),uy=r.n(cy),py=r(58282),dy=r.n(py);const my=(0,kp.Z)((()=>({viewMoreLessLink:{display:"flex",alignItems:"center",cursor:"pointer"},arrow:{marginRight:"8px",marginLeft:"-2px",transform:"rotate(0deg)",transition:"transform 0.35s ease"},rotated:{transform:"rotate(-180deg)"}}))),gy=e=>{let{active:t,onClick:r,className:n}=e;const a=my();return v().createElement(uy(),{className:O()(a.viewMoreLessLink,n),onClick:r,underline:"none"},v().createElement(dy(),{"data-reltio-id":"more-arrow-icon",className:O()(a.arrow,{[a.rotated]:t})}),t?mi().text("View less"):mi().text("View more"))};var yy=r(50592),fy=r(23888),hy=r.n(fy);const Ey=(0,kp.Z)((e=>({bar:{backgroundColor:e.palette.secondary.main,opacity:.12,position:"absolute",minHeight:"20px",minWidth:"5px",borderRadius:"2px",top:0,left:0,height:"100%"}}))),by=e=>(0,_.is)(Number,e),vy=e=>{let{className:t,width:r=0,maxWidth:n}=e;const a=Ey(),i=(0,b.useCallback)((e=>(n?100*e/n:0)+"%"),[n]);return r?v().createElement("div",{className:O()(a.bar,t),style:{width:by(r)?i(r):r}}):null},Ty=(0,kp.Z)((e=>({listContainer:{display:"flex",flexDirection:"column",paddingLeft:18,"& $disabled":{pointerEvents:"none",opacity:.4}},disabled:{},item:{display:"flex",flexGrow:1,flexShrink:0,flexDirection:"row",marginRight:10,marginTop:2,marginBottom:2},info:{display:"flex",flexGrow:1,position:"relative",minWidth:0,marginTop:2,marginBottom:2,"&:hover":{cursor:"pointer","& $buttonONLY":{display:"block"}}},buttonONLY:{display:"none",position:"absolute",height:24,width:59,borderRadius:3,backgroundColor:"#DFDFDF",fontSize:14,fontWeight:600,lineHeight:"16px",color:"rgba(0,0,0,0.54)",boxShadow:"none",top:0,right:0,zIndex:3},avatar:{marginRight:8,height:24,width:24},checkbox:{marginRight:14,padding:0,"& $checked":{opacity:1}},checked:{},textInfo:{display:"flex",flexGrow:1,lineHeight:"16px",backgroundColor:"transparent",minWidth:0,alignItems:"center",zIndex:2},text:{flexGrow:1,marginLeft:7,marginRight:4,color:e.palette.text.primary,width:"100%",maxHeight:"32px",wordBreak:"break-word",wordWrap:"break-word",overflow:"hidden"},count:{flexShrink:0,fontSize:12,color:e.palette.text.secondary,textAlign:"right",marginRight:4},toggleContainer:{height:28,padding:"2px 2px",display:"flex",alignItems:"center",justifyContent:"flex-start",margin:"0",background:e.palette.background.default},toggleButton:{padding:"0",minWidth:"28",height:"28",border:"0","&:last-child":{paddingLeft:"0"}},checkedBar:{opacity:.4}})));function Oy(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const xy={showColorBar:!0,hasOnlyButton:!1},Cy=e=>{let{config:t,data:r=[],values:n=[],onChange:a=_.identity}=e;const i=Ty();t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Oy(e,t,r[t])}))}return e}({},xy,t);const o=e=>()=>{const t=n.includes(e)?n.filter((t=>t!==e)):n.concat(e);a(t)},l=Math.max(...r.map((e=>e.number)));return v().createElement("div",{className:i.listContainer},r.map((e=>v().createElement("div",{key:e.value,className:O()(i.item,{[i.disabled]:!e.number&&!n.includes(e.value)}),"data-reltio-id":"search-facets-list-row"},(e=>v().createElement(Jp(),{className:O()(i.checkbox,{[i.checked]:n.includes(e.value)}),checked:n.includes(e.value),onChange:o(e.value),value:e.value,color:"primary"}))(e),v().createElement("div",{className:i.info,onClick:o(e.value)},(e=>v().createElement(vy,{className:O()({[i.checkedBar]:n.includes(e.value)}),width:e.number,maxWidth:l}))(e),v().createElement("div",{className:O()(i.textInfo)},v().createElement("div",{className:i.text},e.label),v().createElement("div",{className:i.count},void 0===e.number?mi().text("N/A"):(0,ci.k7)(e.number,5e3))),t.hasOnlyButton&&(e=>{return v().createElement(hy(),{className:i.buttonONLY,onClick:(t=e.value,e=>{e.stopPropagation(),a([t])})},mi().text("ONLY"));var t})(e))))))};var Sy=r(1441);const wy=(0,kp.Z)((()=>({container:{overflow:"hidden",display:"flex",flexGrow:1,flexDirection:"column",fontSize:"13px"},noData:{marginLeft:"16px"},viewMoreLess:{paddingLeft:"20px"}}))),Ay=e=>{let{config:t,data:r=[],values:n=[],onChange:a}=e;const i=wy(),o=(0,Tp.useDispatch)(),l=(0,b.useCallback)((e=>{let{show:t}=e;o((e=>{let{show:t,silent:r}=e;return{type:L.k.SHOW_MORE_ENTITY_TYPES,payload:{show:t,silent:r}}})({show:t}))}),[o]),s=(0,Tp.useSelector)((e=>(0,D.jC)(t,e))),c=(0,Tp.useSelector)(ui.t9),u=r.length>K.wP,p=(0,b.useCallback)((()=>{l({show:!s})}),[l,s]),d=(0,b.useMemo)((()=>{const e=s?r:r.slice(0,K.wP);return(0,Sy.ZK)(e,c)}),[r,s,c]);return v().createElement("div",{className:i.container},r.length>0?v().createElement(v().Fragment,null,v().createElement(Cy,{data:d,values:n,onChange:a,config:t}),u&&v().createElement(gy,{active:s,onClick:p,className:i.viewMoreLess})):v().createElement(yy.K,{variant:"noData",className:i.noData}))};var Ry=r(70347),_y=r(94852);const Iy=(0,_y.M)(Ry.ZP);var Ny=r(75237),Dy=r(27308);const Py=(0,_y.M)(Dy.ZP);var ky=r(22507),Ly=r(14658);function Uy(){return Uy=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Uy.apply(this,arguments)}const jy={Option:e=>{let{innerProps:t,innerRef:r,children:n,isFocused:a,isSelected:i,selectProps:{classes:o},label:l}=e;return v().createElement(td(),Uy({className:O()(o.option,{[o["option--selected"]]:i}),ref:r,selected:a,component:"div"},t),v().createElement(Jp(),{color:"primary",checked:i}),v().createElement(gd.Y,{value:l},v().createElement("div",{className:o["option--item"]},n)))}},Fy=e=>{let t=null==e?void 0:e.parentElement;for(;t;){if(t.scrollHeight>t.clientHeight)return t;t=t.parentElement}return null},My=(e,t,r,n)=>e&&t<e&&n.getBoundingClientRect().bottom>r.getBoundingClientRect().bottom,Vy=(0,kp.Z)((e=>({label:{top:6,left:16},placeholder:e=>{let{placeholder:t,label:r}=e;return{display:!t||r?"none":void 0}},"option--selected":{fontWeight:400},clearIndicator:{padding:e.spacing(1),margin:e.spacing(.25,.5)},dropdownIndicator:{padding:e.spacing(1),margin:e.spacing(.25,.5)}})));function By(){return By=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},By.apply(this,arguments)}function zy(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Hy(e,t,r[t])}))}return e}function Hy(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let Yy=0;const Wy=e=>{const{label:t,creatable:r,getOptions:n,loadingIndicator:a,components:i,classes:o,styles:l,onChange:s,onInputChange:c,menuPlacement:u="auto"}=e,p=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["label","creatable","getOptions","loadingIndicator","components","classes","styles","onChange","onInputChange","menuPlacement"]),d=r?Iy:n?Py:Ny.J,[m,g]=(0,b.useState)(""),y=Vy((0,_.omit)(["classes"],e)),f="custom-select-"+Yy++,h=(0,b.useRef)();!function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;const r=(0,Ly.D)(null==e?void 0:e.length);(0,b.useEffect)((()=>{const n=setTimeout((()=>{const n=Fy(null==t?void 0:t.current);var a;n&&My(null==e?void 0:e.length,r,n,t.current)&&(null===(a=t.current)||void 0===a||a.scrollIntoView(!1))}),0);return()=>{clearTimeout(n)}}),[null==e?void 0:e.length])}(e.value,(e=>{const t={};return e.current&&(t.current=(0,_.either)((0,_.path)(["select","controlRef"]),(0,_.path)(["select","select","controlRef"]))(e.current)),t})(h));const E=zy({},jy,i),T=(0,ky.z)(y,o),O=zy({indicatorSeparator:e=>zy({},e,{margin:"10px 0"}),loadingIndicator:e=>zy({},e,{display:a?e.display:"none"}),loadingMessage:e=>zy({},e,{fontFamily:'"Roboto", "Helvetica", "Arial", sans-serif'})},l),x=t?{inputId:f,TextFieldProps:zy({label:t,InputLabelProps:{htmlFor:f,shrink:!(!e.value||!e.value.length)||void 0,className:T.label}},e.TextFieldProps)}:{};return v().createElement(d,By({isMulti:!0,inputId:f,inputValue:m,onChange:function(e,t){s(e,t),"create-option"===t.action&&(g(""),c("",{action:"input-change"}))},onInputChange:function(e,t){let{action:r}=t;c(e,{action:r}),"set-value"!==r&&g(e)},closeMenuOnSelect:!1,hideSelectedOptions:!1,classes:T,components:E,styles:O,menuPlacement:u,loadOptions:n,innerRef:h},x,p))};Wy.defaultProps={creatable:!1,cacheOptions:!0,components:{},classes:{},placeholder:"",loadingIndicator:!1,onInputChange:()=>{},onChange:()=>{}},Wy.propTypes={creatable:vp().bool,cacheOptions:vp().bool,defaultOptions:vp().bool,value:vp().arrayOf(vp().shape({label:vp().string.isRequired,value:vp().any})),options:vp().arrayOf(vp().shape({label:vp().string.isRequired,value:vp().any})),onChange:vp().func,onInputChange:vp().func,placeholder:vp().string,label:vp().string,loadingIndicator:vp().bool,components:vp().shape({ClearIndicator:vp().func,Control:vp().func,DropdownIndicator:vp().func,DownChevron:vp().func,CrossIcon:vp().func,Group:vp().func,GroupHeading:vp().func,IndicatorsContainer:vp().func,IndicatorSeparator:vp().func,Input:vp().func,LoadingIndicator:vp().func,Menu:vp().func,MenuList:vp().func,MenuPortal:vp().func,LoadingMessage:vp().func,NoOptionsMessage:vp().func,MultiValue:vp().func,MultiValueContainer:vp().func,MultiValueLabel:vp().func,MultiValueRemove:vp().func,Option:vp().func,Placeholder:vp().func,SelectContainer:vp().func,SingleValue:vp().func,ValueContainer:vp().func}),classes:vp().shape({control:vp().string,valueContainer:vp().string,multiValue:vp().string,noOptionsMessage:vp().string,singleValue:vp().string,placeholder:vp().string,menu:vp().string,clearIndicator:vp().string,dropdownIndicator:vp().string,option:vp().string,"option--selected":vp().string,label:vp().string}),styles:vp().shape({clearIndicator:vp().func,container:vp().func,control:vp().func,dropdownIndicator:vp().func,group:vp().func,groupHeading:vp().func,indicatorsContainer:vp().func,indicatorSeparator:vp().func,input:vp().func,loadingIndicator:vp().func,loadingMessage:vp().func,menu:vp().func,menuList:vp().func,menuPortal:vp().func,multiValue:vp().func,multiValueLabel:vp().func,multiValueRemove:vp().func,noOptionsMessage:vp().func,option:vp().func,placeholder:vp().func,singleValue:vp().func,valueContainer:vp().func}),TextFieldProps:vp().object,getOptions:vp().func,menuPlacement:vp().string,menuPortalTarget:vp().object,menuShouldBlockScroll:vp().bool,captureMenuScroll:vp().bool,getOptionValue:vp().func,isSearchable:vp().bool,inputRef:vp().shape({current:vp().object})};var Gy=r(80959),qy=r(88640),Zy=r(25386),$y=r(59428),Ky=r(47823);const Xy=(0,kp.Z)({item:{display:"flex",minHeight:"28px",flexGrow:1,flexDirection:"row",alignItems:"center",borderRadius:"1px",padding:0,opacity:1},checkbox:{marginRight:"14px",marginLeft:"18px",padding:0},infobox:{display:"flex",flexGrow:1,alignItems:"center",position:"relative",height:"20px",margin:"2px 10px 2px 0",minWidth:0},textbox:{display:"flex",flexDirection:"row",alignItems:"center",flexGrow:1,minWidth:0,zIndex:2},text:{flexGrow:1,width:0,height:"15px",color:"rgba(0,0,0,0.87)",fontSize:"13px",lineHeight:"16px",letterSpacing:0,fontWeight:"normal",paddingLeft:"7px",paddingRight:"8px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",minWidth:0},number:{flexGrow:0,flexShrink:0,height:"16px",color:"rgba(0,0,0,0.6)",fontSize:"12px",lineHeight:"16px",textAlign:"right",paddingRight:"4px"},colorBar:{height:"20px"},selectedColorBar:{opacity:.4},itemSelected:{backgroundColor:"rgba(0, 0, 0, 0.04) !important"}});function Qy(){return Qy=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Qy.apply(this,arguments)}const Jy=e=>{const{innerProps:t,innerRef:r,data:n,isSelected:a,isFocused:i,selectProps:{classes:o}}=e,l=Xy(),s=(0,_.has)("width",n),c=(0,_.has)("number",n);return v().createElement(td(),Qy({className:o.option,classes:{root:l.item,selected:l.itemSelected},ref:r,component:"div",selected:i,disableGutters:!0},t),v().createElement(Jp(),{checked:a,color:"primary",disableRipple:!0,classes:{root:l.checkbox}}),v().createElement("div",{className:l.infobox},v().createElement("div",{className:l.textbox},v().createElement(gd.Y,{value:n.label},v().createElement("div",{className:l.text},n.label)),c&&v().createElement("div",{className:l.number},(0,ci.k7)(n.number,5e3))),s&&v().createElement(vy,{className:O()(l.colorBar,{[l.selectedColorBar]:a}),width:n.width})))};Jy.propTypes={innerProps:vp().shape({id:vp().string.isRequired,key:vp().string,onClick:vp().func.isRequired,onMouseMove:vp().func.isRequired,onMouseOver:vp().func.isRequired,tabIndex:vp().number.isRequired}).isRequired,innerRef:vp().oneOfType([vp().oneOf([null]),vp().func,vp().shape({current:vp().any.isRequired})]),isSelected:vp().bool.isRequired,isFocused:vp().bool.isRequired,selectProps:vp().shape({classes:vp().shape({option:vp().string})}),data:vp().shape({value:vp().string,label:vp().string.isRequired,number:vp().number}).isRequired};const ef=Jy,tf=e=>{const{selectProps:{classes:t}}=e;return v().createElement(yy.K,{variant:"noData",className:t.noOptionsMessage})};tf.propTypes={selectProps:vp().object.isRequired};const rf=tf;function nf(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){af(e,t,r[t])}))}return e}function af(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const of={container:e=>nf({},e,{width:"100%"}),menuList:e=>nf({},e,{maxHeight:"240px",padding:"8px 0"}),menu:e=>nf({},e,{maxHeight:"240px"})},lf=(0,kp.Z)((()=>({control:{minHeight:"46px",backgroundColor:"rgba(0,0,0, 0.0267)",height:"auto",padding:0},option:{minHeight:"28px",display:"flex",flexGrow:1,flexShrink:0,flexDirection:"row",padding:0},noOptionsMessage:{padding:"0 16px 0 18px"},multiValue:{backgroundColor:"rgba(43, 152, 240, 0.12)"}}))),sf=vp().shape({value:vp().string.isRequired,label:vp().string.isRequired,number:vp().number});function cf(){return cf=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},cf.apply(this,arguments)}function uf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const pf=e=>{let{values:t=[],defaultOptions:r=[],filteredOptions:n,onChange:a=_.identity,getSuggestions:i,showBar:o=!0,showNumberInValue:l=!1,classes:s={},styles:c={},canLoadMore:u=!0,max:p=K.cu}=e,d=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["values","defaultOptions","filteredOptions","onChange","getSuggestions","showBar","showNumberInValue","classes","styles","canLoadMore","max"]);const m=lf(),[g,y]=(0,b.useState)(""),[f,h]=(0,b.useState)(1),[E,T]=(0,b.useState)(!1),O=(0,b.useRef)(null),C=(0,b.useRef)(!1),S=(0,b.useRef)(!1),w=(n||[]).concat(r),A=e=>w.find((t=>t.value===e))||{value:e,label:e},R=e=>l&&(0,_.has)("number",e)?(0,_.assoc)("formattedNumber",(0,x.formatNumberAsMetric)((0,_.prop)("number",e),5e3),e):e,I=(0,_.pipe)((e=>{if(o&&e.length&&(0,_.has)("number",e[0])){const t=Math.max(...e.map((e=>e.number)));return e.map((e=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){uf(e,t,r[t])}))}return e}({},e,{width:N(e.number,t)})))}return e}),(0,_.uniqBy)((0,_.prop)("value"))),N=(e,t)=>(t?100*e/t:0)+"%",D=(0,x.debounce)(((e,t)=>{let{action:r}=t;e!==g&&"set-value"!==r&&(y(e),h(1),C.current=!1,T(!0),i({value:e,pageNumber:1}))}),250),P=n||r,k=(0,b.useCallback)((()=>{T(!0),i({value:g,pageNumber:f+1,currentOptions:P}),C.current=!0}),[g,f,i,P]);(0,b.useEffect)((()=>{T(!1),C.current&&(h((e=>e+1)),C.current=!1)}),[n]),(0,b.useEffect)((()=>{S.current||(T(!1),h(1),C.current=!1,i({value:"",pageNumber:1})),S.current=!1}),[r]);const L=(0,b.useMemo)((()=>P.slice(0,f*p)),[P,f,p]),U=u&&P.length>L.length;return v().createElement(Wy,cf({filterOption:(e,t)=>{let{label:r,value:n}=e;return x.utils.strings.search(r,t)||x.utils.strings.search(n,t)},value:(e=>(0,x.wrapInArrayIfNeeded)(e).map(A).map(R))(t),onChange:(0,_.pipe)((0,_.tap)((()=>{S.current=!0})),(0,_.defaultTo)([]),(0,_.pluck)("value"),a),options:I(L),onInputChange:D,classes:(0,_.mergeRight)(m,s),styles:(0,_.mergeRight)(of,c),TextFieldProps:{InputProps:{disableUnderline:!0},ref:O},inputRef:O,components:{Option:ef,NoOptionsMessage:rf,Menu:Gy.h,DropdownIndicator:qy.K,MultiValue:Zy._,MenuList:$y.d},menuPlacement:"bottom",menuListFooter:U&&v().createElement(Ky.X,{loading:E,onClick:k})},d))};pf.propTypes={values:vp().array,defaultOptions:vp().arrayOf(sf),filteredOptions:vp().arrayOf(sf),onChange:vp().func.isRequired,getSuggestions:vp().func.isRequired,showBar:vp().bool,showNumberInValue:vp().bool,classes:vp().object,styles:vp().object,canLoadMore:vp().bool,max:vp().number};const df=(0,b.memo)(pf);var mf=r(43627),gf=r.n(mf);function yf(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ff(e,t,r[t])}))}return e}function ff(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const hf=(0,_.range)(2,10).reduce(((e,t)=>yf({},e,{[`&:nth-child(${t})`]:{paddingLeft:`calc(1em * (${t} - 2))`,"&::before":{content:'"└"',display:"inline-block",fontSize:"1em",marginRight:"5px",color:"rgba(255, 255, 255, 0.28)"}}})),{}),Ef=(0,kp.Z)((e=>({tooltip:e.tooltip,tooltipContent:{minWidth:"165px",padding:"4px 2px 2px","& p":{fontSize:"11px",lineHeight:"13px",fontWeight:500,margin:0,color:"white"},"& ul":{listStyleType:"none",padding:0,margin:0,"& li":yf({fontSize:"10px",lineHeight:"11px",fontWeight:500,color:"rgba(255, 255, 255, 0.7)",marginTop:"4px"},hf,{"&:last-child":{color:"white"}}),"& li + li":{marginTop:"2px"}}}})));function bf(){return bf=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},bf.apply(this,arguments)}const vf=e=>{let{pathToTitle:t,children:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["pathToTitle","children"]);const a=Ef(),i=null!=t&&t.length?v().createElement("div",{className:a.tooltipContent},v().createElement("p",null,(0,_.last)(t)),t.length>2&&v().createElement("ul",null,t.map((e=>v().createElement("li",{key:e},e))))):"";return v().createElement(gf(),bf({title:i,disableFocusListener:!0,classes:{tooltip:a.tooltip}},n),r)};var Tf=r(96091),Of=r.n(Tf),xf=r(35635),Cf=r.n(xf);const Sf=(0,kp.Z)({root:{boxSizing:"border-box",height:"18px",border:"1px solid rgba(0,0,0,0.12)",borderRadius:"16px",backgroundColor:"transparent","& $deleteIcon":{margin:"0",height:"12px",width:"12px",color:"rgba(0,0,0,0.38)"}},outlined:{"& $deleteIcon":{marginRight:2}},deleteIcon:{},label:{color:"rgba(0,0,0,0.38)",fontSize:"12px",fontWeight:500,lineHeight:"16px",paddingLeft:"4px",paddingRight:"4px"}});function wf(){return wf=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},wf.apply(this,arguments)}const Af=(0,yd.T)(Cf()),Rf=e=>{let{label:t,onDelete:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["label","onDelete"]);const a=Sf();return v().createElement(Of(),wf({className:a.root,label:mi().number(t),onDelete:r,variant:"outlined",classes:{root:a.root,outlined:a.outlined,deleteIcon:a.deleteIcon,label:a.label},deleteIcon:v().createElement(Af,{tooltipTitle:mi().text("Clear")})},n))},_f=(0,kp.Z)((e=>({container:{display:"flex",flexDirection:"column",flexGrow:1,justifyContent:"center",height:"100%",minWidth:0,cursor:"pointer"},parent:{color:e.palette.text.secondary,fontSize:"13px",lineHeight:"15px",letterSpacing:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},titleContainer:{display:"flex",flexDirection:"row",overflow:"hidden",alignItems:"flex-end",height:"18px",width:"100%"},title:{color:e.palette.text.primary,fontSize:"14px",lineHeight:"16px",fontWeight:500,letterSpacing:"0.24px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},chip:{display:"inline",marginLeft:"6px"}})));function If(){return If=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},If.apply(this,arguments)}const Nf=e=>{let{title:t="",chipLabel:r=0,onDelete:n,pathToTitle:a,onClick:i}=e;const o=_f(),l=Boolean(a&&a.length>2),s=l?vf:gd.Y,c=l?{pathToTitle:a}:{value:t};return v().createElement("div",{className:o.container,onClick:i},l&&v().createElement(vf,If({placement:"bottom-start"},c),v().createElement("div",{className:o.parent},a[a.length-2])),v().createElement("div",{className:o.titleContainer},v().createElement(s,If({placement:"bottom-start"},c),v().createElement("span",{className:o.title},t)),0!==r&&v().createElement("div",{className:o.chip},v().createElement(Rf,{label:r,onDelete:n}))))};function Df(){return Df=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Df.apply(this,arguments)}const Pf=(0,kp.Z)((()=>({facetContainer:{display:"flex",flexGrow:1,flexShrink:0,flexDirection:"column",padding:"0 16px",borderRadius:"1px",position:"relative",borderBottom:"solid 1px rgba(0,0,0, 0.33)","&:last-child":{borderBottom:"solid 1px rgb(255,255,255)"}},openedFacetContainer:{paddingBottom:"15px"},closedFacetContainer:{paddingBottom:"5px"},iconButton:{"&:first-child":{marginLeft:"-16px",height:24,width:24},visibility:"hidden"},recommendedIcon:{width:"18px",height:"18px",marginRight:"6px",flexShrink:0},titleContainer:{display:"flex",flexDirection:"row",flexShrink:0,alignItems:"center",height:"42px",borderRadius:"1px","&:hover $iconButton":{visibility:"visible"},marginLeft:"-16px",paddingLeft:"16px"},expandIcon:{transition:"transform .15s ease",margin:"0 2px",color:"rgba(0, 0, 0, 0.54)"},expanded:{transform:"rotate(180deg)"},"@keyframes animate":{from:{background:"#FFFBEB"},"66%":{background:"#FFFBEB"},"100%":{background:"transparent"}},highlighted:{animationName:"$animate",animationDuration:"3s",animationIterationCount:1}}))),kf=(0,yd.T)((e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",Df({width:"13",height:"18",viewBox:"0 0 13 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},r),v().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},v().createElement("g",null,v().createElement("g",null,v().createElement("g",null,v().createElement("g",{transform:"translate(-3 -1)"},v().createElement("g",null,v().createElement("path",{fill:"#FF4081",d:"M5.833 10h3.75v6.667l-3.75 1.666z"}),v().createElement("path",{fill:"#CE0C4E",d:"M13.333 10v8.333l-3.75-1.666V10z"})),v().createElement("circle",{fill:"#FFC058",cx:"9.583",cy:"7.917",r:"6.25"}),v().createElement("circle",{fill:"#FFCD7B",cx:"9.583",cy:"7.917",r:"5.417"}),v().createElement("path",{fill:"#FFFBB5",d:"M8.333 11.667L5 8.462l.933-.898 2.4 2.308L13.4 5l.933.897z"})))))))})),Lf=e=>{let{title:t,chipLabel:r,onDeleteChip:n,pathToTitle:a,onClose:i,children:o,isOpenByDefault:l=!0,isHighlighted:s=!1,isRecommended:c=!1}=e;const u=Pf(),[p,d]=(0,b.useState)(l),m=()=>{d(!p)};return v().createElement("div",{className:O()(u.facetContainer,{[u.openedFacetContainer]:p,[u.closedFacetContainer]:!p,[u.highlighted]:s}),"data-reltio-id":`search-facet-container-${t}`},v().createElement("div",{className:u.titleContainer},v().createElement(wd.k,{tooltipTitle:mi().text("Remove"),icon:_p(),onClick:i,className:u.iconButton,size:"XXS"}),c&&v().createElement(kf,{className:u.recommendedIcon,tooltipTitle:mi().text("Recommended"),showForDisabled:!0}),v().createElement(Nf,{title:t,pathToTitle:a,chipLabel:r,onDelete:n,onClick:m}),v().createElement($m,{onClick:m,isOpen:p,className:u.iconButton,size:"S",tooltipTitle:p?mi().text("Collapse attribute"):mi().text("Expand attribute"),tooltipPlacement:"bottom-end"})),p?o:null)},Uf=(0,kp.Z)((()=>({control:{minHeight:"40px",backgroundColor:"rgba(0, 0, 0, 0.03)",height:"auto",padding:0},valueContainer:{margin:"4px 6px"},placeholder:{color:"rgba(0,0,0,0.6)",fontSize:"13px",letterSpacing:0,lineHeight:"15px",left:"16px",bottom:"14px"},dropdownIndicator:{margin:"0px 2px 0px 0px"}}))),jf=e=>{let{config:t,data:r=[],filteredData:n,values:a=[],isHighlighted:i,isRecommended:o,onSearch:l=_.identity,onChange:s,onClose:c}=e;const u=Uf();return v().createElement(Lf,{title:t.title,pathToTitle:t.pathToTitle,onClose:c,chipLabel:a.length,onDeleteChip:()=>s([]),isHighlighted:i,isRecommended:o},v().createElement(df,{values:a,defaultOptions:r,filteredOptions:n,onChange:s,getSuggestions:l,isClearable:!1,showBar:!1,showNumberInValue:!0,classes:u,placeholder:mi().text("All values"),canLoadMore:!(0,za.tW)(t)}))};var Ff=r(19014),Mf=r(15608),Vf=r.n(Mf);const Bf=(0,kp.Z)((e=>({root:{borderRadius:4,padding:"15px 0"},rail:{backgroundColor:(0,Lm.alpha)(e.palette.primary.main,.12),borderRadius:4},thumb:{width:"14px",height:"14px",border:"1px solid #FFFFFF","&$focusVisible,&:hover":{boxShadow:`0px 0px 0px 9px ${(0,Lm.alpha)(e.palette.primary.main,.12)}`,"@media (hover: none)":{boxShadow:"none"}},"&$active":{boxShadow:`0px 0px 0px 9px ${(0,Lm.alpha)(e.palette.primary.main,.12)}`},"&::after":{left:-10,top:-10,right:-10,bottom:-10}},focusVisible:{},active:{},track:{borderRadius:4}}))),zf=(0,kp.Z)((e=>({tooltipPlacementTop:{margin:"3px 0"},tooltip:{color:"#FFFFFF",fontSize:"9px",letterSpacing:0,lineHeight:"10px",textAlign:"right",padding:"3px 4px",backgroundColor:e.palette.primary.main,borderRadius:"4px"}}))),Hf=e=>{let{children:t,open:r,value:n}=e;const a=zf();return v().createElement(gf(),{open:r,enterTouchDelay:0,placement:"top",title:n,classes:{tooltipPlacementTop:a.tooltipPlacementTop,tooltip:a.tooltip}},t)};function Yf(){return Yf=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Yf.apply(this,arguments)}Hf.propTypes={children:vp().element.isRequired,open:vp().bool.isRequired,value:vp().string.isRequired};const Wf=e=>{let{min:t,max:r,range:n,onChange:a,onAfterChange:i,className:o}=e,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["min","max","range","onChange","onAfterChange","className"]);const s=Bf();return v().createElement("div",{className:o},v().createElement(Vf(),Yf({min:t,max:r,value:n,classes:{root:s.root,rail:s.rail,track:s.track,thumb:s.thumb},onChange:(e,t)=>{a&&a(t)},onChangeCommitted:(e,t)=>{i&&i(t)},valueLabelDisplay:"auto","aria-labelledby":"range-slider",components:{ValueLabel:Hf},size:"small",component:"div"},l)))};Wf.propTypes={min:vp().oneOfType([vp().number,vp().string]).isRequired,max:vp().oneOfType([vp().number,vp().string]).isRequired,range:vp().array.isRequired,onChange:vp().func,onAfterChange:vp().func,className:vp().string};const Gf=Wf;var qf=r(18205),Zf=r(19406),$f=r(55484),Kf=r(25556),Xf=r(3131),Qf=r(27741),Jf=r(42400),eh=r(11011);const th=(0,kp.Z)((()=>({tooltip:{borderRadius:"1px",backgroundColor:"rgba(97,97,97,0.9)",padding:"8px"},number:{color:"#FFFFFF",fontSize:"11px",fontWeight:500,letterSpacing:0,lineHeight:"13px"},value:{opacity:.7,color:"#FFFFFF",fontSize:"10px",letterSpacing:0,lineHeight:"11px",marginTop:"4px"}}))),rh=e=>{let{payload:t,formatter:r,active:n}=e;const a=th();if(n){const{payload:{label:e},value:n}=t[0];return v().createElement("div",{className:a.tooltip},v().createElement("div",{className:a.number},r(n)),v().createElement("div",{className:a.value},e))}return null},nh=(0,kp.Z)((()=>({barChart:{"& text":{stroke:"none",fill:"rgba(0, 0, 0, 0.54)",textAnchor:"end"},"& .recharts-yAxis":{fontSize:"10px",fill:"rgba(0, 0, 0, 0.54)",textAnchor:"end"},"& .recharts-xAxis .recharts-cartesian-axis-tick:first-child text":{fontSize:"10px",fill:"rgba(0, 0, 0, 0.54)",textAnchor:"start"},"& .recharts-xAxis .recharts-cartesian-axis-tick:last-child text":{fontSize:"10px",fill:"rgba(0, 0, 0, 0.54)",textAnchor:"end"},"& .recharts-cartesian-axis-line":{stroke:"rgba(0, 0, 0, 0.54)"}}})));function ah(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ih=e=>{let{data:t=[],range:r=[],domain:n,color:a=x.theme.palette.primary.main,tickFormatterX:i,tickFormatterY:o}=e;const l=nh(),[s,c]=(0,b.useState)(null),u=(e,t)=>(s===t?.2:0)+((e=>{let{value:t}=e;return t[0]>=r[0]&&t[1]<=r[1]})(e)?.6:.2),p=t.map(((e,t,r)=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ah(e,t,r[t])}))}return e}({},e,{value:t<r.length-1?e.value[0]:e.value[1]}))),d=e=>{e.isTooltipActive?c(e.activeTooltipIndex):c(null)};return v().createElement(qf.h,null,v().createElement(Zf.v,{data:p,margin:{top:12,right:0,left:0,bottom:0},onMouseEnter:d,onMouseLeave:d,onMouseMove:d,className:l.barChart},v().createElement($f.q,{vertical:!1,stroke:"#f2f2f2"}),v().createElement(Kf.K,{dataKey:"value",interval:0,padding:{left:4,right:4},height:15,tickLine:!1,ticks:n,tick:e=>{const{x:t,y:r,index:n,payload:{value:a,offset:o}}=e;return v().createElement("text",{x:0===n?t-o:t+o,y:r+4,textAnchor:0===n?"start":"end"},`${i(a)}`)}}),v().createElement(Xf.B,{width:38,domain:[0,"auto"],axisLine:!1,tickLine:!1,tickSize:0,tickMargin:4,tickCount:6,tickFormatter:o}),v().createElement(Qf.u,{cursor:{fill:"rgb(255,255,255)"},content:v().createElement(rh,{formatter:o}),isAnimationActive:!1}),v().createElement(Jf.$,{dataKey:"number",isAnimationActive:!1},t.map(((e,t)=>v().createElement(eh.b,{key:`cell-${t}`,fill:a,fillOpacity:u(e,t)}))))))},oh="NumericRangeFacet-styles-numberEditorInputRoot--djW3k",lh="NumericRangeFacet-styles-numberEditorRoot--DVXqx",sh="NumericRangeFacet-styles-input--Nl2tx";function ch(){return ch=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ch.apply(this,arguments)}class uh extends b.PureComponent{constructor(){super(...arguments),this.state={range:[],data:[],values:[],lowerBound:0,upperBound:0},this.handleOnChangeValue=e=>{if(!this.props.onChange)return;const{data:t,values:r}=this.props,{rangeService:n}=this.state,[a,i]=n.getBarDomain(t),o=n.adjustRange(e,a,i);0!==r.length&&n.equals(o[0],(0,_.path)([0,0],r))&&n.equals(o[1],(0,_.path)([0,1],r))||this.props.onChange([o])},this.onLowerBoundChanged=e=>{const{range:t,NumMath:r,isFloating:n}=this.state;this.setState({lowerBound:n?e:r.toFixed(e,0)},(()=>{const a=(0,_.head)(this.props.data).value[0],i=""===e||isNaN(e)?a:e,o=r.clamp(a,t[1],n?i:r.floor(i));this.setState((e=>({lowerBound:o.toString(),range:[o,e.range[1]]}))),this.handleOnChangeValue([o,t[1]])}))},this.onUpperBoundChanged=e=>{const{range:t,NumMath:r,isFloating:n}=this.state;this.setState({upperBound:n?e:r.toFixed(e,0)},(()=>{const a=(0,_.last)(this.props.data).value[1],i=""===e||isNaN(e)?a:e,o=r.clamp(t[0],a,n?i:r.ceil(i));this.setState((e=>({upperBound:o.toString(),range:[e.range[0],o]}))),this.handleOnChangeValue([t[0],o])}))},this.onChangeRange=e=>{const{isFloating:t,NumMath:r}=this.state,n=e.map((e=>t?e:r.toFixed(this.revertScale(e),0)));this.setState({range:n,lowerBound:n[0],upperBound:n[1]})},this.onRevertedChange=e=>{const{isFloating:t,NumMath:r}=this.state,n=e.map((e=>t?e:r.toFixed(this.revertScale(e),0)));this.handleOnChangeValue(n)},this.applyScale=e=>{const{isScaled:t,scale:r,rangeService:n}=this.state;return t?n.applyScale(e,r):e},this.revertScale=e=>{const{isScaled:t,scale:r,rangeService:n}=this.state;return t?n.revertScale(e,r):e},this.onFocus=e=>e.target.select()}static getDerivedStateFromProps(e,t){if(e.data!==t.data||e.values!==t.values){const{config:t,values:r,data:n}=e,a=t.attrType&&t.attrType.type,i="Long"===a,o=(0,Vl.C)(a),l=(0,ci.Oz)(a),s=o.getRange(r,n);return{range:s,data:n,values:r,lowerBound:s.length>0?s[0].toString():0,upperBound:s.length>0?s[1].toString():0,NumMath:l,rangeService:o,isScaled:i,isFloating:(0,x.isFloatingType)(a),scale:n.length>0?o.calcScale(...o.getBarDomain(n)):{ratio:1,offset:0}}}return null}render(){const{config:e,data:t,isHighlighted:r,isRecommended:n,onClose:a,numberFormat:i}=this.props,{isScaled:o,scale:l,range:s,lowerBound:c,upperBound:u,rangeService:p,isFloating:d}=this.state,m=o?p.bigNumbersTickFormatterX(p.formatNumberForRangeFacet,l):p.formatNumberForRangeFacet,g=t.map((e=>({value:e.value.map(this.applyScale),label:e.value.map(p.formatNumberForRangeFacet).join(" - "),number:e.number}))),y=s.map((e=>+this.applyScale(e))),[f,h]=p.getBarDomain(t).map((e=>this.applyScale(e)));return v().createElement(Lf,{title:e.title,pathToTitle:e.pathToTitle,onClose:a,isHighlighted:r,isRecommended:n},v().createElement("div",{className:"NumericRangeFacet-styles-data--kL9q5"},g.length>0?v().createElement(v().Fragment,null,v().createElement("div",{className:"NumericRangeFacet-styles-barChartContainer--t9NkG","data-reltio-id":"search-bar-chart-with-selection"},v().createElement(ih,{data:g,range:y,tickFormatterX:m,tickFormatterY:p.formatNumberForRangeFacet,domain:[f,h]})),v().createElement(Gf,{min:f,max:h,range:y,onAfterChange:this.onRevertedChange,onChange:this.onChangeRange,className:"NumericRangeFacet-styles-slider--XbmKe",valueLabelFormat:m,step:d?(h-f)/200:1}),v().createElement("div",{className:"NumericRangeFacet-styles-inputsContainer--mU0_m"},v().createElement(Ff.c,{value:c,onChange:this.onLowerBoundChanged,onFocus:this.onFocus,integer:!d,format:i,variant:"filled",classes:{root:lh},InputProps:{classes:{root:oh,input:sh}}}),v().createElement(Ff.c,{value:u,onChange:this.onUpperBoundChanged,onFocus:this.onFocus,integer:!d,format:i,variant:"filled",classes:{root:lh},InputProps:{classes:{root:oh,input:sh}}}))):v().createElement(yy.K,{variant:"noData"})))}}uh.propTypes={data:vp().array,values:vp().array,config:vp().object,isHighlighted:vp().bool,isRecommended:vp().bool,onClose:vp().func,onChange:vp().func,numberFormat:vp().shape({decimalSeparator:vp().string,thousandSeparator:vp().string,prefix:vp().string,suffix:vp().string,decimalScale:vp().number})},uh.defaultProps={config:{},data:[],values:[]};const ph=(0,Tp.connect)((e=>({numberFormat:k().selectors.getUiNumberFormat(e)})))((e=>{const t=t=>{let{config:r,values:n,data:a,onChange:i,numberFormat:o}=t,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(t,["config","values","data","onChange","numberFormat"]);const s=(0,Tp.useSelector)(k().selectors.getAttributesPresentation),{strategy:c}=(0,x.getNumberFormat)((0,x.getAttrDataTypeDefinition)(r.attrType),s,x.intl.getLocale()),u=(0,b.useMemo)((()=>null==a?void 0:a.map((0,_.evolve)({value:(0,_.map)((0,x.applyPresentationStrategyToValue)(c))}))),[a,c]),p=(0,b.useMemo)((()=>null==n?void 0:n.map((0,x.mapFilterValue)((0,x.applyPresentationStrategyToValue)(c)))),[n,c]),d=(0,b.useCallback)((e=>{const t=null==e?void 0:e.map((0,x.mapFilterValue)((0,x.revertPresentationStrategyForValue)(c)));i(t)}),[c,i]);return v().createElement(e,ch({data:u,values:p,onChange:d,config:r,numberFormat:o&&(0,_.omit)(["strategy",o])},l))};return t.displayName="WithCustomizedData",t})(uh));var dh=r(21669);const mh=(0,kp.Z)((()=>({container:{display:"flex",flexGrow:1,whiteSpace:"nowrap",cursor:"default",width:"100%"},dateEditor:{margin:0,width:"50%",whiteSpace:"normal","&:first-child":{marginRight:"4px"},"& .MuiInputAdornment-root":{paddingRight:0}}})));function gh(){return gh=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gh.apply(this,arguments)}const yh=(e,t)=>(0,_.pathOr)(null,[t],e),fh=e=>e&&new Date(e),hh=e=>e&&e.getTime(),Eh=e=>{let{values:t,minDate:r,maxDate:n,onChange:a}=e;const[i,o]=(0,b.useState)(null),[l,s]=(0,b.useState)(null),c=(0,b.useRef)((0,Ke.x0)()),u=(0,b.useRef)((0,Ke.x0)()),p=mh();v().useEffect((()=>{o(yh(t,0)),s(yh(t,1))}),[t]);const d=(e,t)=>{(0,_.isNil)(e)||(0,_.isNil)(t)||a(e>t?[[t,e]]:[[e,t]])},m={minDate:fh(r),maxDate:fh(n)};return v().createElement("div",{className:p.container},v().createElement(dh.Q,gh({label:mi().text("Start Date"),value:fh(i),onChange:e=>{const t=hh(e);o(t),d(t,l)},slotProps:{textField:{id:c.current,className:p.dateEditor}}},m)),v().createElement(dh.Q,gh({label:mi().text("End Date"),value:fh(l),onChange:e=>{const t=hh(e);s(t),d(i,t)},slotProps:{textField:{id:u.current,className:p.dateEditor},popper:{placement:"bottom-end"}}},m)))};function bh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const vh=e=>t=>e===x.DataTypes.TYPE_DATE?x.utils.dates.toLocalDate(t).getTime():t,Th=(0,kp.Z)({barChartContainer:{position:"relative",height:"190px",paddingTop:"6px",width:"100%",overflow:"hidden"},dateRangeChooserWrapper:{display:"flex",flexDirection:"column",alignItems:"center",marginTop:"12px",width:"100%"}}),Oh=(0,Vl.C)(),xh=e=>{let{data:t=[],values:r=[],config:n,onChange:a,isHighlighted:i,isRecommended:o,onClose:l}=e;const s=Th(),c=(0,_.path)(["attrType","type"],n),u=(0,b.useCallback)((e=>{const n=e.map((0,x.mapFilterValue)((i=c,e=>i===x.DataTypes.TYPE_DATE?x.utils.dates.toUtcDate(e).getTime():e)));var i;if(!(0,_.equals)(r,n)){const[e,r]=Oh.getBarDomain(t),i=c===x.DataTypes.TYPE_DATE,o=n.map((e=>[x.utils.dates.getStartOfDay(e[0],i),x.utils.dates.getEndOfDay(e[1],i)])),l=Oh.getRange(o,t);a([l.length?l:[e,r]])}}),[t,a,c,r]),p=(0,b.useMemo)((()=>{return t.map((e=c,t=>{if(Array.isArray(t.value)){const r=t.value.map(vh(e));return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){bh(e,t,r[t])}))}return e}({},t,{value:r,label:r.map(x.formatDate).join(" - ")})}}));var e}),[t,c]),[d,m]=(0,b.useMemo)((()=>[Oh.getBarDomain(p),Oh.getRange(r.map((0,x.mapFilterValue)(vh(c))),p)]),[p,c,r]);return v().createElement(Lf,{title:n.title,pathToTitle:n.pathToTitle,onClose:l,isHighlighted:i,isRecommended:o},t.length>0?v().createElement(v().Fragment,null,v().createElement("div",{className:s.barChartContainer},v().createElement(ih,{data:p,range:m,tickFormatterX:x.formatDate,tickFormatterY:Oh.formatNumberForRangeFacet,domain:d})),v().createElement("div",{className:s.dateRangeChooserWrapper},v().createElement(Eh,{values:m,onChange:u}))):v().createElement(yy.K,{variant:"noData"}))};function Ch(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class Sh{static getWidget(e){switch(e.type){case x.FACET_TYPES.ENTITY_TYPE_FACET:return Ay;case x.FACET_TYPES.WITH_DROPDOWN_CHECKBOXES_FACET:return jf;case x.FACET_TYPES.NUMERIC_RANGE_FACET:return ph;case x.FACET_TYPES.DATE_RANGE_FACET:return xh;default:return null}}static build(e){const t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ch(e,t,r[t])}))}return e}({},Sh.getDefaultConfig(),e),r=Sh.getWidget(t);return r?(e=>{const r=sy(e,t);return Sh.connectData(r,t)})(r):null}}Sh.getDefaultConfig=()=>({autofocus:!1,showDeleteButton:!0}),Sh.connectData=(e,t)=>(0,Tp.connect)((e=>({data:(0,D.X7)(t,e),values:(0,D.N1)(t,e),filteredData:(0,D.VP)(t,e),isHighlighted:(0,D.$t)(t.fieldName,e),isRecommended:(0,D.TH)(t.fieldName,e)})))(e);var wh=r(64927),Ah=r.n(wh),Rh=r(73707),_h=r.n(Rh),Ih=r(93463),Nh=r.n(Ih);const Dh=(0,kp.Z)((()=>({tenantFacet:{flexShrink:0},radioGroup:{padding:"0 15px 10px 20px",overflow:"hidden"},radioLabelRoot:{overflow:"hidden"},radioLabel:{paddingLeft:"12px",fontSize:"13px",lineHeight:"16px",overflowWrap:"break-word",wordWrap:"break-word",overflow:"hidden"},radioButton:{padding:"0 9px"},tenantContainer:{display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%",marginBottom:"5px"},total:{color:"rgba(0,0,0,0.6)",fontSize:"13px",lineHeight:"16px"}})));var Ph=r(44244);const kh=e=>{let{tenantObject:t,isDataTenant:r,className:n}=e;const a=(e=>{let{tenantObject:t,isDataTenant:r}=e;const n=(0,Ph._)(),[a,i]=(0,b.useState)(0),o=(0,Tp.useSelector)(k().selectors.getGlobalSearchRequestOptions),l=r?t:null,s=(0,Tp.useSelector)((e=>(0,ui.E2)(e,[],l))),c=JSON.stringify((0,Ba.Vg)(s,[],o)),u=(0,Tp.useSelector)(k().selectors.getDtssPath),p=(0,Tp.useSelector)(k().selectors.getTenant);return(0,b.useEffect)((()=>{n((0,Ba.Es)({url:K.jS,options:{method:"POST",body:c},customerTenant:p,dataTenant:(0,_.prop)("id",l),dtssPath:u})).then((e=>{let{total:t}=e;i(t)})).catch((e=>{console.warn(e)}))}),[l,p,u,c]),a})({tenantObject:t,isDataTenant:r});return v().createElement("div",{className:n},(0,ci.k7)(a))};kh.propTypes={className:vp().string,tenantObject:vp().object.isRequired,isDataTenant:vp().bool};const Lh=kh;function Uh(){return Uh=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Uh.apply(this,arguments)}const jh={changeCurrentTenant:e=>{let{tenantObject:t,isDataTenant:r}=e;return{type:U.Z.CHANGE_CURRENT_TENANT,payload:{tenantObject:t,isDataTenant:r}}}},Fh=(0,Tp.connect)((e=>({dataTenants:k().selectors.getDataTenants(e),customerTenantObject:k().selectors.getTenantObject(e),currentTenant:(0,ui.RO)(e),openAdvancedSearch:(0,ki.IJ)(e)})),jh)((e=>{let{customerTenantObject:t,currentTenant:r,dataTenants:n,changeCurrentTenant:a,openAdvancedSearch:i}=e;const o=Dh(),l=(0,_.pipe)((0,_.map)((e=>{let{id:t,label:r}=e;return{value:t,label:r}})),(0,_.prepend)({value:t.id,label:t.name}))(n),s=e=>{const r=e!==t.id;return{isDataTenant:r,tenantObject:r?n.find((0,_.propEq)("id",e)):t}},c=r||t.id;return v().createElement("div",{className:o.tenantFacet},v().createElement(Vg,{title:mi().text("Tenants"),hasCollapseButton:!1}),v().createElement(_h(),{className:o.radioGroup,value:c,onChange:(0,_.pipe)(Dp.NA,s,a)},l.map((e=>{let{value:t,label:r}=e;return v().createElement("div",{className:o.tenantContainer,key:t},v().createElement(Nh(),{classes:{root:o.radioLabelRoot,label:o.radioLabel},value:t,label:r||t,control:v().createElement(Ah(),{className:o.radioButton,color:"primary"})}),!i&&v().createElement(Lh,Uh({className:o.total},s(t))))}))))})),Mh=(0,kp.Z)({root:{display:"flex",flexShrink:0,flexDirection:"row",overflow:"hidden",alignItems:"center",marginBottom:"4px"},labelRoot:{fontSize:"13px",paddingLeft:"3px",cursor:"pointer",letterSpacing:"normal",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",marginRight:"16px"},checkboxRoot:{padding:"0",margin:"0 18px"},checkboxRootQueryGroups:{marginRight:9}}),Vh=e=>{let{variant:t="facetsPanel",searchOptions:r={},dispatch:n}=e;const{root:a,labelRoot:i,checkboxRoot:o,checkboxRootQueryGroups:l}=Mh(),s=r.searchByOv,c=(0,b.useCallback)((()=>{n(P.search.actions.updateSearchOptions({searchByOv:!s,ovOnly:!s}))}),[s,n]),u=mi().text("Search by OV only");return v().createElement("div",{className:a,onClick:c},v().createElement(Jp(),{classes:{root:O()(o,{[l]:"queryGroups"===t})},checked:s,color:"primary"}),v().createElement(gd.Y,{value:u},v().createElement(Ag(),{variant:"body2",classes:{root:i}},u)))};Vh.propTypes={searchOptions:vp().shape({searchByOv:vp().bool,ovOnly:vp().bool}),variant:vp().oneOf(["facetsPanel","queryGroups"]),dispatch:vp().func};const Bh=(0,Tp.connect)((e=>({searchOptions:k().selectors.getSearchOptions(e)})))(Vh),zh=(0,kp.Z)({root:{display:"flex",flexDirection:"column",overflow:"auto",height:"100%"}});function Hh(){return Hh=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Hh.apply(this,arguments)}const Yh=(0,x.memoizeWith)((e=>e.fieldName),Sh.build),Wh=e=>{let{group:t,configs:r}=e;return v().createElement(oy,Hh({},t,{key:t.title}),(e=>e.map((e=>({Facet:Yh(e),id:e.fieldName}))).filter((e=>{let{Facet:t}=e;return t})).map((e=>{let{Facet:t,id:r}=e;return v().createElement(t,{key:r})})))(r))},Gh=(0,Tp.connect)((e=>{var t;const r=k().selectors.getDataTenants(e);return{metadata:k().selectors.getMetadata(e),facetsConfigs:(0,D.Mp)(e),uiConfigShowSearchByOv:null!==(t=k().selectors.getShowSearchByOv(e))&&void 0!==t?t:(0,ki.cC)(e),showTenantFacet:r&&r.length>0,tenant:k().selectors.getTenant(e)}}))((e=>{let{facetsConfigs:t=[],metadata:r,onScroll:n,uiConfigShowSearchByOv:a,showTenantFacet:i}=e;const{root:o}=zh(),l=(0,b.useRef)(null),s=(0,b.useCallback)((e=>{n(l.current.scrollTop,e)}),[n]),c=((e,t)=>{const[r,n]=(0,_.partition)(x.isTypeFacet,t),a=[{group:{title:mi().text("Entity types"),hasCollapseButton:!1},configs:r},{group:{title:mi().text("Attributes"),hasCollapseButton:!1,hasSearchAttributesField:!0},configs:n}];return Fg(a)})(0,t),u=(0,_.head)(c),p=(0,_.tail)(c),d=l.current,m=(0,b.useMemo)((()=>({element:d,priority:["top","bottom"]})),[d]);return v().createElement("div",{ref:l,className:o,onScroll:s},v().createElement(Ug.p.Provider,{value:m},a&&v().createElement(Bh,null),i&&v().createElement(v().Fragment,null,v().createElement(Fh,null),v().createElement(Lg(),null)),u&&Wh(u),v().createElement(Lg(),null),p.map(((e,t)=>v().createElement(Wh,Hh({},e,{key:t}))))))})),qh=e=>{let{children:t,className:r}=e;return v().createElement("div",{className:O()("MainContent-styles-mainContent--Ha5me",r)},t)};qh.propTypes={children:vp().node,className:vp().string};const Zh=qh;var $h=r(33788);const Kh=(0,kp.Z)({container:{backgroundColor:"#fff",opacity:.37,position:"fixed",width:"100%",height:"100%",top:0,left:0,display:"flex",justifyContent:"center",alignItems:"center"}}),Xh=()=>{const e=(0,Tp.useSelector)(ki.Kv),{container:t}=Kh();return e?v().createElement("div",{className:t},v().createElement($h.Z,{size:160})):null};var Qh=r(54596),Jh=r.n(Qh),eE=r(49233),tE=r.n(eE),rE=r(35206),nE=r.n(rE),aE=r(81733),iE=r.n(aE),oE=r(68290),lE=r.n(oE);const sE=(0,kp.Z)((e=>({snackbar:{display:"flex",flexWrap:"nowrap",backgroundColor:"rgba(0,0,0,0.87)",boxShadow:"0 2px 4px 0 rgba(0,0,0,0.25)",padding:"8px 16px",minHeight:"48px","&:after":{content:'""',minHeight:"inherit",fontSize:0}},anchorSnackBar:{zIndex:11e3,"@media (min-width: 960px)":{bottom:8}},message:{color:"#FFFFFF",fontSize:14,fontWeight:500,lineHeight:"16px",display:"flex",alignItems:"center",flex:1},messageContent:{display:"flex",alignItems:"center",whiteSpace:"pre"},icon:{opacity:.9,marginRight:"12px"},[K.GT.error]:{backgroundColor:e.palette.error.dark}})));function cE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const uE=()=>{const e=(0,Tp.useDispatch)(),t=(0,Tp.useSelector)(ki.v6),r=(0,Tp.useSelector)(k().selectors.getAutoCloseInterval),n=t&&t.payload.autoHideDuration||r&&1e3*r||5e3,a=sE(),i=(0,b.useRef)(null),o=(0,b.useCallback)((()=>{e(Ai())}),[e]);t&&(i.current=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){cE(e,t,r[t])}))}return e}({},t));const{type:l,payload:s}=i.current||{},{message:c,action:u}=s||{},p=u&&u.actionToDispatch,d=(0,b.useCallback)((()=>{p&&e(p)}),[p,e]),m=(0,b.useMemo)((()=>l===K.GT.error?v().createElement(tE(),{key:"close","aria-label":"Close",color:"inherit",className:a.close,onClick:d,size:"large"},v().createElement(_p(),null)):u?v().createElement(nE(),{color:"primary",size:"small",onClick:d},u.actionLabel):null),[a,l,u,d]);return v().createElement(iE(),{container:document.body},v().createElement(Jh(),{key:c+l,anchorOrigin:{vertical:"bottom",horizontal:"center"},autoHideDuration:n,open:Boolean(t),onClose:o,ContentProps:{classes:{root:O()(a.snackbar,a[l]),message:a.message}},message:v().createElement("div",{className:a.messageContent},l===K.GT.error&&v().createElement(lE(),{className:a.icon}),c),classes:{anchorOriginBottomCenter:a.anchorSnackBar},action:m}))},pE=(0,kp.Z)((()=>({resizablePanesWrapper:{flex:"1 0 0px"},pane:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",flexDirection:"column",overflow:"hidden"},divider:{height:"1px"}})));var dE=r(31396);const mE=(0,kp.Z)((()=>({container:{position:"relative","& .Resizer":{zIndex:1,boxSizing:"border-box",backgroundClip:"padding-box","&.disabled":{cursor:"initial",height:0,margin:0},"&.horizontal":{height:"11px",backgroundImage:"linear-gradient(rgba(0,0,0,0.33), rgba(0,0,0,0.33))",backgroundRepeat:"no-repeat",backgroundSize:"100% 1px",backgroundPosition:"top",width:"100%",marginBottom:"-10px","&.disabled":{background:"transparent"},"&:not(.disabled):hover":{cursor:"row-resize",backgroundImage:"linear-gradient(rgba(0, 114, 206, 0), rgba(0, 114, 206, 0.35), rgba(0, 114, 206, 1))",backgroundSize:"100% 3px"}},"&.vertical":{width:"11px",backgroundImage:"linear-gradient(rgba(0,0,0,0.33), rgba(0,0,0,0.33))",backgroundRepeat:"no-repeat",backgroundSize:"1px 100%",backgroundPosition:"left",height:"100%",marginRight:"-10px","&:not(.disabled):hover":{cursor:"col-resize",backgroundImage:"linear-gradient(to left, rgba(0, 114, 206, 0.35), rgba(0, 114, 206, 1), rgba(0, 114, 206, 0.35))",backgroundSize:"3px 100%"}}}}}))),gE=250,yE=e=>"horizontal"===e,fE=e=>{let{className:t,children:r,orientation:n,primary:a,defaultSize:i,size:o,minSize:l,maxSize:s,allowResize:c,debounceInterval:u=gE,onChange:p}=e;const d=mE(),m=(0,Lm.useTheme)(),[g,y]=(0,b.useState)(null),[f,h]=(0,b.useState)(!0),E=(0,b.useCallback)((()=>h(!0)),[]),T=(0,b.useCallback)((()=>h(!1)),[]),C=()=>yE(n)?null==g?void 0:g.clientHeight:null==g?void 0:g.clientWidth,S=(0,b.useCallback)((0,x.debounce)((e=>{const t=C();p({percentageSize:e/t*100+"%",isMaxSize:+s>0?e===s:e===t+s,isMinSize:e===l,size:e})}),u),[p,n,s,g]),w=(0,b.useMemo)((()=>({transition:m.transitions.create(yE(n)?"height":"width",{easing:m.transitions.easing.sharp,duration:m.transitions.duration.leavingScreen})})),[n,m]);return"number"==typeof o&&o<0&&(o=(C()||0)+o),v().createElement("div",{ref:y,className:O()(d.container,t)},v().createElement(dE.Z,{split:n,size:o,primary:a,allowResize:c,onChange:S,defaultSize:i,minSize:l,maxSize:s,onDragStarted:T,onDragFinished:E,pane1Style:f?w:void 0},r))};fE.displayName="ResizablePanes";const hE=(0,kp.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 7px",borderRadius:"2px",fontSize:"13px",fontWeight:500,lineHeight:"16px",marginRight:"16px",flexShrink:0}}),EE=e=>{let{entity:t,className:r,size:n="small"}=e;const a=hE(),i=(0,w.AH)(),o=(0,x.getEntityType)(i,t.type),l=(o?(0,x.getPropWithInheritance)(i,o,"typeColor"):null)||x.theme.palette.primary.main,s=(0,x.getEntityTypeLabel)(i,t);return v().createElement(gd.Y,{value:s,placement:"top"},v().createElement(Ag(),{style:{backgroundColor:l,color:x.utils.Colors.getColor(l)?"#FFFFFF":"#212121"},className:O()(a[`entityType-${n}`],a["entityType-overflow"],r),component:"div"},s))},bE=e=>e&&e.scrollIntoView({block:"end",behavior:"smooth"}),vE=e=>{e&&clearTimeout(e)},TE=(e,t)=>{if(e&&t){const r=e.offsetTop,n=e.offsetTop+e.clientHeight,{clientHeight:a,scrollTop:i}=t;return r>=0&&n>i&&n<i+a}};var OE=r(600);const xE=(0,kp.Z)((e=>({"@keyframes animate":{from:{background:"transparent"},"66%":{background:"#f2e68e"},"100%":{background:"transparent"}},highlighted:{animationName:"$animate",animationDuration:"3s",animationIterationCount:1},item:{display:"flex",minHeight:"40px",borderBottom:"1px solid rgba(0, 0, 0, 0.1)",flexDirection:"row","&:after":{content:"",minHeight:"inherit",fontSize:0},"&:hover":{backgroundColor:"rgba(0, 0, 0, 0.03)"}},clickable:{cursor:"pointer"},selected:{background:(0,Lm.alpha)(e.palette.primary.main,.12),"&:hover":{background:(0,Lm.alpha)(e.palette.primary.main,.24)}},inactive:{background:e.inactiveBackground,"&:hover":{background:e.inactiveHoverBackground},"&$selected":{background:e.inactiveSelectedBackground,"&:hover":{background:e.inactiveSelectedHoverBackground}}},justImported:{backgroundColor:"#FFFBEB !important"},avatar:{marginLeft:"20px"},image:{height:"32px",width:"32px",marginTop:"8px",marginBottom:"7px"},info:{marginLeft:"20px",flexGrow:1,display:"flex",flexDirection:"column",justifyContent:"center",fontSize:"13px",width:"100%",overflow:"hidden",overflowWrap:"break-word",wordWrap:"break-word"},label:{fontSize:"13px",lineHeight:"15px",fontWeight:500,color:e.palette.primary.main,marginRight:"17px",textDecoration:"none"},secondaryLabel:{marginRight:"12px"},businessCard:{color:"rgba(0, 0, 0, 0.54)"},secondRow:{display:"flex",marginTop:"2px",alignItems:"center",color:"rgba(0, 0, 0, 0.54)",fontSize:"12px"}}))),CE=e=>{let{entities:t,entityToHighlight:r,selectedEntityUri:n,onEntityClick:a,onEntityHover:i,entitiesImportStatus:o,entityButtonsRenderer:l}=e;const s=xE(),c=(0,b.useRef)(null),u=(0,b.useRef)(null),p=(0,w.AH)();return(0,OE.D)((()=>{if(r){var e;const n=null===(e=c.current)||void 0===e?void 0:e.querySelectorAll(`[data-entity-uri='${r}']`);if(vE(u.current),(null==n?void 0:n.length)>0){var t;const e=null===(t=c.current)||void 0===t?void 0:t.parentElement;TE(n[0],e)||(bE(n[0]),u.current=setTimeout((()=>{TE(n[0],e)||bE(n[0])}),1e3))}}return()=>{vE(u.current)}}),[r]),v().createElement("div",{ref:c},(t||[]).map((e=>{const t=(0,x.getLabel)(e.label),c=e.secondaryLabel,u=(0,x.getBusinessCardAttributesText)(p,e),d=(0,x.isActiveObject)(e),m=e.uri,g=(0,x.getEntityUriForLink)(e),y=(0,_.prop)(m,o);return v().createElement("div",{key:m,className:O()(s.item,{[s.clickable]:!!a,[s.selected]:m===n,[s.highlighted]:m===r,[s.inactive]:!d,[s.justImported]:y===bm.Eh.Success}),onClick:a?()=>a(m):void 0,onMouseEnter:i?()=>i(m):void 0,onMouseLeave:i?()=>i(null):void 0,"data-entity-uri":m},v().createElement(A,{entity:e,avatarClassName:s.avatar,imageClassName:s.image}),v().createElement("div",{className:s.info},v().createElement("div",null,v().createElement(qd,{value:g,className:s.label},t),c&&v().createElement("span",{className:s.secondaryLabel},c," "),u&&v().createElement("span",{className:s.businessCard},u)),v().createElement("div",{className:s.secondRow},v().createElement(EE,{entity:e}),v().createElement("div",null,(0,x.getEntityId)(e)))),l&&l(e))})))};var SE=r(92255);function wE(){return wE=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},wE.apply(this,arguments)}function AE(){return AE=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},AE.apply(this,arguments)}function RE(){return RE=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},RE.apply(this,arguments)}function _E(){return _E=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},_E.apply(this,arguments)}const IE=(0,kp.Z)((e=>({root:{display:"flex",flex:"1 1 auto",flexWrap:"nowrap",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"10px",overflow:"auto",height:"100%",minHeight:"350px",boxSizing:"border-box","&$root_small":{minHeight:"160px"},"& $text":{color:e.palette.text.primary,fontSize:"20px",fontWeight:500,lineHeight:"24px",letterSpacing:"0.25px",textAlign:"center"},"& $secondaryText":{color:e.palette.text.secondary,fontSize:"15px",fontWeight:300,lineHeight:"18px",letterSpacing:"0.11px",textAlign:"center",paddingTop:"3px"}},root_small:{},embedded:{flexShrink:0,width:"190px",height:"190px",padding:"8px"},full:{width:"256px",height:"256px"},textBox:{display:"flex",flexDirection:"column",alignItems:"center",maxWidth:500,marginTop:"16px"},text:{},secondaryText:{},button:{minHeight:36,minWidth:64,maxWidth:500,padding:"10px 16px",borderRadius:"2px",boxShadow:"0 0 2px 0 rgba(0,0,0,0.12), 0 2px 2px 0 rgba(0,0,0,0.24), 0 0 8px 0 rgba(0,0,0,0.12), 0 8px 8px 0 rgba(0,0,0,0.24)",fontSize:"14px",fontWeight:500,lineHeight:"16px",marginTop:"24px"}})));function NE(){return NE=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},NE.apply(this,arguments)}let DE=function(e){return e.full="full",e.embedded="embedded",e.small="small",e}({});const PE={SEARCH_RESULTS:e=>v().createElement("svg",wE({width:256,height:256,viewBox:"0 0 256 256",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","data-reltio-id":"SvgEmptySearchResults"},e),v().createElement("defs",null,v().createElement("radialGradient",{cx:"50%",cy:"100%",fx:"50%",fy:"100%",r:"81.681%",gradientTransform:"matrix(.98998 0 0 .612 .005 .388)",id:"EmptySearchResults_svg__c"},v().createElement("stop",{stopColor:"#00BFFF",stopOpacity:.5,offset:"0%"}),v().createElement("stop",{stopColor:"#9EE8FF",stopOpacity:0,offset:"100%"})),v().createElement("radialGradient",{cx:"50%",cy:"111.651%",fx:"50%",fy:"111.651%",r:"87.693%",gradientTransform:"matrix(0 -.97693 .7263 0 -.31 1.605)",id:"EmptySearchResults_svg__f"},v().createElement("stop",{stopColor:"#91F8E5",stopOpacity:.6,offset:"0%"}),v().createElement("stop",{stopColor:"#14F7FF",stopOpacity:0,offset:"100%"})),v().createElement("radialGradient",{cx:"50%",cy:"103.659%",fx:"50%",fy:"103.659%",r:"90.207%",gradientTransform:"matrix(0 -1 2.23905 0 -1.821 1.537)",id:"EmptySearchResults_svg__g"},v().createElement("stop",{stopColor:"#FFF",offset:"0%"}),v().createElement("stop",{stopColor:"#73FAFF",stopOpacity:.21,offset:"59.38%"}),v().createElement("stop",{stopColor:"#14F7FF",stopOpacity:0,offset:"100%"})),v().createElement("linearGradient",{x1:"50%",y1:"170.771%",x2:"50%",y2:"10.303%",id:"EmptySearchResults_svg__e"},v().createElement("stop",{stopColor:"#91F8E5",offset:"0%"}),v().createElement("stop",{stopColor:"#99FCFF",stopOpacity:0,offset:"100%"})),v().createElement("filter",{x:"-25.9%",y:"-26.2%",width:"151.8%",height:"152.3%",filterUnits:"objectBoundingBox",id:"EmptySearchResults_svg__d"},v().createElement("feGaussianBlur",{stdDeviation:15,in:"SourceGraphic"})),v().createElement("circle",{id:"EmptySearchResults_svg__a",cx:128,cy:128,r:128})),v().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},v().createElement("mask",{id:"EmptySearchResults_svg__b",fill:"#fff"},v().createElement("use",{xlinkHref:"#EmptySearchResults_svg__a"})),v().createElement("use",{fillOpacity:.2,fill:"#A792CD",xlinkHref:"#EmptySearchResults_svg__a"}),v().createElement("g",{mask:"url(#EmptySearchResults_svg__b)"},v().createElement("g",{transform:"translate(56 34)"},v().createElement("g",{opacity:.9,strokeWidth:1,fill:"#FFF"},v().createElement("path",{d:"M0 6.99C0 3.13 3.137 0 7 0h247.067c3.866 0 7 3.144 7 6.99v169.353c0 3.86-3.137 6.99-7 6.99H7c-3.866 0-7-3.143-7-6.99V6.99z"}),v().createElement("path",{d:"M13 25.99c0-3.86 3.137-6.99 7-6.99h247.067c3.866 0 7 3.144 7 6.99v169.353c0 3.86-3.137 6.99-7 6.99H20c-3.866 0-7-3.143-7-6.99V25.99z",opacity:.4})),v().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(21.756 45.833)"},v().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:213.204,cy:5.456,rx:4.351,ry:4.365}),v().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:197.976,cy:5.456,rx:4.351,ry:4.365}),v().createElement("path",{d:"M10.334 1.091c5.707 0 10.334 4.627 10.334 10.334v.067c0 5.707-4.627 10.333-10.334 10.333S0 17.2 0 11.492v-.067C0 5.718 4.627 1.091 10.334 1.091z",fill:"#E3EBF4"}),v().createElement("path",{d:"M35.365.861h69.768a3.82 3.82 0 010 7.639H35.365a3.82 3.82 0 010-7.639z",fill:"#B1AABD",opacity:.5}),v().createElement("path",{d:"M34.274 15.048h126.164a2.728 2.728 0 010 5.456H34.274a2.728 2.728 0 110-5.456z",fill:"#B1AABD",opacity:.43}),v().createElement("path",{d:"M33.182 24.869H73.89a1.637 1.637 0 110 3.274H33.182a1.637 1.637 0 010-3.274z",fill:"#B1AABD",opacity:.2})),v().createElement("rect",{fill:"#645F6D",opacity:.5,x:21.756,y:17.46,width:87.022,height:12.004,rx:6.002}),v().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(21.756 87.302)"},v().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:213.204,cy:5.456,rx:4.351,ry:4.365}),v().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:197.976,cy:5.456,rx:4.351,ry:4.365}),v().createElement("rect",{fill:"#E3EBF4",x:0,y:1.091,width:20.668,height:20.734,rx:10.334}),v().createElement("path",{d:"M35.365.861h82.647a3.82 3.82 0 010 7.639H35.365a3.82 3.82 0 010-7.639z",fill:"#B1AABD",opacity:.5}),v().createElement("path",{d:"M34.274 15.048H174.58a2.728 2.728 0 010 5.456H34.274a2.728 2.728 0 110-5.456z",fill:"#B1AABD",opacity:.43}),v().createElement("path",{d:"M33.182 24.869h113.119a1.637 1.637 0 110 3.274H33.182a1.637 1.637 0 010-3.274z",fill:"#B1AABD",opacity:.2})),v().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(21.756 128.77)"},v().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:213.204,cy:5.456,rx:4.351,ry:4.365}),v().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:197.976,cy:5.456,rx:4.351,ry:4.365}),v().createElement("path",{d:"M10.334 1.091c5.707 0 10.334 4.627 10.334 10.334v.067c0 5.707-4.627 10.333-10.334 10.333S0 17.2 0 11.492v-.067C0 5.718 4.627 1.091 10.334 1.091z",fill:"#E3EBF4"}),v().createElement("path",{d:"M35.365.861h110.929a3.82 3.82 0 010 7.639H35.365a3.82 3.82 0 010-7.639z",fill:"#B1AABD",opacity:.5}),v().createElement("path",{d:"M34.274 15.048h92.443a2.728 2.728 0 010 5.456H34.274a2.728 2.728 0 110-5.456z",fill:"#B1AABD",opacity:.43}),v().createElement("path",{d:"M33.182 24.869H73.89a1.637 1.637 0 110 3.274H33.182a1.637 1.637 0 010-3.274z",fill:"#B1AABD",opacity:.2})))),v().createElement("g",{mask:"url(#EmptySearchResults_svg__b)"},v().createElement("path",{fill:"#446275",d:"M72.246 84.033l8.66 5-35.5 61.488-8.66-5-12.556-24.729-51.307-29.622 20.431-35.388 50.648 29.242z"}),v().createElement("path",{d:"M62.906 120.21l-80.091-46.24 10.5-18.188 50.647 29.242 28.284-.99 8.66 5-18 31.176z",fillOpacity:.2,fill:"#FFF"}),v().createElement("path",{d:"M27.566 75.558L3.877 109.065l-5.013-2.895 26.045-32.146 2.657 1.534zm9.467 5.466L13.345 114.53l-5.014-2.895L34.377 79.49l2.656 1.534zm8.158 4.71l-22.32 34.297-5.013-2.895L43.903 84.99l1.288.744z",fill:"#527585"}),v().createElement("path",{d:"M11.524 90.544l13.385-16.52 2.657 1.534-12.174 17.22-3.868-2.234zm9.467 5.467L34.377 79.49l2.656 1.534-12.174 17.22-3.868-2.233zm9.527 5.5L43.903 84.99l1.288.744-11.47 17.626-3.203-1.85z",fill:"#76A2B5",opacity:.6}),v().createElement("path",{d:"M.355 59.848l-23.689 33.507-5.013-2.895 26.045-32.146 2.657 1.534zm9.468 5.466L-13.866 98.82l-5.013-2.895L7.166 63.78l2.657 1.534zm8.158 4.71L-4.34 104.32l-5.014-2.895L16.692 69.28l1.289.744z",fillOpacity:.1,fill:"#000"}),v().createElement("g",null,v().createElement("path",{fill:"url(#EmptySearchResults_svg__c)",opacity:.993,filter:"url(#EmptySearchResults_svg__d)",d:"M.63 0h173.74L123 172H52z",transform:"rotate(120 90.404 138.861)"}),v().createElement("path",{fill:"url(#EmptySearchResults_svg__e)",opacity:.3,d:"M4 9h166.37L120.73 172.299H53.64z",transform:"rotate(120 90.404 138.861)"}),v().createElement("path",{fill:"url(#EmptySearchResults_svg__f)",opacity:.3,d:"M4 2h166.37L120.73 172.299H53.64z",transform:"rotate(120 90.404 138.861)"}),v().createElement("path",{fill:"url(#EmptySearchResults_svg__g)",d:"M4 9h166.37L120.73 172.299H53.64z",transform:"rotate(120 90.404 138.861)"}),v().createElement("path",{fill:"#FFF",opacity:.196,d:"M212.363 205.344l-1 1.732L60.418 124.52l4.977-8.62z"})),v().createElement("path",{fill:"#76A2B5",d:"M73.112 84.533l-35.5 61.488-.866-.5 35.5-61.488z"}),v().createElement("path",{fill:"#F3F3F3",d:"M80.906 89.033l-35.5 61.488-.866-.5 35.5-61.488z"}),v().createElement("path",{fill:"#538196",d:"M55.112 115.71l-17.5 30.311-.866-.5 17.5-30.31z"})))),SELECT_ATTRIBUTES:e=>v().createElement("svg",AE({width:256,height:256,viewBox:"0 0 256 256",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgSelectAttributes"},e),v().createElement("circle",{cx:128,cy:128,r:128,fill:"#0072CE",fillOpacity:.1}),v().createElement("mask",{id:"SelectAttributes_svg__a",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:0,y:0,width:256,height:256},v().createElement("circle",{cx:128,cy:128,r:128,fill:"#fff"})),v().createElement("g",{mask:"url(#SelectAttributes_svg__a)"},v().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M-16 9h256v247H-16V9z",fill:"url(#SelectAttributes_svg__paint0_linear_0_19219)"}),v().createElement("path",{opacity:.05,fillRule:"evenodd",clipRule:"evenodd",d:"M187.761 56.865l58.639 58.639v148.871H93.383L52 225.083V56.865h135.761z",fill:"url(#SelectAttributes_svg__paint1_linear_0_19219)"}),v().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"}),v().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"}),v().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"}),v().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"}),v().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"}),v().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"}),v().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"}),v().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"}),v().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"}),v().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"}),v().createElement("circle",{cx:67,cy:79,r:9,fill:"#B6C7DB"}),v().createElement("circle",{cx:67,cy:79,r:9,fill:"#B6C7DB"}),v().createElement("circle",{cx:120,cy:106,r:6,fill:"#B6C7DB"}),v().createElement("circle",{cx:120,cy:136,r:6,fill:"#B6C7DB"}),v().createElement("circle",{cx:67,cy:169,r:9,fill:"#B6C7DB"}),v().createElement("circle",{cx:67,cy:199,r:9,fill:"#B6C7DB"}),v().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"}),v().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"}),v().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M92.514 108v-8h-2V140.365h11.178v-2h-9.178V110h9.178v-2h-9.178z",fill:"#2B98F0"}),v().createElement("path",{opacity:.54,fillRule:"evenodd",clipRule:"evenodd",d:"M95.071 77l-3.535 3.535L88 77h7.071z",fill:"#000"}),v().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"}),v().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M58 37a6 6 0 016-6h70a6 6 0 110 12H64a6 6 0 01-6-6zM148 37a6 6 0 016-6h10a6 6 0 110 12h-10a6 6 0 01-6-6z",fill:"#979797"})),v().createElement("defs",null,v().createElement("linearGradient",{id:"SelectAttributes_svg__paint0_linear_0_19219",x1:-16,y1:9,x2:-16,y2:256,gradientUnits:"userSpaceOnUse"},v().createElement("stop",{stopColor:"#FAFAFA",stopOpacity:.01}),v().createElement("stop",{offset:1,stopColor:"#F4F4F4"})),v().createElement("linearGradient",{id:"SelectAttributes_svg__paint1_linear_0_19219",x1:266.117,y1:181.111,x2:154.882,y2:77.681,gradientUnits:"userSpaceOnUse"},v().createElement("stop",{stopOpacity:.01}),v().createElement("stop",{offset:1})))),NO_DATA:e=>v().createElement("svg",RE({width:256,height:256,viewBox:"0 0 256 256",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","data-reltio-id":"SvgNoData"},e),v().createElement("defs",null,v().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"NoData_svg__b"},v().createElement("stop",{stopColor:"#FAFAFA",stopOpacity:0,offset:"0%"}),v().createElement("stop",{stopColor:"#F4F4F4",offset:"100%"})),v().createElement("linearGradient",{x1:"69.573%",y1:"86.747%",x2:"38.144%",y2:"33.403%",id:"NoData_svg__d"},v().createElement("stop",{stopColor:"#000",stopOpacity:0,offset:"0%"}),v().createElement("stop",{stopColor:"#000",offset:"100%"})),v().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"NoData_svg__e"},v().createElement("stop",{stopColor:"#EEFBFF",offset:"0%"}),v().createElement("stop",{stopColor:"#0072CE",offset:"100%"})),v().createElement("filter",{x:"-7.7%",y:"-7.5%",width:"115.3%",height:"115%",filterUnits:"objectBoundingBox",id:"NoData_svg__f"},v().createElement("feOffset",{dx:0,dy:2,in:"SourceAlpha",result:"shadowOffsetOuter1"}),v().createElement("feGaussianBlur",{stdDeviation:2,in:"shadowOffsetOuter1",result:"shadowBlurOuter1"}),v().createElement("feColorMatrix",{values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0",type:"matrix",in:"shadowBlurOuter1",result:"shadowMatrixOuter1"}),v().createElement("feMerge",null,v().createElement("feMergeNode",{in:"shadowMatrixOuter1"}),v().createElement("feMergeNode",{in:"SourceGraphic"}))),v().createElement("circle",{id:"NoData_svg__a",cx:128,cy:128,r:128})),v().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},v().createElement("mask",{id:"NoData_svg__c",fill:"#fff"},v().createElement("use",{xlinkHref:"#NoData_svg__a"})),v().createElement("use",{fillOpacity:.1,fill:"#0072CE",xlinkHref:"#NoData_svg__a"}),v().createElement("path",{fill:"url(#NoData_svg__b)",mask:"url(#NoData_svg__c)",d:"M0 9h256v247H0z"}),v().createElement("g",{mask:"url(#NoData_svg__c)"},v().createElement("g",{transform:"translate(29 37)"},v().createElement("g",{opacity:.9,strokeWidth:1,fill:"#FFF"},v().createElement("path",{fillOpacity:.8,opacity:.5,d:"M14.565 8h228.144v176.476H14.565z"}),v().createElement("path",{d:"M0 8.01C0 3.586 3.576 0 7.997 0h223.838a7.997 7.997 0 017.997 8.01v152.401c0 4.424-3.577 8.01-7.997 8.01H7.997A7.997 7.997 0 010 160.411V8.01z"})),v().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(19.986 42.105)"},v().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:195.862,cy:5.013,rx:3.997,ry:4.01}),v().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:181.872,cy:5.013,rx:3.997,ry:4.01}),v().createElement("path",{d:"M9.493 1.003a9.493 9.493 0 019.494 9.493v.06a9.493 9.493 0 01-18.987 0v-.06a9.493 9.493 0 019.493-9.493z",fill:"#E3EBF4"}),v().createElement("path",{d:"M32.488.791h64.093a3.509 3.509 0 110 7.018H32.488a3.509 3.509 0 110-7.018z",fill:"#B1AABD",opacity:.5}),v().createElement("path",{d:"M31.486 13.824h115.902a2.506 2.506 0 010 5.012H31.486a2.506 2.506 0 010-5.012z",fill:"#B1AABD",opacity:.43}),v().createElement("path",{d:"M30.483 22.846H67.88a1.504 1.504 0 110 3.008H30.483a1.504 1.504 0 110-3.008z",fill:"#B1AABD",opacity:.2})),v().createElement("rect",{fill:"#645F6D",opacity:.5,x:19.986,y:16.04,width:79.944,height:11.028,rx:5.514}),v().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(19.986 80.2)"},v().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:195.862,cy:5.013,rx:3.997,ry:4.01}),v().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:181.872,cy:5.013,rx:3.997,ry:4.01}),v().createElement("rect",{fill:"#E3EBF4",x:0,y:1.003,width:18.987,height:19.048,rx:9.493}),v().createElement("path",{d:"M32.488.791h75.925a3.509 3.509 0 010 7.018H32.488a3.509 3.509 0 110-7.018z",fill:"#B1AABD",opacity:.5}),v().createElement("path",{d:"M31.486 13.824h128.893a2.506 2.506 0 110 5.012H31.486a2.506 2.506 0 010-5.012z",fill:"#B1AABD",opacity:.43}),v().createElement("path",{d:"M30.483 22.846h103.918a1.504 1.504 0 010 3.008H30.483a1.504 1.504 0 110-3.008z",fill:"#B1AABD",opacity:.2})),v().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(19.986 118.296)"},v().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:195.862,cy:5.013,rx:3.997,ry:4.01}),v().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:181.872,cy:5.013,rx:3.997,ry:4.01}),v().createElement("path",{d:"M9.493 1.003a9.493 9.493 0 019.494 9.493v.06a9.493 9.493 0 01-18.987 0v-.06a9.493 9.493 0 019.493-9.493z",fill:"#E3EBF4"}),v().createElement("path",{d:"M32.488.791h101.906a3.509 3.509 0 010 7.018H32.488a3.509 3.509 0 110-7.018z",fill:"#B1AABD",opacity:.5}),v().createElement("path",{d:"M31.486 13.824h84.924a2.506 2.506 0 010 5.012H31.486a2.506 2.506 0 010-5.012z",fill:"#B1AABD",opacity:.43}),v().createElement("path",{d:"M30.483 22.846H67.88a1.504 1.504 0 110 3.008H30.483a1.504 1.504 0 110-3.008z",fill:"#B1AABD",opacity:.2})))),v().createElement("g",{mask:"url(#NoData_svg__c)"},v().createElement("path",{d:"M154.445 45.134v154.072H36.625V45.134h.811C35.508 62.52 41.07 80.609 54.12 93.944c22.74 23.235 59.61 23.235 82.352 0 13.05-13.335 18.612-31.424 16.683-48.81h1.29z",fill:"url(#NoData_svg__d)",opacity:.1,transform:"rotate(-30 291.014 34.548)"}),v().createElement("path",{d:"M27.473 93.234c17.964 18.355 47.09 18.355 65.054 0s17.964-48.113 0-66.468c-17.964-18.355-47.09-18.355-65.054 0s-17.964 48.113 0 66.468z",fill:"url(#NoData_svg__e)",opacity:.2,transform:"translate(70 86)"}),v().createElement("g",{filter:"url(#NoData_svg__f)",strokeWidth:1,fill:"none",transform:"translate(70 86)"},v().createElement("path",{d:"M59.697 0c32.97 0 59.697 26.746 59.697 59.738 0 15.185-5.662 29.047-14.988 39.587l51.204 51.24a89.336 89.336 0 01-10.097 9.392l-51.38-51.416c-9.73 6.888-21.61 10.936-34.436 10.936C26.727 119.477 0 92.73 0 59.738 0 26.746 26.727 0 59.697 0zm0 17.756c-23.17 0-41.953 18.796-41.953 41.982s18.783 41.982 41.953 41.982 41.953-18.796 41.953-41.982-18.783-41.982-41.953-41.982z",fill:"#B5C8C9"}),v().createElement("path",{d:"M21.508 105.656C8.365 94.698 0 78.196 0 59.738 0 26.746 26.727 0 59.697 0c18.444 0 34.935 8.37 45.885 21.523l-9.794 9.8c-8.408-10.68-21.45-17.537-36.091-17.537-25.361 0-45.92 20.573-45.92 45.952 0 14.652 6.852 27.702 17.525 36.117l-9.794 9.8z",fillOpacity:.4,fill:"#FFF"})),v().createElement("path",{d:"M97.473 179.234c17.964 18.355 47.09 18.355 65.054 0s17.964-48.113 0-66.468c-17.964-18.355-47.09-18.355-65.054 0s-17.964 48.113 0 66.468z",fill:"#D9F5FF",opacity:.4,style:{mixBlendMode:"soft-light"}}),v().createElement("path",{d:"M123.885 158.736c0-3.929.444-7.03 1.332-9.304.888-2.274 2.328-4.245 4.32-5.914 1.99-1.668 3.504-3.195 4.54-4.581 1.037-1.386 1.555-2.913 1.555-4.581 0-4.064-1.75-6.095-5.248-6.095-1.614 0-2.92.592-3.915 1.776-.996 1.184-1.52 2.785-1.574 4.803H111.25c.054-5.382 1.75-9.573 5.086-12.574 3.337-3 8.02-4.5 14.047-4.5 6.001 0 10.65 1.386 13.946 4.157 3.297 2.772 4.945 6.714 4.945 11.827 0 2.234-.444 4.265-1.332 6.095-.888 1.83-2.315 3.7-4.279 5.61l-4.642 4.32c-1.318 1.265-2.233 2.563-2.745 3.895-.51 1.332-.793 3.02-.847 5.066h-11.545zm-1.655 12.27c0-1.99.72-3.625 2.16-4.904 1.44-1.278 3.236-1.917 5.389-1.917 2.152 0 3.949.64 5.388 1.917 1.44 1.279 2.16 2.913 2.16 4.905 0 1.991-.72 3.626-2.16 4.904-1.44 1.278-3.236 1.917-5.388 1.917-2.153 0-3.95-.639-5.389-1.917-1.44-1.278-2.16-2.913-2.16-4.904z",fillOpacity:.87,fill:"#000",style:{mixBlendMode:"overlay"}}),v().createElement("path",{d:"M123.885 158.736c0-3.929.444-7.03 1.332-9.304.888-2.274 2.328-4.245 4.32-5.914 1.99-1.668 3.504-3.195 4.54-4.581 1.037-1.386 1.555-2.913 1.555-4.581 0-4.064-1.75-6.095-5.248-6.095-1.614 0-2.92.592-3.915 1.776-.996 1.184-1.52 2.785-1.574 4.803H111.25c.054-5.382 1.75-9.573 5.086-12.574 3.337-3 8.02-4.5 14.047-4.5 6.001 0 10.65 1.386 13.946 4.157 3.297 2.772 4.945 6.714 4.945 11.827 0 2.234-.444 4.265-1.332 6.095-.888 1.83-2.315 3.7-4.279 5.61l-4.642 4.32c-1.318 1.265-2.233 2.563-2.745 3.895-.51 1.332-.793 3.02-.847 5.066h-11.545zm-1.655 12.27c0-1.99.72-3.625 2.16-4.904 1.44-1.278 3.236-1.917 5.389-1.917 2.152 0 3.949.64 5.388 1.917 1.44 1.279 2.16 2.913 2.16 4.905 0 1.991-.72 3.626-2.16 4.904-1.44 1.278-3.236 1.917-5.388 1.917-2.153 0-3.95-.639-5.389-1.917-1.44-1.278-2.16-2.913-2.16-4.904z",fillOpacity:.38,fill:"#3C74B4"})))),ERROR:e=>v().createElement("svg",_E({width:88,height:88,viewBox:"0 0 88 88",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgError"},e),v().createElement("mask",{id:"Error_svg__a",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:0,y:0,width:88,height:88},v().createElement("path",{d:"M44 88c24.3 0 44-19.7 44-44S68.3 0 44 0 0 19.7 0 44s19.7 44 44 44z",fill:"#fff"})),v().createElement("g",{mask:"url(#Error_svg__a)"},v().createElement("path",{d:"M44 88c24.3 0 44-19.7 44-44S68.3 0 44 0 0 19.7 0 44s19.7 44 44 44z",fill:"#CAC4D5",fillOpacity:.3}),v().createElement("path",{opacity:.3,fillRule:"evenodd",clipRule:"evenodd",d:"M19.987 6.73l49.449 6.072a.687.687 0 01.596.767l-7.845 63.888a.688.688 0 01-.766.6L7.214 71.4a.688.688 0 01-.599-.763l.408-3.326L19.987 6.73z",fill:"#fff"}),v().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M1.267 25.921l45.86-19.466a.687.687 0 01.9.366l25.15 59.251a.61.61 0 01-.386.84L22.34 82.765a.719.719 0 01-.887-.445l-20.185-56.4z",fill:"#fff"}),v().createElement("path",{d:"M65.631 9.23H11.017a.688.688 0 00-.687.687v64.37c0 .38.307.687.687.687h54.614c.38 0 .688-.308.688-.687V9.917a.688.688 0 00-.688-.688z",fill:"#F9F9F9"}),v().createElement("path",{opacity:.1,fillRule:"evenodd",clipRule:"evenodd",d:"M14.885 34.95l3.105-1.666 7.31-4.025 8.852 3.472 7.89-5.223 8.036-2.628 8.113 5.193 3.352-10.255v16.967H14.935l-.05-1.835z",fill:"#9C6CF0"}),v().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M14.885 32.331l3.105-3.761 7.31 4.31 8.852 1.656 7.89-2.205 8.036 1.827 8.113-12.643 3.352.742V36.36H14.935l-.05-4.029z",fill:"#FA82AA"}),v().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M14.885 34.946l3.105.432 7.31 1.01 8.852-5.117 7.89 3.675 8.036 1.839 8.113-1.839 3.352.811v1.028H14.935l-.05-1.839z",fill:"#4DBEE9"}),v().createElement("path",{opacity:.1,fillRule:"evenodd",clipRule:"evenodd",d:"M61.543 35.288l-.05 1.497H14.885v-5.239l3.352-.276 8.114 4.697 8.036-.679 7.889.82 8.852-.616 7.31-1.601 3.105 1.397z",fill:"#4DBEE9"}),v().createElement("path",{d:"M21.036 40.178h-5.09a.636.636 0 000 1.272h5.09a.636.636 0 100-1.272z",fill:"#ACACAC"}),v().createElement("path",{opacity:.3,fillRule:"evenodd",clipRule:"evenodd",d:"M16.582 55.872c.703 0 1.273.57 1.273 1.273V69.02a1.272 1.272 0 11-2.545 0V57.144c0-.702.57-1.272 1.272-1.272zM25.914 55.872c.702 0 1.272.57 1.272 1.273V69.02a1.272 1.272 0 11-2.545 0V57.144c0-.702.57-1.272 1.273-1.272zM39.91 55.872c.703 0 1.273.57 1.273 1.273V69.02a1.272 1.272 0 11-2.545 0V57.144c0-.702.57-1.272 1.273-1.272zM21.248 55.872c.702 0 1.272.57 1.272 1.273V69.02a1.273 1.273 0 01-2.545 0V57.144c0-.702.57-1.272 1.273-1.272zM35.245 55.872c.703 0 1.273.57 1.273 1.273V69.02a1.272 1.272 0 11-2.545 0V57.144c0-.702.57-1.272 1.272-1.272zM30.58 55.872c.702 0 1.272.57 1.272 1.273V69.02a1.272 1.272 0 11-2.545 0V57.144c0-.702.57-1.272 1.272-1.272zM44.577 55.872c.702 0 1.272.57 1.272 1.273V69.02a1.273 1.273 0 01-2.545 0V57.144c0-.702.57-1.272 1.273-1.272z",fill:"#BDBDBD"}),v().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.582 65.628c.703 0 1.273.57 1.273 1.272v2.121a1.272 1.272 0 11-2.545 0v-2.12c0-.703.57-1.273 1.272-1.273zM25.914 62.658c.702 0 1.272.57 1.272 1.273v5.09a1.272 1.272 0 11-2.545 0v-5.09c0-.703.57-1.273 1.273-1.273zM39.91 65.628c.703 0 1.273.57 1.273 1.272v2.121a1.272 1.272 0 11-2.545 0v-2.12c0-.703.57-1.273 1.273-1.273zM21.248 66.477c.702 0 1.272.57 1.272 1.272v1.273a1.273 1.273 0 01-2.545 0v-1.273c0-.703.57-1.272 1.273-1.272z",fill:"#4DBEE9"}),v().createElement("path",{d:"M36.518 65.628a1.272 1.272 0 00-2.545 0v3.393a1.272 1.272 0 102.545 0v-3.393zM31.852 62.234a1.272 1.272 0 10-2.545 0v6.787a1.272 1.272 0 102.545 0v-6.787z",fill:"#4DBEE9"}),v().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M44.577 60.962c.702 0 1.272.57 1.272 1.272v6.787a1.273 1.273 0 01-2.545 0v-6.787c0-.702.57-1.272 1.273-1.272z",fill:"#4DBEE9"}),v().createElement("path",{d:"M18.915 18.546a1.909 1.909 0 100-3.817 1.909 1.909 0 000 3.817z",fill:"#9C6CF0"}),v().createElement("path",{opacity:.5,d:"M34.185 18.546a1.909 1.909 0 100-3.817 1.909 1.909 0 000 3.817z",fill:"#4DBEE9"}),v().createElement("path",{opacity:.3,d:"M49.454 18.546a1.909 1.909 0 100-3.817 1.909 1.909 0 000 3.817z",fill:"#4DBEE9"}),v().createElement("path",{opacity:.8,d:"M26.55 18.546a1.909 1.909 0 100-3.817 1.909 1.909 0 000 3.817z",fill:"#FB6597"}),v().createElement("path",{d:"M41.82 18.546a1.909 1.909 0 100-3.817 1.909 1.909 0 000 3.817z",fill:"#4DBEE9"}),v().createElement("path",{opacity:.2,d:"M57.09 18.546a1.909 1.909 0 100-3.817 1.909 1.909 0 000 3.817z",fill:"#4DBEE9"}),v().createElement("path",{opacity:.5,fillRule:"evenodd",clipRule:"evenodd",d:"M16.582 19.818h4.666a.424.424 0 110 .849h-4.666a.424.424 0 110-.849zM31.851 19.818h4.666a.424.424 0 010 .849h-4.666a.424.424 0 110-.849zM47.121 19.818h4.666a.424.424 0 010 .849h-4.666a.424.424 0 010-.849zM24.217 19.818h4.665a.424.424 0 010 .849h-4.665a.424.424 0 010-.849zM39.486 19.818h4.666a.424.424 0 110 .849h-4.666a.424.424 0 110-.849zM54.756 19.818h4.666a.424.424 0 110 .849h-4.666a.424.424 0 110-.849z",fill:"#ACACAC"}),v().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.946 43.571h5.09a.636.636 0 110 1.273h-5.09a.636.636 0 010-1.273zM15.946 46.116h5.09a.636.636 0 010 1.273h-5.09a.636.636 0 010-1.273zM15.946 48.661h5.09a.636.636 0 010 1.273h-5.09a.636.636 0 110-1.273zM23.58 43.571h5.09a.636.636 0 110 1.273h-5.09a.636.636 0 010-1.273zM23.58 46.116h5.09a.636.636 0 010 1.273h-5.09a.636.636 0 010-1.273zM23.58 48.661h5.09a.636.636 0 010 1.273h-5.09a.636.636 0 110-1.273zM49.454 43.571h11.028a.636.636 0 010 1.273H49.454a.636.636 0 010-1.273zM49.454 46.116h11.028a.636.636 0 010 1.273H49.454a.636.636 0 010-1.273zM49.454 48.661h11.028a.636.636 0 010 1.273H49.454a.636.636 0 110-1.273zM31.215 43.571h15.27a.636.636 0 110 1.273h-15.27a.636.636 0 010-1.273zM31.215 46.116h15.27a.636.636 0 010 1.273h-15.27a.636.636 0 010-1.273zM31.215 48.661h15.27a.636.636 0 010 1.273h-15.27a.636.636 0 010-1.273zM15.946 51.206h5.09a.636.636 0 110 1.272h-5.09a.636.636 0 110-1.272zM23.58 51.206h5.09a.636.636 0 110 1.272h-5.09a.636.636 0 110-1.272zM49.454 51.206h11.028a.636.636 0 010 1.272H49.454a.636.636 0 110-1.272zM31.215 51.206h15.27a.636.636 0 110 1.272h-15.27a.636.636 0 010-1.272z",fill:"#E9E9E9"}),v().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M49.878 55.872h5.09a.636.636 0 110 1.273h-5.09a.636.636 0 110-1.273z",fill:"#ACACAC"}),v().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M49.878 59.69h11.029a.636.636 0 010 1.272H49.878a.636.636 0 110-1.273zM49.878 62.234h11.029a.636.636 0 010 1.273H49.878a.636.636 0 010-1.273zM49.878 64.78h11.029a.636.636 0 010 1.272H49.878a.636.636 0 010-1.273z",fill:"#E9E9E9"}),v().createElement("path",{d:"M54.968 67.324h-5.09a.636.636 0 000 1.273h5.09a.636.636 0 000-1.273z",fill:"#E9E9E9"}),v().createElement("g",{filter:"url(#Error_svg__filter0_d)"},v().createElement("path",{d:"M57.406 74.25c9.493 0 17.188-7.695 17.188-17.188 0-9.492-7.695-17.187-17.188-17.187-9.492 0-17.187 7.695-17.187 17.188 0 9.492 7.695 17.187 17.187 17.187z",fill:"#000"})),v().createElement("path",{d:"M57.406 74.25c9.493 0 17.188-7.695 17.188-17.188 0-9.492-7.695-17.187-17.188-17.187-9.492 0-17.187 7.695-17.187 17.188 0 9.492 7.695 17.187 17.187 17.187z",fill:"#F25252"}),v().createElement("path",{opacity:.15,fillRule:"evenodd",clipRule:"evenodd",d:"M57.406 34.719c12.34 0 22.344 10.003 22.344 22.343S69.746 79.406 57.406 79.406c-12.34 0-22.343-10.003-22.343-22.344 0-12.34 10.003-22.343 22.343-22.343zm-.172 2.406c-10.916 0-19.765 8.85-19.765 19.766 0 10.916 8.85 19.765 19.765 19.765C68.151 76.656 77 67.806 77 56.891c0-10.917-8.85-19.766-19.766-19.766z",fill:"#F25252"}),v().createElement("path",{opacity:.3,fillRule:"evenodd",clipRule:"evenodd",d:"M57.406 38.844c10.062 0 18.219 8.157 18.219 18.218 0 10.062-8.157 18.22-18.219 18.22-10.062 0-18.218-8.158-18.218-18.22 0-10.061 8.156-18.218 18.218-18.218zm0 2.043c-8.933 0-16.175 7.242-16.175 16.175 0 8.934 7.242 16.176 16.175 16.176 8.934 0 16.176-7.242 16.176-16.175 0-8.934-7.242-16.176-16.176-16.176z",fill:"#F25252"}),v().createElement("path",{opacity:.05,fillRule:"evenodd",clipRule:"evenodd",d:"M57.406 26.469C74.303 26.469 88 40.166 88 57.062c0 16.897-13.697 30.594-30.594 30.594-16.896 0-30.593-13.697-30.593-30.594 0-16.896 13.697-30.593 30.593-30.593zm-.172 3.437c-14.903 0-26.984 12.082-26.984 26.985 0 14.903 12.081 26.984 26.984 26.984 14.903 0 26.985-12.081 26.985-26.984 0-14.903-12.082-26.985-26.985-26.985z",fill:"#F25252"}),v().createElement("path",{d:"M57.406 71.844c8.164 0 14.782-6.618 14.782-14.781 0-8.164-6.618-14.782-14.782-14.782-8.163 0-14.781 6.618-14.781 14.782 0 8.163 6.618 14.78 14.781 14.78z",fill:"#FF6A6A"}),v().createElement("path",{opacity:.05,fillRule:"evenodd",clipRule:"evenodd",d:"M58.298 46.448L75.18 63.331l-9.114 12.078h-2.029l-7.582-7.582 1.006-3.178.837-18.2z",fill:"url(#Error_svg__paint0_linear)"}),v().createElement("g",{filter:"url(#Error_svg__filter1_d)"},v().createElement("path",{d:"M57.406 68.063a1.719 1.719 0 100-3.438 1.719 1.719 0 000 3.438z",fill:"#000"})),v().createElement("path",{d:"M57.406 68.063a1.719 1.719 0 100-3.438 1.719 1.719 0 000 3.438z",fill:"#fff"}),v().createElement("g",{filter:"url(#Error_svg__filter2_d)"},v().createElement("path",{d:"M57.406 46.063c.95 0 1.719.769 1.719 1.718v12.375a1.719 1.719 0 11-3.438 0V47.781c0-.949.77-1.718 1.72-1.718z",fill:"#000"})),v().createElement("path",{d:"M57.406 46.063c.95 0 1.719.769 1.719 1.718v12.375a1.719 1.719 0 11-3.438 0V47.781c0-.949.77-1.718 1.72-1.718z",fill:"#fff"})),v().createElement("defs",null,v().createElement("filter",{id:"Error_svg__filter0_d",x:36.219,y:37.875,width:42.375,height:42.375,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},v().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),v().createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),v().createElement("feOffset",{dy:2}),v().createElement("feGaussianBlur",{stdDeviation:2}),v().createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0"}),v().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),v().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})),v().createElement("filter",{id:"Error_svg__filter1_d",x:51.688,y:62.625,width:11.438,height:11.438,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},v().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),v().createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),v().createElement("feOffset",{dy:2}),v().createElement("feGaussianBlur",{stdDeviation:2}),v().createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0"}),v().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),v().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})),v().createElement("filter",{id:"Error_svg__filter2_d",x:51.688,y:44.063,width:11.438,height:23.813,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},v().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),v().createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),v().createElement("feOffset",{dy:2}),v().createElement("feGaussianBlur",{stdDeviation:2}),v().createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0"}),v().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),v().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})),v().createElement("linearGradient",{id:"Error_svg__paint0_linear",x1:68.438,y1:71.571,x2:60.119,y2:58.801,gradientUnits:"userSpaceOnUse"},v().createElement("stop",{stopOpacity:0}),v().createElement("stop",{offset:1})))),LOADING:e=>v().createElement("svg",NE({width:256,height:256,viewBox:"0 0 256 256",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgEmptyLoading"},e),v().createElement("circle",{cx:128,cy:128,r:128,fill:"#0072CE",fillOpacity:.03}),v().createElement("mask",{id:"EmptyLoading_svg__a",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:0,y:0,width:256,height:256},v().createElement("circle",{cx:128,cy:128,r:128,fill:"#fff"})),v().createElement("g",{mask:"url(#EmptyLoading_svg__a)"},v().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M-16 9h256v247H-16V9z",fill:"url(#EmptyLoading_svg__paint0_linear_2978_41880)"}),v().createElement("g",{fillRule:"evenodd",clipRule:"evenodd"},v().createElement("path",{d:"M40.755 44.17C40.755 38.002 45.76 33 51.92 33h251.675c6.167 0 11.166 5.001 11.166 11.17v160.596H40.755V44.171z",fill:"#5E7282"}),v().createElement("path",{d:"M50.371 43.106h255.685V195.71H50.371V43.106z",fill:"url(#EmptyLoading_svg__paint1_linear_2978_41880)"}),v().createElement("path",{d:"M15.545 208.914c2.321.469 4.723.716 7.183.716H338.75c.22 0 .439-.002.658-.006-7.061 8.445-17.67 13.816-29.524 13.816H45.655c-12.111 0-22.916-5.597-29.968-14.349l-.142-.177z",fill:"#BDCBD8"}),v().createElement("path",{d:"M339.015 204.883v4.966H15v-4.966h324.015z",fill:"#D4DCDF"}),v().createElement("path",{d:"M201.107 213.991h-45.221a11.176 11.176 0 01-11.046-9.449h67.314a11.172 11.172 0 01-11.047 9.449z",fill:"url(#EmptyLoading_svg__paint2_linear_2978_41880)"})),v().createElement("g",{filter:"url(#EmptyLoading_svg__filter0_d_2978_41880)"},v().createElement("rect",{x:81.703,y:99,width:170,height:26,rx:8,fill:"#D1E6FF"}),v().createElement("rect",{x:84.703,y:102,width:164,height:20,rx:5,stroke:"#fff",strokeWidth:6})),v().createElement("g",{filter:"url(#EmptyLoading_svg__filter1_d_2978_41880)"},v().createElement("mask",{id:"EmptyLoading_svg__b",fill:"#fff"},v().createElement("rect",{x:81,y:105,width:108,height:14,rx:2})),v().createElement("rect",{x:81,y:105,width:108,height:14,rx:2,fill:"#61A3F1"}),v().createElement("rect",{x:81,y:105,width:108,height:14,rx:2,stroke:"#4A90E2",strokeWidth:8,mask:"url(#EmptyLoading_svg__b)"})),v().createElement("path",{opacity:.8,fillRule:"evenodd",clipRule:"evenodd",d:"M122.703 74a3 3 0 013-3h81.625a3 3 0 010 6h-81.625a3 3 0 01-3-3z",fill:"#B6C7DB"}),v().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M146.703 86a3 3 0 013-3h34a3 3 0 110 6h-34a3 3 0 01-3-3zM136.703 139a3 3 0 013-3h54a3 3 0 110 6h-54a3 3 0 01-3-3z",fill:"#979797"}),v().createElement("path",{opacity:.1,fillRule:"evenodd",clipRule:"evenodd",d:"M112.703 151a3 3 0 013-3h103a3 3 0 110 6h-103a3 3 0 01-3-3zM124.703 163a3 3 0 013-3h79a3 3 0 110 6h-79a3 3 0 01-3-3z",fill:"#979797"}),v().createElement("g",{filter:"url(#EmptyLoading_svg__filter2_ddd_2978_41880)"},v().createElement("path",{fill:"#A0C1D7",d:"M70.703 64h11v8h-11z"}),v().createElement("rect",{x:62,y:59,width:28,height:8,rx:1,fill:"#BDD4E3"}),v().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M38.23 160.5c20.704 20.703 54.27 20.703 74.973 0 20.703-20.703 20.703-54.27 0-74.973-20.703-20.703-54.27-20.703-74.973 0-20.703 20.703-20.703 54.27 0 74.973z",fill:"#BDD4E3"}),v().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M113.427 85.988c20.463 20.652 20.404 53.981-.175 74.561-20.432 20.431-53.432 20.635-74.115.613l-.446-.439 74.736-74.735z",fill:"#A0C1D7"}),v().createElement("path",{opacity:.144,fillRule:"evenodd",clipRule:"evenodd",d:"M75.037 175.385c29.402 0 53.236-23.834 53.236-53.236a54.67 54.67 0 00-.106-3.399L100.45 91.037l-55.142 58.396 25.814 25.811c1.293.094 2.598.141 3.915.141z",fill:"url(#EmptyLoading_svg__paint3_linear_2978_41880)"}),v().createElement("circle",{cx:75.94,cy:123.237,r:44.723,fill:"#91B0C2"}),v().createElement("g",{filter:"url(#EmptyLoading_svg__filter3_d_2978_41880)"},v().createElement("circle",{r:42.793,transform:"matrix(-1 0 0 1 75.94 123.237)",fill:"#F7F4FF"})),v().createElement("path",{opacity:.05,fillRule:"evenodd",clipRule:"evenodd",d:"M105.043 175.309l-10.298.861-20.313-20.152.863-2.292-9.973-9.982 18.679-6.882h-4.308l-8.943-8.951 4.545-10.532L94.35 90.74l37.888 37.162c-.343 20.088-11.146 37.627-27.195 47.407z",fill:"url(#EmptyLoading_svg__paint4_linear_2978_41880)"}),v().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M67.703 123a8 8 0 0112.362-6.707l14.477-25.145A36.828 36.828 0 0075.703 86c-20.434 0-37 16.565-37 37h29z",fill:"url(#EmptyLoading_svg__paint5_angular_2978_41880)"}),v().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M94.297 90.6l.24.138s-12.45 35.125-12.811 35.752a6.92 6.92 0 01-11.985-6.92c.361-.626 24.556-28.97 24.556-28.97z",fill:"#323232"}),v().createElement("circle",{cx:75.94,cy:123.237,r:2.896,fill:"#EEEBF6"}),v().createElement("circle",{cx:96.211,cy:148.655,r:2.574,fill:"#A0C3D7"}),v().createElement("circle",{cx:107.15,cy:131.924,r:2.574,fill:"#A0C3D7"}),v().createElement("rect",{x:62.427,y:135.592,width:27.027,height:10.039,rx:3,fill:"#A0C3D7"}),v().createElement("path",{opacity:.05,fillRule:"evenodd",clipRule:"evenodd",d:"M85.914 170.534H75.112l-21.605-21.472 2.126-2.775v-1.01L42.8 132.523l2.853-2.529 40.261 40.54z",fill:"url(#EmptyLoading_svg__paint6_linear_2978_41880)"}),v().createElement("path",{opacity:.02,fillRule:"evenodd",clipRule:"evenodd",d:"M96.362 136.555h-4.988l-38.126-38.01 2.853-2.53 40.261 40.54z",fill:"url(#EmptyLoading_svg__paint7_linear_2978_41880)"}),v().createElement("path",{opacity:.02,fillRule:"evenodd",clipRule:"evenodd",d:"M116.746 129.006h-4.988L73.632 90.995l2.853-2.53 40.261 40.541z",fill:"url(#EmptyLoading_svg__paint8_linear_2978_41880)"}),v().createElement("path",{opacity:.02,fillRule:"evenodd",clipRule:"evenodd",d:"M85.793 152.41h-4.988l-38.126-38.011 2.852-2.53 40.262 40.541z",fill:"url(#EmptyLoading_svg__paint9_linear_2978_41880)"}),v().createElement("circle",{cx:75.618,cy:155.734,r:2.574,fill:"#A0C3D7"}),v().createElement("circle",{cx:55.026,cy:148.655,r:2.574,fill:"#A0C3D7"}),v().createElement("circle",{cx:44.73,cy:131.924,r:2.574,fill:"#A0C3D7"}),v().createElement("g",{fill:"#A0C3D7"},v().createElement("circle",{r:2.574,transform:"matrix(1 0 0 -1 96.21 97.363)"}),v().createElement("circle",{r:2.574,transform:"matrix(1 0 0 -1 107.149 114.094)"}),v().createElement("circle",{r:2.574,transform:"matrix(1 0 0 -1 75.618 90.284)"}),v().createElement("circle",{r:2.574,transform:"matrix(1 0 0 -1 55.026 97.363)"}),v().createElement("circle",{r:2.574,transform:"matrix(1 0 0 -1 44.73 114.094)"})))),v().createElement("defs",null,v().createElement("linearGradient",{id:"EmptyLoading_svg__paint0_linear_2978_41880",x1:-16,y1:9,x2:-16,y2:256,gradientUnits:"userSpaceOnUse"},v().createElement("stop",{stopColor:"#FAFAFA",stopOpacity:.01}),v().createElement("stop",{offset:1,stopColor:"#F4F4F4"})),v().createElement("linearGradient",{id:"EmptyLoading_svg__paint1_linear_2978_41880",x1:178.214,y1:43.106,x2:178.214,y2:195.709,gradientUnits:"userSpaceOnUse"},v().createElement("stop",{stopColor:"#F2F9FB"}),v().createElement("stop",{offset:1,stopColor:"#fff"})),v().createElement("linearGradient",{id:"EmptyLoading_svg__paint2_linear_2978_41880",x1:178.497,y1:204.542,x2:178.497,y2:213.991,gradientUnits:"userSpaceOnUse"},v().createElement("stop",{stopColor:"#90AABF"}),v().createElement("stop",{offset:1,stopColor:"#869DAE"})),v().createElement("linearGradient",{id:"EmptyLoading_svg__paint3_linear_2978_41880",x1:154.275,y1:146.574,x2:96.683,y2:91.352,gradientUnits:"userSpaceOnUse"},v().createElement("stop",{stopOpacity:.01}),v().createElement("stop",{offset:1})),v().createElement("linearGradient",{id:"EmptyLoading_svg__paint4_linear_2978_41880",x1:60.762,y1:143.327,x2:114.747,y2:176.019,gradientUnits:"userSpaceOnUse"},v().createElement("stop",{stopOpacity:.87}),v().createElement("stop",{offset:1,stopOpacity:.01})),v().createElement("linearGradient",{id:"EmptyLoading_svg__paint6_linear_2978_41880",x1:90.287,y1:154.267,x2:68.53,y2:131.301,gradientUnits:"userSpaceOnUse"},v().createElement("stop",{stopOpacity:.01}),v().createElement("stop",{offset:1})),v().createElement("linearGradient",{id:"EmptyLoading_svg__paint7_linear_2978_41880",x1:100.735,y1:120.288,x2:78.978,y2:97.322,gradientUnits:"userSpaceOnUse"},v().createElement("stop",{stopOpacity:.01}),v().createElement("stop",{offset:1})),v().createElement("linearGradient",{id:"EmptyLoading_svg__paint8_linear_2978_41880",x1:121.119,y1:112.739,x2:99.362,y2:89.773,gradientUnits:"userSpaceOnUse"},v().createElement("stop",{stopOpacity:.01}),v().createElement("stop",{offset:1})),v().createElement("linearGradient",{id:"EmptyLoading_svg__paint9_linear_2978_41880",x1:90.166,y1:136.143,x2:68.409,y2:113.177,gradientUnits:"userSpaceOnUse"},v().createElement("stop",{stopOpacity:.01}),v().createElement("stop",{offset:1})),v().createElement("filter",{id:"EmptyLoading_svg__filter0_d_2978_41880",x:77.703,y:96,width:178,height:34,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},v().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),v().createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),v().createElement("feOffset",{dy:1}),v().createElement("feGaussianBlur",{stdDeviation:2}),v().createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.06 0"}),v().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_2978_41880"}),v().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_2978_41880",result:"shape"})),v().createElement("filter",{id:"EmptyLoading_svg__filter1_d_2978_41880",x:77,y:102,width:116,height:22,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},v().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),v().createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),v().createElement("feOffset",{dy:1}),v().createElement("feGaussianBlur",{stdDeviation:2}),v().createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.06 0"}),v().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_2978_41880"}),v().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_2978_41880",result:"shape"})),v().createElement("filter",{id:"EmptyLoading_svg__filter2_ddd_2978_41880",x:-13.297,y:28,width:181.534,height:189.17,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},v().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),v().createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),v().createElement("feMorphology",{radius:4,operator:"erode",in:"SourceAlpha",result:"effect1_dropShadow_2978_41880"}),v().createElement("feOffset",{dy:7}),v().createElement("feGaussianBlur",{stdDeviation:4}),v().createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0.600156 0 0 0 0 0.745337 0 0 0 0 0.8625 0 0 0 0.1 0"}),v().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_2978_41880"}),v().createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),v().createElement("feMorphology",{radius:4,operator:"dilate",in:"SourceAlpha",result:"effect2_dropShadow_2978_41880"}),v().createElement("feOffset",{dy:5}),v().createElement("feGaussianBlur",{stdDeviation:16}),v().createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0.447059 0 0 0 0 0.807843 0 0 0 0.06 0"}),v().createElement("feBlend",{mode:"normal",in2:"effect1_dropShadow_2978_41880",result:"effect2_dropShadow_2978_41880"}),v().createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),v().createElement("feMorphology",{radius:2,operator:"dilate",in:"SourceAlpha",result:"effect3_dropShadow_2978_41880"}),v().createElement("feOffset",{dy:12}),v().createElement("feGaussianBlur",{stdDeviation:8.5}),v().createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0.447059 0 0 0 0 0.807843 0 0 0 0.06 0"}),v().createElement("feBlend",{mode:"normal",in2:"effect2_dropShadow_2978_41880",result:"effect3_dropShadow_2978_41880"}),v().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect3_dropShadow_2978_41880",result:"shape"})),v().createElement("filter",{id:"EmptyLoading_svg__filter3_d_2978_41880",x:29.148,y:78.444,width:93.585,height:93.585,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},v().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),v().createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),v().createElement("feOffset",{dy:2}),v().createElement("feGaussianBlur",{stdDeviation:2}),v().createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0"}),v().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_2978_41880"}),v().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_2978_41880",result:"shape"})),v().createElement("radialGradient",{id:"EmptyLoading_svg__paint5_angular_2978_41880",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"rotate(-56.035 152.55 -12.515) scale(43.4058 65.5062)"},v().createElement("stop",{stopColor:"#CFE8FF"}),v().createElement("stop",{offset:.599,stopColor:"#D1F2F9",stopOpacity:0}))))},kE=e=>{let{variant:t=DE.full,LogoRenderer:r=PE.SEARCH_RESULTS,text:n,secondaryText:a,buttonTitle:i,onClick:o=_.identity,access:l}=e;const s=IE(),c=l&&i;return v().createElement("div",{className:O()(s.root,s[`root_${t}`])},v().createElement(r,{className:s[`${t}`]}),v().createElement("div",{className:s.textBox},v().createElement(Ag(),{variant:"h5",classes:{h5:s.text}},n),a&&v().createElement(Ag(),{variant:"subtitle1",classes:{subtitle1:s.secondaryText}},a)),c&&v().createElement(nE(),{className:s.button,variant:"contained",color:"primary",onClick:o},i))};var LE=r(15503);class UE extends v().Component{constructor(e){super(e),this.state={error:null}}componentDidCatch(e){this.setState({error:e}),console.error(e)}render(){const{children:e,error:t}=this.props;return this.state.error?t:e}}const jE=(0,kp.Z)({container:{flexGrow:1,display:"flex",flexDirection:"column",position:"relative",overflow:"hidden","& .Resizer.disabled":{display:"none"}},pagination:{flexGrow:0,height:"52px"},listContainer:{overflowY:"auto"},tableContainer:{display:"flex",flexDirection:"column",height:"100%"},resizablePanesWrapper:{flexGrow:1,height:0},pane:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",flexDirection:"column",overflow:"hidden"}});var FE=r(46089),ME=r.n(FE);const VE=(0,kp.Z)((e=>({button:{"&.MuiButtonGroup-grouped":{minWidth:"30px",padding:"8px 8px",justifyContent:"start",fill:"rgba(0,0,0,0.54)",textTransform:"none",color:"rgba(0,0,0,0.87)",borderColor:"rgba(0,0,0,0.12)","&:hover":{backgroundColor:"rgba(0, 0, 0, 0.04)"},"&:not(:last-of-type):hover":{borderRightColor:"transparent"},"&$current":{"& $icon":{color:e.palette.primary.main},backgroundColor:(0,Lm.alpha)(e.palette.primary.main,.12),fill:e.palette.primary.main,color:e.palette.primary.main,"&:hover":{backgroundColor:(0,Lm.alpha)(e.palette.primary.main,.24),borderRightColor:"transparent"}}}},icon:{color:"rgba(0,0,0,0.54)",width:"20px",height:"20px","& + $title":{marginLeft:"8px"}},title:{fontSize:"13px",lineHeight:"15px",letterSpacing:0},current:{}}))),BE=(0,yd.T)(nE()),zE=e=>{let{className:t,classes:r={},modes:n=[],modeId:a,onChange:i}=e;const o=VE();return v().createElement(ME(),{className:t},n.map((e=>{let{id:t,title:n,tooltipTitle:l,Icon:s,disabled:c}=e;return v().createElement(BE,{disabled:c,showForDisabled:c&&!!l,key:String(t),className:O()(o.button,{[o.current]:a===t},r.button),tooltipTitle:l,onClick:(u=t,()=>i(u)),"data-reltio-id":`reltio-search-mode-${t}`},s&&v().createElement(s,{className:o.icon}),n&&v().createElement("div",{className:o.title},n));var u})))},HE=(0,kp.Z)((()=>({button:{"&.MuiButtonGroup-grouped":{minWidth:"90px",padding:"8px 12px"}}})));function YE(){return YE=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},YE.apply(this,arguments)}const WE=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",YE({width:"25",height:"24",viewBox:"0 0 25 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},r),v().createElement("defs",null,v().createElement("path",{d:"M19 4H5c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zM7 18H5v-8h2v8zM7 8H5V6h2v2zm6 10H9v-8h4v8zm0-10H9V6h4v2zm6 10h-4v-8h4v8zm0-10h-4V6h4v2z",id:"svg3365802068a"})),v().createElement("g",{stroke:"none",strokeWidth:"1"},v().createElement("g",{transform:"translate(.2)"},v().createElement("mask",{id:"svg3365802068b",fill:"#fff"},v().createElement("use",{xlinkHref:"#svg3365802068a"})),v().createElement("g",{mask:"url(#svg3365802068b)"},v().createElement("g",null,v().createElement("g",null,v().createElement("path",{d:"M0 0h24v24H0z"})))))))};function GE(){return GE=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},GE.apply(this,arguments)}const qE=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",GE({width:"25",height:"24",viewBox:"0 0 25 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},r),v().createElement("defs",null,v().createElement("path",{d:"M20 15.5v3H9v-3h11zm-14 0a1 1 0 011 1v1a1 1 0 01-1 1H5a1 1 0 01-1-1v-1a1 1 0 011-1h1zm14-5v3H9v-3h11zm-14 0a1 1 0 011 1v1a1 1 0 01-1 1H5a1 1 0 01-1-1v-1a1 1 0 011-1h1zm14-5v3H9v-3h11zm-14 0a1 1 0 011 1v1a1 1 0 01-1 1H5a1 1 0 01-1-1v-1a1 1 0 011-1h1z",id:"svg4195527304a"})),v().createElement("g",{stroke:"none",strokeWidth:"1"},v().createElement("g",{transform:"translate(.2)"},v().createElement("mask",{id:"svg4195527304b",fill:"#fff"},v().createElement("use",{xlinkHref:"#svg4195527304a"})),v().createElement("g",{mask:"url(#svg4195527304b)"},v().createElement("path",{d:"M0 0h24v24H0z"})))))},ZE=e=>{switch(e){case K.ll.TABLE:return WE;case K.ll.LIST:return qE;default:return lE()}},$E=[{id:K.ll.TABLE,tooltipTitle:mi().text("Table view"),title:mi().text("Table"),Icon:ZE(K.ll.TABLE)},{id:K.ll.LIST,tooltipTitle:mi().text("List view"),title:mi().text("List"),Icon:ZE(K.ll.LIST)}],KE=e=>{let{className:t}=e;const r=HE(),n=(0,Tp.useDispatch)(),a=(0,Tp.useSelector)(ki.XM);return v().createElement(zE,{className:t,classes:{button:r.button},modes:$E,modeId:a,onChange:e=>{a!==e&&n((e=>({type:Ne,payload:e}))(e))}})};KE.propTypes={className:vp().string};const XE=KE;var QE=r(81085),JE=r.n(QE),eb=r(48139),tb=r.n(eb);const rb="DATA_TENANTS_UPDATED",nb=e=>t=>({type:e,payload:t}),ab=(nb(rb),null),ib=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ab,t=arguments.length>1?arguments[1]:void 0;return t.type===rb?t.payload||ab:e},ob="TENANTS_UPDATED",lb=(nb(ob),null),sb=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:lb,t=arguments.length>1?arguments[1]:void 0;return t.type===ob?t.payload||lb:e},cb="METADATA_LOADED";let ub=function(e){return e.OPEN_ENTITY="OPEN_ENTITY",e.NEW_ENTITY_SHOWN="NEW_ENTITY_SHOWN",e.ENTITY_DELETION_FINISHED="ENTITY_DELETION_FINISHED",e.OPEN_PERSPECTIVE="OPEN_PERSPECTIVE",e.UI_CONFIG_LOADED="UI_CONFIG_LOADED",e.NEW_UI_CONFIG_LOADED="NEW_UI_CONFIG_LOADED",e.PATHS_SET="PATHS_SET",e.UI_PATH_SET="UI_PATH_SET",e.LOCALIZATION_LOADED="LOCALIZATION_LOADED",e.LOCALE_ATTRIBUTE_PRESENTATION_LOADED="LOCALE_ATTRIBUTE_PRESENTATION_LOADED",e.AUTOCLOSE_INTERVAL_LOADED="AUTOCLOSE_INTERVAL_LOADED",e.SET_PREFER_REACT="SET_PREFER_REACT",e.OPEN_CONSOLE_APP="OPEN_CONSOLE_APP",e.OPEN_APP_FROM_CHOCOLATE_BAR="OPEN_APP_FROM_CHOCOLATE_BAR",e.NUMBER_FORMAT_UPDATED="NUMBER_FORMAT_UPDATED",e.OPEN_GRAPH="OPEN_GRAPH",e.DATE_MASK_UPDATED="DATE_MASK_UPDATED",e.DATE_TIME_MASK_UPDATED="DATE_TIME_MASK_UPDATED",e.OPEN_SEARCH="OPEN_SEARCH",e.OPEN_DASHBOARD="OPEN_DASHBOARD",e.OPEN_HISTORY_EVENT="OPEN_HISTORY_EVENT",e.KEYS_SET="KEYS_SET",e.OPEN_PIVOTING_PERSPECTIVE="OPEN_PIVOTING_PERSPECTIVE",e.ERROR_SET="ERROR_SET",e.SHOW_NOTIFICATION="SHOW_NOTIFICATION",e.CLOSE_NOTIFICATION="CLOSE_NOTIFICATION",e.CLEAR_NOTIFICATIONS="CLEAR_NOTIFICATIONS",e.DOCUMENTATION_SET="DOCUMENTATION_SET",e.OPEN_NEW_ENTITY_WITH_AUTHORING="OPEN_NEW_ENTITY_WITH_AUTHORING",e.OPEN_PREVIOUS_PAGE="OPEN_PREVIOUS_PAGE",e.NAVIGATE="NAVIGATE",e.ADD_DASHBOARD_EXTERNAL_VIEW="ADD_DASHBOARD_EXTERNAL_VIEW",e.SET_USE_SHARED_PREFERENCES="SET_USE_SHARED_PREFERENCES",e}({});function pb(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){db(e,t,r[t])}))}return e}function db(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const mb={},gb=(0,_.pipe)(x.normalizeMetadata,x.parseMetadata,x.localizeMetadata),yb=(0,_.map)(x.localizeMetadata),fb=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:mb,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case cb:{const{tenant:r,metadata:n}=t.payload;return pb({},e,{[r]:gb(n)})}case ub.LOCALIZATION_LOADED:return yb(e);default:return e}};let hb=function(e){return e.ADD_ATTRIBUTES="ADD_ATTRIBUTES",e.MODIFY_ATTRIBUTE="MODIFY_ATTRIBUTE",e.REMOVE_ATTRIBUTE="REMOVE_ATTRIBUTE",e.REQUEST_NEXT_PAGE_ATTRIBUTE_VALUES="REQUEST_NEXT_PAGE_ATTRIBUTE_VALUES",e.ADD_NEXT_PAGE_ATTRIBUTE_VALUES="ADD_NEXT_PAGE_ATTRIBUTE_VALUES",e.PROCESS_NEXT_PAGE_ATTRIBUTE_VALUES="PROCESS_NEXT_PAGE_ATTRIBUTE_VALUES",e.ADD_DEFAULT_VALUES="ADD_DEFAULT_VALUES",e.SAVE_PROFILE="SAVE_PROFILE",e.SAVE_DRAFT="SAVE_DRAFT",e.VALIDATE_PROFILE="VALIDATE_PROFILE",e.PROFILE_SAVED="PROFILE_SAVED",e.RUN_AUTHORING_TASK_ACTION="RUN_AUTHORING_TASK_ACTION",e}({});const Eb=nb(hb.ADD_ATTRIBUTES),bb=nb(hb.ADD_DEFAULT_VALUES),vb=nb(hb.MODIFY_ATTRIBUTE),Tb=nb(hb.REMOVE_ATTRIBUTE),Ob=nb(hb.ADD_NEXT_PAGE_ATTRIBUTE_VALUES),xb=nb(hb.PROCESS_NEXT_PAGE_ATTRIBUTE_VALUES),Cb=nb(hb.REQUEST_NEXT_PAGE_ATTRIBUTE_VALUES),Sb=nb(hb.SAVE_PROFILE),wb=nb(hb.RUN_AUTHORING_TASK_ACTION),Ab=nb(hb.SAVE_DRAFT),Rb=nb(hb.PROFILE_SAVED),_b=nb(hb.VALIDATE_PROFILE);let Ib=function(e){return e.DEPENDENT_LOOKUPS_STRUCTURE_SET="DEPENDENT_LOOKUPS_STRUCTURE_SET",e.DEPENDENT_LOOKUPS_INITED_TYPE_URIS_ADDED="DEPENDENT_LOOKUPS_INITED_TYPE_URIS_ADDED",e.DEPENDENT_LOOKUPS_EDITORS_BLOCKED="DEPENDENT_LOOKUPS_EDITORS_BLOCKED",e.DEPENDENT_LOOKUPS_EDITOR_TOUCHED="DEPENDENT_LOOKUPS_EDITOR_TOUCHED",e}({});const Nb=nb(Ib.DEPENDENT_LOOKUPS_STRUCTURE_SET),Db=nb(Ib.DEPENDENT_LOOKUPS_INITED_TYPE_URIS_ADDED),Pb=nb(Ib.DEPENDENT_LOOKUPS_EDITORS_BLOCKED),kb=nb(Ib.DEPENDENT_LOOKUPS_EDITOR_TOUCHED);let Lb=function(e){return e.MODE_UPDATED="MODE_UPDATED",e.MODE_EDITING_CANCELED="MODE_EDITING_CANCELED",e.MODE_UPDATE_REQUESTED="MODE_UPDATE_REQUESTED",e}({});function Ub(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){jb(e,t,r[t])}))}return e}function jb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Fb={structure:{},editors:{},initedTypeUris:[]},Mb="SEARCH_RESULTS_SET",Vb="KEYWORD_UPDATED",Bb="UPDATE_STATE",zb="ACTIVITY_FILTER_UPDATED",Hb="GLOBAL_FILTER_UPDATED",Yb="SEARCH_OPTIONS_UPDATED",Wb="SET_SEARCH_OPTIONS_CONFIG",Gb="SET_SEARCH_PROVIDER_DATA",qb="SET_SEARCH_NAVIGATION_DATA",Zb="UPDATE_SEARCH_NAVIGATION_DATA_FIELDS",$b=nb(Mb),Kb=nb(Vb),Xb=nb(Bb),Qb=nb("SAVE_STATE"),Jb=nb(zb),ev=nb(Hb),tv=nb(Yb),rv=nb(Wb),nv=nb(Gb),av=nb(qb),iv=nb(Zb),ov=nb("UPDATE_SEARCH_NAVIGATION_DATA_ON_MERGE"),lv=(0,_.path)(["globalFilter","savedSearchesUris"]),sv="searchNavigation";function*cv(){const e=yield(0,Va.Ys)(xI.selectors.getSearchNavigationData),t=yield(0,Va.Ys)(xI.selectors.getSearchProviderData);sessionStorage.setItem(sv,JSON.stringify({searchNavigationData:e,searchProviderData:t}))}function*uv(){let e;try{e=JSON.parse(sessionStorage.getItem(sv))||{}}catch(t){e={}}const{searchNavigationData:t,searchProviderData:r}=e;t&&r&&(yield(0,Va.gz)(nv(r)),yield(0,Va.gz)(av(t)))}const pv=[function*(){yield(0,Va.Fm)([qb,Zb,ub.OPEN_ENTITY],cv)},function*(){yield(0,Va.RE)(uv)}];function dv(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){mv(e,t,r[t])}))}return e}function mv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const gv={searchResults:[],keyword:null,searchOptions:{searchByOv:!1,ovOnly:!1},activityFilter:"active",globalFilter:{query:null,savedSearchesUris:[],isMuted:!0},searchProviderData:null,searchNavigationData:null},yv=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:gv,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Mb:return dv({},e,{searchResults:t.payload});case Vb:{const r=(0,_.pick)(["value","isRawFilter"],t.payload||{});return dv({},e,{keyword:(0,_.isEmpty)(r)?null:r})}case Bb:return dv({},gv,{keyword:(0,_.isNil)(t.payload.keyword)||(0,_.isEmpty)(t.payload.keyword)?null:t.payload.keyword,searchOptions:t.payload.searchOptions||e.searchOptions,activityFilter:e.activityFilter,globalFilter:e.globalFilter,searchNavigationData:e.searchNavigationData,searchProviderData:e.searchProviderData});case zb:return dv({},e,{activityFilter:t.payload});case Hb:return dv({},e,{globalFilter:(0,x.isEmptyValue)(t.payload)?gv.globalFilter:t.payload});case Yb:return dv({},e,{searchOptions:dv({},e.searchOptions,t.payload)});case Wb:{const r=!!t.payload.showSearchByOv;return dv({},e,{searchOptions:{searchByOv:r,ovOnly:r}})}case Gb:return dv({},e,{searchProviderData:t.payload});case qb:return dv({},e,{searchNavigationData:t.payload});case Zb:return dv({},e,{searchNavigationData:dv({},e.searchNavigationData,t.payload)});case ub.OPEN_ENTITY:{var r;const n=(0,x.removeDtssPrefixFromEntityUri)(t.payload.uri);return"navigation"===t.payload.source||n===(null===(r=e.searchNavigationData)||void 0===r?void 0:r.uri)?e:dv({},e,{searchNavigationData:null})}default:return e}},fv=e=>{let{uri:t,source:r=null,screen:n="profile"}=e;return{type:ub.OPEN_ENTITY,payload:{uri:t,source:r,screen:n}}},hv=e=>{let{entity:t}=e;return{type:ub.NEW_ENTITY_SHOWN,payload:{entity:t}}},Ev=nb(ub.ENTITY_DELETION_FINISHED),bv=nb(ub.OPEN_PERSPECTIVE),vv=e=>({type:ub.SHOW_NOTIFICATION,payload:e}),Tv=e=>({type:ub.CLOSE_NOTIFICATION,payload:e}),Ov=nb(ub.CLEAR_NOTIFICATIONS),xv=nb(ub.PATHS_SET),Cv=nb(ub.UI_PATH_SET),Sv=nb(ub.UI_CONFIG_LOADED),wv=nb(ub.NEW_UI_CONFIG_LOADED),Av=nb(ub.LOCALE_ATTRIBUTE_PRESENTATION_LOADED),Rv=nb(ub.AUTOCLOSE_INTERVAL_LOADED),_v=nb(ub.SET_PREFER_REACT),Iv=nb(ub.NUMBER_FORMAT_UPDATED),Nv=(e,t,r)=>({type:ub.OPEN_CONSOLE_APP,payload:{name:e,path:t,query:r}}),Dv=nb(ub.OPEN_APP_FROM_CHOCOLATE_BAR),Pv=nb(ub.OPEN_GRAPH),kv=nb(ub.LOCALIZATION_LOADED),Lv=nb(ub.DATE_MASK_UPDATED),Uv=nb(ub.DATE_TIME_MASK_UPDATED),jv=e=>({type:ub.OPEN_SEARCH,payload:"searchState"in e?e:{searchState:e}}),Fv=e=>({type:ub.OPEN_DASHBOARD,payload:e}),Mv=nb(ub.OPEN_HISTORY_EVENT),Vv=nb(ub.OPEN_NEW_ENTITY_WITH_AUTHORING),Bv=nb(ub.OPEN_PREVIOUS_PAGE),zv=nb(ub.NAVIGATE),Hv=nb(ub.KEYS_SET),Yv=nb(ub.OPEN_PIVOTING_PERSPECTIVE),Wv=nb(ub.ERROR_SET),Gv=nb(ub.DOCUMENTATION_SET),qv=nb(ub.ADD_DASHBOARD_EXTERNAL_VIEW),Zv=nb(ub.SET_USE_SHARED_PREFERENCES);function $v(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Kv(e,t,r[t])}))}return e}function Kv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Xv=(0,_.path)(["paths","imagePath"]),Qv=(0,_.path)(["paths","exportPath"]),Jv=(0,_.path)(["paths","apiPath"]),eT=(0,_.path)(["paths","uiPath"]),tT=(0,_.path)(["paths","reltioPath"]),rT=(0,_.path)(["paths","dtssPath"]),nT=(0,_.path)(["paths","exportDQPath"]),aT=(0,_.either)((0,_.path)(["newConfig","properties","workflow","path"]),(0,_.path)(["paths","workflowPath"])),iT=(0,_.prop)("paths"),oT=(0,_.path)(["paths","workflowEnvironmentURL"]),lT=(0,_.path)(["paths","collaborationPath"]),sT=(0,_.path)(["paths","imageServicePath"]),cT=(0,_.path)(["paths","dvfPath"]),uT=(0,_.path)(["paths","validationServicePath"]),pT=(0,_.path)(["paths","adminToolsPath"]),dT=(0,_.path)(["paths","mlDqPath"]),mT=(0,kc.createSelector)((e=>(0,_.path)(["newConfig","properties","attributes","presentation"])(e)),(()=>x.intl.getLocale()),(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return $v({},e,(0,x.getSpecialAttributesPresentation)(e,t))})),gT=(0,_.either)((0,_.path)(["config","com.reltio.plugins.entity.EntityRequestSettings","defaultMaxValues"]),(0,_.path)(["newConfig","properties","entity","maxValuesInResponse"])),yT=(0,_.path)(["numberFormat"]),fT=(0,_.either)((0,_.path)(["newConfig","properties","masks","dateMask"]),(0,_.path)(["dateMask"])),hT=(0,_.path)(["notifications"]),ET=(0,_.either)((0,_.path)(["newConfig","properties","masks","dateTimeMask"]),(0,_.path)(["dateTimeMask"])),bT=(0,_.path)(["newConfig","properties","requestProvider"]),vT=["config","com.reltio.plugins.pivoting.PivotingSettings","pivotingAttributes"],TT=(0,_.chain)((0,_.prop)("attributeTypes")),OT=(0,_.ifElse)((0,_.hasPath)(vT),(0,_.path)(vT),(0,_.pipe)((0,_.pathOr)([],["newConfig","pivoting"]),TT)),xT=(0,_.either)((0,_.path)(["config","com.reltio.plugins.imageattribute.fieldsorder"]),(0,_.path)(["newConfig","properties","image","attributeFieldsOrder"])),CT=(0,_.either)((0,_.path)(["config","com.reltio.plugins.ui.LookupAutocomplete"]),(0,_.path)(["newConfig","properties","lookups","autocomplete"])),ST=(0,_.path)(["keys","googleMapKey"]),wT=(0,_.path)(["keys","icpLicenseKey"]),AT=(0,_.pathOr)("",["documentation","releaseNotes"]),RT=["config","com.reltio.plugins.entity.ValidationServiceLevels","levels"],_T=(0,_.ifElse)((0,_.hasPath)(RT),(0,_.path)(RT),(0,_.path)(["newConfig","properties","validation","levels"])),IT=(0,_.ifElse)((0,_.hasPath)(["config","com.reltio.plugins.entity.Validation","validateReadMode"]),(0,_.path)(["config","com.reltio.plugins.entity.Validation","validateReadMode"]),(0,_.pathOr)(!0,["newConfig","properties","validation","validateReadMode"])),NT=(0,_.pathOr)(!1,["newConfig","properties","validation","validateRelations"]),DT=(0,_.pathOr)(!1,["newConfig","properties","validation","validateReferenceEntityInReadMode"]),PT=(0,_.either)((0,_.path)(["config","com.reltio.plugins.workflow.configuration","enabled"]),(0,_.path)(["newConfig","properties","workflow","enabled"])),kT=(0,_.path)(["error"]),LT=(0,_.path)(["paths","servicesPath"]),UT=(0,_.path)(["newConfig"]),jT=(0,_.path)(["newConfig","layout"]),FT=(0,_.path)(["newConfig","profile"]),MT=(0,_.pathOr)(!0,["newConfig","properties","showEntityId"]),VT=(0,_.path)(["newConfig","properties","release"]),BT=(0,_.path)(["newConfig","properties","logo"]),zT=(0,_.path)(["newConfig","properties","headerColor"]),HT=(0,_.path)(["newConfig","properties","showSearchByOv"]),YT=(0,_.path)(["newConfig","properties","showAttributeDescription"]),WT=(0,_.path)(["newConfig","properties","attributes","sorting"]),GT=(0,_.path)(["newConfig","properties","profileCheckUpdate"]),qT=(0,_.pathOr)(!1,["newConfig","properties","aiAssistant","enabled"]),ZT=(0,_.pathOr)(500,["newConfig","properties","aiAssistant","messagesPerDay"]),$T=(0,_.path)(["newConfig","properties","aiAssistant","skills"]),KT=(0,_.path)(["newConfig","properties","aiAssistant","historyBufferSize"]),XT=(0,_.pathOr)(!1,["newConfig","properties","queryEstimator","enabled"]),QT=(0,_.pathOr)(!1,["newConfig","properties","sharedPreferences","enabled"]);function JT(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){eO(e,t,r[t])}))}return e}function eO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const tO={},rO=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:tO,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ub.PATHS_SET:return JT({},e,{paths:t.payload});case ub.UI_PATH_SET:return(0,_.evolve)({paths:(0,_.assoc)("uiPath",t.payload)},e);case ub.UI_CONFIG_LOADED:return JT({},e,{config:t.payload});case ub.NEW_UI_CONFIG_LOADED:return JT({},e,{newConfig:t.payload});case ub.LOCALE_ATTRIBUTE_PRESENTATION_LOADED:return(0,_.evolve)({newConfig:{properties:{attributes:{presentation:(0,_.assoc)(x.LOCALE_ATTRIBUTE_PRESENTATION,t.payload)}}}},e);case ub.AUTOCLOSE_INTERVAL_LOADED:return JT({},e,{autoCloseInterval:t.payload});case ub.NUMBER_FORMAT_UPDATED:return JT({},e,{numberFormat:t.payload});case ub.DATE_MASK_UPDATED:return JT({},e,{dateMask:t.payload});case ub.DATE_TIME_MASK_UPDATED:return JT({},e,{dateTimeMask:t.payload});case ub.KEYS_SET:return JT({},e,{keys:t.payload});case ub.ERROR_SET:return JT({},e,{error:t.payload});case ub.DOCUMENTATION_SET:return JT({},e,{documentation:t.payload});case ub.SHOW_NOTIFICATION:return JT({},e,{notifications:[...e.notifications||[],t.payload]});case ub.CLOSE_NOTIFICATION:return(0,_.evolve)({notifications:(0,_.reject)((0,_.propEq)("id",t.payload))},e);case ub.CLEAR_NOTIFICATIONS:return JT({},e,{notifications:[]});case ub.SET_USE_SHARED_PREFERENCES:return JT({},e,{useSharedPreferences:t.payload});default:return e}},nO="USER_UPDATED",aO=(nb(nO),null),iO=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:aO,t=arguments.length>1?arguments[1]:void 0;return t.type===nO?t.payload||aO:e},oO="TENANT_UPDATED",lO="TENANT_NAME_UPDATED",sO=(nb(oO),nb(lO),(0,_.prop)("id")),cO=(0,_.prop)("name");function uO(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){pO(e,t,r[t])}))}return e}function pO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const dO=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case oO:return uO({},e,{id:t.payload});case lO:return uO({},e,{name:t.payload});default:return e}},mO="ENVIRONMENT_UPDATED",gO="ENVIRONMENT_ALIAS_UPDATED",yO=(nb(mO),nb(gO),(0,_.prop)("id")),fO=(0,_.prop)("alias");function hO(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){EO(e,t,r[t])}))}return e}function EO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const bO=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case mO:return hO({},e,{id:t.payload});case gO:return hO({},e,{alias:t.payload});default:return e}},vO=e=>e.dataTenants,TO=e=>e.tenants,OO=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:dC(e);return e.metadata&&e.metadata[t]},xO=e=>e.tenant,CO=e=>e.environment,SO=e=>e.user,wO=e=>e.ui,AO=e=>e.profile,RO=e=>e.search,_O=e=>mR(AO(e)),IO=e=>RR(AO(e)),NO=e=>_R(AO(e)),DO=(e,t)=>jR(AO(e),t),PO=(e,t,r)=>kR(AO(e),t,r),kO=(e,t,r)=>LR(AO(e),t,r),LO=(e,t,r)=>PR(AO(e),t,r),UO=(e,t)=>FR(AO(e),t),jO=e=>MR(AO(e)),FO=(e,t,r)=>UR(AO(e),t,r),MO=e=>ER(AO(e)),VO=e=>yR(AO(e)),BO=e=>DR(AO(e)),zO=e=>u_(AO(e)),HO=e=>p_(AO(e)),YO=e=>d_(AO(e)),WO=e=>m_(AO(e)),GO=e=>g_(AO(e)),qO=(e,t)=>IR(AO(e),t),ZO=(e,t)=>NR(AO(e),t),$O=e=>gR(AO(e)),KO=(e,t)=>y_(AO(e),t),XO=(e,t,r)=>{let{uri:n}=r;return KR(AO(e),t,n)},QO=(e,t,r)=>{let{uri:n}=r;return XR(AO(e),t,n)},JO=(e,t,r)=>QR(AO(e),t,r),ex=e=>Xv(wO(e)),tx=e=>Jv(wO(e)),rx=e=>Qv(wO(e)),nx=e=>eT(wO(e)),ax=e=>tT(wO(e)),ix=e=>sT(wO(e)),ox=e=>pT(wO(e)),lx=e=>mT(wO(e)),sx=e=>yT(wO(e)),cx=e=>gT(wO(e)),ux=e=>(e=>e.autoCloseInterval)(wO(e)),px=e=>fT(wO(e)),dx=e=>ET(wO(e)),mx=e=>bT(wO(e)),gx=e=>hT(wO(e)),yx=e=>OT(wO(e)),fx=e=>xT(wO(e)),hx=e=>CT(wO(e)),Ex=e=>ST(wO(e)),bx=e=>wT(wO(e)),vx=e=>_T(wO(e)),Tx=e=>IT(wO(e)),Ox=e=>NT(wO(e)),xx=e=>DT(wO(e)),Cx=e=>qT(wO(e)),Sx=e=>ZT(wO(e)),wx=e=>$T(wO(e)),Ax=e=>KT(wO(e)),Rx=e=>QT(wO(e)),_x=e=>(e=>e.searchResults)(RO(e)),Ix=e=>(e=>e.keyword)(RO(e)),Nx=e=>x.getActivityFilter(RO(e)),Dx=e=>x.getSearchOptions(RO(e)),Px=e=>(e=>e.searchProviderData)(RO(e)),kx=e=>(e=>e.searchNavigationData)(RO(e)),Lx=(e,t)=>x.getGlobalSearchRequestOptions(RO(e),t),Ux=e=>x.getStringifiedSearchOptions(RO(e)),jx=e=>(e=>e.globalFilter)(RO(e)),Fx=e=>x.getGlobalFilterQuery(RO(e)),Mx=e=>lv(RO(e)),Vx=e=>vR(AO(e)),Bx=e=>VR(AO(e)),zx=e=>BR(AO(e)),Hx=e=>zR(AO(e)),Yx=e=>fR(AO(e)),Wx=(e,t)=>HR(AO(e),t),Gx=(e,t)=>YR(AO(e),t),qx=(e,t)=>WR(AO(e),t),Zx=(e,t,r)=>GR(AO(e),t,r),$x=(e,t,r)=>qR(AO(e),t,r),Kx=(e,t,r)=>ZR(AO(e),t,r),Xx=(e,t)=>$R(AO(e),t),Qx=e=>Xv(wO(e))||Jv(wO(e)),Jx=e=>(e=>null==e?void 0:e.username)(SO(e)),eC=e=>(e=>null==e?void 0:e.roles)(SO(e)),tC=e=>hR(AO(e)),rC=(e,t)=>JR(AO(e),t),nC=(e,t)=>e_(AO(e),t),aC=(e,t)=>t_(AO(e),t),iC=e=>r_(AO(e)),oC=(e,t,r)=>n_(AO(e),t,r),lC=(e,t)=>a_(AO(e),t),sC=e=>TR(AO(e)),cC=e=>xR(AO(e)),uC=e=>CR(AO(e)),pC=e=>v_(AO(e),kS(e)),dC=e=>sO(xO(e)),mC=e=>cO(xO(e)),gC=e=>yO(CO(e)),yC=e=>fO(CO(e)),fC=e=>rT(wO(e)),hC=e=>nT(wO(e)),EC=e=>aT(wO(e)),bC=e=>iT(wO(e)),vC=e=>oT(wO(e)),TC=e=>PT(wO(e)),OC=e=>lT(wO(e)),xC=e=>cT(wO(e)),CC=e=>uT(wO(e)),SC=e=>dT(wO(e)),wC=(0,kc.createSelector)(SO,dC,x.canUserRegisterConfigEnvironments),AC=(0,kc.createSelector)(SO,dC,x.canUserCreateWorkflowConfigJar),RC=(0,kc.createSelector)(SO,dC,x.canUserCreateWorkflowEnvironmentConfigJar),_C=(0,kc.createSelector)(SO,dC,x.canUserExecuteWorkflowJobs),IC=(0,kc.createSelector)(SO,dC,x.canUserExecuteWorkflowJobsSyncBusinessProcessData),NC=(0,kc.createSelector)(SO,dC,x.canUserExecuteWorkflowJobsTerminateProcessInstance),DC=(0,kc.createSelector)(SO,dC,x.canUserExecuteWorkflowJobsUpdateTasks),PC=(0,kc.createSelector)(SO,dC,x.canUserExecuteWorkflowJobsValidateTasks),kC=(0,kc.createSelector)(SO,dC,x.canUserManageWorkflowDefinition),LC=(0,kc.createSelector)(SO,dC,x.canUserManageWorkflowEnvironmentDefinition),UC=(0,kc.createSelector)(SO,dC,x.canUserReadWorkflowDataTask),jC=(0,kc.createSelector)(SO,dC,x.canUserUpdateProcessInstance),FC=(0,kc.createSelector)(SO,dC,x.canUserUpdateWorkflowDataTask),MC=(0,kc.createSelector)(SO,dC,x.canUserViewProcessInstanceSearchQuery),VC=(0,kc.createSelector)(SO,dC,x.canUserViewWorkflowConfigJar),BC=(0,kc.createSelector)(SO,dC,x.canUserViewWorkflowDefinition),zC=(0,kc.createSelector)(SO,dC,x.canUserViewWorkflowEnvironmentConfigJar),HC=(0,kc.createSelector)(SO,dC,x.canUserViewWorkflowJobs),YC=(0,kc.createSelector)(SO,dC,x.canUserMakeExport),WC=(0,kc.createSelector)(SO,dC,x.canUserMakeActivitiesExport),GC=(0,kc.createSelector)(SO,dC,x.canUserImportEntitiesFromDT),qC=(0,kc.createSelector)(SO,dC,x.canUserReadEntitiesFromDT),ZC=(0,kc.createSelector)(SO,dC,x.canUserStartProcessInstanceFromQuery),$C=(0,kc.createSelector)(SO,dC,x.canUserMakeBulkUpdate),KC=(0,kc.createSelector)(SO,dC,x.canUserDeleteProfiles),XC=(0,kc.createSelector)(SO,dC,x.canUserOpenDataLoader),QC=(0,kc.createSelector)(SO,dC,x.canUserGetDQStatistic),JC=(0,kc.createSelector)(SO,dC,x.canUserReadDVF),eS=(0,kc.createSelector)(OC,WO,((e,t)=>!!e&&!t)),tS=(0,kc.createSelector)(EC,TC,((e,t)=>!!e&&!!t)),rS=(e,t)=>{var r;return null===(r=SR(AO(e)))||void 0===r?void 0:r.find((0,_.propEq)("id",t))},nS=(e,t)=>Boolean(rS(e,t)),aS=e=>nS(e,x.SidePanelViewId.Workflow),iS=e=>nS(e,x.SidePanelViewId.Discussion),oS=e=>nS(e,x.SidePanelViewId.History),lS=e=>nS(e,x.SidePanelViewId.DB),sS=e=>{var t,r;return null!==(t=null===(r=rS(e,x.SidePanelViewId.DB))||void 0===r?void 0:r.views)&&void 0!==t?t:[]},cS=e=>bR(AO(e)),uS=e=>i_(AO(e)),pS=(e,t)=>o_(AO(e),t),dS=e=>l_(AO(e)),mS=e=>s_(AO(e)),gS=(e,t)=>c_(AO(e),t),yS=e=>kT(wO(e)),fS=(e,t)=>{const r=OO(e),n=Vx(e),a=_O(e),{nextEntry:i,inRelations:o=[],outRelations:l=[]}=t,s=n===x.Mode.Editing||n===x.Mode.Suggesting,c=n===x.Mode.Suggesting&&(0,x.isTempUri)(null==a?void 0:a.uri),u=kS(e);if(!s||c&&!u||i||!a)return!1;{const e=(0,x.checkMetadataForUpdate)(n,(0,x.getEntityType)(r,a.type)),t=o.concat(l).map((e=>(0,x.getRelationType)(r,e.uri||e))).some((0,_.both)((0,x.checkMetadataForCreate)(n),(0,x.checkMetadataForUpdate)(n)));return e&&t}},hS=(0,kc.createSelector)(_O,zx,YO,zO,x.getProfileEntityWithHistoryDiff),ES=(0,kc.createSelector)(_O,zx,YO,x.getProfileEntityWithoutHistoryDiff),bS=e=>LT(wO(e)),vS=e=>UT(wO(e)),TS=e=>jT(wO(e)),OS=e=>FT(wO(e)),xS=e=>MT(wO(e)),CS=e=>VT(wO(e)),SS=e=>AT(wO(e)),wS=e=>BT(wO(e)),AS=e=>zT(wO(e)),RS=e=>HT(wO(e)),_S=e=>YT(wO(e)),IS=e=>WT(wO(e)),NS=e=>GT(wO(e)),DS=(e,t)=>((e,t)=>(0,x.getAuthoringItemsFromLayoutByEntityType)(FT(e),t))(wO(e),t),PS=(e,t)=>((e,t)=>(0,_.path)(["newConfig","properties","cleanse",t])(e))(wO(e),t),kS=e=>{const t=_O(e),r=DS(e,null==t?void 0:t.type);return!(0,x.isEmptyValue)(r)},LS=e=>XT(wO(e)),US=e=>wR(AO(e)),jS=e=>AR(AO(e)),FS=(e,t)=>tS(e)&&ZC(e)&&(0,x.checkMetadataPermission)(x.MetadataPermissions.INITIATE_CHANGE_REQUEST,t);let MS=function(e){return e.MODIFIED_ENTITY_CREATED="MODIFIED_ENTITY_CREATED",e.MODIFIED_ENTITY_DELETED="MODIFIED_ENTITY_DELETED",e.MODIFIED_ENTITY_DEFAULT_PROFILE_PIC_SET="MODIFIED_ENTITY_DEFAULT_PROFILE_PIC_SET",e.MODIFIED_ENTITIES_RESET="MODIFIED_ENTITIES_RESET",e.CLEANSE_LOADING="CLEANSE_LOADING",e}({}),VS=function(e){return e.RELATIONS_LOADED="RELATIONS_LOADED",e.REMOVE_RELATION="REMOVE_RELATION",e.EDIT_RELATION="EDIT_RELATION",e.ADD_RELATION="ADD_RELATION",e.OPEN_RELATION_EDITOR="OPEN_RELATION_EDITOR",e.CLOSE_RELATION_EDITOR="CLOSE_RELATION_EDITOR",e.SET_RELATION_TYPE="SET_RELATION_TYPE",e.SET_RELATION_ENTITY="SET_RELATION_ENTITY",e.SET_INITIAL_INFO="SET_INITIAL_INFO",e.IGNORE_RELATION="IGNORE_RELATION",e.SECOND_LEVEL_RELATIONS_LOADED="SECOND_LEVEL_RELATIONS_LOADED",e}({});var BS=r(51095);const zS=(e,t)=>e.find((0,_.pipe)(x.getRelationUriFromConnection,(0,_.equals)(t))),HS=(e,t)=>(0,_.path)([t,"connections"],e),YS=r.n(BS)()(HS,((e,t)=>(0,_.path)([t,"drafts"],e)),((e,t,r)=>r),(function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const{addedConnections:a=[],editedConnections:i=[],removedUris:o=[],ignoredRelationData:l=[]}=r,s=(0,_.pipe)(x.getRelationUriFromConnection,_.equals,(0,_.find)(_.__,o)),c=l.map((e=>e.relationUri)),u=(0,_.pipe)(x.getRelationUriFromConnection,_.equals,(0,_.find)(_.__,c)),p=e=>(0,_.pipe)((0,_.eqBy)(x.getRelationUriFromConnection),(0,_.find)(_.__,i),(0,_.unless)(_.isNil,x.markEdited))(e),d=n?(null===(e=t.find((e=>e.entity.entityUri===n)))||void 0===e?void 0:e.connections)||[]:t,m=a.filter((0,_.propEq)("parentEntityUri",n));return m.map(x.markNew).concat(d.filter((e=>!m.some((0,_.pipe)(x.getRelationUriFromConnection,(0,_.equals)((0,x.getRelationUriFromConnection)(e)))))).map((0,_.pipe)((0,_.either)(p,_.identity),(0,_.when)(s,x.markRemoved),(0,_.when)(u,x.markIgnored))))}))(((e,t,r)=>t+r)),WS=(e,t,r)=>{const n=(0,x.getTempRelations)(e,t);return zS(n,r)};function*GS(e){yield(0,Va.gw)(0);const t=e.payload,r=yield(0,Va.Ys)(OO),n=yield(0,Va.Ys)(uS),a=[t.type],i=yield(0,Va.Ys)(dS),o=(0,x.initDependentLookups)({structure:n,metadata:r,typeUris:a,alreadyAddedTypeUris:i}),l=(0,x.populateDependentLookupsFromEntity)({structure:o,metadata:r,entityOrRelation:t});yield(0,Va.gz)(Nb(l)),yield(0,Va.gz)(Db(a))}function*qS(e,t){const r=(0,x.getBaseUri)(e);return(0,x.isRelationUri)(r)?yield(0,Va.Ys)(kO,t,r):yield(0,Va.Ys)(qO,r)}function*ZS(e){const{attributeType:t,metadata:r,parentUri:n,viewId:a}=e.payload,i=yield(0,Va.RE)(qS,n,a),o=yield(0,Va.Ys)(uS);if(i)if(t){const e=(0,x.findAttributeValuesByTypeUri)(r,i,t.uri).filter((e=>{let{uri:t}=e;return t.startsWith(n)}))[0],a=(0,x.addValueToDependentLookups)({structure:o,attributeValue:e});yield(0,Va.gz)(Nb(a))}else{const e=[i.type],t=yield(0,Va.Ys)(dS),n=(0,x.initDependentLookups)({structure:o,metadata:r,typeUris:e,alreadyAddedTypeUris:t}),a=(0,x.populateDependentLookupsFromEntity)({structure:n,metadata:r,entityOrRelation:i});yield(0,Va.gz)(Nb(a)),yield(0,Va.gz)(Db(e))}}function*$S(e){const t=e.payload,r=yield(0,Va.Ys)(OO),n=yield(0,Va.Ys)(uS);let a=n;for(const e of t){const{attributeType:t,parentUri:i,viewId:o}=e;if((0,x.isAttributeTypeInDependentLookups)(n,t.uri)){const e=yield(0,Va.RE)(qS,i,o);e&&(a=(0,x.syncAttributeTypeWithDependentLookups)({structure:a,entityOrRelation:e,attrTypeUri:t.uri,metadata:r}))}}a!==n&&(yield(0,Va.gz)(Nb(a)))}function*KS(e){let{structure:t,attributeType:r,value:n}=e;if((0,x.isReference)(r)&&n){const e=(0,x.getReferencedEntityUriFromAttrValue)(n);if((0,x.isTempUri)(e))return yield(0,Va.RE)(ew,t,e)}return t}function*XS(e){let{structure:t,uri:r,attributeType:n,value:a}=e,i=(0,x.removeValuesFromDependentLookups)({structure:t,uri:r});if(i=yield(0,Va.RE)(KS,{structure:i,attributeType:n,value:a}),i=(0,x.addValueToDependentLookups)({structure:i,attributeValue:a}),(0,x.isReference)(n)&&a){const e=(0,x.getReferencedEntityUriFromAttrValue)(a);(0,x.isTempUri)(e)&&(i=yield(0,Va.RE)(JS,i,e))}i!==t&&(yield(0,Va.gz)(Nb(i)))}function*QS(e){yield(0,Va.gw)(0);const{attributeType:t,uri:r,viewId:n,silent:a,value:i}=e.payload,o=yield(0,Va.Ys)(uS),l=yield(0,Va.RE)(qS,r,n);if(l&&(0,x.isAttributeTypeInDependentLookups)(o,t.uri)){const{value:n,lookupCode:i}=e.payload.value,l=i||n;a||(yield(0,Va.rM)(nw,o,{type:t.uri,uri:r,lookupValue:l}));const s=(0,x.addValueToDependentLookups)({structure:o,attributeValue:{type:t.uri,value:l,uri:r}});yield(0,Va.gz)(Nb(s))}l&&(0,x.isComplexAttribute)(t.type)&&(yield(0,Va.RE)(XS,{structure:o,uri:r,attributeType:t,value:i}))}function*JS(e,t){const r=yield(0,Va.Ys)(OO),n=yield(0,Va.Ys)(qO,t);if(!n)return e;const a=yield(0,Va.Ys)($O),i=(0,x.findRelatedTemporaryEntities)(a,n);let o=e;for(const e of[n,...i])o=(0,x.populateDependentLookupsFromEntity)({structure:o,metadata:r,entityOrRelation:e});return o}function*ew(e,t){const r=yield(0,Va.Ys)(qO,t),n=yield(0,Va.Ys)($O),a=(0,x.findRelatedTemporaryEntities)(n,r).map((0,_.prop)("uri"));let i=e;for(const e of[t,...a])i=(0,x.removeValuesFromDependentLookups)({structure:i,uri:e});return i}function*tw(e){const{attributeType:t,uri:r,attributeValue:n,viewId:a}=e.payload,i=yield(0,Va.Ys)(uS),o=(0,x.isAttributeTypeInDependentLookups)(i,t.uri);if(yield(0,Va.RE)(qS,r,a)){o&&(yield(0,Va.rM)(nw,i,{type:t.uri,uri:r,lookupValue:""}));let e=o||(0,x.isComplexAttribute)(t)?(0,x.removeValuesFromDependentLookups)({structure:i,uri:r}):i;e=yield(0,Va.RE)(KS,{structure:e,attributeType:t,value:n}),e!==i&&(yield(0,Va.gz)(Nb(e)))}}function*rw(e){yield(0,Va.gw)(0);const t=yield(0,Va.Ys)(uS),r=yield(0,Va.RE)(ew,t,e.payload);yield(0,Va.gz)(Nb(r))}function*nw(e,t){var r;const n=yield(0,Va.Ys)(OO),a=yield(0,Va.Ys)($O),i=yield(0,Va.Ys)(qx),o=yield(0,Va.Ys)(IO),l=yield(0,Va.Ys)(hx),s=yield(0,Va.Ys)(mS),c=yield(0,Va.Ys)(US),u=(0,x.getDependentLookupStateForValueUri)({structure:e,typeUri:t.type,valueUri:t.uri,modifiedEntities:a,connections:i,entityUri:o,config:l,editorsState:s,hiddenAttributes:null!==(r=c[o])&&void 0!==r?r:[]});if(u.length>0){const e=u.map((e=>e.uri));yield(0,Va.gz)(Pb({uris:e,isBlocked:!0}));try{const e=yield(0,Va.RE)(x.cascadeUpdate,u,t);for(const r of e){const{type:e,uri:a,lookupValue:i,displayName:o}=r,l=(yield(0,Va.Ys)(Xx,(0,x.getBaseUri)(a)))[0],s=yield(0,Va.RE)(qS,a,l);s&&(0,x.findAttributeValueByUri)(s,a)&&a!==t.uri&&(yield(0,Va.gz)(vb({attributeType:(0,x.findAttributeTypeByUri)(n,e),uri:a,value:{value:o||"",lookupCode:i||""},silent:!0,viewId:l})))}}catch(e){console.warn(e)}yield(0,Va.gz)(Pb({uris:e,isBlocked:!1}))}}function*aw(e){const t=e.payload.connection,r=(0,x.getEntityUriFromConnection)(t);if((0,x.isTempUri)(r)&&(yield(0,Va.Ys)(qO,r))){yield(0,Va.qn)(Ib.DEPENDENT_LOOKUPS_STRUCTURE_SET);const e=yield(0,Va.Ys)(uS),t=yield(0,Va.RE)(JS,e,r);yield(0,Va.gz)(Nb(t))}}function*iw(e){const t=e.payload.relationUri,r=yield(0,Va.Ys)(uS),n=(0,x.removeValuesFromDependentLookups)({structure:r,uri:t});yield(0,Va.gz)(Nb(n))}function*ow(e){const t=e.payload.id,r=e.payload.relationUri;if(0===(yield(0,Va.Ys)(Xx,r)).length){const e=yield(0,Va.Ys)(uS);let n=(0,x.removeValuesFromDependentLookups)({structure:e,uri:r});const a=yield(0,Va.Ys)(LO,t),i=zS(a,r),o=(0,x.getEntityUriFromConnection)(i);(0,x.isTempUri)(o)&&(n=yield(0,Va.RE)(ew,n,o)),yield(0,Va.gz)(Nb(n))}}const lw=[function*(){yield(0,Va.ib)(MS.MODIFIED_ENTITY_CREATED,GS)},function*(){yield(0,Va.ib)(MS.MODIFIED_ENTITY_DELETED,rw)},function*(){yield(0,Va.ib)(hb.ADD_DEFAULT_VALUES,ZS)},function*(){yield(0,Va.ib)(hb.ADD_ATTRIBUTES,$S)},function*(){yield(0,Va.ib)(hb.MODIFY_ATTRIBUTE,QS)},function*(){yield(0,Va.ib)(hb.REMOVE_ATTRIBUTE,tw)},function*(){yield(0,Va.ib)(VS.OPEN_RELATION_EDITOR,aw)},function*(){yield(0,Va.ib)(VS.SET_RELATION_TYPE,iw)},function*(){yield(0,Va.ib)(VS.CLOSE_RELATION_EDITOR,ow)}];let sw=function(e){return e.ENTITY_LOADED="ENTITY_LOADED",e.DEFAULT_PROFILE_PIC_SET="DEFAULT_PROFILE_PIC_SET",e.LOAD_ENTITY="LOAD_ENTITY",e.ENTITY_CREATION_REQUESTED="ENTITY_CREATION_REQUESTED",e.ENTITY_CREATION_WITH_AUTHORING_REQUESTED="ENTITY_CREATION_WITH_AUTHORING_REQUESTED",e.ENTITY_REMOVE_REQUESTED="ENTITY_REMOVE_REQUESTED",e.CLEAR_ENTITY="CLEAR_ENTITY",e.CLONE_ENTITY="CLONE_ENTITY",e.ENTITY_AUTHORING_DRAFT_ENTITIES_LOADED="ENTITY_AUTHORING_DRAFT_ENTITIES_LOADED",e.AUTHORING_DCR_RESOLVED="AUTHORING_DCR_RESOLVED",e}({});const cw=(e,t)=>({type:sw.ENTITY_LOADED,payload:{entity:e,silent:t}}),uw=nb(sw.DEFAULT_PROFILE_PIC_SET),pw=nb(sw.LOAD_ENTITY),dw=nb(sw.ENTITY_CREATION_REQUESTED),mw=nb(sw.ENTITY_CREATION_WITH_AUTHORING_REQUESTED),gw=nb(sw.ENTITY_AUTHORING_DRAFT_ENTITIES_LOADED),yw=nb(sw.AUTHORING_DCR_RESOLVED),fw=nb(sw.ENTITY_REMOVE_REQUESTED),hw=nb(sw.CLONE_ENTITY),Ew=nb(sw.CLEAR_ENTITY),bw=e=>null==e?void 0:e.uri,vw=(0,kc.createSelector)((e=>null==e?void 0:e.dataTenant),bw,((e,t)=>(0,x.getEntityUriForLink)({dataTenant:e,uri:t})));function Tw(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ow(e,t,r[t])}))}return e}function Ow(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const xw={};let Cw=function(e){return e.ERRORS_SET="ERRORS_SET",e.REMOVE_ERROR="REMOVE_ERROR",e.ERROR_DEACTIVATED="ERROR_DEACTIVATED",e}({});const Sw=nb(Cw.ERROR_DEACTIVATED),ww=nb(Cw.ERRORS_SET);function Aw(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Rw(e,t,r[t])}))}return e}function Rw(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const _w=[];let Iw=function(e){return e.HISTORY_DIFF_SET="HISTORY_DIFF_SET",e.HISTORY_DIFF_CLEARED="HISTORY_DIFF_CLEARED",e.HISTORY_EVENT_SET="HISTORY_EVENT_SET",e.HISTORY_EVENT_CLEARED="HISTORY_EVENT_CLEARED",e.HISTORY_SLICE_SET="HISTORY_SLICE_SET",e.HISTORY_MODE_SET="HISTORY_MODE_SET",e}({});const Nw=nb(Iw.HISTORY_DIFF_SET),Dw=nb(Iw.HISTORY_DIFF_CLEARED),Pw=nb(Iw.HISTORY_EVENT_SET),kw=nb(Iw.HISTORY_EVENT_CLEARED),Lw=nb(Iw.HISTORY_SLICE_SET),Uw=nb(Iw.HISTORY_MODE_SET);function jw(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Fw(e,t,r[t])}))}return e}function Fw(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Mw={mode:x.HistoryMode.Current};let Vw=function(e){return e.PROFILE_LAST_LOADED_TIME_UPDATE="PROFILE_LAST_LOADED_TIME_UPDATE",e}({});nb(Vw.PROFILE_LAST_LOADED_TIME_UPDATE);let Bw=function(e){return e.LOOKUPS_LOADED="LOOKUPS_LOADED",e.LOOKUPS_FOR_TYPE_RESOLVED="LOOKUPS_FOR_TYPE_RESOLVED",e.LOOKUPS_LIST_RESOLVED="LOOKUPS_LIST_RESOLVED",e}({});const zw=nb(Bw.LOOKUPS_LOADED),Hw=nb(Bw.LOOKUPS_FOR_TYPE_RESOLVED),Yw=nb(Bw.LOOKUPS_LIST_RESOLVED);function Ww(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Gw(e,t,r[t])}))}return e}function Gw(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const qw={},Zw=(e,t)=>({type:Lb.MODE_UPDATED,payload:{mode:e,silent:t}}),$w=nb(Lb.MODE_UPDATE_REQUESTED),Kw=nb(Lb.MODE_EDITING_CANCELED),Xw=x.isSuggestMode,Qw=(x.isEditMode,x.isViewMode),Jw=x.isEditableMode,eA=x.Mode.Viewing,tA=nb(MS.MODIFIED_ENTITY_CREATED),rA=nb(MS.MODIFIED_ENTITY_DELETED),nA=nb(MS.MODIFIED_ENTITY_DEFAULT_PROFILE_PIC_SET),aA=nb(MS.MODIFIED_ENTITIES_RESET),iA=nb(MS.CLEANSE_LOADING);function oA(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){lA(e,t,r[t])}))}return e}function lA(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const sA={};function cA(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){uA(e,t,r[t])}))}return e}function uA(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*pA(e){const{values:t,parentUri:r,attributeTypeUri:n,attributeTypeName:a}=e.payload;let i=t;const o=yield(0,Va.Ys)(_O);if(r===o.uri){const e=(0,x.getAttributeSource)(n),r=(0,_.pipe)((0,_.pathOr)([],[e,a]),(0,_.map)((0,_.prop)("uri")))(o),l=(0,_.intersection)(r,t.map((0,_.prop)("uri")));i=t.filter((e=>!l.includes(e.uri)))}i.length&&(yield(0,Va.gz)(Ob(cA({},e.payload,{values:i}))))}function*dA(){return{apiPath:yield(0,Va.Ys)(tx),tenant:yield(0,Va.Ys)(dC)}}function*mA(e){const{attributeTypeName:t,attributeTypeUri:r}=e.payload,n=yield(0,Va.RE)(dA);try{const a=yield(0,Va.RE)(x.getPagedEntity,cA({},e.payload,n)),i=(0,x.getAttributeSource)(r),o=(0,_.pathOr)([],[i,t],a);yield(0,Va.gz)(xb(cA({},e.payload,{values:o})))}catch(e){console.warn(e),yield(0,Va.gz)(Wv((0,x.getRequestErrorMessage)(e,mi().text("Something went wrong"))))}}function*gA(e){var t;const{attributeType:r,value:n,uri:a}=e.payload,i=r.uri,o=(0,x.getBaseUri)(i),l=yield(0,Va.Ys)(PS,o);if(!l)return;const s=yield(0,Va.Ys)(OO),c=(0,x.getEntityType)(s,o),u=null==c||null===(t=c.cleanseConfig)||void 0===t?void 0:t.infos;if(!u)return;const p=(0,x.getCleanseType)(l,i);if(!(0,x.hasCleanseTypeInEntityType)(p,u))return;const d=(0,x.getCleanseAttributes)(l);if(null!=d&&d.includes(i)){yield(0,Va.gz)(iA({isLoading:!0}));try{const e=yield(0,Va.RE)(x.cleanseData,{cleanseType:p.split("/cleanse/infos/")[1],type:o,attributes:{[r.name]:[{type:i,value:n}]}}),t=(0,x.getBaseUri)(a),l=yield(0,Va.Ys)(qO,t);if((0,x.hasCleanseStatus)(e))if((0,x.isUnverifiedCleanse)(e))yield(0,Va.gz)(Wv((0,_.path)(x.CLEANSE_STATUS_ERROR_PATH,e)));else if(l){const{attributes:r}=e,n=(0,x.prepareCleansedAttributes)(t,r);yield(0,Va.gz)(tA(cA({},l,{attributes:cA({},l.attributes,n)})))}}catch(e){console.warn(e),yield(0,Va.gz)(Wv((0,x.getRequestErrorMessage)(e,mi().text("Something went wrong"))))}yield(0,Va.gz)(iA({isLoading:!1}))}}const yA=[function*(){yield(0,Va.ib)(hb.REQUEST_NEXT_PAGE_ATTRIBUTE_VALUES,mA)},function*(){yield(0,Va.ib)(hb.PROCESS_NEXT_PAGE_ATTRIBUTE_VALUES,pA)},function*(){yield(0,Va.ib)(hb.MODIFY_ATTRIBUTE,gA)}],fA=nb(VS.RELATIONS_LOADED),hA=nb(VS.SECOND_LEVEL_RELATIONS_LOADED),EA=(0,_.curry)(((e,t)=>({type:VS.REMOVE_RELATION,payload:{id:e,relationUri:t}}))),bA=(0,_.curry)(((e,t)=>({type:VS.IGNORE_RELATION,payload:{id:e,ignoredRelationData:t}}))),vA=(0,_.curry)(((e,t)=>({type:VS.ADD_RELATION,payload:{id:e,connection:t}}))),TA=(0,_.curry)(((e,t)=>({type:VS.EDIT_RELATION,payload:{id:e,connection:t}}))),OA=(0,_.curry)(((e,t)=>({type:VS.OPEN_RELATION_EDITOR,payload:{id:e,connection:t}}))),xA=(0,_.curry)(((e,t)=>({type:VS.CLOSE_RELATION_EDITOR,payload:{id:e,relationUri:t}}))),CA=(0,_.curry)(((e,t,r)=>({type:VS.SET_RELATION_TYPE,payload:{id:e,relationUri:t,relationType:r}}))),SA=(0,_.curry)(((e,t,r)=>({type:VS.SET_RELATION_ENTITY,payload:{id:e,relationUri:t,entityInfo:r}}))),wA=(0,_.curry)(((e,t,r)=>({type:VS.SET_INITIAL_INFO,payload:{id:e,relationUri:t,tempEntity:r}})));function AA(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){RA(e,t,r[t])}))}return e}function RA(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const _A={},IA={removedUris:[],addedConnections:[],editedConnections:[],ignoredRelationData:[]},NA=(e,t,r)=>{if((0,_.pathEq)([...(0,x.getRelationToAddPath)(e),"relation","relationUri"],t,r))return(0,x.getRelationToAddPath)(e);{const n=((0,_.path)((0,x.getRelationsToEditPath)(e),r)||[]).findIndex((0,_.pathEq)(["relation","relationUri"],t));return n>=0?[...(0,x.getRelationsToEditPath)(e),n]:null}},DA=(e,t,r)=>{const n=NA(e,t,r);return n?(0,_.lensPath)([...n,"relation"]):null},PA=(0,_.pipe)(DA,(e=>(0,_.compose)(e,(0,_.lensProp)("object"))));let kA=function(e){return e.TREES_RESET_INITIAL_TREES="TREES_RESET_INITIAL_TREES",e.TREES_RESTORE_FROM_INITIAL_TREES="TREES_RESTORE_FROM_INITIAL_TREES",e.TREES_STATE_RESTORED="TREES_STATE_RESTORED",e.TREES_STATE_SAVED="TREES_STATE_SAVED",e.TREE_ACTIVENESS_DATE_CHANGED="TREE_ACTIVENESS_DATE_CHANGED",e.TREE_CHANGED="TREE_CHANGED",e.TREE_CHILDREN_LOADED="TREE_CHILDREN_LOADED",e.TREE_CHILDREN_LOADING="TREE_CHILDREN_LOADING",e.TREE_COMMANDS_CLEARED="TREE_COMMANDS_CLEARED",e.TREE_CURRENT_ENTITY_SHOWN="TREE_CURRENT_ENTITY_SHOWN",e.TREE_ENTITIES_MAPPING_LOADED="TREE_ENTITIES_MAPPING_LOADED",e.TREE_LOADED="TREE_LOADED",e.TREE_LOADED_WITH_ERROR="TREE_LOADED_WITH_ERROR",e.TREE_LOADING="TREE_LOADING",e.TREE_NODE_CREATED="TREE_NODE_CREATED",e.TREE_NODE_EDITED="TREE_NODE_EDITED",e.TREE_NODE_EDITING_APPLIED="TREE_NODE_EDITING_APPLIED",e.TREE_NODE_EDITING_CANCELED="TREE_NODE_EDITING_CANCELED",e.TREE_NODE_EDITING_STARTED="TREE_NODE_EDITING_STARTED",e.TREE_NODE_ENTITY_CHANGED="TREE_NODE_ENTITY_CHANGED",e.TREE_NODE_EXPANDED="TREE_NODE_EXPANDED",e.TREE_NODE_NEW_CHILD_EDITING_APPLIED="TREE_NODE_NEW_CHILD_EDITING_APPLIED",e.TREE_NODE_NEW_CHILD_EDITING_CANCELED="TREE_NODE_NEW_CHILD_EDITING_CANCELED",e.TREE_NODE_NEW_CHILD_EDITING_STARTED="TREE_NODE_NEW_CHILD_EDITING_STARTED",e.TREE_NODE_NEW_PARENT_EDITING_APPLIED="TREE_NODE_NEW_PARENT_EDITING_APPLIED",e.TREE_NODE_NEW_PARENT_EDITING_CANCELED="TREE_NODE_NEW_PARENT_EDITING_CANCELED",e.TREE_NODE_NEW_PARENT_EDITING_STARTED="TREE_NODE_NEW_PARENT_EDITING_STARTED",e.TREE_NODE_RELATION_TYPE_CHANGED="TREE_NODE_RELATION_TYPE_CHANGED",e.TREE_NODE_REMOVED="TREE_NODE_REMOVED",e.TREE_SECONDARY_LABEL_SHOWN="TREE_SECONDARY_LABEL_SHOWN",e.TREE_SCROLL_TO_NODE_RESET="TREE_SCROLL_TO_NODE_RESET",e.TREE_SORTED="TREE_SORTED",e.TREE_REFRESHED="TREE_REFRESHED",e.TREE_RELATION_CREATED="TREE_RELATION_CREATED",e.TREE_RELATION_EDITED="TREE_RELATION_EDITED",e.TREE_RELATION_REMOVED="TREE_RELATION_REMOVED",e.TREE_RELATION_REPOINTED="TREE_RELATION_REPOINTED",e.TREE_CANCEL_CHILDREN_LOADING="TREE_CANCEL_CHILDREN_LOADING",e}({});nb(kA.TREE_LOADED),nb(kA.TREE_LOADED_WITH_ERROR),nb(kA.TREE_LOADING),nb(kA.TREE_SCROLL_TO_NODE_RESET);const LA=nb(kA.TREE_COMMANDS_CLEARED),UA=(nb(kA.TREE_CHILDREN_LOADING),nb(kA.TREE_CURRENT_ENTITY_SHOWN),nb(kA.TREE_REFRESHED),nb(kA.TREE_NODE_EXPANDED),nb(kA.TREE_RELATION_REMOVED),nb(kA.TREE_NODE_REMOVED),nb(kA.TREE_SECONDARY_LABEL_SHOWN),nb(kA.TREE_ENTITIES_MAPPING_LOADED),nb(kA.TREE_CHANGED)),jA=(nb(kA.TREE_NODE_EDITED),nb(kA.TREE_ACTIVENESS_DATE_CHANGED),nb(kA.TREE_RELATION_REPOINTED),nb(kA.TREE_RELATION_CREATED),nb(kA.TREE_NODE_CREATED),nb(kA.TREE_RELATION_EDITED),nb(kA.TREE_NODE_EDITED),nb(kA.TREE_NODE_EDITING_STARTED),nb(kA.TREE_NODE_EDITING_APPLIED),nb(kA.TREE_NODE_EDITING_CANCELED),nb(kA.TREE_NODE_NEW_PARENT_EDITING_STARTED),nb(kA.TREE_NODE_NEW_PARENT_EDITING_APPLIED),nb(kA.TREE_NODE_NEW_PARENT_EDITING_CANCELED),nb(kA.TREE_NODE_NEW_CHILD_EDITING_STARTED),nb(kA.TREE_NODE_NEW_CHILD_EDITING_APPLIED),nb(kA.TREE_NODE_NEW_CHILD_EDITING_CANCELED),nb(kA.TREE_NODE_RELATION_TYPE_CHANGED),nb(kA.TREE_NODE_ENTITY_CHANGED),nb(kA.TREE_SORTED),nb(kA.TREES_STATE_SAVED),nb(kA.TREES_STATE_RESTORED),nb(kA.TREE_CHILDREN_LOADED),nb(kA.TREES_RESTORE_FROM_INITIAL_TREES)),FA=nb(kA.TREES_RESET_INITIAL_TREES),MA=(nb(kA.TREE_CANCEL_CHILDREN_LOADING),(0,_.path)(["common","commands"]));var VA=r(76665);function BA(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){zA(e,t,r[t])}))}return e}function zA(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const HA=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if((0,_.path)(["entity","uri"],e)===t)return r.forEach((e=>e.expanded=!0)),e;if(e.children)for(const n of e.children){const a=HA(n,t,r.concat(e));if(a)return a}},YA=(e,t)=>{const r=Object.keys(e).reduce(((r,n)=>{const a=e[n];return t[n]&&(a.parent=(0,_.uniq)([].concat(a.parent).concat(t[n].parent).filter(_.identity))),r[n]=a,r}),{});return Object.keys(t).forEach((e=>{r[e]||(r[e]=t[e])})),r},WA=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const r=(0,_.reject)((0,_.prop)("loading")),n=r(e);return t.forEach((t=>{e.find((e=>(0,_.path)(["entity","uri"],e)===t.entity.uri))||n.push(t)})),n},GA=(e,t)=>{if(e&&e.children){const r=e.children.findIndex((e=>{let{nodeId:r}=e;return r===t}));r>-1&&e.children.splice(r,1)}},qA=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;e&&e.children&&e.children.splice(r,0,t)},ZA=e=>{let{path:t,value:r,object:n}=e,a=n;for(let e=0;e<t.length;e++){const n=t[e];e===t.length-1?a[n]="function"==typeof r?r(a[n]):r:(a[n]=a[n]||("number"==typeof n?[]:{}),a=a[n])}},$A=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;e[t]=r,e.children&&e.children.forEach((e=>$A(e,t,r)))},KA=e=>({entity:e.entity,relation:e.relation}),XA=e=>{let{id:t,draft:r,node:n}=e;ZA({path:["editingConnections",n.relation.uri],object:r[t],value:KA(n)})},QA=e=>{let{id:t,draft:r,node:n,entity:a}=e;ZA({path:["editingConnections",n.relation.uri,"entity"],object:r[t],value:a})},JA=e=>{let{id:t,draft:r,node:n,relationTypeUri:a}=e;ZA({path:["editingConnections",n.relation.uri,"relation"],object:r[t],value:e=>BA({},e,{type:a,attributes:{}})})},eR=e=>{let{id:t,draft:r,relationUri:n}=e;delete r[t].editingConnections[n]},tR=e=>{let{id:t,draft:r,relationUri:n}=e;return r[t].editingConnections[n]},rR=e=>{delete e.editingMode,delete e.relatedEntity,delete e.initialConnection},nR=e=>{let{id:t,draft:r,currentNode:n}=e;const a=r[t].root;if(a===n)r[t].root=n.children[0],r[t].root.children=r[t].root.children||[],r[t].root.children.push(...n.children.slice(1));else{const e=(0,x.findParentNodeById)(a,n.nodeId);GA(e,n.nodeId)}},aR=(e,t,r)=>{const n=[e,"editingConnections",t,"relation"];return(0,_.path)(n,r)?(0,_.lensPath)(n):null},iR=(0,_.pick)(["showSecondaryLabel","sortField","sortOrder"]),oR=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return YA(e,t.reduce(((e,t)=>BA({},e,{[t.entity.uri]:(0,_.pick)(["entity","parent","relations"],t)})),{}))},lR=e=>({entity:(0,_.pick)(["uri","type","label","secondaryLabel"],e.entity),parent:[],relations:[(0,_.pick)(["uri","type"],e.relation)]});function sR(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){cR(e,t,r[t])}))}return e}function cR(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const uR={common:{commands:[]},trees:{},initialTrees:{}};let pR=function(e){return e.ENTITY_RELATED_ATTRIBUTES_ADDED="ENTITY_RELATED_ATTRIBUTES_ADDED",e}({});nb(pR.ENTITY_RELATED_ATTRIBUTES_ADDED);const dR={},mR=e=>e.entity,gR=e=>e.modifiedEntities,yR=e=>e.errors,fR=e=>e.relations,hR=e=>e.trees,ER=e=>e.lookups,bR=e=>e.dependentLookups,vR=e=>e.mode,TR=e=>e.lastLoadedTime,OR=e=>e.history,xR=e=>e.operation,CR=e=>e.views,SR=e=>e.sidePanelViews,wR=e=>e.hiddenAttributes,AR=e=>e.controlAttributes,RR=e=>bw(mR(e)),_R=e=>vw(mR(e)),IR=(e,t)=>((e,t)=>t&&e[t])(gR(e),t),NR=(e,t)=>((e,t)=>t&&e[t]&&e[t].defaultProfilePic)(gR(e),t),DR=e=>(0,_.keys)(fR(e)),PR=(e,t,r)=>YS(fR(e),t,r),kR=(e,t,r)=>WS(fR(e),t,r),LR=(e,t,r)=>((e,t,r)=>{const n=WS(e,t,r);return(0,x.getRelationObjectFromConnection)(n)})(fR(e),t,r),UR=(e,t,r)=>((e,t,r)=>{const n=(0,_.pipe)((0,_.pathOr)([],[t,"drafts","addedConnections"]),(0,_.filter)((0,_.pipe)(x.getRelationUriFromConnection,x.isTempUri)),(0,_.when)((0,_.always)(r),(0,_.filter)((0,_.propEq)("parentEntityUri",r))),_.length)(e);return((e,t,r)=>r?(0,_.pipe)((0,_.path)([t,"connections"]),(0,_.find)((e=>{let{entity:t}=e;return t.entityUri===r})),(0,_.pathOr)(0,["total"]))(e):(0,_.pathOr)(0,[t,"total"],e))(e,t,r)+n})(fR(e),t,r),jR=(e,t)=>HS(fR(e),t),FR=(e,t)=>x.getDraftsForSaveByViewId(fR(e),t),MR=e=>(e=>(0,_.keys)(e).reduce(((t,r)=>{const{addedConnections:n,editedConnections:a}=(0,x.getDraftsForSaveByViewId)(e,r);return(0,_.pipe)(_.concat,(0,_.map)(x.getEntityUriFromConnection),(0,_.filter)(x.isTempUri),(0,_.concat)(t))(n,a)}),[]))(fR(e)),VR=e=>Jw(vR(e)),BR=e=>Qw(vR(e)),zR=e=>Xw(vR(e)),HR=(e,t)=>x.getRelationToAddByViewId(fR(e),t),YR=(e,t)=>x.getRelationsToEditByViewId(fR(e),t),WR=(e,t)=>x.getAllRelationsToAddAndEdit(fR(e),t),GR=(e,t,r)=>x.getAllRelationsToSave(fR(e),t,r),qR=(e,t,r)=>x.getInitialConnectionTempEntity(e.relations,t,r),ZR=(e,t,r)=>x.getInitialConnection(e.relations,t,r),$R=(e,t)=>((e,t)=>Object.keys(e).filter((r=>{const n=(0,x.getTempRelations)(e,r);return!!zS(n,t)})))(fR(e),t),KR=(e,t,r)=>((e,t,r)=>(0,_.pipe)((0,_.filter)((0,_.allPass)([(0,_.propEq)("parentUri",t),(0,_.propEq)("attributeTypeUri",r),(0,_.pipe)((0,_.prop)("uri"),_.isEmpty)])),(0,_.map)((0,_.prop)("message")),(0,_.join)(". "))(e))(yR(e),t,r),XR=(e,t,r)=>((e,t,r)=>(0,_.filter)((0,_.allPass)([(0,_.propEq)("parentUri",t),(0,_.propEq)("attributeTypeUri",r),(0,_.pipe)((0,_.prop)("uri"),_.isEmpty,_.not)]))(e))(yR(e),t,r),QR=(e,t,r)=>x.getCachedActiveErrorsForAttributesPager(yR(e),t,r),JR=(e,t)=>((e,t)=>e.trees[t])(hR(e),t),e_=(e,t)=>((e,t)=>(0,_.path)(["trees",t,"root"],e))(hR(e),t),t_=(e,t)=>((e,t)=>(0,_.path)(["trees",t,"total"],e))(hR(e),t),r_=e=>MA(hR(e)),n_=(e,t,r)=>((e,t,r)=>(0,_.path)(["trees",t,"editingConnections",r],e))(hR(e),t,r),a_=(e,t)=>((e,t)=>(0,_.pipe)((0,_.prop)("trees"),(0,_.when)((0,_.always)(t),(0,_.pick)(t)),_.values,(0,_.map)((0,_.pipe)((0,_.prop)("editingConnections"),_.values)),_.flatten,(0,_.reject)(_.isNil))(e))(hR(e),t),i_=e=>(e=>e.structure)(bR(e)),o_=(e,t)=>x.getDependentLookupsStructureNode(bR(e),t),l_=e=>(e=>e.initedTypeUris)(bR(e)),s_=e=>(e=>e.editors)(bR(e)),c_=(e,t)=>x.getDependentLookupEditorState(bR(e),t),u_=e=>(e=>e.diff)(OR(e)),p_=e=>(e=>e.event)(OR(e)),d_=e=>(e=>e.slice)(OR(e)),m_=e=>(e=>!(0,x.isEmptyValue)(e.slice))(OR(e)),g_=e=>(e=>e.mode)(OR(e)),y_=(e,t)=>((e,t)=>e[t])((e=>e.entityRelatedAttributes)(e),t),f_=(0,kc.createSelector)(mR,(e=>IR(e,RR(e))),((e,t)=>!(!e||!t||(0,x.isEmptyValue)((0,x.collectAllDiffs)(e,t,!0))))),h_=(0,kc.createSelector)(hR,(e=>{const t=MA(e),r=(0,x.getNotAppliedTreeCommands)((0,_.reject)((0,_.propSatisfies)(x.isEmptyValue,"root"),e.trees));return!(0,x.isEmptyValue)(t)||!(0,x.isEmptyValue)(r)})),E_=(0,kc.createSelector)(fR,(e=>(0,_.keys)(e).reduce(((t,r)=>t||!(0,_.all)(x.isEmptyValue)((0,_.values)(x.getDraftsForSaveByViewId(e,r)))),!1))),b_=(0,kc.createSelector)(f_,E_,h_,((e,t,r)=>e||t||r)),v_=(0,kc.createSelector)(vR,mR,b_,((e,t)=>t),((e,t,r,n)=>!(e===x.Mode.Viewing||!t)&&((0,x.isTempUri)(t.uri)&&!n||r)));let T_=function(e){return e.PROFILE_OPERATION_UPDATE="PROFILE_OPERATION_UPDATE",e}({});const O_=nb(T_.PROFILE_OPERATION_UPDATE),x_=e=>{let{metadata:t,modifiedEntities:r,connections:n=[],errors:a}=e;return a.filter((e=>{let{attributeType:t,type:r}=e;return t&&!(0,x.isRequired)(t)&&r===x.ErrorType.missed})).filter((e=>{let{attributeType:a,parentUri:i}=e;const o=(0,x.getBaseUri)(i),l=(0,x.isEntityUri)(i)?r[o]:(0,x.findConnectionRelationObjectByRelationUri)(n,o),s=l&&(0,x.findAttributeValuesByTypeUri)(t,l,a.uri,!0);return null==s?void 0:s.some((e=>{let{parent:t,attrValues:r}=e;return t.uri===i&&0===r.length}))})).map((e=>{let{attributeType:t,parentUri:r}=e;return{attributeType:t,parentUri:r}}))},C_=e=>(0,x.getProfileViewsIdsByTypes)(e,[x.ProfileViewType.Relations,x.ProfileViewType.RelationsTable]);function S_(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){w_(e,t,r[t])}))}return e}function w_(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*A_(){const e=yield(0,Va.Ys)(xI.selectors.getEntity),t=yield(0,Va.Ys)(xI.selectors.getMode),r=yield(0,Va.Ys)(xI.selectors.getEntityUri),n=yield(0,Va.Ys)(xI.selectors.getMetadata),a=yield(0,Va.Ys)(xI.selectors.getModifiedEntity,r),i=yield(0,Va.Ys)(xI.selectors.getModifiedEntities),o=yield(0,Va.Ys)(xI.selectors.getProfileViews);return{entity:e,modifiedEntity:t===x.Mode.Viewing?e:a,entityUri:r,metadata:n,modifiedEntities:t===x.Mode.Viewing?{[r]:e}:i,profileViews:o,mode:t}}function*R_(){return S_({},yield(0,Va.RE)(A_),{validationServicePath:yield(0,Va.Ys)(xI.selectors.getValidationServicePath),tenant:yield(0,Va.Ys)(xI.selectors.getTenant),severity:yield(0,Va.Ys)(xI.selectors.getValidationServiceSeverityLevels)})}function*__(){const{entityUri:e,metadata:t,modifiedEntities:r,modifiedEntity:n,profileViews:a}=yield(0,Va.RE)(A_);if(!e)return[];const i=C_(a),o=(0,x.getProfileViewsIdsByTypes)(a,[x.ProfileViewType.HierarchyTree]),l=yield(0,Va.Ys)(Zx,i,!0),s=yield(0,Va.Ys)(xI.selectors.getRelations),c=yield(0,Va.Ys)(xI.selectors.getAllTreesEditingConnections,o);return[...(0,x.validateEntityLocally)(t,r,n,(0,x.isAvailableAttributeTypeForProfile)(a)),...l.flatMap((e=>(0,x.validateConnection)(t,r,e))),...c.flatMap((e=>(0,x.validateHierarchyConnection)(t,e)))].map((n=>S_({},n,{path:(0,x.evaluateErrorPath)({entityUri:e,metadata:t,connections:l,entitiesMap:r,relationsState:s,relationViewsIds:i},n.uri||n.parentUri)})))}function*I_(){const{entityUri:e,metadata:t,modifiedEntity:r,mode:n,validationServicePath:a}=yield(0,Va.RE)(R_);if(a&&e&&(0,x.shouldUseValidationService)(t,null==r?void 0:r.type)){const r=yield(0,Va.RE)((0,x.isTempUri)(e)?D_:P_),{modifiedEntities:a}=yield(0,Va.RE)(A_),i=(0,_.pipe)(x.convertValidationServiceErrors,(0,_.uniqBy)(x.getErrorUniqKey))(r,{entityUri:e,metadata:t,entitiesMap:a});if(n!==x.Mode.Viewing){const e=x_({metadata:t,modifiedEntities:a,errors:i});e.length&&(yield(0,Va.gz)(Eb(e)))}return i}return[]}function N_(e){return console.warn("Validation service error",e),[]}function*D_(){const{mode:e,modifiedEntity:t,modifiedEntities:r,validationServicePath:n,tenant:a,severity:i}=yield(0,Va.RE)(R_),o=(0,x.prepareEntityForValidation)(t,r);try{return yield(0,Va.RE)(x.validateEntity,{validationServicePath:n,entity:o,tenant:a,severity:i,options:(0,_.reject)(_.isNil,[x.ValidationServiceOption.preserveURIs,e===x.Mode.Editing?x.ValidationServiceOption.validateDataPermissions:null])})}catch(e){return N_(e)}}function*P_(){var e;const{entityUri:t,mode:r,entity:n,modifiedEntity:a,modifiedEntities:i,validationServicePath:o,metadata:l,tenant:s,severity:c}=yield(0,Va.RE)(R_),u=yield(0,Va.Ys)(xI.selectors.getValidateReferenceEntityInReadMode),p=(0,x.getEntityType)(l,n.type),d=null===(e=null==p?void 0:p.forceOvForUiUpdates)||void 0===e||e,m=r===x.Mode.Viewing?[]:(0,x.collectDiffForValidation)(n,a,i,d);try{return yield(0,Va.RE)(x.validateEntityChanges,{validationServicePath:o,uri:t,diff:m,tenant:s,severity:c,options:(0,_.reject)(_.isNil,[x.ValidationServiceOption.preserveURIs,x.ValidationServiceOption.updateAttributeUpdateDates,r===x.Mode.Editing?x.ValidationServiceOption.validateDataPermissions:null,r===x.Mode.Viewing&&u?x.ValidationServiceOption.validateReferenceEntityAttribute:null])})}catch(e){return N_(e)}}function*k_(){const{entityUri:e,metadata:t,mode:r,modifiedEntity:n,modifiedEntities:a,validationServicePath:i,tenant:o,severity:l,profileViews:s}=yield(0,Va.RE)(R_),c=yield(0,Va.Ys)(xI.selectors.getValidateRelations);if(i&&c){const c=C_(s),u=(yield(0,Va.Ys)(Zx,c)).filter((e=>(0,x.shouldUseValidationService)(t,e.relation.relationType)));if(u.length>0){let s=[];const p=(0,x.prepareConnectionsForValidation)(u,n,a,t);try{const e=yield(0,Va.RE)(x.validateRelations,{validationServicePath:i,body:p,tenant:o,severity:l,options:(0,_.reject)(_.isNil,[x.ValidationServiceOption.preserveURIs,r===x.Mode.Editing?x.ValidationServiceOption.validateDataPermissions:null])});s=Object.values(e.validated).flat()}catch(e){return N_(e)}const d=yield(0,Va.Ys)(xI.selectors.getModifiedEntities),m=yield(0,Va.Ys)(xI.selectors.getRelations),g=(0,_.pipe)(x.convertValidationServiceErrors,(0,_.uniqBy)(x.getErrorUniqKey))(s,{entityUri:e,metadata:t,entitiesMap:d,connections:u,relationsState:m,relationViewsIds:c}),y=x_({metadata:t,modifiedEntities:d,connections:u,errors:g});return y.length&&(yield(0,Va.gz)(Eb(y))),g}}return[]}function*L_(){const e=yield(0,Va.RE)(__),[t,r]=yield(0,Va.$6)([(0,Va.RE)(I_),(0,Va.RE)(k_)]),n=(0,_.uniqBy)(x.getErrorUniqKey,[...e,...t,...r]),a=yield(0,Va.Ys)(xI.selectors.getEntityUri),i=yield(0,Va.Ys)(xI.selectors.getHiddenAttributes),o=(null==i?void 0:i[a])||[],l=(0,x.filterErrorsForHiddenAttributes)(n,o);return yield(0,Va.gz)(ww(n)),0===l.filter(x.isCriticalError).length}let U_=function(e){return e.PROFILE_VIEWS_SET="PROFILE_VIEWS_SET",e}({});const j_=nb(U_.PROFILE_VIEWS_SET);function F_(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){M_(e,t,r[t])}))}return e}function M_(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*V_(e){const t=yield(0,Va.Ys)(xI.selectors.getMetadata),r=yield(0,Va.Ys)(xI.selectors.getMode);switch(e.type){case VS.OPEN_RELATION_EDITOR:{const{id:n,connection:a}=e.payload;a.relation.relationType&&(yield(0,Va.gz)(bb({viewId:n,metadata:t,mode:r,parentUri:a.relation.object.uri})));break}case hb.ADD_ATTRIBUTES:{const n=e.payload;for(const e of n){const{attributeType:n,parentUri:a,viewId:i}=e;(0,x.isComplexAttribute)(n)&&(yield(0,Va.gz)(bb({viewId:i,attributeType:n,parentUri:a,metadata:t,mode:r})))}break}case VS.SET_RELATION_TYPE:{const{id:n,relationUri:a}=e.payload;yield(0,Va.gz)(bb({viewId:n,metadata:t,mode:r,parentUri:a}));break}case kA.TREE_NODE_RELATION_TYPE_CHANGED:{var n;const{id:a,node:i}=e.payload;yield(0,Va.gz)(bb({viewId:a,metadata:t,mode:r,parentUri:null==i||null===(n=i.relation)||void 0===n?void 0:n.uri}));break}}}function*B_(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const r=yield(0,Va.Ys)(tC),n=(0,x.getNotAppliedTreeCommands)(null==r?void 0:r.trees),a=yield(0,Va.Ys)(iC),i=(0,x.optimizeCommands)([...a,...n]);if(null!=i&&i.length){const r=(0,_.when)((0,_.always)(t),(0,x.replaceTempUriInCommands)(t))(i);yield(0,Va.RE)(e,r),yield(0,Va.gz)(LA())}}function*z_(e){var t;const r=yield(0,Va.Ys)(_O),n=yield(0,Va.Ys)(IO),a=yield(0,Va.Ys)(qO,n),i=yield(0,Va.Ys)(OO),o=(0,x.getEntityType)(i,r.type),l=null===(t=null==o?void 0:o.forceOvForUiUpdates)||void 0===t||t,s=(0,x.collectAllDiffs)(r,a,l);return(0,x.prepareAttrDiff)(e,s)}function*H_(e){const t=yield(0,Va.Ys)(jO),r=yield(0,Va.Ys)($O),n=yield(0,Va.Ys)(IO),a=yield(0,Va.Ys)(qO,n),i=(0,x.findAllTemporaryRefEntityURI)(a),o=(0,_.concat)(i,t);return yield(0,Va.RE)(x.saveTemporaryEntities,r,o,e)}function*Y_(e,t,r){const n=e.getDCRObjectUris(),a=yield(0,Va.Ys)(EC),i=yield(0,Va.Ys)(vC),o=yield(0,Va.Ys)(dC);if(null!=n&&n.length){const l=yield(0,Va.RE)(x.startProcessInstance,{workflowPath:a,processType:t?"authoring":"dataChangeRequestReview",objectURIs:(0,_.uniq)([r,...n,e.getDCRUri()]).filter((0,_.complement)(_.isNil)),tenant:o,environment:i});"OK"!==(null==l?void 0:l.status)&&console.warn(l)}}function*W_(e,t,r,n){const a=yield(0,Va.Ys)(UO,r),i=(0,x.createRelationsCommandsFromConnections)(a,n,t);i.length&&(yield(0,Va.RE)(e,i))}function*G_(e,t,r){const n=yield(0,Va.Ys)(BO),a=yield(0,Va.Ys)(IO);for(const i of n)yield(0,Va.rM)(W_,e,r||a,i,t)}function*q_(e){if(!e.hasNewUri())return;const t=yield(0,Va.Ys)(tC);for(const[r,n]of Object.entries(t.trees))if(n.root){const t=t=>(0,_.when)((0,_.prop)("uri"),(0,_.assoc)("uri",e.getUri(null==t?void 0:t.uri)))(t),a=(0,x.mapTree)(n.root,{nodeProcessing:e=>(0,_.pipe)((e=>F_({},e)),(0,_.unless)((0,_.has)("editingMode"),(0,_.evolve)({relation:t,relations:(0,_.map)(t)})))(e)});(0,_.equals)(n.root,a)||(yield(0,Va.gz)(UA({id:r,tree:a})))}}function*Z_(){try{var e;const t=yield(0,Va.Ys)(Hx),{commandExecutor:r,dcrProcessor:n,relationUriProcessor:a}=(0,x.createCommandExecutor)({alwaysCreateDCR:t,dcrUri:null}),i=yield(0,Va.RE)(H_,n);yield(0,Va.$6)([(0,Va.RE)(B_,r),(0,Va.RE)(G_,r,i)]),yield(0,Va.RE)(q_,a);const o=yield(0,Va.RE)(z_,i),l=yield(0,Va.Ys)(IO),s=yield(0,Va.Ys)(xI.selectors.getMetadata),c=(0,x.hasAttributeMasking)(s);let u;if(null!=o&&o.length&&(u=yield(0,Va.RE)(x.entityCumulativeUpdate,{uri:l,diff:o,uriPreprocessor:n.enhanceUriWithDCR,sendMasked:c})),t||(0,x.isChangeRequestUri)(null===(e=u)||void 0===e?void 0:e.uri))u&&n.updateDCRUriFromResponse(u),yield(0,Va.RE)(Y_,n,!1,l),yield(0,Va.gz)(jA()),c&&(yield(0,Va.RE)(nI,!0)),window.alert(mi().text("Your changes are saved as pending and have been sent for review"));else if(u){yield(0,Va.gz)(cw(u));const{trees:e}=yield(0,Va.Ys)(xI.selectors.getTrees),t=(0,x.updateTreesWithNewEntity)((0,_.pick)(["uri","label","secondaryLabel","type"],u),e);for(const e of t)yield(0,Va.gz)(UA({id:e.id,tree:e.root}))}else!u&&c&&(yield(0,Va.RE)(nI,!0));yield(0,Va.gz)(Zw(x.Mode.Viewing)),yield(0,Va.gz)(Rb())}catch(e){yield(0,Va.gz)(Wv((0,x.getRequestErrorMessage)(e,mi().text("Something went wrong"))))}}function*$_(){yield(0,Va.qn)(sw.ENTITY_LOADED),yield(0,Va.gz)(Rb())}function*K_(e,t){const r=yield(0,Va.Ys)(IO),n=yield(0,Va.Ys)(xI.selectors.getModifiedEntity,r),{commandExecutor:a,dcrProcessor:i}=(0,x.createCommandExecutor)({alwaysCreateDCR:t,dcrUri:e}),o=yield(0,Va.RE)(H_,i),l=yield(0,Va.RE)(x.saveTemporaryEntity,n,o,i);return yield(0,Va.$6)([(0,Va.RE)(B_,a,{[r]:l}),(0,Va.RE)(G_,a,o,l)]),{savedEntityUri:l,dcrProcessor:i}}function*X_(){const e=yield(0,Va.Ys)(IO),t=yield(0,Va.Ys)(xI.selectors.getModifiedEntity,e);if((0,x.isEmptyEntity)(t)){const e=(0,Ke.x0)();return yield(0,Va.gz)(vv({id:e,text:mi().text("Please fill out some fields."),actions:[]})),!1}return!0}function*Q_(){try{const e=yield(0,Va.Ys)(Hx);if(!(yield(0,Va.RE)(X_)))return;const{dcrProcessor:t,savedEntityUri:r}=yield(0,Va.RE)(K_,null,e);e&&(yield(0,Va.RE)(Y_,t),window.alert(mi().text("Your changes are saved as pending and have been sent for review"))),yield(0,Va.gz)(Zw(x.Mode.Viewing)),e?(yield(0,Va.gz)(bv()),yield(0,Va.gz)(Ew())):(yield(0,Va.gz)(fv({uri:r})),yield(0,Va.rM)($_))}catch(e){yield(0,Va.gz)(Wv((0,x.getRequestErrorMessage)(e,mi().text("Something went wrong"))))}}function*J_(e){const t=yield(0,Va.RE)(x.getDataChangeRequest,e),r=(0,_.pipe)((0,_.prop)("changes"),_.values,_.flatten,(0,_.pluck)("id"))(t);try{yield(0,Va.$6)(r.map((t=>(0,Va.RE)(x.deleteChangeRequestItem,{dcrUri:e,changeItemId:t}))))}catch(e){yield(0,Va.gz)(Wv((0,x.getRequestErrorMessage)(e,mi().text("Something went wrong"))))}}function*eI(e){const{dcrUri:t,action:r,taskId:n}=e.payload;try{if(!(yield(0,Va.RE)(X_)))return;if(yield(0,Va.gz)(O_(x.Operation.Saving)),yield(0,Va.RE)(J_,t),yield(0,Va.RE)(K_,t,!0),"Approve"!==r||(yield(0,Va.RE)(L_))){const e=yield(0,Va.Ys)(EC),t=yield(0,Va.Ys)(vC),a=yield(0,Va.Ys)(dC);yield(0,Va.RE)(x.runTaskAction,{workflowPath:e,environment:t,tenant:a,taskId:n,action:r}),yield(0,Va.gz)(yw())}}catch(e){const t=null==e?void 0:e.error;if((null==t?void 0:t.errorCode)===x.ApiErrorCode.WORKFLOW_IS_NOT_REGISTERED_ERROR)return;yield(0,Va.gz)(Wv((0,x.getRequestErrorMessage)(t||e,mi().text("Something went wrong"))))}yield(0,Va.gz)(O_(null))}function*tI(e){const{dcrUri:t,userAction:r}=e.payload,n=yield(0,Va.Ys)(Vx);try{if(!(yield(0,Va.RE)(X_)))return;yield(0,Va.gz)(Zw("saveDraft"===r?x.Mode.Suggesting:x.Mode.Editing,!0)),yield(0,Va.gz)(O_(x.Operation.Saving));const e=yield(0,Va.RE)(L_);if("saveDraft"===r){if(t)yield(0,Va.RE)(J_,t),yield(0,Va.RE)(K_,t,!0);else{const{dcrProcessor:e}=yield(0,Va.RE)(K_,null,!0);yield(0,Va.RE)(Y_,e,!0);const t=e.getDCRUri();yield(0,Va.gz)(zv({url:"../authoring",searchParams:{entityUri:`${t}`},options:{replace:!0,state:{keepErrors:!0}}}))}window.alert(mi().text("Your changes are saved as pending and have been sent for review"))}else if(e){const{savedEntityUri:e}=yield(0,Va.RE)(K_,null,!1);yield(0,Va.gz)(Zw(x.Mode.Viewing)),yield(0,Va.gz)(fv({uri:e})),yield(0,Va.rM)($_)}else e||(yield(0,Va.gz)(Zw(n,!0)))}catch(e){yield(0,Va.gz)(Zw(n,!0)),yield(0,Va.gz)(Wv((0,x.getRequestErrorMessage)(e,mi().text("Something went wrong"))))}yield(0,Va.gz)(O_(null))}function*rI(){if(yield(0,Va.gz)(O_(x.Operation.Saving)),yield(0,Va.RE)(L_)){const e=yield(0,Va.Ys)(IO);(0,x.isTempUri)(e)?yield(0,Va.RE)(Q_):yield(0,Va.RE)(Z_)}yield(0,Va.gz)(O_(null))}function*nI(e){try{let t;if(e){const e=yield(0,Va.Ys)(xI.selectors.getMetadata);t=(0,x.addMetadataSpecificGetEntityOptions)(e)}yield(0,Va.gz)(O_(x.Operation.Fetching));const r=yield(0,Va.Ys)(IO),n=yield(0,Va.RE)(x.getEntity,r,t);if(!n)throw new Error("Failed to request entity");return yield(0,Va.gz)(cw(n,!0)),n}catch(e){throw yield(0,Va.gz)(Wv((0,x.getRequestErrorMessage)(e,mi().text("Something went wrong")))),e}finally{yield(0,Va.gz)(O_(null))}}function*aI(e){const{mode:t,silent:r}=e.payload;try{if(t!==x.Mode.Viewing&&!r){const e=yield(0,Va.Ys)(xI.selectors.getEntity),r=yield(0,Va.Ys)(xI.selectors.getModifiedEntity,null==e?void 0:e.uri),n=yield(0,Va.Ys)(xI.selectors.getMetadata);if(e&&!r&&n){const r=yield(0,Va.Ys)(xI.selectors.getProfileViews),a=yield(0,Va.Ys)(xI.selectors.getUIConfig),i=yield(0,Va.Ys)(xI.selectors.getUserRoles),o=(0,x.addToEntityRequiredAttributes)({entity:e,metadata:n,mode:t,attrTypeFilter:(0,_.both)((0,x.isAvailableAttributeTypeForProfile)(r||[]),(0,x.getProfileAttributeConfigPermissionsChecker)(a,e.type,i,[x.ConfigPermissions.READ,x.ConfigPermissions.CREATE]))});yield(0,Va.gz)(tA(o));const l=yield(0,Va.Ys)(xI.selectors.getModifiedEntities),s=yield(0,Va.Ys)(xI.selectors.getProfileErrors),c=x_({metadata:n,modifiedEntities:l,errors:s});c.length&&(yield(0,Va.gz)(Eb(c)))}}}catch(e){yield(0,Va.gz)(Zw(x.Mode.Viewing,!0))}}function*iI(e){const{entityTypeUri:t}=e.payload,r=yield(0,Va.Ys)(xI.selectors.getMetadata),n=(0,x.getEntityType)(r,t),a=yield(0,Va.Ys)(xI.selectors.getUIConfig),i=yield(0,Va.Ys)(xI.selectors.getUserRoles),o=(0,x.getProfileAttributeConfigPermissionsChecker)(a,t,i,[x.ConfigPermissions.READ,x.ConfigPermissions.CREATE]),l=((null==n?void 0:n.attributes)||[]).filter((e=>o(e))),s=(0,x.checkMetadataForCreate)(x.Mode.Editing,n)?x.Mode.Editing:x.Mode.Suggesting,c=(0,x.createTemporaryEntity)({entityTypeUri:t,attributeTypes:l,metadata:r,mode:s});yield(0,Va.gz)(hv({entity:c})),yield(0,Va.gz)(cw(c)),yield(0,Va.gz)(Zw(x.Mode.Viewing)),yield(0,Va.gw)(0),(yield(0,Va.Ys)(xI.selectors.getProfileViews))||(yield(0,Va.qn)(U_.PROFILE_VIEWS_SET)),yield(0,Va.gz)(Zw(s)),yield(0,Va.gz)(FA())}function*oI(e){const t=yield(0,Va.Ys)(xI.selectors.getMetadata),r=yield(0,Va.Ys)(xI.selectors.getAuthoringByEntityType,e),n=(0,x.getPreparedAuthoringItems)(t,r,e).map((e=>{let{views:t}=e;return t})).flat();yield(0,Va.gz)(j_(n))}function*lI(e){const{entityTypeUri:t}=e.payload,r=yield(0,Va.Ys)(xI.selectors.getMetadata),n=(0,x.getEntityType)(r,t),a=(0,_.prop)("attributes",n),i=(yield(0,Va.Ys)(xI.selectors.getCanSuggestAuthoring,n))?x.Mode.Suggesting:x.Mode.Editing,o=(0,x.createTemporaryEntity)({entityTypeUri:t,attributeTypes:a,metadata:r,mode:i});yield(0,Va.gz)(Vv({entity:o})),yield(0,Va.gz)(cw(o)),yield(0,Va.RE)(oI,o.type),yield(0,Va.gz)(Zw(i))}function*sI(e){const{mainEntityUri:t,tempEntities:r,keepErrors:n}=e.payload,[[a],i]=(0,_.partition)((0,_.propEq)("uri",t),r);yield(0,Va.gz)(cw(a,n)),yield(0,Va.RE)(oI,a.type),yield(0,Va.gz)(Zw(x.Mode.Suggesting));for(const e of i)yield(0,Va.gz)(tA(e))}function*cI(e){const{payload:{entityUri:t,data:r}}=e;yield(0,Va.gz)(O_(x.Operation.Cloning));try{const e=yield(0,Va.RE)(x.cloneEntity,t,r);yield(0,Va.gz)(hv({entity:e})),yield(0,Va.gz)(cw(e)),yield(0,Va.gz)(Zw(x.Mode.Editing)),yield(0,Va.gz)(FA());const n=(0,Ke.x0)(),a=yield(0,Va.Ys)(xI.selectors.getMetadata),i=(0,x.getEntityType)(a,e.type),o=(0,x.checkMetadataForDelete)(x.Mode.Editing,i);yield(0,Va.gz)(vv({id:n,type:"cloneAction",autoHideDuration:1e4,text:mi().text("Profile is cloned successfully. You can modify the attributes if required."),actions:o?[{label:mi().text("Undo"),needConfirmation:!0,confirmationText:mi().text("Are you sure you want to undo the cloning process?"),confirmationDescription:mi().text("Undoing the cloning process will delete the cloned profile. Are you sure you want to proceed?"),applyAction:fw({entityUri:e.uri}),cancelAction:Tv(n)}]:[]}))}catch(e){yield(0,Va.gz)(Wv((0,x.getRequestErrorMessage)(e,mi().text("Something went wrong"))))}yield(0,Va.gz)(O_(null))}function*uI(e){const{entityUri:t}=e.payload;if(!(0,x.isTempUri)(t))try{yield(0,Va.RE)(x.removeEntity,t),yield(0,Va.gz)(Ev())}catch(e){yield(0,Va.gz)(Wv((0,x.getRequestErrorMessage)(e,mi().text("Something went wrong"))))}}function*pI(e){const t=e.payload;try{if((yield(0,Va.Ys)(pC))&&!confirm(mi().text("Are you sure you want to cancel changes for this Profile?")))return;const e=yield(0,Va.Ys)(Vx),r=yield(0,Va.Ys)(xI.selectors.getMetadata),n=yield(0,Va.Ys)(IO),a=(0,x.hasAttributeMasking)(r),i=(0,x.isTempUri)(n),o=(0,x.isViewMode)(t),l=(0,x.isEditableMode)(e)&&(0,x.isViewMode)(t),s=(0,x.isViewMode)(e)&&(0,x.isEditableMode)(t);n&&(l||s)&&a&&!i&&(yield(0,Va.RE)(nI,o)),yield(0,Va.gz)(Zw(t)),l&&(yield(0,Va.gz)(Kw()))}catch{}}const dI=[function*(){yield(0,Va.A7)([Lb.MODE_UPDATE_REQUESTED],pI)},function*(){yield(0,Va.A7)([hb.RUN_AUTHORING_TASK_ACTION],eI)},function*(){yield(0,Va.ib)([VS.OPEN_RELATION_EDITOR,hb.ADD_ATTRIBUTES,VS.SET_RELATION_TYPE,kA.TREE_NODE_RELATION_TYPE_CHANGED],V_)},function*(){yield(0,Va.A7)([hb.SAVE_PROFILE],rI)},function*(){yield(0,Va.ib)([Lb.MODE_UPDATED],aI)},function*(){yield(0,Va.ib)([sw.ENTITY_CREATION_REQUESTED],iI)},function*(){yield(0,Va.Fm)([hb.VALIDATE_PROFILE],L_)},function*(){yield(0,Va.ib)([sw.ENTITY_REMOVE_REQUESTED],uI)},function*(){yield(0,Va.ib)([sw.CLONE_ENTITY],cI)},function*(){yield(0,Va.ib)([sw.ENTITY_CREATION_WITH_AUTHORING_REQUESTED],lI)},function*(){yield(0,Va.ib)([sw.ENTITY_AUTHORING_DRAFT_ENTITIES_LOADED],sI)},function*(){yield(0,Va.A7)([hb.SAVE_DRAFT],tI)}];let mI=function(e){return e.SIDE_PANEL_VIEWS_LOADED="SIDE_PANEL_VIEWS_LOADED",e}({});nb(mI.SIDE_PANEL_VIEWS_LOADED);const gI=[];let yI=function(e){return e.HIDDEN_ATTRIBUTES_UPDATED="HIDDEN_ATTRIBUTES_UPDATED",e.HIDDEN_ATTRIBUTES_RESET="HIDDEN_ATTRIBUTES_RESET",e}({});const fI=nb(yI.HIDDEN_ATTRIBUTES_UPDATED),hI=nb(yI.HIDDEN_ATTRIBUTES_RESET),EI={};let bI=function(e){return e.CONTROL_ATTRIBUTES_UPDATED="CONTROL_ATTRIBUTES_UPDATED",e}({});const vI=nb(bI.CONTROL_ATTRIBUTES_UPDATED),TI=[],OI=(0,R.combineReducers)({dependentLookups:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Fb,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Lb.MODE_UPDATED:{const{mode:r,silent:n}=t.payload;return(0,x.isViewMode)(r)&&!n?Fb:e}case Ib.DEPENDENT_LOOKUPS_STRUCTURE_SET:return Ub({},e,{structure:t.payload});case Ib.DEPENDENT_LOOKUPS_INITED_TYPE_URIS_ADDED:{const r=t.payload;return Ub({},e,{initedTypeUris:(0,_.uniq)(e.initedTypeUris.concat(r))})}case Ib.DEPENDENT_LOOKUPS_EDITORS_BLOCKED:{const{uris:r,isBlocked:n}=t.payload,a=e.editors,i=r.reduce(((e,t)=>Ub({},e,{[t]:Ub({},e[t],{isBlocked:n})})),a);return Ub({},e,{editors:i})}case Ib.DEPENDENT_LOOKUPS_EDITOR_TOUCHED:{const{uri:r,isTouched:n}=t.payload;return(0,_.assocPath)(["editors",r,"isTouched"],n,e)}default:return e}},entity:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:xw,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case sw.ENTITY_LOADED:return t.payload.entity;case sw.DEFAULT_PROFILE_PIC_SET:return"object"==typeof t.payload&&null!==t.payload?Tw({},e,{defaultProfilePic:t.payload.uri,defaultProfilePicValue:t.payload}):e;case hb.ADD_NEXT_PAGE_ATTRIBUTE_VALUES:{const{parentUri:r,attributeTypeName:n,attributeTypeUri:a,values:i}=t.payload,o=(0,x.getAttributeSource)(a);if(r===e.uri){const t=(0,_.lensPath)([o,n]);return(0,_.over)(t,(0,_.pipe)((0,_.defaultTo)([]),(0,_.concat)(_.__,i)),e)}return e}case sw.CLEAR_ENTITY:return xw;default:return e}},errors:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_w,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Cw.ERRORS_SET:return t.payload;case Cw.ERROR_DEACTIVATED:{const r=t.payload,n=e.findIndex((e=>(0,x.getErrorId)(e)===r)),a=(0,_.lensPath)([n]);return(0,_.over)(a,(0,_.assoc)("deactivated",!0),e)}case hb.REMOVE_ATTRIBUTE:{const{uri:r}=t.payload;return e.map((e=>e.uri===r||(0,x.areOneHierarchyUris)(e.parentUri,r)?Aw({},e,{deactivated:!0}):e))}case Lb.MODE_UPDATED:{const{mode:r,silent:n}=t.payload;return(0,x.isViewMode)(r)&&!n?_w:e}case sw.ENTITY_LOADED:{const{silent:r}=t.payload;return r?e:_w}default:return e}},history:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Mw,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Iw.HISTORY_DIFF_SET:return jw({},e,{diff:t.payload});case Iw.HISTORY_DIFF_CLEARED:return jw({},e,{diff:Mw.diff});case Iw.HISTORY_EVENT_SET:return jw({},e,{event:t.payload});case ub.NEW_ENTITY_SHOWN:case ub.OPEN_ENTITY:case Iw.HISTORY_EVENT_CLEARED:return jw({},Mw,{mode:e.mode});case Iw.HISTORY_SLICE_SET:return jw({},e,{slice:t.payload});case Iw.HISTORY_MODE_SET:return jw({},e,{mode:t.payload});default:return e}},lastLoadedTime:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Vw.PROFILE_LAST_LOADED_TIME_UPDATE:case sw.ENTITY_LOADED:return Date.now();default:return e}},lookups:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:qw,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Bw.LOOKUPS_LOADED:return t.payload;case Bw.LOOKUPS_FOR_TYPE_RESOLVED:{const{type:r,values:n}=t.payload;return Ww({},e,{[r]:Ww({},e[r],n)})}case Bw.LOOKUPS_LIST_RESOLVED:return t.payload.reduce(((e,t)=>Object.keys(t).reduce(((e,r)=>Ww({},e,{[r]:Ww({},e[r],t[r])})),e)),e);case"UI_RESET":return Ww({},qw);default:return e}},mode:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:eA,t=arguments.length>1?arguments[1]:void 0;return t.type===Lb.MODE_UPDATED?t.payload.mode:e},modifiedEntities:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:sA,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case MS.MODIFIED_ENTITY_CREATED:{const r=t.payload;return oA({},e,{[r.uri]:r})}case MS.MODIFIED_ENTITY_DELETED:{const r=t.payload;return(0,_.omit)([r],e)}case MS.MODIFIED_ENTITIES_RESET:return sA;case Lb.MODE_UPDATED:{const{silent:r}=t.payload;return r?e:sA}case MS.MODIFIED_ENTITY_DEFAULT_PROFILE_PIC_SET:{const{entityUri:r,value:n}=t.payload;return r?oA({},e,{[r]:oA({},e[r],{defaultProfilePic:n.uri,defaultProfilePicValue:n})}):e}case hb.ADD_ATTRIBUTES:return t.payload.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:a}=t,i=(0,x.getBaseUri)(n);if((0,x.isEntityUri)(i)){const t=e[i];return e[i]||console.error(`ADD_ATTRIBUTES. parentUri - ${n}, state: ${JSON.stringify(e)}`),(0,x.isEntitySpecialAttrType)(r)?oA({},e,{[i]:(0,x.addEntitySpecialAttribute)({entity:t,attributeType:r})}):oA({},e,{[i]:(0,x.addAttribute)({entity:t,attributeType:r,parentUri:n,index:a})})}return e}),e);case hb.ADD_NEXT_PAGE_ATTRIBUTE_VALUES:{const{parentUri:r,attributeTypeName:n,attributeTypeUri:a,values:i}=t.payload,o=(0,x.getAttributeSource)(a);if((0,x.isEntityUri)(r)&&r in e){const t=(0,_.lensPath)([r,o,n]);return(0,_.over)(t,(0,_.pipe)((0,_.defaultTo)([]),(0,_.concat)(_.__,i)),e)}return e}case hb.MODIFY_ATTRIBUTE:{const{attributeType:r,uri:n,value:a}=t.payload,i=(0,x.getBaseUri)(n);if((0,x.isEntityUri)(i)){const t=e[i];return e[i]&&e[i].attributes||console.error(`MODIFY_ATTRIBUTE. uri - ${n}, state: ${JSON.stringify(e)}`),(0,x.isEntitySpecialAttrType)(r)?oA({},e,{[i]:(0,x.editEntitySpecialAttribute)({entity:t,attributeType:r,value:a})}):oA({},e,{[i]:(0,x.editAttribute)({entity:t,attributeType:r,uri:n,value:a})})}return e}case hb.REMOVE_ATTRIBUTE:{const{attributeType:r,uri:n}=t.payload,a=(0,x.getBaseUri)(n);if((0,x.isEntityUri)(n)){const t=e[a];return e[a]||console.error(`REMOVE_ATTRIBUTE. uri - ${n}, state: ${JSON.stringify(e)}`),(0,x.isEntitySpecialAttrType)(r)?oA({},e,{[a]:(0,x.removeEntitySpecialAttribute)({entity:t,attributeType:r})}):oA({},e,{[a]:(0,x.removeAttribute)({entity:t,attributeType:r,uri:n})})}return e}case hb.ADD_DEFAULT_VALUES:{const{attributeType:r,parentUri:n,metadata:a,mode:i}=t.payload,o=(0,x.getBaseUri)(n);if((0,x.isEntityUri)(o)){const t=(0,x.getEditableAttributeTypeSubAttributes)(a,r);return(0,_.over)((0,_.lensProp)(o),(0,x.addDefaultValuesToComplexAttribute)({attributeType:r,subAttributes:t,metadata:a,mode:i,parentUri:n}),e)}return e}default:return e}},relations:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_A,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case sw.ENTITY_LOADED:{const{silent:r}=t.payload;return r?e:_A}case VS.RELATIONS_LOADED:{const{id:r,connections:n=[],total:a,mode:i}=t.payload;return(0,_.pipe)((0,_.assocPath)([r,"connections"],n),(0,_.assocPath)([r,"total"],a),(0,_.when)((0,_.both)((0,_.complement)((0,_.hasPath)([r,"drafts"])),(0,_.always)((0,x.isEditableMode)(i))),(0,_.assocPath)([r,"drafts"],IA)))(e)}case VS.SECOND_LEVEL_RELATIONS_LOADED:{const{id:r,connections:n,parentEntityUri:a,total:i}=t.payload,o=(0,_.path)([r,"connections"],e).map((e=>{const{entityUri:t}=e.entity;return t===a?AA({},e,{total:i,connections:n.map((e=>AA({},e,{parentEntityUri:a})))}):e}));return(0,_.assocPath)([r,"connections"],o,e)}case Lb.MODE_UPDATED:{const{mode:r,silent:n}=t.payload;return n?e:(0,_.map)(Qw(r)?(0,_.omit)(["drafts","relationsToEdit","relationToAdd"]):(0,_.assoc)("drafts",IA),e)}case VS.REMOVE_RELATION:{const{id:r,relationUri:n}=t.payload,a=(0,_.pipe)(x.getRelationUriFromConnection,(0,_.equals)(n)),i=(0,_.path)([r,"connections"],e),o=!((0,x.isTempUri)(n)||null!=i&&i.some((e=>e.suggested&&e.relation.relationUri===n)));return(0,_.evolve)({[r]:{drafts:(0,_.evolve)({removedUris:o?(0,_.append)(n):_.identity,addedConnections:(0,_.reject)(a),editedConnections:(0,_.reject)(a)})}},e)}case VS.IGNORE_RELATION:{const{id:r,ignoredRelationData:n}=t.payload;return(0,_.evolve)({[r]:{drafts:(0,_.evolve)({ignoredRelationData:(0,_.append)(n)})}},e)}case VS.ADD_RELATION:{const{id:r,connection:n}=t.payload,a=(0,_.omit)(["isNew"],n);return(0,_.evolve)({[r]:(0,_.pipe)((0,_.when)((0,_.propSatisfies)(_.isNil,"drafts"),(0,_.assocPath)(["drafts"],IA)),(0,_.evolve)({drafts:{addedConnections:(0,_.prepend)(a)}}))},e)}case VS.EDIT_RELATION:{const{id:r,connection:n}=t.payload,a=(0,_.eqBy)(x.getRelationUriFromConnection,n);if((0,x.isTempUri)((0,x.getRelationUriFromConnection)(n))){const t=e=>{const t=e.findIndex(a);return t>=0?(0,_.update)(t,n,e):e};return(0,_.evolve)({[r]:{drafts:(0,_.evolve)({addedConnections:t})}},e)}{const t=e=>{const t=e.findIndex(a);return t>=0?(0,_.update)(t,n,e):[...e,n]};return(0,_.evolve)({[r]:{drafts:(0,_.evolve)({editedConnections:t})}},e)}}case VS.OPEN_RELATION_EDITOR:{const{id:r,connection:n}=t.payload,a=n.initial?n:AA({},n,{initial:{connection:n}});if(a.isNew){const t=(0,x.getRelationToAddPath)(r);return(0,_.path)(t,e)?e:(0,_.assocPath)(t,a,e)}{const t=(0,_.lensPath)((0,x.getRelationsToEditPath)(r)),n=(0,_.eqBy)((0,_.path)(["relation","relationUri"]),a);return(0,_.over)(t,(0,_.pipe)((0,_.defaultTo)([]),(0,_.unless)((0,_.find)(n),(0,_.append)(a))),e)}}case VS.SET_INITIAL_INFO:{const{id:r,relationUri:n,tempEntity:a}=t.payload,i=NA(r,n,e);return(0,_.assocPath)([...i,"initial","modifiedEntity"],a,e)}case VS.CLOSE_RELATION_EDITOR:{const{id:r,relationUri:n}=t.payload,a=(0,_.pathEq)(["relation","relationUri"],n);return(0,_.evolve)({[r]:{relationToAdd:(0,_.when)(a,(0,_.always)(null)),relationsToEdit:(0,_.reject)(a)}},e)}case VS.SET_RELATION_TYPE:{const{id:r,relationUri:n,relationType:a}=t.payload,i=NA(r,n,e);if(i){const t=[...i,"relation"],r=(0,_.lensPath)(t);return(0,_.over)(r,(0,x.applyRelationTypeObject)(a),e)}return e}case hb.ADD_ATTRIBUTES:return t.payload.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:a,viewId:i}=t,o=(0,x.getBaseUri)(n),l=DA(i,o,e);if(l&&(0,x.isRelationUri)(o)){if((0,x.isActivenessAttrType)(r)){const t=(0,_.view)(l,e),n=(0,x.addEntitySpecialAttribute)({entity:t,attributeType:r});return(0,_.set)(l,n,e)}{const t=PA(i,o,e),l=(0,_.view)(t,e);l||console.error(`relations.ADD_ATTRIBUTES. viewId - ${i}, relationUri - ${o}, state: ${JSON.stringify(e)}`);const s=(0,x.addAttribute)({entity:l,attributeType:r,parentUri:n,index:a});return(0,_.set)(t,s,e)}}return e}),e);case hb.ADD_NEXT_PAGE_ATTRIBUTE_VALUES:{const{parentUri:r,attributeTypeName:n,values:a,viewId:i}=t.payload;if(!(0,x.isRelationUri)(r))return e;const o=(0,x.getBaseUri)(r),l=NA(i,o,e),s=(0,_.lensPath)([...l,"relation","object","attributes",n]);return(0,_.over)(s,(0,_.pipe)((0,_.defaultTo)([]),(0,_.append)(a)),e)}case hb.MODIFY_ATTRIBUTE:{const{attributeType:r,viewId:n,uri:a,value:i}=t.payload,o=(0,x.getBaseUri)(a),l=DA(n,o,e);if(l&&(0,x.isRelationUri)(o)){if((0,x.isActivenessAttrType)(r)){const t=(0,_.view)(l,e),n=(0,x.editEntitySpecialAttribute)({entity:t,attributeType:r,value:i});return(0,_.set)(l,n,e)}{const t=PA(n,o,e),l=(0,_.view)(t,e);l||console.error(`relations.MODIFY_ATTRIBUTE. viewId - ${n}, relationUri - ${o}, state: ${JSON.stringify(e)}`);const s=(0,x.editAttribute)({entity:l,attributeType:r,uri:a,value:i});return(0,_.set)(t,s,e)}}return e}case hb.REMOVE_ATTRIBUTE:{const{attributeType:r,uri:n,viewId:a}=t.payload,i=(0,x.getBaseUri)(n),o=DA(a,i,e);if(o&&(0,x.isRelationUri)(i)){if((0,x.isActivenessAttrType)(r)){const t=(0,_.view)(o,e),n=(0,x.removeEntitySpecialAttribute)({entity:t,attributeType:r});return(0,_.set)(o,n,e)}{const t=PA(a,i,e),o=(0,_.view)(t,e);o||console.error(`relations.REMOVE_ATTRIBUTE. viewId - ${a}, relationUri - ${i}, state: ${JSON.stringify(e)}`);const l=(0,x.removeAttribute)({entity:o,attributeType:r,uri:n});return(0,_.set)(t,l,e)}}return e}case VS.SET_RELATION_ENTITY:{const{id:r,relationUri:n,entityInfo:a}=t.payload,i=NA(r,n,e);if(i){const t=[...i,"entity"],r=(0,_.lensPath)(t),{uri:n,label:o,type:l}=a,s=(0,_.isEmpty)(a)?{}:{entityUri:n,entityLabel:o,entityType:l,object:{uri:n,label:o,type:l}};return(0,_.set)(r,s,e)}return e}case hb.ADD_DEFAULT_VALUES:{const{viewId:r,attributeType:n,parentUri:a,metadata:i,mode:o}=t.payload,l=(0,x.getBaseUri)(a);if((0,x.isRelationUri)(l)){const t=NA(r,l,e);if(t){if(n){const r=[...t,"relation","object"],l=(0,x.getAttributeTypeSubAttributes)(i,n);return(0,_.over)((0,_.lensPath)(r),(0,x.addDefaultValuesToComplexAttribute)({attributeType:n,subAttributes:l,metadata:i,mode:o,parentUri:a}),e)}{const r=[...t,"relation","object","attributes"],n=[...t,"relation","object","type"],l=(0,_.view)((0,_.lensPath)(n),e),{attributes:s=[]}=(0,x.getRelationType)(i,l);return(0,_.over)((0,_.lensPath)(r),(0,x.addDefaultValuesToAttributes)({metadata:i,mode:o,attributeTypes:s,parentUri:a}),e)}}return e}return e}default:return e}},trees:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:uR,t=arguments.length>1?arguments[1]:void 0;return(0,VA.ZP)(e,(r=>{switch(t.type){case Lb.MODE_UPDATED:{const{mode:e,silent:n}=t.payload;if(n)break;Object.keys(null==r?void 0:r.trees).forEach((e=>{$A(r.trees[e].root,"showDetails",!1)})),(0,x.isViewMode)(e)?(r.common.commands=[],r.initialTrees={}):(0,x.isEditableMode)(e)&&((0,x.isEmptyValue)(r.initialTrees)?r.initialTrees=sR({},r.trees):(r.common.commands=[],r.trees=sR({},r.initialTrees)));break}case Lb.MODE_EDITING_CANCELED:case kA.TREES_RESTORE_FROM_INITIAL_TREES:r.trees=sR({},r.initialTrees);break;case kA.TREES_RESET_INITIAL_TREES:r.initialTrees={};break;case sw.ENTITY_LOADED:{const{silent:r}=t.payload;return r?e:uR}case kA.TREE_LOADED_WITH_ERROR:{const{id:e,errorMessage:n}=t.payload;r.trees[e]=r.trees[e]||{},r.trees[e].errorMessage=n,r.trees[e].loading=!1,delete r.trees[e].root,delete r.trees[e].entitiesMap;break}case kA.TREE_LOADING:{const e=t.payload;r.trees[e]=r.trees[e]||{},r.trees[e].loading=!0;break}case kA.TREE_CHILDREN_LOADING:{const{id:e,parentId:n,nodeId:a}=t.payload,i=r.trees[e].root,o=(0,x.findNodeById)(i,n);o.pending=!1,o.children=(o.children||[]).concat({entity:{},loading:!0,nodeId:a});break}case kA.TREE_CHILDREN_LOADED:{const{children:e,id:n,parentId:a}=t.payload,i=r.trees[n].root,o=(0,x.findNodeById)(i,a);o&&(o.children=WA(o.children,e),delete o.pending);break}case kA.TREE_NODE_REMOVED:{const{id:e,nodeId:n}=t.payload,a=r.trees[e].root,i=(0,x.findParentNodeById)(a,n);GA(i||a,n);break}case kA.TREE_NODE_CREATED:{const{id:e,parentId:n,node:a}=t.payload,i=r.trees[e].root,o=(0,x.findNodeById)(i,n)||i,l=o.children.length;qA(o,a,l);break}case kA.TREE_NODE_EDITED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,x.findNodeById)(a,n.nodeId),o=Object.keys(n);for(const e of o)i[e]=n[e];break}case kA.TREE_NODE_EDITING_STARTED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,x.findNodeById)(a,n.nodeId),o=(0,x.findParentNodeById)(a,n.nodeId);i&&o&&(i.editingMode=x.NODE_EDITING_MODES.editing,i.relatedEntity=o.entity,delete i.loading,i.initialConnection=KA(i),XA({id:e,draft:r.trees,node:i}));break}case kA.TREE_NODE_EDITING_APPLIED:{const{id:e,node:a}=t.payload,i=r.trees[e].root,o=(0,x.findNodeById)(i,a.nodeId),l=tR({id:e,draft:r.trees,relationUri:a.relation.uri});var n;o&&l&&(rR(o),o.entity.uri!==l.entity.uri&&null!==(n=o.children)&&void 0!==n&&n.length&&(delete o.children,o.pending=!0),o.entity=l.entity,o.relation=l.relation,eR({id:e,draft:r.trees,relationUri:a.relation.uri}));break}case kA.TREE_NODE_EDITING_CANCELED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,x.findNodeById)(a,n.nodeId);i&&(rR(i),eR({id:e,draft:r.trees,relationUri:n.relation.uri}));break}case kA.TREE_NODE_NEW_PARENT_EDITING_STARTED:{const{id:e,node:n,newNode:a}=t.payload,i=r.trees[e].root,o=(0,x.findNodeById)(i,n.nodeId);if(a.relatedEntity=o.entity,a.relatedNodeId=o.nodeId,a.editingMode=x.NODE_EDITING_MODES.addingParent,i===o)a.children=[i],r.trees[e].root=a;else{const e=(0,x.findParentNodeById)(i,n.nodeId),t=e.children.findIndex((e=>o===e));qA(e,a,t)}a.initialConnection=KA(a),XA({id:e,draft:r.trees,node:a});break}case kA.TREE_NODE_NEW_PARENT_EDITING_APPLIED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,x.findNodeById)(a,n.nodeId),o=(0,x.findNodeById)(a,n.relatedNodeId),l=tR({id:e,draft:r.trees,relationUri:n.relation.uri});i&&l&&(nR({id:e,draft:r.trees,currentNode:i}),o.parent=o.parent||[],o.parent.push(l.entity.uri),o.relations=o.relations||[],o.relations.push(l.relation),r.trees[e].entitiesMap=oR(r.trees[e].entitiesMap,[o,lR(l)]),eR({id:e,draft:r.trees,relationUri:i.relation.uri}));break}case kA.TREE_NODE_NEW_PARENT_EDITING_CANCELED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,x.findNodeById)(a,n.nodeId);i&&(nR({id:e,draft:r.trees,currentNode:i}),eR({id:e,draft:r.trees,relationUri:i.relation.uri}));break}case kA.TREE_NODE_NEW_CHILD_EDITING_STARTED:{const{id:e,node:n,newNode:a}=t.payload,i=r.trees[e].root,o=(0,x.findNodeById)(i,n.nodeId);a.relatedEntity=o.entity,a.editingMode=x.NODE_EDITING_MODES.addingChild,a.parent=[o.entity.uri],a.directParentUri=o.entity.uri,o.children=o.children||[],o.children.unshift(a),o.expanded=!0,a.initialConnection=KA(a),XA({id:e,draft:r.trees,node:a});break}case kA.TREE_NODE_NEW_CHILD_EDITING_APPLIED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,x.findParentNodeById)(a,n.nodeId),o=(0,x.findNodeById)(i,n.nodeId),l=tR({id:e,draft:r.trees,relationUri:n.relation.uri});i&&o&&l&&(rR(o),o.entity=l.entity,o.relation=l.relation,o.relations=[l.relation],eR({id:e,draft:r.trees,relationUri:n.relation.uri}));break}case kA.TREE_NODE_NEW_CHILD_EDITING_CANCELED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,x.findParentNodeById)(a,n.nodeId);i&&(GA(i,n.nodeId),eR({id:e,draft:r.trees,relationUri:n.relation.uri}));break}case kA.TREE_NODE_RELATION_TYPE_CHANGED:{const{id:e,node:n,relationTypeUri:a}=t.payload,i=tR({id:e,draft:r.trees,relationUri:n.relation.uri}).relation.type;i!==a&&(i&&QA({id:e,draft:r.trees,node:n,entity:null}),JA({id:e,draft:r.trees,node:n,relationTypeUri:a}));break}case kA.TREE_NODE_ENTITY_CHANGED:{const{id:e,node:n,entity:a}=t.payload;QA({id:e,draft:r.trees,node:n,entity:a});break}case hb.ADD_ATTRIBUTES:return t.payload.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:a,viewId:i}=t,o=(0,x.getBaseUri)(n),l=aR(i,o,e.trees);if(l&&(0,x.isRelationUri)(o)){const t=(0,_.view)(l,e.trees);if((0,x.isActivenessAttrType)(r)){const n=(0,x.addEntitySpecialAttribute)({entity:t,attributeType:r});return sR({},e,{trees:(0,_.set)(l,n,e.trees)})}{const i=(0,x.addAttribute)({entity:t,attributeType:r,parentUri:n,index:a});return sR({},e,{trees:(0,_.set)(l,i,e.trees)})}}return e}),e);case hb.MODIFY_ATTRIBUTE:{const{attributeType:r,viewId:n,uri:a,value:i}=t.payload,o=(0,x.getBaseUri)(a),l=aR(n,o,e.trees);if(l&&(0,x.isRelationUri)(o)){const t=(0,_.view)(l,e.trees);if((0,x.isActivenessAttrType)(r)){const n=(0,x.editEntitySpecialAttribute)({entity:t,attributeType:r,value:i});return sR({},e,{trees:(0,_.set)(l,n,e.trees)})}{const n=(0,x.editAttribute)({entity:t,attributeType:r,uri:a,value:i});return sR({},e,{trees:(0,_.set)(l,n,e.trees)})}}return e}case hb.REMOVE_ATTRIBUTE:{const{attributeType:r,uri:n,viewId:a}=t.payload,i=(0,x.getBaseUri)(n),o=aR(a,i,e.trees);if(o&&(0,x.isRelationUri)(i)){const t=(0,_.view)(o,e.trees);if((0,x.isActivenessAttrType)(r)){const n=(0,x.removeEntitySpecialAttribute)({entity:t,attributeType:r});return sR({},e,{trees:(0,_.set)(o,n,e.trees)})}{const a=(0,x.removeAttribute)({entity:t,attributeType:r,uri:n});return sR({},e,{trees:(0,_.set)(o,a,e.trees)})}}return e}case hb.ADD_DEFAULT_VALUES:{const{viewId:r,attributeType:n,parentUri:a,metadata:i,mode:o}=t.payload,l=(0,x.getBaseUri)(a),s=aR(r,l,e.trees);if((0,x.isRelationUri)(l)&&s){if(n){const t=(0,x.getAttributeTypeSubAttributes)(i,n);return sR({},e,{trees:(0,_.over)(s,(0,x.addDefaultValuesToComplexAttribute)({attributeType:n,subAttributes:t,metadata:i,mode:o,parentUri:a}),e.trees)})}{const t=(0,_.compose)(s,(0,_.lensPath)(["attributes"])),r=(0,_.compose)(s,(0,_.lensPath)(["type"])),n=(0,_.view)(r,e.trees),{attributes:l=[]}=(0,x.getRelationType)(i,n);return sR({},e,{trees:(0,_.over)(t,(0,x.addDefaultValuesToAttributes)({metadata:i,mode:o,attributeTypes:l,parentUri:a}),e.trees)})}}return e}case kA.TREE_ENTITIES_MAPPING_LOADED:{const{id:e,entitiesSubMap:n}=t.payload,a=r.trees[e].entitiesMap;r.trees[e].entitiesMap=YA(a,n);break}case kA.TREE_LOADED:{const{tree:e,id:n,graphTypes:a,activenessDate:i,isReversed:o}=t.payload,l=iR(r.trees[n]||{});r.trees[n]=sR({},l,e,{graphTypes:a,activenessDate:i,isReversed:o}),delete r.trees[n].errorMessage,r.trees[n].loading=!1;break}case kA.TREE_SORTED:{const{id:e,typesLabelsMap:n={},sortField:a,sortOrder:i}=t.payload;r.trees[e]=r.trees[e]||{},r.trees[e].sortField=a,r.trees[e].sortOrder=i,r.trees[e].root&&(r.trees[e].root=(0,x.mapTree)(r.trees[e].root,{childrenProcessing:(0,x.sortTreeChildren)({sortField:a,sortOrder:i,typesLabelsMap:n})}));break}case kA.TREE_SECONDARY_LABEL_SHOWN:{const{id:e,show:n}=t.payload;r.trees[e].showSecondaryLabel=n,r.trees[e].root=sR({},r.trees[e].root);break}case kA.TREES_STATE_RESTORED:{const e=t.payload;Object.keys(e).forEach((t=>{r.trees[t]=r.trees[t]||{},r.trees[t]=sR({},r.trees[t],e[t]),r.trees[t].root&&(r.trees[t].root=sR({},r.trees[t].root))}));break}case kA.TREE_CHANGED:{const{id:e,tree:n}=t.payload;r.trees[e].root=n;break}case kA.TREE_REFRESHED:{const e=t.payload;r.trees[e].root=sR({},r.trees[e].root);break}case kA.TREE_NODE_EXPANDED:{const{id:e,nodeId:n}=t.payload,a=r.trees[e].root;(0,x.findNodeById)(a,n).expanded=!0;break}case kA.TREE_CURRENT_ENTITY_SHOWN:{const{id:n,uri:a=(0,_.path)(["entity","uri"],e)}=t.payload;if(r.trees[n]){const e=HA(r.trees[n].root,a);r.trees[n].scrollTo=e}break}case kA.TREE_SCROLL_TO_NODE_RESET:{const e=t.payload;r.trees[e]&&(r.trees[e].scrollTo=null);break}case kA.TREE_ACTIVENESS_DATE_CHANGED:{const{id:e,activenessDate:n}=t.payload;r.trees[e].activenessDate=n;break}case kA.TREE_RELATION_REPOINTED:{const{entity:e,relation:n,newParent:a,isReversed:i}=t.payload,o=(0,_.prop)("uri"),l=o(e),s=o(a),c=(0,x.createRelationRepointCommand)({entityUri:l,relation:n,newEntityUri:s,isReversed:i});r.common.commands.push(c);break}case kA.TREE_RELATION_REMOVED:{const{relationUri:e}=t.payload;if((0,x.isTempUri)(e))r.common.commands=(0,_.reject)((0,x.isRelationCommandForUri)(e),r.common.commands);else{const t=(0,x.createRelationDeleteCommand)({relationUri:e});r.common.commands.push(t)}break}case kA.TREE_RELATION_CREATED:{const{entityUri:e,relation:n,parentEntityUri:a}=t.payload,i=(0,x.createRelationCreateCommand)({parentUri:a,relation:n,entityUri:e});r.common.commands.push(i);break}case kA.TREE_RELATION_EDITED:{const{oldRelation:e,newRelation:n,entityUri:a,newEntityUri:i,isReversed:o}=t.payload,l=i?(0,x.createRelationRepointCommand)({entityUri:a,newEntityUri:i,relation:n,isReversed:o}):(0,x.createRelationUpdateCommand)({oldRelation:e,newRelation:n});r.common.commands.push(l);break}case kA.TREE_COMMANDS_CLEARED:r.common.commands=[];break;case kA.TREE_CANCEL_CHILDREN_LOADING:{const{id:e,parentId:n}=t.payload,a=r.trees[e].root,i=(0,x.findNodeById)(a,n);i&&(i.pending=!0,delete i.expanded,delete i.children);break}}}))},operation:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return t.type===T_.PROFILE_OPERATION_UPDATE?t.payload:e},views:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return t.type===U_.PROFILE_VIEWS_SET?t.payload:e},sidePanelViews:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:gI,t=arguments.length>1?arguments[1]:void 0;return t.type===mI.SIDE_PANEL_VIEWS_LOADED?t.payload:e},entityRelatedAttributes:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:dR,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case pR.ENTITY_RELATED_ATTRIBUTES_ADDED:{const{attributeTypeUri:r,entityUri:n,attributes:a}=t.payload;return(0,_.assocPath)([r,n],a,e)}case Lb.MODE_UPDATED:{const{mode:r,silent:n}=t.payload;return(0,x.isViewMode)(r)&&!n?dR:e}default:return e}},hiddenAttributes:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:EI,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case yI.HIDDEN_ATTRIBUTES_UPDATED:{const{uri:r,hiddenAttributes:n}=t.payload;return(0,_.assoc)(r,n,e)}case yI.HIDDEN_ATTRIBUTES_RESET:return(0,_.dissoc)(t.payload,e);default:return e}},controlAttributes:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:TI,t=arguments.length>1?arguments[1]:void 0;return t.type===bI.CONTROL_ATTRIBUTES_UPDATED?t.payload:e}}),xI={getModule:()=>({id:"mdm",reducerMap:{dataTenants:ib,tenants:sb,metadata:fb,profile:OI,tenant:dO,environment:bO,user:iO,ui:rO,search:yv},sagas:[...yA,...lw,...dI,...pv]}),selectors:c},CI=xI,SI=e=>{let{className:t}=e;const r=(0,Tp.useDispatch)(),n=(0,Tp.useSelector)(ki.qx),a=(0,Tp.useSelector)(CI.selectors.getGoogleMapKey),i=(0,b.useMemo)((()=>((e,t)=>(0,_.when)((0,_.always)(!t),(0,_.reject)((0,_.propEq)("id",K.om.MAP)))(e))([{id:K.om.MAP,tooltipTitle:mi().text("View map"),Icon:tb()},{id:K.om.PROFILE,tooltipTitle:mi().text("View entity details"),Icon:JE()}],a)),[a]);return v().createElement(zE,{className:t,modes:i,modeId:n,onChange:e=>{r(Ni(n!==e?e:null))}})};SI.propTypes={className:vp().string};const wI=SI,AI=()=>v().createElement("div",{className:_d},v().createElement("div",{className:"Headers-styles-title--TvsMA"},mi().text("Profiles")),v().createElement("div",{className:Id},v().createElement(XE,null),v().createElement(wI,{className:Nd})));var RI=r(12932),_I=r.n(RI),II=r(83754),NI=r.n(II);const DI=(0,kp.Z)({tabsRoot:{width:"100%"},tabsScrollButton:{flex:"0 0 24px"},tabRoot:{fontSize:"0.875rem",padding:"7px 18px 5px","@media (min-width: 960px)":{minWidth:"inherit"},"&$disabled":{pointerEvents:"auto"}},labelWrapper:{whiteSpace:"nowrap",letterSpacing:"normal",display:"flex",flexDirection:"row",width:"100%"},label:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",fontWeight:500},disabled:{}});function PI(){return PI=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},PI.apply(this,arguments)}function kI(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}const LI=e=>{let{value:t,tabs:r=[],onChange:n,tabClasses:a}=e,i=kI(e,["value","tabs","onChange","tabClasses"]);const o=DI(),l=(e,t)=>v().createElement("span",{className:o.labelWrapper},v().createElement(gd.Y,{value:e},v().createElement("span",{className:o.label},e)),t);return v().createElement(_I(),PI({value:t,onChange:(e,t)=>n(t),classes:{root:o.tabsRoot,scrollButtons:o.tabsScrollButton},indicatorColor:"primary",textColor:"primary",variant:"scrollable",scrollButtons:!0},i,{allowScrollButtonsMobile:!0}),r.map((e=>{let{label:t,value:r,additionalLabel:n,dataReltioId:i}=e,s=kI(e,["label","value","additionalLabel","dataReltioId"]);return v().createElement(NI(),PI({classes:a||{root:o.tabRoot,disabled:o.disabled},key:r,value:r,label:l(t,n),"data-reltio-id":i},s))})))};function UI(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class jI extends b.PureComponent{constructor(){super(...arguments),this.getTabsData=()=>{const{tenantObject:e,tableViewTabs:t,selectedEntityTypes:r,metadata:n}=this.props,a=(0,Sy.ZK)(t,e);return(0,Pi.nx)(n,a,r).map((e=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){UI(e,t,r[t])}))}return e}({},e,{additionalLabel:v().createElement("span",{className:"Headers-styles-number--trErH"},"(",void 0===e.number?mi().text("N/A"):(0,ci.k7)(e.number),")")})))},this.onTabChange=e=>{this.props.dispatch(Si(e))},this.onSelectColumns=e=>{const{dispatch:t,entityTypeTab:r,columnsForEntityType:n}=this.props;return t(Ci(r,e,n))},this.renderTabs=()=>{const{entityTypeTab:e}=this.props;return v().createElement("div",{className:"Headers-styles-tabsContainer--lhDXc"},v().createElement(LI,{value:e,tabs:this.getTabsData(),onChange:this.onTabChange}))}}render(){const{entityTypeTab:e,columnsForEntityType:t}=this.props;return v().createElement("div",{className:_d},this.renderTabs(),v().createElement("div",{className:Id},v().createElement(kd,{entityTypeUri:e,headColumns:t,onSelectColumns:this.onSelectColumns,"data-reltio-id":"reltio-search-table-add-remove-column",disabled:!e,showForDisabled:!0}),v().createElement(Lg(),{orientation:"vertical",className:"Headers-styles-splitter--sCvn6"}),v().createElement(XE,null),v().createElement(wI,{className:Nd})))}}const FI=(0,Tp.connect)((e=>{const t=(0,ki.o4)(e);return{metadata:k().selectors.getMetadata(e),selectedEntityTypes:(0,D.DX)(e),tableViewTabs:(0,ki.gu)(e),entityTypeTab:t,columnsForEntityType:(0,ki.Gv)(e,t),tenantObject:(0,ui.t9)(e)}}))(jI);function MI(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class VI extends v().PureComponent{constructor(){super(...arguments),this.entitiesTableRef=this.props.basicTableRef||v().createRef(),this.state={resizeDebounceDelay:void 0},this.sortHandle=e=>{let{field:t,order:r}=e;this.props.dispatch((e=>{let{field:t,order:r,entityTypeUri:n}=e;return{type:U.Z.CHANGE_SORT,payload:{field:t,order:r,entityTypeUri:n}}})({field:r?t:null,order:r,entityTypeUri:this.props.entityTypeUri}))},this.reorderingHandle=e=>{let{what:t,where:r}=e;const{entityTypeUri:n,dispatch:a,headColumns:i}=this.props;a(((e,t)=>({type:we,payload:{entityTypeUri:e,columns:t}}))(n,(0,_.move)(t.columnIndex,r.columnIndex,i)))},this.changeColumnsListHandle=e=>{let{columns:t}=e;const{entityTypeUri:r,dispatch:n,headColumns:a}=this.props;n(Ci(r,t,a))},this.changeColumnsSizeHandle=e=>{const{headColumns:t,entityTypeUri:r,dispatch:n}=this.props,a=t.map(((t,r)=>{var n;return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){MI(e,t,r[t])}))}return e}({},t,{size:e[r].size,autoResize:(null!==(n=t.autoResize)&&void 0!==n?n:0!==r)&&!e[r].manuallyChanged})}));n(((e,t)=>({type:Ae,payload:{entityTypeUri:e,columns:t}}))(r,a)),this.setState({resizeDebounceDelay:void 0})},this.logger=e=>{this.props.dispatch({type:"TABLE_LOG",payload:e})}}componentDidUpdate(e){const{headColumns:t,sortField:r,sortOrder:n,entities:a,entityTypeUri:i}=this.props;this.entitiesTableRef.current&&(t.length!==(0,_.path)(["headColumns","length"],e)||(0,_.difference)((0,_.omit)(["size"],t),(0,_.omit)(["size"],e.headColumns)).length>0||r!==e.sortField||n!==e.sortOrder||a!==e.entities)&&this.entitiesTableRef.current.resetScrollbarPosition(),e.entityTypeUri!==i&&this.setState({resizeDebounceDelay:0})}render(){const{entities:e,entityToHighlight:t,onScroll:r,entityTypeUri:n,headColumns:a,sortField:i,sortOrder:o,additionalColumns:l,selectedEntityUri:s,dndColumnReorderingEnabled:c,onEntityClick:u,onEntityHover:p,entitiesImportStatus:d,onEntityImportStatusChange:m}=this.props;return v().createElement(gg,{entities:e,entityToHighlight:t,selectedEntityUri:s,onScroll:r,onSort:this.sortHandle,onEntityClick:u,onEntityHover:p,entityTypeUri:n,headColumns:a,sortField:i,sortOrder:o,dndColumnReorderingEnabled:c,onReorderingColumn:this.reorderingHandle,entitiesTableRef:this.entitiesTableRef,onChangeColumnsList:this.changeColumnsListHandle,onChangeColumnsSize:this.changeColumnsSizeHandle,additionalColumns:l,entitiesImportStatus:d,onEntityImportStatusChange:m,logger:this.logger,resizeDebounceDelay:this.state.resizeDebounceDelay})}}VI.propTypes={entities:vp().array,entityToHighlight:vp().string,selectedEntityUri:vp().string,headColumns:vp().array,onScroll:vp().func,entityTypeUri:vp().string,sortField:vp().string,sortOrder:vp().oneOf([Ld.oy,Ld.U9]),dndColumnReorderingEnabled:vp().bool,dispatch:vp().func,additionalColumns:vp().arrayOf(vp().shape({id:vp().string,label:vp().string})),onEntityClick:vp().func,onEntityHover:vp().func,entitiesImportStatus:vp().object,onEntityImportStatusChange:vp().func,basicTableRef:vp().shape({current:vp().object})},VI.defaultProps={entities:[],headColumns:[]};const BI=(0,Hg.Z)(Pi.oq),zI=(0,Tp.connect)((e=>{const t=(0,ki.tB)(e),r=(0,ki.Gv)(e,t),n=k().selectors.getMetadata(e),a=BI(n,t,r);return{sortField:(0,ui.NW)(e,{entityTypeUri:(0,ki.o4)(e)}),sortOrder:(0,ui.L9)(e,{entityTypeUri:(0,ki.o4)(e)}),dndColumnReorderingEnabled:!(0,ki.Ue)(e),headColumns:r,entityTypeUri:t,additionalColumns:a}}))(VI);var HI=r(14058),YI=r.n(HI);const WI=(0,kp.Z)((()=>({container:{position:"relative",height:"100%",width:"100%"},closeButton:{position:"absolute",top:"7px",left:"7px",zIndex:1}}))),GI=(0,kp.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"}}}))),qI=e=>{let{className:t,entity:r,children:n,classes:a,renderLabel:i=_.identity}=e;const o=GI({classes:a}),l=(0,w.AH)(),s=(0,w.QQ)(),c=(0,b.useCallback)((()=>{navigator.clipboard.writeText((0,x.getEntityId)(r))}),[r]);if((0,_.isNil)(r))return null;const u=(0,x.getLabel)(r.label),p=r.secondaryLabel,d=(0,x.getBusinessCardAttributesText)(l,r),m=(0,x.isActiveObject)(r),g=r.uri,y=(0,x.getEntityId)(r);return v().createElement("div",{className:O()(o.profileBandWrapper,t)},v().createElement("div",{className:O()(o.profileBand,{[o.inactive]:!m}),"data-entity-uri":g},v().createElement(A,{key:r.uri,entity:r,avatarClassName:o.profileIcon,imageClassName:o.imageProfileIcon}),v().createElement("div",{className:o.profileInfo},v().createElement("div",null,v().createElement(Ag(),{variant:"h6",className:o.label},i(u)),p&&v().createElement(Ag(),{variant:"subtitle2",className:o.secondaryLabel},p),d&&v().createElement(Ag(),{variant:"subtitle1",className:o.businessCard},d)),v().createElement("div",{className:o.specialInfo},v().createElement("div",{className:o.entityType},v().createElement(EE,{entity:r,size:"medium",className:o.badge}),!(0,x.isTempUri)(g)&&s&&v().createElement(gf(),{title:mi().text("Copy to clipboard")},v().createElement(Ag(),{display:"inline",variant:"body2",className:o.entityId,onClick:c},mi().text("Entity ID"),": ",y))))),n&&v().createElement("div",null,n)))},ZI=v().createContext(!1);ZI.displayName="BlockImageGalleryDialogContext";var $I=r(31574),KI=r.n($I);const XI=v().createContext([]);var QI=r(24436),JI=r.n(QI);function eN(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){tN(e,t,r[t])}))}return e}function tN(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const rN=(0,kp.Z)((e=>({basicViewPaper:eN({display:"flex",flexDirection:"column"},e.basicView)})));function nN(){return nN=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},nN.apply(this,arguments)}const aN=(0,b.forwardRef)(((e,t)=>{let{children:r,className:n}=e,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["children","className"]);const i=rN();return v().createElement(JI(),nN({ref:t,className:n,classes:{root:i.basicViewPaper}},a),r)}));aN.displayName="BasicView";var iN=r(52574);const oN="1px solid #AFD4E9",lN=(0,kp.Z)({decorator:{marginLeft:8,borderLeft:oN,"&:last-child":{borderLeft:"none","&:before":{borderLeft:oN}},"&:before":{top:0,height:14,width:5,borderBottom:oN,content:'""',display:"block",left:"0"},"&$plain":{"&:before":{width:0}}},plain:{},wrapper:{marginLeft:16,marginTop:-8}}),sN=e=>{let{className:t,children:r,plain:n=!1,enabled:a=!1}=e;const i=lN();return a?v().createElement("div",{"data-reltio-id":"branch-decorator",className:O()(i.decorator,{[i.plain]:n},t)},v().createElement("div",{className:i.wrapper},r)):v().createElement(v().Fragment,null,r)},cN="commentsContainerVisibilityArea",uN=v().createContext([]);uN.displayName="RelatedObjectUrisContext";const pN=v().createContext({comments:[],commentsMap:null,currentComment:null,updateCommentState:_.identity,clearCommentState:_.identity,getCommentState:()=>({}),getComment:_.identity,getComments:()=>new Promise(_.identity),getCommentsCount:_.identity,createComment:()=>new Promise(_.identity),editComment:()=>new Promise(_.identity),createReply:()=>new Promise(_.identity),resolveThread:_.identity,reOpenThread:_.identity,clearCurrentComment:_.identity,deleteComment:_.identity,sending:!1,loading:!1,pageToken:null,deleteReply:_.identity,editReply:()=>new Promise(_.identity)});function dN(){return dN=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},dN.apply(this,arguments)}pN.displayName="CollaborationContext";const mN=e=>v().createElement("svg",dN({width:20,height:20,fillOpacity:.54,fill:"#000",fillRule:"nonzero",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgCommentBubble"},e),v().createElement("path",{d:"M2.8 1h14.4c.99 0 1.8.81 1.8 1.8v10.8c0 .99-.81 1.8-1.8 1.8H4.6L1 19V2.8C1 1.81 1.81 1 2.8 1z"})),gN=(0,kp.Z)((()=>({root:{position:"relative",height:"18px",display:"flex",alignItems:"center",justifyContent:"center",marginLeft:"4px",cursor:"pointer"},icon:{"&:hover":{fillOpacity:.7}}})));function yN(){return yN=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},yN.apply(this,arguments)}const fN=v().forwardRef(((e,t)=>{let{children:r,tooltipTitle:n,icon:a,onClick:i,className:o}=e,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["children","tooltipTitle","icon","onClick","className"]);const s=gN();return v().createElement(gf(),{title:n},v().createElement("div",yN({ref:t,className:O()(s.root,o),onClick:i},l),v().createElement(a,{className:s.icon}),r))}));fN.displayName="BasicCommentButton";const hN=(0,kp.Z)({childrenWrapper:{position:"absolute",width:"100%",height:"100%",lineHeight:"15px",display:"flex",alignItems:"center",justifyContent:"center",top:"-2px",left:0,right:0,bottom:0,color:"white",fontSize:"10px",pointerEvents:"none"}}),EN=v().forwardRef(((e,t)=>{let{children:r,onClick:n}=e;const a=hN();return v().createElement(fN,{ref:t,tooltipTitle:mi().text("Show comment"),icon:mN,onClick:n,"data-reltio-id":"reltio-comment-button"},v().createElement("div",{className:a.childrenWrapper},r))}));function bN(){return bN=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},bN.apply(this,arguments)}EN.displayName="CommentButton";const vN=e=>v().createElement("svg",bN({width:20,height:20,fillOpacity:.54,fill:"#000",fillRule:"nonzero",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgAddComment"},e),v().createElement("path",{d:"M2.8 14.653L3.853 13.6H17.2V2.8H2.8v11.853zM17.2 1c.99 0 1.8.81 1.8 1.8v10.8c0 .99-.81 1.8-1.8 1.8H4.6L1 19V2.8C1 1.81 1.81 1 2.8 1h14.4zm-6.3 3.6H9.1v2.699L6.4 7.3v1.8l2.7-.001V11.8h1.8V9.099l2.7.001V7.3l-2.7-.001V4.6z"})),TN=e=>{let{className:t,onClick:r}=e;return v().createElement(fN,{className:t,onClick:r,tooltipTitle:mi().text("Add comment"),icon:vN})};var ON=r(94511),xN=r.n(ON),CN=r(59674);const SN=(0,kp.Z)((e=>{const t=e.palette.background.paper;return{paper:{backgroundColor:t,maxWidth:1e3},popper:{'&[data-popper-placement*="bottom"] $arrow':{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},'&[data-popper-placement*="top"] $arrow':{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},'&[data-popper-placement*="right"] $arrow':{left:0,marginLeft:"-0.71em",height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}},'&[data-popper-placement*="left"] $arrow':{right:0,marginRight:"-0.71em",height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}}},arrow:{overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:t,"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",boxShadow:e.shadows[1],backgroundColor:"currentColor",transform:"rotate(45deg)"}}}}));function wN(){return wN=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},wN.apply(this,arguments)}const AN=e=>{let{children:t,className:r,classes:n,transition:a}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["children","className","classes","transition"]);const o=SN(),l=a?xN():v().Fragment,[s,c]=(0,b.useState)(null);return v().createElement(CN.r,wN({className:O()(o.popper,r),modifiers:[{name:"preventOverflow",enabled:!0,options:{rootBoundary:"viewport",padding:14,altAxis:!0}},{name:"arrow",enabled:!0,options:{element:s,padding:4}}],transition:a,excludeAnchorFromBackdrop:!1},i),(e=>{let{TransitionProps:r}=e;return v().createElement(l,r,v().createElement(JI(),{className:O()(o.paper,null==n?void 0:n.root)},v().createElement("span",{className:O()(o.arrow,null==n?void 0:n.arrow),ref:c}),t))}))};var RN=r(93526),_N=r.n(RN);const IN=(0,kp.Z)((e=>({menuItem:{minHeight:"32px"},menuText:{color:e.palette.text.primary,fontSize:"13px",lineHeight:"15px",letterSpacing:0}}))),NN=(0,yd.T)(td()),DN=(0,b.forwardRef)(((e,t)=>{let{item:r,onMenuClose:n=_.identity}=e;const a=IN(),{disabled:i,text:o,tooltip:l,onClick:s,id:c="",selectable:u,selected:p}=r;return v().createElement(NN,{tooltipTitle:l,showForDisabled:!0,classes:{root:a.menuItem},onClick:e=>{n(e),s(e)},disabled:i,ref:t,"data-modal":!0,"data-reltio-id":`reltio-search-menu-item${c}`},u&&v().createElement(Jp(),{checked:p,color:"primary"}),v().createElement(Ag(),{classes:{root:a.menuText}},o))}));DN.displayName="DefaultMenuItemRenderer";const PN=(0,kp.Z)((e=>({buttonRoot:{"&$selected":{color:e.palette.action.active,backgroundColor:(0,Lm.alpha)(e.palette.action.active,.12),"&:hover":{backgroundColor:(0,Lm.alpha)(e.palette.action.active,.15)}}},selected:{},paper:{minWidth:"112px"}})));function kN(){return kN=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},kN.apply(this,arguments)}function LN(e){let{className:t,menuId:r,buttonComponent:n=nE(),buttonContent:a,menuItems:i=[],buttonProps:o={},popoverProps:l={},onMenuOpen:s=_.identity,onMenuClose:c=_.identity,MenuItemRenderer:u=DN}=e;const p=n,d=PN(),m=(0,b.useRef)(),[g,y]=(0,b.useState)(!1);(0,OE.D)((()=>{g?s():c()}),[g]);const f=(0,b.useCallback)((e=>{null==e||e.stopPropagation(),y((e=>!e))}),[]);return v().createElement(v().Fragment,null,v().createElement(p,kN({"data-reltio-id":"drop-down-menu-button",ref:m,className:O()(d.buttonRoot,{[d.selected]:g},t),onClick:f,"aria-pressed":g,"aria-controls":g?r:void 0,"aria-haspopup":"true"},o),a),v().createElement(_N(),kN({id:r,variant:"menu",open:g,autoFocus:!1,classes:{paper:d.paper},anchorEl:m.current,onClose:f,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},elevation:2,MenuListProps:{autoFocusItem:g}},l),i.map(((e,t)=>v().createElement(u,{item:e,key:t,onMenuClose:f})))))}const UN=(e,t)=>{(0,b.useEffect)((()=>{if(t){var r,n,a,i;const t=null===(r=e.current)||void 0===r||null===(n=r.value)||void 0===n?void 0:n.length;null===(a=e.current)||void 0===a||a.focus(),null===(i=e.current)||void 0===i||i.setSelectionRange(t,t)}}),[e,t])},jN=(e,t)=>{const r=e.relatedObjectUris.indexOf(t);if(r>=0)return e.relatedObjectUris[1-r]},FN=e=>`${mi().date(e,"LT")} ${mi().date(e,"LL")}`,MN=e=>`comment/${e.commentId}`,VN=(e,t)=>`comment/${e.commentId}/reply/${t.replyId}`,BN=(e,t)=>{let r=e;for(const e of t)r=r.split(`+${e}`).join(`@[${e}](${e})`);return r},zN=v().createContext({});zN.displayName="EntitiesMapContext";const HN=(0,kp.Z)((e=>({title:{marginBottom:"10px",color:e.palette.divider,fontSize:"12px",lineHeight:"14px"},label:{paddingLeft:"9px",borderLeft:"1px solid #D8D8D8",fontSize:"13px",color:e.palette.text.primary,lineHeight:"15px"},link:{color:e.palette.primary.main,textDecoration:"none"}})));function YN(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const WN=e=>{let{comment:t,className:r}=e;const n=HN(),a=(0,b.useContext)(zN),i=(0,w.AH)(),o=(0,w.eh)();return v().createElement(KI(),{className:r},(()=>{switch(t.objectType){case x.CollaborationObjectTypes.ENTITY_ATTRIBUTE:{const e=(0,x.getAttributeTypeUriByValueUri)(t.objectId,o.type),r=(0,x.findAttributeTypeByUri)(i,e);return v().createElement(v().Fragment,null,v().createElement(Ag(),{className:n.title},mi().text("Selected attribute:")),v().createElement(Ag(),{className:n.label},null==r?void 0:r.label))}case x.CollaborationObjectTypes.RELATION_ATTRIBUTE:{const e=t.relatedObjectUris.find((0,_.startsWith)("configuration/relationTypes")),r=e&&(0,x.getAttributeTypeUriByValueUri)(t.objectId,e),a=r&&(0,x.findAttributeTypeByUri)(i,r);return v().createElement(v().Fragment,null,v().createElement(Ag(),{className:n.title},mi().text("Selected attribute:")),v().createElement(Ag(),{className:n.label},null==a?void 0:a.label))}case x.CollaborationObjectTypes.ENTITY:return v().createElement(v().Fragment,null,v().createElement(Ag(),{className:n.title},mi().text("Selected profile:")),v().createElement(qd,{className:O()(n.label,n.link),value:(0,x.getEntityUriForLink)(o)},(0,x.getLabel)(o.label)));case x.CollaborationObjectTypes.RELATION:{const e=jN(t,o.uri),r=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){YN(e,t,r[t])}))}return e}({},a[e]||{},{uri:e});return v().createElement(v().Fragment,null,v().createElement(Ag(),{className:n.title},mi().text("Selected relation:")),v().createElement(Ag(),{className:n.label},v().createElement(qd,{className:n.link,value:(0,x.getEntityUriForLink)(o)},(0,x.getLabel)(o.label)),e&&v().createElement(v().Fragment,null,` ${mi().text("to")} `,v().createElement(qd,{className:n.link,value:(0,x.getEntityUriForLink)(r)},r.label?(0,x.getLabel)(r.label):(0,x.getEntityId)(r)))))}case x.CollaborationObjectTypes.POTENTIAL_MATCH:{var e;const r=jN(t,o.uri),i={uri:r,label:null===(e=a[r])||void 0===e?void 0:e.label};return v().createElement(v().Fragment,null,v().createElement(Ag(),{className:n.title},mi().text("Selected potential match:")),v().createElement(Ag(),{className:n.label},v().createElement(qd,{className:n.link,value:(0,x.getEntityUriForLink)(o)},(0,x.getLabel)(o.label)),r&&v().createElement(v().Fragment,null,` ${mi().text("and")} `,v().createElement(qd,{className:n.link,value:(0,x.getEntityUriForLink)(i)},i.label?(0,x.getLabel)(i.label):(0,x.getEntityId)(i)))))}default:return null}})())},GN=v().createContext([]);GN.displayName="UsersContext";const qN=(0,kp.Z)((e=>({root:{color:e.palette.text.primary,fontSize:"13px",lineHeight:"15px",wordBreak:"break-word"}}))),ZN=e=>{let{comment:t,className:r}=e;const n=qN(),a=(0,b.useContext)(GN);return v().createElement(Ag(),{className:O()(n.root,r)},function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e=>e,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"+";const a=[];let i="",o=!1;for(let l=0;l<=e.length;l++){const s=e[l],c=e[l+1],u=l===e.length-1;i+=s,s===n&&0===l&&(o=!0),o&&t.includes(i.slice(n.length))&&(o=!1,a.push(r(i)),i=""),c===n&&(o=!0,a.push(i),i=""),u&&a.push(i)}return a}(t.content,t.namedUsers,(e=>{const t=a.find((t=>t.username===e.slice(1)));return t?v().createElement(uy(),{href:`mailto:${t.email}`,underline:"hover"},e):e})).map(((e,t)=>v().createElement(b.Fragment,{key:t},e))))},$N=(0,kp.Z)((e=>({root:{width:"32px",height:"32px",fontSize:"12px",color:e.palette.text.secondary,backgroundColor:"rgba(144, 164, 174, 0.2)"}})));function KN(){return KN=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},KN.apply(this,arguments)}const XN=e=>{let{className:t,children:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","children"]);const a=$N();return v().createElement(S(),KN({},n,{className:O()(a.root,t)}),r.split(".").map((e=>e[0].toUpperCase())).join(""))};var QN=r(2271);const JN=r(47503).$+1,eD=(0,kp.Z)((e=>({root:{backgroundColor:"#fff",fontFamily:"Roboto"},mentionsControl:{fontSize:"13px"},mentionsHighlighter:{padding:"10px 22px",border:"1px solid transparent !important","&::before":{content:e=>{let{placeholder:t}=e;return t&&`"${t}"`}}},mentionsInput:{borderRadius:"2px",border:"1px solid rgba(0,0,0,0.12)",padding:"10px 22px",outline:0,overflow:"auto !important"},mentionsSuggestions:{padding:"8px 0",zIndex:JN+"!important",borderRadius:"4px",backgroundColor:"#fafafa !important",boxShadow:"0 2px 2px 0 rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.12), 0 1px 5px 0 rgba(0,0,0,0.2)"},mentionsSuggestionsList:{maxHeight:"200px",overflowY:"scroll"},mentionsSuggestionsItem:{padding:"6px 12px",color:e.palette.text.primary,fontSize:"13px",transition:e.transitions.create(["background-color"]),"&:hover, &--focused":{backgroundColor:"rgba(0,0,0,0.04)"}},mention:{position:"relative",zIndex:1,color:e.palette.primary.main,textShadow:"1px 1px 1px white, 1px -1px 1px white, -1px 1px 1px white, -1px -1px 1px white",pointerEvents:"none"}})));function tD(){return tD=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},tD.apply(this,arguments)}const rD=e=>{let{onChange:t,className:r,value:n,placeholder:a}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["onChange","className","value","placeholder"]);const o=eD({placeholder:n?"":a}),l=(0,b.useContext)(GN);return v().createElement("div",{className:O()(o.root,r)},v().createElement(QN.r,tD({},i,{value:n,placeholder:a,onChange:(e,r,n,a)=>{t(r,n,(0,_.uniq)(a.map((e=>{let{display:t}=e;return t.slice(1)}))))},className:"mentionsTextArea",suggestionsPortalHost:document.body,allowSuggestionsAboveCursor:!0,classNames:{mentionsTextArea__input:o.mentionsInput,mentionsTextArea__highlighter:o.mentionsHighlighter,mentionsTextArea__control:o.mentionsControl,mentionsTextArea__suggestions:o.mentionsSuggestions,mentionsTextArea__suggestions__list:o.mentionsSuggestionsList,mentionsTextArea__suggestions__item:o.mentionsSuggestionsItem}}),v().createElement(QN.p,{trigger:"+",data:l.map((e=>{let{username:t}=e;return{id:t,display:t}})),displayTransform:(e,t)=>`+${t}`,appendSpaceOnAdd:!0,className:o.mention})))},nD=(0,kp.Z)({root:e=>{let{isEditing:t}=e;return{padding:t?"6px 6px 6px 0":" 6px 6px 6px 8px",borderRadius:"4px",backgroundColor:t?"transparent":"rgba(0,114,206,0.06)"}},textField:e=>{let{isEditing:t}=e;return{width:t?"100%":"calc(100% - 40px)"}},form:{marginBottom:0},main:{display:"flex",alignItems:"center"},avatar:{marginRight:"8px"},buttons:e=>{let{isEditing:t}=e;return{marginLeft:t?"0":"40px",marginTop:"8px"}},button:{"& + $button":{marginLeft:"8px"}}}),aD=e=>{switch(e){case"open":return mi().text("Reply...");case"resolved":return mi().text("Adding a comment will re-open this");default:return""}},iD=e=>{let{inputRef:t,className:r,uri:n,relatedObjectUris:a,objectType:i,popperRef:o,comment:l,reply:s,isEditingComment:c,isEditingReply:u,onCancel:p}=e;const d=c||u,m=nD({isEditing:d}),[g,y]=(0,b.useState)(!1),{createReply:f,createComment:h,sending:E,editComment:T,editReply:x,getCommentState:C,updateCommentState:S,clearCommentState:A}=(0,b.useContext)(pN),R=(0,w.qg)(),I=(e=>{let{comment:t,reply:r,isEditingComment:n,isEditingReply:a}=e;return(0,_.isNil)(t)?"comment/new":n?MN(t):a?VN(t,r):(e=>`comment/${e.commentId}/reply/new`)(t)})({comment:l,reply:s,isEditingComment:c,isEditingReply:u}),N=(e=>{let{comment:t,reply:r,isEditingComment:n,isEditingReply:a}=e;const i=n?t:a?r:null,{content:o="",namedUsers:l=[]}=i||{};return{value:BN(o,l),plainTextValue:o,mentions:l}})({comment:l,reply:s,isEditingComment:c,isEditingReply:u}),{value:D=N.value,plainTextValue:P=N.plainTextValue,mentions:k=N.mentions}=C(n,I),L=""!==N.value.trim(),U=""!==D.trim(),j=g||U||L,F=null==l?void 0:l.status,M=()=>{null==p||p(),A(n,I)};(0,b.useEffect)((()=>{o&&o.current.forceUpdate()}),[o,j]);const V=d?"small":"medium";return v().createElement(KI(),{className:O()(m.root,r)},v().createElement("form",{onSubmit:e=>(e.preventDefault(),(0,_.cond)([[(0,_.always)(!l),()=>h({content:P,namedUsers:k,objectType:i,uri:n,relatedObjectUris:a})],[(0,_.always)(c),()=>T({content:P,namedUsers:k,commentId:l.commentId,objectType:i,replies:l.replies,relatedObjectUris:a,uri:n})],[(0,_.always)(u),()=>x({content:P,namedUsers:k,commentId:l.commentId,replyId:s.replyId})],[_.T,()=>f({content:P,namedUsers:k,commentId:l.commentId,action:"open"===l.status?"none":"reopen",uri:n})]])().then(M).catch(console.log)),className:m.form},v().createElement(KI(),{className:m.main},!d&&v().createElement(XN,{classes:{root:m.avatar}},R),v().createElement(rD,{className:m.textField,disabled:E,onChange:(e,t,r)=>S(n,I,{value:e,plainTextValue:t,mentions:r}),inputRef:t,value:D,onFocus:()=>y(!0),onBlur:()=>y(!1),placeholder:aD(F)})),j&&v().createElement(KI(),{className:m.buttons},v().createElement(nE(),{className:m.button,variant:"contained",color:"primary",disabled:!U||E,type:"submit",size:V},((e,t,r)=>t||r?mi().text("Edit"):"open"===e||"resolved"===e?mi().text("Reply"):mi().text("Comment"))(F,c,u)),v().createElement(nE(),{disabled:E,onClick:()=>M(),className:m.button,variant:"outlined",color:"primary",size:V},mi().text("Cancel")))))},oD=(0,kp.Z)((e=>({header:{display:"flex"},avatar:{marginRight:"8px"},username:{marginBottom:"1px",color:e.palette.text.primary,fontSize:"13px",fontWeight:500,lineHeight:"15px"},createdAt:{marginTop:"3px",marginRight:"4px",color:e.palette.text.secondary,fontSize:"11px",lineHeight:"13px",whiteSpace:"nowrap"},body:{marginLeft:"40px"},commentTarget:{marginTop:"-15px",overflowWrap:"break-word"},message:{marginTop:"12px"},dropdownMenu:{zIndex:"3000 !important"},buttons:{marginTop:"15px",marginBottom:"12px",display:"flex","& $button + $button":{marginLeft:"10px"}},button:{fontSize:"13px",lineHeight:"15px"}}))),lD=e=>{let{onReply:t,className:r,uri:n,comment:a,relatedObjectUris:i,objectType:o}=e;const l=oD(),s=(0,b.useRef)(),c=(0,w.qg)(),{commentId:u,createdBy:p,createdTime:d,status:m}=a,g="resolved"===m,y=p===c,{resolveThread:f,reOpenThread:h,sending:E,deleteComment:T,updateCommentState:O,getCommentState:x}=(0,b.useContext)(pN),C=MN(a),{isEditing:S}=x(n,C),A=(0,b.useCallback)((e=>O(n,C,{isEditing:e})),[C,O,n]);UN(s,S);const R=(0,b.useMemo)((()=>g?[{text:mi().text("Delete"),onClick:()=>T({uri:n,commentId:u})}]:[{text:mi().text("Edit"),onClick:()=>A(!0)},{text:mi().text("Delete"),onClick:()=>T({uri:n,commentId:u})}]),[u,T,g,A,n]),_=v().createElement(iD,{inputRef:s,uri:n,relatedObjectUris:i,objectType:o,onCancel:()=>A(!1),isEditingComment:S,comment:a});return v().createElement(KI(),{className:r},v().createElement(KI(),{className:l.header},v().createElement(XN,{classes:{root:l.avatar}},p),v().createElement(KI(),{width:"100%"},v().createElement(Ag(),{className:l.username},p)),v().createElement(Ag(),{className:l.createdAt},FN(d)),y&&v().createElement(LN,{buttonComponent:wd.k,buttonProps:{icon:Vd(),tooltipTitle:mi().text("Open menu")},popoverProps:{PopoverClasses:{root:l.dropdownMenu}},menuItems:R,menuId:"collaboration-comment-menu"})),v().createElement(KI(),{className:l.body},v().createElement(WN,{comment:a,className:l.commentTarget}),S?_:v().createElement(ZN,{comment:a,className:l.message}),v().createElement(KI(),{className:l.buttons},v().createElement(uy(),{className:l.button,onClick:t,component:"button",underline:"hover"},mi().text("Reply")),!g&&v().createElement(uy(),{disabled:E,className:l.button,onClick:()=>{f({commentId:u,uri:n})},component:"button",underline:"hover"},mi().text("Resolve")),g&&v().createElement(uy(),{disabled:E,className:l.button,onClick:()=>{h({commentId:u,uri:n})},component:"button",underline:"hover"},mi().text("Re-open")))))},sD=(0,kp.Z)((e=>({root:{display:"flex",padding:"8px",borderRadius:"4px",backgroundColor:"rgba(0,114,206,0.06)"},avatar:{marginRight:"8px"},replyArea:{width:"calc(100% - 60px)"},header:{display:"flex",marginBottom:"8px"},username:{color:e.palette.text.primary,fontSize:"13px",fontWeight:500,lineHeight:"15px"},message:{marginBottom:"8px",color:e.palette.text.primary,fontSize:"13px",lineHeight:"15px"},createdAt:{color:e.palette.text.secondary,fontSize:"11px",lineHeight:"13px",whiteSpace:"nowrap"},marked:{marginLeft:"8px",color:e.palette.text.secondary,fontSize:"13px",fontStyle:"italic",lineHeight:"15px"}}))),cD=e=>{let{className:t,reply:r,uri:n,comment:a,popperRef:i}=e;const o=(0,b.useRef)(),l=(0,w.qg)(),{createdBy:s,action:c,createdTime:u}=r,p=s===l&&"resolved"!==a.status,{deleteReply:d,updateCommentState:m,getCommentState:g}=(0,b.useContext)(pN),y=VN(a,r),{isEditing:f}=g(n,y),h=(0,b.useCallback)((e=>m(n,y,{isEditing:e})),[y,m,n]);UN(o,f);const E=sD(),T=(0,b.useMemo)((()=>[{text:mi().text("Edit"),onClick:()=>h(!0)},{text:mi().text("Delete"),onClick:()=>d({uri:n,commentId:a.commentId,reply:r})}]),[d,n,a.commentId,r,h]),x=v().createElement(iD,{inputRef:o,popperRef:i,uri:n,onCancel:()=>h(!1),isEditingReply:f,reply:r,comment:a});return v().createElement(KI(),{className:O()(E.root,t)},v().createElement(XN,{classes:{root:E.avatar}},s),v().createElement(KI(),{className:E.replyArea},v().createElement(KI(),{className:E.header},v().createElement(Ag(),{className:E.username},s),"resolve"===c&&v().createElement(Ag(),{className:E.marked},mi().text("Marked as resolved")),"reopen"===c&&v().createElement(Ag(),{className:E.marked},mi().text("Re-opened"))),"resolve"!==c&&(f?x:v().createElement(ZN,{className:E.message,comment:r})),v().createElement(Ag(),{className:E.createdAt},FN(u))),p&&v().createElement(LN,{buttonComponent:wd.k,buttonProps:{icon:Vd(),tooltipTitle:mi().text("Open menu")},menuItems:T,menuId:"collaboration-comment-menu"}))},uD=(0,kp.Z)((()=>({root:{maxWidth:"100%",padding:"8px 4px 10px 16px"},messages:{},repliedComment:{marginBottom:"2px"},replies:{marginLeft:"40px"},sendMessageArea:{marginLeft:"40px"},comment:{}}))),pD=(0,b.memo)((e=>{let{uri:t,relatedObjectUris:r,objectType:n,classes:a,popperRef:i,messagesRef:o,comment:l}=e;const s=(0,b.useRef)(),c=uD({classes:a}),u=v().createElement(iD,{className:c.sendMessageArea,inputRef:s,popperRef:i,uri:t,relatedObjectUris:r,objectType:n,comment:l});return v().createElement(KI(),{className:c.root},l&&v().createElement(v().Fragment,null,v().createElement("div",{className:c.messages,ref:o},v().createElement(lD,{comment:l,uri:t,onReply:()=>{s.current.focus()},className:c.comment,relatedObjectUris:r,objectType:n}),v().createElement(KI(),{className:c.replies},l.replies.map((e=>v().createElement(cD,{key:e.replyId,className:c.repliedComment,reply:e,uri:t,comment:l}))))),u),!l&&u)})),dD=(0,kp.Z)((e=>({root:{},header:{display:"flex",alignItems:"center",height:"48px",paddingLeft:"16px",paddingRight:"8px"},headerInfo:{marginRight:"auto",display:"flex",alignItems:"center"},title:{marginRight:"15px",color:e.palette.text.primary,fontSize:"16px"},counter:{paddingLeft:"15px",borderLeft:"1px solid rgba(0,0,0,0.12)",color:e.palette.text.secondary,fontSize:"14px",lineHeight:"24px"},resolveButton:{zIndex:3e3,"&:hover":{backgroundColor:"transparent"}},popper:{width:"424px",borderRadius:"0 0 4px 4px"},collaborationItem:{padding:"0 0 10px 0"},comment:e=>{let{hasScroll:t}=e;return{marginLeft:"16px",marginRight:t?"2px":"8px"}},replies:e=>{let{hasScroll:t}=e;return{marginLeft:"8px",marginRight:t?"2px":"8px"}},sendMessageArea:e=>{let{hasScroll:t,scrollWidth:r}=e;return{marginLeft:"8px",marginRight:t?r+2:"8px"}},messages:{maxHeight:"400px",overflowY:"auto"}}))),mD=e=>{let{uri:t,relatedObjectUris:r,objectType:n,anchorEl:a,onClose:i,open:o,comment:l}=e;const[s,c]=(0,b.useState)(0),u=dD({scrollWidth:s,hasScroll:0!==s}),p=(0,b.useRef)(null),{resolveThread:d,loading:m,sending:g}=(0,b.useContext)(pN),y=1+(null==l?void 0:l.replies.length);return v().createElement(AN,{popperRef:p,anchorEl:a,open:o,placement:"right-start",onClose:i,className:u.popper},v().createElement(KI(),{className:u.header},v().createElement(KI(),{className:u.headerInfo},v().createElement(Ag(),{className:u.title},mi().text("Comments")),l&&!m&&v().createElement(Ag(),{className:u.counter},mi().number(y)," ",1===y?mi().text("item"):mi().text("items"))),l&&!m&&v().createElement(wd.k,{className:u.resolveButton,size:"S",onClick:()=>{d({commentId:l.commentId,uri:t})},disabled:g,showForDisabled:!0,tooltipTitle:mi().text("Resolve"),icon:Sm(),color:"primary"})),!m&&v().createElement(pD,{popperRef:p,messagesRef:e=>{e&&c(e.offsetWidth-e.clientWidth)},classes:{root:u.collaborationItem,replies:u.replies,sendMessageArea:u.sendMessageArea,messages:u.messages,comment:u.comment},uri:t,relatedObjectUris:r,objectType:n,comment:l}))},gD=(0,kp.Z)((()=>({root:{display:"flex",alignItems:"start"},addButton:{visibility:"hidden","&$showAlways":{visibility:"visible"},".commentsContainerVisibilityArea:hover &":{visibility:"visible"}},showAlways:{}}))),yD=e=>{let{className:t,uri:r,objectType:n,relatedObjectUris:a,onChangePopupVisibility:i,allowOnlyOneComment:o=!1,showAlways:l=!1}=e;const s=gD(),[c,u]=(0,b.useState)(null),[p,d]=(0,b.useState)(!1),m=p&&Boolean(c),{currentComment:g,commentsMap:y,getComment:f,clearCurrentComment:h,objectTypes:E}=(0,b.useContext)(pN),T=!!y&&(!E||E.includes(n)),x=((null==y?void 0:y[r])||[]).filter((e=>{let{status:t}=e;return"resolved"!==t})).reverse(),C=!o||o&&0===x.length,S=null===g&&m;(0,OE.D)((()=>{i&&i(m)}),[m]);const w=(0,b.useContext)(uN),A=(0,b.useMemo)((()=>w?[...a,...w]:a),[w,a]);return T&&v().createElement("div",{className:O()(s.root,t)},C&&v().createElement(TN,{className:O()(s.addButton,{[s.showAlways]:l||S}),onClick:e=>{u(e.currentTarget),d(!0)}}),x.map((e=>{let{replies:t,commentId:r}=e;return v().createElement(EN,{ref:r===(null==g?void 0:g.commentId)?u:null,key:r,onClick:()=>(e=>{f(e),d(!0)})(r)},1+t)})),v().createElement(mD,{anchorEl:c,open:m,onClose:()=>{u(null),h(),d(!1)},uri:r,relatedObjectUris:A,objectType:n,comment:g}))},fD=(0,kp.Z)({label:{color:"rgba(0,0,0,0.6)",fontSize:"13px",lineHeight:"16px"}});function hD(){return hD=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hD.apply(this,arguments)}const ED=e=>{let{label:t,isRequired:r,className:n}=e,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["label","isRequired","className"]);const i=fD();return v().createElement(Ag(),hD({className:O()(i.label,n),component:"span"},a),t,r&&v().createElement(dd,null))},bD=v().createContext(null);bD.displayName="EntityContext";const vD=(0,kp.Z)((e=>({container:{height:"16px",borderColor:(0,Lm.alpha)(e.palette.primary.main,.54)},label:{paddingLeft:"4px",paddingRight:"4px",fontSize:"10px",lineHeight:"11px",color:e.palette.primary.main}}))),TD=(0,yd.T)(Of()),OD=e=>{let{className:t,attributeType:r,nonOvValues:n=[],nonOvTotal:a}=e;const i=vD(),o=(0,w.ax)("openEntity"),l=((e,t,r)=>{var n;const a=null==t||null===(n=t[0])||void 0===n?void 0:n.uri,i=a?(0,x.getEntityUriFromAttributeUri)(a):null;if(i&&(0,x.isEntityUri)(i)){const t=(0,x.getEntityUriFromAttributeUri)(r.uri);if(!e||e.type===t)return{uri:i,type:t};const n=(0,x.getParentUri)(a),o=(0,x.findAttributeValueByUri)(e,n);return{uri:(0,x.getReferencedEntityUriFromAttrValue)(o),type:t}}return e?{uri:e.uri,type:e.type}:null})((0,b.useContext)(bD),n,r),s=(0,w.fC)(null==l?void 0:l.type),c=(0,b.useCallback)((()=>{o({uri:l.uri,screen:"sources"})}),[o,l]);if(!a)return null;const u=n.length?n.map(((e,t)=>v().createElement("div",{key:t},(0,x.isComplexAttribute)(r)?(0,x.getLabel)(e.label):v().createElement(Xd.x,{value:(0,x.getAttributeValue)(e),dataTypeDefinition:(0,x.getAttrDataTypeDefinition)(r),rich:!1})))):null;return v().createElement(TD,{tooltipTitle:u,tooltipPlacement:"bottom",label:`+ ${a}`,variant:"outlined",onClick:null!=l&&l.uri&&s?c:void 0,classes:{root:O()(i.container,t),label:i.label}})};function xD(){return xD=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},xD.apply(this,arguments)}const CD=e=>v().createElement("svg",xD({width:12,height:12,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgDescription"},e),v().createElement("path",{d:"M5.417 9.5h1.166V8.333H5.417V9.5zM6 .167A5.835 5.835 0 00.167 6 5.835 5.835 0 006 11.833 5.835 5.835 0 0011.833 6 5.835 5.835 0 006 .167zm0 10.5A4.673 4.673 0 011.333 6 4.673 4.673 0 016 1.333 4.673 4.673 0 0110.667 6 4.673 4.673 0 016 10.667zM6 2.5a2.333 2.333 0 00-2.333 2.333h1.166A1.17 1.17 0 016 3.667a1.17 1.17 0 011.167 1.166c0 1.167-1.75 1.021-1.75 2.917h1.166c0-1.313 1.75-1.458 1.75-2.917A2.333 2.333 0 006 2.5z",fill:"#000",fillOpacity:.54})),SD=v().createContext({showDescription:!1,showNavigateToGraph:!0});SD.displayName="FeaturesContext";const wD=(0,kp.Z)((()=>({icon:{display:"inline-flex",marginLeft:"8px",verticalAlign:"middle"}}))),AD=e=>{let{className:t,description:r}=e;const{showDescription:n}=(0,b.useContext)(SD),a=wD();return r&&n?v().createElement(gf(),{title:r,placement:"bottom"},v().createElement("span",{"data-reltio-id":"reltio-description-icon",className:O()(a.icon,t)},v().createElement(CD,null))):null};var RD=r(87558);const _D=(0,r(87171).k)({unmaskedAttributes:{},unmaskAttributeValue:void 0,maskAttributeValue:void 0}),ID=e=>(0,RD.S)(_D,e),ND=v().createContext({appearance:void 0,attributes:void 0,roles:void 0,tags:void 0});ND.displayName="HistoryDiffContext";const DD=v().createContext({highlightedValuesUris:[],highlightedClassName:""});function PD(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}DD.displayName="HighlightedValuesContext";const kD=(e,t,r,n)=>{const a=((e,t)=>{const r=t.find((t=>t.uri===e.uri));return r&&Array.isArray(r.children)?r.children:[]})(e,r);let i=(null==e?void 0:e.attributes)||(null==e?void 0:e.analyticsAttributes)||[];return a.length&&(i=i.filter((e=>a.includes(e.uri)))),i.reduce(((e,a)=>{const i=LD(t[a.name],n,r);return i&&i.length&&(Array.isArray(i[0])?e.push({[a.uri]:i[0]}):e.push({[a.uri]:i})),e}),[])},LD=(e,t,r)=>{if(e&&0!==e.length)return e.reduce(((e,n)=>{if("type"in n&&n.type){const a="lookupCode"in n?n.lookupCode:n.value,i=(0,x.findAttributeTypeByUri)(t,n.type);a&&"object"!=typeof a&&(0,x.isOv)(n)?e.push(UD(a,i)):a&&"object"==typeof a&&!Array.isArray(a)&&e.push(kD(i,a,r,t))}return e}),[])},UD=(e,t)=>{switch(null==t?void 0:t.type){case x.DataTypes.TYPE_DATE:return new Date(e).getTime();case x.DataTypes.TYPE_TIMESTAMP:return isNaN(Number(e))?new Date(e).getTime():new Date(Number(e)).getTime();default:return e}};function jD(){return jD=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},jD.apply(this,arguments)}const FD=e=>v().createElement("svg",jD({width:11,height:11,viewBox:"0 0 11 11","data-reltio-id":"SvgPivotingIcon"},e),v().createElement("path",{d:"M2.514 5h2.314V3l2.5 2.5-2.5 2.5V6h-3.8a4.5 4.5 0 10.73-3H.6a5.5 5.5 0 11-.577 3H0V5H2.514z",fill:"#6CACE4",stroke:"none",strokeWidth:1,fillRule:"evenodd"})),MD=(0,kp.Z)((e=>({link:{color:e.palette.primary.main,textDecoration:"none"}}))),VD=(0,b.forwardRef)(((e,t)=>{let{value:r,attributeType:n,children:a,className:i,onClick:o}=e;const l=MD(),{generatePivotingUrl:s}=(0,b.useContext)(Wd),c=s({uiPath:(0,w.Qh)(),uri:n.uri,value:JSON.stringify(r)}),u=(0,b.useCallback)((e=>{(0,Dp.rR)(e)||(o(),e.preventDefault()),e.stopPropagation()}),[o]);return v().createElement("a",{ref:t,href:c,onClick:u,className:O()(l.link,i)},a)}));VD.displayName="PivotingUriLink";const BD=(0,kp.Z)((e=>({container:{backgroundColor:"white",width:"360px",minWidth:"360px",maxWidth:"720px"},header:{display:"flex",height:"48px",alignItems:"center",justifyContent:"space-between",paddingLeft:"16px"},title:{color:e.palette.text.primary,fontSize:"16px",letterSpacing:"0.15px",lineHeight:"19px"},entityTypeLabel:{color:"rgba(0,0,0,0.67)",fontSize:"14px",paddingLeft:"16px",paddingBottom:"12px",lineHeight:"16px"},divider:{height:"24px",width:"1px",backgroundColor:"rgba(0,0,0,0.12)"},headerCount:{color:e.palette.text.secondary,fontSize:"14px",letterSpacing:"0.24px",lineHeight:"28px",width:"210px"},body:{borderBottom:"1px solid rgba(0,0,0,0.12)",padding:"0 16px 8px"},footer:{display:"flex",alignItems:"center",height:"32px",paddingLeft:"16px",color:e.palette.primary.main,fontSize:"13px",letterSpacing:"0",lineHeight:"16px"},profileIcon:{height:"16px",width:"16px"},entityContainer:{display:"flex",flexDirection:"row",alignItems:"center"},entityLabel:{color:e.palette.primary.main,fontSize:"13px",letterSpacing:"0",lineHeight:"15px",textDecoration:"none",paddingLeft:"8px",wordBreak:"break-word"},seeAllButton:{cursor:"pointer"}}))),zD=e=>{let{attributeType:t,label:r,entities:n,generatedValue:a,onSeeAllClick:i,total:o}=e;const l=BD(),s=o>6,c=Boolean(r);return v().createElement("div",{className:l.container},v().createElement("div",{className:l.header},v().createElement("div",{className:l.title},mi().text("Pivot profiles")),v().createElement("div",{className:l.divider}),v().createElement("div",{className:l.headerCount},mi().number(o,"0,0")+" "+(1===o?mi().text("item"):mi().text("items")))),c&&v().createElement("div",{className:l.entityTypeLabel},r),v().createElement("div",{className:l.body},n.map((e=>v().createElement("div",{key:e.uri,className:l.entityContainer},v().createElement(A,{entity:e,avatarClassName:l.profileIcon}),v().createElement(qd,{className:l.entityLabel,value:(0,x.getEntityUriForLink)(e)},(0,x.getLabel)(e.label)))))),s&&v().createElement("div",{className:l.footer},v().createElement(VD,{value:a,attributeType:t,className:l.seeAllButton,onClick:i},mi().text("See all"))))},HD=(0,kp.Z)((e=>({icon:{marginRight:"8px",verticalAlign:"middle",width:"12px",height:"12px"},content:{color:e.palette.primary.main,cursor:"pointer",lineHeight:"16px"}}))),YD=(0,kp.Z)({tooltip:{backgroundColor:"white",boxShadow:"0 4px 5px 0 rgba(0,0,0,0.14), 0 1px 10px 0 rgba(0,0,0,0.12), 0 2px 4px -1px rgba(0,0,0,0.2)",padding:0,borderRadius:"4px",maxWidth:"none"},arrow:{"&::before":{backgroundColor:"white"}}}),WD=e=>{let{value:t,attributeType:r,children:n,className:a}=e;const i=YD(),o=HD(),l=(0,b.useContext)(XI)||[],s=(0,w.ax)("openPivotingPerspective"),c=(0,w.AH)()||{},u=(0,x.isNested)(r)?kD(r,t.value,l,c):UD(t.lookupCode||t.value,r),p=l.some((e=>{let{uri:t}=e;return t===r.uri}))&&(Array.isArray(u)&&u.length||!Array.isArray(u)&&!(0,_.isNil)(u)),d=l.find((e=>{let{uri:t}=e;return t===r.uri})),m=null==d?void 0:d.popup,g=p?Array.isArray(u)?u.map((e=>Object.fromEntries(Object.entries(e).map((e=>{let[t,r]=e;return[(0,x.getLastUriPart)(t),r]}))))):((e,t)=>[{[e.name]:t}])(r,u):void 0,y=()=>{s({value:g,attributeType:r})},{entities:f,total:h,loadPivotingData:E}=(e=>{let{value:t,attributeType:r,entityType:n}=e;const[a,i]=(0,b.useState)([]),[o,l]=(0,b.useState)(0),s=(0,Ph._)(),c=(0,w.eh)(),u=(0,w.mU)(),p=n||(null==c?void 0:c.type),d=(0,b.useMemo)((()=>(0,x.convertPivotingValueToSearchFilters)({value:t,attributeType:r,entityType:p})),[r,p,t]),m=(0,b.useMemo)((()=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){PD(e,t,r[t])}))}return e}({max:6,sort:"label"},u||{})),[u]),g=(0,b.useCallback)((()=>{s(Promise.all([(0,x.getFilteredEntities)({filters:d,options:m}),(0,x.getTotals)({filters:d,options:m})])).then((e=>{const[t,{total:r}]=e;i(Array.isArray(t)?t:[]),l(r)})).catch((()=>{i([]),l(0)}))}),[d,m,s]);return{entities:a,total:o,loadPivotingData:g}})({attributeType:r,value:u,entityType:null==m?void 0:m.entityType});return p?v().createElement(gf(),{arrow:!0,placement:"right-start",classes:i,disableInteractive:!1,onOpen:E,title:v().createElement(zD,{generatedValue:g,attributeType:r,label:null==m?void 0:m.label,onSeeAllClick:y,entities:f,total:h})},v().createElement("span",{className:a},v().createElement(FD,{className:o.icon}),v().createElement(VD,{onClick:y,className:o.content,value:g,attributeType:r},n))):v().createElement(v().Fragment,null,n)};var GD=r(78577),qD=r.n(GD),ZD=r(46157),$D=r.n(ZD);const KD=(0,kp.Z)((e=>({icon:{color:e.palette.text.secondary,fontSize:18},switcherWrapper:{verticalAlign:"middle",marginLeft:8,width:"16px",height:"16px"}}))),XD=e=>{let{className:t,isMasked:r,isUnmasking:n,onToggleMasking:a}=e;const i=KD(),o=r?mi().text("Show"):mi().text("Hide");return n?v().createElement(Tm(),{size:16,className:O()(t,i.switcherWrapper)}):v().createElement(gf(),{key:String(r),title:o},v().createElement(tE(),{"aria-label":o,onClick:a,className:O()(t,i.switcherWrapper)},r?v().createElement($D(),{className:i.icon}):v().createElement(qD(),{className:i.icon})))};function QD(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){JD(e,t,r[t])}))}return e}function JD(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const eP=(0,kp.Z)((e=>({root:{display:"flex",alignItems:"start",justifyContent:"space-between"},commentsContainer:{height:"15px",marginRight:"-4px"},attributeValue:{verticalAlign:"middle",wordBreak:"break-all"},updateAttribute:QD({width:"fit-content",padding:"0 4px",marginLeft:"-4px"},x.historyPalettes[x.HistoryOperations.updateAttribute],{"& > a":{color:x.historyPalettes[x.HistoryOperations.updateAttribute].color}}),insertAttribute:QD({width:"fit-content"},x.historyPalettes[x.HistoryOperations.insertAttribute],{"& > a":{color:x.historyPalettes[x.HistoryOperations.insertAttribute].color}}),deleteAttribute:QD({width:"fit-content",padding:"0 4px",marginLeft:"-4px",textDecoration:"line-through"},x.historyPalettes[x.HistoryOperations.deleteAttribute],{"& > a":{color:x.historyPalettes[x.HistoryOperations.deleteAttribute].color}}),multilineAttribute:{width:"fit-content"},ovFalse:e.inactive}))),tP=e=>{let{className:t,attributeType:r=null,attributeValue:n,inlined:a}=e;const{isUnmaskingNeeded:i,isMasked:o,toggleMasking:l,attributeValue:s,isUnmasking:c}=(e=>{let{attributeType:t,attributeValue:r}=e;const n=ID((e=>{let{unmaskAttributeValue:t}=e;return t})),a=ID((e=>{let{maskAttributeValue:t}=e;return t})),{attributeValue:i,isUnmasked:o=!1,loading:l=!1}=(s=r.uri,ID((e=>{let{unmaskedAttributes:t}=e;return t[s]}))||{});var s;const c=n&&a&&!!t.masking,u=(0,b.useCallback)((()=>c?n(r.uri):Promise.resolve()),[n,r.uri,c]),p=(0,b.useCallback)((()=>{o?a(r.uri):u()}),[r.uri,o,a,u]);return{isUnmaskingNeeded:c,isMasked:!o,toggleMasking:p,isUnmasking:l,unmask:u,attributeValue:c&&o&&i||r}})({attributeType:r,attributeValue:n}),u=eP(),{highlightedValuesUris:p=[],highlightedClassName:d}=(0,b.useContext)(DD),{appearance:m}=(0,b.useContext)(ND),g=(0,x.getHistoryAppearanceByUri)(s.uri,m),y=(0,x.getHistoryAttributeClassName)(g),f=(0,b.useMemo)((()=>v().createElement(Xd.x,{value:(0,x.getAttributeValue)(s),dataTypeDefinition:(0,x.getAttrDataTypeDefinition)(r)})),[s,r]),h=(0,x.isRelationUri)(s.uri)?x.CollaborationObjectTypes.RELATION_ATTRIBUTE:x.CollaborationObjectTypes.ENTITY_ATTRIBUTE,E=i&&v().createElement(XD,{isMasked:o,onToggleMasking:l,isUnmasking:c});return a||y?v().createElement("div",{className:O()(t,{[d]:p.includes(s.uri)})},v().createElement(WD,{value:s,attributeType:r,key:s.uri,className:O()({[u.multilineAttribute]:!a})},v().createElement("span",{className:O()(u.attributeValue,u[y],{[u.ovFalse]:!(0,x.isOv)(s)}),"data-reltio-id":"reltio-attribute-value"},f,E))):v().createElement("div",{className:O()(t,u.root,cN,{[d]:p.includes(s.uri)})},v().createElement(WD,{value:s,attributeType:r,key:s.uri},v().createElement("span",{className:O()(u.attributeValue,{[u.ovFalse]:!(0,x.isOv)(s)}),"data-reltio-id":"reltio-attribute-value"},f,E)),v().createElement(yD,{className:u.commentsContainer,uri:s.uri,relatedObjectUris:(0,x.createRelatedObjectUris)(h,{uri:s.uri}),objectType:h}))};var rP=r(84419),nP=r.n(rP);const aP=(0,kp.Z)({expandButton:{"&:hover":{backgroundColor:"transparent"}},expandIcon:{transition:"transform .15s ease"},expanded:{transform:"rotate(90deg)"}});function iP(){return iP=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},iP.apply(this,arguments)}const oP=e=>{const t=aP(),{expanded:r,className:n}=e,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["expanded","className"]);return v().createElement(Pp.T,iP({icon:nP(),size:"XXS",disableRipple:!0,iconClassName:O()(t.expandIcon,{[t.expanded]:r}),className:O()(n,t.expandButton),"data-reltio-id":"arrow-expand-button"},a))},lP=(0,kp.Z)((e=>({complexContainer:{marginTop:"1px"},labelContainer:{display:"flex",minHeight:"18px"},label:{display:"inline-flex",fontSize:"13px",lineHeight:"16px",letterSpacing:"normal",marginLeft:"2px"},spacer:{flex:1},ovFalse:e.inactive})));function sP(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const cP=e=>{let{attributeTypesList:t,attributeValue:r,label:n,expanded:a=!1,children:i,showNonOv:o,attributeType:l,LabelRenderer:s,RightSlot:c}=e;const u=lP(),p=r.uri,[d,m]=(0,b.useState)(!1),{highlightedValuesUris:g=[],highlightedClassName:y}=(0,b.useContext)(DD);(0,b.useEffect)((()=>{m(a)}),[a]);const f=(t||[]).some((e=>(0,x.isAnalyticAttribute)(e))),h=(0,b.useMemo)((()=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){sP(e,t,r[t])}))}return e}({attributes:f?null:r.value,analyticsAttributes:f?r.value:null},(0,x.isSpecialAttribute)(l)?r.value:{})),[r,f,l]),E=(0,x.isRelationUri)(r.uri)?x.CollaborationObjectTypes.RELATION_ATTRIBUTE:x.CollaborationObjectTypes.ENTITY_ATTRIBUTE;return v().createElement("div",{className:u.complexContainer},v().createElement("div",{className:O()(u.labelContainer,cN)},v().createElement(oP,{onClick:()=>m((e=>!e)),expanded:d}),s?v().createElement(s,{attributeType:l,attributeValue:r}):v().createElement(v().Fragment,null,v().createElement(Ag(),{component:"span",variant:"body2",classes:{body2:u.label},className:O()({[y]:g.includes(r.uri),[u.ovFalse]:!(0,x.isOv)(r)}),"data-reltio-id":"reltio-attribute-complex-label"},n),v().createElement("div",{className:u.spacer}),c&&v().createElement(c,{attributeType:l,attributeValue:r}),v().createElement(yD,{uri:r.uri,relatedObjectUris:(0,x.createRelatedObjectUris)(E,{uri:r.uri}),objectType:E}))),d&&v().createElement(KF,{attrTypes:t,entity:h,drawLines:!0,parentUri:p,showNonOv:o},i))};var uP=r(29195);function pP(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){dP(e,t,r[t])}))}return e}function dP(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const mP=(0,kp.Z)({label:{textDecoration:"none",verticalAlign:"middle"},updateAttribute:pP({width:"fit-content",padding:"0 4px",marginLeft:"-4px"},x.historyPalettes[x.HistoryOperations.updateAttribute]),insertAttribute:pP({width:"fit-content"},x.historyPalettes[x.HistoryOperations.insertAttribute]),deleteAttribute:pP({width:"fit-content",textDecoration:"line-through",padding:"0 4px",marginLeft:"-4px"},x.historyPalettes[x.HistoryOperations.deleteAttribute]),pivotingTooltip:{marginLeft:"4px"}});function gP(){return gP=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gP.apply(this,arguments)}const yP=(0,b.memo)((e=>{let{attributeValue:t,attributeType:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeValue","attributeType"]);const a=mP(),{appearance:i}=(0,b.useContext)(ND),o=(0,b.useMemo)((()=>{const e=(0,x.getHistoryAppearanceByUri)(t.uri,i),n=(0,x.getHistoryAttributeClassName)(e),o=t.label?t.label:(0,x.evaluateDeepEntityLabel)(t,r.dataLabelPattern);return v().createElement(WD,{className:a.pivotingTooltip,value:t,attributeType:r},v().createElement(KI(),{component:"span",className:O()(a[n],a.label)},v().createElement(uP.b,{text:(0,x.getLabel)(o)})))}),[i,a,t,r]);return v().createElement(cP,gP({label:o,attributeValue:t,attributeTypesList:(0,x.getAttributeTypeSubAttributes)({},r),attributeType:r},n))}));var fP=r(24217),hP=r(16782);const EP=(0,kp.Z)((e=>({link:{color:e.palette.primary.main,textDecoration:"none"}})));function bP(){return bP=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},bP.apply(this,arguments)}const vP=e=>{const t=EP(),r=(0,hP.GV)(),{href:n,className:a}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["href","className"]),o=O()(t.link,a);return r&&n?v().createElement(fP.rU,bP({to:n.replace(window.location.origin,""),className:o},i)):v().createElement("a",bP({href:n,className:o},i))};function TP(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){OP(e,t,r[t])}))}return e}function OP(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const xP=(0,kp.Z)((e=>({relationshipLabel:{marginLeft:"4px",color:e.palette.text.primary},updateAttribute:TP({width:"fit-content",padding:"0 4px",marginLeft:"-4px"},x.historyPalettes[x.HistoryOperations.updateAttribute]),insertAttribute:TP({width:"fit-content"},x.historyPalettes[x.HistoryOperations.insertAttribute]),deleteAttribute:TP({width:"fit-content",textDecoration:"line-through",padding:"0 4px",marginLeft:"-4px"},x.historyPalettes[x.HistoryOperations.deleteAttribute]),ovFalse:e.inactive})));function CP(){return CP=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},CP.apply(this,arguments)}const SP=(0,b.memo)((e=>{let{attributeValue:t,attributeType:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeValue","attributeType"]);const a=xP(),i=(0,w.AH)(),o=(0,w.Qh)(),l=(0,x.getReferencedEntityUriFromAttrValue)(t),s=(0,b.useMemo)((()=>(0,x.getAttributeTypeSubAttributes)(i,r)),[r,i]),{appearance:c}=(0,b.useContext)(ND),{generateEntityUrl:u}=(0,b.useContext)(Wd),p=(0,b.useMemo)((()=>{const e=(0,x.getHistoryAppearanceByUri)(t.uri,c),r=(0,x.getHistoryAttributeClassName)(e),n=null!=l&&l.startsWith("changeRequests")?"dcrReview":"profile";return v().createElement(vP,{href:(0,x.isEmptyValue)(c)?u({uiPath:o,uri:l,screen:n}):void 0,className:O()(a[r],{[a.ovFalse]:!(0,x.isOv)(t)})},v().createElement(uP.b,{text:(0,x.getLabel)(t.label)}),t.relationshipLabel&&v().createElement("span",{className:a.relationshipLabel},v().createElement(uP.b,{text:t.relationshipLabel})))}),[t,c,o,l,a,u]);return v().createElement(cP,CP({attributeTypesList:s,attributeValue:t,label:p,attributeType:r},n))}));SP.displayName="ReferenceAttribute";const wP=e=>{const{attributeType:t}=e;return class{static build(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};switch(e.type){case x.DataTypes.TYPE_NESTED:return v().createElement(yP,t);case x.DataTypes.TYPE_REFERENCE:return v().createElement(SP,t);default:return v().createElement(tP,t)}}}.build(t,e)};function AP(){return AP=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},AP.apply(this,arguments)}const RP=e=>v().createElement("svg",AP({width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgControlAttribute"},e),v().createElement("mask",{id:"ControlAttribute_svg__a",fill:"#fff"},v().createElement("path",{d:"M10.966 9.203a3.2 3.2 0 11-.018-2.449l-1.375.581a1.707 1.707 0 10.01 1.307l1.383.561z"})),v().createElement("path",{d:"M10.966 9.203a3.2 3.2 0 11-.018-2.449l-1.375.581a1.707 1.707 0 10.01 1.307l1.383.561z",stroke:"#72828B",strokeWidth:4,mask:"url(#ControlAttribute_svg__a)"}),v().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.297 8.965a4.804 4.804 0 004.068 3.793v1.61a6.403 6.403 0 01-5.693-5.403h1.625zm4.068-5.724a4.803 4.803 0 00-4.124 4.124h-1.61a6.402 6.402 0 015.734-5.734v1.61zm5.393 4.124a4.804 4.804 0 00-3.793-4.068V1.672a6.403 6.403 0 015.404 5.693h-1.61zm-.055 1.6a4.806 4.806 0 01-3.738 3.738v1.625a6.405 6.405 0 005.363-5.363h-1.625z",fill:"#72828B"})),_P=(0,kp.Z)({icon:{display:"inline-flex",marginLeft:"8px",verticalAlign:"middle"}});function IP(){return IP=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},IP.apply(this,arguments)}const NP=(0,b.forwardRef)(((e,t)=>v().createElement("span",IP({},e,{ref:t}),v().createElement(RP,null))));NP.displayName="ControlAttributeForwarded";const DP=(0,yd.T)(NP),PP=()=>{const e=_P();return v().createElement(DP,{"data-reltio-id":"reltio-control-attribute-icon",tooltipTitle:mi().text("This is a control attribute. Changing this value will affect availability of other conditional attributes."),className:e.icon})};function kP(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){LP(e,t,r[t])}))}return e}function LP(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const UP="13px",jP="16px",FP={titleRow:{display:"inline-block",minHeight:"16px"},title:{wordBreak:"break-all",verticalAlign:"middle"},ovIcon:{marginLeft:"8px",textIndent:0},descriptionIcon:{textIndent:0}},MP=(0,kp.Z)({paddingWrapper:{paddingTop:"3px",paddingBottom:"5px","&:last-child":{paddingBottom:"2px"}},paddingWrapperWithLines:{paddingBottom:"1px","&:last-child":{paddingBottom:"2px"}}}),VP=(0,kp.Z)(kP({wrapper:{fontSize:UP,lineHeight:jP},collaborationWrapper:{display:"flex",alignItems:"start",minHeight:"18px",justifyContent:"space-between"},attribute:{marginLeft:"8px",paddingLeft:"4px",paddingRight:"4px",display:"inline",overflow:"hidden",whiteSpace:"pre-wrap",wordBreak:"break-word"},titleIcon:{width:"16px",height:"16px",marginRight:"8px",marginLeft:"1px",color:"rgba(0, 0, 0, 0.38)",verticalAlign:"middle"}},FP)),BP=(0,kp.Z)(kP({wrapper:{display:"flex",flexDirection:"column",alignItems:"flex-start",fontSize:UP,lineHeight:jP},attribute:{"&:last-child":{marginBottom:0},paddingLeft:"4px",paddingRight:"4px",marginLeft:"5px",marginBottom:"4px",whiteSpace:"pre-wrap",wordBreak:"break-word"},attributes:{alignSelf:"stretch"},titleRow:kP({},FP.titleRow,{marginBottom:"3px"})},FP)),zP=e=>{let{value:t,nonVisibleValues:r,attributeType:n,titleClassName:a,contentClassName:i,showNonOv:o,totalNonVisibleValues:l}=e;const s=VP(),{label:c,description:u}=n,p=(0,w.Ws)(),d=(0,b.useMemo)((()=>p.includes(n.uri)),[p,n.uri]),m=(0,x.isRelationUri)(t.uri)?x.CollaborationObjectTypes.RELATION_ATTRIBUTE:x.CollaborationObjectTypes.ENTITY_ATTRIBUTE;return v().createElement("div",{"data-reltio-id":"one-line-renderer",className:O()(s.collaborationWrapper,cN)},v().createElement("div",{className:O()(s.titleRow,s.wrapper)},v().createElement(ED,{label:c,className:O()(s.title,a),"data-reltio-id":"reltio-attribute-label"}),v().createElement(AD,{description:u,className:s.descriptionIcon}),d&&v().createElement(PP,null),v().createElement(OD,{nonOvValues:r,attributeType:n,className:s.ovIcon,nonOvTotal:l}),v().createElement(wP,{className:O()(s.attribute,i),attributeValue:t,attributeType:n,showNonOv:o,inlined:!0})),v().createElement(yD,{uri:t.uri,relatedObjectUris:(0,x.createRelatedObjectUris)(m,{uri:t.uri}),objectType:m}))};var HP=r(33062),YP=r.n(HP);const WP=(0,kp.Z)({link:{display:"flex",marginTop:4},icon:{fontSize:"1rem"}}),GP=e=>{let{moreNumber:t,valueNumber:r,onClick:n}=e;const a=WP();return v().createElement(uy(),{"data-reltio-id":"show-more",component:"button",variant:"caption",className:a.link,onClick:n,underline:"none"},v().createElement(YP(),{className:a.icon}),t&&r?mi().text("Show ${moreNumber} more of remaining ${valueNumber} value",{moreNumber:t,valueNumber:r}):mi().text("Show more"))};var qP=r(86800),ZP=r.n(qP);const $P=(0,kp.Z)({link:{display:"flex",marginTop:4},icon:{fontSize:"1rem"}}),KP=e=>{let{onClick:t}=e;const r=$P();return v().createElement(uy(),{component:"button",variant:"caption",className:r.link,onClick:t,underline:"none"},v().createElement(ZP(),{className:r.icon}),mi().text("Show less"))},XP=e=>{let{max:t,values:r,nonVisibleValues:n,totalVisibleValues:a,attributeType:i,parentUri:o,requestNextPageOfAttributeValues:l,titleClassName:s,contentClassName:c,showNonOv:u,totalNonVisibleValues:p}=e;const d=BP(),[m,g]=(0,b.useState)(t),y=(0,w.Ws)(),f=(0,b.useMemo)((()=>y.includes(i.uri)),[y,i.uri]),h=t<a,E=h&&m<a,T=h&&m>=a,{label:x,description:C}=i,S=r.slice(0,m),A=a-m;return v().createElement("div",{"data-reltio-id":"multi-line-renderer",className:d.wrapper},v().createElement("div",{className:d.titleRow},v().createElement(ED,{label:x,className:O()(d.title,s),"data-reltio-id":"reltio-attribute-label"}),v().createElement(AD,{description:C}),f&&v().createElement(PP,null),v().createElement(OD,{nonOvValues:n,attributeType:i,className:d.ovIcon,nonOvTotal:p})),v().createElement("div",{className:d.attributes},S.map((e=>v().createElement(wP,{key:e.uri,className:O()(d.attribute,c),attributeValue:e,attributeType:i,showNonOv:u})))),E&&v().createElement(GP,{moreNumber:(0,_.min)(t,A),valueNumber:A,onClick:()=>{r.length<a&&l({parentUri:o,attributeTypeUri:i.uri,attributeTypeName:i.name,values:r,defaultMaxValues:t}),g(m+t)}}),T&&v().createElement(KP,{onClick:()=>{g(t)}}))};var QP=r(88941),JP=r.n(QP);function ek(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){tk(e,t,r[t])}))}return e}function tk(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const rk=(0,kp.Z)({attributeValue:{verticalAlign:"middle"},insertAttribute:ek({width:"fit-content"},x.historyPalettes[x.HistoryOperations.insertAttribute]),deleteAttribute:ek({width:"fit-content",textDecoration:"line-through",padding:"0 4px"},x.historyPalettes[x.HistoryOperations.deleteAttribute])}),nk=e=>{let{value:t}=e;const r=rk(),{appearance:n}=(0,b.useContext)(ND),a=(0,w.AH)(),i=(0,x.getHistoryAppearanceBySpecialAttributeValue)("roles",t,n),o=(0,x.getHistoryAttributeClassName)(i);return v().createElement("span",{className:O()(r.attributeValue,r[o])},(0,x.getRoleLabel)(a,t))},ak=e=>{let{className:t,values:r,Component:n,dataReltioId:a}=e;return v().createElement("div",{className:t,"data-reltio-id":a},r.map(((e,t)=>v().createElement(b.Fragment,{key:e},v().createElement(n,{value:e}),t<r.length-1&&", "))))},ik=e=>{let{className:t,values:r}=e;return v().createElement(ak,{values:r,className:t,dataReltioId:"reltio-attribute-value",Component:nk})};function ok(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){lk(e,t,r[t])}))}return e}function lk(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const sk=(0,kp.Z)({attributeValue:{verticalAlign:"middle"},insertAttribute:ok({width:"fit-content"},x.historyPalettes[x.HistoryOperations.insertAttribute]),deleteAttribute:ok({width:"fit-content",textDecoration:"line-through",padding:"0 4px"},x.historyPalettes[x.HistoryOperations.deleteAttribute])}),ck=e=>{let{value:t}=e;const r=sk(),n=(0,b.useContext)(bD),{appearance:a}=(0,b.useContext)(ND),{generateTagUrl:i}=(0,b.useContext)(Wd),o=(0,w.eh)(),l=(0,w.Qh)(),s=(0,x.getHistoryAppearanceBySpecialAttributeValue)("tags",t,a),c=(0,x.getHistoryAttributeClassName)(s),u=n||o;return v().createElement(vP,{className:O()(r.attributeValue,r[c]),href:i({uiPath:l,tag:t,entityUri:u.dataTenant?(0,x.getDataTenantEntityUri)(u):u.uri})},t)},uk=e=>{let{className:t,values:r}=e;return v().createElement(ak,{values:r,className:t,dataReltioId:"reltio-attribute-value",Component:ck})},pk=e=>{let{values:t,attributeType:r}=e;const n=VP(),{label:a}=r;return v().createElement("div",{"data-reltio-id":"special-renderer",className:O()(n.titleRow,n.wrapper)},(i=n.titleIcon,r.uri===x.EntityAttrTypes.tags.uri?v().createElement(JP(),{className:i}):null),v().createElement(ED,{label:a,className:n.title,"data-reltio-id":"reltio-attribute-label"}),(e=>{switch(r.uri){case x.EntityAttrTypes.tags.uri:return v().createElement(uk,{className:e,values:t});case x.EntityAttrTypes.roles.uri:return v().createElement(ik,{className:e,values:t});default:return v().createElement(wP,{className:e,attributeValue:{value:t[0],uri:""},attributeType:r,inlined:!0})}})(n.attribute));var i};var dk=r(97986),mk=r.n(dk);function gk(){return gk=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gk.apply(this,arguments)}const yk=e=>v().createElement("svg",gk({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgDefaultImage"},e),v().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},v().createElement("path",{d:"M0 0h24v24H0z"}),v().createElement("path",{d:"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zm-4.5-9l2.5 3.096V18H5l4.5-5.5 2.5 3.01L16.5 10zm-8-4a1.5 1.5 0 110 3 1.5 1.5 0 010-3z",fillOpacity:.12,fill:"#000",fillRule:"nonzero"}))),fk={SMALL:{imageWidth:114,imageHeight:114},MEDIUM:{imageWidth:162,imageHeight:162},LARGE:{imageWidth:192,imageHeight:192},OVERRIDE:{imageWidth:"unset",imageHeight:"unset"}},hk=(0,kp.Z)((e=>({root:{position:"relative"},image:e=>{let{imageWidth:t,imageHeight:r}=e;return{width:t,height:r,objectFit:"cover",verticalAlign:"bottom"}},defaultContainer:{display:"flex",alignItems:"center",backgroundColor:"rgb(247, 247, 247)"},defaultImage:{width:"40px",height:"40px",marginLeft:"auto",marginRight:"auto",color:e.palette.text.secondary},hideImage:{display:"none"}})));function Ek(){return Ek=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ek.apply(this,arguments)}const bk=(0,b.memo)((e=>{const{src:t,className:r,containerClassName:n,size:a=fk.SMALL,overlay:i=null}=e,o=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["src","className","containerClassName","size","overlay"]),l=a||fk.SMALL,s=hk(l),[c,u]=(0,b.useState)(bm.oA.LOADING);(0,b.useEffect)((()=>{u(bm.oA.LOADING)}),[t]);const p=c===bm.oA.LOADING,d=c===bm.oA.LOADED;return c===bm.oA.ERROR?v().createElement("div",Ek({className:O()(s.defaultContainer,s.image,r)},o),v().createElement(mk(),{className:s.defaultImage})):v().createElement("div",{className:O()(s.root,n)},!(0,x.isEmptyValue)(t)&&v().createElement("img",Ek({src:t,className:O()(s.image,r,{[s.hideImage]:p}),onLoad:()=>{u(bm.oA.LOADED)},onError:()=>{u(bm.oA.ERROR)},alt:"image"},o)),p&&v().createElement("div",Ek({className:O()(s.defaultContainer,s.image,r)},o),v().createElement(yk,{className:s.defaultImage})),d&&i)})),vk={imageMargin:4,imageWidth:fk.SMALL.imageWidth,imageHeight:fk.SMALL.imageHeight};var Tk=r(59849),Ok=r.n(Tk),xk=r(47867),Ck=r.n(xk),Sk=r(93643),wk=r.n(Sk);const Ak=(0,kp.Z)((()=>({thumbnails:{marginLeft:"12px",marginBottom:"12px",marginTop:"auto",width:"calc(100vw - 364px)",overflowX:"auto",overflowY:"hidden"},gridContainer:{width:"100%"},thumb:{width:"96px",height:"96px",cursor:"pointer",userSelect:"none"},inactiveThumb:{filter:"brightness(0.5)"}}))),Rk=e=>{let{attributeValues:t,setAttributeValueIndex:r,attributeValueIndex:n}=e;const a=Ak(),i=(0,b.useRef)(null);return(0,b.useEffect)((()=>{if(null!=i&&i.current){const e=i.current.scrollLeft,t=i.current.offsetWidth+e,r=96*n+16*n+12;t<r?i.current.scroll&&(r>t+96+16?i.current.scroll(r,0):i.current.scroll(112+e,0)):e+96>r&&i.current.scroll&&i.current.scroll(r-96,0)}}),[n,i]),v().createElement("div",{ref:i,className:a.thumbnails},v().createElement(wk(),{container:!0,wrap:"nowrap",direction:"row",spacing:1,className:a.gridContainer},t.map(((e,t)=>{let{uri:i,value:o}=e;return v().createElement(wk(),{item:!0,key:i},v().createElement(bk,{onClick:()=>r(t),className:O()(a.thumb,{[a.inactiveThumb]:n!==t}),src:(0,x.getImageAttributeOvThumbnailUrl)({value:o})}))}))))},_k=(0,kp.Z)((e=>({root:{display:"flex",alignContent:"center",flexDirection:"column"},main:{position:"relative",padding:"0 86px",marginTop:"auto"},mainImageContainer:{display:"flex",alignContent:"center",height:"100%",width:"100%"},mainImage:{maxWidth:"calc(100vw - 512px)",maxHeight:"calc(100vh - 192px)",margin:"0 auto",userSelect:"none"},arrowButton:{backgroundColor:e.palette.divider,color:"white","&:hover":{backgroundColor:e.palette.divider}},arrowButtonPrev:{position:"absolute",top:"50%",left:"16px",transform:"translateY(-50%)"},arrowButtonNext:{position:"absolute",top:"50%",right:"16px",transform:"translateY(-50%)"}}))),Ik=e=>{let{className:t,attributeValues:r,attributeValueIndex:n,setAttributeValueIndex:a}=e;const i=_k(),o=r[n],l=(0,x.getImageAttributeOvPreviewUrl)(o);return v().createElement("div",{className:O()(i.root,t)},v().createElement("div",{className:i.main},n>0&&v().createElement(Pp.T,{icon:Ok(),className:O()(i.arrowButton,i.arrowButtonPrev),onClick:()=>{a(n-1)},size:"XL"}),v().createElement(bk,{containerClassName:i.mainImageContainer,className:i.mainImage,size:l&&fk.OVERRIDE,src:l}),n!==r.length-1&&v().createElement(Pp.T,{icon:Ck(),className:O()(i.arrowButton,i.arrowButtonNext),onClick:()=>{a(n+1)},size:"XL"})),v().createElement(Rk,{attributeValues:r,attributeValueIndex:n,setAttributeValueIndex:a}))};var Nk=r(71884),Dk=r.n(Nk);const Pk=(0,_.curry)(((e,t)=>(0,_.filter)((t=>(t.label||t.name).toLowerCase().includes(e.toLowerCase())))(t))),kk=e=>{let{attrTypes:t,filter:r="",sortingFn:n}=e;return(0,_.pipe)(Pk(r),(0,_.sort)(n),(0,_.map)((e=>({item:{id:e.uri,label:e.label||e.name,attrType:e}}))))(t)};var Lk=function(e){return e.parent="parent",e.attributes="attributes",e}(Lk||{});const Uk=(0,kp.Z)({moreAttributes:{display:"flex",paddingBottom:"6px","&$dense":{padding:0}},dense:{},popupContainer:{},moreAttributesPopup:{"&$popupContainer":{}},moreButton:{padding:"9px 16px 9px 12px",backgroundColor:"rgba(98, 2, 238, 0)",marginTop:"8px",marginLeft:"-4px",marginBottom:"4px"},buttonLabel:{fontSize:"14px",fontWeight:500,lineHeight:"16px"},icon:{fontSize:"18px",marginRight:"8px"},subHeader:{backgroundColor:"rgb(245, 245, 245)",padding:"0 16px",margin:0,display:"flex",alignItems:"center",color:"rgba(0,0,0,0.84)",fontSize:"14px",fontWeight:500},noResultsCaptionContainer:{position:"absolute",top:0,bottom:0,left:0,right:0,display:"flex",justifyContent:"center",alignItems:"center"}}),jk=e=>{let{label:t,popupTitle:r=t,data:n,parent:a,dense:i,onApply:o}=e;const l=Uk(),s=(0,b.useRef)(),[c,u]=(0,b.useState)(!1),[p,d]=(0,b.useState)(""),[m,g]=(0,b.useState)([]),{items:y,hasGroups:f,parentGroupLength:h,attributesGroupLength:E}=(e=>{let{data:t,parent:r,filter:n}=e;const a=(0,w.mT)(),i=Boolean(r),o=(0,b.useMemo)((()=>a===x.SortingStrategy.ASC_BY_NAME?(e,t)=>{var r;return null==e||null===(r=e.label)||void 0===r?void 0:r.localeCompare(null==t?void 0:t.label)}:(e,t)=>0),[a]),l=(0,b.useMemo)((()=>i?kk({attrTypes:[r],filter:n,sortingFn:o}):[]),[i,r,n,o]),s=(0,b.useMemo)((()=>i&&null!=l&&l.length?[{item:{id:Lk.parent,label:mi().text("Parent")},items:l}]:[]),[i,l]),c=(0,b.useMemo)((()=>kk({attrTypes:t,filter:n,sortingFn:o})),[t,n,o]),u=(0,b.useMemo)((()=>i&&null!=c&&c.length?[{item:{id:Lk.attributes,label:mi().text("Attributes")},items:c}]:c),[i,c]),p=(0,b.useMemo)((()=>Hp((s||[]).concat(u))),[s,u]),d=s.length,m=u.length;return{items:p,hasGroups:i,parentGroupLength:d,attributesGroupLength:m}})({data:n,parent:a,filter:p}),T=(0,b.useCallback)(((e,t)=>{g((0,_.ifElse)((0,_.always)(t),(0,_.append)(e),(0,_.reject)((0,_.propEq)("id",e.id)))(m))}),[m]),C=(0,b.useCallback)(((e,t)=>t.items?40:28),[]),S=(0,b.useCallback)((e=>{let{item:t}=e;T(t,(0,_.not)((0,_.any)((0,_.propEq)("id",t.id))(m)))}),[T,m]),{focusIndex:A,handleKeyDown:R}=$p({items:y,open:c,onSelectFocusedItem:S,selectedItems:m}),I=(0,b.useRef)(null);I.current=A;const N=f?(h?1:0)+(E?1:0):0,D=y.length-N,P=Math.min(255,28*D+40*N),k=Math.max(140,P+112),L=(0,b.useCallback)(((e,t,r)=>{var n;let{item:a,level:i=0}=t;const o=(0,_.any)((0,_.propEq)("id",a.id))(m),l=I.current===r;return v().createElement(bd,{key:a.uri,onClick:T,checked:o,level:i,data:a,label:v().createElement(vd.o,{text:a.label,highlight:p}),labelInText:a.label,style:e,isFocused:l,isRequired:!(null===(n=a.attrType)||void 0===n||!n.required),LogoIcon:a.LogoIcon})}),[p,T,m]),U=(0,b.useCallback)(((e,t)=>v().createElement(og(),{component:"div",className:l.subHeader,style:e,key:`group-${t.item.id}`},t.item.label)),[]);return v().createElement("div",{className:O()(l.moreAttributes,{[l.dense]:i})},v().createElement(nE(),{color:"primary",onClick:()=>u(!c),ref:s,className:l.moreButton},v().createElement(Dk(),{classes:{root:l.icon}}),v().createElement("div",{className:l.buttonLabel},t)),v().createElement(zp,{open:c,className:O()(l.moreAttributesPopup,l.popupContainer),anchorEl:s.current,onClose:(0,_.pipe)((()=>{m.length>0&&o((0,_.pluck)("attrType",m))}),(()=>u(!1)),(()=>d("")),(()=>g([]))),onSearch:d,containerHeight:k,title:r,containerWidth:320,searchInputOnKeyDown:R},v().createElement(Zp,{getItemSize:C,renderItem:L,renderGroupTitle:U,disableHorizontalScrollbar:!0,items:y,height:P,focusIndex:A}),0===y.length&&v().createElement("div",{className:l.noResultsCaptionContainer},v().createElement(Ag(),{variant:"caption",display:"block",gutterBottom:!0},mi().text("No results found")))))},Fk=v().createContext({canCreate:!0,canUpdate:!0,canDelete:!0});Fk.displayName="ConfigPermissionsContext";const Mk=e=>{const{canCreate:t,canUpdate:r,canDelete:n}=(0,b.useContext)(Fk),a=(0,x.isTempUri)(e);return(0,b.useMemo)((()=>({canCreate:t,canUpdate:a||r,canDelete:a||n})),[a,t,r,n])},Vk={get CreationTime(){return mi().text("Creation Time")},get CreationDate(){return mi().text("Creation Date")},get Dimensions(){return mi().text("Dimensions")},get MimeType(){return mi().text("Mime Type")},get Size(){return mi().text("Size")},get Url(){return mi().text("Full image URL (S3)")},get UrlPreview(){return mi().text("Preview image URL (S3)")},get UrlThumbnail(){return mi().text("Small image URL (S3)")},get CdnUrl(){return mi().text("Full image URL (CDN)")},get CdnUrlPreview(){return mi().text("Preview image URL (CDN)")},get CdnUrlThumbnail(){return mi().text("Small image URL (CDN)")}},Bk=function(){let{value:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return["Url","UrlPreview","UrlThumbnail","CdnUrl","CdnUrlPreview","CdnUrlThumbnail","MimeType"].includes(t)?(0,_.path)([t,0,"value"],e):"CreationDate"===t&&(0,_.path)(["CreationTimestamp",0,"value"],e)?Ya()(e.CreationTimestamp[0].value).format("MM-DD-YYYY"):"CreationTime"===t&&(0,_.path)(["CreationTimestamp",0,"value"],e)?Ya()(e.CreationTimestamp[0].value).format("HH:mm:ss"):"Dimensions"===t&&(0,_.path)(["Height",0,"value"],e)&&(0,_.path)(["Width",0,"value"],e)?`${e.Height[0].value} x ${e.Width[0].value} ${mi().text("pixels")}`:"Size"===t&&(0,_.path)(["Size",0,"value"],e)?`${(Number(e.Size[0].value)/1e3).toFixed(2)} KB`:void 0},zk=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.filter((e=>{let{system:t}=e;return!t}))},Hk=(e,t)=>{const{includeNames:r=[],excludeNames:n=[],order:a=[]}=t,i=r.length?e.filter((e=>r.includes(e))):e.filter((e=>!n.includes(e)));return 0===a.length?i:i.sort(((e,t)=>{const r=a.indexOf(e),n=a.indexOf(t);return-1===r&&-1!==n?1:-1===n&&-1!==r?-1:r-n}))},Yk=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;const n=zk(t.attributes);return Hk(Object.keys(e.value||{}),r).reduce(((t,r)=>{const a=n.find((e=>{let{name:t}=e;return t===r}));return a?[...t,{attrType:a,values:e.value[r]}]:t}),[])},Wk=e=>["Url","UrlPreview","UrlThumbnail","CdnUrl","CdnUrlPreview","CdnUrlThumbnail"].includes(e),Gk=(0,kp.Z)({title:{marginBottom:"10px",color:"white",fontSize:"18px",lineHeight:"21px","&$canAdd":{marginBottom:"3px"}},divider:{width:"100%",height:"1px",borderColor:"rgba(255,255,255,0.12)"},canAdd:{}}),qk=e=>{let{attributeType:t,onAddAttributes:r,uri:n}=e;const a=Gk(),i=zk(t.attributes),{canCreate:o}=(0,b.useContext)(Fk),l=o&&Boolean(r);return v().createElement(KI(),null,v().createElement(Ag(),{className:O()(a.title,{[a.canAdd]:l})},mi().text("Meta info")),l&&v().createElement(b.Fragment,null,v().createElement(jk,{label:mi().text("Attributes"),data:i,dense:!1,onApply:e=>{r&&r(e.map((e=>({attributeType:e,parentUri:n}))))}}),v().createElement(Lg(),{className:a.divider})))},Zk=(0,kp.Z)((e=>({root:{fontSize:"13px",letterSpacing:0,lineHeight:"15px",marginBottom:"11px"},title:{color:"rgba(255,255,255,0.54)",marginRight:"12px",float:"left"},content:{color:"rgba(255,255,255,0.87)",wordWrap:"break-word"},link:{color:e.palette.primary.main,textDecoration:"none"}}))),$k=e=>{let{title:t,content:r,isLink:n,children:a}=e;const i=Zk();return v().createElement("div",{className:i.root},v().createElement("span",{className:i.title},t),n?v().createElement("a",{className:i.link,href:r},mi().text("link")):v().createElement("span",{className:i.content},r||a))},Kk=(0,kp.Z)({root:{padding:"10px 0"},title:{color:"rgba(255,255,255,0.54)",fontSize:"13px"},content:{color:"rgba(255,255,255,0.87)",wordWrap:"break-word"}}),Xk=e=>{let{attributeValue:t,attributeType:r,imageAttributeFieldsOrder:n}=e;const a=Kk(),i=(0,w.xH)(),o=(l=t,s=n,Hk(Object.keys(Vk),s).map((e=>Bk(l,e)?{title:Vk[e],value:Bk(l,e),isLink:Wk(e)}:null)).filter(Boolean));var l,s;const c=Yk(t,r,n);return v().createElement(KI(),{className:a.root},o.map((e=>{let{title:t,value:r,isLink:n}=e;return v().createElement($k,{key:t,isLink:n,title:t,content:r})})),i&&c.map((e=>{let{attrType:r,values:n}=e;return v().createElement(ZF,{key:r.uri,attributeType:r,drawLines:!1,values:n,titleClassName:a.title,contentClassName:a.content,parentUri:t.uri})})))},Qk=(0,kp.Z)((e=>({caption:{display:"flex",color:e.palette.error.main,fontSize:"12px",lineHeight:"16px"}}))),Jk=e=>{let{className:t,message:r}=e;const n=Qk();return r?v().createElement(Ag(),{variant:"caption",className:O()(n.caption,t)},r):null};var eL=r(66826),tL=r.n(eL),rL=r(95210),nL=r(70485),aL=r.n(nL),iL=r(53167),oL=r.n(iL);const lL=(0,kp.Z)({wrapper:{width:"100%"},helperText:{margin:"3px 0 1px 12px"}});function sL(){return sL=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},sL.apply(this,arguments)}const cL=(0,b.memo)((e=>{let{errorMessage:t,children:r,className:n,classes:a}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["errorMessage","children","className","classes"]);const o=lL(),l=!!t;return v().createElement(aL(),sL({variant:"standard",className:O()(o.wrapper,n,null==a?void 0:a.root),error:!0},i),r,l&&v().createElement(oL(),{className:O()(o.helperText,null==a?void 0:a.helperText)},v().createElement(Jk,{message:t})))}));cL.displayName="ErrorWrapper";const uL=(e,t,r,n)=>{const a=(0,_.pipe)(x.getEntityType,(0,_.defaultTo)({}),(0,_.props)(["attributes","analyticsAttributes"]),(0,_.reject)(_.isNil),_.flatten,(0,_.concat)(_.__,(0,_.pipe)(_.values,(0,_.reject)((0,_.propEq)("uri",x.EntityAttrTypes.id.uri)))(x.EntityAttrTypes)))(e,t);return r.length?a.filter((e=>{let{uri:t}=e;return r.includes(t)})):a.filter((e=>{let{uri:t}=e;return!n.includes(t)}))},pL=(e,t)=>(0,_.partition)((0,_.pipe)((0,_.path)(["attrType","uri"]),(0,_.includes)(_.__,e)),t),dL=(0,_.eqBy)((0,_.pick)(["fieldName","uri","entityTypeUri"])),mL=(e,t)=>t&&!!t.find(dL(e)),gL=(0,_.curry)(((e,t,r)=>{const n=((e,t)=>{const{type:r}=(0,x.getAttrDataTypeDefinition)(e);switch(r){case x.DataTypes.TYPE_BOOLEAN:case x.DataTypes.TYPE_BOOLEAN_RADIO:case x.DataTypes.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return t.toString();case x.DataTypes.TYPE_DATE:return t&&Ya()(t).format("YYYY-MM-DD")||"";case x.DataTypes.TYPE_TIMESTAMP:return t&&Ya()(t).utc().format()||"";case x.DataTypes.TYPE_ACTIVENESS_DATE:case x.DataTypes.TYPE_LOCAL_DATE:return t&&t.valueOf();default:return t||""}})(t,r);return{value:n,uri:e.uri,attributeType:t}})),yL=v().createContext({enabled:!1,queueSizeThreshold:0});yL.displayName="AsyncMountContext";let fL=0;const hL=()=>{const e=(0,b.useRef)(!0),{enabled:t,queueSizeThreshold:r=0}=(0,b.useContext)(yL),[n,a]=(0,b.useState)(!t||t&&fL<r);e.current&&fL++;const i=(0,b.useRef)();return(0,b.useEffect)((()=>{if(fL--,!n)return i.current=setTimeout((()=>{a(!0)}),0),()=>clearTimeout(i.current)}),[]),e.current=!1,n};function EL(){return EL=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},EL.apply(this,arguments)}var bL=r(50548);const vL=v().createContext(!1);vL.displayName="ProfilePerspectiveViewContext";let TL=function(e){return e.Error="Error",e.NewAttribute="NewAttribute",e.NewView="NewView",e}({});const OL=e=>e===TL.Error,xL=v().createContext({element:null,type:null,highlightView:_.identity,highlightError:_.identity,highlightAttribute:_.identity,scrollIntoRef:_.identity});function CL(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){SL(e,t,r[t])}))}return e}function SL(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const wL={content:'""',position:"absolute",left:"-1000px",top:"0px",width:"5000px",height:"calc(100% - 10px)",animationName:"$highlightAnimation",animationDuration:"2s",animationIterationCount:1,opacity:0},AL=(0,kp.Z)((()=>({"@keyframes highlightAnimation":{"0%":{opacity:0},"50%":{opacity:1},"100%":{opacity:0}},highlightError:{"&::before":CL({},wL,{background:"rgba(255, 0, 0, 0.06)"})},highlightWarning:{"&::before":CL({},wL,{background:"rgba(228, 151, 0, 0.08)"})},simpleAttribute:{position:"relative","&::before":{top:"-4px",height:"calc(100% + 8px)"}}}))),RL=e=>{let{highlightedError:t,isSimple:r=!1}=e;const n=AL(),a=(0,b.useRef)(null),i=(0,_.pathOr)(x.ErrorSeverity.ERROR,["element","severity"])(t),o=O()({[n.highlightError]:i===x.ErrorSeverity.ERROR,[n.highlightWarning]:i===x.ErrorSeverity.WARNING,[n.simpleAttribute]:r});return(0,b.useEffect)((()=>{t&&t.scrollIntoRef(a)}),[t]),t?{ref:a,errorClassName:o}:{ref:a}};var _L=r(51894);const IL=(0,kp.Z)((e=>({wrapper:{width:"100%"},errorWrapper:{alignSelf:"stretch"},editor:{display:"flex",flex:1,alignItems:"flex-start",marginBottom:"10px",position:"relative"},"editor-value":{flex:"1 1 auto"},"editor-read-only-value":{marginLeft:"12px",display:"flex",alignItems:"center",color:e.palette.text.primary},"editor-actions":{display:"flex",alignItems:"center",paddingLeft:"8px"},addButton:{marginRight:"-8px"},button:{color:e.palette.text.secondary},placeholder:{height:"50px"},deleted:{color:e.palette.text.secondary,textDecoration:"line-through"},editedLabel:{fontStyle:"italic",color:e.palette.text.secondary}})));function NL(){return NL=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},NL.apply(this,arguments)}const DL=(0,bL.l)(xL,((e,t)=>{let{attributeValue:r}=t;const{element:n,type:a}=e||{};return{highlightedError:OL(a)&&(null==n?void 0:n.uri)===r.uri?e:null}}),(e=>{let{className:t,attributeValue:r,attributeType:n,isReltioCrosswalk:a,ownError:i,mode:o,onAddOneMore:l,onDeleteAttribute:s,onChangeAttribute:c,onDeactivateError:u,additionalControlsRenderer:p,state:d,highlightedError:m,isEmptyEditor:g=!1}=e,y=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","attributeValue","attributeType","isReltioCrosswalk","ownError","mode","onAddOneMore","onDeleteAttribute","onChangeAttribute","onDeactivateError","additionalControlsRenderer","state","highlightedError","isEmptyEditor"]);const f=IL(),h="deleted"===d,E="edited"===d,T=(0,x.isEditableMode)(o),{canCreate:C,canEdit:S,canDelete:A}=(e=>{let{attributeType:t,attributeValue:r,isReltioCrosswalk:n,mode:a}=e;const{canCreate:i,canUpdate:o,canDelete:l}=Mk(r.uri);return{canCreate:i&&(0,x.checkCanCreateAttribute)({attributeType:t,mode:a}),canEdit:o&&(0,x.checkCanEditAttribute)({attributeType:t,attributeValue:r,mode:a,isReltioCrosswalk:n}),canDelete:l&&(0,x.checkCanDeleteAttribute)({attributeType:t,attributeValue:r,mode:a,isReltioCrosswalk:n})}})({attributeValue:r,attributeType:n,mode:o,isReltioCrosswalk:a}),R=S&&T,I=(0,x.getErrorMessage)(i),N=(0,w.ZI)(r,n),{ref:D,errorClassName:P}=RL({highlightedError:m,isSimple:!0});(0,b.useEffect)((()=>{g&&(0,x.isDependentLookupAttrType)(n)&&!(0,_.has)("lookupCode",r)&&c({attributeType:n,uri:r.uri,value:r.value,silent:!0})}),[g]);const k=(0,b.useMemo)((()=>(0,x.getAttrDataTypeDefinition)(n)),[n]),L=(0,b.useMemo)((()=>((e,t)=>{let{type:r}=t;const{value:n,lookupCode:a}=e||{};switch(r){case x.DataTypes.TYPE_BOOLEAN:case x.DataTypes.TYPE_BOOLEAN_RADIO:case x.DataTypes.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return(0,x.parseBoolean)(n);case x.DataTypes.TYPE_DATE:return n&&x.utils.dates.toLocalDate(n)||null;case x.DataTypes.TYPE_LOCAL_DATE:case x.DataTypes.TYPE_TIMESTAMP:case x.DataTypes.TYPE_ACTIVENESS_DATE:return n&&new Date(n)||null;case x.DataTypes.TYPE_DEPENDENT_LOOKUP:case x.DataTypes.TYPE_LOOKUP:return{value:n,lookupCode:a};default:return n}})(r,k)),[r,k]),U=(0,b.useCallback)((()=>{i&&u((0,x.getErrorId)(i))}),[i,u]),j=(0,b.useCallback)((0,_.pipe)(gL(r,n),c,U),[r,n,c,U]),F=!!l&&C&&!n.singleValue,M=!h&&!!s&&A,V=!!I,B=h?{disabled:!0,isCrossedOut:!0}:{},z=(0,b.useContext)(vL),{autopopulationContextValue:H}=(e=>{let{enabled:t,attributeTypeUri:r,valueUri:n}=e;const a=(0,w.ax)("dependentLookupsEditorTouched"),i=(0,w.Pl)(),o=(0,w.h0)(n),l=t&&(0,x.isAutopopulationEnabled)(i,r),s=l?n:null,{isTouched:c=!1}=l&&o||{},u=(0,b.useCallback)((e=>{a({uri:e,isTouched:!0})}),[a]);return{autopopulationContextValue:(0,b.useMemo)((()=>s?{id:s,isTouched:c,onTouch:u}:null),[s,c,u])}})({enabled:z&&(0,x.isDependentLookupAttrType)(n),attributeTypeUri:null==n?void 0:n.uri,valueUri:r.uri});return v().createElement("div",{ref:D,className:O()(f.editor,t,P)},v().createElement(cL,{errorMessage:I,className:f.errorWrapper},v().createElement("div",{className:O()(f["editor-value"],{[f.deleted]:h},{[f["editor-read-only-value"]]:!R}),"data-reltio-id":"reltio-attribute-value"},R?v().createElement(_L.m.Provider,{value:H},v().createElement(rL.Z,NL({fieldName:(0,x.attributeUriToSearchUri)(n.uri),value:L,dataTypeDefinition:k,error:V,onChange:j,fullWidth:!0},N,y,B))):v().createElement(Xd.x,{value:(0,x.getAttributeValue)(r),dataTypeDefinition:k}))),v().createElement("div",{className:f["editor-actions"]},E&&v().createElement(Ag(),{variant:"caption",className:f.editedLabel},"(",mi().text("edited"),")"),F&&v().createElement(Pp.T,{icon:Dk(),onClick:l,size:"L",className:O()(f.addButton,f.button),"data-reltio-id":"reltio-add-one-more-simple-attribute-button"}),p&&p({attributeType:n,attributeValue:r}),M&&v().createElement(Pp.T,{className:f.button,icon:tL(),onClick:()=>{s({uri:r.uri,attributeType:n}),(0,x.getErrorType)(i)!==x.ErrorType.missed&&U()},size:"L","data-reltio-id":"reltio-delete-simple-attribute-button"})))})),PL=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const r=(0,b.forwardRef)(((r,n)=>hL()?v().createElement(e,EL({},r,{ref:n})):t&&v().createElement(t,EL({},r,{ref:n}))));return r.displayName="WithAsyncMount",r}(DL,(()=>{const e=IL();return v().createElement("div",{className:e.placeholder})})),kL=[x.EntityAttrTypes.roles.uri,x.EntityAttrTypes.tags.uri],LL=v().createContext(null),UL=v().createContext(null),jL=(0,b.createContext)({});function FL(){return FL=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},FL.apply(this,arguments)}function ML(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const VL=(0,bL.l)(xL,(e=>{const{highlightAttribute:t}=e||{};return{highlightAttribute:t}}),(e=>{let{parentAttributeType:t,attrTypes:r,entity:n,parentUri:a,showEmptyEditors:i,mode:o,crosswalks:l,drawLines:s,children:c,className:u,alwaysVisibleTypeUris:p=kL,onAddAttributes:d,onChangeAttribute:m,onDeleteAttribute:g,additionalControlsRenderer:y,showNonOv:f,highlightAttribute:h}=e;const E=(0,b.useContext)(jL),T=a&&(0,x.getBaseUri)(a),O=(0,b.useMemo)((()=>E[T]||[]),[E,T]),C=(0,b.useMemo)((()=>r.filter((e=>!O.includes(e.uri)))),[r,O]),{attributes:S={}}=n,[w,A]=(0,b.useState)({}),R=(0,b.useCallback)(((e,t)=>{A((r=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ML(e,t,r[t])}))}return e}({},r,{[e]:t})))}),[]);(0,b.useEffect)((()=>{A({})}),[a]);const{canCreate:I}=(0,b.useContext)(Fk),N=(0,b.useMemo)((()=>I&&t&&(0,x.checkCanCreateAttribute)({attributeType:t,mode:o})),[t,o,I]),D=((e,t,r,n)=>e.filter((e=>{const a=((e,t)=>{const{attributes:r={},analyticsAttributes:n={}}=t;return(0,_.cond)([[x.isSpecialAttribute,(0,_.always)(t)],[(0,_.both)(x.isAnalyticAttribute,(0,_.always)(n)),(0,_.always)(n)],[_.T,(0,_.always)(r)]])(e)})(e,t),i=(e=>(0,x.isSpecialAttribute)(e)?"uri":"name")(e);return!((e.singleValue||(0,x.isRoleAttrType)(e)||(0,x.isTagAttrType)(e))&&((0,_.has)(e[i])(a)||r&&(null==n||!n[e.uri])))})))((0,b.useMemo)((()=>I?(0,x.getCreatableAttributeTypes)(o,C):[]),[C,o,I]),n,i,w),P=(0,b.useContext)(LL),k=(0,b.useMemo)((()=>(0,x.getAttributesListForEditMode)(C,o,n,i,f,P,I)),[C,o,n,i,f,P,I]),[L,U]=(0,b.useMemo)((()=>pL(p,k)),[k,p]),j=(0,b.useCallback)((e=>{d(e.map((e=>({attributeType:e,parentUri:e===t?(0,x.getParentUri)(a):a})))),h((0,_.last)(e),TL.NewAttribute)}),[d,a,t]),F={enabled:s},M=(0,b.useMemo)((()=>({hasDeletionsMap:w,setHasDeletions:R})),[w,R]);return v().createElement("div",{className:u},c&&v().createElement(sN,F,c),v().createElement(sN,FL({},F,{plain:!0}),D.length>0&&v().createElement(jk,{label:mi().text("More attributes"),onApply:j,dense:s,data:D,parent:N&&t})),v().createElement(UL.Provider,{value:M},U.concat(L).map((e=>{let{attrType:t,values:r}=e;return v().createElement(oF,{key:`${t.uri}_${a}`,attributeType:t,drawLines:s,values:r,paging:(0,_.path)(["paging",t.uri],S),parentUri:a,showEmptyEditors:i,mode:o,crosswalks:l,onAddAttributes:d,onChangeAttribute:m,onDeleteAttribute:g,additionalControlsRenderer:y,showNonOv:f})}))))})),BL=(0,kp.Z)((e=>({complexWrapper:{position:"relative"},editor:{display:"flex",flex:1,height:"36px",alignItems:"center"},label:{flex:1,marginLeft:"2px",marginTop:"2px",fontSize:"13px",lineHeight:"15px"},actions:{display:"flex",alignItems:"center"},titleContainer:{display:"flex",flex:1,minHeight:"20px"},expandButton:{marginTop:"2px"},deleted:{color:e.palette.text.secondary,textDecoration:"line-through"},editedLabel:{fontStyle:"italic",color:e.palette.text.secondary},errorWrapperHelperText:{marginLeft:0}}))),zL=(0,bL.l)(xL,((e,t)=>{let{attributeValue:r}=t;const{element:n,type:a}=e||{},i=OL(a);return{highlightedError:i&&(null==n?void 0:n.uri)===r.uri?e:null,isHighlightedPath:i&&(0,_.pipe)((0,_.propOr)([],"path"),(0,_.any)((0,_.pathEq)(["value","uri"],r.uri)))(n)}}),(e=>{let{label:t,attributeTypesList:r,attributeType:n,attributeValue:a,children:i,errors:o,ownError:l,mode:s,metadata:c,crosswalks:u,lazy:p,showEmptyEditors:d,onAddOneMore:m,onAddAttributes:g,onDeleteAttribute:y,onChangeAttribute:f,additionalControlsRenderer:h,hideDeleteButton:E,state:T,showNonOv:C,isHighlightedPath:S,highlightedError:w,expanded:A=!1}=e;const R=BL(),_="deleted"===T,I="edited"===T,N=a.uri,D=(0,x.isTempUri)(N),P=D||A,[k,L]=(0,b.useState)(P),{ref:U,errorClassName:j}=RL({highlightedError:w});(0,b.useEffect)((()=>{S&&L(!0)}),[S]),(0,b.useEffect)((()=>{L(P)}),[P]);const{canDelete:F}=Mk(a.uri),M=(0,b.useMemo)((()=>F&&(0,x.checkCanDeleteAttribute)({attributeType:n,attributeValue:a,mode:s,metadata:c,isReltioCrosswalk:(0,x.isReltioCrosswalk)(u,a)})),[n,a,s,c,u,F]),V=!_&&!E&&!!y&&M,B=(0,b.useMemo)((()=>(0,x.hasAttributeDescendantsWithErrors)(a,o)),[o,a]);(0,b.useEffect)((()=>{B&&L(!0)}),[o,B]),(0,b.useEffect)((()=>{_&&L(!1)}),[_]);const z=(r||[]).some((e=>(0,x.isAnalyticAttribute)(e))),H=(0,b.useMemo)((()=>({attributes:z?null:a.value,analyticsAttributes:z?a.value:null})),[a,z]),Y=(0,x.getErrorMessage)(l)||B&&mi().text("Has an incorrect value")||"";return p?v().createElement(nE(),{variant:"text",color:"primary",onClick:m},"Create attribute"):v().createElement("div",{ref:U,"data-reltio-id":"reltio-edit-mode-complex-attribute",className:O()(R.complexWrapper,j)},v().createElement("div",{className:R.editor},v().createElement("div",{className:R.titleContainer},v().createElement(oP,{onClick:()=>L((e=>!e)),expanded:k,className:R.expandButton,disabled:_}),v().createElement(cL,{errorMessage:Y,classes:{helperText:R.errorWrapperHelperText}},v().createElement("div",{className:O()(R.label,{[R.deleted]:_}),"data-reltio-id":"reltio-attribute-complex-label"},t))),v().createElement("div",{className:R.actions},I&&v().createElement(Ag(),{variant:"caption",className:R.editedLabel},"(",mi().text("edited"),")"),h&&h({attributeType:n,attributeValue:a}),V&&v().createElement(Pp.T,{icon:tL(),onClick:()=>y({uri:N,attributeType:n,attributeValue:a}),size:"L","data-reltio-id":"reltio-delete-complex-attribute-button"}))),k&&v().createElement(VL,{parentAttributeType:n,attrTypes:r,entity:H,showEmptyEditors:d||D,drawLines:!0,parentUri:N,mode:s,crosswalks:u,onAddAttributes:g,onChangeAttribute:f,onDeleteAttribute:y,additionalControlsRenderer:h,showNonOv:C},i))}));function HL(){return HL=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},HL.apply(this,arguments)}const YL=(0,b.memo)((e=>{const{attributeValue:t,attributeType:r}=e,n=(0,x.evaluateDeepEntityLabel)(t,r.dataLabelPattern);return v().createElement(zL,HL({label:(0,x.getLabel)(n),attributeTypesList:r.attributes||r.analyticsAttributes},e))}));YL.displayName="NestedAttributeEditor";var WL=r(84199),GL=r(62880);const qL=(0,kp.Z)((e=>({addLabel:{display:"flex",padding:"0 7px",height:"35px",alignItems:"center",fontSize:"13px",fontWeight:"500",color:e.palette.primary.main,cursor:"pointer",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",borderTop:"solid 1px rgba(0, 0, 0, 0.14)",backgroundColor:"rgba(0, 0, 0, 0.03)"},addIcon:{height:"18px",width:"18px",padding:"0 9px"}}))),ZL=e=>{const{selectProps:{onCreate:t,createLabel:r,inputValue:n,components:a},children:i}=e,o=qL();return v().createElement(Gy.h,e,i,r&&!(0,_.prop)("Group",a)&&v().createElement("span",{className:o.addLabel,onClick:()=>t(n)},v().createElement(Dk(),{className:o.addIcon}),r))};ZL.propTypes={children:vp().element.isRequired,selectProps:vp().object.isRequired};const $L=(0,kp.Z)({singleValue:{fontSize:"14px",lineHeight:"16px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",marginTop:"17px"}});function KL(){return KL=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},KL.apply(this,arguments)}const XL=e=>{const{selectProps:{menuIsOpen:t},innerProps:r,children:n}=e,a=$L();return!t&&v().createElement(Ag(),KL({className:a.singleValue},r),n)};function QL(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){JL(e,t,r[t])}))}return e}function JL(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}XL.propTypes={children:vp().node,innerProps:vp().object};const eU=(0,kp.Z)({control:{height:"auto"},dropdownIndicator:{boxSizing:"content-box",transition:"transform .15s ease",padding:e=>(e.height-24)/2+"px 12px",cursor:"pointer",color:"rgba(0, 0, 0, 0.54)"},valueContainer:{marginLeft:"16px",width:0},formControl:{margin:0},filledInputRoot:{backgroundColor:"rgba(0, 0, 0, 0.03)","&:hover":{backgroundColor:"rgba(0, 0, 0, 0.03)"},"&.focused":{backgroundColor:"rgba(0, 0, 0, 0.03)"}},filledInputUnderline:{"&:before":{display:"none"}},inputLabel:{color:"rgba(0,0,0,0.6)",fontSize:"14px",paddingLeft:"4px","&.shrink":{paddingLeft:"4px"}}}),tU={menu:e=>QL({},e,{borderRadius:"0 0 4px 4px",backgroundColor:"#FFFFFFFF",boxShadow:"0 2px 2px 0 rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.12), 0 1px 5px 0 rgba(0,0,0,0.2)",margin:0}),menuList:e=>QL({},e,{maxHeight:"208px",padding:"8px 0"}),group:e=>QL({},e,{padding:"0 0 8px 0"}),input:e=>QL({},e,{height:"16px",color:"rgba(0, 0, 0, 0.87)",fontSize:"14px",lineHeight:"16px",margin:"16px 0 0",padding:0}),option:e=>QL({},e,{fontSize:"13px",lineHeight:"15px",height:"32px"})},rU={menuList:e=>QL({},e,{padding:0})},nU={input:e=>QL({},e,{height:"16px",color:"rgba(0, 0, 0, 0.87)",fontSize:"14px",lineHeight:"16px",margin:0,padding:0})};function aU(){return aU=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},aU.apply(this,arguments)}function iU(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){oU(e,t,r[t])}))}return e}function oU(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const lU=e=>{let{value:t,label:r,createLabel:n,getOptions:a,options:i,height:o=46,onChange:l=_.identity,onCreate:s,onClear:c=_.identity,components:u,textFieldInputRef:p,TextFieldProps:d,classes:m}=e,g=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["value","label","createLabel","getOptions","options","height","onChange","onCreate","onClear","components","textFieldInputRef","TextFieldProps","classes"]);const y=eU({height:o}),[f,h]=(0,b.useState)(!1),E=(0,b.useRef)(null),T=a?Py:Ny.J,C=(0,_.prop)("ClearIndicator",u)?{}:{IndicatorSeparator:WL.V,ClearIndicator:WL.V},S=s?(e,t)=>{s(e,t),h(!1)}:void 0,w=(0,_.prop)("Group",u)?rU:{},A=(0,_.isEmpty)(r)?nU:{},R=iU({},tU,w,A),I=iU({},y,m);return v().createElement(T,aU({placeholder:"",defaultOptions:!0},g,{value:(0,_.defaultTo)(null,t),loadOptions:a,options:i,cacheOptions:!0,onChange:l,onCreate:S,onClear:c,createLabel:n,classes:I,styles:R,components:iU({DropdownIndicator:GL.G,LoadingIndicator:WL.V,SingleValue:XL,Menu:ZL},C,u),menuPlacement:"auto",TextFieldProps:iU({},d,{label:r,variant:"filled",size:"small",classes:iU({},(0,_.prop)("classes",d),{root:O()(y.formControl,(0,_.path)(["classes","root"],d))}),inputProps:iU({},(0,_.prop)("inputProps",d)),InputProps:iU({},(0,_.prop)("InputProps",d),{classes:iU({},(0,_.path)(["InputProps","classes"],d),{root:O()(y.filledInputRoot,(0,_.path)(["InputProps","classes","root"],d)),underline:O()({[y.filledInputUnderline]:(0,x.isEmptyValue)(t)},(0,_.path)(["InputProps","classes","underline"],d)),focused:O()("focused",(0,_.path)(["InputProps","classes","focused"],d))})}),InputLabelProps:iU({},(0,_.prop)("InputLabelProps",d),{classes:iU({},(0,_.path)(["InputLabelProps","classes"],d),{root:O()(y.inputLabel,(0,_.path)(["InputLabelProps","classes","root"],d)),shrink:O()("shrink",(0,_.path)(["InputLabelProps","classes","shrink"],d))}),shrink:!(0,x.isEmptyValue)(t)||void 0}),ref:p||E}),inputRef:p||E,menuIsOpen:f,onMenuOpen:()=>h(!0),onMenuClose:()=>h(!1)}))},sU={value:vp().oneOfType([vp().object,vp().array]),label:vp().string.isRequired,getOptions:vp().func,options:vp().array,onChange:vp().func,onCreate:vp().func,onClear:vp().func,createLabel:vp().string,components:vp().object,textFieldInputRef:vp().object,TextFieldProps:vp().object,height:vp().number,classes:vp().object};lU.propTypes=sU;var cU=r(98018);function uU(){return uU=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},uU.apply(this,arguments)}const pU=e=>{const t=(0,w.$H)()||"";return v().createElement(cU.ZP,uU({},e,{storagePath:(r=t,r.endsWith("/")?r:r+"/")}));var r},dU=(0,kp.Z)({entityContainer:{display:"flex",alignItems:"center",height:"32px",minHeight:"32px",padding:0},entityLabel:{height:"15px",fontSize:"13px",color:"rgba(0,0,0,0.87)",cursor:"pointer",lineHeight:"15px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},emptyEntityLabel:{height:"15px",fontSize:"13px",color:"rgba(0,0,0,0.6)",lineHeight:"15px",marginLeft:"16px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",cursor:"default"},entityAvatar:{transform:"scale(0.5)",marginLeft:"8px",marginRight:"11px"},entitySecondaryLabel:{color:"rgba(0,0,0,0.6)"}});function mU(){return mU=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},mU.apply(this,arguments)}const gU=e=>{let{innerRef:t,innerProps:r,selectOption:n,data:a}=e;const i=dU(),{uri:o,entityType:l,label:s,secondaryLabel:c}=a;return""!==o?v().createElement(td(),mU({className:i.entityContainer,ref:t,key:o,onClick:()=>n({label:s,uri:o,entityType:l})},r),v().createElement(pU,{className:i.entityAvatar,entityType:l}),v().createElement(gd.Y,{value:`${s}${c?", "+c:""}`},v().createElement("span",{className:i.entityLabel},s,c&&v().createElement("span",{className:i.entitySecondaryLabel},", ",c)))):v().createElement(td(),mU({className:i.entityContainer,ref:t,key:o},r,{disabled:!0}),v().createElement("span",{className:i.emptyEntityLabel},mi().text("No results found")))},yU=(0,kp.Z)((e=>({singleValue:{color:"rgba(0, 0, 0, 0.87)",fontSize:"14px",paddingTop:"18px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},linkValue:{cursor:"pointer",color:e.palette.primary.main,textDecoration:"none",pointerEvents:"all"}}))),fU=e=>{let{selectProps:{currentEntityType:t,menuIsOpen:r,disableLinkClick:n},children:a,data:i}=e;const o=yU(),l=(0,w.ax)("openEntity"),s=(0,w.Qh)(),{generateEntityUrl:c}=(0,b.useContext)(Wd),u=(0,x.isTempUri)(i.entityUri)?{className:o.singleValue,component:"span"}:{className:O()(o.singleValue,o.linkValue),onMouseDown:e=>{e.stopPropagation()},onClick:e=>{e.stopPropagation(),n?e.preventDefault():(0,Dp.rR)(e)||(l({uri:i.entityUri}),e.preventDefault())},href:c({uiPath:s,uri:i.entityUri}),component:"a"};return r?null:v().createElement(Ag(),u,(0,x.isTempUri)(i.entityUri)?mi().text(`New ${t.label} will be created`):(0,x.getLabel)(a))},hU=(0,kp.Z)({clearIcon:{cursor:"pointer",height:"20px",width:"20px"}}),EU=e=>{const{selectProps:{onClear:t}}=e,r=hU();return v().createElement(tE(),{onClick:t,size:"large"},v().createElement(YI(),{className:r.clearIcon}))};EU.propTypes={selectProps:vp().object.isRequired};var bU=r(81997);const vU=(0,kp.Z)((e=>({addLabel:{color:e.palette.primary.main,display:"flex",fontWeight:"500",cursor:"pointer",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},groupHeading:{fontSize:"13px",height:"36px",padding:"0 16px",display:"flex",justifyContent:"space-between",alignItems:"center",backgroundColor:"rgba(0, 0, 0, 0.03)"},addIcon:{height:"18px",width:"18px",padding:"0 9px"}}))),{Group:TU}=bU.F,OU=e=>{const{selectProps:{inputValue:t,onCreate:r},data:n,children:a}=e,i=vU();return v().createElement(TU,e,v().createElement("div",{className:i.groupHeading},v().createElement("span",null,n.label),r&&v().createElement("span",{onClick:()=>r(t,n.entityType),className:i.addLabel},v().createElement(Dk(),{className:i.addIcon}),mi().text(`Create ${t?`"${t}" as `:""}new ${n.label}`))),a)};OU.propTypes={selectProps:vp().object.isRequired,data:vp().object,children:vp().array};const xU=e=>e&&e.attributes,CU=e=>{let{entityUri:t,entityType:r,mode:n,attributeTypesSelectionStrategy:a=xU}=e;const i=(0,w.ax)("addAttributes"),o=(0,w.ax)("removeAttribute"),l=(0,w.ax)("modifyAttribute"),s=(0,w.vc)(t),c=(0,b.useMemo)((()=>a(r)),[a,r]);return s?v().createElement(VL,{key:s.uri,attrTypes:c,entity:s,showEmptyEditors:!0,drawLines:!0,parentUri:s.uri,mode:n,crosswalks:s.crosswalks,onAddAttributes:i,onChangeAttribute:l,onDeleteAttribute:o}):null};function SU(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const wU=(0,kp.Z)({creatorWrapper:{marginTop:"20px"}});function AU(){return AU=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},AU.apply(this,arguments)}function RU(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){_U(e,t,r[t])}))}return e}function _U(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function IU(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}const NU=20,DU=e=>{let{entity:t={},entityTypesUris:r=[],mode:n,max:a=NU,onChange:i,onCreate:o,metadata:l,globalSearchRequestOptions:s,attributeTypesSelectionStrategy:c,disableLinkClick:u=!1}=e,p=IU(e,["entity","entityTypesUris","mode","max","onChange","onCreate","metadata","globalSearchRequestOptions","attributeTypesSelectionStrategy","disableLinkClick"]);const d=wU(),[m,g]=(0,b.useState)(""),y=(0,b.useMemo)((()=>r.map((e=>(0,x.getEntityType)(l,e))).filter(x.isAvailableEntityType)),[r,l]),f=RU({},s,{max:a}),h=o?(e,t)=>{o(t||r[0],e),g("")}:void 0,E=e=>{null!==e&&(g(""),i(e))},T=(0,b.useMemo)((()=>1!==y.length),[y]),O=((0,_.isEmpty)(t)?y[0]:(0,x.getEntityType)(l,t.entityType))||{},C=o&&mi().text(`Create ${m?`"${m}" as `:""}new ${O.label}`),S=mi().text(`Select ${1===y.length?`${y[0].label} `:""}profile`),w=!(0,_.isEmpty)(t)&&(0,x.isTempUri)(t.entityUri),A=T?{Group:OU,GroupHeading:WL.V}:{},R=w?{ClearIndicator:EU}:{},{TextFieldProps:I}=p,N=IU(p,["TextFieldProps"]),D=(0,b.useMemo)((()=>RU({},I||{},{"data-reltio-id":"reltio-entity-selector"})),[I]);return v().createElement(v().Fragment,null,v().createElement(lU,AU({value:(0,_.isEmpty)(t)?void 0:t,inputValue:m,onInputChange:e=>{g(e)},getOptions:e=>(0,x.typeAheadSearch)(y,e,f).then(((e,t)=>r=>{const n=r.map((t=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){SU(e,t,r[t])}))}return e}({},t,{label:(0,x.getLabel)(t.label),entityType:e.find((e=>{let{uri:r}=e;return r===t.type}))}))),a=e=>(0,_.isEmpty)(e)?[{label:"",uri:"",entityType:{}}]:e,i=t?e:e.filter((e=>n.some((t=>t.type===e.uri))));return i.length>1?i.map((e=>({label:e.label,entityType:e.uri,options:a(n.filter((t=>t.type===e.uri)))}))):a(n)})(y,o)),getOptionLabel:(0,_.prop)("entityLabel"),onChange:E,onCreate:h,onClear:()=>{E({})},label:S,createLabel:C,components:RU({Option:gU,SingleValue:fU},A,R),currentEntityType:O,isClearable:!0,disableLinkClick:u,TextFieldProps:D},N)),w&&v().createElement("div",{className:d.creatorWrapper},v().createElement(CU,{mode:n,attributeTypesSelectionStrategy:c,entityType:O,entityUri:t.entityUri})))},PU=(0,kp.Z)({item:{marginBottom:"20px"},dense:{marginBottom:0}});function kU(){return kU=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},kU.apply(this,arguments)}function LU(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const UU=(0,bL.l)(xL,((e,t)=>{let{attributeValue:r,attributeType:n}=t;const{element:a,type:i}=e||{};return{highlightedError:OL(i)&&(0,x.isAttributeTypeError)(a,r.uri,n.uri)?e:null}}),(e=>{const t=PU(),{highlightedError:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["highlightedError"]),{attributeValue:a,attributeType:i,mode:o,crosswalks:l,errors:s,onChangeAttribute:c}=n,u=(0,b.useRef)(a),{ref:p,errorClassName:d}=RL({highlightedError:r,isSimple:!0}),m=(0,x.getReferencedEntityUriFromAttrValue)(a),g=(0,w.ax)("entityDeleted"),y=(0,w.ax)("entityCreated"),f=(0,w.ax)("errorDeactivated"),h=(0,w.vc)(m),E=(0,x.isTempUri)(m)?h:null,T=(0,w.AH)(),C=(0,w.mU)(["ovOnly"]),S=(0,x.getReferencedEntityFromAttrValue)(a),A=(0,x.getReferencedRelationFromAttrValue)(a),R=(0,x.getReferencedEntityTypeUriFromAttrType)(i),I=(0,x.getEntityType)(T,R),N=E?(0,x.evaluateDeepEntityLabel)(E,I.dataLabelPattern):a.label,D=(0,b.useMemo)((()=>[R]),[R]),P=(0,b.useMemo)((()=>(0,x.addReferencedRelationCrosswalks)(l,A)),[l,A]),k=(0,b.useMemo)((()=>(0,x.getReferencedEntityActiveError)(a,s)),[a,s]),L=(0,b.useMemo)((()=>S&&{entityUri:(0,x.getReferencedEntityUri)(S),entityType:(0,x.getReferencedEntityTypeUri)(S),entityLabel:a.label}),[S,a.label]),U=(0,b.useMemo)((()=>(0,x.getReferencedRelationAttrTypesUris)(i).map((e=>(0,x.findAttributeTypeByUri)(T,e))).filter(_.identity)),[i,T]),j=(0,b.useCallback)((e=>(0,x.referencedEntityAttributeTypesSelectionStrategy)(i,e)),[i]),F=(0,b.useCallback)((e=>{E&&g(E.uri);const t=u.current,r=!(0,_.isEmpty)(e)&&e.uri===(0,x.getReferencedEntityUriFromAttrValue)(t),n=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){LU(e,t,r[t])}))}return e}({},a,{label:e.label,refEntity:r?t.refEntity:(0,x.convertReferencedEntityForAttrValue)(e),refRelation:r?t.refRelation:(0,x.createReferencedRelationForAttrValue)(a)});c({value:n,attributeType:i,uri:a.uri}),k&&f((0,x.getErrorId)(k))}),[a,i,E,c,g,f,k]),M=(0,b.useCallback)(((e,t)=>{const r=(0,_.pipe)(j,(0,x.getCreatableAttributeTypes)(o))(I),n=(0,x.createTemporaryEntity)({entityTypeUri:e,initValue:t,attributeTypes:r,metadata:T,mode:o});F(n),y(n)}),[j,o,I,T,F,y]),{canCreate:V,canUpdate:B}=Mk(a.uri),z=(0,b.useMemo)((()=>B&&(0,x.checkCanEditAttribute)({attributeType:i,attributeValue:a,mode:o,isReltioCrosswalk:(0,x.isReltioCrosswalk)(l,a)})),[i,a,o,l,B]),H=(0,b.useMemo)((()=>V&&(0,x.checkMetadataForCreate)(o,I)),[o,I,V]),Y=(0,x.getErrorMessage)(k);return v().createElement(zL,kU({},n,{label:(0,x.getLabel)(N),attributeTypesList:U,crosswalks:P,metadata:T}),v().createElement("div",{ref:p,className:d},v().createElement(cL,{errorMessage:Y},v().createElement(DU,{className:O()(t.item,{[t.dense]:Y||L&&(0,x.isTempUri)(L.entityUri)}),entity:L||{},entityTypesUris:D,globalSearchRequestOptions:C,mode:o,isDisabled:!z,onChange:F,onCreate:H?M:void 0,metadata:T,attributeTypesSelectionStrategy:j}))))}));function jU(){return jU=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},jU.apply(this,arguments)}const FU=(0,b.forwardRef)(((e,t)=>{const{className:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className"]);return v().createElement("div",{ref:t,"data-reltio-id":"reltio-edit-attribute",className:r},class{static build(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};switch(e.type){case x.DataTypes.TYPE_NESTED:return v().createElement(YL,t);case x.DataTypes.TYPE_REFERENCE:return v().createElement(UU,t);default:{const e=(0,_.omit)(["showEmptyEditors","onAddAttributes","lazy","errors","crosswalks","showNonOv","expanded"],t);return v().createElement(PL,jU({isReltioCrosswalk:(0,x.isReltioCrosswalk)(t.crosswalks,t.attributeValue)},e))}}}}.build(e.attributeType,n))}));FU.displayName="EditModeAttribute";const MU=e=>mi().text("${value}",{value:1===e?mi().text("value"):mi().text("values")}),VU=(0,_.has)("minValue"),BU=(0,_.has)("maxValue"),zU=(0,_.pipe)(BU,_.not),HU=(0,_.propSatisfies)((e=>1===e),"minValue"),YU=e=>{let{minValue:t}=e;return mi().text("This attribute can have minimum ${minValue} ${minValueCaption}",{minValue:mi().number(t,"0"),minValueCaption:MU(t)})},WU=e=>{let{maxValue:t}=e;return mi().text("This attribute can have maximum ${maxValue} ${maxValueCaption}",{maxValue:mi().number(t,"0"),maxValueCaption:MU(t)})},GU=(0,_.cond)([[_.isNil,(0,_.always)("")],[e=>{let{minValue:t,maxValue:r}=e;return t&&t===r},e=>{let{minValue:t}=e;return mi().text("This attribute should have ${minValue} ${minValueCaption}",{minValue:mi().number(t,"0"),minValueCaption:MU(t)})}],[(0,_.allPass)([HU,BU]),WU],[(0,_.allPass)([HU,zU]),(0,_.always)("")],[(0,_.allPass)([VU,BU]),e=>{let{minValue:t,maxValue:r}=e;return mi().text("${minCardinality} and maximum ${maxValue} ${maxValueCaption}",{minCardinality:YU({minValue:t}),maxValue:mi().number(r,"0"),maxValueCaption:MU(r)})}],[BU,WU],[VU,YU],[_.T,(0,_.always)("")]]),qU=(0,kp.Z)((()=>({caption:{fontSize:"0.7rem",opacity:.54}}))),ZU=e=>{let{cardinality:t}=e;const r=qU(),n=GU(t);return n?v().createElement(Ag(),{variant:"caption",className:r.caption},n):null};function $U(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){KU(e,t,r[t])}))}return e}function KU(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const XU={content:'""',position:"absolute",left:"-1000px",top:"-4px",width:"5000px",height:"calc(100% + 8px)",animationName:"$highlightAnimation",animationDuration:"2s",animationIterationCount:1,opacity:0},QU=(0,kp.Z)((()=>({"@keyframes highlightAnimation":{"0%":{opacity:0},"50%":{opacity:1},"100%":{opacity:0}},highlighted:{"&::before":$U({},XU,{background:"rgba(228, 151, 0, 0.08)"}),position:"relative"}}))),JU=e=>{const t=QU(),r=(0,b.useRef)(null);return(0,b.useEffect)((()=>{e&&e.scrollIntoRef(r)}),[e]),e?{ref:r,highlightedClassName:t.highlighted}:{ref:r}},ej=(0,_.filter)((0,_.propSatisfies)(x.isTempUri,"uri")),tj=(0,kp.Z)((e=>({caption:{fontSize:"0.7rem",opacity:.54},wrapper:{display:"flex",flexDirection:"column",alignItems:"flex-start",position:"relative"},attributesWrapper:{width:"100%",marginBottom:"10px"},imagesWrapper:{paddingBottom:"10px",width:"100%"},link:{display:"flex",marginTop:4},"svg-icon__root":{fontSize:"1rem"},title:{fontSize:"12px",lineHeight:"14px",paddingLeft:"12px",verticalAlign:"middle",wordBreak:"break-all",color:e.palette.text.secondary},typeError:{marginLeft:"12px"},ovIcon:{marginLeft:"8px",textIndent:0},titleWrapper:{display:"inline-block",paddingBottom:"3px"},errorWrapper:{paddingBottom:"10px"}}))),rj=e=>{let{max:t,values:r,attributeType:n,parentUri:a,mode:i,drawLines:o,showEmptyEditors:l,errorMessage:s,errors:c,paging:u,crosswalks:p,showNonOv:d,nonVisibleValues:m,highlightedError:g,highlightedAttribute:y,onAddAttributes:f,onDeleteAttribute:h,onChangeAttribute:E,onDeactivateError:T,additionalControlsRenderer:C,requestNextPageOfAttributeValues:S}=e;const A=tj(),[R,I]=(0,b.useState)(t),[N,D]=(0,b.useState)(!1),{label:P,required:k,cardinality:L,name:U,uri:j,description:F}=n,M=(0,x.isEditableMode)(i),{ref:V,errorClassName:B}=RL({highlightedError:g}),{ref:z,highlightedClassName:H}=JU(y),Y=(0,b.useContext)(LL),W=(0,b.useMemo)((()=>null==Y?void 0:Y.includes(j)),[j,Y]),G=(0,x.isEmptyValue)(r),q=(!N&&l||k||W)&&G,Z=(0,w.Ws)(),$=(0,b.useMemo)((()=>Z.includes(n.uri)),[Z,n.uri]),K=(0,b.useRef)((0,x.createNewAttribute)({parentUri:a,attributeType:(0,_.omit)(["defaultValue"],n)})),X=(0,b.useCallback)((()=>{I(R+1);const e=e=>({parentUri:a,index:R,attributeType:e});if(q&&!(0,x.isComplexAttribute)(n.type)){const t=[e((0,_.omit)(["defaultValue"],n)),e(n)];return f(t)}return f([e(n)])}),[R,f,a,n,q]),Q=(0,b.useCallback)((0,_.pipe)(h,_.T,D),[h,D]);if(G&&!q)return null;if(q&&G&&(r=[K.current]),(0,x.isEmptyValue)(r))return null;const J=(ej(r)||[]).length,ee=d?"totalValues":"totalOvValues",te=(0,_.ifElse)((0,_.has)(ee),(0,_.pipe)((0,_.prop)(ee),(0,_.add)(J)),(0,_.always)(r.length))(u),re=null!=u&&u.totalValues?u.totalValues-te:null==m?void 0:m.length,ne=t<te,ae=ne&&R<te,ie=ne&&R>=te,oe=r.slice(0,R),le=oe?oe.length-1:0,se=te-R;return v().createElement(sN,{enabled:o},v().createElement("div",{ref:V,className:O()(A.wrapper,B)},v().createElement("div",{className:A.titleWrapper},v().createElement(ED,{label:P,isRequired:k,className:A.title,"data-reltio-id":"reltio-attribute-label"}),v().createElement(AD,{description:F}),$&&v().createElement(PP,null),v().createElement(OD,{nonOvValues:m,attributeType:n,className:A.ovIcon,nonOvTotal:re})),M&&v().createElement(ZU,{cardinality:L}),M&&v().createElement(Jk,{message:s,className:A.typeError}),v().createElement("div",{className:A.attributesWrapper},oe.map(((e,t)=>v().createElement(FU,{key:e.uri,attributeValue:e,attributeType:n,lazy:q&&!k,showEmptyEditors:l,errors:c,ownError:(0,x.getAttributeOwnError)(e,t,n.uri,c),mode:i,crosswalks:p,onAddOneMore:le===t?X:null,onAddAttributes:f,onDeleteAttribute:Q,onChangeAttribute:E,onDeactivateError:T,additionalControlsRenderer:C,className:0===t?H:null,ref:0===t?z:null,isEmptyEditor:q}))),ae&&v().createElement(GP,{moreNumber:(0,_.min)(t,se),valueNumber:se,onClick:()=>{r.length<te&&S({parentUri:a,attributeTypeUri:j,attributeTypeName:U,values:r,defaultMaxValues:t}),I(R+t)}}),ie&&v().createElement(KP,{onClick:()=>{I(t)}}))))};rj.displayName="AttributeRenderer";const nj=(0,b.memo)(rj),aj=(0,kp.Z)({value:{color:"rgba(0, 0, 0, 0.87)"}}),ij=(0,kp.Z)({placeholder:{color:"rgba(0, 0, 0, 0.38)",fontSize:"14px !important"}});function oj(){return oj=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},oj.apply(this,arguments)}function lj(){return lj=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},lj.apply(this,arguments)}const sj={SingleValue:e=>{let{selectProps:{menuIsOpen:t},data:{label:r}}=e;const n=aj();return!t&&v().createElement(Ag(),{variant:"body2",classes:{root:n.value}},r)},Placeholder:e=>{let{innerProps:t,children:r}=e;const n=ij();return v().createElement(Ag(),oj({className:n.placeholder},t),r)}},cj=(0,b.memo)((e=>v().createElement(lU,lj({components:sj},e)))),uj=(0,kp.Z)({container:{display:"flex",flex:1,alignItems:"flex-start",marginBottom:"10px"},roleContainer:{width:"100%"},valueContainer:{marginLeft:"8px",width:0},deleteButton:{marginLeft:"8px"}}),pj={MultiValue:Zy._},dj=e=>{let{values:t,onChange:r,onDelete:n}=e;const a=uj(),i=(0,w.AH)(),o=(0,w.eh)(),l=o.uri,s=(0,x.getRolesForEntityType)(i,o.type).map((e=>({value:e.uri,label:e.label}))),c=(t||[]).map((e=>{var t;return{value:e,label:(null===(t=s.find((0,_.propEq)("value",e)))||void 0===t?void 0:t.label)||(0,x.getLastUriPart)(e)}})),u=(0,b.useCallback)((e=>{const t=(null==e?void 0:e.map((0,_.prop)("value")))||[];r({value:t,attributeType:x.EntityAttrTypes.roles,uri:l})}),[l,r]),p=(0,b.useCallback)((()=>{n({uri:l,attributeType:x.EntityAttrTypes.roles})}),[l,n]);return v().createElement("div",{className:a.container,"data-reltio-id":"reltio-attribute-value"},v().createElement(cj,{label:"",height:40,isMulti:!0,options:s,value:c,onChange:u,components:pj,classes:a,className:a.roleContainer}),!!n&&v().createElement(Pp.T,{"data-reltio-id":"reltio-roles-delete-button",className:a.deleteButton,icon:tL(),onClick:p,size:"L"}))};var mj=r(56333);const gj=(0,kp.Z)({container:{display:"flex",flex:1,alignItems:"flex-start",marginBottom:"10px"},deleteButton:{marginLeft:"8px"}});function yj(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){fj(e,t,r[t])}))}return e}function fj(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const hj=e=>{let{className:t,values:r,onChange:n,onDelete:a}=e;const i=gj(),o=(0,w.lG)(),l=(0,w.mU)(),s=(0,b.useCallback)((async(e,t,r)=>{const n=await(0,x.getFacetedAttributeData)({fieldName:"tags",searchValue:e,options:yj({},l,{max:t,pageNo:r})});return Object.keys(n.tags)}),[l]),c=(0,b.useCallback)((e=>{n({value:e,attributeType:x.EntityAttrTypes.tags,uri:o})}),[n,o]),u=(0,b.useCallback)((()=>{a({uri:o,attributeType:x.EntityAttrTypes.tags})}),[o,a]);return v().createElement("div",{className:i.container,"data-reltio-id":"reltio-attribute-value"},v().createElement(mj.p,{fullWidth:!0,multiple:!0,variant:"filled",className:t,value:r||[],onChange:c,getSuggestions:s}),!!a&&v().createElement(Pp.T,{"data-reltio-id":"reltio-tags-delete-button",className:i.deleteButton,icon:tL(),onClick:u,size:"L"}))};function Ej(){return Ej=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ej.apply(this,arguments)}function bj(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const vj=(0,bL.l)(UL,((e,t)=>{let{attributeType:r}=t;const{hasDeletionsMap:n,setHasDeletions:a}=e||{};return{hasDeletions:n?Boolean(n[null==r?void 0:r.uri]):void 0,setHasDeletions:a}}),(e=>{let{values:t,attributeType:r,parentUri:n,mode:a,errorMessage:i,onDeleteAttribute:o,onChangeAttribute:l,showEmptyEditors:s,hasDeletions:c,setHasDeletions:u,highlightedAttribute:p}=e,d=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["values","attributeType","parentUri","mode","errorMessage","onDeleteAttribute","onChangeAttribute","showEmptyEditors","hasDeletions","setHasDeletions","highlightedAttribute"]);const m=tj(),{label:g,required:y,cardinality:f}=r,h=(0,x.isEditableMode)(a),[E,T]=(0,b.useState)(!1),C=(0,b.useCallback)((e=>{T(e),null==u||u(r.uri,e)}),[r.uri,u]),S=void 0!==c?c:E,w=(0,b.useCallback)((0,_.pipe)(o,_.T,C),[o,C]),A=(0,x.isEmptyValue)(t),R=!S&&s&&A,I=(0,b.useRef)((0,x.createNewAttribute)({parentUri:n,attributeType:r})),{ref:N,highlightedClassName:D}=JU(p);return(0,x.isActivenessAttrType)(r)&&A&&!R?null:v().createElement("div",{ref:N,className:O()(D,m.wrapper)},v().createElement(ED,{label:g,isRequired:y,className:O()(m.title,m.titleWrapper),"data-reltio-id":"reltio-attribute-label"}),h&&v().createElement(ZU,{cardinality:f}),h&&v().createElement(Jk,{message:i}),v().createElement(KI(),{className:m.attributesWrapper},(()=>{switch(r.uri){case x.EntityAttrTypes.tags.uri:return v().createElement(hj,{values:t,onDelete:w,onChange:l});case x.EntityAttrTypes.roles.uri:return v().createElement(dj,{values:t,onDelete:w,onChange:l});default:{const e=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){bj(e,t,r[t])}))}return e}({},I.current,{value:t[0]||""});return v().createElement(FU,Ej({attributeValue:e,attributeType:r,mode:a,onDeleteAttribute:w,onChangeAttribute:l},d))}}})()))}));var Tj=r(57517),Oj=r.n(Tj);function xj(){return xj=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},xj.apply(this,arguments)}const Cj=e=>v().createElement("svg",xj({width:18,height:18,viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","data-reltio-id":"SvgDownload"},e),v().createElement("defs",null,v().createElement("path",{d:"M19 16v3H5v-3H3v3c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-3h-2zm-6-3.33l2.59-2.58L17 11.5l-5 5-5-5 1.41-1.41L11 12.67V3h2v9.67z",id:"Download_svg__a"})),v().createElement("g",{transform:"translate(-3 -3)",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},v().createElement("mask",{id:"Download_svg__b",fill:"#fff"},v().createElement("use",{xlinkHref:"#Download_svg__a"})),v().createElement("path",{fillOpacity:.54,fill:"#fff",mask:"url(#Download_svg__b)",d:"M0 0h24v24H0z"})));var Sj=r(76550),wj=r.n(Sj),Aj=r(29367),Rj=r.n(Aj);const _j=(0,kp.Z)((()=>({root:{fontSize:"24px",color:"#fff"}}))),Ij=e=>{let{checked:t,className:r,onClick:n}=e;const a=_j(),i=t?Rj():wj();return v().createElement(i,{className:O()(a.root,r),onClick:n})},Nj=(0,kp.Z)((()=>({overlay:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",transition:"0.2s linear all","&:not($selected):not($selectionMode):hover":{backgroundColor:"rgba(0,0,0,0.6)"},userSelect:"none"},selected:{backgroundColor:"rgba(0,114,206,0.6)"},selectionMode:{cursor:"pointer","&:not($selected)":{backgroundColor:"rgba(0,0,0,0.6)"}},button:{padding:0,width:"100px",height:"36px",color:"#fff",fontSize:"14px",fontWeight:500,lineHeight:"16px",border:"1px solid rgba(255,255,255,0.25)",backgroundColor:"rgba(98,2,238,0)"},checkedIcon:{position:"absolute",left:"4px",top:"4px",cursor:"pointer"},actions:{display:"flex",alignItems:"center",position:"absolute",top:"4px",right:"4px"},actionButton:{color:"#fff",fontSize:"24px"},dropDownMenuButton:{margin:"0 2px 0 8px"}}))),Dj=(0,b.memo)((e=>{const{id:t,canBeSelected:r=!1,selected:n=!1,selectionMode:a=!1,onDeselect:i=_.identity,onSelect:o=_.identity,onShareLink:l,onSetAsDefault:s,onDelete:c,onDownload:u=_.identity,onClick:p}=e,d=Nj(),[m,g]=(0,b.useState)(!1),{canDelete:y}=Mk(t),f=(0,b.useMemo)((()=>[{text:mi().text("Share link"),onClick:l},{text:mi().text("Set as default"),onClick:s},{text:mi().text("Delete"),onClick:y&&c}].filter((0,_.prop)("onClick"))),[l,s,c,y]),h=e=>()=>(0,_.ifElse)((0,_.equals)(!0),i,o)(e),E=r&&(n||m||a),T=!a&&!n&&m,x=r&&n;return v().createElement("div",{className:O()(d.overlay,{[d.selected]:n,[d.selectionMode]:a}),onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),onClick:a?h(n):e=>{e.currentTarget===e.target&&p()},"data-reltio-id":"image-actions-overlay"},E&&v().createElement(Ij,{className:d.checkedIcon,checked:n,onClick:h(n)}),T&&v().createElement("div",{className:d.actions},v().createElement(Pp.T,{onClick:u,className:d.actionButton,icon:Cj}),v().createElement(LN,{menuId:`image-overlay-actions-${t}`,buttonComponent:Pp.T,buttonProps:{icon:Vd(),className:O()(d.actionButton,d.dropDownMenuButton)},menuItems:f})),x&&v().createElement(nE(),{className:d.button,variant:"outlined",onClick:i},mi().text("Deselect")))}));var Pj=r(70251),kj=r.n(Pj),Lj=r(1937),Uj=r.n(Lj);const jj=(0,kp.Z)((e=>({root:{width:"328px"},paper:{width:"100%",height:"40px",display:"flex",alignItems:"center",boxShadow:"none",backgroundColor:"rgba(0,0,0,0.03)"},inputRoot:{flex:1},input:{padding:"0 12px",fontSize:"14px","&:placeholder":{color:e.palette.text.secondary}},errorMessage:{marginTop:"8px",fontSize:"12px",color:e.palette.error.main}}))),Fj=e=>0===e.trim().length,Mj=e=>{let{onSend:t}=e;const r=jj(),[n,a]=(0,b.useState)(""),[i,o]=(0,b.useState)(null);return v().createElement(KI(),{className:r.root},v().createElement(JI(),{className:r.paper},v().createElement(Uj(),{value:n,onChange:e=>{const t=e.target.value,r=new RegExp(/^(ftp|http|https):\/\/[^ "]+$/).test(t);a(t),r||Fj(t)?o(null):o(mi().text("URL is not correct"))},classes:{root:r.inputRoot,input:r.input},placeholder:mi().text("Paste an image URL here")}),v().createElement(nE(),{disabled:Boolean(i)||Fj(n),variant:"outlined",color:"primary",onClick:()=>{t(n),a(""),o(null)}},mi().text("Send"))),i&&v().createElement(Ag(),{className:r.errorMessage},i))};var Vj=r(65680),Bj=r(83997);const zj=["image/png","image/jpeg","image/tiff","image/gif","image/bmp"],Hj=e=>{let{className:t,onAppendFile:r}=e;return v().createElement(v().Fragment,null,v().createElement("input",{onInput:e=>{r&&r(e.currentTarget.files[0])},style:{display:"none"},accept:zj.join(","),id:"upload-image-button","data-reltio-id":"upload-image-button",type:"file"}),v().createElement("label",{htmlFor:"upload-image-button"},v().createElement(nE(),{className:t,variant:"contained",color:"primary",component:"span"},mi().text("Select image"))))};function Yj(){return Yj=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Yj.apply(this,arguments)}const Wj=e=>v().createElement("svg",Yj({width:256,height:256,viewBox:"0 0 256 256",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","data-reltio-id":"SvgUploadIcon"},e),v().createElement("defs",null,v().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"UploadIcon_svg__c"},v().createElement("stop",{stopColor:"#FFF",offset:"0%"}),v().createElement("stop",{stopColor:"#FFF",stopOpacity:0,offset:"100%"})),v().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"UploadIcon_svg__d"},v().createElement("stop",{stopColor:"#FFF",offset:"0%"}),v().createElement("stop",{stopColor:"#FFF",stopOpacity:0,offset:"100%"})),v().createElement("linearGradient",{x1:"67.572%",y1:"54.952%",x2:"15.212%",y2:"13.907%",id:"UploadIcon_svg__e"},v().createElement("stop",{stopColor:"#000",stopOpacity:0,offset:"0%"}),v().createElement("stop",{stopColor:"#000",offset:"100%"})),v().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"UploadIcon_svg__f"},v().createElement("stop",{stopColor:"#B8EDFF",offset:"0%"}),v().createElement("stop",{stopColor:"#53ACDE",offset:"100%"})),v().createElement("circle",{id:"UploadIcon_svg__a",cx:128,cy:128,r:128})),v().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},v().createElement("mask",{id:"UploadIcon_svg__b",fill:"#fff"},v().createElement("use",{xlinkHref:"#UploadIcon_svg__a"})),v().createElement("use",{fillOpacity:.1,fill:"#0072CE",xlinkHref:"#UploadIcon_svg__a"}),v().createElement("g",{mask:"url(#UploadIcon_svg__b)"},v().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(-1 9)"},v().createElement("path",{d:"M0 107.268c0 35.579 28.703 64.409 64.173 64.409h139.021c29.578 0 53.497-24.035 53.497-53.635 0-28.356-21.935-51.562-49.705-53.515C199.577 27.705 167.2 0 128.346 0 97.425 0 70.59 17.582 57.171 43.274 25.027 46.767 0 74.117 0 107.268z",fill:"#FFF",opacity:.3}),v().createElement("ellipse",{fill:"url(#UploadIcon_svg__c)",opacity:.4,cx:64.553,cy:107.664,rx:61.43,ry:62.336}),v().createElement("path",{d:"M127.979 8.91c38.773 0 70.206 31.895 70.206 71.24 0 39.346-31.433 71.241-70.206 71.241-6.067 0-11.954-.78-17.57-2.249 9.688-11.019 15.574-25.551 15.574-41.478 0-33.7-26.352-61.153-59.286-62.299C78.714 23.611 101.654 8.91 127.98 8.91z",fill:"url(#UploadIcon_svg__d)",opacity:.4})),v().createElement("path",{fill:"url(#UploadIcon_svg__e)",opacity:.12,d:"M82.093 128.474l38.374 37.966-10.666 18.958 72.714 71.94 63.578-57.537v-6.11l-71.107-70.352H97.22z",transform:"translate(-1 9)"}),v().createElement("path",{fill:"url(#UploadIcon_svg__f)",d:"M151.004 128.29v57.591h-40.836V128.29H81l49.5-49.409L180 128.29z",transform:"translate(-1 9)"})))),Gj=(0,kp.Z)((e=>({root:{padding:"36px 0 29px"},isActive:{backgroundColor:"rgba(0,114,206,0.12)"},icon:{width:"190px",height:"190px",marginBottom:"24px"},title:{marginBottom:"8px",color:e.palette.text.primary,fontSize:"20px",fontWeight:500,lineHeight:"24px"},description:{marginBottom:"24px",color:e.palette.text.secondary,fontSize:"14px",lineHeight:"16px"}}))),qj=e=>{let{onAppendFile:t,className:r}=e;const n=Gj(),[{canDrop:a,isOver:i},o]=(0,Vj.useDrop)({accept:[Bj.FILE],drop:e=>{e&&t(e.files[0])},collect:e=>({isOver:e.isOver(),canDrop:e.canDrop()})}),l=a&&i;return v().createElement("div",{ref:o,className:O()(n.root,{[n.isActive]:l},r)},v().createElement(Wj,{className:n.icon}),v().createElement(Ag(),{className:n.title},mi().text("Drag an image here")),v().createElement(Ag(),{className:n.description},mi().text("Acceptable image types would include JPG, PNG, TIFF, GIF, BMP. Maximum image size: ${MAX_IMAGE_SIZE}Mb",{MAX_IMAGE_SIZE:20})),v().createElement(Hj,{onAppendFile:t}))},Zj=(0,kp.Z)((e=>({root:{width:"100%",display:"flex",alignItems:"center",padding:"0 30px",boxSizing:"border-box"},border:{borderBottom:`1px solid ${e.palette.text.primary}`,flex:1,opacity:.12},text:{padding:"0 10px",color:e.palette.text.secondary,fontSize:"14px",lineHeight:"16px"}}))),$j=e=>{let{children:t,className:r}=e;const n=Zj();return v().createElement(KI(),{className:O()(n.root,r)},v().createElement(KI(),{className:n.border}),v().createElement(Ag(),{className:n.text},t),v().createElement(KI(),{className:n.border}))},Kj=(0,kp.Z)({closeIcon:{color:"#fff"}}),Xj=e=>{let{error:t,onClose:r}=e;const n=Kj();return v().createElement(Jh(),{open:Boolean(t),onClose:r,message:t,action:v().createElement(wd.k,{className:n.closeIcon,tooltipTitle:mi().text("Close"),icon:_p(),onClick:r})})},Qj=(0,kp.Z)((e=>({root:{},dialogPaper:{position:"relative",maxWidth:"480px"},title:{color:e.palette.text.primary,fontSize:"20px",fontWeight:500,letterSpacing:"0.25px",lineHeight:"24px",padding:"16px"},body:{display:"flex",flexDirection:"column",alignItems:"center",padding:"0 8px 49px",textAlign:"center"},targetBox:{marginBottom:"8px"},divider:{marginBottom:"28px"}}))),Jj=e=>{let{open:t,onClose:r,onUpload:n}=e;const a=Qj(),[i,o]=(0,b.useState)(!1),[l,s]=(0,b.useState)(null),c=(0,w.qD)(),u=(0,w.fN)(),p=(0,w.Uv)(),d=e=>{o(!0),(0,x.uploadImage)({image:e,imageServicePath:c,environment:u,tenant:p}).then((e=>{n(e),r()})).catch((e=>{s((0,x.getRequestErrorMessage)(e,mi().text("Something went wrong")))})).finally((()=>o(!1)))};return v().createElement(kj(),{open:t,onClose:r,classes:{paper:a.dialogPaper}},v().createElement(Ag(),{className:a.title},mi().text("Add new image")),v().createElement(KI(),{className:a.body},v().createElement(qj,{className:a.targetBox,onAppendFile:e=>{if(!e)return s(mi().text("No image selected."));const t=Number((e.size/1024/1024).toFixed(2)),r=zj.includes(e.type);t>20?s(mi().text("File size exceeds configured max file size.")):r?d(e):s(mi().text("File format is not supported."))}}),v().createElement($j,{className:a.divider},mi().text("or")),v().createElement(Mj,{onSend:e=>{d(e)}})),i&&v().createElement(LE.z,null),v().createElement(Xj,{error:l,onClose:()=>s(null)}))},eF=(0,kp.Z)((()=>({root:{width:"100%"},image:e=>{let{imageMargin:t}=e;return{marginRight:t,cursor:"pointer","&:last-child":{marginRight:0}}},uploadContainer:e=>{let{imageMargin:t,imageWidth:r,imageHeight:n}=e;return{backgroundColor:"white",width:r,height:n,cursor:"pointer",border:"1px dashed #0072CE",boxSizing:"border-box",marginRight:t,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}},uploadButton:{width:"50px",height:"50px"},uploadIcon:{fontSize:"36px"}}))),tF={},rF=e=>{let{attributeType:t={},attributeValues:r=[],onDeleteAttribute:n,onChangeAttribute:a,requestNextPageOfAttributeValues:i,parentUri:o,paging:l,showNonOv:s,imageSize:c=vk}=e;const u=eF(c),[p,d]=(0,b.useState)(!1),m=(0,w.ax)("setDefaultProfilePicForModifiedEntity"),g=(0,w.eh)()||tF,y=(0,w.AU)(g.uri),{canCreate:f}=(0,b.useContext)(Fk),h=(0,b.useCallback)((()=>{d((e=>!e))}),[]),E=(0,b.useCallback)((e=>{const r=(0,x.generateUri)(o,t.name),n={};for(const a in e){const i=(t.attributes||[]).find((e=>{let{name:t}=e;return t===a}));i&&(n[a]=[{uri:(0,x.generateUri)(r,i.name),ov:!0,value:e[a],type:i.uri}])}a({attributeType:t,uri:r,value:n})}),[a,o,t]),T=(0,b.useCallback)((e=>{if(n(e),y===e.uri){var t;const n=(null===(t=r[0])||void 0===t?void 0:t.uri)===e.uri?r[1]:r[0];m({entityUri:g.uri,value:n||{}})}}),[n,g,y,r,m]),O=(e,r)=>{const{onOpenImageGalleryDialog:n,onDownload:a,onShareLink:i,onSetAsDefault:o}=e,l=(0,x.getImageAttributeOvUrl)(r),{uri:s}=r;return v().createElement(Dj,{id:s,onShareLink:()=>i(l),onSetAsDefault:()=>o(r),onDelete:()=>T({uri:s,attributeType:t}),onDownload:()=>a([l]),onClick:()=>n(s)})};return v().createElement("div",{className:u.root,"data-reltio-id":"image-line-edit-mode"},v().createElement(VF,{attributeValues:r,attributeType:t,renderImage:e=>function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=(0,x.getImageAttributeOvThumbnailUrl)(t),{uri:n}=t,{onOpenImageGalleryDialog:a}=e;return v().createElement("div",{className:u.image,key:n},v().createElement(bk,{src:r,overlay:O(e,t),onClick:()=>a(n),size:{imageWidth:c.imageWidth,imageHeight:c.imageHeight},"data-reltio-id":"reltio-attribute-value"}))},overlay:!0,countFixedItems:f?1:0,onUpload:h,onDeleteAttribute:T,imageSize:c,requestNextPageOfAttributeValues:i,paging:l,parentUri:o,showNonOv:s},f&&v().createElement("div",{className:u.uploadContainer,onClick:h},v().createElement(Pp.T,{className:u.uploadButton,iconClassName:u.uploadIcon,icon:Oj(),"data-reltio-id":"reltio-upload-image-button"}))),v().createElement(Jj,{open:p,onUpload:E,onClose:h}))},nF=e=>{let{attributeType:t,attributeValues:r,paging:n,parentUri:a,showNonOv:i,onDeleteAttribute:o,onChangeAttribute:l,requestNextPageOfAttributeValues:s,highlightedAttribute:c,error:u,highlightedError:p,onDeactivateError:d}=e;const m=tj(),{label:g,description:y,required:f}=t,{ref:h,highlightedClassName:E}=JU(c),{ref:T,errorClassName:C}=RL({highlightedError:p}),S=(0,b.useCallback)((()=>{u&&d&&d((0,x.getErrorId)(u))}),[u,d]);return v().createElement("div",{ref:h,className:O()(m.wrapper,E)},v().createElement("div",{ref:T,className:O()(m.imagesWrapper,C)},v().createElement("div",{className:m.titleWrapper},v().createElement(ED,{className:m.title,label:g,"data-reltio-id":"reltio-attribute-label",isRequired:f}),v().createElement(AD,{description:y})),v().createElement(cL,{errorMessage:null==u?void 0:u.message,className:m.errorWrapper},v().createElement(rF,{attributeValues:r,attributeType:t,paging:n,onDeleteAttribute:o,parentUri:a,onChangeAttribute:(0,_.pipe)(l,S),requestNextPageOfAttributeValues:s,showNonOv:i}))))};let aF=function(e){return e.imageLine="imageLine",e.special="special",e.default="default",e}({});function iF(){return iF=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},iF.apply(this,arguments)}const oF=(0,bL.l)(xL,((e,t)=>{let{attributeType:r,parentUri:n}=t;const{element:a,type:i}=e||{},o=(e=>e===TL.NewAttribute)(i)&&a.uri===r.uri;return{highlightedAttribute:o?e:null,highlightedError:OL(i)&&(0,x.isAttributeTypeError)(a,n,r.uri)?e:null}}),(e=>{var t;let{values:r,attributeType:n,mode:a=x.Mode.Viewing,crosswalks:i,drawLines:o,paging:l={},parentUri:s,max:c,showEmptyEditors:u,showNonOv:p,highlightedError:d,highlightedAttribute:m,onAddAttributes:g,onDeleteAttribute:y,onChangeAttribute:f,additionalControlsRenderer:h}=e;const E=(0,w.ax)("errorDeactivated"),T=(0,w.ax)("requestNextPageOfAttributeValues"),O=(0,b.useContext)(jL),C=s&&(0,x.getBaseUri)(s),S=(0,b.useMemo)((()=>O[C]||[]),[O,C]),A=(0,w.Jz)(s,n),R=(0,b.useMemo)((()=>(0,x.filterErrorsForHiddenAttributes)(A,S)),[A,S]),I=(0,w.Xj)(),N=(0,w.vd)(),D=(0,x.getAttributePagerActiveTypeErrorMessage)(s,n,I),P=null!==(t=null!=c?c:N)&&void 0!==t?t:1/0,k=(0,_.partition)(x.isOv),[L,U]=k(r),j=p?r:L,F=p?[]:U,M={errorMessage:D,errors:R,mode:a,parentUri:s,onAddAttributes:g,onDeleteAttribute:y,onChangeAttribute:f,onDeactivateError:E,additionalControlsRenderer:h,showEmptyEditors:u,highlightedError:d,highlightedAttribute:m};return(()=>{switch((0,_.cond)([[x.isSpecialAttribute,(0,_.always)(aF.special)],[x.isImage,(0,_.always)(aF.imageLine)],[_.T,(0,_.always)(aF.default)]])(n)){case aF.special:return v().createElement(sN,{enabled:o},v().createElement(vj,iF({values:j,attributeType:n},M)));case aF.imageLine:return v().createElement(sN,{enabled:o},v().createElement(nF,{attributeValues:j,attributeType:n,paging:l,onDeleteAttribute:y,parentUri:s,onChangeAttribute:f,requestNextPageOfAttributeValues:T,showNonOv:p,highlightedAttribute:m,error:(0,x.getAttributeErrorByTypeUri)(n.uri,R),highlightedError:d,onDeactivateError:E}));default:return v().createElement(nj,iF({values:j,attributeType:n,max:P,paging:l,crosswalks:i,drawLines:o,requestNextPageOfAttributeValues:T,showNonOv:p,nonVisibleValues:F},M))}})()})),lF=(0,kp.Z)({root:{},form:{padding:"10px 0"},divider:{width:"100%",height:"1px",borderColor:"rgba(255,255,255,0.12)"},actions:{display:"flex",justifyContent:"flex-end",marginTop:"4px"},cancelButton:{color:"white",marginRight:"8px"}}),sF=e=>{let{attributeType:t,imageAttributeFieldsOrder:r,attributeValue:n,hasChanges:a,onDeleteAttribute:i,onChangeAttribute:o,onAddAttributes:l,onCancel:s,onApply:c,mode:u}=e;const p=lF(),d=Yk(n,t,r),m=0!==d.length||0===d.length&&a;return v().createElement(KI(),{className:p.root},v().createElement(KI(),{className:p.form},d.map((e=>{let{attrType:t,values:r}=e;return v().createElement(oF,{key:t.uri,parentUri:n.uri,attributeType:t,values:r,showEmptyEditors:(0,x.isTempUri)(n.uri),mode:u,drawLines:!1,onDeleteAttribute:i,onChangeAttribute:o,onAddAttributes:l})}))),m&&v().createElement(v().Fragment,null,v().createElement(Lg(),{className:p.divider}),v().createElement(KI(),{className:p.actions},v().createElement(nE(),{disabled:!a,onClick:s,className:p.cancelButton},mi().text("Cancel")),v().createElement(nE(),{disabled:!a,onClick:c,color:"primary"},mi().text("Apply")))))},cF={palette:{mode:"dark",primary:x.theme.palette.primary,secondary:x.theme.palette.secondary}},uF=(0,Lm.createTheme)(cF),pF=e=>{let{imageAttributeFieldsOrder:t,attributeType:r,attributeValue:n}=e;const a=(0,w.YA)(),i=(0,w.o_)(),{addAttributes:o,changeAttribute:l,deleteAttribute:s,clearLocalChanges:c,applyLocalChanges:u,attributeValue:p,hasChanges:d}=(e=>{let{initialAttributeValue:t,attributeType:r}=e;const n=(0,w.ax)("modifyAttribute"),[a,i]=(0,b.useState)(t);(0,b.useEffect)((()=>{i(t)}),[t]);const o=!(0,_.equals)(a,t),l=(0,b.useCallback)((e=>{i((t=>e.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:a}=t;return(0,x.addAttribute)({entity:e,attributeType:r,parentUri:n,index:a,nestingLevel:1})}),t)))}),[]),s=(0,b.useCallback)((e=>{let{value:t,attributeType:r,uri:n}=e;i((e=>(0,x.editAttribute)({entity:e,attributeType:r,uri:n,value:t,nestingLevel:1})))}),[]),c=(0,b.useCallback)((e=>{let{attributeType:t,uri:r}=e;i((e=>(0,x.removeAttribute)({entity:e,attributeType:t,uri:r,nestingLevel:1})))}),[]);return{addAttributes:l,changeAttribute:s,deleteAttribute:c,clearLocalChanges:(0,b.useCallback)((()=>{i(t)}),[t]),applyLocalChanges:(0,b.useCallback)((()=>{n({value:a,attributeType:r,uri:a.uri})}),[a,r,n]),attributeValue:a,hasChanges:o}})({attributeType:r,initialAttributeValue:n});return v().createElement(Lm.ThemeProvider,{theme:uF},v().createElement(KI(),null,v().createElement(qk,{attributeType:r,uri:null==p?void 0:p.uri,onAddAttributes:i?o:void 0}),v().createElement(Xk,{attributeType:r,attributeValue:p,imageAttributeFieldsOrder:t}),i&&v().createElement(sF,{mode:a,imageAttributeFieldsOrder:t,attributeType:r,attributeValue:p,hasChanges:d,onDeleteAttribute:s,onChangeAttribute:l,onAddAttributes:o,onCancel:c,onApply:u})))},dF=(0,kp.Z)((e=>({root:{position:"relative",backgroundColor:"#333",maxHeight:"calc(100vh - 64px)",overflow:"hidden"},header:{display:"flex",alignItems:"center",height:"56px",paddingLeft:"16px",boxShadow:`0 1px 0 0 ${e.palette.divider}`},headerTitle:{color:"rgba(255, 255, 255, 0.87)",fontSize:"16px",lineHeight:"19px"},bodyWrapper:{maxHeight:"calc(100% - 56px)",overflow:"auto"},body:{padding:"16px"},formControlLabel:{marginLeft:0,marginBottom:"27px"},checkboxLabel:{marginLeft:"8px",color:"rgba(255,255,255,0.87)",fontSize:"13px",lineHeight:"15px"},checkbox:{color:"white",padding:0}}))),mF=e=>{let{className:t,attributeValue:r,handleSetAsDefault:n,attributeType:a}=e;const i=dF(),[o,l]=(0,b.useState)(!1),s=(0,w.eh)()||{},c=(0,w.vc)(null==s?void 0:s.uri)||{},u=(0,w.xH)(),p=(0,w.uO)()||{},d=u?s:c,m=p[null==s?void 0:s.type]||(null==p?void 0:p.default)||{};(0,b.useEffect)((()=>{l((null==d?void 0:d.defaultProfilePic)===(null==r?void 0:r.uri))}),[null==r?void 0:r.uri,d]);const g=(0,b.useCallback)((()=>{n(r.uri)}),[null==r?void 0:r.uri]);return v().createElement(KI(),{className:O()(i.root,t)},v().createElement(KI(),{className:i.header},v().createElement(Ag(),{className:i.headerTitle},mi().text("Details"))),v().createElement(KI(),{className:i.bodyWrapper},v().createElement(KI(),{className:i.body},v().createElement(Nh(),{classes:{root:i.formControlLabel,label:i.checkboxLabel},control:v().createElement(Jp(),{className:i.checkbox,checked:o,onChange:g}),label:mi().text("Set as default")}),v().createElement(pF,{attributeType:a,imageAttributeFieldsOrder:m,attributeValue:r}))))},gF=(0,kp.Z)((()=>({root:{display:"flex",width:"100%",overflowY:"auto",height:"calc(100vh - 64px)"},main:{flex:"1 0 auto"},details:{width:"340px"}}))),yF=e=>{let{attributeValues:t=[],currentAttributeValueUri:r,setCurrentAttributeValueUri:n,handleSetAsDefault:a,attributeType:i}=e;const[o,l]=(0,b.useState)(0);(0,b.useEffect)((()=>{s(r?t.findIndex((e=>e.uri===r)):0)}),[r,t]);const s=(0,b.useCallback)((e=>{var r;l(e),n(null===(r=t[e])||void 0===r?void 0:r.uri)}),[t]),c=gF();return v().createElement(KI(),{className:c.root},v().createElement(Ik,{attributeValueIndex:o,setAttributeValueIndex:s,attributeValues:t,className:c.main}),v().createElement(mF,{handleSetAsDefault:a,attributeValue:t[o],className:c.details,attributeType:i}))};let fF=function(e){return e.Gallery="gallery",e.Details="details",e}({});var hF=r(60480),EF=r.n(hF),bF=r(54886),vF=r.n(bF),TF=r(86038),OF=r.n(TF),xF=r(39178),CF=r.n(xF);function SF(){return SF=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},SF.apply(this,arguments)}const wF=e=>v().createElement("svg",SF({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","data-reltio-id":"SvgDetails"},e),v().createElement("defs",null,v().createElement("path",{d:"M14 5a1 1 0 011 1v12a1 1 0 01-1 1H4a1 1 0 01-1-1V6a1 1 0 011-1h10zm6 12v2h-3v-2h3zm2-4v2h-5v-2h5zm0-4v2h-5V9h5zm0-4v2h-5V5h5z",id:"Details_svg__a"})),v().createElement("g",{stroke:"none",strokeWidth:1,fillRule:"evenodd"},v().createElement("mask",{id:"Details_svg__b",fill:"#fff"},v().createElement("use",{xlinkHref:"#Details_svg__a"})),v().createElement("path",{mask:"url(#Details_svg__b)",d:"M0 0h24v24H0z"}))),AF=(0,kp.Z)((()=>({paper:{backgroundColor:"rgba(0, 0, 0, .85)"},backdrop:{backgroundColor:"transparent"},toolbar:{paddingLeft:"20px",paddingRight:"20px"},appBar:{position:"relative",background:"linear-gradient(180deg, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0) 100%)"},closeButton:{marginRight:"28px"},closeIcon:{fontSize:"24px",color:"#fff"},headerLeft:{display:"flex",alignItems:"center",flex:2},headerCenter:{display:"flex",justifyContent:"center",flex:1},headerRight:{flex:2,display:"flex",justifyContent:"flex-end",alignItems:"center"},modeSwitcher:{backgroundColor:"#fff"},content:{padding:0}}))),RF=e=>{let{open:t,mode:r,children:n,header:a,onClose:i,onChangeMode:o}=e;const l=AF(),s=(0,b.useMemo)((()=>[{id:fF.Gallery,title:mi().text("Gallery"),Icon:CF()},{id:fF.Details,title:mi().text("Details"),Icon:wF}]),[]);return v().createElement(kj(),{classes:{paper:l.paper},open:t,BackdropProps:{className:l.backdrop},fullScreen:!0},v().createElement(vF(),{classes:{colorPrimary:l.appBar}},v().createElement(OF(),{className:l.toolbar},v().createElement(KI(),{className:l.headerLeft},v().createElement(wd.k,{tooltipTitle:mi().text("Close"),onClick:i,className:l.closeButton,iconClassName:l.closeIcon,icon:_p()}),null==a?void 0:a.left),v().createElement(KI(),{className:l.headerCenter},v().createElement(zE,{modes:s,modeId:r,onChange:o,className:l.modeSwitcher})),v().createElement(KI(),{className:l.headerRight},null==a?void 0:a.right))),v().createElement(EF(),{className:l.content},n))},_F=(0,kp.Z)((()=>({root:{padding:"0 24px",overflowY:"auto",height:"calc(100vh - 64px)"},item:{padding:"2px"}}))),IF=e=>{let{items:t,selectedItems:r,onSelectImage:n,onDeselectImage:a,onShareLink:i,onSetAsDefault:o,onDownload:l,onClickImage:s,onDelete:c}=e;const u=_F(),p=e=>v().createElement(Dj,{id:e,selected:r.includes(e),selectionMode:0!==r.length,onSelect:()=>n(e),onDeselect:()=>a(e),onShareLink:()=>i(e),onSetAsDefault:()=>o(e),onDownload:()=>l(e),onClick:()=>s(e),onDelete:c?()=>c(e):void 0,canBeSelected:!0});return v().createElement(KI(),{className:u.root},v().createElement(wk(),{container:!0},t.map((e=>{let{id:t,src:r}=e;return v().createElement(wk(),{key:t,classes:{item:u.item},item:!0},v().createElement(bk,{size:fk.LARGE,onClick:()=>s(t),src:r,overlay:p(t)}))}))))},NF=(0,kp.Z)((e=>({selectButton:{fontSize:"14px",fontWeight:500,color:e.palette.primary.main,textTransform:"uppercase"}}))),DF=e=>{let{selectedItems:t,items:r,onSelectAll:n,onClearAll:a}=e;const i=NF(),o=t.length===r.length;return v().createElement(uy(),{component:"button",underline:"none",classes:{button:i.selectButton},onClick:o?a:n},o?mi().text("Clear selection"):mi().text("Select all images"))};var PF=r(70997),kF=r.n(PF);const LF=(0,kp.Z)((()=>({downloadButton:{color:"#fff",fontSize:"24px",marginLeft:"30px"},shareButton:{color:"#fff",fontSize:"24px",marginLeft:"21px"},deleteButton:{color:"#fff",fontSize:"24px",marginLeft:"24px"},divider:{height:"31px",width:"1px",marginLeft:"10px",backgroundColor:"rgba(255,255,255,0.38)"}}))),UF=e=>{let{onDownload:t,onShare:r,onUpload:n,onDelete:a}=e;const i=LF();return v().createElement(v().Fragment,null,n&&v().createElement(nE(),{variant:"contained",color:"primary",onClick:n,startIcon:v().createElement(Oj(),null)},mi().text("Upload")),t&&n&&v().createElement("div",{className:i.divider}),t&&v().createElement(wd.k,{className:i.downloadButton,tooltipTitle:mi().text("Download selected items"),icon:Cj,onClick:t}),r&&v().createElement(wd.k,{className:i.shareButton,tooltipTitle:mi().text("Copy link"),icon:kF(),onClick:r}),a&&v().createElement(wd.k,{className:i.deleteButton,tooltipTitle:mi().text("Delete selected items"),icon:tL(),onClick:a}))},jF=e=>{let{attributeValues:t,open:r,onClose:n,currentAttributeValueUri:a,setCurrentAttributeValueUri:i,attributeType:o,onDownload:l,onShareLink:s,onSetAsDefault:c,onUpload:u,onDeleteAttribute:p}=e;const[d,m]=(0,b.useState)([]),[g,y]=(0,b.useState)(fF.Gallery),f=(0,w.xH)();(0,b.useEffect)((()=>{y(a?fF.Details:fF.Gallery)}),[a]);const h=t.map((e=>({src:(0,x.getImageAttributeOvThumbnailUrl)(e),downloadURL:(0,x.getImageAttributeOvUrl)(e),id:e.uri}))),E=e=>{s(h.find((0,_.propEq)("id",e)).downloadURL)},T=e=>{const r=t.find((t=>{let{uri:r}=t;return r===e}));c(r)},O=e=>{p({uri:e,attributeType:o})},{canCreate:C,canDelete:S}=(0,b.useContext)(Fk),A=g===fF.Gallery,R=g===fF.Details,I=d.length>0,N=R||A&&I,D=()=>A?d:[a],P=D().every((e=>(0,x.isTempUri)(e)||S)),k=!f&&N&&P,L=!f&&C&&(R||A&&!I),U=A&&I&&v().createElement(DF,{items:h,selectedItems:d,onClearAll:()=>{m([])},onSelectAll:()=>{m((0,_.pluck)("id",h))}}),j=v().createElement(UF,{onDelete:k?()=>{D().forEach((e=>{O(e)})),d.length&&m([])}:void 0,onDownload:N?()=>{const e=A?(0,_.pipe)((0,_.filter)((e=>{let{id:t}=e;return d.includes(t)})),(0,_.pluck)("downloadURL"))(h):[h.find((0,_.propEq)("id",a)).downloadURL];l(e)}:void 0,onShare:R?()=>{E(a)}:void 0,onUpload:L?u:void 0});return v().createElement(RF,{mode:g,open:r,onChangeMode:y,header:{left:U,right:j},onClose:n},A&&v().createElement(IF,{items:h,selectedItems:d,onSelectImage:e=>{m((t=>[...t,e]))},onDeselectImage:e=>{m((t=>t.filter((t=>t!==e))))},onShareLink:E,onSetAsDefault:T,onDownload:e=>{l([h.find((0,_.propEq)("id",e)).downloadURL])},onClickImage:e=>{i(e),y(fF.Details)},onDelete:f?void 0:O}),R&&v().createElement(yF,{handleSetAsDefault:T,setCurrentAttributeValueUri:i,currentAttributeValueUri:a,attributeValues:t,attributeType:o}))},FF=(0,kp.Z)((e=>({imageBox:{position:"relative",display:"flex",width:"100%",flexGrow:1,flexShrink:0,flexWrap:"nowrap",marginTop:"2px",overflow:"hidden"},moreButtonContainer:e=>{let{imageWidth:t,imageHeight:r}=e;return{backgroundColor:"white",width:t,height:r,position:"absolute",right:0,cursor:"pointer"}},moreButton:t=>{let{imageWidth:r,imageHeight:n}=t;return{display:"flex",justifyContent:"center",alignItems:"center",width:r,height:n,backgroundColor:(0,Lm.alpha)(e.palette.primary.main,.06)}},number:{color:e.palette.primary.main,fontSize:"24px",lineHeight:"42px",letterSpacing:0,textAlign:"center",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}})));function MF(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const VF=e=>{let{attributeType:t,attributeValues:r=[],renderImage:n,overlay:a=!1,countFixedItems:i=0,children:o,onUpload:l,onDeleteAttribute:s,imageSize:c=vk,paging:u,parentUri:p,showNonOv:d,requestNextPageOfAttributeValues:m}=e;const g=FF(c);(0,b.useEffect)((()=>{if(u&&m){const e=d?u.totalOvValues:u.totalValues;e>r.length&&m({parentUri:p,attributeTypeUri:t.uri,attributeTypeName:t.name,values:[],defaultMaxValues:e})}}),[u,m,t,p,r.length,d]);const y=(0,b.useRef)(),[f,h]=(0,b.useState)(0),[E,T]=(0,b.useState)(0),O=(0,b.useContext)(ZI),[C,S]=(0,b.useState)(!1),[A,R]=(0,b.useState)(),_=(0,w.ax)("setDefaultProfilePicForEntity"),I=(0,w.ax)("setDefaultProfilePicForModifiedEntity"),N=(0,w.eh)()||{},D=(0,w.xH)(),P=(0,b.useCallback)((e=>{const{imageMargin:t,imageWidth:n}=c,a=Math.floor((e+t)/(n+t))-i,o=e+t-(a+i)*(n+t)<8;h(a),r.length>a?T(r.length-a+(o?1:0)):T(0)}),[r.length,i,c]),k=(0,b.useCallback)((e=>{P(e),y.current=e}),[P]);(0,b.useEffect)((()=>{y.current&&P(y.current)}),[r.length,P]);const L=(0,b.useCallback)((e=>{O||(R(e),S(!0))}),[O]),U=(0,b.useCallback)((()=>{S(!1)}),[]),j=e=>(e=>{e.forEach(((e,t)=>{try{if((e=>!!(e=>e.indexOf("://")>0||0===e.indexOf("//"))(e)&&new URL(e).host!==location.host)(e)){const r=document.createElement("iframe");r.setAttribute("style","display: none;"),r.setAttribute("src",e),document.body.appendChild(r),setTimeout((()=>document.body.removeChild(r)),3e4*(t+1))}else{const t=document.createElement("a");t.href=e,t.download=(e=>e.split("/").pop())(e),document.body.appendChild(t),t.click(),document.body.removeChild(t)}}catch(e){console.error(e)}}))})(e),F=e=>navigator.clipboard.writeText(e),M=(0,b.useCallback)((e=>{D?(0,x.insertDefaultImageByAttrUri)(N.uri,e.uri).then((t=>{let{status:r}=t;"success"===r&&_(e)})):I({entityUri:N.uri,value:e})}),[D,N.uri,_,I]),V=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){MF(e,t,r[t])}))}return e}({onOpenImageGalleryDialog:L},a&&{onDownload:j,onShareLink:F,onSetAsDefault:M});return v().createElement(v().Fragment,null,v().createElement(Gp.Z,{handleWidth:!0,onResize:k}),v().createElement(jF,{attributeValues:r,open:C,onClose:U,setCurrentAttributeValueUri:R,currentAttributeValueUri:A,attributeType:t,onDownload:j,onShareLink:F,onSetAsDefault:M,onUpload:l,onDeleteAttribute:s}),v().createElement("div",{className:g.imageBox},o,r.slice(0,f).map(n(V)),E>0&&v().createElement("div",{className:g.moreButtonContainer},v().createElement("div",{className:g.moreButton,onClick:()=>L()},v().createElement(Ag(),{className:g.number},`+${E}`)))))},BF=(0,kp.Z)((e=>({image:e=>{let{imageMargin:t,imageHeight:r,imageWidth:n}=e;return{marginRight:t,width:n,height:r,cursor:"pointer","&:last-child":{marginRight:0}}},deleteAttributeImage:{position:"relative","&:before":{content:"''",position:"absolute",left:0,top:0,right:0,bottom:0,background:`url('${(0,x.svg2Url)('<svg xmlns="http://www.w3.org/2000/svg" style="stroke: #D1051E; stroke-width: 1" viewBox="0 0 114 114">\n\t<line x1="5" y1="109" x2="109" y2="5" />\n</svg>')}') no-repeat`,backgroundColor:x.historyPalettes[x.HistoryOperations.deleteAttribute].backgroundColor,pointerEvents:"none"}},updateAttributeImage:{position:"relative","&:before":{content:"''",position:"absolute",left:0,top:0,right:0,bottom:0,backgroundColor:x.historyPalettes[x.HistoryOperations.updateAttribute].backgroundColor,pointerEvents:"none"}},deleteAttribute:e=>{let{imageWidth:t,imageHeight:r}=e;return{width:t,height:r,boxSizing:"border-box",outline:`3px solid ${x.historyPalettes[x.HistoryOperations.deleteAttribute].color}`,outlineOffset:"-3px"}},insertAttribute:e=>{let{imageWidth:t,imageHeight:r}=e;return{width:t,height:r,boxSizing:"border-box",outline:`3px solid ${x.historyPalettes[x.HistoryOperations.insertAttribute].color}`,outlineOffset:"-3px"}},updateAttribute:e=>{let{imageWidth:t,imageHeight:r}=e;return{width:t,height:r,boxSizing:"border-box",outline:`3px solid ${x.historyPalettes[x.HistoryOperations.updateAttribute].color}`,outlineOffset:"-3px"}},number:{color:e.palette.primary.main,fontSize:"24px",lineHeight:"42px",letterSpacing:0,padding:"36px 8px",textAlign:"center",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}}))),zF=e=>{let{attributeType:t,attributeValues:r=[],paging:n,parentUri:a,requestNextPageOfAttributeValues:i,showNonOv:o,imageSize:l=vk}=e;const s=BF(l),{appearance:c}=(0,b.useContext)(ND);return v().createElement(VF,{attributeValues:r,attributeType:t,renderImage:e=>{let{onOpenImageGalleryDialog:t}=e;return e=>{const r=(0,x.getImageAttributeOvThumbnailUrl)(e),{uri:n}=e,a=(0,x.getHistoryAppearanceByUri)(n,c),i=(0,x.getHistoryAttributeClassName)(a);return v().createElement("div",{className:O()(s.image,{[s[i+"Image"]]:i}),key:n,"data-reltio-id":"reltio-attribute-value"},v().createElement(bk,{onClick:()=>t(n),className:s[i],src:r,size:{imageWidth:l.imageWidth,imageHeight:l.imageHeight}}))}},imageSize:l,requestNextPageOfAttributeValues:i,paging:n,parentUri:a,showNonOv:o})},HF=e=>{let{attributeType:t,attributeValues:r,paging:n,parentUri:a,showNonOv:i,requestNextPageOfAttributeValues:o}=e;const l=BP(),{label:s,description:c}=t;return v().createElement(v().Fragment,null,v().createElement("div",{className:l.titleRow},v().createElement(ED,{className:l.title,label:s,"data-reltio-id":"reltio-attribute-label"}),v().createElement(AD,{className:l.descriptionIcon,description:c})),v().createElement(zF,{attributeValues:r,attributeType:t,paging:n,parentUri:a,requestNextPageOfAttributeValues:o,showNonOv:i}))},YF="oneLine",WF="multiLine",GF="imageLine",qF="special",ZF=(0,b.memo)((e=>{var t;let{values:r,attributeType:n,drawLines:a,paging:i={},parentUri:o,max:l,titleClassName:s,contentClassName:c,showNonOv:u}=e;const p=MP(),d=(0,w.ax)("requestNextPageOfAttributeValues"),m=(0,w.vd)(),g=null!==(t=null!=l?l:m)&&void 0!==t?t:1/0,y=(0,_.partition)(x.isOv);if(!r||!r.length)return null;const[f,h]=y(r),E=u?r:f,b=u?[]:h,T=u?"totalValues":"totalOvValues",C=(0,_.ifElse)((0,_.has)(T),(0,_.prop)(T),(0,_.always)(E.length))(i),S=null!=i&&i.totalValues?i.totalValues-C:b.length,A=1===C&&!(0,x.isComplexAttribute)(n);return v().createElement(sN,{enabled:a,className:O()({[p.paddingWrapperWithLines]:a})},v().createElement("div",{className:O()({[p.paddingWrapper]:!a})},(()=>{switch((0,_.cond)([[x.isSpecialAttribute,(0,_.always)(qF)],[x.isImage,(0,_.always)(GF)],[(0,_.always)(A),(0,_.always)(YF)],[_.T,(0,_.always)(WF)]])(n)){case YF:return v().createElement(zP,{value:E[0],nonVisibleValues:b,totalNonVisibleValues:S,attributeType:n,titleClassName:s,contentClassName:c,showNonOv:u});case WF:return v().createElement(XP,{values:E,nonVisibleValues:b,totalVisibleValues:C,totalNonVisibleValues:S,attributeType:n,parentUri:o,max:g,requestNextPageOfAttributeValues:d,titleClassName:s,contentClassName:c,showNonOv:u});case GF:return v().createElement(HF,{attributeValues:E,attributeType:n,paging:i,parentUri:o,requestNextPageOfAttributeValues:d,showNonOv:u});case qF:return v().createElement(pk,{values:E,attributeType:n})}})()))})),$F=e=>{let{attrTypes:t=[],entity:r,parentUri:n,drawLines:a,children:i,className:o,max:l,alwaysVisibleTypeUris:s=kL,showNonOv:c}=e;const u=(0,b.useContext)(jL),p=n&&(0,x.getBaseUri)(n),d=(0,b.useMemo)((()=>u[p]||[]),[u,p]),m=(0,b.useMemo)((()=>(t||[]).filter((e=>!d.includes(e.uri)))),[t,d]),[g,y]=(0,b.useState)(l||1/0),f=(0,b.useMemo)((()=>(0,x.getAttributesListForReadMode)(m,r,c)),[m,r,c]),[h,E]=(0,b.useMemo)((()=>pL(s,f)),[f,s]),T=E.slice(0,g),O=l&&T.length<E.length,C=l&&T.length>=E.length&&l<T.length,S={enabled:a};return v().createElement("div",{className:o},i&&v().createElement(sN,S,i),T.concat(h).map((e=>{let{attrType:t,values:i}=e;return v().createElement(ZF,{key:t.uri,attributeType:t,drawLines:a,values:i,paging:(0,_.path)(["paging",t.uri],r.attributes),parentUri:n,showNonOv:c})})),O&&v().createElement(GP,{onClick:()=>{y(1/0)}}),C&&v().createElement(KP,{onClick:()=>{y(l)}}))};$F.displayName="ReadOnlyAttributesList";const KF=(0,b.memo)($F),XF=(0,kp.Z)({attributesContainer:{padding:"8px 16px"},noCaption:{paddingTop:"16px"},noData:{fontSize:"13px",color:"rgba(0,0,0,0.54)"}}),QF=e=>{let{className:t,entity:r={},caption:n="",excludeUris:a=[],includeUris:i=[],attributesCount:o}=e;const l=XF(),s=(0,w.AH)(),c=(0,w.xK)(),u=(0,b.useMemo)((()=>uL(s,r.type,i,a)),[a,i,s,r]),p=o||16,d=(0,x.getAttributesListForReadMode)(u,r).filter((e=>{let{values:t}=e;return!(0,x.isEmptyValue)(t)})).length>0;return d||!(0,x.isEmptyValue)(n)?v().createElement(XI.Provider,{value:c},v().createElement(aN,{className:t},n&&v().createElement(iN.I,{title:n}),v().createElement(KI(),{className:O()(l.attributesContainer,{[l.noCaption]:!n})},d?v().createElement(KF,{entity:r,attrTypes:u,parentUri:r.uri,drawLines:!1,max:p}):v().createElement(Ag(),{className:l.noData},mi().text("No data found"))))):null},JF=(0,kp.Z)({attributesContainer:{overflow:"hidden",padding:"8px 16px"},noCaption:{paddingTop:"16px"}}),eM=e=>{let{className:t,mode:r,entity:n,caption:a="",excludeUris:i=[],includeUris:o=[],pinnedAttributes:l}=e;const s=JF(),c=(0,w.ax)("addAttributes"),u=(0,w.ax)("modifyAttribute"),p=(0,w.ax)("removeAttribute"),d=(0,w.AH)(),m=(0,w.R2)(),g=(0,w.vc)(n.uri)||{},y=(0,b.useMemo)((()=>(0,x.getPinnedAttributesForUser)(l,m)),[l,m]),f=(0,b.useMemo)((()=>uL(d,g.type,o,i)),[i,o,d,g.type]);return v().createElement(aN,{className:t},a&&v().createElement(iN.I,{title:a}),v().createElement(KI(),{className:O()(s.attributesContainer,{[s.noCaption]:!a})},v().createElement(LL.Provider,{value:y},v().createElement(VL,{entity:g,attrTypes:f,parentUri:g.uri,drawLines:!1,mode:r,showEmptyEditors:(0,x.isTempUri)(g.uri),crosswalks:g.crosswalks,onAddAttributes:c,onChangeAttribute:u,onDeleteAttribute:p}))))};function tM(){return tM=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},tM.apply(this,arguments)}const rM=e=>{let{attributesCount:t,pinnedAttributes:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributesCount","pinnedAttributes"]);const a=(0,w.Fr)(),i=(0,w.YA)(),o=n.entity||a,l=n.mode||i;return v().createElement(bD.Provider,{value:o},(0,x.isViewMode)(l)?v().createElement(QF,tM({},n,{attributesCount:t,entity:o})):v().createElement(eM,tM({},n,{mode:l,pinnedAttributes:r,entity:o})))},nM=(0,kp.Z)((()=>({container:{display:"flex",flexDirection:"column",height:"100%"},scrollWrapper:{flexGrow:1,overflowY:"auto",backgroundColor:"#FAFAFA"},attributesView:{margin:"16px"},emptyState:{height:"100%",backgroundColor:"#FAFAFA"},profileBand:{paddingLeft:48,backgroundColor:"rgba(0,114,206,0.06)"}}))),aM=()=>{const e=nM(),t=(0,Tp.useSelector)(oc),r=(0,Tp.useSelector)(ac);return v().createElement(v().Fragment,null,r&&v().createElement(LE.z,null),t?v().createElement("div",{className:e.container},v().createElement(qI,{entity:t,classes:{profileBand:e.profileBand}}),v().createElement("div",{className:e.scrollWrapper},v().createElement(ZI.Provider,{value:!0},v().createElement(rM,{className:e.attributesView,entity:t,mode:x.Mode.Viewing})))):v().createElement("div",{className:e.emptyState},v().createElement(kE,{LogoRenderer:PE.NO_DATA,text:mi().text("No data to display."),secondaryText:mi().text("Select a profile and view preview details here."),variant:DE.embedded})))},iM="circle",oM="polygon",lM={fillColor:"rgb(242,82,82)",fillOpacity:.1,strokeWeight:2,strokeColor:"#F25252",clickable:!1,editable:!0,zIndex:1},sM={mapTypeControl:!1,streetViewControl:!1,fullscreenControl:!1},cM=.001,uM=v().createContext({});uM.displayName="EntityMarkerContext";var pM=r(17871);const dM=(0,kp.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"}}}}))),mM=e=>{let{entity:t,classes:r={}}=e;const n=dM(),{secondaryLabel:a,label:i}=r,o=(0,x.getLabel)(t.label),{secondaryLabel:l}=t,s=(0,b.useCallback)((()=>{navigator.clipboard.writeText((0,x.getEntityId)(t))}),[t]);return v().createElement(v().Fragment,null,v().createElement(A,{entity:t,imageClassName:n.image}),v().createElement("div",{className:n.info},v().createElement(qd,{value:(0,x.getEntityUriForLink)(t),className:n.link},v().createElement(gd.Y,{value:o,placement:"top",showOnExceededHeight:!0},v().createElement("div",{className:O()(n.label,i)},o))),l&&v().createElement(gd.Y,{value:l,placement:"top",showOnExceededHeight:!0},v().createElement("div",{className:O()(n.secondaryLabel,a)},l)),v().createElement("div",{className:n.thirdRow},v().createElement(EE,{entity:t,size:"medium"}),v().createElement("div",{className:n.entityId,onClick:s},v().createElement("div",{className:n.entityIdLabel},mi().text("ID:")),v().createElement(gd.Y,{value:`Copy to clipboard ${(0,x.getEntityId)(t)}`,placement:"top"},v().createElement("div",{className:n.entityIdValue},(0,x.getEntityId)(t)))))))},gM=(0,kp.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)"}}),yM=()=>{const e=gM();return v().createElement(v().Fragment,null,v().createElement("div",{className:O()(e.avatar,e.wave)}),v().createElement("div",{className:e.info},v().createElement("div",{className:O()(e.label,e.wave)}),v().createElement("div",{className:O()(e.secondaryLabel,e.wave)}),v().createElement("div",{className:O()(e.thirdRow,e.wave)})))},fM=(0,kp.Z)({container:{display:"flex",padding:"16px",overflow:"hidden"}});function hM(){return hM=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hM.apply(this,arguments)}const EM=(0,b.memo)((e=>{let{entity:t,classes:r={},variant:n="normal"}=e,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["entity","classes","variant"]);const i=fM(),{container:o}=r;return v().createElement("div",hM({className:O()(i.container,o)},a),"normal"===n?v().createElement(mM,{entity:t,classes:r}):v().createElement(yM,null))})),bM=(0,kp.Z)({popper:{maxWidth:"263px",minWidth:"150px",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)",backgroundColor:"white",borderRadius:"2px"}});function vM(){return vM=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vM.apply(this,arguments)}const TM=(0,x.svg2Url)('<?xml version="1.0" encoding="UTF-8"?>\n<svg width="22px" height="32px" viewBox="0 0 22 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>View / Map / Marker / Large (hover)</title>\n <defs>\n <radialGradient cx="50%" cy="50.2950175%" fx="50%" fy="50.2950175%" r="49.7049825%" gradientTransform="translate(0.500000,0.502950),scale(0.777778,1.000000),rotate(90.000000),scale(1.000000,1.293560),translate(-0.500000,-0.502950)" id="radialGradient-1">\n <stop stop-color="#000000" offset="0%"></stop>\n <stop stop-color="#000000" stop-opacity="0" offset="100%"></stop>\n </radialGradient>\n <path d="M21,0 C21.5522847,-1.01453063e-16 22,0.44771525 22,1 L22,21 C22,21.5522847 21.5522847,22 21,22 L15.7283832,22.0012846 C15.5422129,22.2445529 15.3664776,22.4802332 15.1984183,22.7122576 C13.7560833,24.7035592 13,26.2846074 13,27.5 L13,27.5 L12.9945143,27.6492623 C12.9181651,28.6841222 12.0543618,29.5 11,29.5 C9.8954305,29.5 9,28.6045695 9,27.5 L9,27.5 L8.99485006,27.3298651 C8.91582184,26.0024976 7.93016704,24.2171459 6.23940611,22.000704 L1,22 C0.44771525,22 6.76353751e-17,21.5522847 0,21 L0,1 C-6.76353751e-17,0.44771525 0.44771525,1.01453063e-16 1,0 L21,0 Z" id="path-2"></path>\n </defs>\n <g id="View-/-Map-/-Marker-/-Large-(hover)" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <ellipse id="Oval" fill="url(#radialGradient-1)" opacity="0.32" cx="11" cy="28.5" rx="6" ry="4.66666667"></ellipse>\n <mask id="mask-3" fill="white">\n <use xlink:href="#path-2"></use>\n </mask>\n <use id="Path-2" fill="#FFFFFF" xlink:href="#path-2"></use>\n <rect id="Entity-type" fill="#24A8E8" mask="url(#mask-3)" x="0" y="0" width="22" height="32"></rect>\n <path d="M20,2 L20,20 L14.755,20 L14.6905172,20.0815309 C14.3562717,20.5012516 14.0578656,20.8886742 13.7817711,21.2616986 L13.5786724,21.5390469 C11.92787,23.8181606 11.079024,25.6311217 11.0052669,27.2674145 L11.0052669,27.2674145 L11,27.5 L10.9968324,27.3203844 C10.9285422,25.3781621 9.75347502,23.1598866 7.22124201,20.0010865 L2,20 L2,2 L20,2 Z" id="Path" fill="#FFFFFF" fill-rule="nonzero" mask="url(#mask-3)"></path>\n </g>\n</svg>'),OM=(0,x.svg2Url)('<?xml version="1.0" encoding="UTF-8"?>\n<svg width="22px" height="32px" viewBox="0 0 22 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>View / Map / Marker / Large</title>\n <defs>\n <radialGradient cx="50%" cy="50.2950175%" fx="50%" fy="50.2950175%" r="49.7049825%" gradientTransform="translate(0.500000,0.502950),scale(0.777778,1.000000),rotate(90.000000),scale(1.000000,1.293560),translate(-0.500000,-0.502950)" id="radialGradient-1">\n <stop stop-color="#000000" offset="0%"></stop>\n <stop stop-color="#000000" stop-opacity="0" offset="100%"></stop>\n </radialGradient>\n <path d="M20,1 C20.5522847,1 21,1.44771525 21,2 L21,20 C21,20.5522847 20.5522847,21 20,21 L15.2374606,21.0021908 C14.9306693,21.3935449 14.6510143,21.7632851 14.3885453,22.1256523 C12.8309725,24.2760522 12,26.0137017 12,27.5 C12,28.0522847 11.5522847,28.5 11,28.5 C10.4477153,28.5 10,28.0522847 10,27.5 C10,25.7886708 8.84033182,23.6810997 6.73798027,21.0014567 L2,21 C1.44771525,21 1,20.5522847 1,20 L1,2 C1,1.44771525 1.44771525,1 2,1 L20,1 Z" id="path-2"></path>\n </defs>\n <g id="View-/-Map-/-Marker-/-Large" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <ellipse id="Oval" fill="url(#radialGradient-1)" opacity="0.12" cx="11" cy="28.5" rx="4.5" ry="3.5"></ellipse>\n <path d="M21,0 C21.5522847,-1.01453063e-16 22,0.44771525 22,1 L22,21 C22,21.5522847 21.5522847,22 21,22 L15.7283832,22.0012846 C15.5422129,22.2445529 15.3664776,22.4802332 15.1984183,22.7122576 C13.7560833,24.7035592 13,26.2846074 13,27.5 L13,27.5 L12.9945143,27.6492623 C12.9181651,28.6841222 12.0543618,29.5 11,29.5 C9.8954305,29.5 9,28.6045695 9,27.5 L9,27.5 L8.99485006,27.3298651 C8.91582184,26.0024976 7.93016704,24.2171459 6.23940611,22.000704 L1,22 C0.44771525,22 6.76353751e-17,21.5522847 0,21 L0,1 C-6.76353751e-17,0.44771525 0.44771525,1.01453063e-16 1,0 L21,0 Z" id="Path-3" fill="#FFFFFF"></path>\n <mask id="mask-3" fill="white">\n <use xlink:href="#path-2"></use>\n </mask>\n <use id="Path-2" fill="#FFFFFF" fill-rule="nonzero" xlink:href="#path-2"></use>\n <rect id="Entity-type" fill="#24A8E8" mask="url(#mask-3)" x="0" y="0" width="22" height="32"></rect>\n </g>\n</svg>'),xM=(0,b.memo)((e=>{let{marker:t,onClick:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["marker","onClick"]);const a=bM(),i=(0,b.useRef)(),[o,l]=(0,b.useState)(!1),{activeEntityUri:s}=(0,b.useContext)(uM),c=(0,_.pathEq)(["entity","uri"],s,t),u={lat:t.point.lat,lng:t.point.lng},p=(0,b.useCallback)((0,x.debounce)(l,50),[]),d=(0,b.useCallback)((()=>p(!0)),[p]),m=(0,b.useCallback)((()=>p(!1)),[p]),g=(0,b.useCallback)((()=>r(t)),[r,t]);return v().createElement(v().Fragment,null,v().createElement(CN.r,{anchorEl:i.current,open:o,className:a.popper,modal:!1,placement:"top"},v().createElement(EM,{entity:t.entity,onMouseOver:d,onMouseOut:m})),v().createElement(pM.Jx,vM({icon:{url:o||c?TM:OM,scaledSize:new google.maps.Size(22,32)},position:u,onClick:g,visible:!1!==t.visible,onMouseOver:d,onMouseOut:m},n)),v().createElement(pM.vD,{options:{alignBottom:!0,pane:"mapPane",pixelOffset:new google.maps.Size(0,-40),closeBoxURL:"",enableEventPropagation:!0,disableAutoPan:!0},position:u},v().createElement("span",{ref:i})))}));var CM=r(47111);const SM=e=>{let{children:t,className:r,position:n,map:a}=e;const[i,o]=(0,b.useState)(null);return(0,b.useEffect)((()=>{const e=document.createElement("div"),t=a.controls[n].length;return a.controls[n].push(e),o(e),()=>{a.controls[n].removeAt(t)}}),[a,n]),(0,b.useEffect)((()=>{i&&r&&i.classList.add(r)}),[r,i]),i?(0,CM.createPortal)(t,i):null};var wM=r(518),AM=r.n(wM);function RM(){return RM=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},RM.apply(this,arguments)}const _M=e=>v().createElement("svg",RM({width:18,height:18,viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgRadius"},e),v().createElement("path",{d:"M10.61 8.568A1.666 1.666 0 119.432 7.39l3.656-3.657a6.668 6.668 0 101.179 1.179L10.61 8.568zm-7.503 6.325A8.333 8.333 0 1114.893 3.107 8.333 8.333 0 013.107 14.893z",fill:"#000",stroke:"none",strokeWidth:1,fillRule:"evenodd",opacity:.54}));function IM(){return IM=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},IM.apply(this,arguments)}const NM=e=>v().createElement("svg",IM({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","data-reltio-id":"SvgDraw"},e),v().createElement("defs",null,v().createElement("path",{d:"M18.29 11.44a1.49 1.49 0 012.12 0l1.15 1.15c.59.58.59 1.53 0 2.12L16.27 20H13v-3.27zM18.174 4c0 1.71-.26 3.285-.932 4.563-.946 1.798-2.609 2.724-4.906 2.46l-.855-.116c-4.382-.544-6.626.53-6.626 3.609 0 1.968 1.105 2.924 3.267 3.304.692.121 1.306.165 2.234.176L11 18v2l-.698-.003c-1.016-.013-1.71-.063-2.526-.206-3.018-.53-4.921-2.176-4.921-5.274 0-4.819 3.71-6.378 9.52-5.505 1.575.237 2.506-.255 3.098-1.38.451-.858.666-2.02.697-3.307L16.174 4h2zM18 13.97l-3.45 3.45v1.03h1.03L19.03 15 18 13.97z",id:"Draw_svg__a"})),v().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},v().createElement("mask",{id:"Draw_svg__b",fill:"#fff"},v().createElement("use",{xlinkHref:"#Draw_svg__a"})),v().createElement("g",{mask:"url(#Draw_svg__b)",fill:"#000",fillOpacity:.54},v().createElement("path",{d:"M0 0h24v24H0z"})))),DM=(0,kp.Z)({container:{margin:"2px",display:"flex",alignItems:"center"},button:{color:"rgba(0,0,0,0.54)",padding:0,height:"24px",width:"24px",minWidth:0},icon:{width:"20px",height:"20px"}}),PM=(0,yd.T)(nE()),kM=e=>{let{drawingMode:t,drawingModes:r=[],hasActiveOverlay:n,onDrawingModeChanged:a,onClearOverlay:i}=e;const o=DM(),l=e=>()=>{a(e)};return v().createElement("div",{className:o.container},t||n?v().createElement(PM,{tooltipTitle:mi().text("Clear area"),className:o.button,onClick:n?i:l(null)},v().createElement(AM(),{className:o.icon})):r.map((e=>{const t=(e=>{switch(e){case iM:return _M;case oM:return NM;default:return null}})(e);return v().createElement(PM,{tooltipTitle:mi().text("Draw area"),key:e,className:o.button,onClick:l(e)},v().createElement(t,{className:o.icon}))})))},LM=(0,kp.Z)({container:{height:"28px",marginRight:"7px",marginLeft:0},label:{fontSize:"11px",alignSelf:"center",lineHeight:"13px",marginLeft:"2px",letterSpacing:0},checkbox:{width:"20px",height:"20px",boxSizing:"content-box",padding:"5px","& svg":{width:"16px",height:"16px"}}}),UM=e=>{let{isSearchOnMapMove:t,onChangeIsSearchOnMapMove:r}=e;const n=LM();return v().createElement(Nh(),{classes:{root:n.container,label:n.label},control:v().createElement(Jp(),{checked:t,onChange:e=>{r(e.target.checked)},className:n.checkbox}),label:mi().text("Search as I move the map")})},jM=e=>{const t=e.getBounds(),r=t.getNorthEast(),n=t.getSouthWest(),a=r.lat(),i=r.lng(),o=n.lat(),l=n.lng(),s=[],c=[];if(!(180===i&&-180===l||-180===i&&180===l)){const e=t.getCenter();s.push([a,e.lng()]),c.push([o,e.lng()])}return[[a,i],...s,[a,l],[o,l],...c,[o,i]]},FM=e=>{switch(e){case iM:return window.google.maps.drawing.OverlayType.CIRCLE;case oM:return window.google.maps.drawing.OverlayType.POLYGON;default:return null}},MM=(e,t,r)=>{if(t.path){const n=r||new window.google.maps.LatLngBounds;t.path.forEach((e=>{let{lat:t,lng:r}=e;return n.extend(new window.google.maps.LatLng(t,r))})),e.fitBounds(n)}},VM=(0,kp.Z)({mapControlContainer:{borderRadius:"2px",backgroundColor:"#FFFFFF",boxShadow:"0 1px 3px 0 rgba(0,0,0,0.15)",margin:"10px"}});function BM(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){zM(e,t,r[t])}))}return e}function zM(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const HM=["drawing"],YM=e=>{let{markers:t=[],mapKey:r,defaultZoom:n,defaultCenter:a,loadingElement:i,isSearchOnMapMove:o,isSearchEnabled:l,activeOverlay:s,overlayOptions:c={},drawingModes:u=[],markerClusterer:p,markerClustererOptions:d,mapOptions:m={},mapContainerClassName:g,onMapBoundsChanged:y=_.identity,onOverlayUpdated:f=_.identity,onMarkerClicked:h=_.identity}=e;const E=VM(),{isLoaded:T,loadError:O}=(0,pM.Ji)({googleMapsApiKey:r,libraries:HM}),x=(0,b.useRef)(null),[C,S]=(0,b.useState)(null),[w,A]=(0,b.useState)(null),[R,I]=(0,b.useState)(null);(e=>{let{markers:t,activeOverlay:r,isSearchOnMapMove:n,map:a}=e;const i=Boolean(a&&window.google),o=(0,Ly.D)(t),l=(0,Ly.D)(r),s=(0,Ly.D)(i);(0,b.useEffect)((()=>{const e=o!==t,c=s!==i,u=i&&r&&(l!==r||c);i&&!n&&t.length&&(e||c)?((e,t,r)=>{const n=new window.google.maps.LatLngBounds;if(e.forEach((e=>n.extend(e.point))),1===e.length){const t=e[0].point;n.extend(new window.google.maps.LatLng(t.lat+cM,t.lng+cM)),n.extend(new window.google.maps.LatLng(t.lat-cM,t.lng-cM))}t.fitBounds(n),r&&MM(t,r,n)})(t,a,r):u&&MM(a,r)}),[i,t,r])})({markers:t,activeOverlay:s,map:C,isSearchOnMapMove:o});const N=(0,b.useMemo)((()=>BM({},lM,c)),[c]),D=(0,b.useMemo)((()=>BM({},sM,m)),[m]),P=(0,b.useCallback)((e=>{y(e?jM(C):null),I(null),clearTimeout(x.current)}),[C,y]),k=(0,b.useCallback)((()=>{clearTimeout(x.current)}),[]),L=(0,b.useCallback)((()=>{o&&y(jM(C))}),[o,C,y]),U=(0,b.useCallback)((()=>{o&&(clearTimeout(x.current),x.current=setTimeout(L,1e3))}),[L,o]),j=(0,b.useCallback)(((e,t)=>{var r;const n=t||w&&{type:oM,overlay:w};if((0,_.isEmpty)(n))return;const{overlay:a,type:i}=n,o={[oM]:()=>a.getPath().getArray().map((e=>[e.lat(),e.lng()])),[iM]:()=>({radius:a.getRadius()/1e3,center:a.getCenter()})},l=null===(r=o[i])||void 0===r?void 0:r.call(o);l&&f({data:l,type:i})}),[f,w]),F=(0,b.useCallback)((e=>t=>{j(null,{type:e,overlay:t}),t.setMap(null),I(null)}),[j]),M=(0,b.useCallback)((()=>{f(null)}),[f]),V=e=>t.filter((0,_.prop)("point")).map((t=>v().createElement(xM,{key:t.id,marker:t,clusterer:e,onClick:h})));if(O)return null;if(!T)return i;const B=l&&Boolean(u.length),z=C&&l&&Boolean(u.length),H=C&&l,Y=!FM(R)&&s&&(0,_.propEq)("type",oM,s);return v().createElement(pM.b6,{mapTypeId:window.google.maps.MapTypeId.ROADMAP,options:D,onLoad:S,zoom:n,center:a,onZoomChanged:k,onDragStart:k,onIdle:U,mapContainerClassName:g},z&&v().createElement(SM,{className:E.mapControlContainer,position:window.google.maps.ControlPosition.TOP_RIGHT,map:C},v().createElement(kM,{hasActiveOverlay:!!s,drawingModes:u,drawingMode:R,onDrawingModeChanged:I,onClearOverlay:M})),H&&v().createElement(SM,{className:E.mapControlContainer,position:window.google.maps.ControlPosition.TOP_CENTER,map:C},v().createElement(UM,{onChangeIsSearchOnMapMove:P,isSearchOnMapMove:o})),p?(W=d,v().createElement(pM.XL,{options:W},V)):V(),Y&&v().createElement(pM.mg,{onLoad:A,path:s.path,editable:!0,options:N,onMouseUp:j,onDragEnd:j}),B&&v().createElement(pM.j_,{onPolygonComplete:F(oM),onCircleComplete:F(iM),drawingMode:FM(R),options:{drawingControl:!1,circleOptions:N,polygonOptions:N}}));var W},WM=(e,t)=>Math.abs(e-t)<1,GM=(0,_.curry)(((e,t,r)=>{const n=t.map((t=>{let{position:r}=t;const n=e.find((e=>{let{point:t}=e;return WM(r.lat(),t.lat)&&WM(r.lng(),t.lng)}));return(0,_.propOr)("","label",n)})),a=(n.length>2?n.slice(0,2).concat("..."):n).join("\n");let i=0;const o=t.length.toString();let l=o;for(;0!==l;)l=parseInt(l/10,10),i++;return i=Math.min(i,r),{text:o,index:i,title:a}})),qM=[],ZM=(0,_.pipe)((0,_.path)(["point","lat"]),(0,_.both)((0,_.gt)(90),(0,_.lt)(-90))),$M={[x.MapSearch.geoPolygon]:oM,[x.MapSearch.geoLocation]:iM},KM=e=>e&&e.length?[...e,e[0]]:e,XM=e=>e[0].map((e=>{let[t,r]=e;return{lat:t,lng:r}})).slice(0,-1),QM=(0,kp.Z)((()=>({container:{height:"100%",width:"100%",position:"relative"},fullHeight:{height:"100%"}}))),JM=()=>{const e=QM(),t=(0,Tp.useSelector)(k().selectors.getMetadata),r=(0,Tp.useSelector)(ui.Qr),n=(0,Tp.useSelector)(ki.AO),a=(0,Tp.useSelector)(k().selectors.getGoogleMapKey),{markers:i,loading:o,onMarkerClicked:l}=(e=>{let{searchResults:t,metadata:r,mapKey:n}=e;t=t||qM;const a=(0,Tp.useDispatch)(),[i,o]=(0,b.useState)([]),[l,s]=(0,b.useState)(!1),c=(0,b.useRef)(),u=(0,b.useRef)(),p=(0,b.useCallback)((e=>{a({type:be,payload:e||null})}),[a]),d=(0,b.useCallback)((()=>{clearTimeout(u.current),clearTimeout(c.current)}),[]);return(0,b.useEffect)((()=>{s(!0),(0,x.resolve)(r,t,n).then((e=>{s(!1),o(e.filter(ZM))})).catch((()=>{s(!1),o([])}))}),[t,r,n]),{markers:i,loading:l,onMarkerClicked:(0,b.useCallback)((e=>{const t=(0,_.path)(["entity","uri"],e);d(),p(),c.current=setTimeout((()=>p(t)),0),u.current=setTimeout(p,3e3)}),[d,p])}})({searchResults:r,metadata:t,mapKey:a}),{isSearchEnabled:s,activeOverlay:c,onOverlayUpdated:u,isSearchOnMapMove:p,onMapBoundsChanged:d}=(()=>{const e=(0,Tp.useDispatch)(),t=(0,Tp.useSelector)(ui.Qy),r=(0,Tp.useSelector)(ui.bt),n=(0,Tp.useSelector)(ki.d7),[a,i]=(0,b.useState)(!1),o=(0,b.useCallback)((t=>{let r=null,n=null;if(t){const{data:e,type:a}=t;switch(a){case iM:{const{center:t,radius:a}=e;r=[t.lng(),t.lat(),a],n=x.MapSearch.geoLocation;break}case oM:r=KM(e),n=x.MapSearch.geoPolygon}}i(!1),e(ri(r,n))}),[e]),l=(0,b.useCallback)((t=>{i(!!t),e(ri(KM(t),t&&x.MapSearch.onMapMove))}),[e]),s=$M[r],c=(0,b.useMemo)((()=>n&&s&&t.length?{path:s===oM?XM(t):null,type:s}:null),[n,t,s]);return(0,b.useEffect)((()=>{(c||0===t.length)&&i(!1)}),[t,c]),{isSearchEnabled:n,onOverlayUpdated:o,activeOverlay:c,isSearchOnMapMove:a,onMapBoundsChanged:l}})(),m=(0,b.useMemo)((()=>v().createElement("div",{className:e.fullHeight},v().createElement(LE.z,null))),[e]),g=(0,b.useMemo)((()=>({gridSize:60,maxZoom:9,calculator:GM(i)})),[i]),y=(0,b.useMemo)((()=>({activeEntityUri:n})),[n]),f=(0,b.useMemo)((()=>({lat:0,lng:0})),[]),h=(0,b.useMemo)((()=>[oM]),[]);return a?v().createElement("div",{className:e.container},o&&v().createElement(LE.z,null),v().createElement(uM.Provider,{value:y},v().createElement(YM,{loadingElement:m,defaultZoom:1,defaultCenter:f,onOverlayUpdated:u,onMarkerClicked:l,activeOverlay:c,markers:i,fullscreenControl:!1,markerClusterer:!0,markerClustererOptions:g,drawingModes:h,isSearchOnMapMove:p,onMapBoundsChanged:d,isSearchEnabled:s,mapContainerClassName:e.fullHeight,mapKey:a}))):null},eV=(0,yd.T)(Pp.T),tV=e=>{switch(e){case K.om.PROFILE:return mi().text("Hide entity details");case K.om.MAP:return mi().text("Hide map")}},rV=()=>{const e=WI(),t=(0,Tp.useDispatch)(),r=(0,Tp.useSelector)(ki.qx),n=r===K.om.MAP,a=(0,Tp.useSelector)(k().selectors.getGoogleMapKey),i=(0,b.useCallback)((()=>t(Ni(null))),[t]);return(0,b.useEffect)((()=>{!a&&n&&i()}),[a,n,i]),v().createElement("div",{className:e.container},v().createElement(eV,{tooltipTitle:tV(r),tooltipPlacement:"bottom-start",size:"L",icon:YI(),className:e.closeButton,onClick:i}),(e=>{switch(e){case K.om.PROFILE:return v().createElement(aM,null);case K.om.MAP:return v().createElement(JM,null)}})(r))},nV=e=>{let{className:t,loading:r,entities:n,entityTypeTab:a,quantity:i,rowsPerPage:o,page:l,entityToHighlight:s,selectedEntityUri:c,mode:u,previewPanelMode:p,isPreviewPanelOpen:d,dispatch:m}=e;const g=jE(),y=(0,b.useRef)(),[f,h]=(0,b.useState)("50%"),E=(0,Pi.gj)(u),T=p===K.om.PROFILE,C=p===K.om.MAP,[S,w]=(0,b.useState)({}),A=(0,b.useCallback)(((e,t)=>{w((0,_.assoc)(e,t))}),[]);(0,b.useEffect)((()=>{y.current&&(y.current.scrollTop=0)}),[n]),(0,b.useEffect)((()=>{T&&((0,x.isEmptyValue)(n)?m(sc(null)):!(0,_.prop)(0,n)||c&&n.map((0,_.prop)("uri")).includes(c)||m(sc(n[0].uri)))}),[m,T,c,n]),(0,b.useEffect)((()=>{!T&&c&&m(cc(null))}),[m,c,T]);const R=(0,b.useCallback)((e=>m(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2?arguments[2]:void 0;return{type:U.Z.CHANGE_PAGE,payload:{pageNumber:e,debounceTime:t,entityTypeUri:r}}}(e,250,a))),[m,a]),I=(0,b.useCallback)((e=>m(((e,t)=>({type:U.Z.CHANGE_ROWS_PER_PAGE,payload:{number:e,entityTypeUri:t}}))(e,a))),[m,a]),N=(0,b.useCallback)((e=>m(sc(e))),[m]),D=(0,b.useCallback)((0,x.debounce)((e=>m({type:ve,payload:e})),50),[m]),P=(0,b.useCallback)((e=>{let{percentageSize:t}=e;return h(t)}),[]),k=e=>{const t=(0,_.prop)(e.uri,S);return v().createElement(Nm,{entity:e,entityImportStatus:t,onEntityImportStatusChange:A})},L=(0,b.useRef)(null);return v().createElement("div",{className:O()(g.container,t)},r&&v().createElement(LE.z,null),(0,Pi.gj)(u)?v().createElement(FI,{quantity:i}):v().createElement(AI,null),v().createElement(fE,{className:g.resizablePanesWrapper,orientation:"vertical",size:d?f:"100%",minSize:480,maxSize:-480,allowResize:d,onChange:P},v().createElement("div",{className:g.pane},v().createElement(UE,{error:v().createElement(kE,{LogoRenderer:PE.ERROR,text:mi().text("Something went wrong."),variant:DE.embedded})},(()=>{const e=s||null;return i?v().createElement("div",{className:E?g.tableContainer:g.listContainer,ref:y},E?v().createElement(zI,{entities:n,entityToHighlight:e,selectedEntityUri:c,entityTypeUri:a,onEntityClick:T?N:void 0,onEntityHover:C?D:void 0,entitiesImportStatus:S,onEntityImportStatusChange:A,basicTableRef:L}):v().createElement(CE,{entities:n,entityToHighlight:e,selectedEntityUri:c,onEntityClick:T?N:void 0,onEntityHover:C?D:void 0,entitiesImportStatus:S,entityButtonsRenderer:k}),i>K.Tu[0]&&v().createElement("div",{className:g.pagination},v().createElement(SE.Z,{count:i,rowsPerPageOptions:K.Tu,rowsPerPage:o||K.Tu[0],page:l||0,onChangePage:R,onChangeRowsPerPage:I,basicTableRef:L}))):v().createElement(kE,{LogoRenderer:PE.SEARCH_RESULTS,text:mi().text("No results found."),secondaryText:mi().text("Try adjusting your search or filter to find what you're looking for."),variant:DE.embedded})})())),v().createElement("div",{className:g.pane},v().createElement(rV,null))))};nV.propTypes={page:vp().number,quantity:vp().number,rowsPerPage:vp().number,entities:vp().array,loading:vp().bool,dispatch:vp().func,entityToHighlight:vp().string,mode:vp().string,entityTypeTab:vp().string,className:vp().string,isPreviewPanelOpen:vp().bool,previewPanelMode:vp().oneOf(Object.values(K.om)),selectedEntityUri:vp().string},nV.defaultProps={quantity:0,entities:[]};const aV=(0,Tp.connect)((e=>{const t=(0,ki.tB)(e);return{quantity:(0,ui.NU)(e,{entityTypeUri:t}),page:(0,ui.fx)(e,{entityTypeUri:t}),rowsPerPage:(0,ui.Uz)(e,{entityTypeUri:t}),entities:(0,ui.BP)(e,{entityTypeUri:t}),loading:(0,ui.gP)(e),entityToHighlight:(0,ki.Dn)(e),mode:(0,ki.XM)(e),entityTypeTab:t,previewPanelMode:(0,ki.qx)(e),isPreviewPanelOpen:(0,ki.jr)(e),selectedEntityUri:ic(e)}}))(nV);var iV=r(4539),oV=r.n(iV),lV=r(4494);const sV=(0,kp.Z)({root:{height:"32px",borderRadius:"18px",backgroundColor:"rgba(0,0,0,0.10)",margin:"4px",maxWidth:"380px",flexShrink:"0",border:"none","&:focus":{"background-color":"rgb(206, 206, 206)"},"&:first-child":{marginLeft:0},"& $deleteIcon":{color:"rgba(0,0,0,0.38)",margin:"0 5px 0 0px",height:"18px",width:"18px"}},deleteIcon:{},label:{paddingLeft:"8px",paddingRight:"8px",overflow:"hidden"},labelContainer:{display:"flex",overflow:"hidden"},title:{color:"rgba(0,0,0,0.67)",marginRight:"6px"},values:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}),cV=e=>{const t=sV(),r=e.values&&e.values.join(", ");return v().createElement(Of(),{label:v().createElement("div",{className:t.labelContainer},e.title&&v().createElement("div",{className:t.title},e.title,": "),e.values&&v().createElement(gd.Y,{value:r},v().createElement("div",{className:t.values},r))),onDelete:e.onDelete,variant:"outlined",deleteIcon:v().createElement(Cf(),{"data-reltio-id":"facet-bar-chip-delete"}),classes:{root:t.root,deleteIcon:t.deleteIcon,label:t.label}})};cV.propTypes={classes:vp().object,title:vp().string,values:vp().array,onDelete:vp().func};const uV=cV;class pV extends b.PureComponent{constructor(){super(...arguments),this.state={anchorEl:null},this.handleClick=e=>{const{currentTarget:t}=e;this.setState((e=>({anchorEl:e.anchorEl?null:t})))},this.handleClose=e=>{e.stopPropagation(),this.setState({anchorEl:null})}}render(){const{classes:e,items:t}=this.props,{anchorEl:r}=this.state,n=Boolean(r),a=n?"moreButtonPopper":null;return v().createElement(b.Fragment,null,v().createElement(nE(),{"aria-describedby":a,color:"primary",variant:"contained",classes:{root:e.root,label:e.label},onClick:this.handleClick},mi().text(`+ ${t.length}`)),v().createElement(CN.r,{id:a,open:n,onClose:this.handleClose,anchorEl:r,placement:"bottom-start"},v().createElement(JI(),{elevation:2,classes:{root:e.popperContent}},this.props.items)))}}pV.propTypes={classes:vp().object,items:vp().array},pV.defaultProps={items:[]};const dV=zg()((()=>({root:{flexShrink:0,minHeight:"32px",opacity:"0.54",padding:"8px",minWidth:"35px",borderRadius:"8px"},label:{fontSize:"13px",lineHeight:"15px"},popperContent:{display:"flex",flexDirection:"column",alignItems:"flex-start",padding:"8px"}})))(pV);var mV=r(74635),gV=r.n(mV),yV=r(60904),fV=r(96177),hV=r.n(fV),EV=r(34319);const bV=(0,kp.Z)({dialogRoot:{minWidth:"600px",minHeight:"280px"},dialogTitle:{paddingTop:"19px"},dialogContentRoot:{paddingTop:"14px",display:"flex",flexDirection:"column"},dialogField:{marginTop:"0px",marginBottom:"24px"},dialogInput:{paddingTop:"21px",paddingBottom:"7px"},dialogFont:{fontSize:"14px"},dialogActions:{padding:"0 8px 8px 0"}});function vV(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){TV(e,t,r[t])}))}return e}function TV(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function OV(){return OV=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},OV.apply(this,arguments)}const xV=e=>{let{isOpen:t,isAvailableUpdate:r,isChangedSavedSearch:n,currentSavedSearch:a,onClose:i,onSave:o,onUpdate:l}=e;const s=bV(),[c,u]=(0,b.useState)(""),[p,d]=(0,b.useState)(K.ib.private),m=r&&a&&c===a.name,g=m&&a.isPublic===(p===K.ib.public)&&!n,y=(0,b.useCallback)((e=>{u(e.target.value)}),[]),f=(0,b.useCallback)((e=>{d(e)}),[]),h=(0,b.useCallback)((()=>m?l({share:p}):o({name:c,share:p})),[c,o,l,p,m]),E={InputProps:{classes:{input:O()(s.dialogInput,s.dialogFont)}},InputLabelProps:{classes:{root:s.dialogFont}}};return(0,b.useEffect)((()=>{if(t){const e=r?a.name:"",t=r&&a.isPublic?K.ib.public:K.ib.private;u(e),d(t)}}),[t,r,a]),v().createElement(kj(),{onClose:i,open:t,PaperProps:{classes:{root:s.dialogRoot}}},v().createElement(gV(),{classes:{root:s.dialogTitle}},mi().text("Save search")),v().createElement(EF(),{classes:{root:s.dialogContentRoot}},v().createElement(yV.H,OV({classes:{root:s.dialogField},label:mi().text("Name"),required:!0,variant:"filled",value:c,onInput:y,size:"small",autoFocus:!0},E)),v().createElement(EV.k,{entries:K.m2,TextFieldProps:vV({classes:{root:s.dialogField},required:!0,label:mi().text("Share with"),variant:"filled",size:"small"},E),value:p,onChange:f})),v().createElement(hV(),{classes:{root:s.dialogActions},disableSpacing:!0},v().createElement(nE(),{onClick:i},mi().text("Cancel")),v().createElement(nE(),{color:"primary",onClick:h,disabled:m?g:0===c.length},m?mi().text("Save"):mi().text("Save as"))))};xV.propTypes={isOpen:vp().bool,isAvailableUpdate:vp().bool,isChangedSavedSearch:vp().bool,currentSavedSearch:vp().object,onClose:vp().func.isRequired,onSave:vp().func.isRequired,onUpdate:vp().func.isRequired};const CV=(0,Tp.connect)((e=>{const t=(0,xo.LA)(e);return{isOpen:(0,ki.jd)(e),isAvailableUpdate:!(0,_.isNil)(t)&&(0,xo.Jv)(e),isChangedSavedSearch:(0,xo.WH)(e),currentSavedSearch:t}}),{onClose:()=>Oi(!1),onSave:e=>({type:ir,payload:e}),onUpdate:e=>({type:sr,payload:e})})(xV);var SV=r(11400);function wV(){return wV=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},wV.apply(this,arguments)}const AV=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",wV({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},r),v().createElement("path",{fill:"#000",fillOpacity:".54",fillRule:"evenodd",d:"M7.596 3.561A5.963 5.963 0 019 3.4c1.164 0 2.195.3 3.093.902l.99-.99a7.287 7.287 0 00-1.353-.76A6.816 6.816 0 009 2c-.74 0-1.447.107-2.12.322l.716 1.239zm-2.007-.675A6.948 6.948 0 002.551 6.27 6.816 6.816 0 002 9c0 .968.184 1.878.551 2.73a7.069 7.069 0 001.497 2.223 7.07 7.07 0 002.222 1.496 6.689 6.689 0 001.73.483v-1.828a6.272 6.272 0 00-.19.356 5.213 5.213 0 01-1.479-.534 5.44 5.44 0 01-1.251-.936 4.848 4.848 0 011.059-.367A5.106 5.106 0 017.25 12.5h.306c.1 0 .219.012.359.035L8 12.451v-1.305a6.4 6.4 0 00-2.308.147 7.568 7.568 0 00-1.487.542 4.735 4.735 0 01-.604-1.33A5.547 5.547 0 013.4 9c0-1.563.542-2.888 1.627-3.973a5.66 5.66 0 011.25-.951l-.688-1.19zm9.86 3.384c.238.552.399 1.129.483 1.73H14.52a5.305 5.305 0 00-1.365-2.781l.98-.98A7.1 7.1 0 0115.45 6.27zm-2.056 1.488c.076.076.145.157.204.242h-2.894c.06-.085.128-.166.205-.242a1.69 1.69 0 011.242-.508c.49 0 .904.17 1.242.508zM9.7 7.6c0 .137-.01.27-.03.4H9a1 1 0 00-1 1v.94c-.235.073-.485.11-.75.11a2.36 2.36 0 01-1.732-.718A2.36 2.36 0 014.8 7.6c0-.677.24-1.254.718-1.732A2.36 2.36 0 017.25 5.15c.677 0 1.254.24 1.732.717A2.36 2.36 0 019.7 7.6zm-1.706.744a1.013 1.013 0 01-.744.306c-.292 0-.54-.102-.744-.306A1.013 1.013 0 016.2 7.6c0-.292.102-.54.306-.744.204-.204.452-.306.744-.306s.54.102.744.306c.204.204.306.452.306.744s-.102.54-.306.744zM22 20.667v-8L19.333 10h-8c-.366 0-.68.13-.941.392a1.284 1.284 0 00-.392.941v9.334c0 .366.13.68.392.941.26.261.575.392.941.392h9.334c.366 0 .68-.13.941-.392.261-.26.392-.575.392-.941zm-4.583-1.25A1.929 1.929 0 0116 20a1.929 1.929 0 01-1.417-.583A1.929 1.929 0 0114 18c0-.556.194-1.028.583-1.417A1.929 1.929 0 0116 16c.556 0 1.028.194 1.417.583.389.39.583.861.583 1.417s-.194 1.028-.583 1.417zm.583-4.75h-6V12h6v2.667z",clipRule:"evenodd"}))},RV=(0,kp.Z)({button:{marginRight:"-4px"},dialogRoot:{minWidth:"600px",minHeight:"280px"},dialogContentRoot:{display:"flex",flexDirection:"column",gap:"20px"}}),_V=()=>{const e=RV(),t=(0,Tp.useStore)(),[r,n]=(0,b.useState)(!1),[a,i]=(0,b.useState)(!1),o=(0,b.useCallback)((()=>n(!1)),[]),l=(0,b.useCallback)((()=>n(!0)),[]),s=(0,b.useCallback)((async(e,r,n)=>{const a=t.getState(),l=(0,So.Z)(a),s=(0,xo.Cc)(a,!0);i(!0);try{await(0,x.createSavedSearch)([{name:e,description:r,isPublic:n,query:s,uiState:l,type:x.SavedSearchType.SEGMENTATION}]),i(!1),o()}catch(e){(0,pi.U)(e,{defaultMessage:mi().text("Something went wrong while saving of the segment")}),i(!1)}}),[t,o]);return v().createElement(v().Fragment,null,v().createElement(wd.k,{icon:AV,size:"L",onClick:l,tooltipTitle:mi().text("Save as segment"),className:e.button}),v().createElement(SV.L,{isOpen:r,isSaving:a,onClose:o,onSave:s}))};function IV(){return IV=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},IV.apply(this,arguments)}const NV=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",IV({xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},r),v().createElement("g",null,v().createElement("path",{fill:"none",d:"M0 0h24v24H0z"})),v().createElement("g",null,v().createElement("path",{fillOpacity:".54",d:"M5 20h14v-2H5v2zM19 9h-4V3H9v6H5l7 7 7-7z"})))};function DV(){return DV=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},DV.apply(this,arguments)}const PV=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",DV({width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},r),v().createElement("defs",null,v().createElement("path",{d:"M17 3H5a2 2 0 00-2 2v14a2 2 0 002 2h14c1.1 0 2-.9 2-2V7l-4-4zm-5 16c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3zm3-10H5V5h10v4z",id:"svg1966704254a"})),v().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},v().createElement("mask",{id:"svg1966704254b",fill:"#fff"},v().createElement("use",{xlinkHref:"#svg1966704254a"})),v().createElement("g",{mask:"url(#svg1966704254b)",fill:"#000",fillOpacity:".54"},v().createElement("path",{d:"M0 0h24v24H0z"}))))};function kV(){return kV=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},kV.apply(this,arguments)}const LV=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",kV({xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},r),v().createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),v().createElement("path",{fillOpacity:".54",d:"M19.35 10.04A7.49 7.49 0 0012 4C9.11 4 6.6 5.64 5.35 8.04A5.994 5.994 0 000 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z"}))};function UV(){return UV=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},UV.apply(this,arguments)}const jV=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",UV({width:"12",height:"24",viewBox:"0 0 12 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},r),v().createElement("defs",null,v().createElement("path",{d:"M6 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z",id:"svg2486556319a"})),v().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},v().createElement("mask",{id:"svg2486556319b",fill:"#fff"},v().createElement("use",{xlinkHref:"#svg2486556319a"})),v().createElement("g",{mask:"url(#svg2486556319b)",fill:"#000",fillOpacity:".54"},v().createElement("path",{d:"M0 0h12v24H0z"}))))};var FV=r(69199),MV=r.n(FV),VV=r(37290),BV=r.n(VV);const zV=e=>navigator.clipboard?navigator.clipboard.writeText(e):(e=>new Promise(((t,r)=>{const n=document.createElement("textarea");n.value=e,n.style.top="0",n.style.left="0",n.style.position="fixed",document.body.appendChild(n),n.focus(),n.select();try{document.execCommand("copy"),t()}catch(e){r(e)}document.body.removeChild(n)})))(e);function HV(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){YV(e,t,r[t])}))}return e}function YV(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const WV=(0,kp.Z)({title:{marginBottom:"-10px"},linkField:{margin:"10px 0"},linkInput:{textOverflow:"ellipsis",fontSize:"14px"}}),GV=e=>{let{open:t,onClose:r=_.identity}=e;const n=WV(),a=(e=>{let{enabled:t}=e;const[r,n]=(0,b.useState)(""),a=(0,Tp.useSelector)(So.Z),i=(0,Tp.useSelector)(ui.RO),o=(0,Tp.useSelector)(k().selectors.getServicesPath),l=(0,Tp.useSelector)(k().selectors.getUIPath);return(0,b.useEffect)((()=>{t?(0,x.rawRequest)(`${o}/searchLink`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(HV({},a,{currentTenant:i}))}).then((0,_.pipe)((0,_.prop)("link"),(0,x.getSearchLink)(l),n)).catch(gi):n("")}),[t]),r})({enabled:t});return v().createElement(kj(),{open:t,onClose:r},v().createElement(gV(),{className:n.title},mi().text("Share link with search results")),v().createElement(EF(),null,v().createElement(MV(),null,mi().text("With the URL link, anyone can view these search results. Paste this link in email or IM for testing, analyze, sharing and more.")),v().createElement(BV(),{className:n.linkField,InputProps:{classes:{input:n.linkInput}},label:a?"URL":"",placeholder:mi().text("Loading URL..."),value:a,variant:"filled",fullWidth:!0,size:"small"})),v().createElement(hV(),null,v().createElement(nE(),{onClick:r},mi().text("Cancel")),v().createElement(nE(),{disabled:!a,onClick:(0,_.pipe)((()=>zV(a)),r),color:"primary",autoFocus:!0},mi().text("Copy link"))))};GV.propTypes={open:vp().bool,onClose:vp().func};const qV=GV,ZV=(0,kp.Z)((()=>({button:{marginRight:"-4px"},exportButtonDisabled:{opacity:"0.54"}}))),$V=e=>{let{customActions:t=[]}=e;const r=ZV(),n=(0,Tp.useDispatch)(),a=(0,Tp.useSelector)(k().selectors.getUIConfig),i=(0,Tp.useSelector)(k().selectors.getCanUserMakeExport),o=(0,Tp.useSelector)(k().selectors.getCanUserOpenDataLoader),l=!!(0,x.findPerspectiveConfig)(x.ScreenType.Segmentation,a),s=!!(0,Tp.useSelector)(ui.lF),{canExport:c}=(0,Tp.useSelector)(ki.MO),u=c&&i,p=(0,b.useCallback)((()=>{n({type:U.Z.EXPORT_RESULTS})}),[n]),d=(0,b.useCallback)((()=>{n({type:U.Z.OPEN_DATA_LOADER})}),[n]),m=(0,Tp.useSelector)(ui.ai),g=(0,b.useCallback)((()=>{n(Oi(!0))}),[n]),y=[],[f]=(()=>{const e=(0,Tp.useSelector)(k().selectors.getCanUserStartProcessFromQuery),t=(0,Tp.useSelector)(k().selectors.getWorkflowPath),r=(0,Tp.useSelector)(k().selectors.getWorkflowEnvironmentUrl),n=(0,Tp.useSelector)(ki.FH),a=(0,Tp.useSelector)(k().selectors.getTenant),i=(0,Tp.useDispatch)(),o=(0,Tp.useSelector)(ui.FR),{globalFilter:l}=(0,Tp.useSelector)(k().selectors.getGlobalSearchRequestOptions),s=(0,Ba._k)(o,[],l),c=(0,b.useCallback)((()=>{const{processType:e}=n;(0,x.startProcessFromQuery)({workflowPath:t,processType:e,searchString:s,tenant:a,environment:r}).then((()=>{i(Ii({message:mi().text("Match reviews successfully submitted. Go to Inbox to view their status."),actionToDispatch:P.ui.actions.openAppFromChocolateBar("Inbox"),actionLabel:mi().text("Go to inbox"),autoHideDuration:null}))})).catch((e=>{gi(e)}))}),[n,t,s,a,r,i]),u=s.includes("matches")||s.includes("matchRules");return[e&&t&&n?{disabled:!u,text:mi().text("Request Match Review"),tooltip:mi().text("Filter on match rules or potential matches to enable Potential Match Review"),onClick:c,id:"-request-match-review"}:null]})();f&&y.push(f);const[h]=(()=>{const e={NO_ENTITY_TYPE:mi().text("Please select exactly one entity type or switch to table mode")},t=(0,Tp.useDispatch)(),r=(0,Tp.useSelector)(ki.MO),n=(0,Tp.useSelector)(k().selectors.getCanUserMakeBulkUpdate),a=!!(0,Tp.useSelector)(ui.lF),i=(0,Tp.useSelector)(ru),o=!!i,l=Boolean(null==r?void 0:r.bulkUpdate),s=(0,Tp.useSelector)(k().selectors.getMetadata),c=(0,Tp.useSelector)(ki.Xf),u=l&&n&&!a?{disabled:!o||!(e=>(0,za.wW)(s,{},c).some((t=>t.value===e)))(i),text:mi().text("Bulk update"),tooltip:o?null:e.NO_ENTITY_TYPE,onClick:()=>t(Di(!0)),id:"-bulk-update"}:null;return[u]})();h&&y.push(h);const[E,T]=(0,b.useState)(!1);return y.push({text:mi().text("Share link"),onClick:()=>T(!0),id:"-share-link"}),y.push(...t),v().createElement(v().Fragment,null,o&&v().createElement(wd.k,{icon:LV,size:"L",onClick:d,tooltipTitle:mi().text("Load data"),className:r.button,"data-reltio-id":"reltio-search-actions-menu-load-data"}),u&&v().createElement(wd.k,{icon:NV,size:"L",onClick:p,tooltipTitle:mi().text("Export"),showForDisabled:!0,classes:{disabled:r.exportButtonDisabled},className:r.button,disabled:s,"data-reltio-id":"reltio-search-actions-menu-export"}),v().createElement(wd.k,{tooltipTitle:mi().text("Save"),showForDisabled:!0,className:O()({[r.button]:y.length>0}),disabled:!m,onClick:g,icon:PV,size:"L","data-reltio-id":"reltio-search-actions-menu-save"}),l&&v().createElement(_V,null),y.length>0&&v().createElement(LN,{buttonComponent:Pp.T,buttonProps:{icon:jV,size:"L","data-reltio-id":"reltio-search-actions-menu"},menuId:"custom-actions",menuItems:y}),v().createElement(CV,null),v().createElement(qV,{open:E,onClose:()=>T(!1)}))},KV="#FF1744",XV=(0,kp.Z)({indicatorWrapper:{width:0,height:"20px",position:"relative"},indicatorTooltipArea:{width:"10px",height:"20px"},indicator:{width:"3px",height:"3px",backgroundColor:KV,border:"1px solid",borderColor:KV,borderRadius:"3px",position:"absolute",right:"-7px"},wrapper:{display:"inline-flex",position:"relative",overflow:"hidden"},for:{color:"rgba(0,0,0,0.6)",marginLeft:"8px",marginRight:"8px"},label:{color:"rgba(0,0,0,0.87)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}}),QV=()=>{const e=(0,Tp.useSelector)(xo.LA),t=(0,Tp.useSelector)(xo.WH),r=(0,b.useContext)(lV._),n=XV();if(!e)return null;const a=e.name,i=r?mi().text("Segment has changed"):mi().text("Saved search has changed");return v().createElement(v().Fragment,null,v().createElement("div",{className:n.wrapper},v().createElement(Ag(),{variant:"body2",component:"span",classes:{root:n.for}},mi().text("for")),v().createElement(gd.Y,{value:a},v().createElement(Ag(),{variant:"body2",classes:{root:n.label}},a))),t&&v().createElement(gf(),{title:i,placement:"bottom"},v().createElement("div",{className:n.indicatorWrapper,"data-reltio-id":"changed-indicator"},v().createElement("div",{className:n.indicator}),v().createElement("div",{className:n.indicatorTooltipArea}))))},JV=(0,kp.Z)({wrapper:{display:"inline-flex",position:"relative",overflow:"hidden",color:"rgba(0,0,0,0.6)"},in:{marginLeft:"8px",marginRight:"8px"},label:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",fontWeight:500}}),eB=()=>{const e=JV(),t=(0,Tp.useSelector)(k().selectors.getDataTenants),r=t&&t.length>0,n=(0,Tp.useSelector)(ui.t9),a=(0,Tp.useSelector)(k().selectors.getTenantName),i=n?n.label:a;return r&&v().createElement("div",{className:e.wrapper},v().createElement(Ag(),{variant:"body2",component:"span",classes:{root:e.in}},mi().text("in")),v().createElement(gd.Y,{value:a},v().createElement(Ag(),{variant:"body2",classes:{root:e.label}},i)))};var tB=r(81877),rB=r.n(tB);const nB=(0,kp.Z)({dialogPaper:{height:"70vh"},contentRoot:{padding:0,display:"flex",flexDirection:"column",overflow:"hidden"},tabContent:{display:"flex",flex:"1 1 auto"},tabsWrapper:{padding:"0 24px"}}),aB=(0,kp.Z)((e=>({container:{display:"flex",alignItems:"center",paddingTop:17,paddingBottom:11,paddingLeft:15,paddingRight:15},selected:{backgroundColor:(0,Lm.alpha)(e.palette.primary.main,.12)}}))),iB=(0,kp.Z)({main:{display:"flex",alignItems:"center",justifyContent:"space-between",flex:1},title:{display:"flex",alignItems:"center"},filterButton:{marginLeft:"10px",minWidth:0},deleteButton:{marginTop:"-5px"},searchBox:{flex:"1 1 auto",width:"100%",maxWidth:"323px"},flex1:{flex:1}}),oB=(0,kp.Z)({closeButton:{marginRight:"10px"}}),lB=e=>{let{onClose:t}=e;const r=oB();return v().createElement(Pp.T,{size:"L",icon:_p(),className:r.closeButton,onClick:t})};lB.propTypes={onClose:vp().func};const sB=lB,cB=e=>{let{selectedNumber:t,onDelete:r,onClose:n}=e;const a=iB();return v().createElement(v().Fragment,null,v().createElement("div",{className:O()(a.title,a.flex1)},v().createElement(sB,{onClose:n}),v().createElement(Ag(),{color:"primary"},mi().text("Selected: ${count}",{count:t}))),v().createElement(wd.k,{tooltipTitle:mi().text("Delete"),size:"L",icon:tL(),className:a.deleteButton,onClick:r}))};cB.propTypes={selectedNumber:vp().number,onClose:vp().func,onDelete:vp().func};const uB=cB,pB=(0,kp.Z)((()=>({white:{backgroundColor:"rgb(255, 255, 255)",boxShadow:"0 1px 3px 0 rgba(0,0,0,0.24)"}})));function dB(){return dB=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},dB.apply(this,arguments)}function mB(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){gB(e,t,r[t])}))}return e}function gB(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const yB=e=>{let{classes:t}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["classes"]);const n=pB({});return v().createElement(Mp,dB({classes:mB({},t,{focused:n.white})},r))};var fB=r(34480),hB=r.n(fB);const EB=(0,kp.Z)((e=>({changedFiltersIndicator:{backgroundColor:(0,Lm.alpha)(e.palette.primary.main,.12)},popupContent:{paddingTop:"19px",paddingBottom:"10px",paddingLeft:"23px",paddingRight:"23px",width:"48%",maxWidth:"480px"},title:{marginBottom:"30px"},favoriteOnlyControlRoot:{marginTop:"27px"},favoriteOnlyControlLabel:{fontSize:"0.8rem"},favoriteOnlyCheckbox:{marginRight:"20px"},buttonsGroup:{display:"flex",justifyContent:"space-between",marginTop:"35px",marginLeft:"-11px",marginRight:"-11px"},cancelButton:{marginRight:"10px"},shareWithRoot:{padding:"20px 16px 7px",fontSize:"0.85rem"},shareWithLabel:{top:"-3px",left:"4px"},shareWithMenuItem:{fontSize:"0.85rem"}}))),bB=e=>e?K.ib.public:K.ib.private,vB=e=>e===K.ib.public,TB=e=>{let{className:t,findPublic:r,favoriteOnly:n,onChangeFilters:a}=e;const i=EB(),o=(0,b.useRef)(),[l,s]=(0,b.useState)(!1),[c,u]=(0,b.useState)(r),[p,d]=(0,b.useState)(n);(0,b.useEffect)((()=>{u(r),d(n)}),[r,n]);const m=(0,b.useCallback)((()=>s((e=>!e))),[]),g=(0,b.useCallback)((e=>d(e.target.checked)),[]),y=(0,b.useCallback)((()=>{a({findPublic:c,favoriteOnly:p}),m()}),[m,a,c,p]),f=(0,b.useCallback)((()=>{u(r),d(n),m()}),[m,r,n]),h=(0,b.useCallback)((()=>{u(!0),d(!1)}),[]),E=!0===c&&!1===p;return v().createElement(v().Fragment,null,v().createElement(nE(),{ref:o,color:E?"inherit":"primary",classes:{root:t,textPrimary:i.changedFiltersIndicator},onClick:m},v().createElement(hB(),null)),v().createElement(xp(),{open:l,classes:{paper:i.popupContent},anchorEl:o.current,onClose:f,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},v().createElement(Ag(),{className:i.title,variant:"h6"},mi().text("Filter")),v().createElement(EV.k,{entries:K.m2,TextFieldProps:{InputLabelProps:{classes:{root:i.shareWithLabel}},label:mi().text("Shared with"),variant:"filled"},classes:{root:i.shareWithRoot,menuItem:i.shareWithMenuItem},fullWidth:!0,value:bB(c),onChange:(0,_.pipe)(vB,u)}),v().createElement(Nh(),{classes:{root:i.favoriteOnlyControlRoot,label:i.favoriteOnlyControlLabel},control:v().createElement(Jp(),{className:i.favoriteOnlyCheckbox,checked:p,onChange:g}),label:mi().text("Show favorites only")}),v().createElement("div",{className:i.buttonsGroup},v().createElement(nE(),{onClick:h,disabled:E},mi().text("Clear all")),v().createElement("div",null,v().createElement(nE(),{onClick:f,className:i.cancelButton},mi().text("Cancel")),v().createElement(nE(),{onClick:y,color:"primary"},mi().text("Apply"))))))};TB.propTypes={className:vp().string,findPublic:vp().bool,favoriteOnly:vp().bool,onChangeFilters:vp().func,onChangeFavoriteOnly:vp().func};const OB=(0,Tp.connect)((e=>({findPublic:(0,xo.kU)(e),favoriteOnly:(0,xo.VS)(e)})),{onChangeFilters:e=>{let{findPublic:t,favoriteOnly:r}=e;return{type:yr,payload:{findPublic:t,favoriteOnly:r}}}})(TB),xB=e=>{let{type:t,onSearch:r,placeholder:n,onClose:a}=e;const i=iB();return v().createElement(v().Fragment,null,v().createElement("div",{className:i.main},v().createElement("div",{className:i.title},v().createElement(sB,{onClose:a}),v().createElement(Ag(),{variant:"h6"},mi().text("Saved & recent searches"))),v().createElement("div",{className:i.searchBox},v().createElement(yB,{fullWidth:!0,onSearch:r,placeholder:n}))),t===K.uJ.saved&&v().createElement(OB,{className:i.filterButton}))};xB.propTypes={type:vp().oneOf(Object.values(K.uJ)),onClose:vp().func,onSearch:vp().func,placeholder:vp().string};const CB=xB,SB=e=>{let{type:t,selectedNumber:r,onClose:n,dispatch:a}=e;const i=aB(),o=(0,b.useCallback)((()=>{const e=t===K.uJ.saved?{type:Ar}:{type:Hr};a(e)}),[t,a]),l=(0,b.useCallback)((0,x.debounce)((e=>{const r=t===K.uJ.saved?{type:Nr,payload:e}:{type:qr,payload:e};a(r)}),500),[t,a]),s=(0,_.cond)([[(0,_.equals)(K.uJ.saved),(0,_.always)(mi().text("Search name"))],[(0,_.equals)(K.uJ.recent),(0,_.always)(mi().text("Search for filtered entity types and attributes"))]])(t);return v().createElement(gV(),{className:O()(i.container,{[i.selected]:r})},r?v().createElement(uB,{selectedNumber:r,onDelete:o,onClose:n}):v().createElement(CB,{type:t,onSearch:l,onClose:n,placeholder:s}))};SB.propTypes={type:vp().oneOf(Object.values(K.uJ)).isRequired,selectedNumber:vp().number,onClose:vp().func,dispatch:vp().func};const wB=(0,Tp.connect)(((e,t)=>({selectedNumber:t.type===K.uJ.saved?(0,xo.g2)(e):js(e)})))(SB),AB="0.75rem",RB=(0,kp.Z)({tableWrapper:{display:"flex",flexDirection:"column",width:"100%",position:"relative","& $cellBorder":{borderLeft:"none",borderRight:"none"}},cellBorder:{},paginationRoot:{flexShrink:0,boxShadow:"none",borderTop:"1px solid rgba(0, 0, 0, 0.1)",fontSize:AB},paginationCaption:{fontSize:AB}});var _B=r(54622);const IB=vp().shape({field:vp().string,order:vp().oneOf(["asc","desc"])}),NB=vp().shape({label:vp().string,name:vp().string,description:vp().string,type:vp().string,hidden:vp().bool,faceted:vp().bool,searchable:vp().bool,uri:vp().string,access:vp().arrayOf(vp().string),cardinality:vp().shape({minValue:vp().number,maxValue:vp().number})}),DB=vp().shape({title:vp().string,pathToTitle:vp().arrayOf(vp().string),fieldName:vp().string,entityTypeUri:vp().string,attrType:NB,uri:vp().string,groupName:vp().string}),PB=vp().shape({id:vp().oneOfType([vp().number,vp().string]),values:vp().array,data:DB,filter:vp().string,operator:vp().string}),kB="0.8rem",LB=(0,kp.Z)((e=>{const t=(0,Lm.lighten)(e.palette.primary.main,.88),r=(0,Lm.alpha)(t,0),n=(0,Lm.lighten)(e.palette.primary.main,.82),a={content:'""',position:"absolute",top:0,right:0,width:"40px",height:"100%",background:"linear-gradient(to right, rgba(255, 255, 255, 0.2), #fff 100%)",pointerEvents:"none","div.hoveredRow &":{background:"linear-gradient(to right, rgba(238, 238, 238, 0), rgba(238, 238, 238, 1) 100%)"},"$checkedRowCell &":{background:`linear-gradient(to right, ${r}, ${t} 100%)`},"div.hoveredRow $checkedRowCell &":{background:`linear-gradient(to right, ${(0,Lm.alpha)(n,0)}, ${n} 100%)`}};return{defaultWrapper:{whiteSpace:"nowrap",overflow:"hidden",padding:"0 22px",fontSize:kB,display:"flex",alignItems:"center",height:"100%","&:after":a},numberWrapper:{whiteSpace:"nowrap",overflow:"hidden",padding:"0 24px 0 22px",fontSize:kB,justifyContent:"flex-end",display:"flex",alignItems:"center",height:"100%"},nameWithStar:{display:"flex",alignItems:"center",height:"100%",paddingLeft:"6px","& $editNameButton":{display:"none"},"div.hoveredRow & $editNameButton":{display:"flex"}},leftButtonWrapper:{},deleteButton:{visibility:"hidden",marginRight:"2px"},totalWithButtonsWrapper:{justifyContent:"flex-end",display:"flex",alignItems:"center",height:"100%","& $numberWrapper":{paddingRight:"8px"},"div.hoveredRow & $deleteButton":{visibility:"visible"}},nameTextEditorRoot:{margin:0},nameInput:{fontSize:kB,"&::-ms-clear":{display:"none"}},nameContainer:{flex:1,overflow:"hidden"},editing:{},editNameButton:{},searchName:{cursor:"pointer",lineHeight:"29px",position:"relative",whiteSpace:"nowrap",overflow:"hidden",fontSize:kB,"&:after":a},clickableArea:{cursor:"pointer"},starButton:{marginLeft:"-7px",marginRight:"3px",visibility:"hidden","div.hoveredRow &$enabledButton":{visibility:"visible"}},checkedStarButton:{visibility:"visible",color:"#F5A623 !important"},filterButton:{"$editing &":{marginRight:"2px"},marginLeft:"-7px",marginRight:"10px",visibility:"hidden","div.hoveredRow &$enabledButton":{visibility:"visible"},"& svg":{fill:"rgba(0,0,0,0.56)"}},checkedFilterButton:{visibility:"visible","& svg":{fill:e.palette.primary.main}},enabledButton:{},headCell:{display:"flex",alignItems:"center",height:"100%",fontSize:"0.75rem",borderBottom:"1px solid rgba(0,0,0,.1)",color:"rgba(0,0,0,0.6)",fontWeight:500,"&>div":{padding:"0 4px 0 22px"},"& $headLabel":{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}},totalHeadCell:{justifyContent:"flex-end",marginRight:"45px"},nameHeadCell:{paddingLeft:"39px"},headLabel:{},checkbox:{paddingLeft:"11px"},sharingWrapper:{paddingLeft:"22px",display:"flex",alignItems:"center",height:"100%"},sharingRoot:{flexShrink:1,maxWidth:"100%"},sharingInput:{fontSize:kB},sharingMenuItem:{fontSize:kB,minWidth:"100px"},sharingDisabled:{color:"rgba(0,0,0,0.89)",paddingRight:"0 !important"},sharingIconDisabled:{display:"none"},rowCell:{height:"100%"},checkedRowCell:{backgroundColor:t,"div.hoveredRow &":{backgroundColor:n}},invisibleOnHoverCommon:{height:"100%","&$invisibleOnHover":{pointerEvents:"none","div.hoveredRow &":{color:"transparent"}}},invisibleOnHover:{},tooltip:e.tooltip,tooltipSection:{marginBottom:"5px"},tooltipSectionHeader:{margin:"5px 0",fontSize:"11px",fontWeight:500},tooltipText:{opacity:.7,fontSize:"10px"}}})),UB=e=>{let{mode:t}=e;const r=LB(),n=(0,Tp.useDispatch)(),a=t===K.uJ.saved?xo.tc:Fs,i=(0,Tp.useSelector)(a),o=t===K.uJ.saved?xo.hY:Ms,l=(0,Tp.useSelector)(o),s=(0,b.useCallback)((()=>{t===K.uJ.saved?n(l?bo():{type:hr}):n(l?Ss():{type:Br})}),[n,l,t]);return v().createElement("div",{className:O()(r.headCell,r.checkbox)},v().createElement(Jp(),{indeterminate:!i&&l,checked:i,onChange:s}))};UB.propTypes={mode:vp().string};const jB=(0,Bd.q)((0,_.pick)(["mode"]))(UB),FB=e=>{const t=t=>{const r=LB(),{rowValue:{checked:n}}=t;return v().createElement("div",{className:O()(r.rowCell,{[r.checkedRowCell]:n})},v().createElement(e,t))};return t.propTypes={rowValue:vp().shape({checked:vp().bool})},t},MB=(0,yd.T)(Jp()),VB=e=>{let{value:t=!1,rowValue:{uri:r,isOwnSearch:n},onClick:a}=e;const i=LB(),o=!n;return v().createElement("div",{className:O()(i.headCell,i.checkbox)},v().createElement(MB,{showForDisabled:!0,tooltipTitle:o&&mi().text("Cannot edit because you're not the owner"),tooltipPlacement:"bottom-start",disabled:o,checked:t,onChange:e=>a(r,e.target.checked)}))};VB.propTypes={value:vp().bool,rowValue:vp().shape({uri:vp().string,isOwnSearch:vp().bool}),onClick:vp().func};const BB=(0,Bd.q)((e=>{let{onSelectItem:t}=e;return{onClick:t}}))(FB(VB));var zB=r(92332);function HB(){return HB=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},HB.apply(this,arguments)}function YB(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){WB(e,t,r[t])}))}return e}function WB(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const GB=e=>{let{className:t}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className"]);const n=LB(),{headCellData:a}=r;return v().createElement("div",{className:O()(n.headCell,t)},v().createElement(zB.default,HB({},r,{headCellData:YB({},a,{label:v().createElement(gd.Y,{value:a.label},v().createElement("div",{className:n.headLabel},a.label))})})))};GB.propTypes={className:vp().string,headCellData:vp().shape({id:vp().string,label:vp().oneOfType([vp().string,vp().node]),sortable:vp().bool,resizable:vp().bool,className:vp().string,initialWidth:vp().number,minWidth:vp().number,autoResize:vp().bool,renderer:vp().func})};const qB=GB;function ZB(){return ZB=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ZB.apply(this,arguments)}const $B=e=>{const t=LB();return v().createElement(qB,ZB({className:t.nameHeadCell},e))};$B.propTypes={headCellData:vp().shape({id:vp().string,label:vp().oneOfType([vp().string,vp().node]),sortable:vp().bool,resizable:vp().bool,className:vp().string,initialWidth:vp().number,minWidth:vp().number,autoResize:vp().bool,renderer:vp().func})};const KB=$B;var XB=r(18122),QB=r.n(XB),JB=r(62839),ez=r.n(JB);function tz(){return tz=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},tz.apply(this,arguments)}const rz=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",tz({xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},r),v().createElement("g",null,v().createElement("path",{d:"M0 0h24m0 24H0",fill:"none"}),v().createElement("path",{d:"M4.25 5.61C6.27 8.2 10 13 10 13v6c0 .55.45 1 1 1h2c.55 0 1-.45 1-1v-6s3.72-4.8 5.74-7.39A.998.998 0 0018.95 4H5.04c-.83 0-1.3.95-.79 1.61z"}),v().createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"})))};function nz(){return nz=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},nz.apply(this,arguments)}const az=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",nz({xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},r),v().createElement("g",null,v().createElement("path",{d:"M0 0h24m0 24H0",fill:"none"}),v().createElement("path",{d:"M7 6h10l-5.01 6.3L7 6zm-2.75-.39C6.27 8.2 10 13 10 13v6c0 .55.45 1 1 1h2c.55 0 1-.45 1-1v-6s3.72-4.8 5.74-7.39A.998.998 0 0018.95 4H5.04c-.83 0-1.3.95-.79 1.61z"}),v().createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"})))};var iz=r(74492),oz=r.n(iz),lz=r(72246),sz=r.n(lz);const cz=e=>{let{value:t,rowValue:{uri:r,isFavorite:n,isOwnSearch:a,isEditing:i,isGlobalFilter:o},onStarClick:l,onGlobalClick:s,onApply:c,onChangeName:u,onSetEditing:p}=e;const d=LB(),m=a&&!i,[g,y]=(0,b.useState)(t);(0,b.useEffect)((()=>{y(t)}),[t]);const f=(0,b.useCallback)((()=>{u(r,g)}),[r,g,u]),h=(0,b.useCallback)((()=>l(r,!n)),[l,r,n]),E=(0,b.useCallback)((()=>s(r,!o)),[s,r,o]),T=(0,b.useCallback)((()=>p(r,!0)),[p,r]),x=(0,b.useCallback)((()=>c(r)),[c,r]),C=(0,_.cond)([[(0,_.always)(a),(0,_.always)(mi().text("Mark as favorite"))],[(0,_.always)(n),(0,_.always)(mi().text("Cannot ummark because you're not the owner"))],[_.T,(0,_.always)("")]])();return v().createElement("div",{className:O()(d.nameWithStar,{[d.editing]:i})},v().createElement(wd.k,{showForDisabled:!0,tooltipTitle:C,tooltipPlacement:a?"bottom":"bottom-start",disabled:!a,className:O()(d.starButton,{[d.checkedStarButton]:n},{[d.enabledButton]:a}),size:"M",icon:n?QB():ez(),onClick:h}),v().createElement(wd.k,{tooltipTitle:o?mi().text("Remove Global filter"):mi().text("Set as Global filter"),className:O()(d.filterButton,d.enabledButton,{[d.checkedFilterButton]:o}),size:"M",icon:o?rz:az,onClick:E}),v().createElement("div",{className:d.nameContainer},i?v().createElement(sz(),{onClickAway:f},v().createElement("div",null,v().createElement(yV.H,{variant:"filled",hiddenLabel:!0,size:"small",fullWidth:!0,autoFocus:!0,classes:{root:d.nameTextEditorRoot},InputProps:{classes:{input:d.nameInput}},value:g,onInput:e=>y(e.target.value),onKeyDown:(0,_.when)((0,_.propEq)("keyCode",13),f)}))):v().createElement(gd.Y,{value:t},v().createElement("div",{className:d.searchName,onClick:x},t))),m&&v().createElement(wd.k,{tooltipTitle:mi().text("Edit"),className:d.editNameButton,size:"M",icon:oz(),onClick:T}))};cz.propTypes={value:vp().string,rowValue:vp().shape({uri:vp().string,isFavorite:vp().bool,isOwnSearch:vp().bool,isEditing:vp().bool,isGlobalFilter:vp().bool}),onStarClick:vp().func,onGlobalClick:vp().func,onApply:vp().func,onChangeName:vp().func,onSetEditing:vp().func};const uz=(0,Bd.q)((e=>{let{onChangeIsFavorite:t,onChangeIsGlobal:r,onSearchApply:n,onSetItemEditing:a,onChangeItemName:i}=e;return{onStarClick:t,onGlobalClick:r,onApply:n,onSetEditing:a,onChangeName:i}}))(FB(cz)),pz=e=>{let{value:t,rowValue:{uri:r,isOwnSearch:n},onChange:a}=e;const i=LB(),o=(0,b.useCallback)((e=>{const n=vB(e);n!==t&&a(r,n)}),[r,t,a]);return v().createElement("div",{className:i.sharingWrapper},v().createElement(EV.k,{entries:K.m2,value:bB(t),onChange:o,disableUnderline:!0,disabled:!n,MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},elevation:3},TextFieldProps:{classes:{root:i.sharingRoot}},classes:{root:i.sharingInput,menuItem:i.sharingMenuItem,disabled:i.sharingDisabled,icon:O()({[i.sharingIconDisabled]:!n})}}))};pz.propTypes={value:vp().bool,rowValue:vp().shape({uri:vp().string,isOwnSearch:vp().bool}),onChange:vp().func};const dz=(0,Bd.q)((e=>{let{onChangeIsPublic:t}=e;return{onChange:t}}))(FB(pz)),mz=e=>{let{value:t,rowValue:r,onClick:n}=e;const a=LB(),i=n?()=>n(r):()=>{};return v().createElement(gd.Y,{value:t},v().createElement("div",{className:O()(a.defaultWrapper,{[a.clickableArea]:n}),onClick:i},t))};mz.propTypes={value:vp().any,rowValue:vp().object,onClick:vp().func};const gz=FB(mz);function yz(){return yz=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},yz.apply(this,arguments)}const fz=e=>{const{rowValue:{updateDate:t,createDate:r}}=e,n=t||r;return v().createElement(gz,yz({},e,{value:n&&mi().date(n,"L")}))};fz.propTypes={rowValue:vp().shape({updateDate:vp().number,createDate:vp().number})};const hz=fz,Ez=e=>{let{values:t}=e;return(0,_.pipe)((0,_.cond)([[_.isNil,_.T],[Array.isArray,(0,_.pipe)(_.flatten,_.isEmpty)],[_.T,_.isEmpty]]),_.not)(t)},bz=(0,_.curry)(((e,t)=>(0,_.path)(["facetsData",t.fieldName,"values","length"],e)>0)),vz=e=>e&&e.slice(1).join(" / "),Tz=(e,t,r)=>(e[t]||(e[t]={title:t,attributes:[]}),e[t].attributes=(0,_.uniq)(e[t].attributes.concat(r)),e),Oz=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.flatMap((e=>e.attributes)).filter(Ez).reduce(((e,t)=>{let{data:{title:r,groupName:n,pathToTitle:a}}=t;const i=vz(a)||r;return Tz(e,n,i)}),{})},xz=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(e.facetsConfigs||[]).filter((0,_.pipe)(x.isTypeFacet,_.not)).filter(bz(e)).reduce(((e,t)=>{const r=(0,_.path)(["pathToTitle",0],t)||mi().text("Special"),n=vz(t.pathToTitle)||t.title;return Tz(e,r,n)}),{})},Cz=e=>{let{rowValue:{uiState:t}}=e;const r=LB(),n=(0,b.useMemo)((()=>function(){let{facets:e,advanced:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{const r=t?Oz(t):xz(e);return Object.values(r)}catch(e){return[]}}(t)),[t]),a=(0,b.useMemo)((()=>(e=>e.flatMap((e=>e.attributes)).length)(n)),[n]),i=!!n.length&&v().createElement("div",null,n.map((e=>{let{title:t,attributes:n}=e;return v().createElement("div",{key:t,className:r.tooltipSection},v().createElement("h6",{className:r.tooltipSectionHeader},t),n.map((e=>v().createElement("div",{key:e,className:r.tooltipText},e))))})));return v().createElement("div",{className:r.numberWrapper},(o=a,i?v().createElement(gf(),{title:i,classes:{tooltip:r.tooltip},disableFocusListener:!0,disableTouchListener:!0},v().createElement("span",null,o)):o));var o};Cz.propTypes={rowValue:vp().shape({uiState:vp().shape({facets:vp().object,advanced:vp().array})})};const Sz=FB(Cz);function wz(){return wz=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},wz.apply(this,arguments)}const Az=e=>{const t=LB();return v().createElement(qB,wz({className:t.totalHeadCell},e))};Az.propTypes={headCellData:vp().shape({id:vp().string,label:vp().oneOfType([vp().string,vp().node]),sortable:vp().bool,resizable:vp().bool,className:vp().string,initialWidth:vp().number,minWidth:vp().number,autoResize:vp().bool,renderer:vp().func})};const Rz=Az;var _z=r(67520),Iz=r.n(_z);const Nz=e=>{let{value:t}=e;const r=LB();return v().createElement(gd.Y,{value:t},v().createElement("div",{className:r.numberWrapper},mi().number(t)))};Nz.propTypes={value:vp().number};const Dz=FB(Nz),Pz=e=>{const t=LB(),{rowValue:{isTotalLoading:r,isOwnSearch:n,uri:a},onDeleteItem:i,onLoadTotalForItem:o,value:l}=e,s=(0,b.useCallback)((()=>{i(a)}),[i,a]),c=n?mi().text("Delete"):mi().text("Cannot delete because you're not the owner"),u=r?mi().text("Loading data"):mi().text("Load data"),p=(0,b.useCallback)((()=>{o(a)}),[o,a]),d=r||-1===l;return v().createElement("div",{className:t.totalWithButtonsWrapper},d?v().createElement(wd.k,{showForDisabled:!0,tooltipTitle:u,tooltipPlacement:"bottom-end",disabled:r,size:"L",icon:Iz(),onClick:p}):v().createElement(Dz,e),v().createElement(wd.k,{showForDisabled:!0,className:t.deleteButton,tooltipTitle:c,tooltipPlacement:"bottom-end",disabled:!n,size:"L",icon:tL(),onClick:s}))};Pz.propTypes={value:vp().number,rowIndex:vp().number,rowValue:vp().shape({isOwnSearch:vp().bool,isTotalLoading:vp().bool,uri:vp().string}),onDeleteItem:vp().func,onLoadTotalForItem:vp().func};const kz=(0,Bd.q)((e=>{let{onDeleteItem:t,onLoadTotalForItem:r}=e;return{onDeleteItem:t,onLoadTotalForItem:r}}))(FB(Pz));function Lz(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Uz={rowCellValueRenderer:gz,headCellRenderer:qB,autoResize:!1},jz=[{id:"checked",label:"",initialWidth:55,headCellRenderer:jB,rowCellValueRenderer:BB},{id:"name",get label(){return mi().text("Name")},autoResize:!0,headCellRenderer:KB,rowCellValueRenderer:uz,sortable:!0},{id:"isPublic",get label(){return mi().text("Shared with")},rowCellValueRenderer:dz},{id:"owner",get label(){return mi().text("Created by")},initialWidth:260},{id:"updateDate",get label(){return mi().text("Last modified")},rowCellValueRenderer:hz,sortable:!0},{id:"attributes",get label(){return mi().text("Filtered attributes")},rowCellValueRenderer:Sz},{id:"total",get label(){return mi().text("Number of profiles")},headCellRenderer:Rz,rowCellValueRenderer:kz,initialWidth:194}].map((e=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Lz(e,t,r[t])}))}return e}({},Uz,e)));function Fz(){return Fz=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Fz.apply(this,arguments)}function Mz(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Vz=e=>{let{items:t,total:r,sorting:n,page:a,rowsPerPage:i,loading:o,searchValue:l,globalFilterSavedSearchesUris:s=[],onSearchApply:c,onChangeIsFavorite:u,onChangeIsPublic:p,onChangeIsGlobal:d,onChangeRowsPerPage:m,onChangePage:g,onSelectItem:y,onDeselectAllItems:f,onDeleteItem:h,onChangeItemName:E,onSetItemEditing:T,onLoadTotalForItem:O,onSort:C}=e;const S=RB(),w=(0,b.useMemo)((()=>({cellBorder:S.cellBorder})),[S]),[A,R]=(0,b.useState)(null),[_,I]=(0,b.useState)(null),N=(0,b.useRef)(null);(0,b.useEffect)((()=>f),[f]);const D=(0,b.useCallback)((e=>{s.includes(e)?I(e):h(e)}),[s,h]),P=(0,b.useMemo)((()=>({mode:K.uJ.saved,onSelectItem:y,onChangeIsFavorite:u,onChangeIsGlobal:d,onSearchApply:c,onSetItemEditing:T,onChangeItemName:E,onDeleteItem:D,onLoadTotalForItem:O,onChangeIsPublic:p})),[D,y,u,d,O,c,T,E,p]),k=(0,b.useMemo)((()=>(0,x.isEmptyValue)(l)?{LogoRenderer:PE.SELECT_ATTRIBUTES,text:mi().text("No saved searches."),secondaryText:mi().text("Save time by creating saved searches for queries you regularly search for.")}:{LogoRenderer:PE.SEARCH_RESULTS,text:mi().text("No results found."),secondaryText:mi().text("Try adjusting your search or filter to find what you're looking for.")}),[l]),L=(0,b.useMemo)((()=>t.map((e=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Mz(e,t,r[t])}))}return e}({},e,{isGlobalFilter:s.includes(e.uri)})))),[t,s]);return v().createElement("div",{className:S.tableWrapper},r>0?v().createElement(v().Fragment,null,v().createElement(Ud.M,{columnsData:jz,rowsData:L,context:P,sorting:n,getRowCellHeight:null,defaultColumnWidth:140,defaultColumnMinWidth:140,defaultRowHeight:48,headRowHeight:47,hoverStateEnabled:!0,onSort:C,hoverRowIndex:A,onRowHover:R,classes:w,ref:N}),v().createElement(SE.Z,{classes:{root:S.paginationRoot,caption:S.paginationCaption},count:r,rowsPerPageOptions:K.Tu,rowsPerPage:i,onChangeRowsPerPage:m,page:a,onChangePage:g,basicTableRef:N}),v().createElement(_B.U,{open:!!_,title:mi().text("Keep the global filter?"),content:mi().text("The saved search you are deleting is being used as a global filter in your tenant. Do you want to keep the global filter?"),discardCaption:mi().text("NO, remove it"),saveCaption:mi().text("YES, KEEP GLOBAL FILTER"),onCancel:()=>I(null),onDiscard:()=>{d(_,!1),h(_),I(null)},onSave:()=>{h(_),I(null)}})):v().createElement(kE,Fz({},k,{variant:DE.embedded})),o&&v().createElement(LE.z,null))};Vz.propTypes={items:vp().arrayOf(vp().shape({uri:vp().string,name:vp().string,isPublic:vp().bool,isFavorite:vp().bool,isOwnSearch:vp().bool,isEditing:vp().bool,checked:vp().bool,owner:vp().string,updateDate:vp().number,query:vp().string})),total:vp().number,sorting:IB,page:vp().number,rowsPerPage:vp().number,loading:vp().bool,searchValue:vp().string,globalFilterSavedSearchesUris:vp().arrayOf(vp().string),onSearchApply:vp().func,onChangeIsFavorite:vp().func,onChangeIsPublic:vp().func,onChangeIsGlobal:vp().func,onChangeRowsPerPage:vp().func,onChangePage:vp().func,onSelectItem:vp().func,onDeselectAllItems:vp().func,onDeleteItem:vp().func,onChangeItemName:vp().func,onSetItemEditing:vp().func,onSort:vp().func};const Bz=(0,Tp.connect)((e=>({items:(0,xo.gg)(e),total:(0,xo.Yi)(e),sorting:(0,xo.rT)(e),page:(0,xo.wH)(e),rowsPerPage:(0,xo.s6)(e),loading:(0,xo.w7)(e),searchValue:(0,xo.U3)(e),globalFilterSavedSearchesUris:k().selectors.getGlobalFilterSavedSearchesUris(e)})),{onSearchApply:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:K.XU;return{type:Dr,payload:{uri:e,debounceTime:t}}},onChangeIsFavorite:(e,t)=>({type:Tr,payload:{uri:e,isFavorite:t}}),onChangeIsPublic:(e,t)=>({type:br,payload:{uri:e,isPublic:t}}),onChangeIsGlobal:(e,t)=>({type:xr,payload:{uri:e,isGlobalFilter:t}}),onChangeRowsPerPage:e=>({type:gr,payload:e}),onChangePage:e=>({type:mr,payload:e}),onSelectItem:(e,t)=>({type:fr,payload:{uri:e,checked:t}}),onDeselectAllItems:bo,onDeleteItem:e=>({type:Rr,payload:e}),onChangeItemName:(e,t)=>({type:Cr,payload:{uri:e,name:t}}),onSetItemEditing:(e,t)=>({type:wr,payload:{uri:e,isEditing:t}}),onLoadTotalForItem:e=>({type:kr,payload:e}),onSort:e=>({type:Lr,payload:e})})(Vz),zz=e=>{let{value:t=!1,rowValue:{createdDate:r},onClick:n}=e;const a=LB();return v().createElement("div",{className:O()(a.headCell,a.checkbox)},v().createElement(Jp(),{checked:t,onChange:e=>n(r,e.target.checked)}))};zz.propTypes={value:vp().bool,rowValue:vp().shape({createdDate:vp().number}),onClick:vp().func};const Hz=(0,Bd.q)((e=>{let{onSelectItem:t}=e;return{onClick:t}}))(FB(zz));function Yz(){return Yz=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Yz.apply(this,arguments)}const Wz=e=>{const{rowValue:{createdDate:t}}=e,r=t;return v().createElement(gz,Yz({},e,{value:r&&mi().date(r,"L LT")}))};Wz.propTypes={rowValue:vp().shape({createdDate:vp().number}),onClick:vp().func};const Gz=(0,Bd.q)((e=>{let{onSearchApply:t}=e;return{onClick:t}}))(Wz),qz=e=>{const t=LB(),{rowValue:r,onDeleteItem:n,onLoadTotalForItem:a,value:i}=e,{isTotalLoading:o,createdDate:l}=r,s=(0,b.useCallback)((()=>{n(r)}),[n,r]),c=o?mi().text("Loading data"):mi().text("Load data"),u=(0,b.useCallback)((()=>{a(l)}),[a,l]),p=o||-1===i;return v().createElement("div",{className:t.totalWithButtonsWrapper},p?v().createElement(wd.k,{showForDisabled:!0,tooltipTitle:c,tooltipPlacement:"bottom-end",disabled:o,size:"L",icon:Iz(),onClick:u}):v().createElement(Dz,e),v().createElement(wd.k,{className:t.deleteButton,tooltipTitle:mi().text("Delete"),tooltipPlacement:"bottom-end",size:"L",icon:tL(),onClick:s}))};qz.propTypes={value:vp().number,rowValue:vp().shape({isTotalLoading:vp().bool,createdDate:vp().number}),onDeleteItem:vp().func,onLoadTotalForItem:vp().func};const Zz=(0,Bd.q)((e=>{let{onDeleteItem:t,onLoadTotalForItem:r}=e;return{onDeleteItem:t,onLoadTotalForItem:r}}))(FB(qz)),$z=(0,Bd.q)((e=>{let{onSearchApply:t}=e;return{onClick:t}}))(gz);function Kz(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Xz={rowCellValueRenderer:gz,headCellRenderer:qB,autoResize:!1},Qz=[{id:"checked",label:"",initialWidth:55,headCellRenderer:jB,rowCellValueRenderer:Hz},{id:"createdDate",get label(){return mi().text("Created")},rowCellValueRenderer:Gz,initialWidth:256},{id:"name",get label(){return mi().text("Query")},autoResize:!0,rowCellValueRenderer:$z,minWidth:150},{id:"total",get label(){return mi().text("Record count")},rowCellValueRenderer:Zz,headCellRenderer:Rz,initialWidth:150}].map((e=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Kz(e,t,r[t])}))}return e}({},Xz,e)));function Jz(){return Jz=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Jz.apply(this,arguments)}const eH=e=>{let{items:t,loading:r,filterWord:n,onSelectItem:a,onDeselectAllItems:i,onSearchApply:o,onDeleteItem:l,onLoadTotalForItem:s}=e;const c=RB(),u=(0,b.useMemo)((()=>({cellBorder:c.cellBorder})),[c]),[p,d]=(0,b.useState)(null);(0,b.useEffect)((()=>i),[i]);const m=(0,b.useMemo)((()=>({mode:K.uJ.recent,onSelectItem:a,onSearchApply:o,onDeleteItem:l,onLoadTotalForItem:s})),[l,s,a,o]),g=(0,b.useMemo)((()=>(0,x.isEmptyValue)(n)?{LogoRenderer:PE.SELECT_ATTRIBUTES,text:mi().text("No recent searches."),secondaryText:mi().text("Your recent search history will appear here.")}:{LogoRenderer:PE.SEARCH_RESULTS,text:mi().text("No results found."),secondaryText:mi().text("Try adjusting your search or filter to find what you're looking for.")}),[n]);return v().createElement("div",{className:c.tableWrapper},t.length>0?v().createElement(Ud.M,{columnsData:Qz,rowsData:t,context:m,getRowCellHeight:null,defaultColumnWidth:50,defaultColumnMinWidth:50,defaultRowHeight:48,headRowHeight:47,hoverStateEnabled:!0,hoverRowIndex:p,onRowHover:d,classes:u}):v().createElement(kE,Jz({},g,{variant:DE.embedded})),r&&v().createElement(LE.z,null))};eH.propTypes={items:vp().arrayOf(vp().shape({uri:vp().string,name:vp().string,isPublic:vp().bool,isFavorite:vp().bool,isOwnSearch:vp().bool,checked:vp().bool,owner:vp().string,createdDate:vp().number,query:vp().string})),loading:vp().bool,filterWord:vp().string,onSelectItem:vp().func,onSearchApply:vp().func,onDeselectAllItems:vp().func,onDeleteItem:vp().func};const tH=(0,Tp.connect)((e=>({items:Ls(e),loading:Us(e),filterWord:Ps(e)})),{onSearchApply:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:K.XU;return{type:Xr,payload:{search:e,debounceTime:t}}},onSelectItem:(e,t)=>({type:Vr,payload:{searchCreatedDate:e,checked:t}}),onDeselectAllItems:Ss,onDeleteItem:e=>({type:Wr,payload:e}),onLoadTotalForItem:e=>({type:Kr,payload:e})})(eH),rH=e=>{let{open:t,onClose:r}=e;const n=nB(),a=(0,Tp.useDispatch)(),i=(0,b.useMemo)((()=>[{value:K.uJ.saved,label:mi().text("Saved searches"),content:v().createElement(Bz,null),dataReltioId:"reltio-search-saved-searches"},{value:K.uJ.recent,label:mi().text("Recent searches"),content:v().createElement(tH,null),dataReltioId:"reltio-search-recent-searches"}]),[]),[o,l]=(0,b.useState)(i[0].value);return(0,b.useEffect)((()=>{t&&(o===K.uJ.saved?a({type:cr}):a({type:jr}))}),[t,a,o]),v().createElement(kj(),{classes:{paper:n.dialogPaper},fullWidth:!0,maxWidth:"lg",open:t,onClose:r},v().createElement(wB,{type:o,onClose:r}),v().createElement(EF(),{classes:{root:n.contentRoot}},v().createElement("div",{className:n.tabsWrapper},v().createElement(LI,{value:o,tabs:i,onChange:l,scrollButtons:"auto"})),v().createElement("div",{className:n.tabContent},i.find((0,_.propEq)("value",o)).content)))};rH.propTypes={open:vp().bool,onClose:vp().func};const nH=rH,aH=(0,kp.Z)((()=>({button:{display:"flex",alignItems:"center",whiteSpace:"nowrap",borderColor:"rgba(0, 0, 0, 0.12)"},buttonText:{letterSpacing:0},compact:{paddingTop:"2px",paddingBottom:"2px",marginRight:"-8px",marginLeft:"4px"}}))),iH=e=>{let{showTypography:t}=e;const r=aH(),n=(0,Tp.useDispatch)(),a=(0,Tp.useSelector)(ki.tm),i=mi().text("Saved & recent searches"),o=(0,b.useCallback)((()=>n(Ti(!0))),[n]),l=(0,b.useCallback)((()=>n(Ti(!1))),[n]);return v().createElement(v().Fragment,null,v().createElement(gf(),{title:t?"":i},v().createElement(nE(),{className:r.button,variant:"outlined",startIcon:v().createElement(rB(),{className:O()({[r.compact]:!t}),color:"action"}),onClick:o,"data-reltio-id":"reltio-search-saved-and-recent-search"},t&&v().createElement(Ag(),{variant:"button",color:"textPrimary",className:r.buttonText},i))),v().createElement(nH,{open:a,onClose:l}))},oH=(0,kp.Z)((()=>({container:{display:"flex",flexDirection:"column",position:"relative",paddingLeft:"16px",paddingRight:"20px"},header:{height:"63px",display:"flex",alignItems:"center"},captionWrapper:{marginTop:"-2px",paddingLeft:"8px",flexShrink:0},profileText:{paddingLeft:"8px",color:"rgba(0,0,0,0.6)"},profileNumber:{fontWeight:600},facetsBar:{display:"flex",alignItems:"center",flexGrow:1,marginBottom:"12px",marginTop:"-8px"},showBar:{display:"flex",overflow:"hidden"},clearButton:{marginRight:"auto",marginLeft:"14px"},splitter:{marginRight:"15px",marginLeft:"1px",height:"32px"},searchBarControls:{display:"flex",alignItems:"center",width:"100%",justifyContent:"flex-end"}}))),lH="search",sH="geoLocation",cH={},uH=()=>{const e=oH(),t=(0,Tp.useDispatch)(),r=(0,Tp.useSelector)(D.Mp),n=(0,Tp.useSelector)(D.X0),a=(0,Tp.useSelector)(ui.Qw)||cH,i=(0,Tp.useSelector)(k().selectors.getSearchKeyword),o=(0,Tp.useSelector)(k().selectors.getDateMask),l=(0,Tp.useSelector)(k().selectors.getDateTimeMask),s=(0,Tp.useSelector)(k().selectors.getAttributesPresentation)||cH,c=(0,Tp.useSelector)(ki.IJ),u=(0,Tp.useSelector)((e=>(0,ui.NU)(e,{entityTypeUri:void 0}))),p=(0,Tp.useSelector)(ro.go),d=(0,b.useContext)(lV._),[m,g]=(0,b.useState)([]),[y,f]=(0,b.useState)(0),[h,E]=(0,b.useState)(!1),T=(0,b.useRef)(null),[O,C]=(0,b.useState)(!0);(0,b.useEffect)((()=>{g(S())}),[r,n,a,i]),(0,b.useEffect)((()=>{f(m.length),E(!0)}),[m]),(0,b.useEffect)((()=>{if(h){const e=R();f(e),E(!1)}}),[h,n]);const S=(0,b.useCallback)((()=>{const e=Object.values((0,za.t8)(n,r)).filter((e=>e.values&&e.values.length)).map((e=>{const t=e.title||e.hiddenTitle,r=(0,za.MI)([...e.data||[],...e.filteredData||[]],(0,_.path)(["attrType","type"],e)===x.DataTypes.TYPE_DATE?e.values.map((e=>e.map((e=>x.utils.dates.toLocalDate(e).getTime())))):e.values.map((0,x.mapFilterValue)((0,x.applyPresentationStrategyToValue)((e=>(0,x.getNumberFormat)((0,x.getAttrDataTypeDefinition)(e.attrType),s,x.intl.getLocale()).strategy)(e)))),e.type,{dateMask:o,dateTimeMask:l});return{fieldName:e.fieldName,title:t,values:r}}));i&&e.push({fieldName:lH,title:mi().text("Search"),values:[i.value]});const{values:[t]=[],type:c}=(0,_.pathOr)({},["mapSearch"],a);return t&&e.push({fieldName:sH,values:(0,x.getMapSearchValues)(c,t),title:(0,x.getMapSearchLabel)(c)}),e}),[r,n,a,i,s,o,l]),w=(0,b.useCallback)((()=>{f(m.length),E(!0)}),[m]),A=(0,b.useCallback)((e=>{C(e>=410)}),[]),R=(0,b.useCallback)((()=>{if(!T.current)return 0;const{firstChild:e,offsetLeft:t,offsetWidth:r}=T.current,n=t+r;return([...e.childNodes]||[]).filter((a=n,e=>e.offsetLeft+e.offsetWidth<=a)).length;var a}),[T]),I=(0,b.useCallback)((e=>r=>{switch(r.stopPropagation(),e){case lH:t(P.search.actions.keywordUpdated(null));break;case sH:t(ri(null));break;default:t(ii(e,[]))}}),[t]),N=(0,b.useCallback)((()=>{t(Qa({silent:!0})),t(P.search.actions.keywordUpdated({debounceTime:K.XU}))}),[t]),L=(0,b.useMemo)((()=>m.map((e=>v().createElement(uV,{key:e.fieldName,title:e.title,values:e.values,onDelete:I(e.fieldName)})))),[m,I]),U=L.slice(0,y),j=L.slice(y),F=(0,_.when)((0,_.propEq)("length",1),(0,_.reject)(x.isEmptySearchGroup))(p),M=0===L.length&&0===F.length;return v().createElement("div",{className:e.container,"data-reltio-id":"search-bar"},v().createElement("div",{className:e.header},v().createElement("div",{className:e.captionWrapper,"data-reltio-id":"search-bar-total-profiles"},v().createElement(Ag(),{component:"span",classes:{body1:e.profileNumber}},mi().number(u,"0,0")),v().createElement(Ag(),{variant:"body2",component:"span",classes:{root:e.profileText}},mi().text("total profiles"))),v().createElement(eB,null),v().createElement(QV,null),v().createElement(nE(),{color:"primary",className:e.clearButton,onClick:N,disabled:M,"data-reltio-id":"reltio-search-clear"},mi().text("clear")),!d&&v().createElement("div",{className:e.searchBarControls,"data-reltio-id":"search-bar-controls"},v().createElement(Gp.Z,{handleWidth:!0,onResize:A}),v().createElement($V,null),v().createElement(Lg(),{orientation:"vertical",className:e.splitter}),v().createElement(iH,{showTypography:O}))),v().createElement(Gp.Z,{handleWidth:!0,onResize:w}),v().createElement(oV(),{in:!c&&y>0,timeout:500},v().createElement("div",{ref:T,className:e.facetsBar,"data-reltio-id":"search-facets-bar"},v().createElement("div",{className:e.showBar},U),j.length>0&&v().createElement(dV,{items:j}))))},pH=(0,kp.Z)({title:{flexGrow:1},collapseIcon:{transform:"rotate(0deg)",transition:"transform 0.35s ease"},"collapseIcon--inverted":{transform:"rotate(-180deg)"},backButtonContainer:{margin:"12px"},collapseButton:{padding:"8px",marginRight:"12px"},toolBar:{minHeight:0,flexShrink:1,overflow:"hidden"}}),dH=e=>{let{onBackBtnClick:t}=e;const r=pH();return v().createElement(OF(),{disableGutters:!0,classes:{root:r.toolBar}},v().createElement(wd.k,{tooltipTitle:mi().text("Switch to basic mode"),size:"L",icon:YI(),className:r.backButtonContainer,onClick:t}),v().createElement(Ag(),{variant:"subtitle1",className:r.title},mi().text("Advanced search")))};dH.propTypes={onBackBtnClick:vp().func};const mH=dH,gH=(0,kp.Z)((e=>({query:{color:e.palette.text.secondary,fontSize:"12px",letterSpacing:0,lineHeight:"16px"},[x.READABLE_QUERY_PRIMITIVE_TYPES.entityTypeLabel]:{color:"#03904A"},[x.READABLE_QUERY_PRIMITIVE_TYPES.attributeLabel]:{color:"#059BEA"},[x.READABLE_QUERY_PRIMITIVE_TYPES.specialAttributeLabel]:{color:"#EA05CF"},[x.READABLE_QUERY_PRIMITIVE_TYPES.attributeFilter]:{color:"#7F00FF"},[x.READABLE_QUERY_PRIMITIVE_TYPES.attributeValue]:{color:"#000000"}})));function yH(){return yH=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},yH.apply(this,arguments)}const fH=(0,b.forwardRef)(((e,t)=>{let{readableQuery:r=[],className:n}=e,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["readableQuery","className"]);const i=gH();return v().createElement("span",yH({ref:t,className:O()(i.query,n),"data-reltio-id":"search-readable-query"},a),r.map(((e,t)=>{let{type:r,text:n}=e;return v().createElement("span",{key:t,className:i[r]},n)})))}));fH.displayName="ReadableSearchQuery";var hH=r(82466),EH=r.n(hH);const bH=(0,kp.Z)({collapseIcon:{transform:"rotate(0deg)",transition:"transform 0.35s ease"},"collapseIcon--inverted":{transform:"rotate(-180deg)"}});function vH(){return vH=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vH.apply(this,arguments)}const TH=e=>{let{collapseBtnActive:t,onCollapseBtnClick:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["collapseBtnActive","onCollapseBtnClick"]);const a=bH();return v().createElement(wd.k,vH({size:"L",icon:EH(),tooltipTitle:t?mi().text("Collapse panel"):mi().text("Expand panel"),onClick:r,iconClassName:O()(a.collapseIcon,{[a["collapseIcon--inverted"]]:!t}),"data-reltio-id":"reltio-search-advanced-search-collapse-panel"},n))};TH.propTypes={backBtnDisabled:vp().bool,onBackBtnClick:vp().func,collapseBtnActive:vp().bool,onCollapseBtnClick:vp().func};const OH=TH;var xH=r(89808),CH=r.n(xH),SH=r(19820),wH=r.n(SH);function AH(){return AH=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},AH.apply(this,arguments)}const RH=e=>{let{isFullscreen:t=!1,onClick:r=_.identity}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["isFullscreen","onClick"]);return v().createElement(wd.k,AH({size:"L",icon:t?wH():CH(),tooltipTitle:t?mi().text("Exit full screen"):mi().text("Full screen"),onClick:r,"data-reltio-id":"reltio-search-advanced-search-full-screen"},n))};RH.propTypes={isFullscreen:vp().bool,onClick:vp().func};const _H=RH,IH=(0,kp.Z)({resultQueryPanel:{background:"#E3E7E9",display:"flex",flex:"0 0 auto",alignItems:"center"},resultQuery:{flexGrow:1,padding:"10px 10px 10px 24px",fontSize:"12px",lineHeight:"16px",color:"rgba(0,0,0,0.38)"},queryContainer:{height:"auto",maxHeight:"48px",paddingRight:"24px",paddingTop:"4px",overflow:"auto"},queryContainerMinHeight:{maxHeight:"18px"},query:{cursor:"pointer"},noQuery:{color:"#000000"},actionsPanel:{display:"flex",paddingRight:"12px"},collapseButton:{marginRight:"-4px"}}),NH=e=>{let{groups:t,hasMinSize:r,lookups:n,metadata:a,attributesPresentation:i,collapseBtnActive:o,isFullscreen:l,onCollapseBtnClick:s,onFullScreenBtnClick:c,keyword:u,map:p,dispatch:d}=e;const m=IH(),[g,y]=(0,b.useState)(0),[f,h]=(0,b.useState)(0),E=(0,b.useMemo)((()=>(0,Ba.Jk)((0,Et.P0)(a,t))),[a,t]),T=(0,x.buildReadableQuery)(a,i,n,t,u,p),C=mi().text("Copy to clipboard"),[S,w]=(0,b.useState)(C),A=(0,b.useCallback)((0,x.debounce)((()=>{d({type:ft})}),500),[d]),R=(0,b.useCallback)((()=>{zV((0,x.buildReadableQueryToString)(a,i,n,t,u,p)).then((()=>w(mi().text("Query was copied")))).catch((()=>w(mi().text("Error"))))}),[t,i,n,a,u,p]),_=(0,b.useCallback)((()=>{w(C)}),[C]),I=(0,b.useCallback)((e=>{y(e.clientX),h(e.clientY)}),[]);(0,OE.D)(A,[A,E]);const N=(0,b.useMemo)((()=>({anchorEl:{clientWidth:1,clientHeight:1,getBoundingClientRect:()=>({left:g,bottom:f,height:1,right:g,width:1,top:f})}})),[g,f]);return v().createElement("div",{className:m.resultQueryPanel},v().createElement("div",{className:m.resultQuery},mi().text("Search query"),v().createElement("div",{className:O()(m.queryContainer,{[m.queryContainerMinHeight]:r})},T.length>0?v().createElement(gf(),{key:S,title:S,onClose:_,PopperProps:N},v().createElement(fH,{readableQuery:T,onMouseEnter:I,onClick:R,className:m.query})):v().createElement("span",{className:m.noQuery},mi().text("Build your search and view your search query here")))),v().createElement("div",{className:m.actionsPanel},v().createElement(OH,{collapseBtnActive:o,onCollapseBtnClick:s,className:m.collapseButton}),v().createElement(_H,{isFullscreen:l,onClick:c})))};var DH=r(28345),PH=r.n(DH),kH=r(68157);const LH=(0,kp.Z)((e=>({readOnlyLogicOperatorContainer:{display:"flex",alignItems:"center",marginRight:"40px",width:"76px",fontSize:"14px",color:e.palette.text.secondary,maxHeight:"46px"}}))),UH=e=>{let{className:t,rowData:r}=e;const n=LH();return v().createElement("div",{className:O()(n.readOnlyLogicOperatorContainer,t)},r&&r.operator?(0,kH.capitalize)(r.operator):mi().text("Where"))},jH=(0,kp.Z)((e=>({readOnlyFilter:{display:"flex",alignItems:"center",fontSize:"14px",color:e.palette.text.secondary,width:"50px",marginLeft:"12px",maxHeight:"46px"}}))),FH=e=>{let{className:t,rowData:r}=e;const n=jH();return v().createElement("div",{className:O()(n.readOnlyFilter,t)},r&&r.filter?(0,x.getFilterOptionLabel)(r.filter):mi().text("equals"))},MH=(0,kp.Z)((()=>({row:{display:"flex",marginBottom:"12px"},rowItem:{paddingRight:"10px",display:"flex"},fullWidth:{flexGrow:"1",flexBasis:"0",overflow:"hidden"},hidden:{visibility:"hidden"}})));const VH=(0,b.memo)((e=>{let{classes:t={},rowData:r,previousRowData:n,LogicOperatorComponent:a=UH,AttributeSelectorComponent:i,FilterSelectorComponent:o=FH,ValuesEditorComponent:l,ActionsComponent:s,filterSelectorRef:c,attributeSelectorProps:u={}}=e,p=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["classes","rowData","previousRowData","LogicOperatorComponent","AttributeSelectorComponent","FilterSelectorComponent","ValuesEditorComponent","ActionsComponent","filterSelectorRef","attributeSelectorProps"]);const d=MH();return v().createElement("div",{className:O()(d.row,t.root),"data-reltio-id":"query-builder-row"},v().createElement(a,{className:t.logicOperatorContainer,rowContext:p,rowData:n}),v().createElement("div",{className:O()(d.rowItem,t.attributeSelectorContainer),"data-reltio-id":"query-builder-row-attribute-selector"},v().createElement(i,{attributeSelectorProps:u,rowContext:p,rowData:r})),v().createElement("div",{className:O()(d.rowItem,t.filterSelectorContainer),"data-reltio-id":"query-builder-row-filter-selector"},v().createElement(o,{textFieldInputRef:c,rowContext:p,rowData:r})),v().createElement("div",{className:O()(d.rowItem,d.fullWidth,t.valuesEditorContainer),"data-reltio-id":"query-builder-row-values-editor"},v().createElement(l,{rowContext:p,rowData:r})),v().createElement("div",{className:O()(d.rowItem,t.actionsContainer,{[d.hidden]:!r}),"data-reltio-id":"query-builder-row-actions"},v().createElement(s,{rowContext:p,rowData:r})))}));function BH(){return BH=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},BH.apply(this,arguments)}const zH=(0,v().memo)((e=>{let{className:t,rowClasses:r,rowsData:n,lastRowAttributeSelectorProps:a,filterSelectorRef:i,filterSelectorRefIndex:o}=e,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","rowClasses","rowsData","lastRowAttributeSelectorProps","filterSelectorRef","filterSelectorRefIndex"]);const s=(e,t,n)=>{const s=t>0?(0,_.path)([t-1],n):null,c=t===n.length?{attributeSelectorProps:a}:{};return v().createElement(VH,BH({key:e&&e.id,rowData:e,previousRowData:s,classes:r,filterSelectorRef:t===o?i:void 0},l,c))};return v().createElement("div",{"data-reltio-id":"reltio-query-builder-rows-group",className:t},n.map(s),s(null,n.length,n))})),HH=(0,kp.Z)((()=>({select:{padding:"6px 16px 7px"},dropDown:{width:"100px","&:before":{content:"none !important"}}}))),YH=e=>{let{className:t,value:r,onChange:n}=e;const a=HH();return v().createElement(EV.k,{className:O()(a.dropDown,t),classes:a,value:r,entries:x.operatorOptions,onChange:n})},WH={position:"absolute",width:1,background:"rgba(43, 152, 240, 0.3)",height:16,left:36};function GH(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){qH(e,t,r[t])}))}return e}function qH(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ZH=(0,kp.Z)((e=>({title:{},rows:{},actions:{},container:{backgroundColor:e.palette.background.paper,padding:"18px 16px 0",position:"relative",margin:"16px 0 19px","& $title":{color:e.palette.text.hint,fontSize:12,marginBottom:20},"& $rows":{display:"flex",flexDirection:"column"},"& $actions":{position:"absolute",top:16,right:16,paddingTop:0},"&:after, &:before":{content:"",width:1,height:16,position:"absolute",top:"100%",left:35,background:"rgba(43, 152, 240, .3)"},"&:before":{top:"initial",bottom:"100%"},"&:first-child":{marginTop:0,"&:before":{content:"none"}}},entityTypeSelector:{width:"394px",height:"46px"},entityTypeSelectorContainer:{marginBottom:"20px"},logicOperator:{position:"relative",paddingLeft:16,"&:before":{}},verticalOperatorLine:GH({},WH),upperLine:{marginTop:-18},lowerLine:{marginBottom:-16,bottom:0}}))),$H="46px",KH=(0,kp.Z)((e=>({row:{marginBottom:"20px","&:hover $actions":{opacity:1}},logicOperatorContainer:{marginTop:"7px",marginRight:"40px",width:"100px"},logicOperator:{fontSize:"14px",color:e.palette.text.secondary},logicOperatorPlaceholder:{paddingLeft:"16px",paddingTop:"10px"},attributeSelect:{width:"254px",height:$H},filterSelect:{width:"190px"},valuesWrapper:{width:"100%",display:"flex",minHeight:$H,alignItems:"flex-start",boxSizing:"border-box"},actions:{opacity:"0",transition:"opacity 0.3s",paddingTop:"13px",width:"88px",height:"24px",display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:"0",marginLeft:"8px","& >span":{cursor:"pointer",display:"flex"},"& $actionIcon":{cursor:"pointer",color:"rgba(0, 0, 0, .54)"}},actionIcon:{}}))),XH=e=>e.join(", "),QH=e=>`calc(${(0,_.isNil)(e)?"100%":`${e}px`} - 35px)`,JH=(0,kp.Z)({listLabelContainer:{display:"flex",alignItems:"center",position:"relative",overflow:"hidden",whiteSpace:"nowrap",justifyContent:"space-between",height:"100%",width:"100%"},listLabel:{visibility:"hidden",position:"absolute",overflow:"hidden"},visibleItemsLabel:{textOverflow:"ellipsis",marginRight:"5px",overflow:"hidden",flex:1,flexBasis:"auto"},hiddenCount:{color:"rgba(0,0,0,0.87)",fontSize:"13px",lineHeight:"15px",padding:"5px 8px",borderRadius:"16px",backgroundColor:"rgba(0,0,0,.12)"}}),eY=e=>{let{list:t,maxWidth:r}=e;const n=JH(),a=(0,b.useRef)(),[i,o]=(0,b.useState)(0);(0,b.useEffect)((()=>{o(((e,t)=>{const r=e.length,n=((e,t)=>{if(t){const r=((e,t)=>{const{childNodes:r,clientLeft:n,clientWidth:a}=t;if(r.length>0){const[t]=Array.from(r),i=document.createRange();i.setStart(t,0);for(let r=0;r<e.length;r++){i.setEnd(t,i.endOffset+e[r].length);const{width:o}=i.getBoundingClientRect();if(n+o>a)return r;r!==e.length-1&&i.setEnd(t,i.endOffset+", ".length)}}return-1})(e,t);return-1===r?0:e.length-r}return 0})(e,t);return r-Math.max(1,r-n)})(t,a.current))}),[t]);const l=XH(t),s=i>0,c=s?XH(t.slice(0,-i)):l;return v().createElement(gf(),{title:s?l:""},v().createElement("div",{className:n.listLabelContainer},v().createElement("div",{style:{width:QH(r)},className:n.listLabel,ref:a},l),v().createElement("div",{className:n.visibleItemsLabel},c),s&&v().createElement("div",{className:n.hiddenCount},`+${i}`)))};function tY(){return tY=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},tY.apply(this,arguments)}const rY=(0,_.always)(32),nY=(0,b.memo)((e=>{let{selectedItems:t,onItemClick:r,focusIndex:n,width:a,height:i}=e,o=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["selectedItems","onItemClick","focusIndex","width","height"]);return v().createElement(Zp,tY({getItemSize:rY,renderItem:(e,a,i)=>{let{item:o}=a;const l=!!t.find((e=>o.uri===e)),s=i===n;return v().createElement(bd,{key:o.uri,onClick:r,checked:l,data:o,label:v().createElement(vd.o,{text:o.label,highlight:o.filterText}),labelInText:o.label,style:e,isFocused:s,hideIcon:!0,LogoIcon:o.LogoIcon})},focusIndex:n,fixedTitle:!1,disableHorizontalScrollbar:!0,width:a,height:i},o))}));nY.displayName="SelectMetadataTypesList";const aY=(0,kp.Z)({root:{borderRadius:"4px 4px 0 0",margin:0,fontSize:"14px",letterSpacing:0,lineHeight:"16px"},inputLabel:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",width:"100%",cursor:"pointer",top:"calc(50% - 23px)"},inputText:{display:"flex",flexGrow:1,alignItems:"center",height:"25px",width:"calc(100% - 53px)",paddingTop:"18px",paddingBottom:"4px",color:"rgba(0,0,0,0.87)",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},input:{width:0,cursor:"pointer","&.Mui-disabled":{backgroundColor:"transparent",cursor:"default"},"&$emptyInput":{width:"100%"}},emptyInput:{},disabledInput:{},disabledPointer:{},disabledUnderline:{},inputRoot:{flex:1,paddingRight:"4px",fontSize:"14px",letterSpacing:0,lineHeight:"16px",cursor:"pointer","&$disabledInput":{backgroundColor:"rgba(0, 0, 0, 0.03)",cursor:"pointer","&$disabledPointer":{cursor:"default"},"&$disabledUnderline::before":{borderBottomStyle:"solid"}}},icon:{transform:"rotate(0deg)",transition:"transform 0.35s ease"},"popup-opened-icon":{transform:"rotate(-180deg)"}});function iY(){return iY=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},iY.apply(this,arguments)}function oY(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){lY(e,t,r[t])}))}return e}function lY(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const sY=(0,b.memo)((e=>{let{placeholder:t,classes:r={},items:n,selectedItemsUris:a,onChange:i,ListLabelProps:o={},disabled:l,enableEmptyValueUnderline:s,single:c,label:u,dataReltioId:p,selectionPopupTitle:d}=e;const m=aY(),[g,y]=(0,b.useState)(!1),f=(0,b.useCallback)((()=>y(!0)),[]),h=(0,b.useCallback)((()=>y(!1)),[]),[E,T]=(0,b.useState)(""),C=(0,b.useCallback)((()=>T("")),[]),S=(0,b.useCallback)((0,_.pipe)(C,h),[h,C]),w=n.filter((e=>{let{label:t}=e;return x.utils.strings.search(t,E)})).map(((e,t)=>({item:{item:oY({},e,{filterText:E})},index:t}))),A=(0,b.useMemo)((()=>(0,_.pipe)((0,_.map)((e=>n.find((0,_.propEq)("uri",e)))),(0,_.reject)(_.isNil),(0,_.pluck)("label"))(a)),[a,n]),R=(0,b.useCallback)(((e,t)=>{c?(i(t?[e.uri]:[]),S()):i(t?a.concat(e.uri):a.filter((t=>t!==e.uri)))}),[a,i,c,S]),I=(0,b.useCallback)((e=>{let{item:t}=e;const r=!a.includes(t.uri);R(t,r)}),[a,R]),{focusIndex:N,handleKeyDown:D}=$p({items:w,open:g,onSelectFocusedItem:I,selectedItems:a,onClose:S}),P=(0,b.useRef)(),k=P.current?P.current.getBoundingClientRect().width:0,L=Math.max(k,255),U=0===a.length;return v().createElement(v().Fragment,null,v().createElement(BV(),{label:u,ref:P,InputProps:{startAdornment:U&&!t?null:v().createElement("div",{className:O()(m.inputText,r.inputText)},U?v().createElement("div",null,t):v().createElement(eY,iY({},o,{list:A}))),classes:{root:m.inputRoot,input:O()(m.input,r.input,{[m.emptyInput]:U&&!t}),disabled:O()(m.disabledInput,{[m.disabledPointer]:l}),underline:m.disabledUnderline},endAdornment:v().createElement(Pp.T,{size:"L",icon:dy(),iconClassName:O()(m.icon,{[m["popup-opened-icon"]]:g}),disabled:l}),readOnly:!0,disableUnderline:U&&!s},inputProps:{tabIndex:-1},InputLabelProps:{classes:{root:O()(m.inputLabel,r.label)}},value:"",onClick:l?void 0:f,classes:{root:O()(m.root,r.root)},size:"small",variant:"filled",disabled:l,"data-reltio-id":p}),v().createElement(zp,{open:g,anchorEl:P.current,onClose:S,onSearch:T,title:d,containerWidth:L,containerHeight:355,searchInputOnKeyDown:D,transformOrigin:{horizontal:"left",vertical:"top"},anchorOrigin:{horizontal:"left",vertical:"bottom"},PaperProps:{"data-reltio-id":`${p}-popup`}},v().createElement(nY,{items:w,onItemClick:R,selectedItems:a,width:L,height:245,focusIndex:N})))}));sY.displayName="MetadataTypesSelector";const cY=(0,b.memo)((e=>{let{entityTypes:t,selectedEntityTypes:r,single:n,placeholder:a,enableEmptyValueUnderline:i,onChange:o,classes:l={},ListLabelProps:s={},disabled:c=!1}=e;const u=(0,b.useMemo)((()=>t.filter(x.isAvailableEntityType)),[t]);return v().createElement(sY,{items:u,selectedItemsUris:r,single:n,placeholder:a,enableEmptyValueUnderline:i,onChange:o,classes:l,ListLabelProps:s,disabled:c,label:mi().text("Entity type"),dataReltioId:"entity-type-selector",selectionPopupTitle:mi().text("Select entity types")})}));cY.displayName="EntityTypesSelector";const uY=e=>{let{selectedEntityTypes:t,onChange:r,classes:n={},ListLabelProps:a={}}=e;const i=(0,Tp.useSelector)(k().selectors.getMetadata),o=(0,Tp.useSelector)(ui.t9),l=(0,Tp.useSelector)(ki.Xf),s=(0,b.useCallback)(l?e=>{let{uri:t}=e;return l.includes(t)}:_.identity,[l]),c=(0,b.useMemo)((()=>i.entityTypes.filter(s).sort(l?(0,x.orderByArrayComparator)(l,"uri"):e=>0).filter((e=>{let{uri:t}=e;return(0,x.isAvailableEntityTypeForDataTenant)(o,t)}))),[i,o,s,l]);return v().createElement(cY,{classes:n,entityTypes:c,onChange:r,selectedEntityTypes:t,ListLabelProps:a,placeholder:mi().text("All"),enableEmptyValueUnderline:!0})};uY.propTypes={selectedEntityTypes:vp().arrayOf(vp().string).isRequired,onChange:vp().func.isRequired,classes:vp().shape({root:vp().string,label:vp().string}),ListLabelProps:vp().shape({maxWidth:vp().number})};const pY=uY,dY=(0,kp.Z)({attribute:{cursor:"pointer",lineHeight:"16px",flexBasis:"100%",display:"flex",alignItems:"center",padding:"0 10px 0 16px",width:"calc(100% - 32px)","&$attributeWithValue":{borderBottom:"1px solid rgba(0,0,0,0.38)"},"&$disabled":{cursor:"default"}},disabled:{},attributeWithValue:{},noSelect:{},name:{fontSize:"14px",color:"rgba(0,0,0,0.87)",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",direction:"rtl",textAlign:"left",flex:"1 0",width:"0","& $noSelect":{color:"rgba(0,0,0,0.38)"},"&$disabled":{color:"rgba(0,0,0,0.26)","& $noSelect":{color:"rgba(0,0,0,0.26)"}}}}),mY=(0,_.either)((0,_.prop)("title"),(0,_.prop)("fieldName")),gY=e=>{let{value:t,getLabel:r=mY,onSelectAttributeClick:n,disabled:a=!1}=e;const i=dY(),o=t&&r(t);return v().createElement("div",{onClick:a?void 0:n,className:O()(i.attribute,{[i.attributeWithValue]:!!o},{[i.disabled]:a})},v().createElement(gd.Y,{value:o},v().createElement("div",{className:O()(i.name,{[i.disabled]:a})},o||v().createElement("span",{className:i.noSelect},mi().text("Select attribute")))),v().createElement(Pp.T,{size:"M",icon:dy(),disabled:a}))},yY=(0,kp.Z)({subHeader:{backgroundColor:"#f5f5f5",padding:"0 16px",margin:0,display:"flex",alignItems:"center",color:"rgba(0,0,0,0.84)",fontSize:"14px",fontWeight:500}});function fY(){return fY=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},fY.apply(this,arguments)}function hY(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){EY(e,t,r[t])}))}return e}function EY(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const bY=(0,b.memo)((e=>{let{selectedAttributes:t,onItemClick:r,focusIndex:n,hideCheckBox:a}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["selectedAttributes","onItemClick","focusIndex","hideCheckBox"]);const o=yY(),l=(0,w.AH)();return v().createElement(Zp,fY({getItemSize:(e,t)=>t.items?40:28,renderItem:(e,i,o)=>{let{item:l,level:s,groupId:c,groupName:u}=i;const p=mL(l,t),d=o===n;return v().createElement(bd,{key:`item-${c}-${l.fieldName}`,onClick:r,checked:p,data:hY({},l,{groupName:u}),notSelectable:l.notSelectable,hideCheckBox:a,label:v().createElement(vd.o,{text:l.title,highlight:l.filterText}),labelInText:l.title,level:s,style:e,isFocused:d,groupId:c,LogoIcon:l.LogoIcon})},renderGroupTitle:(e,t)=>v().createElement(og(),{component:"div",className:o.subHeader,style:e,key:`group-${t.item.id}`},t.item.needGroupIcon&&v().createElement(qg,{group:t.item,metadata:l}),t.item.title),focusIndex:n},i))}));function vY(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){TY(e,t,r[t])}))}return e}function TY(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const OY=(e,t)=>e.title.toLowerCase().includes(t.toLowerCase()),xY=(e,t)=>OY(e,t)||(e.children||[]).some((e=>xY(e,t))),CY=(e,t)=>e.findIndex(dL(t)),SY=(0,x.getMaxItemWidth)("title"),wY=function(e,t,r,n){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,i=arguments.length>5&&void 0!==arguments[5]&&arguments[5];const o=OY(e,n);return[{item:n?vY({},e,{filterText:n}):e,level:a,groupId:t,groupName:r}].concat(e.children?e.children.filter((e=>i||o||xY(e,n))).flatMap((e=>wY(e,t,r,n,a+1,i||o))):[]).flat()},AY=(0,_.curry)(((e,t)=>t.map((t=>({item:t,items:t.attributes.filter((t=>xY(t,e))).map((r=>wY(r,t.id,t.title,e)))}))).filter((e=>e.items.length)))),RY=(0,kp.Z)({selector:{minWidth:"200px",width:"100%",alignItems:"stretch",background:"rgba(0,0,0, 0.0267)",boxSizing:"border-box",borderRadius:"4px",display:"flex"}}),_Y=(0,b.memo)((e=>{let{className:t,itemsGroups:r,value:n,getLabel:a,onSelect:i,onRestoreFocus:o=_.identity,onOpenPopup:l=_.identity,disableRestoreFocus:s=!1,disableEnforceFocus:c=!1,single:u=!1,ungroup:p=!1,disabled:d=!1,hideCheckBox:m=!1}=e;const g=RY(),[y,f]=(0,b.useState)(null),h=(0,b.useCallback)((()=>f(null)),[]),E=!!y,[T,x]=(0,b.useState)(""),C=(0,b.useCallback)((()=>x("")),[]),[S,w]=(0,b.useState)([]),A=(0,b.useCallback)((()=>w([])),[]),R=(0,b.useMemo)((()=>AY(T,r)),[r,T]),I=(0,b.useMemo)((()=>(0,_.pipe)((0,_.when)((0,_.always)(p),(0,_.chain)((0,_.pipe)((0,_.prop)("items"),_.flatten,(0,_.map)((0,_.pick)(["item","level"]))))),Hp)(R)),[p,R]),N=(0,b.useMemo)((()=>Math.max(SY(R),308)),[R]),D=(0,_.pipe)((0,_.tap)((0,_.pipe)(A,C,h)),o),P=(0,b.useRef)(),k=(0,b.useCallback)(((e,t)=>{i({checked:t,attribute:e,index:t?S.length:CY(S,e),selectedAttributes:S}),u?(w(t?[e]:[]),D({})):(w((e=>{let{attribute:t,selectedAttributes:r,checked:n}=e;return n?r.concat(t):r.filter((e=>!dL(t,e)))})({selectedAttributes:S,attribute:e,checked:t})),P.current&&P.current.focus())}),[S,i,u,D,P]),L=(0,b.useCallback)((e=>{let{onListItemClick:t,selectedAttributes:r}=e;return e=>{let{item:n,groupData:a}=e;const i=mL(n,r);t(vY({},n,{groupName:a.groupName}),!i)}})({onListItemClick:k,selectedAttributes:S}),[k,S]),{focusIndex:U,handleKeyDown:j}=$p({items:I,open:E,onSelectFocusedItem:L,selectedItems:S,onClose:D});return v().createElement("div",{className:O()(g.selector,t),"data-reltio-id":"attribute-selector"},v().createElement(gY,{value:n,getLabel:a,onSelectAttributeClick:e=>{l(),f(e.currentTarget)},disabled:d}),v().createElement(zp,{open:E,anchorEl:y,onClose:D,onSearch:x,title:mi().text("Select attribute"),containerWidth:N,containerHeight:507,searchInputOnKeyDown:j,anchorOrigin:{horizontal:"right",vertical:"bottom"},searchInputRef:P,disableRestoreFocus:s,disableEnforceFocus:c},v().createElement(bY,{items:I,onItemClick:k,selectedAttributes:S,width:N,height:400,focusIndex:U,hideCheckBox:m})))}));var IY=r(80349);function NY(){return NY=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},NY.apply(this,arguments)}const DY=(0,b.memo)((e=>{let{entityTypes:t,recommendedAttributes:r,showReferencedEntityAttributes:n=!0,firstLevelAttributesFilter:a}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["entityTypes","recommendedAttributes","showReferencedEntityAttributes","firstLevelAttributesFilter"]);const o=(0,Tp.useSelector)(k().selectors.getMetadata),l=(0,Tp.useSelector)(ui.t9),s=(0,Tp.useSelector)(k().selectors.getCanUserReadWorkflowDataTask),c=(0,Tp.useSelector)(ki.Xf),u=(0,Tp.useSelector)(k().selectors.getDataTenants),p=(0,b.useMemo)((()=>(0,_.pipe)(IY.s1,(0,_.when)((0,_.always)(!n),IY.a),(0,j.ED)(l))({allowedEntityTypes:c,firstLevelAttributesFilter:a},o,t,r,u,s)),[t,o,l,c,a,r,n,u,s]);return v().createElement(_Y,NY({},i,{itemsGroups:p}))})),PY=e=>{let{rowData:t,rowContext:{entityTypes:r,dispatchGroupAction:n},attributeSelectorProps:a={}}=e;const i=KH(),o=t&&t.id,l=(0,b.useCallback)((e=>{n($o,o,e)}),[o,n]),s=(0,b.useCallback)((e=>(0,x.getSearchGroupAttributeLabel)({data:e})),[]);return v().createElement(DY,{className:i.attributeSelect,value:t&&t.data,getLabel:s,entityTypes:r,onSelect:l,onRestoreFocus:a.onRestoreFocus,onOpenPopup:a.onOpen,disableRestoreFocus:a.disablePopoverRestoreFocus,disableEnforceFocus:a.disablePopoverRestoreFocus})};PY.propTypes={rowData:PB,rowContext:vp().shape({entityTypes:vp().arrayOf(vp().string),dispatchGroupAction:vp().func}),attributeSelectorProps:vp().shape({onRestoreFocus:vp().func,onOpen:vp().func,disablePopoverRestoreFocus:vp().bool})};const kY=(0,b.memo)(PY);function LY(){return LY=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},LY.apply(this,arguments)}const UY=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",LY({width:"20",height:"20",viewBox:"0 0 20 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",focusable:"false"},r),v().createElement("defs",null,v().createElement("path",{d:"M20.222 6C21.21 6 22 6.8 22 7.778v12.444C22 21.2 21.209 22 20.222 22H7.778C6.79 22 6 21.2 6 20.222V7.778C6 6.8 6.791 6 7.778 6h12.444zM8 8v12h12V8H8zM4 18H2V4c0-1.1.9-2 2-2h14v2H4v14z",id:"svg397942461a"})),v().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},v().createElement("g",null,v().createElement("g",{transform:"translate(-2 -2)"},v().createElement("mask",{id:"svg397942461b",fill:"#fff"},v().createElement("use",{xlinkHref:"#svg397942461a"})),v().createElement("g",{mask:"url(#svg397942461b)",fill:"#000",fillOpacity:".54"},v().createElement("path",{d:"M0 0h24v24H0z"}))))))},jY=e=>!(e&&e.data),FY=e=>{let{rowData:t,rowContext:{dispatchGroupAction:r}}=e;const n=KH(),a=t&&t.id,i=(0,b.useCallback)((()=>r(Qo,a)),[a,r]),o=(0,b.useCallback)((()=>r(Jo,a)),[a,r]),l=(0,b.useCallback)((()=>r(Wo,a)),[a,r]);return t&&v().createElement("div",{className:O()(n.actions)},v().createElement(gf(),{title:mi().text("Add"),placement:"bottom"},v().createElement(PH(),{className:n.actionIcon,onClick:l})),!jY(t)&&v().createElement(gf(),{title:mi().text("Duplicate"),placement:"bottom"},v().createElement("div",{className:n.actionIcon,tabIndex:-1},v().createElement(UY,{onClick:o,tabIndex:-1}))),v().createElement(gf(),{title:mi().text("Delete"),placement:"bottom"},v().createElement(_p(),{onClick:i,className:n.actionIcon})))};FY.propTypes={rowData:PB,rowContext:vp().shape({dispatchGroupAction:vp().func})};const MY=(0,b.memo)(FY),VY={BY_LABEL:(0,r(51774).c)({stringify:(0,_.prop)("label")})},BY=e=>{let{className:t,attribute:r,textFieldInputRef:n,isDisabled:a,height:i,onChange:o}=e;const l=(0,_.pipe)(x.getFilterOptionLabel,kH.capitalize);return v().createElement(cj,{label:"",placeholder:mi().text("Equals"),className:t,value:a?void 0:{value:r.filter,label:l(r.filter)},options:r&&r.data&&r.data.filterOptions.map((e=>({value:e,label:l(e)})))||[],height:i,onChange:o,isDisabled:a,filterOption:VY.BY_LABEL,textFieldInputRef:n})};BY.propTypes={className:vp().string,attribute:PB,textFieldInputRef:vp().object,isDisabled:vp().bool,onChange:vp().func,height:vp().number};const zY=(0,b.memo)(BY),HY=e=>{let{rowData:t,rowContext:{dispatchGroupAction:r},textFieldInputRef:n}=e;const a=KH(),i=t&&t.id,o=(0,b.useCallback)((e=>r(el,i,e.value)),[r,i]);return v().createElement(zY,{className:a.filterSelect,attribute:t,textFieldInputRef:n,isDisabled:jY(t),onChange:o})};HY.propTypes={rowData:PB,rowContext:vp().shape({dispatchGroupAction:vp().func}),textFieldInputRef:vp().object};const YY=(0,b.memo)(HY);var WY=r(23821);const GY=(0,kp.Z)({input:{margin:0,paddingBottom:"4px !important",paddingTop:"2px !important",borderRadius:"4px"},multipleInput:{minHeight:"46px",margin:0,padding:100},root:{borderRadius:"4px 4px 0 0",padding:0,display:"flex",alignItems:"center",margin:0},boolRoot:{borderRadius:"4px 4px",padding:11,display:"flex",alignItems:"center"},dateRoot:{borderRadius:"4px 4px 0 0",margin:0},booleanRadioEditor:{paddingLeft:"11px"}}),qY=e=>{let{attribute:t,groupId:r,onChange:n,updateValues:a,filterValues:i}=e;const{values:o,data:{attrType:l,fieldName:s}={},id:c}=t,u=(0,Tp.useSelector)((e=>(0,ro.Sw)(e,r,c)))||{},p=(0,Tp.useSelector)((e=>(0,ro.Ly)(e))),d=(0,Tp.useSelector)((e=>(0,ui.Sg)(e,s)));(0,b.useEffect)((()=>{p&&a()}),[o,p,d]),(0,b.useEffect)((()=>{p||a()}),[o,p]);const m=(0,b.useMemo)((()=>(0,_.propOr)([],0,o)),[o]),g=(0,b.useCallback)((0,_.pipe)(x.wrapInArray,n),[n]),{default:y,filtered:f}=u;return!y&&l?v().createElement("div",{className:"ValuesEditor-styles-loadingWrapper--_rOmn"},v().createElement(Tm(),{size:20,className:"ValuesEditor-styles-loading--mLFVu"})):v().createElement(df,{values:m,defaultOptions:y,filteredOptions:f,onChange:g,getSuggestions:i,tabSelectsValue:!1,canLoadMore:!(0,za.tW)(t.data)})};qY.propTypes={attribute:PB.isRequired,groupId:vp().string,onChange:vp().func,updateValues:vp().func,filterValues:vp().func};const ZY=qY,$Y=e=>{let{attribute:t,dispatchGroupAction:r,groupId:n}=e;const{values:a,data:{attrType:i,fieldName:o}={},filter:l}=t,s=GY(),c=(0,x.isTypeaheadAttrType)(i)||(0,_.allPass)([(0,_.propSatisfies)((0,_.either)(_.isNil,x.isEntityTypeUri),"uri"),(0,_.prop)("faceted"),(0,_.propEq)("type",x.DataTypes.TYPE_BLOB)])(i),u=(0,x.isEnumAttrType)(i)||(0,x.isLookupAttrType)(i),p=e=>r(tl,t.id,e);if((c||u)&&(0,x.isMultiValueOption)(l)){const e=()=>r(al,t),a=e=>{let{value:n,pageNumber:a,currentOptions:i}=e;return r(rl,{attribute:t,value:n,debounceTime:500,pageNumber:a,currentOptions:i})};return v().createElement(ZY,{attribute:t,groupId:n,onChange:p,filterValues:a,updateValues:e})}{const e=u?{type:x.DataTypes.TYPE_STRING}:(0,x.getAttrDataTypeDefinition)(i),t=(0,x.getDataTypeDefinitionForFilterValue)(e,l),r=(0,x.isDateType)(t.type)&&!(0,x.isDateRangeFilterOption)(l)&&s.dateRoot||(0,x.isBooleanType)(t.type)&&s.boolRoot||s.root;return v().createElement(WY.n,{filter:{filter:l,fieldName:o,values:a||[]},onChange:p,dataTypeDefinition:t,fullWidth:!0,TextFieldProps:{InputProps:{classes:{root:s.input},disableUnderline:(0,_.isNil)(a)||(0,_.isEmpty)((0,_.flatten)(a))}},color:"primary",booleanRadioEditorClassName:s.booleanRadioEditor,classes:{root:r},orientation:"horizontal"})}};$Y.propTypes={attribute:PB.isRequired,groupId:vp().string,dispatchGroupAction:vp().func};const KY=(0,b.memo)($Y),XY=e=>{let{rowData:t,rowContext:{dispatchGroupAction:r,groupId:n}}=e;const a=KH(),i=t&&(0,x.checkIfOptionHasValues)(t.filter);return v().createElement("div",{className:a.valuesWrapper,"data-reltio-id":"advanced-search-values-editor-wrapper"},!jY(t)&&i&&v().createElement(KY,{attribute:t,dispatchGroupAction:r,groupId:n}))};XY.propTypes={rowData:PB,rowContext:vp().shape({dispatchGroupAction:vp().func,groupId:vp().string})};const QY=(0,b.memo)(XY),JY=e=>{let{rowData:t,rowContext:{dispatchGroupAction:r}}=e;const n=KH(),a=t&&t.id,i=t&&t.operator,o=(0,b.useCallback)((e=>r(Ko,a,e)),[r,a]);return v().createElement("div",{className:n.logicOperatorContainer},i?v().createElement(YH,{className:n.logicOperator,value:i,onChange:o}):v().createElement("div",{className:O()(n.logicOperator,n.logicOperatorPlaceholder)},mi().text("Where")))};JY.propTypes={rowData:PB,rowContext:vp().shape({dispatchGroupAction:vp().func})};const eW=(0,b.memo)(JY);function tW(){return tW=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},tW.apply(this,arguments)}const rW=e=>{let{showLogicOperator:t,group:{id:r,attributes:n,operator:a,entityTypes:i=[]},dispatch:o,onAddEmptyGroup:l}=e,s=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["showLogicOperator","group","dispatch","onAddEmptyGroup"]);const c=ZH(),u=KH(),p=(0,b.useCallback)((()=>o({type:rt,payload:{groupId:r,id:(0,Ke.x0)()}})),[r,o]),d=(0,b.useCallback)((()=>o({type:et,payload:{groupId:r}})),[r,o]),m=(0,b.useCallback)((e=>o(((e,t)=>({type:Je,payload:{groupId:e,operator:t}}))(r,e))),[r,o]),g=(0,b.useCallback)((e=>o(((e,t)=>({type:Xe,payload:{groupId:e,entityTypes:t}}))(r,e))),[r,o]),y=(0,b.useCallback)((function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),a=1;a<t;a++)n[a-1]=arguments[a];return o(e(r,...n))}),[r,o]),f=(0,b.useRef)(null),h=(0,b.useRef)(null),E=(0,b.useRef)(null);E.current=n.length;const T=(0,b.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),f.current&&h.current!==E.current&&(f.current.querySelector("input").focus(),h.current=null)}),[]),x=(0,b.useCallback)((()=>{h.current=n.length}),[n.length]),C=(0,b.useMemo)((()=>[{text:mi().text("Add set"),onClick:l,id:"-group-add-set"},{text:mi().text("Duplicate set"),onClick:p,id:"-group-duplicate-set"},{text:mi().text("Delete set"),onClick:d,id:"-group-delete-set"}]),[l,p,d]),S=(0,b.useMemo)((()=>({root:u.row})),[u]),w=(0,b.useMemo)((()=>({onRestoreFocus:T,onOpen:x,disablePopoverRestoreFocus:!!T})),[T,x]);return v().createElement(v().Fragment,null,v().createElement("div",tW({className:c.container},s),v().createElement("div",{className:c.title},mi().text("Set")),v().createElement("div",{className:c.entityTypeSelectorContainer},v().createElement(pY,{classes:{root:c.entityTypeSelector},selectedEntityTypes:i,onChange:g})),v().createElement("div",{className:c.rows},v().createElement(zH,{rowClasses:S,rowsData:n,AttributeSelectorComponent:kY,FilterSelectorComponent:YY,ValuesEditorComponent:QY,ActionsComponent:MY,LogicOperatorComponent:eW,filterSelectorRefIndex:h.current,filterSelectorRef:f,lastRowAttributeSelectorProps:w,entityTypes:i,groupId:r,dispatchGroupAction:y}),v().createElement("div",{className:c.actions},v().createElement(LN,{menuId:`query-builder-group-actions-${r}`,buttonComponent:Pp.T,buttonProps:{icon:Vd(),size:"L","data-reltio-id":"reltio-search-query-builder-group-actions"},menuItems:C})))),t&&v().createElement("div",{className:c.logicOperator},v().createElement("div",{className:O()(c.verticalOperatorLine,c.upperLine)}),v().createElement("div",{className:O()(c.verticalOperatorLine,c.lowerLine)}),v().createElement(YH,{value:a,onChange:m})))};rW.propTypes={showLogicOperator:vp().bool,group:vp().shape({id:vp().string,attributes:vp().arrayOf(PB),entityTypes:vp().arrayOf(vp().string),operator:vp().string}),onAddEmptyGroup:vp().func,dispatch:vp().func};const nW=(0,b.memo)(rW);function aW(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){iW(e,t,r[t])}))}return e}function iW(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const oW=(0,kp.Z)((e=>({container:{backgroundColor:e.palette.background.default,transition:"flex-grow 0.35s ease",flexGrow:1,flexBasis:0,overflow:"hidden",display:"flex",flexDirection:"column"},button:{paddingLeft:23,fontSize:"14px",position:"relative"},scrollWrapper:{overflow:"auto",flex:"1 0 0px",padding:"0 60px"},groupsContainer:{margin:"0 auto",width:"100%",maxWidth:"1280px"},apply:{background:e.palette.background.default,textAlign:"right",padding:"15px 45px"},icon:{height:18,width:18,marginRight:"9px"},verticalOperatorLine:aW({},WH),upperLine:{marginTop:-18},searchByOvContainer:{marginLeft:-6,marginBottom:-14}}))),lW=e=>{let{groups:t,uiConfigShowSearchByOv:r,dispatch:n}=e;const a=oW(),i=(0,b.useRef)(null),o=(0,b.useRef)(null),l=(0,b.useCallback)((()=>n({type:tt,payload:{group:tr([])}})),[n]);return(0,b.useEffect)((()=>{if(0===t.length)l();else if(!(0,_.isNil)(o.current)&&o.current<t.length&&i.current){const e=i.current.childNodes;e[e.length-2].scrollIntoView({behavior:"smooth"})}o.current=t.length}),[t.length,l]),v().createElement("div",{className:a.scrollWrapper},v().createElement("div",{className:a.groupsContainer,ref:i},r&&v().createElement("div",{className:a.searchByOvContainer},v().createElement(Bh,{variant:"queryGroups"})),t.map(((e,t,r)=>v().createElement(nW,{key:e.id,group:e,dispatch:n,showLogicOperator:t!==r.length-1,onAddEmptyGroup:l,"data-reltio-id":`reltio-search-advansed-search-group-builder-${t}`}))),v().createElement("div",{className:a.button},v().createElement("div",{className:O()(a.verticalOperatorLine,a.upperLine)}),v().createElement(nE(),{onClick:l,color:"primary",size:"small","data-reltio-id":"reltio-search-advanced-search-add-set-button"},v().createElement(PH(),{color:"primary",className:a.icon,fontSize:"small"}),mi().text("ADD SET")))))};lW.propTypes={groups:vp().array,dispatch:vp().func,uiConfigShowSearchByOv:vp().bool};const sW=(0,Tp.connect)((e=>{var t;return{groups:(0,ro.go)(e),uiConfigShowSearchByOv:null!==(t=k().selectors.getShowSearchByOv(e))&&void 0!==t?t:(0,ki.cC)(e)}}))(lW),cW=P.search.actions.updateState({}),uW=e=>{let{open:t,onClose:r}=e;const n=(0,Tp.useDispatch)(),a=(0,b.useCallback)((()=>{r(),n(cW)}),[n,r]),i=(0,b.useCallback)((()=>{r(),n(Oi(!0,cW))}),[n,r]),o=(0,Tp.useSelector)(xo.LA),l=(0,Tp.useSelector)(ui.ai),s=(0,Tp.useSelector)(xo.WH),c=(0,Tp.useSelector)(xo.Jv),u=o?c&&!s:!l;return v().createElement(_B.U,{open:t,title:mi().text("Search filters cannot be displayed in Quick filters"),content:mi().text("You have advanced filters that cannot be displayed in Quick filters. Save your search or clear your filters to go to Quick filters."),discardCaption:mi().text("Clear search"),saveCaption:mi().text("Save search"),disabledSave:u,onCancel:r,onDiscard:a,onSave:i})};uW.propTypes={open:vp().bool,onClose:vp().func};const pW=uW,dW=(0,Tp.connect)((e=>({metadata:k().selectors.getMetadata(e),attributesPresentation:k().selectors.getAttributesPresentation(e),groups:(0,ro.go)(e),lookups:k().selectors.getLookups(e),keyword:k().selectors.getSearchKeyword(e),map:(0,ui.vH)(e),dataTenants:k().selectors.getDataTenants(e)})))((e=>{let{metadata:t,attributesPresentation:r,lookups:n,groups:a,keyword:i,map:o,onClose:l,collapsed:s,isFullscreen:c,onCollapse:u,onExpand:p,onFullscreen:d,dataTenants:m,dispatch:g}=e;const y=oW(),[f,h]=(0,b.useState)(!1),E=(0,_.ifElse)((0,_.always)(Ga(t,a,m)),(0,_.pipe)(l,p),(()=>h(!0)));return v().createElement("div",{className:y.container},v().createElement(mH,{onBackBtnClick:E}),v().createElement(sW,null),v().createElement(NH,{groups:a,lookups:n,dispatch:g,metadata:t,attributesPresentation:r,hasMinSize:s,collapseBtnActive:!s,isFullscreen:c,onCollapseBtnClick:s?p:u,onFullScreenBtnClick:c?p:d,keyword:i,map:o}),v().createElement(pW,{open:f,onClose:()=>h(!1)}))})),mW="calc(100% - 53px)",gW=e=>{let{isOpenAdvancedSearch:t,onCloseAdvancedSearch:r}=e;const n=pE(),[a,i]=(0,b.useState)(!1),[o,l]=(0,b.useState)("50%"),s=(0,b.useCallback)((()=>{i(!0),l("120px")}),[]),c=(0,b.useCallback)((()=>{i(!1),l("50%")}),[]),u=(0,b.useCallback)((e=>{let{percentageSize:t,isMaxSize:r,isMinSize:n}=e;i(n),l(r?mW:t)}),[]),p=(0,b.useCallback)((()=>{i(!1),l(mW)}),[]),d=v().createElement(v().Fragment,null,v().createElement(uH,null),v().createElement(Lg(),{className:n.divider})),m=v().createElement(v().Fragment,null,d,v().createElement(dW,{collapsed:a,isFullscreen:o===mW,onClose:r,onCollapse:s,onExpand:c,onFullscreen:p}));return v().createElement(fE,{className:n.resizablePanesWrapper,orientation:"horizontal",size:t?o:0,minSize:120,maxSize:-53,allowResize:t,onChange:u},v().createElement("div",{className:n.pane},t&&m),v().createElement("div",{className:n.pane},!t&&d,v().createElement(aV,null)))};gW.propTypes={isOpenAdvancedSearch:vp().bool,onCloseAdvancedSearch:vp().func};const yW=gW;function fW(){return fW=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},fW.apply(this,arguments)}const hW=e=>v().createElement("svg",fW({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgTenant"},e),v().createElement("path",{d:"M2 0h13v2H8v19h12V6h-9V4h11v19H2V0zm9 8h7v2h-7V8zm0 4h7v2h-7v-2zm0 4h7v2h-7v-2zM4 4v2h2V4H4zm0 8v2h2v-2H4zm0-4v2h2V8H4zm0 8v2h2v-2H4z",fill:"#000",stroke:"none",strokeWidth:1,fillRule:"evenodd"})),EW=(0,kp.Z)((()=>({labelWrapper:{height:"24px",display:"inline-flex",alignItems:"center"},tenantIcon:{height:"24px",width:"24px",marginRight:"4px",opacity:.38},tenantLabel:{lineHeight:"15px",fontSize:"13px",color:"rgba(0,0,0,0.38)"}}))),bW=e=>{let{className:t}=e;const r=EW(),n=(0,w.xz)(),a=(0,w.fN)(),i=`${n}${a?" - "+a.toUpperCase():""}`;return v().createElement("div",{className:O()(r.labelWrapper,t)},v().createElement(hW,{className:r.tenantIcon,"data-reltio-id":"reltio-tenant-icon"}),v().createElement(Ag(),{className:r.tenantLabel},i))},vW=(0,kp.Z)((e=>({container:{display:"flex",flexDirection:"row",minHeight:"64px",flexShrink:0,alignItems:"center",paddingRight:"14px"},entityTypeTitle:{fontSize:"18px",letterSpacing:0,lineHeight:"21px",marginRight:"16px",flexShrink:0},profileText:{color:e.palette.text.secondary,fontSize:"14px",lineHeight:"28px",flexShrink:0},profileNumber:{color:e.palette.text.secondary,fontWeight:600,paddingLeft:"3px",paddingRight:"8px",flexShrink:0},splitter:{marginRight:"15px",marginLeft:"18px",height:"32px"},clearButton:{marginRight:"auto",marginLeft:"14px",flexShrink:0},searchBox:{flex:"1 1 auto",width:"100%",maxWidth:"538px"},searchQueryContainer:{display:"flex",flexDirection:"column",minHeight:"50px",flexShrink:0,paddingLeft:"24px",paddingRight:"14px",alignItems:"flex-start",color:e.palette.text.secondary,fontSize:"12px",letterSpacing:0,lineHeight:"14px"},searchQuery:{paddingTop:"6px"},borderBottom:{borderBottom:"1px solid rgba(0,0,0,0.1)"}}))),TW=()=>{const e=vW(),t=(0,Tp.useSelector)(k().selectors.getMetadata),r=(0,Tp.useSelector)(ru),n=(0,Tp.useSelector)(eu),a=(0,Tp.useSelector)(gu),i=(0,Tp.useSelector)(ui.hX),o=(0,Tp.useSelector)(yu),l=(0,Tp.useSelector)(du),s=(0,x.getEntityTypeLabel)(t,{type:r}),c=(0,Tp.useSelector)(mu),u=(0,Tp.useDispatch)(),p=(()=>{const e=(0,Tp.useSelector)(k().selectors.getMetadata),t=(0,Tp.useSelector)(k().selectors.getLookups),r=(0,Tp.useSelector)(k().selectors.getAttributesPresentation),n=(0,Tp.useSelector)(ro.go),a=(0,Tp.useSelector)(k().selectors.getSearchKeyword),i=(0,Tp.useSelector)(ui.vH),o=(0,Tp.useSelector)(k().selectors.getDataTenants),l=(0,Tp.useSelector)(D.X0),s=(0,Tp.useSelector)(D.Mp),c=(0,b.useMemo)((()=>Object.values((0,za.t8)(l,s))),[l,s]);return(0,b.useMemo)((()=>{const l=(0,_.isEmpty)(n)?(0,il.h)(e,o,c):n;return(e=>!(1===e.length&&(0,_.isEmpty)(e[0].attributes)&&1===e[0].entityTypes.length))(l)||i||a?(0,x.buildReadableQuery)(e,r,t,l,a,i):[]}),[a,i,e,o,r,n,c,t])})();(0,b.useEffect)((()=>{0!==i&&(a&&o>=i||!a&&o<=0)&&u(Ec())}),[a,i,o,u]);const d=(0,b.useCallback)((e=>u(((e,t)=>({type:zn,payload:{filterText:e,debounceTime:t}}))(e,K.XU))),[u]);return v().createElement(v().Fragment,null,v().createElement(OF(),{className:O()(e.container,{[e.borderBottom]:n>0})},v().createElement(Ag(),{component:"span",className:e.entityTypeTitle},s),v().createElement(Lg(),{orientation:"vertical",className:e.splitter}),v().createElement(Ag(),{component:"span",className:e.profileNumber},mi().number(o,"0,0")),v().createElement(Ag(),{variant:"body2",component:"span",className:e.profileText},mi().text(" profiles are selected for bulk edit.")),0===n&&v().createElement(v().Fragment,null,v().createElement(nE(),{color:"primary",className:e.clearButton,onClick:()=>{u(Ec())},"data-reltio-id":"reltio-search-bulk-update-"+(a?"select-all-profiles":"clear-selection")},a?`${mi().text("Select all")} ${mi().number(i,"0,0")} ${mi().text("profiles")}`:mi().text("Clear selection")),v().createElement(Mp,{classes:{root:e.searchBox},value:c,onSearch:d,"data-reltio-id":"reltio-search-bulk-update-search-input"}),v().createElement(Lg(),{orientation:"vertical",className:e.splitter}),v().createElement(kd,{entityTypeUri:r,headColumns:l,onSelectColumns:e=>{const t=(0,Pi.tU)(e,l);u(Tc(e)),t&&u(hc())},"data-reltio-id":"reltio-search-bulk-update-add-remove-columns"}))),0===n&&!(0,_.isEmpty)(p)&&v().createElement(OF(),{className:e.searchQueryContainer},mi().text("Search query"),v().createElement(fH,{readableQuery:p,className:e.searchQuery})))};function OW(){return OW=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},OW.apply(this,arguments)}const xW=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",OW({width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},r),v().createElement("defs",null,v().createElement("path",{id:"svg3533951039a",d:"M15 6v5l2 2v2h-4v4l-.992 1L11 19v-4H7v-2l2-2V6H8V4h8v2z"})),v().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},v().createElement("mask",{id:"svg3533951039b",fill:"#fff"},v().createElement("use",{xlinkHref:"#svg3533951039a"})),v().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg3533951039b)",d:"M0 0h24v24H0z"})))};function CW(){return CW=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},CW.apply(this,arguments)}const SW=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",CW({width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},r),v().createElement("defs",null,v().createElement("path",{d:"M9 4a5.002 5.002 0 011 9.9V18h5.24a2.2 2.2 0 110 2H10c-1.11 0-2-.89-2-2v-4.1A5.002 5.002 0 019 4zm.5 2.5h-1v2h-2v1h2v2h1v-2h2v-1h-2v-2z",id:"svg1464898421a"})),v().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},v().createElement("mask",{id:"svg1464898421b",fill:"#fff"},v().createElement("use",{xlinkHref:"#svg1464898421a"})),v().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg1464898421b)",d:"M0 0h24v24H0z"})))},wW=(0,kp.Z)({editor:{marginBottom:0},editorValue:{width:"100%",marginRight:"8px"}}),AW=e=>{let{valueProperty:t,emptyEditorValue:r,attributeType:n,value:a,fieldName:i,onChangeValue:o}=e;const l=wW(),s=!n.uri,c=(0,_.pipe)((0,_.ifElse)((0,_.has)("lookupCode"),_.identity,(0,_.objOf)("value")),(0,_.filter)((e=>void 0!==e)),(0,_.mergeRight)(r))(a);return(0,b.useEffect)((()=>{(0,x.isLookupAttrType)(n)||""===r.value||o(t)(r)}),[]),s?v().createElement("div",{key:t,className:O()(l.editor,l.editorValue),"data-reltio-id":"bulk-update-special-attribute-change-editor"},v().createElement(rL.Z,{fieldName:i,value:a,dataTypeDefinition:(0,x.getAttrDataTypeDefinition)(n),onChange:(0,_.pipe)((0,_.objOf)("value"),o(t)),fullWidth:!0})):v().createElement(PL,{key:t,className:l.editor,mode:x.Mode.Editing,attributeType:n,attributeValue:c,onChangeAttribute:o(t)})},RW={flex:"0 0 auto"},_W=(0,kp.Z)({container:{flexGrow:1,display:"flex",alignItems:"center",margin:0},singleEditor:{marginRight:5,maxWidth:334},to:{color:"#696969",padding:"0 16px 0 7px"},type_Timestamp:RW,type_Boolean:RW,type_Date:RW}),IW=(0,b.memo)((e=>{let{id:t,groupId:r,operation:n,operationParameters:a}=e;const i=_W(),o=(0,Tp.useDispatch)(),{attributeType:l,fieldName:s}=a.attributeTypeData,c=(0,b.useMemo)((()=>(0,x.createNewAttribute)({parentUri:"entities/fakeEntity",attributeType:l})),[l]),u=(0,b.useCallback)((e=>n=>{const{value:a}=n,i=""===a&&(0,x.isLookupAttrType)(l)?{lookupCode:"",value:""}:a;o(Sc({id:t,groupId:r,operationParameters:{[e]:i}}))}),[t,r,l,o]),p=Kc(n).map((e=>v().createElement(AW,{key:e,valueProperty:e,value:a[e],emptyEditorValue:c,fieldName:s,attributeType:l,onChangeValue:u})));if(!p.length)return null;const d=v().createElement("div",{key:"to",className:i.to},mi().text("with"));return v().createElement("div",{className:O()(i.container,i[`type_${l.type}`],{[i.singleEditor]:1===p.length})},2===p.length?(0,_.insert)(1,d,p):p)}));IW.displayName="ChangeEditor";const NW=(0,kp.Z)((()=>({entitySelector:{marginTop:"10px",width:"100%",maxWidth:"452px"},label:{"&:not($labelShrink)":{transform:"translate(12px, 10px)"}},labelShrink:{}}))),DW=e=>{let{attributeType:t,value:r,onChange:n}=e;const a=NW(),i=(0,Tp.useDispatch)(),o=(0,Tp.useSelector)(k().selectors.getMetadata),l=(0,Tp.useSelector)((e=>k().selectors.getGlobalSearchRequestOptions(e,["ovOnly"]))),s=x.Mode.Editing,c=null==r?void 0:r.entityUri,u=(0,x.getReferencedEntityTypeUriFromAttrType)(t),p=(0,b.useCallback)((e=>(0,x.referencedEntityAttributeTypesSelectionStrategy)(t,e)),[t]),d=(0,b.useCallback)((e=>{const{uri:t,type:r,label:a}=e;(0,x.isTempUri)(c)&&i(P.profile.modifiedEntities.actions.entityDeleted(c)),n((0,_.isEmpty)(e)?null:{entityUri:t,entityType:r,entityLabel:a})}),[i,n,c]),m=(0,b.useCallback)(((e,t)=>{const r=(0,x.getEntityType)(o,u),n=(0,_.pipe)(p,(0,x.getCreatableAttributeTypes)(s))(r),a=(0,x.createTemporaryEntity)({entityTypeUri:e,initValue:t,attributeTypes:n,metadata:o,mode:s});d(a),i(P.profile.modifiedEntities.actions.entityCreated(a))}),[i,d,p,o,s,u]);return v().createElement(DU,{className:a.entitySelector,entity:r,entityTypesUris:(0,ci.l0)(u),metadata:o,globalSearchRequestOptions:l,onChange:d,onCreate:m,height:40,disableLinkClick:!0,attributeTypesSelectionStrategy:p,mode:s,TextFieldProps:{InputLabelProps:{classes:{root:a.label,shrink:a.labelShrink}}}})},PW=e=>(0,_.last)(e.type.split("/")),kW=e=>({attributes:{[PW(e)]:[e]}}),LW=(e,t)=>{const r=PW(e);return t.attributes[r][0]},UW=e=>{let{attributeValue:t,onChange:r}=e;const n=(0,b.useRef)(t);n.current=t;const a=(0,b.useCallback)((e=>{let{value:t,attributeType:a,uri:i}=e;const o=kW(n.current),l=(0,x.editAttribute)({entity:o,attributeType:a,uri:i,value:t});r(LW(n.current,l))}),[r]),i=(0,b.useCallback)((e=>{let{attributeType:t,uri:a}=e;const i=kW(n.current),o=(0,x.removeAttribute)({entity:i,attributeType:t,uri:a});r(LW(n.current,o))}),[r]),o=(0,b.useCallback)((e=>{const t=kW(n.current),a=e.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:a}=t;return(0,x.addAttribute)({entity:e,attributeType:r,parentUri:n,index:a})}),t);r(LW(n.current,a))}),[r]),l=(0,b.useCallback)((e=>{const t=(e=>{let{parentAttributeValue:t,uri:r}=e;const n=r.split(t.uri+"/")[1].split("/"),a=[];for(;n.length;){a.push("value");const e=n.shift(),r=n.shift();a.push(e);const i=(0,_.view)((0,_.lensPath)(a),t);if(!i)return null;const o=i.findIndex((e=>{let{uri:t}=e;return t.endsWith("/"+r)}));a.push(o)}return a.length?(a.push("pin"),(0,_.over)((0,_.lensPath)(a),_.not,t)):null})({parentAttributeValue:n.current,uri:e});t&&r(t)}),[r]);return{onChangeAttribute:a,onDeleteAttribute:i,onAddAttributes:o,onTogglePin:l}},jW=(0,kp.Z)((e=>({pinIcon:{marginRight:"-8px"},pinIconActive:{"& svg > g > path":{fill:e.palette.primary.main,fillOpacity:1}}}))),FW=e=>{let{onTogglePin:t,subAttributeValue:r}=e;const n=jW();return v().createElement(wd.k,{icon:xW,onClick:()=>t(r.uri),size:"L",className:O()(n.pinIcon,r.pin&&n.pinIconActive)})},MW=(0,_.curry)(((e,t,r)=>{let{attributeValue:n}=r;return n.uri===e?null:v().createElement(FW,{onTogglePin:t,subAttributeValue:n})}));function VW(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const BW=e=>{let{attributeType:t,attributeValue:r,onChange:n}=e;const a=(0,Tp.useSelector)(k().selectors.getMetadata),i=(0,b.useMemo)((()=>{const e=(0,x.getAttributeTypeSubAttributes)(a,t),r=(0,x.createNewAttribute)({parentUri:"entities/fakeEntity",attributeType:t});return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){VW(e,t,r[t])}))}return e}({},r,{value:(0,x.createDefaultValues)({attributeTypes:e,parentUri:r.uri,metadata:a,mode:x.Mode.Editing})})}),[t,a]),o=r||i,{onChangeAttribute:l,onDeleteAttribute:s,onAddAttributes:c,onTogglePin:u}=UW({attributeValue:o,onChange:n}),p=(0,b.useCallback)(MW(o.uri,u),[o.uri,u]);return v().createElement(YL,{attributeType:t,attributeValue:o,showEmptyEditors:!0,mode:x.Mode.Editing,metadata:a,onAddAttributes:c,onDeleteAttribute:s,onChangeAttribute:l,hideDeleteButton:!0,additionalControlsRenderer:p})};function zW(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const HW=e=>{let{attributeType:t,attributeValue:r,onChange:n}=e;const a=(0,Tp.useSelector)(k().selectors.getMetadata),i=(0,b.useMemo)((()=>{const e=(0,x.getEditableAttributeTypeSubAttributes)(a,t),r=(0,x.createNewAttribute)({parentUri:"entities/fakeEntity",attributeType:t});return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){zW(e,t,r[t])}))}return e}({},r,{value:(0,x.createDefaultValues)({attributeTypes:e,parentUri:r.uri,metadata:a,mode:x.Mode.Editing})})}),[t,a]),o=r||i,{onChangeAttribute:l,onDeleteAttribute:s,onAddAttributes:c,onTogglePin:u}=UW({attributeValue:o,onChange:n}),p=(0,b.useCallback)(MW(o.uri,u),[o.uri,u]);return v().createElement(UU,{attributeType:t,attributeValue:o,showEmptyEditors:!0,mode:x.Mode.Editing,metadata:a,onAddAttributes:c,onDeleteAttribute:s,onChangeAttribute:l,hideDeleteButton:!0,additionalControlsRenderer:p})},YW=e=>{let{operation:t,attributeType:r,attributeValue:n,onChange:a}=e;return t===la.d.RepointReference?v().createElement(DW,{attributeType:r,value:n,onChange:a}):(0,x.isNested)(r)?v().createElement(BW,{attributeType:r,attributeValue:n,onChange:a}):(0,x.isReference)(r)?v().createElement(HW,{attributeType:r,attributeValue:n,onChange:a}):null},WW=(0,_.curry)(((e,t,r)=>(0,_.assoc)(t,(0,_.prop)(e,r),(0,_.dissoc)(e,r)))),GW=(0,_.pipe)((0,_.pick)(["fieldName","title","pathToTitle","attrType"]),WW("attrType","attributeType")),qW=(0,_.unless)(_.isNil,WW("attributeType","attrType")),ZW="1px solid #e4e4e4",$W=(0,kp.Z)((e=>({mainRowContent:{display:"flex",alignItems:"center","&>*":{marginRight:8}},row:{borderBottom:ZW,padding:"17px 34px","&:last-child":{borderBottom:"none"},"&$withoutLine":{borderBottom:"none",paddingTop:"9px",paddingBottom:"9px"}},withoutLine:{},attrSelector:{width:254,height:40,flexShrink:0},operationSelector:{width:190,marginRight:26,flexShrink:0},icons:{flexGrow:0,marginLeft:-5,display:"flex"},actionIcon:{marginRight:2},actionIconActive:{"& svg > g > path":{fill:e.palette.primary.main,fillOpacity:1}}}))),KW={enabled:!0,queueSizeThreshold:5},XW=(0,b.memo)((e=>{let{id:t,operation:r,operationParameters:n,groupId:a,groupAttributeType:i,hasConditions:o}=e;const l=$W(),s=(0,Tp.useDispatch)(),c=(0,Tp.useSelector)(ru),u=(0,ci.l0)(c),{pin:p,addNestedAttribute:d,attributeTypeData:m}=n||{},{attributeType:g}=m||{},y=r&&m,f=(0,b.useCallback)((e=>{let{attribute:r,checked:n}=e;n&&s((e=>{let{id:t,groupId:r,attribute:n}=e;return{type:Gn,payload:{id:t,groupId:r,attribute:n}}})({id:t,groupId:a,attribute:GW(r)}))}),[t,a,s]),h=(0,b.useCallback)((e=>{s(Sc({id:t,groupId:a,operationParameters:{attributeValue:e}}))}),[s,t,a]),E=(0,b.useCallback)((()=>{s((e=>{let{id:t,groupId:r}=e;return{type:na,payload:{id:t,groupId:r}}})({id:t,groupId:a}))}),[t,a,s]),T=(0,b.useCallback)((()=>{s((e=>{let{id:t,groupId:r}=e;return{type:aa,payload:{id:t,groupId:r}}})({id:t,groupId:a}))}),[t,a,s]),C=(0,b.useCallback)((()=>{s(Cc({id:t,groupId:a}))}),[t,a,s]),S=(0,b.useCallback)((e=>{s((e=>{let{id:t,groupId:r,operation:n}=e;return{type:qn,payload:{id:t,groupId:r,operation:n}}})({id:t,groupId:a,operation:e.value}))}),[t,a,s]),w=(0,x.isComplexAttribute)(g)&&[la.d.AddNew,la.d.ReplaceAllWith,la.d.RepointReference].includes(r),A=[la.d.AddNew,la.d.ReplaceAllWith,la.d.FindAndReplace].includes(r)&&!(null==g||!g.uri),R=i&&g&&g.uri===i.uri,I=a&&!R&&r===la.d.AddNew&&!(0,x.isReference)(i),N=(0,b.useMemo)((()=>{return g?(e=g,t=o&&R,(0,_.cond)([[(0,_.both)(x.isNested,(0,_.always)(t)),(0,_.always)((0,_.without)([la.d.AddNew,la.d.ReplaceAllWith],K.DY))],[x.isNested,(0,_.always)(K.DY)],[(0,_.both)(x.isReference,(0,_.always)(t)),(0,_.always)((0,_.without)([la.d.AddNew],K.hS))],[x.isReference,(0,_.always)(K.hS)],[_.T,(0,_.always)(K.pG)]])(e)).map((e=>({value:la.d[e],label:K.WN[e]}))):[];var e,t}),[o,g,R]),D=(0,b.useMemo)((()=>N.find((e=>e.value===r))),[r,N]),P=(0,b.useMemo)((()=>qW(m)),[m]),k=(0,b.useCallback)(i?(0,IY.xM)(i):(0,_.ifElse)(IY.XF,(0,_.pipe)((0,_.pathEq)(["fieldName"],"tags")),(0,_.pipe)((0,_.prop)("attrType"),(0,_.both)((0,_.complement)(x.isImage),(0,_.complement)(x.isAnalyticAttribute)))),[i]),L=(0,b.useCallback)((e=>(0,x.getSearchGroupAttributeLabel)({data:e})),[]);return(0,b.useEffect)((()=>{!D&&N[0]&&m&&S(N[0])}),[N,D,m,S]),(0,b.useEffect)((()=>{p&&!A&&E()}),[A,p,E]),(0,b.useEffect)((()=>{d&&!I&&T()}),[I,d,T]),v().createElement("div",{"data-reltio-id":"bulk-update-dialog-action-row",className:O()(l.row,{[l.withoutLine]:!!a})},v().createElement("div",{className:l.mainRowContent},v().createElement(DY,{className:l.attrSelector,single:!0,showReferencedEntityAttributes:!1,entityTypes:u,value:P,onSelect:f,firstLevelAttributesFilter:k,ungroup:!!a,getLabel:L}),v().createElement(cj,{label:"",isDisabled:!P,placeholder:mi().text("Select operation"),className:l.operationSelector,value:D,options:N,height:40,onChange:S}),y&&v().createElement(v().Fragment,null,!w&&v().createElement(IW,{id:t,groupId:a,operation:r,operationParameters:n}),v().createElement("div",{className:l.icons},A&&v().createElement(wd.k,{className:O()(l.actionIcon,{[l.actionIconActive]:p}),size:"M",tooltipTitle:mi().text("Make this Operational Value"),icon:xW,onClick:E}),I&&v().createElement(wd.k,{className:O()(l.actionIcon,{[l.actionIconActive]:d}),size:"M",tooltipTitle:mi().text("Create parent attribute if none exists"),icon:SW,onClick:T}),v().createElement(wd.k,{size:"M",tooltipTitle:mi().text("Delete"),icon:_p(),onClick:C})))),y&&w&&v().createElement(yL.Provider,{value:KW},v().createElement(YW,{operation:r,attributeType:g,attributeValue:n.attributeValue,onChange:h})))}));var QW=r(80510),JW=r.n(QW);function eG(){return eG=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},eG.apply(this,arguments)}const tG=(0,b.memo)((e=>{let{attributeType:t,showReferencedEntityAttributes:r,subattributesGroupTitle:n,additionalItemsGroups:a}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeType","showReferencedEntityAttributes","subattributesGroupTitle","additionalItemsGroups"]);const o=(0,Tp.useSelector)(k().selectors.getMetadata),l=t.uri.split("/").slice(0,3).join("/"),s=(0,ci.l0)(l),c=(0,b.useCallback)((0,IY.xM)(t),[t]),u=(0,b.useMemo)((()=>(0,_.pipe)(IY.s1,(0,_.when)((0,_.always)(!r),IY.a),(0,_.map)((0,_.evolve)({attributes:(0,_.pathOr)([],[0,"children"]),title:(0,_.when)((0,_.always)(n),(0,_.always)(n))})),(0,_.when)((0,_.always)(a),(0,_.concat)(a)))({firstLevelAttributesFilter:c},o,s)),[a,n,r,s,o,c]);return v().createElement(_Y,eG({},i,{ungroup:!a,itemsGroups:u}))}));function rG(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){nG(e,t,r[t])}))}return e}function nG(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const aG=(e,t)=>(0,Wa.nT)(`${K.E_}_group`,mi().text("Profile"),[rG({},(0,Wa.o)(rG({title:(0,x.getEntityTypeLabel)(t,{type:(0,x.getReferencedEntityTypeUriFromAttrType)(e)}),fieldName:K.E_},e)),{enforcedFilterOptions:[x.FilterOptions.EQUALS]})]),iG=(0,kp.Z)({selector:{width:"254px",height:"40px"}}),oG=(0,b.memo)((e=>{let{rowData:t,rowContext:{attributeType:r,dispatchGroupAction:n},attributeSelectorProps:a={}}=e;const i=iG(),o=(0,Tp.useSelector)(k().selectors.getMetadata),l=t&&t.id,s=(0,b.useMemo)((()=>(0,x.isReference)(r)?[aG(r,o)]:null),[r,o]),c=(0,b.useCallback)((e=>{n(_c,l,e)}),[l,n]);return v().createElement(tG,{className:i.selector,value:t&&t.data,attributeType:r,additionalItemsGroups:s,subattributesGroupTitle:(0,x.isReference)(r)?mi().text("Reference attributes"):"",onSelect:c,onRestoreFocus:a.onRestoreFocus,onOpenPopup:a.onOpen,disableRestoreFocus:a.disablePopoverRestoreFocus,disableEnforceFocus:a.disablePopoverRestoreFocus})}));oG.displayName="ConditionAttributeSelector";const lG=e=>!(e&&e.data),sG=(0,_.pathEq)(["data","fieldName"],K.E_),cG=(0,kp.Z)({selector:{width:"190px"}}),uG=(0,b.memo)((e=>{let{rowData:t,rowContext:{dispatchGroupAction:r},textFieldInputRef:n}=e;const a=cG(),i=t&&t.id,o=(0,b.useCallback)((e=>r(Nc,i,e.value)),[r,i]);return v().createElement(zY,{height:40,className:a.selector,attribute:t,textFieldInputRef:n,isDisabled:lG(t),onChange:o})}));uG.displayName="ConditionFilterSelector";const pG=(0,kp.Z)({input:{margin:0,borderRadius:"4px"},root:{borderRadius:"4px 4px 0 0",padding:0,display:"flex",alignItems:"center",margin:0},entitySelector:{width:"100%"},entitySelectorLabel:{"&:not($entitySelectorLabelShrink)":{transform:"translate(12px, 10px)"}},entitySelectorLabelShrink:{}}),dG=(0,b.memo)((e=>{let{condition:t,dispatchGroupAction:r}=e;const{values:n=[],data:{attrType:a,fieldName:i}={},filter:o}=t,l=pG(),s=(0,Tp.useSelector)(k().selectors.getMetadata),c=(0,Tp.useSelector)((e=>k().selectors.getGlobalSearchRequestOptions(e,["ovOnly"]))),u=(0,b.useCallback)((e=>r(Dc,t.id,e)),[r,t.id]),p=(0,b.useCallback)((e=>{let{uri:t,type:r,label:n}=e;u([{entityUri:t,entityType:r,entityLabel:n}])}),[u]),d=(0,x.getAttrDataTypeDefinition)(a),m=(0,x.getDataTypeDefinitionForFilterValue)(d,o);return sG(t)?v().createElement(DU,{className:l.entitySelector,entity:n[0],entityTypesUris:(0,ci.l0)((0,x.getReferencedEntityTypeUriFromAttrType)(a)),metadata:s,mode:x.Mode.Editing,globalSearchRequestOptions:c,onChange:p,height:40,disableLinkClick:!0,TextFieldProps:{InputLabelProps:{classes:{root:l.entitySelectorLabel,shrink:l.entitySelectorLabelShrink}}}}):v().createElement(WY.n,{filter:{filter:o,fieldName:i,values:n||[]},onChange:u,dataTypeDefinition:m,fullWidth:!0,TextFieldProps:{InputProps:{classes:{root:l.input}}},color:"primary",classes:{root:l.root},orientation:"horizontal"})}));dG.displayName="ConditionValuesEditor";const mG=(0,kp.Z)({root:{width:"100%",display:"flex",minHeight:"40px",alignItems:"flex-start",boxSizing:"border-box"}}),gG=(0,b.memo)((e=>{let{rowData:t,rowContext:{dispatchGroupAction:r}}=e;const n=mG(),a=lG(t),i=t&&(0,x.checkIfOptionHasValues)(t.filter);return v().createElement("div",{className:n.root},!a&&i&&v().createElement(dG,{condition:t,dispatchGroupAction:r}))}));gG.displayName="ConditionValuesEditorWrapper";const yG=(0,kp.Z)({root:{paddingTop:"8px",height:"24px",display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:"0"}}),fG=(0,b.memo)((e=>{let{rowData:t,rowContext:{dispatchGroupAction:r}}=e;const n=yG(),a=t&&t.id,i=(0,b.useCallback)((()=>r(Ic,a)),[a,r]);return t?v().createElement("div",{className:n.root},v().createElement(wd.k,{tooltipTitle:mi().text("Delete"),tooltipPlacement:"bottom",icon:_p(),size:"M",onClick:i})):null}));fG.displayName="ConditionActions";const hG=(0,kp.Z)((e=>({row:{"&:hover $actions":{opacity:1}},logicOperatorContainer:{maxHeight:"40px"},caption:{color:e.palette.text.secondary},conditions:{backgroundColor:"rgba(0,0,0,0.032)",padding:"20px 15px",margin:"7px 0"},actions:{opacity:"0",transition:"opacity 0.3s"}}))),EG=e=>{let{attributeType:t,conditions:r,groupId:n}=e;const a=hG(),i=(0,Tp.useDispatch)(),o=(0,b.useCallback)((function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),a=1;a<t;a++)r[a-1]=arguments[a];return i(e(n,...r))}),[n,i]),l=(0,b.useMemo)((()=>({root:a.row,logicOperatorContainer:a.logicOperatorContainer,actionsContainer:a.actions})),[a]);return v().createElement(v().Fragment,null,v().createElement(Ag(),{variant:"caption",component:"div",className:a.caption},mi().text("If the following conditions are met")),v().createElement(zH,{className:a.conditions,rowClasses:l,rowsData:r,AttributeSelectorComponent:oG,FilterSelectorComponent:uG,ValuesEditorComponent:gG,ActionsComponent:fG,attributeType:t,dispatchGroupAction:o}),v().createElement(Ag(),{variant:"caption",component:"div",className:a.caption},mi().text("Then perform the change")))},bG=(0,kp.Z)((e=>({complexRow:{borderBottom:ZW,padding:"10px 34px 17px","&:last-child":{borderBottom:"none"}},header:{display:"flex",alignItems:"center",marginBottom:"4px"},actionsBlock:{marginTop:"2px",marginLeft:"-34px",marginRight:"-34px"},attributeLabel:{fontSize:"14px",fontWeight:500,color:e.palette.text.secondary},conditionsToggleButton:{marginTop:"1px",marginLeft:"6px",display:"flex",alignItems:"center"},conditionsToggleIcon:{marginRight:"8px",width:"18px",height:"18px",marginTop:"-1px"}})));function vG(){return vG=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vG.apply(this,arguments)}const TG=(0,b.memo)((e=>{let{id:t,fieldName:r,actions:n,conditions:a}=e;const i=bG(),o=(0,Tp.useDispatch)(),l=(0,Tp.useSelector)(ru),s=(0,Tp.useSelector)(k().selectors.getMetadata),c=(0,b.useMemo)((()=>{const e=(0,x.searchUriToAttrUri)(r,l);return(0,x.findAttributeTypeByUri)(s,e,l)}),[s,r,l]),u=!!a,p=((e,t)=>(0,_.any)((0,_.both)((0,_.pipe)((0,_.prop)("operation"),(0,_.includes)(_.__,[la.d.AddNew,la.d.ReplaceAllWith])),(0,_.pathEq)(["operationParameters","attributeTypeData","attributeType","uri"],t.uri)))(e))(n,c),d=(0,b.useCallback)((()=>o({type:Kn,payload:t})),[t,o]),m=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return v().createElement(XW,vG({key:e.id},e,{groupId:t,groupAttributeType:c,hasConditions:u}))};return(0,b.useEffect)((()=>{u||0!==n.length||o(Cc({id:t,groupId:void 0}))}),[t,u,n.length,o]),v().createElement("div",{className:i.complexRow},v().createElement("div",{className:i.header},v().createElement("div",{className:i.attributeLabel},c.label),v().createElement(nE(),{disabled:p,color:"primary",className:i.conditionsToggleButton,onClick:d},u?v().createElement(v().Fragment,null,v().createElement(JW(),{className:i.conditionsToggleIcon}),mi().text("Remove")," "):v().createElement(v().Fragment,null,v().createElement(PH(),{className:i.conditionsToggleIcon}),mi().text("Add")," "),mi().text("conditions"))),a&&v().createElement(EG,{attributeType:c,conditions:a,groupId:t}),v().createElement("div",{className:i.actionsBlock},n.map(m),m()))}));TG.displayName="ComplexActionRow";const OG=(0,kp.Z)({wrapper:{flexGrow:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"flex-start",backgroundColor:"#fafafa",boxSizing:"border-box",padding:30},container:{width:"100%",flex:"1 1 auto",maxWidth:1320,backgroundColor:"white",borderRadius:2,padding:"16px 0 50px",display:"flex",flexDirection:"column"}});function xG(){return xG=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},xG.apply(this,arguments)}const CG=e=>"actions"in e?v().createElement(TG,xG({key:e.id},e)):v().createElement(XW,xG({key:e.id},e)),SG=()=>{const e=OG(),t=(0,Tp.useSelector)(hu);return v().createElement("div",{className:e.wrapper},v().createElement("div",{className:e.container},t.map(CG),v().createElement(XW,null)))};var wG=r(99261),AG=r.n(wG),RG=r(26518),_G=r.n(RG),IG=r(60158),NG=r.n(IG),DG=r(61887),PG=r.n(DG);const kG=(0,kp.Z)((()=>({buttonWrapper:{position:"relative"},progress:{position:"absolute",left:"calc(50% - 12px)",top:"calc(50% - 12px)"}})));function LG(){return LG=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},LG.apply(this,arguments)}const UG=e=>{let{isInProgress:t,disabled:r,circularColor:n="primary",className:a,children:i}=e,o=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["isInProgress","disabled","circularColor","className","children"]);const l=kG();return v().createElement(nE(),LG({},o,{className:O()(l.buttonWrapper,a),disabled:r||t}),i,t&&v().createElement("div",{className:l.progress,"data-reltio-id":"reltio-circular-load-indicator"},v().createElement(Tm(),{size:24,color:n})))},jG=(0,kp.Z)((()=>({container:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"},placeholder:{flex:1},stepper:{padding:"0 24px",flex:2},stepButton:{margin:"-20px -16px",padding:"20px 16px","& svg text":{textAnchor:"middle"}},buttons:{flex:1,display:"flex",justifyContent:"flex-end"},backButton:{marginRight:"8px",border:"1px solid rgba(0, 0, 0, 0.23)"},errorLabel:{color:"#dd2c00 !important"},warningLabel:{color:"#f9a825 !important"}}))),FG=e=>{let{activeStep:t,steps:r,isPending:n=!1,shouldCompleteSteps:a=!0,onConfirm:i,onChangeStep:o}=e;const l=jG(),s=t===r.length-1,c=e=>{e!==t&&o(e)},u=(0,_.propOr)(!0,"enabled"),p=e=>{if(e>0){const t=e-1;u(r[t])?c(t):p(t)}},d=e=>{if(e<r.length-1){const t=e+1;u(r[t])?c(t):d(t)}},m=s&&!!i,g=m||(0,_.any)(u,(0,_.drop)(t+1,r));return v().createElement("div",{className:l.container},v().createElement("div",{className:l.placeholder}),v().createElement(AG(),{nonLinear:!0,activeStep:t,className:l.stepper},r.map(((e,r)=>{let{label:i,enabled:o=!0,hasError:s,hasWarning:u}=e;const p=!o||n,d=a&&!p&&r<t;return v().createElement(_G(),{key:i,completed:d,disabled:p},v().createElement(NG(),{className:l.stepButton,onClick:()=>c(r),"data-reltio-id":`reltio-search-bulk-update-${r}`},v().createElement(PG(),{error:s||u,classes:{error:s?l.errorLabel:l.warningLabel}},i)))}))),v().createElement("div",{className:l.buttons},t>0&&v().createElement(nE(),{variant:"outlined",className:l.backButton,onClick:()=>p(t),disabled:n,"data-reltio-id":"reltio-search-bulk-update-back"},mi().text("Back")),v().createElement(UG,{variant:"contained",color:"primary",disabled:!g,isInProgress:n,onClick:s?i:()=>d(t),"data-reltio-id":"reltio-search-bulk-update-"+(s?"confirm":"continue")},m?mi().text("Confirm"):mi().text("Continue"))))},MG=()=>{const e=(0,Tp.useDispatch)(),t=(0,Tp.useSelector)(eu),r=(0,Tp.useSelector)(fu),n=(0,Tp.useSelector)(Jc),a=!(0,_.isNil)(n),i=(0,Tp.useSelector)(vu),o=(0,Tp.useSelector)(Tu),l=[{label:mi().text("Select profiles")},{label:mi().text("Select operation"),enabled:r},{label:mi().text("Define changes"),enabled:r&&a&&n===K.dV.UpdateProfiles},{label:mi().text("Review changes"),enabled:r&&a&&(i||n===K.dV.DeleteProfiles)}];return v().createElement(FG,{activeStep:t,steps:l,isPending:o,onChangeStep:t=>e((e=>({type:Nn,payload:e}))(t)),onConfirm:()=>e({type:ia})})},VG=(0,kp.Z)((()=>({appBar:{boxShadow:"none"},toolbar:{background:"white",borderBottom:"1px solid rgba(0,0,0,0.1)",boxSizing:"border-box",paddingLeft:"21px"},title:{fontSize:"1.1rem",display:"inline-flex",alignItems:"center"},closeButton:{marginRight:"10px"}}))),BG=e=>{let{children:t,onClose:r}=e;const n=VG();return v().createElement(vF(),{position:"static",color:"default",className:n.appBar},v().createElement(OF(),{className:n.toolbar},v().createElement(wd.k,{edge:"start",tooltipTitle:mi().text("Close"),"aria-label":mi().text("Close"),icon:_p(),onClick:r,className:n.closeButton,size:"L","data-reltio-id":"reltio-search-bulk-update-close"}),v().createElement(Ag(),{variant:"h6",className:n.title},t)),v().createElement(OF(),{className:n.toolbar},v().createElement(MG,null)))};BG.propTypes={children:vp().node,onClose:vp().func};const zG=BG,HG=(0,kp.Z)((()=>({tableContainer:{position:"relative",height:"100%",display:"flex",flexDirection:"column",backgroundColor:"#fff"},pagination:{flexGrow:0,borderTop:"1px solid rgba(0, 0, 0, 0.1)",height:"52px",boxShadow:"none"}}))),YG=(0,_.equals)(K.v6.include);function WG(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const GG=()=>{const e=HG(),t=(0,Tp.useDispatch)(),r=(0,Tp.useSelector)(k().selectors.getMetadata),n=(0,Tp.useSelector)(ru),a=(0,Tp.useSelector)(du),i=(0,Tp.useSelector)(ou),o=(0,Tp.useSelector)(uu),l=(0,Tp.useSelector)(pu),s=(0,Tp.useSelector)(au),c=(0,Tp.useSelector)(su),u=(0,Tp.useSelector)(cu),p=(0,Tp.useSelector)(tu),d=(0,Tp.useSelector)(lu),m=(0,Tp.useSelector)(iu),g=(0,b.useMemo)((()=>((e,t,r)=>(0,_.pipe)((0,_.map)((0,_.prop)("uri")),YG(e)?(0,_.intersection)(t):(0,_.without)(t))(r))(m,d,i)),[m,d,i]),y=((e,t)=>0!==e.length&&(e.length===t.length||null))(g,i),f=(0,b.useMemo)((()=>(0,Pi.oq)(r,n,a)),[r,n,a]),h=(0,b.useCallback)((e=>{let{field:r,order:n}=e;return t((e=>{let{field:t,order:r}=e;return{type:Mn,payload:{field:t,order:r}}})({field:n?r:null,order:n}))}),[t]),E=(0,b.useCallback)((e=>{let{what:r,where:n}=e;const i=(0,_.move)(r.columnIndex,n.columnIndex,a);t(Tc(i))}),[t,a]),T=(0,b.useCallback)((e=>{let{columns:r}=e;const n=(0,Pi.tU)(r,a);t(Tc(r)),n&&t(hc())}),[t,a]),O=(0,b.useCallback)((e=>{const r=a.map(((t,r)=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){WG(e,t,r[t])}))}return e}({},t,{size:e[r].size})));t(Tc(r))}),[t,a]),x=(0,b.useCallback)(((e,r)=>{t(e?((e,t)=>({type:kn,payload:{uri:e,checked:t}}))(e,r):{type:Ln,payload:!y})}),[y,t]),C=(0,b.useRef)(null);return v().createElement("div",{className:e.tableContainer},p&&v().createElement(LE.z,null),v().createElement(gg,{entities:i,entityTypeUri:n,headColumns:a,additionalColumns:f,canCheck:!0,onCheck:x,checkedEntitiesUris:g,headerCheckboxState:y,dndColumnReorderingEnabled:!0,sortField:o,sortOrder:l,onSort:h,onReorderingColumn:E,onChangeColumnsList:T,onChangeColumnsSize:O,entitiesTableRef:C}),s>K.Tu[0]&&v().createElement("div",{className:e.pagination},v().createElement(SE.Z,{count:s,rowsPerPageOptions:K.Tu,rowsPerPage:u||K.Tu[0],page:c||0,onChangePage:e=>t(vc(e)),onChangeRowsPerPage:e=>t((e=>({type:jn,payload:e}))(e)),basicTableRef:C})))},qG=(0,kp.Z)((e=>({tableContainer:{display:"flex",flexDirection:"column",backgroundColor:"#fff",width:"100%",margin:"30px 60px",padding:"24px"},title:{fontSize:"14px",fontWeight:500,letterSpacing:"0.1px",lineHeight:"24px",color:e.palette.text.secondary,marginBottom:"6px"},label:{color:e.palette.text.secondary,fontSize:"14px",letterSpacing:0,lineHeight:"32px",paddingLeft:"7px"},radioButton:{padding:"0 9px"}}))),ZG=()=>{const e=qG(),t=(0,Tp.useDispatch)(),r=(0,Tp.useSelector)(Jc),n=(0,Tp.useSelector)(k().selectors.getCanUserDeleteProfiles);(0,b.useEffect)((()=>{(0,_.isNil)(r)&&t(xc(K.dV.UpdateProfiles))}),[r,t]);const a=(0,_.pipe)(Dp.NA,xc,t);return v().createElement("div",{className:e.tableContainer},v().createElement(Ag(),{className:e.title},mi().text("Choose Bulk Update Operation")),v().createElement(_h(),{value:r,onChange:a},v().createElement(Nh(),{classes:{label:e.label},value:K.dV.UpdateProfiles,control:v().createElement(Ah(),{className:e.radioButton}),label:mi().text("Update Profiles - Update attribute values of selected profiles")}),v().createElement(Nh(),{disabled:!n,classes:{label:e.label},value:K.dV.DeleteProfiles,control:v().createElement(Ah(),{className:e.radioButton}),label:mi().text("Delete Profiles - Delete selected profiles")})))};var $G=r(49850),KG=r.n($G),XG=r(28012),QG=r.n(XG),JG=r(18878),eq=r.n(JG),tq=r(70918),rq=r.n(tq),nq=r(51159),aq=r.n(nq),iq=r(35681),oq=r.n(iq);const lq=e=>{let{value:t,attributeType:r,lookups:n}=e;return(0,x.isLookupAttrType)(r)&&"string"==typeof t&&(t={lookupCode:t,value:(0,x.getResolvedLookupValue)(n,(0,x.getAttrTypeLookupCode)(r),t)}),v().createElement(Xd.x,{dataTypeDefinition:(0,x.getAttrDataTypeDefinition)(r),value:t})},sq=e=>{let{operation:t}=e;return v().createElement(v().Fragment,null,K.WN[t])},cq=e=>{let{conditions:t,attributesPresentation:r,metadata:n,lookups:a}=e;if((0,x.isEmptyValue)(t))return v().createElement(v().Fragment,null,"-");const i=(0,x.buildAttributesReadableQuery)(n,r,a,t,!1);return v().createElement(fH,{readableQuery:i})},uq="8px",pq="1px",dq="1px solid #AFD4E9",mq=(0,kp.Z)((e=>({scaffoldsContainer:{height:"calc(100% + 24px)",margin:"-12px 0"},scaffold:{width:"32px",height:"100%",position:"relative",display:"inline-block",verticalAlign:"middle"},scaffoldFullVert:{"&:before":{content:'""',position:"absolute",display:"block",boxSizing:"border-box",height:"100%",width:pq,left:uq,top:0,borderLeft:dq}},scaffoldHalfVert:{"&:before":{content:'""',position:"absolute",display:"block",boxSizing:"border-box",height:"50%",width:pq,left:uq,top:0,borderLeft:dq}},scaffoldHor:{"&:after":{content:'""',position:"absolute",display:"block",boxSizing:"border-box",height:pq,width:"5px",left:uq,top:"50%",borderBottom:dq}},noWrapContainer:{display:"inline-flex",verticalAlign:"middle",height:"100%",alignItems:"center","& > *":{flexShrink:0}},optionContainer:{width:"20px","& svg g path":{fill:e.palette.primary.main,fillOpacity:1},"& + &":{paddingLeft:"4px"}},opaque:{opacity:0},newIcon:{color:"#599E0E",marginLeft:"10px",borderRadius:"16px",padding:"2px 12px",border:"2px solid rgba(89,158,14,0.3)",fontSize:"10px",lineHeight:"16px"},nestedLabel:{width:"100%"}}))),gq=e=>{let{attributeTypeData:{pathToTitle:t,title:r}}=e;const n=mq();return Boolean(t&&t.length>2)?v().createElement(vf,{placement:"bottom-start",pathToTitle:t},v().createElement("span",{className:n.nestedLabel},r)):v().createElement(v().Fragment,null,r)};function yq(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function fq(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){hq(e,t,r[t])}))}return e}function hq(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Eq={EMPTY:"empty",FULL_VERT:"full_vert",FULL_VERT_HOR:"full_vert_hor",HALF_VERT_HOR:"half_vert_hor"},bq=e=>e.map(((t,r)=>(e=>{let{hasLowerSubAttrs:t,isFirstValue:r,isLastScaffold:n}=e;const a=n&&r;return t?a?Eq.FULL_VERT_HOR:Eq.FULL_VERT:a?Eq.HALF_VERT_HOR:Eq.EMPTY})(fq({},t,{isLastScaffold:r===e.length-1})))),vq=e=>{let{operation:t,operationParameters:r}=e;return(0,x.wrapInArrayIfNeeded)(fq({},r,{operation:t}))},Tq=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];const a=(0,x.findAttributeTypeByUri)(e,t.type),i=a.label||a.name,o={attributeTypeData:{attributeType:a,title:i,pathToTitle:[...r,i]},scaffolds:bq(n),pin:t.pin};if((0,x.isComplexAttribute)(a)){const a=Object.values(t.value),l=a.flatMap(((t,o)=>t.flatMap(((t,l)=>{const s={hasLowerSubAttrs:a.length-o-1>0,isFirstValue:0===l};return Tq(e,t,[...r,i],[...n,s])}))));return[o,...l]}return[fq({},o,{attributeValue:(0,x.getAttributeValue)(t)})]},Oq=(0,_.curry)(((e,t)=>{let{operation:r,operationParameters:n}=t;const{attributeValue:a,attributeTypeData:i}=n,o=yq(n,["attributeValue","attributeTypeData"]),[l,...s]=Tq(e,a,i.pathToTitle.slice(0,-1));return[fq({},l,{operation:r},o),...s]})),xq=(0,_.curry)(((e,t)=>{let{operation:r,operationParameters:n}=t;const{attributeValue:a,attributeTypeData:i}=n,o=yq(n,["attributeValue","attributeTypeData"]),[l,...s]=Tq(e,a,i.pathToTitle.slice(0,-1)),{label:c,refEntity:u}=a,[{objectURI:p,type:d}]=u;return[fq({},l,{operation:r},o,{attributeValue:{entityUri:p,entityLabel:c,entityType:d}}),...s]})),Cq=(0,_.curry)(((e,t)=>(0,_.cond)([[Gc,Oq(e)],[qc,xq(e)],[_.T,vq]])(t))),Sq=(0,_.curry)(((e,t)=>(0,_.pipe)((0,_.defaultTo)([]),(0,_.chain)((0,_.ifElse)(Lc,(0,_.pipe)(Uc,Sq(e)),Cq(e))))(t))),wq=e=>{let{scaffold:t}=e;const r=mq();return v().createElement("div",{className:O()(r.scaffold,{[r.scaffoldFullVert]:t===Eq.FULL_VERT||t===Eq.FULL_VERT_HOR,[r.scaffoldHalfVert]:t===Eq.HALF_VERT_HOR,[r.scaffoldHor]:t===Eq.FULL_VERT_HOR||t===Eq.HALF_VERT_HOR})})};wq.propTypes={scaffold:vp().oneOf((0,_.values)(Eq))};const Aq=e=>{let{scaffolds:t}=e;const r=mq();return v().createElement("div",{className:r.scaffoldsContainer},t.map(((e,t)=>v().createElement(wq,{key:t,scaffold:e}))))};Aq.propTypes={scaffolds:vp().arrayOf(wq.propTypes.scaffold)};const Rq=Aq,_q=e=>{let{children:t}=e;const r=mq();return v().createElement("div",{className:r.noWrapContainer},t)};_q.propTypes={children:vp().node};const Iq=_q,Nq=e=>{let{pin:t,addParent:r}=e;const n=mq();return v().createElement(Iq,null,v().createElement("div",{className:O()(n.optionContainer,{[n.opaque]:!t})},v().createElement(xW,null)),v().createElement("div",{className:O()(n.optionContainer,{[n.opaque]:!r})},v().createElement(SW,null)))};Nq.propTypes={pin:vp().bool,addParent:vp().bool};const Dq=Nq,Pq=e=>{let{entity:{entityLabel:t,entityUri:r},attributeType:n}=e;const a=mq(),i=(0,Tp.useSelector)((e=>k().selectors.getModifiedEntity(e,r)))||null,o=(0,Tp.useSelector)(k().selectors.getMetadata),l=(0,b.useCallback)((()=>{const e=(0,x.getReferencedEntityTypeUriFromAttrType)(n),t=(0,x.getEntityType)(o,e);return(0,x.evaluateDeepEntityLabel)(i,t.dataLabelPattern)}),[n,o,i]),s=i?l():t;return v().createElement(Iq,null,(0,x.getLabel)(s),(0,x.isTempUri)(r)&&v().createElement("div",{className:a.newIcon},mi().text("New")))},kq=(0,kp.Z)((()=>({tableContainer:{width:"90%",maxWidth:"1320px",margin:"30px auto",boxShadow:"0 2px 2px 0 rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.12), 0 1px 5px 0 rgba(0,0,0,0.2)"},table:{height:0,"& td, & th":{padding:"12px",overflowWrap:"anywhere"},"& th":{fontSize:"12px"},"& td":{fontSize:"13px"},"& tr":{"& > *:first-child":{paddingLeft:"24px"},"& > *:last-child":{paddingRight:"24px"}}},attributeColumn:{width:"35%"},conditionColumn:{width:"20%"},operatorColumn:{width:"10%"},valueColumn:{width:"15%"},optionsColumn:{width:"5%"}}))),Lq=()=>{const e=kq(),t=(0,Tp.useSelector)(Eu),r=(0,Tp.useSelector)(k().selectors.getMetadata),n=(0,Tp.useSelector)(k().selectors.getAttributesPresentation),a=(0,Tp.useSelector)(k().selectors.getLookups),i=(0,b.useMemo)((()=>Sq(r,t)),[t,r]);return v().createElement(rq(),{className:e.tableContainer,component:JI()},v().createElement(KG(),{className:e.table},v().createElement(aq(),null,v().createElement(oq(),null,v().createElement(eq(),{className:e.attributeColumn},mi().text("Attribute")),v().createElement(eq(),{className:e.conditionColumn},mi().text("Condition")),v().createElement(eq(),{className:e.operatorColumn},mi().text("Operator")),v().createElement(eq(),{className:e.valueColumn,colSpan:2}),v().createElement(eq(),{className:e.valueColumn}),v().createElement(eq(),{className:e.optionsColumn}))),v().createElement(QG(),null,i.map(((e,t)=>{let{scaffolds:i,attributeTypeData:o,conditions:l,operation:s,attributeValueToFind:c,attributeValue:u,pin:p,addNestedAttribute:d}=e;const m=!(0,_.isNil)(u),g=!(0,_.isNil)(c);return v().createElement(oq(),{key:t},v().createElement(eq(),null,v().createElement(Iq,null,i&&v().createElement(Rq,{scaffolds:i}),v().createElement(gq,{attributeTypeData:o}))),v().createElement(eq(),null,v().createElement(cq,{attributesPresentation:n,metadata:r,lookups:a,conditions:l})),v().createElement(eq(),null,s&&v().createElement(sq,{operation:s})),v().createElement(eq(),null,g&&v().createElement(lq,{lookups:a,attributeType:o.attributeType,value:c})),v().createElement(eq(),{align:"right"},g&&m&&v().createElement(Iq,null,v().createElement("span",null,mi().text("with")))),v().createElement(eq(),null,m&&((0,x.isReference)(o.attributeType)?v().createElement(Pq,{entity:u,attributeType:o.attributeType}):v().createElement(lq,{lookups:a,attributeType:o.attributeType,value:u}))),v().createElement(eq(),{align:"right"},v().createElement(Dq,{pin:p,addParent:d})))})))))},Uq=(0,kp.Z)((e=>({tableContainer:{display:"flex",flexDirection:"column",backgroundColor:"#fff",width:"100%",margin:"30px 60px",padding:"24px"},text:{paddingTop:"2px",paddingBottom:"1px","& p":{fontSize:"14px",lineHeight:"16px",margin:0,letterSpacing:0,color:e.palette.text.primary}}}))),jq=()=>{const e=Uq(),t=(0,Tp.useSelector)(Jc),r=(0,Tp.useSelector)(yu);return t===K.dV.UpdateProfiles?v().createElement(Lq,null):v().createElement("div",{className:e.tableContainer},v().createElement("div",{className:e.text},v().createElement("p",null,`${mi().text("Please confirm that you wish to start deletion of the selected")}`,v().createElement("b",null,` ${mi().number(r,"0,0")} `),mi().text(" profiles.")),v().createElement("p",null,mi().text("Click on Confirm to proceed."))))},Fq=(0,kp.Z)((()=>({contentRoot:{padding:"0 0 5px",position:"relative",backgroundColor:"#FAFAFA"},tenantLabel:{marginLeft:"23px"}}))),Mq=()=>{const e=Fq(),t=(0,Tp.useSelector)(ki.Ue),r=(0,Tp.useSelector)(eu),n=(0,Tp.useDispatch)(),a=()=>n(Di(!1));return v().createElement(kj(),{fullScreen:!0,open:t,onClose:a,disableEnforceFocus:!0},v().createElement(zG,{onClose:a},mi().text("Bulk update"),v().createElement(bW,{className:e.tenantLabel})),v().createElement(TW,null),v().createElement(EF(),{classes:{root:e.contentRoot}},(()=>{switch(r){case 0:return v().createElement(GG,null);case 1:return v().createElement(ZG,null);case 2:return v().createElement(SG,null);case 3:return v().createElement(jq,null)}})()))},Vq="1px solid rgba(0, 0, 0, 0.33)",Bq=(0,kp.Z)((e=>({root:{fontFamily:"Roboto, Helvetica, Arial, sans-serif",display:"flex",overflow:"hidden",position:"absolute",top:0,left:0,bottom:0,right:0},drawer:{flex:"0 0 288px!important"},docked:{flex:"0 0 288px"},drawerPaper:{width:288,display:"flex",flexDirection:"column",position:"relative",borderRight:Vq},mainContent:{transition:e.transitions.create("margin",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen}),backgroundColor:"white",marginLeft:-288},"mainContent--shifted":{transition:e.transitions.create("margin",{easing:e.transitions.easing.easeOut,duration:e.transitions.duration.enteringScreen}),marginLeft:0},menuIcon:{width:"24px",height:"24px",flexShrink:0,marginRight:"12px"},goToActionIcon:{marginLeft:"12px"},buttonRoot:{flexShrink:0},buttonExtended:{width:"256px",margin:"8px 16px",padding:"12px",backgroundColor:"rgba(0,0,0,0)",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)","&:hover":{backgroundColor:"rgba(0,0,0,0.1)"}},buttonLabel:{flexGrow:1,textAlign:"left",color:e.palette.text.secondary,fontSize:"14px",fontWeight:500,letterSpacing:0,lineHeight:"16px"},quickFilterRoot:{lineHeight:"16px",fontWeight:100,color:"rgba(0,0,0, 0.54)",letterSpacing:"normal",display:"flex",padding:"8px 0 16px 16px",flexShrink:0},withBottomBorder:{borderBottom:Vq,boxShadow:"0 1px 3px 0 rgba(0,0,0,0.12)"}}))),zq=(0,yd.T)(_g()),Hq=(0,Tp.connect)((e=>({isReadyAppData:!!(0,ki.$s)(e),openAdvancedSearch:(0,ki.IJ)(e),tenant:k().selectors.getTenant(e)})))((e=>{let{openAdvancedSearch:t,isReadyAppData:r,tenant:n,dispatch:a}=e;const i=(0,b.useCallback)((()=>{a({type:L.k.CONVERT_FROM_ADVANCED_SEARCH}),a(xi(!1))}),[a]),o=(0,b.useCallback)((()=>{a(xi(!0)),a({type:ht})}),[a]),[l,s]=(0,b.useState)(!0),c=(0,b.useCallback)((e=>{s(e<=0)}),[]),u=Bq(),p=!t;return(0,b.useEffect)((()=>()=>x.memoizeWith.clearCache()),[n]),r?v().createElement(v().Fragment,null,v().createElement("div",{className:u.root},v().createElement(Sg,{variant:"persistent",anchor:"left",open:p,classes:{root:u.drawer,paper:u.drawerPaper,docked:u.docked},"data-reltio-id":"reltio-search-facet-search-panel"},v().createElement(zq,{tooltipTitle:mi().text("Switch to Advanced search"),tooltipPlacement:"bottom-end",variant:"extended",classes:{root:u.buttonRoot,extended:u.buttonExtended},onClick:o,"data-reltio-id":"reltio-search-advanced-search-button"},v().createElement(Ng(),{color:"primary",className:u.menuIcon}),v().createElement("span",{className:u.buttonLabel},mi().text("Advanced search")),v().createElement(Pg(),{color:"action",className:u.goToActionIcon})),v().createElement(Ag(),{variant:"button",classes:{root:O()(u.quickFilterRoot,{[u.withBottomBorder]:!l})}},mi().text("Quick filters")),v().createElement(Gh,{onScroll:c})),v().createElement(Zh,{className:O()(u.mainContent,{[u["mainContent--shifted"]]:p})},v().createElement(yW,{isOpenAdvancedSearch:t,onCloseAdvancedSearch:i}))),v().createElement(Xh,null),v().createElement(uE,null),v().createElement(Mq,null)):null})),Yq=bg()({productionPrefix:"searchTable",disableGlobal:!0,seed:"srch"});x.userPreferencesComparator.register("searchState",((e,t)=>(0,x.looseEquals)((0,_.omit)(["query"],e),(0,_.omit)(["query"],t))));const Wq=()=>v().createElement(yg.DynamicModuleLoader,{modules:[Ep()]},v().createElement(Tg(),{generateClassName:Yq},v().createElement(hg._,{dateAdapter:fg.Q},v().createElement(Hq,null))))}}]);