@reltio/segmentation 1.4.160 → 1.4.162
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/566.bundle.js +1 -1
- package/package.json +3 -3
package/566.bundle.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_reltio_segmentation=self.webpackChunk_reltio_segmentation||[]).push([[566],{66566:(e,t,r)=>{r.r(t),r.d(t,{ConfigureColumnsButton:()=>xd,DEFAULT_SEARCH_SELECT:()=>B.Tv,EntitiesTableWithConfigurableColumns:()=>nf,EntityAvatar:()=>b.A,ROWS_PER_PAGE_OPTIONS:()=>B.Tu,buildQueryForAdvancedSearchGroups:()=>_a.Jk,buildSelectFromColumns:()=>vi.vw,collectSpecialColumns:()=>vi.oX,createRecentSearch:()=>ps,default:()=>lZ,getActiveEntityTypeTab:()=>Ti.tB,getAdditionalColumns:()=>vi.oq,getDataTenant:()=>Xa.lF,getEntityTypeLabel:()=>v.getEntityTypeLabel,getEntityTypeTab:()=>Ti.o4,getModule:()=>np,getPage:()=>Xa.fx,getRowsPerPage:()=>Xa.Uz,getSearchResultsMode:()=>Ti.XM,getSearchUrlQuery:()=>co.Cc,getSerializedSearchState:()=>po.Z,getTotal:()=>Xa.NU,needRequestAfterColumnsChanges:()=>vi.tU,parseSearchState:()=>gs.Z,queryBuilderHelpers:()=>n,queryBuilderSagas:()=>a,replaceSearchResultsColumns:()=>gs.f,showMoreResultsForEntityTypeAction:()=>Va,showSavedSearchesDialogAction:()=>si});var n={};r.r(n),r.d(n,{PROP_NAME_FILTER:()=>dt,PROP_NAME_OPERATOR:()=>ut,PROP_NAME_VALUES:()=>pt,addAttributeAfter:()=>St,changeAttributeData:()=>xt,createGetAttributeIndex:()=>bt,createGetAttributeLens:()=>vt,createGetAttributeProp:()=>Ot,createGetAttributesLens:()=>Et,createGetGroupLens:()=>ht,createSetAttributeProp:()=>Tt,defaultFindGroupPath:()=>gt,deleteAttribute:()=>wt,duplicateAttribute:()=>At,getAttributeData:()=>yt,getAttributeObject:()=>ft,getEmptyAttributeObject:()=>mt,setAttributeOperator:()=>Ct,setFilter:()=>Rt,setValues:()=>_t});var a={};r.r(a),r.d(a,{toggleQueryBuilderAttributeSelect:()=>qo});var i={};r.r(i),r.d(i,{addAttributes:()=>ib,addDefaultValuesAction:()=>ob,addNextPageOfAttributeValues:()=>cb,cancelProfileValidation:()=>hb,modifyAttribute:()=>lb,processNextPageOfAttributeValues:()=>ub,profileSaved:()=>yb,removeAttribute:()=>sb,requestNextPageOfAttributeValues:()=>pb,runAuthoringTaskAction:()=>mb,saveDraft:()=>fb,saveProfile:()=>db,validateProfile:()=>gb});var o={};r.r(o),r.d(o,{dependentLookupsEditorTouched:()=>Ob,dependentLookupsEditorsBlocked:()=>Tb,dependentLookupsInitedTypeUrisAdded:()=>vb,dependentLookupsStructureSet:()=>bb});var l={};r.r(l),r.d(l,{activityFilterUpdated:()=>Bb,globalFilterUpdated:()=>zb,keywordUpdated:()=>Fb,saveState:()=>Vb,searchResultsSet:()=>jb,setSearchNavigationData:()=>Gb,setSearchOptionsConfig:()=>Yb,setSearchProviderData:()=>Wb,updateSearchNavigationDataFields:()=>qb,updateSearchNavigationDataOnMerge:()=>Zb,updateSearchOptions:()=>Hb,updateState:()=>Mb});var s={};r.r(s),r.d(s,{addDashboardExternalView:()=>Lv,autocloseIntervalLoaded:()=>gv,clearNotifications:()=>uv,closeNotification:()=>cv,dateMaskUpdated:()=>Sv,dateTimeMaskUpdated:()=>xv,documentationSet:()=>kv,entityDeletionFinished:()=>ov,errorSet:()=>Dv,keysSet:()=>Nv,localeAttributePresentationLoaded:()=>yv,localizationLoaded:()=>Ov,navigateTo:()=>Iv,newEntityShown:()=>iv,newUiConfigLoaded:()=>fv,numberFormatUpdated:()=>Ev,openAppFromChocolateBar:()=>vv,openConsoleApp:()=>bv,openDashboard:()=>wv,openEntity:()=>av,openGraph:()=>Tv,openHistoryEvent:()=>Av,openNewEntityWithAuthoring:()=>Rv,openPerspective:()=>lv,openPivotingPerspective:()=>Pv,openPreviousPage:()=>_v,openSearch:()=>Cv,pathsSet:()=>pv,setPreferReact:()=>hv,setUseSharedPreferences:()=>Uv,showNotification:()=>sv,uiConfigLoaded:()=>mv,uiPathSet:()=>dv});var c={};r.r(c),r.d(c,{getAbsoluteImagePath:()=>VS,getActiveErrorsForAttributesPager:()=>BO,getActivityFilter:()=>bS,getAdminToolsPath:()=>ZO,getAiAssistantEnabled:()=>dS,getAiAssistantHistoryBufferSize:()=>yS,getAiAssistantLimitPerDay:()=>mS,getAiAssistantSkills:()=>fS,getAllRelationsToAddAndEdit:()=>LS,getAllRelationsToSave:()=>US,getAllServicesPaths:()=>lx,getAllTreesEditingConnections:()=>$S,getApiPath:()=>HO,getAttributeTypeErrors:()=>MO,getAttributesErrors:()=>VO,getAttributesPresentation:()=>$O,getAttributesSortingStrategy:()=>EC,getAuthoringByEntityType:()=>vC,getAutoCloseInterval:()=>QO,getCanSuggestAuthoring:()=>AC,getCanUserCreateWorkflowConfigJar:()=>yx,getCanUserCreateWorkflowEnvironmentConfigJar:()=>gx,getCanUserDeleteProfiles:()=>Fx,getCanUserExecuteWorkflowJobs:()=>hx,getCanUserExecuteWorkflowJobsSyncBusinessProcessData:()=>Ex,getCanUserExecuteWorkflowJobsTerminateProcessInstance:()=>bx,getCanUserExecuteWorkflowJobsUpdateTasks:()=>vx,getCanUserExecuteWorkflowJobsValidateTasks:()=>Tx,getCanUserGetDQStatistic:()=>Vx,getCanUserImportEntitiesFromDT:()=>kx,getCanUserMakeActivitiesExport:()=>Dx,getCanUserMakeBulkUpdate:()=>jx,getCanUserMakeExport:()=>Px,getCanUserManageWorkflowDefinition:()=>Ox,getCanUserManageWorkflowEnvironmentDefinition:()=>Sx,getCanUserOpenDataLoader:()=>Mx,getCanUserReadDVF:()=>Bx,getCanUserReadEntitiesFromDT:()=>Lx,getCanUserReadWorkflowDataTask:()=>xx,getCanUserRegisterConfigEnvironments:()=>fx,getCanUserStartProcessFromQuery:()=>Ux,getCanUserUpdateProcessInstance:()=>Cx,getCanUserUpdateWorkflowDataTask:()=>wx,getCanUserViewProcessInstanceSearchQuery:()=>Ax,getCanUserViewWorkflowConfigJar:()=>Rx,getCanUserViewWorkflowDefinition:()=>_x,getCanUserViewWorkflowEnvironmentConfigJar:()=>Ix,getCanUserViewWorkflowJobs:()=>Nx,getCheckIfCanAddRelations:()=>aC,getCleanseByEntityType:()=>TC,getCollaborationPath:()=>ux,getConnectionsByViewId:()=>vO,getConnectionsTemporaryUrisForCreation:()=>CO,getConnectionsWithDraftsByViewId:()=>SO,getControlAttributes:()=>wC,getDBConnectorSideViews:()=>Kx,getDVFPath:()=>px,getDataTenants:()=>sO,getDateMask:()=>JO,getDateTimeMask:()=>eS,getDependentLookupEditorState:()=>rC,getDependentLookupEditorsState:()=>tC,getDependentLookups:()=>Xx,getDependentLookupsInitedTypeUris:()=>eC,getDependentLookupsStructure:()=>Qx,getDependentLookupsStructureNode:()=>Jx,getDocReleaseNotes:()=>mC,getDraftsForSaveByViewId:()=>xO,getDtssPath:()=>ax,getEditingOrAddingConnectionByViewIdAndRelationUri:()=>TO,getEditingOrAddingConnectionRelationObjectByViewIdAndRelationUri:()=>OO,getEntity:()=>hO,getEntityRelatedAttributesByAttributeTypeUri:()=>FO,getEntityUri:()=>EO,getEntityUriWithDataTenant:()=>bO,getEntityWithDiff:()=>iC,getEntityWithoutDiff:()=>oC,getEnvironment:()=>rx,getEnvironmentAlias:()=>nx,getEnvironmentObject:()=>dO,getExportDQPath:()=>ix,getExportPath:()=>YO,getGlobalFilter:()=>CS,getGlobalFilterQuery:()=>wS,getGlobalFilterSavedSearchesUris:()=>AS,getGlobalSearchRequestOptions:()=>SS,getGoogleMapKey:()=>oS,getHeaderColor:()=>yC,getHiddenAttributes:()=>CC,getHistoryDiff:()=>IO,getHistoryEvent:()=>NO,getHistoryMode:()=>kO,getHistorySlice:()=>PO,getIcpLicenseKey:()=>lS,getImageAttributesFieldsOrder:()=>aS,getImagePath:()=>zO,getImageServicePath:()=>qO,getInitialConnection:()=>FS,getInitialConnectionTempEntity:()=>jS,getIsAuthoringMode:()=>SC,getIsEditableMode:()=>_S,getIsHistoryModeEnabled:()=>DO,getIsSuggestMode:()=>NS,getIsViewMode:()=>IS,getLogo:()=>fC,getLookupAutocomplete:()=>iS,getLookups:()=>AO,getMaxValuesInResponse:()=>XO,getMetadata:()=>uO,getMlDqPath:()=>mx,getMode:()=>RS,getModifiedEntities:()=>jO,getModifiedEntity:()=>LO,getModifiedEntityDefaultProfilePic:()=>UO,getNewTreeEnabled:()=>OC,getNotifications:()=>rS,getPivotingAttributes:()=>nS,getProfile:()=>yO,getProfileCancelNeedConfirm:()=>JS,getProfileCheckUpdate:()=>bC,getProfileErrors:()=>RO,getProfileLastLoadedTime:()=>KS,getProfileOperation:()=>XS,getProfileViews:()=>QS,getQueryEstimatorEnabled:()=>xC,getRelationToAddByViewId:()=>DS,getRelations:()=>PS,getRelationsToEditByViewId:()=>kS,getRelationsViewIds:()=>_O,getReleaseVersion:()=>dC,getReltioPath:()=>GO,getRequestProviderConfiguration:()=>tS,getSearch:()=>gO,getSearchKeyword:()=>ES,getSearchNavigationData:()=>OS,getSearchOptions:()=>vS,getSearchProviderData:()=>TS,getSearchResults:()=>hS,getServicesPath:()=>lC,getSharedPreferencesEnabled:()=>gS,getShowAttributeDescription:()=>hC,getShowEntityId:()=>pC,getShowSearchByOv:()=>gC,getStringifiedSearchOptions:()=>xS,getTenant:()=>ex,getTenantName:()=>tx,getTenantObject:()=>pO,getTenants:()=>cO,getTotalByViewId:()=>wO,getTree:()=>YS,getTreeCommands:()=>qS,getTreeEditingConnection:()=>ZS,getTreeRoot:()=>WS,getTreeTotal:()=>GS,getTrees:()=>HS,getUIConfig:()=>sC,getUIConfigLayout:()=>cC,getUIConfigProfile:()=>uC,getUIPath:()=>WO,getUi:()=>fO,getUiError:()=>nC,getUiNumberFormat:()=>KO,getUser:()=>mO,getUserName:()=>BS,getUserRoles:()=>zS,getValidateReadMode:()=>cS,getValidateReferenceEntityInReadMode:()=>pS,getValidateRelations:()=>uS,getValidationServicePath:()=>dx,getValidationServiceSeverityLevels:()=>sS,getViewIdsForOpenRelation:()=>MS,getWorkflowConfigurationEnabled:()=>cx,getWorkflowEnvironmentUrl:()=>sx,getWorkflowPath:()=>ox,isCollaborationEnabled:()=>zx,isCollaborationSideViewEnabled:()=>qx,isDBConnectorSideViewEnabled:()=>$x,isHistorySideViewEnabled:()=>Zx,isWorkflowEnabled:()=>Hx,isWorkflowSideViewEnabled:()=>Gx});var u={};r.r(u),r.d(u,{authoringDcrResolved:()=>aw,authoringDraftEntitiesLoaded:()=>nw,clearEntity:()=>lw,entityCloneRequested:()=>ow,entityCreationRequested:()=>tw,entityCreationWithAuthoringRequested:()=>rw,entityLoaded:()=>QC,entityRemoveRequested:()=>iw,loadEntity:()=>ew,setDefaultProfilePic:()=>JC});var p={};r.r(p),r.d(p,{errorDeactivated:()=>mw,errorsSet:()=>fw});var d={};r.r(d),r.d(d,{clearHistoryDiff:()=>bw,clearHistoryEvent:()=>Tw,setHistoryDiff:()=>Ew,setHistoryEvent:()=>vw,setHistoryMode:()=>Sw,setHistorySlice:()=>Ow});var m={};r.r(m),r.d(m,{lookupsForTypeResolved:()=>Iw,lookupsListResolved:()=>Nw,lookupsLoaded:()=>_w});var f={};r.r(f),r.d(f,{modeEditingCanceled:()=>jw,modeUpdateRequested:()=>Uw,modeUpdated:()=>Lw});var y={};r.r(y),r.d(y,{cleanseLoading:()=>Gw,entityCreated:()=>zw,entityDeleted:()=>Hw,modifiedEntitiesReset:()=>Ww,setDefaultProfilePic:()=>Yw});var g={};r.r(g),r.d(g,{addRelation:()=>lA,closeRelationEditor:()=>pA,editRelation:()=>sA,ignoreRelation:()=>oA,openRelationEditor:()=>uA,relationsLoaded:()=>nA,removeRelation:()=>iA,secondLevelRelationsLoaded:()=>aA,setInitialInfo:()=>fA,setRelationEntity:()=>mA,setRelationType:()=>dA,updateRelationRating:()=>cA});var h={};r.r(h),r.d(h,{hiddenAttributesReset:()=>aI,hiddenAttributesUpdated:()=>nI});var E={};r.r(E),r.d(E,{controlAttributesUpdated:()=>lI}),r(69448);var b=r(68269),v=r(2396),T=r(75580),O=r(73288),S=r(62391),x=r(9400),C=r(8523),w=r(42308),A=r.n(w),R=r(61882),_=r(26040),I=r(5950);function N(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){P(e,t,r[t])}))}return e}function P(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const D={facetsConfigs:[],facetsData:{},recommendedFacets:[],addedFacets:[]},k=(0,S.Ic)("facetsConfigs"),L=(0,S.Ic)("facetsData"),U=(0,S.Ic)("recommendedFacets"),j=(0,S.Ic)("addedFacets"),F=(e,t,r)=>Object.keys(e).reduce(((t,n)=>(0,O.prop)(n,t)?(0,S.ET)(n,r).set(t,e[n]):t),N({},t)),M=({state:e,facetsConfigs:t,addToEnd:r=!1,facetsData:n={}})=>{const a=t.filter((e=>e.fieldName)),i=k.get(e),o=k.set(e,r?i.concat(a):a.concat(i)),l=L.get(e),s=a.reduce(((e,t)=>N({},e,{[t.fieldName]:(0,x.DV)(t.fieldName,n[t.fieldName])})),N({},l));return L.set(o,s)},V=(e=D,t)=>{switch(t.type){case R.k.CREATE_FACETS:{const{facetsConfigs:r,addToEnd:n}=t.payload;return M({state:e,facetsConfigs:r,addToEnd:n})}case w.search.constants.UPDATE_STATE:{const{facetsConfigs:e=[],facetsData:r={}}=t.payload.facets||{facetsConfigs:[]};return M({state:D,facetsConfigs:e,facetsData:r})}case R.k.DESTROY_FACETS:return((e,t)=>{const r=L.get(e),n=k.get(e),a=N({},r);t.forEach((e=>{delete a[e]}));const i=L.set(e,a);return k.set(i,n.filter((e=>!t.includes(e.fieldName))))})(e,t.payload||[]);case R.k.CHANGE_VALUES:{const{facetFieldName:r,values:n}=t.payload;return(({facetFieldName:e,values:t,state:r})=>{const n=[...(0,C.jK)(e),"values"];return(0,S.ET)(...n).set(r,t)})({facetFieldName:r,values:n,state:e})}case R.k.SHOW_MORE_ENTITY_TYPES:{const{show:r}=t.payload,n="type",a=(0,C.jK)(n);if(r)return(0,S.ET)(...a,"showAllItems").set(e,r);{const t=(0,S.ET)(...a);return t.set(e,(0,O.omit)(["showAllItems"],t.get(e)))}}case R.k.CLEAR_ALL_VALUES:case _.Z.CLEAR_ALL:{const t=L.get(e),r=Object.keys(t).reduce(((e,t)=>N({},e,{[t]:[]})),{}),n=F(r,t,"values");return L.set(e,n)}case R.k.UPDATE_DATA:{const r=t.payload||{},n=L.get(e),a=F(r,n,"data");return L.set(e,a)}case R.k.UPDATE_FILTERED_DATA:{const r=t.payload||{},n=L.get(e),a=F(r,n,"filteredData");return L.set(e,a)}case R.k.DESTROY_FILTERED_DATA:{const r=t.payload||{},n=(0,C.jK)(r);if((0,O.path)(n,e)){const t=(0,S.ET)(...n),r=N({},t.get(e));if(r.filteredData)return delete r.filteredData,t.set(e,r)}break}case R.k.SET_RECOMMENDED_FACETS_LIST:return U.set(e,t.payload||[]);case R.k.HIGHLIGHT_ADDED_FACETS:return j.set(e,t.payload);case R.k.CLEAR_HIGHLIGHT_ADDED_FACETS:return j.set(e,[]);case"UI_RESET":return N({},D);case _.Z.CHANGE_CURRENT_TENANT:{const{isDataTenant:r,tenantObject:n}=t.payload;if(r){const t=k.get(e),r=L.get(e),a=(0,I.ci)(n,t),i=(0,O.pluck)("fieldName",a),o=(0,O.pipe)((0,O.pick)(i),(0,I.AZ)(n))(r);return L.set(k.set(e,a),o)}return e}}return e};var B=r(33950);function z(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){H(e,t,r[t])}))}return e}function H(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Y={searchResults:null,searchResultsByEntityTypes:{},total:0,page:0,sortField:null,sortOrder:null,rowsPerPage:B.Tu[0],loading:!1,searchParams:{searchBoxInput:{fieldName:"attributes",filter:"containsWordStartingWith"},mapSearch:{fieldName:"geoLocation",type:"geoLocation",filter:"range",values:[]}},currentTenant:null},W=(0,S.Ic)("searchResults"),G=(0,S.Ic)("total"),q=(0,S.Ic)("page"),Z=(0,S.Ic)("rowsPerPage"),$=(0,S.Ic)("sortField"),K=(0,S.Ic)("sortOrder"),X=(0,S.Ic)("loading"),Q=(0,S.ET)("searchParams","mapSearch","values"),J=(0,S.ET)("searchParams","mapSearch","type"),ee=(0,S.ET)("searchParams","mapSearch","fieldName"),te=(0,S.Ic)("searchResultsByEntityTypes"),re=e=>te.compose((0,S.ET)(e,"page")),ne=({entityTypeUri:e,field:t,order:r},n)=>{if(e){const a=te.compose((0,S.ET)(e,"sortField")),i=te.compose((0,S.ET)(e,"sortOrder")),o=a.set(n,t);return i.set(o,r)}{const e=$.set(n,t);return K.set(e,r)}},ae=(e=Y,t)=>{switch(t.type){case _.Z.UPDATE_ENTITIES:{const{searchResults:r,entityTypeUri:n}=t.payload;return n?te.compose((0,S.ET)(n,"searchResults")).set(e,r):W.set(e,r)}case _.Z.UPDATE_TOTAL:return G.set(e,t.payload);case _.Z.CHANGE_PAGE:{const{entityTypeUri:r,pageNumber:n}=t.payload;return r?re(r).set(e,n):q.set(e,n)}case _.Z.RESET_PAGE:{const{entityTypeUri:r}=t.payload,n=q.set(e,0);return r?re(r).set(n,0):n}case _.Z.CHANGE_ROWS_PER_PAGE:{const{entityTypeUri:r,number:n}=t.payload;if(r){const t=te.compose((0,S.ET)(r,"rowsPerPage")),a=re(r).set(e,0);return t.set(a,n)}{const t=q.set(e,0);return Z.set(t,n)}}case _.Z.CHANGE_SORT:return ne(t.payload,e);case _.Z.CHANGE_LOADING:return X.set(e,t.payload);case w.search.constants.UPDATE_STATE:{const{values:r=[],searchType:n=v.MapSearch.geoPolygon}=t.payload.map||{};let a=Q.set(Y,r);if(a=J.set(a,n),a=ee.set(a,(0,v.mapSearchTypeToFieldName)(n)),t.payload.view){const{entityTypeTab:e,sortField:r,sortOrder:n}=t.payload.view;a=ne({entityTypeUri:e,field:r,order:n},a)}return z({},a,{currentTenant:t.payload.currentTenant||e.currentTenant,searchOptions:t.payload.searchOptions||e.searchOptions})}case"UI_RESET":return z({},Y);case _.Z.MAP_CHANGE_VALUE:{const{value:r,searchType:n}=t.payload;let a=J.set(e,n);return a=ee.set(a,(0,v.mapSearchTypeToFieldName)(n)),Q.set(a,r?[r]:[])}case _.Z.CLEAR_RESULTS:{const r=t.payload;if(r){let t=W.set(e,void 0);const n=te.get(e);return te.set(t,{[r]:n[r]})}return te.set(e,{})}case _.Z.CLEAR_ALL:return Q.set(e,[]);case _.Z.CHANGE_CURRENT_TENANT:return z({},e,{currentTenant:t.payload.tenantObject.id})}return e},ie="UI_SHOW_MORE_FACETS_POPUP",oe="UI_SHOW_SAVED_SEARCHES_DIALOG",le="UI_SHOW_SAVE_SEARCH_DIALOG",se="UI_SHOW_ADVANCED_SEARCH",ce="UI_SHOW_BULK_UPDATE",ue="UI_SET_MARKER",pe="UI_SET_HOVERED_ENTITY_URI",de="UI_SET_SEARCH_RESULTS_COLUMNS",me="UI_CHANGE_SEARCH_RESULTS_COLUMNS",fe="UI_SET_ENTITY_TYPE_TAB",ye="UI_UPDATE_TABLE_VIEW_TABS",ge="UI_CHANGE_ORDER_SEARCH_RESULTS_COLUMNS",he="UI_CHANGE_SIZES_SEARCH_RESULTS_COLUMNS",Ee="UI_CLEAR_NOTIFICATION",be="UI_SET_NOTIFICATION",ve="UI_SET_SEARCH_RESULTS_MODE",Te="UI_SET_PREVIEW_PANEL_MODE",Oe={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},Se=(0,S.Ic)("showMoreFacetsPopup"),xe=(0,S.Ic)("showSavedSearchesDialog"),Ce=(0,S.Ic)("showSaveSearchDialog"),we=(0,S.Ic)("showAdvancedSearch"),Ae=(0,S.Ic)("showBulkUpdate"),Re=(0,S.Ic)("activeAdditionalSearch"),_e=(0,S.Ic)("activeMarker"),Ie=(0,S.Ic)("hoveredEntityUri"),Ne=(0,S.Ic)("searchResultsMode"),Pe=(0,S.Ic)("previewPanelMode"),De=(0,S.Ic)("searchResultsColumns"),ke=(0,S.Ic)("entityTypeTab"),Le=(0,S.Ic)("tableViewTabs"),Ue=(0,S.Ic)("loading"),je=(0,S.Ic)("notification"),Fe=(e=Oe,t)=>{switch(t.type){case ie:return Se.set(e,t.payload);case oe:return xe.set(e,t.payload);case le:return Ce.set(e,t.payload.show);case se:return we.set(e,t.payload);case ce:return Ae.set(e,t.payload);case"UI_SET_ACTIVE_ADDITIONAL_SEARCH":{const r=Re.get(e)===t.payload?null:t.payload;return Re.set(e,r)}case ue:return _e.set(e,t.payload);case pe:return Ie.set(e,t.payload);case ve:return Ne.set(e,t.payload);case de:return De.set(e,t.payload);case me:{const{entityTypeUri:r,columns:n}=t.payload;return De.compose((0,S.Ic)(r)).set(e,n)}case he:{const{entityTypeUri:r,columns:n}=t.payload;return De.compose((0,S.Ic)(r)).set(e,n)}case ge:{const{entityTypeUri:r,columns:n}=t.payload;return De.compose((0,S.Ic)(r)).set(e,n)}case Te:return Pe.set(e,t.payload);case fe:return ke.set(e,t.payload.entityTypeUri);case ye:return Le.set(e,t.payload);case R.k.UPDATE_DATA:if((0,O.has)("type",t.payload))return Le.set(e,t.payload.type);break;case R.k.CHANGE_VALUES:{const{facetFieldName:r,values:n}=t.payload;if("type"===r&&n.length){const t=ke.get(e);if(!n.includes(t))return ke.set(e,n[0])}break}case"UI_RESET":return Oe;case"UI_SET_LOADING":return Ue.set(e,t.payload);case be:return je.set(e,t.payload);case Ee:return je.set(e,null);case w.search.constants.UPDATE_STATE:{let r=we.set(e,(0,O.has)("advanced",t.payload));if(t.payload.view){const{searchResultsMode:e,entityTypeTab:n,searchResultsColumns:a,previewPanelMode:i}=t.payload.view;r=Ne.set(r,e),r=ke.set(r,n),(0,v.isEmptyValue)(a)||(r=De.set(r,a)),r=Pe.set(r,i)}return t.payload.showSavedSearchesDialog&&(r=xe.set(r,t.payload.showSavedSearchesDialog)),r}}return e};var Me=r(37164);const Ve="ADVANCED_SEARCH_SET_GROUP_ENTITY_TYPES",Be="ADVANCED_SEARCH_VERIFY_GROUP_ENTITY_TYPES",ze="ADVANCED_SEARCH_SET_GROUP_OPERATOR",He="ADVANCED_SEARCH_DELETE_GROUP",Ye="ADVANCED_SEARCH_ADD_GROUP",We="ADVANCED_SEARCH_DUPLICATE_GROUP",Ge="ADVANCED_SEARCH_ADD_ATTRIBUTE_AFTER",qe="ADVANCED_SEARCH_CHANGE_ATTRIBUTE_DATA",Ze="ADVANCED_SEARCH_TOGGLE_ATTRIBUTE_SELECT",$e="ADVANCED_SEARCH_SET_ATTRIBUTE_OPERATOR",Ke="ADVANCED_SEARCH_DELETE_ATTRIBUTE",Xe="ADVANCED_DELETE_ATTRIBUTE_AND_VERIFY_GROUP_ENTITY_TYPES",Qe="ADVANCED_SEARCH_DUPLICATE_ATTRIBUTE",Je="ADVANCED_SEARCH_SET_FILTER",et="ADVANCED_SEARCH_SET_VALUES",tt="ADVANCED_SEARCH_ATTRIBUTE_SET_VALUES",rt="ADVANCED_SEARCH_ATTRIBUTE_FILTER_VALUES",nt="ADVANCED_SEARCH_ATTRIBUTE_SET_FILTERED_VALUES",at="ADVANCED_SEARCH_ATTRIBUTE_UPDATE_VALUES",it="ADVANCED_SEARCH_UPDATE",ot="ADVANCED_SEARCH_CONVERT_FROM_FACETS";var lt=r(81253);function st(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){ct(e,t,r[t])}))}return e}function ct(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ut="operator",pt="values",dt="filter",mt=(e=(0,Me.x0)())=>({[ut]:B.YL.value,id:e}),ft=(e,t=(0,Me.x0)())=>{const r=yt(e);return{data:r,[ut]:B.YL.value,[dt]:(0,O.pathOr)("",["filterOptions",0],r),id:t}},yt=e=>st({},e,{filterOptions:e.enforcedFilterOptions||(0,v.getFilterOptionsForQueryBuilder)(e.attrType,e.fieldName,!0)}),gt=(0,O.curry)(((e,t)=>{const r=t.findIndex((t=>t.id===e));return r>-1?[r]:null})),ht=(e,t=gt)=>(r,n)=>{const a=(0,S.ET)(...e).get(r),i=t(n,a);return!!i&&(0,S.ET)(...e,...i)},Et=(e,t)=>(r,n)=>{const a=e(r,n);return a&&a.compose((0,S.Ic)(t))},bt=e=>(t,r,n)=>{const a=e(t,r);return a?a.get(t).findIndex((e=>e.id===n)):-1},vt=e=>(t,r,n)=>{const a=e(t,r),i=bt(e)(t,r,n);return-1!==i?a.compose((0,S.ET)(i)):null},Tt=e=>(t,r,n,a,i)=>{const o=e(t,r,n);if(o){const e=st({},o.get(t));return e[a]=i,o.set(t,e)}return t},Ot=e=>(t,r,n,a)=>{const i=e(t,r,n);if(i)return i.get(t)[a]},St=({state:e,groupId:t,attributeId:r,attribute:n,getAttributesLens:a,getAttributeIndex:i})=>{const o=a(e,t);if(o){let a=[...o.get(e)];const l=i(e,t,r),s=!a[l+1];return-1!==l&&s?a.splice(l+1,0,n):-1!==l?(a.splice(l+1,0,st({},n,{operator:a[l].operator})),a[l]=st({},a[l],{operator:B.YL.value})):a.push(n),o.set(e,a)}return e},xt=({state:e,groupId:t,attributeId:r,attributeData:n,setAttributeProp:a,getAttributeLens:i})=>{let o=e;if(n)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))})(e,t,r,n,i)&&(o=a(e,t,r,dt,n.filterOptions[0])),o=a(o,t,r,pt,[]),a(o,t,r,"data",n);{const n=i(e,t,r);return n&&(o=n.set(o,mt(r))),o}},Ct=({state:e,groupId:t,attributeId:r,operator:n,setAttributeProp:a})=>a(e,t,r,ut,n),wt=({state:e,groupId:t,attributeId:r,getAttributesLens:n})=>{const a=n(e,t);if(a){const t=[...a.get(e)],n=t.findIndex((e=>e.id===r));if(n>-1){const r=(0,O.remove)(n,1,t),i=r[n-1],o=t[n];return i&&(r[n-1]=st({},i,{operator:o.operator})),a.set(e,r)}}return e},At=({state:e,groupId:t,attributeId:r,id:n,getAttributesLens:a})=>{const i=a(e,t);if(i){const t=[...i.get(e)],a=t.findIndex((e=>e.id===r));if(a>-1)return t.push(st({},t[a],{id:n})),i.set(e,t)}return e},Rt=({state:e,groupId:t,attributeId:r,filter:n,getAttributeProp:a,setAttributeProp:i})=>{const o=a(e,t,r,dt),l=(0,v.isCompatibleFilters)(o,n)?e:i(e,t,r,pt,[]);return i(l,t,r,dt,n)},_t=({state:e,groupId:t,attributeId:r,values:n,setAttributeProp:a})=>a(e,t,r,pt,n);function It(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Nt(e,t,r[t])}))}return e}function Nt(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Pt={groups:[]},Dt={},kt="entityTypes",Lt="attributes",Ut=["groups"],jt=(0,S.ET)(...Ut),Ft=ht(Ut),Mt=Et(Ft,Lt),Vt=bt(Mt),Bt=vt(Mt),zt=Tt(Bt),Ht=Ot(Bt),Yt=(e,t=[],r=(0,Me.x0)())=>({[Lt]:e.map((e=>ft(e))),[ut]:B.qx.value,[kt]:t,id:r}),Wt=(e=Dt,t)=>{switch(t.type){case nt:{const{groupId:r,attributeId:n,values:a}=t.payload;return(0,O.assocPath)([r,n,"filtered"],a,e)}case He:{const{groupId:r}=t.payload;return(0,O.dissoc)(r,e)}case Ke:{const{groupId:r,attributeId:n}=t.payload;return(0,O.dissocPath)([r,n],e)}case We:{const{groupId:r,id:n}=t.payload,a=e[r];return a?(0,O.assoc)(n,a,e):e}case Qe:{const{groupId:r,attributeId:n,id:a}=t.payload,i=(0,O.path)([r,n],e);return i?(0,O.assocPath)([r,a],i,e):e}case _.Z.CLEAR_ALL:case w.search.constants.UPDATE_STATE:return Dt;default:return e}},Gt=(e=Pt,t)=>{switch(t.type){case Ye:{const{group:r}=t.payload,n=[...jt.get(e)];return n.push(r),jt.set(e,n)}case ze:{const{groupId:r,operator:n}=t.payload,a=Ft(e,r);if(a){const t=It({},a.get(e));return t[ut]=n,a.set(e,t)}return e}case Ve:{const{groupId:r,entityTypes:n}=t.payload,a=Ft(e,r);if(a){const t=It({},a.get(e));return t.entityTypes=n,t.autoAddedEntityTypes=[],t.attributes=[],a.set(e,t)}return e}case Be:{const{groupId:r}=t.payload,n=Ft(e,r);if(n){const t=n.get(e),{entityTypes:r,autoAddedEntityTypes:a}=(0,lt.tg)((0,lt.r8)(t.attributes||[]),t.entityTypes,t.autoAddedEntityTypes);return n.set(e,It({},t,{[kt]:r,autoAddedEntityTypes:a}))}return e}case He:{const{groupId:r}=t.payload,n=[...jt.get(e)],a=n.findIndex((e=>e.id===r));if(a>-1){const t=(0,O.remove)(a,1,n),r=t[a-1],i=n[a];return r&&(t[a-1]=It({},r,{operator:i.operator})),jt.set(e,t)}return e}case We:{const{groupId:r,id:n}=t.payload,a=[...jt.get(e)],i=a.findIndex((e=>e.id===r));return i>-1?(a.push(It({},a[i],{id:n})),jt.set(e,a)):e}case Ge:{const{groupId:r,attributeId:n,attribute:a}=t.payload;return St({state:e,groupId:r,attributeId:n,attribute:a,getAttributesLens:Mt,getAttributeIndex:Vt})}case qe:{const{groupId:r,attributeId:n,attributeData:a}=t.payload;return xt({state:e,groupId:r,attributeId:n,attributeData:a,setAttributeProp:zt,getAttributeLens:Bt})}case $e:{const{groupId:r,attributeId:n,operator:a}=t.payload;return Ct({state:e,groupId:r,attributeId:n,operator:a,setAttributeProp:zt})}case Ke:{const{groupId:r,attributeId:n}=t.payload;return wt({state:e,groupId:r,attributeId:n,getAttributesLens:Mt})}case Qe:{const{groupId:r,attributeId:n,id:a}=t.payload;return At({state:e,groupId:r,attributeId:n,id:a,getAttributesLens:Mt})}case Je:{const{groupId:r,attributeId:n,filter:a}=t.payload;return Rt({state:e,groupId:r,attributeId:n,filter:a,getAttributeProp:Ht,setAttributeProp:zt})}case et:{const{groupId:r,attributeId:n,values:a}=t.payload;return _t({state:e,groupId:r,attributeId:n,values:a,setAttributeProp:zt})}case _.Z.CLEAR_ALL:return Pt;case w.search.constants.UPDATE_STATE:{const{advanced:e=[]}=t.payload;return jt.set(Pt,e)}default:return e}},qt=(e,t)=>{const r=((e,t)=>{if(t.type===tt){var r;const{groupId:n,attributeId:a,values:i}=t.payload;return((null===(r=[...jt.get(e.searchParams)].find((e=>e.id===n)))||void 0===r?void 0:r.attributes)||[]).some((({id:e})=>e===a))?(0,O.assocPath)(["attributesData",n,a,"default"],i,e):e}return e})((0,T.combineReducers)({searchParams:Gt,attributesData:Wt})(e,t),t);return r},Zt="SAVED_SEARCHES_CREATE",$t="SAVED_SEARCHES_SET_CURRENT",Kt="SAVED_SEARCHES_SET_CHANGE_INDICATOR",Xt="SAVED_SEARCHES_UPDATE",Qt="SAVED_SEARCHES_LOAD",Jt="SAVED_SEARCHES_SET_TOTAL",er="SAVED_SEARCHES_SET_ITEMS",tr="SAVED_SEARCHES_SET_ITEM_TOTAL",rr="SAVED_SEARCHES_SET_PAGE",nr="SAVED_SEARCHES_SET_ROWS_PER_PAGE",ar="SAVED_SEARCHES_SET_FILTERS",ir="SAVED_SEARCHES_SELECT_ITEM",or="SAVED_SEARCHES_SELECT_ALL_ITEMS",lr="SAVED_SEARCHES_DESELECT_ALL_ITEMS",sr="SAVED_SEARCHES_MARK_PUBLIC_REQUEST",cr="SAVED_SEARCHES_MARK_PUBLIC",ur="SAVED_SEARCHES_MARK_FAVORITE_REQUEST",pr="SAVED_SEARCHES_MARK_FAVORITE",dr="SAVED_SEARCHES_MARK_GLOBAL_FILTER_REQUEST",mr="SAVED_SEARCHES_CHANGE_ITEM_NAME_REQUEST",fr="SAVED_SEARCHES_CHANGE_ITEM_NAME",yr="SAVED_SEARCHES_SET_EDITING",gr="SAVED_SEARCHES_DELETE_SELECTED_ITEMS_REQUEST",hr="SAVED_SEARCHES_DELETE_ITEM_REQUEST",Er="SAVED_SEARCHES_DELETE_ITEMS",br="SAVED_SEARCHES_SET_LOADING",vr="SAVED_SEARCHES_SET_SEARCH_VALUE",Tr="SAVED_SEARCHES_APPLY_ITEM",Or="SAVED_SEARCHES_SET_TOTAL_LOADING",Sr="SAVED_SEARCHES_LOAD_TOTAL",xr="SAVED_SEARCHES_TOGGLE_SORT",Cr="RECENT_SEARCHES_CREATE",wr="RECENT_SEARCHES_LOAD",Ar="RECENT_SEARCHES_SET_ITEMS",Rr="RECENT_SEARCHES_SET_ITEM_TOTAL",_r="RECENT_SEARCHES_SELECT_ITEM",Ir="RECENT_SEARCHES_SELECT_ALL_ITEMS",Nr="RECENT_SEARCHES_DESELECT_ALL_ITEMS",Pr="RECENT_SEARCHES_DELETE_SELECTED_ITEMS_REQUEST",Dr="RECENT_SEARCHES_DELETE_ITEMS",kr="RECENT_SEARCHES_DELETE_ITEM_REQUEST",Lr="RECENT_SEARCHES_SET_LOADING",Ur="RECENT_SEARCHES_SET_SEARCH_VALUE",jr="RECENT_SEARCHES_SET_LAST_SAVED",Fr="RECENT_SEARCHES_SET_TOTAL_LOADING",Mr="RECENT_SEARCHES_LOAD_TOTAL",Vr="RECENT_SEARCHES_APPLY_ITEM";function Br(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){zr(e,t,r[t])}))}return e}function zr(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Hr={currentSearch:null,postSavingAction:null,changeIndicator:!1,items:[],loading:!1,total:0,page:0,rowsPerPage:B.Tu[0],searchValue:"",findPublic:!0,favoriteOnly:!1,sorting:{order:B.rX.DESC,field:B.KY.updateDate}},Yr=(0,S.Ic)("changeIndicator"),Wr=(0,S.Ic)("items"),Gr=(0,S.Ic)("total"),qr=(0,S.Ic)("page"),Zr=(0,S.Ic)("loading"),$r=(0,S.Ic)("postSavingAction"),Kr=(0,S.Ic)("sorting"),Xr=(e,t,r)=>{const n=Wr.get(r).findIndex((e=>e.uri===t)),a=Wr.compose((0,S.ET)([n])),i=a.get(r);return a.set(r,e(i))},Qr=(e,t,r)=>(0,O.evolve)({page:(0,O.always)(0),[e]:(0,O.always)(t)},r),Jr=(e=Hr,t)=>{switch(t.type){case $t:return(0,O.evolve)({currentSearch:(0,O.always)(t.payload),changeIndicator:null===t.payload?(0,O.always)(!1):O.identity},e);case _.Z.CLEAR_ALL:return(0,O.evolve)({currentSearch:(0,O.always)(null),changeIndicator:(0,O.always)(!1)},e);case Kt:return Yr.set(e,t.payload);case Jt:return Gr.set(e,t.payload);case rr:return qr.set(e,t.payload);case nr:return Qr("rowsPerPage",t.payload,e);case ar:{const{findPublic:r,favoriteOnly:n}=t.payload;return(0,O.evolve)({page:(0,O.always)(0),findPublic:(0,O.always)(r),favoriteOnly:(0,O.always)(n)},e)}case er:return Wr.set(e,t.payload);case ir:{const{uri:r,checked:n}=t.payload;return Xr((e=>Br({},e,{checked:n})),r,e)}case lr:{const t=Wr.get(e);return Wr.set(e,t.map((0,O.omit)(["checked"])))}case or:{const t=Wr.get(e);return Wr.set(e,t.map((0,O.ifElse)((0,O.prop)("isOwnSearch"),(0,O.assoc)("checked",!0),O.identity)))}case Er:{const r=t.payload,n=Wr.get(e),a=Gr.set(e,Gr.get(e)-r.length);return Wr.set(a,n.filter((e=>!r.includes(e.uri))))}case cr:{const{uri:r,isPublic:n}=t.payload;return Xr((e=>Br({},e,{isPublic:n})),r,e)}case pr:{const{uri:r,isFavorite:n}=t.payload;return Xr((e=>Br({},e,{isFavorite:n})),r,e)}case tr:{const{uri:r,total:n}=t.payload;return Xr((e=>Br({},e,{total:n})),r,e)}case yr:{const{uri:r,isEditing:n}=t.payload;return Xr((e=>Br({},e,{isEditing:n})),r,e)}case mr:{const{uri:r}=t.payload;return Xr((0,O.omit)(["isEditing"]),r,e)}case fr:{const{uri:r,name:n}=t.payload;return Xr((e=>Br({},e,{name:n})),r,e)}case br:return Zr.set(e,t.payload);case Ur:case vr:return Qr("searchValue",t.payload,e);case Qt:return Br({},e,{page:0,findPublic:!0,favoriteOnly:!1});case xr:{const n=t.payload,a=(0,O.path)(["sorting","field"],e),i=(0,O.path)(["sorting","order"],e);return Kr.set(e,{field:n,order:(r=n===a?i:null,r===B.rX.DESC?B.rX.ASC:B.rX.DESC)})}case Or:{const{uri:r,isLoading:n}=t.payload;return Xr((e=>Br({},e,{isTotalLoading:n})),r,e)}case le:return $r.set(e,t.payload.postSavingAction);case oe:return Qr("searchValue",Hr.searchValue,e)}var r;return e};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.push.apply(n,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=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const rn={items:[],filterWord:null,loading:!1,lastSavedRecentSearch:null},nn=(0,S.Ic)("items"),an=(0,S.Ic)("loading"),on=(0,S.Ic)("filterWord"),ln=(0,S.Ic)("lastSavedRecentSearch"),sn=(e,t,r)=>{const n=nn.get(r).findIndex((e=>e.createdDate===t)),a=nn.compose((0,S.ET)([n])),i=a.get(r);return a.set(r,e(i))},cn=(e=rn,t)=>{switch(t.type){case vr:case Ur:return on.set(e,t.payload);case Ar:return nn.set(e,t.payload);case _r:{const{searchCreatedDate:r,checked:n}=t.payload;return sn((e=>en({},e,{checked:n})),r,e)}case Nr:{const t=nn.get(e);return nn.set(e,t.map((0,O.omit)(["checked"])))}case Ir:{const t=nn.get(e);return nn.set(e,t.map((0,O.assoc)("checked",!0)))}case Dr:{const r=(t.payload||[]).map((0,O.prop)("createdDate")),n=nn.get(e);return nn.set(e,n.filter((e=>!r.includes(e.createdDate))))}case Rr:{const{searchCreatedDate:r,total:n}=t.payload;return sn((e=>en({},e,{total:n})),r,e)}case Lr:return an.set(e,t.payload);case jr:return ln.set(e,t.payload);case Fr:{const{searchCreatedDate:r,isLoading:n}=t.payload;return sn((e=>en({},e,{isTotalLoading:n})),r,e)}case oe:return on.set(e,rn.filterWord)}return e},un="ENTITY_SET_LOADING",pn="ENTITY_LOAD_ENTITY_REQUEST",dn="ENTITY_SET_SELECTED_ENTITY_URI",mn="ENTITY_SET_ENTITY",fn={loading:!1,selectedEntityUri:null,entity:null},yn=(0,S.Ic)("loading"),gn=(0,S.Ic)("selectedEntityUri"),hn=(0,S.Ic)("entity"),En=(e=fn,t)=>{switch(t.type){case un:return yn.set(e,t.payload);case dn:return gn.set(e,t.payload);case mn:return hn.set(e,t.payload);case w.profile.constants.ProfileActions.ADD_NEXT_PAGE_ATTRIBUTE_VALUES:{const{parentUri:r,attributeTypeName:n,attributeTypeUri:a,values:i}=t.payload,o=(0,v.getAttributeSource)(a);if(e.entity&&r===e.entity.uri){const t=(0,O.lensPath)(["entity",o,n]);return(0,O.over)(t,(0,O.pipe)((0,O.defaultTo)([]),(0,O.concat)(O.__,i)),e)}return e}case w.search.constants.SEARCH_RESULTS_SET:if((0,v.isEmptyValue)(t.payload)){const t=hn.set(e,fn.entity);return gn.set(t,fn.selectedEntityUri)}return e}return e},bn="BULK_UPDATE_SET_ACTIVE_STEP",vn="BULK_UPDATE_INIT",Tn="BULK_UPDATE_TOGGLE_SELECTION_MODE",On="BULK_UPDATE_SELECT_ENTITY",Sn="BULK_UPDATE_SELECT_ALL_ENTITIES_ON_PAGE",xn="BULK_UPDATE_SET_LOADING",Cn="BULK_UPDATE_CHANGE_ROWS_PER_PAGE",wn="BULK_UPDATE_CHANGE_PAGE",An="BULK_UPDATE_CHANGE_SORT",Rn="BULK_UPDATE_CHANGE_COLUMNS",_n="BULK_UPDATE_UPDATE_ENTITIES",In="BULK_UPDATE_SET_FILTER_TEXT",Nn="BULK_UPDATE_SET_TOTAL",Pn="UPDATE_BULK_UPDATE_CURRENT_ENTITIES",Dn="BULK_UPDATE_SET_OPERATION",kn="BULK_UPDATE_SET_ACTION_ATTRIBUTE",Ln="BULK_UPDATE_SET_ACTION_OPERATION",Un="BULK_UPDATE_ADD_OPERATION_PARAMETERS",jn="BULK_UPDATE_DELETE_ACTION",Fn="BULK_UPDATE_TOGGLE_CONDITIONS",Mn="BULK_UPDATE_ADD_CONDITION_AFTER",Vn="BULK_UPDATE_CHANGE_CONDITION_DATA",Bn="BULK_UPDATE_TOGGLE_CONDITION_SELECT",zn="BULK_UPDATE_DELETE_CONDITION",Hn="BULK_UPDATE_SET_CONDITION_FILTER",Yn="BULK_UPDATE_SET_CONDITION_VALUES",Wn="BULK_UPDATE_TOGGLE_ACTION_PIN",Gn="BULK_UPDATE_TOGGLE_ACTION_ADD_NESTED",qn="BULK_UPDATE_CONFIRM",Zn="BULK_UPDATE_SET_REQUEST_PENDING";var $n=r(39705);function Kn(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Xn(e,t,r[t])}))}return e}function Xn(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Qn={objects:{selectionMode:B.v6.exclude,selectedEntities:[],entities:[],total:0,page:0,rowsPerPage:B.Tu[0],filterText:"",sortOrder:null,sortField:null,selectedColumns:[]},actions:[],operation:null,activeStep:0,loading:!1,requestPending:!1},Jn=(0,S.Ic)("activeStep"),ea=(0,S.Ic)("operation"),ta=(0,S.Ic)("loading"),ra=(0,S.Ic)("requestPending"),na=(0,S.ET)("objects","total"),aa=(0,S.ET)("objects","page"),ia=(0,S.ET)("objects","rowsPerPage"),oa=(0,S.ET)("objects","selectionMode"),la=(0,S.ET)("objects","entities"),sa=(0,S.ET)("objects","selectedEntities"),ca=(0,S.ET)("objects","filterText"),ua=e=>oa.get(e)===B.v6.include,pa=(0,S.ET)("objects","sortOrder"),da=(0,S.ET)("objects","sortField"),ma=(0,S.ET)("objects","selectedColumns"),fa=["actions"],ya=(0,S.ET)(...fa),ga=({groupId:e,state:t})=>{if(e){const r=ya.get(t).findIndex((t=>t.id===e));if(-1!==r)return[...fa,r,"actions"]}return fa},ha=(e,t)=>({id:(0,Me.x0)(),operation:e,operationParameters:t}),Ea=e=>((0,O.path)(["attributeTypeData","fieldName"],e)||"").split(".").slice(0,2).join("."),ba=(e,t)=>({id:(0,Me.x0)(),fieldName:Ea(t),actions:[ha(e,t)]}),va=({state:e,id:t,groupId:r,operation:n,operationParameters:a,togglePin:i,toggleAddNested:o})=>{const l=ga({state:e,groupId:r}),s=(0,S.ET)(...l).get(e),c=!r&&(0,O.prop)("attributeTypeData",a)&&(({attributeType:e,fieldName:t=""})=>(0,v.isComplexAttribute)(e)||t.split(".").length>2)(a.attributeTypeData);if(t){const r=s.findIndex((e=>e.id===t)),p=(0,S.ET)(...l,r),d=Kn({},p.get(e));if(n&&d.operation!==n){if(d.operationParameters){const e=[d.operation,n].includes($n.d.RepointReference)?[]:B.KJ[n];d.operationParameters=(0,O.omit)((0,O.without)(e,["attributeValue","attributeValueToFind"]),d.operationParameters)}d.operation=n}return a&&(d.operationParameters=(0,O.reject)(O.isNil,Kn({},d.operationParameters,a))),i&&(d.operationParameters=Kn({},d.operationParameters,{pin:!(0,O.path)(["operationParameters","pin"],d)})),o&&(d.operationParameters=Kn({},d.operationParameters,{addNestedAttribute:!(0,O.path)(["operationParameters","addNestedAttribute"],d)})),p.set(e,c?ba((u=d).operation,u.operationParameters):d)}{const t=(0,O.reject)(O.isNil,a),r=c?ba(n,t):ha(n,t);return(0,S.ET)(...l,s.length).set(e,r)}var u},Ta=ht(fa),Oa=Et(Ta,"conditions"),Sa=bt(Oa),xa=vt(Oa),Ca=Tt(xa),wa=Ot(xa),Aa=(e=Qn,t)=>{switch(t.type){case bn:return Jn.set(e,t.payload);case vn:return Kn({},Qn,{objects:Kn({},Qn.objects,t.payload)});case _n:return la.set(e,t.payload);case Tn:{const t=oa.set(e,ua(e)?B.v6.exclude:B.v6.include);return sa.set(t,[])}case On:{const{uri:r,checked:n}=t.payload,a=sa.get(e),i=ua(e);return sa.set(e,!!n==!!i?(0,O.uniq)(a.concat(r)):(0,O.without)(r,a))}case Sn:{const r=t.payload,n=ua(e),a=sa.get(e),i=la.get(e).map((0,O.prop)("uri"));return sa.set(e,!!r==!!n?(0,O.uniq)(a.concat(i)):(0,O.without)(i,a))}case xn:return ta.set(e,t.payload);case wn:return aa.set(e,t.payload);case Cn:{const r=aa.set(e,0);return ia.set(r,t.payload)}case An:{const{order:r,field:n}=t.payload,a=da.set(e,n);return pa.set(a,r)}case Rn:return ma.set(e,t.payload);case Nn:return na.set(e,t.payload);case In:{const{filterText:r}=t.payload;return ca.set(e,r)}case Dn:return ea.set(e,t.payload);case kn:{const{id:r,groupId:n,attribute:a}=t.payload;return va({state:e,id:r,groupId:n,operationParameters:{attributeTypeData:a,attributeValue:null,attributeValueToFind:null,pin:null,addNestedAttribute:null}})}case Ln:{const{id:r,groupId:n,operation:a}=t.payload;return va({state:e,id:r,groupId:n,operation:a})}case Un:{const{id:r,groupId:n,operationParameters:a}=t.payload;return va({state:e,id:r,groupId:n,operationParameters:a})}case Wn:{const{id:r,groupId:n}=t.payload;return va({state:e,id:r,groupId:n,togglePin:!0})}case Gn:{const{id:r,groupId:n}=t.payload;return va({state:e,id:r,groupId:n,toggleAddNested:!0})}case jn:{const{id:r,groupId:n}=t.payload,a=ga({state:e,groupId:n}),i=(0,S.ET)(...a),o=i.get(e);return i.set(e,o.filter((e=>e.id!==r)))}case Fn:{const r=t.payload,n=ya.get(e).findIndex((e=>e.id===r)),a=(0,S.ET)(...fa,n),i=a.get(e);return a.set(e,i.conditions?(0,O.omit)(["conditions"],i):(0,O.assoc)("conditions",[],i))}case Mn:{const{groupId:r,attributeId:n,attribute:a}=t.payload;return St({state:e,groupId:r,attributeId:n,attribute:a,getAttributesLens:Oa,getAttributeIndex:Sa})}case Vn:{const{groupId:r,attributeId:n,attributeData:a}=t.payload;return xt({state:e,groupId:r,attributeId:n,attributeData:a,setAttributeProp:Ca,getAttributeLens:xa})}case zn:{const{groupId:r,attributeId:n}=t.payload;return wt({state:e,groupId:r,attributeId:n,getAttributesLens:Oa})}case Hn:{const{groupId:r,attributeId:n,filter:a}=t.payload;return Rt({state:e,groupId:r,attributeId:n,filter:a,getAttributeProp:wa,setAttributeProp:Ca})}case Yn:{const{groupId:r,attributeId:n,values:a}=t.payload;return _t({state:e,groupId:r,attributeId:n,values:a,setAttributeProp:Ca})}case Zn:return ra.set(e,t.payload)}return e};var Ra=r(27422),_a=r(82349),Ia=r(12848),Na=r(33192),Pa=r.n(Na),Da=r(43717);const ka=(e,t,r)=>{const n=La(t);if(n.length){const i=ja(e,t,r),o=Ua(e,t,r),l=o.every((e=>(0,v.isTypeSearchGroupAttribute)({data:e})||i.some((0,O.eqProps)("fieldName",e)))),s=(0,v.areAllOperatorsAnd)(t),c=(0,v.areAllOperatorsAnd)(n),u=n.every((({filter:e,data:{attrType:t={}}})=>[v.FilterOptions.EQUALS,v.FilterOptions.IN_RANGE,v.FilterOptions.FULL_TEXT,v.FilterOptions.ON,v.FilterOptions.WITHIN].includes(e)||v.FilterOptions.EXISTS===e&&(0,v.isBooleanType)(t.type))),p=(a=n,!Object.values(a.reduce(((e,{data:{fieldName:t},filter:r,values:n})=>(r===v.FilterOptions.EQUALS&&(0,O.path)([0,"length"],n)&&(e[t]=e[t]&&e[t]+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},La=e=>e.flatMap((e=>e.attributes)).filter((0,O.has)("data")),Ua=(e,t,r)=>{const n=La(t).map((({data:{fieldName:e,entityTypeUri:t},filter:r,values:n})=>({entityTypeUri:t,fieldName:e,filter:r,values:n}))).reduce(((t,{entityTypeUri:n,fieldName:a,filter:i,values:o})=>{const{attrType:l}=n?(0,x.eC)(e,[n],[],r).find((e=>e.fieldName===a))||{}:(0,Da.zH)(a,r)||{},s=!(0,O.isNil)(l)&&l.faceted?((e,t,r,n)=>{if(![v.FilterOptions.EQUALS,v.FilterOptions.IN_RANGE].includes(t)&&![v.FilterOptions.ON,v.FilterOptions.WITHIN].includes(t)||!Array.isArray(e)||(0,v.isEmptyValue)(e[0]))return(0,v.isBooleanType)(n)&&t===v.FilterOptions.EXISTS?[!0,!1]:e&&!(0,v.isEmptyValue)(e[0])?[e[0]]:[];switch(r){case v.FACET_TYPES.NUMERIC_RANGE_FACET:return((e,t)=>{switch(t){case v.FilterOptions.EQUALS:return e.map((e=>[e,e]));case v.FilterOptions.IN_RANGE:return e.some(v.isEmptyValue)?[]:[e]}})(e[0],t);case v.FACET_TYPES.DATE_RANGE_FACET:return((e,t)=>{switch(t){case v.FilterOptions.ON:{const t=Pa()(e),r=!(0,v.isTimestampBasedType)(n);return[[v.utils.dates.getStartOfDay(t,r),v.utils.dates.getEndOfDay(t,r)]]}case v.FilterOptions.WITHIN:return(0,v.isDateRangeValue)(e)?[(0,v.getDateRangeByValue)(e)]:e.some(v.isEmptyValue)?[]:[e]}})(e[0],t);default:return e[0]}})(o,i,(0,v.getFacetTypeForAttrType)(l),l.type):o;return(0,O.isNil)(s)||(t[a]=(0,O.uniq)((t[a]||[]).concat(s))),t}),{}),a=Object.keys(n).map((e=>({fieldName:e,values:n[e]})));return a.some((({values:e})=>e&&Array.isArray(e[0])&&e.length>1))?[]:a},ja=(e,t,r)=>{const n=(0,lt.VO)(t);return(0,x.eC)(e,n,[],r)},Fa=(e,t)=>({type:_.Z.UPDATE_ENTITIES,payload:{searchResults:e,entityTypeUri:t}}),Ma=({silent:e})=>({type:_.Z.CLEAR_ALL,payload:{silent:e}}),Va=({entityTypeUri:e,keywordValue:t})=>({type:_.Z.SHOW_MORE_RESULTS_FOR_ENTITY_TYPE,payload:{entityTypeUri:e,keywordValue:t}}),Ba=e=>({type:_.Z.UPDATE_TOTAL,payload:e}),za=e=>({type:_.Z.CHANGE_LOADING,payload:e}),Ha=(e,t=null,r=!1)=>({type:_.Z.MAP_CHANGE_VALUE,payload:{value:e,searchType:t,silent:r}}),Ya=(e,t)=>({type:R.k.CREATE_FACETS,payload:{facetsConfigs:e,addToEnd:t}}),Wa=e=>({type:R.k.DESTROY_FACETS,payload:e}),Ga=(e,t,r=!1)=>({type:R.k.CHANGE_VALUES,payload:{facetFieldName:e,values:t,silent:r}}),qa=e=>({type:R.k.UPDATE_DATA,payload:e}),Za=e=>({type:R.k.UPDATE_FILTERED_DATA,payload:e}),$a=({facetsToAdd:e,fieldNamesToDelete:t,changedEntityTypes:r,addToEnd:n})=>({type:R.k.HANDLE_CONFIGS_CHANGES,payload:{facetsToAdd:e,fieldNamesToDelete:t,changedEntityTypes:r,addToEnd:n}});var Ka=r(5236),Xa=r(54145),Qa=r(55443),Ja=r(65751),ei=r.n(Ja);const ti=e=>{(0,Qa.U)(e,{title:ei().text("Server Error"),defaultMessage:ei().text("Something went wrong...")})};var ri=r(21430);const ni=(e,t,r)=>`${e}/recommend/${r}/${t}`,ai=e=>e&&1===e.length?e[0]:null,ii=e=>[e].filter((0,O.complement)(v.isComplexAttribute)).map((0,O.compose)(_a.$9,(0,O.prop)("uri"))).concat((e.children||[]).map(ii)).flat(1/0);function*oi(){const e=yield(0,Ra.RE)(Fl),t=yield(0,Ra.Ys)(A().selectors.getTenant),r=yield(0,Ra.Ys)(A().selectors.getEnvironment),n=((e,t,r,n,a)=>{const i=e.map((({fieldName:e,values:t})=>({fieldName:e,values:t.map((e=>Array.isArray(e)?JSON.stringify(e):e))}))),o={facets:(0,_a._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:ni(r,n,a),options:{method:"POST",body:JSON.stringify(o),headers:{"Content-Type":"application/json"}}}})(e,0,yield(0,Ra.Ys)(A().selectors.getServicesPath),t,r);let a;try{a=yield(0,Ra.RE)(v.rawRequest,n.url,n.options),a=a.filter((e=>"type"!==e)).slice(0,5)}catch(e){a=[]}const i=yield(0,Ra.Ys)(A().selectors.getMetadata),o=yield(0,Ra.Ys)(C.DX);a=((e,t=[],r)=>{const n=ai(r),a=n&&(0,v.getEntityType)(e,n),i=(0,ri.vf)(e,a||{}).map(ii).flat(1/0);return t.filter((e=>n||!e.startsWith("attributes."))).filter((e=>!e.startsWith("attributes.")||i.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=ai(n);if(t){const r=((0,v.getEntityType)(e,t).defaultFacetedAttributes||[]).map((r=>(0,v.findAttributeTypeByUri)(e,r,t))).filter((e=>e&&(0,v.isReadableAttribute)(e)&&!(0,v.isComplexAttribute)(e))).map((0,O.prop)("uri")).map(_a.$9).filter(a);i=i.concat(r)}if(i.length<o){const e=(0,x.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,Ra.gz)((s=a,{type:R.k.SET_RECOMMENDED_FACETS_LIST,payload:s}))}const li=e=>({type:ie,payload:e}),si=e=>({type:oe,payload:e}),ci=(e,t)=>({type:le,payload:{show:e,postSavingAction:t}}),ui=e=>({type:se,payload:e}),pi=(e,t,r)=>({type:me,payload:{entityTypeUri:e,columns:t,prevColumns:r}}),di=(e,t=!1)=>({type:fe,payload:{entityTypeUri:e,silent:t}}),mi=e=>({type:ye,payload:e}),fi=()=>({type:Ee}),yi=e=>({type:be,payload:e}),gi=e=>yi({payload:{message:e,action:null},type:B.GT.info}),hi=({message:e,actionLabel:t,actionToDispatch:r,autoHideDuration:n})=>yi({payload:{message:e,action:{actionLabel:t,actionToDispatch:r},autoHideDuration:n},type:B.GT.info}),Ei=e=>({type:Te,payload:e}),bi=e=>({type:ce,payload:e});var vi=r(90503),Ti=r(82877);const Oi=(e={},t="")=>Object.keys(e).filter((r=>v.utils.strings.search(r,t)||v.utils.strings.search(e[r].displayName,t))),Si=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)}},xi=(e,t)=>e===t,Ci=new class{constructor(){this.isLookupValueResolveTaskRunning=(0,O.curry)(((e,t)=>(0,O.hasPath)([e,t],this._lookupValuesResolveTasks))),this._lookupValuesResolveTasks=Object.create(null)}addTask(e,t){e.forEach((({type:e,codeValues:r})=>{!this._lookupValuesResolveTasks[e]&&(this._lookupValuesResolveTasks[e]={}),r.forEach((r=>{this._lookupValuesResolveTasks[e][r]=t}))}))}deleteTask(e){e.forEach((({type:e,codeValues:t})=>{this._lookupValuesResolveTasks[e]&&t.forEach((t=>{delete this._lookupValuesResolveTasks[e][t]})),(0,O.isEmpty)(this._lookupValuesResolveTasks[e])&&delete this._lookupValuesResolveTasks[e]}))}getRunningTasks(e){const t=e.flatMap((({type:e,codeValues:t})=>this._lookupValuesResolveTasks[e]?t.reduce(((t,r)=>{const n=this._lookupValuesResolveTasks[e][r];return n&&t.push(n),t}),[]):[]));return(0,O.uniqWith)(xi,t)}clearTasks(){this._lookupValuesResolveTasks=Object.create(null)}};function*wi(e){const t=Ci.getRunningTasks(e);t.length>0&&(yield(0,Ra.v_)(t))}function*Ai(e){try{const t=e.flatMap((({type:e,codeValues:t})=>t.map((t=>({type:e,codeValue:t}))))),r=yield(0,Ra.rM)(v.resolveLookupsList,t);Ci.addTask(e,r);const n=(yield(0,Ra.v_)(r)).reduce(((e,t)=>{const[r]=Object.keys(t),[n]=Object.keys(t[r]),a=(0,O.lensPath)([r,n]),i=(0,O.path)([r,n],t);return(0,O.set)(a,i,e)}),{});for(const e in n)yield(0,Ra.gz)(w.profile.lookups.actions.lookupsForTypeResolved({type:e,values:n[e]}))}catch(e){console.warn(e)}finally{Ci.deleteTask(e)}}function*Ri(e){if((0,O.isEmpty)(e))return;const t=e.map((({type:e,codeValues:t})=>{const r=Ci.isLookupValueResolveTaskRunning(e);return{type:e,codeValues:t.filter((0,O.complement)(r))}})).filter((({codeValues:e})=>e.length>0));t.length>0&&(yield(0,Ra.RE)(Ai,t)),yield(0,Ra.RE)(wi,e)}function*_i(e,t,r=B.cu,n=1){const a=!t&&1===n,i=`${e}${r}`,o=a&&Si.getRunningTask(i);if(o)yield(0,Ra.v_)(o);else try{const o=yield(0,Ra.rM)(v.getDependentLookups,{type:e,displayNamePrefix:t,max:r,offset:r*(n-1)});a&&Si.addTask(i,o);const l=yield(0,Ra.v_)(o);yield(0,Ra.gz)(w.profile.lookups.actions.lookupsForTypeResolved({type:e,values:l.codeValues[e]}))}catch(e){console.warn(e)}finally{a&&Si.deleteTask(i)}}const Ii=(e,t,r)=>e.slice((r-1)*t,t*r);function*Ni(e,t,r,n=1){const a=yield(0,Ra.Ys)(A().selectors.getLookups),i=Oi(a[e],t);if(i.length>=r*n)return Ii(i,r,n);yield(0,Ra.RE)(_i,e,t,r,n);const o=yield(0,Ra.Ys)(A().selectors.getLookups);return Ii(Oi(o[e],t),r,n)}const Pi=(e,t)=>Object.keys(e).filter((e=>(0,Ia.iL)(e,t))).reduce(((r,n)=>(r[(0,Ia.iL)(n,t).fieldName]=e[n],r)),{});function Di(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){ki(e,t,r[t])}))}return e}function ki(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*Li(e,t,r){if((0,O.isEmpty)(e))return;const n=yield(0,Ra.Ys)(A().selectors.getLookups),a=yield(0,Ra.Ys)(A().selectors.getMetadata),i=Pi(r,e),o=yield(0,Ra.Ys)(Ti.Xf);yield(0,Ra.gz)(t((0,Ia.HC)(a,i,e,n,{allowedEntityTypes:o})))}function*Ui(e,t,r){try{const n=yield(0,Ra.RE)(xl,e.url,e.options),[a,i]=(0,O.partition)(x._H,t);yield(0,Ra.rM)(Li,i,r,n),yield(0,Ra.RE)(zi,a,n),yield(0,Ra.RE)(Li,a,r,n)}catch(e){console.warn(e)}}function*ji(e,t,r){e=Di({},e,{includeFilter:[]});const n=yield(0,Ra.Ys)(A().selectors.getGlobalSearchRequestOptions),a=(0,_a.aw)([e],t,[e.fieldName],n);yield(0,Ra.RE)(Ui,a,[e],r)}const Fi=(e,t=[])=>t.filter((({label:t})=>v.utils.strings.search(t,e))),Mi=(e,t)=>Fi(t,e).map((0,O.prop)("value"));function*Vi(e,t,r,n){const a=Di({},e),i=[...t];if((0,x._H)(a)){const t=(0,v.getAttrTypeLookupCode)(e.attrType);a.includeFilter=yield(0,Ra.RE)(Ni,t,r,(0,O.propOr)(B.cu,"pageSize",a),a.pageNumber)}else if("sourceSystems"===a.fieldName){const{sources:e}=yield(0,Ra.Ys)(A().selectors.getMetadata);a.includeFilter=((e,t)=>Fi(t,e).map((({uri:e})=>(0,v.getLastUriPart)(e))))(e,r)}else if((0,x.S9)(a)){const t=yield(0,Ra.Ys)(A().selectors.getMetadata),n=(0,v.getEntityType)(t,a.entityTypeUri)||{},i=(0,O.pipe)((0,O.propOr)([],"displayedItems"),(0,O.filter)((0,O.propEq)("isRaw",!0)))(e);a.includeFilter=[...(o=n.matchGroups,l=r,Fi(l,o).map((0,O.prop)("uri"))),...Mi(i,r)]}else a.disableIncludeFilter=!0,i.push({values:[r],fieldName:e.fieldName,filter:"containsWordStartingWith",forceInclude:!0});var o,l;const s=yield(0,Ra.Ys)(A().selectors.getGlobalSearchRequestOptions),c=(0,_a.aw)([a],i,[e.fieldName],s);yield(0,Ra.RE)(Bi,c,e,a.includeFilter,n)}function*Bi(e,t,r,n){try{const a=yield(0,Ra.RE)(xl,e.url,e.options),i=yield(0,Ra.Ys)(A().selectors.getLookups),o=Pi(a,[t]);if(r){const e=t.fieldName;o[e]=(0,Ia.AX)(o[e],r)}const l=yield(0,Ra.Ys)(A().selectors.getMetadata),s=yield(0,Ra.Ys)(Ti.Xf);yield(0,Ra.gz)(n((0,Ia.HC)(l,o,[t],i,{allowedEntityTypes:s})))}catch(e){console.warn(e)}}function*zi(e,t){const r=yield(0,Ra.Ys)(A().selectors.getLookups),n=(0,Ia.U4)(e,r),a=((e,t,r)=>{const n=((e,t)=>(0,O.pipe)(Object.entries,(0,O.reduce)(((e,[r,n])=>{const a=t.find((0,O.propEq)("fieldName",r));if(!a)return e;const{attrType:i}=a,o=(0,v.getAttrTypeLookupCode)(i);return e[o]={type:o,codeValues:(0,O.uniq)([...(0,O.pathOr)([],[o,"codeValues"],e),...Object.keys(n)])},e}),{}),O.values)(e))(e,t);return(0,v.getUnresolvedLookupsList)(r,n)})(t,e,r),i=(0,v.mergeLookupsLists)(n,a);i.length&&(yield(0,Ra.RE)(Ri,i))}var Hi=r(59295);function Yi(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Wi(e,t,r[t])}))}return e}function Wi(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*Gi(){const e=yield(0,Ra.Ys)(A().selectors.getMetadata),t=yield(0,Ra.Ys)(Ti.Xf),r=yield(0,Ra.Ys)(Ti.sl);return(0,vi.wM)(e,t,r)}const qi=e=>({value:t})=>!e.length||e.includes(t);function*Zi(e){e=e||(yield(0,Ra.Ys)(Xa.FR));const t=yield(0,Ra.Ys)(Ti.XM);if((0,vi.gj)(t)){const t=yield(0,Ra.Ys)(A().selectors.getMetadata),r=yield(0,Ra.Ys)(Hi.V6),n=(0,x.$t)(t),a=yield(0,Ra.Ys)(A().selectors.getGlobalSearchRequestOptions),i=(0,_a.aw)([n],e,[n.fieldName],a),o=({type:e=[]})=>{const t=e.filter(qi(r));return mi(t)};yield(0,Ra.RE)(Ui,i,[n],o)}else yield(0,Ra.gz)(mi([]))}function*$i(){const e=yield(0,Ra.Ys)(A().selectors.getMetadata),t=yield(0,Ra.Ys)(Ti.Xf),r=yield(0,Ra.Ys)(Hi.V6);return(0,Ia.wW)(e,{},t).filter(qi(r))}function*Ki(){const e=yield(0,Ra.Ys)(A().selectors.getMetadata),t=yield(0,Ra.RE)(Gi),r=yield(0,Ra.Ys)(Ti.uJ),n=(0,vi.oX)().map((0,O.prop)("id")),a=(0,O.pipe)((0,O.map)((0,O.filter)((0,O.pipe)((0,O.prop)("id"),(0,O.cond)([[(0,O.includes)("."),O.T],[(0,O.includes)(O.__,n),O.T],[O.T,O.F]])))),O.toPairs,(0,O.map)((([t,r])=>[t,(0,vi.Wh)(e,t,(0,O.map)((0,O.prop)("id"),r)).map(((e,t)=>{const n=r.find((0,O.propEq)("id",e.id)),{size:a,autoResize:i=0!==t&&!a}=n||{};return(0,O.reject)(O.isNil,Yi({},e,{size:a,autoResize:i}))}))])),O.fromPairs)(r),i=!(0,O.equals)(r,a),o=Object.keys(t),l=Object.keys(a);var s;!i&&(0,O.equals)(new Set(o),new Set(l))||(yield(0,Ra.gz)((s=Yi({},t,(0,O.pick)(o,a)),{type:de,payload:s})))}function*Xi(){const e=yield(0,Ra.Ys)(A().selectors.getMetadata),t=yield(0,Ra.Ys)(C.DX),r=(yield(0,Ra.Ys)(Ti.IJ))?yield(0,Ra.RE)($i):yield(0,Ra.RE)($l),n=(0,vi.nx)(e,r,t).map((0,O.prop)("value")),a=yield(0,Ra.Ys)(Ti.o4);n.includes(a)||(yield(0,Ra.gz)(di(n[0],!0)))}function*Qi(e={}){const{silent:t}=e.payload||{};if(!t){const e=yield(0,Ra.Ys)(Ti.tB),t=yield(0,Ra.Ys)(Xa.t9);if((0,v.isAvailableEntityTypeForDataTenant)(t,e)){const t=yield(0,Ra.Ys)(Xa.BP,{entityTypeUri:e});(0,O.isNil)(t)&&(yield(0,Ra.gz)({type:_.Z.REFRESH_DISPLAYED_ENTITIES}))}else yield(0,Ra.gz)(Fa([],e))}}function*Ji(e){const t=e.payload;yield(0,Ra.RE)(Qi,e);const r=yield(0,Ra.Ys)(Ti.gu);if((0,vi.gj)(t)&&0===r.length){const e=yield(0,Ra.RE)($i);yield(0,Ra.gz)(mi(e)),yield(0,Ra.RE)(Zi)}}function*eo(){const e=yield(0,Ra.Ys)(Ti.qx),t=yield(0,Ra.Ys)(Xa.Qy);e!==B.om.MAP&&t.length&&(yield(0,Ra.gz)(Ha(null)))}function*to(e){const t=(0,v.removeDtssPrefixFromEntityUri)(e.payload.uri),r=yield(0,Ra.Ys)(Ti.tB),n=((yield(0,Ra.Ys)(Xa.BP,{entityTypeUri:r}))||[]).map((0,O.prop)("uri")),a=(yield(0,Ra.Ys)(Xa.fx,{entityTypeUri:r}))||0,i=(yield(0,Ra.Ys)(Xa.Uz,{entityTypeUri:r}))||B.Tu[0],o=n.indexOf(t)+a*i,l=yield(0,Ra.Ys)(Xa.NU,{entityTypeUri:r}),s=yield(0,Ra.Ys)(A().selectors.getTenant),c=yield(0,Ra.Ys)(Xa.lF);yield(0,Ra.gz)(w.search.actions.setSearchNavigationData({uri:t,index:o,total:l,tenant:c||s,cache:n}))}const ro=[function*(){yield(0,Ra.Fm)(fe,Qi)},function*(){yield(0,Ra.Fm)(ve,Ji)},function*(){yield(0,Ra.Fm)([Ve,Be,He],Xi)},function*(){yield(0,Ra.Fm)(Te,eo)},function*(){yield(0,Ra.Fm)(w.ui.constants.UIActions.OPEN_ENTITY,to)}],no=e=>({type:$t,payload:e}),ao=e=>({type:Kt,payload:e}),io=()=>({type:lr}),oo=e=>({type:Er,payload:e}),lo=e=>({type:br,payload:e}),so=(e,t)=>({type:Or,payload:{uri:e,isLoading:t}});var co=r(90533),uo=r(86374),po=r(4898);function mo(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){fo(e,t,r[t])}))}return e}function fo(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*yo(){yield(0,Ra.gz)(lo(!0));try{const t=yield(0,Ra.Ys)(A().selectors.getUserName),r=e=>mo({},e,{isOwnSearch:t===e.owner}),n=yield(0,Ra.RE)(go),{result:a=[],total:i}=yield(0,Ra.RE)(v.getSavedSearches,n);yield(0,Ra.gz)((e=>({type:Jt,payload:e}))(i));const o=yield(0,Ra.Ys)(A().selectors.getMetadata),l=yield(0,Ra.Ys)(A().selectors.getDataTenants),s=yield(0,Ra.Ys)(A().selectors.getCanUserReadWorkflowDataTask);yield(0,Ra.gz)((e=a.map(r).map((0,uo.z7)(o,l,s)),{type:er,payload:e})),yield(0,Ra.gz)(lo(!1)),yield(0,Ra.RE)(bo,a)}catch(e){yield(0,Ra.gz)(lo(!1))}var e}function*go(){const e=yield(0,Ra.Ys)(co.s6),t=yield(0,Ra.Ys)(co.wH),r=yield(0,Ra.Ys)(co.U3),n=yield(0,Ra.Ys)(co.VS),a=yield(0,Ra.Ys)(co.kU),{field:i,order:o}=yield(0,Ra.Ys)(co.rT);return{offset:e*t,max:e,containsWordStartingWith:r,favoriteOnly:n,findPublic:a,countResults:!1,sortBy:B.PW[i],sortOrder:o}}function*ho(e){const t=yield(0,Ra.Ys)(co.EH,e.payload);yield(0,Ra.RE)(Eo,t)}function*Eo(e,t){yield(0,Ra.gz)(so(e.uri,!0));try{const{total:r}=yield(0,Ra.RE)(v.getTotalsForQuery,(0,v.replacePlaceholdersInQuery)(e.query),Boolean(t));yield(0,Ra.gz)(((e,t)=>({type:tr,payload:{uri:e,total:t}}))(e.uri,r))}catch(e){ti(e)}yield(0,Ra.gz)(so(e.uri,!1))}function*bo(e){const t=yield(0,Ra.Ys)(A().selectors.getQueryEstimatorEnabled);return yield(0,Ra.$6)(e.map((e=>(0,Ra.RE)(Eo,e,t))))}function*vo(e){const{uri:t,isPublic:r}=e.payload,n=yield(0,Ra.Ys)(co.EH,t);if(n){yield(0,Ra.gz)(lo(!0));try{yield(0,Ra.RE)(v.markSavedSearchAsPublic,(0,uo.Tp)(n),r),yield(0,Ra.gz)(((e,t)=>({type:cr,payload:{uri:e,isPublic:t}}))(t,r))}catch(e){ti(e)}yield(0,Ra.gz)(lo(!1))}}function*To(e){const{uri:t,isFavorite:r}=e.payload,n=yield(0,Ra.Ys)(co.EH,t);if(n){yield(0,Ra.gz)(lo(!0));try{yield(0,Ra.RE)(v.markSavedSearchAsFavorite,(0,uo.Tp)(n),r),yield(0,Ra.gz)(((e,t)=>({type:pr,payload:{uri:e,isFavorite:t}}))(t,r))}catch(e){ti(e)}yield(0,Ra.gz)(lo(!1))}}function*Oo(e){const{uri:t,isGlobalFilter:r}=e.payload,n=yield(0,Ra.Ys)(co.EH,t);if(n){const e=(0,uo.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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["uiState"]);(0,v.isObject)("2.0"===t.version?t:t.state)||!r?yield(0,Ra.gz)(((e,t)=>({type:"SAVED_SEARCHES_MARK_GLOBAL_FILTER",payload:{savedSearch:e,isGlobalFilter:t}}))(mo({},a,{uiState:t,query:(0,v.replacePlaceholdersInQuery)((0,O.propOr)("","query",a))}),r)):(0,Qa.U)({errorMessage:"Saved Search is incorrect"},{title:ei().text("Saved Search can't be mark as global")})}}function*So(e){const{uri:t,name:r}=e.payload,n=yield(0,Ra.Ys)(co.EH,t);if(n&&r!==n.name){yield(0,Ra.gz)(lo(!0));try{yield(0,Ra.RE)(v.updateSavedSearch,mo({},(0,uo.Tp)(n),{name:r})),yield(0,Ra.gz)(((e,t)=>({type:fr,payload:{uri:e,name:t}}))(t,r))}catch(e){ti(e)}yield(0,Ra.gz)(lo(!1))}}function*xo(){const e=yield(0,Ra.Ys)(co.Kh);yield(0,Ra.gz)(lo(!0));try{yield(0,Ra.$6)(e.map((e=>(0,Ra.RE)(v.deleteSavedSearch,e)))),yield(0,Ra.gz)(oo(e.map((0,O.prop)("uri"))))}catch(e){ti(e)}yield(0,Ra.gz)(lo(!1))}function*Co(e){const t=e.payload;yield(0,Ra.gz)(lo(!0));try{yield(0,Ra.RE)(v.deleteSavedSearch,{uri:t}),yield(0,Ra.gz)(oo([t]))}catch(e){ti(e)}yield(0,Ra.gz)(lo(!1))}function*wo(e=!1,t=!1){return{query:yield(0,Ra.Ys)(co.Cc,e),uiState:yield(0,Ra.Ys)(po.Z,t)}}function*Ao({payload:{name:e,share:t}}){const{query:r,uiState:n}=yield(0,Ra.RE)(wo,!0),a={isFavorite:!1,isPublic:t===B.ib.public,name:e,query:r,uiState:n},i=yield(0,Ra.Ys)(co.tp);yield(0,Ra.gz)(ci(!1));try{yield(0,Ra.gz)(gi(ei().text("Saving search...")));const e=yield(0,Ra.RE)(v.createSavedSearch,[a]);e[0].successful?(yield(0,Ra.gz)(no(e[0].object)),yield(0,Ra.gz)(ao(!1)),yield(0,Ra.gz)(gi(ei().text("Search saved successfully"))),i&&(yield(0,Ra.gz)(i))):ti(e)}catch(e){ti(e)}}function*Ro(e){const{uri:t,debounceTime:r}=e.payload;yield(0,Ra.gz)(si(!1));const n=yield(0,Ra.Ys)(co.EH,t),a=(0,co.In)(n)||{},{errors:i}=a;i&&i.length?((e=[])=>{(0,Qa.U)(e,{message:ei().text("Saved Search can't be applied")})})(i):(yield(0,Ra.gz)(no(n)),(yield(0,Ra.Ys)(Xa.lF))&&(a.currentTenant=yield(0,Ra.Ys)(A().selectors.getTenant)),yield(0,Ra.gz)(w.search.actions.updateState(mo({},a,{debounceTime:r}))),yield(0,Ra.qn)(_.Z.STATE_UPDATED))}const _o=[function*(){yield(0,Ra.Fm)([Qt,rr,nr,vr,ar,xr],yo)},function*(){const e={[sr]:vo,[ur]:To,[hr]:Co,[gr]:xo,[mr]:So,[dr]:Oo},t=yield(0,Ra.ZO)(Object.keys(e));for(;;){const r=yield(0,Ra.qn)(t);yield(0,Ra.RE)(e[r.type],r)}},function*(){yield(0,Ra.Fm)([Zt],Ao)},function*(){yield(0,Ra.Fm)([Tr],Ro)},function*(){yield(0,Ra.ib)([Sr],ho)}];function*Io(e){try{yield(0,Ra.RE)(v.createActivity,{label:v.ACTIVITY_TYPES.userSearch,description:JSON.stringify({activity:e,version:"2.0"})})}catch(e){console.warn(e)}}const No=e=>({type:Be,payload:{groupId:e}}),Po=(e,t)=>({type:Ge,payload:{groupId:e,attributeId:t,attribute:mt()}}),Do=(e,t,r)=>({type:Ge,payload:{groupId:e,attributeId:t,attribute:ft(r)}}),ko=(e,t,r)=>({type:qe,payload:{groupId:e,attributeId:t,attributeData:yt(r)}}),Lo=(e,t)=>({type:qe,payload:{groupId:e,attributeId:t,attributeData:null}}),Uo=(e,t,r)=>({type:Ze,payload:{groupId:e,attributeId:t,selectInfo:r}}),jo=(e,t,r)=>({type:$e,payload:{groupId:e,attributeId:t,operator:r}}),Fo=(e,t)=>({type:Ke,payload:{groupId:e,attributeId:t}}),Mo=(e,t)=>({type:Xe,payload:{groupId:e,attributeId:t}}),Vo=(e,t)=>({type:Qe,payload:{groupId:e,attributeId:t,id:(0,Me.x0)()}}),Bo=(e,t,r)=>({type:Je,payload:{groupId:e,attributeId:t,filter:r}}),zo=(e,t,r)=>({type:et,payload:{groupId:e,attributeId:t,values:r}}),Ho=(e,{attribute:t,value:r,debounceTime:n=0,pageNumber:a=1,currentOptions:i})=>({type:rt,payload:{groupId:e,attribute:t,value:r,debounceTime:n,pageNumber:a,currentOptions:i}}),Yo=(e,t,r)=>({type:nt,payload:{groupId:e,attributeId:t,values:r}}),Wo=(e,t)=>({type:at,payload:{groupId:e,attribute:t}});var Go=r(44006);function*qo({groups:e,findGroupPath:t=gt,attributesPropName:r,groupId:n,attributeId:a,selectInfo:i,actions:o}){const{checked:l,attribute:s,index:c,selectedAttributes:u}=i,{addAttributeAfter:p,changeAttribute:d,clearAttribute:m,deleteAttribute:f}=o,y=(0,O.pipe)(t(n),(0,O.path)(O.__,e),(0,O.propOr)([],r))(e),g=e=>(0,O.path)([e,"id"],y),h=y.findIndex((0,O.propEq)("id",a));if(a&&0===c)if(l)yield(0,Ra.gz)(d(n,a,s));else{let e=u[c+1];e?(yield(0,Ra.gz)(d(n,a,e)),yield(0,Ra.gz)(f(n,g(h+1)))):yield(0,Ra.gz)(m(n,a))}else{const e=u.length-c,t=a?h+c:y.length-e;l?yield(0,Ra.gz)(p(n,g(t-1),s)):yield(0,Ra.gz)(f(n,g(t)))}}function Zo(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){$o(e,t,r[t])}))}return e}function $o(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*Ko(e){const{groupId:t,attributeId:r,selectInfo:n}=e.payload,a=yield(0,Ra.Ys)(Hi.go),i={addAttributeAfter:Do,changeAttribute:ko,clearAttribute:Lo,deleteAttribute:Fo};yield(0,Ra.RE)(qo,{groups:a,attributesPropName:"attributes",groupId:t,attributeId:r,selectInfo:n,actions:i}),yield(0,Ra.gz)(No(t))}function*Xo(e){const{attribute:t,groupId:r}=e.payload,n=yield(0,Ra.Ys)(Hi._7,r),a=yield(0,Ra.Ys)(A().selectors.getGlobalSearchRequestOptions),{data:{fieldName:i},values:o}=t,l=yield(0,Ra.Ys)(Xa.L7,n,i),s=Zo({},t.data,{values:o?(0,O.flatten)(o):void 0,pageSize:t.data.pageSize+1}),c=(0,_a.aw)([s],l,[],a);yield(0,Ra.RE)(Ui,c,[s],(e=>((e,t,r)=>({type:tt,payload:{groupId:e,attributeId:t,values:r}}))(r,t.id,e[i])))}function*Qo(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,Ra.gz)(Yo(i,t.id,void 0));else{a&&(yield(0,Ra.gw)(a));const e=yield(0,Ra.Ys)(Hi.ad,i,t.id),c=e=>Yo(i,t.id,o.concat(e[s]));if(r){const a=l?[{values:[l],fieldName:"type",filter:"equals"}]:[],i=yield(0,Ra.Ys)(Xa.L7,a,s);yield(0,Ra.rM)(Vi,Zo({},t.data,{displayedItems:e,pageNumber:n,pageSize:t.data.pageSize+1}),i,r,c)}else{const r=yield(0,Ra.Ys)(Hi._7,i),a=yield(0,Ra.Ys)(Xa.L7,r,s);yield(0,Ra.rM)(ji,Zo({},t.data,{displayedItems:e,pageNumber:n,pageSize:t.data.pageSize+1}),a,c)}}}function*Jo(){const e=yield(0,Ra.Ys)(A().selectors.getSearchKeyword),t=yield(0,Ra.Ys)(Xa.vH),r=yield(0,Ra.RE)(Fl),n=yield(0,Ra.Ys)(A().selectors.getMetadata),a=yield(0,Ra.Ys)(A().selectors.getDataTenants),i=(0,Go.h)(n,a,r);yield(0,Ra.gz)(w.search.actions.updateState({advanced:i,keyword:e,map:t}))}function*el(e){const{groupId:t,attributeId:r}=e.payload;yield(0,Ra.gz)(Fo(t,r)),yield(0,Ra.gz)(No(t))}function*tl(){if(yield(0,Ra.Ys)(Ti.IJ)){const e=yield(0,Ra.Ys)(Hi.go),t=yield(0,Ra.Ys)(Ti.Xf);for(const r of e){const e=r.entityTypes||[];if((t?e.filter((e=>t.includes(e))):e).length!==e.length){yield(0,Ra.gz)(Ma({silent:!0}));break}}}}const rl=[function*(){yield(0,Ra.ib)([Ze],Ko)},function*(){yield(0,Ra.Fm)([rt],Qo)},function*(){yield(0,Ra.ib)(ot,Jo)},function*(){yield(0,Ra.ib)(at,Xo)},function*(){yield(0,Ra.ib)([Xe],el)}];function nl(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){al(e,t,r[t])}))}return e}function al(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*il(){const e=yield(0,Ra.Ys)(Xa.FR);yield(0,Ra.RE)(ll);const t=yield(0,Ra.Ys)(Ti.tB);var r;yield(0,Ra.gz)((r=t,{type:_.Z.RESET_PAGE,payload:{entityTypeUri:r}})),yield(0,Ra.rM)(Ml,e),yield(0,Ra.rM)(fl,e),(yield(0,Ra.Ys)(Ti.IJ))?yield(0,Ra.rM)(Zi,e):yield(0,Ra.rM)(oi)}function*ol(e){const{debounceTime:t}=e.payload||{};t&&(yield(0,Ra.gw)(t));const r=yield(0,Ra.Ys)(Xa.FR);yield(0,Ra.rM)(sl,r)}function*ll(){const e=yield(0,Ra.Ys)(Ti.tB);var t;yield(0,Ra.gz)((t=e,{type:_.Z.CLEAR_RESULTS,payload:t}))}function*sl(e){const t=yield(0,Ra.Ys)(A().selectors.getMetadata),r=yield(0,Ra.Ys)(Ti.tB),n=yield(0,Ra.Ys)(Xa.fx,{entityTypeUri:r}),a=yield(0,Ra.Ys)(Xa.Uz,{entityTypeUri:r}),i=yield(0,Ra.Ys)(Xa.L9,{entityTypeUri:r}),o=yield(0,Ra.Ys)(Xa.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,Ra.RE)(ml,r);c=(0,O.uniq)(c.concat(a).concat((0,_a.kx)(t,s,[_a.cI]))),l=!0}else c=(0,O.uniq)(c.concat((0,_a.kx)(t,s,[_a.Bo,_a.cI]))),l=!1;const u=nl({page:n,rowsPerPage:a,sortOrder:i,sortField:o,forceOvOnly:l},yield(0,Ra.Ys)(A().selectors.getGlobalSearchRequestOptions),{select:c}),p=(0,_a.XP)(s,u),d=yield(0,Ra.Ys)(Xa.lF);yield(0,Ra.gz)(za(!0));try{let e;if(d){const t=(0,_a.kH)(s,u);e=yield(0,Ra.RE)(xl,t)}else{const t=(0,_a.Lv)(s,u);e=yield(0,Ra.RE)(xl,B.NV,t)}Array.isArray(e)||(e=[]),yield(0,Ra.RE)(cl,(0,O.reject)(O.isNil,{query:p,sortField:o,sortOrder:i,dataTenant:d})),e=yield(0,Ra.RE)(Sl,e),yield(0,Ra.gz)(Fa(e,r))}catch(e){yield(0,Ra.gz)(Fa([],r))}yield(0,Ra.gz)(za(!1))}function*cl(e){var t;yield(0,Ra.gz)((t=e.query,{type:_.Z.UPDATE_URL,payload:t}));const r=yield(0,Ra.Ys)(A().selectors.getSearchProviderData);(0,O.equals)(null==r?void 0:r.data,e)||(yield(0,Ra.gz)(w.search.actions.setSearchNavigationData(null))),yield(0,Ra.gz)(w.search.actions.setSearchProviderData({type:"search",data:e}))}function*ul(e){const{columns:t,prevColumns:r}=e.payload;if((0,vi.tU)(t,r)){const e=yield(0,Ra.Ys)(Ti.o4),t=(yield(0,Ra.Ys)(Xa.BP,{entityTypeUri:e})).map((e=>e.uri)),r=yield(0,Ra.RE)(ml,e),n=yield(0,Ra.Ys)(Xa.FR),a=yield(0,Ra.Ys)(A().selectors.getGlobalSearchRequestOptions),i=(0,_a.aG)(t,n,nl({select:r},a));yield(0,Ra.gz)(za(!0));try{let t=yield(0,Ra.RE)(xl,i.url,i.options);t=yield(0,Ra.RE)(Sl,t),yield(0,Ra.gz)(Fa(t,e))}catch(t){yield(0,Ra.gz)(Fa([],e)),ti(t)}yield(0,Ra.gz)(za(!1))}}function*pl(){const e=yield(0,Ra.Ys)(Ti.tB),t=yield(0,Ra.Ys)(Xa.BP,{entityTypeUri:e});t&&(yield(0,Ra.gz)(w.search.actions.searchResultsSet(t)))}function*dl(e){const{entityTypeUri:t,keywordValue:r}=e.payload;yield(0,Ra.gz)(((e=!1)=>({type:R.k.CLEAR_ALL_VALUES,payload:{silent:e}}))(!0)),yield(0,Ra.gz)(Ga("type",[t],!0)),yield(0,Ra.gz)(w.search.actions.keywordUpdated({value:r,isRawFilter:!1}))}function*ml(e){const t=yield(0,Ra.Ys)(Ti.Gv,e);return(0,vi.vw)(t)}function*fl(e){const t=yield(0,Ra.Ys)(A().selectors.getGlobalSearchRequestOptions),r=(0,_a.Vg)(e,[],t);try{const e=yield(0,Ra.RE)(xl,B.jS,{method:"POST",body:JSON.stringify(r)});yield(0,Ra.gz)(Ba(e.total))}catch(e){yield(0,Ra.gz)(Ba(0))}}function*yl(){yield(0,Ra.RE)(hl);const e=yield(0,Ra.RE)(wo,!0);(0,O.isEmpty)(e.query)||(yield(0,Ra.RE)(Io,e))}const gl=[tt];function*hl(){for(;yield(0,Ra.Ys)(Hi.UM);)yield(0,Ra.qn)(gl)}function*El(e){const{debounceTime:t}=e.payload||{};t&&(yield(0,Ra.gw)(t)),(0,Ia.$L)(e)&&(yield(0,Ra.RE)(Wl)),(0,O.pathOr)(!1,["payload","silent"],e)||(yield(0,Ra.RE)(il),yield(0,Ra.RE)(yl))}function*bl(e){const t=(0,O.path)(["payload","searchOptions"],e),r=(0,O.path)(["payload","errors"],e),n=(0,O.pathOr)(0,["payload","debounceTime"],e);r&&r.length&&((e=[])=>{(0,Qa.U)(e,{message:ei().text("Can't apply search state")})})(r),!((yield(0,Ra.Ys)(A().selectors.getShowSearchByOv))??(yield(0,Ra.Ys)(Ti.cC)))&&t&&t.searchByOv&&(yield(0,Ra.gz)(w.search.actions.updateSearchOptions({searchByOv:!1,ovOnly:!1}))),yield(0,Ra.RE)(Zl),yield(0,Ra.RE)(tl),yield(0,Ra.RE)(Ki),yield(0,Ra.RE)(Xi),yield(0,Ra.RE)(vl),yield(0,Ra.gz)(((e=0)=>({type:_.Z.STATE_UPDATED,payload:{debounceTime:e}}))(n))}function*vl(){const e=yield(0,Ra.Ys)(Ti.d7),t=yield(0,Ra.Ys)(Xa.Qy);!e&&t.length&&(yield(0,Ra.gz)(Ha(null,null,!0)))}function*Tl(){const e=yield(0,Ra.Ys)(Xa.A7),{activityFilter:t,globalFilter:r}=yield(0,Ra.Ys)(A().selectors.getGlobalSearchRequestOptions),n=yield(0,Ra.Ys)(A().selectors.getSearchOptions),a=n&&n.searchByOv,i=[(0,_a.s4)(e,[],{globalFilter:r})];a&&i.push("options=searchByOv"),t&&i.push(`activeness=${t}`);const o=i.filter(O.identity).join("&"),l=new URLSearchParams(o);if(yield(0,Ra.Ys)(A().selectors.getSharedPreferencesEnabled)){const e=yield(0,Ra.Ys)(A().selectors.getServicesPath),t=yield(0,Ra.Ys)(A().selectors.getTenant),r=yield(0,Ra.Ys)(A().selectors.getEnvironment),n=yield(0,Ra.Ys)(A().selectors.getUserName),a=yield(0,Ra.Ys)(Ti.XM),i=yield(0,Ra.Ys)(Ti.uJ),o=(0,O.pipe)((0,O.map)((0,O.pipe)((0,O.map)((0,O.path)(["attrType","uri"])),(0,O.reject)(v.isEmptyValue))),(0,O.reject)(O.isEmpty)),s="searchExportData",c={name:s,tenant:t,environment:r,user:n,servicesPath:e,value:{searchResultsColumnsUris:(0,vi.gj)(a)?o(i):void 0}};try{yield(0,Ra.RE)(v.setSharedPreferences,c),l.set("sharedPreferenceName",s)}catch(e){ti(e)}}yield(0,Ra.gz)(w.ui.actions.openConsoleApp("Export","entities",l.toString()))}function*Ol(){yield(0,Ra.gz)(w.ui.actions.openConsoleApp("Data Loader","projects"))}function*Sl(e){const t=yield(0,Ra.Ys)(Xa.lF);return e&&t?e.map((0,v.enrichEntityWithDataTenant)(t)):e}function*xl(e,t){const r=yield(0,Ra.Ys)(A().selectors.getTenant),n=yield(0,Ra.Ys)(Xa.lF),a=yield(0,Ra.Ys)(A().selectors.getDtssPath);return yield(0,Ra.RE)(_a.Es,{url:e,options:t,customerTenant:r,dataTenant:n,dtssPath:a})}const Cl=[R.k.CHANGE_VALUES,w.search.constants.KEYWORD_UPDATED,_.Z.REFRESH,R.k.CLEAR_ALL_VALUES,_.Z.MAP_CHANGE_VALUE,_.Z.CLEAR_ALL,_.Z.STATE_UPDATED,it,w.search.constants.SEARCH_OPTIONS_UPDATED,w.search.constants.ACTIVITY_FILTER_UPDATED,w.search.constants.GLOBAL_FILTER_UPDATED,_.Z.CHANGE_CURRENT_TENANT],wl=[function*(){yield(0,Ra.Fm)(Cl,El)},function*(){yield(0,Ra.Fm)([_.Z.CHANGE_PAGE,_.Z.RESET_PAGE,_.Z.CHANGE_ROWS_PER_PAGE,_.Z.REFRESH_DISPLAYED_ENTITIES,_.Z.CHANGE_SORT],ol)},function*(){yield(0,Ra.Fm)(me,ul)},function*(){yield(0,Ra.Fm)([_.Z.UPDATE_ENTITIES,fe,ve],pl)},function*(){yield(0,Ra.Fm)(_.Z.SHOW_MORE_RESULTS_FOR_ENTITY_TYPE,dl)},function*(){yield(0,Ra.Fm)(w.search.constants.UPDATE_STATE,bl)},function*(){yield(0,Ra.Fm)(_.Z.EXPORT_RESULTS,Tl)},function*(){yield(0,Ra.Fm)(_.Z.OPEN_DATA_LOADER,Ol)}];var Al=r(56906);function Rl(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*_l(e,t){try{const[r,n]=yield(0,Ra.RE)(Il,e,[]);if((0,O.isNil)(r)||(0,O.isNil)(n))yield(0,Ra.gz)(qa({[e.fieldName]:[]}));else{const[a,i]=(0,Ia.dG)(e.type),o=(0,Ia.q7)(a,r),l=(0,Ia.q7)(i,n),s=(0,Ka.Oz)(e.attrType&&e.attrType.type),[c,u]=s.greaterThan(o,l)?[l,o]:[o,l],p=yield(0,Ra.RE)(Nl,e,c,u,t),d={[e.fieldName]:p};yield(0,Ra.gz)(qa(d))}}catch(e){console.warn(e)}}function*Il(e,t){const r=yield(0,Ra.Ys)(A().selectors.getGlobalSearchRequestOptions),n=(0,_a.rN)(e,t,[e.fieldName],r),a=yield(0,Ra.RE)(xl,n.url,n.options),i=Pi(a,[e]),{min:o,max:l,count:s}=(0,Ia.Kn)(i,[e])[e.fieldName];return s?[(0,x.bB)(e)?0:o,l]:[]}function*Nl(e,t,r,n){const a=e.attrType&&e.attrType.type,i=(0,Al.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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Rl(e,t,r[t])}))}return e}({interval:o,offset:t},yield(0,Ra.Ys)(A().selectors.getGlobalSearchRequestOptions)),s=(0,_a.ti)(e,n,[e.fieldName],l),c=yield(0,Ra.RE)(xl,s.url,s.options),u=yield(0,Ra.Ys)(A().selectors.getMetadata),p=Pi(c,[e]),d=(0,Ia.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 Pl(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Dl={matches:_a.dW,"dtPotentialMatches.matches":_a.dW,"potentialMatches.matchScore":_a._9};function*kl(e,t){try{const[r,n]=yield(0,Ra.RE)(Il,e,[]);if((0,O.isNil)(r)||(0,O.isNil)(n))yield(0,Ra.gz)(qa({[e.fieldName]:[]}));else{const[a,i]=(0,Ia.dG)(e.type),o=(0,Ia.q7)(a,r),l=(0,Ia.q7)(i,n),s=yield(0,Ra.RE)(Ll,e,o,l,t),c={[e.fieldName]:s};yield(0,Ra.gz)(qa(c))}}catch(e){console.warn(e)}}function*Ll(e,t,r,n){const a=yield(0,Ra.Ys)(A().selectors.getGlobalSearchRequestOptions),i=Math.min(5,r-t+1),o=yield(0,Ra.RE)(v.rawRequest,Dl[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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Pl(e,t,r[t])}))}return e}({},a,{dataTenant:e.dataTenant})));return o.map((e=>({number:e.count,value:[e.from,e.to]})))}function Ul(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.push.apply(n,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=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*Fl(){const e=yield(0,Ra.Ys)(C.X0),t=yield(0,Ra.Ys)(C.Mp);return Object.values((0,Ia.t8)(e,t))}function*Ml(e){const t=yield(0,Ra.RE)(Fl),[r,n]=(0,O.partition)(x.bB,t);let[a,i]=(0,O.partition)(v.isRangeFacet,n);for(let t=0;t<r.length;t++)yield(0,Ra.rM)(kl,r[t],e);for(let t=0;t<a.length;t++)yield(0,Ra.rM)(_l,a[t],e);const[o,l]=(0,O.partition)((e=>e.values&&e.values.length),i);for(let t=0;t<o.length;t++)yield(0,Ra.rM)(Bl,o[t],e);const[s,c]=(0,O.partition)(x.DT,l);for(const t of s)yield(0,Ra.rM)(zl,[t],e);c.length&&(yield(0,Ra.rM)(zl,c,e))}function*Vl(e){const t=yield(0,Ra.Ys)(Xa.FR),[r,n]=(0,O.partition)(x.bB,e.payload),[a,i]=(0,O.partition)(v.isRangeFacet,n),[o,l]=(0,O.partition)(x.DT,i);for(let e=0;e<r.length;e++)yield(0,Ra.rM)(kl,r[e],t);for(let e=0;e<a.length;e++)yield(0,Ra.rM)(_l,a[e],t);for(const e of o)yield(0,Ra.rM)(zl,[e],t);l.length&&(yield(0,Ra.rM)(zl,l,t))}function*Bl(e,t,r){const n=yield(0,Ra.Ys)(A().selectors.getGlobalSearchRequestOptions),a=(0,_a.aw)([Ul({},e,{pageSize:e.pageSize+1})],t,[e.fieldName],n,r);yield(0,Ra.RE)(Hl,a,[e])}function*zl(e,t,r){const n=yield(0,Ra.Ys)(A().selectors.getGlobalSearchRequestOptions),a=(0,_a.aw)(e.map((e=>Ul({},e,{pageSize:e.pageSize+1}))),t,[],n,r);yield(0,Ra.RE)(Hl,a,e)}function*Hl(e,t){yield(0,Ra.RE)(Ui,e,t,qa)}function*Yl(e){const{facetFieldName:t,value:r,debounceTime:n,pageNumber:a=1,currentOptions:i=[]}=e.payload;if(""===r&&1===a)yield(0,Ra.gz)((e=>({type:R.k.DESTROY_FILTERED_DATA,payload:e}))(t));else{const e=yield(0,Ra.Ys)(C.X0),o=yield(0,Ra.Ys)(C.Mp),l=Ul({},(0,Ia.t8)(e,o)[t]);if("type"===t){const e={[t]:[...l.data.filter((e=>e.label.toLowerCase().includes(r.toLowerCase())))]};yield(0,Ra.gz)(Za(e))}else{n&&(yield(0,Ra.gw)(n));const e=yield(0,Ra.Ys)(Xa.FR),o=yield(0,Ra.Ys)(C.rM,t),s=e=>Za({[t]:i.concat(e[t])});r?yield(0,Ra.rM)(Vi,Ul({},l,{displayedItems:o,pageNumber:a,pageSize:l.pageSize+1}),e,r,s):yield(0,Ra.rM)(ji,Ul({},l,{pageNumber:a,pageSize:l.pageSize+1}),e,s)}}}function*Wl(){const e=yield(0,Ra.Ys)(C.DX),t=t=>t.entityTypeUri&&t.entityTypeUri!==e[0],r=yield(0,Ra.Ys)(C.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,Ra.gz)(Wa(n)))}}function*Gl(e){const{facetsToAdd:t=[],fieldNamesToDelete:r=[],changedEntityTypes:n,addToEnd:a=!1}=e.payload;if(t.length||r.length){t.length&&(yield(0,Ra.gz)(Ya(t,a)));const e=yield(0,Ra.RE)(Fl);let o=!1;if(r.length){const t=e.filter((e=>e.values&&e.values.length));o=r.some((e=>t.some((t=>{var r;return null===(r=t.fieldName)||void 0===r?void 0:r.startsWith(e)})))),yield(0,Ra.gz)(Wa(r))}if(null!=n)yield(0,Ra.gz)(Ga("type",n));else if(o)yield(0,Ra.gz)((({debounceTime:e}={})=>({type:_.Z.REFRESH,payload:{debounceTime:e}}))());else if(t.length){const r=e.filter((e=>t.some((t=>e.fieldName.startsWith(t.fieldName)))));yield(0,Ra.gz)((i=r,{type:R.k.REQUEST_GIVEN_FACETS_DATA,payload:i}))}}var i}function*ql(){const e=yield(0,Ra.Ys)(A().selectors.getSearchKeyword),t=yield(0,Ra.Ys)(Xa.vH),r=yield(0,Ra.Ys)(Hi.go),n=yield(0,Ra.Ys)(A().selectors.getMetadata),a=yield(0,Ra.Ys)(A().selectors.getDataTenants);if(ka(n,r,a)){const i=((e,t,r)=>{const n=ja(e,t,r),a=Ua(e,t,r),i=(0,O.pipe)(O.flatten,O.uniq)((0,lt.VO)(t)),o=(0,x.$t)(e);return a.reduce(((e,{fieldName:t,values:r})=>{const a=n.find((e=>e.fieldName===t));return a&&(e.facetsConfigs.push(a),e.facetsData[t]={values:r}),e}),{facetsConfigs:[o],facetsData:{[o.fieldName]:(l=i,(0,Ia.Kk)({values:l})?{values:l,showAllItems:!0}:{values:l})}});var l})(n,r,a);yield(0,Ra.gz)(w.search.actions.updateState({facets:i,keyword:e,map:t}))}}function*Zl(){if(!(yield(0,Ra.Ys)(Ti.IJ))){const e=yield(0,Ra.Ys)(A().selectors.getMetadata);if((yield(0,Ra.Ys)(C.Mp)).some(v.isTypeFacet)){const e=yield(0,Ra.Ys)(Ti.Xf),t=yield(0,Ra.Ys)(C.DX);(e?t.filter((t=>e.includes(t))):t).length!==t.length&&(yield(0,Ra.gz)(Ma({silent:!0})))}else{const t=[(0,x.$t)(e)];yield(0,Ra.gz)(Ya(t))}}}function*$l(){const e=yield(0,Ra.Ys)(A().selectors.getMetadata),t=yield(0,Ra.Ys)(C.X0),r=(0,Ia.t8)({type:t.type},[(0,x.$t)(e)]).type.data.reduce(((e,t)=>(e[(0,v.getLastUriPart)(t.value)]=t.number,e)),{}),n=yield(0,Ra.Ys)(Ti.Xf);return(0,Ia.wW)(e,r,n)}const Kl=[function*(){yield(0,Ra.Fm)([R.k.FILTER_FACET_DATA],Yl)},function*(){yield(0,Ra.ib)(R.k.REQUEST_GIVEN_FACETS_DATA,Vl)},function*(){yield(0,Ra.ib)(R.k.HANDLE_CONFIGS_CHANGES,Gl)},function*(){yield(0,Ra.ib)(R.k.CONVERT_FROM_ADVANCED_SEARCH,ql)}];function Xl(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ql=e=>{const t=["view","searchResultsColumns"],r=(0,O.pathOr)({},t,e),n=(0,O.map)((0,O.map)((0,O.pipe)((0,O.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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Xl(e,t,r[t])}))}return e}({},e,{attrType:{uri:(0,O.pathOr)("",["attrType","uri"],e)}}):e))),r),a=(0,O.lensPath)(t),i=(0,O.omit)(["sortField","sortOrder","entityTypeTab"],e.view),o=(0,O.lensPath)(["view"]),l=["keyword"],s=(0,O.pathOr)("",l,e),c=(0,O.lensPath)(l),u=["map"],p=(0,O.pathOr)("",u,e),d=(0,O.lensPath)(u);return(0,O.pipe)((0,O.omit)(["searchOptions"]),(0,O.set)(o,i),(0,O.set)(a,n),(0,O.set)(c,s),(0,O.set)(d,p))(e)};function Jl(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){es(e,t,r[t])}))}return e}function es(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*ts({payload:{share:e}}){const{query:t,uiState:r}=yield(0,Ra.RE)(wo,!0),n=Jl({},yield(0,Ra.Ys)(co.LA),{isPublic:e===B.ib.public,query:t,uiState:r}),a=yield(0,Ra.Ys)(co.tp);yield(0,Ra.gz)(ci(!1));try{yield(0,Ra.gz)(gi(ei().text("Updating search..."))),yield(0,Ra.RE)(v.updateSavedSearch,n),yield(0,Ra.gz)(ao(!1)),yield(0,Ra.gz)(gi(ei().text("Search updated successfully"))),a&&(yield(0,Ra.gz)(a))}catch(e){ti(e)}}function*rs(){const e=yield(0,Ra.Ys)(co.LA);if(!e)return void(yield(0,Ra.gz)(ao(!1)));const t=yield(0,Ra.Ys)(A().selectors.getMetadata),r=yield(0,Ra.Ys)(A().selectors.getDataTenants),n=yield(0,Ra.Ys)(A().selectors.getCanUserReadWorkflowDataTask),{uiState:a}=(0,uo.z7)(t,r,n,yield(0,Ra.RE)(wo)),i=(({savedUiState:e,actualUiState:t})=>{const r=Ql(e),n=Ql(t);if(!(0,O.equals)(r,n))return!1;if((0,O.path)(["view","searchResultsMode"],e)===B.ll.TABLE){const r=["view","sortField"],n=["view","sortOrder"],a=["view","entityTypeTab"],i=(0,O.path)(r,e),o=(0,O.path)(r,t),l=(0,O.path)(n,e),s=(0,O.path)(n,t),c=(0,O.path)(a,e),u=(0,O.path)(a,t);if(!(0,O.equals)(i,o)||!(0,O.equals)(l,s)||!(0,O.equals)(c,u))return!1}const a=["searchOptions"],i=(0,O.pathOr)(null,a,e),o=(0,O.pathOr)(null,a,t);return!!((0,O.isNil)(i)||(0,O.isNil)(o)||(0,O.equals)(i,o))})({savedUiState:e.uiState,actualUiState:a});yield(0,Ra.gz)(ao(!i))}function*ns(e){const t=yield(0,Ra.Ys)(co.LA);if(t)switch(e.type){case fr:case cr:case pr:t.uri===e.payload.uri&&(yield(0,Ra.gz)(no(Jl({},t,e.payload))));break;case Er:(0,O.includes)(t.uri,e.payload)&&(yield(0,Ra.gz)(no(null)));break;case Xt:yield(0,Ra.gz)(no(Jl({},t,{isPublic:e.payload.share===B.ib.public})));break;default:(yield(0,Ra.Ys)(Xa.kw))&&(yield(0,Ra.gz)(no(null)))}}function*as(e){const t=yield(0,Ra.Ys)(co.EH,e);if(t)return t;const r=yield(0,Ra.Ys)(A().selectors.getMetadata),n=yield(0,Ra.Ys)(A().selectors.getDataTenants),a=yield(0,Ra.Ys)(A().selectors.getCanUserReadWorkflowDataTask);try{const t=yield(0,Ra.RE)(v.getSavedSearch,(0,uo.tk)(e));return(0,uo.z7)(r,n,a,t)}catch(e){return ti(e),null}}function*is(e){const t=(0,O.path)(["payload","currentSavedSearchUri"],e);if(!t)return;const r=yield(0,Ra.Ys)(co.LA);if((0,O.prop)("uri",r)===t)return;const n=yield(0,Ra.RE)(as,t);n&&(yield(0,Ra.gz)(no(n)),yield(0,Ra.RE)(rs))}const os=[...Cl,fe,_.Z.CHANGE_SORT,ve,me,he,ge,Te,R.k.CREATE_FACETS,R.k.DESTROY_FACETS,R.k.SHOW_MORE_ENTITY_TYPES],ls=[function*(){yield(0,Ra.Fm)(os,rs)},function*(){yield(0,Ra.Fm)([Xt],ts)},function*(){yield(0,Ra.Fm)([fr,cr,pr,Er,Xt,...Cl],ns)},function*(){yield(0,Ra.Fm)(w.search.constants.UPDATE_STATE,is)}];function ss(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*cs(){yield(0,Ra.gw)(500);const{uiState:e,query:t}=yield(0,Ra.RE)(wo,!1,!0),r=yield(0,Ra.Ys)(co.LA);yield(0,Ra.gz)(w.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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){ss(e,t,r[t])}))}return e}({},e,{query:t,currentSavedSearchUri:(0,O.path)(["uri"],r)})))}function*us(){yield(0,Ra.qn)(w.search.constants.UPDATE_STATE);const e=(0,O.reject)((0,O.includes)(O.__,[_.Z.REFRESH]),os);yield(0,Ra.Fm)([$t,...e],cs)}const ps=e=>({type:Cr,payload:e}),ds=()=>({type:Nr}),ms=e=>({type:Dr,payload:e}),fs=e=>({type:Lr,payload:e}),ys=(e,t)=>({type:Fr,payload:{searchCreatedDate:e,isLoading:t}});var gs=r(97010),hs=r(73667);const Es=(0,O.path)([B.Jf,"recentSearches"]),bs=e=>Es(e).items,vs=e=>Es(e).filterWord,Ts=(0,O.curry)(((e,t)=>!e||t&&t.name.toLocaleLowerCase().includes(e.toLocaleLowerCase()))),Os=e=>(0,O.pipe)(bs,(0,O.filter)(Ts(vs(e))))(e),Ss=e=>Es(e).loading,xs=(0,hs.Rm)(bs),Cs=(0,hs.d1)(bs),ws=(0,hs.Ky)(bs),As=(0,hs.$y)(bs),Rs=e=>Es(e).lastSavedRecentSearch,_s=(e,t)=>bs(e).find((0,O.propEq)("createdDate",t)),Is=(0,O.path)(["advancedSearch","searchParams","groups"]);function Ns(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Ps(e,t,r[t])}))}return e}function Ps(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*Ds(){yield(0,Ra.gz)(fs(!0));try{const t=yield(0,Ra.Ys)(A().selectors.getTenant),r=yield(0,Ra.Ys)(A().selectors.getEnvironment),n=yield(0,Ra.Ys)(A().selectors.getServicesPath),{result:a=[]}=yield(0,Ra.RE)(v.getRecentSearches,{environment:r,tenant:t,servicesPath:n}),i=(0,O.sort)((0,O.descend)((0,O.prop)("createdDate")))(a);yield(0,Ra.gz)((e=i,{type:Ar,payload:e})),yield(0,Ra.gz)(fs(!1)),yield(0,Ra.RE)(Us,i)}catch(e){ti(e),yield(0,Ra.gz)(fs(!1))}var e}function*ks(e){const t=yield(0,Ra.Ys)(_s,e.payload);yield(0,Ra.RE)(Ls,t)}function*Ls(e,t){yield(0,Ra.gz)(ys(e.createdDate,!0));try{const{total:r}=yield(0,Ra.RE)(v.getTotalsForQuery,(0,v.replacePlaceholdersInQuery)(e.query),Boolean(t));yield(0,Ra.gz)(((e,t)=>({type:Rr,payload:{searchCreatedDate:e,total:t}}))(e.createdDate,r))}catch(e){ti(e)}yield(0,Ra.gz)(ys(e.createdDate,!1))}function*Us(e){const t=yield(0,Ra.Ys)(A().selectors.getQueryEstimatorEnabled);return yield(0,Ra.$6)(e.map((e=>(0,Ra.RE)(Ls,e,t))))}function*js(){const e=yield(0,Ra.Ys)(As),t=yield(0,Ra.Ys)(A().selectors.getServicesPath);yield(0,Ra.gz)(fs(!0));try{yield(0,Ra.$6)(e.map((e=>(0,Ra.RE)(v.deleteRecentSearch,Ns({},e,{servicesPath:t}))))),yield(0,Ra.gz)(ms(e))}catch(e){ti(e)}yield(0,Ra.gz)(fs(!1))}function*Fs(e){const t=e.payload,r=yield(0,Ra.Ys)(A().selectors.getServicesPath);yield(0,Ra.gz)(fs(!0));try{yield(0,Ra.RE)(v.deleteRecentSearch,Ns({},t,{servicesPath:r})),yield(0,Ra.gz)(ms([t]))}catch(e){ti(e)}yield(0,Ra.gz)(fs(!1))}function*Ms(e){const{debounceTime:t}=e.payload??{};t&&(yield(0,Ra.gw)(t));const{query:r,uiState:n}=yield(0,Ra.RE)(wo,!0),a=yield(0,Ra.Ys)(Ti.$s),i=yield(0,Ra.Ys)(Rs),o=yield(0,Ra.Ys)(Xa.kw),l=yield(0,Ra.Ys)(A().selectors.getTenant),s=yield(0,Ra.Ys)(A().selectors.getEnvironment),c=yield(0,Ra.Ys)(A().selectors.getServicesPath),u=((e={})=>{const t=Is(e);return t&&t.length>0?((e={})=>{const t=(0,O.chain)((0,O.prop)("attributes")),r=(0,O.filter)((0,O.has)("values")),n=(0,O.pipe)(Is,t,r),a=(0,O.pipe)((0,O.prop)("values"),(0,O.map)((0,O.prop)("label")),(0,O.join)(", ")),i=(0,O.path)(["data","title"]),o=(0,O.pathEq)(["data","fieldName"],"type"),l=(0,O.find)(o),s=(0,O.pipe)(l,(0,O.when)(O.identity,a)),c=(0,O.pipe)((0,O.reject)(o),(0,O.map)(i),(0,O.reject)(O.isNil),(0,O.join)(", "));return[s(u=n(e)),c(u)].filter(O.identity).join(" - ");var u})(e):((e={})=>{const t=(0,O.prop)("facets"),r=(0,O.prop)("facetsData"),n=(0,O.prop)("facetsConfigs"),a=(0,O.prop)("values"),i=(0,O.prop)("label"),o=(0,O.prop)("title"),l=(0,O.pipe)(a,(e=>e&&e.length>0)),s=(0,O.curry)(((e,r)=>(0,O.pipe)(t,n,(0,O.find)((0,O.propEq)("fieldName",r)),(0,O.defaultTo)({}),o)(e))),c=(0,Ia.XK)(e),u=[];c&&u.push(a(c).map((e=>(0,O.pipe)((0,O.propOr)([],"data"),(0,O.find)((0,O.propEq)("value",e)),(0,O.defaultTo)({}),i))).map((e=>e(c))).join(", "));const p=(0,O.pipe)(t,r,O.values,(0,O.reject)(v.isTypeFacet),(0,O.filter)(l),(0,O.map)((0,O.prop)("fieldName"))),d=(0,O.pipe)(p,(0,O.map)(s(e)))(e);return d.length>0&&u.push(d.join(", ")),u.filter(O.identity).join(" - ")})(e)})(a),p=(0,v.getHash)(r),d={query:r,state:n,name:u,environment:s,tenant:l};try{if(i!==p&&!o){const e=yield(0,Ra.RE)(v.createRecentSearch,d,c);e.success?yield(0,Ra.gz)((e=>({type:jr,payload:e}))(p)):ti(e)}}catch(e){ti(e)}}function*Vs(e){const{search:t,debounceTime:r}=e.payload;yield(0,Ra.gz)(si(!1));const n=yield(0,Ra.Ys)(A().selectors.getMetadata),a=yield(0,Ra.Ys)(A().selectors.getDataTenants),i=yield(0,Ra.Ys)(A().selectors.getCanUserReadWorkflowDataTask);let o={};try{o=(0,O.pipe)(gs.Z,(0,gs.f)(null))(n,JSON.parse(t.state),{},a,i)}catch(e){o={}}(yield(0,Ra.Ys)(Xa.lF))&&(o.currentTenant=yield(0,Ra.Ys)(A().selectors.getTenant)),yield(0,Ra.gz)(w.search.actions.updateState(Ns({},o,{debounceTime:r})))}const Bs=({type:e,payload:t={}})=>e===w.search.constants.KEYWORD_UPDATED&&!(null==t||!t.saveToRecent),zs=[function*(){yield(0,Ra.Fm)([wr],Ds)},function*(){yield(0,Ra.ib)(Pr,js)},function*(){yield(0,Ra.Fm)([w.ui.constants.UIActions.OPEN_ENTITY,Zt,Xt,Cr,_.Z.CHANGE_PAGE,_.Z.CHANGE_ROWS_PER_PAGE,_.Z.EXPORT_RESULTS,Bs],Ms)},function*(){yield(0,Ra.Fm)([Vr],Vs)},function*(){yield(0,Ra.ib)([Mr],ks)},function*(){yield(0,Ra.ib)(kr,Fs)}],Hs=e=>e[B.Jf].entity.loading,Ys=e=>e[B.Jf].entity.selectedEntityUri,Ws=e=>e[B.Jf].entity.entity,Gs=e=>({type:un,payload:e}),qs=e=>({type:pn,payload:e}),Zs=e=>({type:dn,payload:e}),$s=e=>({type:mn,payload:e});function*Ks(e){if(yield(0,Ra.Ys)(Xa.lF)){const t=yield(0,Ra.RE)(xl,(0,v.getDtssEntityUrl)(e));return(yield(0,Ra.RE)(Sl,t))[0]}{const t=yield(0,Ra.Ys)(A().selectors.getMetadata),r=(0,v.addMetadataSpecificGetEntityOptions)(t);return yield(0,Ra.RE)(v.getEntity,e,r)}}function*Xs(e){const t=e.payload;(yield(0,Ra.Ys)(Ys))!==t&&(yield(0,Ra.gz)(Zs(t)));const r=yield(0,Ra.Ys)(Ws);if(yield(0,Ra.gz)(Gs(!0)),(0,O.isNil)(t))yield(0,Ra.gz)($s(null));else if(!r||r.uri!==t)try{const e=yield(0,Ra.RE)(Ks,t);yield(0,Ra.gz)($s(e))}catch(e){n=e,(0,Qa.U)(n,{defaultMessage:ei().text("Can't load entity")}),yield(0,Ra.gz)($s(null))}var n;yield(0,Ra.gz)(Gs(!1))}const Qs=[function*(){yield(0,Ra.Fm)(pn,Xs)}];function*Js(e){const t="type"===(0,O.path)(["payload","facetFieldName"],e),r=(0,O.path)(["payload","values"],e);if(!t||1!==(0,O.length)(r))return;const n=yield(0,Ra.Ys)(A().selectors.getMetadata),a=(0,v.getEntityType)(n,r[0]),i=a.defaultFacetedAttributes||[];if(i.length>0){const e=yield(0,Ra.Ys)(C.Mp),t=({fieldName:t})=>(0,O.none)((0,O.propEq)("fieldName",t),e),r=(0,ri.vf)(n,a).map((e=>(0,ri.NG)(n,e,a.uri,"",x.u7))),o=i.reduce(((e,n)=>{const a=(0,v.attributeUriToSearchUri)(n),i=(0,x.zy)(r,a);return i&&t(i)?e.concat(i.children?(0,ri.jj)(i).filter(t):i):e}),[]);o.length>0&&(yield(0,Ra.gz)(Ya(o,!0)))}}const ec=[function*(){yield(0,Ra.Fm)(R.k.CHANGE_VALUES,Js)}],tc=e=>({type:_n,payload:e}),rc=()=>({type:Pn}),nc=()=>({type:Tn}),ac=e=>({type:xn,payload:e}),ic=e=>({type:wn,payload:e}),oc=e=>({type:Rn,payload:e}),lc=e=>({type:Nn,payload:e}),sc=e=>({type:Dn,payload:e}),cc=({id:e,groupId:t})=>({type:jn,payload:{id:e,groupId:t}}),uc=({id:e,groupId:t,operationParameters:r})=>({type:Un,payload:{id:e,groupId:t,operationParameters:r}}),pc=(e,t,r)=>({type:Mn,payload:{groupId:e,attributeId:t,attribute:ft(r)}}),dc=(e,t,r)=>({type:Vn,payload:{groupId:e,attributeId:t,attributeData:yt(r)}}),mc=(e,t)=>({type:Vn,payload:{groupId:e,attributeId:t,attributeData:null}}),fc=(e,t,r)=>({type:Bn,payload:{groupId:e,attributeId:t,selectInfo:r}}),yc=(e,t)=>({type:zn,payload:{groupId:e,attributeId:t}}),gc=(e,t,r)=>({type:Hn,payload:{groupId:e,attributeId:t,filter:r}}),hc=(e,t,r)=>({type:Yn,payload:{groupId:e,attributeId:t,values:r}}),Ec=e=>({type:Zn,payload:e});var bc=r(27901);const vc=(0,O.has)("actions"),Tc=e=>e.actions.map((0,O.assocPath)(["operationParameters","conditions"],e.conditions)),Oc=(0,O.path)(["operationParameters","attributeTypeData","attributeType"]),Sc=(0,O.path)(["operationParameters","attributeTypeData","fieldName"]),xc=(0,O.path)(["operationParameters","pin"]),Cc=(0,O.path)(["operationParameters","addNestedAttribute"]),wc=(0,O.path)(["operationParameters","attributeValue"]),Ac=(0,O.path)(["operationParameters","attributeValueToFind"]),Rc=(0,O.anyPass)([(0,O.equals)($n.d.AddNew),(0,O.equals)($n.d.ReplaceAllWith)]),_c=(0,O.anyPass)([(0,O.equals)($n.d.AddNew),(0,O.equals)($n.d.ReplaceAllWith),(0,O.equals)($n.d.FindAndReplace)]),Ic=(0,O.equals)($n.d.AddNew),Nc=(0,O.both)((0,O.pipe)(Oc,v.isNested),(0,O.pipe)((0,O.prop)("operation"),Rc)),Pc=(0,O.both)((0,O.pipe)(Oc,v.isReference),(0,O.pipe)((0,O.prop)("operation"),Ic)),Dc=(0,O.both)((0,O.pipe)(wc,v.isLookupAttrType),(0,O.pipe)((0,O.prop)("operation"),_c)),kc=(0,O.pipe)(Oc,v.isLookupAttrType),Lc=e=>{switch(e){case $n.d.AddNew:case $n.d.RepointReference:case $n.d.ReplaceAllWith:return["attributeValue"];case $n.d.FindAndReplace:return["attributeValueToFind","attributeValue"];case $n.d.FindAndRemove:return["attributeValueToFind"];default:return[]}},Uc=e=>{if(!e.operation||!e.operationParameters)return!1;const t=Nc(e),r=Pc(e),n=kc(e),a=Lc(e.operation);for(let i of a){const a=e.operationParameters[i];if((0,v.isEmptyValue)(a)||n&&(0,v.isEmptyValue)((0,v.getAttrTypeLookupCode)(a))||r&&(0,v.isEmptyValue)((0,v.getReferencedEntityFromAttrValue)(a))||t&&(0,v.isEmptyValue)((0,v.cleanAttributesWith)({deleteEmptyComplex:!0})(a.value)))return!1}return!0},jc=e=>{const t=Nc(e),r=Pc(e);return t||r?Lc(e.operation).reduce(((e,t)=>{const r=["operationParameters",t,"value"];if((0,O.path)(r,e)){const t=(0,O.lensPath)(r);return(0,O.over)(t,(0,v.cleanAttributesWith)({deleteEmptyComplex:!0}),e)}return e}),e):e},Fc=e=>e[B.Jf].bulkUpdate.operation,Mc=e=>e[B.Jf].bulkUpdate.activeStep,Vc=e=>e[B.Jf].bulkUpdate.loading,Bc=e=>{const t=(0,Ti.IJ)(e)?(0,Hi.V6)(e):(0,C.DX)(e),r=(0,Ti.tB)(e);return r||1===t.length?r||t[0]:null},zc=(0,O.path)([B.Jf,"bulkUpdate","objects"]),Hc=e=>zc(e).total,Yc=e=>zc(e).selectionMode,Wc=e=>zc(e).entities,Gc=e=>zc(e).selectedEntities,qc=e=>zc(e).page,Zc=e=>zc(e).rowsPerPage,$c=e=>zc(e).sortField,Kc=e=>zc(e).sortOrder,Xc=e=>zc(e).selectedColumns,Qc=e=>zc(e).filterText,Jc=(0,O.pipe)(Yc,(0,O.equals)(B.v6.include)),eu=(0,O.ifElse)(Jc,(0,O.pipe)(Gc,O.length),(e=>{const t=Gc(e).length;return(0,Xa.hX)(e)-t})),tu=(0,O.pipe)(eu,(0,O.gt)(O.__,0)),ru=e=>e[B.Jf].bulkUpdate.actions,nu=(0,bc.P1)(ru,(0,O.pipe)((0,O.map)((0,O.ifElse)(vc,(0,O.evolve)({actions:(0,O.pipe)((0,O.map)(jc),(0,O.filter)(Uc))}),jc)),(0,O.filter)((0,O.ifElse)(vc,(0,O.pipe)((0,O.path)(["actions","length"]),(0,O.gt)(O.__,0)),Uc)))),au=(0,bc.P1)(ru,(0,O.pipe)((0,O.map)((0,O.when)(vc,(0,O.prop)("actions"))),O.flatten)),iu=e=>{const t=au(e);return 0!==t.length&&t.every(Uc)},ou=e=>e[B.Jf].bulkUpdate.requestPending,lu=(0,v.getUrisForSaving)((e=>(0,O.equals)(e.slice(-3),["operationParameters","attributeValue","entityUri"]))),su=(0,O.curry)(((e,t,r)=>{const n=(0,O.pipe)(lu,(0,O.find)((t=>(0,O.pathSatisfies)((t=>t===e),t,r))))(r);return n?(0,O.set)((0,O.lensPath)(n),t,r):r})),cu=(e,t,r)=>(0,O.pipe)(su(e,t),(0,O.when)((e=>e===r),(0,v.replaceTemporaryRefEntityURI)(e,t)))(r),uu=(0,O.pathEq)(["data","fieldName"],B.E_),pu=(0,O.pipe)((0,O.path)(["values",0,"entityUri"]),(0,O.objOf)("uri"),v.getEntityId,v.wrapInQuotes),du=e=>[{attributes:e,operator:"or"}],mu=(0,O.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===B.Vp.AddAttribute&&l--,i.length||(i=a.slice(-1),l++);const s=`${(0,O.repeat)("parent.",Math.max(0,l)).join("")}attributes.${i.join(".")}`;return(0,O.assocPath)(["data","fieldName"],s,r)})))),fu=(0,O.curry)(((e,t,r)=>{const n=((e,t,r)=>{const[n,a]=(0,O.partition)(uu,e),i=(0,O.pipe)(mu(t,r),du,_a.Jk)(a),o=n.length?(e=>`in(${B.E_}, ${e.map(pu).join(",")})`)(n):"";return i&&o?`${i} and ${o}`:i||o})(e,t,r.operation);return(0,O.isEmpty)(n)?r:(0,O.ifElse)((0,O.pipe)((0,O.path)(["operationParameters","valueFilter"]),v.isEmptyValue),(0,O.assocPath)(["operationParameters","valueFilter"],n),(0,O.evolve)({operationParameters:{valueFilter:(0,O.concat)(O.__,` and (${n})`)}}))(r)}));var yu=r(9828);function gu(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){hu(e,t,r[t])}))}return e}function hu(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Eu=e=>{const t=(0,O.pipe)((0,O.pick)(["pin"]),(0,O.assoc)("value",bu(e)))(e);return(0,yu.Kn)(t.value)?Object.keys(t.value).reduce(((e,r)=>(e.value=gu({},e.value,{[r]:t.value[r].map(Eu)}),e)),t):t},bu=(0,O.when)(yu.Kn,(0,O.ifElse)((0,O.has)("lookupCode"),(0,O.prop)("lookupCode"),(0,O.prop)("value"))),vu=(0,O.cond)([[Nc,(0,O.pipe)(wc,Eu)],[Pc,(0,O.pipe)(wc,(e=>{const{refEntity:t=[],refRelation:r=[]}=e;return gu({refEntity:(0,O.pipe)(O.head,(0,O.pick)(["objectURI"]))(t),refRelation:(0,O.pipe)(O.head,(0,O.pick)(["type"]))(r)},Eu(e))}))],[Dc,(0,O.pipe)(wc,bu)],[O.T,wc]]),Tu=(0,O.pipe)(vu,(0,O.assocPath)(["operationParameters","attributeValue"])),Ou=(0,O.ifElse)(xc,(()=>(0,O.assocPath)(["operationParameters","pin"],!0)),(()=>O.identity)),Su=(0,O.ifElse)(Cc,(()=>(0,O.assocPath)(["operationParameters","addNestedAttribute"],!0)),(()=>O.identity)),xu=(0,O.pipe)(Ac,(0,O.ifElse)(O.isNil,(()=>O.identity),(0,O.pipe)(((e="")=>`equals(value, '${bu(e)}')`),(0,O.assocPath)(["operationParameters","valueFilter"])))),Cu=(0,O.pipe)(wc,(0,O.prop)("entityUri"),(0,O.assocPath)(["operationParameters","referencedEntity","uri"])),wu=(e,t)=>({operationParameters:{attributeURI:e},operation:t}),Au=(e,t)=>(0,O.pipe)(wu,Tu(e),Ou(e),Su(e))(t,B.Vp.AddAttribute),Ru=(e,t)=>(0,O.pipe)(wu,xu(e))(t,B.Vp.DeleteAttribute),_u=(e,t)=>(0,O.pipe)(wu,Tu(e),Ou(e),xu(e))(t,B.Vp.UpdateAttribute),Iu=(e,t)=>(0,O.pipe)(wu,Cu(e))(t,B.Vp.RepointReferencedEntity),Nu=(e,t)=>(0,O.reject)(O.isNil,{operationParameters:e,operation:t}),Pu=e=>Nu({tags:[wc(e)]},B.Vp.AddTags),Du=e=>Nu({newValue:wc(e),oldValue:Ac(e)},B.Vp.ReplaceTag),ku=e=>Nu({tags:[Ac(e)]},B.Vp.DeleteTags),Lu=()=>Nu(null,B.Vp.ClearTags),Uu=(e,t=[],r={})=>{const{selectionMode:n,selectedEntities:a=[]}=e,{searchOptions:i,activityFilter:o,globalFilter:l}=r;return n===B.v6.include?{list:a,activeness:o}:{filter:(0,O.pipe)(_a.XP,(0,v.addGlobalFilterToQuery)(l))(t),excludeList:a,options:i,activeness:o}},ju=(0,O.curry)(((e,t)=>(0,O.chain)((0,O.ifElse)(vc,(0,O.pipe)(Tc,ju(e)),Fu(e)))(t))),Fu=(0,O.curry)(((e,t)=>{const r=(0,O.pathOr)([],["operationParameters","conditions"],t),n=Sc(t);return(0,O.pipe)(Vu(e),(0,O.map)(fu(r,n)))(t)})),Mu=(0,O.curry)((e=>(0,O.propEq)("operation",e))),Vu=(0,O.curry)(((e,t)=>{const r=Sc(t),n=r.includes(".")?(0,v.searchUriToAttrUri)(r,e):r,a=r===v.EntityAttrTypes.tags.uri;return(0,O.cond)([[(0,O.both)((0,O.always)(a),Mu($n.d.AddNew)),()=>[Pu(t)]],[(0,O.both)((0,O.always)(a),Mu($n.d.Clear)),()=>[Lu()]],[(0,O.both)((0,O.always)(a),Mu($n.d.ReplaceAllWith)),()=>[Lu(),Pu(t)]],[(0,O.both)((0,O.always)(a),Mu($n.d.FindAndReplace)),()=>[Du(t)]],[(0,O.both)((0,O.always)(a),Mu($n.d.FindAndRemove)),()=>[ku(t)]],[Mu($n.d.AddNew),()=>[Au(t,n)]],[Mu($n.d.Clear),()=>[Ru(t,n)]],[Mu($n.d.ReplaceAllWith),()=>[Ru(t,n),Au(t,n)]],[Mu($n.d.FindAndReplace),()=>[_u(t,n)]],[Mu($n.d.FindAndRemove),()=>[Ru(t,n)]],[Mu($n.d.RepointReference),()=>[Iu(t,n)]]])(t)}));function Bu(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){zu(e,t,r[t])}))}return e}function zu(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*Hu(e){if(e.payload){const e=yield(0,Ra.Ys)(Ti.tB);let r;do{if(r=yield(0,Ra.Ys)(Xa.BP,{entityTypeUri:e}),r)break;yield(0,Ra.qn)(_.Z.UPDATE_ENTITIES)}while(!r);const n=yield(0,Ra.Ys)(Bc),a=yield(0,Ra.Ys)(Xa.fx,{entityTypeUri:e}),i=yield(0,Ra.Ys)(Xa.Uz,{entityTypeUri:e}),o=(yield(0,Ra.Ys)(Xa.L9,{entityTypeUri:e}))||void 0,l=yield(0,Ra.Ys)(Xa.NW,{entityTypeUri:e}),s=(yield(0,Ra.RE)(Gi))[n].filter((0,O.pipe)((0,O.prop)("id"),v.isAttributeSearchUri,O.not)),c=e?yield(0,Ra.Ys)(Ti.Gv,e):s,u=yield(0,Ra.Ys)(Xa.NU,{entityTypeUri:e});yield(0,Ra.gz)((t={page:a,rowsPerPage:i,sortOrder:o,sortField:l,selectedColumns:c,total:u,entities:r},{type:vn,payload:t}))}var t}function*Yu(e){const t=yield(0,Ra.Ys)(A().selectors.getMetadata),r=yield(0,Ra.Ys)(qc),n=yield(0,Ra.Ys)(Zc),a=yield(0,Ra.Ys)(Kc),i=yield(0,Ra.Ys)($c),o=yield(0,Ra.RE)(ep),l=(0,O.uniq)(o.concat((0,_a.kx)(t,e))),s=Bu({page:r,rowsPerPage:n,sortOrder:a,sortField:i,forceOvOnly:!0},yield(0,Ra.Ys)(A().selectors.getGlobalSearchRequestOptions),{select:l}),c=(0,_a.Lv)(e,s);yield(0,Ra.gz)(ac(!0));try{const e=yield(0,Ra.RE)(v.rawRequest,B.NV,c);yield(0,Ra.gz)(tc(e))}catch(e){console.warn(e),yield(0,Ra.gz)(tc([]))}yield(0,Ra.gz)(ac(!1))}function*Wu(){const e=yield(0,Ra.Ys)(Qc),t=yield(0,Ra.RE)(Ju,e);yield(0,Ra.rM)(Yu,t)}function*Gu(e={}){const{debounceTime:t}=e.payload||{};t&&(yield(0,Ra.gw)(t));const r=yield(0,Ra.Ys)(Qc),n=yield(0,Ra.RE)(Ju,r);yield(0,Ra.gz)(ic(0)),yield(0,Ra.rM)(qu,n)}function*qu(e){const t=yield(0,Ra.Ys)(A().selectors.getGlobalSearchRequestOptions),r=(0,_a.Vg)(e,[],t);try{const e=yield(0,Ra.RE)(v.rawRequest,B.jS,{method:"POST",body:JSON.stringify(r)});yield(0,Ra.gz)(lc(e.total))}catch(e){console.warn(e),yield(0,Ra.gz)(lc(0))}}function*Zu(){const e=(yield(0,Ra.Ys)(Wc)).map((e=>e.uri)),t=yield(0,Ra.RE)(ep),r=yield(0,Ra.Ys)(Qc),n=yield(0,Ra.RE)(Ju,r),a=yield(0,Ra.Ys)(A().selectors.getGlobalSearchRequestOptions),i=(0,_a.aG)(e,n,Bu({select:t},a));yield(0,Ra.gz)(ac(!0));try{const e=yield(0,Ra.RE)(v.rawRequest,i.url,i.options);yield(0,Ra.gz)(tc(e))}catch(e){console.warn(e),yield(0,Ra.gz)(tc([]))}yield(0,Ra.gz)(ac(!1))}function*$u(e){try{yield(0,Ra.RE)(v.rawRequest,e.url,e.options),yield(0,Ra.gz)(bi(!1)),yield(0,Ra.gz)(hi({message:ei().text("Bulk update is currently in progress. You'll receive an email notification once completed.\nGo to Tenant Management to view the status."),actionLabel:ei().text("Tenant Management"),actionToDispatch:w.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?ei().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||ei().text("Something went wrong...")),yield(0,Ra.gz)((t=r,yi({payload:{message:t,action:{actionToDispatch:fi()}},type:B.GT.error})))}var t}function*Ku(){const e=yield(0,Ra.Ys)(Fc);e===B.dV.UpdateProfiles?yield(0,Ra.RE)(Xu):e===B.dV.DeleteProfiles&&(yield(0,Ra.RE)(Qu))}function*Xu(){yield(0,Ra.gz)(Ec(!0));const e=yield(0,Ra.Ys)(Bc),t=yield(0,Ra.Ys)(zc);let r=yield(0,Ra.Ys)(nu);const n=yield(0,Ra.RE)(Ju),a=yield(0,Ra.Ys)(A().selectors.getGlobalSearchRequestOptions),i=yield(0,Ra.Ys)(A().selectors.getModifiedEntities),o=((e,t)=>{const r=(0,v.findAllTemporaryRefEntityURI)(t),n=(a=t,(0,O.pipe)(lu,(0,v.getPathsWithTempUri)(a),(0,O.map)((e=>(0,O.path)(e,a))))(a));var a;return r.concat(n).filter((t=>e[t]))})(i,r);if(o.length>0){const e=yield(0,Ra.RE)(v.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=((e,t={},r=[],n=[],a={})=>({objects:Uu(t,n,a),actions:ju(e,r)}))(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,Ra.RE)($u,l),yield(0,Ra.gz)(Ec(!1))}function*Qu(){yield(0,Ra.gz)(Ec(!0));const e=function(e,t,r){const n={objects:Uu(e,t,r)};return{url:"/entities/_delete?sendMail=true",options:{method:"POST",body:JSON.stringify(n),headers:{"Content-Type":"application/json"}}}}(yield(0,Ra.Ys)(zc),yield(0,Ra.RE)(Ju),yield(0,Ra.Ys)(A().selectors.getGlobalSearchRequestOptions));yield(0,Ra.RE)($u,e),yield(0,Ra.gz)(Ec(!1))}function*Ju(e){const t=yield(0,Ra.Ys)(Xa.FR),r={fieldName:"type",filter:"equals",values:[yield(0,Ra.Ys)(Bc)]};let n=t.filter((e=>"type"!==e.fieldName)).concat(r);return e&&(n=n.concat({fieldName:"attributes",filter:"containsWordStartingWith",values:[e]})),n}function*ep(){const e=yield(0,Ra.Ys)(Xc);return(0,vi.vw)(e)}function*tp(e){const{groupId:t,attributeId:r,selectInfo:n}=e.payload,a=yield(0,Ra.Ys)(ru),i={addAttributeAfter:pc,changeAttribute:dc,clearAttribute:mc,deleteAttribute:yc};yield(0,Ra.RE)(qo,{groups:a,attributesPropName:"conditions",groupId:t,attributeId:r,selectInfo:n,actions:i})}const rp=[function*(){yield(0,Ra.Fm)(ce,Hu)},function*(){yield(0,Ra.Fm)([wn,Cn,An],Wu)},function*(){yield(0,Ra.Fm)(In,Gu)},function*(){yield(0,Ra.Fm)(Pn,Zu)},function*(){yield(0,Ra.ib)(Bn,tp)},function*(){yield(0,Ra.ib)(qn,Ku)}],np=()=>({id:B.Jf,reducerMap:{[B.Jf]:(0,T.combineReducers)({ui:Fe,search:ae,facets:V,advancedSearch:qt,savedSearches:Jr,recentSearches:cn,entity:En,bulkUpdate:Aa})},sagas:[...wl,...Kl,...ro,...rl,..._o,...zs,...ls,us,...Qs,...ec,...rp]});var ap=r(8156),ip=r.n(ap),op=r(95099),lp=r.n(op),sp=r(34756),cp=r(78310),up=r.n(cp),pp=r(23625),dp=r.n(pp),mp=r(53732),fp=r.n(mp),yp=r(88214),gp=r.n(yp),hp=r(14294),Ep=r.n(hp),bp=r(4501),vp=r.n(bp),Tp=r(87925),Op=r(18538),Sp=r(42950);const xp=(0,Sp.Z)((()=>({container:({height:e=36})=>({height:e,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 Cp(){return Cp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Cp.apply(null,arguments)}function wp(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Ap(e,t,r[t])}))}return e}function Ap(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Rp=e=>{let{value:t,autofocus:r,onSearch:n=O.identity,rootRef:a,classes:i={},height:o,placeholder:l=ei().text("Search"),endAdornmentContent:s}=e,c=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["value","autofocus","onSearch","rootRef","classes","height","placeholder","endAdornmentContent"]);const u=xp({height:o}),[p,d]=(0,ap.useState)(""),m=(0,O.pipe)((0,O.tap)(n),d),f=(0,O.isNil)(t)?p:t;return ip().createElement(fp(),Cp({startAdornment:ip().createElement(gp(),{position:"start"},ip().createElement(vp(),{className:u.icon})),endAdornment:ip().createElement(gp(),{position:"end"},f.length>0&&ip().createElement(Op.T,{icon:Ep(),className:u.clearButton,onClick:()=>m("")}),s),autoFocus:r,classes:wp({},i,{input:up()(u.input,i.input),root:up()(u.container,i.root)}),placeholder:l,value:f,onChange:(0,O.pipe)(Tp.NA,m),disableUnderline:!0,ref:a},c))},_p=(0,ap.memo)(Rp),Ip=(0,Sp.Z)((()=>({container:({containerHeight:e=553,containerWidth:t})=>({display:"flex",flexDirection:"column",height:e,width:t,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 Np(){return Np=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Np.apply(null,arguments)}const Pp=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,f=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.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=Ip({containerWidth:l,containerHeight:s}),g=ip().createElement(ip().Fragment,null,!a&&ip().createElement("div",{className:y.header},t),!i&&ip().createElement(_p,{onSearch:n,autofocus:!0,onKeyDown:c,inputRef:p,classes:{root:y.searchInputContainer},placeholder:ei().text("Search & add attributes"),height:40}));return ip().createElement(dp(),Np({anchorOrigin:d,transformOrigin:m},f),ip().createElement("div",{className:up()(y.container,r),style:{width:l}},"top"===o&&g,ip().createElement("div",{className:y.list},u),"bottom"===o&&g))},Dp=e=>{const t=e=>(0,O.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})))},kp=e=>e.titleItemIndex===e.index;var Lp=r(50166),Up=r(62515);const jp=(0,Sp.Z)({stickyTitlesWrapper:{position:"absolute",top:0,"& > div":{zIndex:1,position:"absolute",top:0,width:"100%",visibility:"hidden"}}}),Fp=({items:e,getItemSize:t,renderItem:r,renderGroupTitle:n,width:a="100%",height:i,fixedTitle:o=!0,itemKey:l=(e=>e),disableHorizontalScrollbar:s,hideSubtitles:c,focusIndex:u=null,onInnerContainerResize:p})=>{const d=jp(),m=(0,ap.useRef)(null),f=(0,ap.useRef)(null),y=(0,ap.useRef)(null),g=(0,ap.useRef)([0]),h={topMargin:0},E=(0,ap.useMemo)((()=>!c||(e||[]).some((e=>null!==e.titleItemIndex))),[e,c]),b=(0,ap.useCallback)((r=>{const n=g.current.length;let a=0;e.slice(n-1,r+1).forEach(((e,r)=>{const i=n+r-1;r>0&&(g.current[i]=g.current[i-1]+a),a=t(i,e.item)}))}),[t,e]),v=(0,ap.useCallback)((t=>e[t].titleItemIndex),[e]),T=(0,ap.useCallback)((t=>e[t]),[e]);(0,ap.useEffect)((()=>{requestAnimationFrame((()=>{m.current&&m.current.scrollTo(0)}))}),[e.length]),(0,ap.useEffect)((()=>{m.current&&m.current.resetAfterIndex(0),O();const r=(e=>{const r=e.findIndex((e=>e.item.moveTo));if(r>-1){b(r);const e=v(r);return{offset:g.current[r],titleHeight:t(e,T(e).item)}}})(e);if(r&&r.offset&&m.current){const{titleHeight:e}=r,t=r.offset-e;(t<m.current.state.scrollOffset||t>m.current.state.scrollOffset+i)&&requestAnimationFrame((()=>{m.current&&m.current.scrollTo(t-(i-e)/2)}))}}),[b,T,t,v,i,g,e,m]);const O=()=>{y.current&&f.current&&(y.current.style.width=f.current.offsetWidth+"px")},S=(0,ap.useCallback)((t=>{let r=null,n=0;return e.some(((e,a)=>{b(a+10);const i=g.current[a+1];return t>=n&&t<i&&(r={index:a,offset:n,listItem:e}),n=i,r})),r}),[b,g,e]),x=(0,ap.useCallback)((e=>t(e,T(e).item)),[T,t]),C=(0,ap.useCallback)((({index:e,style:t,data:a})=>{const i=T(e);return i.item&&(kp(i)&&n(t,i.item)||r(t,i.item,e,a))}),[T,n,r]),{handleOnItemsRendered:w}=(({focusIndex:e,listRef:t,items:r})=>{const n=(0,ap.useRef)(null),a=(0,ap.useRef)(null),i=(0,ap.useCallback)((({visibleStartIndex:e,visibleStopIndex:t})=>{n.current=e,a.current=t}),[]);return(0,ap.useEffect)((()=>{t.current&&null!==e&&0!==r.length&&(e<Math.max(n.current+3,0)?t.current.scrollToItem(Math.max(e-3,0),"start"):e>Math.min(a.current-3,r.length-1)&&t.current.scrollToItem(Math.min(e+3,r.length-1),"end"))}),[e,r.length,t]),{handleOnItemsRendered:i}})({items:e,focusIndex:u,listRef:m}),A=(0,ap.useCallback)((()=>e.filter((e=>kp(e))).map((e=>(e=>ip().createElement("div",{className:"stickyTitleItem",style:{visibility:"hidden"},"data-index":e.index,key:e.index},n({height:t(e.index,e.item)},e.item)))(e)))),[t,e,n]);return ip().createElement(ip().Fragment,null,ip().createElement("div",{ref:y,className:d.stickyTitlesWrapper},o&&A()),p&&f.current&&ip().createElement(Up.ZP,{handleHeight:!0,onResize:p,targetRef:f}),ip().createElement(Lp.VariableSizeList,{ref:m,itemCount:e.length,itemSize:x,width:a,height:i,itemKey:l,innerRef:f,onScroll:({scrollOffset:r,scrollDirection:n})=>{if(!o||!E)return;const a=S(r),i=a&&v(a.index);var l;null!==i&&(l=i,y.current&&[...y.current.querySelectorAll(".stickyTitleItem")].forEach((e=>{e.dataset.index===l.toString()?(e.style.visibility="visible",h.index=l):e.style.visibility="hidden"}))),O();const s=null!==i&&t(i,T(i).item),c=S(r+s+h.topMargin);let u=0;if(c){switch(n){case"forward":c.offset-r>0&&kp(c.listItem)&&(u=s-(c.offset-r));break;case"backward":{const t=i>-1&&(p=i,e.findIndex(((e,t)=>kp(e)&&p<t))),n=(e=>(b(e),g.current[e]))(t);t>-1&&r<n&&s>=n-r&&(u=s-(n-r))}}(e=>{y.current&&(h.topMargin=-e,y.current.style.top=-e+"px")})(u)}var p},style:s?{overflowX:"hidden"}:void 0,overscanCount:5,onItemsRendered:w},C))};Fp.propTypes={items:lp().arrayOf(lp().object).isRequired,getItemSize:lp().func.isRequired,renderItem:lp().func.isRequired,width:lp().oneOfType([lp().number,lp().string]),height:lp().number.isRequired,renderGroupTitle:lp().func,fixedTitle:lp().bool,hideSubtitles:lp().bool,itemKey:lp().func,disableHorizontalScrollbar:lp().bool,focusIndex:lp().number,onInnerContainerResize:lp().func};const Mp=({items:e,open:t,onSelectFocusedItem:r,selectedItems:n,onClose:a})=>{const[i,o]=(0,ap.useState)(null),l=(0,ap.useRef)(!1),s=(0,ap.useCallback)((t=>{let r=null===t?s(-1):t;for(;null!==t&&r<e.length&&(r<=t||r>=0&&kp(e[r]));)r+=1;return r!==e.length?r:s(-1)}),[e]),c=(0,ap.useCallback)((t=>{let r=null===t?e.length-1:t;for(;null!==t&&r>=0&&(r>=t||kp(e[r]));)r-=1;return r<0?e.length-1:r}),[e]),u=(0,ap.useCallback)((()=>{if(!(0,O.isNil)(i)){const t=e[i].item;!t.item.notSelectable&&r({item:t.item,groupData:t})}}),[r,e,i]),p=(0,ap.useCallback)((t=>{if(0!==e.length)switch(t.key){case"Down":case"ArrowDown":return o(s),t.preventDefault(),!1;case"Up":case"ArrowUp":return o(c),t.preventDefault(),!1;case"Enter":l.current=!0,u();break;case"Tab":a&&a(t);break;default:return}}),[e,s,c,u,a]);return(0,ap.useEffect)((()=>{if(l.current){l.current=!1;const t=e.findIndex((e=>e.item.moveTo));t>-1&&o(t)}else o(null)}),[e,t,n]),{focusIndex:i,handleKeyDown:p}};var Vp=r(85746),Bp=r.n(Vp),zp=r(22811),Hp=r.n(zp),Yp=r(93222),Wp=r.n(Yp);function Gp(){return Gp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Gp.apply(null,arguments)}function qp(){return qp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},qp.apply(null,arguments)}const Zp=e=>ip().createElement("svg",qp({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgNestedAttribute"},e),ip().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 $p(){return $p=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},$p.apply(null,arguments)}const Kp=e=>ip().createElement("svg",$p({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgReferenceAttribute"},e),ip().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 Xp(){return Xp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Xp.apply(null,arguments)}const Qp=e=>ip().createElement("svg",Xp({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgSimpleAttribute"},e),ip().createElement("rect",{fill:"#000",x:9,y:9,width:6,height:6,rx:1,stroke:"none",strokeWidth:1,fillRule:"evenodd"})),Jp=(0,Sp.Z)({icon:{opacity:.29,width:"16px",height:"16px",flexShrink:0,marginRight:"6px",marginLeft:"8px"}}),ed=({attrType:e={}})=>{const t=Jp(),r=(e=>{switch(e.type){case v.DataTypes.TYPE_IMAGE:case v.DataTypes.TYPE_NESTED:return Zp;case v.DataTypes.TYPE_REFERENCE:return Kp;default:return Qp}})(e);return ip().createElement(r,{className:t.icon})},td=(0,Sp.Z)({mark:{color:"red"}}),rd=()=>{const e=td();return ip().createElement("span",{className:e.mark},"*")},nd=({margin:e,level:t,className:r,children:n})=>null!=t?ip().createElement("div",{style:{marginLeft:t*e},className:r},n):n;var ad=r(1063),id=r(85740);const od=(0,Sp.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"}}),ld=(0,id.T)((e=>ip().createElement("svg",Gp({width:13,height:18,viewBox:"0 0 13 18",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgRecommended"},e),ip().createElement("g",{transform:"translate(-3 -1)",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},ip().createElement("path",{fill:"#FF4081",d:"M5.833 10h3.75v6.667l-3.75 1.666z"}),ip().createElement("path",{fill:"#CE0C4E",d:"M13.333 10v8.333l-3.75-1.666V10z"}),ip().createElement("circle",{fill:"#FFC058",cx:9.583,cy:7.917,r:6.25}),ip().createElement("circle",{fill:"#FFCD7B",cx:9.583,cy:7.917,r:5.417}),ip().createElement("path",{fill:"#FFFBB5",d:"M8.333 11.667L5 8.462l.933-.898 2.4 2.308L13.4 5l.933.897z"}))))),sd=({groupId:e,data:t,checked:r=!1,isFocused:n=!1,isRequired:a=!1,label:i,labelInText:o,level:l,onClick:s=O.identity,hideCheckBox:c=!1,hideIcon:u=!1,notSelectable:p=!1,disableHorizontalScrollbar:d=!1,style:m={},subItemMargin:f=20,LogoIcon:y,className:g,disableNonSelectable:h,disableGutters:E})=>{const b=od(),{attrType:T}=t||{},S=!(c&&(0,v.isNested)(T)||p),x=!!y;return ip().createElement(ad.Y,{value:o||i,className:b.itemTooltip,placement:"bottom-end"},ip().createElement(Wp(),{className:up()(b.container,b.listItem,{[b.defaultCursor]:!S},g),onClick:S?()=>s(t,!r,e):void 0,style:m,dense:!0,disabled:h&&p,classes:{focusVisible:b.listItemFocus,selected:b.listItemFocus},selected:n,tabIndex:-1,disableGutters:E},!c&&ip().createElement(Hp(),{checked:r,disableRipple:!0,disabled:!S,className:up()(b.checkbox,{[b.checked]:r}),tabIndex:-1}),ip().createElement(nd,{margin:f,level:l,className:b.marginWrapper},ip().createElement(ip().Fragment,null,!u&&(t=>"recommended"===e?ip().createElement(ld,{className:b.recommendedIcon,tooltipTitle:ei().text("Recommended"),showForDisabled:!0}):ip().createElement(ed,{attrType:t}))(T),ip().createElement("div",{className:up()(b.itemTextWrapper,{[b.marginText]:u})},x&&ip().createElement(y,{className:b.logoIcon}),ip().createElement(Bp(),{primary:ip().createElement(ip().Fragment,null,i,a&&ip().createElement(rd,null)),className:b.itemText})))),S&&d&&ip().createElement("div",{className:b.itemAfter})))};sd.defaultName="AttributeListItem";const cd=(0,ap.memo)(sd);var ud=r(49940);const pd=(0,Sp.Z)({popupContainer:{},container:{"&$popupContainer":{height:"408px",minWidth:"200px"}}});function dd(){return dd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},dd.apply(null,arguments)}function md(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){fd(e,t,r[t])}))}return e}function fd(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const yd=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.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,ap.useCallback)((e=>e.label.toLowerCase().includes(l.toLowerCase())),[l]),f=(0,ap.useCallback)((e=>m(e)||(e.children||[]).some(f)),[m]),y=(0,ap.useMemo)((()=>{const e=(0,O.curry)(((e,r,n,a)=>[{item:md({},r,{filterText:l}),level:e,groupId:n,groupName:a},...t(r.children||[],n,a,e+1)])),t=(t,r,n,a=0)=>{const i=t.filter(f);return(p?O.map:O.chain)((t=>e(a,t,r,n)),i)};return t}),[l,p,f]),g=(0,ap.useCallback)((e=>e.map((e=>({item:e,items:y(e.attributes,e.id,e.label)}))).filter((e=>e.items.length))),[y]),h=(0,ap.useCallback)((({item:e})=>{s(e,!c.find((t=>t.id===e.id||t.id.includes(`${e.id}.`))))}),[s,c]),E=(0,ap.useMemo)((()=>(p?g:y)(n)),[n,p,g,y]),b=(0,ap.useMemo)((()=>Dp(E)),[E]),{focusIndex:T,handleKeyDown:S}=Mp({items:b,open:t,onSelectFocusedItem:h,selectedItems:c}),x=(0,ap.useRef)(null);x.current=T;const C=(0,ap.useCallback)(((e,{item:t,level:r=0},n)=>{const a=!!c.find((e=>e.id===t.id||e.id.includes(`${t.id}.`))),i=x.current===n;return ip().createElement(cd,{key:t.id,onClick:s,checked:a,level:r,data:t,label:ip().createElement(ud.o,{text:t.label,highlight:t.filterText}),labelInText:t.label,style:e,hideCheckBox:u,isFocused:i,notSelectable:t.notSelectable,LogoIcon:t.LogoIcon})}),[u,s,c]),w=(0,v.getMaxItemWidth)("label")(E)||308,A=pd();return ip().createElement(Pp,dd({open:t,className:up()(A.container,A.popupContainer),anchorEl:r,onClose:i,onSearch:a,title:o,containerWidth:w,searchInputOnKeyDown:S},d),ip().createElement(Fp,{height:300,renderItem:C,items:b,hideSubtitles:!0,getItemSize:()=>32,containerWidth:w,focusIndex:T,renderGroupTitle:p}))};yd.propTypes={open:lp().bool,hideCheckBox:lp().bool,anchorEl:lp().any,selected:lp().array,data:lp().array,filterText:lp().string,titleText:lp().string,onClose:lp().func,onListItemClick:lp().func,onSearch:lp().func,renderGroupTitle:lp().func},yd.defaultProps={data:[],selected:[],titleText:ei().text("Show/hide columns"),filterText:""};var gd=r(97179);function hd(){return hd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hd.apply(null,arguments)}const Ed=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return ip().createElement("svg",hd({width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},r),ip().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",opacity:".54"},ip().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"})))},bd="Headers-styles-container--Zbdka",vd="Headers-styles-actionsBar--RXMy4",Td="Headers-styles-previewSwitcher--Ppqem";function Od(){return Od=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Od.apply(null,arguments)}const Sd=e=>{let{entityTypeUri:t,headColumns:r=[],onSelectColumns:n=O.identity}=e,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["entityTypeUri","headColumns","onSelectColumns"]);const[i,o]=(0,ap.useState)(null),[l,s]=(0,ap.useState)(""),c=(0,sp.useSelector)(A().selectors.getMetadata),u=()=>{o(null),s("")},p=(0,ap.useCallback)(((e,a)=>{const i=(0,vi.kF)(c,t),o=(0,vi.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 ip().createElement(ip().Fragment,null,ip().createElement(gd.k,Od({tooltipTitle:ei().text("Show/hide columns"),size:"M",icon:Ed,onClick:e=>o(e.currentTarget),className:"Headers-styles-headerIcon--c2qe7"},a)),(()=>{const e=(0,vi.kF)(c,t);return ip().createElement(yd,{open:!!i,anchorEl:i,data:e,onListItemClick:p,selected:r,filterText:l,onClose:u,onSearch:s})})())};Sd.propTypes={entityTypeUri:lp().string,headColumns:lp().array,onSelectColumns:lp().func};const xd=Sd;var Cd=r(45053),wd=r(72897),Ad=r(27618),Rd=r.n(Ad),_d=r(98515),Id=r.n(_d),Nd=r(29289);const Pd=({headCellData:e,headIndex:t,sortOrder:r,sortField:n,sortHandler:a,canCheck:i,onCheck:o,headerCheckboxState:l,openConfigColumnPopup:s})=>ip().createElement("div",{className:up()("HeadCellRenderer-styles-headCellContentWrapper--L6RrQ",(0,O.path)(["wrapperClassName"],e))},e&&i&&ip().createElement(Hp(),{className:"HeadCellRenderer-styles-checkbox--qQEHg",checked:l||!1,indeterminate:null===l,onChange:()=>o()}),ip().createElement("div",{className:"HeadCellRenderer-styles-labelWrapper--cmclk"},e&&(e.sortable?ip().createElement(Rd(),{active:Boolean(r&&n===e.id),direction:r,onClick:a,classes:{root:"HeadCellRenderer-styles-sortLabel--NZx3o"},component:"div"},e.label):e.label)),s&&ip().createElement("div",{className:"HeadCellRenderer-styles-menuButtonWrapper--aBNeR"},ip().createElement(Op.T,{icon:Id(),onClick:s,size:"S","data-column-index":t})));Pd.propTypes={headCellData:lp().shape({id:lp().string,label:lp().oneOfType([lp().string,lp().node]),sortable:lp().bool}),headIndex:lp().number,sortOrder:lp().string,sortField:lp().string,sortHandler:lp().func,canCheck:lp().bool,onCheck:lp().func,headerCheckboxState:lp().oneOf([!0,!1,null]),openConfigColumnPopup:lp().func};const Dd=(0,Nd.q)((0,O.pick)(["openConfigColumnPopup"]))(Pd),kd=(0,Nd.q)((0,O.pick)(["openConfigColumnPopup","canCheck","onCheck","headerCheckboxState"]))(Pd);var Ld=r(16778);const Ud={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"},jd=({value:e={}})=>{const t=(0,v.getLabel)(e.label);return ip().createElement("div",{className:up()(Ud.defaultWrapper,Ud.profileWrapper)},ip().createElement(b.A,{avatarClassName:Ud.entityAvatar,imageClassName:Ud.entityAvatarImage,entity:e}),ip().createElement(Ld.x,{value:(0,v.getEntityUriForLink)(e),className:Ud.entityLabel},t))};jd.propTypes={value:lp().object};const Fd=jd;var Md=r(56755);const Vd=({value:e,columnData:{dataTypeDefinition:t}})=>ip().createElement("div",{className:Ud.defaultWrapper},t?ip().createElement(Md.x,{value:e,dataTypeDefinition:t}):e);Vd.propTypes={value:lp().any,columnData:lp().object};const Bd=Vd,zd=(e,t,r)=>{const n=(0,v.getEntityTypeGraphIcon)(e,{type:t});return(0,v.getAbsoluteImageUrl)(r,n)};var Hd=r(55743),Yd=r.n(Hd);let Wd=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 Gd(){return Gd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Gd.apply(null,arguments)}const qd=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","icon","avatarText","rootClasses"]);const[o,l]=(0,ap.useState)(null);(0,ap.useEffect)((()=>{l(r?Wd.ICON_MODE:Wd.TEXT_MODE)}),[r,n]);const s=()=>{l(Wd.ERROR_MODE)};switch(o){case Wd.ICON_MODE:return ip().createElement(Yd(),Gd({className:up()(t,null==a?void 0:a.iconRoot),src:r,onError:s},i));case Wd.TEXT_MODE:case Wd.ERROR_MODE:return ip().createElement(Yd(),Gd({className:up()(t,null==a?void 0:a.textRoot)},i),n);default:return null}},Zd=({value:e})=>{const t=(0,sp.useSelector)(A().selectors.getMetadata),r=(0,sp.useSelector)(A().selectors.getApiPath),n=(0,sp.useSelector)(A().selectors.getImagePath);return e&&ip().createElement("div",{className:up()(Ud.defaultWrapper,Ud.referenceWrapper)},ip().createElement(qd,{className:Ud.referenceIcon,icon:zd(t,e.refEntity.type,n||r)}),ip().createElement(Ld.x,{value:e.refEntity.objectURI,className:Ud.referenceContent},(0,v.getLabel)(e.label)))};Zd.propTypes={value:lp().object};const $d=Zd,Kd=e=>{e.stopPropagation()},Xd=e=>{const{value:t}=e;return ip().createElement("div",{className:Ud.blobWrapper,onScroll:Kd},t)};Xd.propTypes={value:lp().any};const Qd=Xd,Jd=({value:e})=>{const t=(0,v.getImageAttributeOvThumbnailUrl)({value:e});return t&&ip().createElement("div",{className:Ud.imageWrapper},ip().createElement("img",{src:t}))};Jd.propTypes={value:lp().object};const em=Jd,tm=e=>{if("label"===e.id)return Fd;switch((0,O.path)(["attrType","type"],e)){case"Reference":return $d;case"Blob":return Qd;case"Image":return em}return Bd};function rm(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){nm(e,t,r[t])}))}return e}function nm(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const am=(0,O.split)("."),im=["entityId"],om=e=>!im.includes(e.id),lm=e=>{if((0,v.isAttributeSearchUri)(e)){const[,...t]=am(e);return t.length>1?t.slice(0,-1):null}return null};var sm=r(39034),cm=r(57526),um=r.n(cm),pm=r(18567),dm=r.n(pm),mm=r(99272),fm=r.n(mm);const ym=(0,Sp.Z)({root:{display:"flex",alignItems:"center",justifyContent:"center",width:"24px",height:"24px"},check:{color:"#8CC152"}}),gm=({classes:e={},tooltip:t="",onClick:r=O.identity,mode:n=sm.Eh.Init})=>{const a=ym();return ip().createElement("div",{className:up()(a.root,e.root)},(()=>{switch(n){case sm.Eh.Init:return ip().createElement(gd.k,{className:e.button,size:"M",tooltipTitle:t,icon:dm(),onClick:r});case sm.Eh.Progress:return ip().createElement(um(),{className:e.spinner,size:24});case sm.Eh.Success:return ip().createElement(fm(),{className:up()(a.check,e.check)});default:return null}})())};function hm(){return hm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hm.apply(null,arguments)}const Em=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["entity","importStatus","onImportStatusChange","hideDelay"]);const o=(0,sp.useSelector)(A().selectors.getDtssPath),l=(0,sp.useSelector)(A().selectors.getTenant);return ip().createElement(gm,hm({},i,{mode:r,tooltip:ei().text("Import this record"),onClick:e=>{e.stopPropagation(),n(sm.Eh.Progress),(0,v.importEntityFromDataTenant)({dtssPath:o,customerTenant:l,entity:t}).then((({success:e,uris:r})=>{if(!e)throw new Error("Failed to import entity");t.ctSubscribedUris=r,n(sm.Eh.Success),setTimeout((()=>n(sm.Eh.Done)),a)})).catch((()=>{n(sm.Eh.Init),(0,Qa.U)(undefined,{title:ei().text("Import Error"),message:ei().text("Record can't be imported")})}))}}))},bm=(0,Sp.Z)({importButtonPlaceholder:{display:"flex",alignItems:"center",padding:"0 10px",width:"24px",flexShrink:0,position:"relative"}}),vm=({entity:e,entityImportStatus:t,onEntityImportStatusChange:r})=>{const n=bm(),a=(0,sp.useSelector)(A().selectors.getMetadata),i=(0,sp.useSelector)(A().selectors.getCanUserImportEntitiesFromDT),o=(0,v.isDataTenantEntity)(e)&&i,l=(0,v.getEntityType)(a,e.type),s=(0,v.checkCanImportEntityOfType)(l)&&!(0,v.isEntityImportedToCT)(e),c=t&&t!==sm.Eh.Done||s;return ip().createElement(ip().Fragment,null,o&&ip().createElement("div",{className:n.importButtonPlaceholder},c&&ip().createElement(Em,{entity:e,importStatus:t,onImportStatusChange:t=>r(e.uri,t)})))},Tm=({entity:e,isSelectedEntity:t,isHighlightedEntity:r,entityImportStatus:n,onEntityImportStatusChange:a})=>ip().createElement("div",{className:up()(Ud.entityButtons,{[Ud.selectedEntityButtons]:t,[Ud.justImportedEntityButtons]:n===sm.Eh.Success,[Ud.highlightedEntityButtons]:r})},ip().createElement(vm,{entity:e,entityImportStatus:n,onEntityImportStatusChange:a}));Tm.propTypes={entity:lp().object,isSelectedEntity:lp().bool,isHighlightedEntity:lp().bool,entityImportStatus:lp().oneOf(Object.values(sm.Eh)),onEntityImportStatusChange:lp().func};const Om=(0,Nd.q)((({entitiesImportStatus:e,onEntityImportStatusChange:t,selectedEntityUri:r,highlightedEntityIndex:n},{entity:a,rowIndex:i})=>({entityImportStatus:a&&e[a.uri],onEntityImportStatusChange:t,isSelectedEntity:r===a.uri,isHighlightedEntity:n===i})))(Tm);var Sm=r(72326),xm=r(67655);function Cm(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){wm(e,t,r[t])}))}return e}function wm(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Am={height:"100%",display:"flex",flexDirection:"column"},Rm=(0,Sp.Z)((e=>({inactiveCell:Cm({background:e.inactiveBackground},Am,{"&$selectedRowCell":{background:e.inactiveSelectedBackground}}),selectedRowCell:Cm({background:(0,xm.lighten)(e.palette.primary.main,.88)},Am),clickable:Cm({cursor:"pointer"},Am),justImported:Cm({backgroundColor:"#FFFBEB !important"},Am)}))),_m={entity:lp().object,isSelected:lp().bool,onEntityClick:lp().func,isJustImported:lp().bool},Im=(0,Sp.Z)({checkboxWrapper:{display:"flex",alignItems:"center"},checkbox:{marginRight:"-8px",marginLeft:"11px"}}),Nm={onCheck:lp().func,isChecked:lp().bool,hasCheckbox:lp().bool},Pm=(0,Sp.Z)({collapser:{marginLeft:"-2px"}});var Dm=r(18021),km=r(8835),Lm=r.n(km);const Um=(0,Sp.Z)({collapseButton:{cursor:"pointer"},expandLess:{transform:"rotate( -180deg )"}});function jm(){return jm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},jm.apply(null,arguments)}const Fm=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["isOpen","tooltipTitle"]);const a=Um(),i={icon:Lm(),className:a.collapseButton,iconClassName:up()({[a.expandLess]:t})},o={tooltipTitle:r};return ip().createElement(gd.k,jm({"data-reltio-id":"collapse-button"},i,o,n))},Mm=(0,Sp.Z)((()=>({hidden:{visibility:"hidden"}}))),Vm=({rowIndex:e,rowValue:t,className:r})=>{const n=Mm(),{toggleRowCollapse:a,getIsRowCollapsible:i,getIsRowCollapsed:o}=(0,ap.useContext)(Dm.x),l=i(t),s=o(e);return ip().createElement(Fm,{className:up()(r,{[n.hidden]:!l}),isOpen:!s,onClick:t=>{a(e),t.stopPropagation()}})},Bm={hasCollapseButton:lp().bool},zm=(0,O.pipe)((e=>{const t=t=>{const r=Pm(),{hasCollapseButton:n}=t,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(t,["hasCollapseButton"]),{rowValue:i,rowIndex:o}=a;return n?ip().createElement("div",{className:"cellWithCollapser"},ip().createElement(Vm,{className:r.collapser,rowIndex:o,rowValue:i}),ip().createElement(e,a)):ip().createElement(e,a)};return t.propTypes=Bm,t}),(e=>{const t=t=>{const r=Im(),{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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(t,["onCheck","isChecked","hasCheckbox"]),{rowValue:{rawValue:l}}=o;return i?ip().createElement("div",{className:up()(r.checkboxWrapper,"cellWithCheckbox")},ip().createElement(Hp(),{className:r.checkbox,checked:a,onClick:e=>e.stopPropagation(),onChange:e=>n(l.uri,e.target.checked)}),ip().createElement(e,o)):ip().createElement(e,o)};return t.propTypes=Nm,t}),(e=>{const t=t=>{const r=Rm(),{rowValue:{rawValue:n},isSelected:a,onEntityClick:i,isJustImported:o}=t,l=i?()=>i(n.uri):void 0,s=n&&!(0,v.isActiveObject)(n);return l||s||a||o?ip().createElement("div",{className:up()({[r.inactiveCell]:s},{inactiveCell:s},{[r.selectedRowCell]:a},{selectedRowCell:a},{[r.clickable]:!!l},{[r.justImported]:o},{justImported:o}),onClick:l},ip().createElement(e,t)):ip().createElement(e,t)};return t.propTypes=_m,t}),(0,Nd.q)((({onEntityClick:e,selectedEntityUri:t,entitiesImportStatus:r,canCheck:n,onCheck:a,checkedEntitiesUris:i},{rowValue:o,columnIndex:l})=>{const{rawValue:s}=o,c=0===l;return{onCheck:a,isChecked:i&&i.includes(s.uri),hasCheckbox:n&&c,hasCollapseButton:c,isSelected:t===s.uri,isJustImported:r[s.uri]===sm.Eh.Success,onEntityClick:e}})))(Sm.DN),Hm=({columnData:e,cell:t})=>{const r=t.values.length,n=28*Math.max(r,1)+20;if(!r)return n;switch((0,O.path)(["dataTypeDefinition","type"],e)){case"Reference":return 28*r+17;case"Blob":return 100*r;case"Image":return 76*r+17;default:return n}},Ym=(0,ap.forwardRef)((({headColumns:e,entities:t,entityToHighlight:r,selectedEntityUri:n,onReorderingColumn:a,dndColumnReorderingEnabled:i,columnsSize:o,onChangeColumnsSize:l,onScroll:s,onSort:c,sortField:u,sortOrder:p,onEntityHover:d,onEntityClick:m,entitiesImportStatus:f,onEntityImportStatusChange:y,logger:g,canCheck:h,checkedEntitiesUris:E,headerCheckboxState:b,onCheck:T,openConfigColumnPopup:S,resizeDebounceDelay:x},C)=>{const w=(0,ap.useMemo)((()=>({highlightRow:"highlightedSelector",dragColumnHead:Ud.dragColumnHead,dragColumnBody:Ud.dragColumnBody,draggableHeadCell:Ud.draggableHeadCell,cellWrapper:Ud.cellWrapper})),[]),R=(0,sp.useSelector)(A().selectors.getMetadata),[_,I]=(0,ap.useState)(null),N=(0,ap.useCallback)((e=>{I(e),d&&d((0,O.path)([e,"uri"],t))}),[d,t]),P=(0,ap.useRef)();(0,ap.useImperativeHandle)(C,(()=>({resetScrollbarPosition:()=>{P.current&&P.current.resetScrollbarPosition({resetLeft:!1})}})));const D=(0,ap.useCallback)((e=>{p&&e===u?p===Cd.oy?c({field:e,order:Cd.U9}):c({field:e}):c({field:e,order:Cd.oy})}),[c,u,p]),k=(0,ap.useCallback)((e=>{const r=(0,O.prop)(e,t);return r?ip().createElement(Om,{entity:r,rowIndex:e}):null}),[t]),L=(0,ap.useCallback)((e=>ip().createElement(zm,e)),[]),U=!!d,j=!!c,F=(0,ap.useMemo)((()=>((e,t=!0)=>e.map(((e,r)=>{let{attrType:n}=e,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attrType"]);const i=0===r;return rm({},a,{dataTypeDefinition:n&&(0,v.getAttrDataTypeDefinition)(n),resizable:!0,autoResize:a.autoResize??!i,draggable:!i,sortable:t&&om(a),nestedPath:lm(a.id),headCellRenderer:i?kd:Dd,rowCellValueRenderer:tm(rm({},a,{attrType:n}))})})))(e,j)),[e,j]),M=(0,ap.useMemo)((()=>((e,t,r)=>(r||[]).map((e=>(0,O.pipe)((0,O.reduce)(((t,r)=>(0,O.assoc)(r.id,((e,t,r)=>{switch(t.id){case"label":return r;case"entityId":return(0,v.getEntityId)(r);default:{const[e,...n]=am(t.id);return(0,O.pipe)((0,O.prop)(e),(0,v.getOvAttributeValuesByPath)(n))(r)}}})(0,r,e),t)),{}),(0,O.assoc)("rawValue",e))(t))))(0,e,t)),[R,e,t]),V=r?t.findIndex((0,O.propEq)("uri",r)):-1,B=(0,ap.useMemo)((()=>({onEntityClick:m,selectedEntityUri:n,highlightedEntityIndex:V,entitiesImportStatus:f,onEntityImportStatusChange:y,canCheck:h,checkedEntitiesUris:E,headerCheckboxState:b,onCheck:T,openConfigColumnPopup:S})),[E,f,b,V,h,T,m,y,n,S]);return ip().createElement(wd.M,{fixFirstColumn:!0,onScroll:s,rowsData:M,columnsData:F,onSort:D,highlightRow:-1!==V?V:null,ref:P,sortFieldClassName:Ud.sortableCell,containerClassName:Ud.table,classes:w,defaultColumnWidth:250,headRowHeight:50,defaultColumnMinWidth:100,defaultRowHeight:48,sorting:{field:u,order:p},dndColumnReorderingHandler:a,dndColumnReorderingEnabled:i,onChangeColumnsSize:l,columnsSize:o,resizeDebounceDelay:x??150,onRowHover:U?N:void 0,hoverStateEnabled:U,hoverRowIndex:_,renderRowOverlay:k,logger:g,context:B,maxRowValuesCount:2,renderRowCell:L,getRowCellHeight:Hm})}));Ym.propTypes={entities:lp().array,entityToHighlight:lp().string,selectedEntityUri:lp().string,headColumns:lp().array,columnsSize:lp().array,onScroll:lp().func,onSort:lp().func,onReorderingColumn:lp().func,onChangeColumnsSize:lp().func,dndColumnReorderingEnabled:lp().bool,onEntityClick:lp().func,onEntityHover:lp().func,sortField:lp().string,sortOrder:lp().oneOf([Cd.oy,Cd.U9]),entitiesImportStatus:lp().object,onEntityImportStatusChange:lp().func,logger:lp().func,canCheck:lp().bool,checkedEntitiesUris:lp().arrayOf(lp().string),headerCheckboxState:lp().oneOf([!0,!1,null]),onCheck:lp().func,openConfigColumnPopup:lp().func,resizeDebounceDelay:lp().number},Ym.defaultProps={entities:[],headColumns:[]},Ym.displayName="EntitiesTable";const Wm=(0,ap.memo)(Ym);var Gm=r(4437),qm=r.n(Gm),Zm=r(5106),$m=r.n(Zm);const Km="left",Xm="right",Qm="hide",Jm={[Km]:ei().text("Insert 1 left"),[Xm]:ei().text("Insert 1 right"),[Qm]:ei().text("Hide column")},ef=({open:e,anchorEl:t,onClick:r,onClose:n,actions:a})=>ip().createElement(dp(),{open:e,anchorEl:t,onClose:n},ip().createElement(qm(),{component:"div"},a.map(((e,t)=>((e,t,r)=>ip().createElement($m(),{button:!0,component:"div",key:r,onClick:t},ip().createElement(Bp(),{primary:Jm[e],primaryTypographyProps:{variant:"body2"}})))(e,(e=>()=>{r(e)})(e),t)))));ef.propTypes={open:lp().bool,anchorEl:lp().any,onClick:lp().func,onClose:lp().func,actions:lp().array};const tf=ef;class rf extends ip().PureComponent{constructor(...e){super(...e),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=({newColumnPlaceIndex:e})=>{this.setState({newColumnPlaceIndex:e,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 Km:this.openAddColumnPopup({newColumnPlaceIndex:t});break;case Xm:this.openAddColumnPopup({newColumnPlaceIndex:t+1});break;case Qm: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,v.memoizeWith)(rf.getMemoIdForColumnSize,rf.getColumnSizeFromHeadColumns)}static getColumnSizeFromHeadColumns(e){return e.map((e=>({id:e.id,size:e.size})))}static getMemoIdForColumnSize(e,t){return`${t}${(0,O.toString)(e.map((e=>(0,O.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:f,onChangeColumnsSize:y,entityTypeUri:g,entitiesImportStatus:h={},onEntityImportStatusChange:E,logger:b,canCheck:v,checkedEntitiesUris:T,headerCheckboxState:O,onCheck:S,resizeDebounceDelay:x}=this.props,{addColumnPopupOpen:C,configColumnPopupOpen:w,popupAnchor:A,filterText:R,configurableColumnIndex:_}=this.state,I=this.memoizedGetColumnSize(a,g);return ip().createElement(ip().Fragment,null,ip().createElement(Wm,{entities:e,entityToHighlight:t,selectedEntityUri:r,onScroll:n,onSort:f,onEntityClick:s,onEntityHover:c,headColumns:a,sortField:i,sortOrder:o,onReorderingColumn:m,ref:u,onChangeColumnsList:d,dndColumnReorderingEnabled:l,onChangeColumnsSize:y,columnsSize:I,entitiesImportStatus:h,onEntityImportStatusChange:E,logger:b,canCheck:v,checkedEntitiesUris:T,headerCheckboxState:O,onCheck:S,openConfigColumnPopup:this.openConfigColumnPopup,resizeDebounceDelay:x}),ip().createElement(yd,{open:C,anchorEl:A,data:p,onListItemClick:this.addColumnHandler,filterText:R,onClose:this.closeAddColumnPopup,onSearch:this.setFilterText,hideCheckBox:!0,titleText:Ja.text("Add column")}),ip().createElement(tf,{onClick:this.configColumnHandler,onClose:this.closeConfigColumnPopup,anchorEl:A,open:w,actions:_>0?[Km,Xm,Qm]:[Xm]}))}}rf.propTypes={entities:lp().array,entityToHighlight:lp().string,selectedEntityUri:lp().string,entityTypeUri:lp().string,headColumns:lp().array,dndColumnReorderingEnabled:lp().bool,onScroll:lp().func,onSort:lp().func,onReorderingColumn:lp().func,onChangeColumnsSize:lp().func,onChangeColumnsList:lp().func,onEntityClick:lp().func,onEntityHover:lp().func,sortField:lp().string,sortOrder:lp().oneOf([Cd.oy,Cd.U9]),entitiesTableRef:lp().shape({current:lp().shape({resetScrollbarPosition:lp().func})}),additionalColumns:lp().arrayOf(lp().shape({id:lp().string,label:lp().string})),entitiesImportStatus:lp().object,onEntityImportStatusChange:lp().func,logger:lp().func,canCheck:lp().bool,checkedEntitiesUris:lp().arrayOf(lp().string),headerCheckboxState:lp().oneOf([!0,!1,null]),onCheck:lp().func};const nf=rf;var af=r(66780),of=r(9366),lf=r(41633),sf=r(79881),cf=r.n(sf),uf=r(93962),pf=r.n(uf),df=r(45995),mf=r.n(df);function ff(){return ff=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ff.apply(null,arguments)}const yf=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["open","children"]);const[a,i]=(0,ap.useState)(t),o=(0,xm.useTheme)().transitions.duration.leavingScreen;return(0,ap.useEffect)((()=>{if(t!==a){if(!t){const e=setTimeout((()=>{i(!1)}),o);return()=>clearTimeout(e)}i(!0)}}),[t,o,a]),ip().createElement(mf(),ff({open:t},n),a&&r)};yf.displayName="Drawer";var gf=r(18759),hf=r.n(gf),Ef=r(30122),bf=r.n(Ef),vf=r(43410),Tf=r.n(vf),Of=r(93416),Sf=r.n(Of),xf=r(66825),Cf=r.n(xf),wf=r(17698);const Af=(0,O.allPass)([(0,O.propSatisfies)(O.isEmpty,"configs"),(0,O.pathEq)(["group","hasCollapseButton"],!0)]),Rf=(0,O.reject)(Af),_f=(0,Sp.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"}}),If=({title:e="",iconSrc:t="",isOpen:r=!0,hasCollapseButton:n=!0,leftIcon:a,onCollapse:i})=>{const o=_f();return ip().createElement("div",{className:o.titleBox},ip().createElement("div",{className:o.title},a&&ip().createElement("div",{className:o.leftIcon},a),t&&ip().createElement(Yd(),{src:t,className:o.avatar}),ip().createElement(ad.Y,{value:e},ip().createElement("span",{className:o.text},e))),n&&ip().createElement(Fm,{isOpen:r,onClick:i,className:o.collapseIcon,size:"S"}))};var Nf=r(1230),Pf=r.n(Nf),Df=r(36631);const kf=({facet:e,selectedFacets:t})=>!!t.find((t=>t.fieldName===e.fieldName||t.fieldName.includes(`${e.fieldName}.`))),Lf=({facet:e,selectedFacets:t})=>kf({facet:e,selectedFacets:t})||(0,x.OP)(e)&&e.children&&e.children.some((e=>kf({facet:e,selectedFacets:t})));var Uf=r(13639);const jf=(0,Sp.Z)({icon:{maxHeight:"25px",maxWidth:"25px",marginRight:"16px"}}),Ff=({group:e,metadata:t})=>{const r=jf(),n=(0,Uf.$H)(),a=(0,v.getEntityTypeGraphIcon)(t,{type:e.id}),i=(0,v.getAbsoluteImageUrl)(n,a);return ip().createElement(qd,{className:r.icon,icon:i,avatarText:e.title[0]})};function Mf(){return Mf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Mf.apply(null,arguments)}const Vf=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["onListItemClick","focusIndex","selectedFacets","metadata"]);const o=(0,ap.useRef)(null);o.current=n;const l=(0,ap.useRef)(null);l.current=r;const s=(0,ap.useCallback)(((e,{item:r,level:n,groupId:a},i)=>{const s=Lf({facet:r,selectedFacets:o.current}),c=l.current===i;return ip().createElement(cd,{key:`item-${a}-${r.fieldName}`,onClick:t,data:r,label:ip().createElement(ud.o,{text:r.title,highlight:r.filterText}),labelInText:r.title,level:n,style:e,checked:s,isFocused:c,groupId:a,LogoIcon:r.LogoIcon})}),[t]),c=(0,ap.useCallback)(((e,t)=>ip().createElement($m(),{component:"div",className:"MoreFacetsPopup-styles-subHeader--h1vGz",style:e,key:`group-${t.item.id}`},t.item.needGroupIcon&&ip().createElement(Ff,{metadata:a,group:t.item}),t.item.title)),[a]),u=(0,ap.useCallback)(((e,t)=>t.items?40:28),[]);return ip().createElement(Fp,Mf({getItemSize:u,renderGroupTitle:c,renderItem:s,focusIndex:r},i,{disableHorizontalScrollbar:!0}))};function Bf(){return Bf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Bf.apply(null,arguments)}const zf=574,Hf={},Yf=e=>{let{metadata:t,open:r,selectedFacets:n,data:a=[],onListItemClick:i,lastFacetClicked:o=Hf,width:l,height:s=zf}=e,c=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["metadata","open","selectedFacets","data","onListItemClick","lastFacetClicked","width","height"]);const[u,p]=(0,ap.useState)(464),d=s-110;(0,ap.useEffect)((()=>{p(d)}),[d]);const m=(0,ap.useCallback)(((e,t)=>p((0,O.clamp)(56,d,t))),[d]),f=(0,ap.useRef)();(0,ap.useEffect)((()=>{const e=(0,O.path)(["current","updatePosition"],f);e&&e()}),[u]);const y=(0,ap.useCallback)(((e,t,r=0)=>[{type:"item",item:e,moveTo:(0,O.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]),g=(0,ap.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,ap.useMemo)((()=>g(a)),[a,g]),E=(0,ap.useMemo)((()=>(0,ri.LG)(h)),[h]),b=(0,ap.useCallback)((({item:e,groupData:t})=>{i(e,!Lf({facet:e,selectedFacets:n}),t.groupId)}),[i,n]),{focusIndex:T,handleKeyDown:S}=Mp({items:E,open:r,onSelectFocusedItem:b,selectedItems:n}),x=Math.max(l||(0,v.getMaxItemWidth)("title")(h),240);return ip().createElement(Pp,Bf({open:r,action:f,title:ei().text("Select attribute"),containerWidth:x,searchInputOnKeyDown:S,containerHeight:110+u},c),ip().createElement(Vf,{focusIndex:T,selectedFacets:n,onListItemClick:i,metadata:t,items:E,height:u,onInnerContainerResize:m}),0===E.length&&ip().createElement("div",{className:"MoreFacetsPopup-styles-noResultsCaptionContainer--ChfND"},ip().createElement(hf(),{variant:"caption",display:"block",gutterBottom:!0},ei().text("No results found"))))};function Wf(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Gf=(0,O.curry)(((e,t)=>{const r=(0,v.getAttrTypeUrisHavingMasking)(e);return 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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Wf(e,t,r[t])}))}return e}({},e,{facets:e.facets.map((e=>(0,v.filterMaskedFromGroup)(r,e))).filter(O.identity)})))}));function qf(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Zf(e,t,r[t])}))}return e}function Zf(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class $f extends ap.PureComponent{constructor(e){super(e),this.state={filterText:"",lastFacetClicked:null,addedFacets:[]},this.searchInputRootRef=ip().createRef(),this.showSearchInput=()=>this.searchInputRootRef.current.scrollIntoView(!0),this.openPopup=()=>this.props.dispatch(li(!0)),this.closePopup=()=>{this.props.dispatch(li(!1)),this.props.dispatch(((e=[])=>({type:R.k.HIGHLIGHT_ADDED_FACETS,payload:e}))(this.state.addedFacets)),this.setState({addedFacets:[]}),setTimeout((()=>{this.props.dispatch({type:R.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=>qf({},e,{hide:!this.filterItemsTree(e),filterText:this.state.filterText}))).map((e=>{const t=this.getFilteredFacets(e.children);return(0,O.isEmpty)(t)?e:qf({},e,{children:t})})),this.filterItemsInGroups=e=>e.map((e=>qf({},e,{facets:this.getFilteredFacets(e.facets)}))),this.rejectNotAllowedEntityTypes=e=>t=>t.filter((({id:t})=>!(0,v.isEntityTypeUri)(t)||e.includes(t))),this.toggleSelectedFacet=(e,t)=>{const{facetsConfigs:r,selectedEntityTypes:n,dispatch:a}=this.props,i=(0,ri.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,O.uniq)(o.filter((e=>e.entityTypeUri)).map((e=>e.entityTypeUri)).concat(n)),s=o.filter((0,O.complement)(x.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,O.prop)("fieldName")),u),a($a({facetsToAdd:c,fieldNamesToDelete:u,changedEntityTypes:(0,O.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,Df.Z)(x.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,O.pipe)((0,O.when)((0,O.always)(e),this.filterItemsInGroups),(0,O.when)((0,O.always)(c),this.rejectNotAllowedEntityTypes(c)),(0,I.Eb)(s),Gf(i))(d),{verticalOrigin:f,popupHeight:y}=((e,t,r=16)=>{let 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,zf),g={vertical:f,horizontal:"right"};return ip().createElement(ap.Fragment,null,ip().createElement(_p,{classes:{root:a.inputContainer},onSearch:this.setFilterText,onFocus:this.handleInputFocus,rootRef:this.searchInputRootRef,value:e,placeholder:ei().text("Search & add attributes"),height:40,"data-reltio-id":"reltio-search-more-facets-search-input"}),ip().createElement(Yf,{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"===f?"bottom":"top",anchorOrigin:g,transformOrigin:g,disableRestoreFocus:!0}))}}$f.defaultProps={selectedEntityTypes:[],facetsConfigs:[]};const Kf=(0,sp.connect)((e=>({metadata:A().selectors.getMetadata(e),open:(0,Ti.ds)(e),facetsConfigs:(0,C.Mp)(e),recommendedFacets:(0,C.ER)(e),selectedEntityTypes:(0,C.DX)(e),dataTenantObject:(0,Xa.t9)(e),allowedEntityTypes:(0,Ti.Xf)(e),dataTenants:A().selectors.getDataTenants(e)})))(Pf()((()=>({inputContainer:{margin:"4px 16px 16px",flexShrink:"0"}})))($f)),Xf=(0,Sp.Z)({facetGroupContainer:{display:"flex",flexShrink:0,flexDirection:"column","& + hr":{marginTop:8},"& + &":{marginTop:"8px"}}});function Qf(){return Qf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Qf.apply(null,arguments)}const Jf=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["hasSearchAttributesField","children"]);const a=Xf(),[i,o]=(0,ap.useState)(!0);return ip().createElement("div",{className:a.facetGroupContainer},ip().createElement(If,Qf({isOpen:i,onCollapse:e=>{o(!i)}},n)),t&&ip().createElement(ip().Fragment,null,ip().createElement(Kf,null),ip().createElement(Cf(),null)),i&&r)};function ey(){return ey=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ey.apply(null,arguments)}var ty=r(52004),ry=r.n(ty),ny=r(40927),ay=r.n(ny);const iy=(0,Sp.Z)({link:{display:"flex",alignItems:"center",cursor:"pointer"},icon:{fontSize:"20px",marginRight:"4px",marginLeft:"-2px"}}),oy=({active:e,onClick:t,className:r})=>{const n=iy(),a=e?ay():Lm();return ip().createElement(ry(),{className:up()(n.link,r),onClick:t,underline:"none"},ip().createElement(a,{className:n.icon}),e?ei().text("View less"):ei().text("View more"))};var ly=r(50592),sy=r(23888),cy=r.n(sy);const uy=(0,Sp.Z)((e=>({bar:{backgroundColor:e.palette.secondary.main,opacity:.12,position:"absolute",minHeight:"20px",minWidth:"5px",borderRadius:"2px",top:0,left:0,height:"100%"}}))),py=e=>(0,O.is)(Number,e),dy=({className:e,width:t=0,maxWidth:r})=>{const n=uy(),a=(0,ap.useCallback)((e=>(r?100*e/r:0)+"%"),[r]);return t?ip().createElement("div",{className:up()(n.bar,e),style:{width:py(t)?a(t):t}}):null},my=(0,Sp.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 fy(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const yy={showColorBar:!0,hasOnlyButton:!1},gy=({config:e,data:t=[],values:r=[],onChange:n=O.identity})=>{const a=my();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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){fy(e,t,r[t])}))}return e}({},yy,e);const i=e=>()=>{const t=r.includes(e)?r.filter((t=>t!==e)):r.concat(e);n(t)},o=Math.max(...t.map((e=>e.number)));return ip().createElement("div",{className:a.listContainer},t.map((t=>ip().createElement("div",{key:t.value,className:up()(a.item,{[a.disabled]:!t.number&&!r.includes(t.value)}),"data-reltio-id":"search-facets-list-row"},(e=>ip().createElement(Hp(),{className:up()(a.checkbox,{[a.checked]:r.includes(e.value)}),checked:r.includes(e.value),onChange:i(e.value),value:e.value,color:"primary"}))(t),ip().createElement("div",{className:a.info,onClick:i(t.value)},(e=>ip().createElement(dy,{className:up()({[a.checkedBar]:r.includes(e.value)}),width:e.number,maxWidth:o}))(t),ip().createElement("div",{className:up()(a.textInfo)},ip().createElement("div",{className:a.text},t.label),ip().createElement("div",{className:a.count},void 0===t.number?ei().text("N/A"):(0,Ka.k7)(t.number,5e3))),e.hasOnlyButton&&(e=>{return ip().createElement(cy(),{className:a.buttonONLY,onClick:(t=e.value,e=>{e.stopPropagation(),n([t])})},ei().text("ONLY"));var t})(t))))))};var hy=r(1441);const Ey=(0,Sp.Z)((()=>({container:{overflow:"hidden",display:"flex",flexGrow:1,flexDirection:"column",fontSize:"13px"},noData:{marginLeft:"16px"},viewMoreLess:{paddingLeft:"20px"}}))),by=({config:e,data:t=[],values:r=[],onChange:n})=>{const a=Ey(),i=(0,sp.useDispatch)(),o=(0,ap.useCallback)((({show:e})=>{i((({show:e,silent:t})=>({type:R.k.SHOW_MORE_ENTITY_TYPES,payload:{show:e,silent:t}}))({show:e}))}),[i]),l=(0,sp.useSelector)((t=>(0,C.jC)(e,t))),s=(0,sp.useSelector)(Xa.t9),c=t.length>B.wP,u=(0,ap.useCallback)((()=>{o({show:!l})}),[o,l]),p=(0,ap.useMemo)((()=>{const e=l?t:t.slice(0,B.wP);return(0,hy.ZK)(e,s)}),[t,l,s]);return ip().createElement("div",{className:a.container},t.length>0?ip().createElement(ip().Fragment,null,ip().createElement(gy,{data:p,values:r,onChange:n,config:e}),c&&ip().createElement(oy,{active:l,onClick:u,className:a.viewMoreLess})):ip().createElement(ly.K,{variant:"noData",className:a.noData}))};var vy=r(3661),Ty=r(90320);const Oy=(0,Ty.M)(vy.Z);var Sy=r(75674),xy=r(18374);const Cy=(0,Ty.M)(xy.Z);var wy=r(22507),Ay=r(14658);function Ry(){return Ry=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ry.apply(null,arguments)}const _y={Option:({innerProps:e,innerRef:t,children:r,isFocused:n,isSelected:a,selectProps:{classes:i},label:o})=>ip().createElement(Wp(),Ry({className:up()(i.option,{[i["option--selected"]]:a}),ref:t,selected:n,component:"div"},e),ip().createElement(Hp(),{color:"primary",checked:a}),ip().createElement(ad.Y,{value:o},ip().createElement("div",{className:i["option--item"]},r)))},Iy=(0,Sp.Z)((e=>({label:{top:6,left:16},placeholder:({placeholder:e,label:t})=>({display:!e||t?"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 Ny(){return Ny=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ny.apply(null,arguments)}function Py(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Dy(e,t,r[t])}))}return e}function Dy(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let ky=0;const Ly=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["label","creatable","getOptions","loadingIndicator","components","classes","styles","onChange","onInputChange","menuPlacement"]),d=r?Oy:n?Cy:Sy.J,[m,f]=(0,ap.useState)(""),y=Iy((0,O.omit)(["classes"],e)),g="custom-select-"+ky++,h=(0,ap.useRef)();((e=[],t)=>{const r=(0,Ay.D)(null==e?void 0:e.length);(0,ap.useEffect)((()=>{const n=setTimeout((()=>{const n=(e=>{let t=null==e?void 0:e.parentElement;for(;t;){if(t.scrollHeight>t.clientHeight)return t;t=t.parentElement}return null})(null==t?void 0:t.current);var a;n&&((e,t,r,n)=>e&&t<e&&n.getBoundingClientRect().bottom>r.getBoundingClientRect().bottom)(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,O.prop)("controlRef",e.current)),t})(h));const E=Py({},_y,i),b=(0,wy.z)(y,o),v=Py({indicatorSeparator:e=>Py({},e,{margin:"10px 0"}),loadingIndicator:e=>Py({},e,{display:a?e.display:"none"}),loadingMessage:e=>Py({},e,{fontFamily:'"Roboto", "Helvetica", "Arial", sans-serif'})},l),T=t?{inputId:g,TextFieldProps:Py({label:t,InputLabelProps:{htmlFor:g,shrink:!(!e.value||!e.value.length)||void 0,className:b.label}},e.TextFieldProps)}:{};return ip().createElement(d,Ny({isMulti:!0,inputId:g,inputValue:m,onChange:function(e,t){s(e,t),"create-option"===t.action&&(f(""),c("",{action:"input-change"}))},onInputChange:function(e,{action:t}){c(e,{action:t}),"set-value"!==t&&f(e)},closeMenuOnSelect:!1,hideSelectedOptions:!1,classes:b,components:E,styles:v,menuPlacement:u,loadOptions:n,innerRef:h},T,p))};Ly.defaultProps={creatable:!1,cacheOptions:!0,components:{},classes:{},placeholder:"",loadingIndicator:!1,onInputChange:()=>{},onChange:()=>{}},Ly.propTypes={creatable:lp().bool,cacheOptions:lp().bool,defaultOptions:lp().bool,value:lp().arrayOf(lp().shape({label:lp().string.isRequired,value:lp().any})),options:lp().arrayOf(lp().shape({label:lp().string.isRequired,value:lp().any})),onChange:lp().func,onInputChange:lp().func,placeholder:lp().string,label:lp().string,loadingIndicator:lp().bool,components:lp().shape({ClearIndicator:lp().func,Control:lp().func,DropdownIndicator:lp().func,DownChevron:lp().func,CrossIcon:lp().func,Group:lp().func,GroupHeading:lp().func,IndicatorsContainer:lp().func,IndicatorSeparator:lp().func,Input:lp().func,LoadingIndicator:lp().func,Menu:lp().func,MenuList:lp().func,MenuPortal:lp().func,LoadingMessage:lp().func,NoOptionsMessage:lp().func,MultiValue:lp().func,MultiValueContainer:lp().func,MultiValueLabel:lp().func,MultiValueRemove:lp().func,Option:lp().func,Placeholder:lp().func,SelectContainer:lp().func,SingleValue:lp().func,ValueContainer:lp().func}),classes:lp().shape({control:lp().string,valueContainer:lp().string,multiValue:lp().string,noOptionsMessage:lp().string,singleValue:lp().string,placeholder:lp().string,menu:lp().string,clearIndicator:lp().string,dropdownIndicator:lp().string,option:lp().string,"option--selected":lp().string,label:lp().string}),styles:lp().shape({clearIndicator:lp().func,container:lp().func,control:lp().func,dropdownIndicator:lp().func,group:lp().func,groupHeading:lp().func,indicatorsContainer:lp().func,indicatorSeparator:lp().func,input:lp().func,loadingIndicator:lp().func,loadingMessage:lp().func,menu:lp().func,menuList:lp().func,menuPortal:lp().func,multiValue:lp().func,multiValueLabel:lp().func,multiValueRemove:lp().func,noOptionsMessage:lp().func,option:lp().func,placeholder:lp().func,singleValue:lp().func,valueContainer:lp().func}),TextFieldProps:lp().object,getOptions:lp().func,menuPlacement:lp().string,menuPortalTarget:lp().object,menuShouldBlockScroll:lp().bool,captureMenuScroll:lp().bool,getOptionValue:lp().func,isSearchable:lp().bool,inputRef:lp().shape({current:lp().object})};var Uy=r(80959),jy=r(88640),Fy=r(25386),My=r(59428),Vy=r(47823);const By=(0,Sp.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 zy(){return zy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},zy.apply(null,arguments)}const Hy=e=>{const{innerProps:t,innerRef:r,data:n,isSelected:a,isFocused:i,selectProps:{classes:o}}=e,l=By(),s=(0,O.has)("width",n),c=(0,O.has)("number",n);return ip().createElement(Wp(),zy({className:o.option,classes:{root:l.item,selected:l.itemSelected},ref:r,component:"div",selected:i,disableGutters:!0},t),ip().createElement(Hp(),{checked:a,color:"primary",disableRipple:!0,classes:{root:l.checkbox}}),ip().createElement("div",{className:l.infobox},ip().createElement("div",{className:l.textbox},ip().createElement(ad.Y,{value:n.label},ip().createElement("div",{className:l.text},n.label)),c&&ip().createElement("div",{className:l.number},(0,Ka.k7)(n.number,5e3))),s&&ip().createElement(dy,{className:up()(l.colorBar,{[l.selectedColorBar]:a}),width:n.width})))};Hy.propTypes={innerProps:lp().shape({id:lp().string.isRequired,key:lp().string,onClick:lp().func.isRequired,onMouseMove:lp().func.isRequired,onMouseOver:lp().func.isRequired,tabIndex:lp().number.isRequired}).isRequired,innerRef:lp().oneOfType([lp().oneOf([null]),lp().func,lp().shape({current:lp().any.isRequired})]),isSelected:lp().bool.isRequired,isFocused:lp().bool.isRequired,selectProps:lp().shape({classes:lp().shape({option:lp().string})}),data:lp().shape({value:lp().string,label:lp().string.isRequired,number:lp().number}).isRequired};const Yy=Hy,Wy=e=>{const{selectProps:{classes:t}}=e;return ip().createElement(ly.K,{variant:"noData",className:t.noOptionsMessage})};Wy.propTypes={selectProps:lp().object.isRequired};const Gy=Wy;function qy(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Zy(e,t,r[t])}))}return e}function Zy(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const $y={container:e=>qy({},e,{width:"100%"}),menuList:e=>qy({},e,{maxHeight:"240px",padding:"8px 0"}),menu:e=>qy({},e,{maxHeight:"240px"})},Ky=(0,Sp.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)"}}))),Xy=lp().shape({value:lp().string.isRequired,label:lp().string.isRequired,number:lp().number});function Qy(){return Qy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Qy.apply(null,arguments)}function Jy(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const eg=e=>{let{values:t=[],defaultOptions:r=[],filteredOptions:n,onChange:a=O.identity,getSuggestions:i,showBar:o=!0,showNumberInValue:l=!1,classes:s={},styles:c={},canLoadMore:u=!0,max:p=B.cu}=e,d=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["values","defaultOptions","filteredOptions","onChange","getSuggestions","showBar","showNumberInValue","classes","styles","canLoadMore","max"]);const m=Ky(),[f,y]=(0,ap.useState)(""),[g,h]=(0,ap.useState)(1),[E,b]=(0,ap.useState)(!1),T=(0,ap.useRef)(null),S=(0,ap.useRef)(!1),x=(0,ap.useRef)(!1),C=(n||[]).concat(r),w=e=>C.find((t=>t.value===e))||{value:e,label:e},A=e=>l&&(0,O.has)("number",e)?(0,O.assoc)("formattedNumber",(0,v.formatNumberAsMetric)((0,O.prop)("number",e),5e3),e):e,R=(0,O.pipe)((e=>{if(o&&e.length&&(0,O.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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Jy(e,t,r[t])}))}return e}({},e,{width:_(e.number,t)})))}return e}),(0,O.uniqBy)((0,O.prop)("value"))),_=(e,t)=>(t?100*e/t:0)+"%",I=(0,v.debounce)(((e,{action:t})=>{e!==f&&"set-value"!==t&&(y(e),h(1),S.current=!1,b(!0),i({value:e,pageNumber:1}))}),250),N=n||r,P=(0,ap.useCallback)((()=>{b(!0),i({value:f,pageNumber:g+1,currentOptions:N}),S.current=!0}),[f,g,i,N]);(0,ap.useEffect)((()=>{b(!1),S.current&&(h((e=>e+1)),S.current=!1)}),[n]),(0,ap.useEffect)((()=>{x.current||(b(!1),h(1),S.current=!1,i({value:"",pageNumber:1})),x.current=!1}),[r]);const D=(0,ap.useMemo)((()=>N.slice(0,g*p)),[N,g,p]),k=u&&N.length>D.length;return ip().createElement(Ly,Qy({filterOption:({label:e,value:t},r)=>v.utils.strings.search(e,r)||v.utils.strings.search(t,r),value:(e=>(0,v.wrapInArrayIfNeeded)(e).map(w).map(A))(t),onChange:(0,O.pipe)((0,O.tap)((()=>{x.current=!0})),(0,O.pluck)("value"),a),options:R(D),onInputChange:I,classes:(0,O.mergeRight)(m,s),styles:(0,O.mergeRight)($y,c),TextFieldProps:{InputProps:{disableUnderline:!0},ref:T},inputRef:T,components:{Option:Yy,NoOptionsMessage:Gy,Menu:Uy.h,DropdownIndicator:jy.K,MultiValue:Fy._,MenuList:My.d},menuPlacement:"bottom",menuListFooter:k&&ip().createElement(Vy.X,{loading:E,onClick:P})},d))};eg.propTypes={values:lp().array,defaultOptions:lp().arrayOf(Xy),filteredOptions:lp().arrayOf(Xy),onChange:lp().func.isRequired,getSuggestions:lp().func.isRequired,showBar:lp().bool,showNumberInValue:lp().bool,classes:lp().object,styles:lp().object,canLoadMore:lp().bool,max:lp().number};const tg=(0,ap.memo)(eg);var rg=r(43627),ng=r.n(rg);function ag(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){ig(e,t,r[t])}))}return e}function ig(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const og=(0,O.range)(2,10).reduce(((e,t)=>ag({},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)"}}})),{}),lg=(0,Sp.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":ag({fontSize:"10px",lineHeight:"11px",fontWeight:500,color:"rgba(255, 255, 255, 0.7)",marginTop:"4px"},og,{"&:last-child":{color:"white"}}),"& li + li":{marginTop:"2px"}}}})));function sg(){return sg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},sg.apply(null,arguments)}const cg=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["pathToTitle","children"]);const a=lg(),i=null!=t&&t.length?ip().createElement("div",{className:a.tooltipContent},ip().createElement("p",null,(0,O.last)(t)),t.length>2&&ip().createElement("ul",null,t.map((e=>ip().createElement("li",{key:e},e))))):"";return ip().createElement(ng(),sg({title:i,disableFocusListener:!0,classes:{tooltip:a.tooltip}},n),r)};var ug=r(96091),pg=r.n(ug),dg=r(35635),mg=r.n(dg);const fg=(0,Sp.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 yg(){return yg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},yg.apply(null,arguments)}const gg=(0,id.T)(mg()),hg=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["label","onDelete"]);const a=fg();return ip().createElement(pg(),yg({className:a.root,label:ei().number(t),onDelete:r,variant:"outlined",classes:{root:a.root,outlined:a.outlined,deleteIcon:a.deleteIcon,label:a.label},deleteIcon:ip().createElement(gg,{tooltipTitle:ei().text("Clear")})},n))},Eg=(0,Sp.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 bg(){return bg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},bg.apply(null,arguments)}const vg=({title:e="",chipLabel:t=0,onDelete:r,pathToTitle:n,onClick:a})=>{const i=Eg(),o=Boolean(n&&n.length>2),l=o?cg:ad.Y,s=o?{pathToTitle:n}:{value:e};return ip().createElement("div",{className:i.container,onClick:a},o&&ip().createElement(cg,bg({placement:"bottom-start"},s),ip().createElement("div",{className:i.parent},n[n.length-2])),ip().createElement("div",{className:i.titleContainer},ip().createElement(l,bg({placement:"bottom-start"},s),ip().createElement("span",{className:i.title},e)),0!==t&&ip().createElement("div",{className:i.chip},ip().createElement(hg,{label:t,onDelete:r}))))};function Tg(){return Tg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Tg.apply(null,arguments)}const Og=(0,Sp.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}}))),Sg=(0,id.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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return ip().createElement("svg",Tg({width:"13",height:"18",viewBox:"0 0 13 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},r),ip().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},ip().createElement("g",null,ip().createElement("g",null,ip().createElement("g",null,ip().createElement("g",{transform:"translate(-3 -1)"},ip().createElement("g",null,ip().createElement("path",{fill:"#FF4081",d:"M5.833 10h3.75v6.667l-3.75 1.666z"}),ip().createElement("path",{fill:"#CE0C4E",d:"M13.333 10v8.333l-3.75-1.666V10z"})),ip().createElement("circle",{fill:"#FFC058",cx:"9.583",cy:"7.917",r:"6.25"}),ip().createElement("circle",{fill:"#FFCD7B",cx:"9.583",cy:"7.917",r:"5.417"}),ip().createElement("path",{fill:"#FFFBB5",d:"M8.333 11.667L5 8.462l.933-.898 2.4 2.308L13.4 5l.933.897z"})))))))})),xg=({title:e,chipLabel:t,onDeleteChip:r,pathToTitle:n,onClose:a,children:i,isOpenByDefault:o=!0,isHighlighted:l=!1,isRecommended:s=!1})=>{const c=Og(),[u,p]=(0,ap.useState)(o),d=()=>{p(!u)};return ip().createElement("div",{className:up()(c.facetContainer,{[c.openedFacetContainer]:u,[c.closedFacetContainer]:!u,[c.highlighted]:l}),"data-reltio-id":`search-facet-container-${e}`},ip().createElement("div",{className:c.titleContainer},ip().createElement(gd.k,{tooltipTitle:ei().text("Remove"),icon:Ep(),onClick:a,className:c.iconButton,size:"XXS"}),s&&ip().createElement(Sg,{className:c.recommendedIcon,tooltipTitle:ei().text("Recommended"),showForDisabled:!0}),ip().createElement(vg,{title:e,pathToTitle:n,chipLabel:t,onDelete:r,onClick:d}),ip().createElement(Fm,{onClick:d,isOpen:u,className:c.iconButton,size:"S",tooltipTitle:u?ei().text("Collapse attribute"):ei().text("Expand attribute"),tooltipPlacement:"bottom-end"})),u?i:null)},Cg=(0,Sp.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"}}))),wg=({config:e,data:t=[],filteredData:r,values:n=[],isHighlighted:a,isRecommended:i,onSearch:o=O.identity,onChange:l,onClose:s})=>{const c=Cg();return ip().createElement(xg,{title:e.title,pathToTitle:e.pathToTitle,onClose:s,chipLabel:n.length,onDeleteChip:()=>l([]),isHighlighted:a,isRecommended:i},ip().createElement(tg,{values:n,defaultOptions:t,filteredOptions:r,onChange:l,getSuggestions:o,isClearable:!1,showBar:!1,showNumberInValue:!0,classes:c,placeholder:ei().text("All values"),canLoadMore:!(0,Ia.tW)(e)}))};var Ag=r(32015),Rg=r(15608),_g=r.n(Rg);const Ig=(0,Sp.Z)((e=>({root:{borderRadius:4,padding:"15px 0"},rail:{backgroundColor:(0,xm.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,xm.alpha)(e.palette.primary.main,.12)}`,"@media (hover: none)":{boxShadow:"none"}},"&$active":{boxShadow:`0px 0px 0px 9px ${(0,xm.alpha)(e.palette.primary.main,.12)}`},"&::after":{left:-10,top:-10,right:-10,bottom:-10}},focusVisible:{},active:{},track:{borderRadius:4}}))),Ng=(0,Sp.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"}}))),Pg=({children:e,open:t,value:r})=>{const n=Ng();return ip().createElement(ng(),{open:t,enterTouchDelay:0,placement:"top",title:r,classes:{tooltipPlacementTop:n.tooltipPlacementTop,tooltip:n.tooltip}},e)};function Dg(){return Dg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Dg.apply(null,arguments)}Pg.propTypes={children:lp().element.isRequired,open:lp().bool.isRequired,value:lp().string.isRequired};const kg=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["min","max","range","onChange","onAfterChange","className"]);const s=Ig();return ip().createElement("div",{className:o},ip().createElement(_g(),Dg({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:Pg},size:"small",component:"div"},l)))};kg.propTypes={min:lp().oneOfType([lp().number,lp().string]).isRequired,max:lp().oneOfType([lp().number,lp().string]).isRequired,range:lp().array.isRequired,onChange:lp().func,onAfterChange:lp().func,className:lp().string};const Lg=kg;var Ug=r(18205),jg=r(19406),Fg=r(55484),Mg=r(25556),Vg=r(3131),Bg=r(27741),zg=r(42400),Hg=r(11011);const Yg=(0,Sp.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"}}))),Wg=({payload:e,formatter:t,active:r})=>{const n=Yg();if(r){const{payload:{label:r},value:a}=e[0];return ip().createElement("div",{className:n.tooltip},ip().createElement("div",{className:n.number},t(a)),ip().createElement("div",{className:n.value},r))}return null},Gg=(0,Sp.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 qg(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Zg=({data:e=[],range:t=[],domain:r,color:n=v.theme.palette.primary.main,tickFormatterX:a,tickFormatterY:i})=>{const o=Gg(),[l,s]=(0,ap.useState)(null),c=(e,r)=>(l===r?.2:0)+((({value:e})=>e[0]>=t[0]&&e[1]<=t[1])(e)?.6:.2),u=e.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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){qg(e,t,r[t])}))}return e}({},e,{value:t<r.length-1?e.value[0]:e.value[1]}))),p=e=>{e.isTooltipActive?s(e.activeTooltipIndex):s(null)};return ip().createElement(Ug.h,null,ip().createElement(jg.v,{data:u,margin:{top:12,right:0,left:0,bottom:0},onMouseEnter:p,onMouseLeave:p,onMouseMove:p,className:o.barChart},ip().createElement(Fg.q,{vertical:!1,stroke:"#f2f2f2"}),ip().createElement(Mg.K,{dataKey:"value",interval:0,padding:{left:4,right:4},height:15,tickLine:!1,ticks:r,tick:e=>{const{x:t,y:r,index:n,payload:{value:i,offset:o}}=e;return ip().createElement("text",{x:0===n?t-o:t+o,y:r+4,textAnchor:0===n?"start":"end"},`${a(i)}`)}}),ip().createElement(Vg.B,{width:38,domain:[0,"auto"],axisLine:!1,tickLine:!1,tickSize:0,tickMargin:4,tickCount:6,tickFormatter:i}),ip().createElement(Bg.u,{cursor:{fill:"rgb(255,255,255)"},content:ip().createElement(Wg,{formatter:i}),isAnimationActive:!1}),ip().createElement(zg.$,{dataKey:"number",isAnimationActive:!1},e.map(((e,t)=>ip().createElement(Hg.b,{key:`cell-${t}`,fill:n,fillOpacity:c(e,t)}))))))},$g="NumericRangeFacet-styles-numberEditorInputRoot--djW3k",Kg="NumericRangeFacet-styles-numberEditorRoot--DVXqx",Xg="NumericRangeFacet-styles-input--Nl2tx";function Qg(){return Qg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Qg.apply(null,arguments)}class Jg extends ap.PureComponent{constructor(...e){super(...e),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,O.path)([0,0],r))&&n.equals(o[1],(0,O.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,O.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,O.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,Al.C)(a),l=(0,Ka.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,v.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,f=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))),[g,h]=p.getBarDomain(t).map((e=>this.applyScale(e)));return ip().createElement(xg,{title:e.title,pathToTitle:e.pathToTitle,onClose:a,isHighlighted:r,isRecommended:n},ip().createElement("div",{className:"NumericRangeFacet-styles-data--kL9q5"},f.length>0?ip().createElement(ip().Fragment,null,ip().createElement("div",{className:"NumericRangeFacet-styles-barChartContainer--t9NkG","data-reltio-id":"search-bar-chart-with-selection"},ip().createElement(Zg,{data:f,range:y,tickFormatterX:m,tickFormatterY:p.formatNumberForRangeFacet,domain:[g,h]})),ip().createElement(Lg,{min:g,max:h,range:y,onAfterChange:this.onRevertedChange,onChange:this.onChangeRange,className:"NumericRangeFacet-styles-slider--XbmKe",valueLabelFormat:m,step:d?(h-g)/200:1}),ip().createElement("div",{className:"NumericRangeFacet-styles-inputsContainer--mU0_m"},ip().createElement(Ag.c,{value:c,onChange:this.onLowerBoundChanged,onFocus:this.onFocus,integer:!d,format:i,variant:"filled",classes:{root:Kg},InputProps:{classes:{root:$g,input:Xg}}}),ip().createElement(Ag.c,{value:u,onChange:this.onUpperBoundChanged,onFocus:this.onFocus,integer:!d,format:i,variant:"filled",classes:{root:Kg},InputProps:{classes:{root:$g,input:Xg}}}))):ip().createElement(ly.K,{variant:"noData"})))}}Jg.propTypes={data:lp().array,values:lp().array,config:lp().object,isHighlighted:lp().bool,isRecommended:lp().bool,onClose:lp().func,onChange:lp().func,numberFormat:lp().shape({decimalSeparator:lp().string,thousandSeparator:lp().string,prefix:lp().string,suffix:lp().string,decimalScale:lp().number})},Jg.defaultProps={config:{},data:[],values:[]};const eh=(0,sp.connect)((e=>({numberFormat:A().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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(t,["config","values","data","onChange","numberFormat"]);const s=(0,sp.useSelector)(A().selectors.getAttributesPresentation),{strategy:c}=(0,v.getNumberFormat)((0,v.getAttrDataTypeDefinition)(r.attrType),s,v.intl.getLocale()),u=(0,ap.useMemo)((()=>null==a?void 0:a.map((0,O.evolve)({value:(0,O.map)((0,v.applyPresentationStrategyToValue)(c))}))),[a,c]),p=(0,ap.useMemo)((()=>null==n?void 0:n.map((0,v.mapFilterValue)((0,v.applyPresentationStrategyToValue)(c)))),[n,c]),d=(0,ap.useCallback)((e=>{const t=null==e?void 0:e.map((0,v.mapFilterValue)((0,v.revertPresentationStrategyForValue)(c)));i(t)}),[c,i]);return ip().createElement(e,Qg({data:u,values:p,onChange:d,config:r,numberFormat:o&&(0,O.omit)(["strategy",o])},l))};return t.displayName="WithCustomizedData",t})(Jg));var th=r(21669);const rh=(0,Sp.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 nh(){return nh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},nh.apply(null,arguments)}const ah=(e,t)=>(0,O.pathOr)(null,[t],e),ih=e=>e&&new Date(e),oh=e=>e&&e.getTime(),lh=({values:e,minDate:t,maxDate:r,onChange:n})=>{const[a,i]=(0,ap.useState)(null),[o,l]=(0,ap.useState)(null),s=(0,ap.useRef)((0,Me.x0)()),c=(0,ap.useRef)((0,Me.x0)()),u=rh();ip().useEffect((()=>{i(ah(e,0)),l(ah(e,1))}),[e]);const p=(e,t)=>{(0,O.isNil)(e)||(0,O.isNil)(t)||n(e>t?[[t,e]]:[[e,t]])},d={minDate:ih(t),maxDate:ih(r)};return ip().createElement("div",{className:u.container},ip().createElement(th.Q,nh({label:ei().text("Start Date"),value:ih(a),onChange:e=>{const t=oh(e);i(t),p(t,o)},slotProps:{textField:{id:s.current,className:u.dateEditor}}},d)),ip().createElement(th.Q,nh({label:ei().text("End Date"),value:ih(o),onChange:e=>{const t=oh(e);l(t),p(a,t)},slotProps:{textField:{id:c.current,className:u.dateEditor},popper:{placement:"bottom-end"}}},d)))};function sh(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ch=e=>t=>e===v.DataTypes.TYPE_DATE?v.utils.dates.toLocalDate(t).getTime():t,uh=(0,Sp.Z)({barChartContainer:{position:"relative",height:"190px",paddingTop:"6px",width:"100%",overflow:"hidden"},dateRangeChooserWrapper:{display:"flex",flexDirection:"column",alignItems:"center",marginTop:"12px",width:"100%"}}),ph=(0,Al.C)(),dh=({data:e=[],values:t=[],config:r,onChange:n,isHighlighted:a,isRecommended:i,onClose:o})=>{const l=uh(),s=(0,O.path)(["attrType","type"],r),c=(0,ap.useCallback)((r=>{const a=r.map((0,v.mapFilterValue)((i=s,e=>i===v.DataTypes.TYPE_DATE?v.utils.dates.toUtcDate(e).getTime():e)));var i;if(!(0,O.equals)(t,a)){const[t,r]=ph.getBarDomain(e),i=s===v.DataTypes.TYPE_DATE,o=a.map((e=>[v.utils.dates.getStartOfDay(e[0],i),v.utils.dates.getEndOfDay(e[1],i)])),l=ph.getRange(o,e);n([l.length?l:[t,r]])}}),[e,n,s,t]),u=(0,ap.useMemo)((()=>{return e.map((t=s,e=>{if(Array.isArray(e.value)){const r=e.value.map(ch(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){sh(e,t,r[t])}))}return e}({},e,{value:r,label:r.map(v.formatDate).join(" - ")})}}));var t}),[e,s]),[p,d]=(0,ap.useMemo)((()=>[ph.getBarDomain(u),ph.getRange(t.map((0,v.mapFilterValue)(ch(s))),u)]),[u,s,t]);return ip().createElement(xg,{title:r.title,pathToTitle:r.pathToTitle,onClose:o,isHighlighted:a,isRecommended:i},e.length>0?ip().createElement(ip().Fragment,null,ip().createElement("div",{className:l.barChartContainer},ip().createElement(Zg,{data:u,range:d,tickFormatterX:v.formatDate,tickFormatterY:ph.formatNumberForRangeFacet,domain:p})),ip().createElement("div",{className:l.dateRangeChooserWrapper},ip().createElement(lh,{values:d,onChange:c}))):ip().createElement(ly.K,{variant:"noData"}))};function mh(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class fh{static getWidget(e){switch(e.type){case v.FACET_TYPES.ENTITY_TYPE_FACET:return by;case v.FACET_TYPES.WITH_DROPDOWN_CHECKBOXES_FACET:return wg;case v.FACET_TYPES.NUMERIC_RANGE_FACET:return eh;case v.FACET_TYPES.DATE_RANGE_FACET:return dh;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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){mh(e,t,r[t])}))}return e}({},fh.getDefaultConfig(),e),r=fh.getWidget(t);return r?(e=>{const r=((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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(r,["dispatch"]);return ip().createElement(e,ey({config:t,onChange:(i=t.fieldName,e=>{n(Ga(i,e))}),onClose:t.showDeleteButton?(e=>()=>{n($a({fieldNamesToDelete:[e]}))})(t.fieldName):()=>{},onSearch:(e=>({value:t,pageNumber:r,currentOptions:a})=>{n((({facetFieldName:e,value:t,debounceTime:r=0,pageNumber:n=1,currentOptions:a})=>({type:R.k.FILTER_FACET_DATA,payload:{facetFieldName:e,value:t,debounceTime:r,pageNumber:n,currentOptions:a}}))({facetFieldName:e,value:t,debounceTime:250,pageNumber:r,currentOptions:a}))})(t.fieldName)},a));var i};return r.propTypes={dispatch:lp().func,isRecommended:lp().bool},r})(e,t);return fh.connectData(r,t)})(r):null}}fh.getDefaultConfig=()=>({autofocus:!1,showDeleteButton:!0}),fh.connectData=(e,t)=>(0,sp.connect)((e=>({data:(0,C.X7)(t,e),values:(0,C.N1)(t,e),filteredData:(0,C.VP)(t,e),isHighlighted:(0,C.$t)(t.fieldName,e),isRecommended:(0,C.TH)(t.fieldName,e)})))(e);var yh=r(64927),gh=r.n(yh),hh=r(73707),Eh=r.n(hh),bh=r(93463),vh=r.n(bh);const Th=(0,Sp.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 Oh=r(44244);const Sh=({tenantObject:e,isDataTenant:t,className:r})=>{const n=(({tenantObject:e,isDataTenant:t})=>{const r=(0,Oh._)(),[n,a]=(0,ap.useState)(0),i=(0,sp.useSelector)(A().selectors.getGlobalSearchRequestOptions),o=t?e:null,l=(0,sp.useSelector)((e=>(0,Xa.E2)(e,[],o))),s=JSON.stringify((0,_a.Vg)(l,[],i)),c=(0,sp.useSelector)(A().selectors.getDtssPath),u=(0,sp.useSelector)(A().selectors.getTenant);return(0,ap.useEffect)((()=>{r((0,_a.Es)({url:B.jS,options:{method:"POST",body:s},customerTenant:u,dataTenant:(0,O.prop)("id",o),dtssPath:c})).then((({total:e})=>{a(e)})).catch((e=>{console.warn(e)}))}),[o,u,c,s]),n})({tenantObject:e,isDataTenant:t});return ip().createElement("div",{className:r},(0,Ka.k7)(n))};Sh.propTypes={className:lp().string,tenantObject:lp().object.isRequired,isDataTenant:lp().bool};const xh=Sh;function Ch(){return Ch=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ch.apply(null,arguments)}const wh={changeCurrentTenant:({tenantObject:e,isDataTenant:t})=>({type:_.Z.CHANGE_CURRENT_TENANT,payload:{tenantObject:e,isDataTenant:t}})},Ah=(0,sp.connect)((e=>({dataTenants:A().selectors.getDataTenants(e),customerTenantObject:A().selectors.getTenantObject(e),currentTenant:(0,Xa.RO)(e),openAdvancedSearch:(0,Ti.IJ)(e)})),wh)((({customerTenantObject:e,currentTenant:t,dataTenants:r,changeCurrentTenant:n,openAdvancedSearch:a})=>{const i=Th(),o=(0,O.pipe)((0,O.map)((({id:e,label:t})=>({value:e,label:t}))),(0,O.prepend)({value:e.id,label:e.name}))(r),l=t=>{const n=t!==e.id;return{isDataTenant:n,tenantObject:n?r.find((0,O.propEq)("id",t)):e}},s=t||e.id;return ip().createElement("div",{className:i.tenantFacet},ip().createElement(If,{title:ei().text("Tenants"),hasCollapseButton:!1}),ip().createElement(Eh(),{className:i.radioGroup,value:s,onChange:(0,O.pipe)(Tp.NA,l,n)},o.map((({value:e,label:t})=>ip().createElement("div",{className:i.tenantContainer,key:e},ip().createElement(vh(),{classes:{root:i.radioLabelRoot,label:i.radioLabel},value:e,label:t||e,control:ip().createElement(gh(),{className:i.radioButton,color:"primary"})}),!a&&ip().createElement(xh,Ch({className:i.total},l(e))))))))})),Rh=(0,Sp.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}}),_h=({variant:e="facetsPanel",searchOptions:t={},dispatch:r})=>{const{root:n,labelRoot:a,checkboxRoot:i,checkboxRootQueryGroups:o}=Rh(),l=t.searchByOv,s=(0,ap.useCallback)((()=>{r(w.search.actions.updateSearchOptions({searchByOv:!l,ovOnly:!l}))}),[l,r]),c=ei().text("Search by OV only");return ip().createElement("div",{className:n,onClick:s},ip().createElement(Hp(),{classes:{root:up()(i,{[o]:"queryGroups"===e})},checked:l,color:"primary"}),ip().createElement(ad.Y,{value:c},ip().createElement(hf(),{variant:"body2",classes:{root:a}},c)))};_h.propTypes={searchOptions:lp().shape({searchByOv:lp().bool,ovOnly:lp().bool}),variant:lp().oneOf(["facetsPanel","queryGroups"]),dispatch:lp().func};const Ih=(0,sp.connect)((e=>({searchOptions:A().selectors.getSearchOptions(e)})))(_h),Nh=(0,Sp.Z)({root:{display:"flex",flexDirection:"column",overflow:"auto",height:"100%"}});function Ph(){return Ph=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ph.apply(null,arguments)}const Dh=(0,v.memoizeWith)((e=>e.fieldName),fh.build),kh=({group:e,configs:t})=>ip().createElement(Jf,Ph({},e,{key:e.title}),(e=>e.map((e=>({Facet:Dh(e),id:e.fieldName}))).filter((({Facet:e})=>e)).map((({Facet:e,id:t})=>ip().createElement(e,{key:t}))))(t)),Lh=(0,sp.connect)((e=>{const t=A().selectors.getDataTenants(e);return{metadata:A().selectors.getMetadata(e),facetsConfigs:(0,C.Mp)(e),uiConfigShowSearchByOv:A().selectors.getShowSearchByOv(e)??(0,Ti.cC)(e),showTenantFacet:t&&t.length>0,tenant:A().selectors.getTenant(e)}}))((({facetsConfigs:e=[],metadata:t,onScroll:r,uiConfigShowSearchByOv:n,showTenantFacet:a})=>{const{root:i}=Nh(),o=(0,ap.useRef)(null),l=(0,ap.useCallback)((e=>{r(o.current.scrollTop,e)}),[r]),s=((e,t)=>{const[r,n]=(0,O.partition)(v.isTypeFacet,t),a=[{group:{title:ei().text("Entity types"),hasCollapseButton:!1},configs:r},{group:{title:ei().text("Attributes"),hasCollapseButton:!1,hasSearchAttributesField:!0},configs:n}];return Rf(a)})(0,e),c=(0,O.head)(s),u=(0,O.tail)(s),p=o.current,d=(0,ap.useMemo)((()=>({element:p,priority:["top","bottom"]})),[p]);return ip().createElement("div",{ref:o,className:i,onScroll:l},ip().createElement(wf.p.Provider,{value:d},n&&ip().createElement(Ih,null),a&&ip().createElement(ip().Fragment,null,ip().createElement(Ah,null),ip().createElement(Cf(),null)),c&&kh(c),ip().createElement(Cf(),null),u.map(((e,t)=>ip().createElement(kh,Ph({},e,{key:t}))))))})),Uh=({children:e,className:t})=>ip().createElement("div",{className:up()("MainContent-styles-mainContent--Ha5me",t)},e);Uh.propTypes={children:lp().node,className:lp().string};const jh=Uh;var Fh=r(33788);const Mh=(0,Sp.Z)({container:{backgroundColor:"#fff",opacity:.37,position:"fixed",width:"100%",height:"100%",top:0,left:0,display:"flex",justifyContent:"center",alignItems:"center"}}),Vh=()=>{const e=(0,sp.useSelector)(Ti.Kv),{container:t}=Mh();return e?ip().createElement("div",{className:t},ip().createElement(Fh.Z,{size:160})):null};var Bh=r(54596),zh=r.n(Bh),Hh=r(49233),Yh=r.n(Hh),Wh=r(35206),Gh=r.n(Wh),qh=r(81733),Zh=r.n(qh),$h=r(68290),Kh=r.n($h);const Xh=(0,Sp.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"},[B.GT.error]:{backgroundColor:e.palette.error.dark}})));function Qh(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Jh=()=>{const e=(0,sp.useDispatch)(),t=(0,sp.useSelector)(Ti.v6),r=(0,sp.useSelector)(A().selectors.getAutoCloseInterval),n=t&&t.payload.autoHideDuration||r&&1e3*r||5e3,a=Xh(),i=(0,ap.useRef)(null),o=(0,ap.useCallback)((()=>{e(fi())}),[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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Qh(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,ap.useCallback)((()=>{p&&e(p)}),[p,e]),m=(0,ap.useMemo)((()=>l===B.GT.error?ip().createElement(Yh(),{key:"close","aria-label":"Close",color:"inherit",className:a.close,onClick:d,size:"large"},ip().createElement(Ep(),null)):u?ip().createElement(Gh(),{color:"primary",size:"small",onClick:d},u.actionLabel):null),[a,l,u,d]);return ip().createElement(Zh(),{container:document.body},ip().createElement(zh(),{key:c+l,anchorOrigin:{vertical:"bottom",horizontal:"center"},autoHideDuration:n,open:Boolean(t),onClose:o,ContentProps:{classes:{root:up()(a.snackbar,a[l]),message:a.message}},message:ip().createElement("div",{className:a.messageContent},l===B.GT.error&&ip().createElement(Kh(),{className:a.icon}),c),classes:{anchorOriginBottomCenter:a.anchorSnackBar},action:m}))},eE=(0,Sp.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 tE=r(95641);const rE=(0,Sp.Z)((()=>({container:{position:"relative"},panel:{position:"relative"},horizontal:{},vertical:{},disabled:{},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:"ns-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","&$disabled":{background:"transparent"},"&:not($disabled):hover":{cursor:"ew-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%"}}}})));function nE(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){aE(e,t,r[t])}))}return e}function aE(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const iE=e=>"horizontal"===e,oE=(e,t)=>e.toFixed(2)===t.toFixed(2),lE=({className:e,children:t,orientation:r="vertical",primary:n="first",size:a,minSize:i,maxSize:o,allowResize:l,debounceInterval:s=250,onChange:c})=>{const u=rE(),p=(0,xm.useTheme)(),d=(0,ap.useRef)(),[m,f]=(0,ap.useState)(null),[y,g]=(0,ap.useState)(0),[h,E]=(0,ap.useState)(0),[b,T]=(0,ap.useState)(!0),O=(0,ap.useCallback)((()=>T(!0)),[]),S=(0,ap.useCallback)((()=>T(!1)),[]),x=(0,ap.useCallback)((()=>iE(r)?null==m?void 0:m.clientHeight:null==m?void 0:m.clientWidth),[m,r]);"number"==typeof a&&a<0&&(a=(x()||0)+a);const C=(0,ap.useCallback)((e=>"string"==typeof e&&e.endsWith("%")?+e.replace("%",""):("string"==typeof e&&e.endsWith("px")&&(e=e.replace("px","")),isNaN(+e)?null:+e/x()*100)),[x]),w=(0,ap.useCallback)(((e,t)=>0===e||100===e?0:C(t)||0),[C]),A=(0,ap.useCallback)((()=>{if(m&&d.current){const e=C(a);null==e||isNaN(e)||(E(w(e,o)),g(w(e,i)),d.current.resize(e))}}),[C,w,i,o,a,m]);(0,ap.useEffect)((()=>{A()}),[A,h,y]);const R=(0,ap.useCallback)((0,v.debounce)((e=>{if(void 0===e)return;const t=x();c({percentageSize:e+"%",isMaxSize:oE(e,+h>0?h:100+h),isMinSize:oE(e,y),size:Math.round(e*t/100)})}),s),[c,h,y,x]),_=(0,ap.useCallback)((e=>{e?(R(),S()):(R(d.current.getSize()),O())}),[S,O,R]),I=(0,ap.useMemo)((()=>({transition:p.transitions.create("flex",{easing:p.transitions.easing.sharp,duration:p.transitions.duration.leavingScreen})})),[p]),N=nE({className:u.panel,minSize:y},h>0?{maxSize:h}:{},{ref:d,style:b?I:void 0}),P=nE({className:u.panel,style:b?I:void 0},h<0?{minSize:-h}:{});return ip().createElement("div",{ref:f,className:up()(u.container,e)},ip().createElement(Up.ZP,{handleHeight:iE(r),handleWidth:!iE(r),onResize:A,refreshMode:"debounce",refreshRate:50}),ip().createElement(tE.eh,{direction:iE(r)?"vertical":"horizontal"},ip().createElement(tE.s_,"first"===n?N:P,t[0]),ip().createElement(tE.OT,{className:up()(u.resizer,u[r],{[u.disabled]:!l}),disabled:!l,hitAreaMargins:{coarse:0,fine:0},onDragging:_}),ip().createElement(tE.s_,"second"===n?N:P,t[1])))};lE.displayName="ResizablePanes";const sE=(0,Sp.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}}),cE=({entity:e,className:t,size:r="small"})=>{const n=sE(),a=(0,Uf.AH)(),i=(0,v.getEntityType)(a,e.type),o=(i?(0,v.getPropWithInheritance)(a,i,"typeColor"):null)||v.theme.palette.primary.main,l=(0,v.getEntityTypeLabel)(a,e);return ip().createElement(ad.Y,{value:l,placement:"top"},ip().createElement(hf(),{style:{backgroundColor:o,color:v.utils.Colors.getColor(o)?"#FFFFFF":"#212121"},className:up()(n[`entityType-${r}`],n["entityType-overflow"],t),component:"div"},l))},uE=e=>e&&e.scrollIntoView({block:"end",behavior:"smooth"}),pE=e=>{e&&clearTimeout(e)},dE=(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 mE=r(600);const fE=(0,Sp.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,xm.alpha)(e.palette.primary.main,.12),"&:hover":{background:(0,xm.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"}}))),yE=({entities:e,entityToHighlight:t,selectedEntityUri:r,onEntityClick:n,onEntityHover:a,entitiesImportStatus:i,entityButtonsRenderer:o})=>{const l=fE(),s=(0,ap.useRef)(null),c=(0,ap.useRef)(null),u=(0,Uf.AH)();return(0,mE.D)((()=>{if(t){var e;const n=null===(e=s.current)||void 0===e?void 0:e.querySelectorAll(`[data-entity-uri='${t}']`);if(pE(c.current),(null==n?void 0:n.length)>0){var r;const e=null===(r=s.current)||void 0===r?void 0:r.parentElement;dE(n[0],e)||(uE(n[0]),c.current=setTimeout((()=>{dE(n[0],e)||uE(n[0])}),1e3))}}return()=>{pE(c.current)}}),[t]),ip().createElement("div",{ref:s},(e||[]).map((e=>{const s=(0,v.getLabel)(e.label),c=e.secondaryLabel,p=(0,v.getBusinessCardAttributesText)(u,e),d=(0,v.isActiveObject)(e),m=e.uri,f=(0,v.getEntityUriForLink)(e),y=(0,O.prop)(m,i);return ip().createElement("div",{key:m,className:up()(l.item,{[l.clickable]:!!n,[l.selected]:m===r,[l.highlighted]:m===t,[l.inactive]:!d,[l.justImported]:y===sm.Eh.Success}),onClick:n?()=>n(m):void 0,onMouseEnter:a?()=>a(m):void 0,onMouseLeave:a?()=>a(null):void 0,"data-entity-uri":m},ip().createElement(b.A,{entity:e,avatarClassName:l.avatar,imageClassName:l.image}),ip().createElement("div",{className:l.info},ip().createElement("div",null,ip().createElement(Ld.x,{value:f,className:l.label},s),c&&ip().createElement("span",{className:l.secondaryLabel},c," "),p&&ip().createElement("span",{className:l.businessCard},p)),ip().createElement("div",{className:l.secondRow},ip().createElement(cE,{entity:e}),ip().createElement("div",null,(0,v.getEntityId)(e)))),o&&o(e))})))};var gE=r(92255);function hE(){return hE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hE.apply(null,arguments)}function EE(){return EE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},EE.apply(null,arguments)}function bE(){return bE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},bE.apply(null,arguments)}function vE(){return vE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vE.apply(null,arguments)}const TE=(0,Sp.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:{},small:{width:"88px",height:"88px"},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 OE(){return OE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},OE.apply(null,arguments)}let SE=function(e){return e.full="full",e.embedded="embedded",e.small="small",e}({});const xE={SEARCH_RESULTS:e=>ip().createElement("svg",hE({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),ip().createElement("defs",null,ip().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"},ip().createElement("stop",{stopColor:"#00BFFF",stopOpacity:.5,offset:"0%"}),ip().createElement("stop",{stopColor:"#9EE8FF",stopOpacity:0,offset:"100%"})),ip().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"},ip().createElement("stop",{stopColor:"#91F8E5",stopOpacity:.6,offset:"0%"}),ip().createElement("stop",{stopColor:"#14F7FF",stopOpacity:0,offset:"100%"})),ip().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"},ip().createElement("stop",{stopColor:"#FFF",offset:"0%"}),ip().createElement("stop",{stopColor:"#73FAFF",stopOpacity:.21,offset:"59.38%"}),ip().createElement("stop",{stopColor:"#14F7FF",stopOpacity:0,offset:"100%"})),ip().createElement("linearGradient",{x1:"50%",y1:"170.771%",x2:"50%",y2:"10.303%",id:"EmptySearchResults_svg__e"},ip().createElement("stop",{stopColor:"#91F8E5",offset:"0%"}),ip().createElement("stop",{stopColor:"#99FCFF",stopOpacity:0,offset:"100%"})),ip().createElement("filter",{x:"-25.9%",y:"-26.2%",width:"151.8%",height:"152.3%",filterUnits:"objectBoundingBox",id:"EmptySearchResults_svg__d"},ip().createElement("feGaussianBlur",{stdDeviation:15,in:"SourceGraphic"})),ip().createElement("circle",{id:"EmptySearchResults_svg__a",cx:128,cy:128,r:128})),ip().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},ip().createElement("mask",{id:"EmptySearchResults_svg__b",fill:"#fff"},ip().createElement("use",{xlinkHref:"#EmptySearchResults_svg__a"})),ip().createElement("use",{fillOpacity:.2,fill:"#A792CD",xlinkHref:"#EmptySearchResults_svg__a"}),ip().createElement("g",{mask:"url(#EmptySearchResults_svg__b)"},ip().createElement("g",{transform:"translate(56 34)"},ip().createElement("g",{opacity:.9,strokeWidth:1,fill:"#FFF"},ip().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"}),ip().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})),ip().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(21.756 45.833)"},ip().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:213.204,cy:5.456,rx:4.351,ry:4.365}),ip().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:197.976,cy:5.456,rx:4.351,ry:4.365}),ip().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"}),ip().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}),ip().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}),ip().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})),ip().createElement("rect",{fill:"#645F6D",opacity:.5,x:21.756,y:17.46,width:87.022,height:12.004,rx:6.002}),ip().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(21.756 87.302)"},ip().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:213.204,cy:5.456,rx:4.351,ry:4.365}),ip().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:197.976,cy:5.456,rx:4.351,ry:4.365}),ip().createElement("rect",{fill:"#E3EBF4",x:0,y:1.091,width:20.668,height:20.734,rx:10.334}),ip().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}),ip().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}),ip().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})),ip().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(21.756 128.77)"},ip().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:213.204,cy:5.456,rx:4.351,ry:4.365}),ip().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:197.976,cy:5.456,rx:4.351,ry:4.365}),ip().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"}),ip().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}),ip().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}),ip().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})))),ip().createElement("g",{mask:"url(#EmptySearchResults_svg__b)"},ip().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"}),ip().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"}),ip().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"}),ip().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}),ip().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"}),ip().createElement("g",null,ip().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)"}),ip().createElement("path",{fill:"url(#EmptySearchResults_svg__e)",opacity:.3,d:"M4 9h166.37L120.73 172.299H53.64z",transform:"rotate(120 90.404 138.861)"}),ip().createElement("path",{fill:"url(#EmptySearchResults_svg__f)",opacity:.3,d:"M4 2h166.37L120.73 172.299H53.64z",transform:"rotate(120 90.404 138.861)"}),ip().createElement("path",{fill:"url(#EmptySearchResults_svg__g)",d:"M4 9h166.37L120.73 172.299H53.64z",transform:"rotate(120 90.404 138.861)"}),ip().createElement("path",{fill:"#FFF",opacity:.196,d:"M212.363 205.344l-1 1.732L60.418 124.52l4.977-8.62z"})),ip().createElement("path",{fill:"#76A2B5",d:"M73.112 84.533l-35.5 61.488-.866-.5 35.5-61.488z"}),ip().createElement("path",{fill:"#F3F3F3",d:"M80.906 89.033l-35.5 61.488-.866-.5 35.5-61.488z"}),ip().createElement("path",{fill:"#538196",d:"M55.112 115.71l-17.5 30.311-.866-.5 17.5-30.31z"})))),SELECT_ATTRIBUTES:e=>ip().createElement("svg",EE({width:256,height:256,viewBox:"0 0 256 256",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgSelectAttributes"},e),ip().createElement("circle",{cx:128,cy:128,r:128,fill:"#0072CE",fillOpacity:.1}),ip().createElement("mask",{id:"SelectAttributes_svg__a",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:0,y:0,width:256,height:256},ip().createElement("circle",{cx:128,cy:128,r:128,fill:"#fff"})),ip().createElement("g",{mask:"url(#SelectAttributes_svg__a)"},ip().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M-16 9h256v247H-16V9z",fill:"url(#SelectAttributes_svg__paint0_linear_0_19219)"}),ip().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)"}),ip().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"}),ip().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"}),ip().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"}),ip().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"}),ip().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"}),ip().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"}),ip().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"}),ip().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"}),ip().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"}),ip().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"}),ip().createElement("circle",{cx:67,cy:79,r:9,fill:"#B6C7DB"}),ip().createElement("circle",{cx:67,cy:79,r:9,fill:"#B6C7DB"}),ip().createElement("circle",{cx:120,cy:106,r:6,fill:"#B6C7DB"}),ip().createElement("circle",{cx:120,cy:136,r:6,fill:"#B6C7DB"}),ip().createElement("circle",{cx:67,cy:169,r:9,fill:"#B6C7DB"}),ip().createElement("circle",{cx:67,cy:199,r:9,fill:"#B6C7DB"}),ip().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"}),ip().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"}),ip().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"}),ip().createElement("path",{opacity:.54,fillRule:"evenodd",clipRule:"evenodd",d:"M95.071 77l-3.535 3.535L88 77h7.071z",fill:"#000"}),ip().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"}),ip().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"})),ip().createElement("defs",null,ip().createElement("linearGradient",{id:"SelectAttributes_svg__paint0_linear_0_19219",x1:-16,y1:9,x2:-16,y2:256,gradientUnits:"userSpaceOnUse"},ip().createElement("stop",{stopColor:"#FAFAFA",stopOpacity:.01}),ip().createElement("stop",{offset:1,stopColor:"#F4F4F4"})),ip().createElement("linearGradient",{id:"SelectAttributes_svg__paint1_linear_0_19219",x1:266.117,y1:181.111,x2:154.882,y2:77.681,gradientUnits:"userSpaceOnUse"},ip().createElement("stop",{stopOpacity:.01}),ip().createElement("stop",{offset:1})))),NO_DATA:e=>ip().createElement("svg",bE({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),ip().createElement("defs",null,ip().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"NoData_svg__b"},ip().createElement("stop",{stopColor:"#FAFAFA",stopOpacity:0,offset:"0%"}),ip().createElement("stop",{stopColor:"#F4F4F4",offset:"100%"})),ip().createElement("linearGradient",{x1:"69.573%",y1:"86.747%",x2:"38.144%",y2:"33.403%",id:"NoData_svg__d"},ip().createElement("stop",{stopColor:"#000",stopOpacity:0,offset:"0%"}),ip().createElement("stop",{stopColor:"#000",offset:"100%"})),ip().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"NoData_svg__e"},ip().createElement("stop",{stopColor:"#EEFBFF",offset:"0%"}),ip().createElement("stop",{stopColor:"#0072CE",offset:"100%"})),ip().createElement("filter",{x:"-7.7%",y:"-7.5%",width:"115.3%",height:"115%",filterUnits:"objectBoundingBox",id:"NoData_svg__f"},ip().createElement("feOffset",{dx:0,dy:2,in:"SourceAlpha",result:"shadowOffsetOuter1"}),ip().createElement("feGaussianBlur",{stdDeviation:2,in:"shadowOffsetOuter1",result:"shadowBlurOuter1"}),ip().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"}),ip().createElement("feMerge",null,ip().createElement("feMergeNode",{in:"shadowMatrixOuter1"}),ip().createElement("feMergeNode",{in:"SourceGraphic"}))),ip().createElement("circle",{id:"NoData_svg__a",cx:128,cy:128,r:128})),ip().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},ip().createElement("mask",{id:"NoData_svg__c",fill:"#fff"},ip().createElement("use",{xlinkHref:"#NoData_svg__a"})),ip().createElement("use",{fillOpacity:.1,fill:"#0072CE",xlinkHref:"#NoData_svg__a"}),ip().createElement("path",{fill:"url(#NoData_svg__b)",mask:"url(#NoData_svg__c)",d:"M0 9h256v247H0z"}),ip().createElement("g",{mask:"url(#NoData_svg__c)"},ip().createElement("g",{transform:"translate(29 37)"},ip().createElement("g",{opacity:.9,strokeWidth:1,fill:"#FFF"},ip().createElement("path",{fillOpacity:.8,opacity:.5,d:"M14.565 8h228.144v176.476H14.565z"}),ip().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"})),ip().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(19.986 42.105)"},ip().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:195.862,cy:5.013,rx:3.997,ry:4.01}),ip().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:181.872,cy:5.013,rx:3.997,ry:4.01}),ip().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"}),ip().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}),ip().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}),ip().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})),ip().createElement("rect",{fill:"#645F6D",opacity:.5,x:19.986,y:16.04,width:79.944,height:11.028,rx:5.514}),ip().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(19.986 80.2)"},ip().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:195.862,cy:5.013,rx:3.997,ry:4.01}),ip().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:181.872,cy:5.013,rx:3.997,ry:4.01}),ip().createElement("rect",{fill:"#E3EBF4",x:0,y:1.003,width:18.987,height:19.048,rx:9.493}),ip().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}),ip().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}),ip().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})),ip().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(19.986 118.296)"},ip().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:195.862,cy:5.013,rx:3.997,ry:4.01}),ip().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:181.872,cy:5.013,rx:3.997,ry:4.01}),ip().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"}),ip().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}),ip().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}),ip().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})))),ip().createElement("g",{mask:"url(#NoData_svg__c)"},ip().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)"}),ip().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)"}),ip().createElement("g",{filter:"url(#NoData_svg__f)",strokeWidth:1,fill:"none",transform:"translate(70 86)"},ip().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"}),ip().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"})),ip().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"}}),ip().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"}}),ip().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=>ip().createElement("svg",vE({width:88,height:88,viewBox:"0 0 88 88",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgError"},e),ip().createElement("mask",{id:"Error_svg__a",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:0,y:0,width:88,height:88},ip().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"})),ip().createElement("g",{mask:"url(#Error_svg__a)"},ip().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}),ip().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"}),ip().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"}),ip().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"}),ip().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"}),ip().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"}),ip().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"}),ip().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"}),ip().createElement("path",{d:"M21.036 40.178h-5.09a.636.636 0 000 1.272h5.09a.636.636 0 100-1.272z",fill:"#ACACAC"}),ip().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"}),ip().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"}),ip().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"}),ip().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"}),ip().createElement("path",{d:"M18.915 18.546a1.909 1.909 0 100-3.817 1.909 1.909 0 000 3.817z",fill:"#9C6CF0"}),ip().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"}),ip().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"}),ip().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"}),ip().createElement("path",{d:"M41.82 18.546a1.909 1.909 0 100-3.817 1.909 1.909 0 000 3.817z",fill:"#4DBEE9"}),ip().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"}),ip().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"}),ip().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"}),ip().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"}),ip().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"}),ip().createElement("path",{d:"M54.968 67.324h-5.09a.636.636 0 000 1.273h5.09a.636.636 0 000-1.273z",fill:"#E9E9E9"}),ip().createElement("g",{filter:"url(#Error_svg__filter0_d)"},ip().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"})),ip().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"}),ip().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"}),ip().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"}),ip().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"}),ip().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"}),ip().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)"}),ip().createElement("g",{filter:"url(#Error_svg__filter1_d)"},ip().createElement("path",{d:"M57.406 68.063a1.719 1.719 0 100-3.438 1.719 1.719 0 000 3.438z",fill:"#000"})),ip().createElement("path",{d:"M57.406 68.063a1.719 1.719 0 100-3.438 1.719 1.719 0 000 3.438z",fill:"#fff"}),ip().createElement("g",{filter:"url(#Error_svg__filter2_d)"},ip().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"})),ip().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"})),ip().createElement("defs",null,ip().createElement("filter",{id:"Error_svg__filter0_d",x:36.219,y:37.875,width:42.375,height:42.375,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},ip().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),ip().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"}),ip().createElement("feOffset",{dy:2}),ip().createElement("feGaussianBlur",{stdDeviation:2}),ip().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"}),ip().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),ip().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})),ip().createElement("filter",{id:"Error_svg__filter1_d",x:51.688,y:62.625,width:11.438,height:11.438,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},ip().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),ip().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"}),ip().createElement("feOffset",{dy:2}),ip().createElement("feGaussianBlur",{stdDeviation:2}),ip().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"}),ip().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),ip().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})),ip().createElement("filter",{id:"Error_svg__filter2_d",x:51.688,y:44.063,width:11.438,height:23.813,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},ip().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),ip().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"}),ip().createElement("feOffset",{dy:2}),ip().createElement("feGaussianBlur",{stdDeviation:2}),ip().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"}),ip().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),ip().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})),ip().createElement("linearGradient",{id:"Error_svg__paint0_linear",x1:68.438,y1:71.571,x2:60.119,y2:58.801,gradientUnits:"userSpaceOnUse"},ip().createElement("stop",{stopOpacity:0}),ip().createElement("stop",{offset:1})))),LOADING:e=>ip().createElement("svg",OE({width:256,height:256,viewBox:"0 0 256 256",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgEmptyLoading"},e),ip().createElement("circle",{cx:128,cy:128,r:128,fill:"#0072CE",fillOpacity:.03}),ip().createElement("mask",{id:"EmptyLoading_svg__a",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:0,y:0,width:256,height:256},ip().createElement("circle",{cx:128,cy:128,r:128,fill:"#fff"})),ip().createElement("g",{mask:"url(#EmptyLoading_svg__a)"},ip().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M-16 9h256v247H-16V9z",fill:"url(#EmptyLoading_svg__paint0_linear_2978_41880)"}),ip().createElement("g",{fillRule:"evenodd",clipRule:"evenodd"},ip().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"}),ip().createElement("path",{d:"M50.371 43.106h255.685V195.71H50.371V43.106z",fill:"url(#EmptyLoading_svg__paint1_linear_2978_41880)"}),ip().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"}),ip().createElement("path",{d:"M339.015 204.883v4.966H15v-4.966h324.015z",fill:"#D4DCDF"}),ip().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)"})),ip().createElement("g",{filter:"url(#EmptyLoading_svg__filter0_d_2978_41880)"},ip().createElement("rect",{x:81.703,y:99,width:170,height:26,rx:8,fill:"#D1E6FF"}),ip().createElement("rect",{x:84.703,y:102,width:164,height:20,rx:5,stroke:"#fff",strokeWidth:6})),ip().createElement("g",{filter:"url(#EmptyLoading_svg__filter1_d_2978_41880)"},ip().createElement("mask",{id:"EmptyLoading_svg__b",fill:"#fff"},ip().createElement("rect",{x:81,y:105,width:108,height:14,rx:2})),ip().createElement("rect",{x:81,y:105,width:108,height:14,rx:2,fill:"#61A3F1"}),ip().createElement("rect",{x:81,y:105,width:108,height:14,rx:2,stroke:"#4A90E2",strokeWidth:8,mask:"url(#EmptyLoading_svg__b)"})),ip().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"}),ip().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"}),ip().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"}),ip().createElement("g",{filter:"url(#EmptyLoading_svg__filter2_ddd_2978_41880)"},ip().createElement("path",{fill:"#A0C1D7",d:"M70.703 64h11v8h-11z"}),ip().createElement("rect",{x:62,y:59,width:28,height:8,rx:1,fill:"#BDD4E3"}),ip().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"}),ip().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"}),ip().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)"}),ip().createElement("circle",{cx:75.94,cy:123.237,r:44.723,fill:"#91B0C2"}),ip().createElement("g",{filter:"url(#EmptyLoading_svg__filter3_d_2978_41880)"},ip().createElement("circle",{r:42.793,transform:"matrix(-1 0 0 1 75.94 123.237)",fill:"#F7F4FF"})),ip().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)"}),ip().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)"}),ip().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"}),ip().createElement("circle",{cx:75.94,cy:123.237,r:2.896,fill:"#EEEBF6"}),ip().createElement("circle",{cx:96.211,cy:148.655,r:2.574,fill:"#A0C3D7"}),ip().createElement("circle",{cx:107.15,cy:131.924,r:2.574,fill:"#A0C3D7"}),ip().createElement("rect",{x:62.427,y:135.592,width:27.027,height:10.039,rx:3,fill:"#A0C3D7"}),ip().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)"}),ip().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)"}),ip().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)"}),ip().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)"}),ip().createElement("circle",{cx:75.618,cy:155.734,r:2.574,fill:"#A0C3D7"}),ip().createElement("circle",{cx:55.026,cy:148.655,r:2.574,fill:"#A0C3D7"}),ip().createElement("circle",{cx:44.73,cy:131.924,r:2.574,fill:"#A0C3D7"}),ip().createElement("g",{fill:"#A0C3D7"},ip().createElement("circle",{r:2.574,transform:"matrix(1 0 0 -1 96.21 97.363)"}),ip().createElement("circle",{r:2.574,transform:"matrix(1 0 0 -1 107.149 114.094)"}),ip().createElement("circle",{r:2.574,transform:"matrix(1 0 0 -1 75.618 90.284)"}),ip().createElement("circle",{r:2.574,transform:"matrix(1 0 0 -1 55.026 97.363)"}),ip().createElement("circle",{r:2.574,transform:"matrix(1 0 0 -1 44.73 114.094)"})))),ip().createElement("defs",null,ip().createElement("linearGradient",{id:"EmptyLoading_svg__paint0_linear_2978_41880",x1:-16,y1:9,x2:-16,y2:256,gradientUnits:"userSpaceOnUse"},ip().createElement("stop",{stopColor:"#FAFAFA",stopOpacity:.01}),ip().createElement("stop",{offset:1,stopColor:"#F4F4F4"})),ip().createElement("linearGradient",{id:"EmptyLoading_svg__paint1_linear_2978_41880",x1:178.214,y1:43.106,x2:178.214,y2:195.709,gradientUnits:"userSpaceOnUse"},ip().createElement("stop",{stopColor:"#F2F9FB"}),ip().createElement("stop",{offset:1,stopColor:"#fff"})),ip().createElement("linearGradient",{id:"EmptyLoading_svg__paint2_linear_2978_41880",x1:178.497,y1:204.542,x2:178.497,y2:213.991,gradientUnits:"userSpaceOnUse"},ip().createElement("stop",{stopColor:"#90AABF"}),ip().createElement("stop",{offset:1,stopColor:"#869DAE"})),ip().createElement("linearGradient",{id:"EmptyLoading_svg__paint3_linear_2978_41880",x1:154.275,y1:146.574,x2:96.683,y2:91.352,gradientUnits:"userSpaceOnUse"},ip().createElement("stop",{stopOpacity:.01}),ip().createElement("stop",{offset:1})),ip().createElement("linearGradient",{id:"EmptyLoading_svg__paint4_linear_2978_41880",x1:60.762,y1:143.327,x2:114.747,y2:176.019,gradientUnits:"userSpaceOnUse"},ip().createElement("stop",{stopOpacity:.87}),ip().createElement("stop",{offset:1,stopOpacity:.01})),ip().createElement("linearGradient",{id:"EmptyLoading_svg__paint6_linear_2978_41880",x1:90.287,y1:154.267,x2:68.53,y2:131.301,gradientUnits:"userSpaceOnUse"},ip().createElement("stop",{stopOpacity:.01}),ip().createElement("stop",{offset:1})),ip().createElement("linearGradient",{id:"EmptyLoading_svg__paint7_linear_2978_41880",x1:100.735,y1:120.288,x2:78.978,y2:97.322,gradientUnits:"userSpaceOnUse"},ip().createElement("stop",{stopOpacity:.01}),ip().createElement("stop",{offset:1})),ip().createElement("linearGradient",{id:"EmptyLoading_svg__paint8_linear_2978_41880",x1:121.119,y1:112.739,x2:99.362,y2:89.773,gradientUnits:"userSpaceOnUse"},ip().createElement("stop",{stopOpacity:.01}),ip().createElement("stop",{offset:1})),ip().createElement("linearGradient",{id:"EmptyLoading_svg__paint9_linear_2978_41880",x1:90.166,y1:136.143,x2:68.409,y2:113.177,gradientUnits:"userSpaceOnUse"},ip().createElement("stop",{stopOpacity:.01}),ip().createElement("stop",{offset:1})),ip().createElement("filter",{id:"EmptyLoading_svg__filter0_d_2978_41880",x:77.703,y:96,width:178,height:34,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},ip().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),ip().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"}),ip().createElement("feOffset",{dy:1}),ip().createElement("feGaussianBlur",{stdDeviation:2}),ip().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"}),ip().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_2978_41880"}),ip().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_2978_41880",result:"shape"})),ip().createElement("filter",{id:"EmptyLoading_svg__filter1_d_2978_41880",x:77,y:102,width:116,height:22,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},ip().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),ip().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"}),ip().createElement("feOffset",{dy:1}),ip().createElement("feGaussianBlur",{stdDeviation:2}),ip().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"}),ip().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_2978_41880"}),ip().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_2978_41880",result:"shape"})),ip().createElement("filter",{id:"EmptyLoading_svg__filter2_ddd_2978_41880",x:-13.297,y:28,width:181.534,height:189.17,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},ip().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),ip().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"}),ip().createElement("feMorphology",{radius:4,operator:"erode",in:"SourceAlpha",result:"effect1_dropShadow_2978_41880"}),ip().createElement("feOffset",{dy:7}),ip().createElement("feGaussianBlur",{stdDeviation:4}),ip().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"}),ip().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_2978_41880"}),ip().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"}),ip().createElement("feMorphology",{radius:4,operator:"dilate",in:"SourceAlpha",result:"effect2_dropShadow_2978_41880"}),ip().createElement("feOffset",{dy:5}),ip().createElement("feGaussianBlur",{stdDeviation:16}),ip().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"}),ip().createElement("feBlend",{mode:"normal",in2:"effect1_dropShadow_2978_41880",result:"effect2_dropShadow_2978_41880"}),ip().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"}),ip().createElement("feMorphology",{radius:2,operator:"dilate",in:"SourceAlpha",result:"effect3_dropShadow_2978_41880"}),ip().createElement("feOffset",{dy:12}),ip().createElement("feGaussianBlur",{stdDeviation:8.5}),ip().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"}),ip().createElement("feBlend",{mode:"normal",in2:"effect2_dropShadow_2978_41880",result:"effect3_dropShadow_2978_41880"}),ip().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect3_dropShadow_2978_41880",result:"shape"})),ip().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"},ip().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),ip().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"}),ip().createElement("feOffset",{dy:2}),ip().createElement("feGaussianBlur",{stdDeviation:2}),ip().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"}),ip().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_2978_41880"}),ip().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_2978_41880",result:"shape"})),ip().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)"},ip().createElement("stop",{stopColor:"#CFE8FF"}),ip().createElement("stop",{offset:.599,stopColor:"#D1F2F9",stopOpacity:0}))))},CE=({variant:e=SE.full,LogoRenderer:t=xE.SEARCH_RESULTS,text:r,secondaryText:n,buttonTitle:a,onClick:i=O.identity,access:o})=>{const l=TE(),s=o&&a;return ip().createElement("div",{className:up()(l.root,l[`root_${e}`])},ip().createElement(t,{className:l[`${e}`]}),ip().createElement("div",{className:l.textBox},ip().createElement(hf(),{variant:"h5",classes:{h5:l.text}},r),n&&ip().createElement(hf(),{variant:"subtitle1",classes:{subtitle1:l.secondaryText}},n)),s&&ip().createElement(Gh(),{className:l.button,variant:"contained",color:"primary",onClick:i},a))};var wE=r(15503);class AE extends ip().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 RE=(0,Sp.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 _E=r(46089),IE=r.n(_E);const NE=(0,Sp.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,xm.alpha)(e.palette.primary.main,.12),fill:e.palette.primary.main,color:e.palette.primary.main,"&:hover":{backgroundColor:(0,xm.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:{}}))),PE=(0,id.T)(Gh()),DE=({className:e,classes:t={},modes:r=[],modeId:n,onChange:a})=>{const i=NE();return ip().createElement(IE(),{className:e},r.map((({id:e,title:r,tooltipTitle:o,Icon:l,disabled:s})=>{return ip().createElement(PE,{disabled:s,showForDisabled:s&&!!o,key:String(e),className:up()(i.button,{[i.current]:n===e},t.button),tooltipTitle:o,onClick:(c=e,()=>a(c)),"data-reltio-id":`reltio-search-mode-${e}`},l&&ip().createElement(l,{className:i.icon}),r&&ip().createElement("div",{className:i.title},r));var c})))},kE=(0,Sp.Z)((()=>({button:{"&.MuiButtonGroup-grouped":{minWidth:"90px",padding:"8px 12px"}}})));function LE(){return LE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},LE.apply(null,arguments)}const UE=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return ip().createElement("svg",LE({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),ip().createElement("defs",null,ip().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"})),ip().createElement("g",{stroke:"none",strokeWidth:"1"},ip().createElement("g",{transform:"translate(.2)"},ip().createElement("mask",{id:"svg3365802068b",fill:"#fff"},ip().createElement("use",{xlinkHref:"#svg3365802068a"})),ip().createElement("g",{mask:"url(#svg3365802068b)"},ip().createElement("g",null,ip().createElement("g",null,ip().createElement("path",{d:"M0 0h24v24H0z"})))))))};function jE(){return jE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},jE.apply(null,arguments)}const FE=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return ip().createElement("svg",jE({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),ip().createElement("defs",null,ip().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"})),ip().createElement("g",{stroke:"none",strokeWidth:"1"},ip().createElement("g",{transform:"translate(.2)"},ip().createElement("mask",{id:"svg4195527304b",fill:"#fff"},ip().createElement("use",{xlinkHref:"#svg4195527304a"})),ip().createElement("g",{mask:"url(#svg4195527304b)"},ip().createElement("path",{d:"M0 0h24v24H0z"})))))},ME=e=>{switch(e){case B.ll.TABLE:return UE;case B.ll.LIST:return FE;default:return Kh()}},VE=[{id:B.ll.TABLE,tooltipTitle:ei().text("Table view"),title:ei().text("Table"),Icon:ME(B.ll.TABLE)},{id:B.ll.LIST,tooltipTitle:ei().text("List view"),title:ei().text("List"),Icon:ME(B.ll.LIST)}],BE=({className:e})=>{const t=kE(),r=(0,sp.useDispatch)(),n=(0,sp.useSelector)(Ti.XM);return ip().createElement(DE,{className:e,classes:{button:t.button},modes:VE,modeId:n,onChange:e=>{n!==e&&r((e=>({type:ve,payload:e}))(e))}})};BE.propTypes={className:lp().string};const zE=BE;var HE=r(81085),YE=r.n(HE),WE=r(48139),GE=r.n(WE);const qE="DATA_TENANTS_UPDATED",ZE=e=>t=>({type:e,payload:t}),$E=(ZE(qE),(e=null,t)=>t.type===qE?t.payload||null:e),KE="TENANTS_UPDATED",XE=(ZE(KE),(e=null,t)=>t.type===KE?t.payload||null:e);let QE=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 JE(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const eb={},tb=(0,O.pipe)(v.normalizeMetadata,v.parseMetadata,v.localizeMetadata),rb=(0,O.map)(v.localizeMetadata),nb=(e=eb,t)=>{switch(t.type){case"METADATA_LOADED":{const{tenant:r,metadata:n}=t.payload;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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){JE(e,t,r[t])}))}return e}({},e,{[r]:tb(n)})}case QE.LOCALIZATION_LOADED:return rb(e);default:return e}};let ab=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.CANCEL_PROFILE_VALIDATION="CANCEL_PROFILE_VALIDATION",e.PROFILE_SAVED="PROFILE_SAVED",e.RUN_AUTHORING_TASK_ACTION="RUN_AUTHORING_TASK_ACTION",e}({});const ib=ZE(ab.ADD_ATTRIBUTES),ob=ZE(ab.ADD_DEFAULT_VALUES),lb=ZE(ab.MODIFY_ATTRIBUTE),sb=ZE(ab.REMOVE_ATTRIBUTE),cb=ZE(ab.ADD_NEXT_PAGE_ATTRIBUTE_VALUES),ub=ZE(ab.PROCESS_NEXT_PAGE_ATTRIBUTE_VALUES),pb=ZE(ab.REQUEST_NEXT_PAGE_ATTRIBUTE_VALUES),db=ZE(ab.SAVE_PROFILE),mb=ZE(ab.RUN_AUTHORING_TASK_ACTION),fb=ZE(ab.SAVE_DRAFT),yb=ZE(ab.PROFILE_SAVED),gb=ZE(ab.VALIDATE_PROFILE),hb=ZE(ab.CANCEL_PROFILE_VALIDATION);let Eb=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 bb=ZE(Eb.DEPENDENT_LOOKUPS_STRUCTURE_SET),vb=ZE(Eb.DEPENDENT_LOOKUPS_INITED_TYPE_URIS_ADDED),Tb=ZE(Eb.DEPENDENT_LOOKUPS_EDITORS_BLOCKED),Ob=ZE(Eb.DEPENDENT_LOOKUPS_EDITOR_TOUCHED);let Sb=function(e){return e.MODE_UPDATED="MODE_UPDATED",e.MODE_EDITING_CANCELED="MODE_EDITING_CANCELED",e.MODE_UPDATE_REQUESTED="MODE_UPDATE_REQUESTED",e}({});function xb(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Cb(e,t,r[t])}))}return e}function Cb(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const wb={structure:{},editors:{},initedTypeUris:[]},Ab="SEARCH_RESULTS_SET",Rb="KEYWORD_UPDATED",_b="UPDATE_STATE",Ib="ACTIVITY_FILTER_UPDATED",Nb="GLOBAL_FILTER_UPDATED",Pb="SEARCH_OPTIONS_UPDATED",Db="SET_SEARCH_OPTIONS_CONFIG",kb="SET_SEARCH_PROVIDER_DATA",Lb="SET_SEARCH_NAVIGATION_DATA",Ub="UPDATE_SEARCH_NAVIGATION_DATA_FIELDS",jb=ZE(Ab),Fb=ZE(Rb),Mb=ZE(_b),Vb=ZE("SAVE_STATE"),Bb=ZE(Ib),zb=ZE(Nb),Hb=ZE(Pb),Yb=ZE(Db),Wb=ZE(kb),Gb=ZE(Lb),qb=ZE(Ub),Zb=ZE("UPDATE_SEARCH_NAVIGATION_DATA_ON_MERGE"),$b=(0,O.path)(["globalFilter","savedSearchesUris"]),Kb="searchNavigation";function*Xb(){const e=yield(0,Ra.Ys)(uI.selectors.getSearchNavigationData),t=yield(0,Ra.Ys)(uI.selectors.getSearchProviderData);sessionStorage.setItem(Kb,JSON.stringify({searchNavigationData:e,searchProviderData:t}))}function*Qb(){let e;try{e=JSON.parse(sessionStorage.getItem(Kb))||{}}catch(t){e={}}const{searchNavigationData:t,searchProviderData:r}=e;t&&r&&(yield(0,Ra.gz)(Wb(r)),yield(0,Ra.gz)(Gb(t)))}const Jb=[function*(){yield(0,Ra.Fm)([Lb,Ub,QE.OPEN_ENTITY],Xb)},function*(){yield(0,Ra.RE)(Qb)}];function ev(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.push.apply(n,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=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const rv={searchResults:[],keyword:null,searchOptions:{searchByOv:!1,ovOnly:!1},activityFilter:"active",globalFilter:{query:null,savedSearchesUris:[],isMuted:!0},searchProviderData:null,searchNavigationData:null},nv=(e=rv,t)=>{switch(t.type){case Ab:return ev({},e,{searchResults:t.payload});case Rb:{const r=(0,O.pick)(["value","isRawFilter"],t.payload||{});return ev({},e,{keyword:(0,O.isEmpty)(r)?null:r})}case _b:return ev({},rv,{keyword:(0,O.isNil)(t.payload.keyword)||(0,O.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 Ib:return ev({},e,{activityFilter:t.payload});case Nb:return ev({},e,{globalFilter:(0,v.isEmptyValue)(t.payload)?rv.globalFilter:t.payload});case Pb:return ev({},e,{searchOptions:ev({},e.searchOptions,t.payload)});case Db:{const r=!!t.payload.showSearchByOv;return ev({},e,{searchOptions:{searchByOv:r,ovOnly:r}})}case kb:return ev({},e,{searchProviderData:t.payload});case Lb:return ev({},e,{searchNavigationData:t.payload});case Ub:return ev({},e,{searchNavigationData:ev({},e.searchNavigationData,t.payload)});case QE.OPEN_ENTITY:{var r;const n=(0,v.removeDtssPrefixFromEntityUri)(t.payload.uri);return"navigation"===t.payload.source||n===(null===(r=e.searchNavigationData)||void 0===r?void 0:r.uri)?e:ev({},e,{searchNavigationData:null})}default:return e}},av=({uri:e,source:t=null,screen:r="profile"})=>({type:QE.OPEN_ENTITY,payload:{uri:e,source:t,screen:r}}),iv=({entity:e})=>({type:QE.NEW_ENTITY_SHOWN,payload:{entity:e}}),ov=ZE(QE.ENTITY_DELETION_FINISHED),lv=ZE(QE.OPEN_PERSPECTIVE),sv=e=>({type:QE.SHOW_NOTIFICATION,payload:e}),cv=e=>({type:QE.CLOSE_NOTIFICATION,payload:e}),uv=ZE(QE.CLEAR_NOTIFICATIONS),pv=ZE(QE.PATHS_SET),dv=ZE(QE.UI_PATH_SET),mv=ZE(QE.UI_CONFIG_LOADED),fv=ZE(QE.NEW_UI_CONFIG_LOADED),yv=ZE(QE.LOCALE_ATTRIBUTE_PRESENTATION_LOADED),gv=ZE(QE.AUTOCLOSE_INTERVAL_LOADED),hv=ZE(QE.SET_PREFER_REACT),Ev=ZE(QE.NUMBER_FORMAT_UPDATED),bv=(e,t,r)=>({type:QE.OPEN_CONSOLE_APP,payload:{name:e,path:t,query:r}}),vv=ZE(QE.OPEN_APP_FROM_CHOCOLATE_BAR),Tv=ZE(QE.OPEN_GRAPH),Ov=ZE(QE.LOCALIZATION_LOADED),Sv=ZE(QE.DATE_MASK_UPDATED),xv=ZE(QE.DATE_TIME_MASK_UPDATED),Cv=e=>({type:QE.OPEN_SEARCH,payload:"searchState"in e?e:{searchState:e}}),wv=e=>({type:QE.OPEN_DASHBOARD,payload:e}),Av=ZE(QE.OPEN_HISTORY_EVENT),Rv=ZE(QE.OPEN_NEW_ENTITY_WITH_AUTHORING),_v=ZE(QE.OPEN_PREVIOUS_PAGE),Iv=ZE(QE.NAVIGATE),Nv=ZE(QE.KEYS_SET),Pv=ZE(QE.OPEN_PIVOTING_PERSPECTIVE),Dv=ZE(QE.ERROR_SET),kv=ZE(QE.DOCUMENTATION_SET),Lv=ZE(QE.ADD_DASHBOARD_EXTERNAL_VIEW),Uv=ZE(QE.SET_USE_SHARED_PREFERENCES);var jv=r(97698);function Fv(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Mv=(0,O.path)(["paths","imagePath"]),Vv=(0,O.path)(["paths","exportPath"]),Bv=(0,O.path)(["paths","apiPath"]),zv=(0,O.path)(["paths","uiPath"]),Hv=(0,O.path)(["paths","reltioPath"]),Yv=(0,O.path)(["paths","dtssPath"]),Wv=(0,O.path)(["paths","exportDQPath"]),Gv=(0,O.either)((0,O.path)(["newConfig","properties","workflow","path"]),(0,O.path)(["paths","workflowPath"])),qv=(0,O.prop)("paths"),Zv=(0,O.path)(["paths","workflowEnvironmentURL"]),$v=(0,O.path)(["paths","collaborationPath"]),Kv=(0,O.path)(["paths","imageServicePath"]),Xv=(0,O.path)(["paths","dvfPath"]),Qv=(0,O.path)(["paths","validationServicePath"]),Jv=(0,O.path)(["paths","adminToolsPath"]),eT=(0,O.path)(["paths","mlDqPath"]),tT=(0,jv.createSelector)((e=>(0,O.path)(["newConfig","properties","attributes","presentation"])(e)),(()=>v.intl.getLocale()),((e={},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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Fv(e,t,r[t])}))}return e}({},e,(0,v.getSpecialAttributesPresentation)(e,t)))),rT=(0,O.either)((0,O.path)(["config","com.reltio.plugins.entity.EntityRequestSettings","defaultMaxValues"]),(0,O.path)(["newConfig","properties","entity","maxValuesInResponse"])),nT=(0,O.path)(["numberFormat"]),aT=(0,O.either)((0,O.path)(["newConfig","properties","masks","dateMask"]),(0,O.path)(["dateMask"])),iT=(0,O.path)(["notifications"]),oT=(0,O.either)((0,O.path)(["newConfig","properties","masks","dateTimeMask"]),(0,O.path)(["dateTimeMask"])),lT=(0,O.path)(["newConfig","properties","requestProvider"]),sT=["config","com.reltio.plugins.pivoting.PivotingSettings","pivotingAttributes"],cT=(0,O.chain)((0,O.prop)("attributeTypes")),uT=(0,O.ifElse)((0,O.hasPath)(sT),(0,O.path)(sT),(0,O.pipe)((0,O.pathOr)([],["newConfig","pivoting"]),cT)),pT=(0,O.either)((0,O.path)(["config","com.reltio.plugins.imageattribute.fieldsorder"]),(0,O.path)(["newConfig","properties","image","attributeFieldsOrder"])),dT=(0,O.either)((0,O.path)(["config","com.reltio.plugins.ui.LookupAutocomplete"]),(0,O.path)(["newConfig","properties","lookups","autocomplete"])),mT=(0,O.path)(["keys","googleMapKey"]),fT=(0,O.path)(["keys","icpLicenseKey"]),yT=(0,O.pathOr)("",["documentation","releaseNotes"]),gT=["config","com.reltio.plugins.entity.ValidationServiceLevels","levels"],hT=(0,O.ifElse)((0,O.hasPath)(gT),(0,O.path)(gT),(0,O.path)(["newConfig","properties","validation","levels"])),ET=(0,O.ifElse)((0,O.hasPath)(["config","com.reltio.plugins.entity.Validation","validateReadMode"]),(0,O.path)(["config","com.reltio.plugins.entity.Validation","validateReadMode"]),(0,O.pathOr)(!0,["newConfig","properties","validation","validateReadMode"])),bT=(0,O.pathOr)(!1,["newConfig","properties","validation","validateRelations"]),vT=(0,O.pathOr)(!1,["newConfig","properties","validation","validateReferenceEntityInReadMode"]),TT=(0,O.either)((0,O.path)(["config","com.reltio.plugins.workflow.configuration","enabled"]),(0,O.path)(["newConfig","properties","workflow","enabled"])),OT=(0,O.path)(["error"]),ST=(0,O.path)(["paths","servicesPath"]),xT=(0,O.path)(["newConfig"]),CT=(0,O.path)(["newConfig","layout"]),wT=(0,O.path)(["newConfig","profile"]),AT=(0,O.pathOr)(!0,["newConfig","properties","showEntityId"]),RT=(0,O.path)(["newConfig","properties","release"]),_T=(0,O.path)(["newConfig","properties","logo"]),IT=(0,O.path)(["newConfig","properties","headerColor"]),NT=(0,O.path)(["newConfig","properties","showSearchByOv"]),PT=(0,O.path)(["newConfig","properties","showAttributeDescription"]),DT=(0,O.path)(["newConfig","properties","attributes","sorting"]),kT=(0,O.path)(["newConfig","properties","profileCheckUpdate"]),LT=(0,O.pathOr)(!1,["newConfig","properties","newTreeEnabled"]),UT=(0,O.pathOr)(!1,["newConfig","properties","aiAssistant","enabled"]),jT=(0,O.pathOr)(500,["newConfig","properties","aiAssistant","messagesPerDay"]),FT=(0,O.path)(["newConfig","properties","aiAssistant","skills"]),MT=(0,O.path)(["newConfig","properties","aiAssistant","historyBufferSize"]),VT=(0,O.pathOr)(!1,["newConfig","properties","queryEstimator","enabled"]),BT=(0,O.pathOr)(!1,["newConfig","properties","sharedPreferences","enabled"]);function zT(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){HT(e,t,r[t])}))}return e}function HT(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const YT={},WT=(e=YT,t)=>{switch(t.type){case QE.PATHS_SET:return zT({},e,{paths:t.payload});case QE.UI_PATH_SET:return(0,O.evolve)({paths:(0,O.assoc)("uiPath",t.payload)},e);case QE.UI_CONFIG_LOADED:return zT({},e,{config:t.payload});case QE.NEW_UI_CONFIG_LOADED:return zT({},e,{newConfig:t.payload});case QE.LOCALE_ATTRIBUTE_PRESENTATION_LOADED:return(0,O.evolve)({newConfig:{properties:{attributes:{presentation:(0,O.assoc)(v.LOCALE_ATTRIBUTE_PRESENTATION,t.payload)}}}},e);case QE.AUTOCLOSE_INTERVAL_LOADED:return zT({},e,{autoCloseInterval:t.payload});case QE.NUMBER_FORMAT_UPDATED:return zT({},e,{numberFormat:t.payload});case QE.DATE_MASK_UPDATED:return zT({},e,{dateMask:t.payload});case QE.DATE_TIME_MASK_UPDATED:return zT({},e,{dateTimeMask:t.payload});case QE.KEYS_SET:return zT({},e,{keys:t.payload});case QE.ERROR_SET:return zT({},e,{error:t.payload});case QE.DOCUMENTATION_SET:return zT({},e,{documentation:t.payload});case QE.SHOW_NOTIFICATION:return zT({},e,{notifications:[...e.notifications||[],t.payload]});case QE.CLOSE_NOTIFICATION:return(0,O.evolve)({notifications:(0,O.reject)((0,O.propEq)("id",t.payload))},e);case QE.CLEAR_NOTIFICATIONS:return zT({},e,{notifications:[]});case QE.SET_USE_SHARED_PREFERENCES:return zT({},e,{useSharedPreferences:t.payload});default:return e}},GT="USER_UPDATED",qT=(ZE(GT),(e=null,t)=>t.type===GT?t.payload||null:e),ZT="TENANT_UPDATED",$T="TENANT_NAME_UPDATED",KT=(ZE(ZT),ZE($T),(0,O.prop)("id")),XT=(0,O.prop)("name");function QT(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){JT(e,t,r[t])}))}return e}function JT(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const eO=(e=null,t)=>{switch(t.type){case ZT:return QT({},e,{id:t.payload});case $T:return QT({},e,{name:t.payload});default:return e}},tO="ENVIRONMENT_UPDATED",rO="ENVIRONMENT_ALIAS_UPDATED",nO=(ZE(tO),ZE(rO),(0,O.prop)("id")),aO=(0,O.prop)("alias");function iO(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){oO(e,t,r[t])}))}return e}function oO(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const lO=(e=null,t)=>{switch(t.type){case tO:return iO({},e,{id:t.payload});case rO:return iO({},e,{alias:t.payload});default:return e}},sO=e=>e.dataTenants,cO=e=>e.tenants,uO=(e,t=ex(e))=>e.metadata&&e.metadata[t],pO=e=>e.tenant,dO=e=>e.environment,mO=e=>e.user,fO=e=>e.ui,yO=e=>e.profile,gO=e=>e.search,hO=e=>QA(yO(e)),EO=e=>mR(yO(e)),bO=e=>fR(yO(e)),vO=(e,t)=>OR(yO(e),t),TO=(e,t,r)=>bR(yO(e),t,r),OO=(e,t,r)=>vR(yO(e),t,r),SO=(e,t,r)=>ER(yO(e),t,r),xO=(e,t)=>SR(yO(e),t),CO=e=>xR(yO(e)),wO=(e,t,r)=>TR(yO(e),t,r),AO=e=>nR(yO(e)),RO=e=>eR(yO(e)),_O=e=>hR(yO(e)),IO=e=>$R(yO(e)),NO=e=>KR(yO(e)),PO=e=>XR(yO(e)),DO=e=>QR(yO(e)),kO=e=>JR(yO(e)),LO=(e,t)=>yR(yO(e),t),UO=(e,t)=>gR(yO(e),t),jO=e=>JA(yO(e)),FO=(e,t)=>e_(yO(e),t),MO=(e,t,{uri:r})=>LR(yO(e),t,r),VO=(e,t,{uri:r})=>UR(yO(e),t,r),BO=(e,t,r)=>jR(yO(e),t,r),zO=e=>Mv(fO(e)),HO=e=>Bv(fO(e)),YO=e=>Vv(fO(e)),WO=e=>zv(fO(e)),GO=e=>Hv(fO(e)),qO=e=>Kv(fO(e)),ZO=e=>Jv(fO(e)),$O=e=>tT(fO(e)),KO=e=>nT(fO(e)),XO=e=>rT(fO(e)),QO=e=>(e=>e.autoCloseInterval)(fO(e)),JO=e=>aT(fO(e)),eS=e=>oT(fO(e)),tS=e=>lT(fO(e)),rS=e=>iT(fO(e)),nS=e=>uT(fO(e)),aS=e=>pT(fO(e)),iS=e=>dT(fO(e)),oS=e=>mT(fO(e)),lS=e=>fT(fO(e)),sS=e=>hT(fO(e)),cS=e=>ET(fO(e)),uS=e=>bT(fO(e)),pS=e=>vT(fO(e)),dS=e=>UT(fO(e)),mS=e=>jT(fO(e)),fS=e=>FT(fO(e)),yS=e=>MT(fO(e)),gS=e=>BT(fO(e)),hS=e=>(e=>e.searchResults)(gO(e)),ES=e=>(e=>e.keyword)(gO(e)),bS=e=>v.getActivityFilter(gO(e)),vS=e=>v.getSearchOptions(gO(e)),TS=e=>(e=>e.searchProviderData)(gO(e)),OS=e=>(e=>e.searchNavigationData)(gO(e)),SS=(e,t)=>v.getGlobalSearchRequestOptions(gO(e),t),xS=e=>v.getStringifiedSearchOptions(gO(e)),CS=e=>(e=>e.globalFilter)(gO(e)),wS=e=>v.getGlobalFilterQuery(gO(e)),AS=e=>$b(gO(e)),RS=e=>iR(yO(e)),_S=e=>CR(yO(e)),IS=e=>wR(yO(e)),NS=e=>AR(yO(e)),PS=e=>tR(yO(e)),DS=(e,t)=>RR(yO(e),t),kS=(e,t)=>_R(yO(e),t),LS=(e,t)=>IR(yO(e),t),US=(e,t,r)=>NR(yO(e),t,r),jS=(e,t,r)=>PR(yO(e),t,r),FS=(e,t,r)=>DR(yO(e),t,r),MS=(e,t)=>kR(yO(e),t),VS=e=>Mv(fO(e))||Bv(fO(e)),BS=e=>(e=>null==e?void 0:e.username)(mO(e)),zS=e=>(e=>null==e?void 0:e.roles)(mO(e)),HS=e=>rR(yO(e)),YS=(e,t)=>FR(yO(e),t),WS=(e,t)=>MR(yO(e),t),GS=(e,t)=>VR(yO(e),t),qS=e=>BR(yO(e)),ZS=(e,t,r)=>zR(yO(e),t,r),$S=(e,t)=>HR(yO(e),t),KS=e=>oR(yO(e)),XS=e=>sR(yO(e)),QS=e=>cR(yO(e)),JS=e=>i_(yO(e),SC(e)),ex=e=>KT(pO(e)),tx=e=>XT(pO(e)),rx=e=>nO(dO(e)),nx=e=>aO(dO(e)),ax=e=>Yv(fO(e)),ix=e=>Wv(fO(e)),ox=e=>Gv(fO(e)),lx=e=>qv(fO(e)),sx=e=>Zv(fO(e)),cx=e=>TT(fO(e)),ux=e=>$v(fO(e)),px=e=>Xv(fO(e)),dx=e=>Qv(fO(e)),mx=e=>eT(fO(e)),fx=(0,jv.createSelector)(mO,ex,v.canUserRegisterConfigEnvironments),yx=(0,jv.createSelector)(mO,ex,v.canUserCreateWorkflowConfigJar),gx=(0,jv.createSelector)(mO,ex,v.canUserCreateWorkflowEnvironmentConfigJar),hx=(0,jv.createSelector)(mO,ex,v.canUserExecuteWorkflowJobs),Ex=(0,jv.createSelector)(mO,ex,v.canUserExecuteWorkflowJobsSyncBusinessProcessData),bx=(0,jv.createSelector)(mO,ex,v.canUserExecuteWorkflowJobsTerminateProcessInstance),vx=(0,jv.createSelector)(mO,ex,v.canUserExecuteWorkflowJobsUpdateTasks),Tx=(0,jv.createSelector)(mO,ex,v.canUserExecuteWorkflowJobsValidateTasks),Ox=(0,jv.createSelector)(mO,ex,v.canUserManageWorkflowDefinition),Sx=(0,jv.createSelector)(mO,ex,v.canUserManageWorkflowEnvironmentDefinition),xx=(0,jv.createSelector)(mO,ex,v.canUserReadWorkflowDataTask),Cx=(0,jv.createSelector)(mO,ex,v.canUserUpdateProcessInstance),wx=(0,jv.createSelector)(mO,ex,v.canUserUpdateWorkflowDataTask),Ax=(0,jv.createSelector)(mO,ex,v.canUserViewProcessInstanceSearchQuery),Rx=(0,jv.createSelector)(mO,ex,v.canUserViewWorkflowConfigJar),_x=(0,jv.createSelector)(mO,ex,v.canUserViewWorkflowDefinition),Ix=(0,jv.createSelector)(mO,ex,v.canUserViewWorkflowEnvironmentConfigJar),Nx=(0,jv.createSelector)(mO,ex,v.canUserViewWorkflowJobs),Px=(0,jv.createSelector)(mO,ex,v.canUserMakeExport),Dx=(0,jv.createSelector)(mO,ex,v.canUserMakeActivitiesExport),kx=(0,jv.createSelector)(mO,ex,v.canUserImportEntitiesFromDT),Lx=(0,jv.createSelector)(mO,ex,v.canUserReadEntitiesFromDT),Ux=(0,jv.createSelector)(mO,ex,v.canUserStartProcessInstanceFromQuery),jx=(0,jv.createSelector)(mO,ex,v.canUserMakeBulkUpdate),Fx=(0,jv.createSelector)(mO,ex,v.canUserDeleteProfiles),Mx=(0,jv.createSelector)(mO,ex,v.canUserOpenDataLoader),Vx=(0,jv.createSelector)(mO,ex,v.canUserGetDQStatistic),Bx=(0,jv.createSelector)(mO,ex,v.canUserReadDVF),zx=(0,jv.createSelector)(ux,DO,((e,t)=>!!e&&!t)),Hx=(0,jv.createSelector)(ox,cx,((e,t)=>!!e&&!!t)),Yx=(e,t)=>{var r;return null===(r=uR(yO(e)))||void 0===r?void 0:r.find((0,O.propEq)("id",t))},Wx=(e,t)=>Boolean(Yx(e,t)),Gx=e=>Wx(e,v.SidePanelViewId.Workflow),qx=e=>Wx(e,v.SidePanelViewId.Discussion),Zx=e=>Wx(e,v.SidePanelViewId.History),$x=e=>Wx(e,v.SidePanelViewId.DB),Kx=e=>{var t;return(null===(t=Yx(e,v.SidePanelViewId.DB))||void 0===t?void 0:t.views)??[]},Xx=e=>aR(yO(e)),Qx=e=>YR(yO(e)),Jx=(e,t)=>WR(yO(e),t),eC=e=>GR(yO(e)),tC=e=>qR(yO(e)),rC=(e,t)=>ZR(yO(e),t),nC=e=>OT(fO(e)),aC=(e,t)=>{const r=uO(e),n=RS(e),a=hO(e),{nextEntry:i,inRelations:o=[],outRelations:l=[]}=t,s=n===v.Mode.Editing||n===v.Mode.Suggesting,c=n===v.Mode.Suggesting&&(0,v.isTempUri)(null==a?void 0:a.uri),u=SC(e);if(!s||c&&!u||i||!a)return!1;{const e=(0,v.checkMetadataForUpdate)(n,(0,v.getEntityType)(r,a.type)),t=o.concat(l).map((e=>(0,v.getRelationType)(r,e.uri||e))).some((0,O.both)((0,v.checkMetadataForCreate)(n),(0,v.checkMetadataForUpdate)(n)));return e&&t}},iC=(0,jv.createSelector)(hO,IS,PO,IO,v.getProfileEntityWithHistoryDiff),oC=(0,jv.createSelector)(hO,IS,PO,v.getProfileEntityWithoutHistoryDiff),lC=e=>ST(fO(e)),sC=e=>xT(fO(e)),cC=e=>CT(fO(e)),uC=e=>wT(fO(e)),pC=e=>AT(fO(e)),dC=e=>RT(fO(e)),mC=e=>yT(fO(e)),fC=e=>_T(fO(e)),yC=e=>IT(fO(e)),gC=e=>NT(fO(e)),hC=e=>PT(fO(e)),EC=e=>DT(fO(e)),bC=e=>kT(fO(e)),vC=(e,t)=>((e,t)=>(0,v.getAuthoringItemsFromLayoutByEntityType)(wT(e),t))(fO(e),t),TC=(e,t)=>((e,t)=>(0,O.path)(["newConfig","properties","cleanse",t])(e))(fO(e),t),OC=e=>LT(fO(e)),SC=e=>{const t=hO(e),r=vC(e,null==t?void 0:t.type);return!(0,v.isEmptyValue)(r)},xC=e=>VT(fO(e)),CC=e=>pR(yO(e)),wC=e=>dR(yO(e)),AC=(e,t)=>Hx(e)&&Ux(e)&&(0,v.checkMetadataPermission)(v.MetadataPermissions.INITIATE_CHANGE_REQUEST,t);let RC=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}({}),_C=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.UPDATE_RELATION_RATING="UPDATE_RELATION_RATING",e}({});var IC=r(51095);const NC=(e,t)=>e.find((0,O.pipe)(v.getRelationUriFromConnection,(0,O.equals)(t))),PC=(e,t)=>(0,O.path)([t,"connections"],e),DC=r.n(IC)()(PC,((e,t)=>(0,O.path)([t,"drafts"],e)),((e,t,r)=>r),((e=[],t={},r)=>{var n;const{addedConnections:a=[],editedConnections:i=[],removedUris:o=[],ignoredRelationData:l=[]}=t,s=(0,O.pipe)(v.getRelationUriFromConnection,O.equals,(0,O.find)(O.__,o)),c=l.map((e=>e.relationUri)),u=(0,O.pipe)(v.getRelationUriFromConnection,O.equals,(0,O.find)(O.__,c)),p=r?(null===(n=e.find((e=>e.entity.entityUri===r)))||void 0===n?void 0:n.connections)||[]:e,d=a.filter((0,O.propEq)("parentEntityUri",r));return d.map(v.markNew).concat(p.filter((e=>!d.some((0,O.pipe)(v.getRelationUriFromConnection,(0,O.equals)((0,v.getRelationUriFromConnection)(e)))))).map((0,O.pipe)((0,O.either)((e=>(0,O.pipe)((0,O.eqBy)(v.getRelationUriFromConnection),(0,O.find)(O.__,i),(0,O.unless)(O.isNil,v.markEdited))(e)),O.identity),(0,O.when)(s,v.markRemoved),(0,O.when)(u,v.markIgnored))))}))(((e,t,r)=>t+r)),kC=(e,t,r)=>{const n=(0,v.getTempRelations)(e,t);return NC(n,r)};function*LC(e){yield(0,Ra.gw)(0);const t=e.payload,r=yield(0,Ra.Ys)(uO),n=yield(0,Ra.Ys)(Qx),a=[t.type],i=yield(0,Ra.Ys)(eC),o=(0,v.initDependentLookups)({structure:n,metadata:r,typeUris:a,alreadyAddedTypeUris:i}),l=(0,v.populateDependentLookupsFromEntity)({structure:o,metadata:r,entityOrRelation:t});yield(0,Ra.gz)(bb(l)),yield(0,Ra.gz)(vb(a))}function*UC(e,t){const r=(0,v.getBaseUri)(e);return(0,v.isRelationUri)(r)?yield(0,Ra.Ys)(OO,t,r):yield(0,Ra.Ys)(LO,r)}function*jC(e){const{attributeType:t,metadata:r,parentUri:n,viewId:a}=e.payload,i=yield(0,Ra.RE)(UC,n,a),o=yield(0,Ra.Ys)(Qx);if(i)if(t){const e=(0,v.findAttributeValuesByTypeUri)(r,i,t.uri).filter((({uri:e})=>e.startsWith(n)))[0],a=(0,v.addValueToDependentLookups)({structure:o,attributeValue:e});yield(0,Ra.gz)(bb(a))}else{const e=[i.type],t=yield(0,Ra.Ys)(eC),n=(0,v.initDependentLookups)({structure:o,metadata:r,typeUris:e,alreadyAddedTypeUris:t}),a=(0,v.populateDependentLookupsFromEntity)({structure:n,metadata:r,entityOrRelation:i});yield(0,Ra.gz)(bb(a)),yield(0,Ra.gz)(vb(e))}}function*FC(e){const t=e.payload,r=yield(0,Ra.Ys)(uO),n=yield(0,Ra.Ys)(Qx);let a=n;for(const e of t){const{attributeType:t,parentUri:i,viewId:o}=e;if((0,v.isAttributeTypeInDependentLookups)(n,t.uri)){const e=yield(0,Ra.RE)(UC,i,o);e&&(a=(0,v.syncAttributeTypeWithDependentLookups)({structure:a,entityOrRelation:e,attrTypeUri:t.uri,metadata:r}))}}a!==n&&(yield(0,Ra.gz)(bb(a)))}function*MC({structure:e,attributeType:t,value:r}){if((0,v.isReference)(t)&&r){const t=(0,v.getReferencedEntityUriFromAttrValue)(r);if((0,v.isTempUri)(t))return yield(0,Ra.RE)(HC,e,t)}return e}function*VC({structure:e,uri:t,attributeType:r,value:n}){let a=(0,v.removeValuesFromDependentLookups)({structure:e,uri:t});if(a=yield(0,Ra.RE)(MC,{structure:a,attributeType:r,value:n}),a=(0,v.addValueToDependentLookups)({structure:a,attributeValue:n}),(0,v.isReference)(r)&&n){const e=(0,v.getReferencedEntityUriFromAttrValue)(n);(0,v.isTempUri)(e)&&(a=yield(0,Ra.RE)(zC,a,e))}a!==e&&(yield(0,Ra.gz)(bb(a)))}function*BC(e){yield(0,Ra.gw)(0);const{attributeType:t,uri:r,viewId:n,silent:a,value:i}=e.payload,o=yield(0,Ra.Ys)(Qx),l=yield(0,Ra.RE)(UC,r,n);if(l&&(0,v.isAttributeTypeInDependentLookups)(o,t.uri)){const{value:n,lookupCode:i}=e.payload.value,l=i||n;a||(yield(0,Ra.rM)(GC,o,{type:t.uri,uri:r,lookupValue:l}));const s=(0,v.addValueToDependentLookups)({structure:o,attributeValue:{type:t.uri,value:l,uri:r}});yield(0,Ra.gz)(bb(s))}l&&(0,v.isComplexAttribute)(t.type)&&(yield(0,Ra.RE)(VC,{structure:o,uri:r,attributeType:t,value:i}))}function*zC(e,t){const r=yield(0,Ra.Ys)(uO),n=yield(0,Ra.Ys)(LO,t);if(!n)return e;const a=yield(0,Ra.Ys)(jO),i=(0,v.findRelatedTemporaryEntities)(a,n);let o=e;for(const e of[n,...i])o=(0,v.populateDependentLookupsFromEntity)({structure:o,metadata:r,entityOrRelation:e});return o}function*HC(e,t){const r=yield(0,Ra.Ys)(LO,t),n=yield(0,Ra.Ys)(jO),a=(0,v.findRelatedTemporaryEntities)(n,r).map((0,O.prop)("uri"));let i=e;for(const e of[t,...a])i=(0,v.removeValuesFromDependentLookups)({structure:i,uri:e});return i}function*YC(e){const{attributeType:t,uri:r,attributeValue:n,viewId:a}=e.payload,i=yield(0,Ra.Ys)(Qx),o=(0,v.isAttributeTypeInDependentLookups)(i,t.uri);if(yield(0,Ra.RE)(UC,r,a)){o&&(yield(0,Ra.rM)(GC,i,{type:t.uri,uri:r,lookupValue:""}));let e=o||(0,v.isComplexAttribute)(t)?(0,v.removeValuesFromDependentLookups)({structure:i,uri:r}):i;e=yield(0,Ra.RE)(MC,{structure:e,attributeType:t,value:n}),e!==i&&(yield(0,Ra.gz)(bb(e)))}}function*WC(e){yield(0,Ra.gw)(0);const t=yield(0,Ra.Ys)(Qx),r=yield(0,Ra.RE)(HC,t,e.payload);yield(0,Ra.gz)(bb(r))}function*GC(e,t){const r=yield(0,Ra.Ys)(uO),n=yield(0,Ra.Ys)(jO),a=yield(0,Ra.Ys)(LS),i=yield(0,Ra.Ys)(EO),o=yield(0,Ra.Ys)(iS),l=yield(0,Ra.Ys)(tC),s=yield(0,Ra.Ys)(CC),c=(0,v.getDependentLookupStateForValueUri)({structure:e,typeUri:t.type,valueUri:t.uri,modifiedEntities:n,connections:a,entityUri:i,config:o,editorsState:l,hiddenAttributes:s[i]??[]});if(c.length>0){const e=c.map((e=>e.uri));yield(0,Ra.gz)(Tb({uris:e,isBlocked:!0}));try{const e=yield(0,Ra.RE)(v.cascadeUpdate,c,t);for(const n of e){const{type:e,uri:a,lookupValue:i,displayName:o}=n,l=(yield(0,Ra.Ys)(MS,(0,v.getBaseUri)(a)))[0],s=yield(0,Ra.RE)(UC,a,l);s&&(0,v.findAttributeValueByUri)(s,a)&&a!==t.uri&&(yield(0,Ra.gz)(lb({attributeType:(0,v.findAttributeTypeByUri)(r,e),uri:a,value:{value:o||"",lookupCode:i||""},silent:!0,viewId:l})))}}catch(e){console.warn(e)}yield(0,Ra.gz)(Tb({uris:e,isBlocked:!1}))}}function*qC(e){const t=e.payload.connection,r=(0,v.getEntityUriFromConnection)(t);if((0,v.isTempUri)(r)&&(yield(0,Ra.Ys)(LO,r))){yield(0,Ra.qn)(Eb.DEPENDENT_LOOKUPS_STRUCTURE_SET);const e=yield(0,Ra.Ys)(Qx),t=yield(0,Ra.RE)(zC,e,r);yield(0,Ra.gz)(bb(t))}}function*ZC(e){const t=e.payload.relationUri,r=yield(0,Ra.Ys)(Qx),n=(0,v.removeValuesFromDependentLookups)({structure:r,uri:t});yield(0,Ra.gz)(bb(n))}function*$C(e){const t=e.payload.id,r=e.payload.relationUri;if(0===(yield(0,Ra.Ys)(MS,r)).length){const e=yield(0,Ra.Ys)(Qx);let n=(0,v.removeValuesFromDependentLookups)({structure:e,uri:r});const a=yield(0,Ra.Ys)(SO,t),i=NC(a,r),o=(0,v.getEntityUriFromConnection)(i);(0,v.isTempUri)(o)&&(n=yield(0,Ra.RE)(HC,n,o)),yield(0,Ra.gz)(bb(n))}}const KC=[function*(){yield(0,Ra.ib)(RC.MODIFIED_ENTITY_CREATED,LC)},function*(){yield(0,Ra.ib)(RC.MODIFIED_ENTITY_DELETED,WC)},function*(){yield(0,Ra.ib)(ab.ADD_DEFAULT_VALUES,jC)},function*(){yield(0,Ra.ib)(ab.ADD_ATTRIBUTES,FC)},function*(){yield(0,Ra.ib)(ab.MODIFY_ATTRIBUTE,BC)},function*(){yield(0,Ra.ib)(ab.REMOVE_ATTRIBUTE,YC)},function*(){yield(0,Ra.ib)(_C.OPEN_RELATION_EDITOR,qC)},function*(){yield(0,Ra.ib)(_C.SET_RELATION_TYPE,ZC)},function*(){yield(0,Ra.ib)(_C.CLOSE_RELATION_EDITOR,$C)}];let XC=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 QC=(e,t)=>({type:XC.ENTITY_LOADED,payload:{entity:e,silent:t}}),JC=ZE(XC.DEFAULT_PROFILE_PIC_SET),ew=ZE(XC.LOAD_ENTITY),tw=ZE(XC.ENTITY_CREATION_REQUESTED),rw=ZE(XC.ENTITY_CREATION_WITH_AUTHORING_REQUESTED),nw=ZE(XC.ENTITY_AUTHORING_DRAFT_ENTITIES_LOADED),aw=ZE(XC.AUTHORING_DCR_RESOLVED),iw=ZE(XC.ENTITY_REMOVE_REQUESTED),ow=ZE(XC.CLONE_ENTITY),lw=ZE(XC.CLEAR_ENTITY),sw=e=>null==e?void 0:e.uri,cw=(0,jv.createSelector)((e=>null==e?void 0:e.dataTenant),sw,((e,t)=>(0,v.getEntityUriForLink)({dataTenant:e,uri:t})));function uw(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const pw={};let dw=function(e){return e.ERRORS_SET="ERRORS_SET",e.REMOVE_ERROR="REMOVE_ERROR",e.ERROR_DEACTIVATED="ERROR_DEACTIVATED",e}({});const mw=ZE(dw.ERROR_DEACTIVATED),fw=ZE(dw.ERRORS_SET);function yw(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const gw=[];let hw=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 Ew=ZE(hw.HISTORY_DIFF_SET),bw=ZE(hw.HISTORY_DIFF_CLEARED),vw=ZE(hw.HISTORY_EVENT_SET),Tw=ZE(hw.HISTORY_EVENT_CLEARED),Ow=ZE(hw.HISTORY_SLICE_SET),Sw=ZE(hw.HISTORY_MODE_SET);function xw(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Cw(e,t,r[t])}))}return e}function Cw(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ww={mode:v.HistoryMode.Current};let Aw=function(e){return e.PROFILE_LAST_LOADED_TIME_UPDATE="PROFILE_LAST_LOADED_TIME_UPDATE",e}({});ZE(Aw.PROFILE_LAST_LOADED_TIME_UPDATE);let Rw=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 _w=ZE(Rw.LOOKUPS_LOADED),Iw=ZE(Rw.LOOKUPS_FOR_TYPE_RESOLVED),Nw=ZE(Rw.LOOKUPS_LIST_RESOLVED);function Pw(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Dw(e,t,r[t])}))}return e}function Dw(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const kw={},Lw=(e,t)=>({type:Sb.MODE_UPDATED,payload:{mode:e,silent:t}}),Uw=ZE(Sb.MODE_UPDATE_REQUESTED),jw=ZE(Sb.MODE_EDITING_CANCELED),Fw=v.isSuggestMode,Mw=(v.isEditMode,v.isViewMode),Vw=v.isEditableMode,Bw=v.Mode.Viewing,zw=ZE(RC.MODIFIED_ENTITY_CREATED),Hw=ZE(RC.MODIFIED_ENTITY_DELETED),Yw=ZE(RC.MODIFIED_ENTITY_DEFAULT_PROFILE_PIC_SET),Ww=ZE(RC.MODIFIED_ENTITIES_RESET),Gw=ZE(RC.CLEANSE_LOADING);function qw(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Zw(e,t,r[t])}))}return e}function Zw(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const $w={};function Kw(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Xw(e,t,r[t])}))}return e}function Xw(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*Qw(e){const{values:t,parentUri:r,attributeTypeUri:n,attributeTypeName:a}=e.payload;let i=t;const o=yield(0,Ra.Ys)(hO);if(r===o.uri){const e=(0,v.getAttributeSource)(n),r=(0,O.pipe)((0,O.pathOr)([],[e,a]),(0,O.map)((0,O.prop)("uri")))(o),l=(0,O.intersection)(r,t.map((0,O.prop)("uri")));i=t.filter((e=>!l.includes(e.uri)))}i.length&&(yield(0,Ra.gz)(cb(Kw({},e.payload,{values:i}))))}function*Jw(){return{apiPath:yield(0,Ra.Ys)(HO),tenant:yield(0,Ra.Ys)(ex)}}function*eA(e){const{attributeTypeName:t,attributeTypeUri:r}=e.payload,n=yield(0,Ra.RE)(Jw);try{const a=yield(0,Ra.RE)(v.getPagedEntity,Kw({},e.payload,n)),i=(0,v.getAttributeSource)(r),o=(0,O.pathOr)([],[i,t],a);yield(0,Ra.gz)(ub(Kw({},e.payload,{values:o})))}catch(e){console.warn(e),yield(0,Ra.gz)(Dv((0,v.getRequestErrorMessage)(e,ei().text("Something went wrong"))))}}function*tA(e){var t;const{attributeType:r,value:n,uri:a}=e.payload,i=r.uri,o=(0,v.getBaseUri)(i),l=yield(0,Ra.Ys)(TC,o);if(!l)return;const s=yield(0,Ra.Ys)(uO),c=(0,v.getEntityType)(s,o),u=null==c||null===(t=c.cleanseConfig)||void 0===t?void 0:t.infos;if(!u)return;const p=(0,v.getCleanseType)(l,i);if(!(0,v.hasCleanseTypeInEntityType)(p,u))return;const d=(0,v.getCleanseAttributes)(l);if(null!=d&&d.includes(i)){yield(0,Ra.gz)(Gw({isLoading:!0}));try{const e=yield(0,Ra.RE)(v.cleanseData,{cleanseType:p.split("/cleanse/infos/")[1],type:o,attributes:{[r.name]:[{type:i,value:n}]}}),t=(0,v.getBaseUri)(a),l=yield(0,Ra.Ys)(LO,t);if((0,v.hasCleanseStatus)(e))if((0,v.isUnverifiedCleanse)(e))yield(0,Ra.gz)(Dv((0,O.path)(v.CLEANSE_STATUS_ERROR_PATH,e)));else if(l){const{attributes:r}=e,n=(0,v.prepareCleansedAttributes)(t,r);yield(0,Ra.gz)(zw(Kw({},l,{attributes:Kw({},l.attributes,n)})))}}catch(e){console.warn(e),yield(0,Ra.gz)(Dv((0,v.getRequestErrorMessage)(e,ei().text("Something went wrong"))))}yield(0,Ra.gz)(Gw({isLoading:!1}))}}const rA=[function*(){yield(0,Ra.ib)(ab.REQUEST_NEXT_PAGE_ATTRIBUTE_VALUES,eA)},function*(){yield(0,Ra.ib)(ab.PROCESS_NEXT_PAGE_ATTRIBUTE_VALUES,Qw)},function*(){yield(0,Ra.ib)(ab.MODIFY_ATTRIBUTE,tA)}],nA=ZE(_C.RELATIONS_LOADED),aA=ZE(_C.SECOND_LEVEL_RELATIONS_LOADED),iA=(0,O.curry)(((e,t)=>({type:_C.REMOVE_RELATION,payload:{id:e,relationUri:t}}))),oA=(0,O.curry)(((e,t)=>({type:_C.IGNORE_RELATION,payload:{id:e,ignoredRelationData:t}}))),lA=(0,O.curry)(((e,t)=>({type:_C.ADD_RELATION,payload:{id:e,connection:t}}))),sA=(0,O.curry)(((e,t)=>({type:_C.EDIT_RELATION,payload:{id:e,connection:t}}))),cA=(0,O.curry)(((e,t,r,n)=>({type:_C.UPDATE_RELATION_RATING,payload:{id:e,connection:t,rating:r,user:n}}))),uA=(0,O.curry)(((e,t)=>({type:_C.OPEN_RELATION_EDITOR,payload:{id:e,connection:t}}))),pA=(0,O.curry)(((e,t)=>({type:_C.CLOSE_RELATION_EDITOR,payload:{id:e,relationUri:t}}))),dA=(0,O.curry)(((e,t,r)=>({type:_C.SET_RELATION_TYPE,payload:{id:e,relationUri:t,relationType:r}}))),mA=(0,O.curry)(((e,t,r)=>({type:_C.SET_RELATION_ENTITY,payload:{id:e,relationUri:t,entityInfo:r}}))),fA=(0,O.curry)(((e,t,r)=>({type:_C.SET_INITIAL_INFO,payload:{id:e,relationUri:t,tempEntity:r}})));function yA(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){gA(e,t,r[t])}))}return e}function gA(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const hA={},EA={removedUris:[],addedConnections:[],editedConnections:[],ignoredRelationData:[]},bA=(e,t,r)=>{if((0,O.pathEq)([...(0,v.getRelationToAddPath)(e),"relation","relationUri"],t,r))return(0,v.getRelationToAddPath)(e);{const n=((0,O.path)((0,v.getRelationsToEditPath)(e),r)||[]).findIndex((0,O.pathEq)(["relation","relationUri"],t));return n>=0?[...(0,v.getRelationsToEditPath)(e),n]:null}},vA=(e,t,r)=>{const n=bA(e,t,r);return n?(0,O.lensPath)([...n,"relation"]):null},TA=(0,O.pipe)(vA,(e=>(0,O.compose)(e,(0,O.lensProp)("object"))));let OA=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}({});ZE(OA.TREE_LOADED),ZE(OA.TREE_LOADED_WITH_ERROR),ZE(OA.TREE_LOADING),ZE(OA.TREE_SCROLL_TO_NODE_RESET);const SA=ZE(OA.TREE_COMMANDS_CLEARED),xA=(ZE(OA.TREE_CHILDREN_LOADING),ZE(OA.TREE_CURRENT_ENTITY_SHOWN),ZE(OA.TREE_REFRESHED),ZE(OA.TREE_NODE_EXPANDED),ZE(OA.TREE_RELATION_REMOVED),ZE(OA.TREE_NODE_REMOVED),ZE(OA.TREE_SECONDARY_LABEL_SHOWN),ZE(OA.TREE_ENTITIES_MAPPING_LOADED),ZE(OA.TREE_CHANGED)),CA=(ZE(OA.TREE_NODE_EDITED),ZE(OA.TREE_ACTIVENESS_DATE_CHANGED),ZE(OA.TREE_RELATION_REPOINTED),ZE(OA.TREE_RELATION_CREATED),ZE(OA.TREE_NODE_CREATED),ZE(OA.TREE_RELATION_EDITED),ZE(OA.TREE_NODE_EDITED),ZE(OA.TREE_NODE_EDITING_STARTED),ZE(OA.TREE_NODE_EDITING_APPLIED),ZE(OA.TREE_NODE_EDITING_CANCELED),ZE(OA.TREE_NODE_NEW_PARENT_EDITING_STARTED),ZE(OA.TREE_NODE_NEW_PARENT_EDITING_APPLIED),ZE(OA.TREE_NODE_NEW_PARENT_EDITING_CANCELED),ZE(OA.TREE_NODE_NEW_CHILD_EDITING_STARTED),ZE(OA.TREE_NODE_NEW_CHILD_EDITING_APPLIED),ZE(OA.TREE_NODE_NEW_CHILD_EDITING_CANCELED),ZE(OA.TREE_NODE_RELATION_TYPE_CHANGED),ZE(OA.TREE_NODE_ENTITY_CHANGED),ZE(OA.TREE_SORTED),ZE(OA.TREES_STATE_SAVED),ZE(OA.TREES_STATE_RESTORED),ZE(OA.TREE_CHILDREN_LOADED),ZE(OA.TREES_RESTORE_FROM_INITIAL_TREES)),wA=ZE(OA.TREES_RESET_INITIAL_TREES),AA=(ZE(OA.TREE_CANCEL_CHILDREN_LOADING),(0,O.path)(["common","commands"]));var RA=r(76665);function _A(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){IA(e,t,r[t])}))}return e}function IA(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const NA=(e,t,r=[])=>{if((0,O.path)(["entity","uri"],e)===t)return r.forEach((e=>e.expanded=!0)),e;if(e.children)for(const n of e.children){const a=NA(n,t,r.concat(e));if(a)return a}},PA=(e,t)=>{const r=Object.keys(e).reduce(((r,n)=>{const a=e[n];return t[n]&&(a.parent=(0,O.uniq)([].concat(a.parent).concat(t[n].parent).filter(O.identity))),r[n]=a,r}),{});return Object.keys(t).forEach((e=>{r[e]||(r[e]=t[e])})),r},DA=(e,t)=>{if(e&&e.children){const r=e.children.findIndex((({nodeId:e})=>e===t));r>-1&&e.children.splice(r,1)}},kA=(e,t,r=0)=>{e&&e.children&&e.children.splice(r,0,t)},LA=({path:e,value:t,object:r})=>{let n=r;for(let r=0;r<e.length;r++){const a=e[r];r===e.length-1?n[a]="function"==typeof t?t(n[a]):t:(n[a]=n[a]||("number"==typeof a?[]:{}),n=n[a])}},UA=(e={},t,r)=>{e[t]=r,e.children&&e.children.forEach((e=>UA(e,t,r)))},jA=e=>({entity:e.entity,relation:e.relation}),FA=({id:e,draft:t,node:r})=>{LA({path:["editingConnections",r.relation.uri],object:t[e],value:jA(r)})},MA=({id:e,draft:t,node:r,entity:n})=>{LA({path:["editingConnections",r.relation.uri,"entity"],object:t[e],value:n})},VA=({id:e,draft:t,relationUri:r})=>{delete t[e].editingConnections[r]},BA=({id:e,draft:t,relationUri:r})=>t[e].editingConnections[r],zA=e=>{delete e.editingMode,delete e.relatedEntity,delete e.initialConnection},HA=({id:e,draft:t,currentNode:r})=>{const n=t[e].root;if(n===r)t[e].root=r.children[0],t[e].root.children=t[e].root.children||[],t[e].root.children.push(...r.children.slice(1));else{const e=(0,v.findParentNodeById)(n,r.nodeId);DA(e,r.nodeId)}},YA=(e,t,r)=>{const n=[e,"editingConnections",t,"relation"];return(0,O.path)(n,r)?(0,O.lensPath)(n):null},WA=(0,O.pick)(["showSecondaryLabel","sortField","sortOrder"]),GA=e=>({entity:(0,O.pick)(["uri","type","label","secondaryLabel"],e.entity),parent:[],relations:[(0,O.pick)(["uri","type"],e.relation)]});function qA(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.push.apply(n,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=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const $A={common:{commands:[]},trees:{},initialTrees:{}};let KA=function(e){return e.ENTITY_RELATED_ATTRIBUTES_ADDED="ENTITY_RELATED_ATTRIBUTES_ADDED",e}({});ZE(KA.ENTITY_RELATED_ATTRIBUTES_ADDED);const XA={},QA=e=>e.entity,JA=e=>e.modifiedEntities,eR=e=>e.errors,tR=e=>e.relations,rR=e=>e.trees,nR=e=>e.lookups,aR=e=>e.dependentLookups,iR=e=>e.mode,oR=e=>e.lastLoadedTime,lR=e=>e.history,sR=e=>e.operation,cR=e=>e.views,uR=e=>e.sidePanelViews,pR=e=>e.hiddenAttributes,dR=e=>e.controlAttributes,mR=e=>sw(QA(e)),fR=e=>cw(QA(e)),yR=(e,t)=>((e,t)=>t&&e[t])(JA(e),t),gR=(e,t)=>((e,t)=>t&&e[t]&&e[t].defaultProfilePic)(JA(e),t),hR=e=>(0,O.keys)(tR(e)),ER=(e,t,r)=>DC(tR(e),t,r),bR=(e,t,r)=>kC(tR(e),t,r),vR=(e,t,r)=>((e,t,r)=>{const n=kC(e,t,r);return(0,v.getRelationObjectFromConnection)(n)})(tR(e),t,r),TR=(e,t,r)=>((e,t,r)=>{const n=(0,O.pipe)((0,O.pathOr)([],[t,"drafts","addedConnections"]),(0,O.filter)((0,O.pipe)(v.getRelationUriFromConnection,v.isTempUri)),(0,O.when)((0,O.always)(r),(0,O.filter)((0,O.propEq)("parentEntityUri",r))),O.length)(e);return((e,t,r)=>r?(0,O.pipe)((0,O.path)([t,"connections"]),(0,O.find)((({entity:e})=>e.entityUri===r)),(0,O.pathOr)(0,["total"]))(e):(0,O.pathOr)(0,[t,"total"],e))(e,t,r)+n})(tR(e),t,r),OR=(e,t)=>PC(tR(e),t),SR=(e,t)=>v.getDraftsForSaveByViewId(tR(e),t),xR=e=>(e=>(0,O.keys)(e).reduce(((t,r)=>{const{addedConnections:n,editedConnections:a}=(0,v.getDraftsForSaveByViewId)(e,r);return(0,O.pipe)(O.concat,(0,O.map)(v.getEntityUriFromConnection),(0,O.filter)(v.isTempUri),(0,O.concat)(t))(n,a)}),[]))(tR(e)),CR=e=>Vw(iR(e)),wR=e=>Mw(iR(e)),AR=e=>Fw(iR(e)),RR=(e,t)=>v.getRelationToAddByViewId(tR(e),t),_R=(e,t)=>v.getRelationsToEditByViewId(tR(e),t),IR=(e,t)=>v.getAllRelationsToAddAndEdit(tR(e),t),NR=(e,t,r)=>v.getAllRelationsToSave(tR(e),t,r),PR=(e,t,r)=>v.getInitialConnectionTempEntity(e.relations,t,r),DR=(e,t,r)=>v.getInitialConnection(e.relations,t,r),kR=(e,t)=>((e,t)=>Object.keys(e).filter((r=>{const n=(0,v.getTempRelations)(e,r);return!!NC(n,t)})))(tR(e),t),LR=(e,t,r)=>((e,t,r)=>(0,O.pipe)((0,O.filter)((0,O.allPass)([(0,O.propEq)("parentUri",t),(0,O.propEq)("attributeTypeUri",r),(0,O.pipe)((0,O.prop)("uri"),O.isEmpty)])),(0,O.map)((0,O.prop)("message")),(0,O.join)(". "))(e))(eR(e),t,r),UR=(e,t,r)=>((e,t,r)=>(0,O.filter)((0,O.allPass)([(0,O.propEq)("parentUri",t),(0,O.propEq)("attributeTypeUri",r),(0,O.pipe)((0,O.prop)("uri"),O.isEmpty,O.not)]))(e))(eR(e),t,r),jR=(e,t,r)=>v.getCachedActiveErrorsForAttributesPager(eR(e),t,r),FR=(e,t)=>((e,t)=>e.trees[t])(rR(e),t),MR=(e,t)=>((e,t)=>(0,O.path)(["trees",t,"root"],e))(rR(e),t),VR=(e,t)=>((e,t)=>(0,O.path)(["trees",t,"total"],e))(rR(e),t),BR=e=>AA(rR(e)),zR=(e,t,r)=>((e,t,r)=>(0,O.path)(["trees",t,"editingConnections",r],e))(rR(e),t,r),HR=(e,t)=>((e,t)=>(0,O.pipe)((0,O.prop)("trees"),(0,O.when)((0,O.always)(t),(0,O.pick)(t)),O.values,(0,O.map)((0,O.pipe)((0,O.prop)("editingConnections"),O.values)),O.flatten,(0,O.reject)(O.isNil))(e))(rR(e),t),YR=e=>(e=>e.structure)(aR(e)),WR=(e,t)=>v.getDependentLookupsStructureNode(aR(e),t),GR=e=>(e=>e.initedTypeUris)(aR(e)),qR=e=>(e=>e.editors)(aR(e)),ZR=(e,t)=>v.getDependentLookupEditorState(aR(e),t),$R=e=>(e=>e.diff)(lR(e)),KR=e=>(e=>e.event)(lR(e)),XR=e=>(e=>e.slice)(lR(e)),QR=e=>(e=>!(0,v.isEmptyValue)(e.slice))(lR(e)),JR=e=>(e=>e.mode)(lR(e)),e_=(e,t)=>((e,t)=>e[t])((e=>e.entityRelatedAttributes)(e),t),t_=(0,jv.createSelector)(QA,(e=>yR(e,mR(e))),((e,t)=>!(!e||!t||(0,v.isEmptyValue)((0,v.collectAllDiffs)(e,t,!0))))),r_=(0,jv.createSelector)(rR,(e=>{const t=AA(e),r=(0,v.getNotAppliedTreeCommands)((0,O.reject)((0,O.propSatisfies)(v.isEmptyValue,"root"),e.trees));return!(0,v.isEmptyValue)(t)||!(0,v.isEmptyValue)(r)})),n_=(0,jv.createSelector)(tR,(e=>(0,O.keys)(e).reduce(((t,r)=>t||!(0,O.all)(v.isEmptyValue)((0,O.values)(v.getDraftsForSaveByViewId(e,r)))),!1))),a_=(0,jv.createSelector)(t_,n_,r_,((e,t,r)=>e||t||r)),i_=(0,jv.createSelector)(iR,QA,a_,((e,t)=>t),((e,t,r,n)=>!(e===v.Mode.Viewing||!t)&&((0,v.isTempUri)(t.uri)&&!n||r)));let o_=function(e){return e.PROFILE_OPERATION_UPDATE="PROFILE_OPERATION_UPDATE",e}({});const l_=ZE(o_.PROFILE_OPERATION_UPDATE),s_=({metadata:e,modifiedEntities:t,connections:r=[],errors:n})=>n.filter((({attributeType:e,type:t})=>e&&!(0,v.isRequired)(e)&&t===v.ErrorType.missed)).filter((({attributeType:n,parentUri:a})=>{const i=(0,v.getBaseUri)(a),o=(0,v.isEntityUri)(a)?t[i]:(0,v.findConnectionRelationObjectByRelationUri)(r,i),l=o&&(0,v.findAttributeValuesByTypeUri)(e,o,n.uri,!0);return null==l?void 0:l.some((({parent:e,attrValues:t})=>e.uri===a&&0===t.length))})).map((({attributeType:e,parentUri:t})=>({attributeType:e,parentUri:t}))),c_=e=>(0,v.getProfileViewsIdsByTypes)(e,[v.ProfileViewType.Relations,v.ProfileViewType.RelationsTable]);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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){p_(e,t,r[t])}))}return e}function p_(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*d_(){const e=yield(0,Ra.Ys)(uI.selectors.getEntity),t=yield(0,Ra.Ys)(uI.selectors.getMode),r=yield(0,Ra.Ys)(uI.selectors.getEntityUri),n=yield(0,Ra.Ys)(uI.selectors.getMetadata),a=yield(0,Ra.Ys)(uI.selectors.getModifiedEntity,r),i=yield(0,Ra.Ys)(uI.selectors.getModifiedEntities),o=yield(0,Ra.Ys)(uI.selectors.getProfileViews);return{entity:e,modifiedEntity:t===v.Mode.Viewing?e:a,entityUri:r,metadata:n,modifiedEntities:t===v.Mode.Viewing?{[r]:e}:i,profileViews:o,mode:t}}function*m_(){return u_({},yield(0,Ra.RE)(d_),{validationServicePath:yield(0,Ra.Ys)(uI.selectors.getValidationServicePath),tenant:yield(0,Ra.Ys)(uI.selectors.getTenant),severity:yield(0,Ra.Ys)(uI.selectors.getValidationServiceSeverityLevels)})}function*f_(){const{entityUri:e,metadata:t,modifiedEntities:r,modifiedEntity:n,profileViews:a}=yield(0,Ra.RE)(d_);if(!e)return[];const i=c_(a),o=(0,v.getProfileViewsIdsByTypes)(a,[v.ProfileViewType.HierarchyTree]),l=yield(0,Ra.Ys)(US,i,!0),s=yield(0,Ra.Ys)(uI.selectors.getRelations),c=yield(0,Ra.Ys)(uI.selectors.getAllTreesEditingConnections,o);return[...(0,v.validateEntityLocally)(t,r,n,(0,v.isAvailableAttributeTypeForProfile)(a)),...l.flatMap((e=>(0,v.validateConnection)(t,r,e))),...c.flatMap((e=>(0,v.validateHierarchyConnection)(t,e)))].map((n=>u_({},n,{path:(0,v.evaluateErrorPath)({entityUri:e,metadata:t,connections:l,entitiesMap:r,relationsState:s,relationViewsIds:i},n.uri||n.parentUri)})))}function*y_(){const{entityUri:e,metadata:t,modifiedEntity:r,mode:n,validationServicePath:a}=yield(0,Ra.RE)(m_);if(a&&e&&(0,v.shouldUseValidationService)(t,null==r?void 0:r.type)){const r=yield(0,Ra.RE)((0,v.isTempUri)(e)?h_:E_),{modifiedEntities:a}=yield(0,Ra.RE)(d_),i=(0,O.pipe)(v.convertValidationServiceErrors,(0,O.uniqBy)(v.getErrorUniqKey))(r,{entityUri:e,metadata:t,entitiesMap:a});if(n!==v.Mode.Viewing){const e=s_({metadata:t,modifiedEntities:a,errors:i});e.length&&(yield(0,Ra.gz)(ib(e)))}return i}return[]}function g_(e){return console.warn("Validation service error",e),[]}function*h_(){const{mode:e,modifiedEntity:t,modifiedEntities:r,validationServicePath:n,tenant:a,severity:i}=yield(0,Ra.RE)(m_),o=(0,v.prepareEntityForValidation)(t,r);try{return yield(0,Ra.RE)(v.validateEntity,{validationServicePath:n,entity:o,tenant:a,severity:i,options:(0,O.reject)(O.isNil,[v.ValidationServiceOption.preserveURIs,e===v.Mode.Editing?v.ValidationServiceOption.validateDataPermissions:null])})}catch(e){return g_(e)}}function*E_(){const{entityUri:e,mode:t,entity:r,modifiedEntity:n,modifiedEntities:a,validationServicePath:i,metadata:o,tenant:l,severity:s}=yield(0,Ra.RE)(m_),c=yield(0,Ra.Ys)(uI.selectors.getValidateReferenceEntityInReadMode),u=(0,v.getEntityType)(o,r.type),p=(null==u?void 0:u.forceOvForUiUpdates)??!0,d=t===v.Mode.Viewing?[]:(0,v.collectDiffForValidation)(r,n,a,p);try{return yield(0,Ra.RE)(v.validateEntityChanges,{validationServicePath:i,uri:e,diff:d,tenant:l,severity:s,options:(0,O.reject)(O.isNil,[v.ValidationServiceOption.preserveURIs,v.ValidationServiceOption.updateAttributeUpdateDates,t===v.Mode.Editing?v.ValidationServiceOption.validateDataPermissions:null,t===v.Mode.Viewing&&c?v.ValidationServiceOption.validateReferenceEntityAttribute:null])})}catch(e){return g_(e)}}function*b_(){const{entityUri:e,metadata:t,mode:r,modifiedEntity:n,modifiedEntities:a,validationServicePath:i,tenant:o,severity:l,profileViews:s}=yield(0,Ra.RE)(m_),c=yield(0,Ra.Ys)(uI.selectors.getValidateRelations);if(i&&c){const c=c_(s),u=(yield(0,Ra.Ys)(US,c)).filter((e=>(0,v.shouldUseValidationService)(t,e.relation.relationType)));if(u.length>0){let s=[];const p=(0,v.prepareConnectionsForValidation)(u,n,a,t);try{const e=yield(0,Ra.RE)(v.validateRelations,{validationServicePath:i,body:p,tenant:o,severity:l,options:(0,O.reject)(O.isNil,[v.ValidationServiceOption.preserveURIs,r===v.Mode.Editing?v.ValidationServiceOption.validateDataPermissions:null])});s=Object.values(e.validated).flat()}catch(e){return g_(e)}const d=yield(0,Ra.Ys)(uI.selectors.getModifiedEntities),m=yield(0,Ra.Ys)(uI.selectors.getRelations),f=(0,O.pipe)(v.convertValidationServiceErrors,(0,O.uniqBy)(v.getErrorUniqKey))(s,{entityUri:e,metadata:t,entitiesMap:d,connections:u,relationsState:m,relationViewsIds:c}),y=s_({metadata:t,modifiedEntities:d,connections:u,errors:f});return y.length&&(yield(0,Ra.gz)(ib(y))),f}}return[]}function*v_(e){if((null==e?void 0:e.type)===ab.CANCEL_PROFILE_VALIDATION)return!0;const t=yield(0,Ra.RE)(f_),[r,n]=yield(0,Ra.$6)([(0,Ra.RE)(y_),(0,Ra.RE)(b_)]),a=(0,O.uniqBy)(v.getErrorUniqKey,[...t,...r,...n]),i=yield(0,Ra.Ys)(uI.selectors.getEntityUri),o=yield(0,Ra.Ys)(uI.selectors.getHiddenAttributes),l=(null==o?void 0:o[i])||[],s=(0,v.filterErrorsForHiddenAttributes)(a,l);return yield(0,Ra.gz)(fw(a)),0===s.filter(v.isCriticalError).length}let T_=function(e){return e.PROFILE_VIEWS_SET="PROFILE_VIEWS_SET",e}({});const O_=ZE(T_.PROFILE_VIEWS_SET);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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){x_(e,t,r[t])}))}return e}function x_(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*C_(e){const t=yield(0,Ra.Ys)(uI.selectors.getMetadata),r=yield(0,Ra.Ys)(uI.selectors.getMode);switch(e.type){case _C.OPEN_RELATION_EDITOR:{const{id:n,connection:a}=e.payload;a.relation.relationType&&(yield(0,Ra.gz)(ob({viewId:n,metadata:t,mode:r,parentUri:a.relation.object.uri})));break}case ab.ADD_ATTRIBUTES:{const n=e.payload;for(const e of n){const{attributeType:n,parentUri:a,viewId:i}=e;(0,v.isComplexAttribute)(n)&&(yield(0,Ra.gz)(ob({viewId:i,attributeType:n,parentUri:a,metadata:t,mode:r})))}break}case _C.SET_RELATION_TYPE:{const{id:n,relationUri:a}=e.payload;yield(0,Ra.gz)(ob({viewId:n,metadata:t,mode:r,parentUri:a}));break}case OA.TREE_NODE_RELATION_TYPE_CHANGED:{var n;const{id:a,node:i}=e.payload;yield(0,Ra.gz)(ob({viewId:a,metadata:t,mode:r,parentUri:null==i||null===(n=i.relation)||void 0===n?void 0:n.uri}));break}}}function*w_(e,t=null){const r=yield(0,Ra.Ys)(HS),n=(0,v.getNotAppliedTreeCommands)(null==r?void 0:r.trees),a=yield(0,Ra.Ys)(qS),i=(0,v.optimizeCommands)([...a,...n]);if(null!=i&&i.length){const r=(0,O.when)((0,O.always)(t),(0,v.replaceTempUriInCommands)(t))(i);yield(0,Ra.RE)(e,r),yield(0,Ra.gz)(SA())}}function*A_(e){const t=yield(0,Ra.Ys)(hO),r=yield(0,Ra.Ys)(EO),n=yield(0,Ra.Ys)(LO,r),a=yield(0,Ra.Ys)(uO),i=(0,v.getEntityType)(a,t.type),o=(null==i?void 0:i.forceOvForUiUpdates)??!0,l=(0,v.collectAllDiffs)(t,n,o);return(0,v.prepareAttrDiff)(e,l)}function*R_(e){const t=yield(0,Ra.Ys)(CO),r=yield(0,Ra.Ys)(jO),n=yield(0,Ra.Ys)(EO),a=yield(0,Ra.Ys)(LO,n),i=(0,v.findAllTemporaryRefEntityURI)(a),o=(0,O.concat)(i,t);return yield(0,Ra.RE)(v.saveTemporaryEntities,r,o,e)}function*__(e,t,r){const n=e.getDCRObjectUris(),a=yield(0,Ra.Ys)(ox),i=yield(0,Ra.Ys)(sx),o=yield(0,Ra.Ys)(ex);if(null!=n&&n.length){const l=yield(0,Ra.RE)(v.startProcessInstance,{workflowPath:a,processType:t?"authoring":"dataChangeRequestReview",objectURIs:(0,O.uniq)([r,...n,e.getDCRUri()]).filter((0,O.complement)(O.isNil)),tenant:o,environment:i});"OK"!==(null==l?void 0:l.status)&&console.warn(l)}}function*I_(e,t,r,n){const a=yield(0,Ra.Ys)(xO,r),i=yield(0,Ra.Ys)(uI.selectors.getUserName),o=(0,v.createRelationsCommandsFromConnections)(a,n,t,i);o.length&&(yield(0,Ra.RE)(e,o))}function*N_(e,t,r){const n=yield(0,Ra.Ys)(_O),a=yield(0,Ra.Ys)(EO);for(const i of n)yield(0,Ra.rM)(I_,e,r||a,i,t)}function*P_(e){if(!e.hasNewUri())return;const t=yield(0,Ra.Ys)(HS);for(const[r,n]of Object.entries(t.trees))if(n.root){const t=t=>(0,O.when)((0,O.prop)("uri"),(0,O.assoc)("uri",e.getUri(null==t?void 0:t.uri)))(t),a=(0,v.mapTree)(n.root,{nodeProcessing:e=>(0,O.pipe)((e=>S_({},e)),(0,O.unless)((0,O.has)("editingMode"),(0,O.evolve)({relation:t,relations:(0,O.map)(t)})))(e)});(0,O.equals)(n.root,a)||(yield(0,Ra.gz)(xA({id:r,tree:a})))}}function*D_(){try{var e;const t=yield(0,Ra.Ys)(NS),{commandExecutor:r,dcrProcessor:n,relationUriProcessor:a}=(0,v.createCommandExecutor)({alwaysCreateDCR:t,dcrUri:null}),i=yield(0,Ra.RE)(R_,n);yield(0,Ra.$6)([(0,Ra.RE)(w_,r),(0,Ra.RE)(N_,r,i)]),yield(0,Ra.RE)(P_,a);const o=yield(0,Ra.RE)(A_,i),l=yield(0,Ra.Ys)(EO),s=yield(0,Ra.Ys)(uI.selectors.getMetadata),c=(0,v.hasAttributeMasking)(s);let u;if(null!=o&&o.length&&(u=yield(0,Ra.RE)(v.entityCumulativeUpdate,{uri:l,diff:o,uriPreprocessor:n.enhanceUriWithDCR,sendMasked:c})),t||(0,v.isChangeRequestUri)(null===(e=u)||void 0===e?void 0:e.uri))u&&n.updateDCRUriFromResponse(u),yield(0,Ra.RE)(__,n,!1,l),yield(0,Ra.gz)(CA()),c&&(yield(0,Ra.RE)(z_,!0)),window.alert(ei().text("Your changes are saved as pending and have been sent for review"));else if(u){yield(0,Ra.gz)(QC(u));const{trees:e}=yield(0,Ra.Ys)(uI.selectors.getTrees),t=(0,v.updateTreesWithNewEntity)((0,O.pick)(["uri","label","secondaryLabel","type"],u),e);for(const e of t)yield(0,Ra.gz)(xA({id:e.id,tree:e.root}))}else!u&&c&&(yield(0,Ra.RE)(z_,!0));yield(0,Ra.gz)(Lw(v.Mode.Viewing)),yield(0,Ra.gz)(yb())}catch(e){yield(0,Ra.gz)(Dv((0,v.getRequestErrorMessage)(e,ei().text("Something went wrong"))))}}function*k_(){yield(0,Ra.qn)(XC.ENTITY_LOADED),yield(0,Ra.gz)(yb())}function*L_(e,t){const r=yield(0,Ra.Ys)(EO),n=yield(0,Ra.Ys)(uI.selectors.getModifiedEntity,r),{commandExecutor:a,dcrProcessor:i}=(0,v.createCommandExecutor)({alwaysCreateDCR:t,dcrUri:e}),o=yield(0,Ra.RE)(R_,i),l=yield(0,Ra.RE)(v.saveTemporaryEntity,n,o,i);return yield(0,Ra.$6)([(0,Ra.RE)(w_,a,{[r]:l}),(0,Ra.RE)(N_,a,o,l)]),{savedEntityUri:l,dcrProcessor:i}}function*U_(){const e=yield(0,Ra.Ys)(EO),t=yield(0,Ra.Ys)(uI.selectors.getModifiedEntity,e);if((0,v.isEmptyEntity)(t)){const e=(0,Me.x0)();return yield(0,Ra.gz)(sv({id:e,text:ei().text("Please fill out some fields."),actions:[]})),!1}return!0}function*j_(){try{const e=yield(0,Ra.Ys)(NS);if(!(yield(0,Ra.RE)(U_)))return;const{dcrProcessor:t,savedEntityUri:r}=yield(0,Ra.RE)(L_,null,e);e&&(yield(0,Ra.RE)(__,t),window.alert(ei().text("Your changes are saved as pending and have been sent for review"))),yield(0,Ra.gz)(Lw(v.Mode.Viewing)),e?(yield(0,Ra.gz)(lv()),yield(0,Ra.gz)(lw())):(yield(0,Ra.gz)(av({uri:r})),yield(0,Ra.rM)(k_))}catch(e){yield(0,Ra.gz)(Dv((0,v.getRequestErrorMessage)(e,ei().text("Something went wrong"))))}}function*F_(e){const t=yield(0,Ra.RE)(v.getDataChangeRequest,e),r=(0,O.pipe)((0,O.prop)("changes"),O.values,O.flatten,(0,O.pluck)("id"))(t);try{yield(0,Ra.$6)(r.map((t=>(0,Ra.RE)(v.deleteChangeRequestItem,{dcrUri:e,changeItemId:t}))))}catch(e){yield(0,Ra.gz)(Dv((0,v.getRequestErrorMessage)(e,ei().text("Something went wrong"))))}}function*M_(e){const{dcrUri:t,action:r,taskId:n}=e.payload;try{if(!(yield(0,Ra.RE)(U_)))return;if(yield(0,Ra.gz)(l_(v.Operation.Saving)),yield(0,Ra.RE)(F_,t),yield(0,Ra.RE)(L_,t,!0),"Approve"!==r||(yield(0,Ra.RE)(v_))){const e=yield(0,Ra.Ys)(ox),t=yield(0,Ra.Ys)(sx),a=yield(0,Ra.Ys)(ex);yield(0,Ra.RE)(v.runTaskAction,{workflowPath:e,environment:t,tenant:a,taskId:n,action:r}),yield(0,Ra.gz)(aw())}}catch(e){const t=null==e?void 0:e.error;if((null==t?void 0:t.errorCode)===v.ApiErrorCode.WORKFLOW_IS_NOT_REGISTERED_ERROR)return;yield(0,Ra.gz)(Dv((0,v.getRequestErrorMessage)(t||e,ei().text("Something went wrong"))))}yield(0,Ra.gz)(l_(null))}function*V_(e){const{dcrUri:t,userAction:r}=e.payload,n=yield(0,Ra.Ys)(RS);try{if(!(yield(0,Ra.RE)(U_)))return;yield(0,Ra.gz)(Lw("saveDraft"===r?v.Mode.Suggesting:v.Mode.Editing,!0)),yield(0,Ra.gz)(l_(v.Operation.Saving));const e=yield(0,Ra.RE)(v_);if("saveDraft"===r){if(t)yield(0,Ra.RE)(F_,t),yield(0,Ra.RE)(L_,t,!0);else{const{dcrProcessor:e}=yield(0,Ra.RE)(L_,null,!0);yield(0,Ra.RE)(__,e,!0);const t=e.getDCRUri();yield(0,Ra.gz)(Iv({url:"../authoring",searchParams:{entityUri:`${t}`},options:{replace:!0,state:{keepErrors:!0}}}))}window.alert(ei().text("Your changes are saved as pending and have been sent for review"))}else if(e){const{savedEntityUri:e}=yield(0,Ra.RE)(L_,null,!1);yield(0,Ra.gz)(Lw(v.Mode.Viewing)),yield(0,Ra.gz)(av({uri:e})),yield(0,Ra.rM)(k_)}else e||(yield(0,Ra.gz)(Lw(n,!0)))}catch(e){yield(0,Ra.gz)(Lw(n,!0)),yield(0,Ra.gz)(Dv((0,v.getRequestErrorMessage)(e,ei().text("Something went wrong"))))}yield(0,Ra.gz)(l_(null))}function*B_(){if(yield(0,Ra.gz)(l_(v.Operation.Saving)),yield(0,Ra.RE)(v_)){const e=yield(0,Ra.Ys)(EO);(0,v.isTempUri)(e)?yield(0,Ra.RE)(j_):yield(0,Ra.RE)(D_)}yield(0,Ra.gz)(l_(null))}function*z_(e){try{let t;if(e){const e=yield(0,Ra.Ys)(uI.selectors.getMetadata);t=(0,v.addMetadataSpecificGetEntityOptions)(e)}yield(0,Ra.gz)(l_(v.Operation.Fetching));const r=yield(0,Ra.Ys)(EO),n=yield(0,Ra.RE)(v.getEntity,r,t);if(!n)throw new Error("Failed to request entity");return yield(0,Ra.gz)(QC(n,!0)),n}catch(e){throw yield(0,Ra.gz)(Dv((0,v.getRequestErrorMessage)(e,ei().text("Something went wrong")))),e}finally{yield(0,Ra.gz)(l_(null))}}function*H_(e){const{mode:t,silent:r}=e.payload;r||(yield Y_({mode:t}))}function*Y_({mode:e,overwrite:t=!1}){const r=yield(0,Ra.Ys)(uI.selectors.getEntity),n=yield(0,Ra.Ys)(uI.selectors.getMetadata),a=yield(0,Ra.Ys)(uI.selectors.getModifiedEntity,null==r?void 0:r.uri);if((t||!a)&&e!==v.Mode.Viewing&&r&&n){const t=yield(0,Ra.Ys)(uI.selectors.getProfileViews),a=yield(0,Ra.Ys)(uI.selectors.getUIConfig),i=yield(0,Ra.Ys)(uI.selectors.getUserRoles),o=(0,v.addToEntityRequiredAttributes)({entity:r,metadata:n,mode:e,attrTypeFilter:(0,O.both)((0,v.isAvailableAttributeTypeForProfile)(t||[]),(0,v.getProfileAttributeConfigPermissionsChecker)(a,r.type,i,[v.ConfigPermissions.READ,v.ConfigPermissions.CREATE]))});yield(0,Ra.gz)(zw(o));const l=yield(0,Ra.Ys)(uI.selectors.getModifiedEntities),s=yield(0,Ra.Ys)(uI.selectors.getProfileErrors),c=s_({metadata:n,modifiedEntities:l,errors:s});c.length&&(yield(0,Ra.gz)(ib(c)))}}function*W_(e){const{entity:t,silent:r}=e.payload,n=yield(0,Ra.Ys)(uI.selectors.getMode),a=yield(0,Ra.Ys)(uI.selectors.getProfileOperation);r||(0,v.isTempUri)(t.uri)||a||(yield Y_({mode:n,overwrite:!0}))}function*G_(e){const{entityTypeUri:t}=e.payload,r=yield(0,Ra.Ys)(uI.selectors.getMetadata),n=(0,v.getEntityType)(r,t),a=yield(0,Ra.Ys)(uI.selectors.getUIConfig),i=yield(0,Ra.Ys)(uI.selectors.getUserRoles),o=(0,v.getProfileAttributeConfigPermissionsChecker)(a,t,i,[v.ConfigPermissions.READ,v.ConfigPermissions.CREATE]),l=((null==n?void 0:n.attributes)||[]).filter((e=>o(e))),s=(0,v.checkMetadataForCreate)(v.Mode.Editing,n)?v.Mode.Editing:v.Mode.Suggesting,c=(0,v.createTemporaryEntity)({entityTypeUri:t,attributeTypes:l,metadata:r,mode:s});yield(0,Ra.gz)(iv({entity:c})),yield(0,Ra.gz)(QC(c)),yield(0,Ra.gz)(Lw(v.Mode.Viewing)),yield(0,Ra.gw)(0),(yield(0,Ra.Ys)(uI.selectors.getProfileViews))||(yield(0,Ra.qn)(T_.PROFILE_VIEWS_SET)),yield(0,Ra.gz)(Lw(s)),yield(0,Ra.gz)(wA())}function*q_(e){const t=yield(0,Ra.Ys)(uI.selectors.getMetadata),r=yield(0,Ra.Ys)(uI.selectors.getAuthoringByEntityType,e),n=yield(0,Ra.Ys)(uI.selectors.getUIConfig),a=(0,v.getPreparedAuthoringItems)(t,r,e,n).map((({views:e})=>e)).flat();yield(0,Ra.gz)(O_(a))}function*Z_(e){const{entityTypeUri:t}=e.payload,r=yield(0,Ra.Ys)(uI.selectors.getMetadata),n=(0,v.getEntityType)(r,t),a=(0,O.prop)("attributes",n),i=(yield(0,Ra.Ys)(uI.selectors.getCanSuggestAuthoring,n))?v.Mode.Suggesting:v.Mode.Editing,o=(0,v.createTemporaryEntity)({entityTypeUri:t,attributeTypes:a,metadata:r,mode:i});yield(0,Ra.gz)(Rv({entity:o})),yield(0,Ra.gz)(QC(o)),yield(0,Ra.RE)(q_,o.type),yield(0,Ra.gz)(Lw(i))}function*$_(e){const{mainEntityUri:t,tempEntities:r,keepErrors:n}=e.payload,[[a],i]=(0,O.partition)((0,O.propEq)("uri",t),r);yield(0,Ra.gz)(QC(a,n)),yield(0,Ra.RE)(q_,a.type),yield(0,Ra.gz)(Lw(v.Mode.Suggesting));for(const e of i)yield(0,Ra.gz)(zw(e))}function*K_(e){const{payload:{entityUri:t,data:r}}=e;yield(0,Ra.gz)(l_(v.Operation.Cloning));try{const e=yield(0,Ra.RE)(v.cloneEntity,t,r);yield(0,Ra.gz)(iv({entity:e})),yield(0,Ra.gz)(QC(e)),yield(0,Ra.gz)(Lw(v.Mode.Editing)),yield(0,Ra.gz)(wA());const n=(0,Me.x0)(),a=yield(0,Ra.Ys)(uI.selectors.getMetadata),i=(0,v.getEntityType)(a,e.type),o=(0,v.checkMetadataForDelete)(v.Mode.Editing,i);yield(0,Ra.gz)(sv({id:n,type:"cloneAction",autoHideDuration:1e4,text:ei().text("Profile is cloned successfully. You can modify the attributes if required."),actions:o?[{label:ei().text("Undo"),needConfirmation:!0,confirmationText:ei().text("Are you sure you want to undo the cloning process?"),confirmationDescription:ei().text("Undoing the cloning process will delete the cloned profile. Are you sure you want to proceed?"),applyAction:iw({entityUri:e.uri}),cancelAction:cv(n)}]:[]}))}catch(e){yield(0,Ra.gz)(Dv((0,v.getRequestErrorMessage)(e,ei().text("Something went wrong"))))}yield(0,Ra.gz)(l_(null))}function*X_(e){const{entityUri:t}=e.payload;if(!(0,v.isTempUri)(t))try{yield(0,Ra.RE)(v.removeEntity,t),yield(0,Ra.gz)(ov())}catch(e){yield(0,Ra.gz)(Dv((0,v.getRequestErrorMessage)(e,ei().text("Something went wrong"))))}}function*Q_(e){const t=e.payload;try{if((yield(0,Ra.Ys)(JS))&&!confirm(ei().text("Are you sure you want to cancel changes for this Profile?")))return;const e=yield(0,Ra.Ys)(RS),r=yield(0,Ra.Ys)(uI.selectors.getMetadata),n=yield(0,Ra.Ys)(EO),a=(0,v.hasAttributeMasking)(r),i=(0,v.isTempUri)(n),o=(0,v.isViewMode)(t),l=(0,v.isEditableMode)(e)&&(0,v.isViewMode)(t),s=(0,v.isViewMode)(e)&&(0,v.isEditableMode)(t);n&&(l||s)&&a&&!i&&(yield(0,Ra.RE)(z_,o)),yield(0,Ra.gz)(Lw(t)),l&&(yield(0,Ra.gz)(jw()))}catch{}}const J_=[function*(){yield(0,Ra.A7)([Sb.MODE_UPDATE_REQUESTED],Q_)},function*(){yield(0,Ra.A7)([ab.RUN_AUTHORING_TASK_ACTION],M_)},function*(){yield(0,Ra.ib)([_C.OPEN_RELATION_EDITOR,ab.ADD_ATTRIBUTES,_C.SET_RELATION_TYPE,OA.TREE_NODE_RELATION_TYPE_CHANGED],C_)},function*(){yield(0,Ra.A7)([ab.SAVE_PROFILE],B_)},function*(){yield(0,Ra.ib)([Sb.MODE_UPDATED],H_)},function*(){yield(0,Ra.ib)([XC.ENTITY_CREATION_REQUESTED],G_)},function*(){yield(0,Ra.Fm)([ab.VALIDATE_PROFILE,ab.CANCEL_PROFILE_VALIDATION],v_)},function*(){yield(0,Ra.ib)([XC.ENTITY_REMOVE_REQUESTED],X_)},function*(){yield(0,Ra.ib)([XC.CLONE_ENTITY],K_)},function*(){yield(0,Ra.ib)([XC.ENTITY_CREATION_WITH_AUTHORING_REQUESTED],Z_)},function*(){yield(0,Ra.ib)([XC.ENTITY_AUTHORING_DRAFT_ENTITIES_LOADED],$_)},function*(){yield(0,Ra.A7)([ab.SAVE_DRAFT],V_)},function*(){yield(0,Ra.ib)([XC.ENTITY_LOADED],W_)}];let eI=function(e){return e.SIDE_PANEL_VIEWS_LOADED="SIDE_PANEL_VIEWS_LOADED",e}({});ZE(eI.SIDE_PANEL_VIEWS_LOADED);const tI=[];let rI=function(e){return e.HIDDEN_ATTRIBUTES_UPDATED="HIDDEN_ATTRIBUTES_UPDATED",e.HIDDEN_ATTRIBUTES_RESET="HIDDEN_ATTRIBUTES_RESET",e}({});const nI=ZE(rI.HIDDEN_ATTRIBUTES_UPDATED),aI=ZE(rI.HIDDEN_ATTRIBUTES_RESET),iI={};let oI=function(e){return e.CONTROL_ATTRIBUTES_UPDATED="CONTROL_ATTRIBUTES_UPDATED",e}({});const lI=ZE(oI.CONTROL_ATTRIBUTES_UPDATED),sI=[],cI=(0,T.combineReducers)({dependentLookups:(e=wb,t)=>{switch(t.type){case Sb.MODE_UPDATED:{const{mode:r,silent:n}=t.payload;return(0,v.isViewMode)(r)&&!n?wb:e}case Eb.DEPENDENT_LOOKUPS_STRUCTURE_SET:return xb({},e,{structure:t.payload});case Eb.DEPENDENT_LOOKUPS_INITED_TYPE_URIS_ADDED:{const r=t.payload;return xb({},e,{initedTypeUris:(0,O.uniq)(e.initedTypeUris.concat(r))})}case Eb.DEPENDENT_LOOKUPS_EDITORS_BLOCKED:{const{uris:r,isBlocked:n}=t.payload,a=e.editors,i=r.reduce(((e,t)=>xb({},e,{[t]:xb({},e[t],{isBlocked:n})})),a);return xb({},e,{editors:i})}case Eb.DEPENDENT_LOOKUPS_EDITOR_TOUCHED:{const{uri:r,isTouched:n}=t.payload;return(0,O.assocPath)(["editors",r,"isTouched"],n,e)}default:return e}},entity:(e=pw,t)=>{switch(t.type){case XC.ENTITY_LOADED:return t.payload.entity;case XC.DEFAULT_PROFILE_PIC_SET:return"object"==typeof t.payload&&null!==t.payload?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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){uw(e,t,r[t])}))}return e}({},e,{defaultProfilePic:t.payload.uri,defaultProfilePicValue:t.payload}):e;case ab.ADD_NEXT_PAGE_ATTRIBUTE_VALUES:{const{parentUri:r,attributeTypeName:n,attributeTypeUri:a,values:i}=t.payload,o=(0,v.getAttributeSource)(a);if(r===e.uri){const t=(0,O.lensPath)([o,n]);return(0,O.over)(t,(0,O.pipe)((0,O.defaultTo)([]),(0,O.concat)(O.__,i)),e)}return e}case XC.CLEAR_ENTITY:return pw;default:return e}},errors:(e=gw,t)=>{switch(t.type){case dw.ERRORS_SET:return t.payload;case dw.ERROR_DEACTIVATED:{const r=t.payload,n=e.findIndex((e=>(0,v.getErrorId)(e)===r)),a=(0,O.lensPath)([n]);return(0,O.over)(a,(0,O.assoc)("deactivated",!0),e)}case ab.REMOVE_ATTRIBUTE:{const{uri:r}=t.payload;return e.map((e=>e.uri===r||(0,v.areOneHierarchyUris)(e.parentUri,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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){yw(e,t,r[t])}))}return e}({},e,{deactivated:!0}):e))}case Sb.MODE_UPDATED:{const{mode:r,silent:n}=t.payload;return(0,v.isViewMode)(r)&&!n?gw:e}case XC.ENTITY_LOADED:{const{silent:r}=t.payload;return r?e:gw}default:return e}},history:(e=ww,t)=>{switch(t.type){case hw.HISTORY_DIFF_SET:return xw({},e,{diff:t.payload});case hw.HISTORY_DIFF_CLEARED:return xw({},e,{diff:ww.diff});case hw.HISTORY_EVENT_SET:return xw({},e,{event:t.payload});case QE.NEW_ENTITY_SHOWN:case QE.OPEN_ENTITY:case hw.HISTORY_EVENT_CLEARED:return xw({},ww,{mode:e.mode});case hw.HISTORY_SLICE_SET:return xw({},e,{slice:t.payload});case hw.HISTORY_MODE_SET:return xw({},e,{mode:t.payload});default:return e}},lastLoadedTime:(e=null,t)=>{switch(t.type){case Aw.PROFILE_LAST_LOADED_TIME_UPDATE:case XC.ENTITY_LOADED:return Date.now();default:return e}},lookups:(e=kw,t)=>{switch(t.type){case Rw.LOOKUPS_LOADED:return t.payload;case Rw.LOOKUPS_FOR_TYPE_RESOLVED:{const{type:r,values:n}=t.payload;return Pw({},e,{[r]:Pw({},e[r],n)})}case Rw.LOOKUPS_LIST_RESOLVED:return t.payload.reduce(((e,t)=>Object.keys(t).reduce(((e,r)=>Pw({},e,{[r]:Pw({},e[r],t[r])})),e)),e);case"UI_RESET":return Pw({},kw);default:return e}},mode:(e=Bw,t)=>t.type===Sb.MODE_UPDATED?t.payload.mode:e,modifiedEntities:(e=$w,t)=>{switch(t.type){case RC.MODIFIED_ENTITY_CREATED:{const r=t.payload;return qw({},e,{[r.uri]:r})}case RC.MODIFIED_ENTITY_DELETED:{const r=t.payload;return(0,O.omit)([r],e)}case RC.MODIFIED_ENTITIES_RESET:return $w;case Sb.MODE_UPDATED:{const{silent:r}=t.payload;return r?e:$w}case RC.MODIFIED_ENTITY_DEFAULT_PROFILE_PIC_SET:{const{entityUri:r,value:n}=t.payload;return r?qw({},e,{[r]:qw({},e[r],{defaultProfilePic:n.uri,defaultProfilePicValue:n})}):e}case ab.ADD_ATTRIBUTES:return t.payload.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:a}=t,i=(0,v.getBaseUri)(n);if((0,v.isEntityUri)(i)){const t=e[i];return e[i]||console.error(`ADD_ATTRIBUTES. parentUri - ${n}, state: ${JSON.stringify(e)}`),(0,v.isEntitySpecialAttrType)(r)?qw({},e,{[i]:(0,v.addEntitySpecialAttribute)({entity:t,attributeType:r})}):qw({},e,{[i]:(0,v.addAttribute)({entity:t,attributeType:r,parentUri:n,index:a})})}return e}),e);case ab.ADD_NEXT_PAGE_ATTRIBUTE_VALUES:{const{parentUri:r,attributeTypeName:n,attributeTypeUri:a,values:i}=t.payload,o=(0,v.getAttributeSource)(a);if((0,v.isEntityUri)(r)&&r in e){const t=(0,O.lensPath)([r,o,n]);return(0,O.over)(t,(0,O.pipe)((0,O.defaultTo)([]),(0,O.concat)(O.__,i)),e)}return e}case ab.MODIFY_ATTRIBUTE:{const{attributeType:r,uri:n,value:a}=t.payload,i=(0,v.getBaseUri)(n);if((0,v.isEntityUri)(i)){const t=e[i];return e[i]&&e[i].attributes||console.error(`MODIFY_ATTRIBUTE. uri - ${n}, state: ${JSON.stringify(e)}`),(0,v.isEntitySpecialAttrType)(r)?qw({},e,{[i]:(0,v.editEntitySpecialAttribute)({entity:t,attributeType:r,value:a})}):qw({},e,{[i]:(0,v.editAttribute)({entity:t,attributeType:r,uri:n,value:a})})}return e}case ab.REMOVE_ATTRIBUTE:{const{attributeType:r,uri:n}=t.payload,a=(0,v.getBaseUri)(n);if((0,v.isEntityUri)(n)){const t=e[a];return e[a]||console.error(`REMOVE_ATTRIBUTE. uri - ${n}, state: ${JSON.stringify(e)}`),(0,v.isEntitySpecialAttrType)(r)?qw({},e,{[a]:(0,v.removeEntitySpecialAttribute)({entity:t,attributeType:r})}):qw({},e,{[a]:(0,v.removeAttribute)({entity:t,attributeType:r,uri:n})})}return e}case ab.ADD_DEFAULT_VALUES:{const{attributeType:r,parentUri:n,metadata:a,mode:i}=t.payload,o=(0,v.getBaseUri)(n);if((0,v.isEntityUri)(o)){const t=(0,v.getEditableAttributeTypeSubAttributes)(a,r);return(0,O.over)((0,O.lensProp)(o),(0,v.addDefaultValuesToComplexAttribute)({attributeType:r,subAttributes:t,metadata:a,mode:i,parentUri:n}),e)}return e}default:return e}},relations:(e=hA,t)=>{switch(t.type){case XC.ENTITY_LOADED:{const{silent:r}=t.payload;return r?e:hA}case _C.RELATIONS_LOADED:{const{id:r,connections:n=[],total:a,mode:i}=t.payload;return(0,O.pipe)((0,O.assocPath)([r,"connections"],n),(0,O.assocPath)([r,"total"],a),(0,O.when)((0,O.both)((0,O.complement)((0,O.hasPath)([r,"drafts"])),(0,O.always)((0,v.isEditableMode)(i))),(0,O.assocPath)([r,"drafts"],EA)))(e)}case _C.SECOND_LEVEL_RELATIONS_LOADED:{const{id:r,connections:n,parentEntityUri:a,total:i}=t.payload,o=(0,O.path)([r,"connections"],e).map((e=>{const{entityUri:t}=e.entity;return t===a?yA({},e,{total:i,connections:n.map((e=>yA({},e,{parentEntityUri:a})))}):e}));return(0,O.assocPath)([r,"connections"],o,e)}case Sb.MODE_UPDATED:{const{mode:r,silent:n}=t.payload;return n?e:(0,O.map)(Mw(r)?(0,O.omit)(["drafts","relationsToEdit","relationToAdd"]):(0,O.assoc)("drafts",EA),e)}case _C.REMOVE_RELATION:{const{id:r,relationUri:n}=t.payload,a=(0,O.pipe)(v.getRelationUriFromConnection,(0,O.equals)(n)),i=(0,O.path)([r,"connections"],e),o=!((0,v.isTempUri)(n)||null!=i&&i.some((e=>e.suggested&&e.relation.relationUri===n)));return(0,O.evolve)({[r]:{drafts:(0,O.evolve)({removedUris:o?(0,O.append)(n):O.identity,addedConnections:(0,O.reject)(a),editedConnections:(0,O.reject)(a)})}},e)}case _C.IGNORE_RELATION:{const{id:r,ignoredRelationData:n}=t.payload;return(0,O.evolve)({[r]:{drafts:(0,O.evolve)({ignoredRelationData:(0,O.append)(n)})}},e)}case _C.ADD_RELATION:{const{id:r,connection:n}=t.payload,a=(0,O.omit)(["isNew"],n);return(0,O.evolve)({[r]:(0,O.pipe)((0,O.when)((0,O.propSatisfies)(O.isNil,"drafts"),(0,O.assocPath)(["drafts"],EA)),(0,O.evolve)({drafts:{addedConnections:(0,O.prepend)(a)}}))},e)}case _C.EDIT_RELATION:{const{id:r,connection:n}=t.payload,a=(0,O.eqBy)(v.getRelationUriFromConnection,n);if((0,v.isTempUri)((0,v.getRelationUriFromConnection)(n))){const t=e=>{const t=e.findIndex(a);return t>=0?(0,O.update)(t,n,e):e};return(0,O.evolve)({[r]:{drafts:(0,O.evolve)({addedConnections:t})}},e)}{const t=e=>{const t=e.findIndex(a);return t>=0?(0,O.update)(t,n,e):[...e,n]};return(0,O.evolve)({[r]:{drafts:(0,O.evolve)({editedConnections:t})}},e)}}case _C.UPDATE_RELATION_RATING:{const{id:r,connection:n,rating:a,user:i}=t.payload,o=n.initial?n:yA({},n,{initial:{connection:n}}),l=(0,v.isTempUri)((0,v.getRelationUriFromConnection)(o)),s=(0,O.eqBy)(v.getRelationUriFromConnection,o),c=e=>{const t=null==e?void 0:e.findIndex((e=>e.user===i));return!a&&t>=0?e.filter((e=>e.user!==i)):t>=0?(0,O.update)(t,a,e):[...e,a]},u=e=>{const t=e.findIndex(s);return t>=0?(0,O.update)(t,p,e):[...e,p]},p=(0,O.evolve)({relation:e=>yA({},e,{ratings:c((0,O.defaultTo)([],e.ratings))})},o);return(0,O.evolve)({[r]:{drafts:(0,O.evolve)({[l?"addedConnections":"editedConnections"]:u})}},e)}case _C.OPEN_RELATION_EDITOR:{const{id:r,connection:n}=t.payload,a=n.initial?n:yA({},n,{initial:{connection:n}});if(a.isNew){const t=(0,v.getRelationToAddPath)(r);return(0,O.path)(t,e)?e:(0,O.assocPath)(t,a,e)}{const t=(0,O.lensPath)((0,v.getRelationsToEditPath)(r)),n=(0,O.eqBy)((0,O.path)(["relation","relationUri"]),a);return(0,O.over)(t,(0,O.pipe)((0,O.defaultTo)([]),(0,O.unless)((0,O.find)(n),(0,O.append)(a))),e)}}case _C.SET_INITIAL_INFO:{const{id:r,relationUri:n,tempEntity:a}=t.payload,i=bA(r,n,e);return(0,O.assocPath)([...i,"initial","modifiedEntity"],a,e)}case _C.CLOSE_RELATION_EDITOR:{const{id:r,relationUri:n}=t.payload,a=(0,O.pathEq)(["relation","relationUri"],n);return(0,O.evolve)({[r]:{relationToAdd:(0,O.when)(a,(0,O.always)(null)),relationsToEdit:(0,O.reject)(a)}},e)}case _C.SET_RELATION_TYPE:{const{id:r,relationUri:n,relationType:a}=t.payload,i=bA(r,n,e);if(i){const t=[...i,"relation"],r=(0,O.lensPath)(t);return(0,O.over)(r,(0,v.applyRelationTypeObject)(a),e)}return e}case ab.ADD_ATTRIBUTES:return t.payload.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:a,viewId:i}=t,o=(0,v.getBaseUri)(n),l=vA(i,o,e);if(l&&(0,v.isRelationUri)(o)){if((0,v.isActivenessAttrType)(r)){const t=(0,O.view)(l,e),n=(0,v.addEntitySpecialAttribute)({entity:t,attributeType:r});return(0,O.set)(l,n,e)}{const t=TA(i,o,e),l=(0,O.view)(t,e);l||console.error(`relations.ADD_ATTRIBUTES. viewId - ${i}, relationUri - ${o}, state: ${JSON.stringify(e)}`);const s=(0,v.addAttribute)({entity:l,attributeType:r,parentUri:n,index:a});return(0,O.set)(t,s,e)}}return e}),e);case ab.ADD_NEXT_PAGE_ATTRIBUTE_VALUES:{const{parentUri:r,attributeTypeName:n,values:a,viewId:i}=t.payload;if(!(0,v.isRelationUri)(r))return e;const o=(0,v.getBaseUri)(r),l=bA(i,o,e),s=(0,O.lensPath)([...l,"relation","object","attributes",n]);return(0,O.over)(s,(0,O.pipe)((0,O.defaultTo)([]),(0,O.append)(a)),e)}case ab.MODIFY_ATTRIBUTE:{const{attributeType:r,viewId:n,uri:a,value:i}=t.payload,o=(0,v.getBaseUri)(a),l=vA(n,o,e);if(l&&(0,v.isRelationUri)(o)){if((0,v.isActivenessAttrType)(r)){const t=(0,O.view)(l,e),n=(0,v.editEntitySpecialAttribute)({entity:t,attributeType:r,value:i});return(0,O.set)(l,n,e)}{const t=TA(n,o,e),l=(0,O.view)(t,e);l||console.error(`relations.MODIFY_ATTRIBUTE. viewId - ${n}, relationUri - ${o}, state: ${JSON.stringify(e)}`);const s=(0,v.editAttribute)({entity:l,attributeType:r,uri:a,value:i});return(0,O.set)(t,s,e)}}return e}case ab.REMOVE_ATTRIBUTE:{const{attributeType:r,uri:n,viewId:a}=t.payload,i=(0,v.getBaseUri)(n),o=vA(a,i,e);if(o&&(0,v.isRelationUri)(i)){if((0,v.isActivenessAttrType)(r)){const t=(0,O.view)(o,e),n=(0,v.removeEntitySpecialAttribute)({entity:t,attributeType:r});return(0,O.set)(o,n,e)}{const t=TA(a,i,e),o=(0,O.view)(t,e);o||console.error(`relations.REMOVE_ATTRIBUTE. viewId - ${a}, relationUri - ${i}, state: ${JSON.stringify(e)}`);const l=(0,v.removeAttribute)({entity:o,attributeType:r,uri:n});return(0,O.set)(t,l,e)}}return e}case _C.SET_RELATION_ENTITY:{const{id:r,relationUri:n,entityInfo:a}=t.payload,i=bA(r,n,e);if(i){const t=[...i,"entity"],r=(0,O.lensPath)(t),{uri:n,label:o,type:l}=a,s=(0,O.isEmpty)(a)?{}:{entityUri:n,entityLabel:o,entityType:l,object:{uri:n,label:o,type:l}};return(0,O.set)(r,s,e)}return e}case ab.ADD_DEFAULT_VALUES:{const{viewId:r,attributeType:n,parentUri:a,metadata:i,mode:o}=t.payload,l=(0,v.getBaseUri)(a);if((0,v.isRelationUri)(l)){const t=bA(r,l,e);if(t){if(n){const r=[...t,"relation","object"],l=(0,v.getAttributeTypeSubAttributes)(i,n);return(0,O.over)((0,O.lensPath)(r),(0,v.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,O.view)((0,O.lensPath)(n),e),{attributes:s=[]}=(0,v.getRelationType)(i,l);return(0,O.over)((0,O.lensPath)(r),(0,v.addDefaultValuesToAttributes)({metadata:i,mode:o,attributeTypes:s,parentUri:a}),e)}}return e}return e}default:return e}},trees:(e=$A,t)=>(0,RA.ZP)(e,(r=>{switch(t.type){case Sb.MODE_UPDATED:{const{mode:e,silent:n}=t.payload;if(n)break;Object.keys(null==r?void 0:r.trees).forEach((e=>{UA(r.trees[e].root,"showDetails",!1)})),(0,v.isViewMode)(e)?(r.common.commands=[],r.initialTrees={}):(0,v.isEditableMode)(e)&&((0,v.isEmptyValue)(r.initialTrees)?r.initialTrees=qA({},r.trees):(r.common.commands=[],r.trees=qA({},r.initialTrees)));break}case Sb.MODE_EDITING_CANCELED:case OA.TREES_RESTORE_FROM_INITIAL_TREES:r.trees=qA({},r.initialTrees);break;case OA.TREES_RESET_INITIAL_TREES:r.initialTrees={};break;case XC.ENTITY_LOADED:{const{silent:r}=t.payload;return r?e:$A}case OA.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 OA.TREE_LOADING:{const e=t.payload;r.trees[e]=r.trees[e]||{},r.trees[e].loading=!0;break}case OA.TREE_CHILDREN_LOADING:{const{id:e,parentId:n,nodeId:a}=t.payload,i=r.trees[e].root,o=(0,v.findNodeById)(i,n);o.pending=!1,o.children=(o.children||[]).concat({entity:{},loading:!0,nodeId:a});break}case OA.TREE_CHILDREN_LOADED:{const{children:e,id:n,parentId:a}=t.payload,i=r.trees[n].root,o=(0,v.findNodeById)(i,a);o&&(o.children=((e=[],t=[])=>{const r=(0,O.reject)((0,O.prop)("loading"))(e);return t.forEach((t=>{e.find((e=>(0,O.path)(["entity","uri"],e)===t.entity.uri))||r.push(t)})),r})(o.children,e),delete o.pending);break}case OA.TREE_NODE_REMOVED:{const{id:e,nodeId:n}=t.payload,a=r.trees[e].root,i=(0,v.findParentNodeById)(a,n);DA(i||a,n);break}case OA.TREE_NODE_CREATED:{const{id:e,parentId:n,node:a}=t.payload,i=r.trees[e].root,o=(0,v.findNodeById)(i,n)||i,l=o.children.length;kA(o,a,l);break}case OA.TREE_NODE_EDITED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,v.findNodeById)(a,n.nodeId),o=Object.keys(n);for(const e of o)i[e]=n[e];break}case OA.TREE_NODE_EDITING_STARTED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,v.findNodeById)(a,n.nodeId),o=(0,v.findParentNodeById)(a,n.nodeId);i&&o&&(i.editingMode=v.NODE_EDITING_MODES.editing,i.relatedEntity=o.entity,delete i.loading,i.initialConnection=jA(i),FA({id:e,draft:r.trees,node:i}));break}case OA.TREE_NODE_EDITING_APPLIED:{const{id:e,node:a}=t.payload,i=r.trees[e].root,o=(0,v.findNodeById)(i,a.nodeId),l=BA({id:e,draft:r.trees,relationUri:a.relation.uri});var n;o&&l&&(zA(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,VA({id:e,draft:r.trees,relationUri:a.relation.uri}));break}case OA.TREE_NODE_EDITING_CANCELED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,v.findNodeById)(a,n.nodeId);i&&(zA(i),VA({id:e,draft:r.trees,relationUri:n.relation.uri}));break}case OA.TREE_NODE_NEW_PARENT_EDITING_STARTED:{const{id:e,node:n,newNode:a}=t.payload,i=r.trees[e].root,o=(0,v.findNodeById)(i,n.nodeId);if(a.relatedEntity=o.entity,a.relatedNodeId=o.nodeId,a.editingMode=v.NODE_EDITING_MODES.addingParent,i===o)a.children=[i],r.trees[e].root=a;else{const e=(0,v.findParentNodeById)(i,n.nodeId),t=e.children.findIndex((e=>o===e));kA(e,a,t)}a.initialConnection=jA(a),FA({id:e,draft:r.trees,node:a});break}case OA.TREE_NODE_NEW_PARENT_EDITING_APPLIED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,v.findNodeById)(a,n.nodeId),o=(0,v.findNodeById)(a,n.relatedNodeId),l=BA({id:e,draft:r.trees,relationUri:n.relation.uri});i&&l&&(HA({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=((e,t=[])=>PA(e,t.reduce(((e,t)=>_A({},e,{[t.entity.uri]:(0,O.pick)(["entity","parent","relations"],t)})),{})))(r.trees[e].entitiesMap,[o,GA(l)]),VA({id:e,draft:r.trees,relationUri:i.relation.uri}));break}case OA.TREE_NODE_NEW_PARENT_EDITING_CANCELED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,v.findNodeById)(a,n.nodeId);i&&(HA({id:e,draft:r.trees,currentNode:i}),VA({id:e,draft:r.trees,relationUri:i.relation.uri}));break}case OA.TREE_NODE_NEW_CHILD_EDITING_STARTED:{const{id:e,node:n,newNode:a}=t.payload,i=r.trees[e].root,o=(0,v.findNodeById)(i,n.nodeId);a.relatedEntity=o.entity,a.editingMode=v.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=jA(a),FA({id:e,draft:r.trees,node:a});break}case OA.TREE_NODE_NEW_CHILD_EDITING_APPLIED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,v.findParentNodeById)(a,n.nodeId),o=(0,v.findNodeById)(i,n.nodeId),l=BA({id:e,draft:r.trees,relationUri:n.relation.uri});i&&o&&l&&(zA(o),o.entity=l.entity,o.relation=l.relation,o.relations=[l.relation],VA({id:e,draft:r.trees,relationUri:n.relation.uri}));break}case OA.TREE_NODE_NEW_CHILD_EDITING_CANCELED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,v.findParentNodeById)(a,n.nodeId);i&&(DA(i,n.nodeId),VA({id:e,draft:r.trees,relationUri:n.relation.uri}));break}case OA.TREE_NODE_RELATION_TYPE_CHANGED:{const{id:e,node:n,relationTypeUri:a}=t.payload,i=BA({id:e,draft:r.trees,relationUri:n.relation.uri}).relation.type;i!==a&&(i&&MA({id:e,draft:r.trees,node:n,entity:null}),(({id:e,draft:t,node:r,relationTypeUri:n})=>{LA({path:["editingConnections",r.relation.uri,"relation"],object:t[e],value:e=>_A({},e,{type:n,attributes:{}})})})({id:e,draft:r.trees,node:n,relationTypeUri:a}));break}case OA.TREE_NODE_ENTITY_CHANGED:{const{id:e,node:n,entity:a}=t.payload;MA({id:e,draft:r.trees,node:n,entity:a});break}case ab.ADD_ATTRIBUTES:return t.payload.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:a,viewId:i}=t,o=(0,v.getBaseUri)(n),l=YA(i,o,e.trees);if(l&&(0,v.isRelationUri)(o)){const t=(0,O.view)(l,e.trees);if((0,v.isActivenessAttrType)(r)){const n=(0,v.addEntitySpecialAttribute)({entity:t,attributeType:r});return qA({},e,{trees:(0,O.set)(l,n,e.trees)})}{const i=(0,v.addAttribute)({entity:t,attributeType:r,parentUri:n,index:a});return qA({},e,{trees:(0,O.set)(l,i,e.trees)})}}return e}),e);case ab.MODIFY_ATTRIBUTE:{const{attributeType:r,viewId:n,uri:a,value:i}=t.payload,o=(0,v.getBaseUri)(a),l=YA(n,o,e.trees);if(l&&(0,v.isRelationUri)(o)){const t=(0,O.view)(l,e.trees);if((0,v.isActivenessAttrType)(r)){const n=(0,v.editEntitySpecialAttribute)({entity:t,attributeType:r,value:i});return qA({},e,{trees:(0,O.set)(l,n,e.trees)})}{const n=(0,v.editAttribute)({entity:t,attributeType:r,uri:a,value:i});return qA({},e,{trees:(0,O.set)(l,n,e.trees)})}}return e}case ab.REMOVE_ATTRIBUTE:{const{attributeType:r,uri:n,viewId:a}=t.payload,i=(0,v.getBaseUri)(n),o=YA(a,i,e.trees);if(o&&(0,v.isRelationUri)(i)){const t=(0,O.view)(o,e.trees);if((0,v.isActivenessAttrType)(r)){const n=(0,v.removeEntitySpecialAttribute)({entity:t,attributeType:r});return qA({},e,{trees:(0,O.set)(o,n,e.trees)})}{const a=(0,v.removeAttribute)({entity:t,attributeType:r,uri:n});return qA({},e,{trees:(0,O.set)(o,a,e.trees)})}}return e}case ab.ADD_DEFAULT_VALUES:{const{viewId:r,attributeType:n,parentUri:a,metadata:i,mode:o}=t.payload,l=(0,v.getBaseUri)(a),s=YA(r,l,e.trees);if((0,v.isRelationUri)(l)&&s){if(n){const t=(0,v.getAttributeTypeSubAttributes)(i,n);return qA({},e,{trees:(0,O.over)(s,(0,v.addDefaultValuesToComplexAttribute)({attributeType:n,subAttributes:t,metadata:i,mode:o,parentUri:a}),e.trees)})}{const t=(0,O.compose)(s,(0,O.lensPath)(["attributes"])),r=(0,O.compose)(s,(0,O.lensPath)(["type"])),n=(0,O.view)(r,e.trees),{attributes:l=[]}=(0,v.getRelationType)(i,n);return qA({},e,{trees:(0,O.over)(t,(0,v.addDefaultValuesToAttributes)({metadata:i,mode:o,attributeTypes:l,parentUri:a}),e.trees)})}}return e}case OA.TREE_ENTITIES_MAPPING_LOADED:{const{id:e,entitiesSubMap:n}=t.payload,a=r.trees[e].entitiesMap;r.trees[e].entitiesMap=PA(a,n);break}case OA.TREE_LOADED:{const{tree:e,id:n,graphTypes:a,activenessDate:i,isReversed:o}=t.payload,l=WA(r.trees[n]||{});r.trees[n]=qA({},l,e,{graphTypes:a,activenessDate:i,isReversed:o}),delete r.trees[n].errorMessage,r.trees[n].loading=!1;break}case OA.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,v.mapTree)(r.trees[e].root,{childrenProcessing:(0,v.sortTreeChildren)({sortField:a,sortOrder:i,typesLabelsMap:n})}));break}case OA.TREE_SECONDARY_LABEL_SHOWN:{const{id:e,show:n}=t.payload;r.trees[e].showSecondaryLabel=n,r.trees[e].root=qA({},r.trees[e].root);break}case OA.TREES_STATE_RESTORED:{const e=t.payload;Object.keys(e).forEach((t=>{r.trees[t]=r.trees[t]||{},r.trees[t]=qA({},r.trees[t],e[t]),r.trees[t].root&&(r.trees[t].root=qA({},r.trees[t].root))}));break}case OA.TREE_CHANGED:{const{id:e,tree:n}=t.payload;r.trees[e].root=n;break}case OA.TREE_REFRESHED:{const e=t.payload;r.trees[e].root=qA({},r.trees[e].root);break}case OA.TREE_NODE_EXPANDED:{const{id:e,nodeId:n}=t.payload,a=r.trees[e].root;(0,v.findNodeById)(a,n).expanded=!0;break}case OA.TREE_CURRENT_ENTITY_SHOWN:{const{id:n,uri:a=(0,O.path)(["entity","uri"],e)}=t.payload;if(r.trees[n]){const e=NA(r.trees[n].root,a);r.trees[n].scrollTo=e}break}case OA.TREE_SCROLL_TO_NODE_RESET:{const e=t.payload;r.trees[e]&&(r.trees[e].scrollTo=null);break}case OA.TREE_ACTIVENESS_DATE_CHANGED:{const{id:e,activenessDate:n}=t.payload;r.trees[e].activenessDate=n;break}case OA.TREE_RELATION_REPOINTED:{const{entity:e,relation:n,newParent:a,isReversed:i}=t.payload,o=(0,O.prop)("uri"),l=o(e),s=o(a),c=(0,v.createRelationRepointCommand)({entityUri:l,relation:n,newEntityUri:s,isReversed:i});r.common.commands.push(c);break}case OA.TREE_RELATION_REMOVED:{const{relationUri:e}=t.payload;if((0,v.isTempUri)(e))r.common.commands=(0,O.reject)((0,v.isRelationCommandForUri)(e),r.common.commands);else{const t=(0,v.createRelationDeleteCommand)({relationUri:e});r.common.commands.push(t)}break}case OA.TREE_RELATION_CREATED:{const{entityUri:e,relation:n,parentEntityUri:a}=t.payload,i=(0,v.createRelationCreateCommand)({parentUri:a,relation:n,entityUri:e});r.common.commands.push(i);break}case OA.TREE_RELATION_EDITED:{const{oldRelation:e,newRelation:n,entityUri:a,newEntityUri:i,isReversed:o}=t.payload,l=i?(0,v.createRelationRepointCommand)({entityUri:a,newEntityUri:i,relation:n,isReversed:o}):(0,v.createRelationUpdateCommand)({oldRelation:e,newRelation:n});r.common.commands.push(l);break}case OA.TREE_COMMANDS_CLEARED:r.common.commands=[];break;case OA.TREE_CANCEL_CHILDREN_LOADING:{const{id:e,parentId:n}=t.payload,a=r.trees[e].root,i=(0,v.findNodeById)(a,n);i&&(i.pending=!0,delete i.expanded,delete i.children);break}}})),operation:(e=null,t)=>t.type===o_.PROFILE_OPERATION_UPDATE?t.payload:e,views:(e=null,t)=>t.type===T_.PROFILE_VIEWS_SET?t.payload:e,sidePanelViews:(e=tI,t)=>t.type===eI.SIDE_PANEL_VIEWS_LOADED?t.payload:e,entityRelatedAttributes:(e=XA,t)=>{switch(t.type){case KA.ENTITY_RELATED_ATTRIBUTES_ADDED:{const{attributeTypeUri:r,entityUri:n,attributes:a}=t.payload;return(0,O.assocPath)([r,n],a,e)}case Sb.MODE_UPDATED:{const{mode:r,silent:n}=t.payload;return(0,v.isViewMode)(r)&&!n?XA:e}default:return e}},hiddenAttributes:(e=iI,t)=>{switch(t.type){case rI.HIDDEN_ATTRIBUTES_UPDATED:{const{uri:r,hiddenAttributes:n}=t.payload;return(0,O.assoc)(r,n,e)}case rI.HIDDEN_ATTRIBUTES_RESET:return(0,O.dissoc)(t.payload,e);default:return e}},controlAttributes:(e=sI,t)=>t.type===oI.CONTROL_ATTRIBUTES_UPDATED?t.payload:e});r(39235),r(58512),r(36801);const uI={getModule:()=>({id:"mdm",reducerMap:{dataTenants:$E,tenants:XE,metadata:nb,profile:cI,tenant:eO,environment:lO,user:qT,ui:WT,search:nv},sagas:[...rA,...KC,...J_,...Jb]}),selectors:c},pI=uI,dI=({className:e})=>{const t=(0,sp.useDispatch)(),r=(0,sp.useSelector)(Ti.qx),n=(0,sp.useSelector)(pI.selectors.getGoogleMapKey),a=(0,ap.useMemo)((()=>((e,t)=>(0,O.when)((0,O.always)(!t),(0,O.reject)((0,O.propEq)("id",B.om.MAP)))(e))([{id:B.om.MAP,tooltipTitle:ei().text("View map"),Icon:GE()},{id:B.om.PROFILE,tooltipTitle:ei().text("View entity details"),Icon:YE()}],n)),[n]);return ip().createElement(DE,{className:e,modes:a,modeId:r,onChange:e=>{t(Ei(r!==e?e:null))}})};dI.propTypes={className:lp().string};const mI=dI,fI=()=>ip().createElement("div",{className:bd},ip().createElement("div",{className:"Headers-styles-title--TvsMA"},ei().text("Profiles")),ip().createElement("div",{className:vd},ip().createElement(zE,null),ip().createElement(mI,{className:Td})));var yI=r(12932),gI=r.n(yI),hI=r(83754),EI=r.n(hI);const bI=(0,Sp.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 vI(){return vI=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vI.apply(null,arguments)}function TI(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}const OI=e=>{let{value:t,tabs:r=[],onChange:n,tabClasses:a}=e,i=TI(e,["value","tabs","onChange","tabClasses"]);const o=bI(),l=(e,t)=>ip().createElement("span",{className:o.labelWrapper},ip().createElement(ad.Y,{value:e},ip().createElement("span",{className:o.label},e)),t);return ip().createElement(gI(),vI({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=TI(e,["label","value","additionalLabel","dataReltioId"]);return ip().createElement(EI(),vI({classes:a||{root:o.tabRoot,disabled:o.disabled},key:r,value:r,label:l(t,n),"data-reltio-id":i},s))})))};function SI(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class xI extends ap.PureComponent{constructor(...e){super(...e),this.getTabsData=()=>{const{tenantObject:e,tableViewTabs:t,selectedEntityTypes:r,metadata:n}=this.props,a=(0,hy.ZK)(t,e);return(0,vi.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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){SI(e,t,r[t])}))}return e}({},e,{additionalLabel:ip().createElement("span",{className:"Headers-styles-number--trErH"},"(",void 0===e.number?ei().text("N/A"):(0,Ka.k7)(e.number),")")})))},this.onTabChange=e=>{this.props.dispatch(di(e))},this.onSelectColumns=e=>{const{dispatch:t,entityTypeTab:r,columnsForEntityType:n}=this.props;return t(pi(r,e,n))},this.renderTabs=()=>{const{entityTypeTab:e}=this.props;return ip().createElement("div",{className:"Headers-styles-tabsContainer--lhDXc"},ip().createElement(OI,{value:e,tabs:this.getTabsData(),onChange:this.onTabChange}))}}render(){const{entityTypeTab:e,columnsForEntityType:t}=this.props;return ip().createElement("div",{className:bd},this.renderTabs(),ip().createElement("div",{className:vd},ip().createElement(xd,{entityTypeUri:e,headColumns:t,onSelectColumns:this.onSelectColumns,"data-reltio-id":"reltio-search-table-add-remove-column",disabled:!e,showForDisabled:!0}),ip().createElement(Cf(),{orientation:"vertical",className:"Headers-styles-splitter--sCvn6"}),ip().createElement(zE,null),ip().createElement(mI,{className:Td})))}}const CI=(0,sp.connect)((e=>{const t=(0,Ti.o4)(e);return{metadata:A().selectors.getMetadata(e),selectedEntityTypes:(0,C.DX)(e),tableViewTabs:(0,Ti.gu)(e),entityTypeTab:t,columnsForEntityType:(0,Ti.Gv)(e,t),tenantObject:(0,Xa.t9)(e)}}))(xI);function wI(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class AI extends ip().PureComponent{constructor(...e){super(...e),this.entitiesTableRef=this.props.basicTableRef||ip().createRef(),this.state={resizeDebounceDelay:void 0},this.sortHandle=({field:e,order:t})=>{this.props.dispatch((({field:e,order:t,entityTypeUri:r})=>({type:_.Z.CHANGE_SORT,payload:{field:e,order:t,entityTypeUri:r}}))({field:t?e:null,order:t,entityTypeUri:this.props.entityTypeUri}))},this.reorderingHandle=({what:e,where:t})=>{const{entityTypeUri:r,dispatch:n,headColumns:a}=this.props;n(((e,t)=>({type:ge,payload:{entityTypeUri:e,columns:t}}))(r,(0,O.move)(e.columnIndex,t.columnIndex,a)))},this.changeColumnsListHandle=({columns:e})=>{const{entityTypeUri:t,dispatch:r,headColumns:n}=this.props;r(pi(t,e,n))},this.changeColumnsSizeHandle=e=>{const{headColumns:t,entityTypeUri:r,dispatch:n}=this.props,a=t.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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){wI(e,t,r[t])}))}return e}({},t,{size:e[r].size,autoResize:(t.autoResize??0!==r)&&!e[r].manuallyChanged})));n(((e,t)=>({type:he,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,O.path)(["headColumns","length"],e)||(0,O.difference)((0,O.omit)(["size"],t),(0,O.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 ip().createElement(nf,{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})}}AI.propTypes={entities:lp().array,entityToHighlight:lp().string,selectedEntityUri:lp().string,headColumns:lp().array,onScroll:lp().func,entityTypeUri:lp().string,sortField:lp().string,sortOrder:lp().oneOf([Cd.oy,Cd.U9]),dndColumnReorderingEnabled:lp().bool,dispatch:lp().func,additionalColumns:lp().arrayOf(lp().shape({id:lp().string,label:lp().string})),onEntityClick:lp().func,onEntityHover:lp().func,entitiesImportStatus:lp().object,onEntityImportStatusChange:lp().func,basicTableRef:lp().shape({current:lp().object})},AI.defaultProps={entities:[],headColumns:[]};const RI=(0,Df.Z)(vi.oq),_I=(0,sp.connect)((e=>{const t=(0,Ti.tB)(e),r=(0,Ti.Gv)(e,t),n=A().selectors.getMetadata(e),a=RI(n,t,r);return{sortField:(0,Xa.NW)(e,{entityTypeUri:(0,Ti.o4)(e)}),sortOrder:(0,Xa.L9)(e,{entityTypeUri:(0,Ti.o4)(e)}),dndColumnReorderingEnabled:!(0,Ti.Ue)(e),headColumns:r,entityTypeUri:t,additionalColumns:a}}))(AI);var II=r(14058),NI=r.n(II);const PI=(0,Sp.Z)((()=>({container:{position:"relative",height:"100%",width:"100%"},closeButton:{position:"absolute",top:"7px",left:"7px",zIndex:1}}))),DI=(0,Sp.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"}}}))),kI=({className:e,entity:t,children:r,classes:n,renderLabel:a=O.identity})=>{const i=DI({classes:n}),o=(0,Uf.AH)(),l=(0,Uf.QQ)(),s=(0,ap.useCallback)((()=>{navigator.clipboard.writeText((0,v.getEntityId)(t))}),[t]);if((0,O.isNil)(t))return null;const c=(0,v.getLabel)(t.label),u=t.secondaryLabel,p=(0,v.getBusinessCardAttributesText)(o,t),d=(0,v.isActiveObject)(t),m=t.uri,f=(0,v.getEntityId)(t);return ip().createElement("div",{className:up()(i.profileBandWrapper,e),"data-reltio-id":"reltio-profile-band"},ip().createElement("div",{className:up()(i.profileBand,{[i.inactive]:!d}),"data-entity-uri":m},ip().createElement(b.A,{key:t.uri,entity:t,avatarClassName:i.profileIcon,imageClassName:i.imageProfileIcon}),ip().createElement("div",{className:i.profileInfo},ip().createElement("div",null,ip().createElement(hf(),{variant:"h6",className:i.label},a(c)),u&&ip().createElement(hf(),{variant:"subtitle2",className:i.secondaryLabel},u),p&&ip().createElement(hf(),{variant:"subtitle1",className:i.businessCard},p)),ip().createElement("div",{className:i.specialInfo},ip().createElement("div",{className:i.entityType},ip().createElement(cE,{entity:t,size:"medium",className:i.badge}),!(0,v.isTempUri)(m)&&l&&ip().createElement(ng(),{title:ei().text("Copy to clipboard")},ip().createElement(hf(),{display:"inline",variant:"body2",className:i.entityId,onClick:s},ei().text("Entity ID"),": ",f))))),r&&ip().createElement("div",null,r)))},LI=ip().createContext(!1);LI.displayName="BlockImageGalleryDialogContext";var UI=r(31574),jI=r.n(UI);const FI=ip().createContext([]);var MI=r(24436),VI=r.n(MI);function BI(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){zI(e,t,r[t])}))}return e}function zI(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const HI=(0,Sp.Z)((e=>({basicViewPaper:BI({display:"flex",flexDirection:"column"},e.basicView)})));function YI(){return YI=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},YI.apply(null,arguments)}const WI=(0,ap.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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["children","className"]);const i=HI();return ip().createElement(VI(),YI({ref:t,className:n,classes:{root:i.basicViewPaper}},a),r)}));WI.displayName="BasicView";var GI=r(52574);const qI="1px solid #AFD4E9",ZI=(0,Sp.Z)({decorator:{marginLeft:8,borderLeft:qI,"&:last-child":{borderLeft:"none","&:before":{borderLeft:qI}},"&:before":{top:0,height:14,width:5,borderBottom:qI,content:'""',display:"block",left:"0"},"&$plain":{"&:before":{width:0}}},plain:{},wrapper:{marginLeft:16,marginTop:-8}}),$I=({className:e,children:t,plain:r=!1,enabled:n=!1})=>{const a=ZI();return n?ip().createElement("div",{"data-reltio-id":"branch-decorator",className:up()(a.decorator,{[a.plain]:r},e)},ip().createElement("div",{className:a.wrapper},t)):ip().createElement(ip().Fragment,null,t)},KI="commentsContainerVisibilityArea",XI=ip().createContext([]);XI.displayName="RelatedObjectUrisContext";const QI={comments:[],commentsMap:null,currentComment:null,updateCommentState:O.identity,clearCommentState:O.identity,getCommentState:()=>({}),getComment:O.identity,getComments:()=>new Promise(O.identity),getCommentsCount:O.identity,createComment:()=>new Promise(O.identity),editComment:()=>new Promise(O.identity),createReply:()=>new Promise(O.identity),resolveThread:O.identity,reOpenThread:O.identity,clearCurrentComment:O.identity,deleteComment:O.identity,sending:!1,loading:!1,pageToken:null,deleteReply:O.identity,editReply:()=>new Promise(O.identity)},JI=ip().createContext(QI);function eN(){return eN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},eN.apply(null,arguments)}JI.displayName="CollaborationContext";const tN=e=>ip().createElement("svg",eN({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),ip().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"})),rN=(0,Sp.Z)((()=>({root:{position:"relative",height:"18px",display:"flex",alignItems:"center",justifyContent:"center",marginLeft:"4px",cursor:"pointer"},icon:{"&:hover":{fillOpacity:.7}}})));function nN(){return nN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},nN.apply(null,arguments)}const aN=ip().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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["children","tooltipTitle","icon","onClick","className"]);const s=rN();return ip().createElement(ng(),{title:n},ip().createElement("div",nN({ref:t,className:up()(s.root,o),onClick:i},l),ip().createElement(a,{className:s.icon}),r))}));aN.displayName="BasicCommentButton";const iN=(0,Sp.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"}}),oN=ip().forwardRef((({children:e,onClick:t},r)=>{const n=iN();return ip().createElement(aN,{ref:r,tooltipTitle:ei().text("Show comment"),icon:tN,onClick:t,"data-reltio-id":"reltio-comment-button"},ip().createElement("div",{className:n.childrenWrapper},e))}));function lN(){return lN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},lN.apply(null,arguments)}oN.displayName="CommentButton";const sN=e=>ip().createElement("svg",lN({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),ip().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"})),cN=({className:e,onClick:t})=>ip().createElement(aN,{className:e,onClick:t,tooltipTitle:ei().text("Add comment"),icon:sN});var uN=r(94511),pN=r.n(uN),dN=r(59674);const mN=(0,Sp.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 fN(){return fN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},fN.apply(null,arguments)}const yN=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["children","className","classes","transition"]);const o=mN(),l=a?pN():ip().Fragment,[s,c]=(0,ap.useState)(null);return ip().createElement(dN.r,fN({className:up()(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),(({TransitionProps:e})=>ip().createElement(l,e,ip().createElement(VI(),{className:up()(o.paper,null==n?void 0:n.root)},ip().createElement("span",{className:up()(o.arrow,null==n?void 0:n.arrow),ref:c}),t))))};var gN=r(93526),hN=r.n(gN);const EN=(0,Sp.Z)((e=>({menuItem:{minHeight:"32px"},menuText:{color:e.palette.text.primary,fontSize:"13px",lineHeight:"15px",letterSpacing:0}}))),bN=(0,id.T)(Wp()),vN=(0,ap.forwardRef)((({item:e,onMenuClose:t=O.identity},r)=>{const n=EN(),{disabled:a,text:i,tooltip:o,onClick:l,id:s="",selectable:c,selected:u}=e;return ip().createElement(bN,{tooltipTitle:o,showForDisabled:!0,classes:{root:n.menuItem},onClick:e=>{t(e),l(e)},disabled:a,ref:r,"data-modal":!0,"data-reltio-id":`reltio-search-menu-item${s}`},c&&ip().createElement(Hp(),{checked:u,color:"primary"}),ip().createElement(hf(),{classes:{root:n.menuText}},i))}));vN.displayName="DefaultMenuItemRenderer";const TN=(0,Sp.Z)((e=>({buttonRoot:{"&$selected":{color:e.palette.action.active,backgroundColor:(0,xm.alpha)(e.palette.action.active,.12),"&:hover":{backgroundColor:(0,xm.alpha)(e.palette.action.active,.15)}}},selected:{},paper:{minWidth:"112px"}})));function ON(){return ON=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ON.apply(null,arguments)}function SN({className:e,menuId:t,buttonComponent:r=Gh(),buttonContent:n,menuItems:a=[],buttonProps:i={},popoverProps:o={},onMenuOpen:l=O.identity,onMenuClose:s=O.identity,MenuItemRenderer:c=vN}){const u=r,p=TN(),d=(0,ap.useRef)(),[m,f]=(0,ap.useState)(!1);(0,mE.D)((()=>{m?l():s()}),[m]);const y=(0,ap.useCallback)((e=>{null==e||e.stopPropagation(),f((e=>!e))}),[]);return ip().createElement(ip().Fragment,null,ip().createElement(u,ON({"data-reltio-id":"drop-down-menu-button",ref:d,className:up()(p.buttonRoot,{[p.selected]:m},e),onClick:y,"aria-pressed":m,"aria-controls":m?t:void 0,"aria-haspopup":"true"},i),n),ip().createElement(hN(),ON({id:t,variant:"menu",open:m,autoFocus:!1,classes:{paper:p.paper},anchorEl:d.current,onClose:y,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},elevation:2,MenuListProps:{autoFocusItem:m}},o),a.map(((e,t)=>ip().createElement(c,{item:e,key:t,onMenuClose:y})))))}const xN=(e,t)=>{(0,ap.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])},CN=(e,t)=>{const r=e.relatedObjectUris.indexOf(t);if(r>=0)return e.relatedObjectUris[1-r]},wN=e=>`${ei().date(e,"LT")} ${ei().date(e,"LL")}`,AN=e=>`comment/${e.commentId}`,RN=(e,t)=>`comment/${e.commentId}/reply/${t.replyId}`,_N=(e,t)=>{let r=e;for(const e of t)r=r.split(`+${e}`).join(`@[${e}](${e})`);return r},IN=ip().createContext({});IN.displayName="EntitiesMapContext";const NN=(0,Sp.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 PN(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const DN=({comment:e,className:t})=>{const r=NN(),n=(0,ap.useContext)(IN),a=(0,Uf.AH)(),i=(0,Uf.eh)();return ip().createElement(jI(),{className:t},(()=>{switch(e.objectType){case v.CollaborationObjectTypes.ENTITY_ATTRIBUTE:{const t=(0,v.getAttributeTypeUriByValueUri)(e.objectId,i.type),n=(0,v.findAttributeTypeByUri)(a,t);return ip().createElement(ip().Fragment,null,ip().createElement(hf(),{className:r.title},ei().text("Selected attribute:")),ip().createElement(hf(),{className:r.label},null==n?void 0:n.label))}case v.CollaborationObjectTypes.RELATION_ATTRIBUTE:{const t=e.relatedObjectUris.find((0,O.startsWith)("configuration/relationTypes")),n=t&&(0,v.getAttributeTypeUriByValueUri)(e.objectId,t),i=n&&(0,v.findAttributeTypeByUri)(a,n);return ip().createElement(ip().Fragment,null,ip().createElement(hf(),{className:r.title},ei().text("Selected attribute:")),ip().createElement(hf(),{className:r.label},null==i?void 0:i.label))}case v.CollaborationObjectTypes.ENTITY:return ip().createElement(ip().Fragment,null,ip().createElement(hf(),{className:r.title},ei().text("Selected profile:")),ip().createElement(Ld.x,{className:up()(r.label,r.link),value:(0,v.getEntityUriForLink)(i)},(0,v.getLabel)(i.label)));case v.CollaborationObjectTypes.RELATION:{const t=CN(e,i.uri),a=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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){PN(e,t,r[t])}))}return e}({},n[t]||{},{uri:t});return ip().createElement(ip().Fragment,null,ip().createElement(hf(),{className:r.title},ei().text("Selected relation:")),ip().createElement(hf(),{className:r.label},ip().createElement(Ld.x,{className:r.link,value:(0,v.getEntityUriForLink)(i)},(0,v.getLabel)(i.label)),t&&ip().createElement(ip().Fragment,null,` ${ei().text("to")} `,ip().createElement(Ld.x,{className:r.link,value:(0,v.getEntityUriForLink)(a)},a.label?(0,v.getLabel)(a.label):(0,v.getEntityId)(a)))))}case v.CollaborationObjectTypes.POTENTIAL_MATCH:{var t;const a=CN(e,i.uri),o={uri:a,label:null===(t=n[a])||void 0===t?void 0:t.label};return ip().createElement(ip().Fragment,null,ip().createElement(hf(),{className:r.title},ei().text("Selected potential match:")),ip().createElement(hf(),{className:r.label},ip().createElement(Ld.x,{className:r.link,value:(0,v.getEntityUriForLink)(i)},(0,v.getLabel)(i.label)),a&&ip().createElement(ip().Fragment,null,` ${ei().text("and")} `,ip().createElement(Ld.x,{className:r.link,value:(0,v.getEntityUriForLink)(o)},o.label?(0,v.getLabel)(o.label):(0,v.getEntityId)(o)))))}default:return null}})())},kN=ip().createContext([]);kN.displayName="UsersContext";const LN=(0,Sp.Z)((e=>({root:{color:e.palette.text.primary,fontSize:"13px",lineHeight:"15px",wordBreak:"break-word"}}))),UN=({comment:e,className:t})=>{const r=LN(),n=(0,ap.useContext)(kN);return ip().createElement(hf(),{className:up()(r.root,t)},((e,t,r=(e=>e),n="+")=>{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})(e.content,e.namedUsers,(e=>{const t=n.find((t=>t.username===e.slice(1)));return t?ip().createElement(ry(),{href:`mailto:${t.email}`,underline:"hover"},e):e})).map(((e,t)=>ip().createElement(ap.Fragment,{key:t},e))))},jN=(0,Sp.Z)((e=>({root:{width:"32px",height:"32px",fontSize:"12px",color:e.palette.text.secondary,backgroundColor:"rgba(144, 164, 174, 0.2)"}})));function FN(){return FN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},FN.apply(null,arguments)}const MN=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","children"]);const a=jN();return ip().createElement(Yd(),FN({},n,{className:up()(a.root,t)}),r.split(".").map((e=>e[0].toUpperCase())).join(""))};var VN=r(2271);const BN=r(47503).$+1,zN=(0,Sp.Z)((e=>({root:{backgroundColor:"#fff",fontFamily:"Roboto"},mentionsControl:{fontSize:"13px"},mentionsHighlighter:{padding:"10px 22px",border:"1px solid transparent !important","&::before":{content:({placeholder:e})=>e&&`"${e}"`}},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:BN+"!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":{backgroundColor:"rgba(0,0,0,0.04)"}},mentionsSuggestionsItemFocused:{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 HN(){return HN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},HN.apply(null,arguments)}const YN=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["onChange","className","value","placeholder"]);const o=zN({placeholder:n?"":a}),l=(0,ap.useContext)(kN);return ip().createElement("div",{className:up()(o.root,r)},ip().createElement(VN.r,HN({},i,{value:n,placeholder:a,onChange:(e,r,n,a)=>{t(r,n,(0,O.uniq)(a.map((({display:e})=>e.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,"mentionsTextArea__suggestions__item--focused":o.mentionsSuggestionsItemFocused}}),ip().createElement(VN.p,{trigger:"+",data:l.map((({username:e})=>({id:e,display:e}))),displayTransform:(e,t)=>`+${t}`,appendSpaceOnAdd:!0,className:o.mention})))},WN=(0,Sp.Z)({root:({isEditing:e})=>({padding:e?"6px 6px 6px 0":" 6px 6px 6px 8px",borderRadius:"4px",backgroundColor:e?"transparent":"rgba(0,114,206,0.06)"}),textField:({isEditing:e})=>({width:e?"100%":"calc(100% - 40px)"}),form:{marginBottom:0},main:{display:"flex",alignItems:"center"},avatar:{marginRight:"8px"},buttons:({isEditing:e})=>({marginLeft:e?"0":"40px",marginTop:"8px"}),button:{"& + $button":{marginLeft:"8px"}}}),GN=e=>{switch(e){case"open":return ei().text("Reply...");case"resolved":return ei().text("Adding a comment will re-open this");default:return""}},qN=({inputRef:e,className:t,uri:r,relatedObjectUris:n,objectType:a,popperRef:i,comment:o,reply:l,isEditingComment:s,isEditingReply:c,onCancel:u})=>{const p=s||c,d=WN({isEditing:p}),[m,f]=(0,ap.useState)(!1),{createReply:y,createComment:g,sending:h,editComment:E,editReply:b,getCommentState:v,updateCommentState:T,clearCommentState:S}=(0,ap.useContext)(JI),x=(0,Uf.qg)(),C=(({comment:e,reply:t,isEditingComment:r,isEditingReply:n})=>(0,O.isNil)(e)?"comment/new":r?AN(e):n?RN(e,t):(e=>`comment/${e.commentId}/reply/new`)(e))({comment:o,reply:l,isEditingComment:s,isEditingReply:c}),w=(({comment:e,reply:t,isEditingComment:r,isEditingReply:n})=>{const a=r?e:n?t:null,{content:i="",namedUsers:o=[]}=a||{};return{value:_N(i,o),plainTextValue:i,mentions:o}})({comment:o,reply:l,isEditingComment:s,isEditingReply:c}),{value:A=w.value,plainTextValue:R=w.plainTextValue,mentions:_=w.mentions}=v(r,C),I=""!==w.value.trim(),N=""!==A.trim(),P=m||N||I,D=null==o?void 0:o.status,k=()=>{null==u||u(),S(r,C)};(0,ap.useEffect)((()=>{i&&i.current.forceUpdate()}),[i,P]);const L=p?"small":"medium";return ip().createElement(jI(),{className:up()(d.root,t)},ip().createElement("form",{onSubmit:e=>(e.preventDefault(),(0,O.cond)([[(0,O.always)(!o),()=>g({content:R,namedUsers:_,objectType:a,uri:r,relatedObjectUris:n})],[(0,O.always)(s),()=>E({content:R,namedUsers:_,commentId:o.commentId,objectType:a,replies:o.replies,relatedObjectUris:n,uri:r})],[(0,O.always)(c),()=>b({content:R,namedUsers:_,commentId:o.commentId,replyId:l.replyId})],[O.T,()=>y({content:R,namedUsers:_,commentId:o.commentId,action:"open"===o.status?"none":"reopen",uri:r})]])().then(k).catch(console.log)),className:d.form},ip().createElement(jI(),{className:d.main},!p&&ip().createElement(MN,{classes:{root:d.avatar}},x),ip().createElement(YN,{className:d.textField,disabled:h,onChange:(e,t,n)=>T(r,C,{value:e,plainTextValue:t,mentions:n}),inputRef:e,value:A,onFocus:()=>f(!0),onBlur:()=>f(!1),placeholder:GN(D)})),P&&ip().createElement(jI(),{className:d.buttons},ip().createElement(Gh(),{className:d.button,variant:"contained",color:"primary",disabled:!N||h,type:"submit",size:L},((e,t,r)=>t||r?ei().text("Edit"):"open"===e||"resolved"===e?ei().text("Reply"):ei().text("Comment"))(D,s,c)),ip().createElement(Gh(),{disabled:h,onClick:()=>k(),className:d.button,variant:"outlined",color:"primary",size:L},ei().text("Cancel")))))},ZN=(0,Sp.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"}}))),$N=({onReply:e,className:t,uri:r,comment:n,relatedObjectUris:a,objectType:i})=>{const o=ZN(),l=(0,ap.useRef)(),s=(0,Uf.qg)(),{commentId:c,createdBy:u,createdTime:p,status:d}=n,m="resolved"===d,f=u===s,{resolveThread:y,reOpenThread:g,sending:h,deleteComment:E,updateCommentState:b,getCommentState:v}=(0,ap.useContext)(JI),T=AN(n),{isEditing:O}=v(r,T),S=(0,ap.useCallback)((e=>b(r,T,{isEditing:e})),[T,b,r]);xN(l,O);const x=(0,ap.useMemo)((()=>m?[{text:ei().text("Delete"),onClick:()=>E({uri:r,commentId:c})}]:[{text:ei().text("Edit"),onClick:()=>S(!0)},{text:ei().text("Delete"),onClick:()=>E({uri:r,commentId:c})}]),[c,E,m,S,r]),C=ip().createElement(qN,{inputRef:l,uri:r,relatedObjectUris:a,objectType:i,onCancel:()=>S(!1),isEditingComment:O,comment:n});return ip().createElement(jI(),{className:t},ip().createElement(jI(),{className:o.header},ip().createElement(MN,{classes:{root:o.avatar}},u),ip().createElement(jI(),{width:"100%"},ip().createElement(hf(),{className:o.username},u)),ip().createElement(hf(),{className:o.createdAt},wN(p)),f&&ip().createElement(SN,{buttonComponent:gd.k,buttonProps:{icon:Id(),tooltipTitle:ei().text("Open menu")},popoverProps:{PopoverClasses:{root:o.dropdownMenu}},menuItems:x,menuId:"collaboration-comment-menu"})),ip().createElement(jI(),{className:o.body},ip().createElement(DN,{comment:n,className:o.commentTarget}),O?C:ip().createElement(UN,{comment:n,className:o.message}),ip().createElement(jI(),{className:o.buttons},ip().createElement(ry(),{className:o.button,onClick:e,component:"button",underline:"hover"},ei().text("Reply")),!m&&ip().createElement(ry(),{disabled:h,className:o.button,onClick:()=>{y({commentId:c,uri:r})},component:"button",underline:"hover"},ei().text("Resolve")),m&&ip().createElement(ry(),{disabled:h,className:o.button,onClick:()=>{g({commentId:c,uri:r})},component:"button",underline:"hover"},ei().text("Re-open")))))},KN=(0,Sp.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"}}))),XN=({className:e,reply:t,uri:r,comment:n,popperRef:a})=>{const i=(0,ap.useRef)(),o=(0,Uf.qg)(),{createdBy:l,action:s,createdTime:c}=t,u=l===o&&"resolved"!==n.status,{deleteReply:p,updateCommentState:d,getCommentState:m}=(0,ap.useContext)(JI),f=RN(n,t),{isEditing:y}=m(r,f),g=(0,ap.useCallback)((e=>d(r,f,{isEditing:e})),[f,d,r]);xN(i,y);const h=KN(),E=(0,ap.useMemo)((()=>[{text:ei().text("Edit"),onClick:()=>g(!0)},{text:ei().text("Delete"),onClick:()=>p({uri:r,commentId:n.commentId,reply:t})}]),[p,r,n.commentId,t,g]),b=ip().createElement(qN,{inputRef:i,popperRef:a,uri:r,onCancel:()=>g(!1),isEditingReply:y,reply:t,comment:n});return ip().createElement(jI(),{className:up()(h.root,e)},ip().createElement(MN,{classes:{root:h.avatar}},l),ip().createElement(jI(),{className:h.replyArea},ip().createElement(jI(),{className:h.header},ip().createElement(hf(),{className:h.username},l),"resolve"===s&&ip().createElement(hf(),{className:h.marked},ei().text("Marked as resolved")),"reopen"===s&&ip().createElement(hf(),{className:h.marked},ei().text("Re-opened"))),"resolve"!==s&&(y?b:ip().createElement(UN,{className:h.message,comment:t})),ip().createElement(hf(),{className:h.createdAt},wN(c))),u&&ip().createElement(SN,{buttonComponent:gd.k,buttonProps:{icon:Id(),tooltipTitle:ei().text("Open menu")},menuItems:E,menuId:"collaboration-comment-menu"}))},QN=(0,Sp.Z)((()=>({root:{maxWidth:"100%",padding:"8px 4px 10px 16px"},messages:{},repliedComment:{marginBottom:"2px"},replies:{marginLeft:"40px"},sendMessageArea:{marginLeft:"40px"},comment:{}}))),JN=({uri:e,relatedObjectUris:t,objectType:r,classes:n,popperRef:a,messagesRef:i,comment:o})=>{const l=(0,ap.useRef)(),s=QN({classes:n}),c=ip().createElement(qN,{className:s.sendMessageArea,inputRef:l,popperRef:a,uri:e,relatedObjectUris:t,objectType:r,comment:o});return ip().createElement(jI(),{className:s.root},o&&ip().createElement(ip().Fragment,null,ip().createElement("div",{className:s.messages,ref:i},ip().createElement($N,{comment:o,uri:e,onReply:()=>{l.current.focus()},className:s.comment,relatedObjectUris:t,objectType:r}),ip().createElement(jI(),{className:s.replies},o.replies.map((t=>ip().createElement(XN,{key:t.replyId,className:s.repliedComment,reply:t,uri:e,comment:o}))))),c),!o&&c)},eP=(0,ap.memo)(JN),tP=(0,Sp.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:({hasScroll:e})=>({marginLeft:"16px",marginRight:e?"2px":"8px"}),replies:({hasScroll:e})=>({marginLeft:"8px",marginRight:e?"2px":"8px"}),sendMessageArea:({hasScroll:e,scrollWidth:t})=>({marginLeft:"8px",marginRight:e?t+2:"8px"}),messages:{maxHeight:"400px",overflowY:"auto"}}))),rP=({uri:e,relatedObjectUris:t,objectType:r,anchorEl:n,onClose:a,open:i,comment:o})=>{const[l,s]=(0,ap.useState)(0),c=tP({scrollWidth:l,hasScroll:0!==l}),u=(0,ap.useRef)(null),{resolveThread:p,loading:d,sending:m}=(0,ap.useContext)(JI),f=1+(null==o?void 0:o.replies.length);return ip().createElement(yN,{popperRef:u,anchorEl:n,open:i,placement:"right-start",onClose:a,className:c.popper},ip().createElement(jI(),{className:c.header},ip().createElement(jI(),{className:c.headerInfo},ip().createElement(hf(),{className:c.title},ei().text("Comments")),o&&!d&&ip().createElement(hf(),{className:c.counter},ei().number(f)," ",1===f?ei().text("item"):ei().text("items"))),o&&!d&&ip().createElement(gd.k,{className:c.resolveButton,size:"S",onClick:()=>{p({commentId:o.commentId,uri:e})},disabled:m,showForDisabled:!0,tooltipTitle:ei().text("Resolve"),icon:fm(),color:"primary"})),!d&&ip().createElement(eP,{popperRef:u,messagesRef:e=>{e&&s(e.offsetWidth-e.clientWidth)},classes:{root:c.collaborationItem,replies:c.replies,sendMessageArea:c.sendMessageArea,messages:c.messages,comment:c.comment},uri:e,relatedObjectUris:t,objectType:r,comment:o}))},nP=(0,Sp.Z)((()=>({root:{display:"flex",alignItems:"start"},addButton:{visibility:"hidden","&$showAlways":{visibility:"visible"},".commentsContainerVisibilityArea:hover &":{visibility:"visible"}},showAlways:{}}))),aP=({className:e,uri:t,objectType:r,relatedObjectUris:n,onChangePopupVisibility:a,allowOnlyOneComment:i=!1,showAlways:o=!1})=>{const l=nP(),[s,c]=(0,ap.useState)(null),[u,p]=(0,ap.useState)(!1),d=u&&Boolean(s),{currentComment:m,commentsMap:f,getComment:y,clearCurrentComment:g,objectTypes:h}=(0,ap.useContext)(JI),E=!!f&&(!h||h.includes(r)),b=((null==f?void 0:f[t])||[]).filter((({status:e})=>"resolved"!==e)).reverse(),v=!i||i&&0===b.length,T=null===m&&d;(0,mE.D)((()=>{a&&a(d)}),[d]);const O=(0,ap.useContext)(XI),S=(0,ap.useMemo)((()=>O?[...n,...O]:n),[O,n]);return E&&ip().createElement("div",{className:up()(l.root,e)},v&&ip().createElement(cN,{className:up()(l.addButton,{[l.showAlways]:o||T}),onClick:e=>{c(e.currentTarget),p(!0)}}),b.map((({replies:e,commentId:t})=>ip().createElement(oN,{ref:t===(null==m?void 0:m.commentId)?c:null,key:t,onClick:()=>(e=>{y(e),p(!0)})(t)},1+e))),ip().createElement(rP,{anchorEl:s,open:d,onClose:()=>{c(null),g(),p(!1)},uri:t,relatedObjectUris:S,objectType:r,comment:m}))},iP=(0,Sp.Z)({label:{color:"rgba(0,0,0,0.6)",fontSize:"13px",lineHeight:"16px"}});function oP(){return oP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},oP.apply(null,arguments)}const lP=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["label","isRequired","className"]);const i=iP();return ip().createElement(hf(),oP({className:up()(i.label,n),component:"span"},a),t,r&&ip().createElement(rd,null))},sP=ip().createContext(null);sP.displayName="EntityContext";const cP=(0,Sp.Z)((e=>({container:{height:"16px",borderColor:(0,xm.alpha)(e.palette.primary.main,.54)},label:{paddingLeft:"4px",paddingRight:"4px",fontSize:"10px",lineHeight:"11px",color:e.palette.primary.main}}))),uP=(0,id.T)(pg()),pP=({className:e,attributeType:t,nonOvValues:r=[],nonOvTotal:n})=>{const a=cP(),i=(0,Uf.ax)("openEntity"),o=((e,t,r)=>{var n;const a=null==t||null===(n=t[0])||void 0===n?void 0:n.uri,i=a?(0,v.getEntityUriFromAttributeUri)(a):null;if(i&&(0,v.isEntityUri)(i)){const t=(0,v.getEntityUriFromAttributeUri)(r.uri);if(!e||e.type===t)return{uri:i,type:t};const n=(0,v.getParentUri)(a),o=(0,v.findAttributeValueByUri)(e,n);return{uri:(0,v.getReferencedEntityUriFromAttrValue)(o),type:t}}return e?{uri:e.uri,type:e.type}:null})((0,ap.useContext)(sP),r,t),l=(0,Uf.fC)(null==o?void 0:o.type),s=(0,ap.useCallback)((()=>{i({uri:o.uri,screen:"sources"})}),[i,o]);if(!n)return null;const c=r.length?r.map(((e,r)=>ip().createElement("div",{key:r},(0,v.isComplexAttribute)(t)?(0,v.getLabel)(e.label):ip().createElement(Md.x,{value:(0,v.getAttributeValue)(e),dataTypeDefinition:(0,v.getAttrDataTypeDefinition)(t),rich:!1})))):null;return ip().createElement(uP,{tooltipTitle:c,tooltipPlacement:"bottom",label:`+ ${n}`,variant:"outlined",onClick:null!=o&&o.uri&&l?s:void 0,classes:{root:up()(a.container,e),label:a.label}})};function dP(){return dP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},dP.apply(null,arguments)}const mP=e=>ip().createElement("svg",dP({width:12,height:12,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgDescription"},e),ip().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})),fP=ip().createContext({showDescription:!1,showNavigateToGraph:!0});fP.displayName="FeaturesContext";const yP=(0,Sp.Z)((()=>({icon:{display:"inline-flex",marginLeft:"8px",verticalAlign:"middle"}}))),gP=({className:e,description:t})=>{const{showDescription:r}=(0,ap.useContext)(fP),n=yP();return t&&r?ip().createElement(ng(),{title:t,placement:"bottom"},ip().createElement("span",{"data-reltio-id":"reltio-description-icon",className:up()(n.icon,e)},ip().createElement(mP,null))):null};var hP=r(87558);const EP=(0,r(87171).k)({unmaskedAttributes:{},unmaskAttributeValue:void 0,maskAttributeValue:void 0,deleteUnmaskedAttributeForRelation:void 0}),bP=e=>(0,hP.S)(EP,e),vP=ip().createContext({appearance:void 0,attributes:void 0,roles:void 0,tags:void 0});vP.displayName="HistoryDiffContext";const TP=ip().createContext({highlightedValuesUris:[],highlightedClassName:""});function OP(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}TP.displayName="HighlightedValuesContext";const SP=(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=xP(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}),[])},xP=(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,v.findAttributeTypeByUri)(t,n.type);a&&"object"!=typeof a&&(0,v.isOv)(n)?e.push(CP(a,i)):a&&"object"==typeof a&&!Array.isArray(a)&&e.push(SP(i,a,r,t))}return e}),[])},CP=(e,t)=>{switch(null==t?void 0:t.type){case v.DataTypes.TYPE_DATE:return new Date(e).getTime();case v.DataTypes.TYPE_TIMESTAMP:return isNaN(Number(e))?new Date(e).getTime():new Date(Number(e)).getTime();default:return e}};function wP(){return wP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},wP.apply(null,arguments)}const AP=e=>ip().createElement("svg",wP({width:11,height:11,viewBox:"0 0 11 11","data-reltio-id":"SvgPivotingIcon"},e),ip().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"}));var RP=r(98074);const _P=(0,Sp.Z)((e=>({link:{color:e.palette.primary.main,textDecoration:"none"}}))),IP=(0,ap.forwardRef)((({value:e,attributeType:t,children:r,className:n,onClick:a},i)=>{const o=_P(),{generatePivotingUrl:l}=(0,ap.useContext)(RP.v),s=l({uiPath:(0,Uf.Qh)(),uri:t.uri,value:JSON.stringify(e)}),c=(0,ap.useCallback)((e=>{(0,Tp.rR)(e)||(a(),e.preventDefault()),e.stopPropagation()}),[a]);return ip().createElement("a",{ref:i,href:s,onClick:c,className:up()(o.link,n)},r)}));IP.displayName="PivotingUriLink";const NP=(0,Sp.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"}}))),PP=({attributeType:e,label:t,entities:r,generatedValue:n,onSeeAllClick:a,total:i})=>{const o=NP(),l=i>6,s=Boolean(t);return ip().createElement("div",{className:o.container},ip().createElement("div",{className:o.header},ip().createElement("div",{className:o.title},ei().text("Pivot profiles")),ip().createElement("div",{className:o.divider}),ip().createElement("div",{className:o.headerCount},ei().number(i,"0,0")+" "+(1===i?ei().text("item"):ei().text("items")))),s&&ip().createElement("div",{className:o.entityTypeLabel},t),ip().createElement("div",{className:o.body},r.map((e=>ip().createElement("div",{key:e.uri,className:o.entityContainer},ip().createElement(b.A,{entity:e,avatarClassName:o.profileIcon}),ip().createElement(Ld.x,{className:o.entityLabel,value:(0,v.getEntityUriForLink)(e)},(0,v.getLabel)(e.label)))))),l&&ip().createElement("div",{className:o.footer},ip().createElement(IP,{value:n,attributeType:e,className:o.seeAllButton,onClick:a},ei().text("See all"))))},DP=(0,Sp.Z)((e=>({icon:{marginRight:"8px",verticalAlign:"middle",width:"12px",height:"12px"},content:{color:e.palette.primary.main,cursor:"pointer",lineHeight:"16px"}}))),kP=(0,Sp.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"}}}),LP=({value:e,attributeType:t,children:r,className:n})=>{const a=kP(),i=DP(),o=(0,ap.useContext)(FI)||[],l=(0,Uf.ax)("openPivotingPerspective"),s=(0,Uf.AH)()||{},c=(0,v.isNested)(t)?SP(t,e.value,o,s):CP(e.lookupCode||e.value,t),u=o.some((({uri:e})=>e===t.uri))&&(Array.isArray(c)&&c.length||!Array.isArray(c)&&!(0,O.isNil)(c)),p=o.find((({uri:e})=>e===t.uri)),d=null==p?void 0:p.popup,m=u?Array.isArray(c)?c.map((e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[(0,v.getLastUriPart)(e),t]))))):((e,t)=>[{[e.name]:t}])(t,c):void 0,f=()=>{l({value:m,attributeType:t})},{entities:y,total:g,loadPivotingData:h}=(({value:e,attributeType:t,entityType:r})=>{const[n,a]=(0,ap.useState)([]),[i,o]=(0,ap.useState)(0),l=(0,Oh._)(),s=(0,Uf.eh)(),c=(0,Uf.mU)(),u=r||(null==s?void 0:s.type),p=(0,ap.useMemo)((()=>(0,v.convertPivotingValueToSearchFilters)({value:e,attributeType:t,entityType:u})),[t,u,e]),d=(0,ap.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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){OP(e,t,r[t])}))}return e}({max:6,sort:"label"},c||{})),[c]),m=(0,ap.useCallback)((()=>{l(Promise.all([(0,v.getFilteredEntities)({filters:p,options:d}),(0,v.getTotals)({filters:p,options:d})])).then((e=>{const[t,{total:r}]=e;a(Array.isArray(t)?t:[]),o(r)})).catch((()=>{a([]),o(0)}))}),[p,d,l]);return{entities:n,total:i,loadPivotingData:m}})({attributeType:t,value:c,entityType:null==d?void 0:d.entityType});return u?ip().createElement(ng(),{arrow:!0,placement:"right-start",classes:a,disableInteractive:!1,onOpen:h,title:ip().createElement(PP,{generatedValue:m,attributeType:t,label:null==d?void 0:d.label,onSeeAllClick:f,entities:y,total:g})},ip().createElement("span",{className:n},ip().createElement(AP,{className:i.icon}),ip().createElement(IP,{onClick:f,className:i.content,value:m,attributeType:t},r))):ip().createElement(ip().Fragment,null,r)};var UP=r(78577),jP=r.n(UP),FP=r(46157),MP=r.n(FP);const VP=(0,Sp.Z)((e=>({icon:{color:e.palette.text.secondary,fontSize:18},switcherWrapper:{verticalAlign:"middle",marginLeft:8,width:"16px",height:"16px"}}))),BP=({className:e,isMasked:t,isUnmasking:r,onToggleMasking:n})=>{const a=VP(),i=t?ei().text("Show"):ei().text("Hide");return r?ip().createElement(um(),{size:16,className:up()(e,a.switcherWrapper)}):ip().createElement(ng(),{key:String(t),title:i},ip().createElement(Yh(),{"aria-label":i,onClick:n,className:up()(e,a.switcherWrapper)},t?ip().createElement(MP(),{className:a.icon}):ip().createElement(jP(),{className:a.icon})))};function zP(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){HP(e,t,r[t])}))}return e}function HP(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const YP=(0,Sp.Z)((e=>({root:{display:"flex",alignItems:"start",justifyContent:"space-between"},commentsContainer:{height:"15px",marginRight:"-4px"},attributeValue:{verticalAlign:"middle",wordBreak:"break-all"},updateAttribute:zP({width:"fit-content",padding:"0 4px",marginLeft:"-4px"},v.historyPalettes[v.HistoryOperations.updateAttribute],{"& > a":{color:v.historyPalettes[v.HistoryOperations.updateAttribute].color}}),insertAttribute:zP({width:"fit-content"},v.historyPalettes[v.HistoryOperations.insertAttribute],{"& > a":{color:v.historyPalettes[v.HistoryOperations.insertAttribute].color}}),deleteAttribute:zP({width:"fit-content",padding:"0 4px",marginLeft:"-4px",textDecoration:"line-through"},v.historyPalettes[v.HistoryOperations.deleteAttribute],{"& > a":{color:v.historyPalettes[v.HistoryOperations.deleteAttribute].color}}),multilineAttribute:{width:"fit-content"},ovFalse:e.inactive}))),WP=({className:e,attributeType:t=null,attributeValue:r,inlined:n})=>{const{isUnmaskingNeeded:a,isMasked:i,toggleMasking:o,attributeValue:l,isUnmasking:s}=(({attributeType:e,attributeValue:t})=>{const r=(0,Uf.xH)(),n=bP((({unmaskAttributeValue:e})=>e)),a=bP((({maskAttributeValue:e})=>e)),{attributeValue:i,isUnmasked:o=!1,loading:l=!1}=(s=t.uri,bP((({unmaskedAttributes:e})=>e[s]))||{});var s;const c=n&&a&&!!e.masking&&r,u=(0,ap.useCallback)((()=>c?n(t.uri):Promise.resolve()),[n,t.uri,c]),p=(0,ap.useCallback)((()=>{o?a(t.uri):u()}),[t.uri,o,a,u]);return{isUnmaskingNeeded:c,isMasked:!o,toggleMasking:p,isUnmasking:l,unmask:u,attributeValue:c&&o&&i||t}})({attributeType:t,attributeValue:r}),c=YP(),{highlightedValuesUris:u=[],highlightedClassName:p}=(0,ap.useContext)(TP),{appearance:d}=(0,ap.useContext)(vP),m=(0,v.getHistoryAppearanceByUri)(l.uri,d),f=(0,v.getHistoryAttributeClassName)(m),y=(0,ap.useMemo)((()=>ip().createElement(Md.x,{value:(0,v.getAttributeValue)(l),dataTypeDefinition:(0,v.getAttrDataTypeDefinition)(t)})),[l,t]),g=(0,v.getObjectTypeByAttributeUri)(l.uri),h=a&&ip().createElement(BP,{isMasked:i,onToggleMasking:o,isUnmasking:s});return n||f?ip().createElement("div",{className:up()(e,{[p]:u.includes(l.uri)})},ip().createElement(LP,{value:l,attributeType:t,key:l.uri,className:up()({[c.multilineAttribute]:!n})},ip().createElement("span",{className:up()(c.attributeValue,c[f],{[c.ovFalse]:!(0,v.isOv)(l)}),"data-reltio-id":"reltio-attribute-value"},y,h))):ip().createElement("div",{className:up()(e,c.root,KI,{[p]:u.includes(l.uri)})},ip().createElement(LP,{value:l,attributeType:t,key:l.uri},ip().createElement("span",{className:up()(c.attributeValue,{[c.ovFalse]:!(0,v.isOv)(l)}),"data-reltio-id":"reltio-attribute-value"},y,h)),ip().createElement(aP,{className:c.commentsContainer,uri:l.uri,relatedObjectUris:(0,v.createRelatedObjectUris)(g,{uri:l.uri}),objectType:g}))};var GP=r(84419),qP=r.n(GP);const ZP=(0,Sp.Z)({expandButton:{"&:hover":{backgroundColor:"transparent"}},expandIcon:{transition:"transform .15s ease"},expanded:{transform:"rotate(90deg)"}});function $P(){return $P=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},$P.apply(null,arguments)}const KP=e=>{const t=ZP(),{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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["expanded","className"]);return ip().createElement(Op.T,$P({icon:qP(),size:"XXS",disableRipple:!0,iconClassName:up()(t.expandIcon,{[t.expanded]:r}),className:up()(n,t.expandButton),"data-reltio-id":"arrow-expand-button"},a))},XP=(0,Sp.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 QP(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const JP=({attributeTypesList:e,attributeValue:t,label:r,expanded:n=!1,children:a,showNonOv:i,attributeType:o,classes:l,LabelRenderer:s,RightSlot:c})=>{const u=XP(),p=t.uri,[d,m]=(0,ap.useState)(!1),{highlightedValuesUris:f=[],highlightedClassName:y}=(0,ap.useContext)(TP);(0,ap.useEffect)((()=>{m(n)}),[n]);const g=(e||[]).some((e=>(0,v.isAnalyticAttribute)(e))),h=(0,ap.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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){QP(e,t,r[t])}))}return e}({attributes:g?null:t.value,analyticsAttributes:g?t.value:null},(0,v.isSpecialAttribute)(o)?t.value:{})),[t,g,o]),E=(0,v.getObjectTypeByAttributeUri)(t.uri);return ip().createElement("div",{className:u.complexContainer},ip().createElement("div",{className:up()(u.labelContainer,KI)},ip().createElement(KP,{onClick:()=>m((e=>!e)),expanded:d}),s?ip().createElement(s,{attributeType:o,attributeValue:t}):ip().createElement(ip().Fragment,null,ip().createElement(hf(),{component:"span",variant:"body2",classes:{body2:u.label},className:up()({[y]:f.includes(t.uri),[u.ovFalse]:!(0,v.isOv)(t)}),"data-reltio-id":"reltio-attribute-complex-label"},r),ip().createElement("div",{className:u.spacer}),c&&ip().createElement(c,{attributeType:o,attributeValue:t}),ip().createElement(aP,{uri:t.uri,relatedObjectUris:(0,v.createRelatedObjectUris)(E,{uri:t.uri}),objectType:E}))),d&&ip().createElement(XF,{attrTypes:e,entity:h,drawLines:!0,parentUri:p,showNonOv:i,classes:l},a))};var eD=r(29195);function tD(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){rD(e,t,r[t])}))}return e}function rD(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const nD=(0,Sp.Z)({label:{textDecoration:"none",verticalAlign:"middle"},updateAttribute:tD({width:"fit-content",padding:"0 4px",marginLeft:"-4px"},v.historyPalettes[v.HistoryOperations.updateAttribute]),insertAttribute:tD({width:"fit-content"},v.historyPalettes[v.HistoryOperations.insertAttribute]),deleteAttribute:tD({width:"fit-content",textDecoration:"line-through",padding:"0 4px",marginLeft:"-4px"},v.historyPalettes[v.HistoryOperations.deleteAttribute]),pivotingTooltip:{marginLeft:"4px"}});function aD(){return aD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},aD.apply(null,arguments)}const iD=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeValue","attributeType"]);const a=nD(),{appearance:i}=(0,ap.useContext)(vP),o=(0,ap.useMemo)((()=>{const e=(0,v.getHistoryAppearanceByUri)(t.uri,i),n=(0,v.getHistoryAttributeClassName)(e),o=t.label?t.label:(0,v.evaluateDeepEntityLabel)(t,r.dataLabelPattern);return ip().createElement(LP,{className:a.pivotingTooltip,value:t,attributeType:r},ip().createElement(jI(),{component:"span",className:up()(a[n],a.label)},ip().createElement(eD.b,{text:(0,v.getLabel)(o)})))}),[i,a,t,r]);return ip().createElement(JP,aD({label:o,attributeValue:t,attributeTypesList:(0,v.getAttributeTypeSubAttributes)({},r),attributeType:r},n))},oD=(0,ap.memo)(iD);var lD=r(24217),sD=r(16782);const cD=(0,Sp.Z)((e=>({link:{color:e.palette.primary.main,textDecoration:"none"}})));function uD(){return uD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},uD.apply(null,arguments)}const pD=e=>{const t=cD(),r=(0,sD.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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["href","className"]),o=up()(t.link,a);return r&&n?ip().createElement(lD.rU,uD({to:n.replace(window.location.origin,""),className:o},i)):ip().createElement("a",uD({href:n,className:o},i))};function dD(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){mD(e,t,r[t])}))}return e}function mD(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const fD=(0,Sp.Z)((e=>({relationshipLabel:{marginLeft:"4px",color:e.palette.text.primary},updateAttribute:dD({width:"fit-content",padding:"0 4px",marginLeft:"-4px"},v.historyPalettes[v.HistoryOperations.updateAttribute]),insertAttribute:dD({width:"fit-content"},v.historyPalettes[v.HistoryOperations.insertAttribute]),deleteAttribute:dD({width:"fit-content",textDecoration:"line-through",padding:"0 4px",marginLeft:"-4px"},v.historyPalettes[v.HistoryOperations.deleteAttribute]),ovFalse:e.inactive})));function yD(){return yD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},yD.apply(null,arguments)}const gD=(0,ap.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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeValue","attributeType"]);const a=fD(),i=(0,Uf.AH)(),o=(0,Uf.Qh)(),l=(0,v.getReferencedEntityUriFromAttrValue)(t),s=(0,ap.useMemo)((()=>(0,v.getAttributeTypeSubAttributes)(i,r)),[r,i]),{appearance:c}=(0,ap.useContext)(vP),{generateEntityUrl:u}=(0,ap.useContext)(RP.v),p=(0,ap.useMemo)((()=>{const e=(0,v.getHistoryAppearanceByUri)(t.uri,c),r=(0,v.getHistoryAttributeClassName)(e),n=null!=l&&l.startsWith("changeRequests")?"dcrReview":"profile";return ip().createElement(pD,{href:(0,v.isEmptyValue)(c)?u({uiPath:o,uri:l,screen:n}):void 0,className:up()(a[r],{[a.ovFalse]:!(0,v.isOv)(t)})},ip().createElement(eD.b,{text:(0,v.getLabel)(t.label)}),t.relationshipLabel&&ip().createElement("span",{className:a.relationshipLabel},ip().createElement(eD.b,{text:t.relationshipLabel})))}),[t,c,o,l,a,u]);return ip().createElement(JP,yD({attributeTypesList:s,attributeValue:t,label:p,attributeType:r},n))}));gD.displayName="ReferenceAttribute";const hD=e=>{const{attributeType:t}=e;return class{static build(e,t={}){switch(e.type){case v.DataTypes.TYPE_NESTED:return ip().createElement(oD,t);case v.DataTypes.TYPE_REFERENCE:return ip().createElement(gD,t);default:return ip().createElement(WP,t)}}}.build(t,e)};function ED(){return ED=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ED.apply(null,arguments)}const bD=e=>ip().createElement("svg",ED({width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgControlAttribute"},e),ip().createElement("mask",{id:"ControlAttribute_svg__a",fill:"#fff"},ip().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"})),ip().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)"}),ip().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"})),vD=(0,Sp.Z)({icon:{display:"inline-flex",marginLeft:"8px",verticalAlign:"middle"}});function TD(){return TD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},TD.apply(null,arguments)}const OD=(0,ap.forwardRef)(((e,t)=>ip().createElement("span",TD({},e,{ref:t}),ip().createElement(bD,null))));OD.displayName="ControlAttributeForwarded";const SD=(0,id.T)(OD),xD=()=>{const e=vD();return ip().createElement(SD,{"data-reltio-id":"reltio-control-attribute-icon",tooltipTitle:ei().text("This is a control attribute. Changing this value will affect availability of other conditional attributes."),className:e.icon})};function CD(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){wD(e,t,r[t])}))}return e}function wD(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const AD="13px",RD="16px",_D={titleRow:{display:"inline-block",minHeight:"16px"},title:{wordBreak:"break-all",verticalAlign:"middle"},ovIcon:{marginLeft:"8px",textIndent:0},descriptionIcon:{textIndent:0}},ID=(0,Sp.Z)({paddingWrapper:{paddingTop:"3px",paddingBottom:"5px","&:last-child":{paddingBottom:"2px"}},paddingWrapperWithLines:{paddingBottom:"1px","&:last-child":{paddingBottom:"2px"}}}),ND=(0,Sp.Z)(CD({wrapper:{fontSize:AD,lineHeight:RD},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"}},_D)),PD=(0,Sp.Z)(CD({wrapper:{display:"flex",flexDirection:"column",alignItems:"flex-start",fontSize:AD,lineHeight:RD},attribute:{"&:last-child":{marginBottom:0},paddingLeft:"4px",paddingRight:"4px",marginLeft:"5px",marginBottom:"4px",whiteSpace:"pre-wrap",wordBreak:"break-word"},attributes:{alignSelf:"stretch"},titleRow:CD({},_D.titleRow,{marginBottom:"3px"})},_D)),DD=(0,Sp.Z)(CD({wrapper:{fontSize:AD,lineHeight:RD}},_D)),kD=({value:e,nonVisibleValues:t,attributeType:r,showNonOv:n,totalNonVisibleValues:a,classes:i})=>{const o=ND(),{label:l,description:s}=r,c=(0,Uf.Ws)(),u=(0,ap.useMemo)((()=>c.includes(r.uri)),[c,r.uri]),p=(0,v.getObjectTypeByAttributeUri)(e.uri);return ip().createElement("div",{"data-reltio-id":"one-line-renderer",className:up()(o.collaborationWrapper,KI)},ip().createElement("div",{className:up()(o.titleRow,o.wrapper)},ip().createElement(lP,{label:l,className:up()(o.title,null==i?void 0:i.title),"data-reltio-id":"reltio-attribute-label"}),ip().createElement(gP,{description:s,className:o.descriptionIcon}),u&&ip().createElement(xD,null),ip().createElement(pP,{nonOvValues:t,attributeType:r,className:o.ovIcon,nonOvTotal:a}),ip().createElement(hD,{className:up()(o.attribute,null==i?void 0:i.content),attributeValue:e,attributeType:r,showNonOv:n,inlined:!0,classes:i})),ip().createElement(aP,{uri:e.uri,relatedObjectUris:(0,v.createRelatedObjectUris)(p,{uri:e.uri}),objectType:p}))};var LD=r(33062),UD=r.n(LD);const jD=(0,Sp.Z)({link:{display:"flex",marginTop:4},icon:{fontSize:"1rem"}}),FD=({moreNumber:e,valueNumber:t,onClick:r})=>{const n=jD();return ip().createElement(ry(),{"data-reltio-id":"show-more",component:"button",variant:"caption",className:n.link,onClick:r,underline:"none"},ip().createElement(UD(),{className:n.icon}),e&&t?ei().text("Show ${moreNumber} more of remaining ${valueNumber} value",{moreNumber:e,valueNumber:t}):ei().text("Show more"))};var MD=r(86800),VD=r.n(MD);const BD=(0,Sp.Z)({link:{display:"flex",marginTop:4},icon:{fontSize:"1rem"}}),zD=({onClick:e})=>{const t=BD();return ip().createElement(ry(),{component:"button",variant:"caption",className:t.link,onClick:e,underline:"none"},ip().createElement(VD(),{className:t.icon}),ei().text("Show less"))},HD=({max:e,values:t,nonVisibleValues:r,totalVisibleValues:n,attributeType:a,parentUri:i,requestNextPageOfAttributeValues:o,showNonOv:l,totalNonVisibleValues:s,classes:c})=>{const u=PD(),[p,d]=(0,ap.useState)(e),m=(0,Uf.Ws)(),f=(0,ap.useMemo)((()=>m.includes(a.uri)),[m,a.uri]),y=e<n,g=y&&p<n,h=y&&p>=n,{label:E,description:b}=a,v=t.slice(0,p),T=n-p;return ip().createElement("div",{"data-reltio-id":"multi-line-renderer",className:u.wrapper},ip().createElement("div",{className:u.titleRow},ip().createElement(lP,{label:E,className:up()(u.title,null==c?void 0:c.title),"data-reltio-id":"reltio-attribute-label"}),ip().createElement(gP,{description:b}),f&&ip().createElement(xD,null),ip().createElement(pP,{nonOvValues:r,attributeType:a,className:u.ovIcon,nonOvTotal:s})),ip().createElement("div",{className:u.attributes},v.map((e=>ip().createElement(hD,{key:e.uri,className:up()(u.attribute,null==c?void 0:c.content),attributeValue:e,attributeType:a,showNonOv:l,classes:c})))),g&&ip().createElement(FD,{moreNumber:(0,O.min)(e,T),valueNumber:T,onClick:()=>{t.length<n&&o({parentUri:i,attributeTypeUri:a.uri,attributeTypeName:a.name,values:t,defaultMaxValues:e}),d(p+e)}}),h&&ip().createElement(zD,{onClick:()=>{d(e)}}))};var YD=r(88941),WD=r.n(YD);function GD(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){qD(e,t,r[t])}))}return e}function qD(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ZD=(0,Sp.Z)({attributeValue:{verticalAlign:"middle"},insertAttribute:GD({width:"fit-content"},v.historyPalettes[v.HistoryOperations.insertAttribute]),deleteAttribute:GD({width:"fit-content",textDecoration:"line-through",padding:"0 4px"},v.historyPalettes[v.HistoryOperations.deleteAttribute])}),$D=({value:e})=>{const t=ZD(),{appearance:r}=(0,ap.useContext)(vP),n=(0,Uf.AH)(),a=(0,v.getHistoryAppearanceBySpecialAttributeValue)("roles",e,r),i=(0,v.getHistoryAttributeClassName)(a);return ip().createElement("span",{className:up()(t.attributeValue,t[i])},(0,v.getRoleLabel)(n,e))},KD=({className:e,values:t,Component:r,dataReltioId:n})=>ip().createElement("div",{className:e,"data-reltio-id":n},t.map(((e,n)=>ip().createElement(ap.Fragment,{key:e},ip().createElement(r,{value:e}),n<t.length-1&&", ")))),XD=({className:e,values:t})=>ip().createElement(KD,{values:t,className:e,dataReltioId:"reltio-attribute-value",Component:$D});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.push.apply(n,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=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ek=(0,Sp.Z)({attributeValue:{verticalAlign:"middle"},insertAttribute:QD({width:"fit-content"},v.historyPalettes[v.HistoryOperations.insertAttribute]),deleteAttribute:QD({width:"fit-content",textDecoration:"line-through",padding:"0 4px"},v.historyPalettes[v.HistoryOperations.deleteAttribute])}),tk=({value:e})=>{const t=ek(),r=(0,ap.useContext)(sP),{appearance:n}=(0,ap.useContext)(vP),{generateTagUrl:a}=(0,ap.useContext)(RP.v),i=(0,Uf.eh)(),o=(0,Uf.Qh)(),l=(0,v.getHistoryAppearanceBySpecialAttributeValue)("tags",e,n),s=(0,v.getHistoryAttributeClassName)(l),c=r||i;return ip().createElement(pD,{className:up()(t.attributeValue,t[s]),href:a({uiPath:o,tag:e,entityUri:c.dataTenant?(0,v.getDataTenantEntityUri)(c):c.uri})},e)},rk=({className:e,values:t})=>ip().createElement(KD,{values:t,className:e,dataReltioId:"reltio-attribute-value",Component:tk}),nk=({values:e,attributeType:t,classes:r})=>{const n=ND(),{label:a}=t;return ip().createElement("div",{"data-reltio-id":"special-renderer",className:up()(n.titleRow,n.wrapper)},(i=n.titleIcon,t.uri===v.EntityAttrTypes.tags.uri?ip().createElement(WD(),{className:i}):null),ip().createElement(lP,{label:a,className:up()(n.title,null==r?void 0:r.title),"data-reltio-id":"reltio-attribute-label"}),(n=>{switch(t.uri){case v.EntityAttrTypes.tags.uri:return ip().createElement(rk,{className:n,values:e});case v.EntityAttrTypes.roles.uri:return ip().createElement(XD,{className:n,values:e});default:return ip().createElement(hD,{className:n,attributeValue:{value:e[0],uri:""},attributeType:t,inlined:!0,classes:r})}})(up()(n.attribute,null==r?void 0:r.content)));var i};var ak=r(97986),ik=r.n(ak);function ok(){return ok=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ok.apply(null,arguments)}const lk=e=>ip().createElement("svg",ok({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgDefaultImage"},e),ip().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},ip().createElement("path",{d:"M0 0h24v24H0z"}),ip().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"}))),sk={SMALL:{imageWidth:114,imageHeight:114},MEDIUM:{imageWidth:162,imageHeight:162},LARGE:{imageWidth:192,imageHeight:192},OVERRIDE:{imageWidth:"unset",imageHeight:"unset"}},ck=(0,Sp.Z)((e=>({root:{position:"relative"},image:({imageWidth:e,imageHeight:t})=>({width:e,height:t,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 uk(){return uk=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},uk.apply(null,arguments)}const pk=e=>{const{src:t,className:r,containerClassName:n,size:a=sk.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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["src","className","containerClassName","size","overlay"]),l=a||sk.SMALL,s=ck(l),[c,u]=(0,ap.useState)(sm.oA.LOADING);(0,ap.useEffect)((()=>{u(sm.oA.LOADING)}),[t]);const p=c===sm.oA.LOADING,d=c===sm.oA.LOADED;return c===sm.oA.ERROR?ip().createElement("div",uk({className:up()(s.defaultContainer,s.image,r)},o),ip().createElement(ik(),{className:s.defaultImage})):ip().createElement("div",{className:up()(s.root,n)},!(0,v.isEmptyValue)(t)&&ip().createElement("img",uk({src:t,className:up()(s.image,r,{[s.hideImage]:p}),onLoad:()=>{u(sm.oA.LOADED)},onError:()=>{u(sm.oA.ERROR)},alt:"image"},o)),p&&ip().createElement("div",uk({className:up()(s.defaultContainer,s.image,r)},o),ip().createElement(lk,{className:s.defaultImage})),d&&i)},dk=(0,ap.memo)(pk),mk={imageMargin:4,imageWidth:sk.SMALL.imageWidth,imageHeight:sk.SMALL.imageHeight};var fk=r(59849),yk=r.n(fk),gk=r(47867),hk=r.n(gk),Ek=r(93643),bk=r.n(Ek);const vk=(0,Sp.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)"}}))),Tk=({attributeValues:e,setAttributeValueIndex:t,attributeValueIndex:r})=>{const n=vk(),a=(0,ap.useRef)(null);return(0,ap.useEffect)((()=>{if(null!=a&&a.current){const e=a.current.scrollLeft,t=a.current.offsetWidth+e,n=96*r+16*r+12;t<n?a.current.scroll&&(n>t+96+16?a.current.scroll(n,0):a.current.scroll(112+e,0)):e+96>n&&a.current.scroll&&a.current.scroll(n-96,0)}}),[r,a]),ip().createElement("div",{ref:a,className:n.thumbnails},ip().createElement(bk(),{container:!0,wrap:"nowrap",direction:"row",spacing:1,className:n.gridContainer},e.map((({uri:e,value:a},i)=>ip().createElement(bk(),{item:!0,key:e},ip().createElement(dk,{onClick:()=>t(i),className:up()(n.thumb,{[n.inactiveThumb]:r!==i}),src:(0,v.getImageAttributeOvThumbnailUrl)({value:a})}))))))},Ok=(0,Sp.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%)"}}))),Sk=({className:e,attributeValues:t,attributeValueIndex:r,setAttributeValueIndex:n})=>{const a=Ok(),i=t[r],o=(0,v.getImageAttributeOvPreviewUrl)(i);return ip().createElement("div",{className:up()(a.root,e)},ip().createElement("div",{className:a.main},r>0&&ip().createElement(Op.T,{icon:yk(),className:up()(a.arrowButton,a.arrowButtonPrev),onClick:()=>{n(r-1)},size:"XL"}),ip().createElement(dk,{containerClassName:a.mainImageContainer,className:a.mainImage,size:o&&sk.OVERRIDE,src:o}),r!==t.length-1&&ip().createElement(Op.T,{icon:hk(),className:up()(a.arrowButton,a.arrowButtonNext),onClick:()=>{n(r+1)},size:"XL"})),ip().createElement(Tk,{attributeValues:t,attributeValueIndex:r,setAttributeValueIndex:n}))};var xk=r(71884),Ck=r.n(xk);const wk=(0,O.curry)(((e,t)=>(0,O.filter)((t=>(t.label||t.name).toLowerCase().includes(e.toLowerCase())))(t))),Ak=({attrTypes:e,filter:t="",sortingFn:r})=>(0,O.pipe)(wk(t),(0,O.sort)(r),(0,O.map)((e=>({item:{id:e.uri,label:e.label||e.name,attrType:e}}))))(e);var Rk=function(e){return e.parent="parent",e.attributes="attributes",e}(Rk||{});const _k=(0,Sp.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"}}),Ik=({label:e,popupTitle:t=e,data:r,parent:n,dense:a,onApply:i})=>{const o=_k(),l=(0,ap.useRef)(),[s,c]=(0,ap.useState)(!1),[u,p]=(0,ap.useState)(""),[d,m]=(0,ap.useState)([]),{items:f,hasGroups:y,parentGroupLength:g,attributesGroupLength:h}=(({data:e,parent:t,filter:r})=>{const n=(0,Uf.mT)(),a=Boolean(t),i=(0,ap.useMemo)((()=>n===v.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),[n]),o=(0,ap.useMemo)((()=>a?Ak({attrTypes:[t],filter:r,sortingFn:i}):[]),[a,t,r,i]),l=(0,ap.useMemo)((()=>a&&null!=o&&o.length?[{item:{id:Rk.parent,label:ei().text("Parent")},items:o}]:[]),[a,o]),s=(0,ap.useMemo)((()=>Ak({attrTypes:e,filter:r,sortingFn:i})),[e,r,i]),c=(0,ap.useMemo)((()=>a&&null!=s&&s.length?[{item:{id:Rk.attributes,label:ei().text("Attributes")},items:s}]:s),[a,s]),u=(0,ap.useMemo)((()=>Dp((l||[]).concat(c))),[l,c]),p=l.length,d=c.length;return{items:u,hasGroups:a,parentGroupLength:p,attributesGroupLength:d}})({data:r,parent:n,filter:u}),E=(0,ap.useCallback)(((e,t)=>{m((0,O.ifElse)((0,O.always)(t),(0,O.append)(e),(0,O.reject)((0,O.propEq)("id",e.id)))(d))}),[d]),b=(0,ap.useCallback)(((e,t)=>t.items?40:28),[]),T=(0,ap.useCallback)((({item:e})=>{E(e,(0,O.not)((0,O.any)((0,O.propEq)("id",e.id))(d)))}),[E,d]),{focusIndex:S,handleKeyDown:x}=Mp({items:f,open:s,onSelectFocusedItem:T,selectedItems:d}),C=(0,ap.useRef)(null);C.current=S;const w=y?(g?1:0)+(h?1:0):0,A=f.length-w,R=Math.min(255,28*A+40*w),_=Math.max(140,R+112),I=(0,ap.useCallback)(((e,{item:t,level:r=0},n)=>{var a;const i=(0,O.any)((0,O.propEq)("id",t.id))(d),o=C.current===n;return ip().createElement(cd,{key:t.uri,onClick:E,checked:i,level:r,data:t,label:ip().createElement(ud.o,{text:t.label,highlight:u}),labelInText:t.label,style:e,isFocused:o,isRequired:!(null===(a=t.attrType)||void 0===a||!a.required),LogoIcon:t.LogoIcon})}),[u,E,d]),N=(0,ap.useCallback)(((e,t)=>ip().createElement($m(),{component:"div",className:o.subHeader,style:e,key:`group-${t.item.id}`},t.item.label)),[]);return ip().createElement("div",{className:up()(o.moreAttributes,{[o.dense]:a})},ip().createElement(Gh(),{color:"primary",onClick:()=>c(!s),ref:l,className:o.moreButton},ip().createElement(Ck(),{classes:{root:o.icon}}),ip().createElement("div",{className:o.buttonLabel},e)),ip().createElement(Pp,{open:s,className:up()(o.moreAttributesPopup,o.popupContainer),anchorEl:l.current,onClose:(0,O.pipe)((()=>{d.length>0&&i((0,O.pluck)("attrType",d))}),(()=>c(!1)),(()=>p("")),(()=>m([]))),onSearch:p,containerHeight:_,title:t,containerWidth:320,searchInputOnKeyDown:x},ip().createElement(Fp,{getItemSize:b,renderItem:I,renderGroupTitle:N,disableHorizontalScrollbar:!0,items:f,height:R,focusIndex:S}),0===f.length&&ip().createElement("div",{className:o.noResultsCaptionContainer},ip().createElement(hf(),{variant:"caption",display:"block",gutterBottom:!0},ei().text("No results found")))))},Nk={canCreate:!0,canUpdate:!0,canDelete:!0},Pk=ip().createContext(Nk);Pk.displayName="ConfigPermissionsContext";const Dk=e=>{const{canCreate:t,canUpdate:r,canDelete:n}=(0,ap.useContext)(Pk),a=(0,v.isTempUri)(e);return(0,ap.useMemo)((()=>({canCreate:t,canUpdate:a||r,canDelete:a||n})),[a,t,r,n])},kk={get CreationTime(){return ei().text("Creation Time")},get CreationDate(){return ei().text("Creation Date")},get Dimensions(){return ei().text("Dimensions")},get MimeType(){return ei().text("Mime Type")},get Size(){return ei().text("Size")},get Url(){return ei().text("Full image URL (S3)")},get UrlPreview(){return ei().text("Preview image URL (S3)")},get UrlThumbnail(){return ei().text("Small image URL (S3)")},get CdnUrl(){return ei().text("Full image URL (CDN)")},get CdnUrlPreview(){return ei().text("Preview image URL (CDN)")},get CdnUrlThumbnail(){return ei().text("Small image URL (CDN)")}},Lk=({value:e}={},t)=>["Url","UrlPreview","UrlThumbnail","CdnUrl","CdnUrlPreview","CdnUrlThumbnail","MimeType"].includes(t)?(0,O.path)([t,0,"value"],e):"CreationDate"===t&&(0,O.path)(["CreationTimestamp",0,"value"],e)?Pa()(e.CreationTimestamp[0].value).format("MM-DD-YYYY"):"CreationTime"===t&&(0,O.path)(["CreationTimestamp",0,"value"],e)?Pa()(e.CreationTimestamp[0].value).format("HH:mm:ss"):"Dimensions"===t&&(0,O.path)(["Height",0,"value"],e)&&(0,O.path)(["Width",0,"value"],e)?`${e.Height[0].value} x ${e.Width[0].value} ${ei().text("pixels")}`:"Size"===t&&(0,O.path)(["Size",0,"value"],e)?`${(Number(e.Size[0].value)/1e3).toFixed(2)} KB`:void 0,Uk=(e=[])=>e.filter((({system:e})=>!e)),jk=(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}))},Fk=(e={},t,r)=>{const n=Uk(t.attributes);return jk(Object.keys(e.value||{}),r).reduce(((t,r)=>{const a=n.find((({name:e})=>e===r));return a?[...t,{attrType:a,values:e.value[r]}]:t}),[])},Mk=e=>["Url","UrlPreview","UrlThumbnail","CdnUrl","CdnUrlPreview","CdnUrlThumbnail"].includes(e),Vk=(0,Sp.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:{}}),Bk=({attributeType:e,onAddAttributes:t,uri:r})=>{const n=Vk(),a=Uk(e.attributes),{canCreate:i}=(0,ap.useContext)(Pk),o=i&&Boolean(t);return ip().createElement(jI(),null,ip().createElement(hf(),{className:up()(n.title,{[n.canAdd]:o})},ei().text("Meta info")),o&&ip().createElement(ap.Fragment,null,ip().createElement(Ik,{label:ei().text("Attributes"),data:a,dense:!1,onApply:e=>{t&&t(e.map((e=>({attributeType:e,parentUri:r}))))}}),ip().createElement(Cf(),{className:n.divider})))},zk=(0,Sp.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"}}))),Hk=({title:e,content:t,isLink:r,children:n})=>{const a=zk();return ip().createElement("div",{className:a.root},ip().createElement("span",{className:a.title},e),r?ip().createElement("a",{className:a.link,href:t},ei().text("link")):ip().createElement("span",{className:a.content},t||n))},Yk=(0,Sp.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"}}),Wk=({attributeValue:e,attributeType:t,imageAttributeFieldsOrder:r})=>{const n=Yk(),a=(0,Uf.xH)(),i=(o=e,l=r,jk(Object.keys(kk),l).map((e=>Lk(o,e)?{title:kk[e],value:Lk(o,e),isLink:Mk(e)}:null)).filter(Boolean));var o,l;const s=Fk(e,t,r),c=(0,ap.useMemo)((()=>({title:n.title,content:n.content})),[n]);return ip().createElement(jI(),{className:n.root},i.map((({title:e,value:t,isLink:r})=>ip().createElement(Hk,{key:e,isLink:r,title:e,content:t}))),a&&s.map((({attrType:t,values:r})=>ip().createElement($F,{key:t.uri,attributeType:t,drawLines:!1,values:r,classes:c,parentUri:e.uri}))))},Gk=(0,Sp.Z)((e=>({caption:{display:"flex",color:e.palette.error.main,fontSize:"12px",lineHeight:"16px"}}))),qk=({className:e,message:t})=>{const r=Gk();return t?ip().createElement(hf(),{variant:"caption",className:up()(r.caption,e)},t):null};var Zk=r(66826),$k=r.n(Zk),Kk=r(95210),Xk=r(70485),Qk=r.n(Xk),Jk=r(53167),eL=r.n(Jk);const tL=(0,Sp.Z)({wrapper:{width:"100%"},helperText:{margin:"3px 0 1px 12px"}});function rL(){return rL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},rL.apply(null,arguments)}const nL=(0,ap.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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["errorMessage","children","className","classes"]);const o=tL(),l=!!t;return ip().createElement(Qk(),rL({variant:"standard",className:up()(o.wrapper,n,null==a?void 0:a.root),error:!0},i),r,l&&ip().createElement(eL(),{className:up()(o.helperText,null==a?void 0:a.helperText)},ip().createElement(qk,{message:t})))}));nL.displayName="ErrorWrapper";const aL=(e,t,r,n)=>{const a=(0,O.pipe)(v.getEntityType,(0,O.defaultTo)({}),(0,O.props)(["attributes","analyticsAttributes"]),(0,O.reject)(O.isNil),O.flatten,(0,O.concat)(O.__,(0,O.pipe)(O.values,(0,O.reject)((0,O.propEq)("uri",v.EntityAttrTypes.id.uri)))(v.EntityAttrTypes)))(e,t);return r.length?a.filter((({uri:e})=>r.includes(e))):a.filter((({uri:e})=>!n.includes(e)))},iL=(e,t)=>(0,O.partition)((0,O.pipe)((0,O.path)(["attrType","uri"]),(0,O.includes)(O.__,e)),t),oL=(0,O.eqBy)((0,O.pick)(["fieldName","uri","entityTypeUri"])),lL=(e,t)=>t&&!!t.find(oL(e)),sL=(0,O.curry)(((e,t,r)=>{const n=((e,t)=>{const{type:r}=(0,v.getAttrDataTypeDefinition)(e);switch(r){case v.DataTypes.TYPE_BOOLEAN:case v.DataTypes.TYPE_BOOLEAN_RADIO:case v.DataTypes.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return t.toString();case v.DataTypes.TYPE_DATE:return t&&Pa()(t).format("YYYY-MM-DD")||"";case v.DataTypes.TYPE_TIMESTAMP:return t&&Pa()(t).utc().format()||"";case v.DataTypes.TYPE_ACTIVENESS_DATE:case v.DataTypes.TYPE_LOCAL_DATE:return t&&t.valueOf();default:return t||""}})(t,r);return{value:n,uri:e.uri,attributeType:t}})),cL=ip().createContext({enabled:!1,queueSizeThreshold:0});cL.displayName="AsyncMountContext";let uL=0;function pL(){return pL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},pL.apply(null,arguments)}var dL=r(50548);const mL=ip().createContext(!1);mL.displayName="ProfilePerspectiveViewContext";let fL=function(e){return e.Error="Error",e.NewAttribute="NewAttribute",e.NewView="NewView",e}({});const yL=e=>e===fL.Error,gL=ip().createContext({element:null,type:null,highlightView:O.identity,highlightError:O.identity,highlightAttribute:O.identity,scrollIntoRef:O.identity});function hL(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){EL(e,t,r[t])}))}return e}function EL(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const bL={content:'""',position:"absolute",left:"-1000px",top:"0px",width:"5000px",height:"calc(100% - 10px)",animationName:"$highlightAnimation",animationDuration:"2s",animationIterationCount:1,opacity:0},vL=(0,Sp.Z)((()=>({"@keyframes highlightAnimation":{"0%":{opacity:0},"50%":{opacity:1},"100%":{opacity:0}},highlightError:{"&::before":hL({},bL,{background:"rgba(255, 0, 0, 0.06)"})},highlightWarning:{"&::before":hL({},bL,{background:"rgba(228, 151, 0, 0.08)"})},simpleAttribute:{position:"relative","&::before":{top:"-4px",height:"calc(100% + 8px)"}}}))),TL=({highlightedError:e,isSimple:t=!1})=>{const r=vL(),n=(0,ap.useRef)(null),a=(0,O.pathOr)(v.ErrorSeverity.ERROR,["element","severity"])(e),i=up()({[r.highlightError]:a===v.ErrorSeverity.ERROR,[r.highlightWarning]:a===v.ErrorSeverity.WARNING,[r.simpleAttribute]:t});return(0,ap.useEffect)((()=>{e&&e.scrollIntoRef(n)}),[e]),e?{ref:n,errorClassName:i}:{ref:n}};var OL=r(51894);const SL=(0,Sp.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 xL(){return xL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},xL.apply(null,arguments)}const CL=(0,dL.l)(gL,((e,{attributeValue:t})=>{const{element:r,type:n}=e||{};return{highlightedError:yL(n)&&(null==r?void 0:r.uri)===t.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:f=!1}=e,y=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.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 g=SL(),h="deleted"===d,E="edited"===d,b=(0,v.isEditableMode)(o),{canCreate:T,canEdit:S,canDelete:x}=(({attributeType:e,attributeValue:t,isReltioCrosswalk:r,mode:n})=>{const{canCreate:a,canUpdate:i,canDelete:o}=Dk(t.uri);return{canCreate:a&&(0,v.checkCanCreateAttribute)({attributeType:e,mode:n}),canEdit:i&&(0,v.checkCanEditAttribute)({attributeType:e,attributeValue:t,mode:n,isReltioCrosswalk:r}),canDelete:o&&(0,v.checkCanDeleteAttribute)({attributeType:e,attributeValue:t,mode:n,isReltioCrosswalk:r})}})({attributeValue:r,attributeType:n,mode:o,isReltioCrosswalk:a}),C=S&&b&&!r.masked,w=(0,v.getErrorMessage)(i),A=(0,Uf.ZI)(r,n),{ref:R,errorClassName:_}=TL({highlightedError:m,isSimple:!0});(0,ap.useEffect)((()=>{f&&(0,v.isDependentLookupAttrType)(n)&&!(0,O.has)("lookupCode",r)&&c({attributeType:n,uri:r.uri,value:r.value,silent:!0})}),[f]);const I=(0,ap.useMemo)((()=>(0,v.getAttrDataTypeDefinition)(n)),[n]),N=(0,ap.useMemo)((()=>((e,{type:t})=>{const{value:r,lookupCode:n}=e||{};switch(t){case v.DataTypes.TYPE_BOOLEAN:case v.DataTypes.TYPE_BOOLEAN_RADIO:case v.DataTypes.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return(0,v.parseBoolean)(r);case v.DataTypes.TYPE_DATE:return r&&v.utils.dates.toLocalDate(r)||null;case v.DataTypes.TYPE_LOCAL_DATE:case v.DataTypes.TYPE_TIMESTAMP:case v.DataTypes.TYPE_ACTIVENESS_DATE:return r&&new Date(r)||null;case v.DataTypes.TYPE_DEPENDENT_LOOKUP:case v.DataTypes.TYPE_LOOKUP:return{value:r,lookupCode:n};default:return r}})(r,I)),[r,I]),P=(0,ap.useCallback)((()=>{i&&u((0,v.getErrorId)(i))}),[i,u]),D=(0,ap.useCallback)((0,O.pipe)(sL(r,n),c,P),[r,n,c,P]),k=!!l&&T&&!n.singleValue&&!r.masked&&o!==v.Mode.Viewing,L=!h&&!!s&&x&&!r.masked&&o!==v.Mode.Viewing,U=!!w,j=h?{disabled:!0,isCrossedOut:!0}:{},F=(0,ap.useContext)(mL),{autopopulationContextValue:M}=(({enabled:e,attributeTypeUri:t,valueUri:r})=>{const n=(0,Uf.ax)("dependentLookupsEditorTouched"),a=(0,Uf.Pl)(),i=(0,Uf.h0)(r),o=e&&(0,v.isAutopopulationEnabled)(a,t),l=o?r:null,{isTouched:s=!1}=o&&i||{},c=(0,ap.useCallback)((e=>{n({uri:e,isTouched:!0})}),[n]);return{autopopulationContextValue:(0,ap.useMemo)((()=>l?{id:l,isTouched:s,onTouch:c}:null),[l,s,c])}})({enabled:F&&(0,v.isDependentLookupAttrType)(n),attributeTypeUri:null==n?void 0:n.uri,valueUri:r.uri});return ip().createElement("div",{ref:R,className:up()(g.editor,t,_)},ip().createElement(nL,{errorMessage:w,className:g.errorWrapper},ip().createElement("div",{className:up()(g["editor-value"],{[g.deleted]:h},{[g["editor-read-only-value"]]:!C}),"data-reltio-id":"reltio-attribute-value"},C?ip().createElement(OL.m.Provider,{value:M},ip().createElement(Kk.Z,xL({fieldName:(0,v.attributeUriToSearchUri)(n.uri),value:N,dataTypeDefinition:I,error:U,onChange:D,fullWidth:!0},A,y,j))):ip().createElement(Md.x,{value:(0,v.getAttributeValue)(r),dataTypeDefinition:I}))),ip().createElement("div",{className:g["editor-actions"]},E&&ip().createElement(hf(),{variant:"caption",className:g.editedLabel},"(",ei().text("edited"),")"),k&&ip().createElement(Op.T,{icon:Ck(),onClick:l,size:"L",className:up()(g.addButton,g.button),"data-reltio-id":"reltio-add-one-more-simple-attribute-button"}),p&&p({attributeType:n,attributeValue:r}),L&&ip().createElement(Op.T,{className:g.button,icon:$k(),onClick:()=>{s({uri:r.uri,attributeType:n}),(0,v.getErrorType)(i)!==v.ErrorType.missed&&P()},size:"L","data-reltio-id":"reltio-delete-simple-attribute-button"})))})),wL=((e,t=null)=>{const r=(0,ap.forwardRef)(((r,n)=>(()=>{const e=(0,ap.useRef)(!0),{enabled:t,queueSizeThreshold:r=0}=(0,ap.useContext)(cL),[n,a]=(0,ap.useState)(!t||t&&uL<r);e.current&&uL++;const i=(0,ap.useRef)();return(0,ap.useEffect)((()=>{if(uL--,!n)return i.current=setTimeout((()=>{a(!0)}),0),()=>clearTimeout(i.current)}),[]),e.current=!1,n})()?ip().createElement(e,pL({},r,{ref:n})):t&&ip().createElement(t,pL({},r,{ref:n}))));return r.displayName="WithAsyncMount",r})(CL,(()=>{const e=SL();return ip().createElement("div",{className:e.placeholder})})),AL=[v.EntityAttrTypes.roles.uri,v.EntityAttrTypes.tags.uri],RL=ip().createContext(null),_L=ip().createContext(null),IL=(0,ap.createContext)({}),NL=(0,ap.createContext)([]);function PL(){return PL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},PL.apply(null,arguments)}function DL(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}NL.displayName="AlwaysVisibleAttributesContext";const kL=(0,dL.l)(gL,(e=>{const{highlightAttribute:t}=e||{};return{highlightAttribute:t}}),(({parentAttributeType:e,attrTypes:t,entity:r,parentUri:n,showEmptyEditors:a,mode:i,crosswalks:o,drawLines:l,children:s,className:c,fixedTypeUris:u=AL,onAddAttributes:p,onChangeAttribute:d,onDeleteAttribute:m,additionalControlsRenderer:f,showNonOv:y,highlightAttribute:g})=>{const h=(0,ap.useContext)(IL),E=n&&(0,v.getBaseUri)(n),b=(0,ap.useMemo)((()=>h[E]||[]),[h,E]),T=(0,ap.useContext)(NL),S=(0,ap.useMemo)((()=>t.filter((e=>!b.includes(e.uri)))),[t,b]),{attributes:x={}}=r,[C,w]=(0,ap.useState)({}),A=(0,ap.useCallback)(((e,t)=>{w((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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){DL(e,t,r[t])}))}return e}({},r,{[e]:t})))}),[]);(0,ap.useEffect)((()=>{w({})}),[n]);const{canCreate:R}=(0,ap.useContext)(Pk),_=(0,ap.useMemo)((()=>R&&e&&(0,v.checkCanCreateAttribute)({attributeType:e,mode:i})),[e,i,R]),I=((e,t,r,n)=>e.filter((e=>{const a=((e,t)=>{const{attributes:r={},analyticsAttributes:n={}}=t;return(0,O.cond)([[v.isSpecialAttribute,(0,O.always)(t)],[(0,O.both)(v.isAnalyticAttribute,(0,O.always)(n)),(0,O.always)(n)],[O.T,(0,O.always)(r)]])(e)})(e,t),i=(e=>(0,v.isSpecialAttribute)(e)?"uri":"name")(e);return!((e.singleValue||(0,v.isRoleAttrType)(e)||(0,v.isTagAttrType)(e))&&((0,O.has)(e[i])(a)||r&&(null==n||!n[e.uri])))})))((0,ap.useMemo)((()=>R?(0,v.getCreatableAttributeTypes)(i,S):[]),[S,i,R]),r,a,C),N=(0,ap.useContext)(RL),P=(0,ap.useMemo)((()=>(0,v.getAttributesListForEditMode)(S,i,r,a,y,N,R,T)),[S,i,r,a,y,N,R,T]),[D,k]=(0,ap.useMemo)((()=>iL(u,P)),[P,u]),L=(0,ap.useCallback)((t=>{p(t.map((t=>({attributeType:t,parentUri:t===e?(0,v.getParentUri)(n):n})))),g((0,O.last)(t),fL.NewAttribute)}),[p,n,e]),U={enabled:l},j=(0,ap.useMemo)((()=>({hasDeletionsMap:C,setHasDeletions:A})),[C,A]);return ip().createElement("div",{className:c},s&&ip().createElement($I,U,s),ip().createElement($I,PL({},U,{plain:!0}),I.length>0&&i!==v.Mode.Viewing&&ip().createElement(Ik,{label:ei().text("More attributes"),onApply:L,dense:l,data:I,parent:_&&e})),ip().createElement(_L.Provider,{value:j},k.concat(D).map((({attrType:e,values:t})=>ip().createElement(rF,{key:`${e.uri}_${n}`,attributeType:e,drawLines:l,values:t,paging:(0,O.path)(["paging",e.uri],x),parentUri:n,showEmptyEditors:a,mode:i,crosswalks:o,onAddAttributes:p,onChangeAttribute:d,onDeleteAttribute:m,additionalControlsRenderer:f,showNonOv:y})))))})),LL=(0,Sp.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}}))),UL=(0,dL.l)(gL,((e,{attributeValue:t})=>{const{element:r,type:n}=e||{},a=yL(n);return{highlightedError:a&&(null==r?void 0:r.uri)===t.uri?e:null,isHighlightedPath:a&&(0,O.pipe)((0,O.propOr)([],"path"),(0,O.any)((0,O.pathEq)(["value","uri"],t.uri)))(r)}}),(({label:e,attributeTypesList:t,attributeType:r,attributeValue:n,children:a,errors:i,ownError:o,mode:l,metadata:s,crosswalks:c,lazy:u,showEmptyEditors:p,onAddOneMore:d,onAddAttributes:m,onDeleteAttribute:f,onChangeAttribute:y,additionalControlsRenderer:g,hideDeleteButton:h,state:E,showNonOv:b,isHighlightedPath:T,highlightedError:O,expanded:S=!1})=>{const x=LL(),C="deleted"===E,w="edited"===E,A=n.uri,R=(0,v.isTempUri)(A),_=R||S,[I,N]=(0,ap.useState)(_),{ref:P,errorClassName:D}=TL({highlightedError:O}),k=n.masked?v.Mode.Viewing:l;(0,ap.useEffect)((()=>{T&&N(!0)}),[T]),(0,ap.useEffect)((()=>{N(_)}),[_]);const{canDelete:L}=Dk(n.uri),U=(0,ap.useMemo)((()=>L&&(0,v.checkCanDeleteAttribute)({attributeType:r,attributeValue:n,mode:k,metadata:s,isReltioCrosswalk:(0,v.isReltioCrosswalk)(c,n)})),[r,n,k,s,c,L]),j=!C&&!h&&!!f&&U&&!n.masked&&k!==v.Mode.Viewing,F=(0,ap.useMemo)((()=>(0,v.hasAttributeDescendantsWithErrors)(n,i)),[i,n]);(0,ap.useEffect)((()=>{F&&N(!0)}),[i,F]),(0,ap.useEffect)((()=>{C&&N(!1)}),[C]);const M=(t||[]).some((e=>(0,v.isAnalyticAttribute)(e))),V=(0,ap.useMemo)((()=>({attributes:M?null:n.value,analyticsAttributes:M?n.value:null})),[n,M]),B=(0,v.getErrorMessage)(o)||F&&ei().text("Has an incorrect value")||"";return u?ip().createElement(Gh(),{variant:"text",color:"primary",onClick:d},"Create attribute"):ip().createElement("div",{ref:P,"data-reltio-id":"reltio-edit-mode-complex-attribute",className:up()(x.complexWrapper,D)},ip().createElement("div",{className:x.editor},ip().createElement("div",{className:x.titleContainer},ip().createElement(KP,{onClick:()=>N((e=>!e)),expanded:I,className:x.expandButton,disabled:C}),ip().createElement(nL,{errorMessage:B,classes:{helperText:x.errorWrapperHelperText}},ip().createElement("div",{className:up()(x.label,{[x.deleted]:C}),"data-reltio-id":"reltio-attribute-complex-label"},e))),ip().createElement("div",{className:x.actions},w&&ip().createElement(hf(),{variant:"caption",className:x.editedLabel},"(",ei().text("edited"),")"),g&&g({attributeType:r,attributeValue:n}),j&&ip().createElement(Op.T,{icon:$k(),onClick:()=>f({uri:A,attributeType:r,attributeValue:n}),size:"L","data-reltio-id":"reltio-delete-complex-attribute-button"}))),I&&ip().createElement(kL,{parentAttributeType:r,attrTypes:t,entity:V,showEmptyEditors:p||R,drawLines:!0,parentUri:A,mode:k,crosswalks:c,onAddAttributes:m,onChangeAttribute:y,onDeleteAttribute:f,additionalControlsRenderer:g,showNonOv:b},a))}));function jL(){return jL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},jL.apply(null,arguments)}const FL=(0,ap.memo)((e=>{const{attributeValue:t,attributeType:r}=e,n=(0,v.evaluateDeepEntityLabel)(t,r.dataLabelPattern);return ip().createElement(UL,jL({label:(0,v.getLabel)(n),attributeTypesList:r.attributes||r.analyticsAttributes},e))}));FL.displayName="NestedAttributeEditor";var ML=r(84199),VL=r(62880);const BL=(0,Sp.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=BL();return ip().createElement(Uy.h,e,i,r&&!(0,O.prop)("Group",a)&&ip().createElement("span",{className:o.addLabel,onClick:()=>t(n)},ip().createElement(Ck(),{className:o.addIcon}),r))};zL.propTypes={children:lp().element.isRequired,selectProps:lp().object.isRequired};const HL=(0,Sp.Z)({singleValue:{fontSize:"14px",lineHeight:"16px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",marginTop:"17px"}});function YL(){return YL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},YL.apply(null,arguments)}const WL=e=>{const{selectProps:{menuIsOpen:t},innerProps:r,children:n}=e,a=HL();return!t&&ip().createElement(hf(),YL({className:a.singleValue},r),n)};function GL(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){qL(e,t,r[t])}))}return e}function qL(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}WL.propTypes={children:lp().node,innerProps:lp().object};const ZL=(0,Sp.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"}}}),$L={menu:e=>GL({},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=>GL({},e,{maxHeight:"208px",padding:"8px 0"}),group:e=>GL({},e,{padding:"0 0 8px 0"}),input:e=>GL({},e,{height:"16px",color:"rgba(0, 0, 0, 0.87)",fontSize:"14px",lineHeight:"16px",margin:"16px 0 0",padding:0}),option:e=>GL({},e,{fontSize:"13px",lineHeight:"15px",height:"32px"})},KL={menuList:e=>GL({},e,{padding:0})},XL={input:e=>GL({},e,{height:"16px",color:"rgba(0, 0, 0, 0.87)",fontSize:"14px",lineHeight:"16px",margin:0,padding:0})};function QL(){return QL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},QL.apply(null,arguments)}function JL(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){eU(e,t,r[t])}))}return e}function eU(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const tU=e=>{let{value:t,label:r,createLabel:n,getOptions:a,options:i,height:o=46,onChange:l=O.identity,onCreate:s,onClear:c=O.identity,components:u,textFieldInputRef:p,TextFieldProps:d,classes:m}=e,f=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.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=ZL({height:o}),[g,h]=(0,ap.useState)(!1),E=(0,ap.useRef)(null),b=a?Cy:Sy.J,T=(0,O.prop)("ClearIndicator",u)?{}:{IndicatorSeparator:ML.V,ClearIndicator:ML.V},S=s?(e,t)=>{s(e,t),h(!1)}:void 0,x=(0,O.prop)("Group",u)?KL:{},C=(0,O.isEmpty)(r)?XL:{},w=JL({},$L,x,C),A=JL({},y,m);return ip().createElement(b,QL({placeholder:"",defaultOptions:!0},f,{value:(0,O.defaultTo)(null,t),loadOptions:a,options:i,cacheOptions:!0,onChange:l,onCreate:S,onClear:c,createLabel:n,classes:A,styles:w,components:JL({DropdownIndicator:VL.G,LoadingIndicator:ML.V,SingleValue:WL,Menu:zL},T,u),menuPlacement:"auto",TextFieldProps:JL({},d,{label:r,variant:"filled",size:"small",classes:JL({},(0,O.prop)("classes",d),{root:up()(y.formControl,(0,O.path)(["classes","root"],d))}),inputProps:JL({},(0,O.prop)("inputProps",d)),InputProps:JL({},(0,O.prop)("InputProps",d),{classes:JL({},(0,O.path)(["InputProps","classes"],d),{root:up()(y.filledInputRoot,(0,O.path)(["InputProps","classes","root"],d)),underline:up()({[y.filledInputUnderline]:(0,v.isEmptyValue)(t)},(0,O.path)(["InputProps","classes","underline"],d)),focused:up()("focused",(0,O.path)(["InputProps","classes","focused"],d))})}),InputLabelProps:JL({},(0,O.prop)("InputLabelProps",d),{classes:JL({},(0,O.path)(["InputLabelProps","classes"],d),{root:up()(y.inputLabel,(0,O.path)(["InputLabelProps","classes","root"],d)),shrink:up()("shrink",(0,O.path)(["InputLabelProps","classes","shrink"],d))}),shrink:!(0,v.isEmptyValue)(t)||void 0}),ref:p||E}),inputRef:p||E,menuIsOpen:g,onMenuOpen:()=>h(!0),onMenuClose:()=>h(!1)}))},rU={value:lp().oneOfType([lp().object,lp().array]),label:lp().string.isRequired,getOptions:lp().func,options:lp().array,onChange:lp().func,onCreate:lp().func,onClear:lp().func,createLabel:lp().string,components:lp().object,textFieldInputRef:lp().object,TextFieldProps:lp().object,height:lp().number,classes:lp().object};tU.propTypes=rU;var nU=r(98018);function aU(){return aU=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},aU.apply(null,arguments)}const iU=e=>{const t=(0,Uf.$H)()||"";return ip().createElement(nU.ZP,aU({},e,{storagePath:(r=t,r.endsWith("/")?r:r+"/")}));var r},oU=(0,Sp.Z)({entityContainer:{display:"flex",alignItems:"center",height:"32px",minHeight:"32px",padding:0,"&.focused":{backgroundColor:"rgba(0,0,0,0.04)"}},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 lU(){return lU=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},lU.apply(null,arguments)}const sU=({innerRef:e,innerProps:t,selectOption:r,data:n,isFocused:a})=>{const i=oU(),{uri:o,entityType:l,label:s,secondaryLabel:c}=n;return""!==o?ip().createElement(Wp(),lU({className:up()(i.entityContainer,{focused:a}),ref:e,key:o,onClick:()=>r({label:s,uri:o,entityType:l})},t),ip().createElement(iU,{className:i.entityAvatar,entityType:l}),ip().createElement(ad.Y,{value:`${s}${c?", "+c:""}`},ip().createElement("span",{className:i.entityLabel},s,c&&ip().createElement("span",{className:i.entitySecondaryLabel},", ",c)))):ip().createElement(Wp(),lU({className:i.entityContainer,ref:e,key:o},t,{disabled:!0}),ip().createElement("span",{className:i.emptyEntityLabel},ei().text("No results found")))},cU=(0,Sp.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"}}))),uU=({selectProps:{currentEntityType:e,menuIsOpen:t,disableLinkClick:r},children:n,data:a})=>{const i=cU(),o=(0,Uf.ax)("openEntity"),l=(0,Uf.Qh)(),{generateEntityUrl:s}=(0,ap.useContext)(RP.v),c=(0,v.isTempUri)(a.entityUri)?{className:i.singleValue,component:"span"}:{className:up()(i.singleValue,i.linkValue),onMouseDown:e=>{e.stopPropagation()},onClick:e=>{e.stopPropagation(),r?e.preventDefault():(0,Tp.rR)(e)||(o({uri:a.entityUri}),e.preventDefault())},href:s({uiPath:l,uri:a.entityUri}),component:"a"};return t?null:ip().createElement(hf(),c,(0,v.isTempUri)(a.entityUri)?ei().text(`New ${e.label} will be created`):(0,v.getLabel)(n))},pU=(0,Sp.Z)({clearIcon:{cursor:"pointer",height:"20px",width:"20px"}}),dU=e=>{const{selectProps:{onClear:t}}=e,r=pU();return ip().createElement(Yh(),{onClick:t,size:"large"},ip().createElement(NI(),{className:r.clearIcon}))};dU.propTypes={selectProps:lp().object.isRequired};var mU=r(95574);const fU=(0,Sp.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:yU}=mU.c,gU=e=>{const{selectProps:{inputValue:t,onCreate:r},data:n,children:a}=e,i=fU();return ip().createElement(yU,e,ip().createElement("div",{className:i.groupHeading},ip().createElement("span",null,n.label),r&&ip().createElement("span",{onClick:()=>r(t,n.entityType),className:i.addLabel},ip().createElement(Ck(),{className:i.addIcon}),ei().text(`Create ${t?`"${t}" as `:""}new ${n.label}`))),a)};gU.propTypes={selectProps:lp().object.isRequired,data:lp().object,children:lp().array};const hU=e=>e&&e.attributes,EU=({entityUri:e,entityType:t,mode:r,attributeTypesSelectionStrategy:n=hU})=>{const a=(0,Uf.ax)("addAttributes"),i=(0,Uf.ax)("removeAttribute"),o=(0,Uf.ax)("modifyAttribute"),l=(0,Uf.vc)(e),s=(0,ap.useMemo)((()=>n(t)),[n,t]);return l?ip().createElement(kL,{key:l.uri,attrTypes:s,entity:l,showEmptyEditors:!0,drawLines:!0,parentUri:l.uri,mode:r,crosswalks:l.crosswalks,onAddAttributes:a,onChangeAttribute:o,onDeleteAttribute:i}):null};function bU(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const vU=(0,Sp.Z)({creatorWrapper:{marginTop:"20px"}});function TU(){return TU=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},TU.apply(null,arguments)}function OU(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){SU(e,t,r[t])}))}return e}function SU(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function xU(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}const CU=20,wU=e=>{let{entity:t={},entityTypesUris:r=[],mode:n,max:a=CU,onChange:i,onCreate:o,metadata:l,globalSearchRequestOptions:s,attributeTypesSelectionStrategy:c,disableLinkClick:u=!1,isMasked:p=!1}=e,d=xU(e,["entity","entityTypesUris","mode","max","onChange","onCreate","metadata","globalSearchRequestOptions","attributeTypesSelectionStrategy","disableLinkClick","isMasked"]);const m=vU(),[f,y]=(0,ap.useState)(""),g=(0,ap.useMemo)((()=>r.map((e=>(0,v.getEntityType)(l,e))).filter(v.isAvailableEntityType)),[r,l]),h=OU({},s,{max:a,sendMasked:p}),E=o?(e,t)=>{o(t||r[0],e),y("")}:void 0,b=e=>{null!==e&&(y(""),i(e))},T=(0,ap.useMemo)((()=>1!==g.length),[g]),S=((0,O.isEmpty)(t)?g[0]:(0,v.getEntityType)(l,t.entityType))||{},x=o&&ei().text(`Create ${f?`"${f}" as `:""}new ${S.label}`),C=ei().text(`Select ${1===g.length?`${g[0].label} `:""}profile`),w=!(0,O.isEmpty)(t)&&(0,v.isTempUri)(t.entityUri),A=T?{Group:gU,GroupHeading:ML.V}:{},R=w?{ClearIndicator:dU}:{},{TextFieldProps:_}=d,I=xU(d,["TextFieldProps"]),N=(0,ap.useMemo)((()=>OU({},_||{},{"data-reltio-id":"reltio-entity-selector"})),[_]);return ip().createElement(ip().Fragment,null,ip().createElement(tU,TU({value:(0,O.isEmpty)(t)?void 0:t,inputValue:f,onInputChange:e=>{y(e)},getOptions:e=>(0,v.typeAheadSearch)(g,e,h).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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){bU(e,t,r[t])}))}return e}({},t,{label:(0,v.getLabel)(t.label),entityType:e.find((({uri:e})=>e===t.type))}))),a=e=>(0,O.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)})(g,o)),getOptionLabel:(0,O.prop)("entityLabel"),onChange:b,onCreate:E,onClear:()=>{b({})},label:C,createLabel:x,components:OU({Option:sU,SingleValue:uU},A,R),currentEntityType:S,isClearable:!0,disableLinkClick:u,TextFieldProps:N},I)),w&&ip().createElement("div",{className:m.creatorWrapper},ip().createElement(EU,{mode:n,attributeTypesSelectionStrategy:c,entityType:S,entityUri:t.entityUri})))},AU=(0,Sp.Z)({item:{marginBottom:"20px"},dense:{marginBottom:0}});function RU(){return RU=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},RU.apply(null,arguments)}function _U(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const IU=(0,dL.l)(gL,((e,{attributeValue:t,attributeType:r})=>{const{element:n,type:a}=e||{};return{highlightedError:yL(a)&&(0,v.isAttributeTypeError)(n,t.uri,r.uri)?e:null}}),(e=>{const t=AU(),{highlightedError:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.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,ap.useRef)(a),{ref:p,errorClassName:d}=TL({highlightedError:r,isSimple:!0}),m=(0,v.getReferencedEntityUriFromAttrValue)(a),f=(0,Uf.ax)("entityDeleted"),y=(0,Uf.ax)("entityCreated"),g=(0,Uf.ax)("errorDeactivated"),h=(0,Uf.vc)(m),E=(0,v.isTempUri)(m)?h:null,b=(0,Uf.AH)(),T=(0,Uf.mU)(["ovOnly"]),S=(0,v.getReferencedEntityFromAttrValue)(a),x=(0,v.getReferencedRelationFromAttrValue)(a),C=(0,v.getReferencedEntityTypeUriFromAttrType)(i),w=(0,v.getEntityType)(b,C),A=E?(0,v.evaluateDeepEntityLabel)(E,w.dataLabelPattern):a.label,R=(0,ap.useMemo)((()=>[C]),[C]),_=(0,ap.useMemo)((()=>(0,v.addReferencedRelationCrosswalks)(l,x)),[l,x]),I=(0,ap.useMemo)((()=>(0,v.getReferencedEntityActiveError)(a,s)),[a,s]),N=(0,ap.useMemo)((()=>S&&{entityUri:(0,v.getReferencedEntityUri)(S),entityType:(0,v.getReferencedEntityTypeUri)(S),entityLabel:a.label}),[S,a.label]),P=(0,ap.useMemo)((()=>(0,v.getReferencedRelationAttrTypesUris)(i).map((e=>(0,v.findAttributeTypeByUri)(b,e))).filter(O.identity)),[i,b]),D=(0,ap.useCallback)((e=>(0,v.referencedEntityAttributeTypesSelectionStrategy)(i,e)),[i]),k=(0,ap.useCallback)((e=>{E&&f(E.uri);const t=u.current,r=!(0,O.isEmpty)(e)&&e.uri===(0,v.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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){_U(e,t,r[t])}))}return e}({},a,{label:e.label,refEntity:r?t.refEntity:(0,v.convertReferencedEntityForAttrValue)(e),refRelation:r?t.refRelation:(0,v.createReferencedRelationForAttrValue)(a)});c({value:n,attributeType:i,uri:a.uri}),I&&g((0,v.getErrorId)(I))}),[a,i,E,c,f,g,I]),L=(0,ap.useCallback)(((e,t)=>{const r=(0,O.pipe)(D,(0,v.getCreatableAttributeTypes)(o))(w),n=(0,v.createTemporaryEntity)({entityTypeUri:e,initValue:t,attributeTypes:r,metadata:b,mode:o});k(n),y(n)}),[D,o,w,b,k,y]),{canCreate:U,canUpdate:j}=Dk(a.uri),F=(0,ap.useMemo)((()=>j&&(0,v.checkCanEditAttribute)({attributeType:i,attributeValue:a,mode:o,isReltioCrosswalk:(0,v.isReltioCrosswalk)(l,a)})),[i,a,o,l,j]),M=(0,ap.useMemo)((()=>U&&(0,v.checkMetadataForCreate)(o,w)),[o,w,U]),V=(0,v.getErrorMessage)(I);return ip().createElement(UL,RU({},n,{label:(0,v.getLabel)(A),attributeTypesList:P,crosswalks:_,metadata:b}),ip().createElement("div",{ref:p,className:d},ip().createElement(nL,{errorMessage:V},ip().createElement(wU,{className:up()(t.item,{[t.dense]:V||N&&(0,v.isTempUri)(N.entityUri)}),entity:N||{},entityTypesUris:R,globalSearchRequestOptions:T,mode:o,isDisabled:!F||!!a.masked,onChange:k,onCreate:M?L:void 0,metadata:b,attributeTypesSelectionStrategy:D,isMasked:(0,v.isAttributeHasMaskedValue)(a)}))))}));function NU(){return NU=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},NU.apply(null,arguments)}const PU=(0,ap.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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className"]);return ip().createElement("div",{ref:t,"data-reltio-id":"reltio-edit-attribute",className:r},class{static build(e,t={}){switch(e.type){case v.DataTypes.TYPE_NESTED:return ip().createElement(FL,t);case v.DataTypes.TYPE_REFERENCE:return ip().createElement(IU,t);default:{const e=(0,O.omit)(["showEmptyEditors","onAddAttributes","lazy","errors","crosswalks","showNonOv","expanded"],t);return ip().createElement(wL,NU({isReltioCrosswalk:(0,v.isReltioCrosswalk)(t.crosswalks,t.attributeValue)},e))}}}}.build(e.attributeType,n))}));PU.displayName="EditModeAttribute";const DU=e=>ei().text("${value}",{value:1===e?ei().text("value"):ei().text("values")}),kU=(0,O.has)("minValue"),LU=(0,O.has)("maxValue"),UU=(0,O.pipe)(LU,O.not),jU=(0,O.propSatisfies)((e=>1===e),"minValue"),FU=({minValue:e})=>ei().text("This attribute can have minimum ${minValue} ${minValueCaption}",{minValue:ei().number(e,"0"),minValueCaption:DU(e)}),MU=({maxValue:e})=>ei().text("This attribute can have maximum ${maxValue} ${maxValueCaption}",{maxValue:ei().number(e,"0"),maxValueCaption:DU(e)}),VU=(0,O.cond)([[O.isNil,(0,O.always)("")],[({minValue:e,maxValue:t})=>e&&e===t,({minValue:e})=>ei().text("This attribute should have ${minValue} ${minValueCaption}",{minValue:ei().number(e,"0"),minValueCaption:DU(e)})],[(0,O.allPass)([jU,LU]),MU],[(0,O.allPass)([jU,UU]),(0,O.always)("")],[(0,O.allPass)([kU,LU]),({minValue:e,maxValue:t})=>ei().text("${minCardinality} and maximum ${maxValue} ${maxValueCaption}",{minCardinality:FU({minValue:e}),maxValue:ei().number(t,"0"),maxValueCaption:DU(t)})],[LU,MU],[kU,FU],[O.T,(0,O.always)("")]]),BU=(0,Sp.Z)((()=>({caption:{fontSize:"0.7rem",opacity:.54}}))),zU=({cardinality:e})=>{const t=BU(),r=VU(e);return r?ip().createElement(hf(),{variant:"caption",className:t.caption},r):null};function HU(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){YU(e,t,r[t])}))}return e}function YU(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const WU={content:'""',position:"absolute",left:"-1000px",top:"-4px",width:"5000px",height:"calc(100% + 8px)",animationName:"$highlightAnimation",animationDuration:"2s",animationIterationCount:1,opacity:0},GU=(0,Sp.Z)((()=>({"@keyframes highlightAnimation":{"0%":{opacity:0},"50%":{opacity:1},"100%":{opacity:0}},highlighted:{"&::before":HU({},WU,{background:"rgba(228, 151, 0, 0.08)"}),position:"relative"}}))),qU=e=>{const t=GU(),r=(0,ap.useRef)(null);return(0,ap.useEffect)((()=>{e&&e.scrollIntoRef(r)}),[e]),e?{ref:r,highlightedClassName:t.highlighted}:{ref:r}},ZU=(0,O.filter)((0,O.propSatisfies)(v.isTempUri,"uri")),$U=(0,Sp.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"}}))),KU=({max:e,values:t,attributeType:r,parentUri:n,mode:a,drawLines:i,showEmptyEditors:o,errorMessage:l,errors:s,paging:c,crosswalks:u,showNonOv:p,nonVisibleValues:d,highlightedError:m,highlightedAttribute:f,onAddAttributes:y,onDeleteAttribute:g,onChangeAttribute:h,onDeactivateError:E,additionalControlsRenderer:b,requestNextPageOfAttributeValues:T})=>{const S=$U(),[x,C]=(0,ap.useState)(e),[w,A]=(0,ap.useState)(!1),{label:R,required:_,cardinality:I,name:N,uri:P,description:D}=r,k=(0,v.isEditableMode)(a),{ref:L,errorClassName:U}=TL({highlightedError:m}),{ref:j,highlightedClassName:F}=qU(f),M=(0,ap.useContext)(RL),V=(0,ap.useContext)(NL),B=(0,ap.useMemo)((()=>null==M?void 0:M.includes(P)),[P,M]),z=(0,ap.useMemo)((()=>null==V?void 0:V.includes(P)),[P,V]),H=(0,v.isEmptyValue)(t),Y=(!w&&o||_||B||z)&&H,W=(0,Uf.Ws)(),G=(0,ap.useMemo)((()=>W.includes(r.uri)),[W,r.uri]),q=(0,ap.useRef)((0,v.createNewAttribute)({parentUri:n,attributeType:(0,O.omit)(["defaultValue"],r)})),Z=(0,ap.useCallback)((()=>{C(x+1);const e=e=>({parentUri:n,index:x,attributeType:e});if(Y&&!(0,v.isComplexAttribute)(r.type)){const t=[e((0,O.omit)(["defaultValue"],r)),e(r)];return y(t)}return y([e(r)])}),[x,y,n,r,Y]),$=(0,ap.useCallback)((0,O.pipe)(g,O.T,A),[g,A]);if(H&&!Y)return null;if(Y&&H&&(t=[q.current]),(0,v.isEmptyValue)(t))return null;const K=(ZU(t)||[]).length,X=p?"totalValues":"totalOvValues",Q=(0,O.ifElse)((0,O.has)(X),(0,O.pipe)((0,O.prop)(X),(0,O.add)(K)),(0,O.always)(t.length))(c),J=null!=c&&c.totalValues?c.totalValues-Q:null==d?void 0:d.length,ee=e<Q,te=ee&&x<Q,re=ee&&x>=Q,ne=t.slice(0,x),ae=ne?ne.length-1:0,ie=Q-x;return ip().createElement($I,{enabled:i},ip().createElement("div",{ref:L,className:up()(S.wrapper,U)},ip().createElement("div",{className:S.titleWrapper},ip().createElement(lP,{label:R,isRequired:_,className:S.title,"data-reltio-id":"reltio-attribute-label"}),ip().createElement(gP,{description:D}),G&&ip().createElement(xD,null),ip().createElement(pP,{nonOvValues:d,attributeType:r,className:S.ovIcon,nonOvTotal:J})),k&&ip().createElement(zU,{cardinality:I}),k&&ip().createElement(qk,{message:l,className:S.typeError}),ip().createElement("div",{className:S.attributesWrapper},ne.map(((e,t)=>ip().createElement(PU,{key:e.uri,attributeValue:e,attributeType:r,lazy:Y&&!_,showEmptyEditors:o,errors:s,ownError:(0,v.getAttributeOwnError)(e,t,r.uri,s),mode:a,crosswalks:u,onAddOneMore:ae===t?Z:null,onAddAttributes:y,onDeleteAttribute:$,onChangeAttribute:h,onDeactivateError:E,additionalControlsRenderer:b,className:0===t?F:null,ref:0===t?j:null,isEmptyEditor:Y}))),te&&ip().createElement(FD,{moreNumber:(0,O.min)(e,ie),valueNumber:ie,onClick:()=>{t.length<Q&&T({parentUri:n,attributeTypeUri:P,attributeTypeName:N,values:t,defaultMaxValues:e}),C(x+e)}}),re&&ip().createElement(zD,{onClick:()=>{C(e)}}))))};KU.displayName="AttributeRenderer";const XU=(0,ap.memo)(KU),QU=(0,Sp.Z)({value:{color:"rgba(0, 0, 0, 0.87)"}}),JU=(0,Sp.Z)({placeholder:{color:"rgba(0, 0, 0, 0.38)",fontSize:"14px !important"}});function ej(){return ej=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ej.apply(null,arguments)}function tj(){return tj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},tj.apply(null,arguments)}const rj={SingleValue:({selectProps:{menuIsOpen:e},data:{label:t}})=>{const r=QU();return!e&&ip().createElement(hf(),{variant:"body2",classes:{root:r.value}},t)},Placeholder:({innerProps:e,children:t})=>{const r=JU();return ip().createElement(hf(),ej({className:r.placeholder},e),t)}},nj=e=>ip().createElement(tU,tj({components:rj},e)),aj=(0,ap.memo)(nj),ij=(0,Sp.Z)({container:{display:"flex",flex:1,alignItems:"flex-start",marginBottom:"10px"},roleContainer:{width:"100%"},valueContainer:{marginLeft:"8px",width:0},deleteButton:{marginLeft:"8px"}}),oj={MultiValue:Fy._},lj=({values:e,onChange:t,onDelete:r})=>{const n=ij(),a=(0,Uf.AH)(),i=(0,Uf.eh)(),o=i.uri,l=(0,v.getRolesForEntityType)(a,i.type).map((e=>({value:e.uri,label:e.label}))),s=(e||[]).map((e=>{var t;return{value:e,label:(null===(t=l.find((0,O.propEq)("value",e)))||void 0===t?void 0:t.label)||(0,v.getLastUriPart)(e)}})),c=(0,ap.useCallback)((e=>{const r=(null==e?void 0:e.map((0,O.prop)("value")))||[];t({value:r,attributeType:v.EntityAttrTypes.roles,uri:o})}),[o,t]),u=(0,ap.useCallback)((()=>{r({uri:o,attributeType:v.EntityAttrTypes.roles})}),[o,r]);return ip().createElement("div",{className:n.container,"data-reltio-id":"reltio-attribute-value"},ip().createElement(aj,{label:"",height:40,isMulti:!0,options:l,value:s,onChange:c,components:oj,classes:n,className:n.roleContainer}),!!r&&ip().createElement(Op.T,{"data-reltio-id":"reltio-roles-delete-button",className:n.deleteButton,icon:$k(),onClick:u,size:"L"}))};var sj=r(56333);const cj=(0,Sp.Z)({container:{display:"flex",flex:1,alignItems:"flex-start",marginBottom:"10px"},deleteButton:{marginLeft:"8px"}});function uj(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){pj(e,t,r[t])}))}return e}function pj(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const dj=({className:e,values:t,onChange:r,onDelete:n})=>{const a=cj(),i=(0,Uf.lG)(),o=(0,Uf.mU)(),l=(0,ap.useCallback)((async(e,t,r)=>{const n=await(0,v.getFacetedAttributeData)({fieldName:"tags",searchValue:e,options:uj({},o,{max:t,pageNo:r})});return Object.keys(n.tags)}),[o]),s=(0,ap.useCallback)((e=>{r({value:e,attributeType:v.EntityAttrTypes.tags,uri:i})}),[r,i]),c=(0,ap.useCallback)((()=>{n({uri:i,attributeType:v.EntityAttrTypes.tags})}),[i,n]);return ip().createElement("div",{className:a.container,"data-reltio-id":"reltio-attribute-value"},ip().createElement(sj.p,{fullWidth:!0,multiple:!0,variant:"filled",className:e,value:t||[],onChange:s,getSuggestions:l}),!!n&&ip().createElement(Op.T,{"data-reltio-id":"reltio-tags-delete-button",className:a.deleteButton,icon:$k(),onClick:c,size:"L"}))};function mj(){return mj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},mj.apply(null,arguments)}function fj(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const yj=(0,dL.l)(_L,((e,{attributeType:t})=>{const{hasDeletionsMap:r,setHasDeletions:n}=e||{};return{hasDeletions:r?Boolean(r[null==t?void 0:t.uri]):void 0,setHasDeletions:n}}),(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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["values","attributeType","parentUri","mode","errorMessage","onDeleteAttribute","onChangeAttribute","showEmptyEditors","hasDeletions","setHasDeletions","highlightedAttribute"]);const m=$U(),{label:f,required:y,cardinality:g}=r,h=(0,v.isEditableMode)(a),[E,b]=(0,ap.useState)(!1),T=(0,ap.useCallback)((e=>{b(e),null==u||u(r.uri,e)}),[r.uri,u]),S=void 0!==c?c:E,x=(0,ap.useCallback)((0,O.pipe)(o,O.T,T),[o,T]),C=(0,v.isEmptyValue)(t),w=!S&&s&&C,A=(0,ap.useRef)((0,v.createNewAttribute)({parentUri:n,attributeType:r})),{ref:R,highlightedClassName:_}=qU(p);return(0,v.isActivenessAttrType)(r)&&C&&!w?null:ip().createElement("div",{ref:R,className:up()(_,m.wrapper)},ip().createElement(lP,{label:f,isRequired:y,className:up()(m.title,m.titleWrapper),"data-reltio-id":"reltio-attribute-label"}),h&&ip().createElement(zU,{cardinality:g}),h&&ip().createElement(qk,{message:i}),ip().createElement(jI(),{className:m.attributesWrapper},(()=>{switch(r.uri){case v.EntityAttrTypes.tags.uri:return ip().createElement(dj,{values:t,onDelete:x,onChange:l});case v.EntityAttrTypes.roles.uri:return ip().createElement(lj,{values:t,onDelete:x,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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){fj(e,t,r[t])}))}return e}({},A.current,{value:t[0]||""});return ip().createElement(PU,mj({attributeValue:e,attributeType:r,mode:a,onDeleteAttribute:x,onChangeAttribute:l},d))}}})()))}));var gj=r(57517),hj=r.n(gj);function Ej(){return Ej=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ej.apply(null,arguments)}const bj=e=>ip().createElement("svg",Ej({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),ip().createElement("defs",null,ip().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"})),ip().createElement("g",{transform:"translate(-3 -3)",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},ip().createElement("mask",{id:"Download_svg__b",fill:"#fff"},ip().createElement("use",{xlinkHref:"#Download_svg__a"})),ip().createElement("path",{fillOpacity:.54,fill:"#fff",mask:"url(#Download_svg__b)",d:"M0 0h24v24H0z"})));var vj=r(76550),Tj=r.n(vj),Oj=r(29367),Sj=r.n(Oj);const xj=(0,Sp.Z)((()=>({root:{fontSize:"24px",color:"#fff"}}))),Cj=({checked:e,className:t,onClick:r})=>{const n=xj(),a=e?Sj():Tj();return ip().createElement(a,{className:up()(n.root,t),onClick:r})},wj=(0,Sp.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"}}))),Aj=e=>{const{id:t,canBeSelected:r=!1,selected:n=!1,selectionMode:a=!1,onDeselect:i=O.identity,onSelect:o=O.identity,onShareLink:l,onSetAsDefault:s,onDelete:c,onDownload:u=O.identity,onClick:p}=e,d=wj(),[m,f]=(0,ap.useState)(!1),{canDelete:y}=Dk(t),g=(0,ap.useMemo)((()=>[{text:ei().text("Share link"),onClick:l},{text:ei().text("Set as default"),onClick:s},{text:ei().text("Delete"),onClick:y&&c}].filter((0,O.prop)("onClick"))),[l,s,c,y]),h=e=>()=>(0,O.ifElse)((0,O.equals)(!0),i,o)(e),E=r&&(n||m||a),b=!a&&!n&&m,v=r&&n;return ip().createElement("div",{className:up()(d.overlay,{[d.selected]:n,[d.selectionMode]:a}),onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),onClick:a?h(n):e=>{e.currentTarget===e.target&&p()},"data-reltio-id":"image-actions-overlay"},E&&ip().createElement(Cj,{className:d.checkedIcon,checked:n,onClick:h(n)}),b&&ip().createElement("div",{className:d.actions},ip().createElement(Op.T,{onClick:u,className:d.actionButton,icon:bj}),ip().createElement(SN,{menuId:`image-overlay-actions-${t}`,buttonComponent:Op.T,buttonProps:{icon:Id(),className:up()(d.actionButton,d.dropDownMenuButton)},menuItems:g})),v&&ip().createElement(Gh(),{className:d.button,variant:"outlined",onClick:i},ei().text("Deselect")))},Rj=(0,ap.memo)(Aj);var _j=r(70251),Ij=r.n(_j),Nj=r(1937),Pj=r.n(Nj);const Dj=(0,Sp.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}}))),kj=e=>0===e.trim().length,Lj=({onSend:e})=>{const t=Dj(),[r,n]=(0,ap.useState)(""),[a,i]=(0,ap.useState)(null);return ip().createElement(jI(),{className:t.root},ip().createElement(VI(),{className:t.paper},ip().createElement(Pj(),{value:r,onChange:e=>{const t=e.target.value,r=new RegExp(/^(ftp|http|https):\/\/[^ "]+$/).test(t);n(t),r||kj(t)?i(null):i(ei().text("URL is not correct"))},classes:{root:t.inputRoot,input:t.input},placeholder:ei().text("Paste an image URL here")}),ip().createElement(Gh(),{disabled:Boolean(a)||kj(r),variant:"outlined",color:"primary",onClick:()=>{e(r),n(""),i(null)}},ei().text("Send"))),a&&ip().createElement(hf(),{className:t.errorMessage},a))};var Uj=r(65680),jj=r(83997);const Fj=["image/png","image/jpeg","image/tiff","image/gif","image/bmp"],Mj=({className:e,onAppendFile:t})=>ip().createElement(ip().Fragment,null,ip().createElement("input",{onInput:e=>{t&&t(e.currentTarget.files[0])},style:{display:"none"},accept:Fj.join(","),id:"upload-image-button","data-reltio-id":"upload-image-button",type:"file"}),ip().createElement("label",{htmlFor:"upload-image-button"},ip().createElement(Gh(),{className:e,variant:"contained",color:"primary",component:"span"},ei().text("Select image"))));function Vj(){return Vj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Vj.apply(null,arguments)}const Bj=e=>ip().createElement("svg",Vj({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),ip().createElement("defs",null,ip().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"UploadIcon_svg__c"},ip().createElement("stop",{stopColor:"#FFF",offset:"0%"}),ip().createElement("stop",{stopColor:"#FFF",stopOpacity:0,offset:"100%"})),ip().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"UploadIcon_svg__d"},ip().createElement("stop",{stopColor:"#FFF",offset:"0%"}),ip().createElement("stop",{stopColor:"#FFF",stopOpacity:0,offset:"100%"})),ip().createElement("linearGradient",{x1:"67.572%",y1:"54.952%",x2:"15.212%",y2:"13.907%",id:"UploadIcon_svg__e"},ip().createElement("stop",{stopColor:"#000",stopOpacity:0,offset:"0%"}),ip().createElement("stop",{stopColor:"#000",offset:"100%"})),ip().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"UploadIcon_svg__f"},ip().createElement("stop",{stopColor:"#B8EDFF",offset:"0%"}),ip().createElement("stop",{stopColor:"#53ACDE",offset:"100%"})),ip().createElement("circle",{id:"UploadIcon_svg__a",cx:128,cy:128,r:128})),ip().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},ip().createElement("mask",{id:"UploadIcon_svg__b",fill:"#fff"},ip().createElement("use",{xlinkHref:"#UploadIcon_svg__a"})),ip().createElement("use",{fillOpacity:.1,fill:"#0072CE",xlinkHref:"#UploadIcon_svg__a"}),ip().createElement("g",{mask:"url(#UploadIcon_svg__b)"},ip().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(-1 9)"},ip().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}),ip().createElement("ellipse",{fill:"url(#UploadIcon_svg__c)",opacity:.4,cx:64.553,cy:107.664,rx:61.43,ry:62.336}),ip().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})),ip().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)"}),ip().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)"})))),zj=(0,Sp.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"}}))),Hj=({onAppendFile:e,className:t})=>{const r=zj(),[{canDrop:n,isOver:a},i]=(0,Uj.useDrop)({accept:[jj.FILE],drop:t=>{t&&e(t.files[0])},collect:e=>({isOver:e.isOver(),canDrop:e.canDrop()})}),o=n&&a;return ip().createElement("div",{ref:i,className:up()(r.root,{[r.isActive]:o},t)},ip().createElement(Bj,{className:r.icon}),ip().createElement(hf(),{className:r.title},ei().text("Drag an image here")),ip().createElement(hf(),{className:r.description},ei().text("Acceptable image types would include JPG, PNG, TIFF, GIF, BMP. Maximum image size: ${MAX_IMAGE_SIZE}Mb",{MAX_IMAGE_SIZE:20})),ip().createElement(Mj,{onAppendFile:e}))},Yj=(0,Sp.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"}}))),Wj=({children:e,className:t})=>{const r=Yj();return ip().createElement(jI(),{className:up()(r.root,t)},ip().createElement(jI(),{className:r.border}),ip().createElement(hf(),{className:r.text},e),ip().createElement(jI(),{className:r.border}))},Gj=(0,Sp.Z)({closeIcon:{color:"#fff"}}),qj=({error:e,onClose:t})=>{const r=Gj();return ip().createElement(zh(),{open:Boolean(e),onClose:t,message:e,action:ip().createElement(gd.k,{className:r.closeIcon,tooltipTitle:ei().text("Close"),icon:Ep(),onClick:t})})},Zj=(0,Sp.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"}}))),$j=({open:e,onClose:t,onUpload:r})=>{const n=Zj(),[a,i]=(0,ap.useState)(!1),[o,l]=(0,ap.useState)(null),s=(0,Uf.qD)(),c=(0,Uf.fN)(),u=(0,Uf.Uv)(),p=e=>{i(!0),(0,v.uploadImage)({image:e,imageServicePath:s,environment:c,tenant:u}).then((e=>{r(e),t()})).catch((e=>{l((0,v.getRequestErrorMessage)(e,ei().text("Something went wrong")))})).finally((()=>i(!1)))};return ip().createElement(Ij(),{open:e,onClose:t,classes:{paper:n.dialogPaper}},ip().createElement(hf(),{className:n.title},ei().text("Add new image")),ip().createElement(jI(),{className:n.body},ip().createElement(Hj,{className:n.targetBox,onAppendFile:e=>{if(!e)return l(ei().text("No image selected."));const t=Number((e.size/1024/1024).toFixed(2)),r=Fj.includes(e.type);t>20?l(ei().text("File size exceeds configured max file size.")):r?p(e):l(ei().text("File format is not supported."))}}),ip().createElement(Wj,{className:n.divider},ei().text("or")),ip().createElement(Lj,{onSend:e=>{p(e)}})),a&&ip().createElement(wE.z,null),ip().createElement(qj,{error:o,onClose:()=>l(null)}))},Kj=(0,Sp.Z)((()=>({root:{width:"100%"},image:({imageMargin:e})=>({marginRight:e,cursor:"pointer","&:last-child":{marginRight:0}}),uploadContainer:({imageMargin:e,imageWidth:t,imageHeight:r})=>({backgroundColor:"white",width:t,height:r,cursor:"pointer",border:"1px dashed #0072CE",boxSizing:"border-box",marginRight:e,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}),uploadButton:{width:"50px",height:"50px"},uploadIcon:{fontSize:"36px"}}))),Xj={},Qj=({attributeType:e={},attributeValues:t=[],onDeleteAttribute:r,onChangeAttribute:n,requestNextPageOfAttributeValues:a,parentUri:i,paging:o,showNonOv:l,imageSize:s=mk})=>{const c=Kj(s),[u,p]=(0,ap.useState)(!1),d=(0,Uf.ax)("setDefaultProfilePicForModifiedEntity"),m=(0,Uf.eh)()||Xj,f=(0,Uf.AU)(m.uri),{canCreate:y}=(0,ap.useContext)(Pk),g=(0,ap.useCallback)((()=>{p((e=>!e))}),[]),h=(0,ap.useCallback)((t=>{const r=(0,v.generateUri)(i,e.name),a={};for(const n in t){const i=(e.attributes||[]).find((({name:e})=>e===n));i&&(a[n]=[{uri:(0,v.generateUri)(r,i.name),ov:!0,value:t[n],type:i.uri}])}n({attributeType:e,uri:r,value:a})}),[n,i,e]),E=(0,ap.useCallback)((e=>{if(r(e),f===e.uri){var n;const r=(null===(n=t[0])||void 0===n?void 0:n.uri)===e.uri?t[1]:t[0];d({entityUri:m.uri,value:r||{}})}}),[r,m,f,t,d]),b=(t,r)=>{const{onOpenImageGalleryDialog:n,onDownload:a,onShareLink:i,onSetAsDefault:o}=t,l=(0,v.getImageAttributeOvUrl)(r),{uri:s}=r;return ip().createElement(Rj,{id:s,onShareLink:()=>i(l),onSetAsDefault:()=>o(r),onDelete:()=>E({uri:s,attributeType:e}),onDownload:()=>a([l]),onClick:()=>n(s)})};return ip().createElement("div",{className:c.root,"data-reltio-id":"image-line-edit-mode"},ip().createElement(UF,{attributeValues:t,attributeType:e,renderImage:e=>(t={})=>{const r=(0,v.getImageAttributeOvThumbnailUrl)(t),{uri:n}=t,{onOpenImageGalleryDialog:a}=e;return ip().createElement("div",{className:c.image,key:n},ip().createElement(dk,{src:r,overlay:b(e,t),onClick:()=>a(n),size:{imageWidth:s.imageWidth,imageHeight:s.imageHeight},"data-reltio-id":"reltio-attribute-value"}))},overlay:!0,countFixedItems:y?1:0,onUpload:g,onDeleteAttribute:E,imageSize:s,requestNextPageOfAttributeValues:a,paging:o,parentUri:i,showNonOv:l},y&&ip().createElement("div",{className:c.uploadContainer,onClick:g},ip().createElement(Op.T,{className:c.uploadButton,iconClassName:c.uploadIcon,icon:hj(),"data-reltio-id":"reltio-upload-image-button"}))),ip().createElement($j,{open:u,onUpload:h,onClose:g}))},Jj=({attributeType:e,attributeValues:t,paging:r,parentUri:n,showNonOv:a,onDeleteAttribute:i,onChangeAttribute:o,requestNextPageOfAttributeValues:l,highlightedAttribute:s,error:c,highlightedError:u,onDeactivateError:p})=>{const d=$U(),{label:m,description:f,required:y}=e,{ref:g,highlightedClassName:h}=qU(s),{ref:E,errorClassName:b}=TL({highlightedError:u}),T=(0,ap.useCallback)((()=>{c&&p&&p((0,v.getErrorId)(c))}),[c,p]);return ip().createElement("div",{ref:g,className:up()(d.wrapper,h)},ip().createElement("div",{ref:E,className:up()(d.imagesWrapper,b)},ip().createElement("div",{className:d.titleWrapper},ip().createElement(lP,{className:d.title,label:m,"data-reltio-id":"reltio-attribute-label",isRequired:y}),ip().createElement(gP,{description:f})),ip().createElement(nL,{errorMessage:null==c?void 0:c.message,className:d.errorWrapper},ip().createElement(Qj,{attributeValues:t,attributeType:e,paging:r,onDeleteAttribute:i,parentUri:n,onChangeAttribute:(0,O.pipe)(o,T),requestNextPageOfAttributeValues:l,showNonOv:a}))))};let eF=function(e){return e.imageLine="imageLine",e.special="special",e.default="default",e}({});function tF(){return tF=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},tF.apply(null,arguments)}const rF=(0,dL.l)(gL,((e,{attributeType:t,parentUri:r})=>{const{element:n,type:a}=e||{},i=(e=>e===fL.NewAttribute)(a)&&n.uri===t.uri;return{highlightedAttribute:i?e:null,highlightedError:yL(a)&&(0,v.isAttributeTypeError)(n,r,t.uri)?e:null}}),(({values:e,attributeType:t,mode:r=v.Mode.Viewing,crosswalks:n,drawLines:a,paging:i={},parentUri:o,max:l,showEmptyEditors:s,showNonOv:c,highlightedError:u,highlightedAttribute:p,onAddAttributes:d,onDeleteAttribute:m,onChangeAttribute:f,additionalControlsRenderer:y})=>{const g=(0,Uf.ax)("errorDeactivated"),h=(0,Uf.ax)("requestNextPageOfAttributeValues"),E=(0,ap.useContext)(IL),b=o&&(0,v.getBaseUri)(o),T=(0,ap.useMemo)((()=>E[b]||[]),[E,b]),S=(0,Uf.Jz)(o,t),x=(0,ap.useMemo)((()=>(0,v.filterErrorsForHiddenAttributes)(S,T)),[S,T]),C=(0,Uf.Xj)(),w=(0,Uf.vd)(),A=(0,v.getAttributePagerActiveTypeErrorMessage)(o,t,C),R=l??w??1/0,_=(0,O.partition)(v.isOv),[I,N]=_(e),P=c?e:I,D=c?[]:N,k={errorMessage:A,errors:x,mode:r,parentUri:o,onAddAttributes:d,onDeleteAttribute:m,onChangeAttribute:f,onDeactivateError:g,additionalControlsRenderer:y,showEmptyEditors:s,highlightedError:u,highlightedAttribute:p};return(()=>{switch((0,O.cond)([[v.isSpecialAttribute,(0,O.always)(eF.special)],[v.isImage,(0,O.always)(eF.imageLine)],[O.T,(0,O.always)(eF.default)]])(t)){case eF.special:return ip().createElement($I,{enabled:a},ip().createElement(yj,tF({values:P,attributeType:t},k)));case eF.imageLine:return ip().createElement($I,{enabled:a},ip().createElement(Jj,{attributeValues:P,attributeType:t,paging:i,onDeleteAttribute:m,parentUri:o,onChangeAttribute:f,requestNextPageOfAttributeValues:h,showNonOv:c,highlightedAttribute:p,error:(0,v.getAttributeErrorByTypeUri)(t.uri,x),highlightedError:u,onDeactivateError:g}));default:return ip().createElement(XU,tF({values:P,attributeType:t,max:R,paging:i,crosswalks:n,drawLines:a,requestNextPageOfAttributeValues:h,showNonOv:c,nonVisibleValues:D},k))}})()})),nF=(0,Sp.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"}}),aF=({attributeType:e,imageAttributeFieldsOrder:t,attributeValue:r,hasChanges:n,onDeleteAttribute:a,onChangeAttribute:i,onAddAttributes:o,onCancel:l,onApply:s,mode:c})=>{const u=nF(),p=Fk(r,e,t),d=0!==p.length||0===p.length&&n;return ip().createElement(jI(),{className:u.root},ip().createElement(jI(),{className:u.form},p.map((({attrType:e,values:t})=>ip().createElement(rF,{key:e.uri,parentUri:r.uri,attributeType:e,values:t,showEmptyEditors:(0,v.isTempUri)(r.uri),mode:c,drawLines:!1,onDeleteAttribute:a,onChangeAttribute:i,onAddAttributes:o})))),d&&ip().createElement(ip().Fragment,null,ip().createElement(Cf(),{className:u.divider}),ip().createElement(jI(),{className:u.actions},ip().createElement(Gh(),{disabled:!n,onClick:l,className:u.cancelButton},ei().text("Cancel")),ip().createElement(Gh(),{disabled:!n,onClick:s,color:"primary"},ei().text("Apply")))))},iF={palette:{mode:"dark",primary:v.theme.palette.primary,secondary:v.theme.palette.secondary}},oF=(0,xm.createTheme)(iF),lF=({imageAttributeFieldsOrder:e,attributeType:t,attributeValue:r})=>{const n=(0,Uf.YA)(),a=(0,Uf.o_)(),{addAttributes:i,changeAttribute:o,deleteAttribute:l,clearLocalChanges:s,applyLocalChanges:c,attributeValue:u,hasChanges:p}=(({initialAttributeValue:e,attributeType:t})=>{const r=(0,Uf.ax)("modifyAttribute"),[n,a]=(0,ap.useState)(e);(0,ap.useEffect)((()=>{a(e)}),[e]);const i=!(0,O.equals)(n,e),o=(0,ap.useCallback)((e=>{a((t=>e.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:a}=t;return(0,v.addAttribute)({entity:e,attributeType:r,parentUri:n,index:a,nestingLevel:1})}),t)))}),[]),l=(0,ap.useCallback)((({value:e,attributeType:t,uri:r})=>{a((n=>(0,v.editAttribute)({entity:n,attributeType:t,uri:r,value:e,nestingLevel:1})))}),[]),s=(0,ap.useCallback)((({attributeType:e,uri:t})=>{a((r=>(0,v.removeAttribute)({entity:r,attributeType:e,uri:t,nestingLevel:1})))}),[]);return{addAttributes:o,changeAttribute:l,deleteAttribute:s,clearLocalChanges:(0,ap.useCallback)((()=>{a(e)}),[e]),applyLocalChanges:(0,ap.useCallback)((()=>{r({value:n,attributeType:t,uri:n.uri})}),[n,t,r]),attributeValue:n,hasChanges:i}})({attributeType:t,initialAttributeValue:r});return ip().createElement(xm.ThemeProvider,{theme:oF},ip().createElement(jI(),null,ip().createElement(Bk,{attributeType:t,uri:null==u?void 0:u.uri,onAddAttributes:a?i:void 0}),ip().createElement(Wk,{attributeType:t,attributeValue:u,imageAttributeFieldsOrder:e}),a&&ip().createElement(aF,{mode:n,imageAttributeFieldsOrder:e,attributeType:t,attributeValue:u,hasChanges:p,onDeleteAttribute:l,onChangeAttribute:o,onAddAttributes:i,onCancel:s,onApply:c})))},sF=(0,Sp.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}}))),cF=({className:e,attributeValue:t,handleSetAsDefault:r,attributeType:n})=>{const a=sF(),[i,o]=(0,ap.useState)(!1),l=(0,Uf.eh)()||{},s=(0,Uf.vc)(null==l?void 0:l.uri)||{},c=(0,Uf.xH)(),u=(0,Uf.uO)()||{},p=c?l:s,d=u[null==l?void 0:l.type]||(null==u?void 0:u.default)||{};(0,ap.useEffect)((()=>{o((null==p?void 0:p.defaultProfilePic)===(null==t?void 0:t.uri))}),[null==t?void 0:t.uri,p]);const m=(0,ap.useCallback)((()=>{r(t.uri)}),[null==t?void 0:t.uri]);return ip().createElement(jI(),{className:up()(a.root,e)},ip().createElement(jI(),{className:a.header},ip().createElement(hf(),{className:a.headerTitle},ei().text("Details"))),ip().createElement(jI(),{className:a.bodyWrapper},ip().createElement(jI(),{className:a.body},ip().createElement(vh(),{classes:{root:a.formControlLabel,label:a.checkboxLabel},control:ip().createElement(Hp(),{className:a.checkbox,checked:i,onChange:m}),label:ei().text("Set as default")}),ip().createElement(lF,{attributeType:n,imageAttributeFieldsOrder:d,attributeValue:t}))))},uF=(0,Sp.Z)((()=>({root:{display:"flex",width:"100%",overflowY:"auto",height:"calc(100vh - 64px)"},main:{flex:"1 0 auto"},details:{width:"340px"}}))),pF=({attributeValues:e=[],currentAttributeValueUri:t,setCurrentAttributeValueUri:r,handleSetAsDefault:n,attributeType:a})=>{const[i,o]=(0,ap.useState)(0);(0,ap.useEffect)((()=>{l(t?e.findIndex((e=>e.uri===t)):0)}),[t,e]);const l=(0,ap.useCallback)((t=>{var n;o(t),r(null===(n=e[t])||void 0===n?void 0:n.uri)}),[e]),s=uF();return ip().createElement(jI(),{className:s.root},ip().createElement(Sk,{attributeValueIndex:i,setAttributeValueIndex:l,attributeValues:e,className:s.main}),ip().createElement(cF,{handleSetAsDefault:n,attributeValue:e[i],className:s.details,attributeType:a}))};let dF=function(e){return e.Gallery="gallery",e.Details="details",e}({});var mF=r(60480),fF=r.n(mF),yF=r(54886),gF=r.n(yF),hF=r(86038),EF=r.n(hF),bF=r(39178),vF=r.n(bF);function TF(){return TF=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},TF.apply(null,arguments)}const OF=e=>ip().createElement("svg",TF({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),ip().createElement("defs",null,ip().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"})),ip().createElement("g",{stroke:"none",strokeWidth:1,fillRule:"evenodd"},ip().createElement("mask",{id:"Details_svg__b",fill:"#fff"},ip().createElement("use",{xlinkHref:"#Details_svg__a"})),ip().createElement("path",{mask:"url(#Details_svg__b)",d:"M0 0h24v24H0z"}))),SF=(0,Sp.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}}))),xF=({open:e,mode:t,children:r,header:n,onClose:a,onChangeMode:i})=>{const o=SF(),l=(0,ap.useMemo)((()=>[{id:dF.Gallery,title:ei().text("Gallery"),Icon:vF()},{id:dF.Details,title:ei().text("Details"),Icon:OF}]),[]);return ip().createElement(Ij(),{classes:{paper:o.paper},open:e,BackdropProps:{className:o.backdrop},fullScreen:!0},ip().createElement(gF(),{classes:{colorPrimary:o.appBar}},ip().createElement(EF(),{className:o.toolbar},ip().createElement(jI(),{className:o.headerLeft},ip().createElement(gd.k,{tooltipTitle:ei().text("Close"),onClick:a,className:o.closeButton,iconClassName:o.closeIcon,icon:Ep()}),null==n?void 0:n.left),ip().createElement(jI(),{className:o.headerCenter},ip().createElement(DE,{modes:l,modeId:t,onChange:i,className:o.modeSwitcher})),ip().createElement(jI(),{className:o.headerRight},null==n?void 0:n.right))),ip().createElement(fF(),{className:o.content},r))},CF=(0,Sp.Z)((()=>({root:{padding:"0 24px",overflowY:"auto",height:"calc(100vh - 64px)"},item:{padding:"2px"}}))),wF=({items:e,selectedItems:t,onSelectImage:r,onDeselectImage:n,onShareLink:a,onSetAsDefault:i,onDownload:o,onClickImage:l,onDelete:s})=>{const c=CF(),u=e=>ip().createElement(Rj,{id:e,selected:t.includes(e),selectionMode:0!==t.length,onSelect:()=>r(e),onDeselect:()=>n(e),onShareLink:()=>a(e),onSetAsDefault:()=>i(e),onDownload:()=>o(e),onClick:()=>l(e),onDelete:s?()=>s(e):void 0,canBeSelected:!0});return ip().createElement(jI(),{className:c.root},ip().createElement(bk(),{container:!0},e.map((({id:e,src:t})=>ip().createElement(bk(),{key:e,classes:{item:c.item},item:!0},ip().createElement(dk,{size:sk.LARGE,onClick:()=>l(e),src:t,overlay:u(e)}))))))},AF=(0,Sp.Z)((e=>({selectButton:{fontSize:"14px",fontWeight:500,color:e.palette.primary.main,textTransform:"uppercase"}}))),RF=({selectedItems:e,items:t,onSelectAll:r,onClearAll:n})=>{const a=AF(),i=e.length===t.length;return ip().createElement(ry(),{component:"button",underline:"none",classes:{button:a.selectButton},onClick:i?n:r},i?ei().text("Clear selection"):ei().text("Select all images"))};var _F=r(70997),IF=r.n(_F);const NF=(0,Sp.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)"}}))),PF=({onDownload:e,onShare:t,onUpload:r,onDelete:n})=>{const a=NF();return ip().createElement(ip().Fragment,null,r&&ip().createElement(Gh(),{variant:"contained",color:"primary",onClick:r,startIcon:ip().createElement(hj(),null)},ei().text("Upload")),e&&r&&ip().createElement("div",{className:a.divider}),e&&ip().createElement(gd.k,{className:a.downloadButton,tooltipTitle:ei().text("Download selected items"),icon:bj,onClick:e}),t&&ip().createElement(gd.k,{className:a.shareButton,tooltipTitle:ei().text("Copy link"),icon:IF(),onClick:t}),n&&ip().createElement(gd.k,{className:a.deleteButton,tooltipTitle:ei().text("Delete selected items"),icon:$k(),onClick:n}))},DF=({attributeValues:e,open:t,onClose:r,currentAttributeValueUri:n,setCurrentAttributeValueUri:a,attributeType:i,onDownload:o,onShareLink:l,onSetAsDefault:s,onUpload:c,onDeleteAttribute:u})=>{const[p,d]=(0,ap.useState)([]),[m,f]=(0,ap.useState)(dF.Gallery),y=(0,Uf.xH)();(0,ap.useEffect)((()=>{f(n?dF.Details:dF.Gallery)}),[n]);const g=e.map((e=>({src:(0,v.getImageAttributeOvThumbnailUrl)(e),downloadURL:(0,v.getImageAttributeOvUrl)(e),id:e.uri}))),h=e=>{l(g.find((0,O.propEq)("id",e)).downloadURL)},E=t=>{const r=e.find((({uri:e})=>e===t));s(r)},b=e=>{u({uri:e,attributeType:i})},{canCreate:T,canDelete:S}=(0,ap.useContext)(Pk),x=m===dF.Gallery,C=m===dF.Details,w=p.length>0,A=C||x&&w,R=()=>x?p:[n],_=R().every((e=>(0,v.isTempUri)(e)||S)),I=!y&&A&&_,N=!y&&T&&(C||x&&!w),P=x&&w&&ip().createElement(RF,{items:g,selectedItems:p,onClearAll:()=>{d([])},onSelectAll:()=>{d((0,O.pluck)("id",g))}}),D=ip().createElement(PF,{onDelete:I?()=>{R().forEach((e=>{b(e)})),p.length&&d([])}:void 0,onDownload:A?()=>{const e=x?(0,O.pipe)((0,O.filter)((({id:e})=>p.includes(e))),(0,O.pluck)("downloadURL"))(g):[g.find((0,O.propEq)("id",n)).downloadURL];o(e)}:void 0,onShare:C?()=>{h(n)}:void 0,onUpload:N?c:void 0});return ip().createElement(xF,{mode:m,open:t,onChangeMode:f,header:{left:P,right:D},onClose:r},x&&ip().createElement(wF,{items:g,selectedItems:p,onSelectImage:e=>{d((t=>[...t,e]))},onDeselectImage:e=>{d((t=>t.filter((t=>t!==e))))},onShareLink:h,onSetAsDefault:E,onDownload:e=>{o([g.find((0,O.propEq)("id",e)).downloadURL])},onClickImage:e=>{a(e),f(dF.Details)},onDelete:y?void 0:b}),C&&ip().createElement(pF,{handleSetAsDefault:E,setCurrentAttributeValueUri:a,currentAttributeValueUri:n,attributeValues:e,attributeType:i}))},kF=(0,Sp.Z)((e=>({imageBox:{position:"relative",display:"flex",width:"100%",flexGrow:1,flexShrink:0,flexWrap:"nowrap",marginTop:"2px",overflow:"hidden"},moreButtonContainer:({imageWidth:e,imageHeight:t})=>({backgroundColor:"white",width:e,height:t,position:"absolute",right:0,cursor:"pointer"}),moreButton:({imageWidth:t,imageHeight:r})=>({display:"flex",justifyContent:"center",alignItems:"center",width:t,height:r,backgroundColor:(0,xm.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 LF(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const UF=({attributeType:e,attributeValues:t=[],renderImage:r,overlay:n=!1,countFixedItems:a=0,children:i,onUpload:o,onDeleteAttribute:l,imageSize:s=mk,paging:c,parentUri:u,showNonOv:p,requestNextPageOfAttributeValues:d})=>{const m=kF(s);(0,ap.useEffect)((()=>{if(c&&d){const r=p?c.totalOvValues:c.totalValues;r>t.length&&d({parentUri:u,attributeTypeUri:e.uri,attributeTypeName:e.name,values:[],defaultMaxValues:r})}}),[c,d,e,u,t.length,p]);const f=(0,ap.useRef)(),[y,g]=(0,ap.useState)(0),[h,E]=(0,ap.useState)(0),b=(0,ap.useContext)(LI),[T,O]=(0,ap.useState)(!1),[S,x]=(0,ap.useState)(),C=(0,Uf.ax)("setDefaultProfilePicForEntity"),w=(0,Uf.ax)("setDefaultProfilePicForModifiedEntity"),A=(0,Uf.eh)()||{},R=(0,Uf.xH)(),_=(0,ap.useCallback)((e=>{const{imageMargin:r,imageWidth:n}=s,i=Math.floor((e+r)/(n+r))-a,o=e+r-(i+a)*(n+r)<8;g(i),t.length>i?E(t.length-i+(o?1:0)):E(0)}),[t.length,a,s]),I=(0,ap.useCallback)((e=>{_(e),f.current=e}),[_]);(0,ap.useEffect)((()=>{f.current&&_(f.current)}),[t.length,_]);const N=(0,ap.useCallback)((e=>{b||(x(e),O(!0))}),[b]),P=(0,ap.useCallback)((()=>{O(!1)}),[]),D=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),k=e=>navigator.clipboard.writeText(e),L=(0,ap.useCallback)((e=>{R?(0,v.insertDefaultImageByAttrUri)(A.uri,e.uri).then((({status:t})=>{"success"===t&&C(e)})):w({entityUri:A.uri,value:e})}),[R,A.uri,C,w]),U=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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){LF(e,t,r[t])}))}return e}({onOpenImageGalleryDialog:N},n&&{onDownload:D,onShareLink:k,onSetAsDefault:L});return ip().createElement(ip().Fragment,null,ip().createElement(Up.ZP,{handleWidth:!0,onResize:I}),ip().createElement(DF,{attributeValues:t,open:T,onClose:P,setCurrentAttributeValueUri:x,currentAttributeValueUri:S,attributeType:e,onDownload:D,onShareLink:k,onSetAsDefault:L,onUpload:o,onDeleteAttribute:l}),ip().createElement("div",{className:m.imageBox},i,t.slice(0,y).map(r(U)),h>0&&ip().createElement("div",{className:m.moreButtonContainer},ip().createElement("div",{className:m.moreButton,onClick:()=>N()},ip().createElement(hf(),{className:m.number},`+${h}`)))))},jF=(0,Sp.Z)((e=>({image:({imageMargin:e,imageHeight:t,imageWidth:r})=>({marginRight:e,width:r,height:t,cursor:"pointer","&:last-child":{marginRight:0}}),deleteAttributeImage:{position:"relative","&:before":{content:"''",position:"absolute",left:0,top:0,right:0,bottom:0,background:`url('${(0,v.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:v.historyPalettes[v.HistoryOperations.deleteAttribute].backgroundColor,pointerEvents:"none"}},updateAttributeImage:{position:"relative","&:before":{content:"''",position:"absolute",left:0,top:0,right:0,bottom:0,backgroundColor:v.historyPalettes[v.HistoryOperations.updateAttribute].backgroundColor,pointerEvents:"none"}},deleteAttribute:({imageWidth:e,imageHeight:t})=>({width:e,height:t,boxSizing:"border-box",outline:`3px solid ${v.historyPalettes[v.HistoryOperations.deleteAttribute].color}`,outlineOffset:"-3px"}),insertAttribute:({imageWidth:e,imageHeight:t})=>({width:e,height:t,boxSizing:"border-box",outline:`3px solid ${v.historyPalettes[v.HistoryOperations.insertAttribute].color}`,outlineOffset:"-3px"}),updateAttribute:({imageWidth:e,imageHeight:t})=>({width:e,height:t,boxSizing:"border-box",outline:`3px solid ${v.historyPalettes[v.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"}}))),FF=({attributeType:e,attributeValues:t=[],paging:r,parentUri:n,requestNextPageOfAttributeValues:a,showNonOv:i,imageSize:o=mk})=>{const l=jF(o),{appearance:s}=(0,ap.useContext)(vP);return ip().createElement(UF,{attributeValues:t,attributeType:e,renderImage:({onOpenImageGalleryDialog:e})=>t=>{const r=(0,v.getImageAttributeOvThumbnailUrl)(t),{uri:n}=t,a=(0,v.getHistoryAppearanceByUri)(n,s),i=(0,v.getHistoryAttributeClassName)(a);return ip().createElement("div",{className:up()(l.image,{[l[i+"Image"]]:i}),key:n,"data-reltio-id":"reltio-attribute-value"},ip().createElement(dk,{onClick:()=>e(n),className:l[i],src:r,size:{imageWidth:o.imageWidth,imageHeight:o.imageHeight}}))},imageSize:o,requestNextPageOfAttributeValues:a,paging:r,parentUri:n,showNonOv:i})},MF=({attributeType:e,attributeValues:t,paging:r,parentUri:n,showNonOv:a,requestNextPageOfAttributeValues:i})=>{const o=PD(),{label:l,description:s}=e;return ip().createElement(ip().Fragment,null,ip().createElement("div",{className:o.titleRow},ip().createElement(lP,{className:o.title,label:l,"data-reltio-id":"reltio-attribute-label"}),ip().createElement(gP,{className:o.descriptionIcon,description:s})),ip().createElement(FF,{attributeValues:t,attributeType:e,paging:r,parentUri:n,requestNextPageOfAttributeValues:i,showNonOv:a}))},VF=({attributeType:e,classes:t})=>{const r=DD(),{label:n,description:a}=e;return ip().createElement("div",{"data-reltio-id":"reltio-empty-renderer",className:up()(r.titleRow,r.wrapper)},ip().createElement(lP,{label:n,className:up()(r.title,null==t?void 0:t.title),"data-reltio-id":"reltio-attribute-label"}),ip().createElement(gP,{description:a,className:r.descriptionIcon}))};function BF(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){zF(e,t,r[t])}))}return e}function zF(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const HF="oneLine",YF="multiLine",WF="imageLine",GF="special",qF="empty",ZF=({values:e,attributeType:t,drawLines:r,paging:n={},parentUri:a,max:i,showNonOv:o,classes:l})=>{const s=ID(),c=(0,Uf.ax)("requestNextPageOfAttributeValues"),u=(0,Uf.vd)(),p=i??u??1/0,d=(0,O.partition)(v.isOv),m=(0,ap.useContext)(NL),f=(0,ap.useMemo)((()=>null==m?void 0:m.includes(t.uri)),[t.uri,m]);if(!e||!e.length&&!f)return null;const[y,g]=d(e),h=o?e:y,E=o?[]:g,b=o?"totalValues":"totalOvValues",T=(0,O.ifElse)((0,O.has)(b),(0,O.prop)(b),(0,O.always)(h.length))(n),S=null!=n&&n.totalValues?n.totalValues-T:E.length,x=1===T&&!(0,v.isComplexAttribute)(t),C=0===e.length&&f;return ip().createElement($I,{enabled:r,className:up()(BF({[s.paddingWrapperWithLines]:r},null!=l&&l.wrapperWithLines?{[null==l?void 0:l.wrapperWithLines]:r}:{}))},ip().createElement("div",{className:up()(BF({[s.paddingWrapper]:!r},null!=l&&l.wrapper?{[null==l?void 0:l.wrapper]:!r}:{}))},(()=>{switch((0,O.cond)([[v.isSpecialAttribute,(0,O.always)(GF)],[v.isImage,(0,O.always)(WF)],[(0,O.always)(x),(0,O.always)(HF)],[(0,O.always)(C),(0,O.always)(qF)],[O.T,(0,O.always)(YF)]])(t)){case HF:return ip().createElement(kD,{value:h[0],nonVisibleValues:E,totalNonVisibleValues:S,attributeType:t,showNonOv:o,classes:l});case YF:return ip().createElement(HD,{values:h,nonVisibleValues:E,totalVisibleValues:T,totalNonVisibleValues:S,attributeType:t,parentUri:a,max:p,requestNextPageOfAttributeValues:c,showNonOv:o,classes:l});case WF:return ip().createElement(MF,{attributeValues:h,attributeType:t,paging:n,parentUri:a,requestNextPageOfAttributeValues:c,showNonOv:o});case GF:return ip().createElement(nk,{values:h,attributeType:t,classes:l});case qF:return ip().createElement(VF,{attributeType:t,classes:l})}})()))},$F=(0,ap.memo)(ZF),KF=({attrTypes:e=[],entity:t,parentUri:r,drawLines:n,children:a,className:i,max:o,fixedTypeUris:l=AL,showNonOv:s,classes:c})=>{const u=(0,ap.useContext)(IL),p=(0,ap.useContext)(NL),d=r&&(0,v.getBaseUri)(r),m=(0,ap.useMemo)((()=>u[d]||[]),[u,d]),f=(0,ap.useMemo)((()=>(e||[]).filter((e=>!m.includes(e.uri)))),[e,m]),[y,g]=(0,ap.useState)(o||1/0),h=(0,ap.useMemo)((()=>(0,v.getAttributesListForReadMode)(f,t,s,p)),[f,t,s,p]),[E,b]=(0,ap.useMemo)((()=>iL(l,h)),[h,l]),T=b.slice(0,y),S=o&&T.length<b.length,x=o&&T.length>=b.length&&o<T.length,C={enabled:n};return ip().createElement("div",{className:i},a&&ip().createElement($I,C,a),T.concat(E).map((({attrType:e,values:a})=>ip().createElement($F,{key:e.uri,attributeType:e,drawLines:n,values:a,paging:(0,O.path)(["paging",e.uri],t.attributes),parentUri:r,showNonOv:s,classes:c}))),S&&ip().createElement(FD,{onClick:()=>{g(1/0)}}),x&&ip().createElement(zD,{onClick:()=>{g(o)}}))};KF.displayName="ReadOnlyAttributesList";const XF=(0,ap.memo)(KF),QF=(0,Sp.Z)({attributesContainer:{padding:"8px 16px"},noCaption:{paddingTop:"16px"},noData:{fontSize:"13px",color:"rgba(0,0,0,0.54)"}}),JF=({className:e,entity:t={},caption:r="",excludeUris:n=[],includeUris:a=[],attributesCount:i})=>{const o=QF(),l=(0,Uf.AH)(),s=(0,Uf.xK)(),c=(0,ap.useMemo)((()=>aL(l,t.type,a,n)),[n,a,l,t]),u=i||16,p=(0,v.getAttributesListForReadMode)(c,t).filter((({values:e})=>!(0,v.isEmptyValue)(e))).length>0;return p||!(0,v.isEmptyValue)(r)?ip().createElement(FI.Provider,{value:s},ip().createElement(WI,{className:e},r&&ip().createElement(GI.I,{title:r}),ip().createElement(jI(),{className:up()(o.attributesContainer,{[o.noCaption]:!r})},p?ip().createElement(XF,{entity:t,attrTypes:c,parentUri:t.uri,drawLines:!1,max:u}):ip().createElement(hf(),{className:o.noData},ei().text("No data found"))))):null},eM=(0,Sp.Z)({attributesContainer:{overflow:"hidden",padding:"8px 16px"},noCaption:{paddingTop:"16px"}}),tM=({className:e,mode:t,entity:r,caption:n="",excludeUris:a=[],includeUris:i=[],pinnedAttributes:o})=>{const l=eM(),s=(0,Uf.ax)("addAttributes"),c=(0,Uf.ax)("modifyAttribute"),u=(0,Uf.ax)("removeAttribute"),p=(0,Uf.AH)(),d=(0,Uf.R2)(),m=(0,Uf.vc)(r.uri)||{},f=(0,ap.useMemo)((()=>(0,v.getPinnedAttributesForUser)(o,d)),[o,d]),y=(0,ap.useMemo)((()=>aL(p,m.type,i,a)),[a,i,p,m.type]);return ip().createElement(WI,{className:e},n&&ip().createElement(GI.I,{title:n}),ip().createElement(jI(),{className:up()(l.attributesContainer,{[l.noCaption]:!n})},ip().createElement(RL.Provider,{value:f},ip().createElement(kL,{entity:m,attrTypes:y,parentUri:m.uri,drawLines:!1,mode:t,showEmptyEditors:(0,v.isTempUri)(m.uri),crosswalks:m.crosswalks,onAddAttributes:s,onChangeAttribute:c,onDeleteAttribute:u}))))};function rM(){return rM=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},rM.apply(null,arguments)}const nM=e=>{let{attributesCount:t,pinnedAttributes:r,alwaysVisible:n=[]}=e,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributesCount","pinnedAttributes","alwaysVisible"]);const i=(0,Uf.Fr)(),o=(0,Uf.YA)(),l=a.entity||i,s=a.mode||o;return ip().createElement(sP.Provider,{value:l},ip().createElement(NL.Provider,{value:n},(0,v.isViewMode)(s)?ip().createElement(JF,rM({},a,{attributesCount:t,entity:l})):ip().createElement(tM,rM({},a,{mode:s,pinnedAttributes:r,entity:l}))))},aM=(0,Sp.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)"}}))),iM=()=>{const e=aM(),t=(0,sp.useSelector)(Ws),r=(0,sp.useSelector)(Hs);return ip().createElement(ip().Fragment,null,r&&ip().createElement(wE.z,null),t?ip().createElement("div",{className:e.container},ip().createElement(kI,{entity:t,classes:{profileBand:e.profileBand}}),ip().createElement("div",{className:e.scrollWrapper},ip().createElement(LI.Provider,{value:!0},ip().createElement(nM,{className:e.attributesView,entity:t,mode:v.Mode.Viewing})))):ip().createElement("div",{className:e.emptyState},ip().createElement(CE,{LogoRenderer:xE.NO_DATA,text:ei().text("No data to display."),secondaryText:ei().text("Select a profile and view preview details here."),variant:SE.embedded})))},oM="circle",lM="polygon",sM={fillColor:"rgb(242,82,82)",fillOpacity:.1,strokeWeight:2,strokeColor:"#F25252",clickable:!1,editable:!0,zIndex:1},cM={mapTypeControl:!1,streetViewControl:!1,fullscreenControl:!1},uM=.001,pM=ip().createContext({});pM.displayName="EntityMarkerContext";var dM=r(17871);const mM=(0,Sp.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"}}}}))),fM=({entity:e,classes:t={}})=>{const r=mM(),{secondaryLabel:n,label:a}=t,i=(0,v.getLabel)(e.label),{secondaryLabel:o}=e,l=(0,ap.useCallback)((()=>{navigator.clipboard.writeText((0,v.getEntityId)(e))}),[e]);return ip().createElement(ip().Fragment,null,ip().createElement(b.A,{entity:e,imageClassName:r.image}),ip().createElement("div",{className:r.info},ip().createElement(Ld.x,{value:(0,v.getEntityUriForLink)(e),className:r.link},ip().createElement(ad.Y,{value:i,placement:"top",showOnExceededHeight:!0},ip().createElement("div",{className:up()(r.label,a)},i))),o&&ip().createElement(ad.Y,{value:o,placement:"top",showOnExceededHeight:!0},ip().createElement("div",{className:up()(r.secondaryLabel,n)},o)),ip().createElement("div",{className:r.thirdRow},ip().createElement(cE,{entity:e,size:"medium"}),ip().createElement("div",{className:r.entityId,onClick:l},ip().createElement("div",{className:r.entityIdLabel},ei().text("ID:")),ip().createElement(ad.Y,{value:`Copy to clipboard ${(0,v.getEntityId)(e)}`,placement:"top"},ip().createElement("div",{className:r.entityIdValue},(0,v.getEntityId)(e)))))))},yM=(0,Sp.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)"}}),gM=()=>{const e=yM();return ip().createElement(ip().Fragment,null,ip().createElement("div",{className:up()(e.avatar,e.wave)}),ip().createElement("div",{className:e.info},ip().createElement("div",{className:up()(e.label,e.wave)}),ip().createElement("div",{className:up()(e.secondaryLabel,e.wave)}),ip().createElement("div",{className:up()(e.thirdRow,e.wave)})))},hM=(0,Sp.Z)({container:{display:"flex",padding:"16px",overflow:"hidden"}});function EM(){return EM=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},EM.apply(null,arguments)}const bM=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["entity","classes","variant"]);const i=hM(),{container:o}=r;return ip().createElement("div",EM({className:up()(i.container,o)},a),"normal"===n?ip().createElement(fM,{entity:t,classes:r}):ip().createElement(gM,null))},vM=(0,ap.memo)(bM),TM=(0,Sp.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 OM(){return OM=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},OM.apply(null,arguments)}const SM=(0,v.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>'),xM=(0,v.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>'),CM=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["marker","onClick"]);const a=TM(),i=(0,ap.useRef)(),[o,l]=(0,ap.useState)(!1),{activeEntityUri:s}=(0,ap.useContext)(pM),c=(0,O.pathEq)(["entity","uri"],s,t),u={lat:t.point.lat,lng:t.point.lng},p=(0,ap.useCallback)((0,v.debounce)(l,50),[]),d=(0,ap.useCallback)((()=>p(!0)),[p]),m=(0,ap.useCallback)((()=>p(!1)),[p]),f=(0,ap.useCallback)((()=>r(t)),[r,t]);return ip().createElement(ip().Fragment,null,ip().createElement(dN.r,{anchorEl:i.current,open:o,className:a.popper,modal:!1,placement:"top"},ip().createElement(vM,{entity:t.entity,onMouseOver:d,onMouseOut:m})),ip().createElement(dM.Jx,OM({icon:{url:o||c?SM:xM,scaledSize:new google.maps.Size(22,32)},position:u,onClick:f,visible:!1!==t.visible,onMouseOver:d,onMouseOut:m},n)),ip().createElement(dM.vD,{options:{alignBottom:!0,pane:"mapPane",pixelOffset:new google.maps.Size(0,-40),closeBoxURL:"",enableEventPropagation:!0,disableAutoPan:!0},position:u},ip().createElement("span",{ref:i})))},wM=(0,ap.memo)(CM);var AM=r(47111);const RM=({children:e,className:t,position:r,map:n})=>{const[a,i]=(0,ap.useState)(null);return(0,ap.useEffect)((()=>{const e=document.createElement("div"),t=n.controls[r].length;return n.controls[r].push(e),i(e),()=>{n.controls[r].removeAt(t)}}),[n,r]),(0,ap.useEffect)((()=>{a&&t&&a.classList.add(t)}),[t,a]),a?(0,AM.createPortal)(e,a):null};var _M=r(518),IM=r.n(_M);function NM(){return NM=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},NM.apply(null,arguments)}const PM=e=>ip().createElement("svg",NM({width:18,height:18,viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgRadius"},e),ip().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 DM(){return DM=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},DM.apply(null,arguments)}const kM=e=>ip().createElement("svg",DM({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),ip().createElement("defs",null,ip().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"})),ip().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},ip().createElement("mask",{id:"Draw_svg__b",fill:"#fff"},ip().createElement("use",{xlinkHref:"#Draw_svg__a"})),ip().createElement("g",{mask:"url(#Draw_svg__b)",fill:"#000",fillOpacity:.54},ip().createElement("path",{d:"M0 0h24v24H0z"})))),LM=(0,Sp.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"}}),UM=(0,id.T)(Gh()),jM=({drawingMode:e,drawingModes:t=[],hasActiveOverlay:r,onDrawingModeChanged:n,onClearOverlay:a})=>{const i=LM(),o=e=>()=>{n(e)};return ip().createElement("div",{className:i.container},e||r?ip().createElement(UM,{tooltipTitle:ei().text("Clear area"),className:i.button,onClick:r?a:o(null)},ip().createElement(IM(),{className:i.icon})):t.map((e=>{const t=(e=>{switch(e){case oM:return PM;case lM:return kM;default:return null}})(e);return ip().createElement(UM,{tooltipTitle:ei().text("Draw area"),key:e,className:i.button,onClick:o(e)},ip().createElement(t,{className:i.icon}))})))},FM=(0,Sp.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"}}}),MM=({isSearchOnMapMove:e,onChangeIsSearchOnMapMove:t})=>{const r=FM();return ip().createElement(vh(),{classes:{root:r.container,label:r.label},control:ip().createElement(Hp(),{checked:e,onChange:e=>{t(e.target.checked)},className:r.checkbox}),label:ei().text("Search as I move the map")})},VM=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]]},BM=e=>{switch(e){case oM:return window.google.maps.drawing.OverlayType.CIRCLE;case lM:return window.google.maps.drawing.OverlayType.POLYGON;default:return null}},zM=(e,t,r)=>{if(t.path){const n=r||new window.google.maps.LatLngBounds;t.path.forEach((({lat:e,lng:t})=>n.extend(new window.google.maps.LatLng(e,t)))),e.fitBounds(n)}},HM=(0,Sp.Z)({mapControlContainer:{borderRadius:"2px",backgroundColor:"#FFFFFF",boxShadow:"0 1px 3px 0 rgba(0,0,0,0.15)",margin:"10px"}});function YM(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){WM(e,t,r[t])}))}return e}function WM(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const GM=["drawing"],qM=({markers:e=[],mapKey:t,defaultZoom:r,defaultCenter:n,loadingElement:a,isSearchOnMapMove:i,isSearchEnabled:o,activeOverlay:l,overlayOptions:s={},drawingModes:c=[],markerClusterer:u,markerClustererOptions:p,mapOptions:d={},mapContainerClassName:m,onMapBoundsChanged:f=O.identity,onOverlayUpdated:y=O.identity,onMarkerClicked:g=O.identity})=>{const h=HM(),{isLoaded:E,loadError:b}=(0,dM.Ji)({googleMapsApiKey:t,libraries:GM}),v=(0,ap.useRef)(null),[T,S]=(0,ap.useState)(null),[x,C]=(0,ap.useState)(null),[w,A]=(0,ap.useState)(null);(({markers:e,activeOverlay:t,isSearchOnMapMove:r,map:n})=>{const a=Boolean(n&&window.google),i=(0,Ay.D)(e),o=(0,Ay.D)(t),l=(0,Ay.D)(a);(0,ap.useEffect)((()=>{const s=i!==e,c=l!==a,u=a&&t&&(o!==t||c);a&&!r&&e.length&&(s||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+uM,t.lng+uM)),n.extend(new window.google.maps.LatLng(t.lat-uM,t.lng-uM))}t.fitBounds(n),r&&zM(t,r,n)})(e,n,t):u&&zM(n,t)}),[a,e,t])})({markers:e,activeOverlay:l,map:T,isSearchOnMapMove:i});const R=(0,ap.useMemo)((()=>YM({},sM,s)),[s]),_=(0,ap.useMemo)((()=>YM({},cM,d)),[d]),I=(0,ap.useCallback)((e=>{f(e?VM(T):null),A(null),clearTimeout(v.current)}),[T,f]),N=(0,ap.useCallback)((()=>{clearTimeout(v.current)}),[]),P=(0,ap.useCallback)((()=>{i&&f(VM(T))}),[i,T,f]),D=(0,ap.useCallback)((()=>{i&&(clearTimeout(v.current),v.current=setTimeout(P,1e3))}),[P,i]),k=(0,ap.useCallback)(((e,t)=>{var r;const n=t||x&&{type:lM,overlay:x};if((0,O.isEmpty)(n))return;const{overlay:a,type:i}=n,o={[lM]:()=>a.getPath().getArray().map((e=>[e.lat(),e.lng()])),[oM]:()=>({radius:a.getRadius()/1e3,center:a.getCenter()})},l=null===(r=o[i])||void 0===r?void 0:r.call(o);l&&y({data:l,type:i})}),[y,x]),L=(0,ap.useCallback)((e=>t=>{k(null,{type:e,overlay:t}),t.setMap(null),A(null)}),[k]),U=(0,ap.useCallback)((()=>{y(null)}),[y]),j=t=>e.filter((0,O.prop)("point")).map((e=>ip().createElement(wM,{key:e.id,marker:e,clusterer:t,onClick:g})));if(b)return null;if(!E)return a;const F=o&&Boolean(c.length),M=T&&o&&Boolean(c.length),V=T&&o,B=!BM(w)&&l&&(0,O.propEq)("type",lM,l);return ip().createElement(dM.b6,{mapTypeId:window.google.maps.MapTypeId.ROADMAP,options:_,onLoad:S,zoom:r,center:n,onZoomChanged:N,onDragStart:N,onIdle:D,mapContainerClassName:m},M&&ip().createElement(RM,{className:h.mapControlContainer,position:window.google.maps.ControlPosition.TOP_RIGHT,map:T},ip().createElement(jM,{hasActiveOverlay:!!l,drawingModes:c,drawingMode:w,onDrawingModeChanged:A,onClearOverlay:U})),V&&ip().createElement(RM,{className:h.mapControlContainer,position:window.google.maps.ControlPosition.TOP_CENTER,map:T},ip().createElement(MM,{onChangeIsSearchOnMapMove:I,isSearchOnMapMove:i})),u?(z=p,ip().createElement(dM.XL,{options:z},j)):j(),B&&ip().createElement(dM.mg,{onLoad:C,path:l.path,editable:!0,options:R,onMouseUp:k,onDragEnd:k}),F&&ip().createElement(dM.j_,{onPolygonComplete:L(lM),onCircleComplete:L(oM),drawingMode:BM(w),options:{drawingControl:!1,circleOptions:R,polygonOptions:R}}));var z},ZM=(e,t)=>Math.abs(e-t)<1,$M=(0,O.curry)(((e,t,r)=>{const n=t.map((({position:t})=>{const r=e.find((({point:e})=>ZM(t.lat(),e.lat)&&ZM(t.lng(),e.lng)));return(0,O.propOr)("","label",r)})),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}})),KM=e=>{let t=e.label||e.value||"";return Array.isArray(t)?t=t.join(", "):(0,O.is)(Object,t)&&(t=""),t},XM=(e,t)=>Object.values(e).filter(Array.isArray).flat(1/0).filter(v.isOv).flatMap((e=>{let r;return e.type==t&&(r=[KM(e)]),(0,O.is)(Object,e.value)&&(r=(r||[]).concat(XM(e.value,t))),r})),QM=(0,O.pipe)((0,O.path)(["point","lat"]),(0,O.both)((0,O.gt)(90),(0,O.lt)(-90))),JM=e=>e&&e.length>0,eV=(e,t)=>[].concat(null!=e&&e.attributes?XM(e.attributes,t):[]).filter(O.identity),tV=(e,t,r)=>{if((0,v.hasMaskingByUris)(e,[r.latitude,r.longitude]))return null;const n=eV(t,r.latitude),a=eV(t,r.longitude);return JM(n)&&JM(a)?(0,O.zipWith)(((e,t)=>({lat:Number(e),lng:Number(t)})),n,a):null};function rV(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const nV=async(e,t,r=[])=>{const n=((e,t)=>{const r={};return(0,O.flatten)(t.map((t=>{return"configuration/entityTypes/Location"===t.type?{id:t.uri,label:t.label,entity:t,pointSource:t.attributes}:(r[t.type]=r[t.type]||((null===(n=(0,v.getEntityType)(e,t.type))||void 0===n?void 0:n.attributes)||[]).filter((e=>"configuration/entityTypes/Location"===e.referencedEntityTypeURI)).map((({name:e})=>e)),r[t.type].map((e=>[e,t.attributes[e]])).filter((([,e])=>e)).flatMap((([e,r])=>r.map((r=>({id:r.uri,label:r.label,entity:t,pointSource:r.value,refAttribute:r,name:e}))))));var n})))})(t,r),a=await Promise.all(n.map((({id:r,label:n,entity:a,pointSource:i,refAttribute:o,name:l})=>(async(e,t,r,n,a,i)=>{if(t&&t.type){const e=(0,v.getEntityType)(n,t.type);a&&(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){rV(e,t,r[t])}))}return e}({},t,{attributes:{[i]:[a]}}));const r=(e.geoLocationAttributes||[]).map((e=>tV(n,t,e))).filter(O.identity);if(r.length>0)return Promise.resolve(r[0])}const o=r.GeoLocation;if(o){const e=o.map((e=>{const t=e.value.Latitude,r=e.value.Longitude;if(JM(t)&&t[0].value&&JM(r)&&r[0].value)return(0,v.hasMaskingByUris)(n,[t[0].type,r[0].type])?null:{id:e.uri,lat:Number(t[0].value),lng:Number(r[0].value)}})).filter(O.identity);if(e.length>0)return Promise.resolve(e)}if(a&&a.label)try{return(await(0,v.decodeAddress)({servicesPath:e,address:a.label})).location}catch{return null}return Promise.resolve(null)})(e,a,i,t,o,l).then((t=>!t&&a.label?(0,v.decodeAddress)({servicesPath:e,address:a.label}).then((e=>e.location)).catch((()=>null)):t)).then((e=>(0,v.wrapInArrayIfNeeded)(e).filter(O.identity).map((e=>({id:e.id||r,label:n,entity:a,point:e}))))).catch((()=>null)))));return a.flat(1/0).filter(O.identity)},aV=async({servicesPath:e,metadata:t,entities:r})=>{const n=((e,t=[])=>(0,O.pipe)((0,O.chain)((t=>{const r=(0,v.getEntityType)(e,t.type);return((null==r?void 0:r.geoLocationAttributes)||[]).flatMap((r=>{if((0,v.findAttributeTypeByUri)(e,r.latitude,t.type)&&(0,v.findAttributeTypeByUri)(e,r.longitude,t.type)){const n=tV(e,t,r);return null==n?void 0:n.map((({lat:e,lng:r})=>({id:`${t.uri}_nested_${e}_${r}`,entity:t,label:t.label,point:{lat:Number(e),lng:Number(r)}})))}}))})),(0,O.filter)(O.identity),(0,O.uniqBy)((0,O.prop)("id")))(t))(t,r),a=await nV(e,t,r);return[...n,...a.filter((e=>!n.some((t=>{return n=t,(r=e).entity===n.entity&&r.point.lat===n.point.lat&&r.point.lng===n.point.lng;var r,n}))))]},iV=[],oV={[v.MapSearch.geoPolygon]:lM,[v.MapSearch.geoLocation]:oM},lV=e=>e&&e.length?[...e,e[0]]:e,sV=e=>e[0].map((([e,t])=>({lat:e,lng:t}))).slice(0,-1),cV=(0,Sp.Z)((()=>({container:{height:"100%",width:"100%",position:"relative"},fullHeight:{height:"100%"}}))),uV=()=>{const e=cV(),t=(0,sp.useSelector)(Xa.Qr),r=(0,sp.useSelector)(Ti.AO),n=(0,sp.useSelector)(A().selectors.getGoogleMapKey),{markers:a,loading:i,onMarkerClicked:o}=(e=>{const t=(0,sp.useDispatch)(),{markers:r,loading:n}=(e=>{const[t,r]=(0,ap.useState)([]),[n,a]=(0,ap.useState)(!1),i=(0,Oh._)(),o=(0,Uf.AH)(),l=(0,Uf.au)();return(0,ap.useEffect)((()=>{a(!0),i(aV({metadata:o,servicesPath:l,entities:e})).then((e=>{r(e.filter(QM))})).catch((()=>{r([])})).finally((()=>{a(!1)}))}),[o,l,e,aV,i]),{markers:t,loading:n}})(e||iV),a=(0,ap.useRef)(null),i=(0,ap.useRef)(null),o=(0,ap.useCallback)((e=>{t({type:ue,payload:e||null})}),[t]),l=(0,ap.useCallback)((()=>{clearTimeout(i.current),clearTimeout(a.current)}),[]);return{markers:r,loading:n,onMarkerClicked:(0,ap.useCallback)((e=>{const t=(0,O.path)(["entity","uri"],e);l(),o(),a.current=setTimeout((()=>o(t)),0),i.current=setTimeout(o,3e3)}),[l,o])}})(t),{isSearchEnabled:l,activeOverlay:s,onOverlayUpdated:c,isSearchOnMapMove:u,onMapBoundsChanged:p}=(()=>{const e=(0,sp.useDispatch)(),t=(0,sp.useSelector)(Xa.Qy),r=(0,sp.useSelector)(Xa.bt),n=(0,sp.useSelector)(Ti.d7),[a,i]=(0,ap.useState)(!1),o=(0,ap.useCallback)((t=>{let r=null,n=null;if(t){const{data:e,type:a}=t;switch(a){case oM:{const{center:t,radius:a}=e;r=[t.lng(),t.lat(),a],n=v.MapSearch.geoLocation;break}case lM:r=lV(e),n=v.MapSearch.geoPolygon}}i(!1),e(Ha(r,n))}),[e]),l=(0,ap.useCallback)((t=>{i(!!t),e(Ha(lV(t),t&&v.MapSearch.onMapMove))}),[e]),s=oV[r],c=(0,ap.useMemo)((()=>n&&s&&t.length?{path:s===lM?sV(t):null,type:s}:null),[n,t,s]);return(0,ap.useEffect)((()=>{(c||0===t.length)&&i(!1)}),[t,c]),{isSearchEnabled:n,onOverlayUpdated:o,activeOverlay:c,isSearchOnMapMove:a,onMapBoundsChanged:l}})(),d=(0,ap.useMemo)((()=>ip().createElement("div",{className:e.fullHeight},ip().createElement(wE.z,null))),[e]),m=(0,ap.useMemo)((()=>({gridSize:60,maxZoom:9,calculator:$M(a)})),[a]),f=(0,ap.useMemo)((()=>({activeEntityUri:r})),[r]),y=(0,ap.useMemo)((()=>({lat:0,lng:0})),[]),g=(0,ap.useMemo)((()=>[lM]),[]);return n?ip().createElement("div",{className:e.container},i&&ip().createElement(wE.z,null),ip().createElement(pM.Provider,{value:f},ip().createElement(qM,{loadingElement:d,defaultZoom:1,defaultCenter:y,onOverlayUpdated:c,onMarkerClicked:o,activeOverlay:s,markers:a,fullscreenControl:!1,markerClusterer:!0,markerClustererOptions:m,drawingModes:g,isSearchOnMapMove:u,onMapBoundsChanged:p,isSearchEnabled:l,mapContainerClassName:e.fullHeight,mapKey:n}))):null},pV=(0,id.T)(Op.T),dV=e=>{switch(e){case B.om.PROFILE:return ei().text("Hide entity details");case B.om.MAP:return ei().text("Hide map")}},mV=()=>{const e=PI(),t=(0,sp.useDispatch)(),r=(0,sp.useSelector)(Ti.qx),n=r===B.om.MAP,a=(0,sp.useSelector)(A().selectors.getGoogleMapKey),i=(0,ap.useCallback)((()=>t(Ei(null))),[t]);return(0,ap.useEffect)((()=>{!a&&n&&i()}),[a,n,i]),ip().createElement("div",{className:e.container},ip().createElement(pV,{tooltipTitle:dV(r),tooltipPlacement:"bottom-start",size:"L",icon:NI(),className:e.closeButton,onClick:i}),(e=>{switch(e){case B.om.PROFILE:return ip().createElement(iM,null);case B.om.MAP:return ip().createElement(uV,null)}})(r))},fV=({className:e,loading:t,entities:r,entityTypeTab:n,quantity:a,rowsPerPage:i,page:o,entityToHighlight:l,selectedEntityUri:s,mode:c,previewPanelMode:u,isPreviewPanelOpen:p,dispatch:d})=>{const m=RE(),f=(0,ap.useRef)(),[y,g]=(0,ap.useState)("50%"),h=(0,vi.gj)(c),E=u===B.om.PROFILE,b=u===B.om.MAP,[T,S]=(0,ap.useState)({}),x=(0,ap.useCallback)(((e,t)=>{S((0,O.assoc)(e,t))}),[]);(0,ap.useEffect)((()=>{f.current&&(f.current.scrollTop=0)}),[r]),(0,ap.useEffect)((()=>{E&&((0,v.isEmptyValue)(r)?d(qs(null)):!(0,O.prop)(0,r)||s&&r.map((0,O.prop)("uri")).includes(s)||d(qs(r[0].uri)))}),[d,E,s,r]),(0,ap.useEffect)((()=>{!E&&s&&d(Zs(null))}),[d,s,E]);const C=(0,ap.useCallback)((e=>d(((e,t=0,r)=>({type:_.Z.CHANGE_PAGE,payload:{pageNumber:e,debounceTime:t,entityTypeUri:r}}))(e,250,n))),[d,n]),w=(0,ap.useCallback)((e=>d(((e,t)=>({type:_.Z.CHANGE_ROWS_PER_PAGE,payload:{number:e,entityTypeUri:t}}))(e,n))),[d,n]),A=(0,ap.useCallback)((e=>d(qs(e))),[d]),R=(0,ap.useCallback)((0,v.debounce)((e=>d({type:pe,payload:e})),50),[d]),I=(0,ap.useCallback)((({percentageSize:e})=>g(e)),[]),N=e=>{const t=(0,O.prop)(e.uri,T);return ip().createElement(vm,{entity:e,entityImportStatus:t,onEntityImportStatusChange:x})},P=(0,ap.useRef)(null);return ip().createElement("div",{className:up()(m.container,e)},t&&ip().createElement(wE.z,null),(0,vi.gj)(c)?ip().createElement(CI,{quantity:a}):ip().createElement(fI,null),ip().createElement(lE,{className:m.resizablePanesWrapper,orientation:"vertical",size:p?y:"100%",minSize:480,maxSize:-480,allowResize:p,onChange:I},ip().createElement("div",{className:m.pane},ip().createElement(AE,{error:ip().createElement(CE,{LogoRenderer:xE.ERROR,text:ei().text("Something went wrong."),variant:SE.embedded})},(()=>{const e=l||null;return a?ip().createElement("div",{className:h?m.tableContainer:m.listContainer,ref:f},h?ip().createElement(_I,{entities:r,entityToHighlight:e,selectedEntityUri:s,entityTypeUri:n,onEntityClick:E?A:void 0,onEntityHover:b?R:void 0,entitiesImportStatus:T,onEntityImportStatusChange:x,basicTableRef:P}):ip().createElement(yE,{entities:r,entityToHighlight:e,selectedEntityUri:s,onEntityClick:E?A:void 0,onEntityHover:b?R:void 0,entitiesImportStatus:T,entityButtonsRenderer:N}),a>B.Tu[0]&&ip().createElement("div",{className:m.pagination},ip().createElement(gE.Z,{count:a,rowsPerPageOptions:B.Tu,rowsPerPage:i||B.Tu[0],page:o||0,onChangePage:C,onChangeRowsPerPage:w,basicTableRef:P}))):ip().createElement(CE,{LogoRenderer:xE.SEARCH_RESULTS,text:ei().text("No results found."),secondaryText:ei().text("Try adjusting your search or filter to find what you're looking for."),variant:SE.embedded})})())),ip().createElement("div",{className:m.pane},ip().createElement(mV,null))))};fV.propTypes={page:lp().number,quantity:lp().number,rowsPerPage:lp().number,entities:lp().array,loading:lp().bool,dispatch:lp().func,entityToHighlight:lp().string,mode:lp().string,entityTypeTab:lp().string,className:lp().string,isPreviewPanelOpen:lp().bool,previewPanelMode:lp().oneOf(Object.values(B.om)),selectedEntityUri:lp().string},fV.defaultProps={quantity:0,entities:[]};const yV=(0,sp.connect)((e=>{const t=(0,Ti.tB)(e);return{quantity:(0,Xa.NU)(e,{entityTypeUri:t}),page:(0,Xa.fx)(e,{entityTypeUri:t}),rowsPerPage:(0,Xa.Uz)(e,{entityTypeUri:t}),entities:(0,Xa.BP)(e,{entityTypeUri:t}),loading:(0,Xa.gP)(e),entityToHighlight:(0,Ti.Dn)(e),mode:(0,Ti.XM)(e),entityTypeTab:t,previewPanelMode:(0,Ti.qx)(e),isPreviewPanelOpen:(0,Ti.jr)(e),selectedEntityUri:Ys(e)}}))(fV);var gV=r(4539),hV=r.n(gV),EV=r(4494);const bV=(0,Sp.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"}}),vV=e=>{const t=bV(),r=e.values&&e.values.join(", ");return ip().createElement(pg(),{label:ip().createElement("div",{className:t.labelContainer},e.title&&ip().createElement("div",{className:t.title},e.title,": "),e.values&&ip().createElement(ad.Y,{value:r},ip().createElement("div",{className:t.values},r))),onDelete:e.onDelete,variant:"outlined",deleteIcon:ip().createElement(mg(),{"data-reltio-id":"facet-bar-chip-delete"}),classes:{root:t.root,deleteIcon:t.deleteIcon,label:t.label}})};vV.propTypes={classes:lp().object,title:lp().string,values:lp().array,onDelete:lp().func};const TV=vV;class OV extends ap.PureComponent{constructor(...e){super(...e),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 ip().createElement(ap.Fragment,null,ip().createElement(Gh(),{"aria-describedby":a,color:"primary",variant:"contained",classes:{root:e.root,label:e.label},onClick:this.handleClick},ei().text(`+ ${t.length}`)),ip().createElement(dN.r,{id:a,open:n,onClose:this.handleClose,anchorEl:r,placement:"bottom-start"},ip().createElement(VI(),{elevation:2,classes:{root:e.popperContent}},this.props.items)))}}OV.propTypes={classes:lp().object,items:lp().array},OV.defaultProps={items:[]};const SV=Pf()((()=>({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"}})))(OV);var xV=r(74635),CV=r.n(xV),wV=r(60904),AV=r(34319),RV=r(96177),_V=r.n(RV);const IV=(0,Sp.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 NV(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){PV(e,t,r[t])}))}return e}function PV(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function DV(){return DV=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},DV.apply(null,arguments)}const kV=({isOpen:e,isAvailableUpdate:t,isChangedSavedSearch:r,currentSavedSearch:n,onClose:a,onSave:i,onUpdate:o})=>{const l=IV(),[s,c]=(0,ap.useState)(""),[u,p]=(0,ap.useState)(B.ib.private),d=t&&n&&s===n.name,m=d&&n.isPublic===(u===B.ib.public)&&!r,f=(0,ap.useCallback)((e=>{c(e.target.value)}),[]),y=(0,ap.useCallback)((e=>{p(e)}),[]),g=(0,ap.useCallback)((()=>d?o({share:u}):i({name:s,share:u})),[s,i,o,u,d]),h={InputProps:{classes:{input:up()(l.dialogInput,l.dialogFont)}},InputLabelProps:{classes:{root:l.dialogFont}}};return(0,ap.useEffect)((()=>{if(e){const e=t?n.name:"",r=t&&n.isPublic?B.ib.public:B.ib.private;c(e),p(r)}}),[e,t,n]),ip().createElement(Ij(),{onClose:a,open:e,PaperProps:{classes:{root:l.dialogRoot}}},ip().createElement(CV(),{classes:{root:l.dialogTitle}},ei().text("Save search")),ip().createElement(fF(),{classes:{root:l.dialogContentRoot}},ip().createElement(wV.H,DV({classes:{root:l.dialogField},label:ei().text("Name"),required:!0,variant:"filled",value:s,onInput:f,size:"small",autoFocus:!0},h)),ip().createElement(AV.k,{entries:B.m2,TextFieldProps:NV({classes:{root:l.dialogField},required:!0,label:ei().text("Share with"),variant:"filled",size:"small"},h),value:u,onChange:y})),ip().createElement(_V(),{classes:{root:l.dialogActions},disableSpacing:!0},ip().createElement(Gh(),{onClick:a},ei().text("Cancel")),ip().createElement(Gh(),{color:"primary",onClick:g,disabled:d?m:0===s.length},d?ei().text("Save"):ei().text("Save as"))))};kV.propTypes={isOpen:lp().bool,isAvailableUpdate:lp().bool,isChangedSavedSearch:lp().bool,currentSavedSearch:lp().object,onClose:lp().func.isRequired,onSave:lp().func.isRequired,onUpdate:lp().func.isRequired};const LV=(0,sp.connect)((e=>{const t=(0,co.LA)(e);return{isOpen:(0,Ti.jd)(e),isAvailableUpdate:!(0,O.isNil)(t)&&(0,co.Jv)(e),isChangedSavedSearch:(0,co.WH)(e),currentSavedSearch:t}}),{onClose:()=>ci(!1),onSave:e=>({type:Zt,payload:e}),onUpdate:e=>({type:Xt,payload:e})})(kV);var UV=r(11400);function jV(){return jV=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},jV.apply(null,arguments)}const FV=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return ip().createElement("svg",jV({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},r),ip().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"}))},MV=(0,Sp.Z)({button:{marginRight:"-4px"},dialogRoot:{minWidth:"600px",minHeight:"280px"},dialogContentRoot:{display:"flex",flexDirection:"column",gap:"20px"}}),VV=()=>{const e=MV(),t=(0,sp.useStore)(),[r,n]=(0,ap.useState)(!1),[a,i]=(0,ap.useState)(!1),o=(0,ap.useCallback)((()=>n(!1)),[]),l=(0,ap.useCallback)((()=>n(!0)),[]),s=(0,ap.useCallback)((async(e,r,n)=>{const a=t.getState(),l=(0,po.Z)(a),s=(0,co.Cc)(a,!0);i(!0);try{await(0,v.createSavedSearch)([{name:e,description:r,isPublic:n,query:s,uiState:l,type:v.SavedSearchType.SEGMENTATION}]),i(!1),o()}catch(e){(0,Qa.U)(e,{defaultMessage:ei().text("Something went wrong while saving of the segment")}),i(!1)}}),[t,o]);return ip().createElement(ip().Fragment,null,ip().createElement(gd.k,{icon:FV,size:"L",onClick:l,tooltipTitle:ei().text("Save as segment"),className:e.button}),ip().createElement(UV.L,{isOpen:r,isSaving:a,onClose:o,onSave:s}))};function BV(){return BV=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},BV.apply(null,arguments)}const zV=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return ip().createElement("svg",BV({xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},r),ip().createElement("g",null,ip().createElement("path",{fill:"none",d:"M0 0h24v24H0z"})),ip().createElement("g",null,ip().createElement("path",{fillOpacity:".54",d:"M5 20h14v-2H5v2zM19 9h-4V3H9v6H5l7 7 7-7z"})))};function HV(){return HV=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},HV.apply(null,arguments)}const YV=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return ip().createElement("svg",HV({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),ip().createElement("defs",null,ip().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"})),ip().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},ip().createElement("mask",{id:"svg1966704254b",fill:"#fff"},ip().createElement("use",{xlinkHref:"#svg1966704254a"})),ip().createElement("g",{mask:"url(#svg1966704254b)",fill:"#000",fillOpacity:".54"},ip().createElement("path",{d:"M0 0h24v24H0z"}))))};function WV(){return WV=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},WV.apply(null,arguments)}const GV=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return ip().createElement("svg",WV({xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},r),ip().createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),ip().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 qV(){return qV=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},qV.apply(null,arguments)}const ZV=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return ip().createElement("svg",qV({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),ip().createElement("defs",null,ip().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"})),ip().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},ip().createElement("mask",{id:"svg2486556319b",fill:"#fff"},ip().createElement("use",{xlinkHref:"#svg2486556319a"})),ip().createElement("g",{mask:"url(#svg2486556319b)",fill:"#000",fillOpacity:".54"},ip().createElement("path",{d:"M0 0h12v24H0z"}))))};var $V=r(69199),KV=r.n($V),XV=r(37290),QV=r.n(XV);const JV=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 eB(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){tB(e,t,r[t])}))}return e}function tB(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const rB=(0,Sp.Z)({title:{marginBottom:"-10px"},linkField:{margin:"10px 0"},linkInput:{textOverflow:"ellipsis",fontSize:"14px"}}),nB=({open:e,onClose:t=O.identity})=>{const r=rB(),n=(({enabled:e})=>{const[t,r]=(0,ap.useState)(""),n=(0,sp.useSelector)(po.Z),a=(0,sp.useSelector)(Xa.RO),i=(0,sp.useSelector)(A().selectors.getServicesPath),o=(0,sp.useSelector)(A().selectors.getUIPath);return(0,ap.useEffect)((()=>{e?(0,v.rawRequest)(`${i}/searchLink`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(eB({},n,{currentTenant:a}))}).then((0,O.pipe)((0,O.prop)("link"),(0,v.getSearchLink)(o),r)).catch(ti):r("")}),[e]),t})({enabled:e});return ip().createElement(Ij(),{open:e,onClose:t},ip().createElement(CV(),{className:r.title},ei().text("Share link with search results")),ip().createElement(fF(),null,ip().createElement(KV(),null,ei().text("With the URL link, anyone can view these search results. Paste this link in email or IM for testing, analyze, sharing and more.")),ip().createElement(QV(),{className:r.linkField,InputProps:{classes:{input:r.linkInput}},label:n?"URL":"",placeholder:ei().text("Loading URL..."),value:n,variant:"filled",fullWidth:!0,size:"small"})),ip().createElement(_V(),null,ip().createElement(Gh(),{onClick:t},ei().text("Cancel")),ip().createElement(Gh(),{disabled:!n,onClick:(0,O.pipe)((()=>JV(n)),t),color:"primary",autoFocus:!0},ei().text("Copy link"))))};nB.propTypes={open:lp().bool,onClose:lp().func};const aB=nB,iB=(0,Sp.Z)((()=>({button:{marginRight:"-4px"},exportButtonDisabled:{opacity:"0.54"}}))),oB=({customActions:e=[]})=>{const t=iB(),r=(0,sp.useDispatch)(),n=(0,sp.useSelector)(A().selectors.getUIConfig),a=(0,sp.useSelector)(A().selectors.getCanUserMakeExport),i=(0,sp.useSelector)(A().selectors.getCanUserOpenDataLoader),o=!!(0,v.findPerspectiveConfig)(v.ScreenType.Segmentation,n),l=!!(0,sp.useSelector)(Xa.lF),{canExport:s}=(0,sp.useSelector)(Ti.MO),c=s&&a,u=(0,ap.useCallback)((()=>{r({type:_.Z.EXPORT_RESULTS})}),[r]),p=(0,ap.useCallback)((()=>{r({type:_.Z.OPEN_DATA_LOADER})}),[r]),d=(0,sp.useSelector)(Xa.ai),m=(0,ap.useCallback)((()=>{r(ci(!0))}),[r]),f=[],[y]=(()=>{const e=(0,sp.useSelector)(A().selectors.getCanUserStartProcessFromQuery),t=(0,sp.useSelector)(A().selectors.getWorkflowPath),r=(0,sp.useSelector)(A().selectors.getWorkflowEnvironmentUrl),n=(0,sp.useSelector)(Ti.FH),a=(0,sp.useSelector)(A().selectors.getTenant),i=(0,sp.useDispatch)(),o=(0,sp.useSelector)(Xa.FR),{globalFilter:l}=(0,sp.useSelector)(A().selectors.getGlobalSearchRequestOptions),s=(0,_a._k)(o,[],l),c=(0,ap.useCallback)((()=>{const{processType:e}=n;(0,v.startProcessFromQuery)({workflowPath:t,processType:e,searchString:s,tenant:a,environment:r}).then((()=>{i(hi({message:ei().text("Match reviews successfully submitted. Go to Inbox to view their status."),actionToDispatch:w.ui.actions.openAppFromChocolateBar("Inbox"),actionLabel:ei().text("Go to inbox"),autoHideDuration:null}))})).catch((e=>{ti(e)}))}),[n,t,s,a,r,i]),u=s.includes("matches")||s.includes("matchRules");return[e&&t&&n?{disabled:!u,text:ei().text("Request Match Review"),tooltip:ei().text("Filter on match rules or potential matches to enable Potential Match Review"),onClick:c,id:"-request-match-review"}:null]})();y&&f.push(y);const[g]=(()=>{const e={NO_ENTITY_TYPE:ei().text("Please select exactly one entity type or switch to table mode")},t=(0,sp.useDispatch)(),r=(0,sp.useSelector)(Ti.MO),n=(0,sp.useSelector)(A().selectors.getCanUserMakeBulkUpdate),a=!!(0,sp.useSelector)(Xa.lF),i=(0,sp.useSelector)(Bc),o=!!i,l=Boolean(null==r?void 0:r.bulkUpdate),s=(0,sp.useSelector)(A().selectors.getMetadata),c=(0,sp.useSelector)(Ti.Xf),u=l&&n&&!a?{disabled:!o||!(e=>(0,Ia.wW)(s,{},c).some((t=>t.value===e)))(i),text:ei().text("Bulk update"),tooltip:o?null:e.NO_ENTITY_TYPE,onClick:()=>t(bi(!0)),id:"-bulk-update"}:null;return[u]})();g&&f.push(g);const[h,E]=(0,ap.useState)(!1);return f.push({text:ei().text("Share link"),onClick:()=>E(!0),id:"-share-link"}),f.push(...e),ip().createElement(ip().Fragment,null,i&&ip().createElement(gd.k,{icon:GV,size:"L",onClick:p,tooltipTitle:ei().text("Load data"),className:t.button,"data-reltio-id":"reltio-search-actions-menu-load-data"}),c&&ip().createElement(gd.k,{icon:zV,size:"L",onClick:u,tooltipTitle:ei().text("Export"),showForDisabled:!0,classes:{disabled:t.exportButtonDisabled},className:t.button,disabled:l,"data-reltio-id":"reltio-search-actions-menu-export"}),ip().createElement(gd.k,{tooltipTitle:ei().text("Save"),showForDisabled:!0,className:up()({[t.button]:f.length>0}),disabled:!d,onClick:m,icon:YV,size:"L","data-reltio-id":"reltio-search-actions-menu-save"}),o&&ip().createElement(VV,null),f.length>0&&ip().createElement(SN,{buttonComponent:Op.T,buttonProps:{icon:ZV,size:"L","data-reltio-id":"reltio-search-actions-menu"},menuId:"custom-actions",menuItems:f}),ip().createElement(LV,null),ip().createElement(aB,{open:h,onClose:()=>E(!1)}))},lB="#FF1744",sB=(0,Sp.Z)({indicatorWrapper:{width:0,height:"20px",position:"relative"},indicatorTooltipArea:{width:"10px",height:"20px"},indicator:{width:"3px",height:"3px",backgroundColor:lB,border:"1px solid",borderColor:lB,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"}}),cB=()=>{const e=(0,sp.useSelector)(co.LA),t=(0,sp.useSelector)(co.WH),r=(0,ap.useContext)(EV._),n=sB();if(!e)return null;const a=e.name,i=r?ei().text("Segment has changed"):ei().text("Saved search has changed");return ip().createElement(ip().Fragment,null,ip().createElement("div",{className:n.wrapper},ip().createElement(hf(),{variant:"body2",component:"span",classes:{root:n.for}},ei().text("for")),ip().createElement(ad.Y,{value:a},ip().createElement(hf(),{variant:"body2",classes:{root:n.label}},a))),t&&ip().createElement(ng(),{title:i,placement:"bottom"},ip().createElement("div",{className:n.indicatorWrapper,"data-reltio-id":"changed-indicator"},ip().createElement("div",{className:n.indicator}),ip().createElement("div",{className:n.indicatorTooltipArea}))))},uB=(0,Sp.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}}),pB=()=>{const e=uB(),t=(0,sp.useSelector)(A().selectors.getDataTenants),r=t&&t.length>0,n=(0,sp.useSelector)(Xa.t9),a=(0,sp.useSelector)(A().selectors.getTenantName),i=n?n.label:a;return r&&ip().createElement("div",{className:e.wrapper},ip().createElement(hf(),{variant:"body2",component:"span",classes:{root:e.in}},ei().text("in")),ip().createElement(ad.Y,{value:a},ip().createElement(hf(),{variant:"body2",classes:{root:e.label}},i)))};var dB=r(81877),mB=r.n(dB);const fB=(0,Sp.Z)({dialogPaper:{height:"70vh"},contentRoot:{padding:0,display:"flex",flexDirection:"column",overflow:"hidden"},tabContent:{display:"flex",flex:"1 1 auto"},tabsWrapper:{padding:"0 24px"}}),yB=(0,Sp.Z)((e=>({container:{display:"flex",alignItems:"center",paddingTop:17,paddingBottom:11,paddingLeft:15,paddingRight:15},selected:{backgroundColor:(0,xm.alpha)(e.palette.primary.main,.12)}}))),gB=(0,Sp.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}}),hB=(0,Sp.Z)({closeButton:{marginRight:"10px"}}),EB=({onClose:e})=>{const t=hB();return ip().createElement(Op.T,{size:"L",icon:Ep(),className:t.closeButton,onClick:e})};EB.propTypes={onClose:lp().func};const bB=EB,vB=({selectedNumber:e,onDelete:t,onClose:r})=>{const n=gB();return ip().createElement(ip().Fragment,null,ip().createElement("div",{className:up()(n.title,n.flex1)},ip().createElement(bB,{onClose:r}),ip().createElement(hf(),{color:"primary"},ei().text("Selected: ${count}",{count:e}))),ip().createElement(gd.k,{tooltipTitle:ei().text("Delete"),size:"L",icon:$k(),className:n.deleteButton,onClick:t}))};vB.propTypes={selectedNumber:lp().number,onClose:lp().func,onDelete:lp().func};const TB=vB,OB=(0,Sp.Z)((()=>({white:{backgroundColor:"rgb(255, 255, 255)",boxShadow:"0 1px 3px 0 rgba(0,0,0,0.24)"}})));function SB(){return SB=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},SB.apply(null,arguments)}function xB(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){CB(e,t,r[t])}))}return e}function CB(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const wB=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["classes"]);const n=OB({});return ip().createElement(_p,SB({classes:xB({},t,{focused:n.white})},r))};var AB=r(34480),RB=r.n(AB);const _B=(0,Sp.Z)((e=>({changedFiltersIndicator:{backgroundColor:(0,xm.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"}}))),IB=e=>e?B.ib.public:B.ib.private,NB=e=>e===B.ib.public,PB=({className:e,findPublic:t,favoriteOnly:r,onChangeFilters:n})=>{const a=_B(),i=(0,ap.useRef)(),[o,l]=(0,ap.useState)(!1),[s,c]=(0,ap.useState)(t),[u,p]=(0,ap.useState)(r);(0,ap.useEffect)((()=>{c(t),p(r)}),[t,r]);const d=(0,ap.useCallback)((()=>l((e=>!e))),[]),m=(0,ap.useCallback)((e=>p(e.target.checked)),[]),f=(0,ap.useCallback)((()=>{n({findPublic:s,favoriteOnly:u}),d()}),[d,n,s,u]),y=(0,ap.useCallback)((()=>{c(t),p(r),d()}),[d,t,r]),g=(0,ap.useCallback)((()=>{c(!0),p(!1)}),[]),h=!0===s&&!1===u;return ip().createElement(ip().Fragment,null,ip().createElement(Gh(),{ref:i,color:h?"inherit":"primary",classes:{root:e,textPrimary:a.changedFiltersIndicator},onClick:d},ip().createElement(RB(),null)),ip().createElement(dp(),{open:o,classes:{paper:a.popupContent},anchorEl:i.current,onClose:y,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},ip().createElement(hf(),{className:a.title,variant:"h6"},ei().text("Filter")),ip().createElement(AV.k,{entries:B.m2,TextFieldProps:{InputLabelProps:{classes:{root:a.shareWithLabel}},label:ei().text("Shared with"),variant:"filled"},classes:{root:a.shareWithRoot,menuItem:a.shareWithMenuItem},fullWidth:!0,value:IB(s),onChange:(0,O.pipe)(NB,c)}),ip().createElement(vh(),{classes:{root:a.favoriteOnlyControlRoot,label:a.favoriteOnlyControlLabel},control:ip().createElement(Hp(),{className:a.favoriteOnlyCheckbox,checked:u,onChange:m}),label:ei().text("Show favorites only")}),ip().createElement("div",{className:a.buttonsGroup},ip().createElement(Gh(),{onClick:g,disabled:h},ei().text("Clear all")),ip().createElement("div",null,ip().createElement(Gh(),{onClick:y,className:a.cancelButton},ei().text("Cancel")),ip().createElement(Gh(),{onClick:f,color:"primary"},ei().text("Apply"))))))};PB.propTypes={className:lp().string,findPublic:lp().bool,favoriteOnly:lp().bool,onChangeFilters:lp().func,onChangeFavoriteOnly:lp().func};const DB=(0,sp.connect)((e=>({findPublic:(0,co.kU)(e),favoriteOnly:(0,co.VS)(e)})),{onChangeFilters:({findPublic:e,favoriteOnly:t})=>({type:ar,payload:{findPublic:e,favoriteOnly:t}})})(PB),kB=({type:e,onSearch:t,placeholder:r,onClose:n})=>{const a=gB();return ip().createElement(ip().Fragment,null,ip().createElement("div",{className:a.main},ip().createElement("div",{className:a.title},ip().createElement(bB,{onClose:n}),ip().createElement(hf(),{variant:"h6"},ei().text("Saved & recent searches"))),ip().createElement("div",{className:a.searchBox},ip().createElement(wB,{fullWidth:!0,onSearch:t,placeholder:r}))),e===B.uJ.saved&&ip().createElement(DB,{className:a.filterButton}))};kB.propTypes={type:lp().oneOf(Object.values(B.uJ)),onClose:lp().func,onSearch:lp().func,placeholder:lp().string};const LB=kB,UB=({type:e,selectedNumber:t,onClose:r,dispatch:n})=>{const a=yB(),i=(0,ap.useCallback)((()=>{const t=e===B.uJ.saved?{type:gr}:{type:Pr};n(t)}),[e,n]),o=(0,ap.useCallback)((0,v.debounce)((t=>{const r=e===B.uJ.saved?{type:vr,payload:t}:{type:Ur,payload:t};n(r)}),500),[e,n]),l=(0,O.cond)([[(0,O.equals)(B.uJ.saved),(0,O.always)(ei().text("Search name"))],[(0,O.equals)(B.uJ.recent),(0,O.always)(ei().text("Search for filtered entity types and attributes"))]])(e);return ip().createElement(CV(),{className:up()(a.container,{[a.selected]:t})},t?ip().createElement(TB,{selectedNumber:t,onDelete:i,onClose:r}):ip().createElement(LB,{type:e,onSearch:o,onClose:r,placeholder:l}))};UB.propTypes={type:lp().oneOf(Object.values(B.uJ)).isRequired,selectedNumber:lp().number,onClose:lp().func,dispatch:lp().func};const jB=(0,sp.connect)(((e,t)=>({selectedNumber:t.type===B.uJ.saved?(0,co.g2)(e):xs(e)})))(UB),FB="0.75rem",MB=(0,Sp.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:FB},paginationCaption:{fontSize:FB}});var VB=r(54622);const BB=lp().shape({field:lp().string,order:lp().oneOf(["asc","desc"])}),zB=lp().shape({label:lp().string,name:lp().string,description:lp().string,type:lp().string,hidden:lp().bool,faceted:lp().bool,searchable:lp().bool,uri:lp().string,access:lp().arrayOf(lp().string),cardinality:lp().shape({minValue:lp().number,maxValue:lp().number})}),HB=lp().shape({title:lp().string,pathToTitle:lp().arrayOf(lp().string),fieldName:lp().string,entityTypeUri:lp().string,attrType:zB,uri:lp().string,groupName:lp().string}),YB=lp().shape({id:lp().oneOfType([lp().number,lp().string]),values:lp().array,data:HB,filter:lp().string,operator:lp().string}),WB="0.8rem",GB=(0,Sp.Z)((e=>{const t=(0,xm.lighten)(e.palette.primary.main,.88),r=(0,xm.alpha)(t,0),n=(0,xm.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,xm.alpha)(n,0)}, ${n} 100%)`}};return{defaultWrapper:{whiteSpace:"nowrap",overflow:"hidden",padding:"0 22px",fontSize:WB,display:"flex",alignItems:"center",height:"100%","&:after":a},numberWrapper:{whiteSpace:"nowrap",overflow:"hidden",padding:"0 24px 0 22px",fontSize:WB,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:WB,"&::-ms-clear":{display:"none"}},nameContainer:{flex:1,overflow:"hidden"},editing:{},editNameButton:{},searchName:{cursor:"pointer",lineHeight:"29px",position:"relative",whiteSpace:"nowrap",overflow:"hidden",fontSize:WB,"&: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:WB},sharingMenuItem:{fontSize:WB,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"}}})),qB=({mode:e})=>{const t=GB(),r=(0,sp.useDispatch)(),n=e===B.uJ.saved?co.tc:Cs,a=(0,sp.useSelector)(n),i=e===B.uJ.saved?co.hY:ws,o=(0,sp.useSelector)(i),l=(0,ap.useCallback)((()=>{e===B.uJ.saved?r(o?io():{type:or}):r(o?ds():{type:Ir})}),[r,o,e]);return ip().createElement("div",{className:up()(t.headCell,t.checkbox)},ip().createElement(Hp(),{indeterminate:!a&&o,checked:a,onChange:l}))};qB.propTypes={mode:lp().string};const ZB=(0,Nd.q)((0,O.pick)(["mode"]))(qB),$B=e=>{const t=t=>{const r=GB(),{rowValue:{checked:n}}=t;return ip().createElement("div",{className:up()(r.rowCell,{[r.checkedRowCell]:n})},ip().createElement(e,t))};return t.propTypes={rowValue:lp().shape({checked:lp().bool})},t},KB=(0,id.T)(Hp()),XB=({value:e=!1,rowValue:{uri:t,isOwnSearch:r},onClick:n})=>{const a=GB(),i=!r;return ip().createElement("div",{className:up()(a.headCell,a.checkbox)},ip().createElement(KB,{showForDisabled:!0,tooltipTitle:i&&ei().text("Cannot edit because you're not the owner"),tooltipPlacement:"bottom-start",disabled:i,checked:e,onChange:e=>n(t,e.target.checked)}))};XB.propTypes={value:lp().bool,rowValue:lp().shape({uri:lp().string,isOwnSearch:lp().bool}),onClick:lp().func};const QB=(0,Nd.q)((({onSelectItem:e})=>({onClick:e})))($B(XB));var JB=r(92332);function ez(){return ez=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ez.apply(null,arguments)}function tz(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){rz(e,t,r[t])}))}return e}function rz(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const nz=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className"]);const n=GB(),{headCellData:a}=r;return ip().createElement("div",{className:up()(n.headCell,t)},ip().createElement(JB.default,ez({},r,{headCellData:tz({},a,{label:ip().createElement(ad.Y,{value:a.label},ip().createElement("div",{className:n.headLabel},a.label))})})))};nz.propTypes={className:lp().string,headCellData:lp().shape({id:lp().string,label:lp().oneOfType([lp().string,lp().node]),sortable:lp().bool,resizable:lp().bool,className:lp().string,initialWidth:lp().number,minWidth:lp().number,autoResize:lp().bool,renderer:lp().func})};const az=nz;function iz(){return iz=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},iz.apply(null,arguments)}const oz=e=>{const t=GB();return ip().createElement(az,iz({className:t.nameHeadCell},e))};oz.propTypes={headCellData:lp().shape({id:lp().string,label:lp().oneOfType([lp().string,lp().node]),sortable:lp().bool,resizable:lp().bool,className:lp().string,initialWidth:lp().number,minWidth:lp().number,autoResize:lp().bool,renderer:lp().func})};const lz=oz;var sz=r(18122),cz=r.n(sz),uz=r(62839),pz=r.n(uz);function dz(){return dz=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},dz.apply(null,arguments)}const mz=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return ip().createElement("svg",dz({xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},r),ip().createElement("g",null,ip().createElement("path",{d:"M0 0h24m0 24H0",fill:"none"}),ip().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"}),ip().createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"})))};function fz(){return fz=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},fz.apply(null,arguments)}const yz=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return ip().createElement("svg",fz({xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},r),ip().createElement("g",null,ip().createElement("path",{d:"M0 0h24m0 24H0",fill:"none"}),ip().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"}),ip().createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"})))};var gz=r(74492),hz=r.n(gz),Ez=r(72246),bz=r.n(Ez);const vz=({value:e,rowValue:{uri:t,isFavorite:r,isOwnSearch:n,isEditing:a,isGlobalFilter:i},onStarClick:o,onGlobalClick:l,onApply:s,onChangeName:c,onSetEditing:u})=>{const p=GB(),d=n&&!a,[m,f]=(0,ap.useState)(e);(0,ap.useEffect)((()=>{f(e)}),[e]);const y=(0,ap.useCallback)((()=>{c(t,m)}),[t,m,c]),g=(0,ap.useCallback)((()=>o(t,!r)),[o,t,r]),h=(0,ap.useCallback)((()=>l(t,!i)),[l,t,i]),E=(0,ap.useCallback)((()=>u(t,!0)),[u,t]),b=(0,ap.useCallback)((()=>s(t)),[s,t]),v=(0,O.cond)([[(0,O.always)(n),(0,O.always)(ei().text("Mark as favorite"))],[(0,O.always)(r),(0,O.always)(ei().text("Cannot ummark because you're not the owner"))],[O.T,(0,O.always)("")]])();return ip().createElement("div",{className:up()(p.nameWithStar,{[p.editing]:a})},ip().createElement(gd.k,{showForDisabled:!0,tooltipTitle:v,tooltipPlacement:n?"bottom":"bottom-start",disabled:!n,className:up()(p.starButton,{[p.checkedStarButton]:r},{[p.enabledButton]:n}),size:"M",icon:r?cz():pz(),onClick:g}),ip().createElement(gd.k,{tooltipTitle:i?ei().text("Remove Global filter"):ei().text("Set as Global filter"),className:up()(p.filterButton,p.enabledButton,{[p.checkedFilterButton]:i}),size:"M",icon:i?mz:yz,onClick:h}),ip().createElement("div",{className:p.nameContainer},a?ip().createElement(bz(),{onClickAway:y},ip().createElement("div",null,ip().createElement(wV.H,{variant:"filled",hiddenLabel:!0,size:"small",fullWidth:!0,autoFocus:!0,classes:{root:p.nameTextEditorRoot},InputProps:{classes:{input:p.nameInput}},value:m,onInput:e=>f(e.target.value),onKeyDown:(0,O.when)((0,O.propEq)("keyCode",13),y)}))):ip().createElement(ad.Y,{value:e},ip().createElement("div",{className:p.searchName,onClick:b},e))),d&&ip().createElement(gd.k,{tooltipTitle:ei().text("Edit"),className:p.editNameButton,size:"M",icon:hz(),onClick:E}))};vz.propTypes={value:lp().string,rowValue:lp().shape({uri:lp().string,isFavorite:lp().bool,isOwnSearch:lp().bool,isEditing:lp().bool,isGlobalFilter:lp().bool}),onStarClick:lp().func,onGlobalClick:lp().func,onApply:lp().func,onChangeName:lp().func,onSetEditing:lp().func};const Tz=(0,Nd.q)((({onChangeIsFavorite:e,onChangeIsGlobal:t,onSearchApply:r,onSetItemEditing:n,onChangeItemName:a})=>({onStarClick:e,onGlobalClick:t,onApply:r,onSetEditing:n,onChangeName:a})))($B(vz)),Oz=({value:e,rowValue:{uri:t,isOwnSearch:r},onChange:n})=>{const a=GB(),i=(0,ap.useCallback)((r=>{const a=NB(r);a!==e&&n(t,a)}),[t,e,n]);return ip().createElement("div",{className:a.sharingWrapper},ip().createElement(AV.k,{entries:B.m2,value:IB(e),onChange:i,disableUnderline:!0,disabled:!r,MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},elevation:3},TextFieldProps:{classes:{root:a.sharingRoot}},classes:{root:a.sharingInput,menuItem:a.sharingMenuItem,disabled:a.sharingDisabled,icon:up()({[a.sharingIconDisabled]:!r})}}))};Oz.propTypes={value:lp().bool,rowValue:lp().shape({uri:lp().string,isOwnSearch:lp().bool}),onChange:lp().func};const Sz=(0,Nd.q)((({onChangeIsPublic:e})=>({onChange:e})))($B(Oz)),xz=({value:e,rowValue:t,onClick:r})=>{const n=GB(),a=r?()=>r(t):()=>{};return ip().createElement(ad.Y,{value:e},ip().createElement("div",{className:up()(n.defaultWrapper,{[n.clickableArea]:r}),onClick:a},e))};xz.propTypes={value:lp().any,rowValue:lp().object,onClick:lp().func};const Cz=$B(xz);function wz(){return wz=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},wz.apply(null,arguments)}const Az=e=>{const{rowValue:{updateDate:t,createDate:r}}=e,n=t||r;return ip().createElement(Cz,wz({},e,{value:n&&ei().date(n,"L")}))};Az.propTypes={rowValue:lp().shape({updateDate:lp().number,createDate:lp().number})};const Rz=Az,_z=({values:e})=>(0,O.pipe)((0,O.cond)([[O.isNil,O.T],[Array.isArray,(0,O.pipe)(O.flatten,O.isEmpty)],[O.T,O.isEmpty]]),O.not)(e),Iz=(0,O.curry)(((e,t)=>(0,O.path)(["facetsData",t.fieldName,"values","length"],e)>0)),Nz=e=>e&&e.slice(1).join(" / "),Pz=(e,t,r)=>(e[t]||(e[t]={title:t,attributes:[]}),e[t].attributes=(0,O.uniq)(e[t].attributes.concat(r)),e),Dz=({rowValue:{uiState:e}})=>{const t=GB(),r=(0,ap.useMemo)((()=>(({facets:e,advanced:t}={})=>{try{const r=t?((e=[])=>e.flatMap((e=>e.attributes)).filter(_z).reduce(((e,{data:{title:t,groupName:r,pathToTitle:n}})=>{const a=Nz(n)||t;return Pz(e,r,a)}),{}))(t):((e={})=>(e.facetsConfigs||[]).filter((0,O.pipe)(v.isTypeFacet,O.not)).filter(Iz(e)).reduce(((e,t)=>{const r=(0,O.path)(["pathToTitle",0],t)||ei().text("Special"),n=Nz(t.pathToTitle)||t.title;return Pz(e,r,n)}),{}))(e);return Object.values(r)}catch(e){return[]}})(e)),[e]),n=(0,ap.useMemo)((()=>(e=>e.flatMap((e=>e.attributes)).length)(r)),[r]),a=!!r.length&&ip().createElement("div",null,r.map((({title:e,attributes:r})=>ip().createElement("div",{key:e,className:t.tooltipSection},ip().createElement("h6",{className:t.tooltipSectionHeader},e),r.map((e=>ip().createElement("div",{key:e,className:t.tooltipText},e)))))));return ip().createElement("div",{className:t.numberWrapper},(i=n,a?ip().createElement(ng(),{title:a,classes:{tooltip:t.tooltip},disableFocusListener:!0,disableTouchListener:!0},ip().createElement("span",null,i)):i));var i};Dz.propTypes={rowValue:lp().shape({uiState:lp().shape({facets:lp().object,advanced:lp().array})})};const kz=$B(Dz);function Lz(){return Lz=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Lz.apply(null,arguments)}const Uz=e=>{const t=GB();return ip().createElement(az,Lz({className:t.totalHeadCell},e))};Uz.propTypes={headCellData:lp().shape({id:lp().string,label:lp().oneOfType([lp().string,lp().node]),sortable:lp().bool,resizable:lp().bool,className:lp().string,initialWidth:lp().number,minWidth:lp().number,autoResize:lp().bool,renderer:lp().func})};const jz=Uz;var Fz=r(67520),Mz=r.n(Fz);const Vz=({value:e})=>{const t=GB();return ip().createElement(ad.Y,{value:e},ip().createElement("div",{className:t.numberWrapper},ei().number(e)))};Vz.propTypes={value:lp().number};const Bz=$B(Vz),zz=e=>{const t=GB(),{rowValue:{isTotalLoading:r,isOwnSearch:n,uri:a},onDeleteItem:i,onLoadTotalForItem:o,value:l}=e,s=(0,ap.useCallback)((()=>{i(a)}),[i,a]),c=n?ei().text("Delete"):ei().text("Cannot delete because you're not the owner"),u=r?ei().text("Loading data"):ei().text("Load data"),p=(0,ap.useCallback)((()=>{o(a)}),[o,a]),d=r||-1===l;return ip().createElement("div",{className:t.totalWithButtonsWrapper},d?ip().createElement(gd.k,{showForDisabled:!0,tooltipTitle:u,tooltipPlacement:"bottom-end",disabled:r,size:"L",icon:Mz(),onClick:p}):ip().createElement(Bz,e),ip().createElement(gd.k,{showForDisabled:!0,className:t.deleteButton,tooltipTitle:c,tooltipPlacement:"bottom-end",disabled:!n,size:"L",icon:$k(),onClick:s}))};zz.propTypes={value:lp().number,rowIndex:lp().number,rowValue:lp().shape({isOwnSearch:lp().bool,isTotalLoading:lp().bool,uri:lp().string}),onDeleteItem:lp().func,onLoadTotalForItem:lp().func};const Hz=(0,Nd.q)((({onDeleteItem:e,onLoadTotalForItem:t})=>({onDeleteItem:e,onLoadTotalForItem:t})))($B(zz));function Yz(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Wz={rowCellValueRenderer:Cz,headCellRenderer:az,autoResize:!1},Gz=[{id:"checked",label:"",initialWidth:55,headCellRenderer:ZB,rowCellValueRenderer:QB},{id:"name",get label(){return ei().text("Name")},autoResize:!0,headCellRenderer:lz,rowCellValueRenderer:Tz,sortable:!0},{id:"isPublic",get label(){return ei().text("Shared with")},rowCellValueRenderer:Sz},{id:"owner",get label(){return ei().text("Created by")},initialWidth:260},{id:"updateDate",get label(){return ei().text("Last modified")},rowCellValueRenderer:Rz,sortable:!0},{id:"attributes",get label(){return ei().text("Filtered attributes")},rowCellValueRenderer:kz},{id:"total",get label(){return ei().text("Number of profiles")},headCellRenderer:jz,rowCellValueRenderer:Hz,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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Yz(e,t,r[t])}))}return e}({},Wz,e)));function qz(){return qz=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},qz.apply(null,arguments)}function Zz(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const $z=({items:e,total:t,sorting:r,page:n,rowsPerPage:a,loading:i,searchValue:o,globalFilterSavedSearchesUris:l=[],onSearchApply:s,onChangeIsFavorite:c,onChangeIsPublic:u,onChangeIsGlobal:p,onChangeRowsPerPage:d,onChangePage:m,onSelectItem:f,onDeselectAllItems:y,onDeleteItem:g,onChangeItemName:h,onSetItemEditing:E,onLoadTotalForItem:b,onSort:T})=>{const O=MB(),S=(0,ap.useMemo)((()=>({cellBorder:O.cellBorder})),[O]),[x,C]=(0,ap.useState)(null),[w,A]=(0,ap.useState)(null),R=(0,ap.useRef)(null);(0,ap.useEffect)((()=>y),[y]);const _=(0,ap.useCallback)((e=>{l.includes(e)?A(e):g(e)}),[l,g]),I=(0,ap.useMemo)((()=>({mode:B.uJ.saved,onSelectItem:f,onChangeIsFavorite:c,onChangeIsGlobal:p,onSearchApply:s,onSetItemEditing:E,onChangeItemName:h,onDeleteItem:_,onLoadTotalForItem:b,onChangeIsPublic:u})),[_,f,c,p,b,s,E,h,u]),N=(0,ap.useMemo)((()=>(0,v.isEmptyValue)(o)?{LogoRenderer:xE.SELECT_ATTRIBUTES,text:ei().text("No saved searches."),secondaryText:ei().text("Save time by creating saved searches for queries you regularly search for.")}:{LogoRenderer:xE.SEARCH_RESULTS,text:ei().text("No results found."),secondaryText:ei().text("Try adjusting your search or filter to find what you're looking for.")}),[o]),P=(0,ap.useMemo)((()=>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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Zz(e,t,r[t])}))}return e}({},e,{isGlobalFilter:l.includes(e.uri)})))),[e,l]);return ip().createElement("div",{className:O.tableWrapper},t>0?ip().createElement(ip().Fragment,null,ip().createElement(wd.M,{columnsData:Gz,rowsData:P,context:I,sorting:r,getRowCellHeight:null,defaultColumnWidth:140,defaultColumnMinWidth:140,defaultRowHeight:48,headRowHeight:47,hoverStateEnabled:!0,onSort:T,hoverRowIndex:x,onRowHover:C,classes:S,ref:R}),ip().createElement(gE.Z,{classes:{root:O.paginationRoot,caption:O.paginationCaption},count:t,rowsPerPageOptions:B.Tu,rowsPerPage:a,onChangeRowsPerPage:d,page:n,onChangePage:m,basicTableRef:R}),ip().createElement(VB.U,{open:!!w,title:ei().text("Keep the global filter?"),content:ei().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:ei().text("NO, remove it"),saveCaption:ei().text("YES, KEEP GLOBAL FILTER"),onCancel:()=>A(null),onDiscard:()=>{p(w,!1),g(w),A(null)},onSave:()=>{g(w),A(null)}})):ip().createElement(CE,qz({},N,{variant:SE.embedded})),i&&ip().createElement(wE.z,null))};$z.propTypes={items:lp().arrayOf(lp().shape({uri:lp().string,name:lp().string,isPublic:lp().bool,isFavorite:lp().bool,isOwnSearch:lp().bool,isEditing:lp().bool,checked:lp().bool,owner:lp().string,updateDate:lp().number,query:lp().string})),total:lp().number,sorting:BB,page:lp().number,rowsPerPage:lp().number,loading:lp().bool,searchValue:lp().string,globalFilterSavedSearchesUris:lp().arrayOf(lp().string),onSearchApply:lp().func,onChangeIsFavorite:lp().func,onChangeIsPublic:lp().func,onChangeIsGlobal:lp().func,onChangeRowsPerPage:lp().func,onChangePage:lp().func,onSelectItem:lp().func,onDeselectAllItems:lp().func,onDeleteItem:lp().func,onChangeItemName:lp().func,onSetItemEditing:lp().func,onSort:lp().func};const Kz=(0,sp.connect)((e=>({items:(0,co.gg)(e),total:(0,co.Yi)(e),sorting:(0,co.rT)(e),page:(0,co.wH)(e),rowsPerPage:(0,co.s6)(e),loading:(0,co.w7)(e),searchValue:(0,co.U3)(e),globalFilterSavedSearchesUris:A().selectors.getGlobalFilterSavedSearchesUris(e)})),{onSearchApply:(e,t=B.XU)=>({type:Tr,payload:{uri:e,debounceTime:t}}),onChangeIsFavorite:(e,t)=>({type:ur,payload:{uri:e,isFavorite:t}}),onChangeIsPublic:(e,t)=>({type:sr,payload:{uri:e,isPublic:t}}),onChangeIsGlobal:(e,t)=>({type:dr,payload:{uri:e,isGlobalFilter:t}}),onChangeRowsPerPage:e=>({type:nr,payload:e}),onChangePage:e=>({type:rr,payload:e}),onSelectItem:(e,t)=>({type:ir,payload:{uri:e,checked:t}}),onDeselectAllItems:io,onDeleteItem:e=>({type:hr,payload:e}),onChangeItemName:(e,t)=>({type:mr,payload:{uri:e,name:t}}),onSetItemEditing:(e,t)=>({type:yr,payload:{uri:e,isEditing:t}}),onLoadTotalForItem:e=>({type:Sr,payload:e}),onSort:e=>({type:xr,payload:e})})($z),Xz=({value:e=!1,rowValue:{createdDate:t},onClick:r})=>{const n=GB();return ip().createElement("div",{className:up()(n.headCell,n.checkbox)},ip().createElement(Hp(),{checked:e,onChange:e=>r(t,e.target.checked)}))};Xz.propTypes={value:lp().bool,rowValue:lp().shape({createdDate:lp().number}),onClick:lp().func};const Qz=(0,Nd.q)((({onSelectItem:e})=>({onClick:e})))($B(Xz));function Jz(){return Jz=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Jz.apply(null,arguments)}const eH=e=>{const{rowValue:{createdDate:t}}=e,r=t;return ip().createElement(Cz,Jz({},e,{value:r&&ei().date(r,"L LT")}))};eH.propTypes={rowValue:lp().shape({createdDate:lp().number}),onClick:lp().func};const tH=(0,Nd.q)((({onSearchApply:e})=>({onClick:e})))(eH),rH=e=>{const t=GB(),{rowValue:r,onDeleteItem:n,onLoadTotalForItem:a,value:i}=e,{isTotalLoading:o,createdDate:l}=r,s=(0,ap.useCallback)((()=>{n(r)}),[n,r]),c=o?ei().text("Loading data"):ei().text("Load data"),u=(0,ap.useCallback)((()=>{a(l)}),[a,l]),p=o||-1===i;return ip().createElement("div",{className:t.totalWithButtonsWrapper},p?ip().createElement(gd.k,{showForDisabled:!0,tooltipTitle:c,tooltipPlacement:"bottom-end",disabled:o,size:"L",icon:Mz(),onClick:u}):ip().createElement(Bz,e),ip().createElement(gd.k,{className:t.deleteButton,tooltipTitle:ei().text("Delete"),tooltipPlacement:"bottom-end",size:"L",icon:$k(),onClick:s}))};rH.propTypes={value:lp().number,rowValue:lp().shape({isTotalLoading:lp().bool,createdDate:lp().number}),onDeleteItem:lp().func,onLoadTotalForItem:lp().func};const nH=(0,Nd.q)((({onDeleteItem:e,onLoadTotalForItem:t})=>({onDeleteItem:e,onLoadTotalForItem:t})))($B(rH)),aH=(0,Nd.q)((({onSearchApply:e})=>({onClick:e})))(Cz);function iH(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const oH={rowCellValueRenderer:Cz,headCellRenderer:az,autoResize:!1},lH=[{id:"checked",label:"",initialWidth:55,headCellRenderer:ZB,rowCellValueRenderer:Qz},{id:"createdDate",get label(){return ei().text("Created")},rowCellValueRenderer:tH,initialWidth:256},{id:"name",get label(){return ei().text("Query")},autoResize:!0,rowCellValueRenderer:aH,minWidth:150},{id:"total",get label(){return ei().text("Record count")},rowCellValueRenderer:nH,headCellRenderer:jz,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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){iH(e,t,r[t])}))}return e}({},oH,e)));function sH(){return sH=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},sH.apply(null,arguments)}const cH=({items:e,loading:t,filterWord:r,onSelectItem:n,onDeselectAllItems:a,onSearchApply:i,onDeleteItem:o,onLoadTotalForItem:l})=>{const s=MB(),c=(0,ap.useMemo)((()=>({cellBorder:s.cellBorder})),[s]),[u,p]=(0,ap.useState)(null);(0,ap.useEffect)((()=>a),[a]);const d=(0,ap.useMemo)((()=>({mode:B.uJ.recent,onSelectItem:n,onSearchApply:i,onDeleteItem:o,onLoadTotalForItem:l})),[o,l,n,i]),m=(0,ap.useMemo)((()=>(0,v.isEmptyValue)(r)?{LogoRenderer:xE.SELECT_ATTRIBUTES,text:ei().text("No recent searches."),secondaryText:ei().text("Your recent search history will appear here.")}:{LogoRenderer:xE.SEARCH_RESULTS,text:ei().text("No results found."),secondaryText:ei().text("Try adjusting your search or filter to find what you're looking for.")}),[r]);return ip().createElement("div",{className:s.tableWrapper},e.length>0?ip().createElement(wd.M,{columnsData:lH,rowsData:e,context:d,getRowCellHeight:null,defaultColumnWidth:50,defaultColumnMinWidth:50,defaultRowHeight:48,headRowHeight:47,hoverStateEnabled:!0,hoverRowIndex:u,onRowHover:p,classes:c}):ip().createElement(CE,sH({},m,{variant:SE.embedded})),t&&ip().createElement(wE.z,null))};cH.propTypes={items:lp().arrayOf(lp().shape({uri:lp().string,name:lp().string,isPublic:lp().bool,isFavorite:lp().bool,isOwnSearch:lp().bool,checked:lp().bool,owner:lp().string,createdDate:lp().number,query:lp().string})),loading:lp().bool,filterWord:lp().string,onSelectItem:lp().func,onSearchApply:lp().func,onDeselectAllItems:lp().func,onDeleteItem:lp().func};const uH=(0,sp.connect)((e=>({items:Os(e),loading:Ss(e),filterWord:vs(e)})),{onSearchApply:(e,t=B.XU)=>({type:Vr,payload:{search:e,debounceTime:t}}),onSelectItem:(e,t)=>({type:_r,payload:{searchCreatedDate:e,checked:t}}),onDeselectAllItems:ds,onDeleteItem:e=>({type:kr,payload:e}),onLoadTotalForItem:e=>({type:Mr,payload:e})})(cH),pH=({open:e,onClose:t})=>{const r=fB(),n=(0,sp.useDispatch)(),a=(0,ap.useMemo)((()=>[{value:B.uJ.saved,label:ei().text("Saved searches"),content:ip().createElement(Kz,null),dataReltioId:"reltio-search-saved-searches"},{value:B.uJ.recent,label:ei().text("Recent searches"),content:ip().createElement(uH,null),dataReltioId:"reltio-search-recent-searches"}]),[]),[i,o]=(0,ap.useState)(a[0].value);return(0,ap.useEffect)((()=>{e&&(i===B.uJ.saved?n({type:Qt}):n({type:wr}))}),[e,n,i]),ip().createElement(Ij(),{classes:{paper:r.dialogPaper},fullWidth:!0,maxWidth:"lg",open:e,onClose:t},ip().createElement(jB,{type:i,onClose:t}),ip().createElement(fF(),{classes:{root:r.contentRoot}},ip().createElement("div",{className:r.tabsWrapper},ip().createElement(OI,{value:i,tabs:a,onChange:o,scrollButtons:"auto"})),ip().createElement("div",{className:r.tabContent},a.find((0,O.propEq)("value",i)).content)))};pH.propTypes={open:lp().bool,onClose:lp().func};const dH=pH,mH=(0,Sp.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"}}))),fH=({showTypography:e})=>{const t=mH(),r=(0,sp.useDispatch)(),n=(0,sp.useSelector)(Ti.tm),a=ei().text("Saved & recent searches"),i=(0,ap.useCallback)((()=>r(si(!0))),[r]),o=(0,ap.useCallback)((()=>r(si(!1))),[r]);return ip().createElement(ip().Fragment,null,ip().createElement(ng(),{title:e?"":a},ip().createElement(Gh(),{className:t.button,variant:"outlined",startIcon:ip().createElement(mB(),{className:up()({[t.compact]:!e}),color:"action"}),onClick:i,"data-reltio-id":"reltio-search-saved-and-recent-search"},e&&ip().createElement(hf(),{variant:"button",color:"textPrimary",className:t.buttonText},a))),ip().createElement(dH,{open:n,onClose:o}))},yH=(0,Sp.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"}}))),gH="search",hH="geoLocation",EH={},bH=()=>{const e=yH(),t=(0,sp.useDispatch)(),r=(0,sp.useSelector)(C.Mp),n=(0,sp.useSelector)(C.X0),a=(0,sp.useSelector)(Xa.Qw)||EH,i=(0,sp.useSelector)(A().selectors.getSearchKeyword),o=(0,sp.useSelector)(A().selectors.getDateMask),l=(0,sp.useSelector)(A().selectors.getDateTimeMask),s=(0,sp.useSelector)(A().selectors.getAttributesPresentation)||EH,c=(0,sp.useSelector)(Ti.IJ),u=(0,sp.useSelector)((e=>(0,Xa.NU)(e,{entityTypeUri:void 0}))),p=(0,sp.useSelector)(Hi.go),d=(0,ap.useContext)(EV._),[m,f]=(0,ap.useState)([]),[y,g]=(0,ap.useState)(0),[h,E]=(0,ap.useState)(!1),b=(0,ap.useRef)(null),[T,S]=(0,ap.useState)(!0);(0,ap.useEffect)((()=>{f(x())}),[r,n,a,i]),(0,ap.useEffect)((()=>{g(m.length),E(!0)}),[m]),(0,ap.useEffect)((()=>{if(h){const e=I();g(e),E(!1)}}),[h,n]);const x=(0,ap.useCallback)((()=>{const e=Object.values((0,Ia.t8)(n,r)).filter((e=>e.values&&e.values.length)).map((e=>{const t=e.title||e.hiddenTitle,r=(0,Ia.MI)([...e.data||[],...e.filteredData||[]],(0,O.path)(["attrType","type"],e)===v.DataTypes.TYPE_DATE?e.values.map((e=>e.map((e=>v.utils.dates.toLocalDate(e).getTime())))):e.values.map((0,v.mapFilterValue)((0,v.applyPresentationStrategyToValue)((e=>(0,v.getNumberFormat)((0,v.getAttrDataTypeDefinition)(e.attrType),s,v.intl.getLocale()).strategy)(e)))),e.type,{dateMask:o,dateTimeMask:l});return{fieldName:e.fieldName,title:t,values:r}}));i&&e.push({fieldName:gH,title:ei().text("Search"),values:[i.value]});const{values:[t]=[],type:c}=(0,O.pathOr)({},["mapSearch"],a);return t&&e.push({fieldName:hH,values:(0,v.getMapSearchValues)(c,t),title:(0,v.getMapSearchLabel)(c)}),e}),[r,n,a,i,s,o,l]),R=(0,ap.useCallback)((()=>{g(m.length),E(!0)}),[m]),_=(0,ap.useCallback)((e=>{S(e>=450)}),[]),I=(0,ap.useCallback)((()=>{if(!b.current)return 0;const{firstChild:e,offsetLeft:t,offsetWidth:r}=b.current,n=t+r;return([...e.childNodes]||[]).filter((a=n,e=>e.offsetLeft+e.offsetWidth<=a)).length;var a}),[b]),N=(0,ap.useCallback)((e=>r=>{switch(r.stopPropagation(),e){case gH:t(w.search.actions.keywordUpdated(null));break;case hH:t(Ha(null));break;default:t(Ga(e,[]))}}),[t]),P=(0,ap.useCallback)((()=>{t(Ma({silent:!0})),t(w.search.actions.keywordUpdated({debounceTime:B.XU}))}),[t]),D=(0,ap.useMemo)((()=>m.map((e=>ip().createElement(TV,{key:e.fieldName,title:e.title,values:e.values,onDelete:N(e.fieldName)})))),[m,N]),k=D.slice(0,y),L=D.slice(y),U=(0,O.when)((0,O.propEq)("length",1),(0,O.reject)(v.isEmptySearchGroup))(p),j=0===D.length&&0===U.length,F=!c&&D.length>0;return ip().createElement("div",{className:e.container,"data-reltio-id":"search-bar"},ip().createElement("div",{className:e.header},ip().createElement("div",{className:e.captionWrapper,"data-reltio-id":"search-bar-total-profiles"},ip().createElement(hf(),{component:"span",classes:{body1:e.profileNumber}},ei().number(u,"0,0")),ip().createElement(hf(),{variant:"body2",component:"span",classes:{root:e.profileText}},ei().text("total profiles"))),ip().createElement(pB,null),ip().createElement(cB,null),ip().createElement(Gh(),{color:"primary",className:e.clearButton,onClick:P,disabled:j,"data-reltio-id":"reltio-search-clear"},ei().text("clear")),!d&&ip().createElement("div",{className:e.searchBarControls,"data-reltio-id":"search-bar-controls"},ip().createElement(Up.ZP,{handleWidth:!0,handleHeight:!1,onResize:_}),ip().createElement(oB,null),ip().createElement(Cf(),{orientation:"vertical",className:e.splitter}),ip().createElement(fH,{showTypography:T}))),ip().createElement(Up.ZP,{handleWidth:!0,handleHeight:!1,onResize:R}),ip().createElement(hV(),{in:F,timeout:500},ip().createElement("div",{ref:b,className:e.facetsBar,"data-reltio-id":"search-facets-bar"},ip().createElement("div",{className:e.showBar},k),L.length>0&&ip().createElement(SV,{items:L}))))},vH=(0,Sp.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"}}),TH=({onBackBtnClick:e})=>{const t=vH();return ip().createElement(EF(),{disableGutters:!0,classes:{root:t.toolBar}},ip().createElement(gd.k,{tooltipTitle:ei().text("Switch to basic mode"),size:"L",icon:NI(),className:t.backButtonContainer,onClick:e}),ip().createElement(hf(),{variant:"subtitle1",className:t.title},ei().text("Advanced search")))};TH.propTypes={onBackBtnClick:lp().func};const OH=TH,SH=(0,Sp.Z)((e=>({query:{color:e.palette.text.secondary,fontSize:"12px",letterSpacing:0,lineHeight:"16px"},[v.READABLE_QUERY_PRIMITIVE_TYPES.entityTypeLabel]:{color:"#03904A"},[v.READABLE_QUERY_PRIMITIVE_TYPES.attributeLabel]:{color:"#059BEA"},[v.READABLE_QUERY_PRIMITIVE_TYPES.specialAttributeLabel]:{color:"#EA05CF"},[v.READABLE_QUERY_PRIMITIVE_TYPES.attributeFilter]:{color:"#7F00FF"},[v.READABLE_QUERY_PRIMITIVE_TYPES.attributeValue]:{color:"#000000"}})));function xH(){return xH=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},xH.apply(null,arguments)}const CH=(0,ap.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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["readableQuery","className"]);const i=SH();return ip().createElement("span",xH({ref:t,className:up()(i.query,n),"data-reltio-id":"search-readable-query"},a),r.map((({type:e,text:t},r)=>ip().createElement("span",{key:r,className:i[e]},t))))}));CH.displayName="ReadableSearchQuery";var wH=r(82466),AH=r.n(wH);const RH=(0,Sp.Z)({collapseIcon:{transform:"rotate(0deg)",transition:"transform 0.35s ease"},"collapseIcon--inverted":{transform:"rotate(-180deg)"}});function _H(){return _H=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},_H.apply(null,arguments)}const IH=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["collapseBtnActive","onCollapseBtnClick"]);const a=RH();return ip().createElement(gd.k,_H({size:"L",icon:AH(),tooltipTitle:t?ei().text("Collapse panel"):ei().text("Expand panel"),onClick:r,iconClassName:up()(a.collapseIcon,{[a["collapseIcon--inverted"]]:!t}),"data-reltio-id":"reltio-search-advanced-search-collapse-panel"},n))};IH.propTypes={backBtnDisabled:lp().bool,onBackBtnClick:lp().func,collapseBtnActive:lp().bool,onCollapseBtnClick:lp().func};const NH=IH;var PH=r(89808),DH=r.n(PH),kH=r(19820),LH=r.n(kH);function UH(){return UH=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},UH.apply(null,arguments)}const jH=e=>{let{isFullscreen:t=!1,onClick:r=O.identity}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["isFullscreen","onClick"]);return ip().createElement(gd.k,UH({size:"L",icon:t?LH():DH(),tooltipTitle:t?ei().text("Exit full screen"):ei().text("Full screen"),onClick:r,"data-reltio-id":"reltio-search-advanced-search-full-screen"},n))};jH.propTypes={isFullscreen:lp().bool,onClick:lp().func};const FH=jH,MH=(0,Sp.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"}}),VH=({groups:e,hasMinSize:t,lookups:r,metadata:n,attributesPresentation:a,collapseBtnActive:i,isFullscreen:o,onCollapseBtnClick:l,onFullScreenBtnClick:s,keyword:c,map:u,dispatch:p})=>{const d=MH(),[m,f]=(0,ap.useState)(0),[y,g]=(0,ap.useState)(0),h=(0,ap.useMemo)((()=>(0,_a.Jk)((0,lt.P0)(n,e))),[n,e]),E=(0,v.buildReadableQuery)(n,a,r,e,c,u),b=ei().text("Copy to clipboard"),[T,O]=(0,ap.useState)(b),S=(0,ap.useCallback)((0,v.debounce)((()=>{p({type:it})}),500),[p]),x=(0,ap.useCallback)((()=>{JV((0,v.buildReadableQueryToString)(n,a,r,e,c,u)).then((()=>O(ei().text("Query was copied")))).catch((()=>O(ei().text("Error"))))}),[e,a,r,n,c,u]),C=(0,ap.useCallback)((()=>{O(b)}),[b]),w=(0,ap.useCallback)((e=>{f(e.clientX),g(e.clientY)}),[]);(0,mE.D)(S,[S,h]);const A=(0,ap.useMemo)((()=>({anchorEl:{clientWidth:1,clientHeight:1,getBoundingClientRect:()=>({left:m,bottom:y,height:1,right:m,width:1,top:y})}})),[m,y]);return ip().createElement("div",{className:d.resultQueryPanel},ip().createElement("div",{className:d.resultQuery},ei().text("Search query"),ip().createElement("div",{className:up()(d.queryContainer,{[d.queryContainerMinHeight]:t})},E.length>0?ip().createElement(ng(),{key:T,title:T,onClose:C,PopperProps:A},ip().createElement(CH,{readableQuery:E,onMouseEnter:w,onClick:x,className:d.query})):ip().createElement("span",{className:d.noQuery},ei().text("Build your search and view your search query here")))),ip().createElement("div",{className:d.actionsPanel},ip().createElement(NH,{collapseBtnActive:i,onCollapseBtnClick:l,className:d.collapseButton}),ip().createElement(FH,{isFullscreen:o,onClick:s})))};var BH=r(28345),zH=r.n(BH),HH=r(68157);const YH=(0,Sp.Z)((e=>({readOnlyLogicOperatorContainer:{display:"flex",alignItems:"center",marginRight:"40px",width:"76px",fontSize:"14px",color:e.palette.text.secondary,maxHeight:"46px"}}))),WH=({className:e,rowData:t})=>{const r=YH();return ip().createElement("div",{className:up()(r.readOnlyLogicOperatorContainer,e)},t&&t.operator?(0,HH.capitalize)(t.operator):ei().text("Where"))},GH=(0,Sp.Z)((e=>({readOnlyFilter:{display:"flex",alignItems:"center",fontSize:"14px",color:e.palette.text.secondary,width:"50px",marginLeft:"12px",maxHeight:"46px"}}))),qH=({className:e,rowData:t})=>{const r=GH();return ip().createElement("div",{className:up()(r.readOnlyFilter,e)},t&&t.filter?(0,v.getFilterOptionLabel)(t.filter):ei().text("equals"))},ZH=(0,Sp.Z)((()=>({row:{display:"flex",marginBottom:"12px"},rowItem:{paddingRight:"10px",display:"flex"},fullWidth:{flexGrow:"1",flexBasis:"0",overflow:"hidden"},hidden:{visibility:"hidden"}}))),$H=e=>{let{classes:t={},rowData:r,previousRowData:n,LogicOperatorComponent:a=WH,AttributeSelectorComponent:i,FilterSelectorComponent:o=qH,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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["classes","rowData","previousRowData","LogicOperatorComponent","AttributeSelectorComponent","FilterSelectorComponent","ValuesEditorComponent","ActionsComponent","filterSelectorRef","attributeSelectorProps"]);const d=ZH();return ip().createElement("div",{className:up()(d.row,t.root),"data-reltio-id":"query-builder-row"},ip().createElement(a,{className:t.logicOperatorContainer,rowContext:p,rowData:n}),ip().createElement("div",{className:up()(d.rowItem,t.attributeSelectorContainer),"data-reltio-id":"query-builder-row-attribute-selector"},ip().createElement(i,{attributeSelectorProps:u,rowContext:p,rowData:r})),ip().createElement("div",{className:up()(d.rowItem,t.filterSelectorContainer),"data-reltio-id":"query-builder-row-filter-selector"},ip().createElement(o,{textFieldInputRef:c,rowContext:p,rowData:r})),ip().createElement("div",{className:up()(d.rowItem,d.fullWidth,t.valuesEditorContainer),"data-reltio-id":"query-builder-row-values-editor"},ip().createElement(l,{rowContext:p,rowData:r})),ip().createElement("div",{className:up()(d.rowItem,t.actionsContainer,{[d.hidden]:!r}),"data-reltio-id":"query-builder-row-actions"},ip().createElement(s,{rowContext:p,rowData:r})))},KH=(0,ap.memo)($H);function XH(){return XH=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},XH.apply(null,arguments)}const QH=(0,ip().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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.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,O.path)([t-1],n):null,c=t===n.length?{attributeSelectorProps:a}:{};return ip().createElement(KH,XH({key:e&&e.id,rowData:e,previousRowData:s,classes:r,filterSelectorRef:t===o?i:void 0},l,c))};return ip().createElement("div",{"data-reltio-id":"reltio-query-builder-rows-group",className:t},n.map(s),s(null,n.length,n))})),JH=(0,Sp.Z)((()=>({select:{padding:"6px 16px 7px"},dropDown:{width:"100px","&:before":{content:"none !important"}}}))),eY=({className:e,value:t,onChange:r})=>{const n=JH();return ip().createElement(AV.k,{className:up()(n.dropDown,e),classes:n,value:t,entries:v.operatorOptions,onChange:r})},tY={position:"absolute",width:1,background:"rgba(43, 152, 240, 0.3)",height:16,left:36};function rY(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){nY(e,t,r[t])}))}return e}function nY(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const aY=(0,Sp.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:rY({},tY),upperLine:{marginTop:-18},lowerLine:{marginBottom:-16,bottom:0}}))),iY="46px",oY=(0,Sp.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:iY},filterSelect:{width:"190px"},valuesWrapper:{width:"100%",display:"flex",minHeight:iY,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:{}})));var lY=r(58282),sY=r.n(lY);const cY=e=>e.join(", "),uY=e=>`calc(${(0,O.isNil)(e)?"100%":`${e}px`} - 35px)`,pY=(0,Sp.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)"}}),dY=({list:e,maxWidth:t})=>{const r=pY(),n=(0,ap.useRef)(),[a,i]=(0,ap.useState)(0);(0,ap.useEffect)((()=>{i(((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)})(e,n.current))}),[e]);const o=cY(e),l=a>0,s=l?cY(e.slice(0,-a)):o;return ip().createElement(ng(),{title:l?o:""},ip().createElement("div",{className:r.listLabelContainer},ip().createElement("div",{style:{width:uY(t)},className:r.listLabel,ref:n},o),ip().createElement("div",{className:r.visibleItemsLabel},s),l&&ip().createElement("div",{className:r.hiddenCount},`+${a}`)))};function mY(){return mY=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},mY.apply(null,arguments)}const fY=(0,O.always)(32),yY=(0,ap.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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["selectedItems","onItemClick","focusIndex","width","height"]);return ip().createElement(Fp,mY({getItemSize:fY,renderItem:(e,{item:a},i)=>{const o=!!t.find((e=>a.uri===e)),l=i===n;return ip().createElement(cd,{key:a.uri,onClick:r,checked:o,data:a,label:ip().createElement(ud.o,{text:a.label,highlight:a.filterText}),labelInText:a.label,style:e,isFocused:l,hideIcon:!0,LogoIcon:a.LogoIcon})},focusIndex:n,fixedTitle:!1,disableHorizontalScrollbar:!0,width:a,height:i},o))}));yY.displayName="SelectMetadataTypesList";const gY=(0,Sp.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 hY(){return hY=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hY.apply(null,arguments)}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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){bY(e,t,r[t])}))}return e}function bY(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const vY=(0,ap.memo)((({placeholder:e,classes:t={},items:r,selectedItemsUris:n,onChange:a,ListLabelProps:i={},disabled:o,enableEmptyValueUnderline:l,single:s,label:c,dataReltioId:u,selectionPopupTitle:p})=>{const d=gY(),[m,f]=(0,ap.useState)(!1),y=(0,ap.useCallback)((()=>f(!0)),[]),g=(0,ap.useCallback)((()=>f(!1)),[]),[h,E]=(0,ap.useState)(""),b=(0,ap.useCallback)((()=>E("")),[]),T=(0,ap.useCallback)((0,O.pipe)(b,g),[g,b]),S=r.filter((({label:e})=>v.utils.strings.search(e,h))).map(((e,t)=>({item:{item:EY({},e,{filterText:h})},index:t}))),x=(0,ap.useMemo)((()=>(0,O.pipe)((0,O.map)((e=>r.find((0,O.propEq)("uri",e)))),(0,O.reject)(O.isNil),(0,O.pluck)("label"))(n)),[n,r]),C=(0,ap.useCallback)(((e,t)=>{s?(a(t?[e.uri]:[]),T()):a(t?n.concat(e.uri):n.filter((t=>t!==e.uri)))}),[n,a,s,T]),w=(0,ap.useCallback)((({item:e})=>{const t=!n.includes(e.uri);C(e,t)}),[n,C]),{focusIndex:A,handleKeyDown:R}=Mp({items:S,open:m,onSelectFocusedItem:w,selectedItems:n,onClose:T}),_=(0,ap.useRef)(),I=_.current?_.current.getBoundingClientRect().width:0,N=Math.max(I,255),P=0===n.length;return ip().createElement(ip().Fragment,null,ip().createElement(QV(),{label:c,ref:_,InputProps:{startAdornment:P&&!e?null:ip().createElement("div",{className:up()(d.inputText,t.inputText)},P?ip().createElement("div",null,e):ip().createElement(dY,hY({},i,{list:x}))),classes:{root:d.inputRoot,input:up()(d.input,t.input,{[d.emptyInput]:P&&!e}),disabled:up()(d.disabledInput,{[d.disabledPointer]:o}),underline:d.disabledUnderline},endAdornment:ip().createElement(Op.T,{size:"L",icon:sY(),iconClassName:up()(d.icon,{[d["popup-opened-icon"]]:m}),disabled:o}),readOnly:!0,disableUnderline:P&&!l},inputProps:{tabIndex:-1},InputLabelProps:{classes:{root:up()(d.inputLabel,t.label)}},value:"",onClick:o?void 0:y,classes:{root:up()(d.root,t.root)},size:"small",variant:"filled",disabled:o,"data-reltio-id":u}),ip().createElement(Pp,{open:m,anchorEl:_.current,onClose:T,onSearch:E,title:p,containerWidth:N,containerHeight:355,searchInputOnKeyDown:R,transformOrigin:{horizontal:"left",vertical:"top"},anchorOrigin:{horizontal:"left",vertical:"bottom"},PaperProps:{"data-reltio-id":`${u}-popup`}},ip().createElement(yY,{items:S,onItemClick:C,selectedItems:n,width:N,height:245,focusIndex:A})))}));vY.displayName="MetadataTypesSelector";const TY=(0,ap.memo)((({entityTypes:e,selectedEntityTypes:t,single:r,placeholder:n,enableEmptyValueUnderline:a,onChange:i,classes:o={},ListLabelProps:l={},disabled:s=!1})=>{const c=(0,ap.useMemo)((()=>e.filter(v.isAvailableEntityType)),[e]);return ip().createElement(vY,{items:c,selectedItemsUris:t,single:r,placeholder:n,enableEmptyValueUnderline:a,onChange:i,classes:o,ListLabelProps:l,disabled:s,label:ei().text("Entity type"),dataReltioId:"entity-type-selector",selectionPopupTitle:ei().text("Select entity types")})}));TY.displayName="EntityTypesSelector";const OY=({selectedEntityTypes:e,onChange:t,classes:r={},ListLabelProps:n={}})=>{const a=(0,sp.useSelector)(A().selectors.getMetadata),i=(0,sp.useSelector)(Xa.t9),o=(0,sp.useSelector)(Ti.Xf),l=(0,ap.useCallback)(o?({uri:e})=>o.includes(e):O.identity,[o]),s=(0,ap.useMemo)((()=>a.entityTypes.filter(l).sort(o?(0,v.orderByArrayComparator)(o,"uri"):e=>0).filter((({uri:e})=>(0,v.isAvailableEntityTypeForDataTenant)(i,e)))),[a,i,l,o]);return ip().createElement(TY,{classes:r,entityTypes:s,onChange:t,selectedEntityTypes:e,ListLabelProps:n,placeholder:ei().text("All"),enableEmptyValueUnderline:!0})};OY.propTypes={selectedEntityTypes:lp().arrayOf(lp().string).isRequired,onChange:lp().func.isRequired,classes:lp().shape({root:lp().string,label:lp().string}),ListLabelProps:lp().shape({maxWidth:lp().number})};const SY=OY,xY=(0,Sp.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)"}}}}),CY=(0,O.either)((0,O.prop)("title"),(0,O.prop)("fieldName")),wY=({value:e,getLabel:t=CY,onSelectAttributeClick:r,disabled:n=!1})=>{const a=xY(),i=e&&t(e);return ip().createElement("div",{onClick:n?void 0:r,className:up()(a.attribute,{[a.attributeWithValue]:!!i},{[a.disabled]:n})},ip().createElement(ad.Y,{value:i},ip().createElement("div",{className:up()(a.name,{[a.disabled]:n})},i||ip().createElement("span",{className:a.noSelect},ei().text("Select attribute")))),ip().createElement(Op.T,{size:"M",icon:sY(),disabled:n}))},AY=(0,Sp.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 RY(){return RY=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},RY.apply(null,arguments)}function _Y(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){IY(e,t,r[t])}))}return e}function IY(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const NY=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["selectedAttributes","onItemClick","focusIndex","hideCheckBox"]);const o=AY(),l=(0,Uf.AH)();return ip().createElement(Fp,RY({getItemSize:(e,t)=>t.items?40:28,renderItem:(e,{item:i,level:o,groupId:l,groupName:s},c)=>{const u=lL(i,t),p=c===n;return ip().createElement(cd,{key:`item-${l}-${i.fieldName}`,onClick:r,checked:u,data:_Y({},i,{groupName:s}),notSelectable:i.notSelectable,hideCheckBox:a,label:ip().createElement(ud.o,{text:i.title,highlight:i.filterText}),labelInText:i.title,level:o,style:e,isFocused:p,groupId:l,LogoIcon:i.LogoIcon})},renderGroupTitle:(e,t)=>ip().createElement($m(),{component:"div",className:o.subHeader,style:e,key:`group-${t.item.id}`},t.item.needGroupIcon&&ip().createElement(Ff,{group:t.item,metadata:l}),t.item.title),focusIndex:n},i))},PY=(0,ap.memo)(NY);function DY(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){kY(e,t,r[t])}))}return e}function kY(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const LY=(e,t)=>e.title.toLowerCase().includes(t.toLowerCase()),UY=(e,t)=>LY(e,t)||(e.children||[]).some((e=>UY(e,t))),jY=(e,t)=>e.findIndex(oL(t)),FY=(0,v.getMaxItemWidth)("title"),MY=(e,t,r,n,a=0,i=!1)=>{const o=LY(e,n);return[{item:n?DY({},e,{filterText:n}):e,level:a,groupId:t,groupName:r}].concat(e.children?e.children.filter((e=>i||o||UY(e,n))).flatMap((e=>MY(e,t,r,n,a+1,i||o))):[]).flat()},VY=(0,O.curry)(((e,t)=>t.map((t=>({item:t,items:t.attributes.filter((t=>UY(t,e))).map((r=>MY(r,t.id,t.title,e)))}))).filter((e=>e.items.length)))),BY=(0,Sp.Z)({selector:{minWidth:"200px",width:"100%",alignItems:"stretch",background:"rgba(0,0,0, 0.0267)",boxSizing:"border-box",borderRadius:"4px",display:"flex"}}),zY=({className:e,itemsGroups:t,value:r,getLabel:n,onSelect:a,onRestoreFocus:i=O.identity,onOpenPopup:o=O.identity,disableRestoreFocus:l=!1,disableEnforceFocus:s=!1,single:c=!1,ungroup:u=!1,disabled:p=!1,hideCheckBox:d=!1})=>{const m=BY(),[f,y]=(0,ap.useState)(null),g=(0,ap.useCallback)((()=>y(null)),[]),h=!!f,[E,b]=(0,ap.useState)(""),v=(0,ap.useCallback)((()=>b("")),[]),[T,S]=(0,ap.useState)([]),x=(0,ap.useCallback)((()=>S([])),[]),C=(0,ap.useMemo)((()=>VY(E,t)),[t,E]),w=(0,ap.useMemo)((()=>(0,O.pipe)((0,O.when)((0,O.always)(u),(0,O.chain)((0,O.pipe)((0,O.prop)("items"),O.flatten,(0,O.map)((0,O.pick)(["item","level"]))))),Dp)(C)),[u,C]),A=(0,ap.useMemo)((()=>Math.max(FY(C),308)),[C]),R=(0,O.pipe)((0,O.tap)((0,O.pipe)(x,v,g)),i),_=(0,ap.useRef)(),I=(0,ap.useCallback)(((e,t)=>{a({checked:t,attribute:e,index:t?T.length:jY(T,e),selectedAttributes:T}),c?(S(t?[e]:[]),R({})):(S((({attribute:e,selectedAttributes:t,checked:r})=>r?t.concat(e):t.filter((t=>!oL(e,t))))({selectedAttributes:T,attribute:e,checked:t})),_.current&&_.current.focus())}),[T,a,c,R,_]),N=(0,ap.useCallback)((({onListItemClick:e,selectedAttributes:t})=>({item:r,groupData:n})=>{const a=lL(r,t);e(DY({},r,{groupName:n.groupName}),!a)})({onListItemClick:I,selectedAttributes:T}),[I,T]),{focusIndex:P,handleKeyDown:D}=Mp({items:w,open:h,onSelectFocusedItem:N,selectedItems:T,onClose:R});return ip().createElement("div",{className:up()(m.selector,e),"data-reltio-id":"attribute-selector"},ip().createElement(wY,{value:r,getLabel:n,onSelectAttributeClick:e=>{o(),y(e.currentTarget)},disabled:p}),ip().createElement(Pp,{open:h,anchorEl:f,onClose:R,onSearch:b,title:ei().text("Select attribute"),containerWidth:A,containerHeight:507,searchInputOnKeyDown:D,anchorOrigin:{horizontal:"right",vertical:"bottom"},searchInputRef:_,disableRestoreFocus:l,disableEnforceFocus:s},ip().createElement(PY,{items:w,onItemClick:I,selectedAttributes:T,width:A,height:400,focusIndex:P,hideCheckBox:d})))},HY=(0,ap.memo)(zY);var YY=r(80349);function WY(){return WY=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},WY.apply(null,arguments)}const GY=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["entityTypes","recommendedAttributes","showReferencedEntityAttributes","firstLevelAttributesFilter"]);const o=(0,sp.useSelector)(A().selectors.getMetadata),l=(0,sp.useSelector)(Xa.t9),s=(0,sp.useSelector)(A().selectors.getCanUserReadWorkflowDataTask),c=(0,sp.useSelector)(Ti.Xf),u=(0,sp.useSelector)(A().selectors.getDataTenants),p=(0,ap.useMemo)((()=>(0,O.pipe)(YY.s1,(0,O.when)((0,O.always)(!n),YY.a),(0,I.ED)(l),(e=>(0,v.filterMaskedAttributes)(o,e)))({allowedEntityTypes:c,firstLevelAttributesFilter:a},o,t,r,u,s)),[t,o,l,c,a,r,n,u,s]);return ip().createElement(HY,WY({},i,{itemsGroups:p}))},qY=(0,ap.memo)(GY),ZY=({rowData:e,rowContext:{entityTypes:t,dispatchGroupAction:r},attributeSelectorProps:n={}})=>{const a=oY(),i=e&&e.id,o=(0,ap.useCallback)((e=>{r(Uo,i,e)}),[i,r]),l=(0,ap.useCallback)((e=>(0,v.getSearchGroupAttributeLabel)({data:e})),[]);return ip().createElement(qY,{className:a.attributeSelect,value:e&&e.data,getLabel:l,entityTypes:t,onSelect:o,onRestoreFocus:n.onRestoreFocus,onOpenPopup:n.onOpen,disableRestoreFocus:n.disablePopoverRestoreFocus,disableEnforceFocus:n.disablePopoverRestoreFocus})};ZY.propTypes={rowData:YB,rowContext:lp().shape({entityTypes:lp().arrayOf(lp().string),dispatchGroupAction:lp().func}),attributeSelectorProps:lp().shape({onRestoreFocus:lp().func,onOpen:lp().func,disablePopoverRestoreFocus:lp().bool})};const $Y=(0,ap.memo)(ZY);function KY(){return KY=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},KY.apply(null,arguments)}const XY=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return ip().createElement("svg",KY({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),ip().createElement("defs",null,ip().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"})),ip().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},ip().createElement("g",null,ip().createElement("g",{transform:"translate(-2 -2)"},ip().createElement("mask",{id:"svg397942461b",fill:"#fff"},ip().createElement("use",{xlinkHref:"#svg397942461a"})),ip().createElement("g",{mask:"url(#svg397942461b)",fill:"#000",fillOpacity:".54"},ip().createElement("path",{d:"M0 0h24v24H0z"}))))))},QY=e=>!(e&&e.data),JY=({rowData:e,rowContext:{dispatchGroupAction:t}})=>{const r=oY(),n=e&&e.id,a=(0,ap.useCallback)((()=>t(Mo,n)),[n,t]),i=(0,ap.useCallback)((()=>t(Vo,n)),[n,t]),o=(0,ap.useCallback)((()=>t(Po,n)),[n,t]);return e&&ip().createElement("div",{className:up()(r.actions)},ip().createElement(ng(),{title:ei().text("Add"),placement:"bottom"},ip().createElement(zH(),{className:r.actionIcon,onClick:o})),!QY(e)&&ip().createElement(ng(),{title:ei().text("Duplicate"),placement:"bottom"},ip().createElement("div",{className:r.actionIcon,tabIndex:-1},ip().createElement(XY,{onClick:i,tabIndex:-1}))),ip().createElement(ng(),{title:ei().text("Delete"),placement:"bottom"},ip().createElement(Ep(),{onClick:a,className:r.actionIcon})))};JY.propTypes={rowData:YB,rowContext:lp().shape({dispatchGroupAction:lp().func})};const eW=(0,ap.memo)(JY),tW={BY_LABEL:(0,r(95933).c)({stringify:(0,O.prop)("label")})},rW=({className:e,attribute:t,textFieldInputRef:r,isDisabled:n,height:a,onChange:i})=>{const o=(0,O.pipe)(v.getFilterOptionLabel,HH.capitalize);return ip().createElement(aj,{label:"",placeholder:ei().text("Equals"),className:e,value:n?void 0:{value:t.filter,label:o(t.filter)},options:t&&t.data&&t.data.filterOptions.map((e=>({value:e,label:o(e)})))||[],height:a,onChange:i,isDisabled:n,filterOption:tW.BY_LABEL,textFieldInputRef:r})};rW.propTypes={className:lp().string,attribute:YB,textFieldInputRef:lp().object,isDisabled:lp().bool,onChange:lp().func,height:lp().number};const nW=(0,ap.memo)(rW),aW=({rowData:e,rowContext:{dispatchGroupAction:t},textFieldInputRef:r})=>{const n=oY(),a=e&&e.id,i=(0,ap.useCallback)((e=>t(Bo,a,e.value)),[t,a]);return ip().createElement(nW,{className:n.filterSelect,attribute:e,textFieldInputRef:r,isDisabled:QY(e),onChange:i})};aW.propTypes={rowData:YB,rowContext:lp().shape({dispatchGroupAction:lp().func}),textFieldInputRef:lp().object};const iW=(0,ap.memo)(aW);var oW=r(23821);const lW=(0,Sp.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"}}),sW=({attribute:e,groupId:t,onChange:r,updateValues:n,filterValues:a})=>{const{values:i,data:{attrType:o,fieldName:l}={},id:s}=e,c=(0,sp.useSelector)((e=>(0,Hi.Sw)(e,t,s)))||{},u=(0,sp.useSelector)((e=>(0,Hi.Ly)(e))),p=(0,sp.useSelector)((e=>(0,Xa.Sg)(e,l)));(0,ap.useEffect)((()=>{u&&n()}),[i,u,p]),(0,ap.useEffect)((()=>{u||n()}),[i,u]);const d=(0,ap.useMemo)((()=>(0,O.propOr)([],0,i)),[i]),m=(0,ap.useCallback)((0,O.pipe)(v.wrapInArray,r),[r]),{default:f,filtered:y}=c;return!f&&o?ip().createElement("div",{className:"ValuesEditor-styles-loadingWrapper--_rOmn"},ip().createElement(um(),{size:20,className:"ValuesEditor-styles-loading--mLFVu"})):ip().createElement(tg,{values:d,defaultOptions:f,filteredOptions:y,onChange:m,getSuggestions:a,tabSelectsValue:!1,canLoadMore:!(0,Ia.tW)(e.data)})};sW.propTypes={attribute:YB.isRequired,groupId:lp().string,onChange:lp().func,updateValues:lp().func,filterValues:lp().func};const cW=sW,uW=({attribute:e,dispatchGroupAction:t,groupId:r})=>{const{values:n,data:{attrType:a,fieldName:i}={},filter:o}=e,l=lW(),s=(0,v.isTypeaheadAttrType)(a)||(0,O.allPass)([(0,O.propSatisfies)((0,O.either)(O.isNil,v.isEntityTypeUri),"uri"),(0,O.prop)("faceted"),(0,O.propEq)("type",v.DataTypes.TYPE_BLOB)])(a),c=(0,v.isEnumAttrType)(a)||(0,v.isLookupAttrType)(a),u=r=>t(zo,e.id,r);if((s||c)&&(0,v.isMultiValueOption)(o)){const n=()=>t(Wo,e),a=({value:r,pageNumber:n,currentOptions:a})=>t(Ho,{attribute:e,value:r,debounceTime:500,pageNumber:n,currentOptions:a});return ip().createElement(cW,{attribute:e,groupId:r,onChange:u,filterValues:a,updateValues:n})}{const e=c?{type:v.DataTypes.TYPE_STRING}:(0,v.getAttrDataTypeDefinition)(a),t=(0,v.getDataTypeDefinitionForFilterValue)(e,o),r=(0,v.isDateType)(t.type)&&!(0,v.isDateRangeFilterOption)(o)&&l.dateRoot||(0,v.isBooleanType)(t.type)&&l.boolRoot||l.root;return ip().createElement(oW.n,{filter:{filter:o,fieldName:i,values:n||[]},onChange:u,dataTypeDefinition:t,fullWidth:!0,TextFieldProps:{InputProps:{classes:{root:l.input},disableUnderline:(0,O.isNil)(n)||(0,O.isEmpty)((0,O.flatten)(n))}},color:"primary",booleanRadioEditorClassName:l.booleanRadioEditor,classes:{root:r},orientation:"horizontal"})}};uW.propTypes={attribute:YB.isRequired,groupId:lp().string,dispatchGroupAction:lp().func};const pW=(0,ap.memo)(uW),dW=({rowData:e,rowContext:{dispatchGroupAction:t,groupId:r}})=>{const n=oY(),a=e&&(0,v.checkIfOptionHasValues)(e.filter);return ip().createElement("div",{className:n.valuesWrapper,"data-reltio-id":"advanced-search-values-editor-wrapper"},!QY(e)&&a&&ip().createElement(pW,{attribute:e,dispatchGroupAction:t,groupId:r}))};dW.propTypes={rowData:YB,rowContext:lp().shape({dispatchGroupAction:lp().func,groupId:lp().string})};const mW=(0,ap.memo)(dW),fW=({rowData:e,rowContext:{dispatchGroupAction:t}})=>{const r=oY(),n=e&&e.id,a=e&&e.operator,i=(0,ap.useCallback)((e=>t(jo,n,e)),[t,n]);return ip().createElement("div",{className:r.logicOperatorContainer},a?ip().createElement(eY,{className:r.logicOperator,value:a,onChange:i}):ip().createElement("div",{className:up()(r.logicOperator,r.logicOperatorPlaceholder)},ei().text("Where")))};fW.propTypes={rowData:YB,rowContext:lp().shape({dispatchGroupAction:lp().func})};const yW=(0,ap.memo)(fW);function gW(){return gW=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gW.apply(null,arguments)}const hW=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["showLogicOperator","group","dispatch","onAddEmptyGroup"]);const c=aY(),u=oY(),p=(0,ap.useCallback)((()=>o({type:We,payload:{groupId:r,id:(0,Me.x0)()}})),[r,o]),d=(0,ap.useCallback)((()=>o({type:He,payload:{groupId:r}})),[r,o]),m=(0,ap.useCallback)((e=>o(((e,t)=>({type:ze,payload:{groupId:e,operator:t}}))(r,e))),[r,o]),f=(0,ap.useCallback)((e=>o(((e,t)=>({type:Ve,payload:{groupId:e,entityTypes:t}}))(r,e))),[r,o]),y=(0,ap.useCallback)(((e,...t)=>o(e(r,...t))),[r,o]),g=(0,ap.useRef)(null),h=(0,ap.useRef)(null),E=(0,ap.useRef)(null);E.current=n.length;const b=(0,ap.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),g.current&&h.current!==E.current&&(g.current.querySelector("input").focus(),h.current=null)}),[]),v=(0,ap.useCallback)((()=>{h.current=n.length}),[n.length]),T=(0,ap.useMemo)((()=>[{text:ei().text("Add set"),onClick:l,id:"-group-add-set"},{text:ei().text("Duplicate set"),onClick:p,id:"-group-duplicate-set"},{text:ei().text("Delete set"),onClick:d,id:"-group-delete-set"}]),[l,p,d]),O=(0,ap.useMemo)((()=>({root:u.row})),[u]),S=(0,ap.useMemo)((()=>({onRestoreFocus:b,onOpen:v,disablePopoverRestoreFocus:!!b})),[b,v]);return ip().createElement(ip().Fragment,null,ip().createElement("div",gW({className:c.container},s),ip().createElement("div",{className:c.title},ei().text("Set")),ip().createElement("div",{className:c.entityTypeSelectorContainer},ip().createElement(SY,{classes:{root:c.entityTypeSelector},selectedEntityTypes:i,onChange:f})),ip().createElement("div",{className:c.rows},ip().createElement(QH,{rowClasses:O,rowsData:n,AttributeSelectorComponent:$Y,FilterSelectorComponent:iW,ValuesEditorComponent:mW,ActionsComponent:eW,LogicOperatorComponent:yW,filterSelectorRefIndex:h.current,filterSelectorRef:g,lastRowAttributeSelectorProps:S,entityTypes:i,groupId:r,dispatchGroupAction:y}),ip().createElement("div",{className:c.actions},ip().createElement(SN,{menuId:`query-builder-group-actions-${r}`,buttonComponent:Op.T,buttonProps:{icon:Id(),size:"L","data-reltio-id":"reltio-search-query-builder-group-actions"},menuItems:T})))),t&&ip().createElement("div",{className:c.logicOperator},ip().createElement("div",{className:up()(c.verticalOperatorLine,c.upperLine)}),ip().createElement("div",{className:up()(c.verticalOperatorLine,c.lowerLine)}),ip().createElement(eY,{value:a,onChange:m})))};hW.propTypes={showLogicOperator:lp().bool,group:lp().shape({id:lp().string,attributes:lp().arrayOf(YB),entityTypes:lp().arrayOf(lp().string),operator:lp().string}),onAddEmptyGroup:lp().func,dispatch:lp().func};const EW=(0,ap.memo)(hW);function bW(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){vW(e,t,r[t])}))}return e}function vW(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const TW=(0,Sp.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:bW({},tY),upperLine:{marginTop:-18},searchByOvContainer:{marginLeft:-6,marginBottom:-14}}))),OW=({groups:e,uiConfigShowSearchByOv:t,dispatch:r})=>{const n=TW(),a=(0,ap.useRef)(null),i=(0,ap.useRef)(null),o=(0,ap.useCallback)((()=>r({type:Ye,payload:{group:Yt([])}})),[r]);return(0,ap.useEffect)((()=>{if(0===e.length)o();else if(!(0,O.isNil)(i.current)&&i.current<e.length&&a.current){const e=a.current.childNodes;e[e.length-2].scrollIntoView({behavior:"smooth"})}i.current=e.length}),[e.length,o]),ip().createElement("div",{className:n.scrollWrapper},ip().createElement("div",{className:n.groupsContainer,ref:a},t&&ip().createElement("div",{className:n.searchByOvContainer},ip().createElement(Ih,{variant:"queryGroups"})),e.map(((e,t,n)=>ip().createElement(EW,{key:e.id,group:e,dispatch:r,showLogicOperator:t!==n.length-1,onAddEmptyGroup:o,"data-reltio-id":`reltio-search-advansed-search-group-builder-${t}`}))),ip().createElement("div",{className:n.button},ip().createElement("div",{className:up()(n.verticalOperatorLine,n.upperLine)}),ip().createElement(Gh(),{onClick:o,color:"primary",size:"small","data-reltio-id":"reltio-search-advanced-search-add-set-button"},ip().createElement(zH(),{color:"primary",className:n.icon,fontSize:"small"}),ei().text("ADD SET")))))};OW.propTypes={groups:lp().array,dispatch:lp().func,uiConfigShowSearchByOv:lp().bool};const SW=(0,sp.connect)((e=>({groups:(0,Hi.go)(e),uiConfigShowSearchByOv:A().selectors.getShowSearchByOv(e)??(0,Ti.cC)(e)})))(OW),xW=w.search.actions.updateState({}),CW=({open:e,onClose:t})=>{const r=(0,sp.useDispatch)(),n=(0,ap.useCallback)((()=>{t(),r(xW)}),[r,t]),a=(0,ap.useCallback)((()=>{t(),r(ci(!0,xW))}),[r,t]),i=(0,sp.useSelector)(co.LA),o=(0,sp.useSelector)(Xa.ai),l=(0,sp.useSelector)(co.WH),s=(0,sp.useSelector)(co.Jv),c=i?s&&!l:!o;return ip().createElement(VB.U,{open:e,title:ei().text("Search filters cannot be displayed in Quick filters"),content:ei().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:ei().text("Clear search"),saveCaption:ei().text("Save search"),disabledSave:c,onCancel:t,onDiscard:n,onSave:a})};CW.propTypes={open:lp().bool,onClose:lp().func};const wW=CW,AW=(0,sp.connect)((e=>({metadata:A().selectors.getMetadata(e),attributesPresentation:A().selectors.getAttributesPresentation(e),groups:(0,Hi.go)(e),lookups:A().selectors.getLookups(e),keyword:A().selectors.getSearchKeyword(e),map:(0,Xa.vH)(e),dataTenants:A().selectors.getDataTenants(e)})))((({metadata:e,attributesPresentation:t,lookups:r,groups:n,keyword:a,map:i,onClose:o,collapsed:l,isFullscreen:s,onCollapse:c,onExpand:u,onFullscreen:p,dataTenants:d,dispatch:m})=>{const f=TW(),[y,g]=(0,ap.useState)(!1),h=(0,O.ifElse)((0,O.always)(ka(e,n,d)),(0,O.pipe)(o,u),(()=>g(!0)));return ip().createElement("div",{className:f.container},ip().createElement(OH,{onBackBtnClick:h}),ip().createElement(SW,null),ip().createElement(VH,{groups:n,lookups:r,dispatch:m,metadata:e,attributesPresentation:t,hasMinSize:l,collapseBtnActive:!l,isFullscreen:s,onCollapseBtnClick:l?u:c,onFullScreenBtnClick:s?u:p,keyword:a,map:i}),ip().createElement(wW,{open:y,onClose:()=>g(!1)}))})),RW=({isOpenAdvancedSearch:e,onCloseAdvancedSearch:t})=>{const r=eE(),[n,a]=(0,ap.useState)(!1),[i,o]=(0,ap.useState)("50%"),l=(0,ap.useCallback)((()=>{a(!0),o("120px")}),[]),s=(0,ap.useCallback)((()=>{a(!1),o("50%")}),[]),c=(0,ap.useCallback)((({percentageSize:e,isMaxSize:t,isMinSize:r})=>{a(r),o(t?-53:e)}),[]),u=(0,ap.useCallback)((()=>{a(!1),o(-53)}),[]),p=ip().createElement(ip().Fragment,null,ip().createElement(bH,null),ip().createElement(Cf(),{className:r.divider})),d=ip().createElement(ip().Fragment,null,p,ip().createElement(AW,{collapsed:n,isFullscreen:-53===i,onClose:t,onCollapse:l,onExpand:s,onFullscreen:u}));return ip().createElement(lE,{className:r.resizablePanesWrapper,orientation:"horizontal",size:e?i:0,minSize:120,maxSize:-53,allowResize:e,onChange:c},ip().createElement("div",{className:r.pane},e&&d),ip().createElement("div",{className:r.pane},!e&&p,ip().createElement(yV,null)))};RW.propTypes={isOpenAdvancedSearch:lp().bool,onCloseAdvancedSearch:lp().func};const _W=RW;function IW(){return IW=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},IW.apply(null,arguments)}const NW=e=>ip().createElement("svg",IW({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgTenant"},e),ip().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"})),PW=(0,Sp.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)"}}))),DW=({className:e})=>{const t=PW(),r=(0,Uf.xz)(),n=(0,Uf.fN)(),a=`${r}${n?" - "+n.toUpperCase():""}`;return ip().createElement("div",{className:up()(t.labelWrapper,e)},ip().createElement(NW,{className:t.tenantIcon,"data-reltio-id":"reltio-tenant-icon"}),ip().createElement(hf(),{className:t.tenantLabel},a))},kW=(0,Sp.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)"}}))),LW=()=>{const e=kW(),t=(0,sp.useSelector)(A().selectors.getMetadata),r=(0,sp.useSelector)(Bc),n=(0,sp.useSelector)(Mc),a=(0,sp.useSelector)(Jc),i=(0,sp.useSelector)(Xa.hX),o=(0,sp.useSelector)(eu),l=(0,sp.useSelector)(Xc),s=(0,v.getEntityTypeLabel)(t,{type:r}),c=(0,sp.useSelector)(Qc),u=(0,sp.useDispatch)(),p=(()=>{const e=(0,sp.useSelector)(A().selectors.getMetadata),t=(0,sp.useSelector)(A().selectors.getLookups),r=(0,sp.useSelector)(A().selectors.getAttributesPresentation),n=(0,sp.useSelector)(Hi.go),a=(0,sp.useSelector)(A().selectors.getSearchKeyword),i=(0,sp.useSelector)(Xa.vH),o=(0,sp.useSelector)(A().selectors.getDataTenants),l=(0,sp.useSelector)(C.X0),s=(0,sp.useSelector)(C.Mp),c=(0,ap.useMemo)((()=>Object.values((0,Ia.t8)(l,s))),[l,s]);return(0,ap.useMemo)((()=>{const l=(0,O.isEmpty)(n)?(0,Go.h)(e,o,c):n;return(e=>!(1===e.length&&(0,O.isEmpty)(e[0].attributes)&&1===e[0].entityTypes.length))(l)||i||a?(0,v.buildReadableQuery)(e,r,t,l,a,i):[]}),[a,i,e,o,r,n,c,t])})();(0,ap.useEffect)((()=>{0!==i&&(a&&o>=i||!a&&o<=0)&&u(nc())}),[a,i,o,u]);const d=(0,ap.useCallback)((e=>u(((e,t)=>({type:In,payload:{filterText:e,debounceTime:t}}))(e,B.XU))),[u]);return ip().createElement(ip().Fragment,null,ip().createElement(EF(),{className:up()(e.container,{[e.borderBottom]:n>0})},ip().createElement(hf(),{component:"span",className:e.entityTypeTitle},s),ip().createElement(Cf(),{orientation:"vertical",className:e.splitter}),ip().createElement(hf(),{component:"span",className:e.profileNumber},ei().number(o,"0,0")),ip().createElement(hf(),{variant:"body2",component:"span",className:e.profileText},ei().text(" profiles are selected for bulk edit.")),0===n&&ip().createElement(ip().Fragment,null,ip().createElement(Gh(),{color:"primary",className:e.clearButton,onClick:()=>{u(nc())},"data-reltio-id":"reltio-search-bulk-update-"+(a?"select-all-profiles":"clear-selection")},a?`${ei().text("Select all")} ${ei().number(i,"0,0")} ${ei().text("profiles")}`:ei().text("Clear selection")),ip().createElement(_p,{classes:{root:e.searchBox},value:c,onSearch:d,"data-reltio-id":"reltio-search-bulk-update-search-input"}),ip().createElement(Cf(),{orientation:"vertical",className:e.splitter}),ip().createElement(xd,{entityTypeUri:r,headColumns:l,onSelectColumns:e=>{const t=(0,vi.tU)(e,l);u(oc(e)),t&&u(rc())},"data-reltio-id":"reltio-search-bulk-update-add-remove-columns"}))),0===n&&!(0,O.isEmpty)(p)&&ip().createElement(EF(),{className:e.searchQueryContainer},ei().text("Search query"),ip().createElement(CH,{readableQuery:p,className:e.searchQuery})))};function UW(){return UW=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},UW.apply(null,arguments)}const jW=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return ip().createElement("svg",UW({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),ip().createElement("defs",null,ip().createElement("path",{id:"svg3533951039a",d:"M15 6v5l2 2v2h-4v4l-.992 1L11 19v-4H7v-2l2-2V6H8V4h8v2z"})),ip().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},ip().createElement("mask",{id:"svg3533951039b",fill:"#fff"},ip().createElement("use",{xlinkHref:"#svg3533951039a"})),ip().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg3533951039b)",d:"M0 0h24v24H0z"})))};function FW(){return FW=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},FW.apply(null,arguments)}const MW=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return ip().createElement("svg",FW({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),ip().createElement("defs",null,ip().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"})),ip().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},ip().createElement("mask",{id:"svg1464898421b",fill:"#fff"},ip().createElement("use",{xlinkHref:"#svg1464898421a"})),ip().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg1464898421b)",d:"M0 0h24v24H0z"})))},VW=(0,Sp.Z)({editor:{marginBottom:0},editorValue:{width:"100%",marginRight:"8px"}}),BW=({valueProperty:e,emptyEditorValue:t,attributeType:r,value:n,fieldName:a,onChangeValue:i})=>{const o=VW(),l=!r.uri,s=(0,O.pipe)((0,O.ifElse)((0,O.has)("lookupCode"),O.identity,(0,O.objOf)("value")),(0,O.filter)((e=>void 0!==e)),(0,O.mergeRight)(t))(n);return(0,ap.useEffect)((()=>{(0,v.isLookupAttrType)(r)||""===t.value||i(e)(t)}),[]),l?ip().createElement("div",{key:e,className:up()(o.editor,o.editorValue),"data-reltio-id":"bulk-update-special-attribute-change-editor"},ip().createElement(Kk.Z,{fieldName:a,value:n,dataTypeDefinition:(0,v.getAttrDataTypeDefinition)(r),onChange:(0,O.pipe)((0,O.objOf)("value"),i(e)),fullWidth:!0})):ip().createElement(wL,{key:e,className:o.editor,mode:v.Mode.Editing,attributeType:r,attributeValue:s,onChangeAttribute:i(e)})},zW={flex:"0 0 auto"},HW=(0,Sp.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:zW,type_Boolean:zW,type_Date:zW}),YW=(0,ap.memo)((({id:e,groupId:t,operation:r,operationParameters:n})=>{const a=HW(),i=(0,sp.useDispatch)(),{attributeType:o,fieldName:l}=n.attributeTypeData,s=(0,ap.useMemo)((()=>(0,v.createNewAttribute)({parentUri:"entities/fakeEntity",attributeType:o})),[o]),c=(0,ap.useCallback)((r=>n=>{const{value:a}=n,l=""===a&&(0,v.isLookupAttrType)(o)?{lookupCode:"",value:""}:a;i(uc({id:e,groupId:t,operationParameters:{[r]:l}}))}),[e,t,o,i]),u=Lc(r).map((e=>ip().createElement(BW,{key:e,valueProperty:e,value:n[e],emptyEditorValue:s,fieldName:l,attributeType:o,onChangeValue:c})));if(!u.length)return null;const p=ip().createElement("div",{key:"to",className:a.to},ei().text("with"));return ip().createElement("div",{className:up()(a.container,a[`type_${o.type}`],{[a.singleEditor]:1===u.length})},2===u.length?(0,O.insert)(1,p,u):u)}));YW.displayName="ChangeEditor";const WW=(0,Sp.Z)((()=>({entitySelector:{marginTop:"10px",width:"100%",maxWidth:"452px"},label:{"&:not($labelShrink)":{transform:"translate(12px, 10px)"}},labelShrink:{}}))),GW=({attributeType:e,value:t,onChange:r})=>{const n=WW(),a=(0,sp.useDispatch)(),i=(0,sp.useSelector)(A().selectors.getMetadata),o=(0,sp.useSelector)((e=>A().selectors.getGlobalSearchRequestOptions(e,["ovOnly"]))),l=v.Mode.Editing,s=null==t?void 0:t.entityUri,c=(0,v.getReferencedEntityTypeUriFromAttrType)(e),u=(0,ap.useCallback)((t=>(0,v.referencedEntityAttributeTypesSelectionStrategy)(e,t)),[e]),p=(0,ap.useCallback)((e=>{const{uri:t,type:n,label:i}=e;(0,v.isTempUri)(s)&&a(w.profile.modifiedEntities.actions.entityDeleted(s)),r((0,O.isEmpty)(e)?null:{entityUri:t,entityType:n,entityLabel:i})}),[a,r,s]),d=(0,ap.useCallback)(((e,t)=>{const r=(0,v.getEntityType)(i,c),n=(0,O.pipe)(u,(0,v.getCreatableAttributeTypes)(l))(r),o=(0,v.createTemporaryEntity)({entityTypeUri:e,initValue:t,attributeTypes:n,metadata:i,mode:l});p(o),a(w.profile.modifiedEntities.actions.entityCreated(o))}),[a,p,u,i,l,c]);return ip().createElement(wU,{className:n.entitySelector,entity:t,entityTypesUris:(0,Ka.l0)(c),metadata:i,globalSearchRequestOptions:o,onChange:p,onCreate:d,height:40,disableLinkClick:!0,attributeTypesSelectionStrategy:u,mode:l,TextFieldProps:{InputLabelProps:{classes:{root:n.label,shrink:n.labelShrink}}}})},qW=e=>(0,O.last)(e.type.split("/")),ZW=e=>({attributes:{[qW(e)]:[e]}}),$W=(e,t)=>{const r=qW(e);return t.attributes[r][0]},KW=({attributeValue:e,onChange:t})=>{const r=(0,ap.useRef)(e);r.current=e;return{onChangeAttribute:(0,ap.useCallback)((({value:e,attributeType:n,uri:a})=>{const i=ZW(r.current),o=(0,v.editAttribute)({entity:i,attributeType:n,uri:a,value:e});t($W(r.current,o))}),[t]),onDeleteAttribute:(0,ap.useCallback)((({attributeType:e,uri:n})=>{const a=ZW(r.current),i=(0,v.removeAttribute)({entity:a,attributeType:e,uri:n});t($W(r.current,i))}),[t]),onAddAttributes:(0,ap.useCallback)((e=>{const n=ZW(r.current),a=e.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:a}=t;return(0,v.addAttribute)({entity:e,attributeType:r,parentUri:n,index:a})}),n);t($W(r.current,a))}),[t]),onTogglePin:(0,ap.useCallback)((e=>{const n=(({parentAttributeValue:e,uri:t})=>{const r=t.split(e.uri+"/")[1].split("/"),n=[];for(;r.length;){n.push("value");const t=r.shift(),a=r.shift();n.push(t);const i=(0,O.view)((0,O.lensPath)(n),e);if(!i)return null;const o=i.findIndex((({uri:e})=>e.endsWith("/"+a)));n.push(o)}return n.length?(n.push("pin"),(0,O.over)((0,O.lensPath)(n),O.not,e)):null})({parentAttributeValue:r.current,uri:e});n&&t(n)}),[t])}},XW=(0,Sp.Z)((e=>({pinIcon:{marginRight:"-8px"},pinIconActive:{"& svg > g > path":{fill:e.palette.primary.main,fillOpacity:1}}}))),QW=({onTogglePin:e,subAttributeValue:t})=>{const r=XW();return ip().createElement(gd.k,{icon:jW,onClick:()=>e(t.uri),size:"L",className:up()(r.pinIcon,t.pin&&r.pinIconActive)})},JW=(0,O.curry)(((e,t,{attributeValue:r})=>r.uri===e?null:ip().createElement(QW,{onTogglePin:t,subAttributeValue:r})));function eG(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const tG=({attributeType:e,attributeValue:t,onChange:r})=>{const n=(0,sp.useSelector)(A().selectors.getMetadata),a=(0,ap.useMemo)((()=>{const t=(0,v.getAttributeTypeSubAttributes)(n,e),r=(0,v.createNewAttribute)({parentUri:"entities/fakeEntity",attributeType: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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){eG(e,t,r[t])}))}return e}({},r,{value:(0,v.createDefaultValues)({attributeTypes:t,parentUri:r.uri,metadata:n,mode:v.Mode.Editing})})}),[e,n]),i=t||a,{onChangeAttribute:o,onDeleteAttribute:l,onAddAttributes:s,onTogglePin:c}=KW({attributeValue:i,onChange:r}),u=(0,ap.useCallback)(JW(i.uri,c),[i.uri,c]);return ip().createElement(FL,{attributeType:e,attributeValue:i,showEmptyEditors:!0,mode:v.Mode.Editing,metadata:n,onAddAttributes:s,onDeleteAttribute:l,onChangeAttribute:o,hideDeleteButton:!0,additionalControlsRenderer:u})};function rG(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const nG=({attributeType:e,attributeValue:t,onChange:r})=>{const n=(0,sp.useSelector)(A().selectors.getMetadata),a=(0,ap.useMemo)((()=>{const t=(0,v.getEditableAttributeTypeSubAttributes)(n,e),r=(0,v.createNewAttribute)({parentUri:"entities/fakeEntity",attributeType: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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){rG(e,t,r[t])}))}return e}({},r,{value:(0,v.createDefaultValues)({attributeTypes:t,parentUri:r.uri,metadata:n,mode:v.Mode.Editing})})}),[e,n]),i=t||a,{onChangeAttribute:o,onDeleteAttribute:l,onAddAttributes:s,onTogglePin:c}=KW({attributeValue:i,onChange:r}),u=(0,ap.useCallback)(JW(i.uri,c),[i.uri,c]);return ip().createElement(IU,{attributeType:e,attributeValue:i,showEmptyEditors:!0,mode:v.Mode.Editing,metadata:n,onAddAttributes:s,onDeleteAttribute:l,onChangeAttribute:o,hideDeleteButton:!0,additionalControlsRenderer:u})},aG=({operation:e,attributeType:t,attributeValue:r,onChange:n})=>e===$n.d.RepointReference?ip().createElement(GW,{attributeType:t,value:r,onChange:n}):(0,v.isNested)(t)?ip().createElement(tG,{attributeType:t,attributeValue:r,onChange:n}):(0,v.isReference)(t)?ip().createElement(nG,{attributeType:t,attributeValue:r,onChange:n}):null,iG=(0,O.curry)(((e,t,r)=>(0,O.assoc)(t,(0,O.prop)(e,r),(0,O.dissoc)(e,r)))),oG=(0,O.pipe)((0,O.pick)(["fieldName","title","pathToTitle","attrType"]),iG("attrType","attributeType")),lG=(0,O.unless)(O.isNil,iG("attributeType","attrType")),sG="1px solid #e4e4e4",cG=(0,Sp.Z)((e=>({mainRowContent:{display:"flex",alignItems:"center","&>*":{marginRight:8}},row:{borderBottom:sG,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}}}))),uG={enabled:!0,queueSizeThreshold:5},pG=({id:e,operation:t,operationParameters:r,groupId:n,groupAttributeType:a,hasConditions:i})=>{const o=cG(),l=(0,sp.useDispatch)(),s=(0,sp.useSelector)(Bc),c=(0,Ka.l0)(s),{pin:u,addNestedAttribute:p,attributeTypeData:d}=r||{},{attributeType:m}=d||{},f=t&&d,y=(0,ap.useCallback)((({attribute:t,checked:r})=>{r&&l((({id:e,groupId:t,attribute:r})=>({type:kn,payload:{id:e,groupId:t,attribute:r}}))({id:e,groupId:n,attribute:oG(t)}))}),[e,n,l]),g=(0,ap.useCallback)((t=>{l(uc({id:e,groupId:n,operationParameters:{attributeValue:t}}))}),[l,e,n]),h=(0,ap.useCallback)((()=>{l((({id:e,groupId:t})=>({type:Wn,payload:{id:e,groupId:t}}))({id:e,groupId:n}))}),[e,n,l]),E=(0,ap.useCallback)((()=>{l((({id:e,groupId:t})=>({type:Gn,payload:{id:e,groupId:t}}))({id:e,groupId:n}))}),[e,n,l]),b=(0,ap.useCallback)((()=>{l(cc({id:e,groupId:n}))}),[e,n,l]),T=(0,ap.useCallback)((t=>{l((({id:e,groupId:t,operation:r})=>({type:Ln,payload:{id:e,groupId:t,operation:r}}))({id:e,groupId:n,operation:t.value}))}),[e,n,l]),S=(0,v.isComplexAttribute)(m)&&[$n.d.AddNew,$n.d.ReplaceAllWith,$n.d.RepointReference].includes(t),x=[$n.d.AddNew,$n.d.ReplaceAllWith,$n.d.FindAndReplace].includes(t)&&!(null==m||!m.uri),C=a&&m&&m.uri===a.uri,w=n&&!C&&t===$n.d.AddNew&&!(0,v.isReference)(a),A=(0,ap.useMemo)((()=>{return m?(e=m,t=i&&C,(0,O.cond)([[(0,O.both)(v.isNested,(0,O.always)(t)),(0,O.always)((0,O.without)([$n.d.AddNew,$n.d.ReplaceAllWith],B.DY))],[v.isNested,(0,O.always)(B.DY)],[(0,O.both)(v.isReference,(0,O.always)(t)),(0,O.always)((0,O.without)([$n.d.AddNew],B.hS))],[v.isReference,(0,O.always)(B.hS)],[O.T,(0,O.always)(B.pG)]])(e)).map((e=>({value:$n.d[e],label:B.WN[e]}))):[];var e,t}),[i,m,C]),R=(0,ap.useMemo)((()=>A.find((e=>e.value===t))),[t,A]),_=(0,ap.useMemo)((()=>lG(d)),[d]),I=(0,ap.useCallback)(a?(0,YY.xM)(a):(0,O.ifElse)(YY.XF,(0,O.pipe)((0,O.pathEq)(["fieldName"],"tags")),(0,O.pipe)((0,O.prop)("attrType"),(0,O.both)((0,O.complement)(v.isImage),(0,O.complement)(v.isAnalyticAttribute)))),[a]),N=(0,ap.useCallback)((e=>(0,v.getSearchGroupAttributeLabel)({data:e})),[]);return(0,ap.useEffect)((()=>{!R&&A[0]&&d&&T(A[0])}),[A,R,d,T]),(0,ap.useEffect)((()=>{u&&!x&&h()}),[x,u,h]),(0,ap.useEffect)((()=>{p&&!w&&E()}),[w,p,E]),ip().createElement("div",{"data-reltio-id":"bulk-update-dialog-action-row",className:up()(o.row,{[o.withoutLine]:!!n})},ip().createElement("div",{className:o.mainRowContent},ip().createElement(qY,{className:o.attrSelector,single:!0,showReferencedEntityAttributes:!1,entityTypes:c,value:_,onSelect:y,firstLevelAttributesFilter:I,ungroup:!!n,getLabel:N}),ip().createElement(aj,{label:"",isDisabled:!_,placeholder:ei().text("Select operation"),className:o.operationSelector,value:R,options:A,height:40,onChange:T}),f&&ip().createElement(ip().Fragment,null,!S&&ip().createElement(YW,{id:e,groupId:n,operation:t,operationParameters:r}),ip().createElement("div",{className:o.icons},x&&ip().createElement(gd.k,{className:up()(o.actionIcon,{[o.actionIconActive]:u}),size:"M",tooltipTitle:ei().text("Make this Operational Value"),icon:jW,onClick:h}),w&&ip().createElement(gd.k,{className:up()(o.actionIcon,{[o.actionIconActive]:p}),size:"M",tooltipTitle:ei().text("Create parent attribute if none exists"),icon:MW,onClick:E}),ip().createElement(gd.k,{size:"M",tooltipTitle:ei().text("Delete"),icon:Ep(),onClick:b})))),f&&S&&ip().createElement(cL.Provider,{value:uG},ip().createElement(aG,{operation:t,attributeType:m,attributeValue:r.attributeValue,onChange:g})))},dG=(0,ap.memo)(pG);var mG=r(80510),fG=r.n(mG);function yG(){return yG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},yG.apply(null,arguments)}const gG=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeType","showReferencedEntityAttributes","subattributesGroupTitle","additionalItemsGroups"]);const o=(0,sp.useSelector)(A().selectors.getMetadata),l=t.uri.split("/").slice(0,3).join("/"),s=(0,Ka.l0)(l),c=(0,ap.useCallback)((0,YY.xM)(t),[t]),u=(0,ap.useMemo)((()=>(0,O.pipe)(YY.s1,(0,O.when)((0,O.always)(!r),YY.a),(0,O.map)((0,O.evolve)({attributes:(0,O.pathOr)([],[0,"children"]),title:(0,O.when)((0,O.always)(n),(0,O.always)(n))})),(0,O.when)((0,O.always)(a),(0,O.concat)(a)))({firstLevelAttributesFilter:c},o,s)),[a,n,r,s,o,c]);return ip().createElement(HY,yG({},i,{ungroup:!a,itemsGroups:u}))},hG=(0,ap.memo)(gG);function EG(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){bG(e,t,r[t])}))}return e}function bG(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const vG=(e,t)=>(0,Da.nT)(`${B.E_}_group`,ei().text("Profile"),[EG({},(0,Da.o)(EG({title:(0,v.getEntityTypeLabel)(t,{type:(0,v.getReferencedEntityTypeUriFromAttrType)(e)}),fieldName:B.E_},e)),{enforcedFilterOptions:[v.FilterOptions.EQUALS]})]),TG=(0,Sp.Z)({selector:{width:"254px",height:"40px"}}),OG=(0,ap.memo)((({rowData:e,rowContext:{attributeType:t,dispatchGroupAction:r},attributeSelectorProps:n={}})=>{const a=TG(),i=(0,sp.useSelector)(A().selectors.getMetadata),o=e&&e.id,l=(0,ap.useMemo)((()=>(0,v.isReference)(t)?[vG(t,i)]:null),[t,i]),s=(0,ap.useCallback)((e=>{r(fc,o,e)}),[o,r]);return ip().createElement(hG,{className:a.selector,value:e&&e.data,attributeType:t,additionalItemsGroups:l,subattributesGroupTitle:(0,v.isReference)(t)?ei().text("Reference attributes"):"",onSelect:s,onRestoreFocus:n.onRestoreFocus,onOpenPopup:n.onOpen,disableRestoreFocus:n.disablePopoverRestoreFocus,disableEnforceFocus:n.disablePopoverRestoreFocus})}));OG.displayName="ConditionAttributeSelector";const SG=e=>!(e&&e.data),xG=(0,O.pathEq)(["data","fieldName"],B.E_),CG=(0,Sp.Z)({selector:{width:"190px"}}),wG=(0,ap.memo)((({rowData:e,rowContext:{dispatchGroupAction:t},textFieldInputRef:r})=>{const n=CG(),a=e&&e.id,i=(0,ap.useCallback)((e=>t(gc,a,e.value)),[t,a]);return ip().createElement(nW,{height:40,className:n.selector,attribute:e,textFieldInputRef:r,isDisabled:SG(e),onChange:i})}));wG.displayName="ConditionFilterSelector";const AG=(0,Sp.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:{}}),RG=(0,ap.memo)((({condition:e,dispatchGroupAction:t})=>{const{values:r=[],data:{attrType:n,fieldName:a}={},filter:i}=e,o=AG(),l=(0,sp.useSelector)(A().selectors.getMetadata),s=(0,sp.useSelector)((e=>A().selectors.getGlobalSearchRequestOptions(e,["ovOnly"]))),c=(0,ap.useCallback)((r=>t(hc,e.id,r)),[t,e.id]),u=(0,ap.useCallback)((({uri:e,type:t,label:r})=>{c([{entityUri:e,entityType:t,entityLabel:r}])}),[c]),p=(0,v.getAttrDataTypeDefinition)(n),d=(0,v.getDataTypeDefinitionForFilterValue)(p,i);return xG(e)?ip().createElement(wU,{className:o.entitySelector,entity:r[0],entityTypesUris:(0,Ka.l0)((0,v.getReferencedEntityTypeUriFromAttrType)(n)),metadata:l,mode:v.Mode.Editing,globalSearchRequestOptions:s,onChange:u,height:40,disableLinkClick:!0,TextFieldProps:{InputLabelProps:{classes:{root:o.entitySelectorLabel,shrink:o.entitySelectorLabelShrink}}}}):ip().createElement(oW.n,{filter:{filter:i,fieldName:a,values:r||[]},onChange:c,dataTypeDefinition:d,fullWidth:!0,TextFieldProps:{InputProps:{classes:{root:o.input}}},color:"primary",classes:{root:o.root},orientation:"horizontal"})}));RG.displayName="ConditionValuesEditor";const _G=(0,Sp.Z)({root:{width:"100%",display:"flex",minHeight:"40px",alignItems:"flex-start",boxSizing:"border-box"}}),IG=(0,ap.memo)((({rowData:e,rowContext:{dispatchGroupAction:t}})=>{const r=_G(),n=SG(e),a=e&&(0,v.checkIfOptionHasValues)(e.filter);return ip().createElement("div",{className:r.root},!n&&a&&ip().createElement(RG,{condition:e,dispatchGroupAction:t}))}));IG.displayName="ConditionValuesEditorWrapper";const NG=(0,Sp.Z)({root:{paddingTop:"8px",height:"24px",display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:"0"}}),PG=(0,ap.memo)((({rowData:e,rowContext:{dispatchGroupAction:t}})=>{const r=NG(),n=e&&e.id,a=(0,ap.useCallback)((()=>t(yc,n)),[n,t]);return e?ip().createElement("div",{className:r.root},ip().createElement(gd.k,{tooltipTitle:ei().text("Delete"),tooltipPlacement:"bottom",icon:Ep(),size:"M",onClick:a})):null}));PG.displayName="ConditionActions";const DG=(0,Sp.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"}}))),kG=({attributeType:e,conditions:t,groupId:r})=>{const n=DG(),a=(0,sp.useDispatch)(),i=(0,ap.useCallback)(((e,...t)=>a(e(r,...t))),[r,a]),o=(0,ap.useMemo)((()=>({root:n.row,logicOperatorContainer:n.logicOperatorContainer,actionsContainer:n.actions})),[n]);return ip().createElement(ip().Fragment,null,ip().createElement(hf(),{variant:"caption",component:"div",className:n.caption},ei().text("If the following conditions are met")),ip().createElement(QH,{className:n.conditions,rowClasses:o,rowsData:t,AttributeSelectorComponent:OG,FilterSelectorComponent:wG,ValuesEditorComponent:IG,ActionsComponent:PG,attributeType:e,dispatchGroupAction:i}),ip().createElement(hf(),{variant:"caption",component:"div",className:n.caption},ei().text("Then perform the change")))},LG=(0,Sp.Z)((e=>({complexRow:{borderBottom:sG,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 UG(){return UG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},UG.apply(null,arguments)}const jG=(0,ap.memo)((({id:e,fieldName:t,actions:r,conditions:n})=>{const a=LG(),i=(0,sp.useDispatch)(),o=(0,sp.useSelector)(Bc),l=(0,sp.useSelector)(A().selectors.getMetadata),s=(0,ap.useMemo)((()=>{const e=(0,v.searchUriToAttrUri)(t,o);return(0,v.findAttributeTypeByUri)(l,e,o)}),[l,t,o]),c=!!n,u=((e,t)=>(0,O.any)((0,O.both)((0,O.pipe)((0,O.prop)("operation"),(0,O.includes)(O.__,[$n.d.AddNew,$n.d.ReplaceAllWith])),(0,O.pathEq)(["operationParameters","attributeTypeData","attributeType","uri"],t.uri)))(e))(r,s),p=(0,ap.useCallback)((()=>i({type:Fn,payload:e})),[e,i]),d=(t={})=>ip().createElement(dG,UG({key:t.id},t,{groupId:e,groupAttributeType:s,hasConditions:c}));return(0,ap.useEffect)((()=>{c||0!==r.length||i(cc({id:e,groupId:void 0}))}),[e,c,r.length,i]),ip().createElement("div",{className:a.complexRow},ip().createElement("div",{className:a.header},ip().createElement("div",{className:a.attributeLabel},s.label),ip().createElement(Gh(),{disabled:u,color:"primary",className:a.conditionsToggleButton,onClick:p},c?ip().createElement(ip().Fragment,null,ip().createElement(fG(),{className:a.conditionsToggleIcon}),ei().text("Remove")," "):ip().createElement(ip().Fragment,null,ip().createElement(zH(),{className:a.conditionsToggleIcon}),ei().text("Add")," "),ei().text("conditions"))),n&&ip().createElement(kG,{attributeType:s,conditions:n,groupId:e}),ip().createElement("div",{className:a.actionsBlock},r.map(d),d()))}));jG.displayName="ComplexActionRow";const FG=(0,Sp.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 MG(){return MG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},MG.apply(null,arguments)}const VG=e=>"actions"in e?ip().createElement(jG,MG({key:e.id},e)):ip().createElement(dG,MG({key:e.id},e)),BG=()=>{const e=FG(),t=(0,sp.useSelector)(ru);return ip().createElement("div",{className:e.wrapper},ip().createElement("div",{className:e.container},t.map(VG),ip().createElement(dG,null)))};var zG=r(99261),HG=r.n(zG),YG=r(26518),WG=r.n(YG),GG=r(60158),qG=r.n(GG),ZG=r(61887),$G=r.n(ZG);const KG=(0,Sp.Z)((()=>({buttonWrapper:{position:"relative"},progress:{position:"absolute",left:"calc(50% - 12px)",top:"calc(50% - 12px)"}})));function XG(){return XG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},XG.apply(null,arguments)}const QG=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["isInProgress","disabled","circularColor","className","children"]);const l=KG();return ip().createElement(Gh(),XG({},o,{className:up()(l.buttonWrapper,a),disabled:r||t}),i,t&&ip().createElement("div",{className:l.progress,"data-reltio-id":"reltio-circular-load-indicator"},ip().createElement(um(),{size:24,color:n})))},JG=(0,Sp.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"}}))),eq=({activeStep:e,steps:t,isPending:r=!1,shouldCompleteSteps:n=!0,onConfirm:a,onChangeStep:i})=>{const o=JG(),l=e===t.length-1,s=t=>{t!==e&&i(t)},c=(0,O.propOr)(!0,"enabled"),u=e=>{if(e>0){const r=e-1;c(t[r])?s(r):u(r)}},p=e=>{if(e<t.length-1){const r=e+1;c(t[r])?s(r):p(r)}},d=l&&!!a,m=d||(0,O.any)(c,(0,O.drop)(e+1,t));return ip().createElement("div",{className:o.container},ip().createElement("div",{className:o.placeholder}),ip().createElement(HG(),{nonLinear:!0,activeStep:e,className:o.stepper},t.map((({label:t,enabled:a=!0,hasError:i,hasWarning:l},c)=>{const u=!a||r,p=n&&!u&&c<e;return ip().createElement(WG(),{key:t,completed:p,disabled:u},ip().createElement(qG(),{className:o.stepButton,onClick:()=>s(c),"data-reltio-id":`reltio-search-bulk-update-${c}`},ip().createElement($G(),{error:i||l,classes:{error:i?o.errorLabel:o.warningLabel}},t)))}))),ip().createElement("div",{className:o.buttons},e>0&&ip().createElement(Gh(),{variant:"outlined",className:o.backButton,onClick:()=>u(e),disabled:r,"data-reltio-id":"reltio-search-bulk-update-back"},ei().text("Back")),ip().createElement(QG,{variant:"contained",color:"primary",disabled:!m,isInProgress:r,onClick:l?a:()=>p(e),"data-reltio-id":"reltio-search-bulk-update-"+(l?"confirm":"continue")},d?ei().text("Confirm"):ei().text("Continue"))))},tq=()=>{const e=(0,sp.useDispatch)(),t=(0,sp.useSelector)(Mc),r=(0,sp.useSelector)(tu),n=(0,sp.useSelector)(Fc),a=!(0,O.isNil)(n),i=(0,sp.useSelector)(iu),o=(0,sp.useSelector)(ou),l=[{label:ei().text("Select profiles")},{label:ei().text("Select operation"),enabled:r},{label:ei().text("Define changes"),enabled:r&&a&&n===B.dV.UpdateProfiles},{label:ei().text("Review changes"),enabled:r&&a&&(i||n===B.dV.DeleteProfiles)}];return ip().createElement(eq,{activeStep:t,steps:l,isPending:o,onChangeStep:t=>e((e=>({type:bn,payload:e}))(t)),onConfirm:()=>e({type:qn})})},rq=(0,Sp.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"}}))),nq=({children:e,onClose:t})=>{const r=rq();return ip().createElement(gF(),{position:"static",color:"default",className:r.appBar},ip().createElement(EF(),{className:r.toolbar},ip().createElement(gd.k,{edge:"start",tooltipTitle:ei().text("Close"),"aria-label":ei().text("Close"),icon:Ep(),onClick:t,className:r.closeButton,size:"L","data-reltio-id":"reltio-search-bulk-update-close"}),ip().createElement(hf(),{variant:"h6",className:r.title},e)),ip().createElement(EF(),{className:r.toolbar},ip().createElement(tq,null)))};nq.propTypes={children:lp().node,onClose:lp().func};const aq=nq,iq=(0,Sp.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"}}))),oq=(0,O.equals)(B.v6.include);function lq(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const sq=()=>{const e=iq(),t=(0,sp.useDispatch)(),r=(0,sp.useSelector)(A().selectors.getMetadata),n=(0,sp.useSelector)(Bc),a=(0,sp.useSelector)(Xc),i=(0,sp.useSelector)(Wc),o=(0,sp.useSelector)($c),l=(0,sp.useSelector)(Kc),s=(0,sp.useSelector)(Hc),c=(0,sp.useSelector)(qc),u=(0,sp.useSelector)(Zc),p=(0,sp.useSelector)(Vc),d=(0,sp.useSelector)(Gc),m=(0,sp.useSelector)(Yc),f=(0,ap.useMemo)((()=>((e,t,r)=>(0,O.pipe)((0,O.map)((0,O.prop)("uri")),oq(e)?(0,O.intersection)(t):(0,O.without)(t))(r))(m,d,i)),[m,d,i]),y=((e,t)=>0!==e.length&&(e.length===t.length||null))(f,i),g=(0,ap.useMemo)((()=>(0,vi.oq)(r,n,a)),[r,n,a]),h=(0,ap.useCallback)((({field:e,order:r})=>t((({field:e,order:t})=>({type:An,payload:{field:e,order:t}}))({field:r?e:null,order:r}))),[t]),E=(0,ap.useCallback)((({what:e,where:r})=>{const n=(0,O.move)(e.columnIndex,r.columnIndex,a);t(oc(n))}),[t,a]),b=(0,ap.useCallback)((({columns:e})=>{const r=(0,vi.tU)(e,a);t(oc(e)),r&&t(rc())}),[t,a]),v=(0,ap.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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){lq(e,t,r[t])}))}return e}({},t,{size:e[r].size})));t(oc(r))}),[t,a]),T=(0,ap.useCallback)(((e,r)=>{t(e?((e,t)=>({type:On,payload:{uri:e,checked:t}}))(e,r):{type:Sn,payload:!y})}),[y,t]),S=(0,ap.useRef)(null);return ip().createElement("div",{className:e.tableContainer},p&&ip().createElement(wE.z,null),ip().createElement(nf,{entities:i,entityTypeUri:n,headColumns:a,additionalColumns:g,canCheck:!0,onCheck:T,checkedEntitiesUris:f,headerCheckboxState:y,dndColumnReorderingEnabled:!0,sortField:o,sortOrder:l,onSort:h,onReorderingColumn:E,onChangeColumnsList:b,onChangeColumnsSize:v,entitiesTableRef:S}),s>B.Tu[0]&&ip().createElement("div",{className:e.pagination},ip().createElement(gE.Z,{count:s,rowsPerPageOptions:B.Tu,rowsPerPage:u||B.Tu[0],page:c||0,onChangePage:e=>t(ic(e)),onChangeRowsPerPage:e=>t((e=>({type:Cn,payload:e}))(e)),basicTableRef:S})))},cq=(0,Sp.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"}}))),uq=()=>{const e=cq(),t=(0,sp.useDispatch)(),r=(0,sp.useSelector)(Fc),n=(0,sp.useSelector)(A().selectors.getCanUserDeleteProfiles);(0,ap.useEffect)((()=>{(0,O.isNil)(r)&&t(sc(B.dV.UpdateProfiles))}),[r,t]);const a=(0,O.pipe)(Tp.NA,sc,t);return ip().createElement("div",{className:e.tableContainer},ip().createElement(hf(),{className:e.title},ei().text("Choose Bulk Update Operation")),ip().createElement(Eh(),{value:r,onChange:a},ip().createElement(vh(),{classes:{label:e.label},value:B.dV.UpdateProfiles,control:ip().createElement(gh(),{className:e.radioButton}),label:ei().text("Update Profiles - Update attribute values of selected profiles")}),ip().createElement(vh(),{disabled:!n,classes:{label:e.label},value:B.dV.DeleteProfiles,control:ip().createElement(gh(),{className:e.radioButton}),label:ei().text("Delete Profiles - Delete selected profiles")})))};var pq=r(49850),dq=r.n(pq),mq=r(28012),fq=r.n(mq),yq=r(18878),gq=r.n(yq),hq=r(70918),Eq=r.n(hq),bq=r(51159),vq=r.n(bq),Tq=r(35681),Oq=r.n(Tq);const Sq=({value:e,attributeType:t,lookups:r})=>((0,v.isLookupAttrType)(t)&&"string"==typeof e&&(e={lookupCode:e,value:(0,v.getResolvedLookupValue)(r,(0,v.getAttrTypeLookupCode)(t),e)}),ip().createElement(Md.x,{dataTypeDefinition:(0,v.getAttrDataTypeDefinition)(t),value:e})),xq=({operation:e})=>ip().createElement(ip().Fragment,null,B.WN[e]),Cq=({conditions:e,attributesPresentation:t,metadata:r,lookups:n})=>{if((0,v.isEmptyValue)(e))return ip().createElement(ip().Fragment,null,"-");const a=(0,v.buildAttributesReadableQuery)(r,t,n,e,!1);return ip().createElement(CH,{readableQuery:a})},wq="8px",Aq="1px",Rq="1px solid #AFD4E9",_q=(0,Sp.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:Aq,left:wq,top:0,borderLeft:Rq}},scaffoldHalfVert:{"&:before":{content:'""',position:"absolute",display:"block",boxSizing:"border-box",height:"50%",width:Aq,left:wq,top:0,borderLeft:Rq}},scaffoldHor:{"&:after":{content:'""',position:"absolute",display:"block",boxSizing:"border-box",height:Aq,width:"5px",left:wq,top:"50%",borderBottom:Rq}},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%"}}))),Iq=({attributeTypeData:{pathToTitle:e,title:t}})=>{const r=_q();return Boolean(e&&e.length>2)?ip().createElement(cg,{placement:"bottom-start",pathToTitle:e},ip().createElement("span",{className:r.nestedLabel},t)):ip().createElement(ip().Fragment,null,t)};function Nq(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function Pq(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Dq(e,t,r[t])}))}return e}function Dq(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const kq={EMPTY:"empty",FULL_VERT:"full_vert",FULL_VERT_HOR:"full_vert_hor",HALF_VERT_HOR:"half_vert_hor"},Lq=e=>e.map(((t,r)=>(({hasLowerSubAttrs:e,isFirstValue:t,isLastScaffold:r})=>{const n=r&&t;return e?n?kq.FULL_VERT_HOR:kq.FULL_VERT:n?kq.HALF_VERT_HOR:kq.EMPTY})(Pq({},t,{isLastScaffold:r===e.length-1})))),Uq=({operation:e,operationParameters:t})=>(0,v.wrapInArrayIfNeeded)(Pq({},t,{operation:e})),jq=(e,t,r=[],n=[])=>{const a=(0,v.findAttributeTypeByUri)(e,t.type),i=a.label||a.name,o={attributeTypeData:{attributeType:a,title:i,pathToTitle:[...r,i]},scaffolds:Lq(n),pin:t.pin};if((0,v.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 jq(e,t,[...r,i],[...n,s])}))));return[o,...l]}return[Pq({},o,{attributeValue:(0,v.getAttributeValue)(t)})]},Fq=(0,O.curry)(((e,{operation:t,operationParameters:r})=>{const{attributeValue:n,attributeTypeData:a}=r,i=Nq(r,["attributeValue","attributeTypeData"]),[o,...l]=jq(e,n,a.pathToTitle.slice(0,-1));return[Pq({},o,{operation:t},i),...l]})),Mq=(0,O.curry)(((e,{operation:t,operationParameters:r})=>{const{attributeValue:n,attributeTypeData:a}=r,i=Nq(r,["attributeValue","attributeTypeData"]),[o,...l]=jq(e,n,a.pathToTitle.slice(0,-1)),{label:s,refEntity:c}=n,[{objectURI:u,type:p}]=c;return[Pq({},o,{operation:t},i,{attributeValue:{entityUri:u,entityLabel:s,entityType:p}}),...l]})),Vq=(0,O.curry)(((e,t)=>(0,O.cond)([[Nc,Fq(e)],[Pc,Mq(e)],[O.T,Uq]])(t))),Bq=(0,O.curry)(((e,t)=>(0,O.pipe)((0,O.defaultTo)([]),(0,O.chain)((0,O.ifElse)(vc,(0,O.pipe)(Tc,Bq(e)),Vq(e))))(t))),zq=({scaffold:e})=>{const t=_q();return ip().createElement("div",{className:up()(t.scaffold,{[t.scaffoldFullVert]:e===kq.FULL_VERT||e===kq.FULL_VERT_HOR,[t.scaffoldHalfVert]:e===kq.HALF_VERT_HOR,[t.scaffoldHor]:e===kq.FULL_VERT_HOR||e===kq.HALF_VERT_HOR})})};zq.propTypes={scaffold:lp().oneOf((0,O.values)(kq))};const Hq=({scaffolds:e})=>{const t=_q();return ip().createElement("div",{className:t.scaffoldsContainer},e.map(((e,t)=>ip().createElement(zq,{key:t,scaffold:e}))))};Hq.propTypes={scaffolds:lp().arrayOf(zq.propTypes.scaffold)};const Yq=Hq,Wq=({children:e})=>{const t=_q();return ip().createElement("div",{className:t.noWrapContainer},e)};Wq.propTypes={children:lp().node};const Gq=Wq,qq=({pin:e,addParent:t})=>{const r=_q();return ip().createElement(Gq,null,ip().createElement("div",{className:up()(r.optionContainer,{[r.opaque]:!e})},ip().createElement(jW,null)),ip().createElement("div",{className:up()(r.optionContainer,{[r.opaque]:!t})},ip().createElement(MW,null)))};qq.propTypes={pin:lp().bool,addParent:lp().bool};const Zq=qq,$q=({entity:{entityLabel:e,entityUri:t},attributeType:r})=>{const n=_q(),a=(0,sp.useSelector)((e=>A().selectors.getModifiedEntity(e,t)))||null,i=(0,sp.useSelector)(A().selectors.getMetadata),o=(0,ap.useCallback)((()=>{const e=(0,v.getReferencedEntityTypeUriFromAttrType)(r),t=(0,v.getEntityType)(i,e);return(0,v.evaluateDeepEntityLabel)(a,t.dataLabelPattern)}),[r,i,a]),l=a?o():e;return ip().createElement(Gq,null,(0,v.getLabel)(l),(0,v.isTempUri)(t)&&ip().createElement("div",{className:n.newIcon},ei().text("New")))},Kq=(0,Sp.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%"}}))),Xq=()=>{const e=Kq(),t=(0,sp.useSelector)(nu),r=(0,sp.useSelector)(A().selectors.getMetadata),n=(0,sp.useSelector)(A().selectors.getAttributesPresentation),a=(0,sp.useSelector)(A().selectors.getLookups),i=(0,ap.useMemo)((()=>Bq(r,t)),[t,r]);return ip().createElement(Eq(),{className:e.tableContainer,component:VI()},ip().createElement(dq(),{className:e.table},ip().createElement(vq(),null,ip().createElement(Oq(),null,ip().createElement(gq(),{className:e.attributeColumn},ei().text("Attribute")),ip().createElement(gq(),{className:e.conditionColumn},ei().text("Condition")),ip().createElement(gq(),{className:e.operatorColumn},ei().text("Operator")),ip().createElement(gq(),{className:e.valueColumn,colSpan:2}),ip().createElement(gq(),{className:e.valueColumn}),ip().createElement(gq(),{className:e.optionsColumn}))),ip().createElement(fq(),null,i.map((({scaffolds:e,attributeTypeData:t,conditions:i,operation:o,attributeValueToFind:l,attributeValue:s,pin:c,addNestedAttribute:u},p)=>{const d=!(0,O.isNil)(s),m=!(0,O.isNil)(l);return ip().createElement(Oq(),{key:p},ip().createElement(gq(),null,ip().createElement(Gq,null,e&&ip().createElement(Yq,{scaffolds:e}),ip().createElement(Iq,{attributeTypeData:t}))),ip().createElement(gq(),null,ip().createElement(Cq,{attributesPresentation:n,metadata:r,lookups:a,conditions:i})),ip().createElement(gq(),null,o&&ip().createElement(xq,{operation:o})),ip().createElement(gq(),null,m&&ip().createElement(Sq,{lookups:a,attributeType:t.attributeType,value:l})),ip().createElement(gq(),{align:"right"},m&&d&&ip().createElement(Gq,null,ip().createElement("span",null,ei().text("with")))),ip().createElement(gq(),null,d&&((0,v.isReference)(t.attributeType)?ip().createElement($q,{entity:s,attributeType:t.attributeType}):ip().createElement(Sq,{lookups:a,attributeType:t.attributeType,value:s}))),ip().createElement(gq(),{align:"right"},ip().createElement(Zq,{pin:c,addParent:u})))})))))},Qq=(0,Sp.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=Qq(),t=(0,sp.useSelector)(Fc),r=(0,sp.useSelector)(eu);return t===B.dV.UpdateProfiles?ip().createElement(Xq,null):ip().createElement("div",{className:e.tableContainer},ip().createElement("div",{className:e.text},ip().createElement("p",null,`${ei().text("Please confirm that you wish to start deletion of the selected")}`,ip().createElement("b",null,` ${ei().number(r,"0,0")} `),ei().text(" profiles.")),ip().createElement("p",null,ei().text("Click on Confirm to proceed."))))},eZ=(0,Sp.Z)((()=>({contentRoot:{padding:"0 0 5px",position:"relative",backgroundColor:"#FAFAFA"},tenantLabel:{marginLeft:"23px"}}))),tZ=()=>{const e=eZ(),t=(0,sp.useSelector)(Ti.Ue),r=(0,sp.useSelector)(Mc),n=(0,sp.useDispatch)(),a=()=>n(bi(!1));return ip().createElement(Ij(),{fullScreen:!0,open:t,onClose:a,disableEnforceFocus:!0},ip().createElement(aq,{onClose:a},ei().text("Bulk update"),ip().createElement(DW,{className:e.tenantLabel})),ip().createElement(LW,null),ip().createElement(fF(),{classes:{root:e.contentRoot}},(()=>{switch(r){case 0:return ip().createElement(sq,null);case 1:return ip().createElement(uq,null);case 2:return ip().createElement(BG,null);case 3:return ip().createElement(Jq,null)}})()))},rZ="1px solid rgba(0, 0, 0, 0.33)",nZ=(0,Sp.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:rZ},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:rZ,boxShadow:"0 1px 3px 0 rgba(0,0,0,0.12)"}}))),aZ=(0,id.T)(bf()),iZ=(0,sp.connect)((e=>({isReadyAppData:!!(0,Ti.$s)(e),openAdvancedSearch:(0,Ti.IJ)(e),tenant:A().selectors.getTenant(e)})))((({openAdvancedSearch:e,isReadyAppData:t,tenant:r,dispatch:n})=>{const a=(0,ap.useCallback)((()=>{n({type:R.k.CONVERT_FROM_ADVANCED_SEARCH}),n(ui(!1))}),[n]),i=(0,ap.useCallback)((()=>{n(ui(!0)),n({type:ot})}),[n]),[o,l]=(0,ap.useState)(!0),s=(0,ap.useCallback)((e=>{l(e<=0)}),[]),c=nZ(),u=!e;return(0,ap.useEffect)((()=>()=>v.memoizeWith.clearCache()),[r]),t?ip().createElement(ip().Fragment,null,ip().createElement("div",{className:c.root},ip().createElement(yf,{variant:"persistent",anchor:"left",open:u,classes:{root:c.drawer,paper:c.drawerPaper,docked:c.docked},"data-reltio-id":"reltio-search-facet-search-panel"},ip().createElement(aZ,{tooltipTitle:ei().text("Switch to Advanced search"),tooltipPlacement:"bottom-end",variant:"extended",classes:{root:c.buttonRoot,extended:c.buttonExtended},onClick:i,"data-reltio-id":"reltio-search-advanced-search-button"},ip().createElement(Tf(),{color:"primary",className:c.menuIcon}),ip().createElement("span",{className:c.buttonLabel},ei().text("Advanced search")),ip().createElement(Sf(),{color:"action",className:c.goToActionIcon})),ip().createElement(hf(),{variant:"button",classes:{root:up()(c.quickFilterRoot,{[c.withBottomBorder]:!o})}},ei().text("Quick filters")),ip().createElement(Lh,{onScroll:s})),ip().createElement(jh,{className:up()(c.mainContent,{[c["mainContent--shifted"]]:u})},ip().createElement(_W,{isOpenAdvancedSearch:e,onCloseAdvancedSearch:a}))),ip().createElement(Vh,null),ip().createElement(Jh,null),ip().createElement(tZ,null)):null})),oZ=cf()({productionPrefix:"searchTable",disableGlobal:!0,seed:"srch"});v.userPreferencesComparator.register("searchState",((e,t)=>(0,v.looseEquals)((0,O.omit)(["query"],e),(0,O.omit)(["query"],t))));const lZ=()=>ip().createElement(af.DynamicModuleLoader,{modules:[np()]},ip().createElement(pf(),{generateClassName:oZ},ip().createElement(lf._,{dateAdapter:of.Q},ip().createElement(iZ,null))))}}]);
|
|
1
|
+
"use strict";(self.webpackChunk_reltio_segmentation=self.webpackChunk_reltio_segmentation||[]).push([[566],{66566:(e,t,r)=>{r.r(t),r.d(t,{ConfigureColumnsButton:()=>xd,DEFAULT_SEARCH_SELECT:()=>B.Tv,EntitiesTableWithConfigurableColumns:()=>nf,EntityAvatar:()=>b.A,ROWS_PER_PAGE_OPTIONS:()=>B.Tu,buildQueryForAdvancedSearchGroups:()=>_a.Jk,buildSelectFromColumns:()=>vi.vw,collectSpecialColumns:()=>vi.oX,createRecentSearch:()=>ps,default:()=>lZ,getActiveEntityTypeTab:()=>Ti.tB,getAdditionalColumns:()=>vi.oq,getDataTenant:()=>Xa.lF,getEntityTypeLabel:()=>v.getEntityTypeLabel,getEntityTypeTab:()=>Ti.o4,getModule:()=>np,getPage:()=>Xa.fx,getRowsPerPage:()=>Xa.Uz,getSearchResultsMode:()=>Ti.XM,getSearchUrlQuery:()=>co.Cc,getSerializedSearchState:()=>po.Z,getTotal:()=>Xa.NU,needRequestAfterColumnsChanges:()=>vi.tU,parseSearchState:()=>gs.Z,queryBuilderHelpers:()=>n,queryBuilderSagas:()=>a,replaceSearchResultsColumns:()=>gs.f,showMoreResultsForEntityTypeAction:()=>Va,showSavedSearchesDialogAction:()=>si});var n={};r.r(n),r.d(n,{PROP_NAME_FILTER:()=>dt,PROP_NAME_OPERATOR:()=>ut,PROP_NAME_VALUES:()=>pt,addAttributeAfter:()=>St,changeAttributeData:()=>xt,createGetAttributeIndex:()=>bt,createGetAttributeLens:()=>vt,createGetAttributeProp:()=>Ot,createGetAttributesLens:()=>Et,createGetGroupLens:()=>ht,createSetAttributeProp:()=>Tt,defaultFindGroupPath:()=>gt,deleteAttribute:()=>wt,duplicateAttribute:()=>At,getAttributeData:()=>yt,getAttributeObject:()=>ft,getEmptyAttributeObject:()=>mt,setAttributeOperator:()=>Ct,setFilter:()=>Rt,setValues:()=>_t});var a={};r.r(a),r.d(a,{toggleQueryBuilderAttributeSelect:()=>qo});var i={};r.r(i),r.d(i,{addAttributes:()=>ib,addDefaultValuesAction:()=>ob,addNextPageOfAttributeValues:()=>cb,cancelProfileValidation:()=>hb,modifyAttribute:()=>lb,processNextPageOfAttributeValues:()=>ub,profileSaved:()=>yb,removeAttribute:()=>sb,requestNextPageOfAttributeValues:()=>pb,runAuthoringTaskAction:()=>mb,saveDraft:()=>fb,saveProfile:()=>db,validateProfile:()=>gb});var o={};r.r(o),r.d(o,{dependentLookupsEditorTouched:()=>Ob,dependentLookupsEditorsBlocked:()=>Tb,dependentLookupsInitedTypeUrisAdded:()=>vb,dependentLookupsStructureSet:()=>bb});var l={};r.r(l),r.d(l,{activityFilterUpdated:()=>Bb,globalFilterUpdated:()=>zb,keywordUpdated:()=>Fb,saveState:()=>Vb,searchResultsSet:()=>jb,setSearchNavigationData:()=>Gb,setSearchOptionsConfig:()=>Yb,setSearchProviderData:()=>Wb,updateSearchNavigationDataFields:()=>qb,updateSearchNavigationDataOnMerge:()=>Zb,updateSearchOptions:()=>Hb,updateState:()=>Mb});var s={};r.r(s),r.d(s,{addDashboardExternalView:()=>Lv,autocloseIntervalLoaded:()=>gv,clearNotifications:()=>uv,closeNotification:()=>cv,dateMaskUpdated:()=>Sv,dateTimeMaskUpdated:()=>xv,documentationSet:()=>kv,entityDeletionFinished:()=>ov,errorSet:()=>Dv,keysSet:()=>Nv,localeAttributePresentationLoaded:()=>yv,localizationLoaded:()=>Ov,navigateTo:()=>Iv,newEntityShown:()=>iv,newUiConfigLoaded:()=>fv,numberFormatUpdated:()=>Ev,openAppFromChocolateBar:()=>vv,openConsoleApp:()=>bv,openDashboard:()=>wv,openEntity:()=>av,openGraph:()=>Tv,openHistoryEvent:()=>Av,openNewEntityWithAuthoring:()=>Rv,openPerspective:()=>lv,openPivotingPerspective:()=>Pv,openPreviousPage:()=>_v,openSearch:()=>Cv,pathsSet:()=>pv,setPreferReact:()=>hv,setUseSharedPreferences:()=>Uv,showNotification:()=>sv,uiConfigLoaded:()=>mv,uiPathSet:()=>dv});var c={};r.r(c),r.d(c,{getAbsoluteImagePath:()=>VS,getActiveErrorsForAttributesPager:()=>BO,getActivityFilter:()=>bS,getAdminToolsPath:()=>ZO,getAiAssistantEnabled:()=>dS,getAiAssistantHistoryBufferSize:()=>yS,getAiAssistantLimitPerDay:()=>mS,getAiAssistantSkills:()=>fS,getAllRelationsToAddAndEdit:()=>LS,getAllRelationsToSave:()=>US,getAllServicesPaths:()=>lx,getAllTreesEditingConnections:()=>$S,getApiPath:()=>HO,getAttributeTypeErrors:()=>MO,getAttributesErrors:()=>VO,getAttributesPresentation:()=>$O,getAttributesSortingStrategy:()=>EC,getAuthoringByEntityType:()=>vC,getAutoCloseInterval:()=>QO,getCanSuggestAuthoring:()=>AC,getCanUserCreateWorkflowConfigJar:()=>yx,getCanUserCreateWorkflowEnvironmentConfigJar:()=>gx,getCanUserDeleteProfiles:()=>Fx,getCanUserExecuteWorkflowJobs:()=>hx,getCanUserExecuteWorkflowJobsSyncBusinessProcessData:()=>Ex,getCanUserExecuteWorkflowJobsTerminateProcessInstance:()=>bx,getCanUserExecuteWorkflowJobsUpdateTasks:()=>vx,getCanUserExecuteWorkflowJobsValidateTasks:()=>Tx,getCanUserGetDQStatistic:()=>Vx,getCanUserImportEntitiesFromDT:()=>kx,getCanUserMakeActivitiesExport:()=>Dx,getCanUserMakeBulkUpdate:()=>jx,getCanUserMakeExport:()=>Px,getCanUserManageWorkflowDefinition:()=>Ox,getCanUserManageWorkflowEnvironmentDefinition:()=>Sx,getCanUserOpenDataLoader:()=>Mx,getCanUserReadDVF:()=>Bx,getCanUserReadEntitiesFromDT:()=>Lx,getCanUserReadWorkflowDataTask:()=>xx,getCanUserRegisterConfigEnvironments:()=>fx,getCanUserStartProcessFromQuery:()=>Ux,getCanUserUpdateProcessInstance:()=>Cx,getCanUserUpdateWorkflowDataTask:()=>wx,getCanUserViewProcessInstanceSearchQuery:()=>Ax,getCanUserViewWorkflowConfigJar:()=>Rx,getCanUserViewWorkflowDefinition:()=>_x,getCanUserViewWorkflowEnvironmentConfigJar:()=>Ix,getCanUserViewWorkflowJobs:()=>Nx,getCheckIfCanAddRelations:()=>aC,getCleanseByEntityType:()=>TC,getCollaborationPath:()=>ux,getConnectionsByViewId:()=>vO,getConnectionsTemporaryUrisForCreation:()=>CO,getConnectionsWithDraftsByViewId:()=>SO,getControlAttributes:()=>wC,getDBConnectorSideViews:()=>Kx,getDVFPath:()=>px,getDataTenants:()=>sO,getDateMask:()=>JO,getDateTimeMask:()=>eS,getDependentLookupEditorState:()=>rC,getDependentLookupEditorsState:()=>tC,getDependentLookups:()=>Xx,getDependentLookupsInitedTypeUris:()=>eC,getDependentLookupsStructure:()=>Qx,getDependentLookupsStructureNode:()=>Jx,getDocReleaseNotes:()=>mC,getDraftsForSaveByViewId:()=>xO,getDtssPath:()=>ax,getEditingOrAddingConnectionByViewIdAndRelationUri:()=>TO,getEditingOrAddingConnectionRelationObjectByViewIdAndRelationUri:()=>OO,getEntity:()=>hO,getEntityRelatedAttributesByAttributeTypeUri:()=>FO,getEntityUri:()=>EO,getEntityUriWithDataTenant:()=>bO,getEntityWithDiff:()=>iC,getEntityWithoutDiff:()=>oC,getEnvironment:()=>rx,getEnvironmentAlias:()=>nx,getEnvironmentObject:()=>dO,getExportDQPath:()=>ix,getExportPath:()=>YO,getGlobalFilter:()=>CS,getGlobalFilterQuery:()=>wS,getGlobalFilterSavedSearchesUris:()=>AS,getGlobalSearchRequestOptions:()=>SS,getGoogleMapKey:()=>oS,getHeaderColor:()=>yC,getHiddenAttributes:()=>CC,getHistoryDiff:()=>IO,getHistoryEvent:()=>NO,getHistoryMode:()=>kO,getHistorySlice:()=>PO,getIcpLicenseKey:()=>lS,getImageAttributesFieldsOrder:()=>aS,getImagePath:()=>zO,getImageServicePath:()=>qO,getInitialConnection:()=>FS,getInitialConnectionTempEntity:()=>jS,getIsAuthoringMode:()=>SC,getIsEditableMode:()=>_S,getIsHistoryModeEnabled:()=>DO,getIsSuggestMode:()=>NS,getIsViewMode:()=>IS,getLogo:()=>fC,getLookupAutocomplete:()=>iS,getLookups:()=>AO,getMaxValuesInResponse:()=>XO,getMetadata:()=>uO,getMlDqPath:()=>mx,getMode:()=>RS,getModifiedEntities:()=>jO,getModifiedEntity:()=>LO,getModifiedEntityDefaultProfilePic:()=>UO,getNewTreeEnabled:()=>OC,getNotifications:()=>rS,getPivotingAttributes:()=>nS,getProfile:()=>yO,getProfileCancelNeedConfirm:()=>JS,getProfileCheckUpdate:()=>bC,getProfileErrors:()=>RO,getProfileLastLoadedTime:()=>KS,getProfileOperation:()=>XS,getProfileViews:()=>QS,getQueryEstimatorEnabled:()=>xC,getRelationToAddByViewId:()=>DS,getRelations:()=>PS,getRelationsToEditByViewId:()=>kS,getRelationsViewIds:()=>_O,getReleaseVersion:()=>dC,getReltioPath:()=>GO,getRequestProviderConfiguration:()=>tS,getSearch:()=>gO,getSearchKeyword:()=>ES,getSearchNavigationData:()=>OS,getSearchOptions:()=>vS,getSearchProviderData:()=>TS,getSearchResults:()=>hS,getServicesPath:()=>lC,getSharedPreferencesEnabled:()=>gS,getShowAttributeDescription:()=>hC,getShowEntityId:()=>pC,getShowSearchByOv:()=>gC,getStringifiedSearchOptions:()=>xS,getTenant:()=>ex,getTenantName:()=>tx,getTenantObject:()=>pO,getTenants:()=>cO,getTotalByViewId:()=>wO,getTree:()=>YS,getTreeCommands:()=>qS,getTreeEditingConnection:()=>ZS,getTreeRoot:()=>WS,getTreeTotal:()=>GS,getTrees:()=>HS,getUIConfig:()=>sC,getUIConfigLayout:()=>cC,getUIConfigProfile:()=>uC,getUIPath:()=>WO,getUi:()=>fO,getUiError:()=>nC,getUiNumberFormat:()=>KO,getUser:()=>mO,getUserName:()=>BS,getUserRoles:()=>zS,getValidateReadMode:()=>cS,getValidateReferenceEntityInReadMode:()=>pS,getValidateRelations:()=>uS,getValidationServicePath:()=>dx,getValidationServiceSeverityLevels:()=>sS,getViewIdsForOpenRelation:()=>MS,getWorkflowConfigurationEnabled:()=>cx,getWorkflowEnvironmentUrl:()=>sx,getWorkflowPath:()=>ox,isCollaborationEnabled:()=>zx,isCollaborationSideViewEnabled:()=>qx,isDBConnectorSideViewEnabled:()=>$x,isHistorySideViewEnabled:()=>Zx,isWorkflowEnabled:()=>Hx,isWorkflowSideViewEnabled:()=>Gx});var u={};r.r(u),r.d(u,{authoringDcrResolved:()=>aw,authoringDraftEntitiesLoaded:()=>nw,clearEntity:()=>lw,entityCloneRequested:()=>ow,entityCreationRequested:()=>tw,entityCreationWithAuthoringRequested:()=>rw,entityLoaded:()=>QC,entityRemoveRequested:()=>iw,loadEntity:()=>ew,setDefaultProfilePic:()=>JC});var p={};r.r(p),r.d(p,{errorDeactivated:()=>mw,errorsSet:()=>fw});var d={};r.r(d),r.d(d,{clearHistoryDiff:()=>bw,clearHistoryEvent:()=>Tw,setHistoryDiff:()=>Ew,setHistoryEvent:()=>vw,setHistoryMode:()=>Sw,setHistorySlice:()=>Ow});var m={};r.r(m),r.d(m,{lookupsForTypeResolved:()=>Iw,lookupsListResolved:()=>Nw,lookupsLoaded:()=>_w});var f={};r.r(f),r.d(f,{modeEditingCanceled:()=>jw,modeUpdateRequested:()=>Uw,modeUpdated:()=>Lw});var y={};r.r(y),r.d(y,{cleanseLoading:()=>Gw,entityCreated:()=>zw,entityDeleted:()=>Hw,modifiedEntitiesReset:()=>Ww,setDefaultProfilePic:()=>Yw});var g={};r.r(g),r.d(g,{addRelation:()=>lA,closeRelationEditor:()=>pA,editRelation:()=>sA,ignoreRelation:()=>oA,openRelationEditor:()=>uA,relationsLoaded:()=>nA,removeRelation:()=>iA,secondLevelRelationsLoaded:()=>aA,setInitialInfo:()=>fA,setRelationEntity:()=>mA,setRelationType:()=>dA,updateRelationRating:()=>cA});var h={};r.r(h),r.d(h,{hiddenAttributesReset:()=>aI,hiddenAttributesUpdated:()=>nI});var E={};r.r(E),r.d(E,{controlAttributesUpdated:()=>lI}),r(69448);var b=r(68269),v=r(2396),T=r(75580),O=r(73288),S=r(62391),x=r(9400),C=r(8523),w=r(42308),A=r.n(w),R=r(61882),_=r(26040),I=r(5950);function N(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){P(e,t,r[t])}))}return e}function P(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const D={facetsConfigs:[],facetsData:{},recommendedFacets:[],addedFacets:[]},k=(0,S.Ic)("facetsConfigs"),L=(0,S.Ic)("facetsData"),U=(0,S.Ic)("recommendedFacets"),j=(0,S.Ic)("addedFacets"),F=(e,t,r)=>Object.keys(e).reduce(((t,n)=>(0,O.prop)(n,t)?(0,S.ET)(n,r).set(t,e[n]):t),N({},t)),M=({state:e,facetsConfigs:t,addToEnd:r=!1,facetsData:n={}})=>{const a=t.filter((e=>e.fieldName)),i=k.get(e),o=k.set(e,r?i.concat(a):a.concat(i)),l=L.get(e),s=a.reduce(((e,t)=>N({},e,{[t.fieldName]:(0,x.DV)(t.fieldName,n[t.fieldName])})),N({},l));return L.set(o,s)},V=(e=D,t)=>{switch(t.type){case R.k.CREATE_FACETS:{const{facetsConfigs:r,addToEnd:n}=t.payload;return M({state:e,facetsConfigs:r,addToEnd:n})}case w.search.constants.UPDATE_STATE:{const{facetsConfigs:e=[],facetsData:r={}}=t.payload.facets||{facetsConfigs:[]};return M({state:D,facetsConfigs:e,facetsData:r})}case R.k.DESTROY_FACETS:return((e,t)=>{const r=L.get(e),n=k.get(e),a=N({},r);t.forEach((e=>{delete a[e]}));const i=L.set(e,a);return k.set(i,n.filter((e=>!t.includes(e.fieldName))))})(e,t.payload||[]);case R.k.CHANGE_VALUES:{const{facetFieldName:r,values:n}=t.payload;return(({facetFieldName:e,values:t,state:r})=>{const n=[...(0,C.jK)(e),"values"];return(0,S.ET)(...n).set(r,t)})({facetFieldName:r,values:n,state:e})}case R.k.SHOW_MORE_ENTITY_TYPES:{const{show:r}=t.payload,n="type",a=(0,C.jK)(n);if(r)return(0,S.ET)(...a,"showAllItems").set(e,r);{const t=(0,S.ET)(...a);return t.set(e,(0,O.omit)(["showAllItems"],t.get(e)))}}case R.k.CLEAR_ALL_VALUES:case _.Z.CLEAR_ALL:{const t=L.get(e),r=Object.keys(t).reduce(((e,t)=>N({},e,{[t]:[]})),{}),n=F(r,t,"values");return L.set(e,n)}case R.k.UPDATE_DATA:{const r=t.payload||{},n=L.get(e),a=F(r,n,"data");return L.set(e,a)}case R.k.UPDATE_FILTERED_DATA:{const r=t.payload||{},n=L.get(e),a=F(r,n,"filteredData");return L.set(e,a)}case R.k.DESTROY_FILTERED_DATA:{const r=t.payload||{},n=(0,C.jK)(r);if((0,O.path)(n,e)){const t=(0,S.ET)(...n),r=N({},t.get(e));if(r.filteredData)return delete r.filteredData,t.set(e,r)}break}case R.k.SET_RECOMMENDED_FACETS_LIST:return U.set(e,t.payload||[]);case R.k.HIGHLIGHT_ADDED_FACETS:return j.set(e,t.payload);case R.k.CLEAR_HIGHLIGHT_ADDED_FACETS:return j.set(e,[]);case"UI_RESET":return N({},D);case _.Z.CHANGE_CURRENT_TENANT:{const{isDataTenant:r,tenantObject:n}=t.payload;if(r){const t=k.get(e),r=L.get(e),a=(0,I.ci)(n,t),i=(0,O.pluck)("fieldName",a),o=(0,O.pipe)((0,O.pick)(i),(0,I.AZ)(n))(r);return L.set(k.set(e,a),o)}return e}}return e};var B=r(33950);function z(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){H(e,t,r[t])}))}return e}function H(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Y={searchResults:null,searchResultsByEntityTypes:{},total:0,page:0,sortField:null,sortOrder:null,rowsPerPage:B.Tu[0],loading:!1,searchParams:{searchBoxInput:{fieldName:"attributes",filter:"containsWordStartingWith"},mapSearch:{fieldName:"geoLocation",type:"geoLocation",filter:"range",values:[]}},currentTenant:null},W=(0,S.Ic)("searchResults"),G=(0,S.Ic)("total"),q=(0,S.Ic)("page"),Z=(0,S.Ic)("rowsPerPage"),$=(0,S.Ic)("sortField"),K=(0,S.Ic)("sortOrder"),X=(0,S.Ic)("loading"),Q=(0,S.ET)("searchParams","mapSearch","values"),J=(0,S.ET)("searchParams","mapSearch","type"),ee=(0,S.ET)("searchParams","mapSearch","fieldName"),te=(0,S.Ic)("searchResultsByEntityTypes"),re=e=>te.compose((0,S.ET)(e,"page")),ne=({entityTypeUri:e,field:t,order:r},n)=>{if(e){const a=te.compose((0,S.ET)(e,"sortField")),i=te.compose((0,S.ET)(e,"sortOrder")),o=a.set(n,t);return i.set(o,r)}{const e=$.set(n,t);return K.set(e,r)}},ae=(e=Y,t)=>{switch(t.type){case _.Z.UPDATE_ENTITIES:{const{searchResults:r,entityTypeUri:n}=t.payload;return n?te.compose((0,S.ET)(n,"searchResults")).set(e,r):W.set(e,r)}case _.Z.UPDATE_TOTAL:return G.set(e,t.payload);case _.Z.CHANGE_PAGE:{const{entityTypeUri:r,pageNumber:n}=t.payload;return r?re(r).set(e,n):q.set(e,n)}case _.Z.RESET_PAGE:{const{entityTypeUri:r}=t.payload,n=q.set(e,0);return r?re(r).set(n,0):n}case _.Z.CHANGE_ROWS_PER_PAGE:{const{entityTypeUri:r,number:n}=t.payload;if(r){const t=te.compose((0,S.ET)(r,"rowsPerPage")),a=re(r).set(e,0);return t.set(a,n)}{const t=q.set(e,0);return Z.set(t,n)}}case _.Z.CHANGE_SORT:return ne(t.payload,e);case _.Z.CHANGE_LOADING:return X.set(e,t.payload);case w.search.constants.UPDATE_STATE:{const{values:r=[],searchType:n=v.MapSearch.geoPolygon}=t.payload.map||{};let a=Q.set(Y,r);if(a=J.set(a,n),a=ee.set(a,(0,v.mapSearchTypeToFieldName)(n)),t.payload.view){const{entityTypeTab:e,sortField:r,sortOrder:n}=t.payload.view;a=ne({entityTypeUri:e,field:r,order:n},a)}return z({},a,{currentTenant:t.payload.currentTenant||e.currentTenant,searchOptions:t.payload.searchOptions||e.searchOptions})}case"UI_RESET":return z({},Y);case _.Z.MAP_CHANGE_VALUE:{const{value:r,searchType:n}=t.payload;let a=J.set(e,n);return a=ee.set(a,(0,v.mapSearchTypeToFieldName)(n)),Q.set(a,r?[r]:[])}case _.Z.CLEAR_RESULTS:{const r=t.payload;if(r){let t=W.set(e,void 0);const n=te.get(e);return te.set(t,{[r]:n[r]})}return te.set(e,{})}case _.Z.CLEAR_ALL:return Q.set(e,[]);case _.Z.CHANGE_CURRENT_TENANT:return z({},e,{currentTenant:t.payload.tenantObject.id})}return e},ie="UI_SHOW_MORE_FACETS_POPUP",oe="UI_SHOW_SAVED_SEARCHES_DIALOG",le="UI_SHOW_SAVE_SEARCH_DIALOG",se="UI_SHOW_ADVANCED_SEARCH",ce="UI_SHOW_BULK_UPDATE",ue="UI_SET_MARKER",pe="UI_SET_HOVERED_ENTITY_URI",de="UI_SET_SEARCH_RESULTS_COLUMNS",me="UI_CHANGE_SEARCH_RESULTS_COLUMNS",fe="UI_SET_ENTITY_TYPE_TAB",ye="UI_UPDATE_TABLE_VIEW_TABS",ge="UI_CHANGE_ORDER_SEARCH_RESULTS_COLUMNS",he="UI_CHANGE_SIZES_SEARCH_RESULTS_COLUMNS",Ee="UI_CLEAR_NOTIFICATION",be="UI_SET_NOTIFICATION",ve="UI_SET_SEARCH_RESULTS_MODE",Te="UI_SET_PREVIEW_PANEL_MODE",Oe={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},Se=(0,S.Ic)("showMoreFacetsPopup"),xe=(0,S.Ic)("showSavedSearchesDialog"),Ce=(0,S.Ic)("showSaveSearchDialog"),we=(0,S.Ic)("showAdvancedSearch"),Ae=(0,S.Ic)("showBulkUpdate"),Re=(0,S.Ic)("activeAdditionalSearch"),_e=(0,S.Ic)("activeMarker"),Ie=(0,S.Ic)("hoveredEntityUri"),Ne=(0,S.Ic)("searchResultsMode"),Pe=(0,S.Ic)("previewPanelMode"),De=(0,S.Ic)("searchResultsColumns"),ke=(0,S.Ic)("entityTypeTab"),Le=(0,S.Ic)("tableViewTabs"),Ue=(0,S.Ic)("loading"),je=(0,S.Ic)("notification"),Fe=(e=Oe,t)=>{switch(t.type){case ie:return Se.set(e,t.payload);case oe:return xe.set(e,t.payload);case le:return Ce.set(e,t.payload.show);case se:return we.set(e,t.payload);case ce:return Ae.set(e,t.payload);case"UI_SET_ACTIVE_ADDITIONAL_SEARCH":{const r=Re.get(e)===t.payload?null:t.payload;return Re.set(e,r)}case ue:return _e.set(e,t.payload);case pe:return Ie.set(e,t.payload);case ve:return Ne.set(e,t.payload);case de:return De.set(e,t.payload);case me:{const{entityTypeUri:r,columns:n}=t.payload;return De.compose((0,S.Ic)(r)).set(e,n)}case he:{const{entityTypeUri:r,columns:n}=t.payload;return De.compose((0,S.Ic)(r)).set(e,n)}case ge:{const{entityTypeUri:r,columns:n}=t.payload;return De.compose((0,S.Ic)(r)).set(e,n)}case Te:return Pe.set(e,t.payload);case fe:return ke.set(e,t.payload.entityTypeUri);case ye:return Le.set(e,t.payload);case R.k.UPDATE_DATA:if((0,O.has)("type",t.payload))return Le.set(e,t.payload.type);break;case R.k.CHANGE_VALUES:{const{facetFieldName:r,values:n}=t.payload;if("type"===r&&n.length){const t=ke.get(e);if(!n.includes(t))return ke.set(e,n[0])}break}case"UI_RESET":return Oe;case"UI_SET_LOADING":return Ue.set(e,t.payload);case be:return je.set(e,t.payload);case Ee:return je.set(e,null);case w.search.constants.UPDATE_STATE:{let r=we.set(e,(0,O.has)("advanced",t.payload));if(t.payload.view){const{searchResultsMode:e,entityTypeTab:n,searchResultsColumns:a,previewPanelMode:i}=t.payload.view;r=Ne.set(r,e),r=ke.set(r,n),(0,v.isEmptyValue)(a)||(r=De.set(r,a)),r=Pe.set(r,i)}return t.payload.showSavedSearchesDialog&&(r=xe.set(r,t.payload.showSavedSearchesDialog)),r}}return e};var Me=r(37164);const Ve="ADVANCED_SEARCH_SET_GROUP_ENTITY_TYPES",Be="ADVANCED_SEARCH_VERIFY_GROUP_ENTITY_TYPES",ze="ADVANCED_SEARCH_SET_GROUP_OPERATOR",He="ADVANCED_SEARCH_DELETE_GROUP",Ye="ADVANCED_SEARCH_ADD_GROUP",We="ADVANCED_SEARCH_DUPLICATE_GROUP",Ge="ADVANCED_SEARCH_ADD_ATTRIBUTE_AFTER",qe="ADVANCED_SEARCH_CHANGE_ATTRIBUTE_DATA",Ze="ADVANCED_SEARCH_TOGGLE_ATTRIBUTE_SELECT",$e="ADVANCED_SEARCH_SET_ATTRIBUTE_OPERATOR",Ke="ADVANCED_SEARCH_DELETE_ATTRIBUTE",Xe="ADVANCED_DELETE_ATTRIBUTE_AND_VERIFY_GROUP_ENTITY_TYPES",Qe="ADVANCED_SEARCH_DUPLICATE_ATTRIBUTE",Je="ADVANCED_SEARCH_SET_FILTER",et="ADVANCED_SEARCH_SET_VALUES",tt="ADVANCED_SEARCH_ATTRIBUTE_SET_VALUES",rt="ADVANCED_SEARCH_ATTRIBUTE_FILTER_VALUES",nt="ADVANCED_SEARCH_ATTRIBUTE_SET_FILTERED_VALUES",at="ADVANCED_SEARCH_ATTRIBUTE_UPDATE_VALUES",it="ADVANCED_SEARCH_UPDATE",ot="ADVANCED_SEARCH_CONVERT_FROM_FACETS";var lt=r(81253);function st(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){ct(e,t,r[t])}))}return e}function ct(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ut="operator",pt="values",dt="filter",mt=(e=(0,Me.x0)())=>({[ut]:B.YL.value,id:e}),ft=(e,t=(0,Me.x0)())=>{const r=yt(e);return{data:r,[ut]:B.YL.value,[dt]:(0,O.pathOr)("",["filterOptions",0],r),id:t}},yt=e=>st({},e,{filterOptions:e.enforcedFilterOptions||(0,v.getFilterOptionsForQueryBuilder)(e.attrType,e.fieldName,!0)}),gt=(0,O.curry)(((e,t)=>{const r=t.findIndex((t=>t.id===e));return r>-1?[r]:null})),ht=(e,t=gt)=>(r,n)=>{const a=(0,S.ET)(...e).get(r),i=t(n,a);return!!i&&(0,S.ET)(...e,...i)},Et=(e,t)=>(r,n)=>{const a=e(r,n);return a&&a.compose((0,S.Ic)(t))},bt=e=>(t,r,n)=>{const a=e(t,r);return a?a.get(t).findIndex((e=>e.id===n)):-1},vt=e=>(t,r,n)=>{const a=e(t,r),i=bt(e)(t,r,n);return-1!==i?a.compose((0,S.ET)(i)):null},Tt=e=>(t,r,n,a,i)=>{const o=e(t,r,n);if(o){const e=st({},o.get(t));return e[a]=i,o.set(t,e)}return t},Ot=e=>(t,r,n,a)=>{const i=e(t,r,n);if(i)return i.get(t)[a]},St=({state:e,groupId:t,attributeId:r,attribute:n,getAttributesLens:a,getAttributeIndex:i})=>{const o=a(e,t);if(o){let a=[...o.get(e)];const l=i(e,t,r),s=!a[l+1];return-1!==l&&s?a.splice(l+1,0,n):-1!==l?(a.splice(l+1,0,st({},n,{operator:a[l].operator})),a[l]=st({},a[l],{operator:B.YL.value})):a.push(n),o.set(e,a)}return e},xt=({state:e,groupId:t,attributeId:r,attributeData:n,setAttributeProp:a,getAttributeLens:i})=>{let o=e;if(n)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))})(e,t,r,n,i)&&(o=a(e,t,r,dt,n.filterOptions[0])),o=a(o,t,r,pt,[]),a(o,t,r,"data",n);{const n=i(e,t,r);return n&&(o=n.set(o,mt(r))),o}},Ct=({state:e,groupId:t,attributeId:r,operator:n,setAttributeProp:a})=>a(e,t,r,ut,n),wt=({state:e,groupId:t,attributeId:r,getAttributesLens:n})=>{const a=n(e,t);if(a){const t=[...a.get(e)],n=t.findIndex((e=>e.id===r));if(n>-1){const r=(0,O.remove)(n,1,t),i=r[n-1],o=t[n];return i&&(r[n-1]=st({},i,{operator:o.operator})),a.set(e,r)}}return e},At=({state:e,groupId:t,attributeId:r,id:n,getAttributesLens:a})=>{const i=a(e,t);if(i){const t=[...i.get(e)],a=t.findIndex((e=>e.id===r));if(a>-1)return t.push(st({},t[a],{id:n})),i.set(e,t)}return e},Rt=({state:e,groupId:t,attributeId:r,filter:n,getAttributeProp:a,setAttributeProp:i})=>{const o=a(e,t,r,dt),l=(0,v.isCompatibleFilters)(o,n)?e:i(e,t,r,pt,[]);return i(l,t,r,dt,n)},_t=({state:e,groupId:t,attributeId:r,values:n,setAttributeProp:a})=>a(e,t,r,pt,n);function It(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Nt(e,t,r[t])}))}return e}function Nt(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Pt={groups:[]},Dt={},kt="entityTypes",Lt="attributes",Ut=["groups"],jt=(0,S.ET)(...Ut),Ft=ht(Ut),Mt=Et(Ft,Lt),Vt=bt(Mt),Bt=vt(Mt),zt=Tt(Bt),Ht=Ot(Bt),Yt=(e,t=[],r=(0,Me.x0)())=>({[Lt]:e.map((e=>ft(e))),[ut]:B.qx.value,[kt]:t,id:r}),Wt=(e=Dt,t)=>{switch(t.type){case nt:{const{groupId:r,attributeId:n,values:a}=t.payload;return(0,O.assocPath)([r,n,"filtered"],a,e)}case He:{const{groupId:r}=t.payload;return(0,O.dissoc)(r,e)}case Ke:{const{groupId:r,attributeId:n}=t.payload;return(0,O.dissocPath)([r,n],e)}case We:{const{groupId:r,id:n}=t.payload,a=e[r];return a?(0,O.assoc)(n,a,e):e}case Qe:{const{groupId:r,attributeId:n,id:a}=t.payload,i=(0,O.path)([r,n],e);return i?(0,O.assocPath)([r,a],i,e):e}case _.Z.CLEAR_ALL:case w.search.constants.UPDATE_STATE:return Dt;default:return e}},Gt=(e=Pt,t)=>{switch(t.type){case Ye:{const{group:r}=t.payload,n=[...jt.get(e)];return n.push(r),jt.set(e,n)}case ze:{const{groupId:r,operator:n}=t.payload,a=Ft(e,r);if(a){const t=It({},a.get(e));return t[ut]=n,a.set(e,t)}return e}case Ve:{const{groupId:r,entityTypes:n}=t.payload,a=Ft(e,r);if(a){const t=It({},a.get(e));return t.entityTypes=n,t.autoAddedEntityTypes=[],t.attributes=[],a.set(e,t)}return e}case Be:{const{groupId:r}=t.payload,n=Ft(e,r);if(n){const t=n.get(e),{entityTypes:r,autoAddedEntityTypes:a}=(0,lt.tg)((0,lt.r8)(t.attributes||[]),t.entityTypes,t.autoAddedEntityTypes);return n.set(e,It({},t,{[kt]:r,autoAddedEntityTypes:a}))}return e}case He:{const{groupId:r}=t.payload,n=[...jt.get(e)],a=n.findIndex((e=>e.id===r));if(a>-1){const t=(0,O.remove)(a,1,n),r=t[a-1],i=n[a];return r&&(t[a-1]=It({},r,{operator:i.operator})),jt.set(e,t)}return e}case We:{const{groupId:r,id:n}=t.payload,a=[...jt.get(e)],i=a.findIndex((e=>e.id===r));return i>-1?(a.push(It({},a[i],{id:n})),jt.set(e,a)):e}case Ge:{const{groupId:r,attributeId:n,attribute:a}=t.payload;return St({state:e,groupId:r,attributeId:n,attribute:a,getAttributesLens:Mt,getAttributeIndex:Vt})}case qe:{const{groupId:r,attributeId:n,attributeData:a}=t.payload;return xt({state:e,groupId:r,attributeId:n,attributeData:a,setAttributeProp:zt,getAttributeLens:Bt})}case $e:{const{groupId:r,attributeId:n,operator:a}=t.payload;return Ct({state:e,groupId:r,attributeId:n,operator:a,setAttributeProp:zt})}case Ke:{const{groupId:r,attributeId:n}=t.payload;return wt({state:e,groupId:r,attributeId:n,getAttributesLens:Mt})}case Qe:{const{groupId:r,attributeId:n,id:a}=t.payload;return At({state:e,groupId:r,attributeId:n,id:a,getAttributesLens:Mt})}case Je:{const{groupId:r,attributeId:n,filter:a}=t.payload;return Rt({state:e,groupId:r,attributeId:n,filter:a,getAttributeProp:Ht,setAttributeProp:zt})}case et:{const{groupId:r,attributeId:n,values:a}=t.payload;return _t({state:e,groupId:r,attributeId:n,values:a,setAttributeProp:zt})}case _.Z.CLEAR_ALL:return Pt;case w.search.constants.UPDATE_STATE:{const{advanced:e=[]}=t.payload;return jt.set(Pt,e)}default:return e}},qt=(e,t)=>{const r=((e,t)=>{if(t.type===tt){var r;const{groupId:n,attributeId:a,values:i}=t.payload;return((null===(r=[...jt.get(e.searchParams)].find((e=>e.id===n)))||void 0===r?void 0:r.attributes)||[]).some((({id:e})=>e===a))?(0,O.assocPath)(["attributesData",n,a,"default"],i,e):e}return e})((0,T.combineReducers)({searchParams:Gt,attributesData:Wt})(e,t),t);return r},Zt="SAVED_SEARCHES_CREATE",$t="SAVED_SEARCHES_SET_CURRENT",Kt="SAVED_SEARCHES_SET_CHANGE_INDICATOR",Xt="SAVED_SEARCHES_UPDATE",Qt="SAVED_SEARCHES_LOAD",Jt="SAVED_SEARCHES_SET_TOTAL",er="SAVED_SEARCHES_SET_ITEMS",tr="SAVED_SEARCHES_SET_ITEM_TOTAL",rr="SAVED_SEARCHES_SET_PAGE",nr="SAVED_SEARCHES_SET_ROWS_PER_PAGE",ar="SAVED_SEARCHES_SET_FILTERS",ir="SAVED_SEARCHES_SELECT_ITEM",or="SAVED_SEARCHES_SELECT_ALL_ITEMS",lr="SAVED_SEARCHES_DESELECT_ALL_ITEMS",sr="SAVED_SEARCHES_MARK_PUBLIC_REQUEST",cr="SAVED_SEARCHES_MARK_PUBLIC",ur="SAVED_SEARCHES_MARK_FAVORITE_REQUEST",pr="SAVED_SEARCHES_MARK_FAVORITE",dr="SAVED_SEARCHES_MARK_GLOBAL_FILTER_REQUEST",mr="SAVED_SEARCHES_CHANGE_ITEM_NAME_REQUEST",fr="SAVED_SEARCHES_CHANGE_ITEM_NAME",yr="SAVED_SEARCHES_SET_EDITING",gr="SAVED_SEARCHES_DELETE_SELECTED_ITEMS_REQUEST",hr="SAVED_SEARCHES_DELETE_ITEM_REQUEST",Er="SAVED_SEARCHES_DELETE_ITEMS",br="SAVED_SEARCHES_SET_LOADING",vr="SAVED_SEARCHES_SET_SEARCH_VALUE",Tr="SAVED_SEARCHES_APPLY_ITEM",Or="SAVED_SEARCHES_SET_TOTAL_LOADING",Sr="SAVED_SEARCHES_LOAD_TOTAL",xr="SAVED_SEARCHES_TOGGLE_SORT",Cr="RECENT_SEARCHES_CREATE",wr="RECENT_SEARCHES_LOAD",Ar="RECENT_SEARCHES_SET_ITEMS",Rr="RECENT_SEARCHES_SET_ITEM_TOTAL",_r="RECENT_SEARCHES_SELECT_ITEM",Ir="RECENT_SEARCHES_SELECT_ALL_ITEMS",Nr="RECENT_SEARCHES_DESELECT_ALL_ITEMS",Pr="RECENT_SEARCHES_DELETE_SELECTED_ITEMS_REQUEST",Dr="RECENT_SEARCHES_DELETE_ITEMS",kr="RECENT_SEARCHES_DELETE_ITEM_REQUEST",Lr="RECENT_SEARCHES_SET_LOADING",Ur="RECENT_SEARCHES_SET_SEARCH_VALUE",jr="RECENT_SEARCHES_SET_LAST_SAVED",Fr="RECENT_SEARCHES_SET_TOTAL_LOADING",Mr="RECENT_SEARCHES_LOAD_TOTAL",Vr="RECENT_SEARCHES_APPLY_ITEM";function Br(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){zr(e,t,r[t])}))}return e}function zr(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Hr={currentSearch:null,postSavingAction:null,changeIndicator:!1,items:[],loading:!1,total:0,page:0,rowsPerPage:B.Tu[0],searchValue:"",findPublic:!0,favoriteOnly:!1,sorting:{order:B.rX.DESC,field:B.KY.updateDate}},Yr=(0,S.Ic)("changeIndicator"),Wr=(0,S.Ic)("items"),Gr=(0,S.Ic)("total"),qr=(0,S.Ic)("page"),Zr=(0,S.Ic)("loading"),$r=(0,S.Ic)("postSavingAction"),Kr=(0,S.Ic)("sorting"),Xr=(e,t,r)=>{const n=Wr.get(r).findIndex((e=>e.uri===t)),a=Wr.compose((0,S.ET)([n])),i=a.get(r);return a.set(r,e(i))},Qr=(e,t,r)=>(0,O.evolve)({page:(0,O.always)(0),[e]:(0,O.always)(t)},r),Jr=(e=Hr,t)=>{switch(t.type){case $t:return(0,O.evolve)({currentSearch:(0,O.always)(t.payload),changeIndicator:null===t.payload?(0,O.always)(!1):O.identity},e);case _.Z.CLEAR_ALL:return(0,O.evolve)({currentSearch:(0,O.always)(null),changeIndicator:(0,O.always)(!1)},e);case Kt:return Yr.set(e,t.payload);case Jt:return Gr.set(e,t.payload);case rr:return qr.set(e,t.payload);case nr:return Qr("rowsPerPage",t.payload,e);case ar:{const{findPublic:r,favoriteOnly:n}=t.payload;return(0,O.evolve)({page:(0,O.always)(0),findPublic:(0,O.always)(r),favoriteOnly:(0,O.always)(n)},e)}case er:return Wr.set(e,t.payload);case ir:{const{uri:r,checked:n}=t.payload;return Xr((e=>Br({},e,{checked:n})),r,e)}case lr:{const t=Wr.get(e);return Wr.set(e,t.map((0,O.omit)(["checked"])))}case or:{const t=Wr.get(e);return Wr.set(e,t.map((0,O.ifElse)((0,O.prop)("isOwnSearch"),(0,O.assoc)("checked",!0),O.identity)))}case Er:{const r=t.payload,n=Wr.get(e),a=Gr.set(e,Gr.get(e)-r.length);return Wr.set(a,n.filter((e=>!r.includes(e.uri))))}case cr:{const{uri:r,isPublic:n}=t.payload;return Xr((e=>Br({},e,{isPublic:n})),r,e)}case pr:{const{uri:r,isFavorite:n}=t.payload;return Xr((e=>Br({},e,{isFavorite:n})),r,e)}case tr:{const{uri:r,total:n}=t.payload;return Xr((e=>Br({},e,{total:n})),r,e)}case yr:{const{uri:r,isEditing:n}=t.payload;return Xr((e=>Br({},e,{isEditing:n})),r,e)}case mr:{const{uri:r}=t.payload;return Xr((0,O.omit)(["isEditing"]),r,e)}case fr:{const{uri:r,name:n}=t.payload;return Xr((e=>Br({},e,{name:n})),r,e)}case br:return Zr.set(e,t.payload);case Ur:case vr:return Qr("searchValue",t.payload,e);case Qt:return Br({},e,{page:0,findPublic:!0,favoriteOnly:!1});case xr:{const n=t.payload,a=(0,O.path)(["sorting","field"],e),i=(0,O.path)(["sorting","order"],e);return Kr.set(e,{field:n,order:(r=n===a?i:null,r===B.rX.DESC?B.rX.ASC:B.rX.DESC)})}case Or:{const{uri:r,isLoading:n}=t.payload;return Xr((e=>Br({},e,{isTotalLoading:n})),r,e)}case le:return $r.set(e,t.payload.postSavingAction);case oe:return Qr("searchValue",Hr.searchValue,e)}var r;return e};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.push.apply(n,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=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const rn={items:[],filterWord:null,loading:!1,lastSavedRecentSearch:null},nn=(0,S.Ic)("items"),an=(0,S.Ic)("loading"),on=(0,S.Ic)("filterWord"),ln=(0,S.Ic)("lastSavedRecentSearch"),sn=(e,t,r)=>{const n=nn.get(r).findIndex((e=>e.createdDate===t)),a=nn.compose((0,S.ET)([n])),i=a.get(r);return a.set(r,e(i))},cn=(e=rn,t)=>{switch(t.type){case vr:case Ur:return on.set(e,t.payload);case Ar:return nn.set(e,t.payload);case _r:{const{searchCreatedDate:r,checked:n}=t.payload;return sn((e=>en({},e,{checked:n})),r,e)}case Nr:{const t=nn.get(e);return nn.set(e,t.map((0,O.omit)(["checked"])))}case Ir:{const t=nn.get(e);return nn.set(e,t.map((0,O.assoc)("checked",!0)))}case Dr:{const r=(t.payload||[]).map((0,O.prop)("createdDate")),n=nn.get(e);return nn.set(e,n.filter((e=>!r.includes(e.createdDate))))}case Rr:{const{searchCreatedDate:r,total:n}=t.payload;return sn((e=>en({},e,{total:n})),r,e)}case Lr:return an.set(e,t.payload);case jr:return ln.set(e,t.payload);case Fr:{const{searchCreatedDate:r,isLoading:n}=t.payload;return sn((e=>en({},e,{isTotalLoading:n})),r,e)}case oe:return on.set(e,rn.filterWord)}return e},un="ENTITY_SET_LOADING",pn="ENTITY_LOAD_ENTITY_REQUEST",dn="ENTITY_SET_SELECTED_ENTITY_URI",mn="ENTITY_SET_ENTITY",fn={loading:!1,selectedEntityUri:null,entity:null},yn=(0,S.Ic)("loading"),gn=(0,S.Ic)("selectedEntityUri"),hn=(0,S.Ic)("entity"),En=(e=fn,t)=>{switch(t.type){case un:return yn.set(e,t.payload);case dn:return gn.set(e,t.payload);case mn:return hn.set(e,t.payload);case w.profile.constants.ProfileActions.ADD_NEXT_PAGE_ATTRIBUTE_VALUES:{const{parentUri:r,attributeTypeName:n,attributeTypeUri:a,values:i}=t.payload,o=(0,v.getAttributeSource)(a);if(e.entity&&r===e.entity.uri){const t=(0,O.lensPath)(["entity",o,n]);return(0,O.over)(t,(0,O.pipe)((0,O.defaultTo)([]),(0,O.concat)(O.__,i)),e)}return e}case w.search.constants.SEARCH_RESULTS_SET:if((0,v.isEmptyValue)(t.payload)){const t=hn.set(e,fn.entity);return gn.set(t,fn.selectedEntityUri)}return e}return e},bn="BULK_UPDATE_SET_ACTIVE_STEP",vn="BULK_UPDATE_INIT",Tn="BULK_UPDATE_TOGGLE_SELECTION_MODE",On="BULK_UPDATE_SELECT_ENTITY",Sn="BULK_UPDATE_SELECT_ALL_ENTITIES_ON_PAGE",xn="BULK_UPDATE_SET_LOADING",Cn="BULK_UPDATE_CHANGE_ROWS_PER_PAGE",wn="BULK_UPDATE_CHANGE_PAGE",An="BULK_UPDATE_CHANGE_SORT",Rn="BULK_UPDATE_CHANGE_COLUMNS",_n="BULK_UPDATE_UPDATE_ENTITIES",In="BULK_UPDATE_SET_FILTER_TEXT",Nn="BULK_UPDATE_SET_TOTAL",Pn="UPDATE_BULK_UPDATE_CURRENT_ENTITIES",Dn="BULK_UPDATE_SET_OPERATION",kn="BULK_UPDATE_SET_ACTION_ATTRIBUTE",Ln="BULK_UPDATE_SET_ACTION_OPERATION",Un="BULK_UPDATE_ADD_OPERATION_PARAMETERS",jn="BULK_UPDATE_DELETE_ACTION",Fn="BULK_UPDATE_TOGGLE_CONDITIONS",Mn="BULK_UPDATE_ADD_CONDITION_AFTER",Vn="BULK_UPDATE_CHANGE_CONDITION_DATA",Bn="BULK_UPDATE_TOGGLE_CONDITION_SELECT",zn="BULK_UPDATE_DELETE_CONDITION",Hn="BULK_UPDATE_SET_CONDITION_FILTER",Yn="BULK_UPDATE_SET_CONDITION_VALUES",Wn="BULK_UPDATE_TOGGLE_ACTION_PIN",Gn="BULK_UPDATE_TOGGLE_ACTION_ADD_NESTED",qn="BULK_UPDATE_CONFIRM",Zn="BULK_UPDATE_SET_REQUEST_PENDING";var $n=r(39705);function Kn(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Xn(e,t,r[t])}))}return e}function Xn(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Qn={objects:{selectionMode:B.v6.exclude,selectedEntities:[],entities:[],total:0,page:0,rowsPerPage:B.Tu[0],filterText:"",sortOrder:null,sortField:null,selectedColumns:[]},actions:[],operation:null,activeStep:0,loading:!1,requestPending:!1},Jn=(0,S.Ic)("activeStep"),ea=(0,S.Ic)("operation"),ta=(0,S.Ic)("loading"),ra=(0,S.Ic)("requestPending"),na=(0,S.ET)("objects","total"),aa=(0,S.ET)("objects","page"),ia=(0,S.ET)("objects","rowsPerPage"),oa=(0,S.ET)("objects","selectionMode"),la=(0,S.ET)("objects","entities"),sa=(0,S.ET)("objects","selectedEntities"),ca=(0,S.ET)("objects","filterText"),ua=e=>oa.get(e)===B.v6.include,pa=(0,S.ET)("objects","sortOrder"),da=(0,S.ET)("objects","sortField"),ma=(0,S.ET)("objects","selectedColumns"),fa=["actions"],ya=(0,S.ET)(...fa),ga=({groupId:e,state:t})=>{if(e){const r=ya.get(t).findIndex((t=>t.id===e));if(-1!==r)return[...fa,r,"actions"]}return fa},ha=(e,t)=>({id:(0,Me.x0)(),operation:e,operationParameters:t}),Ea=e=>((0,O.path)(["attributeTypeData","fieldName"],e)||"").split(".").slice(0,2).join("."),ba=(e,t)=>({id:(0,Me.x0)(),fieldName:Ea(t),actions:[ha(e,t)]}),va=({state:e,id:t,groupId:r,operation:n,operationParameters:a,togglePin:i,toggleAddNested:o})=>{const l=ga({state:e,groupId:r}),s=(0,S.ET)(...l).get(e),c=!r&&(0,O.prop)("attributeTypeData",a)&&(({attributeType:e,fieldName:t=""})=>(0,v.isComplexAttribute)(e)||t.split(".").length>2)(a.attributeTypeData);if(t){const r=s.findIndex((e=>e.id===t)),p=(0,S.ET)(...l,r),d=Kn({},p.get(e));if(n&&d.operation!==n){if(d.operationParameters){const e=[d.operation,n].includes($n.d.RepointReference)?[]:B.KJ[n];d.operationParameters=(0,O.omit)((0,O.without)(e,["attributeValue","attributeValueToFind"]),d.operationParameters)}d.operation=n}return a&&(d.operationParameters=(0,O.reject)(O.isNil,Kn({},d.operationParameters,a))),i&&(d.operationParameters=Kn({},d.operationParameters,{pin:!(0,O.path)(["operationParameters","pin"],d)})),o&&(d.operationParameters=Kn({},d.operationParameters,{addNestedAttribute:!(0,O.path)(["operationParameters","addNestedAttribute"],d)})),p.set(e,c?ba((u=d).operation,u.operationParameters):d)}{const t=(0,O.reject)(O.isNil,a),r=c?ba(n,t):ha(n,t);return(0,S.ET)(...l,s.length).set(e,r)}var u},Ta=ht(fa),Oa=Et(Ta,"conditions"),Sa=bt(Oa),xa=vt(Oa),Ca=Tt(xa),wa=Ot(xa),Aa=(e=Qn,t)=>{switch(t.type){case bn:return Jn.set(e,t.payload);case vn:return Kn({},Qn,{objects:Kn({},Qn.objects,t.payload)});case _n:return la.set(e,t.payload);case Tn:{const t=oa.set(e,ua(e)?B.v6.exclude:B.v6.include);return sa.set(t,[])}case On:{const{uri:r,checked:n}=t.payload,a=sa.get(e),i=ua(e);return sa.set(e,!!n==!!i?(0,O.uniq)(a.concat(r)):(0,O.without)(r,a))}case Sn:{const r=t.payload,n=ua(e),a=sa.get(e),i=la.get(e).map((0,O.prop)("uri"));return sa.set(e,!!r==!!n?(0,O.uniq)(a.concat(i)):(0,O.without)(i,a))}case xn:return ta.set(e,t.payload);case wn:return aa.set(e,t.payload);case Cn:{const r=aa.set(e,0);return ia.set(r,t.payload)}case An:{const{order:r,field:n}=t.payload,a=da.set(e,n);return pa.set(a,r)}case Rn:return ma.set(e,t.payload);case Nn:return na.set(e,t.payload);case In:{const{filterText:r}=t.payload;return ca.set(e,r)}case Dn:return ea.set(e,t.payload);case kn:{const{id:r,groupId:n,attribute:a}=t.payload;return va({state:e,id:r,groupId:n,operationParameters:{attributeTypeData:a,attributeValue:null,attributeValueToFind:null,pin:null,addNestedAttribute:null}})}case Ln:{const{id:r,groupId:n,operation:a}=t.payload;return va({state:e,id:r,groupId:n,operation:a})}case Un:{const{id:r,groupId:n,operationParameters:a}=t.payload;return va({state:e,id:r,groupId:n,operationParameters:a})}case Wn:{const{id:r,groupId:n}=t.payload;return va({state:e,id:r,groupId:n,togglePin:!0})}case Gn:{const{id:r,groupId:n}=t.payload;return va({state:e,id:r,groupId:n,toggleAddNested:!0})}case jn:{const{id:r,groupId:n}=t.payload,a=ga({state:e,groupId:n}),i=(0,S.ET)(...a),o=i.get(e);return i.set(e,o.filter((e=>e.id!==r)))}case Fn:{const r=t.payload,n=ya.get(e).findIndex((e=>e.id===r)),a=(0,S.ET)(...fa,n),i=a.get(e);return a.set(e,i.conditions?(0,O.omit)(["conditions"],i):(0,O.assoc)("conditions",[],i))}case Mn:{const{groupId:r,attributeId:n,attribute:a}=t.payload;return St({state:e,groupId:r,attributeId:n,attribute:a,getAttributesLens:Oa,getAttributeIndex:Sa})}case Vn:{const{groupId:r,attributeId:n,attributeData:a}=t.payload;return xt({state:e,groupId:r,attributeId:n,attributeData:a,setAttributeProp:Ca,getAttributeLens:xa})}case zn:{const{groupId:r,attributeId:n}=t.payload;return wt({state:e,groupId:r,attributeId:n,getAttributesLens:Oa})}case Hn:{const{groupId:r,attributeId:n,filter:a}=t.payload;return Rt({state:e,groupId:r,attributeId:n,filter:a,getAttributeProp:wa,setAttributeProp:Ca})}case Yn:{const{groupId:r,attributeId:n,values:a}=t.payload;return _t({state:e,groupId:r,attributeId:n,values:a,setAttributeProp:Ca})}case Zn:return ra.set(e,t.payload)}return e};var Ra=r(27422),_a=r(82349),Ia=r(12848),Na=r(33192),Pa=r.n(Na),Da=r(43717);const ka=(e,t,r)=>{const n=La(t);if(n.length){const i=ja(e,t,r),o=Ua(e,t,r),l=o.every((e=>(0,v.isTypeSearchGroupAttribute)({data:e})||i.some((0,O.eqProps)("fieldName",e)))),s=(0,v.areAllOperatorsAnd)(t),c=(0,v.areAllOperatorsAnd)(n),u=n.every((({filter:e,data:{attrType:t={}}})=>[v.FilterOptions.EQUALS,v.FilterOptions.IN_RANGE,v.FilterOptions.FULL_TEXT,v.FilterOptions.ON,v.FilterOptions.WITHIN].includes(e)||v.FilterOptions.EXISTS===e&&(0,v.isBooleanType)(t.type))),p=(a=n,!Object.values(a.reduce(((e,{data:{fieldName:t},filter:r,values:n})=>(r===v.FilterOptions.EQUALS&&(0,O.path)([0,"length"],n)&&(e[t]=e[t]&&e[t]+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},La=e=>e.flatMap((e=>e.attributes)).filter((0,O.has)("data")),Ua=(e,t,r)=>{const n=La(t).map((({data:{fieldName:e,entityTypeUri:t},filter:r,values:n})=>({entityTypeUri:t,fieldName:e,filter:r,values:n}))).reduce(((t,{entityTypeUri:n,fieldName:a,filter:i,values:o})=>{const{attrType:l}=n?(0,x.eC)(e,[n],[],r).find((e=>e.fieldName===a))||{}:(0,Da.zH)(a,r)||{},s=!(0,O.isNil)(l)&&l.faceted?((e,t,r,n)=>{if(![v.FilterOptions.EQUALS,v.FilterOptions.IN_RANGE].includes(t)&&![v.FilterOptions.ON,v.FilterOptions.WITHIN].includes(t)||!Array.isArray(e)||(0,v.isEmptyValue)(e[0]))return(0,v.isBooleanType)(n)&&t===v.FilterOptions.EXISTS?[!0,!1]:e&&!(0,v.isEmptyValue)(e[0])?[e[0]]:[];switch(r){case v.FACET_TYPES.NUMERIC_RANGE_FACET:return((e,t)=>{switch(t){case v.FilterOptions.EQUALS:return e.map((e=>[e,e]));case v.FilterOptions.IN_RANGE:return e.some(v.isEmptyValue)?[]:[e]}})(e[0],t);case v.FACET_TYPES.DATE_RANGE_FACET:return((e,t)=>{switch(t){case v.FilterOptions.ON:{const t=Pa()(e),r=!(0,v.isTimestampBasedType)(n);return[[v.utils.dates.getStartOfDay(t,r),v.utils.dates.getEndOfDay(t,r)]]}case v.FilterOptions.WITHIN:return(0,v.isDateRangeValue)(e)?[(0,v.getDateRangeByValue)(e)]:e.some(v.isEmptyValue)?[]:[e]}})(e[0],t);default:return e[0]}})(o,i,(0,v.getFacetTypeForAttrType)(l),l.type):o;return(0,O.isNil)(s)||(t[a]=(0,O.uniq)((t[a]||[]).concat(s))),t}),{}),a=Object.keys(n).map((e=>({fieldName:e,values:n[e]})));return a.some((({values:e})=>e&&Array.isArray(e[0])&&e.length>1))?[]:a},ja=(e,t,r)=>{const n=(0,lt.VO)(t);return(0,x.eC)(e,n,[],r)},Fa=(e,t)=>({type:_.Z.UPDATE_ENTITIES,payload:{searchResults:e,entityTypeUri:t}}),Ma=({silent:e})=>({type:_.Z.CLEAR_ALL,payload:{silent:e}}),Va=({entityTypeUri:e,keywordValue:t})=>({type:_.Z.SHOW_MORE_RESULTS_FOR_ENTITY_TYPE,payload:{entityTypeUri:e,keywordValue:t}}),Ba=e=>({type:_.Z.UPDATE_TOTAL,payload:e}),za=e=>({type:_.Z.CHANGE_LOADING,payload:e}),Ha=(e,t=null,r=!1)=>({type:_.Z.MAP_CHANGE_VALUE,payload:{value:e,searchType:t,silent:r}}),Ya=(e,t)=>({type:R.k.CREATE_FACETS,payload:{facetsConfigs:e,addToEnd:t}}),Wa=e=>({type:R.k.DESTROY_FACETS,payload:e}),Ga=(e,t,r=!1)=>({type:R.k.CHANGE_VALUES,payload:{facetFieldName:e,values:t,silent:r}}),qa=e=>({type:R.k.UPDATE_DATA,payload:e}),Za=e=>({type:R.k.UPDATE_FILTERED_DATA,payload:e}),$a=({facetsToAdd:e,fieldNamesToDelete:t,changedEntityTypes:r,addToEnd:n})=>({type:R.k.HANDLE_CONFIGS_CHANGES,payload:{facetsToAdd:e,fieldNamesToDelete:t,changedEntityTypes:r,addToEnd:n}});var Ka=r(5236),Xa=r(54145),Qa=r(55443),Ja=r(65751),ei=r.n(Ja);const ti=e=>{(0,Qa.U)(e,{title:ei().text("Server Error"),defaultMessage:ei().text("Something went wrong...")})};var ri=r(21430);const ni=(e,t,r)=>`${e}/recommend/${r}/${t}`,ai=e=>e&&1===e.length?e[0]:null,ii=e=>[e].filter((0,O.complement)(v.isComplexAttribute)).map((0,O.compose)(_a.$9,(0,O.prop)("uri"))).concat((e.children||[]).map(ii)).flat(1/0);function*oi(){const e=yield(0,Ra.RE)(Fl),t=yield(0,Ra.Ys)(A().selectors.getTenant),r=yield(0,Ra.Ys)(A().selectors.getEnvironment),n=((e,t,r,n,a)=>{const i=e.map((({fieldName:e,values:t})=>({fieldName:e,values:t.map((e=>Array.isArray(e)?JSON.stringify(e):e))}))),o={facets:(0,_a._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:ni(r,n,a),options:{method:"POST",body:JSON.stringify(o),headers:{"Content-Type":"application/json"}}}})(e,0,yield(0,Ra.Ys)(A().selectors.getServicesPath),t,r);let a;try{a=yield(0,Ra.RE)(v.rawRequest,n.url,n.options),a=a.filter((e=>"type"!==e)).slice(0,5)}catch(e){a=[]}const i=yield(0,Ra.Ys)(A().selectors.getMetadata),o=yield(0,Ra.Ys)(C.DX);a=((e,t=[],r)=>{const n=ai(r),a=n&&(0,v.getEntityType)(e,n),i=(0,ri.vf)(e,a||{}).map(ii).flat(1/0);return t.filter((e=>n||!e.startsWith("attributes."))).filter((e=>!e.startsWith("attributes.")||i.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=ai(n);if(t){const r=((0,v.getEntityType)(e,t).defaultFacetedAttributes||[]).map((r=>(0,v.findAttributeTypeByUri)(e,r,t))).filter((e=>e&&(0,v.isReadableAttribute)(e)&&!(0,v.isComplexAttribute)(e))).map((0,O.prop)("uri")).map(_a.$9).filter(a);i=i.concat(r)}if(i.length<o){const e=(0,x.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,Ra.gz)((s=a,{type:R.k.SET_RECOMMENDED_FACETS_LIST,payload:s}))}const li=e=>({type:ie,payload:e}),si=e=>({type:oe,payload:e}),ci=(e,t)=>({type:le,payload:{show:e,postSavingAction:t}}),ui=e=>({type:se,payload:e}),pi=(e,t,r)=>({type:me,payload:{entityTypeUri:e,columns:t,prevColumns:r}}),di=(e,t=!1)=>({type:fe,payload:{entityTypeUri:e,silent:t}}),mi=e=>({type:ye,payload:e}),fi=()=>({type:Ee}),yi=e=>({type:be,payload:e}),gi=e=>yi({payload:{message:e,action:null},type:B.GT.info}),hi=({message:e,actionLabel:t,actionToDispatch:r,autoHideDuration:n})=>yi({payload:{message:e,action:{actionLabel:t,actionToDispatch:r},autoHideDuration:n},type:B.GT.info}),Ei=e=>({type:Te,payload:e}),bi=e=>({type:ce,payload:e});var vi=r(90503),Ti=r(82877);const Oi=(e={},t="")=>Object.keys(e).filter((r=>v.utils.strings.search(r,t)||v.utils.strings.search(e[r].displayName,t))),Si=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)}},xi=(e,t)=>e===t,Ci=new class{constructor(){this.isLookupValueResolveTaskRunning=(0,O.curry)(((e,t)=>(0,O.hasPath)([e,t],this._lookupValuesResolveTasks))),this._lookupValuesResolveTasks=Object.create(null)}addTask(e,t){e.forEach((({type:e,codeValues:r})=>{!this._lookupValuesResolveTasks[e]&&(this._lookupValuesResolveTasks[e]={}),r.forEach((r=>{this._lookupValuesResolveTasks[e][r]=t}))}))}deleteTask(e){e.forEach((({type:e,codeValues:t})=>{this._lookupValuesResolveTasks[e]&&t.forEach((t=>{delete this._lookupValuesResolveTasks[e][t]})),(0,O.isEmpty)(this._lookupValuesResolveTasks[e])&&delete this._lookupValuesResolveTasks[e]}))}getRunningTasks(e){const t=e.flatMap((({type:e,codeValues:t})=>this._lookupValuesResolveTasks[e]?t.reduce(((t,r)=>{const n=this._lookupValuesResolveTasks[e][r];return n&&t.push(n),t}),[]):[]));return(0,O.uniqWith)(xi,t)}clearTasks(){this._lookupValuesResolveTasks=Object.create(null)}};function*wi(e){const t=Ci.getRunningTasks(e);t.length>0&&(yield(0,Ra.v_)(t))}function*Ai(e){try{const t=e.flatMap((({type:e,codeValues:t})=>t.map((t=>({type:e,codeValue:t}))))),r=yield(0,Ra.rM)(v.resolveLookupsList,t);Ci.addTask(e,r);const n=(yield(0,Ra.v_)(r)).reduce(((e,t)=>{const[r]=Object.keys(t),[n]=Object.keys(t[r]),a=(0,O.lensPath)([r,n]),i=(0,O.path)([r,n],t);return(0,O.set)(a,i,e)}),{});for(const e in n)yield(0,Ra.gz)(w.profile.lookups.actions.lookupsForTypeResolved({type:e,values:n[e]}))}catch(e){console.warn(e)}finally{Ci.deleteTask(e)}}function*Ri(e){if((0,O.isEmpty)(e))return;const t=e.map((({type:e,codeValues:t})=>{const r=Ci.isLookupValueResolveTaskRunning(e);return{type:e,codeValues:t.filter((0,O.complement)(r))}})).filter((({codeValues:e})=>e.length>0));t.length>0&&(yield(0,Ra.RE)(Ai,t)),yield(0,Ra.RE)(wi,e)}function*_i(e,t,r=B.cu,n=1){const a=!t&&1===n,i=`${e}${r}`,o=a&&Si.getRunningTask(i);if(o)yield(0,Ra.v_)(o);else try{const o=yield(0,Ra.rM)(v.getDependentLookups,{type:e,displayNamePrefix:t,max:r,offset:r*(n-1)});a&&Si.addTask(i,o);const l=yield(0,Ra.v_)(o);yield(0,Ra.gz)(w.profile.lookups.actions.lookupsForTypeResolved({type:e,values:l.codeValues[e]}))}catch(e){console.warn(e)}finally{a&&Si.deleteTask(i)}}const Ii=(e,t,r)=>e.slice((r-1)*t,t*r);function*Ni(e,t,r,n=1){const a=yield(0,Ra.Ys)(A().selectors.getLookups),i=Oi(a[e],t);if(i.length>=r*n)return Ii(i,r,n);yield(0,Ra.RE)(_i,e,t,r,n);const o=yield(0,Ra.Ys)(A().selectors.getLookups);return Ii(Oi(o[e],t),r,n)}const Pi=(e,t)=>Object.keys(e).filter((e=>(0,Ia.iL)(e,t))).reduce(((r,n)=>(r[(0,Ia.iL)(n,t).fieldName]=e[n],r)),{});function Di(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){ki(e,t,r[t])}))}return e}function ki(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*Li(e,t,r){if((0,O.isEmpty)(e))return;const n=yield(0,Ra.Ys)(A().selectors.getLookups),a=yield(0,Ra.Ys)(A().selectors.getMetadata),i=Pi(r,e),o=yield(0,Ra.Ys)(Ti.Xf);yield(0,Ra.gz)(t((0,Ia.HC)(a,i,e,n,{allowedEntityTypes:o})))}function*Ui(e,t,r){try{const n=yield(0,Ra.RE)(xl,e.url,e.options),[a,i]=(0,O.partition)(x._H,t);yield(0,Ra.rM)(Li,i,r,n),yield(0,Ra.RE)(zi,a,n),yield(0,Ra.RE)(Li,a,r,n)}catch(e){console.warn(e)}}function*ji(e,t,r){e=Di({},e,{includeFilter:[]});const n=yield(0,Ra.Ys)(A().selectors.getGlobalSearchRequestOptions),a=(0,_a.aw)([e],t,[e.fieldName],n);yield(0,Ra.RE)(Ui,a,[e],r)}const Fi=(e,t=[])=>t.filter((({label:t})=>v.utils.strings.search(t,e))),Mi=(e,t)=>Fi(t,e).map((0,O.prop)("value"));function*Vi(e,t,r,n){const a=Di({},e),i=[...t];if((0,x._H)(a)){const t=(0,v.getAttrTypeLookupCode)(e.attrType);a.includeFilter=yield(0,Ra.RE)(Ni,t,r,(0,O.propOr)(B.cu,"pageSize",a),a.pageNumber)}else if("sourceSystems"===a.fieldName){const{sources:e}=yield(0,Ra.Ys)(A().selectors.getMetadata);a.includeFilter=((e,t)=>Fi(t,e).map((({uri:e})=>(0,v.getLastUriPart)(e))))(e,r)}else if((0,x.S9)(a)){const t=yield(0,Ra.Ys)(A().selectors.getMetadata),n=(0,v.getEntityType)(t,a.entityTypeUri)||{},i=(0,O.pipe)((0,O.propOr)([],"displayedItems"),(0,O.filter)((0,O.propEq)("isRaw",!0)))(e);a.includeFilter=[...(o=n.matchGroups,l=r,Fi(l,o).map((0,O.prop)("uri"))),...Mi(i,r)]}else a.disableIncludeFilter=!0,i.push({values:[r],fieldName:e.fieldName,filter:"containsWordStartingWith",forceInclude:!0});var o,l;const s=yield(0,Ra.Ys)(A().selectors.getGlobalSearchRequestOptions),c=(0,_a.aw)([a],i,[e.fieldName],s);yield(0,Ra.RE)(Bi,c,e,a.includeFilter,n)}function*Bi(e,t,r,n){try{const a=yield(0,Ra.RE)(xl,e.url,e.options),i=yield(0,Ra.Ys)(A().selectors.getLookups),o=Pi(a,[t]);if(r){const e=t.fieldName;o[e]=(0,Ia.AX)(o[e],r)}const l=yield(0,Ra.Ys)(A().selectors.getMetadata),s=yield(0,Ra.Ys)(Ti.Xf);yield(0,Ra.gz)(n((0,Ia.HC)(l,o,[t],i,{allowedEntityTypes:s})))}catch(e){console.warn(e)}}function*zi(e,t){const r=yield(0,Ra.Ys)(A().selectors.getLookups),n=(0,Ia.U4)(e,r),a=((e,t,r)=>{const n=((e,t)=>(0,O.pipe)(Object.entries,(0,O.reduce)(((e,[r,n])=>{const a=t.find((0,O.propEq)("fieldName",r));if(!a)return e;const{attrType:i}=a,o=(0,v.getAttrTypeLookupCode)(i);return e[o]={type:o,codeValues:(0,O.uniq)([...(0,O.pathOr)([],[o,"codeValues"],e),...Object.keys(n)])},e}),{}),O.values)(e))(e,t);return(0,v.getUnresolvedLookupsList)(r,n)})(t,e,r),i=(0,v.mergeLookupsLists)(n,a);i.length&&(yield(0,Ra.RE)(Ri,i))}var Hi=r(59295);function Yi(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Wi(e,t,r[t])}))}return e}function Wi(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*Gi(){const e=yield(0,Ra.Ys)(A().selectors.getMetadata),t=yield(0,Ra.Ys)(Ti.Xf),r=yield(0,Ra.Ys)(Ti.sl);return(0,vi.wM)(e,t,r)}const qi=e=>({value:t})=>!e.length||e.includes(t);function*Zi(e){e=e||(yield(0,Ra.Ys)(Xa.FR));const t=yield(0,Ra.Ys)(Ti.XM);if((0,vi.gj)(t)){const t=yield(0,Ra.Ys)(A().selectors.getMetadata),r=yield(0,Ra.Ys)(Hi.V6),n=(0,x.$t)(t),a=yield(0,Ra.Ys)(A().selectors.getGlobalSearchRequestOptions),i=(0,_a.aw)([n],e,[n.fieldName],a),o=({type:e=[]})=>{const t=e.filter(qi(r));return mi(t)};yield(0,Ra.RE)(Ui,i,[n],o)}else yield(0,Ra.gz)(mi([]))}function*$i(){const e=yield(0,Ra.Ys)(A().selectors.getMetadata),t=yield(0,Ra.Ys)(Ti.Xf),r=yield(0,Ra.Ys)(Hi.V6);return(0,Ia.wW)(e,{},t).filter(qi(r))}function*Ki(){const e=yield(0,Ra.Ys)(A().selectors.getMetadata),t=yield(0,Ra.RE)(Gi),r=yield(0,Ra.Ys)(Ti.uJ),n=(0,vi.oX)().map((0,O.prop)("id")),a=(0,O.pipe)((0,O.map)((0,O.filter)((0,O.pipe)((0,O.prop)("id"),(0,O.cond)([[(0,O.includes)("."),O.T],[(0,O.includes)(O.__,n),O.T],[O.T,O.F]])))),O.toPairs,(0,O.map)((([t,r])=>[t,(0,vi.Wh)(e,t,(0,O.map)((0,O.prop)("id"),r)).map(((e,t)=>{const n=r.find((0,O.propEq)("id",e.id)),{size:a,autoResize:i=0!==t&&!a}=n||{};return(0,O.reject)(O.isNil,Yi({},e,{size:a,autoResize:i}))}))])),O.fromPairs)(r),i=!(0,O.equals)(r,a),o=Object.keys(t),l=Object.keys(a);var s;!i&&(0,O.equals)(new Set(o),new Set(l))||(yield(0,Ra.gz)((s=Yi({},t,(0,O.pick)(o,a)),{type:de,payload:s})))}function*Xi(){const e=yield(0,Ra.Ys)(A().selectors.getMetadata),t=yield(0,Ra.Ys)(C.DX),r=(yield(0,Ra.Ys)(Ti.IJ))?yield(0,Ra.RE)($i):yield(0,Ra.RE)($l),n=(0,vi.nx)(e,r,t).map((0,O.prop)("value")),a=yield(0,Ra.Ys)(Ti.o4);n.includes(a)||(yield(0,Ra.gz)(di(n[0],!0)))}function*Qi(e={}){const{silent:t}=e.payload||{};if(!t){const e=yield(0,Ra.Ys)(Ti.tB),t=yield(0,Ra.Ys)(Xa.t9);if((0,v.isAvailableEntityTypeForDataTenant)(t,e)){const t=yield(0,Ra.Ys)(Xa.BP,{entityTypeUri:e});(0,O.isNil)(t)&&(yield(0,Ra.gz)({type:_.Z.REFRESH_DISPLAYED_ENTITIES}))}else yield(0,Ra.gz)(Fa([],e))}}function*Ji(e){const t=e.payload;yield(0,Ra.RE)(Qi,e);const r=yield(0,Ra.Ys)(Ti.gu);if((0,vi.gj)(t)&&0===r.length){const e=yield(0,Ra.RE)($i);yield(0,Ra.gz)(mi(e)),yield(0,Ra.RE)(Zi)}}function*eo(){const e=yield(0,Ra.Ys)(Ti.qx),t=yield(0,Ra.Ys)(Xa.Qy);e!==B.om.MAP&&t.length&&(yield(0,Ra.gz)(Ha(null)))}function*to(e){const t=(0,v.removeDtssPrefixFromEntityUri)(e.payload.uri),r=yield(0,Ra.Ys)(Ti.tB),n=((yield(0,Ra.Ys)(Xa.BP,{entityTypeUri:r}))||[]).map((0,O.prop)("uri")),a=(yield(0,Ra.Ys)(Xa.fx,{entityTypeUri:r}))||0,i=(yield(0,Ra.Ys)(Xa.Uz,{entityTypeUri:r}))||B.Tu[0],o=n.indexOf(t)+a*i,l=yield(0,Ra.Ys)(Xa.NU,{entityTypeUri:r}),s=yield(0,Ra.Ys)(A().selectors.getTenant),c=yield(0,Ra.Ys)(Xa.lF);yield(0,Ra.gz)(w.search.actions.setSearchNavigationData({uri:t,index:o,total:l,tenant:c||s,cache:n}))}const ro=[function*(){yield(0,Ra.Fm)(fe,Qi)},function*(){yield(0,Ra.Fm)(ve,Ji)},function*(){yield(0,Ra.Fm)([Ve,Be,He],Xi)},function*(){yield(0,Ra.Fm)(Te,eo)},function*(){yield(0,Ra.Fm)(w.ui.constants.UIActions.OPEN_ENTITY,to)}],no=e=>({type:$t,payload:e}),ao=e=>({type:Kt,payload:e}),io=()=>({type:lr}),oo=e=>({type:Er,payload:e}),lo=e=>({type:br,payload:e}),so=(e,t)=>({type:Or,payload:{uri:e,isLoading:t}});var co=r(90533),uo=r(86374),po=r(4898);function mo(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){fo(e,t,r[t])}))}return e}function fo(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*yo(){yield(0,Ra.gz)(lo(!0));try{const t=yield(0,Ra.Ys)(A().selectors.getUserName),r=e=>mo({},e,{isOwnSearch:t===e.owner}),n=yield(0,Ra.RE)(go),{result:a=[],total:i}=yield(0,Ra.RE)(v.getSavedSearches,n);yield(0,Ra.gz)((e=>({type:Jt,payload:e}))(i));const o=yield(0,Ra.Ys)(A().selectors.getMetadata),l=yield(0,Ra.Ys)(A().selectors.getDataTenants),s=yield(0,Ra.Ys)(A().selectors.getCanUserReadWorkflowDataTask);yield(0,Ra.gz)((e=a.map(r).map((0,uo.z7)(o,l,s)),{type:er,payload:e})),yield(0,Ra.gz)(lo(!1)),yield(0,Ra.RE)(bo,a)}catch(e){yield(0,Ra.gz)(lo(!1))}var e}function*go(){const e=yield(0,Ra.Ys)(co.s6),t=yield(0,Ra.Ys)(co.wH),r=yield(0,Ra.Ys)(co.U3),n=yield(0,Ra.Ys)(co.VS),a=yield(0,Ra.Ys)(co.kU),{field:i,order:o}=yield(0,Ra.Ys)(co.rT);return{offset:e*t,max:e,containsWordStartingWith:r,favoriteOnly:n,findPublic:a,countResults:!1,sortBy:B.PW[i],sortOrder:o}}function*ho(e){const t=yield(0,Ra.Ys)(co.EH,e.payload);yield(0,Ra.RE)(Eo,t)}function*Eo(e,t){yield(0,Ra.gz)(so(e.uri,!0));try{const{total:r}=yield(0,Ra.RE)(v.getTotalsForQuery,(0,v.replacePlaceholdersInQuery)(e.query),Boolean(t));yield(0,Ra.gz)(((e,t)=>({type:tr,payload:{uri:e,total:t}}))(e.uri,r))}catch(e){ti(e)}yield(0,Ra.gz)(so(e.uri,!1))}function*bo(e){const t=yield(0,Ra.Ys)(A().selectors.getQueryEstimatorEnabled);return yield(0,Ra.$6)(e.map((e=>(0,Ra.RE)(Eo,e,t))))}function*vo(e){const{uri:t,isPublic:r}=e.payload,n=yield(0,Ra.Ys)(co.EH,t);if(n){yield(0,Ra.gz)(lo(!0));try{yield(0,Ra.RE)(v.markSavedSearchAsPublic,(0,uo.Tp)(n),r),yield(0,Ra.gz)(((e,t)=>({type:cr,payload:{uri:e,isPublic:t}}))(t,r))}catch(e){ti(e)}yield(0,Ra.gz)(lo(!1))}}function*To(e){const{uri:t,isFavorite:r}=e.payload,n=yield(0,Ra.Ys)(co.EH,t);if(n){yield(0,Ra.gz)(lo(!0));try{yield(0,Ra.RE)(v.markSavedSearchAsFavorite,(0,uo.Tp)(n),r),yield(0,Ra.gz)(((e,t)=>({type:pr,payload:{uri:e,isFavorite:t}}))(t,r))}catch(e){ti(e)}yield(0,Ra.gz)(lo(!1))}}function*Oo(e){const{uri:t,isGlobalFilter:r}=e.payload,n=yield(0,Ra.Ys)(co.EH,t);if(n){const e=(0,uo.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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["uiState"]);(0,v.isObject)("2.0"===t.version?t:t.state)||!r?yield(0,Ra.gz)(((e,t)=>({type:"SAVED_SEARCHES_MARK_GLOBAL_FILTER",payload:{savedSearch:e,isGlobalFilter:t}}))(mo({},a,{uiState:t,query:(0,v.replacePlaceholdersInQuery)((0,O.propOr)("","query",a))}),r)):(0,Qa.U)({errorMessage:"Saved Search is incorrect"},{title:ei().text("Saved Search can't be mark as global")})}}function*So(e){const{uri:t,name:r}=e.payload,n=yield(0,Ra.Ys)(co.EH,t);if(n&&r!==n.name){yield(0,Ra.gz)(lo(!0));try{yield(0,Ra.RE)(v.updateSavedSearch,mo({},(0,uo.Tp)(n),{name:r})),yield(0,Ra.gz)(((e,t)=>({type:fr,payload:{uri:e,name:t}}))(t,r))}catch(e){ti(e)}yield(0,Ra.gz)(lo(!1))}}function*xo(){const e=yield(0,Ra.Ys)(co.Kh);yield(0,Ra.gz)(lo(!0));try{yield(0,Ra.$6)(e.map((e=>(0,Ra.RE)(v.deleteSavedSearch,e)))),yield(0,Ra.gz)(oo(e.map((0,O.prop)("uri"))))}catch(e){ti(e)}yield(0,Ra.gz)(lo(!1))}function*Co(e){const t=e.payload;yield(0,Ra.gz)(lo(!0));try{yield(0,Ra.RE)(v.deleteSavedSearch,{uri:t}),yield(0,Ra.gz)(oo([t]))}catch(e){ti(e)}yield(0,Ra.gz)(lo(!1))}function*wo(e=!1,t=!1){return{query:yield(0,Ra.Ys)(co.Cc,e),uiState:yield(0,Ra.Ys)(po.Z,t)}}function*Ao({payload:{name:e,share:t}}){const{query:r,uiState:n}=yield(0,Ra.RE)(wo,!0),a={isFavorite:!1,isPublic:t===B.ib.public,name:e,query:r,uiState:n},i=yield(0,Ra.Ys)(co.tp);yield(0,Ra.gz)(ci(!1));try{yield(0,Ra.gz)(gi(ei().text("Saving search...")));const e=yield(0,Ra.RE)(v.createSavedSearch,[a]);e[0].successful?(yield(0,Ra.gz)(no(e[0].object)),yield(0,Ra.gz)(ao(!1)),yield(0,Ra.gz)(gi(ei().text("Search saved successfully"))),i&&(yield(0,Ra.gz)(i))):ti(e)}catch(e){ti(e)}}function*Ro(e){const{uri:t,debounceTime:r}=e.payload;yield(0,Ra.gz)(si(!1));const n=yield(0,Ra.Ys)(co.EH,t),a=(0,co.In)(n)||{},{errors:i}=a;i&&i.length?((e=[])=>{(0,Qa.U)(e,{message:ei().text("Saved Search can't be applied")})})(i):(yield(0,Ra.gz)(no(n)),(yield(0,Ra.Ys)(Xa.lF))&&(a.currentTenant=yield(0,Ra.Ys)(A().selectors.getTenant)),yield(0,Ra.gz)(w.search.actions.updateState(mo({},a,{debounceTime:r}))),yield(0,Ra.qn)(_.Z.STATE_UPDATED))}const _o=[function*(){yield(0,Ra.Fm)([Qt,rr,nr,vr,ar,xr],yo)},function*(){const e={[sr]:vo,[ur]:To,[hr]:Co,[gr]:xo,[mr]:So,[dr]:Oo},t=yield(0,Ra.ZO)(Object.keys(e));for(;;){const r=yield(0,Ra.qn)(t);yield(0,Ra.RE)(e[r.type],r)}},function*(){yield(0,Ra.Fm)([Zt],Ao)},function*(){yield(0,Ra.Fm)([Tr],Ro)},function*(){yield(0,Ra.ib)([Sr],ho)}];function*Io(e){try{yield(0,Ra.RE)(v.createActivity,{label:v.ACTIVITY_TYPES.userSearch,description:JSON.stringify({activity:e,version:"2.0"})})}catch(e){console.warn(e)}}const No=e=>({type:Be,payload:{groupId:e}}),Po=(e,t)=>({type:Ge,payload:{groupId:e,attributeId:t,attribute:mt()}}),Do=(e,t,r)=>({type:Ge,payload:{groupId:e,attributeId:t,attribute:ft(r)}}),ko=(e,t,r)=>({type:qe,payload:{groupId:e,attributeId:t,attributeData:yt(r)}}),Lo=(e,t)=>({type:qe,payload:{groupId:e,attributeId:t,attributeData:null}}),Uo=(e,t,r)=>({type:Ze,payload:{groupId:e,attributeId:t,selectInfo:r}}),jo=(e,t,r)=>({type:$e,payload:{groupId:e,attributeId:t,operator:r}}),Fo=(e,t)=>({type:Ke,payload:{groupId:e,attributeId:t}}),Mo=(e,t)=>({type:Xe,payload:{groupId:e,attributeId:t}}),Vo=(e,t)=>({type:Qe,payload:{groupId:e,attributeId:t,id:(0,Me.x0)()}}),Bo=(e,t,r)=>({type:Je,payload:{groupId:e,attributeId:t,filter:r}}),zo=(e,t,r)=>({type:et,payload:{groupId:e,attributeId:t,values:r}}),Ho=(e,{attribute:t,value:r,debounceTime:n=0,pageNumber:a=1,currentOptions:i})=>({type:rt,payload:{groupId:e,attribute:t,value:r,debounceTime:n,pageNumber:a,currentOptions:i}}),Yo=(e,t,r)=>({type:nt,payload:{groupId:e,attributeId:t,values:r}}),Wo=(e,t)=>({type:at,payload:{groupId:e,attribute:t}});var Go=r(44006);function*qo({groups:e,findGroupPath:t=gt,attributesPropName:r,groupId:n,attributeId:a,selectInfo:i,actions:o}){const{checked:l,attribute:s,index:c,selectedAttributes:u}=i,{addAttributeAfter:p,changeAttribute:d,clearAttribute:m,deleteAttribute:f}=o,y=(0,O.pipe)(t(n),(0,O.path)(O.__,e),(0,O.propOr)([],r))(e),g=e=>(0,O.path)([e,"id"],y),h=y.findIndex((0,O.propEq)("id",a));if(a&&0===c)if(l)yield(0,Ra.gz)(d(n,a,s));else{let e=u[c+1];e?(yield(0,Ra.gz)(d(n,a,e)),yield(0,Ra.gz)(f(n,g(h+1)))):yield(0,Ra.gz)(m(n,a))}else{const e=u.length-c,t=a?h+c:y.length-e;l?yield(0,Ra.gz)(p(n,g(t-1),s)):yield(0,Ra.gz)(f(n,g(t)))}}function Zo(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){$o(e,t,r[t])}))}return e}function $o(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*Ko(e){const{groupId:t,attributeId:r,selectInfo:n}=e.payload,a=yield(0,Ra.Ys)(Hi.go),i={addAttributeAfter:Do,changeAttribute:ko,clearAttribute:Lo,deleteAttribute:Fo};yield(0,Ra.RE)(qo,{groups:a,attributesPropName:"attributes",groupId:t,attributeId:r,selectInfo:n,actions:i}),yield(0,Ra.gz)(No(t))}function*Xo(e){const{attribute:t,groupId:r}=e.payload,n=yield(0,Ra.Ys)(Hi._7,r),a=yield(0,Ra.Ys)(A().selectors.getGlobalSearchRequestOptions),{data:{fieldName:i},values:o}=t,l=yield(0,Ra.Ys)(Xa.L7,n,i),s=Zo({},t.data,{values:o?(0,O.flatten)(o):void 0,pageSize:t.data.pageSize+1}),c=(0,_a.aw)([s],l,[],a);yield(0,Ra.RE)(Ui,c,[s],(e=>((e,t,r)=>({type:tt,payload:{groupId:e,attributeId:t,values:r}}))(r,t.id,e[i])))}function*Qo(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,Ra.gz)(Yo(i,t.id,void 0));else{a&&(yield(0,Ra.gw)(a));const e=yield(0,Ra.Ys)(Hi.ad,i,t.id),c=e=>Yo(i,t.id,o.concat(e[s]));if(r){const a=l?[{values:[l],fieldName:"type",filter:"equals"}]:[],i=yield(0,Ra.Ys)(Xa.L7,a,s);yield(0,Ra.rM)(Vi,Zo({},t.data,{displayedItems:e,pageNumber:n,pageSize:t.data.pageSize+1}),i,r,c)}else{const r=yield(0,Ra.Ys)(Hi._7,i),a=yield(0,Ra.Ys)(Xa.L7,r,s);yield(0,Ra.rM)(ji,Zo({},t.data,{displayedItems:e,pageNumber:n,pageSize:t.data.pageSize+1}),a,c)}}}function*Jo(){const e=yield(0,Ra.Ys)(A().selectors.getSearchKeyword),t=yield(0,Ra.Ys)(Xa.vH),r=yield(0,Ra.RE)(Fl),n=yield(0,Ra.Ys)(A().selectors.getMetadata),a=yield(0,Ra.Ys)(A().selectors.getDataTenants),i=(0,Go.h)(n,a,r);yield(0,Ra.gz)(w.search.actions.updateState({advanced:i,keyword:e,map:t}))}function*el(e){const{groupId:t,attributeId:r}=e.payload;yield(0,Ra.gz)(Fo(t,r)),yield(0,Ra.gz)(No(t))}function*tl(){if(yield(0,Ra.Ys)(Ti.IJ)){const e=yield(0,Ra.Ys)(Hi.go),t=yield(0,Ra.Ys)(Ti.Xf);for(const r of e){const e=r.entityTypes||[];if((t?e.filter((e=>t.includes(e))):e).length!==e.length){yield(0,Ra.gz)(Ma({silent:!0}));break}}}}const rl=[function*(){yield(0,Ra.ib)([Ze],Ko)},function*(){yield(0,Ra.Fm)([rt],Qo)},function*(){yield(0,Ra.ib)(ot,Jo)},function*(){yield(0,Ra.ib)(at,Xo)},function*(){yield(0,Ra.ib)([Xe],el)}];function nl(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){al(e,t,r[t])}))}return e}function al(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*il(){const e=yield(0,Ra.Ys)(Xa.FR);yield(0,Ra.RE)(ll);const t=yield(0,Ra.Ys)(Ti.tB);var r;yield(0,Ra.gz)((r=t,{type:_.Z.RESET_PAGE,payload:{entityTypeUri:r}})),yield(0,Ra.rM)(Ml,e),yield(0,Ra.rM)(fl,e),(yield(0,Ra.Ys)(Ti.IJ))?yield(0,Ra.rM)(Zi,e):yield(0,Ra.rM)(oi)}function*ol(e){const{debounceTime:t}=e.payload||{};t&&(yield(0,Ra.gw)(t));const r=yield(0,Ra.Ys)(Xa.FR);yield(0,Ra.rM)(sl,r)}function*ll(){const e=yield(0,Ra.Ys)(Ti.tB);var t;yield(0,Ra.gz)((t=e,{type:_.Z.CLEAR_RESULTS,payload:t}))}function*sl(e){const t=yield(0,Ra.Ys)(A().selectors.getMetadata),r=yield(0,Ra.Ys)(Ti.tB),n=yield(0,Ra.Ys)(Xa.fx,{entityTypeUri:r}),a=yield(0,Ra.Ys)(Xa.Uz,{entityTypeUri:r}),i=yield(0,Ra.Ys)(Xa.L9,{entityTypeUri:r}),o=yield(0,Ra.Ys)(Xa.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,Ra.RE)(ml,r);c=(0,O.uniq)(c.concat(a).concat((0,_a.kx)(t,s,[_a.cI]))),l=!0}else c=(0,O.uniq)(c.concat((0,_a.kx)(t,s,[_a.Bo,_a.cI]))),l=!1;const u=nl({page:n,rowsPerPage:a,sortOrder:i,sortField:o,forceOvOnly:l},yield(0,Ra.Ys)(A().selectors.getGlobalSearchRequestOptions),{select:c}),p=(0,_a.XP)(s,u),d=yield(0,Ra.Ys)(Xa.lF);yield(0,Ra.gz)(za(!0));try{let e;if(d){const t=(0,_a.kH)(s,u);e=yield(0,Ra.RE)(xl,t)}else{const t=(0,_a.Lv)(s,u);e=yield(0,Ra.RE)(xl,B.NV,t)}Array.isArray(e)||(e=[]),yield(0,Ra.RE)(cl,(0,O.reject)(O.isNil,{query:p,sortField:o,sortOrder:i,dataTenant:d})),e=yield(0,Ra.RE)(Sl,e),yield(0,Ra.gz)(Fa(e,r))}catch(e){yield(0,Ra.gz)(Fa([],r))}yield(0,Ra.gz)(za(!1))}function*cl(e){var t;yield(0,Ra.gz)((t=e.query,{type:_.Z.UPDATE_URL,payload:t}));const r=yield(0,Ra.Ys)(A().selectors.getSearchProviderData);(0,O.equals)(null==r?void 0:r.data,e)||(yield(0,Ra.gz)(w.search.actions.setSearchNavigationData(null))),yield(0,Ra.gz)(w.search.actions.setSearchProviderData({type:"search",data:e}))}function*ul(e){const{columns:t,prevColumns:r}=e.payload;if((0,vi.tU)(t,r)){const e=yield(0,Ra.Ys)(Ti.o4),t=(yield(0,Ra.Ys)(Xa.BP,{entityTypeUri:e})).map((e=>e.uri)),r=yield(0,Ra.RE)(ml,e),n=yield(0,Ra.Ys)(Xa.FR),a=yield(0,Ra.Ys)(A().selectors.getGlobalSearchRequestOptions),i=(0,_a.aG)(t,n,nl({select:r},a));yield(0,Ra.gz)(za(!0));try{let t=yield(0,Ra.RE)(xl,i.url,i.options);t=yield(0,Ra.RE)(Sl,t),yield(0,Ra.gz)(Fa(t,e))}catch(t){yield(0,Ra.gz)(Fa([],e)),ti(t)}yield(0,Ra.gz)(za(!1))}}function*pl(){const e=yield(0,Ra.Ys)(Ti.tB),t=yield(0,Ra.Ys)(Xa.BP,{entityTypeUri:e});t&&(yield(0,Ra.gz)(w.search.actions.searchResultsSet(t)))}function*dl(e){const{entityTypeUri:t,keywordValue:r}=e.payload;yield(0,Ra.gz)(((e=!1)=>({type:R.k.CLEAR_ALL_VALUES,payload:{silent:e}}))(!0)),yield(0,Ra.gz)(Ga("type",[t],!0)),yield(0,Ra.gz)(w.search.actions.keywordUpdated({value:r,isRawFilter:!1}))}function*ml(e){const t=yield(0,Ra.Ys)(Ti.Gv,e);return(0,vi.vw)(t)}function*fl(e){const t=yield(0,Ra.Ys)(A().selectors.getGlobalSearchRequestOptions),r=(0,_a.Vg)(e,[],t);try{const e=yield(0,Ra.RE)(xl,B.jS,{method:"POST",body:JSON.stringify(r)});yield(0,Ra.gz)(Ba(e.total))}catch(e){yield(0,Ra.gz)(Ba(0))}}function*yl(){yield(0,Ra.RE)(hl);const e=yield(0,Ra.RE)(wo,!0);(0,O.isEmpty)(e.query)||(yield(0,Ra.RE)(Io,e))}const gl=[tt];function*hl(){for(;yield(0,Ra.Ys)(Hi.UM);)yield(0,Ra.qn)(gl)}function*El(e){const{debounceTime:t}=e.payload||{};t&&(yield(0,Ra.gw)(t)),(0,Ia.$L)(e)&&(yield(0,Ra.RE)(Wl)),(0,O.pathOr)(!1,["payload","silent"],e)||(yield(0,Ra.RE)(il),yield(0,Ra.RE)(yl))}function*bl(e){const t=(0,O.path)(["payload","searchOptions"],e),r=(0,O.path)(["payload","errors"],e),n=(0,O.pathOr)(0,["payload","debounceTime"],e);r&&r.length&&((e=[])=>{(0,Qa.U)(e,{message:ei().text("Can't apply search state")})})(r),!((yield(0,Ra.Ys)(A().selectors.getShowSearchByOv))??(yield(0,Ra.Ys)(Ti.cC)))&&t&&t.searchByOv&&(yield(0,Ra.gz)(w.search.actions.updateSearchOptions({searchByOv:!1,ovOnly:!1}))),yield(0,Ra.RE)(Zl),yield(0,Ra.RE)(tl),yield(0,Ra.RE)(Ki),yield(0,Ra.RE)(Xi),yield(0,Ra.RE)(vl),yield(0,Ra.gz)(((e=0)=>({type:_.Z.STATE_UPDATED,payload:{debounceTime:e}}))(n))}function*vl(){const e=yield(0,Ra.Ys)(Ti.d7),t=yield(0,Ra.Ys)(Xa.Qy);!e&&t.length&&(yield(0,Ra.gz)(Ha(null,null,!0)))}function*Tl(){const e=yield(0,Ra.Ys)(Xa.A7),{activityFilter:t,globalFilter:r}=yield(0,Ra.Ys)(A().selectors.getGlobalSearchRequestOptions),n=yield(0,Ra.Ys)(A().selectors.getSearchOptions),a=n&&n.searchByOv,i=[(0,_a.s4)(e,[],{globalFilter:r})];a&&i.push("options=searchByOv"),t&&i.push(`activeness=${t}`);const o=i.filter(O.identity).join("&"),l=new URLSearchParams(o);if(yield(0,Ra.Ys)(A().selectors.getSharedPreferencesEnabled)){const e=yield(0,Ra.Ys)(A().selectors.getServicesPath),t=yield(0,Ra.Ys)(A().selectors.getTenant),r=yield(0,Ra.Ys)(A().selectors.getEnvironment),n=yield(0,Ra.Ys)(A().selectors.getUserName),a=yield(0,Ra.Ys)(Ti.XM),i=yield(0,Ra.Ys)(Ti.uJ),o=(0,O.pipe)((0,O.map)((0,O.pipe)((0,O.map)((0,O.path)(["attrType","uri"])),(0,O.reject)(v.isEmptyValue))),(0,O.reject)(O.isEmpty)),s="searchExportData",c={name:s,tenant:t,environment:r,user:n,servicesPath:e,value:{searchResultsColumnsUris:(0,vi.gj)(a)?o(i):void 0}};try{yield(0,Ra.RE)(v.setSharedPreferences,c),l.set("sharedPreferenceName",s)}catch(e){ti(e)}}yield(0,Ra.gz)(w.ui.actions.openConsoleApp("Export","entities",l.toString()))}function*Ol(){yield(0,Ra.gz)(w.ui.actions.openConsoleApp("Data Loader","projects"))}function*Sl(e){const t=yield(0,Ra.Ys)(Xa.lF);return e&&t?e.map((0,v.enrichEntityWithDataTenant)(t)):e}function*xl(e,t){const r=yield(0,Ra.Ys)(A().selectors.getTenant),n=yield(0,Ra.Ys)(Xa.lF),a=yield(0,Ra.Ys)(A().selectors.getDtssPath);return yield(0,Ra.RE)(_a.Es,{url:e,options:t,customerTenant:r,dataTenant:n,dtssPath:a})}const Cl=[R.k.CHANGE_VALUES,w.search.constants.KEYWORD_UPDATED,_.Z.REFRESH,R.k.CLEAR_ALL_VALUES,_.Z.MAP_CHANGE_VALUE,_.Z.CLEAR_ALL,_.Z.STATE_UPDATED,it,w.search.constants.SEARCH_OPTIONS_UPDATED,w.search.constants.ACTIVITY_FILTER_UPDATED,w.search.constants.GLOBAL_FILTER_UPDATED,_.Z.CHANGE_CURRENT_TENANT],wl=[function*(){yield(0,Ra.Fm)(Cl,El)},function*(){yield(0,Ra.Fm)([_.Z.CHANGE_PAGE,_.Z.RESET_PAGE,_.Z.CHANGE_ROWS_PER_PAGE,_.Z.REFRESH_DISPLAYED_ENTITIES,_.Z.CHANGE_SORT],ol)},function*(){yield(0,Ra.Fm)(me,ul)},function*(){yield(0,Ra.Fm)([_.Z.UPDATE_ENTITIES,fe,ve],pl)},function*(){yield(0,Ra.Fm)(_.Z.SHOW_MORE_RESULTS_FOR_ENTITY_TYPE,dl)},function*(){yield(0,Ra.Fm)(w.search.constants.UPDATE_STATE,bl)},function*(){yield(0,Ra.Fm)(_.Z.EXPORT_RESULTS,Tl)},function*(){yield(0,Ra.Fm)(_.Z.OPEN_DATA_LOADER,Ol)}];var Al=r(56906);function Rl(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*_l(e,t){try{const[r,n]=yield(0,Ra.RE)(Il,e,[]);if((0,O.isNil)(r)||(0,O.isNil)(n))yield(0,Ra.gz)(qa({[e.fieldName]:[]}));else{const[a,i]=(0,Ia.dG)(e.type),o=(0,Ia.q7)(a,r),l=(0,Ia.q7)(i,n),s=(0,Ka.Oz)(e.attrType&&e.attrType.type),[c,u]=s.greaterThan(o,l)?[l,o]:[o,l],p=yield(0,Ra.RE)(Nl,e,c,u,t),d={[e.fieldName]:p};yield(0,Ra.gz)(qa(d))}}catch(e){console.warn(e)}}function*Il(e,t){const r=yield(0,Ra.Ys)(A().selectors.getGlobalSearchRequestOptions),n=(0,_a.rN)(e,t,[e.fieldName],r),a=yield(0,Ra.RE)(xl,n.url,n.options),i=Pi(a,[e]),{min:o,max:l,count:s}=(0,Ia.Kn)(i,[e])[e.fieldName];return s?[(0,x.bB)(e)?0:o,l]:[]}function*Nl(e,t,r,n){const a=e.attrType&&e.attrType.type,i=(0,Al.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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Rl(e,t,r[t])}))}return e}({interval:o,offset:t},yield(0,Ra.Ys)(A().selectors.getGlobalSearchRequestOptions)),s=(0,_a.ti)(e,n,[e.fieldName],l),c=yield(0,Ra.RE)(xl,s.url,s.options),u=yield(0,Ra.Ys)(A().selectors.getMetadata),p=Pi(c,[e]),d=(0,Ia.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 Pl(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Dl={matches:_a.dW,"dtPotentialMatches.matches":_a.dW,"potentialMatches.matchScore":_a._9};function*kl(e,t){try{const[r,n]=yield(0,Ra.RE)(Il,e,[]);if((0,O.isNil)(r)||(0,O.isNil)(n))yield(0,Ra.gz)(qa({[e.fieldName]:[]}));else{const[a,i]=(0,Ia.dG)(e.type),o=(0,Ia.q7)(a,r),l=(0,Ia.q7)(i,n),s=yield(0,Ra.RE)(Ll,e,o,l,t),c={[e.fieldName]:s};yield(0,Ra.gz)(qa(c))}}catch(e){console.warn(e)}}function*Ll(e,t,r,n){const a=yield(0,Ra.Ys)(A().selectors.getGlobalSearchRequestOptions),i=Math.min(5,r-t+1),o=yield(0,Ra.RE)(v.rawRequest,Dl[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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Pl(e,t,r[t])}))}return e}({},a,{dataTenant:e.dataTenant})));return o.map((e=>({number:e.count,value:[e.from,e.to]})))}function Ul(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.push.apply(n,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=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*Fl(){const e=yield(0,Ra.Ys)(C.X0),t=yield(0,Ra.Ys)(C.Mp);return Object.values((0,Ia.t8)(e,t))}function*Ml(e){const t=yield(0,Ra.RE)(Fl),[r,n]=(0,O.partition)(x.bB,t);let[a,i]=(0,O.partition)(v.isRangeFacet,n);for(let t=0;t<r.length;t++)yield(0,Ra.rM)(kl,r[t],e);for(let t=0;t<a.length;t++)yield(0,Ra.rM)(_l,a[t],e);const[o,l]=(0,O.partition)((e=>e.values&&e.values.length),i);for(let t=0;t<o.length;t++)yield(0,Ra.rM)(Bl,o[t],e);const[s,c]=(0,O.partition)(x.DT,l);for(const t of s)yield(0,Ra.rM)(zl,[t],e);c.length&&(yield(0,Ra.rM)(zl,c,e))}function*Vl(e){const t=yield(0,Ra.Ys)(Xa.FR),[r,n]=(0,O.partition)(x.bB,e.payload),[a,i]=(0,O.partition)(v.isRangeFacet,n),[o,l]=(0,O.partition)(x.DT,i);for(let e=0;e<r.length;e++)yield(0,Ra.rM)(kl,r[e],t);for(let e=0;e<a.length;e++)yield(0,Ra.rM)(_l,a[e],t);for(const e of o)yield(0,Ra.rM)(zl,[e],t);l.length&&(yield(0,Ra.rM)(zl,l,t))}function*Bl(e,t,r){const n=yield(0,Ra.Ys)(A().selectors.getGlobalSearchRequestOptions),a=(0,_a.aw)([Ul({},e,{pageSize:e.pageSize+1})],t,[e.fieldName],n,r);yield(0,Ra.RE)(Hl,a,[e])}function*zl(e,t,r){const n=yield(0,Ra.Ys)(A().selectors.getGlobalSearchRequestOptions),a=(0,_a.aw)(e.map((e=>Ul({},e,{pageSize:e.pageSize+1}))),t,[],n,r);yield(0,Ra.RE)(Hl,a,e)}function*Hl(e,t){yield(0,Ra.RE)(Ui,e,t,qa)}function*Yl(e){const{facetFieldName:t,value:r,debounceTime:n,pageNumber:a=1,currentOptions:i=[]}=e.payload;if(""===r&&1===a)yield(0,Ra.gz)((e=>({type:R.k.DESTROY_FILTERED_DATA,payload:e}))(t));else{const e=yield(0,Ra.Ys)(C.X0),o=yield(0,Ra.Ys)(C.Mp),l=Ul({},(0,Ia.t8)(e,o)[t]);if("type"===t){const e={[t]:[...l.data.filter((e=>e.label.toLowerCase().includes(r.toLowerCase())))]};yield(0,Ra.gz)(Za(e))}else{n&&(yield(0,Ra.gw)(n));const e=yield(0,Ra.Ys)(Xa.FR),o=yield(0,Ra.Ys)(C.rM,t),s=e=>Za({[t]:i.concat(e[t])});r?yield(0,Ra.rM)(Vi,Ul({},l,{displayedItems:o,pageNumber:a,pageSize:l.pageSize+1}),e,r,s):yield(0,Ra.rM)(ji,Ul({},l,{pageNumber:a,pageSize:l.pageSize+1}),e,s)}}}function*Wl(){const e=yield(0,Ra.Ys)(C.DX),t=t=>t.entityTypeUri&&t.entityTypeUri!==e[0],r=yield(0,Ra.Ys)(C.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,Ra.gz)(Wa(n)))}}function*Gl(e){const{facetsToAdd:t=[],fieldNamesToDelete:r=[],changedEntityTypes:n,addToEnd:a=!1}=e.payload;if(t.length||r.length){t.length&&(yield(0,Ra.gz)(Ya(t,a)));const e=yield(0,Ra.RE)(Fl);let o=!1;if(r.length){const t=e.filter((e=>e.values&&e.values.length));o=r.some((e=>t.some((t=>{var r;return null===(r=t.fieldName)||void 0===r?void 0:r.startsWith(e)})))),yield(0,Ra.gz)(Wa(r))}if(null!=n)yield(0,Ra.gz)(Ga("type",n));else if(o)yield(0,Ra.gz)((({debounceTime:e}={})=>({type:_.Z.REFRESH,payload:{debounceTime:e}}))());else if(t.length){const r=e.filter((e=>t.some((t=>e.fieldName.startsWith(t.fieldName)))));yield(0,Ra.gz)((i=r,{type:R.k.REQUEST_GIVEN_FACETS_DATA,payload:i}))}}var i}function*ql(){const e=yield(0,Ra.Ys)(A().selectors.getSearchKeyword),t=yield(0,Ra.Ys)(Xa.vH),r=yield(0,Ra.Ys)(Hi.go),n=yield(0,Ra.Ys)(A().selectors.getMetadata),a=yield(0,Ra.Ys)(A().selectors.getDataTenants);if(ka(n,r,a)){const i=((e,t,r)=>{const n=ja(e,t,r),a=Ua(e,t,r),i=(0,O.pipe)(O.flatten,O.uniq)((0,lt.VO)(t)),o=(0,x.$t)(e);return a.reduce(((e,{fieldName:t,values:r})=>{const a=n.find((e=>e.fieldName===t));return a&&(e.facetsConfigs.push(a),e.facetsData[t]={values:r}),e}),{facetsConfigs:[o],facetsData:{[o.fieldName]:(l=i,(0,Ia.Kk)({values:l})?{values:l,showAllItems:!0}:{values:l})}});var l})(n,r,a);yield(0,Ra.gz)(w.search.actions.updateState({facets:i,keyword:e,map:t}))}}function*Zl(){if(!(yield(0,Ra.Ys)(Ti.IJ))){const e=yield(0,Ra.Ys)(A().selectors.getMetadata);if((yield(0,Ra.Ys)(C.Mp)).some(v.isTypeFacet)){const e=yield(0,Ra.Ys)(Ti.Xf),t=yield(0,Ra.Ys)(C.DX);(e?t.filter((t=>e.includes(t))):t).length!==t.length&&(yield(0,Ra.gz)(Ma({silent:!0})))}else{const t=[(0,x.$t)(e)];yield(0,Ra.gz)(Ya(t))}}}function*$l(){const e=yield(0,Ra.Ys)(A().selectors.getMetadata),t=yield(0,Ra.Ys)(C.X0),r=(0,Ia.t8)({type:t.type},[(0,x.$t)(e)]).type.data.reduce(((e,t)=>(e[(0,v.getLastUriPart)(t.value)]=t.number,e)),{}),n=yield(0,Ra.Ys)(Ti.Xf);return(0,Ia.wW)(e,r,n)}const Kl=[function*(){yield(0,Ra.Fm)([R.k.FILTER_FACET_DATA],Yl)},function*(){yield(0,Ra.ib)(R.k.REQUEST_GIVEN_FACETS_DATA,Vl)},function*(){yield(0,Ra.ib)(R.k.HANDLE_CONFIGS_CHANGES,Gl)},function*(){yield(0,Ra.ib)(R.k.CONVERT_FROM_ADVANCED_SEARCH,ql)}];function Xl(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ql=e=>{const t=["view","searchResultsColumns"],r=(0,O.pathOr)({},t,e),n=(0,O.map)((0,O.map)((0,O.pipe)((0,O.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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Xl(e,t,r[t])}))}return e}({},e,{attrType:{uri:(0,O.pathOr)("",["attrType","uri"],e)}}):e))),r),a=(0,O.lensPath)(t),i=(0,O.omit)(["sortField","sortOrder","entityTypeTab"],e.view),o=(0,O.lensPath)(["view"]),l=["keyword"],s=(0,O.pathOr)("",l,e),c=(0,O.lensPath)(l),u=["map"],p=(0,O.pathOr)("",u,e),d=(0,O.lensPath)(u);return(0,O.pipe)((0,O.omit)(["searchOptions"]),(0,O.set)(o,i),(0,O.set)(a,n),(0,O.set)(c,s),(0,O.set)(d,p))(e)};function Jl(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){es(e,t,r[t])}))}return e}function es(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*ts({payload:{share:e}}){const{query:t,uiState:r}=yield(0,Ra.RE)(wo,!0),n=Jl({},yield(0,Ra.Ys)(co.LA),{isPublic:e===B.ib.public,query:t,uiState:r}),a=yield(0,Ra.Ys)(co.tp);yield(0,Ra.gz)(ci(!1));try{yield(0,Ra.gz)(gi(ei().text("Updating search..."))),yield(0,Ra.RE)(v.updateSavedSearch,n),yield(0,Ra.gz)(ao(!1)),yield(0,Ra.gz)(gi(ei().text("Search updated successfully"))),a&&(yield(0,Ra.gz)(a))}catch(e){ti(e)}}function*rs(){const e=yield(0,Ra.Ys)(co.LA);if(!e)return void(yield(0,Ra.gz)(ao(!1)));const t=yield(0,Ra.Ys)(A().selectors.getMetadata),r=yield(0,Ra.Ys)(A().selectors.getDataTenants),n=yield(0,Ra.Ys)(A().selectors.getCanUserReadWorkflowDataTask),{uiState:a}=(0,uo.z7)(t,r,n,yield(0,Ra.RE)(wo)),i=(({savedUiState:e,actualUiState:t})=>{const r=Ql(e),n=Ql(t);if(!(0,O.equals)(r,n))return!1;if((0,O.path)(["view","searchResultsMode"],e)===B.ll.TABLE){const r=["view","sortField"],n=["view","sortOrder"],a=["view","entityTypeTab"],i=(0,O.path)(r,e),o=(0,O.path)(r,t),l=(0,O.path)(n,e),s=(0,O.path)(n,t),c=(0,O.path)(a,e),u=(0,O.path)(a,t);if(!(0,O.equals)(i,o)||!(0,O.equals)(l,s)||!(0,O.equals)(c,u))return!1}const a=["searchOptions"],i=(0,O.pathOr)(null,a,e),o=(0,O.pathOr)(null,a,t);return!!((0,O.isNil)(i)||(0,O.isNil)(o)||(0,O.equals)(i,o))})({savedUiState:e.uiState,actualUiState:a});yield(0,Ra.gz)(ao(!i))}function*ns(e){const t=yield(0,Ra.Ys)(co.LA);if(t)switch(e.type){case fr:case cr:case pr:t.uri===e.payload.uri&&(yield(0,Ra.gz)(no(Jl({},t,e.payload))));break;case Er:(0,O.includes)(t.uri,e.payload)&&(yield(0,Ra.gz)(no(null)));break;case Xt:yield(0,Ra.gz)(no(Jl({},t,{isPublic:e.payload.share===B.ib.public})));break;default:(yield(0,Ra.Ys)(Xa.kw))&&(yield(0,Ra.gz)(no(null)))}}function*as(e){const t=yield(0,Ra.Ys)(co.EH,e);if(t)return t;const r=yield(0,Ra.Ys)(A().selectors.getMetadata),n=yield(0,Ra.Ys)(A().selectors.getDataTenants),a=yield(0,Ra.Ys)(A().selectors.getCanUserReadWorkflowDataTask);try{const t=yield(0,Ra.RE)(v.getSavedSearch,(0,uo.tk)(e));return(0,uo.z7)(r,n,a,t)}catch(e){return ti(e),null}}function*is(e){const t=(0,O.path)(["payload","currentSavedSearchUri"],e);if(!t)return;const r=yield(0,Ra.Ys)(co.LA);if((0,O.prop)("uri",r)===t)return;const n=yield(0,Ra.RE)(as,t);n&&(yield(0,Ra.gz)(no(n)),yield(0,Ra.RE)(rs))}const os=[...Cl,fe,_.Z.CHANGE_SORT,ve,me,he,ge,Te,R.k.CREATE_FACETS,R.k.DESTROY_FACETS,R.k.SHOW_MORE_ENTITY_TYPES],ls=[function*(){yield(0,Ra.Fm)(os,rs)},function*(){yield(0,Ra.Fm)([Xt],ts)},function*(){yield(0,Ra.Fm)([fr,cr,pr,Er,Xt,...Cl],ns)},function*(){yield(0,Ra.Fm)(w.search.constants.UPDATE_STATE,is)}];function ss(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*cs(){yield(0,Ra.gw)(500);const{uiState:e,query:t}=yield(0,Ra.RE)(wo,!1,!0),r=yield(0,Ra.Ys)(co.LA);yield(0,Ra.gz)(w.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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){ss(e,t,r[t])}))}return e}({},e,{query:t,currentSavedSearchUri:(0,O.path)(["uri"],r)})))}function*us(){yield(0,Ra.qn)(w.search.constants.UPDATE_STATE);const e=(0,O.reject)((0,O.includes)(O.__,[_.Z.REFRESH]),os);yield(0,Ra.Fm)([$t,...e],cs)}const ps=e=>({type:Cr,payload:e}),ds=()=>({type:Nr}),ms=e=>({type:Dr,payload:e}),fs=e=>({type:Lr,payload:e}),ys=(e,t)=>({type:Fr,payload:{searchCreatedDate:e,isLoading:t}});var gs=r(97010),hs=r(73667);const Es=(0,O.path)([B.Jf,"recentSearches"]),bs=e=>Es(e).items,vs=e=>Es(e).filterWord,Ts=(0,O.curry)(((e,t)=>!e||t&&t.name.toLocaleLowerCase().includes(e.toLocaleLowerCase()))),Os=e=>(0,O.pipe)(bs,(0,O.filter)(Ts(vs(e))))(e),Ss=e=>Es(e).loading,xs=(0,hs.Rm)(bs),Cs=(0,hs.d1)(bs),ws=(0,hs.Ky)(bs),As=(0,hs.$y)(bs),Rs=e=>Es(e).lastSavedRecentSearch,_s=(e,t)=>bs(e).find((0,O.propEq)("createdDate",t)),Is=(0,O.path)(["advancedSearch","searchParams","groups"]);function Ns(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Ps(e,t,r[t])}))}return e}function Ps(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*Ds(){yield(0,Ra.gz)(fs(!0));try{const t=yield(0,Ra.Ys)(A().selectors.getTenant),r=yield(0,Ra.Ys)(A().selectors.getEnvironment),n=yield(0,Ra.Ys)(A().selectors.getServicesPath),{result:a=[]}=yield(0,Ra.RE)(v.getRecentSearches,{environment:r,tenant:t,servicesPath:n}),i=(0,O.sort)((0,O.descend)((0,O.prop)("createdDate")))(a);yield(0,Ra.gz)((e=i,{type:Ar,payload:e})),yield(0,Ra.gz)(fs(!1)),yield(0,Ra.RE)(Us,i)}catch(e){ti(e),yield(0,Ra.gz)(fs(!1))}var e}function*ks(e){const t=yield(0,Ra.Ys)(_s,e.payload);yield(0,Ra.RE)(Ls,t)}function*Ls(e,t){yield(0,Ra.gz)(ys(e.createdDate,!0));try{const{total:r}=yield(0,Ra.RE)(v.getTotalsForQuery,(0,v.replacePlaceholdersInQuery)(e.query),Boolean(t));yield(0,Ra.gz)(((e,t)=>({type:Rr,payload:{searchCreatedDate:e,total:t}}))(e.createdDate,r))}catch(e){ti(e)}yield(0,Ra.gz)(ys(e.createdDate,!1))}function*Us(e){const t=yield(0,Ra.Ys)(A().selectors.getQueryEstimatorEnabled);return yield(0,Ra.$6)(e.map((e=>(0,Ra.RE)(Ls,e,t))))}function*js(){const e=yield(0,Ra.Ys)(As),t=yield(0,Ra.Ys)(A().selectors.getServicesPath);yield(0,Ra.gz)(fs(!0));try{yield(0,Ra.$6)(e.map((e=>(0,Ra.RE)(v.deleteRecentSearch,Ns({},e,{servicesPath:t}))))),yield(0,Ra.gz)(ms(e))}catch(e){ti(e)}yield(0,Ra.gz)(fs(!1))}function*Fs(e){const t=e.payload,r=yield(0,Ra.Ys)(A().selectors.getServicesPath);yield(0,Ra.gz)(fs(!0));try{yield(0,Ra.RE)(v.deleteRecentSearch,Ns({},t,{servicesPath:r})),yield(0,Ra.gz)(ms([t]))}catch(e){ti(e)}yield(0,Ra.gz)(fs(!1))}function*Ms(e){const{debounceTime:t}=e.payload??{};t&&(yield(0,Ra.gw)(t));const{query:r,uiState:n}=yield(0,Ra.RE)(wo,!0),a=yield(0,Ra.Ys)(Ti.$s),i=yield(0,Ra.Ys)(Rs),o=yield(0,Ra.Ys)(Xa.kw),l=yield(0,Ra.Ys)(A().selectors.getTenant),s=yield(0,Ra.Ys)(A().selectors.getEnvironment),c=yield(0,Ra.Ys)(A().selectors.getServicesPath),u=((e={})=>{const t=Is(e);return t&&t.length>0?((e={})=>{const t=(0,O.chain)((0,O.prop)("attributes")),r=(0,O.filter)((0,O.has)("values")),n=(0,O.pipe)(Is,t,r),a=(0,O.pipe)((0,O.prop)("values"),(0,O.map)((0,O.prop)("label")),(0,O.join)(", ")),i=(0,O.path)(["data","title"]),o=(0,O.pathEq)(["data","fieldName"],"type"),l=(0,O.find)(o),s=(0,O.pipe)(l,(0,O.when)(O.identity,a)),c=(0,O.pipe)((0,O.reject)(o),(0,O.map)(i),(0,O.reject)(O.isNil),(0,O.join)(", "));return[s(u=n(e)),c(u)].filter(O.identity).join(" - ");var u})(e):((e={})=>{const t=(0,O.prop)("facets"),r=(0,O.prop)("facetsData"),n=(0,O.prop)("facetsConfigs"),a=(0,O.prop)("values"),i=(0,O.prop)("label"),o=(0,O.prop)("title"),l=(0,O.pipe)(a,(e=>e&&e.length>0)),s=(0,O.curry)(((e,r)=>(0,O.pipe)(t,n,(0,O.find)((0,O.propEq)("fieldName",r)),(0,O.defaultTo)({}),o)(e))),c=(0,Ia.XK)(e),u=[];c&&u.push(a(c).map((e=>(0,O.pipe)((0,O.propOr)([],"data"),(0,O.find)((0,O.propEq)("value",e)),(0,O.defaultTo)({}),i))).map((e=>e(c))).join(", "));const p=(0,O.pipe)(t,r,O.values,(0,O.reject)(v.isTypeFacet),(0,O.filter)(l),(0,O.map)((0,O.prop)("fieldName"))),d=(0,O.pipe)(p,(0,O.map)(s(e)))(e);return d.length>0&&u.push(d.join(", ")),u.filter(O.identity).join(" - ")})(e)})(a),p=(0,v.getHash)(r),d={query:r,state:n,name:u,environment:s,tenant:l};try{if(i!==p&&!o){const e=yield(0,Ra.RE)(v.createRecentSearch,d,c);e.success?yield(0,Ra.gz)((e=>({type:jr,payload:e}))(p)):ti(e)}}catch(e){ti(e)}}function*Vs(e){const{search:t,debounceTime:r}=e.payload;yield(0,Ra.gz)(si(!1));const n=yield(0,Ra.Ys)(A().selectors.getMetadata),a=yield(0,Ra.Ys)(A().selectors.getDataTenants),i=yield(0,Ra.Ys)(A().selectors.getCanUserReadWorkflowDataTask);let o={};try{o=(0,O.pipe)(gs.Z,(0,gs.f)(null))(n,JSON.parse(t.state),{},a,i)}catch(e){o={}}(yield(0,Ra.Ys)(Xa.lF))&&(o.currentTenant=yield(0,Ra.Ys)(A().selectors.getTenant)),yield(0,Ra.gz)(w.search.actions.updateState(Ns({},o,{debounceTime:r})))}const Bs=({type:e,payload:t={}})=>e===w.search.constants.KEYWORD_UPDATED&&!(null==t||!t.saveToRecent),zs=[function*(){yield(0,Ra.Fm)([wr],Ds)},function*(){yield(0,Ra.ib)(Pr,js)},function*(){yield(0,Ra.Fm)([w.ui.constants.UIActions.OPEN_ENTITY,Zt,Xt,Cr,_.Z.CHANGE_PAGE,_.Z.CHANGE_ROWS_PER_PAGE,_.Z.EXPORT_RESULTS,Bs],Ms)},function*(){yield(0,Ra.Fm)([Vr],Vs)},function*(){yield(0,Ra.ib)([Mr],ks)},function*(){yield(0,Ra.ib)(kr,Fs)}],Hs=e=>e[B.Jf].entity.loading,Ys=e=>e[B.Jf].entity.selectedEntityUri,Ws=e=>e[B.Jf].entity.entity,Gs=e=>({type:un,payload:e}),qs=e=>({type:pn,payload:e}),Zs=e=>({type:dn,payload:e}),$s=e=>({type:mn,payload:e});function*Ks(e){if(yield(0,Ra.Ys)(Xa.lF)){const t=yield(0,Ra.RE)(xl,(0,v.getDtssEntityUrl)(e));return(yield(0,Ra.RE)(Sl,t))[0]}{const t=yield(0,Ra.Ys)(A().selectors.getMetadata),r=(0,v.addMetadataSpecificGetEntityOptions)(t);return yield(0,Ra.RE)(v.getEntity,e,r)}}function*Xs(e){const t=e.payload;(yield(0,Ra.Ys)(Ys))!==t&&(yield(0,Ra.gz)(Zs(t)));const r=yield(0,Ra.Ys)(Ws);if(yield(0,Ra.gz)(Gs(!0)),(0,O.isNil)(t))yield(0,Ra.gz)($s(null));else if(!r||r.uri!==t)try{const e=yield(0,Ra.RE)(Ks,t);yield(0,Ra.gz)($s(e))}catch(e){n=e,(0,Qa.U)(n,{defaultMessage:ei().text("Can't load entity")}),yield(0,Ra.gz)($s(null))}var n;yield(0,Ra.gz)(Gs(!1))}const Qs=[function*(){yield(0,Ra.Fm)(pn,Xs)}];function*Js(e){const t="type"===(0,O.path)(["payload","facetFieldName"],e),r=(0,O.path)(["payload","values"],e);if(!t||1!==(0,O.length)(r))return;const n=yield(0,Ra.Ys)(A().selectors.getMetadata),a=(0,v.getEntityType)(n,r[0]),i=a.defaultFacetedAttributes||[];if(i.length>0){const e=yield(0,Ra.Ys)(C.Mp),t=({fieldName:t})=>(0,O.none)((0,O.propEq)("fieldName",t),e),r=(0,ri.vf)(n,a).map((e=>(0,ri.NG)(n,e,a.uri,"",x.u7))),o=i.reduce(((e,n)=>{const a=(0,v.attributeUriToSearchUri)(n),i=(0,x.zy)(r,a);return i&&t(i)?e.concat(i.children?(0,ri.jj)(i).filter(t):i):e}),[]);o.length>0&&(yield(0,Ra.gz)(Ya(o,!0)))}}const ec=[function*(){yield(0,Ra.Fm)(R.k.CHANGE_VALUES,Js)}],tc=e=>({type:_n,payload:e}),rc=()=>({type:Pn}),nc=()=>({type:Tn}),ac=e=>({type:xn,payload:e}),ic=e=>({type:wn,payload:e}),oc=e=>({type:Rn,payload:e}),lc=e=>({type:Nn,payload:e}),sc=e=>({type:Dn,payload:e}),cc=({id:e,groupId:t})=>({type:jn,payload:{id:e,groupId:t}}),uc=({id:e,groupId:t,operationParameters:r})=>({type:Un,payload:{id:e,groupId:t,operationParameters:r}}),pc=(e,t,r)=>({type:Mn,payload:{groupId:e,attributeId:t,attribute:ft(r)}}),dc=(e,t,r)=>({type:Vn,payload:{groupId:e,attributeId:t,attributeData:yt(r)}}),mc=(e,t)=>({type:Vn,payload:{groupId:e,attributeId:t,attributeData:null}}),fc=(e,t,r)=>({type:Bn,payload:{groupId:e,attributeId:t,selectInfo:r}}),yc=(e,t)=>({type:zn,payload:{groupId:e,attributeId:t}}),gc=(e,t,r)=>({type:Hn,payload:{groupId:e,attributeId:t,filter:r}}),hc=(e,t,r)=>({type:Yn,payload:{groupId:e,attributeId:t,values:r}}),Ec=e=>({type:Zn,payload:e});var bc=r(27901);const vc=(0,O.has)("actions"),Tc=e=>e.actions.map((0,O.assocPath)(["operationParameters","conditions"],e.conditions)),Oc=(0,O.path)(["operationParameters","attributeTypeData","attributeType"]),Sc=(0,O.path)(["operationParameters","attributeTypeData","fieldName"]),xc=(0,O.path)(["operationParameters","pin"]),Cc=(0,O.path)(["operationParameters","addNestedAttribute"]),wc=(0,O.path)(["operationParameters","attributeValue"]),Ac=(0,O.path)(["operationParameters","attributeValueToFind"]),Rc=(0,O.anyPass)([(0,O.equals)($n.d.AddNew),(0,O.equals)($n.d.ReplaceAllWith)]),_c=(0,O.anyPass)([(0,O.equals)($n.d.AddNew),(0,O.equals)($n.d.ReplaceAllWith),(0,O.equals)($n.d.FindAndReplace)]),Ic=(0,O.equals)($n.d.AddNew),Nc=(0,O.both)((0,O.pipe)(Oc,v.isNested),(0,O.pipe)((0,O.prop)("operation"),Rc)),Pc=(0,O.both)((0,O.pipe)(Oc,v.isReference),(0,O.pipe)((0,O.prop)("operation"),Ic)),Dc=(0,O.both)((0,O.pipe)(wc,v.isLookupAttrType),(0,O.pipe)((0,O.prop)("operation"),_c)),kc=(0,O.pipe)(Oc,v.isLookupAttrType),Lc=e=>{switch(e){case $n.d.AddNew:case $n.d.RepointReference:case $n.d.ReplaceAllWith:return["attributeValue"];case $n.d.FindAndReplace:return["attributeValueToFind","attributeValue"];case $n.d.FindAndRemove:return["attributeValueToFind"];default:return[]}},Uc=e=>{if(!e.operation||!e.operationParameters)return!1;const t=Nc(e),r=Pc(e),n=kc(e),a=Lc(e.operation);for(let i of a){const a=e.operationParameters[i];if((0,v.isEmptyValue)(a)||n&&(0,v.isEmptyValue)((0,v.getAttrTypeLookupCode)(a))||r&&(0,v.isEmptyValue)((0,v.getReferencedEntityFromAttrValue)(a))||t&&(0,v.isEmptyValue)((0,v.cleanAttributesWith)({deleteEmptyComplex:!0})(a.value)))return!1}return!0},jc=e=>{const t=Nc(e),r=Pc(e);return t||r?Lc(e.operation).reduce(((e,t)=>{const r=["operationParameters",t,"value"];if((0,O.path)(r,e)){const t=(0,O.lensPath)(r);return(0,O.over)(t,(0,v.cleanAttributesWith)({deleteEmptyComplex:!0}),e)}return e}),e):e},Fc=e=>e[B.Jf].bulkUpdate.operation,Mc=e=>e[B.Jf].bulkUpdate.activeStep,Vc=e=>e[B.Jf].bulkUpdate.loading,Bc=e=>{const t=(0,Ti.IJ)(e)?(0,Hi.V6)(e):(0,C.DX)(e),r=(0,Ti.tB)(e);return r||1===t.length?r||t[0]:null},zc=(0,O.path)([B.Jf,"bulkUpdate","objects"]),Hc=e=>zc(e).total,Yc=e=>zc(e).selectionMode,Wc=e=>zc(e).entities,Gc=e=>zc(e).selectedEntities,qc=e=>zc(e).page,Zc=e=>zc(e).rowsPerPage,$c=e=>zc(e).sortField,Kc=e=>zc(e).sortOrder,Xc=e=>zc(e).selectedColumns,Qc=e=>zc(e).filterText,Jc=(0,O.pipe)(Yc,(0,O.equals)(B.v6.include)),eu=(0,O.ifElse)(Jc,(0,O.pipe)(Gc,O.length),(e=>{const t=Gc(e).length;return(0,Xa.hX)(e)-t})),tu=(0,O.pipe)(eu,(0,O.gt)(O.__,0)),ru=e=>e[B.Jf].bulkUpdate.actions,nu=(0,bc.P1)(ru,(0,O.pipe)((0,O.map)((0,O.ifElse)(vc,(0,O.evolve)({actions:(0,O.pipe)((0,O.map)(jc),(0,O.filter)(Uc))}),jc)),(0,O.filter)((0,O.ifElse)(vc,(0,O.pipe)((0,O.path)(["actions","length"]),(0,O.gt)(O.__,0)),Uc)))),au=(0,bc.P1)(ru,(0,O.pipe)((0,O.map)((0,O.when)(vc,(0,O.prop)("actions"))),O.flatten)),iu=e=>{const t=au(e);return 0!==t.length&&t.every(Uc)},ou=e=>e[B.Jf].bulkUpdate.requestPending,lu=(0,v.getUrisForSaving)((e=>(0,O.equals)(e.slice(-3),["operationParameters","attributeValue","entityUri"]))),su=(0,O.curry)(((e,t,r)=>{const n=(0,O.pipe)(lu,(0,O.find)((t=>(0,O.pathSatisfies)((t=>t===e),t,r))))(r);return n?(0,O.set)((0,O.lensPath)(n),t,r):r})),cu=(e,t,r)=>(0,O.pipe)(su(e,t),(0,O.when)((e=>e===r),(0,v.replaceTemporaryRefEntityURI)(e,t)))(r),uu=(0,O.pathEq)(["data","fieldName"],B.E_),pu=(0,O.pipe)((0,O.path)(["values",0,"entityUri"]),(0,O.objOf)("uri"),v.getEntityId,v.wrapInQuotes),du=e=>[{attributes:e,operator:"or"}],mu=(0,O.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===B.Vp.AddAttribute&&l--,i.length||(i=a.slice(-1),l++);const s=`${(0,O.repeat)("parent.",Math.max(0,l)).join("")}attributes.${i.join(".")}`;return(0,O.assocPath)(["data","fieldName"],s,r)})))),fu=(0,O.curry)(((e,t,r)=>{const n=((e,t,r)=>{const[n,a]=(0,O.partition)(uu,e),i=(0,O.pipe)(mu(t,r),du,_a.Jk)(a),o=n.length?(e=>`in(${B.E_}, ${e.map(pu).join(",")})`)(n):"";return i&&o?`${i} and ${o}`:i||o})(e,t,r.operation);return(0,O.isEmpty)(n)?r:(0,O.ifElse)((0,O.pipe)((0,O.path)(["operationParameters","valueFilter"]),v.isEmptyValue),(0,O.assocPath)(["operationParameters","valueFilter"],n),(0,O.evolve)({operationParameters:{valueFilter:(0,O.concat)(O.__,` and (${n})`)}}))(r)}));var yu=r(9828);function gu(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){hu(e,t,r[t])}))}return e}function hu(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Eu=e=>{const t=(0,O.pipe)((0,O.pick)(["pin"]),(0,O.assoc)("value",bu(e)))(e);return(0,yu.Kn)(t.value)?Object.keys(t.value).reduce(((e,r)=>(e.value=gu({},e.value,{[r]:t.value[r].map(Eu)}),e)),t):t},bu=(0,O.when)(yu.Kn,(0,O.ifElse)((0,O.has)("lookupCode"),(0,O.prop)("lookupCode"),(0,O.prop)("value"))),vu=(0,O.cond)([[Nc,(0,O.pipe)(wc,Eu)],[Pc,(0,O.pipe)(wc,(e=>{const{refEntity:t=[],refRelation:r=[]}=e;return gu({refEntity:(0,O.pipe)(O.head,(0,O.pick)(["objectURI"]))(t),refRelation:(0,O.pipe)(O.head,(0,O.pick)(["type"]))(r)},Eu(e))}))],[Dc,(0,O.pipe)(wc,bu)],[O.T,wc]]),Tu=(0,O.pipe)(vu,(0,O.assocPath)(["operationParameters","attributeValue"])),Ou=(0,O.ifElse)(xc,(()=>(0,O.assocPath)(["operationParameters","pin"],!0)),(()=>O.identity)),Su=(0,O.ifElse)(Cc,(()=>(0,O.assocPath)(["operationParameters","addNestedAttribute"],!0)),(()=>O.identity)),xu=(0,O.pipe)(Ac,(0,O.ifElse)(O.isNil,(()=>O.identity),(0,O.pipe)(((e="")=>`equals(value, '${bu(e)}')`),(0,O.assocPath)(["operationParameters","valueFilter"])))),Cu=(0,O.pipe)(wc,(0,O.prop)("entityUri"),(0,O.assocPath)(["operationParameters","referencedEntity","uri"])),wu=(e,t)=>({operationParameters:{attributeURI:e},operation:t}),Au=(e,t)=>(0,O.pipe)(wu,Tu(e),Ou(e),Su(e))(t,B.Vp.AddAttribute),Ru=(e,t)=>(0,O.pipe)(wu,xu(e))(t,B.Vp.DeleteAttribute),_u=(e,t)=>(0,O.pipe)(wu,Tu(e),Ou(e),xu(e))(t,B.Vp.UpdateAttribute),Iu=(e,t)=>(0,O.pipe)(wu,Cu(e))(t,B.Vp.RepointReferencedEntity),Nu=(e,t)=>(0,O.reject)(O.isNil,{operationParameters:e,operation:t}),Pu=e=>Nu({tags:[wc(e)]},B.Vp.AddTags),Du=e=>Nu({newValue:wc(e),oldValue:Ac(e)},B.Vp.ReplaceTag),ku=e=>Nu({tags:[Ac(e)]},B.Vp.DeleteTags),Lu=()=>Nu(null,B.Vp.ClearTags),Uu=(e,t=[],r={})=>{const{selectionMode:n,selectedEntities:a=[]}=e,{searchOptions:i,activityFilter:o,globalFilter:l}=r;return n===B.v6.include?{list:a,activeness:o}:{filter:(0,O.pipe)(_a.XP,(0,v.addGlobalFilterToQuery)(l))(t),excludeList:a,options:i,activeness:o}},ju=(0,O.curry)(((e,t)=>(0,O.chain)((0,O.ifElse)(vc,(0,O.pipe)(Tc,ju(e)),Fu(e)))(t))),Fu=(0,O.curry)(((e,t)=>{const r=(0,O.pathOr)([],["operationParameters","conditions"],t),n=Sc(t);return(0,O.pipe)(Vu(e),(0,O.map)(fu(r,n)))(t)})),Mu=(0,O.curry)((e=>(0,O.propEq)("operation",e))),Vu=(0,O.curry)(((e,t)=>{const r=Sc(t),n=r.includes(".")?(0,v.searchUriToAttrUri)(r,e):r,a=r===v.EntityAttrTypes.tags.uri;return(0,O.cond)([[(0,O.both)((0,O.always)(a),Mu($n.d.AddNew)),()=>[Pu(t)]],[(0,O.both)((0,O.always)(a),Mu($n.d.Clear)),()=>[Lu()]],[(0,O.both)((0,O.always)(a),Mu($n.d.ReplaceAllWith)),()=>[Lu(),Pu(t)]],[(0,O.both)((0,O.always)(a),Mu($n.d.FindAndReplace)),()=>[Du(t)]],[(0,O.both)((0,O.always)(a),Mu($n.d.FindAndRemove)),()=>[ku(t)]],[Mu($n.d.AddNew),()=>[Au(t,n)]],[Mu($n.d.Clear),()=>[Ru(t,n)]],[Mu($n.d.ReplaceAllWith),()=>[Ru(t,n),Au(t,n)]],[Mu($n.d.FindAndReplace),()=>[_u(t,n)]],[Mu($n.d.FindAndRemove),()=>[Ru(t,n)]],[Mu($n.d.RepointReference),()=>[Iu(t,n)]]])(t)}));function Bu(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){zu(e,t,r[t])}))}return e}function zu(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*Hu(e){if(e.payload){const e=yield(0,Ra.Ys)(Ti.tB);let r;do{if(r=yield(0,Ra.Ys)(Xa.BP,{entityTypeUri:e}),r)break;yield(0,Ra.qn)(_.Z.UPDATE_ENTITIES)}while(!r);const n=yield(0,Ra.Ys)(Bc),a=yield(0,Ra.Ys)(Xa.fx,{entityTypeUri:e}),i=yield(0,Ra.Ys)(Xa.Uz,{entityTypeUri:e}),o=(yield(0,Ra.Ys)(Xa.L9,{entityTypeUri:e}))||void 0,l=yield(0,Ra.Ys)(Xa.NW,{entityTypeUri:e}),s=(yield(0,Ra.RE)(Gi))[n].filter((0,O.pipe)((0,O.prop)("id"),v.isAttributeSearchUri,O.not)),c=e?yield(0,Ra.Ys)(Ti.Gv,e):s,u=yield(0,Ra.Ys)(Xa.NU,{entityTypeUri:e});yield(0,Ra.gz)((t={page:a,rowsPerPage:i,sortOrder:o,sortField:l,selectedColumns:c,total:u,entities:r},{type:vn,payload:t}))}var t}function*Yu(e){const t=yield(0,Ra.Ys)(A().selectors.getMetadata),r=yield(0,Ra.Ys)(qc),n=yield(0,Ra.Ys)(Zc),a=yield(0,Ra.Ys)(Kc),i=yield(0,Ra.Ys)($c),o=yield(0,Ra.RE)(ep),l=(0,O.uniq)(o.concat((0,_a.kx)(t,e))),s=Bu({page:r,rowsPerPage:n,sortOrder:a,sortField:i,forceOvOnly:!0},yield(0,Ra.Ys)(A().selectors.getGlobalSearchRequestOptions),{select:l}),c=(0,_a.Lv)(e,s);yield(0,Ra.gz)(ac(!0));try{const e=yield(0,Ra.RE)(v.rawRequest,B.NV,c);yield(0,Ra.gz)(tc(e))}catch(e){console.warn(e),yield(0,Ra.gz)(tc([]))}yield(0,Ra.gz)(ac(!1))}function*Wu(){const e=yield(0,Ra.Ys)(Qc),t=yield(0,Ra.RE)(Ju,e);yield(0,Ra.rM)(Yu,t)}function*Gu(e={}){const{debounceTime:t}=e.payload||{};t&&(yield(0,Ra.gw)(t));const r=yield(0,Ra.Ys)(Qc),n=yield(0,Ra.RE)(Ju,r);yield(0,Ra.gz)(ic(0)),yield(0,Ra.rM)(qu,n)}function*qu(e){const t=yield(0,Ra.Ys)(A().selectors.getGlobalSearchRequestOptions),r=(0,_a.Vg)(e,[],t);try{const e=yield(0,Ra.RE)(v.rawRequest,B.jS,{method:"POST",body:JSON.stringify(r)});yield(0,Ra.gz)(lc(e.total))}catch(e){console.warn(e),yield(0,Ra.gz)(lc(0))}}function*Zu(){const e=(yield(0,Ra.Ys)(Wc)).map((e=>e.uri)),t=yield(0,Ra.RE)(ep),r=yield(0,Ra.Ys)(Qc),n=yield(0,Ra.RE)(Ju,r),a=yield(0,Ra.Ys)(A().selectors.getGlobalSearchRequestOptions),i=(0,_a.aG)(e,n,Bu({select:t},a));yield(0,Ra.gz)(ac(!0));try{const e=yield(0,Ra.RE)(v.rawRequest,i.url,i.options);yield(0,Ra.gz)(tc(e))}catch(e){console.warn(e),yield(0,Ra.gz)(tc([]))}yield(0,Ra.gz)(ac(!1))}function*$u(e){try{yield(0,Ra.RE)(v.rawRequest,e.url,e.options),yield(0,Ra.gz)(bi(!1)),yield(0,Ra.gz)(hi({message:ei().text("Bulk update is currently in progress. You'll receive an email notification once completed.\nGo to Tenant Management to view the status."),actionLabel:ei().text("Tenant Management"),actionToDispatch:w.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?ei().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||ei().text("Something went wrong...")),yield(0,Ra.gz)((t=r,yi({payload:{message:t,action:{actionToDispatch:fi()}},type:B.GT.error})))}var t}function*Ku(){const e=yield(0,Ra.Ys)(Fc);e===B.dV.UpdateProfiles?yield(0,Ra.RE)(Xu):e===B.dV.DeleteProfiles&&(yield(0,Ra.RE)(Qu))}function*Xu(){yield(0,Ra.gz)(Ec(!0));const e=yield(0,Ra.Ys)(Bc),t=yield(0,Ra.Ys)(zc);let r=yield(0,Ra.Ys)(nu);const n=yield(0,Ra.RE)(Ju),a=yield(0,Ra.Ys)(A().selectors.getGlobalSearchRequestOptions),i=yield(0,Ra.Ys)(A().selectors.getModifiedEntities),o=((e,t)=>{const r=(0,v.findAllTemporaryRefEntityURI)(t),n=(a=t,(0,O.pipe)(lu,(0,v.getPathsWithTempUri)(a),(0,O.map)((e=>(0,O.path)(e,a))))(a));var a;return r.concat(n).filter((t=>e[t]))})(i,r);if(o.length>0){const e=yield(0,Ra.RE)(v.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=((e,t={},r=[],n=[],a={})=>({objects:Uu(t,n,a),actions:ju(e,r)}))(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,Ra.RE)($u,l),yield(0,Ra.gz)(Ec(!1))}function*Qu(){yield(0,Ra.gz)(Ec(!0));const e=function(e,t,r){const n={objects:Uu(e,t,r)};return{url:"/entities/_delete?sendMail=true",options:{method:"POST",body:JSON.stringify(n),headers:{"Content-Type":"application/json"}}}}(yield(0,Ra.Ys)(zc),yield(0,Ra.RE)(Ju),yield(0,Ra.Ys)(A().selectors.getGlobalSearchRequestOptions));yield(0,Ra.RE)($u,e),yield(0,Ra.gz)(Ec(!1))}function*Ju(e){const t=yield(0,Ra.Ys)(Xa.FR),r={fieldName:"type",filter:"equals",values:[yield(0,Ra.Ys)(Bc)]};let n=t.filter((e=>"type"!==e.fieldName)).concat(r);return e&&(n=n.concat({fieldName:"attributes",filter:"containsWordStartingWith",values:[e]})),n}function*ep(){const e=yield(0,Ra.Ys)(Xc);return(0,vi.vw)(e)}function*tp(e){const{groupId:t,attributeId:r,selectInfo:n}=e.payload,a=yield(0,Ra.Ys)(ru),i={addAttributeAfter:pc,changeAttribute:dc,clearAttribute:mc,deleteAttribute:yc};yield(0,Ra.RE)(qo,{groups:a,attributesPropName:"conditions",groupId:t,attributeId:r,selectInfo:n,actions:i})}const rp=[function*(){yield(0,Ra.Fm)(ce,Hu)},function*(){yield(0,Ra.Fm)([wn,Cn,An],Wu)},function*(){yield(0,Ra.Fm)(In,Gu)},function*(){yield(0,Ra.Fm)(Pn,Zu)},function*(){yield(0,Ra.ib)(Bn,tp)},function*(){yield(0,Ra.ib)(qn,Ku)}],np=()=>({id:B.Jf,reducerMap:{[B.Jf]:(0,T.combineReducers)({ui:Fe,search:ae,facets:V,advancedSearch:qt,savedSearches:Jr,recentSearches:cn,entity:En,bulkUpdate:Aa})},sagas:[...wl,...Kl,...ro,...rl,..._o,...zs,...ls,us,...Qs,...ec,...rp]});var ap=r(8156),ip=r.n(ap),op=r(95099),lp=r.n(op),sp=r(34756),cp=r(78310),up=r.n(cp),pp=r(23625),dp=r.n(pp),mp=r(53732),fp=r.n(mp),yp=r(88214),gp=r.n(yp),hp=r(14294),Ep=r.n(hp),bp=r(4501),vp=r.n(bp),Tp=r(87925),Op=r(18538),Sp=r(42950);const xp=(0,Sp.Z)((()=>({container:({height:e=36})=>({height:e,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 Cp(){return Cp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Cp.apply(null,arguments)}function wp(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Ap(e,t,r[t])}))}return e}function Ap(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Rp=e=>{let{value:t,autofocus:r,onSearch:n=O.identity,rootRef:a,classes:i={},height:o,placeholder:l=ei().text("Search"),endAdornmentContent:s}=e,c=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["value","autofocus","onSearch","rootRef","classes","height","placeholder","endAdornmentContent"]);const u=xp({height:o}),[p,d]=(0,ap.useState)(""),m=(0,O.pipe)((0,O.tap)(n),d),f=(0,O.isNil)(t)?p:t;return ip().createElement(fp(),Cp({startAdornment:ip().createElement(gp(),{position:"start"},ip().createElement(vp(),{className:u.icon})),endAdornment:ip().createElement(gp(),{position:"end"},f.length>0&&ip().createElement(Op.T,{icon:Ep(),className:u.clearButton,onClick:()=>m("")}),s),autoFocus:r,classes:wp({},i,{input:up()(u.input,i.input),root:up()(u.container,i.root)}),placeholder:l,value:f,onChange:(0,O.pipe)(Tp.NA,m),disableUnderline:!0,ref:a},c))},_p=(0,ap.memo)(Rp),Ip=(0,Sp.Z)((()=>({container:({containerHeight:e=553,containerWidth:t})=>({display:"flex",flexDirection:"column",height:e,width:t,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 Np(){return Np=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Np.apply(null,arguments)}const Pp=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,f=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.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=Ip({containerWidth:l,containerHeight:s}),g=ip().createElement(ip().Fragment,null,!a&&ip().createElement("div",{className:y.header},t),!i&&ip().createElement(_p,{onSearch:n,autofocus:!0,onKeyDown:c,inputRef:p,classes:{root:y.searchInputContainer},placeholder:ei().text("Search & add attributes"),height:40}));return ip().createElement(dp(),Np({anchorOrigin:d,transformOrigin:m},f),ip().createElement("div",{className:up()(y.container,r),style:{width:l}},"top"===o&&g,ip().createElement("div",{className:y.list},u),"bottom"===o&&g))},Dp=e=>{const t=e=>(0,O.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})))},kp=e=>e.titleItemIndex===e.index;var Lp=r(50166),Up=r(62515);const jp=(0,Sp.Z)({stickyTitlesWrapper:{position:"absolute",top:0,"& > div":{zIndex:1,position:"absolute",top:0,width:"100%",visibility:"hidden"}}}),Fp=({items:e,getItemSize:t,renderItem:r,renderGroupTitle:n,width:a="100%",height:i,fixedTitle:o=!0,itemKey:l=(e=>e),disableHorizontalScrollbar:s,hideSubtitles:c,focusIndex:u=null,onInnerContainerResize:p})=>{const d=jp(),m=(0,ap.useRef)(null),f=(0,ap.useRef)(null),y=(0,ap.useRef)(null),g=(0,ap.useRef)([0]),h={topMargin:0},E=(0,ap.useMemo)((()=>!c||(e||[]).some((e=>null!==e.titleItemIndex))),[e,c]),b=(0,ap.useCallback)((r=>{const n=g.current.length;let a=0;e.slice(n-1,r+1).forEach(((e,r)=>{const i=n+r-1;r>0&&(g.current[i]=g.current[i-1]+a),a=t(i,e.item)}))}),[t,e]),v=(0,ap.useCallback)((t=>e[t].titleItemIndex),[e]),T=(0,ap.useCallback)((t=>e[t]),[e]);(0,ap.useEffect)((()=>{requestAnimationFrame((()=>{m.current&&m.current.scrollTo(0)}))}),[e.length]),(0,ap.useEffect)((()=>{m.current&&m.current.resetAfterIndex(0),O();const r=(e=>{const r=e.findIndex((e=>e.item.moveTo));if(r>-1){b(r);const e=v(r);return{offset:g.current[r],titleHeight:t(e,T(e).item)}}})(e);if(r&&r.offset&&m.current){const{titleHeight:e}=r,t=r.offset-e;(t<m.current.state.scrollOffset||t>m.current.state.scrollOffset+i)&&requestAnimationFrame((()=>{m.current&&m.current.scrollTo(t-(i-e)/2)}))}}),[b,T,t,v,i,g,e,m]);const O=()=>{y.current&&f.current&&(y.current.style.width=f.current.offsetWidth+"px")},S=(0,ap.useCallback)((t=>{let r=null,n=0;return e.some(((e,a)=>{b(a+10);const i=g.current[a+1];return t>=n&&t<i&&(r={index:a,offset:n,listItem:e}),n=i,r})),r}),[b,g,e]),x=(0,ap.useCallback)((e=>t(e,T(e).item)),[T,t]),C=(0,ap.useCallback)((({index:e,style:t,data:a})=>{const i=T(e);return i.item&&(kp(i)&&n(t,i.item)||r(t,i.item,e,a))}),[T,n,r]),{handleOnItemsRendered:w}=(({focusIndex:e,listRef:t,items:r})=>{const n=(0,ap.useRef)(null),a=(0,ap.useRef)(null),i=(0,ap.useCallback)((({visibleStartIndex:e,visibleStopIndex:t})=>{n.current=e,a.current=t}),[]);return(0,ap.useEffect)((()=>{t.current&&null!==e&&0!==r.length&&(e<Math.max(n.current+3,0)?t.current.scrollToItem(Math.max(e-3,0),"start"):e>Math.min(a.current-3,r.length-1)&&t.current.scrollToItem(Math.min(e+3,r.length-1),"end"))}),[e,r.length,t]),{handleOnItemsRendered:i}})({items:e,focusIndex:u,listRef:m}),A=(0,ap.useCallback)((()=>e.filter((e=>kp(e))).map((e=>(e=>ip().createElement("div",{className:"stickyTitleItem",style:{visibility:"hidden"},"data-index":e.index,key:e.index},n({height:t(e.index,e.item)},e.item)))(e)))),[t,e,n]);return ip().createElement(ip().Fragment,null,ip().createElement("div",{ref:y,className:d.stickyTitlesWrapper},o&&A()),p&&f.current&&ip().createElement(Up.ZP,{handleHeight:!0,onResize:p,targetRef:f}),ip().createElement(Lp.VariableSizeList,{ref:m,itemCount:e.length,itemSize:x,width:a,height:i,itemKey:l,innerRef:f,onScroll:({scrollOffset:r,scrollDirection:n})=>{if(!o||!E)return;const a=S(r),i=a&&v(a.index);var l;null!==i&&(l=i,y.current&&[...y.current.querySelectorAll(".stickyTitleItem")].forEach((e=>{e.dataset.index===l.toString()?(e.style.visibility="visible",h.index=l):e.style.visibility="hidden"}))),O();const s=null!==i&&t(i,T(i).item),c=S(r+s+h.topMargin);let u=0;if(c){switch(n){case"forward":c.offset-r>0&&kp(c.listItem)&&(u=s-(c.offset-r));break;case"backward":{const t=i>-1&&(p=i,e.findIndex(((e,t)=>kp(e)&&p<t))),n=(e=>(b(e),g.current[e]))(t);t>-1&&r<n&&s>=n-r&&(u=s-(n-r))}}(e=>{y.current&&(h.topMargin=-e,y.current.style.top=-e+"px")})(u)}var p},style:s?{overflowX:"hidden"}:void 0,overscanCount:5,onItemsRendered:w},C))};Fp.propTypes={items:lp().arrayOf(lp().object).isRequired,getItemSize:lp().func.isRequired,renderItem:lp().func.isRequired,width:lp().oneOfType([lp().number,lp().string]),height:lp().number.isRequired,renderGroupTitle:lp().func,fixedTitle:lp().bool,hideSubtitles:lp().bool,itemKey:lp().func,disableHorizontalScrollbar:lp().bool,focusIndex:lp().number,onInnerContainerResize:lp().func};const Mp=({items:e,open:t,onSelectFocusedItem:r,selectedItems:n,onClose:a})=>{const[i,o]=(0,ap.useState)(null),l=(0,ap.useRef)(!1),s=(0,ap.useCallback)((t=>{let r=null===t?s(-1):t;for(;null!==t&&r<e.length&&(r<=t||r>=0&&kp(e[r]));)r+=1;return r!==e.length?r:s(-1)}),[e]),c=(0,ap.useCallback)((t=>{let r=null===t?e.length-1:t;for(;null!==t&&r>=0&&(r>=t||kp(e[r]));)r-=1;return r<0?e.length-1:r}),[e]),u=(0,ap.useCallback)((()=>{if(!(0,O.isNil)(i)){const t=e[i].item;!t.item.notSelectable&&r({item:t.item,groupData:t})}}),[r,e,i]),p=(0,ap.useCallback)((t=>{if(0!==e.length)switch(t.key){case"Down":case"ArrowDown":return o(s),t.preventDefault(),!1;case"Up":case"ArrowUp":return o(c),t.preventDefault(),!1;case"Enter":l.current=!0,u();break;case"Tab":a&&a(t);break;default:return}}),[e,s,c,u,a]);return(0,ap.useEffect)((()=>{if(l.current){l.current=!1;const t=e.findIndex((e=>e.item.moveTo));t>-1&&o(t)}else o(null)}),[e,t,n]),{focusIndex:i,handleKeyDown:p}};var Vp=r(85746),Bp=r.n(Vp),zp=r(22811),Hp=r.n(zp),Yp=r(93222),Wp=r.n(Yp);function Gp(){return Gp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Gp.apply(null,arguments)}function qp(){return qp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},qp.apply(null,arguments)}const Zp=e=>ip().createElement("svg",qp({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgNestedAttribute"},e),ip().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 $p(){return $p=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},$p.apply(null,arguments)}const Kp=e=>ip().createElement("svg",$p({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgReferenceAttribute"},e),ip().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 Xp(){return Xp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Xp.apply(null,arguments)}const Qp=e=>ip().createElement("svg",Xp({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgSimpleAttribute"},e),ip().createElement("rect",{fill:"#000",x:9,y:9,width:6,height:6,rx:1,stroke:"none",strokeWidth:1,fillRule:"evenodd"})),Jp=(0,Sp.Z)({icon:{opacity:.29,width:"16px",height:"16px",flexShrink:0,marginRight:"6px",marginLeft:"8px"}}),ed=({attrType:e={}})=>{const t=Jp(),r=(e=>{switch(e.type){case v.DataTypes.TYPE_IMAGE:case v.DataTypes.TYPE_NESTED:return Zp;case v.DataTypes.TYPE_REFERENCE:return Kp;default:return Qp}})(e);return ip().createElement(r,{className:t.icon})},td=(0,Sp.Z)({mark:{color:"red"}}),rd=()=>{const e=td();return ip().createElement("span",{className:e.mark},"*")},nd=({margin:e,level:t,className:r,children:n})=>null!=t?ip().createElement("div",{style:{marginLeft:t*e},className:r},n):n;var ad=r(1063),id=r(85740);const od=(0,Sp.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"}}),ld=(0,id.T)((e=>ip().createElement("svg",Gp({width:13,height:18,viewBox:"0 0 13 18",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgRecommended"},e),ip().createElement("g",{transform:"translate(-3 -1)",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},ip().createElement("path",{fill:"#FF4081",d:"M5.833 10h3.75v6.667l-3.75 1.666z"}),ip().createElement("path",{fill:"#CE0C4E",d:"M13.333 10v8.333l-3.75-1.666V10z"}),ip().createElement("circle",{fill:"#FFC058",cx:9.583,cy:7.917,r:6.25}),ip().createElement("circle",{fill:"#FFCD7B",cx:9.583,cy:7.917,r:5.417}),ip().createElement("path",{fill:"#FFFBB5",d:"M8.333 11.667L5 8.462l.933-.898 2.4 2.308L13.4 5l.933.897z"}))))),sd=({groupId:e,data:t,checked:r=!1,isFocused:n=!1,isRequired:a=!1,label:i,labelInText:o,level:l,onClick:s=O.identity,hideCheckBox:c=!1,hideIcon:u=!1,notSelectable:p=!1,disableHorizontalScrollbar:d=!1,style:m={},subItemMargin:f=20,LogoIcon:y,className:g,disableNonSelectable:h,disableGutters:E})=>{const b=od(),{attrType:T}=t||{},S=!(c&&(0,v.isNested)(T)||p),x=!!y;return ip().createElement(ad.Y,{value:o||i,className:b.itemTooltip,placement:"bottom-end"},ip().createElement(Wp(),{className:up()(b.container,b.listItem,{[b.defaultCursor]:!S},g),onClick:S?()=>s(t,!r,e):void 0,style:m,dense:!0,disabled:h&&p,classes:{focusVisible:b.listItemFocus,selected:b.listItemFocus},selected:n,tabIndex:-1,disableGutters:E},!c&&ip().createElement(Hp(),{checked:r,disableRipple:!0,disabled:!S,className:up()(b.checkbox,{[b.checked]:r}),tabIndex:-1}),ip().createElement(nd,{margin:f,level:l,className:b.marginWrapper},ip().createElement(ip().Fragment,null,!u&&(t=>"recommended"===e?ip().createElement(ld,{className:b.recommendedIcon,tooltipTitle:ei().text("Recommended"),showForDisabled:!0}):ip().createElement(ed,{attrType:t}))(T),ip().createElement("div",{className:up()(b.itemTextWrapper,{[b.marginText]:u})},x&&ip().createElement(y,{className:b.logoIcon}),ip().createElement(Bp(),{primary:ip().createElement(ip().Fragment,null,i,a&&ip().createElement(rd,null)),className:b.itemText})))),S&&d&&ip().createElement("div",{className:b.itemAfter})))};sd.defaultName="AttributeListItem";const cd=(0,ap.memo)(sd);var ud=r(49940);const pd=(0,Sp.Z)({popupContainer:{},container:{"&$popupContainer":{height:"408px",minWidth:"200px"}}});function dd(){return dd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},dd.apply(null,arguments)}function md(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){fd(e,t,r[t])}))}return e}function fd(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const yd=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.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,ap.useCallback)((e=>e.label.toLowerCase().includes(l.toLowerCase())),[l]),f=(0,ap.useCallback)((e=>m(e)||(e.children||[]).some(f)),[m]),y=(0,ap.useMemo)((()=>{const e=(0,O.curry)(((e,r,n,a)=>[{item:md({},r,{filterText:l}),level:e,groupId:n,groupName:a},...t(r.children||[],n,a,e+1)])),t=(t,r,n,a=0)=>{const i=t.filter(f);return(p?O.map:O.chain)((t=>e(a,t,r,n)),i)};return t}),[l,p,f]),g=(0,ap.useCallback)((e=>e.map((e=>({item:e,items:y(e.attributes,e.id,e.label)}))).filter((e=>e.items.length))),[y]),h=(0,ap.useCallback)((({item:e})=>{s(e,!c.find((t=>t.id===e.id||t.id.includes(`${e.id}.`))))}),[s,c]),E=(0,ap.useMemo)((()=>(p?g:y)(n)),[n,p,g,y]),b=(0,ap.useMemo)((()=>Dp(E)),[E]),{focusIndex:T,handleKeyDown:S}=Mp({items:b,open:t,onSelectFocusedItem:h,selectedItems:c}),x=(0,ap.useRef)(null);x.current=T;const C=(0,ap.useCallback)(((e,{item:t,level:r=0},n)=>{const a=!!c.find((e=>e.id===t.id||e.id.includes(`${t.id}.`))),i=x.current===n;return ip().createElement(cd,{key:t.id,onClick:s,checked:a,level:r,data:t,label:ip().createElement(ud.o,{text:t.label,highlight:t.filterText}),labelInText:t.label,style:e,hideCheckBox:u,isFocused:i,notSelectable:t.notSelectable,LogoIcon:t.LogoIcon})}),[u,s,c]),w=(0,v.getMaxItemWidth)("label")(E)||308,A=pd();return ip().createElement(Pp,dd({open:t,className:up()(A.container,A.popupContainer),anchorEl:r,onClose:i,onSearch:a,title:o,containerWidth:w,searchInputOnKeyDown:S},d),ip().createElement(Fp,{height:300,renderItem:C,items:b,hideSubtitles:!0,getItemSize:()=>32,containerWidth:w,focusIndex:T,renderGroupTitle:p}))};yd.propTypes={open:lp().bool,hideCheckBox:lp().bool,anchorEl:lp().any,selected:lp().array,data:lp().array,filterText:lp().string,titleText:lp().string,onClose:lp().func,onListItemClick:lp().func,onSearch:lp().func,renderGroupTitle:lp().func},yd.defaultProps={data:[],selected:[],titleText:ei().text("Show/hide columns"),filterText:""};var gd=r(97179);function hd(){return hd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hd.apply(null,arguments)}const Ed=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return ip().createElement("svg",hd({width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},r),ip().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",opacity:".54"},ip().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"})))},bd="Headers-styles-container--Zbdka",vd="Headers-styles-actionsBar--RXMy4",Td="Headers-styles-previewSwitcher--Ppqem";function Od(){return Od=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Od.apply(null,arguments)}const Sd=e=>{let{entityTypeUri:t,headColumns:r=[],onSelectColumns:n=O.identity}=e,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["entityTypeUri","headColumns","onSelectColumns"]);const[i,o]=(0,ap.useState)(null),[l,s]=(0,ap.useState)(""),c=(0,sp.useSelector)(A().selectors.getMetadata),u=()=>{o(null),s("")},p=(0,ap.useCallback)(((e,a)=>{const i=(0,vi.kF)(c,t),o=(0,vi.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 ip().createElement(ip().Fragment,null,ip().createElement(gd.k,Od({tooltipTitle:ei().text("Show/hide columns"),size:"M",icon:Ed,onClick:e=>o(e.currentTarget),className:"Headers-styles-headerIcon--c2qe7"},a)),(()=>{const e=(0,vi.kF)(c,t);return ip().createElement(yd,{open:!!i,anchorEl:i,data:e,onListItemClick:p,selected:r,filterText:l,onClose:u,onSearch:s})})())};Sd.propTypes={entityTypeUri:lp().string,headColumns:lp().array,onSelectColumns:lp().func};const xd=Sd;var Cd=r(45053),wd=r(72897),Ad=r(27618),Rd=r.n(Ad),_d=r(98515),Id=r.n(_d),Nd=r(29289);const Pd=({headCellData:e,headIndex:t,sortOrder:r,sortField:n,sortHandler:a,canCheck:i,onCheck:o,headerCheckboxState:l,openConfigColumnPopup:s})=>ip().createElement("div",{className:up()("HeadCellRenderer-styles-headCellContentWrapper--L6RrQ",(0,O.path)(["wrapperClassName"],e))},e&&i&&ip().createElement(Hp(),{className:"HeadCellRenderer-styles-checkbox--qQEHg",checked:l||!1,indeterminate:null===l,onChange:()=>o()}),ip().createElement("div",{className:"HeadCellRenderer-styles-labelWrapper--cmclk"},e&&(e.sortable?ip().createElement(Rd(),{active:Boolean(r&&n===e.id),direction:r,onClick:a,classes:{root:"HeadCellRenderer-styles-sortLabel--NZx3o"},component:"div"},e.label):e.label)),s&&ip().createElement("div",{className:"HeadCellRenderer-styles-menuButtonWrapper--aBNeR"},ip().createElement(Op.T,{icon:Id(),onClick:s,size:"S","data-column-index":t})));Pd.propTypes={headCellData:lp().shape({id:lp().string,label:lp().oneOfType([lp().string,lp().node]),sortable:lp().bool}),headIndex:lp().number,sortOrder:lp().string,sortField:lp().string,sortHandler:lp().func,canCheck:lp().bool,onCheck:lp().func,headerCheckboxState:lp().oneOf([!0,!1,null]),openConfigColumnPopup:lp().func};const Dd=(0,Nd.q)((0,O.pick)(["openConfigColumnPopup"]))(Pd),kd=(0,Nd.q)((0,O.pick)(["openConfigColumnPopup","canCheck","onCheck","headerCheckboxState"]))(Pd);var Ld=r(16778);const Ud={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"},jd=({value:e={}})=>{const t=(0,v.getLabel)(e.label);return ip().createElement("div",{className:up()(Ud.defaultWrapper,Ud.profileWrapper)},ip().createElement(b.A,{avatarClassName:Ud.entityAvatar,imageClassName:Ud.entityAvatarImage,entity:e}),ip().createElement(Ld.x,{value:(0,v.getEntityUriForLink)(e),className:Ud.entityLabel},t))};jd.propTypes={value:lp().object};const Fd=jd;var Md=r(56755);const Vd=({value:e,columnData:{dataTypeDefinition:t}})=>ip().createElement("div",{className:Ud.defaultWrapper},t?ip().createElement(Md.x,{value:e,dataTypeDefinition:t}):e);Vd.propTypes={value:lp().any,columnData:lp().object};const Bd=Vd,zd=(e,t,r)=>{const n=(0,v.getEntityTypeGraphIcon)(e,{type:t});return(0,v.getAbsoluteImageUrl)(r,n)};var Hd=r(55743),Yd=r.n(Hd);let Wd=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 Gd(){return Gd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Gd.apply(null,arguments)}const qd=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","icon","avatarText","rootClasses"]);const[o,l]=(0,ap.useState)(null);(0,ap.useEffect)((()=>{l(r?Wd.ICON_MODE:Wd.TEXT_MODE)}),[r,n]);const s=()=>{l(Wd.ERROR_MODE)};switch(o){case Wd.ICON_MODE:return ip().createElement(Yd(),Gd({className:up()(t,null==a?void 0:a.iconRoot),src:r,onError:s},i));case Wd.TEXT_MODE:case Wd.ERROR_MODE:return ip().createElement(Yd(),Gd({className:up()(t,null==a?void 0:a.textRoot)},i),n);default:return null}},Zd=({value:e})=>{const t=(0,sp.useSelector)(A().selectors.getMetadata),r=(0,sp.useSelector)(A().selectors.getApiPath),n=(0,sp.useSelector)(A().selectors.getImagePath);return e&&ip().createElement("div",{className:up()(Ud.defaultWrapper,Ud.referenceWrapper)},ip().createElement(qd,{className:Ud.referenceIcon,icon:zd(t,e.refEntity.type,n||r)}),ip().createElement(Ld.x,{value:e.refEntity.objectURI,className:Ud.referenceContent},(0,v.getLabel)(e.label)))};Zd.propTypes={value:lp().object};const $d=Zd,Kd=e=>{e.stopPropagation()},Xd=e=>{const{value:t}=e;return ip().createElement("div",{className:Ud.blobWrapper,onScroll:Kd},t)};Xd.propTypes={value:lp().any};const Qd=Xd,Jd=({value:e})=>{const t=(0,v.getImageAttributeOvThumbnailUrl)({value:e});return t&&ip().createElement("div",{className:Ud.imageWrapper},ip().createElement("img",{src:t}))};Jd.propTypes={value:lp().object};const em=Jd,tm=e=>{if("label"===e.id)return Fd;switch((0,O.path)(["attrType","type"],e)){case"Reference":return $d;case"Blob":return Qd;case"Image":return em}return Bd};function rm(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){nm(e,t,r[t])}))}return e}function nm(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const am=(0,O.split)("."),im=["entityId"],om=e=>!im.includes(e.id),lm=e=>{if((0,v.isAttributeSearchUri)(e)){const[,...t]=am(e);return t.length>1?t.slice(0,-1):null}return null};var sm=r(39034),cm=r(57526),um=r.n(cm),pm=r(18567),dm=r.n(pm),mm=r(99272),fm=r.n(mm);const ym=(0,Sp.Z)({root:{display:"flex",alignItems:"center",justifyContent:"center",width:"24px",height:"24px"},check:{color:"#8CC152"}}),gm=({classes:e={},tooltip:t="",onClick:r=O.identity,mode:n=sm.Eh.Init})=>{const a=ym();return ip().createElement("div",{className:up()(a.root,e.root)},(()=>{switch(n){case sm.Eh.Init:return ip().createElement(gd.k,{className:e.button,size:"M",tooltipTitle:t,icon:dm(),onClick:r});case sm.Eh.Progress:return ip().createElement(um(),{className:e.spinner,size:24});case sm.Eh.Success:return ip().createElement(fm(),{className:up()(a.check,e.check)});default:return null}})())};function hm(){return hm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hm.apply(null,arguments)}const Em=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["entity","importStatus","onImportStatusChange","hideDelay"]);const o=(0,sp.useSelector)(A().selectors.getDtssPath),l=(0,sp.useSelector)(A().selectors.getTenant);return ip().createElement(gm,hm({},i,{mode:r,tooltip:ei().text("Import this record"),onClick:e=>{e.stopPropagation(),n(sm.Eh.Progress),(0,v.importEntityFromDataTenant)({dtssPath:o,customerTenant:l,entity:t}).then((({success:e,uris:r})=>{if(!e)throw new Error("Failed to import entity");t.ctSubscribedUris=r,n(sm.Eh.Success),setTimeout((()=>n(sm.Eh.Done)),a)})).catch((()=>{n(sm.Eh.Init),(0,Qa.U)(undefined,{title:ei().text("Import Error"),message:ei().text("Record can't be imported")})}))}}))},bm=(0,Sp.Z)({importButtonPlaceholder:{display:"flex",alignItems:"center",padding:"0 10px",width:"24px",flexShrink:0,position:"relative"}}),vm=({entity:e,entityImportStatus:t,onEntityImportStatusChange:r})=>{const n=bm(),a=(0,sp.useSelector)(A().selectors.getMetadata),i=(0,sp.useSelector)(A().selectors.getCanUserImportEntitiesFromDT),o=(0,v.isDataTenantEntity)(e)&&i,l=(0,v.getEntityType)(a,e.type),s=(0,v.checkCanImportEntityOfType)(l)&&!(0,v.isEntityImportedToCT)(e),c=t&&t!==sm.Eh.Done||s;return ip().createElement(ip().Fragment,null,o&&ip().createElement("div",{className:n.importButtonPlaceholder},c&&ip().createElement(Em,{entity:e,importStatus:t,onImportStatusChange:t=>r(e.uri,t)})))},Tm=({entity:e,isSelectedEntity:t,isHighlightedEntity:r,entityImportStatus:n,onEntityImportStatusChange:a})=>ip().createElement("div",{className:up()(Ud.entityButtons,{[Ud.selectedEntityButtons]:t,[Ud.justImportedEntityButtons]:n===sm.Eh.Success,[Ud.highlightedEntityButtons]:r})},ip().createElement(vm,{entity:e,entityImportStatus:n,onEntityImportStatusChange:a}));Tm.propTypes={entity:lp().object,isSelectedEntity:lp().bool,isHighlightedEntity:lp().bool,entityImportStatus:lp().oneOf(Object.values(sm.Eh)),onEntityImportStatusChange:lp().func};const Om=(0,Nd.q)((({entitiesImportStatus:e,onEntityImportStatusChange:t,selectedEntityUri:r,highlightedEntityIndex:n},{entity:a,rowIndex:i})=>({entityImportStatus:a&&e[a.uri],onEntityImportStatusChange:t,isSelectedEntity:r===a.uri,isHighlightedEntity:n===i})))(Tm);var Sm=r(72326),xm=r(67655);function Cm(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){wm(e,t,r[t])}))}return e}function wm(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Am={height:"100%",display:"flex",flexDirection:"column"},Rm=(0,Sp.Z)((e=>({inactiveCell:Cm({background:e.inactiveBackground},Am,{"&$selectedRowCell":{background:e.inactiveSelectedBackground}}),selectedRowCell:Cm({background:(0,xm.lighten)(e.palette.primary.main,.88)},Am),clickable:Cm({cursor:"pointer"},Am),justImported:Cm({backgroundColor:"#FFFBEB !important"},Am)}))),_m={entity:lp().object,isSelected:lp().bool,onEntityClick:lp().func,isJustImported:lp().bool},Im=(0,Sp.Z)({checkboxWrapper:{display:"flex",alignItems:"center"},checkbox:{marginRight:"-8px",marginLeft:"11px"}}),Nm={onCheck:lp().func,isChecked:lp().bool,hasCheckbox:lp().bool},Pm=(0,Sp.Z)({collapser:{marginLeft:"-2px"}});var Dm=r(18021),km=r(8835),Lm=r.n(km);const Um=(0,Sp.Z)({collapseButton:{cursor:"pointer"},expandLess:{transform:"rotate( -180deg )"}});function jm(){return jm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},jm.apply(null,arguments)}const Fm=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["isOpen","tooltipTitle"]);const a=Um(),i={icon:Lm(),className:a.collapseButton,iconClassName:up()({[a.expandLess]:t})},o={tooltipTitle:r};return ip().createElement(gd.k,jm({"data-reltio-id":"collapse-button"},i,o,n))},Mm=(0,Sp.Z)((()=>({hidden:{visibility:"hidden"}}))),Vm=({rowIndex:e,rowValue:t,className:r})=>{const n=Mm(),{toggleRowCollapse:a,getIsRowCollapsible:i,getIsRowCollapsed:o}=(0,ap.useContext)(Dm.x),l=i(t),s=o(e);return ip().createElement(Fm,{className:up()(r,{[n.hidden]:!l}),isOpen:!s,onClick:t=>{a(e),t.stopPropagation()}})},Bm={hasCollapseButton:lp().bool},zm=(0,O.pipe)((e=>{const t=t=>{const r=Pm(),{hasCollapseButton:n}=t,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(t,["hasCollapseButton"]),{rowValue:i,rowIndex:o}=a;return n?ip().createElement("div",{className:"cellWithCollapser"},ip().createElement(Vm,{className:r.collapser,rowIndex:o,rowValue:i}),ip().createElement(e,a)):ip().createElement(e,a)};return t.propTypes=Bm,t}),(e=>{const t=t=>{const r=Im(),{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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(t,["onCheck","isChecked","hasCheckbox"]),{rowValue:{rawValue:l}}=o;return i?ip().createElement("div",{className:up()(r.checkboxWrapper,"cellWithCheckbox")},ip().createElement(Hp(),{className:r.checkbox,checked:a,onClick:e=>e.stopPropagation(),onChange:e=>n(l.uri,e.target.checked)}),ip().createElement(e,o)):ip().createElement(e,o)};return t.propTypes=Nm,t}),(e=>{const t=t=>{const r=Rm(),{rowValue:{rawValue:n},isSelected:a,onEntityClick:i,isJustImported:o}=t,l=i?()=>i(n.uri):void 0,s=n&&!(0,v.isActiveObject)(n);return l||s||a||o?ip().createElement("div",{className:up()({[r.inactiveCell]:s},{inactiveCell:s},{[r.selectedRowCell]:a},{selectedRowCell:a},{[r.clickable]:!!l},{[r.justImported]:o},{justImported:o}),onClick:l},ip().createElement(e,t)):ip().createElement(e,t)};return t.propTypes=_m,t}),(0,Nd.q)((({onEntityClick:e,selectedEntityUri:t,entitiesImportStatus:r,canCheck:n,onCheck:a,checkedEntitiesUris:i},{rowValue:o,columnIndex:l})=>{const{rawValue:s}=o,c=0===l;return{onCheck:a,isChecked:i&&i.includes(s.uri),hasCheckbox:n&&c,hasCollapseButton:c,isSelected:t===s.uri,isJustImported:r[s.uri]===sm.Eh.Success,onEntityClick:e}})))(Sm.DN),Hm=({columnData:e,cell:t})=>{const r=t.values.length,n=28*Math.max(r,1)+20;if(!r)return n;switch((0,O.path)(["dataTypeDefinition","type"],e)){case"Reference":return 28*r+17;case"Blob":return 100*r;case"Image":return 76*r+17;default:return n}},Ym=(0,ap.forwardRef)((({headColumns:e,entities:t,entityToHighlight:r,selectedEntityUri:n,onReorderingColumn:a,dndColumnReorderingEnabled:i,columnsSize:o,onChangeColumnsSize:l,onScroll:s,onSort:c,sortField:u,sortOrder:p,onEntityHover:d,onEntityClick:m,entitiesImportStatus:f,onEntityImportStatusChange:y,logger:g,canCheck:h,checkedEntitiesUris:E,headerCheckboxState:b,onCheck:T,openConfigColumnPopup:S,resizeDebounceDelay:x},C)=>{const w=(0,ap.useMemo)((()=>({highlightRow:"highlightedSelector",dragColumnHead:Ud.dragColumnHead,dragColumnBody:Ud.dragColumnBody,draggableHeadCell:Ud.draggableHeadCell,cellWrapper:Ud.cellWrapper})),[]),R=(0,sp.useSelector)(A().selectors.getMetadata),[_,I]=(0,ap.useState)(null),N=(0,ap.useCallback)((e=>{I(e),d&&d((0,O.path)([e,"uri"],t))}),[d,t]),P=(0,ap.useRef)();(0,ap.useImperativeHandle)(C,(()=>({resetScrollbarPosition:()=>{P.current&&P.current.resetScrollbarPosition({resetLeft:!1})}})));const D=(0,ap.useCallback)((e=>{p&&e===u?p===Cd.oy?c({field:e,order:Cd.U9}):c({field:e}):c({field:e,order:Cd.oy})}),[c,u,p]),k=(0,ap.useCallback)((e=>{const r=(0,O.prop)(e,t);return r?ip().createElement(Om,{entity:r,rowIndex:e}):null}),[t]),L=(0,ap.useCallback)((e=>ip().createElement(zm,e)),[]),U=!!d,j=!!c,F=(0,ap.useMemo)((()=>((e,t=!0)=>e.map(((e,r)=>{let{attrType:n}=e,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attrType"]);const i=0===r;return rm({},a,{dataTypeDefinition:n&&(0,v.getAttrDataTypeDefinition)(n),resizable:!0,autoResize:a.autoResize??!i,draggable:!i,sortable:t&&om(a),nestedPath:lm(a.id),headCellRenderer:i?kd:Dd,rowCellValueRenderer:tm(rm({},a,{attrType:n}))})})))(e,j)),[e,j]),M=(0,ap.useMemo)((()=>((e,t,r)=>(r||[]).map((e=>(0,O.pipe)((0,O.reduce)(((t,r)=>(0,O.assoc)(r.id,((e,t,r)=>{switch(t.id){case"label":return r;case"entityId":return(0,v.getEntityId)(r);default:{const[e,...n]=am(t.id);return(0,O.pipe)((0,O.prop)(e),(0,v.getOvAttributeValuesByPath)(n))(r)}}})(0,r,e),t)),{}),(0,O.assoc)("rawValue",e))(t))))(0,e,t)),[R,e,t]),V=r?t.findIndex((0,O.propEq)("uri",r)):-1,B=(0,ap.useMemo)((()=>({onEntityClick:m,selectedEntityUri:n,highlightedEntityIndex:V,entitiesImportStatus:f,onEntityImportStatusChange:y,canCheck:h,checkedEntitiesUris:E,headerCheckboxState:b,onCheck:T,openConfigColumnPopup:S})),[E,f,b,V,h,T,m,y,n,S]);return ip().createElement(wd.M,{fixFirstColumn:!0,onScroll:s,rowsData:M,columnsData:F,onSort:D,highlightRow:-1!==V?V:null,ref:P,sortFieldClassName:Ud.sortableCell,containerClassName:Ud.table,classes:w,defaultColumnWidth:250,headRowHeight:50,defaultColumnMinWidth:100,defaultRowHeight:48,sorting:{field:u,order:p},dndColumnReorderingHandler:a,dndColumnReorderingEnabled:i,onChangeColumnsSize:l,columnsSize:o,resizeDebounceDelay:x??150,onRowHover:U?N:void 0,hoverStateEnabled:U,hoverRowIndex:_,renderRowOverlay:k,logger:g,context:B,maxRowValuesCount:2,renderRowCell:L,getRowCellHeight:Hm})}));Ym.propTypes={entities:lp().array,entityToHighlight:lp().string,selectedEntityUri:lp().string,headColumns:lp().array,columnsSize:lp().array,onScroll:lp().func,onSort:lp().func,onReorderingColumn:lp().func,onChangeColumnsSize:lp().func,dndColumnReorderingEnabled:lp().bool,onEntityClick:lp().func,onEntityHover:lp().func,sortField:lp().string,sortOrder:lp().oneOf([Cd.oy,Cd.U9]),entitiesImportStatus:lp().object,onEntityImportStatusChange:lp().func,logger:lp().func,canCheck:lp().bool,checkedEntitiesUris:lp().arrayOf(lp().string),headerCheckboxState:lp().oneOf([!0,!1,null]),onCheck:lp().func,openConfigColumnPopup:lp().func,resizeDebounceDelay:lp().number},Ym.defaultProps={entities:[],headColumns:[]},Ym.displayName="EntitiesTable";const Wm=(0,ap.memo)(Ym);var Gm=r(4437),qm=r.n(Gm),Zm=r(5106),$m=r.n(Zm);const Km="left",Xm="right",Qm="hide",Jm={[Km]:ei().text("Insert 1 left"),[Xm]:ei().text("Insert 1 right"),[Qm]:ei().text("Hide column")},ef=({open:e,anchorEl:t,onClick:r,onClose:n,actions:a})=>ip().createElement(dp(),{open:e,anchorEl:t,onClose:n},ip().createElement(qm(),{component:"div"},a.map(((e,t)=>((e,t,r)=>ip().createElement($m(),{button:!0,component:"div",key:r,onClick:t},ip().createElement(Bp(),{primary:Jm[e],primaryTypographyProps:{variant:"body2"}})))(e,(e=>()=>{r(e)})(e),t)))));ef.propTypes={open:lp().bool,anchorEl:lp().any,onClick:lp().func,onClose:lp().func,actions:lp().array};const tf=ef;class rf extends ip().PureComponent{constructor(...e){super(...e),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=({newColumnPlaceIndex:e})=>{this.setState({newColumnPlaceIndex:e,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 Km:this.openAddColumnPopup({newColumnPlaceIndex:t});break;case Xm:this.openAddColumnPopup({newColumnPlaceIndex:t+1});break;case Qm: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,v.memoizeWith)(rf.getMemoIdForColumnSize,rf.getColumnSizeFromHeadColumns)}static getColumnSizeFromHeadColumns(e){return e.map((e=>({id:e.id,size:e.size})))}static getMemoIdForColumnSize(e,t){return`${t}${(0,O.toString)(e.map((e=>(0,O.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:f,onChangeColumnsSize:y,entityTypeUri:g,entitiesImportStatus:h={},onEntityImportStatusChange:E,logger:b,canCheck:v,checkedEntitiesUris:T,headerCheckboxState:O,onCheck:S,resizeDebounceDelay:x}=this.props,{addColumnPopupOpen:C,configColumnPopupOpen:w,popupAnchor:A,filterText:R,configurableColumnIndex:_}=this.state,I=this.memoizedGetColumnSize(a,g);return ip().createElement(ip().Fragment,null,ip().createElement(Wm,{entities:e,entityToHighlight:t,selectedEntityUri:r,onScroll:n,onSort:f,onEntityClick:s,onEntityHover:c,headColumns:a,sortField:i,sortOrder:o,onReorderingColumn:m,ref:u,onChangeColumnsList:d,dndColumnReorderingEnabled:l,onChangeColumnsSize:y,columnsSize:I,entitiesImportStatus:h,onEntityImportStatusChange:E,logger:b,canCheck:v,checkedEntitiesUris:T,headerCheckboxState:O,onCheck:S,openConfigColumnPopup:this.openConfigColumnPopup,resizeDebounceDelay:x}),ip().createElement(yd,{open:C,anchorEl:A,data:p,onListItemClick:this.addColumnHandler,filterText:R,onClose:this.closeAddColumnPopup,onSearch:this.setFilterText,hideCheckBox:!0,titleText:Ja.text("Add column")}),ip().createElement(tf,{onClick:this.configColumnHandler,onClose:this.closeConfigColumnPopup,anchorEl:A,open:w,actions:_>0?[Km,Xm,Qm]:[Xm]}))}}rf.propTypes={entities:lp().array,entityToHighlight:lp().string,selectedEntityUri:lp().string,entityTypeUri:lp().string,headColumns:lp().array,dndColumnReorderingEnabled:lp().bool,onScroll:lp().func,onSort:lp().func,onReorderingColumn:lp().func,onChangeColumnsSize:lp().func,onChangeColumnsList:lp().func,onEntityClick:lp().func,onEntityHover:lp().func,sortField:lp().string,sortOrder:lp().oneOf([Cd.oy,Cd.U9]),entitiesTableRef:lp().shape({current:lp().shape({resetScrollbarPosition:lp().func})}),additionalColumns:lp().arrayOf(lp().shape({id:lp().string,label:lp().string})),entitiesImportStatus:lp().object,onEntityImportStatusChange:lp().func,logger:lp().func,canCheck:lp().bool,checkedEntitiesUris:lp().arrayOf(lp().string),headerCheckboxState:lp().oneOf([!0,!1,null]),onCheck:lp().func};const nf=rf;var af=r(66780),of=r(9366),lf=r(41633),sf=r(79881),cf=r.n(sf),uf=r(93962),pf=r.n(uf),df=r(45995),mf=r.n(df);function ff(){return ff=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ff.apply(null,arguments)}const yf=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["open","children"]);const[a,i]=(0,ap.useState)(t),o=(0,xm.useTheme)().transitions.duration.leavingScreen;return(0,ap.useEffect)((()=>{if(t!==a){if(!t){const e=setTimeout((()=>{i(!1)}),o);return()=>clearTimeout(e)}i(!0)}}),[t,o,a]),ip().createElement(mf(),ff({open:t},n),a&&r)};yf.displayName="Drawer";var gf=r(18759),hf=r.n(gf),Ef=r(30122),bf=r.n(Ef),vf=r(43410),Tf=r.n(vf),Of=r(93416),Sf=r.n(Of),xf=r(66825),Cf=r.n(xf),wf=r(17698);const Af=(0,O.allPass)([(0,O.propSatisfies)(O.isEmpty,"configs"),(0,O.pathEq)(["group","hasCollapseButton"],!0)]),Rf=(0,O.reject)(Af),_f=(0,Sp.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"}}),If=({title:e="",iconSrc:t="",isOpen:r=!0,hasCollapseButton:n=!0,leftIcon:a,onCollapse:i})=>{const o=_f();return ip().createElement("div",{className:o.titleBox},ip().createElement("div",{className:o.title},a&&ip().createElement("div",{className:o.leftIcon},a),t&&ip().createElement(Yd(),{src:t,className:o.avatar}),ip().createElement(ad.Y,{value:e},ip().createElement("span",{className:o.text},e))),n&&ip().createElement(Fm,{isOpen:r,onClick:i,className:o.collapseIcon,size:"S"}))};var Nf=r(1230),Pf=r.n(Nf),Df=r(36631);const kf=({facet:e,selectedFacets:t})=>!!t.find((t=>t.fieldName===e.fieldName||t.fieldName.includes(`${e.fieldName}.`))),Lf=({facet:e,selectedFacets:t})=>kf({facet:e,selectedFacets:t})||(0,x.OP)(e)&&e.children&&e.children.some((e=>kf({facet:e,selectedFacets:t})));var Uf=r(13639);const jf=(0,Sp.Z)({icon:{maxHeight:"25px",maxWidth:"25px",marginRight:"16px"}}),Ff=({group:e,metadata:t})=>{const r=jf(),n=(0,Uf.$H)(),a=(0,v.getEntityTypeGraphIcon)(t,{type:e.id}),i=(0,v.getAbsoluteImageUrl)(n,a);return ip().createElement(qd,{className:r.icon,icon:i,avatarText:e.title[0]})};function Mf(){return Mf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Mf.apply(null,arguments)}const Vf=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["onListItemClick","focusIndex","selectedFacets","metadata"]);const o=(0,ap.useRef)(null);o.current=n;const l=(0,ap.useRef)(null);l.current=r;const s=(0,ap.useCallback)(((e,{item:r,level:n,groupId:a},i)=>{const s=Lf({facet:r,selectedFacets:o.current}),c=l.current===i;return ip().createElement(cd,{key:`item-${a}-${r.fieldName}`,onClick:t,data:r,label:ip().createElement(ud.o,{text:r.title,highlight:r.filterText}),labelInText:r.title,level:n,style:e,checked:s,isFocused:c,groupId:a,LogoIcon:r.LogoIcon})}),[t]),c=(0,ap.useCallback)(((e,t)=>ip().createElement($m(),{component:"div",className:"MoreFacetsPopup-styles-subHeader--h1vGz",style:e,key:`group-${t.item.id}`},t.item.needGroupIcon&&ip().createElement(Ff,{metadata:a,group:t.item}),t.item.title)),[a]),u=(0,ap.useCallback)(((e,t)=>t.items?40:28),[]);return ip().createElement(Fp,Mf({getItemSize:u,renderGroupTitle:c,renderItem:s,focusIndex:r},i,{disableHorizontalScrollbar:!0}))};function Bf(){return Bf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Bf.apply(null,arguments)}const zf=574,Hf={},Yf=e=>{let{metadata:t,open:r,selectedFacets:n,data:a=[],onListItemClick:i,lastFacetClicked:o=Hf,width:l,height:s=zf}=e,c=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["metadata","open","selectedFacets","data","onListItemClick","lastFacetClicked","width","height"]);const[u,p]=(0,ap.useState)(464),d=s-110;(0,ap.useEffect)((()=>{p(d)}),[d]);const m=(0,ap.useCallback)(((e,t)=>p((0,O.clamp)(56,d,t))),[d]),f=(0,ap.useRef)();(0,ap.useEffect)((()=>{const e=(0,O.path)(["current","updatePosition"],f);e&&e()}),[u]);const y=(0,ap.useCallback)(((e,t,r=0)=>[{type:"item",item:e,moveTo:(0,O.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]),g=(0,ap.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,ap.useMemo)((()=>g(a)),[a,g]),E=(0,ap.useMemo)((()=>(0,ri.LG)(h)),[h]),b=(0,ap.useCallback)((({item:e,groupData:t})=>{i(e,!Lf({facet:e,selectedFacets:n}),t.groupId)}),[i,n]),{focusIndex:T,handleKeyDown:S}=Mp({items:E,open:r,onSelectFocusedItem:b,selectedItems:n}),x=Math.max(l||(0,v.getMaxItemWidth)("title")(h),240);return ip().createElement(Pp,Bf({open:r,action:f,title:ei().text("Select attribute"),containerWidth:x,searchInputOnKeyDown:S,containerHeight:110+u},c),ip().createElement(Vf,{focusIndex:T,selectedFacets:n,onListItemClick:i,metadata:t,items:E,height:u,onInnerContainerResize:m}),0===E.length&&ip().createElement("div",{className:"MoreFacetsPopup-styles-noResultsCaptionContainer--ChfND"},ip().createElement(hf(),{variant:"caption",display:"block",gutterBottom:!0},ei().text("No results found"))))};function Wf(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Gf=(0,O.curry)(((e,t)=>{const r=(0,v.getAttrTypeUrisHavingMasking)(e);return 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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Wf(e,t,r[t])}))}return e}({},e,{facets:e.facets.map((e=>(0,v.filterMaskedFromGroup)(r,e))).filter(O.identity)})))}));function qf(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Zf(e,t,r[t])}))}return e}function Zf(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class $f extends ap.PureComponent{constructor(e){super(e),this.state={filterText:"",lastFacetClicked:null,addedFacets:[]},this.searchInputRootRef=ip().createRef(),this.showSearchInput=()=>this.searchInputRootRef.current.scrollIntoView(!0),this.openPopup=()=>this.props.dispatch(li(!0)),this.closePopup=()=>{this.props.dispatch(li(!1)),this.props.dispatch(((e=[])=>({type:R.k.HIGHLIGHT_ADDED_FACETS,payload:e}))(this.state.addedFacets)),this.setState({addedFacets:[]}),setTimeout((()=>{this.props.dispatch({type:R.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=>qf({},e,{hide:!this.filterItemsTree(e),filterText:this.state.filterText}))).map((e=>{const t=this.getFilteredFacets(e.children);return(0,O.isEmpty)(t)?e:qf({},e,{children:t})})),this.filterItemsInGroups=e=>e.map((e=>qf({},e,{facets:this.getFilteredFacets(e.facets)}))),this.rejectNotAllowedEntityTypes=e=>t=>t.filter((({id:t})=>!(0,v.isEntityTypeUri)(t)||e.includes(t))),this.toggleSelectedFacet=(e,t)=>{const{facetsConfigs:r,selectedEntityTypes:n,dispatch:a}=this.props,i=(0,ri.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,O.uniq)(o.filter((e=>e.entityTypeUri)).map((e=>e.entityTypeUri)).concat(n)),s=o.filter((0,O.complement)(x.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,O.prop)("fieldName")),u),a($a({facetsToAdd:c,fieldNamesToDelete:u,changedEntityTypes:(0,O.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,Df.Z)(x.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,O.pipe)((0,O.when)((0,O.always)(e),this.filterItemsInGroups),(0,O.when)((0,O.always)(c),this.rejectNotAllowedEntityTypes(c)),(0,I.Eb)(s),Gf(i))(d),{verticalOrigin:f,popupHeight:y}=((e,t,r=16)=>{let 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,zf),g={vertical:f,horizontal:"right"};return ip().createElement(ap.Fragment,null,ip().createElement(_p,{classes:{root:a.inputContainer},onSearch:this.setFilterText,onFocus:this.handleInputFocus,rootRef:this.searchInputRootRef,value:e,placeholder:ei().text("Search & add attributes"),height:40,"data-reltio-id":"reltio-search-more-facets-search-input"}),ip().createElement(Yf,{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"===f?"bottom":"top",anchorOrigin:g,transformOrigin:g,disableRestoreFocus:!0}))}}$f.defaultProps={selectedEntityTypes:[],facetsConfigs:[]};const Kf=(0,sp.connect)((e=>({metadata:A().selectors.getMetadata(e),open:(0,Ti.ds)(e),facetsConfigs:(0,C.Mp)(e),recommendedFacets:(0,C.ER)(e),selectedEntityTypes:(0,C.DX)(e),dataTenantObject:(0,Xa.t9)(e),allowedEntityTypes:(0,Ti.Xf)(e),dataTenants:A().selectors.getDataTenants(e)})))(Pf()((()=>({inputContainer:{margin:"4px 16px 16px",flexShrink:"0"}})))($f)),Xf=(0,Sp.Z)({facetGroupContainer:{display:"flex",flexShrink:0,flexDirection:"column","& + hr":{marginTop:8},"& + &":{marginTop:"8px"}}});function Qf(){return Qf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Qf.apply(null,arguments)}const Jf=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["hasSearchAttributesField","children"]);const a=Xf(),[i,o]=(0,ap.useState)(!0);return ip().createElement("div",{className:a.facetGroupContainer},ip().createElement(If,Qf({isOpen:i,onCollapse:e=>{o(!i)}},n)),t&&ip().createElement(ip().Fragment,null,ip().createElement(Kf,null),ip().createElement(Cf(),null)),i&&r)};function ey(){return ey=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ey.apply(null,arguments)}var ty=r(52004),ry=r.n(ty),ny=r(40927),ay=r.n(ny);const iy=(0,Sp.Z)({link:{display:"flex",alignItems:"center",cursor:"pointer"},icon:{fontSize:"20px",marginRight:"4px",marginLeft:"-2px"}}),oy=({active:e,onClick:t,className:r})=>{const n=iy(),a=e?ay():Lm();return ip().createElement(ry(),{className:up()(n.link,r),onClick:t,underline:"none"},ip().createElement(a,{className:n.icon}),e?ei().text("View less"):ei().text("View more"))};var ly=r(50592),sy=r(23888),cy=r.n(sy);const uy=(0,Sp.Z)((e=>({bar:{backgroundColor:e.palette.secondary.main,opacity:.12,position:"absolute",minHeight:"20px",minWidth:"5px",borderRadius:"2px",top:0,left:0,height:"100%"}}))),py=e=>(0,O.is)(Number,e),dy=({className:e,width:t=0,maxWidth:r})=>{const n=uy(),a=(0,ap.useCallback)((e=>(r?100*e/r:0)+"%"),[r]);return t?ip().createElement("div",{className:up()(n.bar,e),style:{width:py(t)?a(t):t}}):null},my=(0,Sp.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 fy(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const yy={showColorBar:!0,hasOnlyButton:!1},gy=({config:e,data:t=[],values:r=[],onChange:n=O.identity})=>{const a=my();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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){fy(e,t,r[t])}))}return e}({},yy,e);const i=e=>()=>{const t=r.includes(e)?r.filter((t=>t!==e)):r.concat(e);n(t)},o=Math.max(...t.map((e=>e.number)));return ip().createElement("div",{className:a.listContainer},t.map((t=>ip().createElement("div",{key:t.value,className:up()(a.item,{[a.disabled]:!t.number&&!r.includes(t.value)}),"data-reltio-id":"search-facets-list-row"},(e=>ip().createElement(Hp(),{className:up()(a.checkbox,{[a.checked]:r.includes(e.value)}),checked:r.includes(e.value),onChange:i(e.value),value:e.value,color:"primary"}))(t),ip().createElement("div",{className:a.info,onClick:i(t.value)},(e=>ip().createElement(dy,{className:up()({[a.checkedBar]:r.includes(e.value)}),width:e.number,maxWidth:o}))(t),ip().createElement("div",{className:up()(a.textInfo)},ip().createElement("div",{className:a.text},t.label),ip().createElement("div",{className:a.count},void 0===t.number?ei().text("N/A"):(0,Ka.k7)(t.number,5e3))),e.hasOnlyButton&&(e=>{return ip().createElement(cy(),{className:a.buttonONLY,onClick:(t=e.value,e=>{e.stopPropagation(),n([t])})},ei().text("ONLY"));var t})(t))))))};var hy=r(1441);const Ey=(0,Sp.Z)((()=>({container:{overflow:"hidden",display:"flex",flexGrow:1,flexDirection:"column",fontSize:"13px"},noData:{marginLeft:"16px"},viewMoreLess:{paddingLeft:"20px"}}))),by=({config:e,data:t=[],values:r=[],onChange:n})=>{const a=Ey(),i=(0,sp.useDispatch)(),o=(0,ap.useCallback)((({show:e})=>{i((({show:e,silent:t})=>({type:R.k.SHOW_MORE_ENTITY_TYPES,payload:{show:e,silent:t}}))({show:e}))}),[i]),l=(0,sp.useSelector)((t=>(0,C.jC)(e,t))),s=(0,sp.useSelector)(Xa.t9),c=t.length>B.wP,u=(0,ap.useCallback)((()=>{o({show:!l})}),[o,l]),p=(0,ap.useMemo)((()=>{const e=l?t:t.slice(0,B.wP);return(0,hy.ZK)(e,s)}),[t,l,s]);return ip().createElement("div",{className:a.container},t.length>0?ip().createElement(ip().Fragment,null,ip().createElement(gy,{data:p,values:r,onChange:n,config:e}),c&&ip().createElement(oy,{active:l,onClick:u,className:a.viewMoreLess})):ip().createElement(ly.K,{variant:"noData",className:a.noData}))};var vy=r(3661),Ty=r(90320);const Oy=(0,Ty.M)(vy.Z);var Sy=r(75674),xy=r(18374);const Cy=(0,Ty.M)(xy.Z);var wy=r(22507),Ay=r(14658);function Ry(){return Ry=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ry.apply(null,arguments)}const _y={Option:({innerProps:e,innerRef:t,children:r,isFocused:n,isSelected:a,selectProps:{classes:i},label:o})=>ip().createElement(Wp(),Ry({className:up()(i.option,{[i["option--selected"]]:a}),ref:t,selected:n,component:"div"},e),ip().createElement(Hp(),{color:"primary",checked:a}),ip().createElement(ad.Y,{value:o},ip().createElement("div",{className:i["option--item"]},r)))},Iy=(0,Sp.Z)((e=>({label:{top:6,left:16},placeholder:({placeholder:e,label:t})=>({display:!e||t?"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 Ny(){return Ny=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ny.apply(null,arguments)}function Py(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Dy(e,t,r[t])}))}return e}function Dy(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let ky=0;const Ly=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["label","creatable","getOptions","loadingIndicator","components","classes","styles","onChange","onInputChange","menuPlacement"]),d=r?Oy:n?Cy:Sy.J,[m,f]=(0,ap.useState)(""),y=Iy((0,O.omit)(["classes"],e)),g="custom-select-"+ky++,h=(0,ap.useRef)();((e=[],t)=>{const r=(0,Ay.D)(null==e?void 0:e.length);(0,ap.useEffect)((()=>{const n=setTimeout((()=>{const n=(e=>{let t=null==e?void 0:e.parentElement;for(;t;){if(t.scrollHeight>t.clientHeight)return t;t=t.parentElement}return null})(null==t?void 0:t.current);var a;n&&((e,t,r,n)=>e&&t<e&&n.getBoundingClientRect().bottom>r.getBoundingClientRect().bottom)(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,O.prop)("controlRef",e.current)),t})(h));const E=Py({},_y,i),b=(0,wy.z)(y,o),v=Py({indicatorSeparator:e=>Py({},e,{margin:"10px 0"}),loadingIndicator:e=>Py({},e,{display:a?e.display:"none"}),loadingMessage:e=>Py({},e,{fontFamily:'"Roboto", "Helvetica", "Arial", sans-serif'})},l),T=t?{inputId:g,TextFieldProps:Py({label:t,InputLabelProps:{htmlFor:g,shrink:!(!e.value||!e.value.length)||void 0,className:b.label}},e.TextFieldProps)}:{};return ip().createElement(d,Ny({isMulti:!0,inputId:g,inputValue:m,onChange:function(e,t){s(e,t),"create-option"===t.action&&(f(""),c("",{action:"input-change"}))},onInputChange:function(e,{action:t}){c(e,{action:t}),"set-value"!==t&&f(e)},closeMenuOnSelect:!1,hideSelectedOptions:!1,classes:b,components:E,styles:v,menuPlacement:u,loadOptions:n,innerRef:h},T,p))};Ly.defaultProps={creatable:!1,cacheOptions:!0,components:{},classes:{},placeholder:"",loadingIndicator:!1,onInputChange:()=>{},onChange:()=>{}},Ly.propTypes={creatable:lp().bool,cacheOptions:lp().bool,defaultOptions:lp().bool,value:lp().arrayOf(lp().shape({label:lp().string.isRequired,value:lp().any})),options:lp().arrayOf(lp().shape({label:lp().string.isRequired,value:lp().any})),onChange:lp().func,onInputChange:lp().func,placeholder:lp().string,label:lp().string,loadingIndicator:lp().bool,components:lp().shape({ClearIndicator:lp().func,Control:lp().func,DropdownIndicator:lp().func,DownChevron:lp().func,CrossIcon:lp().func,Group:lp().func,GroupHeading:lp().func,IndicatorsContainer:lp().func,IndicatorSeparator:lp().func,Input:lp().func,LoadingIndicator:lp().func,Menu:lp().func,MenuList:lp().func,MenuPortal:lp().func,LoadingMessage:lp().func,NoOptionsMessage:lp().func,MultiValue:lp().func,MultiValueContainer:lp().func,MultiValueLabel:lp().func,MultiValueRemove:lp().func,Option:lp().func,Placeholder:lp().func,SelectContainer:lp().func,SingleValue:lp().func,ValueContainer:lp().func}),classes:lp().shape({control:lp().string,valueContainer:lp().string,multiValue:lp().string,noOptionsMessage:lp().string,singleValue:lp().string,placeholder:lp().string,menu:lp().string,clearIndicator:lp().string,dropdownIndicator:lp().string,option:lp().string,"option--selected":lp().string,label:lp().string}),styles:lp().shape({clearIndicator:lp().func,container:lp().func,control:lp().func,dropdownIndicator:lp().func,group:lp().func,groupHeading:lp().func,indicatorsContainer:lp().func,indicatorSeparator:lp().func,input:lp().func,loadingIndicator:lp().func,loadingMessage:lp().func,menu:lp().func,menuList:lp().func,menuPortal:lp().func,multiValue:lp().func,multiValueLabel:lp().func,multiValueRemove:lp().func,noOptionsMessage:lp().func,option:lp().func,placeholder:lp().func,singleValue:lp().func,valueContainer:lp().func}),TextFieldProps:lp().object,getOptions:lp().func,menuPlacement:lp().string,menuPortalTarget:lp().object,menuShouldBlockScroll:lp().bool,captureMenuScroll:lp().bool,getOptionValue:lp().func,isSearchable:lp().bool,inputRef:lp().shape({current:lp().object})};var Uy=r(80959),jy=r(88640),Fy=r(25386),My=r(59428),Vy=r(47823);const By=(0,Sp.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 zy(){return zy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},zy.apply(null,arguments)}const Hy=e=>{const{innerProps:t,innerRef:r,data:n,isSelected:a,isFocused:i,selectProps:{classes:o}}=e,l=By(),s=(0,O.has)("width",n),c=(0,O.has)("number",n);return ip().createElement(Wp(),zy({className:o.option,classes:{root:l.item,selected:l.itemSelected},ref:r,component:"div",selected:i,disableGutters:!0},t),ip().createElement(Hp(),{checked:a,color:"primary",disableRipple:!0,classes:{root:l.checkbox}}),ip().createElement("div",{className:l.infobox},ip().createElement("div",{className:l.textbox},ip().createElement(ad.Y,{value:n.label},ip().createElement("div",{className:l.text},n.label)),c&&ip().createElement("div",{className:l.number},(0,Ka.k7)(n.number,5e3))),s&&ip().createElement(dy,{className:up()(l.colorBar,{[l.selectedColorBar]:a}),width:n.width})))};Hy.propTypes={innerProps:lp().shape({id:lp().string.isRequired,key:lp().string,onClick:lp().func.isRequired,onMouseMove:lp().func.isRequired,onMouseOver:lp().func.isRequired,tabIndex:lp().number.isRequired}).isRequired,innerRef:lp().oneOfType([lp().oneOf([null]),lp().func,lp().shape({current:lp().any.isRequired})]),isSelected:lp().bool.isRequired,isFocused:lp().bool.isRequired,selectProps:lp().shape({classes:lp().shape({option:lp().string})}),data:lp().shape({value:lp().string,label:lp().string.isRequired,number:lp().number}).isRequired};const Yy=Hy,Wy=e=>{const{selectProps:{classes:t}}=e;return ip().createElement(ly.K,{variant:"noData",className:t.noOptionsMessage})};Wy.propTypes={selectProps:lp().object.isRequired};const Gy=Wy;function qy(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Zy(e,t,r[t])}))}return e}function Zy(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const $y={container:e=>qy({},e,{width:"100%"}),menuList:e=>qy({},e,{maxHeight:"240px",padding:"8px 0"}),menu:e=>qy({},e,{maxHeight:"240px"})},Ky=(0,Sp.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)"}}))),Xy=lp().shape({value:lp().string.isRequired,label:lp().string.isRequired,number:lp().number});function Qy(){return Qy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Qy.apply(null,arguments)}function Jy(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const eg=e=>{let{values:t=[],defaultOptions:r=[],filteredOptions:n,onChange:a=O.identity,getSuggestions:i,showBar:o=!0,showNumberInValue:l=!1,classes:s={},styles:c={},canLoadMore:u=!0,max:p=B.cu}=e,d=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["values","defaultOptions","filteredOptions","onChange","getSuggestions","showBar","showNumberInValue","classes","styles","canLoadMore","max"]);const m=Ky(),[f,y]=(0,ap.useState)(""),[g,h]=(0,ap.useState)(1),[E,b]=(0,ap.useState)(!1),T=(0,ap.useRef)(null),S=(0,ap.useRef)(!1),x=(0,ap.useRef)(!1),C=(n||[]).concat(r),w=e=>C.find((t=>t.value===e))||{value:e,label:e},A=e=>l&&(0,O.has)("number",e)?(0,O.assoc)("formattedNumber",(0,v.formatNumberAsMetric)((0,O.prop)("number",e),5e3),e):e,R=(0,O.pipe)((e=>{if(o&&e.length&&(0,O.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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Jy(e,t,r[t])}))}return e}({},e,{width:_(e.number,t)})))}return e}),(0,O.uniqBy)((0,O.prop)("value"))),_=(e,t)=>(t?100*e/t:0)+"%",I=(0,v.debounce)(((e,{action:t})=>{e!==f&&"set-value"!==t&&(y(e),h(1),S.current=!1,b(!0),i({value:e,pageNumber:1}))}),250),N=n||r,P=(0,ap.useCallback)((()=>{b(!0),i({value:f,pageNumber:g+1,currentOptions:N}),S.current=!0}),[f,g,i,N]);(0,ap.useEffect)((()=>{b(!1),S.current&&(h((e=>e+1)),S.current=!1)}),[n]),(0,ap.useEffect)((()=>{x.current||(b(!1),h(1),S.current=!1,i({value:"",pageNumber:1})),x.current=!1}),[r]);const D=(0,ap.useMemo)((()=>N.slice(0,g*p)),[N,g,p]),k=u&&N.length>D.length;return ip().createElement(Ly,Qy({filterOption:({label:e,value:t},r)=>v.utils.strings.search(e,r)||v.utils.strings.search(t,r),value:(e=>(0,v.wrapInArrayIfNeeded)(e).map(w).map(A))(t),onChange:(0,O.pipe)((0,O.tap)((()=>{x.current=!0})),(0,O.pluck)("value"),a),options:R(D),onInputChange:I,classes:(0,O.mergeRight)(m,s),styles:(0,O.mergeRight)($y,c),TextFieldProps:{InputProps:{disableUnderline:!0},ref:T},inputRef:T,components:{Option:Yy,NoOptionsMessage:Gy,Menu:Uy.h,DropdownIndicator:jy.K,MultiValue:Fy._,MenuList:My.d},menuPlacement:"bottom",menuListFooter:k&&ip().createElement(Vy.X,{loading:E,onClick:P})},d))};eg.propTypes={values:lp().array,defaultOptions:lp().arrayOf(Xy),filteredOptions:lp().arrayOf(Xy),onChange:lp().func.isRequired,getSuggestions:lp().func.isRequired,showBar:lp().bool,showNumberInValue:lp().bool,classes:lp().object,styles:lp().object,canLoadMore:lp().bool,max:lp().number};const tg=(0,ap.memo)(eg);var rg=r(43627),ng=r.n(rg);function ag(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){ig(e,t,r[t])}))}return e}function ig(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const og=(0,O.range)(2,10).reduce(((e,t)=>ag({},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)"}}})),{}),lg=(0,Sp.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":ag({fontSize:"10px",lineHeight:"11px",fontWeight:500,color:"rgba(255, 255, 255, 0.7)",marginTop:"4px"},og,{"&:last-child":{color:"white"}}),"& li + li":{marginTop:"2px"}}}})));function sg(){return sg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},sg.apply(null,arguments)}const cg=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["pathToTitle","children"]);const a=lg(),i=null!=t&&t.length?ip().createElement("div",{className:a.tooltipContent},ip().createElement("p",null,(0,O.last)(t)),t.length>2&&ip().createElement("ul",null,t.map((e=>ip().createElement("li",{key:e},e))))):"";return ip().createElement(ng(),sg({title:i,disableFocusListener:!0,classes:{tooltip:a.tooltip}},n),r)};var ug=r(96091),pg=r.n(ug),dg=r(35635),mg=r.n(dg);const fg=(0,Sp.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 yg(){return yg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},yg.apply(null,arguments)}const gg=(0,id.T)(mg()),hg=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["label","onDelete"]);const a=fg();return ip().createElement(pg(),yg({className:a.root,label:ei().number(t),onDelete:r,variant:"outlined",classes:{root:a.root,outlined:a.outlined,deleteIcon:a.deleteIcon,label:a.label},deleteIcon:ip().createElement(gg,{tooltipTitle:ei().text("Clear")})},n))},Eg=(0,Sp.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 bg(){return bg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},bg.apply(null,arguments)}const vg=({title:e="",chipLabel:t=0,onDelete:r,pathToTitle:n,onClick:a})=>{const i=Eg(),o=Boolean(n&&n.length>2),l=o?cg:ad.Y,s=o?{pathToTitle:n}:{value:e};return ip().createElement("div",{className:i.container,onClick:a},o&&ip().createElement(cg,bg({placement:"bottom-start"},s),ip().createElement("div",{className:i.parent},n[n.length-2])),ip().createElement("div",{className:i.titleContainer},ip().createElement(l,bg({placement:"bottom-start"},s),ip().createElement("span",{className:i.title},e)),0!==t&&ip().createElement("div",{className:i.chip},ip().createElement(hg,{label:t,onDelete:r}))))};function Tg(){return Tg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Tg.apply(null,arguments)}const Og=(0,Sp.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}}))),Sg=(0,id.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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return ip().createElement("svg",Tg({width:"13",height:"18",viewBox:"0 0 13 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},r),ip().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},ip().createElement("g",null,ip().createElement("g",null,ip().createElement("g",null,ip().createElement("g",{transform:"translate(-3 -1)"},ip().createElement("g",null,ip().createElement("path",{fill:"#FF4081",d:"M5.833 10h3.75v6.667l-3.75 1.666z"}),ip().createElement("path",{fill:"#CE0C4E",d:"M13.333 10v8.333l-3.75-1.666V10z"})),ip().createElement("circle",{fill:"#FFC058",cx:"9.583",cy:"7.917",r:"6.25"}),ip().createElement("circle",{fill:"#FFCD7B",cx:"9.583",cy:"7.917",r:"5.417"}),ip().createElement("path",{fill:"#FFFBB5",d:"M8.333 11.667L5 8.462l.933-.898 2.4 2.308L13.4 5l.933.897z"})))))))})),xg=({title:e,chipLabel:t,onDeleteChip:r,pathToTitle:n,onClose:a,children:i,isOpenByDefault:o=!0,isHighlighted:l=!1,isRecommended:s=!1})=>{const c=Og(),[u,p]=(0,ap.useState)(o),d=()=>{p(!u)};return ip().createElement("div",{className:up()(c.facetContainer,{[c.openedFacetContainer]:u,[c.closedFacetContainer]:!u,[c.highlighted]:l}),"data-reltio-id":`search-facet-container-${e}`},ip().createElement("div",{className:c.titleContainer},ip().createElement(gd.k,{tooltipTitle:ei().text("Remove"),icon:Ep(),onClick:a,className:c.iconButton,size:"XXS"}),s&&ip().createElement(Sg,{className:c.recommendedIcon,tooltipTitle:ei().text("Recommended"),showForDisabled:!0}),ip().createElement(vg,{title:e,pathToTitle:n,chipLabel:t,onDelete:r,onClick:d}),ip().createElement(Fm,{onClick:d,isOpen:u,className:c.iconButton,size:"S",tooltipTitle:u?ei().text("Collapse attribute"):ei().text("Expand attribute"),tooltipPlacement:"bottom-end"})),u?i:null)},Cg=(0,Sp.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"}}))),wg=({config:e,data:t=[],filteredData:r,values:n=[],isHighlighted:a,isRecommended:i,onSearch:o=O.identity,onChange:l,onClose:s})=>{const c=Cg();return ip().createElement(xg,{title:e.title,pathToTitle:e.pathToTitle,onClose:s,chipLabel:n.length,onDeleteChip:()=>l([]),isHighlighted:a,isRecommended:i},ip().createElement(tg,{values:n,defaultOptions:t,filteredOptions:r,onChange:l,getSuggestions:o,isClearable:!1,showBar:!1,showNumberInValue:!0,classes:c,placeholder:ei().text("All values"),canLoadMore:!(0,Ia.tW)(e)}))};var Ag=r(32015),Rg=r(15608),_g=r.n(Rg);const Ig=(0,Sp.Z)((e=>({root:{borderRadius:4,padding:"15px 0"},rail:{backgroundColor:(0,xm.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,xm.alpha)(e.palette.primary.main,.12)}`,"@media (hover: none)":{boxShadow:"none"}},"&$active":{boxShadow:`0px 0px 0px 9px ${(0,xm.alpha)(e.palette.primary.main,.12)}`},"&::after":{left:-10,top:-10,right:-10,bottom:-10}},focusVisible:{},active:{},track:{borderRadius:4}}))),Ng=(0,Sp.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"}}))),Pg=({children:e,open:t,value:r})=>{const n=Ng();return ip().createElement(ng(),{open:t,enterTouchDelay:0,placement:"top",title:r,classes:{tooltipPlacementTop:n.tooltipPlacementTop,tooltip:n.tooltip}},e)};function Dg(){return Dg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Dg.apply(null,arguments)}Pg.propTypes={children:lp().element.isRequired,open:lp().bool.isRequired,value:lp().string.isRequired};const kg=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["min","max","range","onChange","onAfterChange","className"]);const s=Ig();return ip().createElement("div",{className:o},ip().createElement(_g(),Dg({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:Pg},size:"small",component:"div"},l)))};kg.propTypes={min:lp().oneOfType([lp().number,lp().string]).isRequired,max:lp().oneOfType([lp().number,lp().string]).isRequired,range:lp().array.isRequired,onChange:lp().func,onAfterChange:lp().func,className:lp().string};const Lg=kg;var Ug=r(18205),jg=r(19406),Fg=r(55484),Mg=r(25556),Vg=r(3131),Bg=r(27741),zg=r(42400),Hg=r(11011);const Yg=(0,Sp.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"}}))),Wg=({payload:e,formatter:t,active:r})=>{const n=Yg();if(r){const{payload:{label:r},value:a}=e[0];return ip().createElement("div",{className:n.tooltip},ip().createElement("div",{className:n.number},t(a)),ip().createElement("div",{className:n.value},r))}return null},Gg=(0,Sp.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 qg(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Zg=({data:e=[],range:t=[],domain:r,color:n=v.theme.palette.primary.main,tickFormatterX:a,tickFormatterY:i})=>{const o=Gg(),[l,s]=(0,ap.useState)(null),c=(e,r)=>(l===r?.2:0)+((({value:e})=>e[0]>=t[0]&&e[1]<=t[1])(e)?.6:.2),u=e.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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){qg(e,t,r[t])}))}return e}({},e,{value:t<r.length-1?e.value[0]:e.value[1]}))),p=e=>{e.isTooltipActive?s(e.activeTooltipIndex):s(null)};return ip().createElement(Ug.h,null,ip().createElement(jg.v,{data:u,margin:{top:12,right:0,left:0,bottom:0},onMouseEnter:p,onMouseLeave:p,onMouseMove:p,className:o.barChart},ip().createElement(Fg.q,{vertical:!1,stroke:"#f2f2f2"}),ip().createElement(Mg.K,{dataKey:"value",interval:0,padding:{left:4,right:4},height:15,tickLine:!1,ticks:r,tick:e=>{const{x:t,y:r,index:n,payload:{value:i,offset:o}}=e;return ip().createElement("text",{x:0===n?t-o:t+o,y:r+4,textAnchor:0===n?"start":"end"},`${a(i)}`)}}),ip().createElement(Vg.B,{width:38,domain:[0,"auto"],axisLine:!1,tickLine:!1,tickSize:0,tickMargin:4,tickCount:6,tickFormatter:i}),ip().createElement(Bg.u,{cursor:{fill:"rgb(255,255,255)"},content:ip().createElement(Wg,{formatter:i}),isAnimationActive:!1}),ip().createElement(zg.$,{dataKey:"number",isAnimationActive:!1},e.map(((e,t)=>ip().createElement(Hg.b,{key:`cell-${t}`,fill:n,fillOpacity:c(e,t)}))))))},$g="NumericRangeFacet-styles-numberEditorInputRoot--djW3k",Kg="NumericRangeFacet-styles-numberEditorRoot--DVXqx",Xg="NumericRangeFacet-styles-input--Nl2tx";function Qg(){return Qg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Qg.apply(null,arguments)}class Jg extends ap.PureComponent{constructor(...e){super(...e),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,O.path)([0,0],r))&&n.equals(o[1],(0,O.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,O.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,O.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,Al.C)(a),l=(0,Ka.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,v.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,f=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))),[g,h]=p.getBarDomain(t).map((e=>this.applyScale(e)));return ip().createElement(xg,{title:e.title,pathToTitle:e.pathToTitle,onClose:a,isHighlighted:r,isRecommended:n},ip().createElement("div",{className:"NumericRangeFacet-styles-data--kL9q5"},f.length>0?ip().createElement(ip().Fragment,null,ip().createElement("div",{className:"NumericRangeFacet-styles-barChartContainer--t9NkG","data-reltio-id":"search-bar-chart-with-selection"},ip().createElement(Zg,{data:f,range:y,tickFormatterX:m,tickFormatterY:p.formatNumberForRangeFacet,domain:[g,h]})),ip().createElement(Lg,{min:g,max:h,range:y,onAfterChange:this.onRevertedChange,onChange:this.onChangeRange,className:"NumericRangeFacet-styles-slider--XbmKe",valueLabelFormat:m,step:d?(h-g)/200:1}),ip().createElement("div",{className:"NumericRangeFacet-styles-inputsContainer--mU0_m"},ip().createElement(Ag.c,{value:c,onChange:this.onLowerBoundChanged,onFocus:this.onFocus,integer:!d,format:i,variant:"filled",classes:{root:Kg},InputProps:{classes:{root:$g,input:Xg}}}),ip().createElement(Ag.c,{value:u,onChange:this.onUpperBoundChanged,onFocus:this.onFocus,integer:!d,format:i,variant:"filled",classes:{root:Kg},InputProps:{classes:{root:$g,input:Xg}}}))):ip().createElement(ly.K,{variant:"noData"})))}}Jg.propTypes={data:lp().array,values:lp().array,config:lp().object,isHighlighted:lp().bool,isRecommended:lp().bool,onClose:lp().func,onChange:lp().func,numberFormat:lp().shape({decimalSeparator:lp().string,thousandSeparator:lp().string,prefix:lp().string,suffix:lp().string,decimalScale:lp().number})},Jg.defaultProps={config:{},data:[],values:[]};const eh=(0,sp.connect)((e=>({numberFormat:A().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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(t,["config","values","data","onChange","numberFormat"]);const s=(0,sp.useSelector)(A().selectors.getAttributesPresentation),{strategy:c}=(0,v.getNumberFormat)((0,v.getAttrDataTypeDefinition)(r.attrType),s,v.intl.getLocale()),u=(0,ap.useMemo)((()=>null==a?void 0:a.map((0,O.evolve)({value:(0,O.map)((0,v.applyPresentationStrategyToValue)(c))}))),[a,c]),p=(0,ap.useMemo)((()=>null==n?void 0:n.map((0,v.mapFilterValue)((0,v.applyPresentationStrategyToValue)(c)))),[n,c]),d=(0,ap.useCallback)((e=>{const t=null==e?void 0:e.map((0,v.mapFilterValue)((0,v.revertPresentationStrategyForValue)(c)));i(t)}),[c,i]);return ip().createElement(e,Qg({data:u,values:p,onChange:d,config:r,numberFormat:o&&(0,O.omit)(["strategy",o])},l))};return t.displayName="WithCustomizedData",t})(Jg));var th=r(21669);const rh=(0,Sp.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 nh(){return nh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},nh.apply(null,arguments)}const ah=(e,t)=>(0,O.pathOr)(null,[t],e),ih=e=>e&&new Date(e),oh=e=>e&&e.getTime(),lh=({values:e,minDate:t,maxDate:r,onChange:n})=>{const[a,i]=(0,ap.useState)(null),[o,l]=(0,ap.useState)(null),s=(0,ap.useRef)((0,Me.x0)()),c=(0,ap.useRef)((0,Me.x0)()),u=rh();ip().useEffect((()=>{i(ah(e,0)),l(ah(e,1))}),[e]);const p=(e,t)=>{(0,O.isNil)(e)||(0,O.isNil)(t)||n(e>t?[[t,e]]:[[e,t]])},d={minDate:ih(t),maxDate:ih(r)};return ip().createElement("div",{className:u.container},ip().createElement(th.Q,nh({label:ei().text("Start Date"),value:ih(a),onChange:e=>{const t=oh(e);i(t),p(t,o)},slotProps:{textField:{id:s.current,className:u.dateEditor}}},d)),ip().createElement(th.Q,nh({label:ei().text("End Date"),value:ih(o),onChange:e=>{const t=oh(e);l(t),p(a,t)},slotProps:{textField:{id:c.current,className:u.dateEditor},popper:{placement:"bottom-end"}}},d)))};function sh(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ch=e=>t=>e===v.DataTypes.TYPE_DATE?v.utils.dates.toLocalDate(t).getTime():t,uh=(0,Sp.Z)({barChartContainer:{position:"relative",height:"190px",paddingTop:"6px",width:"100%",overflow:"hidden"},dateRangeChooserWrapper:{display:"flex",flexDirection:"column",alignItems:"center",marginTop:"12px",width:"100%"}}),ph=(0,Al.C)(),dh=({data:e=[],values:t=[],config:r,onChange:n,isHighlighted:a,isRecommended:i,onClose:o})=>{const l=uh(),s=(0,O.path)(["attrType","type"],r),c=(0,ap.useCallback)((r=>{const a=r.map((0,v.mapFilterValue)((i=s,e=>i===v.DataTypes.TYPE_DATE?v.utils.dates.toUtcDate(e).getTime():e)));var i;if(!(0,O.equals)(t,a)){const[t,r]=ph.getBarDomain(e),i=s===v.DataTypes.TYPE_DATE,o=a.map((e=>[v.utils.dates.getStartOfDay(e[0],i),v.utils.dates.getEndOfDay(e[1],i)])),l=ph.getRange(o,e);n([l.length?l:[t,r]])}}),[e,n,s,t]),u=(0,ap.useMemo)((()=>{return e.map((t=s,e=>{if(Array.isArray(e.value)){const r=e.value.map(ch(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){sh(e,t,r[t])}))}return e}({},e,{value:r,label:r.map(v.formatDate).join(" - ")})}}));var t}),[e,s]),[p,d]=(0,ap.useMemo)((()=>[ph.getBarDomain(u),ph.getRange(t.map((0,v.mapFilterValue)(ch(s))),u)]),[u,s,t]);return ip().createElement(xg,{title:r.title,pathToTitle:r.pathToTitle,onClose:o,isHighlighted:a,isRecommended:i},e.length>0?ip().createElement(ip().Fragment,null,ip().createElement("div",{className:l.barChartContainer},ip().createElement(Zg,{data:u,range:d,tickFormatterX:v.formatDate,tickFormatterY:ph.formatNumberForRangeFacet,domain:p})),ip().createElement("div",{className:l.dateRangeChooserWrapper},ip().createElement(lh,{values:d,onChange:c}))):ip().createElement(ly.K,{variant:"noData"}))};function mh(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class fh{static getWidget(e){switch(e.type){case v.FACET_TYPES.ENTITY_TYPE_FACET:return by;case v.FACET_TYPES.WITH_DROPDOWN_CHECKBOXES_FACET:return wg;case v.FACET_TYPES.NUMERIC_RANGE_FACET:return eh;case v.FACET_TYPES.DATE_RANGE_FACET:return dh;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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){mh(e,t,r[t])}))}return e}({},fh.getDefaultConfig(),e),r=fh.getWidget(t);return r?(e=>{const r=((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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(r,["dispatch"]);return ip().createElement(e,ey({config:t,onChange:(i=t.fieldName,e=>{n(Ga(i,e))}),onClose:t.showDeleteButton?(e=>()=>{n($a({fieldNamesToDelete:[e]}))})(t.fieldName):()=>{},onSearch:(e=>({value:t,pageNumber:r,currentOptions:a})=>{n((({facetFieldName:e,value:t,debounceTime:r=0,pageNumber:n=1,currentOptions:a})=>({type:R.k.FILTER_FACET_DATA,payload:{facetFieldName:e,value:t,debounceTime:r,pageNumber:n,currentOptions:a}}))({facetFieldName:e,value:t,debounceTime:250,pageNumber:r,currentOptions:a}))})(t.fieldName)},a));var i};return r.propTypes={dispatch:lp().func,isRecommended:lp().bool},r})(e,t);return fh.connectData(r,t)})(r):null}}fh.getDefaultConfig=()=>({autofocus:!1,showDeleteButton:!0}),fh.connectData=(e,t)=>(0,sp.connect)((e=>({data:(0,C.X7)(t,e),values:(0,C.N1)(t,e),filteredData:(0,C.VP)(t,e),isHighlighted:(0,C.$t)(t.fieldName,e),isRecommended:(0,C.TH)(t.fieldName,e)})))(e);var yh=r(64927),gh=r.n(yh),hh=r(73707),Eh=r.n(hh),bh=r(93463),vh=r.n(bh);const Th=(0,Sp.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 Oh=r(44244);const Sh=({tenantObject:e,isDataTenant:t,className:r})=>{const n=(({tenantObject:e,isDataTenant:t})=>{const r=(0,Oh._)(),[n,a]=(0,ap.useState)(0),i=(0,sp.useSelector)(A().selectors.getGlobalSearchRequestOptions),o=t?e:null,l=(0,sp.useSelector)((e=>(0,Xa.E2)(e,[],o))),s=JSON.stringify((0,_a.Vg)(l,[],i)),c=(0,sp.useSelector)(A().selectors.getDtssPath),u=(0,sp.useSelector)(A().selectors.getTenant);return(0,ap.useEffect)((()=>{r((0,_a.Es)({url:B.jS,options:{method:"POST",body:s},customerTenant:u,dataTenant:(0,O.prop)("id",o),dtssPath:c})).then((({total:e})=>{a(e)})).catch((e=>{console.warn(e)}))}),[o,u,c,s]),n})({tenantObject:e,isDataTenant:t});return ip().createElement("div",{className:r},(0,Ka.k7)(n))};Sh.propTypes={className:lp().string,tenantObject:lp().object.isRequired,isDataTenant:lp().bool};const xh=Sh;function Ch(){return Ch=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ch.apply(null,arguments)}const wh={changeCurrentTenant:({tenantObject:e,isDataTenant:t})=>({type:_.Z.CHANGE_CURRENT_TENANT,payload:{tenantObject:e,isDataTenant:t}})},Ah=(0,sp.connect)((e=>({dataTenants:A().selectors.getDataTenants(e),customerTenantObject:A().selectors.getTenantObject(e),currentTenant:(0,Xa.RO)(e),openAdvancedSearch:(0,Ti.IJ)(e)})),wh)((({customerTenantObject:e,currentTenant:t,dataTenants:r,changeCurrentTenant:n,openAdvancedSearch:a})=>{const i=Th(),o=(0,O.pipe)((0,O.map)((({id:e,label:t})=>({value:e,label:t}))),(0,O.prepend)({value:e.id,label:e.name}))(r),l=t=>{const n=t!==e.id;return{isDataTenant:n,tenantObject:n?r.find((0,O.propEq)("id",t)):e}},s=t||e.id;return ip().createElement("div",{className:i.tenantFacet},ip().createElement(If,{title:ei().text("Tenants"),hasCollapseButton:!1}),ip().createElement(Eh(),{className:i.radioGroup,value:s,onChange:(0,O.pipe)(Tp.NA,l,n)},o.map((({value:e,label:t})=>ip().createElement("div",{className:i.tenantContainer,key:e},ip().createElement(vh(),{classes:{root:i.radioLabelRoot,label:i.radioLabel},value:e,label:t||e,control:ip().createElement(gh(),{className:i.radioButton,color:"primary"})}),!a&&ip().createElement(xh,Ch({className:i.total},l(e))))))))})),Rh=(0,Sp.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}}),_h=({variant:e="facetsPanel",searchOptions:t={},dispatch:r})=>{const{root:n,labelRoot:a,checkboxRoot:i,checkboxRootQueryGroups:o}=Rh(),l=t.searchByOv,s=(0,ap.useCallback)((()=>{r(w.search.actions.updateSearchOptions({searchByOv:!l,ovOnly:!l}))}),[l,r]),c=ei().text("Search by OV only");return ip().createElement("div",{className:n,onClick:s},ip().createElement(Hp(),{classes:{root:up()(i,{[o]:"queryGroups"===e})},checked:l,color:"primary"}),ip().createElement(ad.Y,{value:c},ip().createElement(hf(),{variant:"body2",classes:{root:a}},c)))};_h.propTypes={searchOptions:lp().shape({searchByOv:lp().bool,ovOnly:lp().bool}),variant:lp().oneOf(["facetsPanel","queryGroups"]),dispatch:lp().func};const Ih=(0,sp.connect)((e=>({searchOptions:A().selectors.getSearchOptions(e)})))(_h),Nh=(0,Sp.Z)({root:{display:"flex",flexDirection:"column",overflow:"auto",height:"100%"}});function Ph(){return Ph=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ph.apply(null,arguments)}const Dh=(0,v.memoizeWith)((e=>e.fieldName),fh.build),kh=({group:e,configs:t})=>ip().createElement(Jf,Ph({},e,{key:e.title}),(e=>e.map((e=>({Facet:Dh(e),id:e.fieldName}))).filter((({Facet:e})=>e)).map((({Facet:e,id:t})=>ip().createElement(e,{key:t}))))(t)),Lh=(0,sp.connect)((e=>{const t=A().selectors.getDataTenants(e);return{metadata:A().selectors.getMetadata(e),facetsConfigs:(0,C.Mp)(e),uiConfigShowSearchByOv:A().selectors.getShowSearchByOv(e)??(0,Ti.cC)(e),showTenantFacet:t&&t.length>0,tenant:A().selectors.getTenant(e)}}))((({facetsConfigs:e=[],metadata:t,onScroll:r,uiConfigShowSearchByOv:n,showTenantFacet:a})=>{const{root:i}=Nh(),o=(0,ap.useRef)(null),l=(0,ap.useCallback)((e=>{r(o.current.scrollTop,e)}),[r]),s=((e,t)=>{const[r,n]=(0,O.partition)(v.isTypeFacet,t),a=[{group:{title:ei().text("Entity types"),hasCollapseButton:!1},configs:r},{group:{title:ei().text("Attributes"),hasCollapseButton:!1,hasSearchAttributesField:!0},configs:n}];return Rf(a)})(0,e),c=(0,O.head)(s),u=(0,O.tail)(s),p=o.current,d=(0,ap.useMemo)((()=>({element:p,priority:["top","bottom"]})),[p]);return ip().createElement("div",{ref:o,className:i,onScroll:l},ip().createElement(wf.p.Provider,{value:d},n&&ip().createElement(Ih,null),a&&ip().createElement(ip().Fragment,null,ip().createElement(Ah,null),ip().createElement(Cf(),null)),c&&kh(c),ip().createElement(Cf(),null),u.map(((e,t)=>ip().createElement(kh,Ph({},e,{key:t}))))))})),Uh=({children:e,className:t})=>ip().createElement("div",{className:up()("MainContent-styles-mainContent--Ha5me",t)},e);Uh.propTypes={children:lp().node,className:lp().string};const jh=Uh;var Fh=r(33788);const Mh=(0,Sp.Z)({container:{backgroundColor:"#fff",opacity:.37,position:"fixed",width:"100%",height:"100%",top:0,left:0,display:"flex",justifyContent:"center",alignItems:"center"}}),Vh=()=>{const e=(0,sp.useSelector)(Ti.Kv),{container:t}=Mh();return e?ip().createElement("div",{className:t},ip().createElement(Fh.Z,{size:160})):null};var Bh=r(54596),zh=r.n(Bh),Hh=r(49233),Yh=r.n(Hh),Wh=r(35206),Gh=r.n(Wh),qh=r(81733),Zh=r.n(qh),$h=r(68290),Kh=r.n($h);const Xh=(0,Sp.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"},[B.GT.error]:{backgroundColor:e.palette.error.dark}})));function Qh(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Jh=()=>{const e=(0,sp.useDispatch)(),t=(0,sp.useSelector)(Ti.v6),r=(0,sp.useSelector)(A().selectors.getAutoCloseInterval),n=t&&t.payload.autoHideDuration||r&&1e3*r||5e3,a=Xh(),i=(0,ap.useRef)(null),o=(0,ap.useCallback)((()=>{e(fi())}),[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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Qh(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,ap.useCallback)((()=>{p&&e(p)}),[p,e]),m=(0,ap.useMemo)((()=>l===B.GT.error?ip().createElement(Yh(),{key:"close","aria-label":"Close",color:"inherit",className:a.close,onClick:d,size:"large"},ip().createElement(Ep(),null)):u?ip().createElement(Gh(),{color:"primary",size:"small",onClick:d},u.actionLabel):null),[a,l,u,d]);return ip().createElement(Zh(),{container:document.body},ip().createElement(zh(),{key:c+l,anchorOrigin:{vertical:"bottom",horizontal:"center"},autoHideDuration:n,open:Boolean(t),onClose:o,ContentProps:{classes:{root:up()(a.snackbar,a[l]),message:a.message}},message:ip().createElement("div",{className:a.messageContent},l===B.GT.error&&ip().createElement(Kh(),{className:a.icon}),c),classes:{anchorOriginBottomCenter:a.anchorSnackBar},action:m}))},eE=(0,Sp.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 tE=r(95641);const rE=(0,Sp.Z)((()=>({container:{position:"relative"},panel:{position:"relative"},horizontal:{},vertical:{},disabled:{},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:"ns-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","&$disabled":{background:"transparent"},"&:not($disabled):hover":{cursor:"ew-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%"}}}})));function nE(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){aE(e,t,r[t])}))}return e}function aE(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const iE=e=>"horizontal"===e,oE=(e,t)=>e.toFixed(2)===t.toFixed(2),lE=({className:e,children:t,orientation:r="vertical",primary:n="first",size:a,minSize:i,maxSize:o,allowResize:l,debounceInterval:s=250,onChange:c})=>{const u=rE(),p=(0,xm.useTheme)(),d=(0,ap.useRef)(),[m,f]=(0,ap.useState)(null),[y,g]=(0,ap.useState)(0),[h,E]=(0,ap.useState)(0),[b,T]=(0,ap.useState)(!0),O=(0,ap.useCallback)((()=>T(!0)),[]),S=(0,ap.useCallback)((()=>T(!1)),[]),x=(0,ap.useCallback)((()=>iE(r)?null==m?void 0:m.clientHeight:null==m?void 0:m.clientWidth),[m,r]);"number"==typeof a&&a<0&&(a=(x()||0)+a);const C=(0,ap.useCallback)((e=>"string"==typeof e&&e.endsWith("%")?+e.replace("%",""):("string"==typeof e&&e.endsWith("px")&&(e=e.replace("px","")),isNaN(+e)?null:+e/x()*100)),[x]),w=(0,ap.useCallback)(((e,t)=>0===e||100===e?0:C(t)||0),[C]),A=(0,ap.useCallback)((()=>{if(m&&d.current){const e=C(a);null==e||isNaN(e)||(E(w(e,o)),g(w(e,i)),d.current.resize(e))}}),[C,w,i,o,a,m]);(0,ap.useEffect)((()=>{A()}),[A,h,y]);const R=(0,ap.useCallback)((0,v.debounce)((e=>{if(void 0===e)return;const t=x();c({percentageSize:e+"%",isMaxSize:oE(e,+h>0?h:100+h),isMinSize:oE(e,y),size:Math.round(e*t/100)})}),s),[c,h,y,x]),_=(0,ap.useCallback)((e=>{e?(R(),S()):(R(d.current.getSize()),O())}),[S,O,R]),I=(0,ap.useMemo)((()=>({transition:p.transitions.create("flex",{easing:p.transitions.easing.sharp,duration:p.transitions.duration.leavingScreen})})),[p]),N=nE({className:u.panel,minSize:y},h>0?{maxSize:h}:{},{ref:d,style:b?I:void 0}),P=nE({className:u.panel,style:b?I:void 0},h<0?{minSize:-h}:{});return ip().createElement("div",{ref:f,className:up()(u.container,e)},ip().createElement(Up.ZP,{handleHeight:iE(r),handleWidth:!iE(r),onResize:A,refreshMode:"debounce",refreshRate:50}),ip().createElement(tE.eh,{direction:iE(r)?"vertical":"horizontal"},ip().createElement(tE.s_,"first"===n?N:P,t[0]),ip().createElement(tE.OT,{className:up()(u.resizer,u[r],{[u.disabled]:!l}),disabled:!l,hitAreaMargins:{coarse:0,fine:0},onDragging:_}),ip().createElement(tE.s_,"second"===n?N:P,t[1])))};lE.displayName="ResizablePanes";const sE=(0,Sp.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}}),cE=({entity:e,className:t,size:r="small"})=>{const n=sE(),a=(0,Uf.AH)(),i=(0,v.getEntityType)(a,e.type),o=(i?(0,v.getPropWithInheritance)(a,i,"typeColor"):null)||v.theme.palette.primary.main,l=(0,v.getEntityTypeLabel)(a,e);return ip().createElement(ad.Y,{value:l,placement:"top"},ip().createElement(hf(),{style:{backgroundColor:o,color:v.utils.Colors.getColor(o)?"#FFFFFF":"#212121"},className:up()(n[`entityType-${r}`],n["entityType-overflow"],t),component:"div"},l))},uE=e=>e&&e.scrollIntoView({block:"end",behavior:"smooth"}),pE=e=>{e&&clearTimeout(e)},dE=(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 mE=r(600);const fE=(0,Sp.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,xm.alpha)(e.palette.primary.main,.12),"&:hover":{background:(0,xm.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"}}))),yE=({entities:e,entityToHighlight:t,selectedEntityUri:r,onEntityClick:n,onEntityHover:a,entitiesImportStatus:i,entityButtonsRenderer:o})=>{const l=fE(),s=(0,ap.useRef)(null),c=(0,ap.useRef)(null),u=(0,Uf.AH)();return(0,mE.D)((()=>{if(t){var e;const n=null===(e=s.current)||void 0===e?void 0:e.querySelectorAll(`[data-entity-uri='${t}']`);if(pE(c.current),(null==n?void 0:n.length)>0){var r;const e=null===(r=s.current)||void 0===r?void 0:r.parentElement;dE(n[0],e)||(uE(n[0]),c.current=setTimeout((()=>{dE(n[0],e)||uE(n[0])}),1e3))}}return()=>{pE(c.current)}}),[t]),ip().createElement("div",{ref:s},(e||[]).map((e=>{const s=(0,v.getLabel)(e.label),c=e.secondaryLabel,p=(0,v.getBusinessCardAttributesText)(u,e),d=(0,v.isActiveObject)(e),m=e.uri,f=(0,v.getEntityUriForLink)(e),y=(0,O.prop)(m,i);return ip().createElement("div",{key:m,className:up()(l.item,{[l.clickable]:!!n,[l.selected]:m===r,[l.highlighted]:m===t,[l.inactive]:!d,[l.justImported]:y===sm.Eh.Success}),onClick:n?()=>n(m):void 0,onMouseEnter:a?()=>a(m):void 0,onMouseLeave:a?()=>a(null):void 0,"data-entity-uri":m},ip().createElement(b.A,{entity:e,avatarClassName:l.avatar,imageClassName:l.image}),ip().createElement("div",{className:l.info},ip().createElement("div",null,ip().createElement(Ld.x,{value:f,className:l.label},s),c&&ip().createElement("span",{className:l.secondaryLabel},c," "),p&&ip().createElement("span",{className:l.businessCard},p)),ip().createElement("div",{className:l.secondRow},ip().createElement(cE,{entity:e}),ip().createElement("div",null,(0,v.getEntityId)(e)))),o&&o(e))})))};var gE=r(92255);function hE(){return hE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hE.apply(null,arguments)}function EE(){return EE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},EE.apply(null,arguments)}function bE(){return bE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},bE.apply(null,arguments)}function vE(){return vE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vE.apply(null,arguments)}const TE=(0,Sp.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:{},small:{width:"88px",height:"88px"},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 OE(){return OE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},OE.apply(null,arguments)}let SE=function(e){return e.full="full",e.embedded="embedded",e.small="small",e}({});const xE={SEARCH_RESULTS:e=>ip().createElement("svg",hE({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),ip().createElement("defs",null,ip().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"},ip().createElement("stop",{stopColor:"#00BFFF",stopOpacity:.5,offset:"0%"}),ip().createElement("stop",{stopColor:"#9EE8FF",stopOpacity:0,offset:"100%"})),ip().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"},ip().createElement("stop",{stopColor:"#91F8E5",stopOpacity:.6,offset:"0%"}),ip().createElement("stop",{stopColor:"#14F7FF",stopOpacity:0,offset:"100%"})),ip().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"},ip().createElement("stop",{stopColor:"#FFF",offset:"0%"}),ip().createElement("stop",{stopColor:"#73FAFF",stopOpacity:.21,offset:"59.38%"}),ip().createElement("stop",{stopColor:"#14F7FF",stopOpacity:0,offset:"100%"})),ip().createElement("linearGradient",{x1:"50%",y1:"170.771%",x2:"50%",y2:"10.303%",id:"EmptySearchResults_svg__e"},ip().createElement("stop",{stopColor:"#91F8E5",offset:"0%"}),ip().createElement("stop",{stopColor:"#99FCFF",stopOpacity:0,offset:"100%"})),ip().createElement("filter",{x:"-25.9%",y:"-26.2%",width:"151.8%",height:"152.3%",filterUnits:"objectBoundingBox",id:"EmptySearchResults_svg__d"},ip().createElement("feGaussianBlur",{stdDeviation:15,in:"SourceGraphic"})),ip().createElement("circle",{id:"EmptySearchResults_svg__a",cx:128,cy:128,r:128})),ip().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},ip().createElement("mask",{id:"EmptySearchResults_svg__b",fill:"#fff"},ip().createElement("use",{xlinkHref:"#EmptySearchResults_svg__a"})),ip().createElement("use",{fillOpacity:.2,fill:"#A792CD",xlinkHref:"#EmptySearchResults_svg__a"}),ip().createElement("g",{mask:"url(#EmptySearchResults_svg__b)"},ip().createElement("g",{transform:"translate(56 34)"},ip().createElement("g",{opacity:.9,strokeWidth:1,fill:"#FFF"},ip().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"}),ip().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})),ip().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(21.756 45.833)"},ip().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:213.204,cy:5.456,rx:4.351,ry:4.365}),ip().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:197.976,cy:5.456,rx:4.351,ry:4.365}),ip().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"}),ip().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}),ip().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}),ip().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})),ip().createElement("rect",{fill:"#645F6D",opacity:.5,x:21.756,y:17.46,width:87.022,height:12.004,rx:6.002}),ip().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(21.756 87.302)"},ip().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:213.204,cy:5.456,rx:4.351,ry:4.365}),ip().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:197.976,cy:5.456,rx:4.351,ry:4.365}),ip().createElement("rect",{fill:"#E3EBF4",x:0,y:1.091,width:20.668,height:20.734,rx:10.334}),ip().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}),ip().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}),ip().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})),ip().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(21.756 128.77)"},ip().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:213.204,cy:5.456,rx:4.351,ry:4.365}),ip().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:197.976,cy:5.456,rx:4.351,ry:4.365}),ip().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"}),ip().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}),ip().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}),ip().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})))),ip().createElement("g",{mask:"url(#EmptySearchResults_svg__b)"},ip().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"}),ip().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"}),ip().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"}),ip().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}),ip().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"}),ip().createElement("g",null,ip().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)"}),ip().createElement("path",{fill:"url(#EmptySearchResults_svg__e)",opacity:.3,d:"M4 9h166.37L120.73 172.299H53.64z",transform:"rotate(120 90.404 138.861)"}),ip().createElement("path",{fill:"url(#EmptySearchResults_svg__f)",opacity:.3,d:"M4 2h166.37L120.73 172.299H53.64z",transform:"rotate(120 90.404 138.861)"}),ip().createElement("path",{fill:"url(#EmptySearchResults_svg__g)",d:"M4 9h166.37L120.73 172.299H53.64z",transform:"rotate(120 90.404 138.861)"}),ip().createElement("path",{fill:"#FFF",opacity:.196,d:"M212.363 205.344l-1 1.732L60.418 124.52l4.977-8.62z"})),ip().createElement("path",{fill:"#76A2B5",d:"M73.112 84.533l-35.5 61.488-.866-.5 35.5-61.488z"}),ip().createElement("path",{fill:"#F3F3F3",d:"M80.906 89.033l-35.5 61.488-.866-.5 35.5-61.488z"}),ip().createElement("path",{fill:"#538196",d:"M55.112 115.71l-17.5 30.311-.866-.5 17.5-30.31z"})))),SELECT_ATTRIBUTES:e=>ip().createElement("svg",EE({width:256,height:256,viewBox:"0 0 256 256",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgSelectAttributes"},e),ip().createElement("circle",{cx:128,cy:128,r:128,fill:"#0072CE",fillOpacity:.1}),ip().createElement("mask",{id:"SelectAttributes_svg__a",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:0,y:0,width:256,height:256},ip().createElement("circle",{cx:128,cy:128,r:128,fill:"#fff"})),ip().createElement("g",{mask:"url(#SelectAttributes_svg__a)"},ip().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M-16 9h256v247H-16V9z",fill:"url(#SelectAttributes_svg__paint0_linear_0_19219)"}),ip().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)"}),ip().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"}),ip().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"}),ip().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"}),ip().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"}),ip().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"}),ip().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"}),ip().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"}),ip().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"}),ip().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"}),ip().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"}),ip().createElement("circle",{cx:67,cy:79,r:9,fill:"#B6C7DB"}),ip().createElement("circle",{cx:67,cy:79,r:9,fill:"#B6C7DB"}),ip().createElement("circle",{cx:120,cy:106,r:6,fill:"#B6C7DB"}),ip().createElement("circle",{cx:120,cy:136,r:6,fill:"#B6C7DB"}),ip().createElement("circle",{cx:67,cy:169,r:9,fill:"#B6C7DB"}),ip().createElement("circle",{cx:67,cy:199,r:9,fill:"#B6C7DB"}),ip().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"}),ip().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"}),ip().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"}),ip().createElement("path",{opacity:.54,fillRule:"evenodd",clipRule:"evenodd",d:"M95.071 77l-3.535 3.535L88 77h7.071z",fill:"#000"}),ip().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"}),ip().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"})),ip().createElement("defs",null,ip().createElement("linearGradient",{id:"SelectAttributes_svg__paint0_linear_0_19219",x1:-16,y1:9,x2:-16,y2:256,gradientUnits:"userSpaceOnUse"},ip().createElement("stop",{stopColor:"#FAFAFA",stopOpacity:.01}),ip().createElement("stop",{offset:1,stopColor:"#F4F4F4"})),ip().createElement("linearGradient",{id:"SelectAttributes_svg__paint1_linear_0_19219",x1:266.117,y1:181.111,x2:154.882,y2:77.681,gradientUnits:"userSpaceOnUse"},ip().createElement("stop",{stopOpacity:.01}),ip().createElement("stop",{offset:1})))),NO_DATA:e=>ip().createElement("svg",bE({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),ip().createElement("defs",null,ip().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"NoData_svg__b"},ip().createElement("stop",{stopColor:"#FAFAFA",stopOpacity:0,offset:"0%"}),ip().createElement("stop",{stopColor:"#F4F4F4",offset:"100%"})),ip().createElement("linearGradient",{x1:"69.573%",y1:"86.747%",x2:"38.144%",y2:"33.403%",id:"NoData_svg__d"},ip().createElement("stop",{stopColor:"#000",stopOpacity:0,offset:"0%"}),ip().createElement("stop",{stopColor:"#000",offset:"100%"})),ip().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"NoData_svg__e"},ip().createElement("stop",{stopColor:"#EEFBFF",offset:"0%"}),ip().createElement("stop",{stopColor:"#0072CE",offset:"100%"})),ip().createElement("filter",{x:"-7.7%",y:"-7.5%",width:"115.3%",height:"115%",filterUnits:"objectBoundingBox",id:"NoData_svg__f"},ip().createElement("feOffset",{dx:0,dy:2,in:"SourceAlpha",result:"shadowOffsetOuter1"}),ip().createElement("feGaussianBlur",{stdDeviation:2,in:"shadowOffsetOuter1",result:"shadowBlurOuter1"}),ip().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"}),ip().createElement("feMerge",null,ip().createElement("feMergeNode",{in:"shadowMatrixOuter1"}),ip().createElement("feMergeNode",{in:"SourceGraphic"}))),ip().createElement("circle",{id:"NoData_svg__a",cx:128,cy:128,r:128})),ip().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},ip().createElement("mask",{id:"NoData_svg__c",fill:"#fff"},ip().createElement("use",{xlinkHref:"#NoData_svg__a"})),ip().createElement("use",{fillOpacity:.1,fill:"#0072CE",xlinkHref:"#NoData_svg__a"}),ip().createElement("path",{fill:"url(#NoData_svg__b)",mask:"url(#NoData_svg__c)",d:"M0 9h256v247H0z"}),ip().createElement("g",{mask:"url(#NoData_svg__c)"},ip().createElement("g",{transform:"translate(29 37)"},ip().createElement("g",{opacity:.9,strokeWidth:1,fill:"#FFF"},ip().createElement("path",{fillOpacity:.8,opacity:.5,d:"M14.565 8h228.144v176.476H14.565z"}),ip().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"})),ip().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(19.986 42.105)"},ip().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:195.862,cy:5.013,rx:3.997,ry:4.01}),ip().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:181.872,cy:5.013,rx:3.997,ry:4.01}),ip().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"}),ip().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}),ip().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}),ip().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})),ip().createElement("rect",{fill:"#645F6D",opacity:.5,x:19.986,y:16.04,width:79.944,height:11.028,rx:5.514}),ip().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(19.986 80.2)"},ip().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:195.862,cy:5.013,rx:3.997,ry:4.01}),ip().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:181.872,cy:5.013,rx:3.997,ry:4.01}),ip().createElement("rect",{fill:"#E3EBF4",x:0,y:1.003,width:18.987,height:19.048,rx:9.493}),ip().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}),ip().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}),ip().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})),ip().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(19.986 118.296)"},ip().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:195.862,cy:5.013,rx:3.997,ry:4.01}),ip().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:181.872,cy:5.013,rx:3.997,ry:4.01}),ip().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"}),ip().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}),ip().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}),ip().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})))),ip().createElement("g",{mask:"url(#NoData_svg__c)"},ip().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)"}),ip().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)"}),ip().createElement("g",{filter:"url(#NoData_svg__f)",strokeWidth:1,fill:"none",transform:"translate(70 86)"},ip().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"}),ip().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"})),ip().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"}}),ip().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"}}),ip().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=>ip().createElement("svg",vE({width:88,height:88,viewBox:"0 0 88 88",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgError"},e),ip().createElement("mask",{id:"Error_svg__a",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:0,y:0,width:88,height:88},ip().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"})),ip().createElement("g",{mask:"url(#Error_svg__a)"},ip().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}),ip().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"}),ip().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"}),ip().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"}),ip().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"}),ip().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"}),ip().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"}),ip().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"}),ip().createElement("path",{d:"M21.036 40.178h-5.09a.636.636 0 000 1.272h5.09a.636.636 0 100-1.272z",fill:"#ACACAC"}),ip().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"}),ip().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"}),ip().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"}),ip().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"}),ip().createElement("path",{d:"M18.915 18.546a1.909 1.909 0 100-3.817 1.909 1.909 0 000 3.817z",fill:"#9C6CF0"}),ip().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"}),ip().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"}),ip().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"}),ip().createElement("path",{d:"M41.82 18.546a1.909 1.909 0 100-3.817 1.909 1.909 0 000 3.817z",fill:"#4DBEE9"}),ip().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"}),ip().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"}),ip().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"}),ip().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"}),ip().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"}),ip().createElement("path",{d:"M54.968 67.324h-5.09a.636.636 0 000 1.273h5.09a.636.636 0 000-1.273z",fill:"#E9E9E9"}),ip().createElement("g",{filter:"url(#Error_svg__filter0_d)"},ip().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"})),ip().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"}),ip().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"}),ip().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"}),ip().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"}),ip().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"}),ip().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)"}),ip().createElement("g",{filter:"url(#Error_svg__filter1_d)"},ip().createElement("path",{d:"M57.406 68.063a1.719 1.719 0 100-3.438 1.719 1.719 0 000 3.438z",fill:"#000"})),ip().createElement("path",{d:"M57.406 68.063a1.719 1.719 0 100-3.438 1.719 1.719 0 000 3.438z",fill:"#fff"}),ip().createElement("g",{filter:"url(#Error_svg__filter2_d)"},ip().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"})),ip().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"})),ip().createElement("defs",null,ip().createElement("filter",{id:"Error_svg__filter0_d",x:36.219,y:37.875,width:42.375,height:42.375,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},ip().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),ip().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"}),ip().createElement("feOffset",{dy:2}),ip().createElement("feGaussianBlur",{stdDeviation:2}),ip().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"}),ip().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),ip().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})),ip().createElement("filter",{id:"Error_svg__filter1_d",x:51.688,y:62.625,width:11.438,height:11.438,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},ip().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),ip().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"}),ip().createElement("feOffset",{dy:2}),ip().createElement("feGaussianBlur",{stdDeviation:2}),ip().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"}),ip().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),ip().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})),ip().createElement("filter",{id:"Error_svg__filter2_d",x:51.688,y:44.063,width:11.438,height:23.813,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},ip().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),ip().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"}),ip().createElement("feOffset",{dy:2}),ip().createElement("feGaussianBlur",{stdDeviation:2}),ip().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"}),ip().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),ip().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})),ip().createElement("linearGradient",{id:"Error_svg__paint0_linear",x1:68.438,y1:71.571,x2:60.119,y2:58.801,gradientUnits:"userSpaceOnUse"},ip().createElement("stop",{stopOpacity:0}),ip().createElement("stop",{offset:1})))),LOADING:e=>ip().createElement("svg",OE({width:256,height:256,viewBox:"0 0 256 256",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgEmptyLoading"},e),ip().createElement("circle",{cx:128,cy:128,r:128,fill:"#0072CE",fillOpacity:.03}),ip().createElement("mask",{id:"EmptyLoading_svg__a",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:0,y:0,width:256,height:256},ip().createElement("circle",{cx:128,cy:128,r:128,fill:"#fff"})),ip().createElement("g",{mask:"url(#EmptyLoading_svg__a)"},ip().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M-16 9h256v247H-16V9z",fill:"url(#EmptyLoading_svg__paint0_linear_2978_41880)"}),ip().createElement("g",{fillRule:"evenodd",clipRule:"evenodd"},ip().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"}),ip().createElement("path",{d:"M50.371 43.106h255.685V195.71H50.371V43.106z",fill:"url(#EmptyLoading_svg__paint1_linear_2978_41880)"}),ip().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"}),ip().createElement("path",{d:"M339.015 204.883v4.966H15v-4.966h324.015z",fill:"#D4DCDF"}),ip().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)"})),ip().createElement("g",{filter:"url(#EmptyLoading_svg__filter0_d_2978_41880)"},ip().createElement("rect",{x:81.703,y:99,width:170,height:26,rx:8,fill:"#D1E6FF"}),ip().createElement("rect",{x:84.703,y:102,width:164,height:20,rx:5,stroke:"#fff",strokeWidth:6})),ip().createElement("g",{filter:"url(#EmptyLoading_svg__filter1_d_2978_41880)"},ip().createElement("mask",{id:"EmptyLoading_svg__b",fill:"#fff"},ip().createElement("rect",{x:81,y:105,width:108,height:14,rx:2})),ip().createElement("rect",{x:81,y:105,width:108,height:14,rx:2,fill:"#61A3F1"}),ip().createElement("rect",{x:81,y:105,width:108,height:14,rx:2,stroke:"#4A90E2",strokeWidth:8,mask:"url(#EmptyLoading_svg__b)"})),ip().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"}),ip().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"}),ip().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"}),ip().createElement("g",{filter:"url(#EmptyLoading_svg__filter2_ddd_2978_41880)"},ip().createElement("path",{fill:"#A0C1D7",d:"M70.703 64h11v8h-11z"}),ip().createElement("rect",{x:62,y:59,width:28,height:8,rx:1,fill:"#BDD4E3"}),ip().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"}),ip().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"}),ip().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)"}),ip().createElement("circle",{cx:75.94,cy:123.237,r:44.723,fill:"#91B0C2"}),ip().createElement("g",{filter:"url(#EmptyLoading_svg__filter3_d_2978_41880)"},ip().createElement("circle",{r:42.793,transform:"matrix(-1 0 0 1 75.94 123.237)",fill:"#F7F4FF"})),ip().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)"}),ip().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)"}),ip().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"}),ip().createElement("circle",{cx:75.94,cy:123.237,r:2.896,fill:"#EEEBF6"}),ip().createElement("circle",{cx:96.211,cy:148.655,r:2.574,fill:"#A0C3D7"}),ip().createElement("circle",{cx:107.15,cy:131.924,r:2.574,fill:"#A0C3D7"}),ip().createElement("rect",{x:62.427,y:135.592,width:27.027,height:10.039,rx:3,fill:"#A0C3D7"}),ip().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)"}),ip().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)"}),ip().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)"}),ip().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)"}),ip().createElement("circle",{cx:75.618,cy:155.734,r:2.574,fill:"#A0C3D7"}),ip().createElement("circle",{cx:55.026,cy:148.655,r:2.574,fill:"#A0C3D7"}),ip().createElement("circle",{cx:44.73,cy:131.924,r:2.574,fill:"#A0C3D7"}),ip().createElement("g",{fill:"#A0C3D7"},ip().createElement("circle",{r:2.574,transform:"matrix(1 0 0 -1 96.21 97.363)"}),ip().createElement("circle",{r:2.574,transform:"matrix(1 0 0 -1 107.149 114.094)"}),ip().createElement("circle",{r:2.574,transform:"matrix(1 0 0 -1 75.618 90.284)"}),ip().createElement("circle",{r:2.574,transform:"matrix(1 0 0 -1 55.026 97.363)"}),ip().createElement("circle",{r:2.574,transform:"matrix(1 0 0 -1 44.73 114.094)"})))),ip().createElement("defs",null,ip().createElement("linearGradient",{id:"EmptyLoading_svg__paint0_linear_2978_41880",x1:-16,y1:9,x2:-16,y2:256,gradientUnits:"userSpaceOnUse"},ip().createElement("stop",{stopColor:"#FAFAFA",stopOpacity:.01}),ip().createElement("stop",{offset:1,stopColor:"#F4F4F4"})),ip().createElement("linearGradient",{id:"EmptyLoading_svg__paint1_linear_2978_41880",x1:178.214,y1:43.106,x2:178.214,y2:195.709,gradientUnits:"userSpaceOnUse"},ip().createElement("stop",{stopColor:"#F2F9FB"}),ip().createElement("stop",{offset:1,stopColor:"#fff"})),ip().createElement("linearGradient",{id:"EmptyLoading_svg__paint2_linear_2978_41880",x1:178.497,y1:204.542,x2:178.497,y2:213.991,gradientUnits:"userSpaceOnUse"},ip().createElement("stop",{stopColor:"#90AABF"}),ip().createElement("stop",{offset:1,stopColor:"#869DAE"})),ip().createElement("linearGradient",{id:"EmptyLoading_svg__paint3_linear_2978_41880",x1:154.275,y1:146.574,x2:96.683,y2:91.352,gradientUnits:"userSpaceOnUse"},ip().createElement("stop",{stopOpacity:.01}),ip().createElement("stop",{offset:1})),ip().createElement("linearGradient",{id:"EmptyLoading_svg__paint4_linear_2978_41880",x1:60.762,y1:143.327,x2:114.747,y2:176.019,gradientUnits:"userSpaceOnUse"},ip().createElement("stop",{stopOpacity:.87}),ip().createElement("stop",{offset:1,stopOpacity:.01})),ip().createElement("linearGradient",{id:"EmptyLoading_svg__paint6_linear_2978_41880",x1:90.287,y1:154.267,x2:68.53,y2:131.301,gradientUnits:"userSpaceOnUse"},ip().createElement("stop",{stopOpacity:.01}),ip().createElement("stop",{offset:1})),ip().createElement("linearGradient",{id:"EmptyLoading_svg__paint7_linear_2978_41880",x1:100.735,y1:120.288,x2:78.978,y2:97.322,gradientUnits:"userSpaceOnUse"},ip().createElement("stop",{stopOpacity:.01}),ip().createElement("stop",{offset:1})),ip().createElement("linearGradient",{id:"EmptyLoading_svg__paint8_linear_2978_41880",x1:121.119,y1:112.739,x2:99.362,y2:89.773,gradientUnits:"userSpaceOnUse"},ip().createElement("stop",{stopOpacity:.01}),ip().createElement("stop",{offset:1})),ip().createElement("linearGradient",{id:"EmptyLoading_svg__paint9_linear_2978_41880",x1:90.166,y1:136.143,x2:68.409,y2:113.177,gradientUnits:"userSpaceOnUse"},ip().createElement("stop",{stopOpacity:.01}),ip().createElement("stop",{offset:1})),ip().createElement("filter",{id:"EmptyLoading_svg__filter0_d_2978_41880",x:77.703,y:96,width:178,height:34,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},ip().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),ip().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"}),ip().createElement("feOffset",{dy:1}),ip().createElement("feGaussianBlur",{stdDeviation:2}),ip().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"}),ip().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_2978_41880"}),ip().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_2978_41880",result:"shape"})),ip().createElement("filter",{id:"EmptyLoading_svg__filter1_d_2978_41880",x:77,y:102,width:116,height:22,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},ip().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),ip().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"}),ip().createElement("feOffset",{dy:1}),ip().createElement("feGaussianBlur",{stdDeviation:2}),ip().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"}),ip().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_2978_41880"}),ip().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_2978_41880",result:"shape"})),ip().createElement("filter",{id:"EmptyLoading_svg__filter2_ddd_2978_41880",x:-13.297,y:28,width:181.534,height:189.17,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},ip().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),ip().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"}),ip().createElement("feMorphology",{radius:4,operator:"erode",in:"SourceAlpha",result:"effect1_dropShadow_2978_41880"}),ip().createElement("feOffset",{dy:7}),ip().createElement("feGaussianBlur",{stdDeviation:4}),ip().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"}),ip().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_2978_41880"}),ip().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"}),ip().createElement("feMorphology",{radius:4,operator:"dilate",in:"SourceAlpha",result:"effect2_dropShadow_2978_41880"}),ip().createElement("feOffset",{dy:5}),ip().createElement("feGaussianBlur",{stdDeviation:16}),ip().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"}),ip().createElement("feBlend",{mode:"normal",in2:"effect1_dropShadow_2978_41880",result:"effect2_dropShadow_2978_41880"}),ip().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"}),ip().createElement("feMorphology",{radius:2,operator:"dilate",in:"SourceAlpha",result:"effect3_dropShadow_2978_41880"}),ip().createElement("feOffset",{dy:12}),ip().createElement("feGaussianBlur",{stdDeviation:8.5}),ip().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"}),ip().createElement("feBlend",{mode:"normal",in2:"effect2_dropShadow_2978_41880",result:"effect3_dropShadow_2978_41880"}),ip().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect3_dropShadow_2978_41880",result:"shape"})),ip().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"},ip().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),ip().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"}),ip().createElement("feOffset",{dy:2}),ip().createElement("feGaussianBlur",{stdDeviation:2}),ip().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"}),ip().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_2978_41880"}),ip().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_2978_41880",result:"shape"})),ip().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)"},ip().createElement("stop",{stopColor:"#CFE8FF"}),ip().createElement("stop",{offset:.599,stopColor:"#D1F2F9",stopOpacity:0}))))},CE=({variant:e=SE.full,LogoRenderer:t=xE.SEARCH_RESULTS,text:r,secondaryText:n,buttonTitle:a,onClick:i=O.identity,access:o})=>{const l=TE(),s=o&&a;return ip().createElement("div",{className:up()(l.root,l[`root_${e}`])},ip().createElement(t,{className:l[`${e}`]}),ip().createElement("div",{className:l.textBox},ip().createElement(hf(),{variant:"h5",classes:{h5:l.text}},r),n&&ip().createElement(hf(),{variant:"subtitle1",classes:{subtitle1:l.secondaryText}},n)),s&&ip().createElement(Gh(),{className:l.button,variant:"contained",color:"primary",onClick:i},a))};var wE=r(15503);class AE extends ip().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 RE=(0,Sp.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 _E=r(46089),IE=r.n(_E);const NE=(0,Sp.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,xm.alpha)(e.palette.primary.main,.12),fill:e.palette.primary.main,color:e.palette.primary.main,"&:hover":{backgroundColor:(0,xm.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:{}}))),PE=(0,id.T)(Gh()),DE=({className:e,classes:t={},modes:r=[],modeId:n,onChange:a})=>{const i=NE();return ip().createElement(IE(),{className:e},r.map((({id:e,title:r,tooltipTitle:o,Icon:l,disabled:s})=>{return ip().createElement(PE,{disabled:s,showForDisabled:s&&!!o,key:String(e),className:up()(i.button,{[i.current]:n===e},t.button),tooltipTitle:o,onClick:(c=e,()=>a(c)),"data-reltio-id":`reltio-search-mode-${e}`},l&&ip().createElement(l,{className:i.icon}),r&&ip().createElement("div",{className:i.title},r));var c})))},kE=(0,Sp.Z)((()=>({button:{"&.MuiButtonGroup-grouped":{minWidth:"90px",padding:"8px 12px"}}})));function LE(){return LE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},LE.apply(null,arguments)}const UE=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return ip().createElement("svg",LE({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),ip().createElement("defs",null,ip().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"})),ip().createElement("g",{stroke:"none",strokeWidth:"1"},ip().createElement("g",{transform:"translate(.2)"},ip().createElement("mask",{id:"svg3365802068b",fill:"#fff"},ip().createElement("use",{xlinkHref:"#svg3365802068a"})),ip().createElement("g",{mask:"url(#svg3365802068b)"},ip().createElement("g",null,ip().createElement("g",null,ip().createElement("path",{d:"M0 0h24v24H0z"})))))))};function jE(){return jE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},jE.apply(null,arguments)}const FE=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return ip().createElement("svg",jE({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),ip().createElement("defs",null,ip().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"})),ip().createElement("g",{stroke:"none",strokeWidth:"1"},ip().createElement("g",{transform:"translate(.2)"},ip().createElement("mask",{id:"svg4195527304b",fill:"#fff"},ip().createElement("use",{xlinkHref:"#svg4195527304a"})),ip().createElement("g",{mask:"url(#svg4195527304b)"},ip().createElement("path",{d:"M0 0h24v24H0z"})))))},ME=e=>{switch(e){case B.ll.TABLE:return UE;case B.ll.LIST:return FE;default:return Kh()}},VE=[{id:B.ll.TABLE,tooltipTitle:ei().text("Table view"),title:ei().text("Table"),Icon:ME(B.ll.TABLE)},{id:B.ll.LIST,tooltipTitle:ei().text("List view"),title:ei().text("List"),Icon:ME(B.ll.LIST)}],BE=({className:e})=>{const t=kE(),r=(0,sp.useDispatch)(),n=(0,sp.useSelector)(Ti.XM);return ip().createElement(DE,{className:e,classes:{button:t.button},modes:VE,modeId:n,onChange:e=>{n!==e&&r((e=>({type:ve,payload:e}))(e))}})};BE.propTypes={className:lp().string};const zE=BE;var HE=r(81085),YE=r.n(HE),WE=r(48139),GE=r.n(WE);const qE="DATA_TENANTS_UPDATED",ZE=e=>t=>({type:e,payload:t}),$E=(ZE(qE),(e=null,t)=>t.type===qE?t.payload||null:e),KE="TENANTS_UPDATED",XE=(ZE(KE),(e=null,t)=>t.type===KE?t.payload||null:e);let QE=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 JE(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const eb={},tb=(0,O.pipe)(v.normalizeMetadata,v.parseMetadata,v.localizeMetadata),rb=(0,O.map)(v.localizeMetadata),nb=(e=eb,t)=>{switch(t.type){case"METADATA_LOADED":{const{tenant:r,metadata:n}=t.payload;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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){JE(e,t,r[t])}))}return e}({},e,{[r]:tb(n)})}case QE.LOCALIZATION_LOADED:return rb(e);default:return e}};let ab=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.CANCEL_PROFILE_VALIDATION="CANCEL_PROFILE_VALIDATION",e.PROFILE_SAVED="PROFILE_SAVED",e.RUN_AUTHORING_TASK_ACTION="RUN_AUTHORING_TASK_ACTION",e}({});const ib=ZE(ab.ADD_ATTRIBUTES),ob=ZE(ab.ADD_DEFAULT_VALUES),lb=ZE(ab.MODIFY_ATTRIBUTE),sb=ZE(ab.REMOVE_ATTRIBUTE),cb=ZE(ab.ADD_NEXT_PAGE_ATTRIBUTE_VALUES),ub=ZE(ab.PROCESS_NEXT_PAGE_ATTRIBUTE_VALUES),pb=ZE(ab.REQUEST_NEXT_PAGE_ATTRIBUTE_VALUES),db=ZE(ab.SAVE_PROFILE),mb=ZE(ab.RUN_AUTHORING_TASK_ACTION),fb=ZE(ab.SAVE_DRAFT),yb=ZE(ab.PROFILE_SAVED),gb=ZE(ab.VALIDATE_PROFILE),hb=ZE(ab.CANCEL_PROFILE_VALIDATION);let Eb=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 bb=ZE(Eb.DEPENDENT_LOOKUPS_STRUCTURE_SET),vb=ZE(Eb.DEPENDENT_LOOKUPS_INITED_TYPE_URIS_ADDED),Tb=ZE(Eb.DEPENDENT_LOOKUPS_EDITORS_BLOCKED),Ob=ZE(Eb.DEPENDENT_LOOKUPS_EDITOR_TOUCHED);let Sb=function(e){return e.MODE_UPDATED="MODE_UPDATED",e.MODE_EDITING_CANCELED="MODE_EDITING_CANCELED",e.MODE_UPDATE_REQUESTED="MODE_UPDATE_REQUESTED",e}({});function xb(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Cb(e,t,r[t])}))}return e}function Cb(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const wb={structure:{},editors:{},initedTypeUris:[]},Ab="SEARCH_RESULTS_SET",Rb="KEYWORD_UPDATED",_b="UPDATE_STATE",Ib="ACTIVITY_FILTER_UPDATED",Nb="GLOBAL_FILTER_UPDATED",Pb="SEARCH_OPTIONS_UPDATED",Db="SET_SEARCH_OPTIONS_CONFIG",kb="SET_SEARCH_PROVIDER_DATA",Lb="SET_SEARCH_NAVIGATION_DATA",Ub="UPDATE_SEARCH_NAVIGATION_DATA_FIELDS",jb=ZE(Ab),Fb=ZE(Rb),Mb=ZE(_b),Vb=ZE("SAVE_STATE"),Bb=ZE(Ib),zb=ZE(Nb),Hb=ZE(Pb),Yb=ZE(Db),Wb=ZE(kb),Gb=ZE(Lb),qb=ZE(Ub),Zb=ZE("UPDATE_SEARCH_NAVIGATION_DATA_ON_MERGE"),$b=(0,O.path)(["globalFilter","savedSearchesUris"]),Kb="searchNavigation";function*Xb(){const e=yield(0,Ra.Ys)(uI.selectors.getSearchNavigationData),t=yield(0,Ra.Ys)(uI.selectors.getSearchProviderData);sessionStorage.setItem(Kb,JSON.stringify({searchNavigationData:e,searchProviderData:t}))}function*Qb(){let e;try{e=JSON.parse(sessionStorage.getItem(Kb))||{}}catch(t){e={}}const{searchNavigationData:t,searchProviderData:r}=e;t&&r&&(yield(0,Ra.gz)(Wb(r)),yield(0,Ra.gz)(Gb(t)))}const Jb=[function*(){yield(0,Ra.Fm)([Lb,Ub,QE.OPEN_ENTITY],Xb)},function*(){yield(0,Ra.RE)(Qb)}];function ev(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.push.apply(n,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=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const rv={searchResults:[],keyword:null,searchOptions:{searchByOv:!1,ovOnly:!1},activityFilter:"active",globalFilter:{query:null,savedSearchesUris:[],isMuted:!0},searchProviderData:null,searchNavigationData:null},nv=(e=rv,t)=>{switch(t.type){case Ab:return ev({},e,{searchResults:t.payload});case Rb:{const r=(0,O.pick)(["value","isRawFilter"],t.payload||{});return ev({},e,{keyword:(0,O.isEmpty)(r)?null:r})}case _b:return ev({},rv,{keyword:(0,O.isNil)(t.payload.keyword)||(0,O.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 Ib:return ev({},e,{activityFilter:t.payload});case Nb:return ev({},e,{globalFilter:(0,v.isEmptyValue)(t.payload)?rv.globalFilter:t.payload});case Pb:return ev({},e,{searchOptions:ev({},e.searchOptions,t.payload)});case Db:{const r=!!t.payload.showSearchByOv;return ev({},e,{searchOptions:{searchByOv:r,ovOnly:r}})}case kb:return ev({},e,{searchProviderData:t.payload});case Lb:return ev({},e,{searchNavigationData:t.payload});case Ub:return ev({},e,{searchNavigationData:ev({},e.searchNavigationData,t.payload)});case QE.OPEN_ENTITY:{var r;const n=(0,v.removeDtssPrefixFromEntityUri)(t.payload.uri);return"navigation"===t.payload.source||n===(null===(r=e.searchNavigationData)||void 0===r?void 0:r.uri)?e:ev({},e,{searchNavigationData:null})}default:return e}},av=({uri:e,source:t=null,screen:r="profile"})=>({type:QE.OPEN_ENTITY,payload:{uri:e,source:t,screen:r}}),iv=({entity:e})=>({type:QE.NEW_ENTITY_SHOWN,payload:{entity:e}}),ov=ZE(QE.ENTITY_DELETION_FINISHED),lv=ZE(QE.OPEN_PERSPECTIVE),sv=e=>({type:QE.SHOW_NOTIFICATION,payload:e}),cv=e=>({type:QE.CLOSE_NOTIFICATION,payload:e}),uv=ZE(QE.CLEAR_NOTIFICATIONS),pv=ZE(QE.PATHS_SET),dv=ZE(QE.UI_PATH_SET),mv=ZE(QE.UI_CONFIG_LOADED),fv=ZE(QE.NEW_UI_CONFIG_LOADED),yv=ZE(QE.LOCALE_ATTRIBUTE_PRESENTATION_LOADED),gv=ZE(QE.AUTOCLOSE_INTERVAL_LOADED),hv=ZE(QE.SET_PREFER_REACT),Ev=ZE(QE.NUMBER_FORMAT_UPDATED),bv=(e,t,r)=>({type:QE.OPEN_CONSOLE_APP,payload:{name:e,path:t,query:r}}),vv=ZE(QE.OPEN_APP_FROM_CHOCOLATE_BAR),Tv=ZE(QE.OPEN_GRAPH),Ov=ZE(QE.LOCALIZATION_LOADED),Sv=ZE(QE.DATE_MASK_UPDATED),xv=ZE(QE.DATE_TIME_MASK_UPDATED),Cv=e=>({type:QE.OPEN_SEARCH,payload:"searchState"in e?e:{searchState:e}}),wv=e=>({type:QE.OPEN_DASHBOARD,payload:e}),Av=ZE(QE.OPEN_HISTORY_EVENT),Rv=ZE(QE.OPEN_NEW_ENTITY_WITH_AUTHORING),_v=ZE(QE.OPEN_PREVIOUS_PAGE),Iv=ZE(QE.NAVIGATE),Nv=ZE(QE.KEYS_SET),Pv=ZE(QE.OPEN_PIVOTING_PERSPECTIVE),Dv=ZE(QE.ERROR_SET),kv=ZE(QE.DOCUMENTATION_SET),Lv=ZE(QE.ADD_DASHBOARD_EXTERNAL_VIEW),Uv=ZE(QE.SET_USE_SHARED_PREFERENCES);var jv=r(97698);function Fv(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Mv=(0,O.path)(["paths","imagePath"]),Vv=(0,O.path)(["paths","exportPath"]),Bv=(0,O.path)(["paths","apiPath"]),zv=(0,O.path)(["paths","uiPath"]),Hv=(0,O.path)(["paths","reltioPath"]),Yv=(0,O.path)(["paths","dtssPath"]),Wv=(0,O.path)(["paths","exportDQPath"]),Gv=(0,O.either)((0,O.path)(["newConfig","properties","workflow","path"]),(0,O.path)(["paths","workflowPath"])),qv=(0,O.prop)("paths"),Zv=(0,O.path)(["paths","workflowEnvironmentURL"]),$v=(0,O.path)(["paths","collaborationPath"]),Kv=(0,O.path)(["paths","imageServicePath"]),Xv=(0,O.path)(["paths","dvfPath"]),Qv=(0,O.path)(["paths","validationServicePath"]),Jv=(0,O.path)(["paths","adminToolsPath"]),eT=(0,O.path)(["paths","mlDqPath"]),tT=(0,jv.createSelector)((e=>(0,O.path)(["newConfig","properties","attributes","presentation"])(e)),(()=>v.intl.getLocale()),((e={},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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Fv(e,t,r[t])}))}return e}({},e,(0,v.getSpecialAttributesPresentation)(e,t)))),rT=(0,O.either)((0,O.path)(["config","com.reltio.plugins.entity.EntityRequestSettings","defaultMaxValues"]),(0,O.path)(["newConfig","properties","entity","maxValuesInResponse"])),nT=(0,O.path)(["numberFormat"]),aT=(0,O.either)((0,O.path)(["newConfig","properties","masks","dateMask"]),(0,O.path)(["dateMask"])),iT=(0,O.path)(["notifications"]),oT=(0,O.either)((0,O.path)(["newConfig","properties","masks","dateTimeMask"]),(0,O.path)(["dateTimeMask"])),lT=(0,O.path)(["newConfig","properties","requestProvider"]),sT=["config","com.reltio.plugins.pivoting.PivotingSettings","pivotingAttributes"],cT=(0,O.chain)((0,O.prop)("attributeTypes")),uT=(0,O.ifElse)((0,O.hasPath)(sT),(0,O.path)(sT),(0,O.pipe)((0,O.pathOr)([],["newConfig","pivoting"]),cT)),pT=(0,O.either)((0,O.path)(["config","com.reltio.plugins.imageattribute.fieldsorder"]),(0,O.path)(["newConfig","properties","image","attributeFieldsOrder"])),dT=(0,O.either)((0,O.path)(["config","com.reltio.plugins.ui.LookupAutocomplete"]),(0,O.path)(["newConfig","properties","lookups","autocomplete"])),mT=(0,O.path)(["keys","googleMapKey"]),fT=(0,O.path)(["keys","icpLicenseKey"]),yT=(0,O.pathOr)("",["documentation","releaseNotes"]),gT=["config","com.reltio.plugins.entity.ValidationServiceLevels","levels"],hT=(0,O.ifElse)((0,O.hasPath)(gT),(0,O.path)(gT),(0,O.path)(["newConfig","properties","validation","levels"])),ET=(0,O.ifElse)((0,O.hasPath)(["config","com.reltio.plugins.entity.Validation","validateReadMode"]),(0,O.path)(["config","com.reltio.plugins.entity.Validation","validateReadMode"]),(0,O.pathOr)(!0,["newConfig","properties","validation","validateReadMode"])),bT=(0,O.pathOr)(!1,["newConfig","properties","validation","validateRelations"]),vT=(0,O.pathOr)(!1,["newConfig","properties","validation","validateReferenceEntityInReadMode"]),TT=(0,O.either)((0,O.path)(["config","com.reltio.plugins.workflow.configuration","enabled"]),(0,O.path)(["newConfig","properties","workflow","enabled"])),OT=(0,O.path)(["error"]),ST=(0,O.path)(["paths","servicesPath"]),xT=(0,O.path)(["newConfig"]),CT=(0,O.path)(["newConfig","layout"]),wT=(0,O.path)(["newConfig","profile"]),AT=(0,O.pathOr)(!0,["newConfig","properties","showEntityId"]),RT=(0,O.path)(["newConfig","properties","release"]),_T=(0,O.path)(["newConfig","properties","logo"]),IT=(0,O.path)(["newConfig","properties","headerColor"]),NT=(0,O.path)(["newConfig","properties","showSearchByOv"]),PT=(0,O.path)(["newConfig","properties","showAttributeDescription"]),DT=(0,O.path)(["newConfig","properties","attributes","sorting"]),kT=(0,O.path)(["newConfig","properties","profileCheckUpdate"]),LT=(0,O.pathOr)(!1,["newConfig","properties","newTreeEnabled"]),UT=(0,O.pathOr)(!1,["newConfig","properties","aiAssistant","enabled"]),jT=(0,O.pathOr)(500,["newConfig","properties","aiAssistant","messagesPerDay"]),FT=(0,O.path)(["newConfig","properties","aiAssistant","skills"]),MT=(0,O.path)(["newConfig","properties","aiAssistant","historyBufferSize"]),VT=(0,O.pathOr)(!1,["newConfig","properties","queryEstimator","enabled"]),BT=(0,O.pathOr)(!1,["newConfig","properties","sharedPreferences","enabled"]);function zT(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){HT(e,t,r[t])}))}return e}function HT(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const YT={},WT=(e=YT,t)=>{switch(t.type){case QE.PATHS_SET:return zT({},e,{paths:t.payload});case QE.UI_PATH_SET:return(0,O.evolve)({paths:(0,O.assoc)("uiPath",t.payload)},e);case QE.UI_CONFIG_LOADED:return zT({},e,{config:t.payload});case QE.NEW_UI_CONFIG_LOADED:return zT({},e,{newConfig:t.payload});case QE.LOCALE_ATTRIBUTE_PRESENTATION_LOADED:return(0,O.evolve)({newConfig:{properties:{attributes:{presentation:(0,O.assoc)(v.LOCALE_ATTRIBUTE_PRESENTATION,t.payload)}}}},e);case QE.AUTOCLOSE_INTERVAL_LOADED:return zT({},e,{autoCloseInterval:t.payload});case QE.NUMBER_FORMAT_UPDATED:return zT({},e,{numberFormat:t.payload});case QE.DATE_MASK_UPDATED:return zT({},e,{dateMask:t.payload});case QE.DATE_TIME_MASK_UPDATED:return zT({},e,{dateTimeMask:t.payload});case QE.KEYS_SET:return zT({},e,{keys:t.payload});case QE.ERROR_SET:return zT({},e,{error:t.payload});case QE.DOCUMENTATION_SET:return zT({},e,{documentation:t.payload});case QE.SHOW_NOTIFICATION:return zT({},e,{notifications:[...e.notifications||[],t.payload]});case QE.CLOSE_NOTIFICATION:return(0,O.evolve)({notifications:(0,O.reject)((0,O.propEq)("id",t.payload))},e);case QE.CLEAR_NOTIFICATIONS:return zT({},e,{notifications:[]});case QE.SET_USE_SHARED_PREFERENCES:return zT({},e,{useSharedPreferences:t.payload});default:return e}},GT="USER_UPDATED",qT=(ZE(GT),(e=null,t)=>t.type===GT?t.payload||null:e),ZT="TENANT_UPDATED",$T="TENANT_NAME_UPDATED",KT=(ZE(ZT),ZE($T),(0,O.prop)("id")),XT=(0,O.prop)("name");function QT(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){JT(e,t,r[t])}))}return e}function JT(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const eO=(e=null,t)=>{switch(t.type){case ZT:return QT({},e,{id:t.payload});case $T:return QT({},e,{name:t.payload});default:return e}},tO="ENVIRONMENT_UPDATED",rO="ENVIRONMENT_ALIAS_UPDATED",nO=(ZE(tO),ZE(rO),(0,O.prop)("id")),aO=(0,O.prop)("alias");function iO(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){oO(e,t,r[t])}))}return e}function oO(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const lO=(e=null,t)=>{switch(t.type){case tO:return iO({},e,{id:t.payload});case rO:return iO({},e,{alias:t.payload});default:return e}},sO=e=>e.dataTenants,cO=e=>e.tenants,uO=(e,t=ex(e))=>e.metadata&&e.metadata[t],pO=e=>e.tenant,dO=e=>e.environment,mO=e=>e.user,fO=e=>e.ui,yO=e=>e.profile,gO=e=>e.search,hO=e=>QA(yO(e)),EO=e=>mR(yO(e)),bO=e=>fR(yO(e)),vO=(e,t)=>OR(yO(e),t),TO=(e,t,r)=>bR(yO(e),t,r),OO=(e,t,r)=>vR(yO(e),t,r),SO=(e,t,r)=>ER(yO(e),t,r),xO=(e,t)=>SR(yO(e),t),CO=e=>xR(yO(e)),wO=(e,t,r)=>TR(yO(e),t,r),AO=e=>nR(yO(e)),RO=e=>eR(yO(e)),_O=e=>hR(yO(e)),IO=e=>$R(yO(e)),NO=e=>KR(yO(e)),PO=e=>XR(yO(e)),DO=e=>QR(yO(e)),kO=e=>JR(yO(e)),LO=(e,t)=>yR(yO(e),t),UO=(e,t)=>gR(yO(e),t),jO=e=>JA(yO(e)),FO=(e,t)=>e_(yO(e),t),MO=(e,t,{uri:r})=>LR(yO(e),t,r),VO=(e,t,{uri:r})=>UR(yO(e),t,r),BO=(e,t,r)=>jR(yO(e),t,r),zO=e=>Mv(fO(e)),HO=e=>Bv(fO(e)),YO=e=>Vv(fO(e)),WO=e=>zv(fO(e)),GO=e=>Hv(fO(e)),qO=e=>Kv(fO(e)),ZO=e=>Jv(fO(e)),$O=e=>tT(fO(e)),KO=e=>nT(fO(e)),XO=e=>rT(fO(e)),QO=e=>(e=>e.autoCloseInterval)(fO(e)),JO=e=>aT(fO(e)),eS=e=>oT(fO(e)),tS=e=>lT(fO(e)),rS=e=>iT(fO(e)),nS=e=>uT(fO(e)),aS=e=>pT(fO(e)),iS=e=>dT(fO(e)),oS=e=>mT(fO(e)),lS=e=>fT(fO(e)),sS=e=>hT(fO(e)),cS=e=>ET(fO(e)),uS=e=>bT(fO(e)),pS=e=>vT(fO(e)),dS=e=>UT(fO(e)),mS=e=>jT(fO(e)),fS=e=>FT(fO(e)),yS=e=>MT(fO(e)),gS=e=>BT(fO(e)),hS=e=>(e=>e.searchResults)(gO(e)),ES=e=>(e=>e.keyword)(gO(e)),bS=e=>v.getActivityFilter(gO(e)),vS=e=>v.getSearchOptions(gO(e)),TS=e=>(e=>e.searchProviderData)(gO(e)),OS=e=>(e=>e.searchNavigationData)(gO(e)),SS=(e,t)=>v.getGlobalSearchRequestOptions(gO(e),t),xS=e=>v.getStringifiedSearchOptions(gO(e)),CS=e=>(e=>e.globalFilter)(gO(e)),wS=e=>v.getGlobalFilterQuery(gO(e)),AS=e=>$b(gO(e)),RS=e=>iR(yO(e)),_S=e=>CR(yO(e)),IS=e=>wR(yO(e)),NS=e=>AR(yO(e)),PS=e=>tR(yO(e)),DS=(e,t)=>RR(yO(e),t),kS=(e,t)=>_R(yO(e),t),LS=(e,t)=>IR(yO(e),t),US=(e,t,r)=>NR(yO(e),t,r),jS=(e,t,r)=>PR(yO(e),t,r),FS=(e,t,r)=>DR(yO(e),t,r),MS=(e,t)=>kR(yO(e),t),VS=e=>Mv(fO(e))||Bv(fO(e)),BS=e=>(e=>null==e?void 0:e.username)(mO(e)),zS=e=>(e=>null==e?void 0:e.roles)(mO(e)),HS=e=>rR(yO(e)),YS=(e,t)=>FR(yO(e),t),WS=(e,t)=>MR(yO(e),t),GS=(e,t)=>VR(yO(e),t),qS=e=>BR(yO(e)),ZS=(e,t,r)=>zR(yO(e),t,r),$S=(e,t)=>HR(yO(e),t),KS=e=>oR(yO(e)),XS=e=>sR(yO(e)),QS=e=>cR(yO(e)),JS=e=>i_(yO(e),SC(e)),ex=e=>KT(pO(e)),tx=e=>XT(pO(e)),rx=e=>nO(dO(e)),nx=e=>aO(dO(e)),ax=e=>Yv(fO(e)),ix=e=>Wv(fO(e)),ox=e=>Gv(fO(e)),lx=e=>qv(fO(e)),sx=e=>Zv(fO(e)),cx=e=>TT(fO(e)),ux=e=>$v(fO(e)),px=e=>Xv(fO(e)),dx=e=>Qv(fO(e)),mx=e=>eT(fO(e)),fx=(0,jv.createSelector)(mO,ex,v.canUserRegisterConfigEnvironments),yx=(0,jv.createSelector)(mO,ex,v.canUserCreateWorkflowConfigJar),gx=(0,jv.createSelector)(mO,ex,v.canUserCreateWorkflowEnvironmentConfigJar),hx=(0,jv.createSelector)(mO,ex,v.canUserExecuteWorkflowJobs),Ex=(0,jv.createSelector)(mO,ex,v.canUserExecuteWorkflowJobsSyncBusinessProcessData),bx=(0,jv.createSelector)(mO,ex,v.canUserExecuteWorkflowJobsTerminateProcessInstance),vx=(0,jv.createSelector)(mO,ex,v.canUserExecuteWorkflowJobsUpdateTasks),Tx=(0,jv.createSelector)(mO,ex,v.canUserExecuteWorkflowJobsValidateTasks),Ox=(0,jv.createSelector)(mO,ex,v.canUserManageWorkflowDefinition),Sx=(0,jv.createSelector)(mO,ex,v.canUserManageWorkflowEnvironmentDefinition),xx=(0,jv.createSelector)(mO,ex,v.canUserReadWorkflowDataTask),Cx=(0,jv.createSelector)(mO,ex,v.canUserUpdateProcessInstance),wx=(0,jv.createSelector)(mO,ex,v.canUserUpdateWorkflowDataTask),Ax=(0,jv.createSelector)(mO,ex,v.canUserViewProcessInstanceSearchQuery),Rx=(0,jv.createSelector)(mO,ex,v.canUserViewWorkflowConfigJar),_x=(0,jv.createSelector)(mO,ex,v.canUserViewWorkflowDefinition),Ix=(0,jv.createSelector)(mO,ex,v.canUserViewWorkflowEnvironmentConfigJar),Nx=(0,jv.createSelector)(mO,ex,v.canUserViewWorkflowJobs),Px=(0,jv.createSelector)(mO,ex,v.canUserMakeExport),Dx=(0,jv.createSelector)(mO,ex,v.canUserMakeActivitiesExport),kx=(0,jv.createSelector)(mO,ex,v.canUserImportEntitiesFromDT),Lx=(0,jv.createSelector)(mO,ex,v.canUserReadEntitiesFromDT),Ux=(0,jv.createSelector)(mO,ex,v.canUserStartProcessInstanceFromQuery),jx=(0,jv.createSelector)(mO,ex,v.canUserMakeBulkUpdate),Fx=(0,jv.createSelector)(mO,ex,v.canUserDeleteProfiles),Mx=(0,jv.createSelector)(mO,ex,v.canUserOpenDataLoader),Vx=(0,jv.createSelector)(mO,ex,v.canUserGetDQStatistic),Bx=(0,jv.createSelector)(mO,ex,v.canUserReadDVF),zx=(0,jv.createSelector)(ux,DO,((e,t)=>!!e&&!t)),Hx=(0,jv.createSelector)(ox,cx,((e,t)=>!!e&&!!t)),Yx=(e,t)=>{var r;return null===(r=uR(yO(e)))||void 0===r?void 0:r.find((0,O.propEq)("id",t))},Wx=(e,t)=>Boolean(Yx(e,t)),Gx=e=>Wx(e,v.SidePanelViewId.Workflow),qx=e=>Wx(e,v.SidePanelViewId.Discussion),Zx=e=>Wx(e,v.SidePanelViewId.History),$x=e=>Wx(e,v.SidePanelViewId.DB),Kx=e=>{var t;return(null===(t=Yx(e,v.SidePanelViewId.DB))||void 0===t?void 0:t.views)??[]},Xx=e=>aR(yO(e)),Qx=e=>YR(yO(e)),Jx=(e,t)=>WR(yO(e),t),eC=e=>GR(yO(e)),tC=e=>qR(yO(e)),rC=(e,t)=>ZR(yO(e),t),nC=e=>OT(fO(e)),aC=(e,t)=>{const r=uO(e),n=RS(e),a=hO(e),{nextEntry:i,inRelations:o=[],outRelations:l=[]}=t,s=n===v.Mode.Editing||n===v.Mode.Suggesting,c=n===v.Mode.Suggesting&&(0,v.isTempUri)(null==a?void 0:a.uri),u=SC(e);if(!s||c&&!u||i||!a)return!1;{const e=(0,v.checkMetadataForUpdate)(n,(0,v.getEntityType)(r,a.type)),t=o.concat(l).map((e=>(0,v.getRelationType)(r,e.uri||e))).some((0,O.both)((0,v.checkMetadataForCreate)(n),(0,v.checkMetadataForUpdate)(n)));return e&&t}},iC=(0,jv.createSelector)(hO,IS,PO,IO,v.getProfileEntityWithHistoryDiff),oC=(0,jv.createSelector)(hO,IS,PO,v.getProfileEntityWithoutHistoryDiff),lC=e=>ST(fO(e)),sC=e=>xT(fO(e)),cC=e=>CT(fO(e)),uC=e=>wT(fO(e)),pC=e=>AT(fO(e)),dC=e=>RT(fO(e)),mC=e=>yT(fO(e)),fC=e=>_T(fO(e)),yC=e=>IT(fO(e)),gC=e=>NT(fO(e)),hC=e=>PT(fO(e)),EC=e=>DT(fO(e)),bC=e=>kT(fO(e)),vC=(e,t)=>((e,t)=>(0,v.getAuthoringItemsFromLayoutByEntityType)(wT(e),t))(fO(e),t),TC=(e,t)=>((e,t)=>(0,O.path)(["newConfig","properties","cleanse",t])(e))(fO(e),t),OC=e=>LT(fO(e)),SC=e=>{const t=hO(e),r=vC(e,null==t?void 0:t.type);return!(0,v.isEmptyValue)(r)},xC=e=>VT(fO(e)),CC=e=>pR(yO(e)),wC=e=>dR(yO(e)),AC=(e,t)=>Hx(e)&&Ux(e)&&(0,v.checkMetadataPermission)(v.MetadataPermissions.INITIATE_CHANGE_REQUEST,t);let RC=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}({}),_C=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.UPDATE_RELATION_RATING="UPDATE_RELATION_RATING",e}({});var IC=r(51095);const NC=(e,t)=>e.find((0,O.pipe)(v.getRelationUriFromConnection,(0,O.equals)(t))),PC=(e,t)=>(0,O.path)([t,"connections"],e),DC=r.n(IC)()(PC,((e,t)=>(0,O.path)([t,"drafts"],e)),((e,t,r)=>r),((e=[],t={},r)=>{var n;const{addedConnections:a=[],editedConnections:i=[],removedUris:o=[],ignoredRelationData:l=[]}=t,s=(0,O.pipe)(v.getRelationUriFromConnection,O.equals,(0,O.find)(O.__,o)),c=l.map((e=>e.relationUri)),u=(0,O.pipe)(v.getRelationUriFromConnection,O.equals,(0,O.find)(O.__,c)),p=r?(null===(n=e.find((e=>e.entity.entityUri===r)))||void 0===n?void 0:n.connections)||[]:e,d=a.filter((0,O.propEq)("parentEntityUri",r));return d.map(v.markNew).concat(p.filter((e=>!d.some((0,O.pipe)(v.getRelationUriFromConnection,(0,O.equals)((0,v.getRelationUriFromConnection)(e)))))).map((0,O.pipe)((0,O.either)((e=>(0,O.pipe)((0,O.eqBy)(v.getRelationUriFromConnection),(0,O.find)(O.__,i),(0,O.unless)(O.isNil,v.markEdited))(e)),O.identity),(0,O.when)(s,v.markRemoved),(0,O.when)(u,v.markIgnored))))}))(((e,t,r)=>t+r)),kC=(e,t,r)=>{const n=(0,v.getTempRelations)(e,t);return NC(n,r)};function*LC(e){yield(0,Ra.gw)(0);const t=e.payload,r=yield(0,Ra.Ys)(uO),n=yield(0,Ra.Ys)(Qx),a=[t.type],i=yield(0,Ra.Ys)(eC),o=(0,v.initDependentLookups)({structure:n,metadata:r,typeUris:a,alreadyAddedTypeUris:i}),l=(0,v.populateDependentLookupsFromEntity)({structure:o,metadata:r,entityOrRelation:t});yield(0,Ra.gz)(bb(l)),yield(0,Ra.gz)(vb(a))}function*UC(e,t){const r=(0,v.getBaseUri)(e);return(0,v.isRelationUri)(r)?yield(0,Ra.Ys)(OO,t,r):yield(0,Ra.Ys)(LO,r)}function*jC(e){const{attributeType:t,metadata:r,parentUri:n,viewId:a}=e.payload,i=yield(0,Ra.RE)(UC,n,a),o=yield(0,Ra.Ys)(Qx);if(i)if(t){const e=(0,v.findAttributeValuesByTypeUri)(r,i,t.uri).filter((({uri:e})=>e.startsWith(n)))[0],a=(0,v.addValueToDependentLookups)({structure:o,attributeValue:e});yield(0,Ra.gz)(bb(a))}else{const e=[i.type],t=yield(0,Ra.Ys)(eC),n=(0,v.initDependentLookups)({structure:o,metadata:r,typeUris:e,alreadyAddedTypeUris:t}),a=(0,v.populateDependentLookupsFromEntity)({structure:n,metadata:r,entityOrRelation:i});yield(0,Ra.gz)(bb(a)),yield(0,Ra.gz)(vb(e))}}function*FC(e){const t=e.payload,r=yield(0,Ra.Ys)(uO),n=yield(0,Ra.Ys)(Qx);let a=n;for(const e of t){const{attributeType:t,parentUri:i,viewId:o}=e;if((0,v.isAttributeTypeInDependentLookups)(n,t.uri)){const e=yield(0,Ra.RE)(UC,i,o);e&&(a=(0,v.syncAttributeTypeWithDependentLookups)({structure:a,entityOrRelation:e,attrTypeUri:t.uri,metadata:r}))}}a!==n&&(yield(0,Ra.gz)(bb(a)))}function*MC({structure:e,attributeType:t,value:r}){if((0,v.isReference)(t)&&r){const t=(0,v.getReferencedEntityUriFromAttrValue)(r);if((0,v.isTempUri)(t))return yield(0,Ra.RE)(HC,e,t)}return e}function*VC({structure:e,uri:t,attributeType:r,value:n}){let a=(0,v.removeValuesFromDependentLookups)({structure:e,uri:t});if(a=yield(0,Ra.RE)(MC,{structure:a,attributeType:r,value:n}),a=(0,v.addValueToDependentLookups)({structure:a,attributeValue:n}),(0,v.isReference)(r)&&n){const e=(0,v.getReferencedEntityUriFromAttrValue)(n);(0,v.isTempUri)(e)&&(a=yield(0,Ra.RE)(zC,a,e))}a!==e&&(yield(0,Ra.gz)(bb(a)))}function*BC(e){yield(0,Ra.gw)(0);const{attributeType:t,uri:r,viewId:n,silent:a,value:i}=e.payload,o=yield(0,Ra.Ys)(Qx),l=yield(0,Ra.RE)(UC,r,n);if(l&&(0,v.isAttributeTypeInDependentLookups)(o,t.uri)){const{value:n,lookupCode:i}=e.payload.value,l=i||n;a||(yield(0,Ra.rM)(GC,o,{type:t.uri,uri:r,lookupValue:l}));const s=(0,v.addValueToDependentLookups)({structure:o,attributeValue:{type:t.uri,value:l,uri:r}});yield(0,Ra.gz)(bb(s))}l&&(0,v.isComplexAttribute)(t.type)&&(yield(0,Ra.RE)(VC,{structure:o,uri:r,attributeType:t,value:i}))}function*zC(e,t){const r=yield(0,Ra.Ys)(uO),n=yield(0,Ra.Ys)(LO,t);if(!n)return e;const a=yield(0,Ra.Ys)(jO),i=(0,v.findRelatedTemporaryEntities)(a,n);let o=e;for(const e of[n,...i])o=(0,v.populateDependentLookupsFromEntity)({structure:o,metadata:r,entityOrRelation:e});return o}function*HC(e,t){const r=yield(0,Ra.Ys)(LO,t),n=yield(0,Ra.Ys)(jO),a=(0,v.findRelatedTemporaryEntities)(n,r).map((0,O.prop)("uri"));let i=e;for(const e of[t,...a])i=(0,v.removeValuesFromDependentLookups)({structure:i,uri:e});return i}function*YC(e){const{attributeType:t,uri:r,attributeValue:n,viewId:a}=e.payload,i=yield(0,Ra.Ys)(Qx),o=(0,v.isAttributeTypeInDependentLookups)(i,t.uri);if(yield(0,Ra.RE)(UC,r,a)){o&&(yield(0,Ra.rM)(GC,i,{type:t.uri,uri:r,lookupValue:""}));let e=o||(0,v.isComplexAttribute)(t)?(0,v.removeValuesFromDependentLookups)({structure:i,uri:r}):i;e=yield(0,Ra.RE)(MC,{structure:e,attributeType:t,value:n}),e!==i&&(yield(0,Ra.gz)(bb(e)))}}function*WC(e){yield(0,Ra.gw)(0);const t=yield(0,Ra.Ys)(Qx),r=yield(0,Ra.RE)(HC,t,e.payload);yield(0,Ra.gz)(bb(r))}function*GC(e,t){const r=yield(0,Ra.Ys)(uO),n=yield(0,Ra.Ys)(jO),a=yield(0,Ra.Ys)(LS),i=yield(0,Ra.Ys)(EO),o=yield(0,Ra.Ys)(iS),l=yield(0,Ra.Ys)(tC),s=yield(0,Ra.Ys)(CC),c=(0,v.getDependentLookupStateForValueUri)({structure:e,typeUri:t.type,valueUri:t.uri,modifiedEntities:n,connections:a,entityUri:i,config:o,editorsState:l,hiddenAttributes:s[i]??[]});if(c.length>0){const e=c.map((e=>e.uri));yield(0,Ra.gz)(Tb({uris:e,isBlocked:!0}));try{const e=yield(0,Ra.RE)(v.cascadeUpdate,c,t);for(const n of e){const{type:e,uri:a,lookupValue:i,displayName:o}=n,l=(yield(0,Ra.Ys)(MS,(0,v.getBaseUri)(a)))[0],s=yield(0,Ra.RE)(UC,a,l);s&&(0,v.findAttributeValueByUri)(s,a)&&a!==t.uri&&(yield(0,Ra.gz)(lb({attributeType:(0,v.findAttributeTypeByUri)(r,e),uri:a,value:{value:o||"",lookupCode:i||""},silent:!0,viewId:l})))}}catch(e){console.warn(e)}yield(0,Ra.gz)(Tb({uris:e,isBlocked:!1}))}}function*qC(e){const t=e.payload.connection,r=(0,v.getEntityUriFromConnection)(t);if((0,v.isTempUri)(r)&&(yield(0,Ra.Ys)(LO,r))){yield(0,Ra.qn)(Eb.DEPENDENT_LOOKUPS_STRUCTURE_SET);const e=yield(0,Ra.Ys)(Qx),t=yield(0,Ra.RE)(zC,e,r);yield(0,Ra.gz)(bb(t))}}function*ZC(e){const t=e.payload.relationUri,r=yield(0,Ra.Ys)(Qx),n=(0,v.removeValuesFromDependentLookups)({structure:r,uri:t});yield(0,Ra.gz)(bb(n))}function*$C(e){const t=e.payload.id,r=e.payload.relationUri;if(0===(yield(0,Ra.Ys)(MS,r)).length){const e=yield(0,Ra.Ys)(Qx);let n=(0,v.removeValuesFromDependentLookups)({structure:e,uri:r});const a=yield(0,Ra.Ys)(SO,t),i=NC(a,r),o=(0,v.getEntityUriFromConnection)(i);(0,v.isTempUri)(o)&&(n=yield(0,Ra.RE)(HC,n,o)),yield(0,Ra.gz)(bb(n))}}const KC=[function*(){yield(0,Ra.ib)(RC.MODIFIED_ENTITY_CREATED,LC)},function*(){yield(0,Ra.ib)(RC.MODIFIED_ENTITY_DELETED,WC)},function*(){yield(0,Ra.ib)(ab.ADD_DEFAULT_VALUES,jC)},function*(){yield(0,Ra.ib)(ab.ADD_ATTRIBUTES,FC)},function*(){yield(0,Ra.ib)(ab.MODIFY_ATTRIBUTE,BC)},function*(){yield(0,Ra.ib)(ab.REMOVE_ATTRIBUTE,YC)},function*(){yield(0,Ra.ib)(_C.OPEN_RELATION_EDITOR,qC)},function*(){yield(0,Ra.ib)(_C.SET_RELATION_TYPE,ZC)},function*(){yield(0,Ra.ib)(_C.CLOSE_RELATION_EDITOR,$C)}];let XC=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 QC=(e,t)=>({type:XC.ENTITY_LOADED,payload:{entity:e,silent:t}}),JC=ZE(XC.DEFAULT_PROFILE_PIC_SET),ew=ZE(XC.LOAD_ENTITY),tw=ZE(XC.ENTITY_CREATION_REQUESTED),rw=ZE(XC.ENTITY_CREATION_WITH_AUTHORING_REQUESTED),nw=ZE(XC.ENTITY_AUTHORING_DRAFT_ENTITIES_LOADED),aw=ZE(XC.AUTHORING_DCR_RESOLVED),iw=ZE(XC.ENTITY_REMOVE_REQUESTED),ow=ZE(XC.CLONE_ENTITY),lw=ZE(XC.CLEAR_ENTITY),sw=e=>null==e?void 0:e.uri,cw=(0,jv.createSelector)((e=>null==e?void 0:e.dataTenant),sw,((e,t)=>(0,v.getEntityUriForLink)({dataTenant:e,uri:t})));function uw(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const pw={};let dw=function(e){return e.ERRORS_SET="ERRORS_SET",e.REMOVE_ERROR="REMOVE_ERROR",e.ERROR_DEACTIVATED="ERROR_DEACTIVATED",e}({});const mw=ZE(dw.ERROR_DEACTIVATED),fw=ZE(dw.ERRORS_SET);function yw(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const gw=[];let hw=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 Ew=ZE(hw.HISTORY_DIFF_SET),bw=ZE(hw.HISTORY_DIFF_CLEARED),vw=ZE(hw.HISTORY_EVENT_SET),Tw=ZE(hw.HISTORY_EVENT_CLEARED),Ow=ZE(hw.HISTORY_SLICE_SET),Sw=ZE(hw.HISTORY_MODE_SET);function xw(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Cw(e,t,r[t])}))}return e}function Cw(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ww={mode:v.HistoryMode.Current};let Aw=function(e){return e.PROFILE_LAST_LOADED_TIME_UPDATE="PROFILE_LAST_LOADED_TIME_UPDATE",e}({});ZE(Aw.PROFILE_LAST_LOADED_TIME_UPDATE);let Rw=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 _w=ZE(Rw.LOOKUPS_LOADED),Iw=ZE(Rw.LOOKUPS_FOR_TYPE_RESOLVED),Nw=ZE(Rw.LOOKUPS_LIST_RESOLVED);function Pw(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Dw(e,t,r[t])}))}return e}function Dw(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const kw={},Lw=(e,t)=>({type:Sb.MODE_UPDATED,payload:{mode:e,silent:t}}),Uw=ZE(Sb.MODE_UPDATE_REQUESTED),jw=ZE(Sb.MODE_EDITING_CANCELED),Fw=v.isSuggestMode,Mw=(v.isEditMode,v.isViewMode),Vw=v.isEditableMode,Bw=v.Mode.Viewing,zw=ZE(RC.MODIFIED_ENTITY_CREATED),Hw=ZE(RC.MODIFIED_ENTITY_DELETED),Yw=ZE(RC.MODIFIED_ENTITY_DEFAULT_PROFILE_PIC_SET),Ww=ZE(RC.MODIFIED_ENTITIES_RESET),Gw=ZE(RC.CLEANSE_LOADING);function qw(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Zw(e,t,r[t])}))}return e}function Zw(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const $w={};function Kw(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Xw(e,t,r[t])}))}return e}function Xw(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*Qw(e){const{values:t,parentUri:r,attributeTypeUri:n,attributeTypeName:a}=e.payload;let i=t;const o=yield(0,Ra.Ys)(hO);if(r===o.uri){const e=(0,v.getAttributeSource)(n),r=(0,O.pipe)((0,O.pathOr)([],[e,a]),(0,O.map)((0,O.prop)("uri")))(o),l=(0,O.intersection)(r,t.map((0,O.prop)("uri")));i=t.filter((e=>!l.includes(e.uri)))}i.length&&(yield(0,Ra.gz)(cb(Kw({},e.payload,{values:i}))))}function*Jw(){return{apiPath:yield(0,Ra.Ys)(HO),tenant:yield(0,Ra.Ys)(ex)}}function*eA(e){const{attributeTypeName:t,attributeTypeUri:r}=e.payload,n=yield(0,Ra.RE)(Jw);try{const a=yield(0,Ra.RE)(v.getPagedEntity,Kw({},e.payload,n)),i=(0,v.getAttributeSource)(r),o=(0,O.pathOr)([],[i,t],a);yield(0,Ra.gz)(ub(Kw({},e.payload,{values:o})))}catch(e){console.warn(e),yield(0,Ra.gz)(Dv((0,v.getRequestErrorMessage)(e,ei().text("Something went wrong"))))}}function*tA(e){var t;const{attributeType:r,value:n,uri:a}=e.payload,i=r.uri,o=(0,v.getBaseUri)(i),l=yield(0,Ra.Ys)(TC,o);if(!l)return;const s=yield(0,Ra.Ys)(uO),c=(0,v.getEntityType)(s,o),u=null==c||null===(t=c.cleanseConfig)||void 0===t?void 0:t.infos;if(!u)return;const p=(0,v.getCleanseType)(l,i);if(!(0,v.hasCleanseTypeInEntityType)(p,u))return;const d=(0,v.getCleanseAttributes)(l);if(null!=d&&d.includes(i)){yield(0,Ra.gz)(Gw({isLoading:!0}));try{const e=yield(0,Ra.RE)(v.cleanseData,{cleanseType:p.split("/cleanse/infos/")[1],type:o,attributes:{[r.name]:[{type:i,value:n}]}}),t=(0,v.getBaseUri)(a),l=yield(0,Ra.Ys)(LO,t);if((0,v.hasCleanseStatus)(e))if((0,v.isUnverifiedCleanse)(e))yield(0,Ra.gz)(Dv((0,O.path)(v.CLEANSE_STATUS_ERROR_PATH,e)));else if(l){const{attributes:r}=e,n=(0,v.prepareCleansedAttributes)(t,r);yield(0,Ra.gz)(zw(Kw({},l,{attributes:Kw({},l.attributes,n)})))}}catch(e){console.warn(e),yield(0,Ra.gz)(Dv((0,v.getRequestErrorMessage)(e,ei().text("Something went wrong"))))}yield(0,Ra.gz)(Gw({isLoading:!1}))}}const rA=[function*(){yield(0,Ra.ib)(ab.REQUEST_NEXT_PAGE_ATTRIBUTE_VALUES,eA)},function*(){yield(0,Ra.ib)(ab.PROCESS_NEXT_PAGE_ATTRIBUTE_VALUES,Qw)},function*(){yield(0,Ra.ib)(ab.MODIFY_ATTRIBUTE,tA)}],nA=ZE(_C.RELATIONS_LOADED),aA=ZE(_C.SECOND_LEVEL_RELATIONS_LOADED),iA=(0,O.curry)(((e,t)=>({type:_C.REMOVE_RELATION,payload:{id:e,relationUri:t}}))),oA=(0,O.curry)(((e,t)=>({type:_C.IGNORE_RELATION,payload:{id:e,ignoredRelationData:t}}))),lA=(0,O.curry)(((e,t)=>({type:_C.ADD_RELATION,payload:{id:e,connection:t}}))),sA=(0,O.curry)(((e,t)=>({type:_C.EDIT_RELATION,payload:{id:e,connection:t}}))),cA=(0,O.curry)(((e,t,r,n)=>({type:_C.UPDATE_RELATION_RATING,payload:{id:e,connection:t,rating:r,user:n}}))),uA=(0,O.curry)(((e,t)=>({type:_C.OPEN_RELATION_EDITOR,payload:{id:e,connection:t}}))),pA=(0,O.curry)(((e,t)=>({type:_C.CLOSE_RELATION_EDITOR,payload:{id:e,relationUri:t}}))),dA=(0,O.curry)(((e,t,r)=>({type:_C.SET_RELATION_TYPE,payload:{id:e,relationUri:t,relationType:r}}))),mA=(0,O.curry)(((e,t,r)=>({type:_C.SET_RELATION_ENTITY,payload:{id:e,relationUri:t,entityInfo:r}}))),fA=(0,O.curry)(((e,t,r)=>({type:_C.SET_INITIAL_INFO,payload:{id:e,relationUri:t,tempEntity:r}})));function yA(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){gA(e,t,r[t])}))}return e}function gA(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const hA={},EA={removedUris:[],addedConnections:[],editedConnections:[],ignoredRelationData:[]},bA=(e,t,r)=>{if((0,O.pathEq)([...(0,v.getRelationToAddPath)(e),"relation","relationUri"],t,r))return(0,v.getRelationToAddPath)(e);{const n=((0,O.path)((0,v.getRelationsToEditPath)(e),r)||[]).findIndex((0,O.pathEq)(["relation","relationUri"],t));return n>=0?[...(0,v.getRelationsToEditPath)(e),n]:null}},vA=(e,t,r)=>{const n=bA(e,t,r);return n?(0,O.lensPath)([...n,"relation"]):null},TA=(0,O.pipe)(vA,(e=>(0,O.compose)(e,(0,O.lensProp)("object"))));let OA=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}({});ZE(OA.TREE_LOADED),ZE(OA.TREE_LOADED_WITH_ERROR),ZE(OA.TREE_LOADING),ZE(OA.TREE_SCROLL_TO_NODE_RESET);const SA=ZE(OA.TREE_COMMANDS_CLEARED),xA=(ZE(OA.TREE_CHILDREN_LOADING),ZE(OA.TREE_CURRENT_ENTITY_SHOWN),ZE(OA.TREE_REFRESHED),ZE(OA.TREE_NODE_EXPANDED),ZE(OA.TREE_RELATION_REMOVED),ZE(OA.TREE_NODE_REMOVED),ZE(OA.TREE_SECONDARY_LABEL_SHOWN),ZE(OA.TREE_ENTITIES_MAPPING_LOADED),ZE(OA.TREE_CHANGED)),CA=(ZE(OA.TREE_NODE_EDITED),ZE(OA.TREE_ACTIVENESS_DATE_CHANGED),ZE(OA.TREE_RELATION_REPOINTED),ZE(OA.TREE_RELATION_CREATED),ZE(OA.TREE_NODE_CREATED),ZE(OA.TREE_RELATION_EDITED),ZE(OA.TREE_NODE_EDITED),ZE(OA.TREE_NODE_EDITING_STARTED),ZE(OA.TREE_NODE_EDITING_APPLIED),ZE(OA.TREE_NODE_EDITING_CANCELED),ZE(OA.TREE_NODE_NEW_PARENT_EDITING_STARTED),ZE(OA.TREE_NODE_NEW_PARENT_EDITING_APPLIED),ZE(OA.TREE_NODE_NEW_PARENT_EDITING_CANCELED),ZE(OA.TREE_NODE_NEW_CHILD_EDITING_STARTED),ZE(OA.TREE_NODE_NEW_CHILD_EDITING_APPLIED),ZE(OA.TREE_NODE_NEW_CHILD_EDITING_CANCELED),ZE(OA.TREE_NODE_RELATION_TYPE_CHANGED),ZE(OA.TREE_NODE_ENTITY_CHANGED),ZE(OA.TREE_SORTED),ZE(OA.TREES_STATE_SAVED),ZE(OA.TREES_STATE_RESTORED),ZE(OA.TREE_CHILDREN_LOADED),ZE(OA.TREES_RESTORE_FROM_INITIAL_TREES)),wA=ZE(OA.TREES_RESET_INITIAL_TREES),AA=(ZE(OA.TREE_CANCEL_CHILDREN_LOADING),(0,O.path)(["common","commands"]));var RA=r(76665);function _A(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){IA(e,t,r[t])}))}return e}function IA(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const NA=(e,t,r=[])=>{if((0,O.path)(["entity","uri"],e)===t)return r.forEach((e=>e.expanded=!0)),e;if(e.children)for(const n of e.children){const a=NA(n,t,r.concat(e));if(a)return a}},PA=(e,t)=>{const r=Object.keys(e).reduce(((r,n)=>{const a=e[n];return t[n]&&(a.parent=(0,O.uniq)([].concat(a.parent).concat(t[n].parent).filter(O.identity))),r[n]=a,r}),{});return Object.keys(t).forEach((e=>{r[e]||(r[e]=t[e])})),r},DA=(e,t)=>{if(e&&e.children){const r=e.children.findIndex((({nodeId:e})=>e===t));r>-1&&e.children.splice(r,1)}},kA=(e,t,r=0)=>{e&&e.children&&e.children.splice(r,0,t)},LA=({path:e,value:t,object:r})=>{let n=r;for(let r=0;r<e.length;r++){const a=e[r];r===e.length-1?n[a]="function"==typeof t?t(n[a]):t:(n[a]=n[a]||("number"==typeof a?[]:{}),n=n[a])}},UA=(e={},t,r)=>{e[t]=r,e.children&&e.children.forEach((e=>UA(e,t,r)))},jA=e=>({entity:e.entity,relation:e.relation}),FA=({id:e,draft:t,node:r})=>{LA({path:["editingConnections",r.relation.uri],object:t[e],value:jA(r)})},MA=({id:e,draft:t,node:r,entity:n})=>{LA({path:["editingConnections",r.relation.uri,"entity"],object:t[e],value:n})},VA=({id:e,draft:t,relationUri:r})=>{delete t[e].editingConnections[r]},BA=({id:e,draft:t,relationUri:r})=>t[e].editingConnections[r],zA=e=>{delete e.editingMode,delete e.relatedEntity,delete e.initialConnection},HA=({id:e,draft:t,currentNode:r})=>{const n=t[e].root;if(n===r)t[e].root=r.children[0],t[e].root.children=t[e].root.children||[],t[e].root.children.push(...r.children.slice(1));else{const e=(0,v.findParentNodeById)(n,r.nodeId);DA(e,r.nodeId)}},YA=(e,t,r)=>{const n=[e,"editingConnections",t,"relation"];return(0,O.path)(n,r)?(0,O.lensPath)(n):null},WA=(0,O.pick)(["showSecondaryLabel","sortField","sortOrder"]),GA=e=>({entity:(0,O.pick)(["uri","type","label","secondaryLabel"],e.entity),parent:[],relations:[(0,O.pick)(["uri","type"],e.relation)]});function qA(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.push.apply(n,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=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const $A={common:{commands:[]},trees:{},initialTrees:{}};let KA=function(e){return e.ENTITY_RELATED_ATTRIBUTES_ADDED="ENTITY_RELATED_ATTRIBUTES_ADDED",e}({});ZE(KA.ENTITY_RELATED_ATTRIBUTES_ADDED);const XA={},QA=e=>e.entity,JA=e=>e.modifiedEntities,eR=e=>e.errors,tR=e=>e.relations,rR=e=>e.trees,nR=e=>e.lookups,aR=e=>e.dependentLookups,iR=e=>e.mode,oR=e=>e.lastLoadedTime,lR=e=>e.history,sR=e=>e.operation,cR=e=>e.views,uR=e=>e.sidePanelViews,pR=e=>e.hiddenAttributes,dR=e=>e.controlAttributes,mR=e=>sw(QA(e)),fR=e=>cw(QA(e)),yR=(e,t)=>((e,t)=>t&&e[t])(JA(e),t),gR=(e,t)=>((e,t)=>t&&e[t]&&e[t].defaultProfilePic)(JA(e),t),hR=e=>(0,O.keys)(tR(e)),ER=(e,t,r)=>DC(tR(e),t,r),bR=(e,t,r)=>kC(tR(e),t,r),vR=(e,t,r)=>((e,t,r)=>{const n=kC(e,t,r);return(0,v.getRelationObjectFromConnection)(n)})(tR(e),t,r),TR=(e,t,r)=>((e,t,r)=>{const n=(0,O.pipe)((0,O.pathOr)([],[t,"drafts","addedConnections"]),(0,O.filter)((0,O.pipe)(v.getRelationUriFromConnection,v.isTempUri)),(0,O.when)((0,O.always)(r),(0,O.filter)((0,O.propEq)("parentEntityUri",r))),O.length)(e);return((e,t,r)=>r?(0,O.pipe)((0,O.path)([t,"connections"]),(0,O.find)((({entity:e})=>e.entityUri===r)),(0,O.pathOr)(0,["total"]))(e):(0,O.pathOr)(0,[t,"total"],e))(e,t,r)+n})(tR(e),t,r),OR=(e,t)=>PC(tR(e),t),SR=(e,t)=>v.getDraftsForSaveByViewId(tR(e),t),xR=e=>(e=>(0,O.keys)(e).reduce(((t,r)=>{const{addedConnections:n,editedConnections:a}=(0,v.getDraftsForSaveByViewId)(e,r);return(0,O.pipe)(O.concat,(0,O.map)(v.getEntityUriFromConnection),(0,O.filter)(v.isTempUri),(0,O.concat)(t))(n,a)}),[]))(tR(e)),CR=e=>Vw(iR(e)),wR=e=>Mw(iR(e)),AR=e=>Fw(iR(e)),RR=(e,t)=>v.getRelationToAddByViewId(tR(e),t),_R=(e,t)=>v.getRelationsToEditByViewId(tR(e),t),IR=(e,t)=>v.getAllRelationsToAddAndEdit(tR(e),t),NR=(e,t,r)=>v.getAllRelationsToSave(tR(e),t,r),PR=(e,t,r)=>v.getInitialConnectionTempEntity(e.relations,t,r),DR=(e,t,r)=>v.getInitialConnection(e.relations,t,r),kR=(e,t)=>((e,t)=>Object.keys(e).filter((r=>{const n=(0,v.getTempRelations)(e,r);return!!NC(n,t)})))(tR(e),t),LR=(e,t,r)=>((e,t,r)=>(0,O.pipe)((0,O.filter)((0,O.allPass)([(0,O.propEq)("parentUri",t),(0,O.propEq)("attributeTypeUri",r),(0,O.pipe)((0,O.prop)("uri"),O.isEmpty)])),(0,O.map)((0,O.prop)("message")),(0,O.join)(". "))(e))(eR(e),t,r),UR=(e,t,r)=>((e,t,r)=>(0,O.filter)((0,O.allPass)([(0,O.propEq)("parentUri",t),(0,O.propEq)("attributeTypeUri",r),(0,O.pipe)((0,O.prop)("uri"),O.isEmpty,O.not)]))(e))(eR(e),t,r),jR=(e,t,r)=>v.getCachedActiveErrorsForAttributesPager(eR(e),t,r),FR=(e,t)=>((e,t)=>e.trees[t])(rR(e),t),MR=(e,t)=>((e,t)=>(0,O.path)(["trees",t,"root"],e))(rR(e),t),VR=(e,t)=>((e,t)=>(0,O.path)(["trees",t,"total"],e))(rR(e),t),BR=e=>AA(rR(e)),zR=(e,t,r)=>((e,t,r)=>(0,O.path)(["trees",t,"editingConnections",r],e))(rR(e),t,r),HR=(e,t)=>((e,t)=>(0,O.pipe)((0,O.prop)("trees"),(0,O.when)((0,O.always)(t),(0,O.pick)(t)),O.values,(0,O.map)((0,O.pipe)((0,O.prop)("editingConnections"),O.values)),O.flatten,(0,O.reject)(O.isNil))(e))(rR(e),t),YR=e=>(e=>e.structure)(aR(e)),WR=(e,t)=>v.getDependentLookupsStructureNode(aR(e),t),GR=e=>(e=>e.initedTypeUris)(aR(e)),qR=e=>(e=>e.editors)(aR(e)),ZR=(e,t)=>v.getDependentLookupEditorState(aR(e),t),$R=e=>(e=>e.diff)(lR(e)),KR=e=>(e=>e.event)(lR(e)),XR=e=>(e=>e.slice)(lR(e)),QR=e=>(e=>!(0,v.isEmptyValue)(e.slice))(lR(e)),JR=e=>(e=>e.mode)(lR(e)),e_=(e,t)=>((e,t)=>e[t])((e=>e.entityRelatedAttributes)(e),t),t_=(0,jv.createSelector)(QA,(e=>yR(e,mR(e))),((e,t)=>!(!e||!t||(0,v.isEmptyValue)((0,v.collectAllDiffs)(e,t,!0))))),r_=(0,jv.createSelector)(rR,(e=>{const t=AA(e),r=(0,v.getNotAppliedTreeCommands)((0,O.reject)((0,O.propSatisfies)(v.isEmptyValue,"root"),e.trees));return!(0,v.isEmptyValue)(t)||!(0,v.isEmptyValue)(r)})),n_=(0,jv.createSelector)(tR,(e=>(0,O.keys)(e).reduce(((t,r)=>t||!(0,O.all)(v.isEmptyValue)((0,O.values)(v.getDraftsForSaveByViewId(e,r)))),!1))),a_=(0,jv.createSelector)(t_,n_,r_,((e,t,r)=>e||t||r)),i_=(0,jv.createSelector)(iR,QA,a_,((e,t)=>t),((e,t,r,n)=>!(e===v.Mode.Viewing||!t)&&((0,v.isTempUri)(t.uri)&&!n||r)));let o_=function(e){return e.PROFILE_OPERATION_UPDATE="PROFILE_OPERATION_UPDATE",e}({});const l_=ZE(o_.PROFILE_OPERATION_UPDATE),s_=({metadata:e,modifiedEntities:t,connections:r=[],errors:n})=>n.filter((({attributeType:e,type:t})=>e&&!(0,v.isRequired)(e)&&t===v.ErrorType.missed)).filter((({attributeType:n,parentUri:a})=>{const i=(0,v.getBaseUri)(a),o=(0,v.isEntityUri)(a)?t[i]:(0,v.findConnectionRelationObjectByRelationUri)(r,i),l=o&&(0,v.findAttributeValuesByTypeUri)(e,o,n.uri,!0);return null==l?void 0:l.some((({parent:e,attrValues:t})=>e.uri===a&&0===t.length))})).map((({attributeType:e,parentUri:t})=>({attributeType:e,parentUri:t}))),c_=e=>(0,v.getProfileViewsIdsByTypes)(e,[v.ProfileViewType.Relations,v.ProfileViewType.RelationsTable]);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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){p_(e,t,r[t])}))}return e}function p_(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*d_(){const e=yield(0,Ra.Ys)(uI.selectors.getEntity),t=yield(0,Ra.Ys)(uI.selectors.getMode),r=yield(0,Ra.Ys)(uI.selectors.getEntityUri),n=yield(0,Ra.Ys)(uI.selectors.getMetadata),a=yield(0,Ra.Ys)(uI.selectors.getModifiedEntity,r),i=yield(0,Ra.Ys)(uI.selectors.getModifiedEntities),o=yield(0,Ra.Ys)(uI.selectors.getProfileViews);return{entity:e,modifiedEntity:t===v.Mode.Viewing?e:a,entityUri:r,metadata:n,modifiedEntities:t===v.Mode.Viewing?{[r]:e}:i,profileViews:o,mode:t}}function*m_(){return u_({},yield(0,Ra.RE)(d_),{validationServicePath:yield(0,Ra.Ys)(uI.selectors.getValidationServicePath),tenant:yield(0,Ra.Ys)(uI.selectors.getTenant),severity:yield(0,Ra.Ys)(uI.selectors.getValidationServiceSeverityLevels)})}function*f_(){const{entityUri:e,metadata:t,modifiedEntities:r,modifiedEntity:n,profileViews:a}=yield(0,Ra.RE)(d_);if(!e)return[];const i=c_(a),o=(0,v.getProfileViewsIdsByTypes)(a,[v.ProfileViewType.HierarchyTree]),l=yield(0,Ra.Ys)(US,i,!0),s=yield(0,Ra.Ys)(uI.selectors.getRelations),c=yield(0,Ra.Ys)(uI.selectors.getAllTreesEditingConnections,o);return[...(0,v.validateEntityLocally)(t,r,n,(0,v.isAvailableAttributeTypeForProfile)(a)),...l.flatMap((e=>(0,v.validateConnection)(t,r,e))),...c.flatMap((e=>(0,v.validateHierarchyConnection)(t,e)))].map((n=>u_({},n,{path:(0,v.evaluateErrorPath)({entityUri:e,metadata:t,connections:l,entitiesMap:r,relationsState:s,relationViewsIds:i},n.uri||n.parentUri)})))}function*y_(){const{entityUri:e,metadata:t,modifiedEntity:r,mode:n,validationServicePath:a}=yield(0,Ra.RE)(m_);if(a&&e&&(0,v.shouldUseValidationService)(t,null==r?void 0:r.type)){const r=yield(0,Ra.RE)((0,v.isTempUri)(e)?h_:E_),{modifiedEntities:a}=yield(0,Ra.RE)(d_),i=(0,O.pipe)(v.convertValidationServiceErrors,(0,O.uniqBy)(v.getErrorUniqKey))(r,{entityUri:e,metadata:t,entitiesMap:a});if(n!==v.Mode.Viewing){const e=s_({metadata:t,modifiedEntities:a,errors:i});e.length&&(yield(0,Ra.gz)(ib(e)))}return i}return[]}function g_(e){return console.warn("Validation service error",e),[]}function*h_(){const{mode:e,modifiedEntity:t,modifiedEntities:r,validationServicePath:n,tenant:a,severity:i}=yield(0,Ra.RE)(m_),o=(0,v.prepareEntityForValidation)(t,r);try{return yield(0,Ra.RE)(v.validateEntity,{validationServicePath:n,entity:o,tenant:a,severity:i,options:(0,O.reject)(O.isNil,[v.ValidationServiceOption.preserveURIs,e===v.Mode.Editing?v.ValidationServiceOption.validateDataPermissions:null])})}catch(e){return g_(e)}}function*E_(){const{entityUri:e,mode:t,entity:r,modifiedEntity:n,modifiedEntities:a,validationServicePath:i,metadata:o,tenant:l,severity:s}=yield(0,Ra.RE)(m_),c=yield(0,Ra.Ys)(uI.selectors.getValidateReferenceEntityInReadMode),u=(0,v.getEntityType)(o,r.type),p=(null==u?void 0:u.forceOvForUiUpdates)??!0,d=t===v.Mode.Viewing?[]:(0,v.collectDiffForValidation)(r,n,a,p);try{return yield(0,Ra.RE)(v.validateEntityChanges,{validationServicePath:i,uri:e,diff:d,tenant:l,severity:s,options:(0,O.reject)(O.isNil,[v.ValidationServiceOption.preserveURIs,v.ValidationServiceOption.updateAttributeUpdateDates,t===v.Mode.Editing?v.ValidationServiceOption.validateDataPermissions:null,t===v.Mode.Viewing&&c?v.ValidationServiceOption.validateReferenceEntityAttribute:null])})}catch(e){return g_(e)}}function*b_(){const{entityUri:e,metadata:t,mode:r,modifiedEntity:n,modifiedEntities:a,validationServicePath:i,tenant:o,severity:l,profileViews:s}=yield(0,Ra.RE)(m_),c=yield(0,Ra.Ys)(uI.selectors.getValidateRelations);if(i&&c){const c=c_(s),u=(yield(0,Ra.Ys)(US,c)).filter((e=>(0,v.shouldUseValidationService)(t,e.relation.relationType)));if(u.length>0){let s=[];const p=(0,v.prepareConnectionsForValidation)(u,n,a,t);try{const e=yield(0,Ra.RE)(v.validateRelations,{validationServicePath:i,body:p,tenant:o,severity:l,options:(0,O.reject)(O.isNil,[v.ValidationServiceOption.preserveURIs,r===v.Mode.Editing?v.ValidationServiceOption.validateDataPermissions:null])});s=Object.values(e.validated).flat()}catch(e){return g_(e)}const d=yield(0,Ra.Ys)(uI.selectors.getModifiedEntities),m=yield(0,Ra.Ys)(uI.selectors.getRelations),f=(0,O.pipe)(v.convertValidationServiceErrors,(0,O.uniqBy)(v.getErrorUniqKey))(s,{entityUri:e,metadata:t,entitiesMap:d,connections:u,relationsState:m,relationViewsIds:c}),y=s_({metadata:t,modifiedEntities:d,connections:u,errors:f});return y.length&&(yield(0,Ra.gz)(ib(y))),f}}return[]}function*v_(e){if((null==e?void 0:e.type)===ab.CANCEL_PROFILE_VALIDATION)return!0;const t=yield(0,Ra.RE)(f_),[r,n]=yield(0,Ra.$6)([(0,Ra.RE)(y_),(0,Ra.RE)(b_)]),a=(0,O.uniqBy)(v.getErrorUniqKey,[...t,...r,...n]),i=yield(0,Ra.Ys)(uI.selectors.getEntityUri),o=yield(0,Ra.Ys)(uI.selectors.getHiddenAttributes),l=(null==o?void 0:o[i])||[],s=(0,v.filterErrorsForHiddenAttributes)(a,l);return yield(0,Ra.gz)(fw(a)),0===s.filter(v.isCriticalError).length}let T_=function(e){return e.PROFILE_VIEWS_SET="PROFILE_VIEWS_SET",e}({});const O_=ZE(T_.PROFILE_VIEWS_SET);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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){x_(e,t,r[t])}))}return e}function x_(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*C_(e){const t=yield(0,Ra.Ys)(uI.selectors.getMetadata),r=yield(0,Ra.Ys)(uI.selectors.getMode);switch(e.type){case _C.OPEN_RELATION_EDITOR:{const{id:n,connection:a}=e.payload;a.relation.relationType&&(yield(0,Ra.gz)(ob({viewId:n,metadata:t,mode:r,parentUri:a.relation.object.uri})));break}case ab.ADD_ATTRIBUTES:{const n=e.payload;for(const e of n){const{attributeType:n,parentUri:a,viewId:i}=e;(0,v.isComplexAttribute)(n)&&(yield(0,Ra.gz)(ob({viewId:i,attributeType:n,parentUri:a,metadata:t,mode:r})))}break}case _C.SET_RELATION_TYPE:{const{id:n,relationUri:a}=e.payload;yield(0,Ra.gz)(ob({viewId:n,metadata:t,mode:r,parentUri:a}));break}case OA.TREE_NODE_RELATION_TYPE_CHANGED:{var n;const{id:a,node:i}=e.payload;yield(0,Ra.gz)(ob({viewId:a,metadata:t,mode:r,parentUri:null==i||null===(n=i.relation)||void 0===n?void 0:n.uri}));break}}}function*w_(e,t=null){const r=yield(0,Ra.Ys)(HS),n=(0,v.getNotAppliedTreeCommands)(null==r?void 0:r.trees),a=yield(0,Ra.Ys)(qS),i=(0,v.optimizeCommands)([...a,...n]);if(null!=i&&i.length){const r=(0,O.when)((0,O.always)(t),(0,v.replaceTempUriInCommands)(t))(i);yield(0,Ra.RE)(e,r),yield(0,Ra.gz)(SA())}}function*A_(e){const t=yield(0,Ra.Ys)(hO),r=yield(0,Ra.Ys)(EO),n=yield(0,Ra.Ys)(LO,r),a=yield(0,Ra.Ys)(uO),i=(0,v.getEntityType)(a,t.type),o=(null==i?void 0:i.forceOvForUiUpdates)??!0,l=(0,v.collectAllDiffs)(t,n,o);return(0,v.prepareAttrDiff)(e,l)}function*R_(e){const t=yield(0,Ra.Ys)(CO),r=yield(0,Ra.Ys)(jO),n=yield(0,Ra.Ys)(EO),a=yield(0,Ra.Ys)(LO,n),i=(0,v.findAllTemporaryRefEntityURI)(a),o=(0,O.concat)(i,t);return yield(0,Ra.RE)(v.saveTemporaryEntities,r,o,e)}function*__(e,t,r){const n=e.getDCRObjectUris(),a=yield(0,Ra.Ys)(ox),i=yield(0,Ra.Ys)(sx),o=yield(0,Ra.Ys)(ex);if(null!=n&&n.length){const l=yield(0,Ra.RE)(v.startProcessInstance,{workflowPath:a,processType:t?"authoring":"dataChangeRequestReview",objectURIs:(0,O.uniq)([r,...n,e.getDCRUri()]).filter((0,O.complement)(O.isNil)),tenant:o,environment:i});"OK"!==(null==l?void 0:l.status)&&console.warn(l)}}function*I_(e,t,r,n){const a=yield(0,Ra.Ys)(xO,r),i=yield(0,Ra.Ys)(uI.selectors.getUserName),o=(0,v.createRelationsCommandsFromConnections)(a,n,t,i);o.length&&(yield(0,Ra.RE)(e,o))}function*N_(e,t,r){const n=yield(0,Ra.Ys)(_O),a=yield(0,Ra.Ys)(EO);for(const i of n)yield(0,Ra.rM)(I_,e,r||a,i,t)}function*P_(e){if(!e.hasNewUri())return;const t=yield(0,Ra.Ys)(HS);for(const[r,n]of Object.entries(t.trees))if(n.root){const t=t=>(0,O.when)((0,O.prop)("uri"),(0,O.assoc)("uri",e.getUri(null==t?void 0:t.uri)))(t),a=(0,v.mapTree)(n.root,{nodeProcessing:e=>(0,O.pipe)((e=>S_({},e)),(0,O.unless)((0,O.has)("editingMode"),(0,O.evolve)({relation:t,relations:(0,O.map)(t)})))(e)});(0,O.equals)(n.root,a)||(yield(0,Ra.gz)(xA({id:r,tree:a})))}}function*D_(){try{var e;const t=yield(0,Ra.Ys)(NS),{commandExecutor:r,dcrProcessor:n,relationUriProcessor:a}=(0,v.createCommandExecutor)({alwaysCreateDCR:t,dcrUri:null}),i=yield(0,Ra.RE)(R_,n);yield(0,Ra.$6)([(0,Ra.RE)(w_,r),(0,Ra.RE)(N_,r,i)]),yield(0,Ra.RE)(P_,a);const o=yield(0,Ra.RE)(A_,i),l=yield(0,Ra.Ys)(EO),s=yield(0,Ra.Ys)(uI.selectors.getMetadata),c=(0,v.hasAttributeMasking)(s);let u;if(null!=o&&o.length&&(u=yield(0,Ra.RE)(v.entityCumulativeUpdate,{uri:l,diff:o,uriPreprocessor:n.enhanceUriWithDCR,sendMasked:c})),t||(0,v.isChangeRequestUri)(null===(e=u)||void 0===e?void 0:e.uri))u&&n.updateDCRUriFromResponse(u),yield(0,Ra.RE)(__,n,!1,l),yield(0,Ra.gz)(CA()),c&&(yield(0,Ra.RE)(z_,!0)),window.alert(ei().text("Your changes are saved as pending and have been sent for review"));else if(u){yield(0,Ra.gz)(QC(u));const{trees:e}=yield(0,Ra.Ys)(uI.selectors.getTrees),t=(0,v.updateTreesWithNewEntity)((0,O.pick)(["uri","label","secondaryLabel","type"],u),e);for(const e of t)yield(0,Ra.gz)(xA({id:e.id,tree:e.root}))}else!u&&c&&(yield(0,Ra.RE)(z_,!0));yield(0,Ra.gz)(Lw(v.Mode.Viewing)),yield(0,Ra.gz)(yb())}catch(e){yield(0,Ra.gz)(Dv((0,v.getRequestErrorMessage)(e,ei().text("Something went wrong"))))}}function*k_(){yield(0,Ra.qn)(XC.ENTITY_LOADED),yield(0,Ra.gz)(yb())}function*L_(e,t){const r=yield(0,Ra.Ys)(EO),n=yield(0,Ra.Ys)(uI.selectors.getModifiedEntity,r),{commandExecutor:a,dcrProcessor:i}=(0,v.createCommandExecutor)({alwaysCreateDCR:t,dcrUri:e}),o=yield(0,Ra.RE)(R_,i),l=yield(0,Ra.RE)(v.saveTemporaryEntity,n,o,i);return yield(0,Ra.$6)([(0,Ra.RE)(w_,a,{[r]:l}),(0,Ra.RE)(N_,a,o,l)]),{savedEntityUri:l,dcrProcessor:i}}function*U_(){const e=yield(0,Ra.Ys)(EO),t=yield(0,Ra.Ys)(uI.selectors.getModifiedEntity,e);if((0,v.isEmptyEntity)(t)){const e=(0,Me.x0)();return yield(0,Ra.gz)(sv({id:e,text:ei().text("Please fill out some fields."),actions:[]})),!1}return!0}function*j_(){try{const e=yield(0,Ra.Ys)(NS);if(!(yield(0,Ra.RE)(U_)))return;const{dcrProcessor:t,savedEntityUri:r}=yield(0,Ra.RE)(L_,null,e);e&&(yield(0,Ra.RE)(__,t),window.alert(ei().text("Your changes are saved as pending and have been sent for review"))),yield(0,Ra.gz)(Lw(v.Mode.Viewing)),e?(yield(0,Ra.gz)(lv()),yield(0,Ra.gz)(lw())):(yield(0,Ra.gz)(av({uri:r})),yield(0,Ra.rM)(k_))}catch(e){yield(0,Ra.gz)(Dv((0,v.getRequestErrorMessage)(e,ei().text("Something went wrong"))))}}function*F_(e){const t=yield(0,Ra.RE)(v.getDataChangeRequest,e),r=(0,O.pipe)((0,O.prop)("changes"),O.values,O.flatten,(0,O.pluck)("id"))(t);try{yield(0,Ra.$6)(r.map((t=>(0,Ra.RE)(v.deleteChangeRequestItem,{dcrUri:e,changeItemId:t}))))}catch(e){yield(0,Ra.gz)(Dv((0,v.getRequestErrorMessage)(e,ei().text("Something went wrong"))))}}function*M_(e){const{dcrUri:t,action:r,taskId:n}=e.payload;try{if(!(yield(0,Ra.RE)(U_)))return;if(yield(0,Ra.gz)(l_(v.Operation.Saving)),yield(0,Ra.RE)(F_,t),yield(0,Ra.RE)(L_,t,!0),"Approve"!==r||(yield(0,Ra.RE)(v_))){const e=yield(0,Ra.Ys)(ox),t=yield(0,Ra.Ys)(sx),a=yield(0,Ra.Ys)(ex);yield(0,Ra.RE)(v.runTaskAction,{workflowPath:e,environment:t,tenant:a,taskId:n,action:r}),yield(0,Ra.gz)(aw())}}catch(e){const t=null==e?void 0:e.error;if((null==t?void 0:t.errorCode)===v.ApiErrorCode.WORKFLOW_IS_NOT_REGISTERED_ERROR)return;yield(0,Ra.gz)(Dv((0,v.getRequestErrorMessage)(t||e,ei().text("Something went wrong"))))}yield(0,Ra.gz)(l_(null))}function*V_(e){const{dcrUri:t,userAction:r}=e.payload,n=yield(0,Ra.Ys)(RS);try{if(!(yield(0,Ra.RE)(U_)))return;yield(0,Ra.gz)(Lw("saveDraft"===r?v.Mode.Suggesting:v.Mode.Editing,!0)),yield(0,Ra.gz)(l_(v.Operation.Saving));const e=yield(0,Ra.RE)(v_);if("saveDraft"===r){if(t)yield(0,Ra.RE)(F_,t),yield(0,Ra.RE)(L_,t,!0);else{const{dcrProcessor:e}=yield(0,Ra.RE)(L_,null,!0);yield(0,Ra.RE)(__,e,!0);const t=e.getDCRUri();yield(0,Ra.gz)(Iv({url:"../authoring",searchParams:{entityUri:`${t}`},options:{replace:!0,state:{keepErrors:!0}}}))}window.alert(ei().text("Your changes are saved as pending and have been sent for review"))}else if(e){const{savedEntityUri:e}=yield(0,Ra.RE)(L_,null,!1);yield(0,Ra.gz)(Lw(v.Mode.Viewing)),yield(0,Ra.gz)(av({uri:e})),yield(0,Ra.rM)(k_)}else e||(yield(0,Ra.gz)(Lw(n,!0)))}catch(e){yield(0,Ra.gz)(Lw(n,!0)),yield(0,Ra.gz)(Dv((0,v.getRequestErrorMessage)(e,ei().text("Something went wrong"))))}yield(0,Ra.gz)(l_(null))}function*B_(){if(yield(0,Ra.gz)(l_(v.Operation.Saving)),yield(0,Ra.RE)(v_)){const e=yield(0,Ra.Ys)(EO);(0,v.isTempUri)(e)?yield(0,Ra.RE)(j_):yield(0,Ra.RE)(D_)}yield(0,Ra.gz)(l_(null))}function*z_(e){try{let t;if(e){const e=yield(0,Ra.Ys)(uI.selectors.getMetadata);t=(0,v.addMetadataSpecificGetEntityOptions)(e)}yield(0,Ra.gz)(l_(v.Operation.Fetching));const r=yield(0,Ra.Ys)(EO),n=yield(0,Ra.RE)(v.getEntity,r,t);if(!n)throw new Error("Failed to request entity");return yield(0,Ra.gz)(QC(n,!0)),n}catch(e){throw yield(0,Ra.gz)(Dv((0,v.getRequestErrorMessage)(e,ei().text("Something went wrong")))),e}finally{yield(0,Ra.gz)(l_(null))}}function*H_(e){const{mode:t,silent:r}=e.payload;r||(yield Y_({mode:t}))}function*Y_({mode:e,overwrite:t=!1}){const r=yield(0,Ra.Ys)(uI.selectors.getEntity),n=yield(0,Ra.Ys)(uI.selectors.getMetadata),a=yield(0,Ra.Ys)(uI.selectors.getModifiedEntity,null==r?void 0:r.uri);if((t||!a)&&e!==v.Mode.Viewing&&r&&n){const t=yield(0,Ra.Ys)(uI.selectors.getProfileViews),a=yield(0,Ra.Ys)(uI.selectors.getUIConfig),i=yield(0,Ra.Ys)(uI.selectors.getUserRoles),o=(0,v.addToEntityRequiredAttributes)({entity:r,metadata:n,mode:e,attrTypeFilter:(0,O.both)((0,v.isAvailableAttributeTypeForProfile)(t||[]),(0,v.getProfileAttributeConfigPermissionsChecker)(a,r.type,i,[v.ConfigPermissions.READ,v.ConfigPermissions.CREATE]))});yield(0,Ra.gz)(zw(o));const l=yield(0,Ra.Ys)(uI.selectors.getModifiedEntities),s=yield(0,Ra.Ys)(uI.selectors.getProfileErrors),c=s_({metadata:n,modifiedEntities:l,errors:s});c.length&&(yield(0,Ra.gz)(ib(c)))}}function*W_(e){const{entity:t,silent:r}=e.payload,n=yield(0,Ra.Ys)(uI.selectors.getMode),a=yield(0,Ra.Ys)(uI.selectors.getProfileOperation);r||(0,v.isTempUri)(t.uri)||a||(yield Y_({mode:n,overwrite:!0}))}function*G_(e){const{entityTypeUri:t}=e.payload,r=yield(0,Ra.Ys)(uI.selectors.getMetadata),n=(0,v.getEntityType)(r,t),a=yield(0,Ra.Ys)(uI.selectors.getUIConfig),i=yield(0,Ra.Ys)(uI.selectors.getUserRoles),o=(0,v.getProfileAttributeConfigPermissionsChecker)(a,t,i,[v.ConfigPermissions.READ,v.ConfigPermissions.CREATE]),l=((null==n?void 0:n.attributes)||[]).filter((e=>o(e))),s=(0,v.checkMetadataForCreate)(v.Mode.Editing,n)?v.Mode.Editing:v.Mode.Suggesting,c=(0,v.createTemporaryEntity)({entityTypeUri:t,attributeTypes:l,metadata:r,mode:s});yield(0,Ra.gz)(iv({entity:c})),yield(0,Ra.gz)(QC(c)),yield(0,Ra.gz)(Lw(v.Mode.Viewing)),yield(0,Ra.gw)(0),(yield(0,Ra.Ys)(uI.selectors.getProfileViews))||(yield(0,Ra.qn)(T_.PROFILE_VIEWS_SET)),yield(0,Ra.gz)(Lw(s)),yield(0,Ra.gz)(wA())}function*q_(e){const t=yield(0,Ra.Ys)(uI.selectors.getMetadata),r=yield(0,Ra.Ys)(uI.selectors.getAuthoringByEntityType,e),n=yield(0,Ra.Ys)(uI.selectors.getUIConfig),a=(0,v.getPreparedAuthoringItems)(t,r,e,n).map((({views:e})=>e)).flat();yield(0,Ra.gz)(O_(a))}function*Z_(e){const{entityTypeUri:t}=e.payload,r=yield(0,Ra.Ys)(uI.selectors.getMetadata),n=(0,v.getEntityType)(r,t),a=(0,O.prop)("attributes",n),i=(yield(0,Ra.Ys)(uI.selectors.getCanSuggestAuthoring,n))?v.Mode.Suggesting:v.Mode.Editing,o=(0,v.createTemporaryEntity)({entityTypeUri:t,attributeTypes:a,metadata:r,mode:i});yield(0,Ra.gz)(Rv({entity:o})),yield(0,Ra.gz)(QC(o)),yield(0,Ra.RE)(q_,o.type),yield(0,Ra.gz)(Lw(i))}function*$_(e){const{mainEntityUri:t,tempEntities:r,keepErrors:n}=e.payload,[[a],i]=(0,O.partition)((0,O.propEq)("uri",t),r);yield(0,Ra.gz)(QC(a,n)),yield(0,Ra.RE)(q_,a.type),yield(0,Ra.gz)(Lw(v.Mode.Suggesting));for(const e of i)yield(0,Ra.gz)(zw(e))}function*K_(e){const{payload:{entityUri:t,data:r}}=e;yield(0,Ra.gz)(l_(v.Operation.Cloning));try{const e=yield(0,Ra.RE)(v.cloneEntity,t,r);yield(0,Ra.gz)(iv({entity:e})),yield(0,Ra.gz)(QC(e)),yield(0,Ra.gz)(Lw(v.Mode.Editing)),yield(0,Ra.gz)(wA());const n=(0,Me.x0)(),a=yield(0,Ra.Ys)(uI.selectors.getMetadata),i=(0,v.getEntityType)(a,e.type),o=(0,v.checkMetadataForDelete)(v.Mode.Editing,i);yield(0,Ra.gz)(sv({id:n,type:"cloneAction",autoHideDuration:1e4,text:ei().text("Profile is cloned successfully. You can modify the attributes if required."),actions:o?[{label:ei().text("Undo"),needConfirmation:!0,confirmationText:ei().text("Are you sure you want to undo the cloning process?"),confirmationDescription:ei().text("Undoing the cloning process will delete the cloned profile. Are you sure you want to proceed?"),applyAction:iw({entityUri:e.uri}),cancelAction:cv(n)}]:[]}))}catch(e){yield(0,Ra.gz)(Dv((0,v.getRequestErrorMessage)(e,ei().text("Something went wrong"))))}yield(0,Ra.gz)(l_(null))}function*X_(e){const{entityUri:t}=e.payload;if(!(0,v.isTempUri)(t))try{yield(0,Ra.RE)(v.removeEntity,t),yield(0,Ra.gz)(ov())}catch(e){yield(0,Ra.gz)(Dv((0,v.getRequestErrorMessage)(e,ei().text("Something went wrong"))))}}function*Q_(e){const t=e.payload;try{if((yield(0,Ra.Ys)(JS))&&!confirm(ei().text("Are you sure you want to cancel changes for this Profile?")))return;const e=yield(0,Ra.Ys)(RS),r=yield(0,Ra.Ys)(uI.selectors.getMetadata),n=yield(0,Ra.Ys)(EO),a=(0,v.hasAttributeMasking)(r),i=(0,v.isTempUri)(n),o=(0,v.isViewMode)(t),l=(0,v.isEditableMode)(e)&&(0,v.isViewMode)(t),s=(0,v.isViewMode)(e)&&(0,v.isEditableMode)(t);n&&(l||s)&&a&&!i&&(yield(0,Ra.RE)(z_,o)),yield(0,Ra.gz)(Lw(t)),l&&(yield(0,Ra.gz)(jw()))}catch{}}const J_=[function*(){yield(0,Ra.A7)([Sb.MODE_UPDATE_REQUESTED],Q_)},function*(){yield(0,Ra.A7)([ab.RUN_AUTHORING_TASK_ACTION],M_)},function*(){yield(0,Ra.ib)([_C.OPEN_RELATION_EDITOR,ab.ADD_ATTRIBUTES,_C.SET_RELATION_TYPE,OA.TREE_NODE_RELATION_TYPE_CHANGED],C_)},function*(){yield(0,Ra.A7)([ab.SAVE_PROFILE],B_)},function*(){yield(0,Ra.ib)([Sb.MODE_UPDATED],H_)},function*(){yield(0,Ra.ib)([XC.ENTITY_CREATION_REQUESTED],G_)},function*(){yield(0,Ra.Fm)([ab.VALIDATE_PROFILE,ab.CANCEL_PROFILE_VALIDATION],v_)},function*(){yield(0,Ra.ib)([XC.ENTITY_REMOVE_REQUESTED],X_)},function*(){yield(0,Ra.ib)([XC.CLONE_ENTITY],K_)},function*(){yield(0,Ra.ib)([XC.ENTITY_CREATION_WITH_AUTHORING_REQUESTED],Z_)},function*(){yield(0,Ra.ib)([XC.ENTITY_AUTHORING_DRAFT_ENTITIES_LOADED],$_)},function*(){yield(0,Ra.A7)([ab.SAVE_DRAFT],V_)},function*(){yield(0,Ra.ib)([XC.ENTITY_LOADED],W_)}];let eI=function(e){return e.SIDE_PANEL_VIEWS_LOADED="SIDE_PANEL_VIEWS_LOADED",e}({});ZE(eI.SIDE_PANEL_VIEWS_LOADED);const tI=[];let rI=function(e){return e.HIDDEN_ATTRIBUTES_UPDATED="HIDDEN_ATTRIBUTES_UPDATED",e.HIDDEN_ATTRIBUTES_RESET="HIDDEN_ATTRIBUTES_RESET",e}({});const nI=ZE(rI.HIDDEN_ATTRIBUTES_UPDATED),aI=ZE(rI.HIDDEN_ATTRIBUTES_RESET),iI={};let oI=function(e){return e.CONTROL_ATTRIBUTES_UPDATED="CONTROL_ATTRIBUTES_UPDATED",e}({});const lI=ZE(oI.CONTROL_ATTRIBUTES_UPDATED),sI=[],cI=(0,T.combineReducers)({dependentLookups:(e=wb,t)=>{switch(t.type){case Sb.MODE_UPDATED:{const{mode:r,silent:n}=t.payload;return(0,v.isViewMode)(r)&&!n?wb:e}case Eb.DEPENDENT_LOOKUPS_STRUCTURE_SET:return xb({},e,{structure:t.payload});case Eb.DEPENDENT_LOOKUPS_INITED_TYPE_URIS_ADDED:{const r=t.payload;return xb({},e,{initedTypeUris:(0,O.uniq)(e.initedTypeUris.concat(r))})}case Eb.DEPENDENT_LOOKUPS_EDITORS_BLOCKED:{const{uris:r,isBlocked:n}=t.payload,a=e.editors,i=r.reduce(((e,t)=>xb({},e,{[t]:xb({},e[t],{isBlocked:n})})),a);return xb({},e,{editors:i})}case Eb.DEPENDENT_LOOKUPS_EDITOR_TOUCHED:{const{uri:r,isTouched:n}=t.payload;return(0,O.assocPath)(["editors",r,"isTouched"],n,e)}default:return e}},entity:(e=pw,t)=>{switch(t.type){case XC.ENTITY_LOADED:return t.payload.entity;case XC.DEFAULT_PROFILE_PIC_SET:return"object"==typeof t.payload&&null!==t.payload?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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){uw(e,t,r[t])}))}return e}({},e,{defaultProfilePic:t.payload.uri,defaultProfilePicValue:t.payload}):e;case ab.ADD_NEXT_PAGE_ATTRIBUTE_VALUES:{const{parentUri:r,attributeTypeName:n,attributeTypeUri:a,values:i}=t.payload,o=(0,v.getAttributeSource)(a);if(r===e.uri){const t=(0,O.lensPath)([o,n]);return(0,O.over)(t,(0,O.pipe)((0,O.defaultTo)([]),(0,O.concat)(O.__,i)),e)}return e}case XC.CLEAR_ENTITY:return pw;default:return e}},errors:(e=gw,t)=>{switch(t.type){case dw.ERRORS_SET:return t.payload;case dw.ERROR_DEACTIVATED:{const r=t.payload,n=e.findIndex((e=>(0,v.getErrorId)(e)===r)),a=(0,O.lensPath)([n]);return(0,O.over)(a,(0,O.assoc)("deactivated",!0),e)}case ab.REMOVE_ATTRIBUTE:{const{uri:r}=t.payload;return e.map((e=>e.uri===r||(0,v.areOneHierarchyUris)(e.parentUri,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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){yw(e,t,r[t])}))}return e}({},e,{deactivated:!0}):e))}case Sb.MODE_UPDATED:{const{mode:r,silent:n}=t.payload;return(0,v.isViewMode)(r)&&!n?gw:e}case XC.ENTITY_LOADED:{const{silent:r}=t.payload;return r?e:gw}default:return e}},history:(e=ww,t)=>{switch(t.type){case hw.HISTORY_DIFF_SET:return xw({},e,{diff:t.payload});case hw.HISTORY_DIFF_CLEARED:return xw({},e,{diff:ww.diff});case hw.HISTORY_EVENT_SET:return xw({},e,{event:t.payload});case QE.NEW_ENTITY_SHOWN:case QE.OPEN_ENTITY:case hw.HISTORY_EVENT_CLEARED:return xw({},ww,{mode:e.mode});case hw.HISTORY_SLICE_SET:return xw({},e,{slice:t.payload});case hw.HISTORY_MODE_SET:return xw({},e,{mode:t.payload});default:return e}},lastLoadedTime:(e=null,t)=>{switch(t.type){case Aw.PROFILE_LAST_LOADED_TIME_UPDATE:case XC.ENTITY_LOADED:return Date.now();default:return e}},lookups:(e=kw,t)=>{switch(t.type){case Rw.LOOKUPS_LOADED:return t.payload;case Rw.LOOKUPS_FOR_TYPE_RESOLVED:{const{type:r,values:n}=t.payload;return Pw({},e,{[r]:Pw({},e[r],n)})}case Rw.LOOKUPS_LIST_RESOLVED:return t.payload.reduce(((e,t)=>Object.keys(t).reduce(((e,r)=>Pw({},e,{[r]:Pw({},e[r],t[r])})),e)),e);case"UI_RESET":return Pw({},kw);default:return e}},mode:(e=Bw,t)=>t.type===Sb.MODE_UPDATED?t.payload.mode:e,modifiedEntities:(e=$w,t)=>{switch(t.type){case RC.MODIFIED_ENTITY_CREATED:{const r=t.payload;return qw({},e,{[r.uri]:r})}case RC.MODIFIED_ENTITY_DELETED:{const r=t.payload;return(0,O.omit)([r],e)}case RC.MODIFIED_ENTITIES_RESET:return $w;case Sb.MODE_UPDATED:{const{silent:r}=t.payload;return r?e:$w}case RC.MODIFIED_ENTITY_DEFAULT_PROFILE_PIC_SET:{const{entityUri:r,value:n}=t.payload;return r?qw({},e,{[r]:qw({},e[r],{defaultProfilePic:n.uri,defaultProfilePicValue:n})}):e}case ab.ADD_ATTRIBUTES:return t.payload.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:a}=t,i=(0,v.getBaseUri)(n);if((0,v.isEntityUri)(i)){const t=e[i];return e[i]||console.error(`ADD_ATTRIBUTES. parentUri - ${n}, state: ${JSON.stringify(e)}`),(0,v.isEntitySpecialAttrType)(r)?qw({},e,{[i]:(0,v.addEntitySpecialAttribute)({entity:t,attributeType:r})}):qw({},e,{[i]:(0,v.addAttribute)({entity:t,attributeType:r,parentUri:n,index:a})})}return e}),e);case ab.ADD_NEXT_PAGE_ATTRIBUTE_VALUES:{const{parentUri:r,attributeTypeName:n,attributeTypeUri:a,values:i}=t.payload,o=(0,v.getAttributeSource)(a);if((0,v.isEntityUri)(r)&&r in e){const t=(0,O.lensPath)([r,o,n]);return(0,O.over)(t,(0,O.pipe)((0,O.defaultTo)([]),(0,O.concat)(O.__,i)),e)}return e}case ab.MODIFY_ATTRIBUTE:{const{attributeType:r,uri:n,value:a}=t.payload,i=(0,v.getBaseUri)(n);if((0,v.isEntityUri)(i)){const t=e[i];return e[i]&&e[i].attributes||console.error(`MODIFY_ATTRIBUTE. uri - ${n}, state: ${JSON.stringify(e)}`),(0,v.isEntitySpecialAttrType)(r)?qw({},e,{[i]:(0,v.editEntitySpecialAttribute)({entity:t,attributeType:r,value:a})}):qw({},e,{[i]:(0,v.editAttribute)({entity:t,attributeType:r,uri:n,value:a})})}return e}case ab.REMOVE_ATTRIBUTE:{const{attributeType:r,uri:n}=t.payload,a=(0,v.getBaseUri)(n);if((0,v.isEntityUri)(n)){const t=e[a];return e[a]||console.error(`REMOVE_ATTRIBUTE. uri - ${n}, state: ${JSON.stringify(e)}`),(0,v.isEntitySpecialAttrType)(r)?qw({},e,{[a]:(0,v.removeEntitySpecialAttribute)({entity:t,attributeType:r})}):qw({},e,{[a]:(0,v.removeAttribute)({entity:t,attributeType:r,uri:n})})}return e}case ab.ADD_DEFAULT_VALUES:{const{attributeType:r,parentUri:n,metadata:a,mode:i}=t.payload,o=(0,v.getBaseUri)(n);if((0,v.isEntityUri)(o)){const t=(0,v.getEditableAttributeTypeSubAttributes)(a,r);return(0,O.over)((0,O.lensProp)(o),(0,v.addDefaultValuesToComplexAttribute)({attributeType:r,subAttributes:t,metadata:a,mode:i,parentUri:n}),e)}return e}default:return e}},relations:(e=hA,t)=>{switch(t.type){case XC.ENTITY_LOADED:{const{silent:r}=t.payload;return r?e:hA}case _C.RELATIONS_LOADED:{const{id:r,connections:n=[],total:a,mode:i}=t.payload;return(0,O.pipe)((0,O.assocPath)([r,"connections"],n),(0,O.assocPath)([r,"total"],a),(0,O.when)((0,O.both)((0,O.complement)((0,O.hasPath)([r,"drafts"])),(0,O.always)((0,v.isEditableMode)(i))),(0,O.assocPath)([r,"drafts"],EA)))(e)}case _C.SECOND_LEVEL_RELATIONS_LOADED:{const{id:r,connections:n,parentEntityUri:a,total:i}=t.payload,o=(0,O.path)([r,"connections"],e).map((e=>{const{entityUri:t}=e.entity;return t===a?yA({},e,{total:i,connections:n.map((e=>yA({},e,{parentEntityUri:a})))}):e}));return(0,O.assocPath)([r,"connections"],o,e)}case Sb.MODE_UPDATED:{const{mode:r,silent:n}=t.payload;return n?e:(0,O.map)(Mw(r)?(0,O.omit)(["drafts","relationsToEdit","relationToAdd"]):(0,O.assoc)("drafts",EA),e)}case _C.REMOVE_RELATION:{const{id:r,relationUri:n}=t.payload,a=(0,O.pipe)(v.getRelationUriFromConnection,(0,O.equals)(n)),i=(0,O.path)([r,"connections"],e),o=!((0,v.isTempUri)(n)||null!=i&&i.some((e=>e.suggested&&e.relation.relationUri===n)));return(0,O.evolve)({[r]:{drafts:(0,O.evolve)({removedUris:o?(0,O.append)(n):O.identity,addedConnections:(0,O.reject)(a),editedConnections:(0,O.reject)(a)})}},e)}case _C.IGNORE_RELATION:{const{id:r,ignoredRelationData:n}=t.payload;return(0,O.evolve)({[r]:{drafts:(0,O.evolve)({ignoredRelationData:(0,O.append)(n)})}},e)}case _C.ADD_RELATION:{const{id:r,connection:n}=t.payload,a=(0,O.omit)(["isNew"],n);return(0,O.evolve)({[r]:(0,O.pipe)((0,O.when)((0,O.propSatisfies)(O.isNil,"drafts"),(0,O.assocPath)(["drafts"],EA)),(0,O.evolve)({drafts:{addedConnections:(0,O.prepend)(a)}}))},e)}case _C.EDIT_RELATION:{const{id:r,connection:n}=t.payload,a=(0,O.eqBy)(v.getRelationUriFromConnection,n);if((0,v.isTempUri)((0,v.getRelationUriFromConnection)(n))){const t=e=>{const t=e.findIndex(a);return t>=0?(0,O.update)(t,n,e):e};return(0,O.evolve)({[r]:{drafts:(0,O.evolve)({addedConnections:t})}},e)}{const t=e=>{const t=e.findIndex(a);return t>=0?(0,O.update)(t,n,e):[...e,n]};return(0,O.evolve)({[r]:{drafts:(0,O.evolve)({editedConnections:t})}},e)}}case _C.UPDATE_RELATION_RATING:{const{id:r,connection:n,rating:a,user:i}=t.payload,o=n.initial?n:yA({},n,{initial:{connection:n}}),l=(0,v.isTempUri)((0,v.getRelationUriFromConnection)(o)),s=(0,O.eqBy)(v.getRelationUriFromConnection,o),c=e=>{const t=null==e?void 0:e.findIndex((e=>e.user===i));return!a&&t>=0?e.filter((e=>e.user!==i)):t>=0?(0,O.update)(t,a,e):[...e,a]},u=e=>{const t=e.findIndex(s);return t>=0?(0,O.update)(t,p,e):[...e,p]},p=(0,O.evolve)({relation:e=>yA({},e,{ratings:c((0,O.defaultTo)([],e.ratings))})},o);return(0,O.evolve)({[r]:{drafts:(0,O.evolve)({[l?"addedConnections":"editedConnections"]:u})}},e)}case _C.OPEN_RELATION_EDITOR:{const{id:r,connection:n}=t.payload,a=n.initial?n:yA({},n,{initial:{connection:n}});if(a.isNew){const t=(0,v.getRelationToAddPath)(r);return(0,O.path)(t,e)?e:(0,O.assocPath)(t,a,e)}{const t=(0,O.lensPath)((0,v.getRelationsToEditPath)(r)),n=(0,O.eqBy)((0,O.path)(["relation","relationUri"]),a);return(0,O.over)(t,(0,O.pipe)((0,O.defaultTo)([]),(0,O.unless)((0,O.find)(n),(0,O.append)(a))),e)}}case _C.SET_INITIAL_INFO:{const{id:r,relationUri:n,tempEntity:a}=t.payload,i=bA(r,n,e);return(0,O.assocPath)([...i,"initial","modifiedEntity"],a,e)}case _C.CLOSE_RELATION_EDITOR:{const{id:r,relationUri:n}=t.payload,a=(0,O.pathEq)(["relation","relationUri"],n);return(0,O.evolve)({[r]:{relationToAdd:(0,O.when)(a,(0,O.always)(null)),relationsToEdit:(0,O.reject)(a)}},e)}case _C.SET_RELATION_TYPE:{const{id:r,relationUri:n,relationType:a}=t.payload,i=bA(r,n,e);if(i){const t=[...i,"relation"],r=(0,O.lensPath)(t);return(0,O.over)(r,(0,v.applyRelationTypeObject)(a),e)}return e}case ab.ADD_ATTRIBUTES:return t.payload.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:a,viewId:i}=t,o=(0,v.getBaseUri)(n),l=vA(i,o,e);if(l&&(0,v.isRelationUri)(o)){if((0,v.isActivenessAttrType)(r)){const t=(0,O.view)(l,e),n=(0,v.addEntitySpecialAttribute)({entity:t,attributeType:r});return(0,O.set)(l,n,e)}{const t=TA(i,o,e),l=(0,O.view)(t,e);l||console.error(`relations.ADD_ATTRIBUTES. viewId - ${i}, relationUri - ${o}, state: ${JSON.stringify(e)}`);const s=(0,v.addAttribute)({entity:l,attributeType:r,parentUri:n,index:a});return(0,O.set)(t,s,e)}}return e}),e);case ab.ADD_NEXT_PAGE_ATTRIBUTE_VALUES:{const{parentUri:r,attributeTypeName:n,values:a,viewId:i}=t.payload;if(!(0,v.isRelationUri)(r))return e;const o=(0,v.getBaseUri)(r),l=bA(i,o,e),s=(0,O.lensPath)([...l,"relation","object","attributes",n]);return(0,O.over)(s,(0,O.pipe)((0,O.defaultTo)([]),(0,O.append)(a)),e)}case ab.MODIFY_ATTRIBUTE:{const{attributeType:r,viewId:n,uri:a,value:i}=t.payload,o=(0,v.getBaseUri)(a),l=vA(n,o,e);if(l&&(0,v.isRelationUri)(o)){if((0,v.isActivenessAttrType)(r)){const t=(0,O.view)(l,e),n=(0,v.editEntitySpecialAttribute)({entity:t,attributeType:r,value:i});return(0,O.set)(l,n,e)}{const t=TA(n,o,e),l=(0,O.view)(t,e);l||console.error(`relations.MODIFY_ATTRIBUTE. viewId - ${n}, relationUri - ${o}, state: ${JSON.stringify(e)}`);const s=(0,v.editAttribute)({entity:l,attributeType:r,uri:a,value:i});return(0,O.set)(t,s,e)}}return e}case ab.REMOVE_ATTRIBUTE:{const{attributeType:r,uri:n,viewId:a}=t.payload,i=(0,v.getBaseUri)(n),o=vA(a,i,e);if(o&&(0,v.isRelationUri)(i)){if((0,v.isActivenessAttrType)(r)){const t=(0,O.view)(o,e),n=(0,v.removeEntitySpecialAttribute)({entity:t,attributeType:r});return(0,O.set)(o,n,e)}{const t=TA(a,i,e),o=(0,O.view)(t,e);o||console.error(`relations.REMOVE_ATTRIBUTE. viewId - ${a}, relationUri - ${i}, state: ${JSON.stringify(e)}`);const l=(0,v.removeAttribute)({entity:o,attributeType:r,uri:n});return(0,O.set)(t,l,e)}}return e}case _C.SET_RELATION_ENTITY:{const{id:r,relationUri:n,entityInfo:a}=t.payload,i=bA(r,n,e);if(i){const t=[...i,"entity"],r=(0,O.lensPath)(t),{uri:n,label:o,type:l}=a,s=(0,O.isEmpty)(a)?{}:{entityUri:n,entityLabel:o,entityType:l,object:{uri:n,label:o,type:l}};return(0,O.set)(r,s,e)}return e}case ab.ADD_DEFAULT_VALUES:{const{viewId:r,attributeType:n,parentUri:a,metadata:i,mode:o}=t.payload,l=(0,v.getBaseUri)(a);if((0,v.isRelationUri)(l)){const t=bA(r,l,e);if(t){if(n){const r=[...t,"relation","object"],l=(0,v.getAttributeTypeSubAttributes)(i,n);return(0,O.over)((0,O.lensPath)(r),(0,v.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,O.view)((0,O.lensPath)(n),e),{attributes:s=[]}=(0,v.getRelationType)(i,l);return(0,O.over)((0,O.lensPath)(r),(0,v.addDefaultValuesToAttributes)({metadata:i,mode:o,attributeTypes:s,parentUri:a}),e)}}return e}return e}default:return e}},trees:(e=$A,t)=>(0,RA.ZP)(e,(r=>{switch(t.type){case Sb.MODE_UPDATED:{const{mode:e,silent:n}=t.payload;if(n)break;Object.keys(null==r?void 0:r.trees).forEach((e=>{UA(r.trees[e].root,"showDetails",!1)})),(0,v.isViewMode)(e)?(r.common.commands=[],r.initialTrees={}):(0,v.isEditableMode)(e)&&((0,v.isEmptyValue)(r.initialTrees)?r.initialTrees=qA({},r.trees):(r.common.commands=[],r.trees=qA({},r.initialTrees)));break}case Sb.MODE_EDITING_CANCELED:case OA.TREES_RESTORE_FROM_INITIAL_TREES:r.trees=qA({},r.initialTrees);break;case OA.TREES_RESET_INITIAL_TREES:r.initialTrees={};break;case XC.ENTITY_LOADED:{const{silent:r}=t.payload;return r?e:$A}case OA.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 OA.TREE_LOADING:{const e=t.payload;r.trees[e]=r.trees[e]||{},r.trees[e].loading=!0;break}case OA.TREE_CHILDREN_LOADING:{const{id:e,parentId:n,nodeId:a}=t.payload,i=r.trees[e].root,o=(0,v.findNodeById)(i,n);o.pending=!1,o.children=(o.children||[]).concat({entity:{},loading:!0,nodeId:a});break}case OA.TREE_CHILDREN_LOADED:{const{children:e,id:n,parentId:a}=t.payload,i=r.trees[n].root,o=(0,v.findNodeById)(i,a);o&&(o.children=((e=[],t=[])=>{const r=(0,O.reject)((0,O.prop)("loading"))(e);return t.forEach((t=>{e.find((e=>(0,O.path)(["entity","uri"],e)===t.entity.uri))||r.push(t)})),r})(o.children,e),delete o.pending);break}case OA.TREE_NODE_REMOVED:{const{id:e,nodeId:n}=t.payload,a=r.trees[e].root,i=(0,v.findParentNodeById)(a,n);DA(i||a,n);break}case OA.TREE_NODE_CREATED:{const{id:e,parentId:n,node:a}=t.payload,i=r.trees[e].root,o=(0,v.findNodeById)(i,n)||i,l=o.children.length;kA(o,a,l);break}case OA.TREE_NODE_EDITED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,v.findNodeById)(a,n.nodeId),o=Object.keys(n);for(const e of o)i[e]=n[e];break}case OA.TREE_NODE_EDITING_STARTED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,v.findNodeById)(a,n.nodeId),o=(0,v.findParentNodeById)(a,n.nodeId);i&&o&&(i.editingMode=v.NODE_EDITING_MODES.editing,i.relatedEntity=o.entity,delete i.loading,i.initialConnection=jA(i),FA({id:e,draft:r.trees,node:i}));break}case OA.TREE_NODE_EDITING_APPLIED:{const{id:e,node:a}=t.payload,i=r.trees[e].root,o=(0,v.findNodeById)(i,a.nodeId),l=BA({id:e,draft:r.trees,relationUri:a.relation.uri});var n;o&&l&&(zA(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,VA({id:e,draft:r.trees,relationUri:a.relation.uri}));break}case OA.TREE_NODE_EDITING_CANCELED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,v.findNodeById)(a,n.nodeId);i&&(zA(i),VA({id:e,draft:r.trees,relationUri:n.relation.uri}));break}case OA.TREE_NODE_NEW_PARENT_EDITING_STARTED:{const{id:e,node:n,newNode:a}=t.payload,i=r.trees[e].root,o=(0,v.findNodeById)(i,n.nodeId);if(a.relatedEntity=o.entity,a.relatedNodeId=o.nodeId,a.editingMode=v.NODE_EDITING_MODES.addingParent,i===o)a.children=[i],r.trees[e].root=a;else{const e=(0,v.findParentNodeById)(i,n.nodeId),t=e.children.findIndex((e=>o===e));kA(e,a,t)}a.initialConnection=jA(a),FA({id:e,draft:r.trees,node:a});break}case OA.TREE_NODE_NEW_PARENT_EDITING_APPLIED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,v.findNodeById)(a,n.nodeId),o=(0,v.findNodeById)(a,n.relatedNodeId),l=BA({id:e,draft:r.trees,relationUri:n.relation.uri});i&&l&&(HA({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=((e,t=[])=>PA(e,t.reduce(((e,t)=>_A({},e,{[t.entity.uri]:(0,O.pick)(["entity","parent","relations"],t)})),{})))(r.trees[e].entitiesMap,[o,GA(l)]),VA({id:e,draft:r.trees,relationUri:i.relation.uri}));break}case OA.TREE_NODE_NEW_PARENT_EDITING_CANCELED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,v.findNodeById)(a,n.nodeId);i&&(HA({id:e,draft:r.trees,currentNode:i}),VA({id:e,draft:r.trees,relationUri:i.relation.uri}));break}case OA.TREE_NODE_NEW_CHILD_EDITING_STARTED:{const{id:e,node:n,newNode:a}=t.payload,i=r.trees[e].root,o=(0,v.findNodeById)(i,n.nodeId);a.relatedEntity=o.entity,a.editingMode=v.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=jA(a),FA({id:e,draft:r.trees,node:a});break}case OA.TREE_NODE_NEW_CHILD_EDITING_APPLIED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,v.findParentNodeById)(a,n.nodeId),o=(0,v.findNodeById)(i,n.nodeId),l=BA({id:e,draft:r.trees,relationUri:n.relation.uri});i&&o&&l&&(zA(o),o.entity=l.entity,o.relation=l.relation,o.relations=[l.relation],VA({id:e,draft:r.trees,relationUri:n.relation.uri}));break}case OA.TREE_NODE_NEW_CHILD_EDITING_CANCELED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,v.findParentNodeById)(a,n.nodeId);i&&(DA(i,n.nodeId),VA({id:e,draft:r.trees,relationUri:n.relation.uri}));break}case OA.TREE_NODE_RELATION_TYPE_CHANGED:{const{id:e,node:n,relationTypeUri:a}=t.payload,i=BA({id:e,draft:r.trees,relationUri:n.relation.uri}).relation.type;i!==a&&(i&&MA({id:e,draft:r.trees,node:n,entity:null}),(({id:e,draft:t,node:r,relationTypeUri:n})=>{LA({path:["editingConnections",r.relation.uri,"relation"],object:t[e],value:e=>_A({},e,{type:n,attributes:{}})})})({id:e,draft:r.trees,node:n,relationTypeUri:a}));break}case OA.TREE_NODE_ENTITY_CHANGED:{const{id:e,node:n,entity:a}=t.payload;MA({id:e,draft:r.trees,node:n,entity:a});break}case ab.ADD_ATTRIBUTES:return t.payload.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:a,viewId:i}=t,o=(0,v.getBaseUri)(n),l=YA(i,o,e.trees);if(l&&(0,v.isRelationUri)(o)){const t=(0,O.view)(l,e.trees);if((0,v.isActivenessAttrType)(r)){const n=(0,v.addEntitySpecialAttribute)({entity:t,attributeType:r});return qA({},e,{trees:(0,O.set)(l,n,e.trees)})}{const i=(0,v.addAttribute)({entity:t,attributeType:r,parentUri:n,index:a});return qA({},e,{trees:(0,O.set)(l,i,e.trees)})}}return e}),e);case ab.MODIFY_ATTRIBUTE:{const{attributeType:r,viewId:n,uri:a,value:i}=t.payload,o=(0,v.getBaseUri)(a),l=YA(n,o,e.trees);if(l&&(0,v.isRelationUri)(o)){const t=(0,O.view)(l,e.trees);if((0,v.isActivenessAttrType)(r)){const n=(0,v.editEntitySpecialAttribute)({entity:t,attributeType:r,value:i});return qA({},e,{trees:(0,O.set)(l,n,e.trees)})}{const n=(0,v.editAttribute)({entity:t,attributeType:r,uri:a,value:i});return qA({},e,{trees:(0,O.set)(l,n,e.trees)})}}return e}case ab.REMOVE_ATTRIBUTE:{const{attributeType:r,uri:n,viewId:a}=t.payload,i=(0,v.getBaseUri)(n),o=YA(a,i,e.trees);if(o&&(0,v.isRelationUri)(i)){const t=(0,O.view)(o,e.trees);if((0,v.isActivenessAttrType)(r)){const n=(0,v.removeEntitySpecialAttribute)({entity:t,attributeType:r});return qA({},e,{trees:(0,O.set)(o,n,e.trees)})}{const a=(0,v.removeAttribute)({entity:t,attributeType:r,uri:n});return qA({},e,{trees:(0,O.set)(o,a,e.trees)})}}return e}case ab.ADD_DEFAULT_VALUES:{const{viewId:r,attributeType:n,parentUri:a,metadata:i,mode:o}=t.payload,l=(0,v.getBaseUri)(a),s=YA(r,l,e.trees);if((0,v.isRelationUri)(l)&&s){if(n){const t=(0,v.getAttributeTypeSubAttributes)(i,n);return qA({},e,{trees:(0,O.over)(s,(0,v.addDefaultValuesToComplexAttribute)({attributeType:n,subAttributes:t,metadata:i,mode:o,parentUri:a}),e.trees)})}{const t=(0,O.compose)(s,(0,O.lensPath)(["attributes"])),r=(0,O.compose)(s,(0,O.lensPath)(["type"])),n=(0,O.view)(r,e.trees),{attributes:l=[]}=(0,v.getRelationType)(i,n);return qA({},e,{trees:(0,O.over)(t,(0,v.addDefaultValuesToAttributes)({metadata:i,mode:o,attributeTypes:l,parentUri:a}),e.trees)})}}return e}case OA.TREE_ENTITIES_MAPPING_LOADED:{const{id:e,entitiesSubMap:n}=t.payload,a=r.trees[e].entitiesMap;r.trees[e].entitiesMap=PA(a,n);break}case OA.TREE_LOADED:{const{tree:e,id:n,graphTypes:a,activenessDate:i,isReversed:o}=t.payload,l=WA(r.trees[n]||{});r.trees[n]=qA({},l,e,{graphTypes:a,activenessDate:i,isReversed:o}),delete r.trees[n].errorMessage,r.trees[n].loading=!1;break}case OA.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,v.mapTree)(r.trees[e].root,{childrenProcessing:(0,v.sortTreeChildren)({sortField:a,sortOrder:i,typesLabelsMap:n})}));break}case OA.TREE_SECONDARY_LABEL_SHOWN:{const{id:e,show:n}=t.payload;r.trees[e].showSecondaryLabel=n,r.trees[e].root=qA({},r.trees[e].root);break}case OA.TREES_STATE_RESTORED:{const e=t.payload;Object.keys(e).forEach((t=>{r.trees[t]=r.trees[t]||{},r.trees[t]=qA({},r.trees[t],e[t]),r.trees[t].root&&(r.trees[t].root=qA({},r.trees[t].root))}));break}case OA.TREE_CHANGED:{const{id:e,tree:n}=t.payload;r.trees[e].root=n;break}case OA.TREE_REFRESHED:{const e=t.payload;r.trees[e].root=qA({},r.trees[e].root);break}case OA.TREE_NODE_EXPANDED:{const{id:e,nodeId:n}=t.payload,a=r.trees[e].root;(0,v.findNodeById)(a,n).expanded=!0;break}case OA.TREE_CURRENT_ENTITY_SHOWN:{const{id:n,uri:a=(0,O.path)(["entity","uri"],e)}=t.payload;if(r.trees[n]){const e=NA(r.trees[n].root,a);r.trees[n].scrollTo=e}break}case OA.TREE_SCROLL_TO_NODE_RESET:{const e=t.payload;r.trees[e]&&(r.trees[e].scrollTo=null);break}case OA.TREE_ACTIVENESS_DATE_CHANGED:{const{id:e,activenessDate:n}=t.payload;r.trees[e].activenessDate=n;break}case OA.TREE_RELATION_REPOINTED:{const{entity:e,relation:n,newParent:a,isReversed:i}=t.payload,o=(0,O.prop)("uri"),l=o(e),s=o(a),c=(0,v.createRelationRepointCommand)({entityUri:l,relation:n,newEntityUri:s,isReversed:i});r.common.commands.push(c);break}case OA.TREE_RELATION_REMOVED:{const{relationUri:e}=t.payload;if((0,v.isTempUri)(e))r.common.commands=(0,O.reject)((0,v.isRelationCommandForUri)(e),r.common.commands);else{const t=(0,v.createRelationDeleteCommand)({relationUri:e});r.common.commands.push(t)}break}case OA.TREE_RELATION_CREATED:{const{entityUri:e,relation:n,parentEntityUri:a}=t.payload,i=(0,v.createRelationCreateCommand)({parentUri:a,relation:n,entityUri:e});r.common.commands.push(i);break}case OA.TREE_RELATION_EDITED:{const{oldRelation:e,newRelation:n,entityUri:a,newEntityUri:i,isReversed:o}=t.payload,l=i?(0,v.createRelationRepointCommand)({entityUri:a,newEntityUri:i,relation:n,isReversed:o}):(0,v.createRelationUpdateCommand)({oldRelation:e,newRelation:n});r.common.commands.push(l);break}case OA.TREE_COMMANDS_CLEARED:r.common.commands=[];break;case OA.TREE_CANCEL_CHILDREN_LOADING:{const{id:e,parentId:n}=t.payload,a=r.trees[e].root,i=(0,v.findNodeById)(a,n);i&&(i.pending=!0,delete i.expanded,delete i.children);break}}})),operation:(e=null,t)=>t.type===o_.PROFILE_OPERATION_UPDATE?t.payload:e,views:(e=null,t)=>t.type===T_.PROFILE_VIEWS_SET?t.payload:e,sidePanelViews:(e=tI,t)=>t.type===eI.SIDE_PANEL_VIEWS_LOADED?t.payload:e,entityRelatedAttributes:(e=XA,t)=>{switch(t.type){case KA.ENTITY_RELATED_ATTRIBUTES_ADDED:{const{attributeTypeUri:r,entityUri:n,attributes:a}=t.payload;return(0,O.assocPath)([r,n],a,e)}case Sb.MODE_UPDATED:{const{mode:r,silent:n}=t.payload;return(0,v.isViewMode)(r)&&!n?XA:e}default:return e}},hiddenAttributes:(e=iI,t)=>{switch(t.type){case rI.HIDDEN_ATTRIBUTES_UPDATED:{const{uri:r,hiddenAttributes:n}=t.payload;return(0,O.assoc)(r,n,e)}case rI.HIDDEN_ATTRIBUTES_RESET:return(0,O.dissoc)(t.payload,e);default:return e}},controlAttributes:(e=sI,t)=>t.type===oI.CONTROL_ATTRIBUTES_UPDATED?t.payload:e});r(39235),r(58512),r(36801);const uI={getModule:()=>({id:"mdm",reducerMap:{dataTenants:$E,tenants:XE,metadata:nb,profile:cI,tenant:eO,environment:lO,user:qT,ui:WT,search:nv},sagas:[...rA,...KC,...J_,...Jb]}),selectors:c},pI=uI,dI=({className:e})=>{const t=(0,sp.useDispatch)(),r=(0,sp.useSelector)(Ti.qx),n=(0,sp.useSelector)(pI.selectors.getGoogleMapKey),a=(0,ap.useMemo)((()=>((e,t)=>(0,O.when)((0,O.always)(!t),(0,O.reject)((0,O.propEq)("id",B.om.MAP)))(e))([{id:B.om.MAP,tooltipTitle:ei().text("View map"),Icon:GE()},{id:B.om.PROFILE,tooltipTitle:ei().text("View entity details"),Icon:YE()}],n)),[n]);return ip().createElement(DE,{className:e,modes:a,modeId:r,onChange:e=>{t(Ei(r!==e?e:null))}})};dI.propTypes={className:lp().string};const mI=dI,fI=()=>ip().createElement("div",{className:bd},ip().createElement("div",{className:"Headers-styles-title--TvsMA"},ei().text("Profiles")),ip().createElement("div",{className:vd},ip().createElement(zE,null),ip().createElement(mI,{className:Td})));var yI=r(12932),gI=r.n(yI),hI=r(83754),EI=r.n(hI);const bI=(0,Sp.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 vI(){return vI=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vI.apply(null,arguments)}function TI(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}const OI=e=>{let{value:t,tabs:r=[],onChange:n,tabClasses:a}=e,i=TI(e,["value","tabs","onChange","tabClasses"]);const o=bI(),l=(e,t)=>ip().createElement("span",{className:o.labelWrapper},ip().createElement(ad.Y,{value:e},ip().createElement("span",{className:o.label},e)),t);return ip().createElement(gI(),vI({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=TI(e,["label","value","additionalLabel","dataReltioId"]);return ip().createElement(EI(),vI({classes:a||{root:o.tabRoot,disabled:o.disabled},key:r,value:r,label:l(t,n),"data-reltio-id":i},s))})))};function SI(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class xI extends ap.PureComponent{constructor(...e){super(...e),this.getTabsData=()=>{const{tenantObject:e,tableViewTabs:t,selectedEntityTypes:r,metadata:n}=this.props,a=(0,hy.ZK)(t,e);return(0,vi.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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){SI(e,t,r[t])}))}return e}({},e,{additionalLabel:ip().createElement("span",{className:"Headers-styles-number--trErH"},"(",void 0===e.number?ei().text("N/A"):(0,Ka.k7)(e.number),")")})))},this.onTabChange=e=>{this.props.dispatch(di(e))},this.onSelectColumns=e=>{const{dispatch:t,entityTypeTab:r,columnsForEntityType:n}=this.props;return t(pi(r,e,n))},this.renderTabs=()=>{const{entityTypeTab:e}=this.props;return ip().createElement("div",{className:"Headers-styles-tabsContainer--lhDXc"},ip().createElement(OI,{value:e,tabs:this.getTabsData(),onChange:this.onTabChange}))}}render(){const{entityTypeTab:e,columnsForEntityType:t}=this.props;return ip().createElement("div",{className:bd},this.renderTabs(),ip().createElement("div",{className:vd},ip().createElement(xd,{entityTypeUri:e,headColumns:t,onSelectColumns:this.onSelectColumns,"data-reltio-id":"reltio-search-table-add-remove-column",disabled:!e,showForDisabled:!0}),ip().createElement(Cf(),{orientation:"vertical",className:"Headers-styles-splitter--sCvn6"}),ip().createElement(zE,null),ip().createElement(mI,{className:Td})))}}const CI=(0,sp.connect)((e=>{const t=(0,Ti.o4)(e);return{metadata:A().selectors.getMetadata(e),selectedEntityTypes:(0,C.DX)(e),tableViewTabs:(0,Ti.gu)(e),entityTypeTab:t,columnsForEntityType:(0,Ti.Gv)(e,t),tenantObject:(0,Xa.t9)(e)}}))(xI);function wI(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class AI extends ip().PureComponent{constructor(...e){super(...e),this.entitiesTableRef=this.props.basicTableRef||ip().createRef(),this.state={resizeDebounceDelay:void 0},this.sortHandle=({field:e,order:t})=>{this.props.dispatch((({field:e,order:t,entityTypeUri:r})=>({type:_.Z.CHANGE_SORT,payload:{field:e,order:t,entityTypeUri:r}}))({field:t?e:null,order:t,entityTypeUri:this.props.entityTypeUri}))},this.reorderingHandle=({what:e,where:t})=>{const{entityTypeUri:r,dispatch:n,headColumns:a}=this.props;n(((e,t)=>({type:ge,payload:{entityTypeUri:e,columns:t}}))(r,(0,O.move)(e.columnIndex,t.columnIndex,a)))},this.changeColumnsListHandle=({columns:e})=>{const{entityTypeUri:t,dispatch:r,headColumns:n}=this.props;r(pi(t,e,n))},this.changeColumnsSizeHandle=e=>{const{headColumns:t,entityTypeUri:r,dispatch:n}=this.props,a=t.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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){wI(e,t,r[t])}))}return e}({},t,{size:e[r].size,autoResize:(t.autoResize??0!==r)&&!e[r].manuallyChanged})));n(((e,t)=>({type:he,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,O.path)(["headColumns","length"],e)||(0,O.difference)((0,O.omit)(["size"],t),(0,O.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 ip().createElement(nf,{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})}}AI.propTypes={entities:lp().array,entityToHighlight:lp().string,selectedEntityUri:lp().string,headColumns:lp().array,onScroll:lp().func,entityTypeUri:lp().string,sortField:lp().string,sortOrder:lp().oneOf([Cd.oy,Cd.U9]),dndColumnReorderingEnabled:lp().bool,dispatch:lp().func,additionalColumns:lp().arrayOf(lp().shape({id:lp().string,label:lp().string})),onEntityClick:lp().func,onEntityHover:lp().func,entitiesImportStatus:lp().object,onEntityImportStatusChange:lp().func,basicTableRef:lp().shape({current:lp().object})},AI.defaultProps={entities:[],headColumns:[]};const RI=(0,Df.Z)(vi.oq),_I=(0,sp.connect)((e=>{const t=(0,Ti.tB)(e),r=(0,Ti.Gv)(e,t),n=A().selectors.getMetadata(e),a=RI(n,t,r);return{sortField:(0,Xa.NW)(e,{entityTypeUri:(0,Ti.o4)(e)}),sortOrder:(0,Xa.L9)(e,{entityTypeUri:(0,Ti.o4)(e)}),dndColumnReorderingEnabled:!(0,Ti.Ue)(e),headColumns:r,entityTypeUri:t,additionalColumns:a}}))(AI);var II=r(14058),NI=r.n(II);const PI=(0,Sp.Z)((()=>({container:{position:"relative",height:"100%",width:"100%"},closeButton:{position:"absolute",top:"7px",left:"7px",zIndex:1}}))),DI=(0,Sp.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"}}}))),kI=({className:e,entity:t,children:r,classes:n,renderLabel:a=O.identity})=>{const i=DI({classes:n}),o=(0,Uf.AH)(),l=(0,Uf.QQ)(),s=(0,ap.useCallback)((()=>{navigator.clipboard.writeText((0,v.getEntityId)(t))}),[t]);if((0,O.isNil)(t))return null;const c=(0,v.getLabel)(t.label),u=t.secondaryLabel,p=(0,v.getBusinessCardAttributesText)(o,t),d=(0,v.isActiveObject)(t),m=t.uri,f=(0,v.getEntityId)(t);return ip().createElement("div",{className:up()(i.profileBandWrapper,e),"data-reltio-id":"reltio-profile-band"},ip().createElement("div",{className:up()(i.profileBand,{[i.inactive]:!d}),"data-entity-uri":m},ip().createElement(b.A,{key:t.uri,entity:t,avatarClassName:i.profileIcon,imageClassName:i.imageProfileIcon}),ip().createElement("div",{className:i.profileInfo},ip().createElement("div",null,ip().createElement(hf(),{variant:"h6",className:i.label},a(c)),u&&ip().createElement(hf(),{variant:"subtitle2",className:i.secondaryLabel},u),p&&ip().createElement(hf(),{variant:"subtitle1",className:i.businessCard},p)),ip().createElement("div",{className:i.specialInfo},ip().createElement("div",{className:i.entityType},ip().createElement(cE,{entity:t,size:"medium",className:i.badge}),!(0,v.isTempUri)(m)&&l&&ip().createElement(ng(),{title:ei().text("Copy to clipboard")},ip().createElement(hf(),{display:"inline",variant:"body2",className:i.entityId,onClick:s},ei().text("Entity ID"),": ",f))))),r&&ip().createElement("div",null,r)))},LI=ip().createContext(!1);LI.displayName="BlockImageGalleryDialogContext";var UI=r(31574),jI=r.n(UI);const FI=ip().createContext([]),MI=(0,ap.createContext)([]);MI.displayName="AlwaysVisibleAttributesContext";var VI=r(24436),BI=r.n(VI);function zI(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){HI(e,t,r[t])}))}return e}function HI(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const YI=(0,Sp.Z)((e=>({basicViewPaper:zI({display:"flex",flexDirection:"column"},e.basicView)})));function WI(){return WI=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},WI.apply(null,arguments)}const GI=(0,ap.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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["children","className"]);const i=YI();return ip().createElement(BI(),WI({ref:t,className:n,classes:{root:i.basicViewPaper}},a),r)}));GI.displayName="BasicView";var qI=r(52574);const ZI="1px solid #AFD4E9",$I=(0,Sp.Z)({decorator:{marginLeft:8,borderLeft:ZI,"&:last-child":{borderLeft:"none","&:before":{borderLeft:ZI}},"&:before":{top:0,height:14,width:5,borderBottom:ZI,content:'""',display:"block",left:"0"},"&$plain":{"&:before":{width:0}}},plain:{},wrapper:{marginLeft:16,marginTop:-8}}),KI=({className:e,children:t,plain:r=!1,enabled:n=!1})=>{const a=$I();return n?ip().createElement("div",{"data-reltio-id":"branch-decorator",className:up()(a.decorator,{[a.plain]:r},e)},ip().createElement("div",{className:a.wrapper},t)):ip().createElement(ip().Fragment,null,t)},XI="commentsContainerVisibilityArea",QI=ip().createContext([]);QI.displayName="RelatedObjectUrisContext";const JI={comments:[],commentsMap:null,currentComment:null,updateCommentState:O.identity,clearCommentState:O.identity,getCommentState:()=>({}),getComment:O.identity,getComments:()=>new Promise(O.identity),getCommentsCount:O.identity,createComment:()=>new Promise(O.identity),editComment:()=>new Promise(O.identity),createReply:()=>new Promise(O.identity),resolveThread:O.identity,reOpenThread:O.identity,clearCurrentComment:O.identity,deleteComment:O.identity,sending:!1,loading:!1,pageToken:null,deleteReply:O.identity,editReply:()=>new Promise(O.identity)},eN=ip().createContext(JI);function tN(){return tN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},tN.apply(null,arguments)}eN.displayName="CollaborationContext";const rN=e=>ip().createElement("svg",tN({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),ip().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"})),nN=(0,Sp.Z)((()=>({root:{position:"relative",height:"18px",display:"flex",alignItems:"center",justifyContent:"center",marginLeft:"4px",cursor:"pointer"},icon:{"&:hover":{fillOpacity:.7}}})));function aN(){return aN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},aN.apply(null,arguments)}const iN=ip().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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["children","tooltipTitle","icon","onClick","className"]);const s=nN();return ip().createElement(ng(),{title:n},ip().createElement("div",aN({ref:t,className:up()(s.root,o),onClick:i},l),ip().createElement(a,{className:s.icon}),r))}));iN.displayName="BasicCommentButton";const oN=(0,Sp.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"}}),lN=ip().forwardRef((({children:e,onClick:t},r)=>{const n=oN();return ip().createElement(iN,{ref:r,tooltipTitle:ei().text("Show comment"),icon:rN,onClick:t,"data-reltio-id":"reltio-comment-button"},ip().createElement("div",{className:n.childrenWrapper},e))}));function sN(){return sN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},sN.apply(null,arguments)}lN.displayName="CommentButton";const cN=e=>ip().createElement("svg",sN({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),ip().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"})),uN=({className:e,onClick:t})=>ip().createElement(iN,{className:e,onClick:t,tooltipTitle:ei().text("Add comment"),icon:cN});var pN=r(94511),dN=r.n(pN),mN=r(59674);const fN=(0,Sp.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 yN(){return yN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},yN.apply(null,arguments)}const gN=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["children","className","classes","transition"]);const o=fN(),l=a?dN():ip().Fragment,[s,c]=(0,ap.useState)(null);return ip().createElement(mN.r,yN({className:up()(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),(({TransitionProps:e})=>ip().createElement(l,e,ip().createElement(BI(),{className:up()(o.paper,null==n?void 0:n.root)},ip().createElement("span",{className:up()(o.arrow,null==n?void 0:n.arrow),ref:c}),t))))};var hN=r(93526),EN=r.n(hN);const bN=(0,Sp.Z)((e=>({menuItem:{minHeight:"32px"},menuText:{color:e.palette.text.primary,fontSize:"13px",lineHeight:"15px",letterSpacing:0}}))),vN=(0,id.T)(Wp()),TN=(0,ap.forwardRef)((({item:e,onMenuClose:t=O.identity},r)=>{const n=bN(),{disabled:a,text:i,tooltip:o,onClick:l,id:s="",selectable:c,selected:u}=e;return ip().createElement(vN,{tooltipTitle:o,showForDisabled:!0,classes:{root:n.menuItem},onClick:e=>{t(e),l(e)},disabled:a,ref:r,"data-modal":!0,"data-reltio-id":`reltio-search-menu-item${s}`},c&&ip().createElement(Hp(),{checked:u,color:"primary"}),ip().createElement(hf(),{classes:{root:n.menuText}},i))}));TN.displayName="DefaultMenuItemRenderer";const ON=(0,Sp.Z)((e=>({buttonRoot:{"&$selected":{color:e.palette.action.active,backgroundColor:(0,xm.alpha)(e.palette.action.active,.12),"&:hover":{backgroundColor:(0,xm.alpha)(e.palette.action.active,.15)}}},selected:{},paper:{minWidth:"112px"}})));function SN(){return SN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},SN.apply(null,arguments)}function xN({className:e,menuId:t,buttonComponent:r=Gh(),buttonContent:n,menuItems:a=[],buttonProps:i={},popoverProps:o={},onMenuOpen:l=O.identity,onMenuClose:s=O.identity,MenuItemRenderer:c=TN}){const u=r,p=ON(),d=(0,ap.useRef)(),[m,f]=(0,ap.useState)(!1);(0,mE.D)((()=>{m?l():s()}),[m]);const y=(0,ap.useCallback)((e=>{null==e||e.stopPropagation(),f((e=>!e))}),[]);return ip().createElement(ip().Fragment,null,ip().createElement(u,SN({"data-reltio-id":"drop-down-menu-button",ref:d,className:up()(p.buttonRoot,{[p.selected]:m},e),onClick:y,"aria-pressed":m,"aria-controls":m?t:void 0,"aria-haspopup":"true"},i),n),ip().createElement(EN(),SN({id:t,variant:"menu",open:m,autoFocus:!1,classes:{paper:p.paper},anchorEl:d.current,onClose:y,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},elevation:2,MenuListProps:{autoFocusItem:m}},o),a.map(((e,t)=>ip().createElement(c,{item:e,key:t,onMenuClose:y})))))}const CN=(e,t)=>{(0,ap.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])},wN=(e,t)=>{const r=e.relatedObjectUris.indexOf(t);if(r>=0)return e.relatedObjectUris[1-r]},AN=e=>`${ei().date(e,"LT")} ${ei().date(e,"LL")}`,RN=e=>`comment/${e.commentId}`,_N=(e,t)=>`comment/${e.commentId}/reply/${t.replyId}`,IN=(e,t)=>{let r=e;for(const e of t)r=r.split(`+${e}`).join(`@[${e}](${e})`);return r},NN=ip().createContext({});NN.displayName="EntitiesMapContext";const PN=(0,Sp.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 DN(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const kN=({comment:e,className:t})=>{const r=PN(),n=(0,ap.useContext)(NN),a=(0,Uf.AH)(),i=(0,Uf.eh)();return ip().createElement(jI(),{className:t},(()=>{switch(e.objectType){case v.CollaborationObjectTypes.ENTITY_ATTRIBUTE:{const t=(0,v.getAttributeTypeUriByValueUri)(e.objectId,i.type),n=(0,v.findAttributeTypeByUri)(a,t);return ip().createElement(ip().Fragment,null,ip().createElement(hf(),{className:r.title},ei().text("Selected attribute:")),ip().createElement(hf(),{className:r.label},null==n?void 0:n.label))}case v.CollaborationObjectTypes.RELATION_ATTRIBUTE:{const t=e.relatedObjectUris.find((0,O.startsWith)("configuration/relationTypes")),n=t&&(0,v.getAttributeTypeUriByValueUri)(e.objectId,t),i=n&&(0,v.findAttributeTypeByUri)(a,n);return ip().createElement(ip().Fragment,null,ip().createElement(hf(),{className:r.title},ei().text("Selected attribute:")),ip().createElement(hf(),{className:r.label},null==i?void 0:i.label))}case v.CollaborationObjectTypes.ENTITY:return ip().createElement(ip().Fragment,null,ip().createElement(hf(),{className:r.title},ei().text("Selected profile:")),ip().createElement(Ld.x,{className:up()(r.label,r.link),value:(0,v.getEntityUriForLink)(i)},(0,v.getLabel)(i.label)));case v.CollaborationObjectTypes.RELATION:{const t=wN(e,i.uri),a=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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){DN(e,t,r[t])}))}return e}({},n[t]||{},{uri:t});return ip().createElement(ip().Fragment,null,ip().createElement(hf(),{className:r.title},ei().text("Selected relation:")),ip().createElement(hf(),{className:r.label},ip().createElement(Ld.x,{className:r.link,value:(0,v.getEntityUriForLink)(i)},(0,v.getLabel)(i.label)),t&&ip().createElement(ip().Fragment,null,` ${ei().text("to")} `,ip().createElement(Ld.x,{className:r.link,value:(0,v.getEntityUriForLink)(a)},a.label?(0,v.getLabel)(a.label):(0,v.getEntityId)(a)))))}case v.CollaborationObjectTypes.POTENTIAL_MATCH:{var t;const a=wN(e,i.uri),o={uri:a,label:null===(t=n[a])||void 0===t?void 0:t.label};return ip().createElement(ip().Fragment,null,ip().createElement(hf(),{className:r.title},ei().text("Selected potential match:")),ip().createElement(hf(),{className:r.label},ip().createElement(Ld.x,{className:r.link,value:(0,v.getEntityUriForLink)(i)},(0,v.getLabel)(i.label)),a&&ip().createElement(ip().Fragment,null,` ${ei().text("and")} `,ip().createElement(Ld.x,{className:r.link,value:(0,v.getEntityUriForLink)(o)},o.label?(0,v.getLabel)(o.label):(0,v.getEntityId)(o)))))}default:return null}})())},LN=ip().createContext([]);LN.displayName="UsersContext";const UN=(0,Sp.Z)((e=>({root:{color:e.palette.text.primary,fontSize:"13px",lineHeight:"15px",wordBreak:"break-word"}}))),jN=({comment:e,className:t})=>{const r=UN(),n=(0,ap.useContext)(LN);return ip().createElement(hf(),{className:up()(r.root,t)},((e,t,r=(e=>e),n="+")=>{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})(e.content,e.namedUsers,(e=>{const t=n.find((t=>t.username===e.slice(1)));return t?ip().createElement(ry(),{href:`mailto:${t.email}`,underline:"hover"},e):e})).map(((e,t)=>ip().createElement(ap.Fragment,{key:t},e))))},FN=(0,Sp.Z)((e=>({root:{width:"32px",height:"32px",fontSize:"12px",color:e.palette.text.secondary,backgroundColor:"rgba(144, 164, 174, 0.2)"}})));function MN(){return MN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},MN.apply(null,arguments)}const VN=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","children"]);const a=FN();return ip().createElement(Yd(),MN({},n,{className:up()(a.root,t)}),r.split(".").map((e=>e[0].toUpperCase())).join(""))};var BN=r(2271);const zN=r(47503).$+1,HN=(0,Sp.Z)((e=>({root:{backgroundColor:"#fff",fontFamily:"Roboto"},mentionsControl:{fontSize:"13px"},mentionsHighlighter:{padding:"10px 22px",border:"1px solid transparent !important","&::before":{content:({placeholder:e})=>e&&`"${e}"`}},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:zN+"!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":{backgroundColor:"rgba(0,0,0,0.04)"}},mentionsSuggestionsItemFocused:{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 YN(){return YN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},YN.apply(null,arguments)}const WN=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["onChange","className","value","placeholder"]);const o=HN({placeholder:n?"":a}),l=(0,ap.useContext)(LN);return ip().createElement("div",{className:up()(o.root,r)},ip().createElement(BN.r,YN({},i,{value:n,placeholder:a,onChange:(e,r,n,a)=>{t(r,n,(0,O.uniq)(a.map((({display:e})=>e.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,"mentionsTextArea__suggestions__item--focused":o.mentionsSuggestionsItemFocused}}),ip().createElement(BN.p,{trigger:"+",data:l.map((({username:e})=>({id:e,display:e}))),displayTransform:(e,t)=>`+${t}`,appendSpaceOnAdd:!0,className:o.mention})))},GN=(0,Sp.Z)({root:({isEditing:e})=>({padding:e?"6px 6px 6px 0":" 6px 6px 6px 8px",borderRadius:"4px",backgroundColor:e?"transparent":"rgba(0,114,206,0.06)"}),textField:({isEditing:e})=>({width:e?"100%":"calc(100% - 40px)"}),form:{marginBottom:0},main:{display:"flex",alignItems:"center"},avatar:{marginRight:"8px"},buttons:({isEditing:e})=>({marginLeft:e?"0":"40px",marginTop:"8px"}),button:{"& + $button":{marginLeft:"8px"}}}),qN=e=>{switch(e){case"open":return ei().text("Reply...");case"resolved":return ei().text("Adding a comment will re-open this");default:return""}},ZN=({inputRef:e,className:t,uri:r,relatedObjectUris:n,objectType:a,popperRef:i,comment:o,reply:l,isEditingComment:s,isEditingReply:c,onCancel:u})=>{const p=s||c,d=GN({isEditing:p}),[m,f]=(0,ap.useState)(!1),{createReply:y,createComment:g,sending:h,editComment:E,editReply:b,getCommentState:v,updateCommentState:T,clearCommentState:S}=(0,ap.useContext)(eN),x=(0,Uf.qg)(),C=(({comment:e,reply:t,isEditingComment:r,isEditingReply:n})=>(0,O.isNil)(e)?"comment/new":r?RN(e):n?_N(e,t):(e=>`comment/${e.commentId}/reply/new`)(e))({comment:o,reply:l,isEditingComment:s,isEditingReply:c}),w=(({comment:e,reply:t,isEditingComment:r,isEditingReply:n})=>{const a=r?e:n?t:null,{content:i="",namedUsers:o=[]}=a||{};return{value:IN(i,o),plainTextValue:i,mentions:o}})({comment:o,reply:l,isEditingComment:s,isEditingReply:c}),{value:A=w.value,plainTextValue:R=w.plainTextValue,mentions:_=w.mentions}=v(r,C),I=""!==w.value.trim(),N=""!==A.trim(),P=m||N||I,D=null==o?void 0:o.status,k=()=>{null==u||u(),S(r,C)};(0,ap.useEffect)((()=>{i&&i.current.forceUpdate()}),[i,P]);const L=p?"small":"medium";return ip().createElement(jI(),{className:up()(d.root,t)},ip().createElement("form",{onSubmit:e=>(e.preventDefault(),(0,O.cond)([[(0,O.always)(!o),()=>g({content:R,namedUsers:_,objectType:a,uri:r,relatedObjectUris:n})],[(0,O.always)(s),()=>E({content:R,namedUsers:_,commentId:o.commentId,objectType:a,replies:o.replies,relatedObjectUris:n,uri:r})],[(0,O.always)(c),()=>b({content:R,namedUsers:_,commentId:o.commentId,replyId:l.replyId})],[O.T,()=>y({content:R,namedUsers:_,commentId:o.commentId,action:"open"===o.status?"none":"reopen",uri:r})]])().then(k).catch(console.log)),className:d.form},ip().createElement(jI(),{className:d.main},!p&&ip().createElement(VN,{classes:{root:d.avatar}},x),ip().createElement(WN,{className:d.textField,disabled:h,onChange:(e,t,n)=>T(r,C,{value:e,plainTextValue:t,mentions:n}),inputRef:e,value:A,onFocus:()=>f(!0),onBlur:()=>f(!1),placeholder:qN(D)})),P&&ip().createElement(jI(),{className:d.buttons},ip().createElement(Gh(),{className:d.button,variant:"contained",color:"primary",disabled:!N||h,type:"submit",size:L},((e,t,r)=>t||r?ei().text("Edit"):"open"===e||"resolved"===e?ei().text("Reply"):ei().text("Comment"))(D,s,c)),ip().createElement(Gh(),{disabled:h,onClick:()=>k(),className:d.button,variant:"outlined",color:"primary",size:L},ei().text("Cancel")))))},$N=(0,Sp.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"}}))),KN=({onReply:e,className:t,uri:r,comment:n,relatedObjectUris:a,objectType:i})=>{const o=$N(),l=(0,ap.useRef)(),s=(0,Uf.qg)(),{commentId:c,createdBy:u,createdTime:p,status:d}=n,m="resolved"===d,f=u===s,{resolveThread:y,reOpenThread:g,sending:h,deleteComment:E,updateCommentState:b,getCommentState:v}=(0,ap.useContext)(eN),T=RN(n),{isEditing:O}=v(r,T),S=(0,ap.useCallback)((e=>b(r,T,{isEditing:e})),[T,b,r]);CN(l,O);const x=(0,ap.useMemo)((()=>m?[{text:ei().text("Delete"),onClick:()=>E({uri:r,commentId:c})}]:[{text:ei().text("Edit"),onClick:()=>S(!0)},{text:ei().text("Delete"),onClick:()=>E({uri:r,commentId:c})}]),[c,E,m,S,r]),C=ip().createElement(ZN,{inputRef:l,uri:r,relatedObjectUris:a,objectType:i,onCancel:()=>S(!1),isEditingComment:O,comment:n});return ip().createElement(jI(),{className:t},ip().createElement(jI(),{className:o.header},ip().createElement(VN,{classes:{root:o.avatar}},u),ip().createElement(jI(),{width:"100%"},ip().createElement(hf(),{className:o.username},u)),ip().createElement(hf(),{className:o.createdAt},AN(p)),f&&ip().createElement(xN,{buttonComponent:gd.k,buttonProps:{icon:Id(),tooltipTitle:ei().text("Open menu")},popoverProps:{PopoverClasses:{root:o.dropdownMenu}},menuItems:x,menuId:"collaboration-comment-menu"})),ip().createElement(jI(),{className:o.body},ip().createElement(kN,{comment:n,className:o.commentTarget}),O?C:ip().createElement(jN,{comment:n,className:o.message}),ip().createElement(jI(),{className:o.buttons},ip().createElement(ry(),{className:o.button,onClick:e,component:"button",underline:"hover"},ei().text("Reply")),!m&&ip().createElement(ry(),{disabled:h,className:o.button,onClick:()=>{y({commentId:c,uri:r})},component:"button",underline:"hover"},ei().text("Resolve")),m&&ip().createElement(ry(),{disabled:h,className:o.button,onClick:()=>{g({commentId:c,uri:r})},component:"button",underline:"hover"},ei().text("Re-open")))))},XN=(0,Sp.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"}}))),QN=({className:e,reply:t,uri:r,comment:n,popperRef:a})=>{const i=(0,ap.useRef)(),o=(0,Uf.qg)(),{createdBy:l,action:s,createdTime:c}=t,u=l===o&&"resolved"!==n.status,{deleteReply:p,updateCommentState:d,getCommentState:m}=(0,ap.useContext)(eN),f=_N(n,t),{isEditing:y}=m(r,f),g=(0,ap.useCallback)((e=>d(r,f,{isEditing:e})),[f,d,r]);CN(i,y);const h=XN(),E=(0,ap.useMemo)((()=>[{text:ei().text("Edit"),onClick:()=>g(!0)},{text:ei().text("Delete"),onClick:()=>p({uri:r,commentId:n.commentId,reply:t})}]),[p,r,n.commentId,t,g]),b=ip().createElement(ZN,{inputRef:i,popperRef:a,uri:r,onCancel:()=>g(!1),isEditingReply:y,reply:t,comment:n});return ip().createElement(jI(),{className:up()(h.root,e)},ip().createElement(VN,{classes:{root:h.avatar}},l),ip().createElement(jI(),{className:h.replyArea},ip().createElement(jI(),{className:h.header},ip().createElement(hf(),{className:h.username},l),"resolve"===s&&ip().createElement(hf(),{className:h.marked},ei().text("Marked as resolved")),"reopen"===s&&ip().createElement(hf(),{className:h.marked},ei().text("Re-opened"))),"resolve"!==s&&(y?b:ip().createElement(jN,{className:h.message,comment:t})),ip().createElement(hf(),{className:h.createdAt},AN(c))),u&&ip().createElement(xN,{buttonComponent:gd.k,buttonProps:{icon:Id(),tooltipTitle:ei().text("Open menu")},menuItems:E,menuId:"collaboration-comment-menu"}))},JN=(0,Sp.Z)((()=>({root:{maxWidth:"100%",padding:"8px 4px 10px 16px"},messages:{},repliedComment:{marginBottom:"2px"},replies:{marginLeft:"40px"},sendMessageArea:{marginLeft:"40px"},comment:{}}))),eP=({uri:e,relatedObjectUris:t,objectType:r,classes:n,popperRef:a,messagesRef:i,comment:o})=>{const l=(0,ap.useRef)(),s=JN({classes:n}),c=ip().createElement(ZN,{className:s.sendMessageArea,inputRef:l,popperRef:a,uri:e,relatedObjectUris:t,objectType:r,comment:o});return ip().createElement(jI(),{className:s.root},o&&ip().createElement(ip().Fragment,null,ip().createElement("div",{className:s.messages,ref:i},ip().createElement(KN,{comment:o,uri:e,onReply:()=>{l.current.focus()},className:s.comment,relatedObjectUris:t,objectType:r}),ip().createElement(jI(),{className:s.replies},o.replies.map((t=>ip().createElement(QN,{key:t.replyId,className:s.repliedComment,reply:t,uri:e,comment:o}))))),c),!o&&c)},tP=(0,ap.memo)(eP),rP=(0,Sp.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:({hasScroll:e})=>({marginLeft:"16px",marginRight:e?"2px":"8px"}),replies:({hasScroll:e})=>({marginLeft:"8px",marginRight:e?"2px":"8px"}),sendMessageArea:({hasScroll:e,scrollWidth:t})=>({marginLeft:"8px",marginRight:e?t+2:"8px"}),messages:{maxHeight:"400px",overflowY:"auto"}}))),nP=({uri:e,relatedObjectUris:t,objectType:r,anchorEl:n,onClose:a,open:i,comment:o})=>{const[l,s]=(0,ap.useState)(0),c=rP({scrollWidth:l,hasScroll:0!==l}),u=(0,ap.useRef)(null),{resolveThread:p,loading:d,sending:m}=(0,ap.useContext)(eN),f=1+(null==o?void 0:o.replies.length);return ip().createElement(gN,{popperRef:u,anchorEl:n,open:i,placement:"right-start",onClose:a,className:c.popper},ip().createElement(jI(),{className:c.header},ip().createElement(jI(),{className:c.headerInfo},ip().createElement(hf(),{className:c.title},ei().text("Comments")),o&&!d&&ip().createElement(hf(),{className:c.counter},ei().number(f)," ",1===f?ei().text("item"):ei().text("items"))),o&&!d&&ip().createElement(gd.k,{className:c.resolveButton,size:"S",onClick:()=>{p({commentId:o.commentId,uri:e})},disabled:m,showForDisabled:!0,tooltipTitle:ei().text("Resolve"),icon:fm(),color:"primary"})),!d&&ip().createElement(tP,{popperRef:u,messagesRef:e=>{e&&s(e.offsetWidth-e.clientWidth)},classes:{root:c.collaborationItem,replies:c.replies,sendMessageArea:c.sendMessageArea,messages:c.messages,comment:c.comment},uri:e,relatedObjectUris:t,objectType:r,comment:o}))},aP=(0,Sp.Z)((()=>({root:{display:"flex",alignItems:"start"},addButton:{visibility:"hidden","&$showAlways":{visibility:"visible"},".commentsContainerVisibilityArea:hover &":{visibility:"visible"}},showAlways:{}}))),iP=({className:e,uri:t,objectType:r,relatedObjectUris:n,onChangePopupVisibility:a,allowOnlyOneComment:i=!1,showAlways:o=!1})=>{const l=aP(),[s,c]=(0,ap.useState)(null),[u,p]=(0,ap.useState)(!1),d=u&&Boolean(s),{currentComment:m,commentsMap:f,getComment:y,clearCurrentComment:g,objectTypes:h}=(0,ap.useContext)(eN),E=!!f&&(!h||h.includes(r)),b=((null==f?void 0:f[t])||[]).filter((({status:e})=>"resolved"!==e)).reverse(),v=!i||i&&0===b.length,T=null===m&&d;(0,mE.D)((()=>{a&&a(d)}),[d]);const O=(0,ap.useContext)(QI),S=(0,ap.useMemo)((()=>O?[...n,...O]:n),[O,n]);return E&&ip().createElement("div",{className:up()(l.root,e)},v&&ip().createElement(uN,{className:up()(l.addButton,{[l.showAlways]:o||T}),onClick:e=>{c(e.currentTarget),p(!0)}}),b.map((({replies:e,commentId:t})=>ip().createElement(lN,{ref:t===(null==m?void 0:m.commentId)?c:null,key:t,onClick:()=>(e=>{y(e),p(!0)})(t)},1+e))),ip().createElement(nP,{anchorEl:s,open:d,onClose:()=>{c(null),g(),p(!1)},uri:t,relatedObjectUris:S,objectType:r,comment:m}))},oP=(0,Sp.Z)({label:{color:"rgba(0,0,0,0.6)",fontSize:"13px",lineHeight:"16px"}});function lP(){return lP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},lP.apply(null,arguments)}const sP=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["label","isRequired","className"]);const i=oP();return ip().createElement(hf(),lP({className:up()(i.label,n),component:"span"},a),t,r&&ip().createElement(rd,null))},cP=ip().createContext(null);cP.displayName="EntityContext";const uP=(0,Sp.Z)((e=>({container:{height:"16px",borderColor:(0,xm.alpha)(e.palette.primary.main,.54)},label:{paddingLeft:"4px",paddingRight:"4px",fontSize:"10px",lineHeight:"11px",color:e.palette.primary.main}}))),pP=(0,id.T)(pg()),dP=({className:e,attributeType:t,nonOvValues:r=[],nonOvTotal:n})=>{const a=uP(),i=(0,Uf.ax)("openEntity"),o=((e,t,r)=>{var n;const a=null==t||null===(n=t[0])||void 0===n?void 0:n.uri,i=a?(0,v.getEntityUriFromAttributeUri)(a):null;if(i&&(0,v.isEntityUri)(i)){const t=(0,v.getEntityUriFromAttributeUri)(r.uri);if(!e||e.type===t)return{uri:i,type:t};const n=(0,v.getParentUri)(a),o=(0,v.findAttributeValueByUri)(e,n);return{uri:(0,v.getReferencedEntityUriFromAttrValue)(o),type:t}}return e?{uri:e.uri,type:e.type}:null})((0,ap.useContext)(cP),r,t),l=(0,Uf.fC)(null==o?void 0:o.type),s=(0,ap.useCallback)((()=>{i({uri:o.uri,screen:"sources"})}),[i,o]);if(!n)return null;const c=r.length?r.map(((e,r)=>ip().createElement("div",{key:r},(0,v.isComplexAttribute)(t)?(0,v.getLabel)(e.label):ip().createElement(Md.x,{value:(0,v.getAttributeValue)(e),dataTypeDefinition:(0,v.getAttrDataTypeDefinition)(t),rich:!1})))):null;return ip().createElement(pP,{tooltipTitle:c,tooltipPlacement:"bottom",label:`+ ${n}`,variant:"outlined",onClick:null!=o&&o.uri&&l?s:void 0,classes:{root:up()(a.container,e),label:a.label}})};function mP(){return mP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},mP.apply(null,arguments)}const fP=e=>ip().createElement("svg",mP({width:12,height:12,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgDescription"},e),ip().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})),yP=ip().createContext({showDescription:!1,showNavigateToGraph:!0});yP.displayName="FeaturesContext";const gP=(0,Sp.Z)((()=>({icon:{display:"inline-flex",marginLeft:"8px",verticalAlign:"middle"}}))),hP=({className:e,description:t})=>{const{showDescription:r}=(0,ap.useContext)(yP),n=gP();return t&&r?ip().createElement(ng(),{title:t,placement:"bottom"},ip().createElement("span",{"data-reltio-id":"reltio-description-icon",className:up()(n.icon,e)},ip().createElement(fP,null))):null};var EP=r(87558);const bP=(0,r(87171).k)({unmaskedAttributes:{},unmaskAttributeValue:void 0,maskAttributeValue:void 0,deleteUnmaskedAttributeForRelation:void 0}),vP=e=>(0,EP.S)(bP,e),TP=ip().createContext({appearance:void 0,attributes:void 0,roles:void 0,tags:void 0});TP.displayName="HistoryDiffContext";const OP=ip().createContext({highlightedValuesUris:[],highlightedClassName:""});function SP(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}OP.displayName="HighlightedValuesContext";const xP=(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=CP(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}),[])},CP=(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,v.findAttributeTypeByUri)(t,n.type);a&&"object"!=typeof a&&(0,v.isOv)(n)?e.push(wP(a,i)):a&&"object"==typeof a&&!Array.isArray(a)&&e.push(xP(i,a,r,t))}return e}),[])},wP=(e,t)=>{switch(null==t?void 0:t.type){case v.DataTypes.TYPE_DATE:return new Date(e).getTime();case v.DataTypes.TYPE_TIMESTAMP:return isNaN(Number(e))?new Date(e).getTime():new Date(Number(e)).getTime();default:return e}};function AP(){return AP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},AP.apply(null,arguments)}const RP=e=>ip().createElement("svg",AP({width:11,height:11,viewBox:"0 0 11 11","data-reltio-id":"SvgPivotingIcon"},e),ip().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"}));var _P=r(98074);const IP=(0,Sp.Z)((e=>({link:{color:e.palette.primary.main,textDecoration:"none"}}))),NP=(0,ap.forwardRef)((({value:e,attributeType:t,children:r,className:n,onClick:a},i)=>{const o=IP(),{generatePivotingUrl:l}=(0,ap.useContext)(_P.v),s=l({uiPath:(0,Uf.Qh)(),uri:t.uri,value:JSON.stringify(e)}),c=(0,ap.useCallback)((e=>{(0,Tp.rR)(e)||(a(),e.preventDefault()),e.stopPropagation()}),[a]);return ip().createElement("a",{ref:i,href:s,onClick:c,className:up()(o.link,n)},r)}));NP.displayName="PivotingUriLink";const PP=(0,Sp.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"}}))),DP=({attributeType:e,label:t,entities:r,generatedValue:n,onSeeAllClick:a,total:i})=>{const o=PP(),l=i>6,s=Boolean(t);return ip().createElement("div",{className:o.container},ip().createElement("div",{className:o.header},ip().createElement("div",{className:o.title},ei().text("Pivot profiles")),ip().createElement("div",{className:o.divider}),ip().createElement("div",{className:o.headerCount},ei().number(i,"0,0")+" "+(1===i?ei().text("item"):ei().text("items")))),s&&ip().createElement("div",{className:o.entityTypeLabel},t),ip().createElement("div",{className:o.body},r.map((e=>ip().createElement("div",{key:e.uri,className:o.entityContainer},ip().createElement(b.A,{entity:e,avatarClassName:o.profileIcon}),ip().createElement(Ld.x,{className:o.entityLabel,value:(0,v.getEntityUriForLink)(e)},(0,v.getLabel)(e.label)))))),l&&ip().createElement("div",{className:o.footer},ip().createElement(NP,{value:n,attributeType:e,className:o.seeAllButton,onClick:a},ei().text("See all"))))},kP=(0,Sp.Z)((e=>({icon:{marginRight:"8px",verticalAlign:"middle",width:"12px",height:"12px"},content:{color:e.palette.primary.main,cursor:"pointer",lineHeight:"16px"}}))),LP=(0,Sp.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"}}}),UP=({value:e,attributeType:t,children:r,className:n})=>{const a=LP(),i=kP(),o=(0,ap.useContext)(FI)||[],l=(0,Uf.ax)("openPivotingPerspective"),s=(0,Uf.AH)()||{},c=(0,v.isNested)(t)?xP(t,e.value,o,s):wP(e.lookupCode||e.value,t),u=o.some((({uri:e})=>e===t.uri))&&(Array.isArray(c)&&c.length||!Array.isArray(c)&&!(0,O.isNil)(c)),p=o.find((({uri:e})=>e===t.uri)),d=null==p?void 0:p.popup,m=u?Array.isArray(c)?c.map((e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[(0,v.getLastUriPart)(e),t]))))):((e,t)=>[{[e.name]:t}])(t,c):void 0,f=()=>{l({value:m,attributeType:t})},{entities:y,total:g,loadPivotingData:h}=(({value:e,attributeType:t,entityType:r})=>{const[n,a]=(0,ap.useState)([]),[i,o]=(0,ap.useState)(0),l=(0,Oh._)(),s=(0,Uf.eh)(),c=(0,Uf.mU)(),u=r||(null==s?void 0:s.type),p=(0,ap.useMemo)((()=>(0,v.convertPivotingValueToSearchFilters)({value:e,attributeType:t,entityType:u})),[t,u,e]),d=(0,ap.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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){SP(e,t,r[t])}))}return e}({max:6,sort:"label"},c||{})),[c]),m=(0,ap.useCallback)((()=>{l(Promise.all([(0,v.getFilteredEntities)({filters:p,options:d}),(0,v.getTotals)({filters:p,options:d})])).then((e=>{const[t,{total:r}]=e;a(Array.isArray(t)?t:[]),o(r)})).catch((()=>{a([]),o(0)}))}),[p,d,l]);return{entities:n,total:i,loadPivotingData:m}})({attributeType:t,value:c,entityType:null==d?void 0:d.entityType});return u?ip().createElement(ng(),{arrow:!0,placement:"right-start",classes:a,disableInteractive:!1,onOpen:h,title:ip().createElement(DP,{generatedValue:m,attributeType:t,label:null==d?void 0:d.label,onSeeAllClick:f,entities:y,total:g})},ip().createElement("span",{className:n},ip().createElement(RP,{className:i.icon}),ip().createElement(NP,{onClick:f,className:i.content,value:m,attributeType:t},r))):ip().createElement(ip().Fragment,null,r)};var jP=r(78577),FP=r.n(jP),MP=r(46157),VP=r.n(MP);const BP=(0,Sp.Z)((e=>({icon:{color:e.palette.text.secondary,fontSize:18},switcherWrapper:{verticalAlign:"middle",marginLeft:8,width:"16px",height:"16px"}}))),zP=({className:e,isMasked:t,isUnmasking:r,onToggleMasking:n})=>{const a=BP(),i=t?ei().text("Show"):ei().text("Hide");return r?ip().createElement(um(),{size:16,className:up()(e,a.switcherWrapper)}):ip().createElement(ng(),{key:String(t),title:i},ip().createElement(Yh(),{"aria-label":i,onClick:n,className:up()(e,a.switcherWrapper)},t?ip().createElement(VP(),{className:a.icon}):ip().createElement(FP(),{className:a.icon})))};function HP(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){YP(e,t,r[t])}))}return e}function YP(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const WP=(0,Sp.Z)((e=>({root:{display:"flex",alignItems:"start",justifyContent:"space-between"},commentsContainer:{height:"15px",marginRight:"-4px"},attributeValue:{verticalAlign:"middle",wordBreak:"break-all"},updateAttribute:HP({width:"fit-content",padding:"0 4px",marginLeft:"-4px"},v.historyPalettes[v.HistoryOperations.updateAttribute],{"& > a":{color:v.historyPalettes[v.HistoryOperations.updateAttribute].color}}),insertAttribute:HP({width:"fit-content"},v.historyPalettes[v.HistoryOperations.insertAttribute],{"& > a":{color:v.historyPalettes[v.HistoryOperations.insertAttribute].color}}),deleteAttribute:HP({width:"fit-content",padding:"0 4px",marginLeft:"-4px",textDecoration:"line-through"},v.historyPalettes[v.HistoryOperations.deleteAttribute],{"& > a":{color:v.historyPalettes[v.HistoryOperations.deleteAttribute].color}}),multilineAttribute:{width:"fit-content"},ovFalse:e.inactive}))),GP=({className:e,attributeType:t=null,attributeValue:r,inlined:n})=>{const{isUnmaskingNeeded:a,isMasked:i,toggleMasking:o,attributeValue:l,isUnmasking:s}=(({attributeType:e,attributeValue:t})=>{const r=(0,Uf.xH)(),n=vP((({unmaskAttributeValue:e})=>e)),a=vP((({maskAttributeValue:e})=>e)),{attributeValue:i,isUnmasked:o=!1,loading:l=!1}=(s=t.uri,vP((({unmaskedAttributes:e})=>e[s]))||{});var s;const c=n&&a&&!!e.masking&&r,u=(0,ap.useCallback)((()=>c?n(t.uri):Promise.resolve()),[n,t.uri,c]),p=(0,ap.useCallback)((()=>{o?a(t.uri):u()}),[t.uri,o,a,u]);return{isUnmaskingNeeded:c,isMasked:!o,toggleMasking:p,isUnmasking:l,unmask:u,attributeValue:c&&o&&i||t}})({attributeType:t,attributeValue:r}),c=WP(),{highlightedValuesUris:u=[],highlightedClassName:p}=(0,ap.useContext)(OP),{appearance:d}=(0,ap.useContext)(TP),m=(0,v.getHistoryAppearanceByUri)(l.uri,d),f=(0,v.getHistoryAttributeClassName)(m),y=(0,ap.useMemo)((()=>ip().createElement(Md.x,{value:(0,v.getAttributeValue)(l),dataTypeDefinition:(0,v.getAttrDataTypeDefinition)(t)})),[l,t]),g=(0,v.getObjectTypeByAttributeUri)(l.uri),h=a&&ip().createElement(zP,{isMasked:i,onToggleMasking:o,isUnmasking:s});return n||f?ip().createElement("div",{className:up()(e,{[p]:u.includes(l.uri)})},ip().createElement(UP,{value:l,attributeType:t,key:l.uri,className:up()({[c.multilineAttribute]:!n})},ip().createElement("span",{className:up()(c.attributeValue,c[f],{[c.ovFalse]:!(0,v.isOv)(l)}),"data-reltio-id":"reltio-attribute-value"},y,h))):ip().createElement("div",{className:up()(e,c.root,XI,{[p]:u.includes(l.uri)})},ip().createElement(UP,{value:l,attributeType:t,key:l.uri},ip().createElement("span",{className:up()(c.attributeValue,{[c.ovFalse]:!(0,v.isOv)(l)}),"data-reltio-id":"reltio-attribute-value"},y,h)),ip().createElement(iP,{className:c.commentsContainer,uri:l.uri,relatedObjectUris:(0,v.createRelatedObjectUris)(g,{uri:l.uri}),objectType:g}))};var qP=r(84419),ZP=r.n(qP);const $P=(0,Sp.Z)({expandButton:{"&:hover":{backgroundColor:"transparent"}},expandIcon:{transition:"transform .15s ease"},expanded:{transform:"rotate(90deg)"}});function KP(){return KP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},KP.apply(null,arguments)}const XP=e=>{const t=$P(),{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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["expanded","className"]);return ip().createElement(Op.T,KP({icon:ZP(),size:"XXS",disableRipple:!0,iconClassName:up()(t.expandIcon,{[t.expanded]:r}),className:up()(n,t.expandButton),"data-reltio-id":"arrow-expand-button"},a))},QP=(0,Sp.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 JP(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const eD=({attributeTypesList:e,attributeValue:t,label:r,expanded:n=!1,children:a,showNonOv:i,attributeType:o,classes:l,LabelRenderer:s,RightSlot:c})=>{const u=QP(),p=t.uri,[d,m]=(0,ap.useState)(!1),{highlightedValuesUris:f=[],highlightedClassName:y}=(0,ap.useContext)(OP);(0,ap.useEffect)((()=>{m(n)}),[n]);const g=(e||[]).some((e=>(0,v.isAnalyticAttribute)(e))),h=(0,ap.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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){JP(e,t,r[t])}))}return e}({attributes:g?null:t.value,analyticsAttributes:g?t.value:null},(0,v.isSpecialAttribute)(o)?t.value:{})),[t,g,o]),E=(0,v.getObjectTypeByAttributeUri)(t.uri);return ip().createElement("div",{className:u.complexContainer},ip().createElement("div",{className:up()(u.labelContainer,XI)},ip().createElement(XP,{onClick:()=>m((e=>!e)),expanded:d}),s?ip().createElement(s,{attributeType:o,attributeValue:t}):ip().createElement(ip().Fragment,null,ip().createElement(hf(),{component:"span",variant:"body2",classes:{body2:u.label},className:up()({[y]:f.includes(t.uri),[u.ovFalse]:!(0,v.isOv)(t)}),"data-reltio-id":"reltio-attribute-complex-label"},r),ip().createElement("div",{className:u.spacer}),c&&ip().createElement(c,{attributeType:o,attributeValue:t}),ip().createElement(iP,{uri:t.uri,relatedObjectUris:(0,v.createRelatedObjectUris)(E,{uri:t.uri}),objectType:E}))),d&&ip().createElement(XF,{attrTypes:e,entity:h,drawLines:!0,parentUri:p,showNonOv:i,classes:l},a))};var tD=r(29195);function rD(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){nD(e,t,r[t])}))}return e}function nD(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const aD=(0,Sp.Z)({label:{textDecoration:"none",verticalAlign:"middle"},updateAttribute:rD({width:"fit-content",padding:"0 4px",marginLeft:"-4px"},v.historyPalettes[v.HistoryOperations.updateAttribute]),insertAttribute:rD({width:"fit-content"},v.historyPalettes[v.HistoryOperations.insertAttribute]),deleteAttribute:rD({width:"fit-content",textDecoration:"line-through",padding:"0 4px",marginLeft:"-4px"},v.historyPalettes[v.HistoryOperations.deleteAttribute]),pivotingTooltip:{marginLeft:"4px"}});function iD(){return iD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},iD.apply(null,arguments)}const oD=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeValue","attributeType"]);const a=aD(),{appearance:i}=(0,ap.useContext)(TP),o=(0,ap.useMemo)((()=>{const e=(0,v.getHistoryAppearanceByUri)(t.uri,i),n=(0,v.getHistoryAttributeClassName)(e),o=t.label?t.label:(0,v.evaluateDeepEntityLabel)(t,r.dataLabelPattern);return ip().createElement(UP,{className:a.pivotingTooltip,value:t,attributeType:r},ip().createElement(jI(),{component:"span",className:up()(a[n],a.label)},ip().createElement(tD.b,{text:(0,v.getLabel)(o)})))}),[i,a,t,r]);return ip().createElement(eD,iD({label:o,attributeValue:t,attributeTypesList:(0,v.getAttributeTypeSubAttributes)({},r),attributeType:r},n))},lD=(0,ap.memo)(oD);var sD=r(24217),cD=r(16782);const uD=(0,Sp.Z)((e=>({link:{color:e.palette.primary.main,textDecoration:"none"}})));function pD(){return pD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},pD.apply(null,arguments)}const dD=e=>{const t=uD(),r=(0,cD.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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["href","className"]),o=up()(t.link,a);return r&&n?ip().createElement(sD.rU,pD({to:n.replace(window.location.origin,""),className:o},i)):ip().createElement("a",pD({href:n,className:o},i))};function mD(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){fD(e,t,r[t])}))}return e}function fD(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const yD=(0,Sp.Z)((e=>({relationshipLabel:{marginLeft:"4px",color:e.palette.text.primary},updateAttribute:mD({width:"fit-content",padding:"0 4px",marginLeft:"-4px"},v.historyPalettes[v.HistoryOperations.updateAttribute]),insertAttribute:mD({width:"fit-content"},v.historyPalettes[v.HistoryOperations.insertAttribute]),deleteAttribute:mD({width:"fit-content",textDecoration:"line-through",padding:"0 4px",marginLeft:"-4px"},v.historyPalettes[v.HistoryOperations.deleteAttribute]),ovFalse:e.inactive})));function gD(){return gD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gD.apply(null,arguments)}const hD=(0,ap.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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeValue","attributeType"]);const a=yD(),i=(0,Uf.AH)(),o=(0,Uf.Qh)(),l=(0,v.getReferencedEntityUriFromAttrValue)(t),s=(0,ap.useMemo)((()=>(0,v.getAttributeTypeSubAttributes)(i,r)),[r,i]),{appearance:c}=(0,ap.useContext)(TP),{generateEntityUrl:u}=(0,ap.useContext)(_P.v),p=(0,ap.useMemo)((()=>{const e=(0,v.getHistoryAppearanceByUri)(t.uri,c),r=(0,v.getHistoryAttributeClassName)(e),n=null!=l&&l.startsWith("changeRequests")?"dcrReview":"profile";return ip().createElement(dD,{href:(0,v.isEmptyValue)(c)?u({uiPath:o,uri:l,screen:n}):void 0,className:up()(a[r],{[a.ovFalse]:!(0,v.isOv)(t)})},ip().createElement(tD.b,{text:(0,v.getLabel)(t.label)}),t.relationshipLabel&&ip().createElement("span",{className:a.relationshipLabel},ip().createElement(tD.b,{text:t.relationshipLabel})))}),[t,c,o,l,a,u]);return ip().createElement(eD,gD({attributeTypesList:s,attributeValue:t,label:p,attributeType:r},n))}));hD.displayName="ReferenceAttribute";const ED=e=>{const{attributeType:t}=e;return class{static build(e,t={}){switch(e.type){case v.DataTypes.TYPE_NESTED:return ip().createElement(lD,t);case v.DataTypes.TYPE_REFERENCE:return ip().createElement(hD,t);default:return ip().createElement(GP,t)}}}.build(t,e)};function bD(){return bD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},bD.apply(null,arguments)}const vD=e=>ip().createElement("svg",bD({width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgControlAttribute"},e),ip().createElement("mask",{id:"ControlAttribute_svg__a",fill:"#fff"},ip().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"})),ip().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)"}),ip().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"})),TD=(0,Sp.Z)({icon:{display:"inline-flex",marginLeft:"8px",verticalAlign:"middle"}});function OD(){return OD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},OD.apply(null,arguments)}const SD=(0,ap.forwardRef)(((e,t)=>ip().createElement("span",OD({},e,{ref:t}),ip().createElement(vD,null))));SD.displayName="ControlAttributeForwarded";const xD=(0,id.T)(SD),CD=()=>{const e=TD();return ip().createElement(xD,{"data-reltio-id":"reltio-control-attribute-icon",tooltipTitle:ei().text("This is a control attribute. Changing this value will affect availability of other conditional attributes."),className:e.icon})};function wD(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){AD(e,t,r[t])}))}return e}function AD(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const RD="13px",_D="16px",ID={titleRow:{display:"inline-block",minHeight:"16px"},title:{wordBreak:"break-all",verticalAlign:"middle"},ovIcon:{marginLeft:"8px",textIndent:0},descriptionIcon:{textIndent:0}},ND=(0,Sp.Z)({paddingWrapper:{paddingTop:"3px",paddingBottom:"5px","&:last-child":{paddingBottom:"2px"}},paddingWrapperWithLines:{paddingBottom:"1px","&:last-child":{paddingBottom:"2px"}}}),PD=(0,Sp.Z)(wD({wrapper:{fontSize:RD,lineHeight:_D},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"}},ID)),DD=(0,Sp.Z)(wD({wrapper:{display:"flex",flexDirection:"column",alignItems:"flex-start",fontSize:RD,lineHeight:_D},attribute:{"&:last-child":{marginBottom:0},paddingLeft:"4px",paddingRight:"4px",marginLeft:"5px",marginBottom:"4px",whiteSpace:"pre-wrap",wordBreak:"break-word"},attributes:{alignSelf:"stretch"},titleRow:wD({},ID.titleRow,{marginBottom:"3px"})},ID)),kD=(0,Sp.Z)(wD({wrapper:{fontSize:RD,lineHeight:_D}},ID)),LD=({value:e,nonVisibleValues:t,attributeType:r,showNonOv:n,totalNonVisibleValues:a,classes:i})=>{const o=PD(),{label:l,description:s}=r,c=(0,Uf.Ws)(),u=(0,ap.useMemo)((()=>c.includes(r.uri)),[c,r.uri]),p=(0,v.getObjectTypeByAttributeUri)(e.uri);return ip().createElement("div",{"data-reltio-id":"one-line-renderer",className:up()(o.collaborationWrapper,XI)},ip().createElement("div",{className:up()(o.titleRow,o.wrapper)},ip().createElement(sP,{label:l,className:up()(o.title,null==i?void 0:i.title),"data-reltio-id":"reltio-attribute-label"}),ip().createElement(hP,{description:s,className:o.descriptionIcon}),u&&ip().createElement(CD,null),ip().createElement(dP,{nonOvValues:t,attributeType:r,className:o.ovIcon,nonOvTotal:a}),ip().createElement(ED,{className:up()(o.attribute,null==i?void 0:i.content),attributeValue:e,attributeType:r,showNonOv:n,inlined:!0,classes:i})),ip().createElement(iP,{uri:e.uri,relatedObjectUris:(0,v.createRelatedObjectUris)(p,{uri:e.uri}),objectType:p}))};var UD=r(33062),jD=r.n(UD);const FD=(0,Sp.Z)({link:{display:"flex",marginTop:4},icon:{fontSize:"1rem"}}),MD=({moreNumber:e,valueNumber:t,onClick:r})=>{const n=FD();return ip().createElement(ry(),{"data-reltio-id":"show-more",component:"button",variant:"caption",className:n.link,onClick:r,underline:"none"},ip().createElement(jD(),{className:n.icon}),e&&t?ei().text("Show ${moreNumber} more of remaining ${valueNumber} value",{moreNumber:e,valueNumber:t}):ei().text("Show more"))};var VD=r(86800),BD=r.n(VD);const zD=(0,Sp.Z)({link:{display:"flex",marginTop:4},icon:{fontSize:"1rem"}}),HD=({onClick:e})=>{const t=zD();return ip().createElement(ry(),{component:"button",variant:"caption",className:t.link,onClick:e,underline:"none"},ip().createElement(BD(),{className:t.icon}),ei().text("Show less"))},YD=({max:e,values:t,nonVisibleValues:r,totalVisibleValues:n,attributeType:a,parentUri:i,requestNextPageOfAttributeValues:o,showNonOv:l,totalNonVisibleValues:s,classes:c})=>{const u=DD(),[p,d]=(0,ap.useState)(e),m=(0,Uf.Ws)(),f=(0,ap.useMemo)((()=>m.includes(a.uri)),[m,a.uri]),y=e<n,g=y&&p<n,h=y&&p>=n,{label:E,description:b}=a,v=t.slice(0,p),T=n-p;return ip().createElement("div",{"data-reltio-id":"multi-line-renderer",className:u.wrapper},ip().createElement("div",{className:u.titleRow},ip().createElement(sP,{label:E,className:up()(u.title,null==c?void 0:c.title),"data-reltio-id":"reltio-attribute-label"}),ip().createElement(hP,{description:b}),f&&ip().createElement(CD,null),ip().createElement(dP,{nonOvValues:r,attributeType:a,className:u.ovIcon,nonOvTotal:s})),ip().createElement("div",{className:u.attributes},v.map((e=>ip().createElement(ED,{key:e.uri,className:up()(u.attribute,null==c?void 0:c.content),attributeValue:e,attributeType:a,showNonOv:l,classes:c})))),g&&ip().createElement(MD,{moreNumber:(0,O.min)(e,T),valueNumber:T,onClick:()=>{t.length<n&&o({parentUri:i,attributeTypeUri:a.uri,attributeTypeName:a.name,values:t,defaultMaxValues:e}),d(p+e)}}),h&&ip().createElement(HD,{onClick:()=>{d(e)}}))};var WD=r(88941),GD=r.n(WD);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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){ZD(e,t,r[t])}))}return e}function ZD(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const $D=(0,Sp.Z)({attributeValue:{verticalAlign:"middle"},insertAttribute:qD({width:"fit-content"},v.historyPalettes[v.HistoryOperations.insertAttribute]),deleteAttribute:qD({width:"fit-content",textDecoration:"line-through",padding:"0 4px"},v.historyPalettes[v.HistoryOperations.deleteAttribute])}),KD=({value:e})=>{const t=$D(),{appearance:r}=(0,ap.useContext)(TP),n=(0,Uf.AH)(),a=(0,v.getHistoryAppearanceBySpecialAttributeValue)("roles",e,r),i=(0,v.getHistoryAttributeClassName)(a);return ip().createElement("span",{className:up()(t.attributeValue,t[i])},(0,v.getRoleLabel)(n,e))},XD=({className:e,values:t,Component:r,dataReltioId:n})=>ip().createElement("div",{className:e,"data-reltio-id":n},t.map(((e,n)=>ip().createElement(ap.Fragment,{key:e},ip().createElement(r,{value:e}),n<t.length-1&&", ")))),QD=({className:e,values:t})=>ip().createElement(XD,{values:t,className:e,dataReltioId:"reltio-attribute-value",Component:KD});function JD(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){ek(e,t,r[t])}))}return e}function ek(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const tk=(0,Sp.Z)({attributeValue:{verticalAlign:"middle"},insertAttribute:JD({width:"fit-content"},v.historyPalettes[v.HistoryOperations.insertAttribute]),deleteAttribute:JD({width:"fit-content",textDecoration:"line-through",padding:"0 4px"},v.historyPalettes[v.HistoryOperations.deleteAttribute])}),rk=({value:e})=>{const t=tk(),r=(0,ap.useContext)(cP),{appearance:n}=(0,ap.useContext)(TP),{generateTagUrl:a}=(0,ap.useContext)(_P.v),i=(0,Uf.eh)(),o=(0,Uf.Qh)(),l=(0,v.getHistoryAppearanceBySpecialAttributeValue)("tags",e,n),s=(0,v.getHistoryAttributeClassName)(l),c=r||i;return ip().createElement(dD,{className:up()(t.attributeValue,t[s]),href:a({uiPath:o,tag:e,entityUri:c.dataTenant?(0,v.getDataTenantEntityUri)(c):c.uri})},e)},nk=({className:e,values:t})=>ip().createElement(XD,{values:t,className:e,dataReltioId:"reltio-attribute-value",Component:rk}),ak=({values:e,attributeType:t,classes:r})=>{const n=PD(),{label:a}=t;return ip().createElement("div",{"data-reltio-id":"special-renderer",className:up()(n.titleRow,n.wrapper)},(i=n.titleIcon,t.uri===v.EntityAttrTypes.tags.uri?ip().createElement(GD(),{className:i}):null),ip().createElement(sP,{label:a,className:up()(n.title,null==r?void 0:r.title),"data-reltio-id":"reltio-attribute-label"}),(n=>{switch(t.uri){case v.EntityAttrTypes.tags.uri:return ip().createElement(nk,{className:n,values:e});case v.EntityAttrTypes.roles.uri:return ip().createElement(QD,{className:n,values:e});default:return ip().createElement(ED,{className:n,attributeValue:{value:e[0],uri:""},attributeType:t,inlined:!0,classes:r})}})(up()(n.attribute,null==r?void 0:r.content)));var i};var ik=r(97986),ok=r.n(ik);function lk(){return lk=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},lk.apply(null,arguments)}const sk=e=>ip().createElement("svg",lk({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgDefaultImage"},e),ip().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},ip().createElement("path",{d:"M0 0h24v24H0z"}),ip().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"}))),ck={SMALL:{imageWidth:114,imageHeight:114},MEDIUM:{imageWidth:162,imageHeight:162},LARGE:{imageWidth:192,imageHeight:192},OVERRIDE:{imageWidth:"unset",imageHeight:"unset"}},uk=(0,Sp.Z)((e=>({root:{position:"relative"},image:({imageWidth:e,imageHeight:t})=>({width:e,height:t,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 pk(){return pk=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},pk.apply(null,arguments)}const dk=e=>{const{src:t,className:r,containerClassName:n,size:a=ck.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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["src","className","containerClassName","size","overlay"]),l=a||ck.SMALL,s=uk(l),[c,u]=(0,ap.useState)(sm.oA.LOADING);(0,ap.useEffect)((()=>{u(sm.oA.LOADING)}),[t]);const p=c===sm.oA.LOADING,d=c===sm.oA.LOADED;return c===sm.oA.ERROR?ip().createElement("div",pk({className:up()(s.defaultContainer,s.image,r)},o),ip().createElement(ok(),{className:s.defaultImage})):ip().createElement("div",{className:up()(s.root,n)},!(0,v.isEmptyValue)(t)&&ip().createElement("img",pk({src:t,className:up()(s.image,r,{[s.hideImage]:p}),onLoad:()=>{u(sm.oA.LOADED)},onError:()=>{u(sm.oA.ERROR)},alt:"image"},o)),p&&ip().createElement("div",pk({className:up()(s.defaultContainer,s.image,r)},o),ip().createElement(sk,{className:s.defaultImage})),d&&i)},mk=(0,ap.memo)(dk),fk={imageMargin:4,imageWidth:ck.SMALL.imageWidth,imageHeight:ck.SMALL.imageHeight};var yk=r(59849),gk=r.n(yk),hk=r(47867),Ek=r.n(hk),bk=r(93643),vk=r.n(bk);const Tk=(0,Sp.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)"}}))),Ok=({attributeValues:e,setAttributeValueIndex:t,attributeValueIndex:r})=>{const n=Tk(),a=(0,ap.useRef)(null);return(0,ap.useEffect)((()=>{if(null!=a&&a.current){const e=a.current.scrollLeft,t=a.current.offsetWidth+e,n=96*r+16*r+12;t<n?a.current.scroll&&(n>t+96+16?a.current.scroll(n,0):a.current.scroll(112+e,0)):e+96>n&&a.current.scroll&&a.current.scroll(n-96,0)}}),[r,a]),ip().createElement("div",{ref:a,className:n.thumbnails},ip().createElement(vk(),{container:!0,wrap:"nowrap",direction:"row",spacing:1,className:n.gridContainer},e.map((({uri:e,value:a},i)=>ip().createElement(vk(),{item:!0,key:e},ip().createElement(mk,{onClick:()=>t(i),className:up()(n.thumb,{[n.inactiveThumb]:r!==i}),src:(0,v.getImageAttributeOvThumbnailUrl)({value:a})}))))))},Sk=(0,Sp.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%)"}}))),xk=({className:e,attributeValues:t,attributeValueIndex:r,setAttributeValueIndex:n})=>{const a=Sk(),i=t[r],o=(0,v.getImageAttributeOvPreviewUrl)(i);return ip().createElement("div",{className:up()(a.root,e)},ip().createElement("div",{className:a.main},r>0&&ip().createElement(Op.T,{icon:gk(),className:up()(a.arrowButton,a.arrowButtonPrev),onClick:()=>{n(r-1)},size:"XL"}),ip().createElement(mk,{containerClassName:a.mainImageContainer,className:a.mainImage,size:o&&ck.OVERRIDE,src:o}),r!==t.length-1&&ip().createElement(Op.T,{icon:Ek(),className:up()(a.arrowButton,a.arrowButtonNext),onClick:()=>{n(r+1)},size:"XL"})),ip().createElement(Ok,{attributeValues:t,attributeValueIndex:r,setAttributeValueIndex:n}))};var Ck=r(71884),wk=r.n(Ck);const Ak=(0,O.curry)(((e,t)=>(0,O.filter)((t=>(t.label||t.name).toLowerCase().includes(e.toLowerCase())))(t))),Rk=({attrTypes:e,filter:t="",sortingFn:r})=>(0,O.pipe)(Ak(t),(0,O.sort)(r),(0,O.map)((e=>({item:{id:e.uri,label:e.label||e.name,attrType:e}}))))(e);var _k=function(e){return e.parent="parent",e.attributes="attributes",e}(_k||{});const Ik=(0,Sp.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"}}),Nk=({label:e,popupTitle:t=e,data:r,parent:n,dense:a,onApply:i})=>{const o=Ik(),l=(0,ap.useRef)(),[s,c]=(0,ap.useState)(!1),[u,p]=(0,ap.useState)(""),[d,m]=(0,ap.useState)([]),{items:f,hasGroups:y,parentGroupLength:g,attributesGroupLength:h}=(({data:e,parent:t,filter:r})=>{const n=(0,Uf.mT)(),a=Boolean(t),i=(0,ap.useMemo)((()=>n===v.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),[n]),o=(0,ap.useMemo)((()=>a?Rk({attrTypes:[t],filter:r,sortingFn:i}):[]),[a,t,r,i]),l=(0,ap.useMemo)((()=>a&&null!=o&&o.length?[{item:{id:_k.parent,label:ei().text("Parent")},items:o}]:[]),[a,o]),s=(0,ap.useMemo)((()=>Rk({attrTypes:e,filter:r,sortingFn:i})),[e,r,i]),c=(0,ap.useMemo)((()=>a&&null!=s&&s.length?[{item:{id:_k.attributes,label:ei().text("Attributes")},items:s}]:s),[a,s]),u=(0,ap.useMemo)((()=>Dp((l||[]).concat(c))),[l,c]),p=l.length,d=c.length;return{items:u,hasGroups:a,parentGroupLength:p,attributesGroupLength:d}})({data:r,parent:n,filter:u}),E=(0,ap.useCallback)(((e,t)=>{m((0,O.ifElse)((0,O.always)(t),(0,O.append)(e),(0,O.reject)((0,O.propEq)("id",e.id)))(d))}),[d]),b=(0,ap.useCallback)(((e,t)=>t.items?40:28),[]),T=(0,ap.useCallback)((({item:e})=>{E(e,(0,O.not)((0,O.any)((0,O.propEq)("id",e.id))(d)))}),[E,d]),{focusIndex:S,handleKeyDown:x}=Mp({items:f,open:s,onSelectFocusedItem:T,selectedItems:d}),C=(0,ap.useRef)(null);C.current=S;const w=y?(g?1:0)+(h?1:0):0,A=f.length-w,R=Math.min(255,28*A+40*w),_=Math.max(140,R+112),I=(0,ap.useCallback)(((e,{item:t,level:r=0},n)=>{var a;const i=(0,O.any)((0,O.propEq)("id",t.id))(d),o=C.current===n;return ip().createElement(cd,{key:t.uri,onClick:E,checked:i,level:r,data:t,label:ip().createElement(ud.o,{text:t.label,highlight:u}),labelInText:t.label,style:e,isFocused:o,isRequired:!(null===(a=t.attrType)||void 0===a||!a.required),LogoIcon:t.LogoIcon})}),[u,E,d]),N=(0,ap.useCallback)(((e,t)=>ip().createElement($m(),{component:"div",className:o.subHeader,style:e,key:`group-${t.item.id}`},t.item.label)),[]);return ip().createElement("div",{className:up()(o.moreAttributes,{[o.dense]:a})},ip().createElement(Gh(),{color:"primary",onClick:()=>c(!s),ref:l,className:o.moreButton},ip().createElement(wk(),{classes:{root:o.icon}}),ip().createElement("div",{className:o.buttonLabel},e)),ip().createElement(Pp,{open:s,className:up()(o.moreAttributesPopup,o.popupContainer),anchorEl:l.current,onClose:(0,O.pipe)((()=>{d.length>0&&i((0,O.pluck)("attrType",d))}),(()=>c(!1)),(()=>p("")),(()=>m([]))),onSearch:p,containerHeight:_,title:t,containerWidth:320,searchInputOnKeyDown:x},ip().createElement(Fp,{getItemSize:b,renderItem:I,renderGroupTitle:N,disableHorizontalScrollbar:!0,items:f,height:R,focusIndex:S}),0===f.length&&ip().createElement("div",{className:o.noResultsCaptionContainer},ip().createElement(hf(),{variant:"caption",display:"block",gutterBottom:!0},ei().text("No results found")))))},Pk={canCreate:!0,canUpdate:!0,canDelete:!0},Dk=ip().createContext(Pk);Dk.displayName="ConfigPermissionsContext";const kk=e=>{const{canCreate:t,canUpdate:r,canDelete:n}=(0,ap.useContext)(Dk),a=(0,v.isTempUri)(e);return(0,ap.useMemo)((()=>({canCreate:t,canUpdate:a||r,canDelete:a||n})),[a,t,r,n])},Lk={get CreationTime(){return ei().text("Creation Time")},get CreationDate(){return ei().text("Creation Date")},get Dimensions(){return ei().text("Dimensions")},get MimeType(){return ei().text("Mime Type")},get Size(){return ei().text("Size")},get Url(){return ei().text("Full image URL (S3)")},get UrlPreview(){return ei().text("Preview image URL (S3)")},get UrlThumbnail(){return ei().text("Small image URL (S3)")},get CdnUrl(){return ei().text("Full image URL (CDN)")},get CdnUrlPreview(){return ei().text("Preview image URL (CDN)")},get CdnUrlThumbnail(){return ei().text("Small image URL (CDN)")}},Uk=({value:e}={},t)=>["Url","UrlPreview","UrlThumbnail","CdnUrl","CdnUrlPreview","CdnUrlThumbnail","MimeType"].includes(t)?(0,O.path)([t,0,"value"],e):"CreationDate"===t&&(0,O.path)(["CreationTimestamp",0,"value"],e)?Pa()(e.CreationTimestamp[0].value).format("MM-DD-YYYY"):"CreationTime"===t&&(0,O.path)(["CreationTimestamp",0,"value"],e)?Pa()(e.CreationTimestamp[0].value).format("HH:mm:ss"):"Dimensions"===t&&(0,O.path)(["Height",0,"value"],e)&&(0,O.path)(["Width",0,"value"],e)?`${e.Height[0].value} x ${e.Width[0].value} ${ei().text("pixels")}`:"Size"===t&&(0,O.path)(["Size",0,"value"],e)?`${(Number(e.Size[0].value)/1e3).toFixed(2)} KB`:void 0,jk=(e=[])=>e.filter((({system:e})=>!e)),Fk=(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}))},Mk=(e={},t,r)=>{const n=jk(t.attributes);return Fk(Object.keys(e.value||{}),r).reduce(((t,r)=>{const a=n.find((({name:e})=>e===r));return a?[...t,{attrType:a,values:e.value[r]}]:t}),[])},Vk=e=>["Url","UrlPreview","UrlThumbnail","CdnUrl","CdnUrlPreview","CdnUrlThumbnail"].includes(e),Bk=(0,Sp.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:{}}),zk=({attributeType:e,onAddAttributes:t,uri:r})=>{const n=Bk(),a=jk(e.attributes),{canCreate:i}=(0,ap.useContext)(Dk),o=i&&Boolean(t);return ip().createElement(jI(),null,ip().createElement(hf(),{className:up()(n.title,{[n.canAdd]:o})},ei().text("Meta info")),o&&ip().createElement(ap.Fragment,null,ip().createElement(Nk,{label:ei().text("Attributes"),data:a,dense:!1,onApply:e=>{t&&t(e.map((e=>({attributeType:e,parentUri:r}))))}}),ip().createElement(Cf(),{className:n.divider})))},Hk=(0,Sp.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"}}))),Yk=({title:e,content:t,isLink:r,children:n})=>{const a=Hk();return ip().createElement("div",{className:a.root},ip().createElement("span",{className:a.title},e),r?ip().createElement("a",{className:a.link,href:t},ei().text("link")):ip().createElement("span",{className:a.content},t||n))},Wk=(0,Sp.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"}}),Gk=({attributeValue:e,attributeType:t,imageAttributeFieldsOrder:r})=>{const n=Wk(),a=(0,Uf.xH)(),i=(o=e,l=r,Fk(Object.keys(Lk),l).map((e=>Uk(o,e)?{title:Lk[e],value:Uk(o,e),isLink:Vk(e)}:null)).filter(Boolean));var o,l;const s=Mk(e,t,r),c=(0,ap.useMemo)((()=>({title:n.title,content:n.content})),[n]);return ip().createElement(jI(),{className:n.root},i.map((({title:e,value:t,isLink:r})=>ip().createElement(Yk,{key:e,isLink:r,title:e,content:t}))),a&&s.map((({attrType:t,values:r})=>ip().createElement($F,{key:t.uri,attributeType:t,drawLines:!1,values:r,classes:c,parentUri:e.uri}))))},qk=(0,Sp.Z)((e=>({caption:{display:"flex",color:e.palette.error.main,fontSize:"12px",lineHeight:"16px"}}))),Zk=({className:e,message:t})=>{const r=qk();return t?ip().createElement(hf(),{variant:"caption",className:up()(r.caption,e)},t):null};var $k=r(66826),Kk=r.n($k),Xk=r(95210),Qk=r(70485),Jk=r.n(Qk),eL=r(53167),tL=r.n(eL);const rL=(0,Sp.Z)({wrapper:{width:"100%"},helperText:{margin:"3px 0 1px 12px"}});function nL(){return nL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},nL.apply(null,arguments)}const aL=(0,ap.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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["errorMessage","children","className","classes"]);const o=rL(),l=!!t;return ip().createElement(Jk(),nL({variant:"standard",className:up()(o.wrapper,n,null==a?void 0:a.root),error:!0},i),r,l&&ip().createElement(tL(),{className:up()(o.helperText,null==a?void 0:a.helperText)},ip().createElement(Zk,{message:t})))}));aL.displayName="ErrorWrapper";const iL=(e,t,r,n)=>{const a=(0,O.pipe)(v.getEntityType,(0,O.defaultTo)({}),(0,O.props)(["attributes","analyticsAttributes"]),(0,O.reject)(O.isNil),O.flatten,(0,O.concat)(O.__,(0,O.pipe)(O.values,(0,O.reject)((0,O.propEq)("uri",v.EntityAttrTypes.id.uri)))(v.EntityAttrTypes)))(e,t);return r.length?a.filter((({uri:e})=>r.includes(e))):a.filter((({uri:e})=>!n.includes(e)))},oL=(e,t)=>(0,O.partition)((0,O.pipe)((0,O.path)(["attrType","uri"]),(0,O.includes)(O.__,e)),t),lL=(0,O.eqBy)((0,O.pick)(["fieldName","uri","entityTypeUri"])),sL=(e,t)=>t&&!!t.find(lL(e)),cL=(0,O.curry)(((e,t,r)=>{const n=((e,t)=>{const{type:r}=(0,v.getAttrDataTypeDefinition)(e);switch(r){case v.DataTypes.TYPE_BOOLEAN:case v.DataTypes.TYPE_BOOLEAN_RADIO:case v.DataTypes.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return t.toString();case v.DataTypes.TYPE_DATE:return t&&Pa()(t).format("YYYY-MM-DD")||"";case v.DataTypes.TYPE_TIMESTAMP:return t&&Pa()(t).utc().format()||"";case v.DataTypes.TYPE_ACTIVENESS_DATE:case v.DataTypes.TYPE_LOCAL_DATE:return t&&t.valueOf();default:return t||""}})(t,r);return{value:n,uri:e.uri,attributeType:t}})),uL=ip().createContext({enabled:!1,queueSizeThreshold:0});uL.displayName="AsyncMountContext";let pL=0;function dL(){return dL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},dL.apply(null,arguments)}var mL=r(50548);const fL=ip().createContext(!1);fL.displayName="ProfilePerspectiveViewContext";let yL=function(e){return e.Error="Error",e.NewAttribute="NewAttribute",e.NewView="NewView",e}({});const gL=e=>e===yL.Error,hL=ip().createContext({element:null,type:null,highlightView:O.identity,highlightError:O.identity,highlightAttribute:O.identity,scrollIntoRef:O.identity});function EL(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){bL(e,t,r[t])}))}return e}function bL(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const vL={content:'""',position:"absolute",left:"-1000px",top:"0px",width:"5000px",height:"calc(100% - 10px)",animationName:"$highlightAnimation",animationDuration:"2s",animationIterationCount:1,opacity:0},TL=(0,Sp.Z)((()=>({"@keyframes highlightAnimation":{"0%":{opacity:0},"50%":{opacity:1},"100%":{opacity:0}},highlightError:{"&::before":EL({},vL,{background:"rgba(255, 0, 0, 0.06)"})},highlightWarning:{"&::before":EL({},vL,{background:"rgba(228, 151, 0, 0.08)"})},simpleAttribute:{position:"relative","&::before":{top:"-4px",height:"calc(100% + 8px)"}}}))),OL=({highlightedError:e,isSimple:t=!1})=>{const r=TL(),n=(0,ap.useRef)(null),a=(0,O.pathOr)(v.ErrorSeverity.ERROR,["element","severity"])(e),i=up()({[r.highlightError]:a===v.ErrorSeverity.ERROR,[r.highlightWarning]:a===v.ErrorSeverity.WARNING,[r.simpleAttribute]:t});return(0,ap.useEffect)((()=>{e&&e.scrollIntoRef(n)}),[e]),e?{ref:n,errorClassName:i}:{ref:n}};var SL=r(51894);const xL=(0,Sp.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 CL(){return CL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},CL.apply(null,arguments)}const wL=(0,mL.l)(hL,((e,{attributeValue:t})=>{const{element:r,type:n}=e||{};return{highlightedError:gL(n)&&(null==r?void 0:r.uri)===t.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:f=!1}=e,y=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.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 g=xL(),h="deleted"===d,E="edited"===d,b=(0,v.isEditableMode)(o),{canCreate:T,canEdit:S,canDelete:x}=(({attributeType:e,attributeValue:t,isReltioCrosswalk:r,mode:n})=>{const{canCreate:a,canUpdate:i,canDelete:o}=kk(t.uri);return{canCreate:a&&(0,v.checkCanCreateAttribute)({attributeType:e,mode:n}),canEdit:i&&(0,v.checkCanEditAttribute)({attributeType:e,attributeValue:t,mode:n,isReltioCrosswalk:r}),canDelete:o&&(0,v.checkCanDeleteAttribute)({attributeType:e,attributeValue:t,mode:n,isReltioCrosswalk:r})}})({attributeValue:r,attributeType:n,mode:o,isReltioCrosswalk:a}),C=S&&b&&!r.masked,w=(0,v.getErrorMessage)(i),A=(0,Uf.ZI)(r,n),{ref:R,errorClassName:_}=OL({highlightedError:m,isSimple:!0});(0,ap.useEffect)((()=>{f&&(0,v.isDependentLookupAttrType)(n)&&!(0,O.has)("lookupCode",r)&&c({attributeType:n,uri:r.uri,value:r.value,silent:!0})}),[f]);const I=(0,ap.useMemo)((()=>(0,v.getAttrDataTypeDefinition)(n)),[n]),N=(0,ap.useMemo)((()=>((e,{type:t})=>{const{value:r,lookupCode:n}=e||{};switch(t){case v.DataTypes.TYPE_BOOLEAN:case v.DataTypes.TYPE_BOOLEAN_RADIO:case v.DataTypes.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return(0,v.parseBoolean)(r);case v.DataTypes.TYPE_DATE:return r&&v.utils.dates.toLocalDate(r)||null;case v.DataTypes.TYPE_LOCAL_DATE:case v.DataTypes.TYPE_TIMESTAMP:case v.DataTypes.TYPE_ACTIVENESS_DATE:return r&&new Date(r)||null;case v.DataTypes.TYPE_DEPENDENT_LOOKUP:case v.DataTypes.TYPE_LOOKUP:return{value:r,lookupCode:n};default:return r}})(r,I)),[r,I]),P=(0,ap.useCallback)((()=>{i&&u((0,v.getErrorId)(i))}),[i,u]),D=(0,ap.useCallback)((0,O.pipe)(cL(r,n),c,P),[r,n,c,P]),k=!!l&&T&&!n.singleValue&&!r.masked&&o!==v.Mode.Viewing,L=!h&&!!s&&x&&!r.masked&&o!==v.Mode.Viewing,U=!!w,j=h?{disabled:!0,isCrossedOut:!0}:{},F=(0,ap.useContext)(fL),{autopopulationContextValue:M}=(({enabled:e,attributeTypeUri:t,valueUri:r})=>{const n=(0,Uf.ax)("dependentLookupsEditorTouched"),a=(0,Uf.Pl)(),i=(0,Uf.h0)(r),o=e&&(0,v.isAutopopulationEnabled)(a,t),l=o?r:null,{isTouched:s=!1}=o&&i||{},c=(0,ap.useCallback)((e=>{n({uri:e,isTouched:!0})}),[n]);return{autopopulationContextValue:(0,ap.useMemo)((()=>l?{id:l,isTouched:s,onTouch:c}:null),[l,s,c])}})({enabled:F&&(0,v.isDependentLookupAttrType)(n),attributeTypeUri:null==n?void 0:n.uri,valueUri:r.uri});return ip().createElement("div",{ref:R,className:up()(g.editor,t,_)},ip().createElement(aL,{errorMessage:w,className:g.errorWrapper},ip().createElement("div",{className:up()(g["editor-value"],{[g.deleted]:h},{[g["editor-read-only-value"]]:!C}),"data-reltio-id":"reltio-attribute-value"},C?ip().createElement(SL.m.Provider,{value:M},ip().createElement(Xk.Z,CL({fieldName:(0,v.attributeUriToSearchUri)(n.uri),value:N,dataTypeDefinition:I,error:U,onChange:D,fullWidth:!0},A,y,j))):ip().createElement(Md.x,{value:(0,v.getAttributeValue)(r),dataTypeDefinition:I}))),ip().createElement("div",{className:g["editor-actions"]},E&&ip().createElement(hf(),{variant:"caption",className:g.editedLabel},"(",ei().text("edited"),")"),k&&ip().createElement(Op.T,{icon:wk(),onClick:l,size:"L",className:up()(g.addButton,g.button),"data-reltio-id":"reltio-add-one-more-simple-attribute-button"}),p&&p({attributeType:n,attributeValue:r}),L&&ip().createElement(Op.T,{className:g.button,icon:Kk(),onClick:()=>{s({uri:r.uri,attributeType:n}),(0,v.getErrorType)(i)!==v.ErrorType.missed&&P()},size:"L","data-reltio-id":"reltio-delete-simple-attribute-button"})))})),AL=((e,t=null)=>{const r=(0,ap.forwardRef)(((r,n)=>(()=>{const e=(0,ap.useRef)(!0),{enabled:t,queueSizeThreshold:r=0}=(0,ap.useContext)(uL),[n,a]=(0,ap.useState)(!t||t&&pL<r);e.current&&pL++;const i=(0,ap.useRef)();return(0,ap.useEffect)((()=>{if(pL--,!n)return i.current=setTimeout((()=>{a(!0)}),0),()=>clearTimeout(i.current)}),[]),e.current=!1,n})()?ip().createElement(e,dL({},r,{ref:n})):t&&ip().createElement(t,dL({},r,{ref:n}))));return r.displayName="WithAsyncMount",r})(wL,(()=>{const e=xL();return ip().createElement("div",{className:e.placeholder})})),RL=[v.EntityAttrTypes.roles.uri,v.EntityAttrTypes.tags.uri],_L=ip().createContext(null),IL=ip().createContext(null),NL=(0,ap.createContext)({});function PL(){return PL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},PL.apply(null,arguments)}function DL(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const kL=(0,mL.l)(hL,(e=>{const{highlightAttribute:t}=e||{};return{highlightAttribute:t}}),(({parentAttributeType:e,attrTypes:t,entity:r,parentUri:n,showEmptyEditors:a,mode:i,crosswalks:o,drawLines:l,children:s,className:c,fixedTypeUris:u=RL,onAddAttributes:p,onChangeAttribute:d,onDeleteAttribute:m,additionalControlsRenderer:f,showNonOv:y,highlightAttribute:g})=>{const h=(0,ap.useContext)(NL),E=n&&(0,v.getBaseUri)(n),b=(0,ap.useMemo)((()=>h[E]||[]),[h,E]),T=(0,ap.useContext)(MI),S=(0,ap.useMemo)((()=>t.filter((e=>!b.includes(e.uri)))),[t,b]),{attributes:x={}}=r,[C,w]=(0,ap.useState)({}),A=(0,ap.useCallback)(((e,t)=>{w((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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){DL(e,t,r[t])}))}return e}({},r,{[e]:t})))}),[]);(0,ap.useEffect)((()=>{w({})}),[n]);const{canCreate:R}=(0,ap.useContext)(Dk),_=(0,ap.useMemo)((()=>R&&e&&(0,v.checkCanCreateAttribute)({attributeType:e,mode:i})),[e,i,R]),I=((e,t,r,n)=>e.filter((e=>{const a=((e,t)=>{const{attributes:r={},analyticsAttributes:n={}}=t;return(0,O.cond)([[v.isSpecialAttribute,(0,O.always)(t)],[(0,O.both)(v.isAnalyticAttribute,(0,O.always)(n)),(0,O.always)(n)],[O.T,(0,O.always)(r)]])(e)})(e,t),i=(e=>(0,v.isSpecialAttribute)(e)?"uri":"name")(e);return!((e.singleValue||(0,v.isRoleAttrType)(e)||(0,v.isTagAttrType)(e))&&((0,O.has)(e[i])(a)||r&&(null==n||!n[e.uri])))})))((0,ap.useMemo)((()=>R?(0,v.getCreatableAttributeTypes)(i,S):[]),[S,i,R]),r,a,C),N=(0,ap.useContext)(_L),P=(0,ap.useMemo)((()=>(0,v.getAttributesListForEditMode)(S,i,r,a,y,N,R,T)),[S,i,r,a,y,N,R,T]),[D,k]=(0,ap.useMemo)((()=>oL(u,P)),[P,u]),L=(0,ap.useCallback)((t=>{p(t.map((t=>({attributeType:t,parentUri:t===e?(0,v.getParentUri)(n):n})))),g((0,O.last)(t),yL.NewAttribute)}),[p,n,e]),U={enabled:l},j=(0,ap.useMemo)((()=>({hasDeletionsMap:C,setHasDeletions:A})),[C,A]);return ip().createElement("div",{className:c},s&&ip().createElement(KI,U,s),ip().createElement(KI,PL({},U,{plain:!0}),I.length>0&&i!==v.Mode.Viewing&&ip().createElement(Nk,{label:ei().text("More attributes"),onApply:L,dense:l,data:I,parent:_&&e})),ip().createElement(IL.Provider,{value:j},k.concat(D).map((({attrType:e,values:t})=>ip().createElement(rF,{key:`${e.uri}_${n}`,attributeType:e,drawLines:l,values:t,paging:(0,O.path)(["paging",e.uri],x),parentUri:n,showEmptyEditors:a,mode:i,crosswalks:o,onAddAttributes:p,onChangeAttribute:d,onDeleteAttribute:m,additionalControlsRenderer:f,showNonOv:y})))))})),LL=(0,Sp.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}}))),UL=(0,mL.l)(hL,((e,{attributeValue:t})=>{const{element:r,type:n}=e||{},a=gL(n);return{highlightedError:a&&(null==r?void 0:r.uri)===t.uri?e:null,isHighlightedPath:a&&(0,O.pipe)((0,O.propOr)([],"path"),(0,O.any)((0,O.pathEq)(["value","uri"],t.uri)))(r)}}),(({label:e,attributeTypesList:t,attributeType:r,attributeValue:n,children:a,errors:i,ownError:o,mode:l,metadata:s,crosswalks:c,lazy:u,showEmptyEditors:p,onAddOneMore:d,onAddAttributes:m,onDeleteAttribute:f,onChangeAttribute:y,additionalControlsRenderer:g,hideDeleteButton:h,state:E,showNonOv:b,isHighlightedPath:T,highlightedError:O,expanded:S=!1})=>{const x=LL(),C="deleted"===E,w="edited"===E,A=n.uri,R=(0,v.isTempUri)(A),_=R||S,[I,N]=(0,ap.useState)(_),{ref:P,errorClassName:D}=OL({highlightedError:O}),k=n.masked?v.Mode.Viewing:l;(0,ap.useEffect)((()=>{T&&N(!0)}),[T]),(0,ap.useEffect)((()=>{N(_)}),[_]);const{canDelete:L}=kk(n.uri),U=(0,ap.useMemo)((()=>L&&(0,v.checkCanDeleteAttribute)({attributeType:r,attributeValue:n,mode:k,metadata:s,isReltioCrosswalk:(0,v.isReltioCrosswalk)(c,n)})),[r,n,k,s,c,L]),j=!C&&!h&&!!f&&U&&!n.masked&&k!==v.Mode.Viewing,F=(0,ap.useMemo)((()=>(0,v.hasAttributeDescendantsWithErrors)(n,i)),[i,n]);(0,ap.useEffect)((()=>{F&&N(!0)}),[i,F]),(0,ap.useEffect)((()=>{C&&N(!1)}),[C]);const M=(t||[]).some((e=>(0,v.isAnalyticAttribute)(e))),V=(0,ap.useMemo)((()=>({attributes:M?null:n.value,analyticsAttributes:M?n.value:null})),[n,M]),B=(0,v.getErrorMessage)(o)||F&&ei().text("Has an incorrect value")||"";return u?ip().createElement(Gh(),{variant:"text",color:"primary",onClick:d},"Create attribute"):ip().createElement("div",{ref:P,"data-reltio-id":"reltio-edit-mode-complex-attribute",className:up()(x.complexWrapper,D)},ip().createElement("div",{className:x.editor},ip().createElement("div",{className:x.titleContainer},ip().createElement(XP,{onClick:()=>N((e=>!e)),expanded:I,className:x.expandButton,disabled:C}),ip().createElement(aL,{errorMessage:B,classes:{helperText:x.errorWrapperHelperText}},ip().createElement("div",{className:up()(x.label,{[x.deleted]:C}),"data-reltio-id":"reltio-attribute-complex-label"},e))),ip().createElement("div",{className:x.actions},w&&ip().createElement(hf(),{variant:"caption",className:x.editedLabel},"(",ei().text("edited"),")"),g&&g({attributeType:r,attributeValue:n}),j&&ip().createElement(Op.T,{icon:Kk(),onClick:()=>f({uri:A,attributeType:r,attributeValue:n}),size:"L","data-reltio-id":"reltio-delete-complex-attribute-button"}))),I&&ip().createElement(kL,{parentAttributeType:r,attrTypes:t,entity:V,showEmptyEditors:p||R,drawLines:!0,parentUri:A,mode:k,crosswalks:c,onAddAttributes:m,onChangeAttribute:y,onDeleteAttribute:f,additionalControlsRenderer:g,showNonOv:b},a))}));function jL(){return jL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},jL.apply(null,arguments)}const FL=(0,ap.memo)((e=>{const{attributeValue:t,attributeType:r}=e,n=(0,v.evaluateDeepEntityLabel)(t,r.dataLabelPattern);return ip().createElement(UL,jL({label:(0,v.getLabel)(n),attributeTypesList:r.attributes||r.analyticsAttributes},e))}));FL.displayName="NestedAttributeEditor";var ML=r(84199),VL=r(62880);const BL=(0,Sp.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=BL();return ip().createElement(Uy.h,e,i,r&&!(0,O.prop)("Group",a)&&ip().createElement("span",{className:o.addLabel,onClick:()=>t(n)},ip().createElement(wk(),{className:o.addIcon}),r))};zL.propTypes={children:lp().element.isRequired,selectProps:lp().object.isRequired};const HL=(0,Sp.Z)({singleValue:{fontSize:"14px",lineHeight:"16px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",marginTop:"17px"}});function YL(){return YL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},YL.apply(null,arguments)}const WL=e=>{const{selectProps:{menuIsOpen:t},innerProps:r,children:n}=e,a=HL();return!t&&ip().createElement(hf(),YL({className:a.singleValue},r),n)};function GL(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){qL(e,t,r[t])}))}return e}function qL(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}WL.propTypes={children:lp().node,innerProps:lp().object};const ZL=(0,Sp.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"}}}),$L={menu:e=>GL({},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=>GL({},e,{maxHeight:"208px",padding:"8px 0"}),group:e=>GL({},e,{padding:"0 0 8px 0"}),input:e=>GL({},e,{height:"16px",color:"rgba(0, 0, 0, 0.87)",fontSize:"14px",lineHeight:"16px",margin:"16px 0 0",padding:0}),option:e=>GL({},e,{fontSize:"13px",lineHeight:"15px",height:"32px"})},KL={menuList:e=>GL({},e,{padding:0})},XL={input:e=>GL({},e,{height:"16px",color:"rgba(0, 0, 0, 0.87)",fontSize:"14px",lineHeight:"16px",margin:0,padding:0})};function QL(){return QL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},QL.apply(null,arguments)}function JL(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){eU(e,t,r[t])}))}return e}function eU(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const tU=e=>{let{value:t,label:r,createLabel:n,getOptions:a,options:i,height:o=46,onChange:l=O.identity,onCreate:s,onClear:c=O.identity,components:u,textFieldInputRef:p,TextFieldProps:d,classes:m}=e,f=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.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=ZL({height:o}),[g,h]=(0,ap.useState)(!1),E=(0,ap.useRef)(null),b=a?Cy:Sy.J,T=(0,O.prop)("ClearIndicator",u)?{}:{IndicatorSeparator:ML.V,ClearIndicator:ML.V},S=s?(e,t)=>{s(e,t),h(!1)}:void 0,x=(0,O.prop)("Group",u)?KL:{},C=(0,O.isEmpty)(r)?XL:{},w=JL({},$L,x,C),A=JL({},y,m);return ip().createElement(b,QL({placeholder:"",defaultOptions:!0},f,{value:(0,O.defaultTo)(null,t),loadOptions:a,options:i,cacheOptions:!0,onChange:l,onCreate:S,onClear:c,createLabel:n,classes:A,styles:w,components:JL({DropdownIndicator:VL.G,LoadingIndicator:ML.V,SingleValue:WL,Menu:zL},T,u),menuPlacement:"auto",TextFieldProps:JL({},d,{label:r,variant:"filled",size:"small",classes:JL({},(0,O.prop)("classes",d),{root:up()(y.formControl,(0,O.path)(["classes","root"],d))}),inputProps:JL({},(0,O.prop)("inputProps",d)),InputProps:JL({},(0,O.prop)("InputProps",d),{classes:JL({},(0,O.path)(["InputProps","classes"],d),{root:up()(y.filledInputRoot,(0,O.path)(["InputProps","classes","root"],d)),underline:up()({[y.filledInputUnderline]:(0,v.isEmptyValue)(t)},(0,O.path)(["InputProps","classes","underline"],d)),focused:up()("focused",(0,O.path)(["InputProps","classes","focused"],d))})}),InputLabelProps:JL({},(0,O.prop)("InputLabelProps",d),{classes:JL({},(0,O.path)(["InputLabelProps","classes"],d),{root:up()(y.inputLabel,(0,O.path)(["InputLabelProps","classes","root"],d)),shrink:up()("shrink",(0,O.path)(["InputLabelProps","classes","shrink"],d))}),shrink:!(0,v.isEmptyValue)(t)||void 0}),ref:p||E}),inputRef:p||E,menuIsOpen:g,onMenuOpen:()=>h(!0),onMenuClose:()=>h(!1)}))},rU={value:lp().oneOfType([lp().object,lp().array]),label:lp().string.isRequired,getOptions:lp().func,options:lp().array,onChange:lp().func,onCreate:lp().func,onClear:lp().func,createLabel:lp().string,components:lp().object,textFieldInputRef:lp().object,TextFieldProps:lp().object,height:lp().number,classes:lp().object};tU.propTypes=rU;var nU=r(98018);function aU(){return aU=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},aU.apply(null,arguments)}const iU=e=>{const t=(0,Uf.$H)()||"";return ip().createElement(nU.ZP,aU({},e,{storagePath:(r=t,r.endsWith("/")?r:r+"/")}));var r},oU=(0,Sp.Z)({entityContainer:{display:"flex",alignItems:"center",height:"32px",minHeight:"32px",padding:0,"&.focused":{backgroundColor:"rgba(0,0,0,0.04)"}},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 lU(){return lU=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},lU.apply(null,arguments)}const sU=({innerRef:e,innerProps:t,selectOption:r,data:n,isFocused:a})=>{const i=oU(),{uri:o,entityType:l,label:s,secondaryLabel:c}=n;return""!==o?ip().createElement(Wp(),lU({className:up()(i.entityContainer,{focused:a}),ref:e,key:o,onClick:()=>r({label:s,uri:o,entityType:l})},t),ip().createElement(iU,{className:i.entityAvatar,entityType:l}),ip().createElement(ad.Y,{value:`${s}${c?", "+c:""}`},ip().createElement("span",{className:i.entityLabel},s,c&&ip().createElement("span",{className:i.entitySecondaryLabel},", ",c)))):ip().createElement(Wp(),lU({className:i.entityContainer,ref:e,key:o},t,{disabled:!0}),ip().createElement("span",{className:i.emptyEntityLabel},ei().text("No results found")))},cU=(0,Sp.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"}}))),uU=({selectProps:{currentEntityType:e,menuIsOpen:t,disableLinkClick:r},children:n,data:a})=>{const i=cU(),o=(0,Uf.ax)("openEntity"),l=(0,Uf.Qh)(),{generateEntityUrl:s}=(0,ap.useContext)(_P.v),c=(0,v.isTempUri)(a.entityUri)?{className:i.singleValue,component:"span"}:{className:up()(i.singleValue,i.linkValue),onMouseDown:e=>{e.stopPropagation()},onClick:e=>{e.stopPropagation(),r?e.preventDefault():(0,Tp.rR)(e)||(o({uri:a.entityUri}),e.preventDefault())},href:s({uiPath:l,uri:a.entityUri}),component:"a"};return t?null:ip().createElement(hf(),c,(0,v.isTempUri)(a.entityUri)?ei().text(`New ${e.label} will be created`):(0,v.getLabel)(n))},pU=(0,Sp.Z)({clearIcon:{cursor:"pointer",height:"20px",width:"20px"}}),dU=e=>{const{selectProps:{onClear:t}}=e,r=pU();return ip().createElement(Yh(),{onClick:t,size:"large"},ip().createElement(NI(),{className:r.clearIcon}))};dU.propTypes={selectProps:lp().object.isRequired};var mU=r(95574);const fU=(0,Sp.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:yU}=mU.c,gU=e=>{const{selectProps:{inputValue:t,onCreate:r},data:n,children:a}=e,i=fU();return ip().createElement(yU,e,ip().createElement("div",{className:i.groupHeading},ip().createElement("span",null,n.label),r&&ip().createElement("span",{onClick:()=>r(t,n.entityType),className:i.addLabel},ip().createElement(wk(),{className:i.addIcon}),ei().text(`Create ${t?`"${t}" as `:""}new ${n.label}`))),a)};gU.propTypes={selectProps:lp().object.isRequired,data:lp().object,children:lp().array};const hU=e=>e&&e.attributes,EU=({entityUri:e,entityType:t,mode:r,attributeTypesSelectionStrategy:n=hU})=>{const a=(0,Uf.ax)("addAttributes"),i=(0,Uf.ax)("removeAttribute"),o=(0,Uf.ax)("modifyAttribute"),l=(0,Uf.vc)(e),s=(0,ap.useMemo)((()=>n(t)),[n,t]);return l?ip().createElement(kL,{key:l.uri,attrTypes:s,entity:l,showEmptyEditors:!0,drawLines:!0,parentUri:l.uri,mode:r,crosswalks:l.crosswalks,onAddAttributes:a,onChangeAttribute:o,onDeleteAttribute:i}):null};function bU(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const vU=(0,Sp.Z)({creatorWrapper:{marginTop:"20px"}});function TU(){return TU=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},TU.apply(null,arguments)}function OU(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){SU(e,t,r[t])}))}return e}function SU(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function xU(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}const CU=20,wU=e=>{let{entity:t={},entityTypesUris:r=[],mode:n,max:a=CU,onChange:i,onCreate:o,metadata:l,globalSearchRequestOptions:s,attributeTypesSelectionStrategy:c,disableLinkClick:u=!1,isMasked:p=!1}=e,d=xU(e,["entity","entityTypesUris","mode","max","onChange","onCreate","metadata","globalSearchRequestOptions","attributeTypesSelectionStrategy","disableLinkClick","isMasked"]);const m=vU(),[f,y]=(0,ap.useState)(""),g=(0,ap.useMemo)((()=>r.map((e=>(0,v.getEntityType)(l,e))).filter(v.isAvailableEntityType)),[r,l]),h=OU({},s,{max:a,sendMasked:p}),E=o?(e,t)=>{o(t||r[0],e),y("")}:void 0,b=e=>{null!==e&&(y(""),i(e))},T=(0,ap.useMemo)((()=>1!==g.length),[g]),S=((0,O.isEmpty)(t)?g[0]:(0,v.getEntityType)(l,t.entityType))||{},x=o&&ei().text(`Create ${f?`"${f}" as `:""}new ${S.label}`),C=ei().text(`Select ${1===g.length?`${g[0].label} `:""}profile`),w=!(0,O.isEmpty)(t)&&(0,v.isTempUri)(t.entityUri),A=T?{Group:gU,GroupHeading:ML.V}:{},R=w?{ClearIndicator:dU}:{},{TextFieldProps:_}=d,I=xU(d,["TextFieldProps"]),N=(0,ap.useMemo)((()=>OU({},_||{},{"data-reltio-id":"reltio-entity-selector"})),[_]);return ip().createElement(ip().Fragment,null,ip().createElement(tU,TU({value:(0,O.isEmpty)(t)?void 0:t,inputValue:f,onInputChange:e=>{y(e)},getOptions:e=>(0,v.typeAheadSearch)(g,e,h).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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){bU(e,t,r[t])}))}return e}({},t,{label:(0,v.getLabel)(t.label),entityType:e.find((({uri:e})=>e===t.type))}))),a=e=>(0,O.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)})(g,o)),getOptionLabel:(0,O.prop)("entityLabel"),onChange:b,onCreate:E,onClear:()=>{b({})},label:C,createLabel:x,components:OU({Option:sU,SingleValue:uU},A,R),currentEntityType:S,isClearable:!0,disableLinkClick:u,TextFieldProps:N},I)),w&&ip().createElement("div",{className:m.creatorWrapper},ip().createElement(EU,{mode:n,attributeTypesSelectionStrategy:c,entityType:S,entityUri:t.entityUri})))},AU=(0,Sp.Z)({item:{marginBottom:"20px"},dense:{marginBottom:0}});function RU(){return RU=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},RU.apply(null,arguments)}function _U(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const IU=(0,mL.l)(hL,((e,{attributeValue:t,attributeType:r})=>{const{element:n,type:a}=e||{};return{highlightedError:gL(a)&&(0,v.isAttributeTypeError)(n,t.uri,r.uri)?e:null}}),(e=>{const t=AU(),{highlightedError:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.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,ap.useRef)(a),{ref:p,errorClassName:d}=OL({highlightedError:r,isSimple:!0}),m=(0,v.getReferencedEntityUriFromAttrValue)(a),f=(0,Uf.ax)("entityDeleted"),y=(0,Uf.ax)("entityCreated"),g=(0,Uf.ax)("errorDeactivated"),h=(0,Uf.vc)(m),E=(0,v.isTempUri)(m)?h:null,b=(0,Uf.AH)(),T=(0,Uf.mU)(["ovOnly"]),S=(0,v.getReferencedEntityFromAttrValue)(a),x=(0,v.getReferencedRelationFromAttrValue)(a),C=(0,v.getReferencedEntityTypeUriFromAttrType)(i),w=(0,v.getEntityType)(b,C),A=E?(0,v.evaluateDeepEntityLabel)(E,w.dataLabelPattern):a.label,R=(0,ap.useMemo)((()=>[C]),[C]),_=(0,ap.useMemo)((()=>(0,v.addReferencedRelationCrosswalks)(l,x)),[l,x]),I=(0,ap.useMemo)((()=>(0,v.getReferencedEntityActiveError)(a,s)),[a,s]),N=(0,ap.useMemo)((()=>S&&{entityUri:(0,v.getReferencedEntityUri)(S),entityType:(0,v.getReferencedEntityTypeUri)(S),entityLabel:a.label}),[S,a.label]),P=(0,ap.useMemo)((()=>(0,v.getReferencedRelationAttrTypesUris)(i).map((e=>(0,v.findAttributeTypeByUri)(b,e))).filter(O.identity)),[i,b]),D=(0,ap.useCallback)((e=>(0,v.referencedEntityAttributeTypesSelectionStrategy)(i,e)),[i]),k=(0,ap.useCallback)((e=>{E&&f(E.uri);const t=u.current,r=!(0,O.isEmpty)(e)&&e.uri===(0,v.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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){_U(e,t,r[t])}))}return e}({},a,{label:e.label,refEntity:r?t.refEntity:(0,v.convertReferencedEntityForAttrValue)(e),refRelation:r?t.refRelation:(0,v.createReferencedRelationForAttrValue)(a)});c({value:n,attributeType:i,uri:a.uri}),I&&g((0,v.getErrorId)(I))}),[a,i,E,c,f,g,I]),L=(0,ap.useCallback)(((e,t)=>{const r=(0,O.pipe)(D,(0,v.getCreatableAttributeTypes)(o))(w),n=(0,v.createTemporaryEntity)({entityTypeUri:e,initValue:t,attributeTypes:r,metadata:b,mode:o});k(n),y(n)}),[D,o,w,b,k,y]),{canCreate:U,canUpdate:j}=kk(a.uri),F=(0,ap.useMemo)((()=>j&&(0,v.checkCanEditAttribute)({attributeType:i,attributeValue:a,mode:o,isReltioCrosswalk:(0,v.isReltioCrosswalk)(l,a)})),[i,a,o,l,j]),M=(0,ap.useMemo)((()=>U&&(0,v.checkMetadataForCreate)(o,w)),[o,w,U]),V=(0,v.getErrorMessage)(I);return ip().createElement(UL,RU({},n,{label:(0,v.getLabel)(A),attributeTypesList:P,crosswalks:_,metadata:b}),ip().createElement("div",{ref:p,className:d},ip().createElement(aL,{errorMessage:V},ip().createElement(wU,{className:up()(t.item,{[t.dense]:V||N&&(0,v.isTempUri)(N.entityUri)}),entity:N||{},entityTypesUris:R,globalSearchRequestOptions:T,mode:o,isDisabled:!F||!!a.masked,onChange:k,onCreate:M?L:void 0,metadata:b,attributeTypesSelectionStrategy:D,isMasked:(0,v.isAttributeHasMaskedValue)(a)}))))}));function NU(){return NU=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},NU.apply(null,arguments)}const PU=(0,ap.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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className"]);return ip().createElement("div",{ref:t,"data-reltio-id":"reltio-edit-attribute",className:r},class{static build(e,t={}){switch(e.type){case v.DataTypes.TYPE_NESTED:return ip().createElement(FL,t);case v.DataTypes.TYPE_REFERENCE:return ip().createElement(IU,t);default:{const e=(0,O.omit)(["showEmptyEditors","onAddAttributes","lazy","errors","crosswalks","showNonOv","expanded"],t);return ip().createElement(AL,NU({isReltioCrosswalk:(0,v.isReltioCrosswalk)(t.crosswalks,t.attributeValue)},e))}}}}.build(e.attributeType,n))}));PU.displayName="EditModeAttribute";const DU=e=>ei().text("${value}",{value:1===e?ei().text("value"):ei().text("values")}),kU=(0,O.has)("minValue"),LU=(0,O.has)("maxValue"),UU=(0,O.pipe)(LU,O.not),jU=(0,O.propSatisfies)((e=>1===e),"minValue"),FU=({minValue:e})=>ei().text("This attribute can have minimum ${minValue} ${minValueCaption}",{minValue:ei().number(e,"0"),minValueCaption:DU(e)}),MU=({maxValue:e})=>ei().text("This attribute can have maximum ${maxValue} ${maxValueCaption}",{maxValue:ei().number(e,"0"),maxValueCaption:DU(e)}),VU=(0,O.cond)([[O.isNil,(0,O.always)("")],[({minValue:e,maxValue:t})=>e&&e===t,({minValue:e})=>ei().text("This attribute should have ${minValue} ${minValueCaption}",{minValue:ei().number(e,"0"),minValueCaption:DU(e)})],[(0,O.allPass)([jU,LU]),MU],[(0,O.allPass)([jU,UU]),(0,O.always)("")],[(0,O.allPass)([kU,LU]),({minValue:e,maxValue:t})=>ei().text("${minCardinality} and maximum ${maxValue} ${maxValueCaption}",{minCardinality:FU({minValue:e}),maxValue:ei().number(t,"0"),maxValueCaption:DU(t)})],[LU,MU],[kU,FU],[O.T,(0,O.always)("")]]),BU=(0,Sp.Z)((()=>({caption:{fontSize:"0.7rem",opacity:.54}}))),zU=({cardinality:e})=>{const t=BU(),r=VU(e);return r?ip().createElement(hf(),{variant:"caption",className:t.caption},r):null};function HU(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){YU(e,t,r[t])}))}return e}function YU(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const WU={content:'""',position:"absolute",left:"-1000px",top:"-4px",width:"5000px",height:"calc(100% + 8px)",animationName:"$highlightAnimation",animationDuration:"2s",animationIterationCount:1,opacity:0},GU=(0,Sp.Z)((()=>({"@keyframes highlightAnimation":{"0%":{opacity:0},"50%":{opacity:1},"100%":{opacity:0}},highlighted:{"&::before":HU({},WU,{background:"rgba(228, 151, 0, 0.08)"}),position:"relative"}}))),qU=e=>{const t=GU(),r=(0,ap.useRef)(null);return(0,ap.useEffect)((()=>{e&&e.scrollIntoRef(r)}),[e]),e?{ref:r,highlightedClassName:t.highlighted}:{ref:r}},ZU=(0,O.filter)((0,O.propSatisfies)(v.isTempUri,"uri")),$U=(0,Sp.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"}}))),KU=({max:e,values:t,attributeType:r,parentUri:n,mode:a,drawLines:i,showEmptyEditors:o,errorMessage:l,errors:s,paging:c,crosswalks:u,showNonOv:p,nonVisibleValues:d,highlightedError:m,highlightedAttribute:f,onAddAttributes:y,onDeleteAttribute:g,onChangeAttribute:h,onDeactivateError:E,additionalControlsRenderer:b,requestNextPageOfAttributeValues:T})=>{const S=$U(),[x,C]=(0,ap.useState)(e),[w,A]=(0,ap.useState)(!1),{label:R,required:_,cardinality:I,name:N,uri:P,description:D}=r,k=(0,v.isEditableMode)(a),{ref:L,errorClassName:U}=OL({highlightedError:m}),{ref:j,highlightedClassName:F}=qU(f),M=(0,ap.useContext)(_L),V=(0,ap.useContext)(MI),B=(0,ap.useMemo)((()=>null==M?void 0:M.includes(P)),[P,M]),z=(0,ap.useMemo)((()=>null==V?void 0:V.includes(P)),[P,V]),H=(0,v.isEmptyValue)(t),Y=(!w&&o||_||B||z)&&H,W=(0,Uf.Ws)(),G=(0,ap.useMemo)((()=>W.includes(r.uri)),[W,r.uri]),q=(0,ap.useRef)((0,v.createNewAttribute)({parentUri:n,attributeType:(0,O.omit)(["defaultValue"],r)})),Z=(0,ap.useCallback)((()=>{C(x+1);const e=e=>({parentUri:n,index:x,attributeType:e});if(Y&&!(0,v.isComplexAttribute)(r.type)){const t=[e((0,O.omit)(["defaultValue"],r)),e(r)];return y(t)}return y([e(r)])}),[x,y,n,r,Y]),$=(0,ap.useCallback)((0,O.pipe)(g,O.T,A),[g,A]);if(H&&!Y)return null;if(Y&&H&&(t=[q.current]),(0,v.isEmptyValue)(t))return null;const K=(ZU(t)||[]).length,X=p?"totalValues":"totalOvValues",Q=(0,O.ifElse)((0,O.has)(X),(0,O.pipe)((0,O.prop)(X),(0,O.add)(K)),(0,O.always)(t.length))(c),J=null!=c&&c.totalValues?c.totalValues-Q:null==d?void 0:d.length,ee=e<Q,te=ee&&x<Q,re=ee&&x>=Q,ne=t.slice(0,x),ae=ne?ne.length-1:0,ie=Q-x;return ip().createElement(KI,{enabled:i},ip().createElement("div",{ref:L,className:up()(S.wrapper,U)},ip().createElement("div",{className:S.titleWrapper},ip().createElement(sP,{label:R,isRequired:_,className:S.title,"data-reltio-id":"reltio-attribute-label"}),ip().createElement(hP,{description:D}),G&&ip().createElement(CD,null),ip().createElement(dP,{nonOvValues:d,attributeType:r,className:S.ovIcon,nonOvTotal:J})),k&&ip().createElement(zU,{cardinality:I}),k&&ip().createElement(Zk,{message:l,className:S.typeError}),ip().createElement("div",{className:S.attributesWrapper},ne.map(((e,t)=>ip().createElement(PU,{key:e.uri,attributeValue:e,attributeType:r,lazy:Y&&!_,showEmptyEditors:o,errors:s,ownError:(0,v.getAttributeOwnError)(e,t,r.uri,s),mode:a,crosswalks:u,onAddOneMore:ae===t?Z:null,onAddAttributes:y,onDeleteAttribute:$,onChangeAttribute:h,onDeactivateError:E,additionalControlsRenderer:b,className:0===t?F:null,ref:0===t?j:null,isEmptyEditor:Y}))),te&&ip().createElement(MD,{moreNumber:(0,O.min)(e,ie),valueNumber:ie,onClick:()=>{t.length<Q&&T({parentUri:n,attributeTypeUri:P,attributeTypeName:N,values:t,defaultMaxValues:e}),C(x+e)}}),re&&ip().createElement(HD,{onClick:()=>{C(e)}}))))};KU.displayName="AttributeRenderer";const XU=(0,ap.memo)(KU),QU=(0,Sp.Z)({value:{color:"rgba(0, 0, 0, 0.87)"}}),JU=(0,Sp.Z)({placeholder:{color:"rgba(0, 0, 0, 0.38)",fontSize:"14px !important"}});function ej(){return ej=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ej.apply(null,arguments)}function tj(){return tj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},tj.apply(null,arguments)}const rj={SingleValue:({selectProps:{menuIsOpen:e},data:{label:t}})=>{const r=QU();return!e&&ip().createElement(hf(),{variant:"body2",classes:{root:r.value}},t)},Placeholder:({innerProps:e,children:t})=>{const r=JU();return ip().createElement(hf(),ej({className:r.placeholder},e),t)}},nj=e=>ip().createElement(tU,tj({components:rj},e)),aj=(0,ap.memo)(nj),ij=(0,Sp.Z)({container:{display:"flex",flex:1,alignItems:"flex-start",marginBottom:"10px"},roleContainer:{width:"100%"},valueContainer:{marginLeft:"8px",width:0},deleteButton:{marginLeft:"8px"}}),oj={MultiValue:Fy._},lj=({values:e,onChange:t,onDelete:r})=>{const n=ij(),a=(0,Uf.AH)(),i=(0,Uf.eh)(),o=i.uri,l=(0,v.getRolesForEntityType)(a,i.type).map((e=>({value:e.uri,label:e.label}))),s=(e||[]).map((e=>{var t;return{value:e,label:(null===(t=l.find((0,O.propEq)("value",e)))||void 0===t?void 0:t.label)||(0,v.getLastUriPart)(e)}})),c=(0,ap.useCallback)((e=>{const r=(null==e?void 0:e.map((0,O.prop)("value")))||[];t({value:r,attributeType:v.EntityAttrTypes.roles,uri:o})}),[o,t]),u=(0,ap.useCallback)((()=>{r({uri:o,attributeType:v.EntityAttrTypes.roles})}),[o,r]);return ip().createElement("div",{className:n.container,"data-reltio-id":"reltio-attribute-value"},ip().createElement(aj,{label:"",height:40,isMulti:!0,options:l,value:s,onChange:c,components:oj,classes:n,className:n.roleContainer}),!!r&&ip().createElement(Op.T,{"data-reltio-id":"reltio-roles-delete-button",className:n.deleteButton,icon:Kk(),onClick:u,size:"L"}))};var sj=r(56333);const cj=(0,Sp.Z)({container:{display:"flex",flex:1,alignItems:"flex-start",marginBottom:"10px"},deleteButton:{marginLeft:"8px"}});function uj(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){pj(e,t,r[t])}))}return e}function pj(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const dj=({className:e,values:t,onChange:r,onDelete:n})=>{const a=cj(),i=(0,Uf.lG)(),o=(0,Uf.mU)(),l=(0,ap.useCallback)((async(e,t,r)=>{const n=await(0,v.getFacetedAttributeData)({fieldName:"tags",searchValue:e,options:uj({},o,{max:t,pageNo:r})});return Object.keys(n.tags)}),[o]),s=(0,ap.useCallback)((e=>{r({value:e,attributeType:v.EntityAttrTypes.tags,uri:i})}),[r,i]),c=(0,ap.useCallback)((()=>{n({uri:i,attributeType:v.EntityAttrTypes.tags})}),[i,n]);return ip().createElement("div",{className:a.container,"data-reltio-id":"reltio-attribute-value"},ip().createElement(sj.p,{fullWidth:!0,multiple:!0,variant:"filled",className:e,value:t||[],onChange:s,getSuggestions:l}),!!n&&ip().createElement(Op.T,{"data-reltio-id":"reltio-tags-delete-button",className:a.deleteButton,icon:Kk(),onClick:c,size:"L"}))};function mj(){return mj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},mj.apply(null,arguments)}function fj(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const yj=(0,mL.l)(IL,((e,{attributeType:t})=>{const{hasDeletionsMap:r,setHasDeletions:n}=e||{};return{hasDeletions:r?Boolean(r[null==t?void 0:t.uri]):void 0,setHasDeletions:n}}),(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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["values","attributeType","parentUri","mode","errorMessage","onDeleteAttribute","onChangeAttribute","showEmptyEditors","hasDeletions","setHasDeletions","highlightedAttribute"]);const m=$U(),{label:f,required:y,cardinality:g}=r,h=(0,v.isEditableMode)(a),[E,b]=(0,ap.useState)(!1),T=(0,ap.useCallback)((e=>{b(e),null==u||u(r.uri,e)}),[r.uri,u]),S=void 0!==c?c:E,x=(0,ap.useCallback)((0,O.pipe)(o,O.T,T),[o,T]),C=(0,v.isEmptyValue)(t),w=!S&&s&&C,A=(0,ap.useRef)((0,v.createNewAttribute)({parentUri:n,attributeType:r})),{ref:R,highlightedClassName:_}=qU(p);return(0,v.isActivenessAttrType)(r)&&C&&!w?null:ip().createElement("div",{ref:R,className:up()(_,m.wrapper)},ip().createElement(sP,{label:f,isRequired:y,className:up()(m.title,m.titleWrapper),"data-reltio-id":"reltio-attribute-label"}),h&&ip().createElement(zU,{cardinality:g}),h&&ip().createElement(Zk,{message:i}),ip().createElement(jI(),{className:m.attributesWrapper},(()=>{switch(r.uri){case v.EntityAttrTypes.tags.uri:return ip().createElement(dj,{values:t,onDelete:x,onChange:l});case v.EntityAttrTypes.roles.uri:return ip().createElement(lj,{values:t,onDelete:x,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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){fj(e,t,r[t])}))}return e}({},A.current,{value:t[0]||""});return ip().createElement(PU,mj({attributeValue:e,attributeType:r,mode:a,onDeleteAttribute:x,onChangeAttribute:l},d))}}})()))}));var gj=r(57517),hj=r.n(gj);function Ej(){return Ej=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ej.apply(null,arguments)}const bj=e=>ip().createElement("svg",Ej({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),ip().createElement("defs",null,ip().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"})),ip().createElement("g",{transform:"translate(-3 -3)",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},ip().createElement("mask",{id:"Download_svg__b",fill:"#fff"},ip().createElement("use",{xlinkHref:"#Download_svg__a"})),ip().createElement("path",{fillOpacity:.54,fill:"#fff",mask:"url(#Download_svg__b)",d:"M0 0h24v24H0z"})));var vj=r(76550),Tj=r.n(vj),Oj=r(29367),Sj=r.n(Oj);const xj=(0,Sp.Z)((()=>({root:{fontSize:"24px",color:"#fff"}}))),Cj=({checked:e,className:t,onClick:r})=>{const n=xj(),a=e?Sj():Tj();return ip().createElement(a,{className:up()(n.root,t),onClick:r})},wj=(0,Sp.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"}}))),Aj=e=>{const{id:t,canBeSelected:r=!1,selected:n=!1,selectionMode:a=!1,onDeselect:i=O.identity,onSelect:o=O.identity,onShareLink:l,onSetAsDefault:s,onDelete:c,onDownload:u=O.identity,onClick:p}=e,d=wj(),[m,f]=(0,ap.useState)(!1),{canDelete:y}=kk(t),g=(0,ap.useMemo)((()=>[{text:ei().text("Share link"),onClick:l},{text:ei().text("Set as default"),onClick:s},{text:ei().text("Delete"),onClick:y&&c}].filter((0,O.prop)("onClick"))),[l,s,c,y]),h=e=>()=>(0,O.ifElse)((0,O.equals)(!0),i,o)(e),E=r&&(n||m||a),b=!a&&!n&&m,v=r&&n;return ip().createElement("div",{className:up()(d.overlay,{[d.selected]:n,[d.selectionMode]:a}),onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),onClick:a?h(n):e=>{e.currentTarget===e.target&&p()},"data-reltio-id":"image-actions-overlay"},E&&ip().createElement(Cj,{className:d.checkedIcon,checked:n,onClick:h(n)}),b&&ip().createElement("div",{className:d.actions},ip().createElement(Op.T,{onClick:u,className:d.actionButton,icon:bj}),ip().createElement(xN,{menuId:`image-overlay-actions-${t}`,buttonComponent:Op.T,buttonProps:{icon:Id(),className:up()(d.actionButton,d.dropDownMenuButton)},menuItems:g})),v&&ip().createElement(Gh(),{className:d.button,variant:"outlined",onClick:i},ei().text("Deselect")))},Rj=(0,ap.memo)(Aj);var _j=r(70251),Ij=r.n(_j),Nj=r(1937),Pj=r.n(Nj);const Dj=(0,Sp.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}}))),kj=e=>0===e.trim().length,Lj=({onSend:e})=>{const t=Dj(),[r,n]=(0,ap.useState)(""),[a,i]=(0,ap.useState)(null);return ip().createElement(jI(),{className:t.root},ip().createElement(BI(),{className:t.paper},ip().createElement(Pj(),{value:r,onChange:e=>{const t=e.target.value,r=new RegExp(/^(ftp|http|https):\/\/[^ "]+$/).test(t);n(t),r||kj(t)?i(null):i(ei().text("URL is not correct"))},classes:{root:t.inputRoot,input:t.input},placeholder:ei().text("Paste an image URL here")}),ip().createElement(Gh(),{disabled:Boolean(a)||kj(r),variant:"outlined",color:"primary",onClick:()=>{e(r),n(""),i(null)}},ei().text("Send"))),a&&ip().createElement(hf(),{className:t.errorMessage},a))};var Uj=r(65680),jj=r(83997);const Fj=["image/png","image/jpeg","image/tiff","image/gif","image/bmp"],Mj=({className:e,onAppendFile:t})=>ip().createElement(ip().Fragment,null,ip().createElement("input",{onInput:e=>{t&&t(e.currentTarget.files[0])},style:{display:"none"},accept:Fj.join(","),id:"upload-image-button","data-reltio-id":"upload-image-button",type:"file"}),ip().createElement("label",{htmlFor:"upload-image-button"},ip().createElement(Gh(),{className:e,variant:"contained",color:"primary",component:"span"},ei().text("Select image"))));function Vj(){return Vj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Vj.apply(null,arguments)}const Bj=e=>ip().createElement("svg",Vj({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),ip().createElement("defs",null,ip().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"UploadIcon_svg__c"},ip().createElement("stop",{stopColor:"#FFF",offset:"0%"}),ip().createElement("stop",{stopColor:"#FFF",stopOpacity:0,offset:"100%"})),ip().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"UploadIcon_svg__d"},ip().createElement("stop",{stopColor:"#FFF",offset:"0%"}),ip().createElement("stop",{stopColor:"#FFF",stopOpacity:0,offset:"100%"})),ip().createElement("linearGradient",{x1:"67.572%",y1:"54.952%",x2:"15.212%",y2:"13.907%",id:"UploadIcon_svg__e"},ip().createElement("stop",{stopColor:"#000",stopOpacity:0,offset:"0%"}),ip().createElement("stop",{stopColor:"#000",offset:"100%"})),ip().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"UploadIcon_svg__f"},ip().createElement("stop",{stopColor:"#B8EDFF",offset:"0%"}),ip().createElement("stop",{stopColor:"#53ACDE",offset:"100%"})),ip().createElement("circle",{id:"UploadIcon_svg__a",cx:128,cy:128,r:128})),ip().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},ip().createElement("mask",{id:"UploadIcon_svg__b",fill:"#fff"},ip().createElement("use",{xlinkHref:"#UploadIcon_svg__a"})),ip().createElement("use",{fillOpacity:.1,fill:"#0072CE",xlinkHref:"#UploadIcon_svg__a"}),ip().createElement("g",{mask:"url(#UploadIcon_svg__b)"},ip().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(-1 9)"},ip().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}),ip().createElement("ellipse",{fill:"url(#UploadIcon_svg__c)",opacity:.4,cx:64.553,cy:107.664,rx:61.43,ry:62.336}),ip().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})),ip().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)"}),ip().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)"})))),zj=(0,Sp.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"}}))),Hj=({onAppendFile:e,className:t})=>{const r=zj(),[{canDrop:n,isOver:a},i]=(0,Uj.useDrop)({accept:[jj.FILE],drop:t=>{t&&e(t.files[0])},collect:e=>({isOver:e.isOver(),canDrop:e.canDrop()})}),o=n&&a;return ip().createElement("div",{ref:i,className:up()(r.root,{[r.isActive]:o},t)},ip().createElement(Bj,{className:r.icon}),ip().createElement(hf(),{className:r.title},ei().text("Drag an image here")),ip().createElement(hf(),{className:r.description},ei().text("Acceptable image types would include JPG, PNG, TIFF, GIF, BMP. Maximum image size: ${MAX_IMAGE_SIZE}Mb",{MAX_IMAGE_SIZE:20})),ip().createElement(Mj,{onAppendFile:e}))},Yj=(0,Sp.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"}}))),Wj=({children:e,className:t})=>{const r=Yj();return ip().createElement(jI(),{className:up()(r.root,t)},ip().createElement(jI(),{className:r.border}),ip().createElement(hf(),{className:r.text},e),ip().createElement(jI(),{className:r.border}))},Gj=(0,Sp.Z)({closeIcon:{color:"#fff"}}),qj=({error:e,onClose:t})=>{const r=Gj();return ip().createElement(zh(),{open:Boolean(e),onClose:t,message:e,action:ip().createElement(gd.k,{className:r.closeIcon,tooltipTitle:ei().text("Close"),icon:Ep(),onClick:t})})},Zj=(0,Sp.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"}}))),$j=({open:e,onClose:t,onUpload:r})=>{const n=Zj(),[a,i]=(0,ap.useState)(!1),[o,l]=(0,ap.useState)(null),s=(0,Uf.qD)(),c=(0,Uf.fN)(),u=(0,Uf.Uv)(),p=e=>{i(!0),(0,v.uploadImage)({image:e,imageServicePath:s,environment:c,tenant:u}).then((e=>{r(e),t()})).catch((e=>{l((0,v.getRequestErrorMessage)(e,ei().text("Something went wrong")))})).finally((()=>i(!1)))};return ip().createElement(Ij(),{open:e,onClose:t,classes:{paper:n.dialogPaper}},ip().createElement(hf(),{className:n.title},ei().text("Add new image")),ip().createElement(jI(),{className:n.body},ip().createElement(Hj,{className:n.targetBox,onAppendFile:e=>{if(!e)return l(ei().text("No image selected."));const t=Number((e.size/1024/1024).toFixed(2)),r=Fj.includes(e.type);t>20?l(ei().text("File size exceeds configured max file size.")):r?p(e):l(ei().text("File format is not supported."))}}),ip().createElement(Wj,{className:n.divider},ei().text("or")),ip().createElement(Lj,{onSend:e=>{p(e)}})),a&&ip().createElement(wE.z,null),ip().createElement(qj,{error:o,onClose:()=>l(null)}))},Kj=(0,Sp.Z)((()=>({root:{width:"100%"},image:({imageMargin:e})=>({marginRight:e,cursor:"pointer","&:last-child":{marginRight:0}}),uploadContainer:({imageMargin:e,imageWidth:t,imageHeight:r})=>({backgroundColor:"white",width:t,height:r,cursor:"pointer",border:"1px dashed #0072CE",boxSizing:"border-box",marginRight:e,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}),uploadButton:{width:"50px",height:"50px"},uploadIcon:{fontSize:"36px"}}))),Xj={},Qj=({attributeType:e={},attributeValues:t=[],onDeleteAttribute:r,onChangeAttribute:n,requestNextPageOfAttributeValues:a,parentUri:i,paging:o,showNonOv:l,imageSize:s=fk})=>{const c=Kj(s),[u,p]=(0,ap.useState)(!1),d=(0,Uf.ax)("setDefaultProfilePicForModifiedEntity"),m=(0,Uf.eh)()||Xj,f=(0,Uf.AU)(m.uri),{canCreate:y}=(0,ap.useContext)(Dk),g=(0,ap.useCallback)((()=>{p((e=>!e))}),[]),h=(0,ap.useCallback)((t=>{const r=(0,v.generateUri)(i,e.name),a={};for(const n in t){const i=(e.attributes||[]).find((({name:e})=>e===n));i&&(a[n]=[{uri:(0,v.generateUri)(r,i.name),ov:!0,value:t[n],type:i.uri}])}n({attributeType:e,uri:r,value:a})}),[n,i,e]),E=(0,ap.useCallback)((e=>{if(r(e),f===e.uri){var n;const r=(null===(n=t[0])||void 0===n?void 0:n.uri)===e.uri?t[1]:t[0];d({entityUri:m.uri,value:r||{}})}}),[r,m,f,t,d]),b=(t,r)=>{const{onOpenImageGalleryDialog:n,onDownload:a,onShareLink:i,onSetAsDefault:o}=t,l=(0,v.getImageAttributeOvUrl)(r),{uri:s}=r;return ip().createElement(Rj,{id:s,onShareLink:()=>i(l),onSetAsDefault:()=>o(r),onDelete:()=>E({uri:s,attributeType:e}),onDownload:()=>a([l]),onClick:()=>n(s)})};return ip().createElement("div",{className:c.root,"data-reltio-id":"image-line-edit-mode"},ip().createElement(UF,{attributeValues:t,attributeType:e,renderImage:e=>(t={})=>{const r=(0,v.getImageAttributeOvThumbnailUrl)(t),{uri:n}=t,{onOpenImageGalleryDialog:a}=e;return ip().createElement("div",{className:c.image,key:n},ip().createElement(mk,{src:r,overlay:b(e,t),onClick:()=>a(n),size:{imageWidth:s.imageWidth,imageHeight:s.imageHeight},"data-reltio-id":"reltio-attribute-value"}))},overlay:!0,countFixedItems:y?1:0,onUpload:g,onDeleteAttribute:E,imageSize:s,requestNextPageOfAttributeValues:a,paging:o,parentUri:i,showNonOv:l},y&&ip().createElement("div",{className:c.uploadContainer,onClick:g},ip().createElement(Op.T,{className:c.uploadButton,iconClassName:c.uploadIcon,icon:hj(),"data-reltio-id":"reltio-upload-image-button"}))),ip().createElement($j,{open:u,onUpload:h,onClose:g}))},Jj=({attributeType:e,attributeValues:t,paging:r,parentUri:n,showNonOv:a,onDeleteAttribute:i,onChangeAttribute:o,requestNextPageOfAttributeValues:l,highlightedAttribute:s,error:c,highlightedError:u,onDeactivateError:p})=>{const d=$U(),{label:m,description:f,required:y}=e,{ref:g,highlightedClassName:h}=qU(s),{ref:E,errorClassName:b}=OL({highlightedError:u}),T=(0,ap.useCallback)((()=>{c&&p&&p((0,v.getErrorId)(c))}),[c,p]);return ip().createElement("div",{ref:g,className:up()(d.wrapper,h)},ip().createElement("div",{ref:E,className:up()(d.imagesWrapper,b)},ip().createElement("div",{className:d.titleWrapper},ip().createElement(sP,{className:d.title,label:m,"data-reltio-id":"reltio-attribute-label",isRequired:y}),ip().createElement(hP,{description:f})),ip().createElement(aL,{errorMessage:null==c?void 0:c.message,className:d.errorWrapper},ip().createElement(Qj,{attributeValues:t,attributeType:e,paging:r,onDeleteAttribute:i,parentUri:n,onChangeAttribute:(0,O.pipe)(o,T),requestNextPageOfAttributeValues:l,showNonOv:a}))))};let eF=function(e){return e.imageLine="imageLine",e.special="special",e.default="default",e}({});function tF(){return tF=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},tF.apply(null,arguments)}const rF=(0,mL.l)(hL,((e,{attributeType:t,parentUri:r})=>{const{element:n,type:a}=e||{},i=(e=>e===yL.NewAttribute)(a)&&n.uri===t.uri;return{highlightedAttribute:i?e:null,highlightedError:gL(a)&&(0,v.isAttributeTypeError)(n,r,t.uri)?e:null}}),(({values:e,attributeType:t,mode:r=v.Mode.Viewing,crosswalks:n,drawLines:a,paging:i={},parentUri:o,max:l,showEmptyEditors:s,showNonOv:c,highlightedError:u,highlightedAttribute:p,onAddAttributes:d,onDeleteAttribute:m,onChangeAttribute:f,additionalControlsRenderer:y})=>{const g=(0,Uf.ax)("errorDeactivated"),h=(0,Uf.ax)("requestNextPageOfAttributeValues"),E=(0,ap.useContext)(NL),b=o&&(0,v.getBaseUri)(o),T=(0,ap.useMemo)((()=>E[b]||[]),[E,b]),S=(0,Uf.Jz)(o,t),x=(0,ap.useMemo)((()=>(0,v.filterErrorsForHiddenAttributes)(S,T)),[S,T]),C=(0,Uf.Xj)(),w=(0,Uf.vd)(),A=(0,v.getAttributePagerActiveTypeErrorMessage)(o,t,C),R=l??w??1/0,_=(0,O.partition)(v.isOv),[I,N]=_(e),P=c?e:I,D=c?[]:N,k={errorMessage:A,errors:x,mode:r,parentUri:o,onAddAttributes:d,onDeleteAttribute:m,onChangeAttribute:f,onDeactivateError:g,additionalControlsRenderer:y,showEmptyEditors:s,highlightedError:u,highlightedAttribute:p};return(()=>{switch((0,O.cond)([[v.isSpecialAttribute,(0,O.always)(eF.special)],[v.isImage,(0,O.always)(eF.imageLine)],[O.T,(0,O.always)(eF.default)]])(t)){case eF.special:return ip().createElement(KI,{enabled:a},ip().createElement(yj,tF({values:P,attributeType:t},k)));case eF.imageLine:return ip().createElement(KI,{enabled:a},ip().createElement(Jj,{attributeValues:P,attributeType:t,paging:i,onDeleteAttribute:m,parentUri:o,onChangeAttribute:f,requestNextPageOfAttributeValues:h,showNonOv:c,highlightedAttribute:p,error:(0,v.getAttributeErrorByTypeUri)(t.uri,x),highlightedError:u,onDeactivateError:g}));default:return ip().createElement(XU,tF({values:P,attributeType:t,max:R,paging:i,crosswalks:n,drawLines:a,requestNextPageOfAttributeValues:h,showNonOv:c,nonVisibleValues:D},k))}})()})),nF=(0,Sp.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"}}),aF=({attributeType:e,imageAttributeFieldsOrder:t,attributeValue:r,hasChanges:n,onDeleteAttribute:a,onChangeAttribute:i,onAddAttributes:o,onCancel:l,onApply:s,mode:c})=>{const u=nF(),p=Mk(r,e,t),d=0!==p.length||0===p.length&&n;return ip().createElement(jI(),{className:u.root},ip().createElement(jI(),{className:u.form},p.map((({attrType:e,values:t})=>ip().createElement(rF,{key:e.uri,parentUri:r.uri,attributeType:e,values:t,showEmptyEditors:(0,v.isTempUri)(r.uri),mode:c,drawLines:!1,onDeleteAttribute:a,onChangeAttribute:i,onAddAttributes:o})))),d&&ip().createElement(ip().Fragment,null,ip().createElement(Cf(),{className:u.divider}),ip().createElement(jI(),{className:u.actions},ip().createElement(Gh(),{disabled:!n,onClick:l,className:u.cancelButton},ei().text("Cancel")),ip().createElement(Gh(),{disabled:!n,onClick:s,color:"primary"},ei().text("Apply")))))},iF={palette:{mode:"dark",primary:v.theme.palette.primary,secondary:v.theme.palette.secondary}},oF=(0,xm.createTheme)(iF),lF=({imageAttributeFieldsOrder:e,attributeType:t,attributeValue:r})=>{const n=(0,Uf.YA)(),a=(0,Uf.o_)(),{addAttributes:i,changeAttribute:o,deleteAttribute:l,clearLocalChanges:s,applyLocalChanges:c,attributeValue:u,hasChanges:p}=(({initialAttributeValue:e,attributeType:t})=>{const r=(0,Uf.ax)("modifyAttribute"),[n,a]=(0,ap.useState)(e);(0,ap.useEffect)((()=>{a(e)}),[e]);const i=!(0,O.equals)(n,e),o=(0,ap.useCallback)((e=>{a((t=>e.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:a}=t;return(0,v.addAttribute)({entity:e,attributeType:r,parentUri:n,index:a,nestingLevel:1})}),t)))}),[]),l=(0,ap.useCallback)((({value:e,attributeType:t,uri:r})=>{a((n=>(0,v.editAttribute)({entity:n,attributeType:t,uri:r,value:e,nestingLevel:1})))}),[]),s=(0,ap.useCallback)((({attributeType:e,uri:t})=>{a((r=>(0,v.removeAttribute)({entity:r,attributeType:e,uri:t,nestingLevel:1})))}),[]);return{addAttributes:o,changeAttribute:l,deleteAttribute:s,clearLocalChanges:(0,ap.useCallback)((()=>{a(e)}),[e]),applyLocalChanges:(0,ap.useCallback)((()=>{r({value:n,attributeType:t,uri:n.uri})}),[n,t,r]),attributeValue:n,hasChanges:i}})({attributeType:t,initialAttributeValue:r});return ip().createElement(xm.ThemeProvider,{theme:oF},ip().createElement(jI(),null,ip().createElement(zk,{attributeType:t,uri:null==u?void 0:u.uri,onAddAttributes:a?i:void 0}),ip().createElement(Gk,{attributeType:t,attributeValue:u,imageAttributeFieldsOrder:e}),a&&ip().createElement(aF,{mode:n,imageAttributeFieldsOrder:e,attributeType:t,attributeValue:u,hasChanges:p,onDeleteAttribute:l,onChangeAttribute:o,onAddAttributes:i,onCancel:s,onApply:c})))},sF=(0,Sp.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}}))),cF=({className:e,attributeValue:t,handleSetAsDefault:r,attributeType:n})=>{const a=sF(),[i,o]=(0,ap.useState)(!1),l=(0,Uf.eh)()||{},s=(0,Uf.vc)(null==l?void 0:l.uri)||{},c=(0,Uf.xH)(),u=(0,Uf.uO)()||{},p=c?l:s,d=u[null==l?void 0:l.type]||(null==u?void 0:u.default)||{};(0,ap.useEffect)((()=>{o((null==p?void 0:p.defaultProfilePic)===(null==t?void 0:t.uri))}),[null==t?void 0:t.uri,p]);const m=(0,ap.useCallback)((()=>{r(t.uri)}),[null==t?void 0:t.uri]);return ip().createElement(jI(),{className:up()(a.root,e)},ip().createElement(jI(),{className:a.header},ip().createElement(hf(),{className:a.headerTitle},ei().text("Details"))),ip().createElement(jI(),{className:a.bodyWrapper},ip().createElement(jI(),{className:a.body},ip().createElement(vh(),{classes:{root:a.formControlLabel,label:a.checkboxLabel},control:ip().createElement(Hp(),{className:a.checkbox,checked:i,onChange:m}),label:ei().text("Set as default")}),ip().createElement(lF,{attributeType:n,imageAttributeFieldsOrder:d,attributeValue:t}))))},uF=(0,Sp.Z)((()=>({root:{display:"flex",width:"100%",overflowY:"auto",height:"calc(100vh - 64px)"},main:{flex:"1 0 auto"},details:{width:"340px"}}))),pF=({attributeValues:e=[],currentAttributeValueUri:t,setCurrentAttributeValueUri:r,handleSetAsDefault:n,attributeType:a})=>{const[i,o]=(0,ap.useState)(0);(0,ap.useEffect)((()=>{l(t?e.findIndex((e=>e.uri===t)):0)}),[t,e]);const l=(0,ap.useCallback)((t=>{var n;o(t),r(null===(n=e[t])||void 0===n?void 0:n.uri)}),[e]),s=uF();return ip().createElement(jI(),{className:s.root},ip().createElement(xk,{attributeValueIndex:i,setAttributeValueIndex:l,attributeValues:e,className:s.main}),ip().createElement(cF,{handleSetAsDefault:n,attributeValue:e[i],className:s.details,attributeType:a}))};let dF=function(e){return e.Gallery="gallery",e.Details="details",e}({});var mF=r(60480),fF=r.n(mF),yF=r(54886),gF=r.n(yF),hF=r(86038),EF=r.n(hF),bF=r(39178),vF=r.n(bF);function TF(){return TF=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},TF.apply(null,arguments)}const OF=e=>ip().createElement("svg",TF({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),ip().createElement("defs",null,ip().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"})),ip().createElement("g",{stroke:"none",strokeWidth:1,fillRule:"evenodd"},ip().createElement("mask",{id:"Details_svg__b",fill:"#fff"},ip().createElement("use",{xlinkHref:"#Details_svg__a"})),ip().createElement("path",{mask:"url(#Details_svg__b)",d:"M0 0h24v24H0z"}))),SF=(0,Sp.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}}))),xF=({open:e,mode:t,children:r,header:n,onClose:a,onChangeMode:i})=>{const o=SF(),l=(0,ap.useMemo)((()=>[{id:dF.Gallery,title:ei().text("Gallery"),Icon:vF()},{id:dF.Details,title:ei().text("Details"),Icon:OF}]),[]);return ip().createElement(Ij(),{classes:{paper:o.paper},open:e,BackdropProps:{className:o.backdrop},fullScreen:!0},ip().createElement(gF(),{classes:{colorPrimary:o.appBar}},ip().createElement(EF(),{className:o.toolbar},ip().createElement(jI(),{className:o.headerLeft},ip().createElement(gd.k,{tooltipTitle:ei().text("Close"),onClick:a,className:o.closeButton,iconClassName:o.closeIcon,icon:Ep()}),null==n?void 0:n.left),ip().createElement(jI(),{className:o.headerCenter},ip().createElement(DE,{modes:l,modeId:t,onChange:i,className:o.modeSwitcher})),ip().createElement(jI(),{className:o.headerRight},null==n?void 0:n.right))),ip().createElement(fF(),{className:o.content},r))},CF=(0,Sp.Z)((()=>({root:{padding:"0 24px",overflowY:"auto",height:"calc(100vh - 64px)"},item:{padding:"2px"}}))),wF=({items:e,selectedItems:t,onSelectImage:r,onDeselectImage:n,onShareLink:a,onSetAsDefault:i,onDownload:o,onClickImage:l,onDelete:s})=>{const c=CF(),u=e=>ip().createElement(Rj,{id:e,selected:t.includes(e),selectionMode:0!==t.length,onSelect:()=>r(e),onDeselect:()=>n(e),onShareLink:()=>a(e),onSetAsDefault:()=>i(e),onDownload:()=>o(e),onClick:()=>l(e),onDelete:s?()=>s(e):void 0,canBeSelected:!0});return ip().createElement(jI(),{className:c.root},ip().createElement(vk(),{container:!0},e.map((({id:e,src:t})=>ip().createElement(vk(),{key:e,classes:{item:c.item},item:!0},ip().createElement(mk,{size:ck.LARGE,onClick:()=>l(e),src:t,overlay:u(e)}))))))},AF=(0,Sp.Z)((e=>({selectButton:{fontSize:"14px",fontWeight:500,color:e.palette.primary.main,textTransform:"uppercase"}}))),RF=({selectedItems:e,items:t,onSelectAll:r,onClearAll:n})=>{const a=AF(),i=e.length===t.length;return ip().createElement(ry(),{component:"button",underline:"none",classes:{button:a.selectButton},onClick:i?n:r},i?ei().text("Clear selection"):ei().text("Select all images"))};var _F=r(70997),IF=r.n(_F);const NF=(0,Sp.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)"}}))),PF=({onDownload:e,onShare:t,onUpload:r,onDelete:n})=>{const a=NF();return ip().createElement(ip().Fragment,null,r&&ip().createElement(Gh(),{variant:"contained",color:"primary",onClick:r,startIcon:ip().createElement(hj(),null)},ei().text("Upload")),e&&r&&ip().createElement("div",{className:a.divider}),e&&ip().createElement(gd.k,{className:a.downloadButton,tooltipTitle:ei().text("Download selected items"),icon:bj,onClick:e}),t&&ip().createElement(gd.k,{className:a.shareButton,tooltipTitle:ei().text("Copy link"),icon:IF(),onClick:t}),n&&ip().createElement(gd.k,{className:a.deleteButton,tooltipTitle:ei().text("Delete selected items"),icon:Kk(),onClick:n}))},DF=({attributeValues:e,open:t,onClose:r,currentAttributeValueUri:n,setCurrentAttributeValueUri:a,attributeType:i,onDownload:o,onShareLink:l,onSetAsDefault:s,onUpload:c,onDeleteAttribute:u})=>{const[p,d]=(0,ap.useState)([]),[m,f]=(0,ap.useState)(dF.Gallery),y=(0,Uf.xH)();(0,ap.useEffect)((()=>{f(n?dF.Details:dF.Gallery)}),[n]);const g=e.map((e=>({src:(0,v.getImageAttributeOvThumbnailUrl)(e),downloadURL:(0,v.getImageAttributeOvUrl)(e),id:e.uri}))),h=e=>{l(g.find((0,O.propEq)("id",e)).downloadURL)},E=t=>{const r=e.find((({uri:e})=>e===t));s(r)},b=e=>{u({uri:e,attributeType:i})},{canCreate:T,canDelete:S}=(0,ap.useContext)(Dk),x=m===dF.Gallery,C=m===dF.Details,w=p.length>0,A=C||x&&w,R=()=>x?p:[n],_=R().every((e=>(0,v.isTempUri)(e)||S)),I=!y&&A&&_,N=!y&&T&&(C||x&&!w),P=x&&w&&ip().createElement(RF,{items:g,selectedItems:p,onClearAll:()=>{d([])},onSelectAll:()=>{d((0,O.pluck)("id",g))}}),D=ip().createElement(PF,{onDelete:I?()=>{R().forEach((e=>{b(e)})),p.length&&d([])}:void 0,onDownload:A?()=>{const e=x?(0,O.pipe)((0,O.filter)((({id:e})=>p.includes(e))),(0,O.pluck)("downloadURL"))(g):[g.find((0,O.propEq)("id",n)).downloadURL];o(e)}:void 0,onShare:C?()=>{h(n)}:void 0,onUpload:N?c:void 0});return ip().createElement(xF,{mode:m,open:t,onChangeMode:f,header:{left:P,right:D},onClose:r},x&&ip().createElement(wF,{items:g,selectedItems:p,onSelectImage:e=>{d((t=>[...t,e]))},onDeselectImage:e=>{d((t=>t.filter((t=>t!==e))))},onShareLink:h,onSetAsDefault:E,onDownload:e=>{o([g.find((0,O.propEq)("id",e)).downloadURL])},onClickImage:e=>{a(e),f(dF.Details)},onDelete:y?void 0:b}),C&&ip().createElement(pF,{handleSetAsDefault:E,setCurrentAttributeValueUri:a,currentAttributeValueUri:n,attributeValues:e,attributeType:i}))},kF=(0,Sp.Z)((e=>({imageBox:{position:"relative",display:"flex",width:"100%",flexGrow:1,flexShrink:0,flexWrap:"nowrap",marginTop:"2px",overflow:"hidden"},moreButtonContainer:({imageWidth:e,imageHeight:t})=>({backgroundColor:"white",width:e,height:t,position:"absolute",right:0,cursor:"pointer"}),moreButton:({imageWidth:t,imageHeight:r})=>({display:"flex",justifyContent:"center",alignItems:"center",width:t,height:r,backgroundColor:(0,xm.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 LF(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const UF=({attributeType:e,attributeValues:t=[],renderImage:r,overlay:n=!1,countFixedItems:a=0,children:i,onUpload:o,onDeleteAttribute:l,imageSize:s=fk,paging:c,parentUri:u,showNonOv:p,requestNextPageOfAttributeValues:d})=>{const m=kF(s);(0,ap.useEffect)((()=>{if(c&&d){const r=p?c.totalOvValues:c.totalValues;r>t.length&&d({parentUri:u,attributeTypeUri:e.uri,attributeTypeName:e.name,values:[],defaultMaxValues:r})}}),[c,d,e,u,t.length,p]);const f=(0,ap.useRef)(),[y,g]=(0,ap.useState)(0),[h,E]=(0,ap.useState)(0),b=(0,ap.useContext)(LI),[T,O]=(0,ap.useState)(!1),[S,x]=(0,ap.useState)(),C=(0,Uf.ax)("setDefaultProfilePicForEntity"),w=(0,Uf.ax)("setDefaultProfilePicForModifiedEntity"),A=(0,Uf.eh)()||{},R=(0,Uf.xH)(),_=(0,ap.useCallback)((e=>{const{imageMargin:r,imageWidth:n}=s,i=Math.floor((e+r)/(n+r))-a,o=e+r-(i+a)*(n+r)<8;g(i),t.length>i?E(t.length-i+(o?1:0)):E(0)}),[t.length,a,s]),I=(0,ap.useCallback)((e=>{_(e),f.current=e}),[_]);(0,ap.useEffect)((()=>{f.current&&_(f.current)}),[t.length,_]);const N=(0,ap.useCallback)((e=>{b||(x(e),O(!0))}),[b]),P=(0,ap.useCallback)((()=>{O(!1)}),[]),D=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),k=e=>navigator.clipboard.writeText(e),L=(0,ap.useCallback)((e=>{R?(0,v.insertDefaultImageByAttrUri)(A.uri,e.uri).then((({status:t})=>{"success"===t&&C(e)})):w({entityUri:A.uri,value:e})}),[R,A.uri,C,w]),U=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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){LF(e,t,r[t])}))}return e}({onOpenImageGalleryDialog:N},n&&{onDownload:D,onShareLink:k,onSetAsDefault:L});return ip().createElement(ip().Fragment,null,ip().createElement(Up.ZP,{handleWidth:!0,onResize:I}),ip().createElement(DF,{attributeValues:t,open:T,onClose:P,setCurrentAttributeValueUri:x,currentAttributeValueUri:S,attributeType:e,onDownload:D,onShareLink:k,onSetAsDefault:L,onUpload:o,onDeleteAttribute:l}),ip().createElement("div",{className:m.imageBox},i,t.slice(0,y).map(r(U)),h>0&&ip().createElement("div",{className:m.moreButtonContainer},ip().createElement("div",{className:m.moreButton,onClick:()=>N()},ip().createElement(hf(),{className:m.number},`+${h}`)))))},jF=(0,Sp.Z)((e=>({image:({imageMargin:e,imageHeight:t,imageWidth:r})=>({marginRight:e,width:r,height:t,cursor:"pointer","&:last-child":{marginRight:0}}),deleteAttributeImage:{position:"relative","&:before":{content:"''",position:"absolute",left:0,top:0,right:0,bottom:0,background:`url('${(0,v.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:v.historyPalettes[v.HistoryOperations.deleteAttribute].backgroundColor,pointerEvents:"none"}},updateAttributeImage:{position:"relative","&:before":{content:"''",position:"absolute",left:0,top:0,right:0,bottom:0,backgroundColor:v.historyPalettes[v.HistoryOperations.updateAttribute].backgroundColor,pointerEvents:"none"}},deleteAttribute:({imageWidth:e,imageHeight:t})=>({width:e,height:t,boxSizing:"border-box",outline:`3px solid ${v.historyPalettes[v.HistoryOperations.deleteAttribute].color}`,outlineOffset:"-3px"}),insertAttribute:({imageWidth:e,imageHeight:t})=>({width:e,height:t,boxSizing:"border-box",outline:`3px solid ${v.historyPalettes[v.HistoryOperations.insertAttribute].color}`,outlineOffset:"-3px"}),updateAttribute:({imageWidth:e,imageHeight:t})=>({width:e,height:t,boxSizing:"border-box",outline:`3px solid ${v.historyPalettes[v.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"}}))),FF=({attributeType:e,attributeValues:t=[],paging:r,parentUri:n,requestNextPageOfAttributeValues:a,showNonOv:i,imageSize:o=fk})=>{const l=jF(o),{appearance:s}=(0,ap.useContext)(TP);return ip().createElement(UF,{attributeValues:t,attributeType:e,renderImage:({onOpenImageGalleryDialog:e})=>t=>{const r=(0,v.getImageAttributeOvThumbnailUrl)(t),{uri:n}=t,a=(0,v.getHistoryAppearanceByUri)(n,s),i=(0,v.getHistoryAttributeClassName)(a);return ip().createElement("div",{className:up()(l.image,{[l[i+"Image"]]:i}),key:n,"data-reltio-id":"reltio-attribute-value"},ip().createElement(mk,{onClick:()=>e(n),className:l[i],src:r,size:{imageWidth:o.imageWidth,imageHeight:o.imageHeight}}))},imageSize:o,requestNextPageOfAttributeValues:a,paging:r,parentUri:n,showNonOv:i})},MF=({attributeType:e,attributeValues:t,paging:r,parentUri:n,showNonOv:a,requestNextPageOfAttributeValues:i})=>{const o=DD(),{label:l,description:s}=e;return ip().createElement(ip().Fragment,null,ip().createElement("div",{className:o.titleRow},ip().createElement(sP,{className:o.title,label:l,"data-reltio-id":"reltio-attribute-label"}),ip().createElement(hP,{className:o.descriptionIcon,description:s})),ip().createElement(FF,{attributeValues:t,attributeType:e,paging:r,parentUri:n,requestNextPageOfAttributeValues:i,showNonOv:a}))},VF=({attributeType:e,classes:t})=>{const r=kD(),{label:n,description:a}=e,i=(0,Uf.Ws)(),o=(0,ap.useMemo)((()=>i.includes(e.uri)),[i,e.uri]);return ip().createElement("div",{"data-reltio-id":"reltio-empty-renderer",className:up()(r.titleRow,r.wrapper)},ip().createElement(sP,{label:n,className:up()(r.title,null==t?void 0:t.title),"data-reltio-id":"reltio-attribute-label"}),o&&ip().createElement(CD,null),ip().createElement(hP,{description:a,className:r.descriptionIcon}))};function BF(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){zF(e,t,r[t])}))}return e}function zF(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const HF="oneLine",YF="multiLine",WF="imageLine",GF="special",qF="empty",ZF=({values:e,attributeType:t,drawLines:r,paging:n={},parentUri:a,max:i,showNonOv:o,classes:l})=>{const s=ND(),c=(0,Uf.ax)("requestNextPageOfAttributeValues"),u=(0,Uf.vd)(),p=i??u??1/0,d=(0,O.partition)(v.isOv),m=(0,ap.useContext)(MI),f=(0,ap.useMemo)((()=>null==m?void 0:m.includes(t.uri)),[t.uri,m]);if(!e||!e.length&&!f)return null;const[y,g]=d(e),h=o?e:y,E=o?[]:g,b=o?"totalValues":"totalOvValues",T=(0,O.ifElse)((0,O.has)(b),(0,O.prop)(b),(0,O.always)(h.length))(n),S=null!=n&&n.totalValues?n.totalValues-T:E.length,x=1===T&&!(0,v.isComplexAttribute)(t),C=0===e.length&&f;return ip().createElement(KI,{enabled:r,className:up()(BF({[s.paddingWrapperWithLines]:r},null!=l&&l.wrapperWithLines?{[null==l?void 0:l.wrapperWithLines]:r}:{}))},ip().createElement("div",{className:up()(BF({[s.paddingWrapper]:!r},null!=l&&l.wrapper?{[null==l?void 0:l.wrapper]:!r}:{}))},(()=>{switch((0,O.cond)([[v.isSpecialAttribute,(0,O.always)(GF)],[v.isImage,(0,O.always)(WF)],[(0,O.always)(x),(0,O.always)(HF)],[(0,O.always)(C),(0,O.always)(qF)],[O.T,(0,O.always)(YF)]])(t)){case HF:return ip().createElement(LD,{value:h[0],nonVisibleValues:E,totalNonVisibleValues:S,attributeType:t,showNonOv:o,classes:l});case YF:return ip().createElement(YD,{values:h,nonVisibleValues:E,totalVisibleValues:T,totalNonVisibleValues:S,attributeType:t,parentUri:a,max:p,requestNextPageOfAttributeValues:c,showNonOv:o,classes:l});case WF:return ip().createElement(MF,{attributeValues:h,attributeType:t,paging:n,parentUri:a,requestNextPageOfAttributeValues:c,showNonOv:o});case GF:return ip().createElement(ak,{values:h,attributeType:t,classes:l});case qF:return ip().createElement(VF,{attributeType:t,classes:l})}})()))},$F=(0,ap.memo)(ZF),KF=({attrTypes:e=[],entity:t,parentUri:r,drawLines:n,children:a,className:i,max:o,fixedTypeUris:l=RL,showNonOv:s,classes:c})=>{const u=(0,ap.useContext)(NL),p=(0,ap.useContext)(MI),d=r&&(0,v.getBaseUri)(r),m=(0,ap.useMemo)((()=>u[d]||[]),[u,d]),f=(0,ap.useMemo)((()=>(e||[]).filter((e=>!m.includes(e.uri)))),[e,m]),[y,g]=(0,ap.useState)(o||1/0),h=(0,ap.useMemo)((()=>(0,v.getAttributesListForReadMode)(f,t,s,p)),[f,t,s,p]),[E,b]=(0,ap.useMemo)((()=>oL(l,h)),[h,l]),T=b.slice(0,y),S=o&&T.length<b.length,x=o&&T.length>=b.length&&o<T.length,C={enabled:n};return ip().createElement("div",{className:i},a&&ip().createElement(KI,C,a),T.concat(E).map((({attrType:e,values:a})=>ip().createElement($F,{key:e.uri,attributeType:e,drawLines:n,values:a,paging:(0,O.path)(["paging",e.uri],t.attributes),parentUri:r,showNonOv:s,classes:c}))),S&&ip().createElement(MD,{onClick:()=>{g(1/0)}}),x&&ip().createElement(HD,{onClick:()=>{g(o)}}))};KF.displayName="ReadOnlyAttributesList";const XF=(0,ap.memo)(KF),QF=(0,Sp.Z)({attributesContainer:{padding:"8px 16px"},noCaption:{paddingTop:"16px"},noData:{fontSize:"13px",color:"rgba(0,0,0,0.54)"}}),JF=({className:e,entity:t={},caption:r="",excludeUris:n=[],includeUris:a=[],attributesCount:i})=>{const o=QF(),l=(0,Uf.AH)(),s=(0,Uf.xK)(),c=(0,ap.useMemo)((()=>iL(l,t.type,a,n)),[n,a,l,t]),u=i||16,p=(0,v.getAttributesListForReadMode)(c,t),d=(0,ap.useContext)(MI),m=p.filter((({values:e})=>!(0,v.isEmptyValue)(e))).length>0||d.length>0;return m||!(0,v.isEmptyValue)(r)?ip().createElement(FI.Provider,{value:s},ip().createElement(GI,{className:e},r&&ip().createElement(qI.I,{title:r}),ip().createElement(jI(),{className:up()(o.attributesContainer,{[o.noCaption]:!r})},m?ip().createElement(XF,{entity:t,attrTypes:c,parentUri:t.uri,drawLines:!1,max:u}):ip().createElement(hf(),{className:o.noData},ei().text("No data found"))))):null},eM=(0,Sp.Z)({attributesContainer:{overflow:"hidden",padding:"8px 16px"},noCaption:{paddingTop:"16px"}}),tM=({className:e,mode:t,entity:r,caption:n="",excludeUris:a=[],includeUris:i=[],pinnedAttributes:o})=>{const l=eM(),s=(0,Uf.ax)("addAttributes"),c=(0,Uf.ax)("modifyAttribute"),u=(0,Uf.ax)("removeAttribute"),p=(0,Uf.AH)(),d=(0,Uf.R2)(),m=(0,Uf.vc)(r.uri)||{},f=(0,ap.useMemo)((()=>(0,v.getPinnedAttributesForUser)(o,d)),[o,d]),y=(0,ap.useMemo)((()=>iL(p,m.type,i,a)),[a,i,p,m.type]);return ip().createElement(GI,{className:e},n&&ip().createElement(qI.I,{title:n}),ip().createElement(jI(),{className:up()(l.attributesContainer,{[l.noCaption]:!n})},ip().createElement(_L.Provider,{value:f},ip().createElement(kL,{entity:m,attrTypes:y,parentUri:m.uri,drawLines:!1,mode:t,showEmptyEditors:(0,v.isTempUri)(m.uri),crosswalks:m.crosswalks,onAddAttributes:s,onChangeAttribute:c,onDeleteAttribute:u}))))};function rM(){return rM=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},rM.apply(null,arguments)}const nM=e=>{let{attributesCount:t,pinnedAttributes:r,alwaysVisible:n=[]}=e,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributesCount","pinnedAttributes","alwaysVisible"]);const i=(0,Uf.Fr)(),o=(0,Uf.YA)(),l=a.entity||i,s=a.mode||o;return ip().createElement(cP.Provider,{value:l},ip().createElement(MI.Provider,{value:n},(0,v.isViewMode)(s)?ip().createElement(JF,rM({},a,{attributesCount:t,entity:l})):ip().createElement(tM,rM({},a,{mode:s,pinnedAttributes:r,entity:l}))))},aM=(0,Sp.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)"}}))),iM=()=>{const e=aM(),t=(0,sp.useSelector)(Ws),r=(0,sp.useSelector)(Hs);return ip().createElement(ip().Fragment,null,r&&ip().createElement(wE.z,null),t?ip().createElement("div",{className:e.container},ip().createElement(kI,{entity:t,classes:{profileBand:e.profileBand}}),ip().createElement("div",{className:e.scrollWrapper},ip().createElement(LI.Provider,{value:!0},ip().createElement(nM,{className:e.attributesView,entity:t,mode:v.Mode.Viewing})))):ip().createElement("div",{className:e.emptyState},ip().createElement(CE,{LogoRenderer:xE.NO_DATA,text:ei().text("No data to display."),secondaryText:ei().text("Select a profile and view preview details here."),variant:SE.embedded})))},oM="circle",lM="polygon",sM={fillColor:"rgb(242,82,82)",fillOpacity:.1,strokeWeight:2,strokeColor:"#F25252",clickable:!1,editable:!0,zIndex:1},cM={mapTypeControl:!1,streetViewControl:!1,fullscreenControl:!1},uM=.001,pM=ip().createContext({});pM.displayName="EntityMarkerContext";var dM=r(17871);const mM=(0,Sp.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"}}}}))),fM=({entity:e,classes:t={}})=>{const r=mM(),{secondaryLabel:n,label:a}=t,i=(0,v.getLabel)(e.label),{secondaryLabel:o}=e,l=(0,ap.useCallback)((()=>{navigator.clipboard.writeText((0,v.getEntityId)(e))}),[e]);return ip().createElement(ip().Fragment,null,ip().createElement(b.A,{entity:e,imageClassName:r.image}),ip().createElement("div",{className:r.info},ip().createElement(Ld.x,{value:(0,v.getEntityUriForLink)(e),className:r.link},ip().createElement(ad.Y,{value:i,placement:"top",showOnExceededHeight:!0},ip().createElement("div",{className:up()(r.label,a)},i))),o&&ip().createElement(ad.Y,{value:o,placement:"top",showOnExceededHeight:!0},ip().createElement("div",{className:up()(r.secondaryLabel,n)},o)),ip().createElement("div",{className:r.thirdRow},ip().createElement(cE,{entity:e,size:"medium"}),ip().createElement("div",{className:r.entityId,onClick:l},ip().createElement("div",{className:r.entityIdLabel},ei().text("ID:")),ip().createElement(ad.Y,{value:`Copy to clipboard ${(0,v.getEntityId)(e)}`,placement:"top"},ip().createElement("div",{className:r.entityIdValue},(0,v.getEntityId)(e)))))))},yM=(0,Sp.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)"}}),gM=()=>{const e=yM();return ip().createElement(ip().Fragment,null,ip().createElement("div",{className:up()(e.avatar,e.wave)}),ip().createElement("div",{className:e.info},ip().createElement("div",{className:up()(e.label,e.wave)}),ip().createElement("div",{className:up()(e.secondaryLabel,e.wave)}),ip().createElement("div",{className:up()(e.thirdRow,e.wave)})))},hM=(0,Sp.Z)({container:{display:"flex",padding:"16px",overflow:"hidden"}});function EM(){return EM=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},EM.apply(null,arguments)}const bM=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["entity","classes","variant"]);const i=hM(),{container:o}=r;return ip().createElement("div",EM({className:up()(i.container,o)},a),"normal"===n?ip().createElement(fM,{entity:t,classes:r}):ip().createElement(gM,null))},vM=(0,ap.memo)(bM),TM=(0,Sp.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 OM(){return OM=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},OM.apply(null,arguments)}const SM=(0,v.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>'),xM=(0,v.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>'),CM=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["marker","onClick"]);const a=TM(),i=(0,ap.useRef)(),[o,l]=(0,ap.useState)(!1),{activeEntityUri:s}=(0,ap.useContext)(pM),c=(0,O.pathEq)(["entity","uri"],s,t),u={lat:t.point.lat,lng:t.point.lng},p=(0,ap.useCallback)((0,v.debounce)(l,50),[]),d=(0,ap.useCallback)((()=>p(!0)),[p]),m=(0,ap.useCallback)((()=>p(!1)),[p]),f=(0,ap.useCallback)((()=>r(t)),[r,t]);return ip().createElement(ip().Fragment,null,ip().createElement(mN.r,{anchorEl:i.current,open:o,className:a.popper,modal:!1,placement:"top"},ip().createElement(vM,{entity:t.entity,onMouseOver:d,onMouseOut:m})),ip().createElement(dM.Jx,OM({icon:{url:o||c?SM:xM,scaledSize:new google.maps.Size(22,32)},position:u,onClick:f,visible:!1!==t.visible,onMouseOver:d,onMouseOut:m},n)),ip().createElement(dM.vD,{options:{alignBottom:!0,pane:"mapPane",pixelOffset:new google.maps.Size(0,-40),closeBoxURL:"",enableEventPropagation:!0,disableAutoPan:!0},position:u},ip().createElement("span",{ref:i})))},wM=(0,ap.memo)(CM);var AM=r(47111);const RM=({children:e,className:t,position:r,map:n})=>{const[a,i]=(0,ap.useState)(null);return(0,ap.useEffect)((()=>{const e=document.createElement("div"),t=n.controls[r].length;return n.controls[r].push(e),i(e),()=>{n.controls[r].removeAt(t)}}),[n,r]),(0,ap.useEffect)((()=>{a&&t&&a.classList.add(t)}),[t,a]),a?(0,AM.createPortal)(e,a):null};var _M=r(518),IM=r.n(_M);function NM(){return NM=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},NM.apply(null,arguments)}const PM=e=>ip().createElement("svg",NM({width:18,height:18,viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgRadius"},e),ip().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 DM(){return DM=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},DM.apply(null,arguments)}const kM=e=>ip().createElement("svg",DM({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),ip().createElement("defs",null,ip().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"})),ip().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},ip().createElement("mask",{id:"Draw_svg__b",fill:"#fff"},ip().createElement("use",{xlinkHref:"#Draw_svg__a"})),ip().createElement("g",{mask:"url(#Draw_svg__b)",fill:"#000",fillOpacity:.54},ip().createElement("path",{d:"M0 0h24v24H0z"})))),LM=(0,Sp.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"}}),UM=(0,id.T)(Gh()),jM=({drawingMode:e,drawingModes:t=[],hasActiveOverlay:r,onDrawingModeChanged:n,onClearOverlay:a})=>{const i=LM(),o=e=>()=>{n(e)};return ip().createElement("div",{className:i.container},e||r?ip().createElement(UM,{tooltipTitle:ei().text("Clear area"),className:i.button,onClick:r?a:o(null)},ip().createElement(IM(),{className:i.icon})):t.map((e=>{const t=(e=>{switch(e){case oM:return PM;case lM:return kM;default:return null}})(e);return ip().createElement(UM,{tooltipTitle:ei().text("Draw area"),key:e,className:i.button,onClick:o(e)},ip().createElement(t,{className:i.icon}))})))},FM=(0,Sp.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"}}}),MM=({isSearchOnMapMove:e,onChangeIsSearchOnMapMove:t})=>{const r=FM();return ip().createElement(vh(),{classes:{root:r.container,label:r.label},control:ip().createElement(Hp(),{checked:e,onChange:e=>{t(e.target.checked)},className:r.checkbox}),label:ei().text("Search as I move the map")})},VM=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]]},BM=e=>{switch(e){case oM:return window.google.maps.drawing.OverlayType.CIRCLE;case lM:return window.google.maps.drawing.OverlayType.POLYGON;default:return null}},zM=(e,t,r)=>{if(t.path){const n=r||new window.google.maps.LatLngBounds;t.path.forEach((({lat:e,lng:t})=>n.extend(new window.google.maps.LatLng(e,t)))),e.fitBounds(n)}},HM=(0,Sp.Z)({mapControlContainer:{borderRadius:"2px",backgroundColor:"#FFFFFF",boxShadow:"0 1px 3px 0 rgba(0,0,0,0.15)",margin:"10px"}});function YM(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){WM(e,t,r[t])}))}return e}function WM(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const GM=["drawing"],qM=({markers:e=[],mapKey:t,defaultZoom:r,defaultCenter:n,loadingElement:a,isSearchOnMapMove:i,isSearchEnabled:o,activeOverlay:l,overlayOptions:s={},drawingModes:c=[],markerClusterer:u,markerClustererOptions:p,mapOptions:d={},mapContainerClassName:m,onMapBoundsChanged:f=O.identity,onOverlayUpdated:y=O.identity,onMarkerClicked:g=O.identity})=>{const h=HM(),{isLoaded:E,loadError:b}=(0,dM.Ji)({googleMapsApiKey:t,libraries:GM}),v=(0,ap.useRef)(null),[T,S]=(0,ap.useState)(null),[x,C]=(0,ap.useState)(null),[w,A]=(0,ap.useState)(null);(({markers:e,activeOverlay:t,isSearchOnMapMove:r,map:n})=>{const a=Boolean(n&&window.google),i=(0,Ay.D)(e),o=(0,Ay.D)(t),l=(0,Ay.D)(a);(0,ap.useEffect)((()=>{const s=i!==e,c=l!==a,u=a&&t&&(o!==t||c);a&&!r&&e.length&&(s||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+uM,t.lng+uM)),n.extend(new window.google.maps.LatLng(t.lat-uM,t.lng-uM))}t.fitBounds(n),r&&zM(t,r,n)})(e,n,t):u&&zM(n,t)}),[a,e,t])})({markers:e,activeOverlay:l,map:T,isSearchOnMapMove:i});const R=(0,ap.useMemo)((()=>YM({},sM,s)),[s]),_=(0,ap.useMemo)((()=>YM({},cM,d)),[d]),I=(0,ap.useCallback)((e=>{f(e?VM(T):null),A(null),clearTimeout(v.current)}),[T,f]),N=(0,ap.useCallback)((()=>{clearTimeout(v.current)}),[]),P=(0,ap.useCallback)((()=>{i&&f(VM(T))}),[i,T,f]),D=(0,ap.useCallback)((()=>{i&&(clearTimeout(v.current),v.current=setTimeout(P,1e3))}),[P,i]),k=(0,ap.useCallback)(((e,t)=>{var r;const n=t||x&&{type:lM,overlay:x};if((0,O.isEmpty)(n))return;const{overlay:a,type:i}=n,o={[lM]:()=>a.getPath().getArray().map((e=>[e.lat(),e.lng()])),[oM]:()=>({radius:a.getRadius()/1e3,center:a.getCenter()})},l=null===(r=o[i])||void 0===r?void 0:r.call(o);l&&y({data:l,type:i})}),[y,x]),L=(0,ap.useCallback)((e=>t=>{k(null,{type:e,overlay:t}),t.setMap(null),A(null)}),[k]),U=(0,ap.useCallback)((()=>{y(null)}),[y]),j=t=>e.filter((0,O.prop)("point")).map((e=>ip().createElement(wM,{key:e.id,marker:e,clusterer:t,onClick:g})));if(b)return null;if(!E)return a;const F=o&&Boolean(c.length),M=T&&o&&Boolean(c.length),V=T&&o,B=!BM(w)&&l&&(0,O.propEq)("type",lM,l);return ip().createElement(dM.b6,{mapTypeId:window.google.maps.MapTypeId.ROADMAP,options:_,onLoad:S,zoom:r,center:n,onZoomChanged:N,onDragStart:N,onIdle:D,mapContainerClassName:m},M&&ip().createElement(RM,{className:h.mapControlContainer,position:window.google.maps.ControlPosition.TOP_RIGHT,map:T},ip().createElement(jM,{hasActiveOverlay:!!l,drawingModes:c,drawingMode:w,onDrawingModeChanged:A,onClearOverlay:U})),V&&ip().createElement(RM,{className:h.mapControlContainer,position:window.google.maps.ControlPosition.TOP_CENTER,map:T},ip().createElement(MM,{onChangeIsSearchOnMapMove:I,isSearchOnMapMove:i})),u?(z=p,ip().createElement(dM.XL,{options:z},j)):j(),B&&ip().createElement(dM.mg,{onLoad:C,path:l.path,editable:!0,options:R,onMouseUp:k,onDragEnd:k}),F&&ip().createElement(dM.j_,{onPolygonComplete:L(lM),onCircleComplete:L(oM),drawingMode:BM(w),options:{drawingControl:!1,circleOptions:R,polygonOptions:R}}));var z},ZM=(e,t)=>Math.abs(e-t)<1,$M=(0,O.curry)(((e,t,r)=>{const n=t.map((({position:t})=>{const r=e.find((({point:e})=>ZM(t.lat(),e.lat)&&ZM(t.lng(),e.lng)));return(0,O.propOr)("","label",r)})),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}})),KM=e=>{let t=e.label||e.value||"";return Array.isArray(t)?t=t.join(", "):(0,O.is)(Object,t)&&(t=""),t},XM=(e,t)=>Object.values(e).filter(Array.isArray).flat(1/0).filter(v.isOv).flatMap((e=>{let r;return e.type==t&&(r=[KM(e)]),(0,O.is)(Object,e.value)&&(r=(r||[]).concat(XM(e.value,t))),r})),QM=(0,O.pipe)((0,O.path)(["point","lat"]),(0,O.both)((0,O.gt)(90),(0,O.lt)(-90))),JM=e=>e&&e.length>0,eV=(e,t)=>[].concat(null!=e&&e.attributes?XM(e.attributes,t):[]).filter(O.identity),tV=(e,t,r)=>{if((0,v.hasMaskingByUris)(e,[r.latitude,r.longitude]))return null;const n=eV(t,r.latitude),a=eV(t,r.longitude);return JM(n)&&JM(a)?(0,O.zipWith)(((e,t)=>({lat:Number(e),lng:Number(t)})),n,a):null};function rV(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const nV=async(e,t,r=[])=>{const n=((e,t)=>{const r={};return(0,O.flatten)(t.map((t=>{return"configuration/entityTypes/Location"===t.type?{id:t.uri,label:t.label,entity:t,pointSource:t.attributes}:(r[t.type]=r[t.type]||((null===(n=(0,v.getEntityType)(e,t.type))||void 0===n?void 0:n.attributes)||[]).filter((e=>"configuration/entityTypes/Location"===e.referencedEntityTypeURI)).map((({name:e})=>e)),r[t.type].map((e=>[e,t.attributes[e]])).filter((([,e])=>e)).flatMap((([e,r])=>r.map((r=>({id:r.uri,label:r.label,entity:t,pointSource:r.value,refAttribute:r,name:e}))))));var n})))})(t,r),a=await Promise.all(n.map((({id:r,label:n,entity:a,pointSource:i,refAttribute:o,name:l})=>(async(e,t,r,n,a,i)=>{if(t&&t.type){const e=(0,v.getEntityType)(n,t.type);a&&(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){rV(e,t,r[t])}))}return e}({},t,{attributes:{[i]:[a]}}));const r=(e.geoLocationAttributes||[]).map((e=>tV(n,t,e))).filter(O.identity);if(r.length>0)return Promise.resolve(r[0])}const o=r.GeoLocation;if(o){const e=o.map((e=>{const t=e.value.Latitude,r=e.value.Longitude;if(JM(t)&&t[0].value&&JM(r)&&r[0].value)return(0,v.hasMaskingByUris)(n,[t[0].type,r[0].type])?null:{id:e.uri,lat:Number(t[0].value),lng:Number(r[0].value)}})).filter(O.identity);if(e.length>0)return Promise.resolve(e)}if(a&&a.label)try{return(await(0,v.decodeAddress)({servicesPath:e,address:a.label})).location}catch{return null}return Promise.resolve(null)})(e,a,i,t,o,l).then((t=>!t&&a.label?(0,v.decodeAddress)({servicesPath:e,address:a.label}).then((e=>e.location)).catch((()=>null)):t)).then((e=>(0,v.wrapInArrayIfNeeded)(e).filter(O.identity).map((e=>({id:e.id||r,label:n,entity:a,point:e}))))).catch((()=>null)))));return a.flat(1/0).filter(O.identity)},aV=async({servicesPath:e,metadata:t,entities:r})=>{const n=((e,t=[])=>(0,O.pipe)((0,O.chain)((t=>{const r=(0,v.getEntityType)(e,t.type);return((null==r?void 0:r.geoLocationAttributes)||[]).flatMap((r=>{if((0,v.findAttributeTypeByUri)(e,r.latitude,t.type)&&(0,v.findAttributeTypeByUri)(e,r.longitude,t.type)){const n=tV(e,t,r);return null==n?void 0:n.map((({lat:e,lng:r})=>({id:`${t.uri}_nested_${e}_${r}`,entity:t,label:t.label,point:{lat:Number(e),lng:Number(r)}})))}}))})),(0,O.filter)(O.identity),(0,O.uniqBy)((0,O.prop)("id")))(t))(t,r),a=await nV(e,t,r);return[...n,...a.filter((e=>!n.some((t=>{return n=t,(r=e).entity===n.entity&&r.point.lat===n.point.lat&&r.point.lng===n.point.lng;var r,n}))))]},iV=[],oV={[v.MapSearch.geoPolygon]:lM,[v.MapSearch.geoLocation]:oM},lV=e=>e&&e.length?[...e,e[0]]:e,sV=e=>e[0].map((([e,t])=>({lat:e,lng:t}))).slice(0,-1),cV=(0,Sp.Z)((()=>({container:{height:"100%",width:"100%",position:"relative"},fullHeight:{height:"100%"}}))),uV=()=>{const e=cV(),t=(0,sp.useSelector)(Xa.Qr),r=(0,sp.useSelector)(Ti.AO),n=(0,sp.useSelector)(A().selectors.getGoogleMapKey),{markers:a,loading:i,onMarkerClicked:o}=(e=>{const t=(0,sp.useDispatch)(),{markers:r,loading:n}=(e=>{const[t,r]=(0,ap.useState)([]),[n,a]=(0,ap.useState)(!1),i=(0,Oh._)(),o=(0,Uf.AH)(),l=(0,Uf.au)();return(0,ap.useEffect)((()=>{a(!0),i(aV({metadata:o,servicesPath:l,entities:e})).then((e=>{r(e.filter(QM))})).catch((()=>{r([])})).finally((()=>{a(!1)}))}),[o,l,e,aV,i]),{markers:t,loading:n}})(e||iV),a=(0,ap.useRef)(null),i=(0,ap.useRef)(null),o=(0,ap.useCallback)((e=>{t({type:ue,payload:e||null})}),[t]),l=(0,ap.useCallback)((()=>{clearTimeout(i.current),clearTimeout(a.current)}),[]);return{markers:r,loading:n,onMarkerClicked:(0,ap.useCallback)((e=>{const t=(0,O.path)(["entity","uri"],e);l(),o(),a.current=setTimeout((()=>o(t)),0),i.current=setTimeout(o,3e3)}),[l,o])}})(t),{isSearchEnabled:l,activeOverlay:s,onOverlayUpdated:c,isSearchOnMapMove:u,onMapBoundsChanged:p}=(()=>{const e=(0,sp.useDispatch)(),t=(0,sp.useSelector)(Xa.Qy),r=(0,sp.useSelector)(Xa.bt),n=(0,sp.useSelector)(Ti.d7),[a,i]=(0,ap.useState)(!1),o=(0,ap.useCallback)((t=>{let r=null,n=null;if(t){const{data:e,type:a}=t;switch(a){case oM:{const{center:t,radius:a}=e;r=[t.lng(),t.lat(),a],n=v.MapSearch.geoLocation;break}case lM:r=lV(e),n=v.MapSearch.geoPolygon}}i(!1),e(Ha(r,n))}),[e]),l=(0,ap.useCallback)((t=>{i(!!t),e(Ha(lV(t),t&&v.MapSearch.onMapMove))}),[e]),s=oV[r],c=(0,ap.useMemo)((()=>n&&s&&t.length?{path:s===lM?sV(t):null,type:s}:null),[n,t,s]);return(0,ap.useEffect)((()=>{(c||0===t.length)&&i(!1)}),[t,c]),{isSearchEnabled:n,onOverlayUpdated:o,activeOverlay:c,isSearchOnMapMove:a,onMapBoundsChanged:l}})(),d=(0,ap.useMemo)((()=>ip().createElement("div",{className:e.fullHeight},ip().createElement(wE.z,null))),[e]),m=(0,ap.useMemo)((()=>({gridSize:60,maxZoom:9,calculator:$M(a)})),[a]),f=(0,ap.useMemo)((()=>({activeEntityUri:r})),[r]),y=(0,ap.useMemo)((()=>({lat:0,lng:0})),[]),g=(0,ap.useMemo)((()=>[lM]),[]);return n?ip().createElement("div",{className:e.container},i&&ip().createElement(wE.z,null),ip().createElement(pM.Provider,{value:f},ip().createElement(qM,{loadingElement:d,defaultZoom:1,defaultCenter:y,onOverlayUpdated:c,onMarkerClicked:o,activeOverlay:s,markers:a,fullscreenControl:!1,markerClusterer:!0,markerClustererOptions:m,drawingModes:g,isSearchOnMapMove:u,onMapBoundsChanged:p,isSearchEnabled:l,mapContainerClassName:e.fullHeight,mapKey:n}))):null},pV=(0,id.T)(Op.T),dV=e=>{switch(e){case B.om.PROFILE:return ei().text("Hide entity details");case B.om.MAP:return ei().text("Hide map")}},mV=()=>{const e=PI(),t=(0,sp.useDispatch)(),r=(0,sp.useSelector)(Ti.qx),n=r===B.om.MAP,a=(0,sp.useSelector)(A().selectors.getGoogleMapKey),i=(0,ap.useCallback)((()=>t(Ei(null))),[t]);return(0,ap.useEffect)((()=>{!a&&n&&i()}),[a,n,i]),ip().createElement("div",{className:e.container},ip().createElement(pV,{tooltipTitle:dV(r),tooltipPlacement:"bottom-start",size:"L",icon:NI(),className:e.closeButton,onClick:i}),(e=>{switch(e){case B.om.PROFILE:return ip().createElement(iM,null);case B.om.MAP:return ip().createElement(uV,null)}})(r))},fV=({className:e,loading:t,entities:r,entityTypeTab:n,quantity:a,rowsPerPage:i,page:o,entityToHighlight:l,selectedEntityUri:s,mode:c,previewPanelMode:u,isPreviewPanelOpen:p,dispatch:d})=>{const m=RE(),f=(0,ap.useRef)(),[y,g]=(0,ap.useState)("50%"),h=(0,vi.gj)(c),E=u===B.om.PROFILE,b=u===B.om.MAP,[T,S]=(0,ap.useState)({}),x=(0,ap.useCallback)(((e,t)=>{S((0,O.assoc)(e,t))}),[]);(0,ap.useEffect)((()=>{f.current&&(f.current.scrollTop=0)}),[r]),(0,ap.useEffect)((()=>{E&&((0,v.isEmptyValue)(r)?d(qs(null)):!(0,O.prop)(0,r)||s&&r.map((0,O.prop)("uri")).includes(s)||d(qs(r[0].uri)))}),[d,E,s,r]),(0,ap.useEffect)((()=>{!E&&s&&d(Zs(null))}),[d,s,E]);const C=(0,ap.useCallback)((e=>d(((e,t=0,r)=>({type:_.Z.CHANGE_PAGE,payload:{pageNumber:e,debounceTime:t,entityTypeUri:r}}))(e,250,n))),[d,n]),w=(0,ap.useCallback)((e=>d(((e,t)=>({type:_.Z.CHANGE_ROWS_PER_PAGE,payload:{number:e,entityTypeUri:t}}))(e,n))),[d,n]),A=(0,ap.useCallback)((e=>d(qs(e))),[d]),R=(0,ap.useCallback)((0,v.debounce)((e=>d({type:pe,payload:e})),50),[d]),I=(0,ap.useCallback)((({percentageSize:e})=>g(e)),[]),N=e=>{const t=(0,O.prop)(e.uri,T);return ip().createElement(vm,{entity:e,entityImportStatus:t,onEntityImportStatusChange:x})},P=(0,ap.useRef)(null);return ip().createElement("div",{className:up()(m.container,e)},t&&ip().createElement(wE.z,null),(0,vi.gj)(c)?ip().createElement(CI,{quantity:a}):ip().createElement(fI,null),ip().createElement(lE,{className:m.resizablePanesWrapper,orientation:"vertical",size:p?y:"100%",minSize:480,maxSize:-480,allowResize:p,onChange:I},ip().createElement("div",{className:m.pane},ip().createElement(AE,{error:ip().createElement(CE,{LogoRenderer:xE.ERROR,text:ei().text("Something went wrong."),variant:SE.embedded})},(()=>{const e=l||null;return a?ip().createElement("div",{className:h?m.tableContainer:m.listContainer,ref:f},h?ip().createElement(_I,{entities:r,entityToHighlight:e,selectedEntityUri:s,entityTypeUri:n,onEntityClick:E?A:void 0,onEntityHover:b?R:void 0,entitiesImportStatus:T,onEntityImportStatusChange:x,basicTableRef:P}):ip().createElement(yE,{entities:r,entityToHighlight:e,selectedEntityUri:s,onEntityClick:E?A:void 0,onEntityHover:b?R:void 0,entitiesImportStatus:T,entityButtonsRenderer:N}),a>B.Tu[0]&&ip().createElement("div",{className:m.pagination},ip().createElement(gE.Z,{count:a,rowsPerPageOptions:B.Tu,rowsPerPage:i||B.Tu[0],page:o||0,onChangePage:C,onChangeRowsPerPage:w,basicTableRef:P}))):ip().createElement(CE,{LogoRenderer:xE.SEARCH_RESULTS,text:ei().text("No results found."),secondaryText:ei().text("Try adjusting your search or filter to find what you're looking for."),variant:SE.embedded})})())),ip().createElement("div",{className:m.pane},ip().createElement(mV,null))))};fV.propTypes={page:lp().number,quantity:lp().number,rowsPerPage:lp().number,entities:lp().array,loading:lp().bool,dispatch:lp().func,entityToHighlight:lp().string,mode:lp().string,entityTypeTab:lp().string,className:lp().string,isPreviewPanelOpen:lp().bool,previewPanelMode:lp().oneOf(Object.values(B.om)),selectedEntityUri:lp().string},fV.defaultProps={quantity:0,entities:[]};const yV=(0,sp.connect)((e=>{const t=(0,Ti.tB)(e);return{quantity:(0,Xa.NU)(e,{entityTypeUri:t}),page:(0,Xa.fx)(e,{entityTypeUri:t}),rowsPerPage:(0,Xa.Uz)(e,{entityTypeUri:t}),entities:(0,Xa.BP)(e,{entityTypeUri:t}),loading:(0,Xa.gP)(e),entityToHighlight:(0,Ti.Dn)(e),mode:(0,Ti.XM)(e),entityTypeTab:t,previewPanelMode:(0,Ti.qx)(e),isPreviewPanelOpen:(0,Ti.jr)(e),selectedEntityUri:Ys(e)}}))(fV);var gV=r(4539),hV=r.n(gV),EV=r(4494);const bV=(0,Sp.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"}}),vV=e=>{const t=bV(),r=e.values&&e.values.join(", ");return ip().createElement(pg(),{label:ip().createElement("div",{className:t.labelContainer},e.title&&ip().createElement("div",{className:t.title},e.title,": "),e.values&&ip().createElement(ad.Y,{value:r},ip().createElement("div",{className:t.values},r))),onDelete:e.onDelete,variant:"outlined",deleteIcon:ip().createElement(mg(),{"data-reltio-id":"facet-bar-chip-delete"}),classes:{root:t.root,deleteIcon:t.deleteIcon,label:t.label}})};vV.propTypes={classes:lp().object,title:lp().string,values:lp().array,onDelete:lp().func};const TV=vV;class OV extends ap.PureComponent{constructor(...e){super(...e),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 ip().createElement(ap.Fragment,null,ip().createElement(Gh(),{"aria-describedby":a,color:"primary",variant:"contained",classes:{root:e.root,label:e.label},onClick:this.handleClick},ei().text(`+ ${t.length}`)),ip().createElement(mN.r,{id:a,open:n,onClose:this.handleClose,anchorEl:r,placement:"bottom-start"},ip().createElement(BI(),{elevation:2,classes:{root:e.popperContent}},this.props.items)))}}OV.propTypes={classes:lp().object,items:lp().array},OV.defaultProps={items:[]};const SV=Pf()((()=>({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"}})))(OV);var xV=r(74635),CV=r.n(xV),wV=r(60904),AV=r(34319),RV=r(96177),_V=r.n(RV);const IV=(0,Sp.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 NV(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){PV(e,t,r[t])}))}return e}function PV(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function DV(){return DV=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},DV.apply(null,arguments)}const kV=({isOpen:e,isAvailableUpdate:t,isChangedSavedSearch:r,currentSavedSearch:n,onClose:a,onSave:i,onUpdate:o})=>{const l=IV(),[s,c]=(0,ap.useState)(""),[u,p]=(0,ap.useState)(B.ib.private),d=t&&n&&s===n.name,m=d&&n.isPublic===(u===B.ib.public)&&!r,f=(0,ap.useCallback)((e=>{c(e.target.value)}),[]),y=(0,ap.useCallback)((e=>{p(e)}),[]),g=(0,ap.useCallback)((()=>d?o({share:u}):i({name:s,share:u})),[s,i,o,u,d]),h={InputProps:{classes:{input:up()(l.dialogInput,l.dialogFont)}},InputLabelProps:{classes:{root:l.dialogFont}}};return(0,ap.useEffect)((()=>{if(e){const e=t?n.name:"",r=t&&n.isPublic?B.ib.public:B.ib.private;c(e),p(r)}}),[e,t,n]),ip().createElement(Ij(),{onClose:a,open:e,PaperProps:{classes:{root:l.dialogRoot}}},ip().createElement(CV(),{classes:{root:l.dialogTitle}},ei().text("Save search")),ip().createElement(fF(),{classes:{root:l.dialogContentRoot}},ip().createElement(wV.H,DV({classes:{root:l.dialogField},label:ei().text("Name"),required:!0,variant:"filled",value:s,onInput:f,size:"small",autoFocus:!0},h)),ip().createElement(AV.k,{entries:B.m2,TextFieldProps:NV({classes:{root:l.dialogField},required:!0,label:ei().text("Share with"),variant:"filled",size:"small"},h),value:u,onChange:y})),ip().createElement(_V(),{classes:{root:l.dialogActions},disableSpacing:!0},ip().createElement(Gh(),{onClick:a},ei().text("Cancel")),ip().createElement(Gh(),{color:"primary",onClick:g,disabled:d?m:0===s.length},d?ei().text("Save"):ei().text("Save as"))))};kV.propTypes={isOpen:lp().bool,isAvailableUpdate:lp().bool,isChangedSavedSearch:lp().bool,currentSavedSearch:lp().object,onClose:lp().func.isRequired,onSave:lp().func.isRequired,onUpdate:lp().func.isRequired};const LV=(0,sp.connect)((e=>{const t=(0,co.LA)(e);return{isOpen:(0,Ti.jd)(e),isAvailableUpdate:!(0,O.isNil)(t)&&(0,co.Jv)(e),isChangedSavedSearch:(0,co.WH)(e),currentSavedSearch:t}}),{onClose:()=>ci(!1),onSave:e=>({type:Zt,payload:e}),onUpdate:e=>({type:Xt,payload:e})})(kV);var UV=r(11400);function jV(){return jV=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},jV.apply(null,arguments)}const FV=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return ip().createElement("svg",jV({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},r),ip().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"}))},MV=(0,Sp.Z)({button:{marginRight:"-4px"},dialogRoot:{minWidth:"600px",minHeight:"280px"},dialogContentRoot:{display:"flex",flexDirection:"column",gap:"20px"}}),VV=()=>{const e=MV(),t=(0,sp.useStore)(),[r,n]=(0,ap.useState)(!1),[a,i]=(0,ap.useState)(!1),o=(0,ap.useCallback)((()=>n(!1)),[]),l=(0,ap.useCallback)((()=>n(!0)),[]),s=(0,ap.useCallback)((async(e,r,n)=>{const a=t.getState(),l=(0,po.Z)(a),s=(0,co.Cc)(a,!0);i(!0);try{await(0,v.createSavedSearch)([{name:e,description:r,isPublic:n,query:s,uiState:l,type:v.SavedSearchType.SEGMENTATION}]),i(!1),o()}catch(e){(0,Qa.U)(e,{defaultMessage:ei().text("Something went wrong while saving of the segment")}),i(!1)}}),[t,o]);return ip().createElement(ip().Fragment,null,ip().createElement(gd.k,{icon:FV,size:"L",onClick:l,tooltipTitle:ei().text("Save as segment"),className:e.button}),ip().createElement(UV.L,{isOpen:r,isSaving:a,onClose:o,onSave:s}))};function BV(){return BV=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},BV.apply(null,arguments)}const zV=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return ip().createElement("svg",BV({xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},r),ip().createElement("g",null,ip().createElement("path",{fill:"none",d:"M0 0h24v24H0z"})),ip().createElement("g",null,ip().createElement("path",{fillOpacity:".54",d:"M5 20h14v-2H5v2zM19 9h-4V3H9v6H5l7 7 7-7z"})))};function HV(){return HV=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},HV.apply(null,arguments)}const YV=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return ip().createElement("svg",HV({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),ip().createElement("defs",null,ip().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"})),ip().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},ip().createElement("mask",{id:"svg1966704254b",fill:"#fff"},ip().createElement("use",{xlinkHref:"#svg1966704254a"})),ip().createElement("g",{mask:"url(#svg1966704254b)",fill:"#000",fillOpacity:".54"},ip().createElement("path",{d:"M0 0h24v24H0z"}))))};function WV(){return WV=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},WV.apply(null,arguments)}const GV=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return ip().createElement("svg",WV({xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},r),ip().createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),ip().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 qV(){return qV=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},qV.apply(null,arguments)}const ZV=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return ip().createElement("svg",qV({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),ip().createElement("defs",null,ip().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"})),ip().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},ip().createElement("mask",{id:"svg2486556319b",fill:"#fff"},ip().createElement("use",{xlinkHref:"#svg2486556319a"})),ip().createElement("g",{mask:"url(#svg2486556319b)",fill:"#000",fillOpacity:".54"},ip().createElement("path",{d:"M0 0h12v24H0z"}))))};var $V=r(69199),KV=r.n($V),XV=r(37290),QV=r.n(XV);const JV=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 eB(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){tB(e,t,r[t])}))}return e}function tB(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const rB=(0,Sp.Z)({title:{marginBottom:"-10px"},linkField:{margin:"10px 0"},linkInput:{textOverflow:"ellipsis",fontSize:"14px"}}),nB=({open:e,onClose:t=O.identity})=>{const r=rB(),n=(({enabled:e})=>{const[t,r]=(0,ap.useState)(""),n=(0,sp.useSelector)(po.Z),a=(0,sp.useSelector)(Xa.RO),i=(0,sp.useSelector)(A().selectors.getServicesPath),o=(0,sp.useSelector)(A().selectors.getUIPath);return(0,ap.useEffect)((()=>{e?(0,v.rawRequest)(`${i}/searchLink`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(eB({},n,{currentTenant:a}))}).then((0,O.pipe)((0,O.prop)("link"),(0,v.getSearchLink)(o),r)).catch(ti):r("")}),[e]),t})({enabled:e});return ip().createElement(Ij(),{open:e,onClose:t},ip().createElement(CV(),{className:r.title},ei().text("Share link with search results")),ip().createElement(fF(),null,ip().createElement(KV(),null,ei().text("With the URL link, anyone can view these search results. Paste this link in email or IM for testing, analyze, sharing and more.")),ip().createElement(QV(),{className:r.linkField,InputProps:{classes:{input:r.linkInput}},label:n?"URL":"",placeholder:ei().text("Loading URL..."),value:n,variant:"filled",fullWidth:!0,size:"small"})),ip().createElement(_V(),null,ip().createElement(Gh(),{onClick:t},ei().text("Cancel")),ip().createElement(Gh(),{disabled:!n,onClick:(0,O.pipe)((()=>JV(n)),t),color:"primary",autoFocus:!0},ei().text("Copy link"))))};nB.propTypes={open:lp().bool,onClose:lp().func};const aB=nB,iB=(0,Sp.Z)((()=>({button:{marginRight:"-4px"},exportButtonDisabled:{opacity:"0.54"}}))),oB=({customActions:e=[]})=>{const t=iB(),r=(0,sp.useDispatch)(),n=(0,sp.useSelector)(A().selectors.getUIConfig),a=(0,sp.useSelector)(A().selectors.getCanUserMakeExport),i=(0,sp.useSelector)(A().selectors.getCanUserOpenDataLoader),o=!!(0,v.findPerspectiveConfig)(v.ScreenType.Segmentation,n),l=!!(0,sp.useSelector)(Xa.lF),{canExport:s}=(0,sp.useSelector)(Ti.MO),c=s&&a,u=(0,ap.useCallback)((()=>{r({type:_.Z.EXPORT_RESULTS})}),[r]),p=(0,ap.useCallback)((()=>{r({type:_.Z.OPEN_DATA_LOADER})}),[r]),d=(0,sp.useSelector)(Xa.ai),m=(0,ap.useCallback)((()=>{r(ci(!0))}),[r]),f=[],[y]=(()=>{const e=(0,sp.useSelector)(A().selectors.getCanUserStartProcessFromQuery),t=(0,sp.useSelector)(A().selectors.getWorkflowPath),r=(0,sp.useSelector)(A().selectors.getWorkflowEnvironmentUrl),n=(0,sp.useSelector)(Ti.FH),a=(0,sp.useSelector)(A().selectors.getTenant),i=(0,sp.useDispatch)(),o=(0,sp.useSelector)(Xa.FR),{globalFilter:l}=(0,sp.useSelector)(A().selectors.getGlobalSearchRequestOptions),s=(0,_a._k)(o,[],l),c=(0,ap.useCallback)((()=>{const{processType:e}=n;(0,v.startProcessFromQuery)({workflowPath:t,processType:e,searchString:s,tenant:a,environment:r}).then((()=>{i(hi({message:ei().text("Match reviews successfully submitted. Go to Inbox to view their status."),actionToDispatch:w.ui.actions.openAppFromChocolateBar("Inbox"),actionLabel:ei().text("Go to inbox"),autoHideDuration:null}))})).catch((e=>{ti(e)}))}),[n,t,s,a,r,i]),u=s.includes("matches")||s.includes("matchRules");return[e&&t&&n?{disabled:!u,text:ei().text("Request Match Review"),tooltip:ei().text("Filter on match rules or potential matches to enable Potential Match Review"),onClick:c,id:"-request-match-review"}:null]})();y&&f.push(y);const[g]=(()=>{const e={NO_ENTITY_TYPE:ei().text("Please select exactly one entity type or switch to table mode")},t=(0,sp.useDispatch)(),r=(0,sp.useSelector)(Ti.MO),n=(0,sp.useSelector)(A().selectors.getCanUserMakeBulkUpdate),a=!!(0,sp.useSelector)(Xa.lF),i=(0,sp.useSelector)(Bc),o=!!i,l=Boolean(null==r?void 0:r.bulkUpdate),s=(0,sp.useSelector)(A().selectors.getMetadata),c=(0,sp.useSelector)(Ti.Xf),u=l&&n&&!a?{disabled:!o||!(e=>(0,Ia.wW)(s,{},c).some((t=>t.value===e)))(i),text:ei().text("Bulk update"),tooltip:o?null:e.NO_ENTITY_TYPE,onClick:()=>t(bi(!0)),id:"-bulk-update"}:null;return[u]})();g&&f.push(g);const[h,E]=(0,ap.useState)(!1);return f.push({text:ei().text("Share link"),onClick:()=>E(!0),id:"-share-link"}),f.push(...e),ip().createElement(ip().Fragment,null,i&&ip().createElement(gd.k,{icon:GV,size:"L",onClick:p,tooltipTitle:ei().text("Load data"),className:t.button,"data-reltio-id":"reltio-search-actions-menu-load-data"}),c&&ip().createElement(gd.k,{icon:zV,size:"L",onClick:u,tooltipTitle:ei().text("Export"),showForDisabled:!0,classes:{disabled:t.exportButtonDisabled},className:t.button,disabled:l,"data-reltio-id":"reltio-search-actions-menu-export"}),ip().createElement(gd.k,{tooltipTitle:ei().text("Save"),showForDisabled:!0,className:up()({[t.button]:f.length>0}),disabled:!d,onClick:m,icon:YV,size:"L","data-reltio-id":"reltio-search-actions-menu-save"}),o&&ip().createElement(VV,null),f.length>0&&ip().createElement(xN,{buttonComponent:Op.T,buttonProps:{icon:ZV,size:"L","data-reltio-id":"reltio-search-actions-menu"},menuId:"custom-actions",menuItems:f}),ip().createElement(LV,null),ip().createElement(aB,{open:h,onClose:()=>E(!1)}))},lB="#FF1744",sB=(0,Sp.Z)({indicatorWrapper:{width:0,height:"20px",position:"relative"},indicatorTooltipArea:{width:"10px",height:"20px"},indicator:{width:"3px",height:"3px",backgroundColor:lB,border:"1px solid",borderColor:lB,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"}}),cB=()=>{const e=(0,sp.useSelector)(co.LA),t=(0,sp.useSelector)(co.WH),r=(0,ap.useContext)(EV._),n=sB();if(!e)return null;const a=e.name,i=r?ei().text("Segment has changed"):ei().text("Saved search has changed");return ip().createElement(ip().Fragment,null,ip().createElement("div",{className:n.wrapper},ip().createElement(hf(),{variant:"body2",component:"span",classes:{root:n.for}},ei().text("for")),ip().createElement(ad.Y,{value:a},ip().createElement(hf(),{variant:"body2",classes:{root:n.label}},a))),t&&ip().createElement(ng(),{title:i,placement:"bottom"},ip().createElement("div",{className:n.indicatorWrapper,"data-reltio-id":"changed-indicator"},ip().createElement("div",{className:n.indicator}),ip().createElement("div",{className:n.indicatorTooltipArea}))))},uB=(0,Sp.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}}),pB=()=>{const e=uB(),t=(0,sp.useSelector)(A().selectors.getDataTenants),r=t&&t.length>0,n=(0,sp.useSelector)(Xa.t9),a=(0,sp.useSelector)(A().selectors.getTenantName),i=n?n.label:a;return r&&ip().createElement("div",{className:e.wrapper},ip().createElement(hf(),{variant:"body2",component:"span",classes:{root:e.in}},ei().text("in")),ip().createElement(ad.Y,{value:a},ip().createElement(hf(),{variant:"body2",classes:{root:e.label}},i)))};var dB=r(81877),mB=r.n(dB);const fB=(0,Sp.Z)({dialogPaper:{height:"70vh"},contentRoot:{padding:0,display:"flex",flexDirection:"column",overflow:"hidden"},tabContent:{display:"flex",flex:"1 1 auto"},tabsWrapper:{padding:"0 24px"}}),yB=(0,Sp.Z)((e=>({container:{display:"flex",alignItems:"center",paddingTop:17,paddingBottom:11,paddingLeft:15,paddingRight:15},selected:{backgroundColor:(0,xm.alpha)(e.palette.primary.main,.12)}}))),gB=(0,Sp.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}}),hB=(0,Sp.Z)({closeButton:{marginRight:"10px"}}),EB=({onClose:e})=>{const t=hB();return ip().createElement(Op.T,{size:"L",icon:Ep(),className:t.closeButton,onClick:e})};EB.propTypes={onClose:lp().func};const bB=EB,vB=({selectedNumber:e,onDelete:t,onClose:r})=>{const n=gB();return ip().createElement(ip().Fragment,null,ip().createElement("div",{className:up()(n.title,n.flex1)},ip().createElement(bB,{onClose:r}),ip().createElement(hf(),{color:"primary"},ei().text("Selected: ${count}",{count:e}))),ip().createElement(gd.k,{tooltipTitle:ei().text("Delete"),size:"L",icon:Kk(),className:n.deleteButton,onClick:t}))};vB.propTypes={selectedNumber:lp().number,onClose:lp().func,onDelete:lp().func};const TB=vB,OB=(0,Sp.Z)((()=>({white:{backgroundColor:"rgb(255, 255, 255)",boxShadow:"0 1px 3px 0 rgba(0,0,0,0.24)"}})));function SB(){return SB=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},SB.apply(null,arguments)}function xB(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){CB(e,t,r[t])}))}return e}function CB(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const wB=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["classes"]);const n=OB({});return ip().createElement(_p,SB({classes:xB({},t,{focused:n.white})},r))};var AB=r(34480),RB=r.n(AB);const _B=(0,Sp.Z)((e=>({changedFiltersIndicator:{backgroundColor:(0,xm.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"}}))),IB=e=>e?B.ib.public:B.ib.private,NB=e=>e===B.ib.public,PB=({className:e,findPublic:t,favoriteOnly:r,onChangeFilters:n})=>{const a=_B(),i=(0,ap.useRef)(),[o,l]=(0,ap.useState)(!1),[s,c]=(0,ap.useState)(t),[u,p]=(0,ap.useState)(r);(0,ap.useEffect)((()=>{c(t),p(r)}),[t,r]);const d=(0,ap.useCallback)((()=>l((e=>!e))),[]),m=(0,ap.useCallback)((e=>p(e.target.checked)),[]),f=(0,ap.useCallback)((()=>{n({findPublic:s,favoriteOnly:u}),d()}),[d,n,s,u]),y=(0,ap.useCallback)((()=>{c(t),p(r),d()}),[d,t,r]),g=(0,ap.useCallback)((()=>{c(!0),p(!1)}),[]),h=!0===s&&!1===u;return ip().createElement(ip().Fragment,null,ip().createElement(Gh(),{ref:i,color:h?"inherit":"primary",classes:{root:e,textPrimary:a.changedFiltersIndicator},onClick:d},ip().createElement(RB(),null)),ip().createElement(dp(),{open:o,classes:{paper:a.popupContent},anchorEl:i.current,onClose:y,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},ip().createElement(hf(),{className:a.title,variant:"h6"},ei().text("Filter")),ip().createElement(AV.k,{entries:B.m2,TextFieldProps:{InputLabelProps:{classes:{root:a.shareWithLabel}},label:ei().text("Shared with"),variant:"filled"},classes:{root:a.shareWithRoot,menuItem:a.shareWithMenuItem},fullWidth:!0,value:IB(s),onChange:(0,O.pipe)(NB,c)}),ip().createElement(vh(),{classes:{root:a.favoriteOnlyControlRoot,label:a.favoriteOnlyControlLabel},control:ip().createElement(Hp(),{className:a.favoriteOnlyCheckbox,checked:u,onChange:m}),label:ei().text("Show favorites only")}),ip().createElement("div",{className:a.buttonsGroup},ip().createElement(Gh(),{onClick:g,disabled:h},ei().text("Clear all")),ip().createElement("div",null,ip().createElement(Gh(),{onClick:y,className:a.cancelButton},ei().text("Cancel")),ip().createElement(Gh(),{onClick:f,color:"primary"},ei().text("Apply"))))))};PB.propTypes={className:lp().string,findPublic:lp().bool,favoriteOnly:lp().bool,onChangeFilters:lp().func,onChangeFavoriteOnly:lp().func};const DB=(0,sp.connect)((e=>({findPublic:(0,co.kU)(e),favoriteOnly:(0,co.VS)(e)})),{onChangeFilters:({findPublic:e,favoriteOnly:t})=>({type:ar,payload:{findPublic:e,favoriteOnly:t}})})(PB),kB=({type:e,onSearch:t,placeholder:r,onClose:n})=>{const a=gB();return ip().createElement(ip().Fragment,null,ip().createElement("div",{className:a.main},ip().createElement("div",{className:a.title},ip().createElement(bB,{onClose:n}),ip().createElement(hf(),{variant:"h6"},ei().text("Saved & recent searches"))),ip().createElement("div",{className:a.searchBox},ip().createElement(wB,{fullWidth:!0,onSearch:t,placeholder:r}))),e===B.uJ.saved&&ip().createElement(DB,{className:a.filterButton}))};kB.propTypes={type:lp().oneOf(Object.values(B.uJ)),onClose:lp().func,onSearch:lp().func,placeholder:lp().string};const LB=kB,UB=({type:e,selectedNumber:t,onClose:r,dispatch:n})=>{const a=yB(),i=(0,ap.useCallback)((()=>{const t=e===B.uJ.saved?{type:gr}:{type:Pr};n(t)}),[e,n]),o=(0,ap.useCallback)((0,v.debounce)((t=>{const r=e===B.uJ.saved?{type:vr,payload:t}:{type:Ur,payload:t};n(r)}),500),[e,n]),l=(0,O.cond)([[(0,O.equals)(B.uJ.saved),(0,O.always)(ei().text("Search name"))],[(0,O.equals)(B.uJ.recent),(0,O.always)(ei().text("Search for filtered entity types and attributes"))]])(e);return ip().createElement(CV(),{className:up()(a.container,{[a.selected]:t})},t?ip().createElement(TB,{selectedNumber:t,onDelete:i,onClose:r}):ip().createElement(LB,{type:e,onSearch:o,onClose:r,placeholder:l}))};UB.propTypes={type:lp().oneOf(Object.values(B.uJ)).isRequired,selectedNumber:lp().number,onClose:lp().func,dispatch:lp().func};const jB=(0,sp.connect)(((e,t)=>({selectedNumber:t.type===B.uJ.saved?(0,co.g2)(e):xs(e)})))(UB),FB="0.75rem",MB=(0,Sp.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:FB},paginationCaption:{fontSize:FB}});var VB=r(54622);const BB=lp().shape({field:lp().string,order:lp().oneOf(["asc","desc"])}),zB=lp().shape({label:lp().string,name:lp().string,description:lp().string,type:lp().string,hidden:lp().bool,faceted:lp().bool,searchable:lp().bool,uri:lp().string,access:lp().arrayOf(lp().string),cardinality:lp().shape({minValue:lp().number,maxValue:lp().number})}),HB=lp().shape({title:lp().string,pathToTitle:lp().arrayOf(lp().string),fieldName:lp().string,entityTypeUri:lp().string,attrType:zB,uri:lp().string,groupName:lp().string}),YB=lp().shape({id:lp().oneOfType([lp().number,lp().string]),values:lp().array,data:HB,filter:lp().string,operator:lp().string}),WB="0.8rem",GB=(0,Sp.Z)((e=>{const t=(0,xm.lighten)(e.palette.primary.main,.88),r=(0,xm.alpha)(t,0),n=(0,xm.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,xm.alpha)(n,0)}, ${n} 100%)`}};return{defaultWrapper:{whiteSpace:"nowrap",overflow:"hidden",padding:"0 22px",fontSize:WB,display:"flex",alignItems:"center",height:"100%","&:after":a},numberWrapper:{whiteSpace:"nowrap",overflow:"hidden",padding:"0 24px 0 22px",fontSize:WB,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:WB,"&::-ms-clear":{display:"none"}},nameContainer:{flex:1,overflow:"hidden"},editing:{},editNameButton:{},searchName:{cursor:"pointer",lineHeight:"29px",position:"relative",whiteSpace:"nowrap",overflow:"hidden",fontSize:WB,"&: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:WB},sharingMenuItem:{fontSize:WB,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"}}})),qB=({mode:e})=>{const t=GB(),r=(0,sp.useDispatch)(),n=e===B.uJ.saved?co.tc:Cs,a=(0,sp.useSelector)(n),i=e===B.uJ.saved?co.hY:ws,o=(0,sp.useSelector)(i),l=(0,ap.useCallback)((()=>{e===B.uJ.saved?r(o?io():{type:or}):r(o?ds():{type:Ir})}),[r,o,e]);return ip().createElement("div",{className:up()(t.headCell,t.checkbox)},ip().createElement(Hp(),{indeterminate:!a&&o,checked:a,onChange:l}))};qB.propTypes={mode:lp().string};const ZB=(0,Nd.q)((0,O.pick)(["mode"]))(qB),$B=e=>{const t=t=>{const r=GB(),{rowValue:{checked:n}}=t;return ip().createElement("div",{className:up()(r.rowCell,{[r.checkedRowCell]:n})},ip().createElement(e,t))};return t.propTypes={rowValue:lp().shape({checked:lp().bool})},t},KB=(0,id.T)(Hp()),XB=({value:e=!1,rowValue:{uri:t,isOwnSearch:r},onClick:n})=>{const a=GB(),i=!r;return ip().createElement("div",{className:up()(a.headCell,a.checkbox)},ip().createElement(KB,{showForDisabled:!0,tooltipTitle:i&&ei().text("Cannot edit because you're not the owner"),tooltipPlacement:"bottom-start",disabled:i,checked:e,onChange:e=>n(t,e.target.checked)}))};XB.propTypes={value:lp().bool,rowValue:lp().shape({uri:lp().string,isOwnSearch:lp().bool}),onClick:lp().func};const QB=(0,Nd.q)((({onSelectItem:e})=>({onClick:e})))($B(XB));var JB=r(92332);function ez(){return ez=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ez.apply(null,arguments)}function tz(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){rz(e,t,r[t])}))}return e}function rz(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const nz=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className"]);const n=GB(),{headCellData:a}=r;return ip().createElement("div",{className:up()(n.headCell,t)},ip().createElement(JB.default,ez({},r,{headCellData:tz({},a,{label:ip().createElement(ad.Y,{value:a.label},ip().createElement("div",{className:n.headLabel},a.label))})})))};nz.propTypes={className:lp().string,headCellData:lp().shape({id:lp().string,label:lp().oneOfType([lp().string,lp().node]),sortable:lp().bool,resizable:lp().bool,className:lp().string,initialWidth:lp().number,minWidth:lp().number,autoResize:lp().bool,renderer:lp().func})};const az=nz;function iz(){return iz=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},iz.apply(null,arguments)}const oz=e=>{const t=GB();return ip().createElement(az,iz({className:t.nameHeadCell},e))};oz.propTypes={headCellData:lp().shape({id:lp().string,label:lp().oneOfType([lp().string,lp().node]),sortable:lp().bool,resizable:lp().bool,className:lp().string,initialWidth:lp().number,minWidth:lp().number,autoResize:lp().bool,renderer:lp().func})};const lz=oz;var sz=r(18122),cz=r.n(sz),uz=r(62839),pz=r.n(uz);function dz(){return dz=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},dz.apply(null,arguments)}const mz=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return ip().createElement("svg",dz({xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},r),ip().createElement("g",null,ip().createElement("path",{d:"M0 0h24m0 24H0",fill:"none"}),ip().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"}),ip().createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"})))};function fz(){return fz=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},fz.apply(null,arguments)}const yz=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return ip().createElement("svg",fz({xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},r),ip().createElement("g",null,ip().createElement("path",{d:"M0 0h24m0 24H0",fill:"none"}),ip().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"}),ip().createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"})))};var gz=r(74492),hz=r.n(gz),Ez=r(72246),bz=r.n(Ez);const vz=({value:e,rowValue:{uri:t,isFavorite:r,isOwnSearch:n,isEditing:a,isGlobalFilter:i},onStarClick:o,onGlobalClick:l,onApply:s,onChangeName:c,onSetEditing:u})=>{const p=GB(),d=n&&!a,[m,f]=(0,ap.useState)(e);(0,ap.useEffect)((()=>{f(e)}),[e]);const y=(0,ap.useCallback)((()=>{c(t,m)}),[t,m,c]),g=(0,ap.useCallback)((()=>o(t,!r)),[o,t,r]),h=(0,ap.useCallback)((()=>l(t,!i)),[l,t,i]),E=(0,ap.useCallback)((()=>u(t,!0)),[u,t]),b=(0,ap.useCallback)((()=>s(t)),[s,t]),v=(0,O.cond)([[(0,O.always)(n),(0,O.always)(ei().text("Mark as favorite"))],[(0,O.always)(r),(0,O.always)(ei().text("Cannot ummark because you're not the owner"))],[O.T,(0,O.always)("")]])();return ip().createElement("div",{className:up()(p.nameWithStar,{[p.editing]:a})},ip().createElement(gd.k,{showForDisabled:!0,tooltipTitle:v,tooltipPlacement:n?"bottom":"bottom-start",disabled:!n,className:up()(p.starButton,{[p.checkedStarButton]:r},{[p.enabledButton]:n}),size:"M",icon:r?cz():pz(),onClick:g}),ip().createElement(gd.k,{tooltipTitle:i?ei().text("Remove Global filter"):ei().text("Set as Global filter"),className:up()(p.filterButton,p.enabledButton,{[p.checkedFilterButton]:i}),size:"M",icon:i?mz:yz,onClick:h}),ip().createElement("div",{className:p.nameContainer},a?ip().createElement(bz(),{onClickAway:y},ip().createElement("div",null,ip().createElement(wV.H,{variant:"filled",hiddenLabel:!0,size:"small",fullWidth:!0,autoFocus:!0,classes:{root:p.nameTextEditorRoot},InputProps:{classes:{input:p.nameInput}},value:m,onInput:e=>f(e.target.value),onKeyDown:(0,O.when)((0,O.propEq)("keyCode",13),y)}))):ip().createElement(ad.Y,{value:e},ip().createElement("div",{className:p.searchName,onClick:b},e))),d&&ip().createElement(gd.k,{tooltipTitle:ei().text("Edit"),className:p.editNameButton,size:"M",icon:hz(),onClick:E}))};vz.propTypes={value:lp().string,rowValue:lp().shape({uri:lp().string,isFavorite:lp().bool,isOwnSearch:lp().bool,isEditing:lp().bool,isGlobalFilter:lp().bool}),onStarClick:lp().func,onGlobalClick:lp().func,onApply:lp().func,onChangeName:lp().func,onSetEditing:lp().func};const Tz=(0,Nd.q)((({onChangeIsFavorite:e,onChangeIsGlobal:t,onSearchApply:r,onSetItemEditing:n,onChangeItemName:a})=>({onStarClick:e,onGlobalClick:t,onApply:r,onSetEditing:n,onChangeName:a})))($B(vz)),Oz=({value:e,rowValue:{uri:t,isOwnSearch:r},onChange:n})=>{const a=GB(),i=(0,ap.useCallback)((r=>{const a=NB(r);a!==e&&n(t,a)}),[t,e,n]);return ip().createElement("div",{className:a.sharingWrapper},ip().createElement(AV.k,{entries:B.m2,value:IB(e),onChange:i,disableUnderline:!0,disabled:!r,MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},elevation:3},TextFieldProps:{classes:{root:a.sharingRoot}},classes:{root:a.sharingInput,menuItem:a.sharingMenuItem,disabled:a.sharingDisabled,icon:up()({[a.sharingIconDisabled]:!r})}}))};Oz.propTypes={value:lp().bool,rowValue:lp().shape({uri:lp().string,isOwnSearch:lp().bool}),onChange:lp().func};const Sz=(0,Nd.q)((({onChangeIsPublic:e})=>({onChange:e})))($B(Oz)),xz=({value:e,rowValue:t,onClick:r})=>{const n=GB(),a=r?()=>r(t):()=>{};return ip().createElement(ad.Y,{value:e},ip().createElement("div",{className:up()(n.defaultWrapper,{[n.clickableArea]:r}),onClick:a},e))};xz.propTypes={value:lp().any,rowValue:lp().object,onClick:lp().func};const Cz=$B(xz);function wz(){return wz=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},wz.apply(null,arguments)}const Az=e=>{const{rowValue:{updateDate:t,createDate:r}}=e,n=t||r;return ip().createElement(Cz,wz({},e,{value:n&&ei().date(n,"L")}))};Az.propTypes={rowValue:lp().shape({updateDate:lp().number,createDate:lp().number})};const Rz=Az,_z=({values:e})=>(0,O.pipe)((0,O.cond)([[O.isNil,O.T],[Array.isArray,(0,O.pipe)(O.flatten,O.isEmpty)],[O.T,O.isEmpty]]),O.not)(e),Iz=(0,O.curry)(((e,t)=>(0,O.path)(["facetsData",t.fieldName,"values","length"],e)>0)),Nz=e=>e&&e.slice(1).join(" / "),Pz=(e,t,r)=>(e[t]||(e[t]={title:t,attributes:[]}),e[t].attributes=(0,O.uniq)(e[t].attributes.concat(r)),e),Dz=({rowValue:{uiState:e}})=>{const t=GB(),r=(0,ap.useMemo)((()=>(({facets:e,advanced:t}={})=>{try{const r=t?((e=[])=>e.flatMap((e=>e.attributes)).filter(_z).reduce(((e,{data:{title:t,groupName:r,pathToTitle:n}})=>{const a=Nz(n)||t;return Pz(e,r,a)}),{}))(t):((e={})=>(e.facetsConfigs||[]).filter((0,O.pipe)(v.isTypeFacet,O.not)).filter(Iz(e)).reduce(((e,t)=>{const r=(0,O.path)(["pathToTitle",0],t)||ei().text("Special"),n=Nz(t.pathToTitle)||t.title;return Pz(e,r,n)}),{}))(e);return Object.values(r)}catch(e){return[]}})(e)),[e]),n=(0,ap.useMemo)((()=>(e=>e.flatMap((e=>e.attributes)).length)(r)),[r]),a=!!r.length&&ip().createElement("div",null,r.map((({title:e,attributes:r})=>ip().createElement("div",{key:e,className:t.tooltipSection},ip().createElement("h6",{className:t.tooltipSectionHeader},e),r.map((e=>ip().createElement("div",{key:e,className:t.tooltipText},e)))))));return ip().createElement("div",{className:t.numberWrapper},(i=n,a?ip().createElement(ng(),{title:a,classes:{tooltip:t.tooltip},disableFocusListener:!0,disableTouchListener:!0},ip().createElement("span",null,i)):i));var i};Dz.propTypes={rowValue:lp().shape({uiState:lp().shape({facets:lp().object,advanced:lp().array})})};const kz=$B(Dz);function Lz(){return Lz=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Lz.apply(null,arguments)}const Uz=e=>{const t=GB();return ip().createElement(az,Lz({className:t.totalHeadCell},e))};Uz.propTypes={headCellData:lp().shape({id:lp().string,label:lp().oneOfType([lp().string,lp().node]),sortable:lp().bool,resizable:lp().bool,className:lp().string,initialWidth:lp().number,minWidth:lp().number,autoResize:lp().bool,renderer:lp().func})};const jz=Uz;var Fz=r(67520),Mz=r.n(Fz);const Vz=({value:e})=>{const t=GB();return ip().createElement(ad.Y,{value:e},ip().createElement("div",{className:t.numberWrapper},ei().number(e)))};Vz.propTypes={value:lp().number};const Bz=$B(Vz),zz=e=>{const t=GB(),{rowValue:{isTotalLoading:r,isOwnSearch:n,uri:a},onDeleteItem:i,onLoadTotalForItem:o,value:l}=e,s=(0,ap.useCallback)((()=>{i(a)}),[i,a]),c=n?ei().text("Delete"):ei().text("Cannot delete because you're not the owner"),u=r?ei().text("Loading data"):ei().text("Load data"),p=(0,ap.useCallback)((()=>{o(a)}),[o,a]),d=r||-1===l;return ip().createElement("div",{className:t.totalWithButtonsWrapper},d?ip().createElement(gd.k,{showForDisabled:!0,tooltipTitle:u,tooltipPlacement:"bottom-end",disabled:r,size:"L",icon:Mz(),onClick:p}):ip().createElement(Bz,e),ip().createElement(gd.k,{showForDisabled:!0,className:t.deleteButton,tooltipTitle:c,tooltipPlacement:"bottom-end",disabled:!n,size:"L",icon:Kk(),onClick:s}))};zz.propTypes={value:lp().number,rowIndex:lp().number,rowValue:lp().shape({isOwnSearch:lp().bool,isTotalLoading:lp().bool,uri:lp().string}),onDeleteItem:lp().func,onLoadTotalForItem:lp().func};const Hz=(0,Nd.q)((({onDeleteItem:e,onLoadTotalForItem:t})=>({onDeleteItem:e,onLoadTotalForItem:t})))($B(zz));function Yz(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Wz={rowCellValueRenderer:Cz,headCellRenderer:az,autoResize:!1},Gz=[{id:"checked",label:"",initialWidth:55,headCellRenderer:ZB,rowCellValueRenderer:QB},{id:"name",get label(){return ei().text("Name")},autoResize:!0,headCellRenderer:lz,rowCellValueRenderer:Tz,sortable:!0},{id:"isPublic",get label(){return ei().text("Shared with")},rowCellValueRenderer:Sz},{id:"owner",get label(){return ei().text("Created by")},initialWidth:260},{id:"updateDate",get label(){return ei().text("Last modified")},rowCellValueRenderer:Rz,sortable:!0},{id:"attributes",get label(){return ei().text("Filtered attributes")},rowCellValueRenderer:kz},{id:"total",get label(){return ei().text("Number of profiles")},headCellRenderer:jz,rowCellValueRenderer:Hz,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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Yz(e,t,r[t])}))}return e}({},Wz,e)));function qz(){return qz=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},qz.apply(null,arguments)}function Zz(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const $z=({items:e,total:t,sorting:r,page:n,rowsPerPage:a,loading:i,searchValue:o,globalFilterSavedSearchesUris:l=[],onSearchApply:s,onChangeIsFavorite:c,onChangeIsPublic:u,onChangeIsGlobal:p,onChangeRowsPerPage:d,onChangePage:m,onSelectItem:f,onDeselectAllItems:y,onDeleteItem:g,onChangeItemName:h,onSetItemEditing:E,onLoadTotalForItem:b,onSort:T})=>{const O=MB(),S=(0,ap.useMemo)((()=>({cellBorder:O.cellBorder})),[O]),[x,C]=(0,ap.useState)(null),[w,A]=(0,ap.useState)(null),R=(0,ap.useRef)(null);(0,ap.useEffect)((()=>y),[y]);const _=(0,ap.useCallback)((e=>{l.includes(e)?A(e):g(e)}),[l,g]),I=(0,ap.useMemo)((()=>({mode:B.uJ.saved,onSelectItem:f,onChangeIsFavorite:c,onChangeIsGlobal:p,onSearchApply:s,onSetItemEditing:E,onChangeItemName:h,onDeleteItem:_,onLoadTotalForItem:b,onChangeIsPublic:u})),[_,f,c,p,b,s,E,h,u]),N=(0,ap.useMemo)((()=>(0,v.isEmptyValue)(o)?{LogoRenderer:xE.SELECT_ATTRIBUTES,text:ei().text("No saved searches."),secondaryText:ei().text("Save time by creating saved searches for queries you regularly search for.")}:{LogoRenderer:xE.SEARCH_RESULTS,text:ei().text("No results found."),secondaryText:ei().text("Try adjusting your search or filter to find what you're looking for.")}),[o]),P=(0,ap.useMemo)((()=>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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Zz(e,t,r[t])}))}return e}({},e,{isGlobalFilter:l.includes(e.uri)})))),[e,l]);return ip().createElement("div",{className:O.tableWrapper},t>0?ip().createElement(ip().Fragment,null,ip().createElement(wd.M,{columnsData:Gz,rowsData:P,context:I,sorting:r,getRowCellHeight:null,defaultColumnWidth:140,defaultColumnMinWidth:140,defaultRowHeight:48,headRowHeight:47,hoverStateEnabled:!0,onSort:T,hoverRowIndex:x,onRowHover:C,classes:S,ref:R}),ip().createElement(gE.Z,{classes:{root:O.paginationRoot,caption:O.paginationCaption},count:t,rowsPerPageOptions:B.Tu,rowsPerPage:a,onChangeRowsPerPage:d,page:n,onChangePage:m,basicTableRef:R}),ip().createElement(VB.U,{open:!!w,title:ei().text("Keep the global filter?"),content:ei().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:ei().text("NO, remove it"),saveCaption:ei().text("YES, KEEP GLOBAL FILTER"),onCancel:()=>A(null),onDiscard:()=>{p(w,!1),g(w),A(null)},onSave:()=>{g(w),A(null)}})):ip().createElement(CE,qz({},N,{variant:SE.embedded})),i&&ip().createElement(wE.z,null))};$z.propTypes={items:lp().arrayOf(lp().shape({uri:lp().string,name:lp().string,isPublic:lp().bool,isFavorite:lp().bool,isOwnSearch:lp().bool,isEditing:lp().bool,checked:lp().bool,owner:lp().string,updateDate:lp().number,query:lp().string})),total:lp().number,sorting:BB,page:lp().number,rowsPerPage:lp().number,loading:lp().bool,searchValue:lp().string,globalFilterSavedSearchesUris:lp().arrayOf(lp().string),onSearchApply:lp().func,onChangeIsFavorite:lp().func,onChangeIsPublic:lp().func,onChangeIsGlobal:lp().func,onChangeRowsPerPage:lp().func,onChangePage:lp().func,onSelectItem:lp().func,onDeselectAllItems:lp().func,onDeleteItem:lp().func,onChangeItemName:lp().func,onSetItemEditing:lp().func,onSort:lp().func};const Kz=(0,sp.connect)((e=>({items:(0,co.gg)(e),total:(0,co.Yi)(e),sorting:(0,co.rT)(e),page:(0,co.wH)(e),rowsPerPage:(0,co.s6)(e),loading:(0,co.w7)(e),searchValue:(0,co.U3)(e),globalFilterSavedSearchesUris:A().selectors.getGlobalFilterSavedSearchesUris(e)})),{onSearchApply:(e,t=B.XU)=>({type:Tr,payload:{uri:e,debounceTime:t}}),onChangeIsFavorite:(e,t)=>({type:ur,payload:{uri:e,isFavorite:t}}),onChangeIsPublic:(e,t)=>({type:sr,payload:{uri:e,isPublic:t}}),onChangeIsGlobal:(e,t)=>({type:dr,payload:{uri:e,isGlobalFilter:t}}),onChangeRowsPerPage:e=>({type:nr,payload:e}),onChangePage:e=>({type:rr,payload:e}),onSelectItem:(e,t)=>({type:ir,payload:{uri:e,checked:t}}),onDeselectAllItems:io,onDeleteItem:e=>({type:hr,payload:e}),onChangeItemName:(e,t)=>({type:mr,payload:{uri:e,name:t}}),onSetItemEditing:(e,t)=>({type:yr,payload:{uri:e,isEditing:t}}),onLoadTotalForItem:e=>({type:Sr,payload:e}),onSort:e=>({type:xr,payload:e})})($z),Xz=({value:e=!1,rowValue:{createdDate:t},onClick:r})=>{const n=GB();return ip().createElement("div",{className:up()(n.headCell,n.checkbox)},ip().createElement(Hp(),{checked:e,onChange:e=>r(t,e.target.checked)}))};Xz.propTypes={value:lp().bool,rowValue:lp().shape({createdDate:lp().number}),onClick:lp().func};const Qz=(0,Nd.q)((({onSelectItem:e})=>({onClick:e})))($B(Xz));function Jz(){return Jz=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Jz.apply(null,arguments)}const eH=e=>{const{rowValue:{createdDate:t}}=e,r=t;return ip().createElement(Cz,Jz({},e,{value:r&&ei().date(r,"L LT")}))};eH.propTypes={rowValue:lp().shape({createdDate:lp().number}),onClick:lp().func};const tH=(0,Nd.q)((({onSearchApply:e})=>({onClick:e})))(eH),rH=e=>{const t=GB(),{rowValue:r,onDeleteItem:n,onLoadTotalForItem:a,value:i}=e,{isTotalLoading:o,createdDate:l}=r,s=(0,ap.useCallback)((()=>{n(r)}),[n,r]),c=o?ei().text("Loading data"):ei().text("Load data"),u=(0,ap.useCallback)((()=>{a(l)}),[a,l]),p=o||-1===i;return ip().createElement("div",{className:t.totalWithButtonsWrapper},p?ip().createElement(gd.k,{showForDisabled:!0,tooltipTitle:c,tooltipPlacement:"bottom-end",disabled:o,size:"L",icon:Mz(),onClick:u}):ip().createElement(Bz,e),ip().createElement(gd.k,{className:t.deleteButton,tooltipTitle:ei().text("Delete"),tooltipPlacement:"bottom-end",size:"L",icon:Kk(),onClick:s}))};rH.propTypes={value:lp().number,rowValue:lp().shape({isTotalLoading:lp().bool,createdDate:lp().number}),onDeleteItem:lp().func,onLoadTotalForItem:lp().func};const nH=(0,Nd.q)((({onDeleteItem:e,onLoadTotalForItem:t})=>({onDeleteItem:e,onLoadTotalForItem:t})))($B(rH)),aH=(0,Nd.q)((({onSearchApply:e})=>({onClick:e})))(Cz);function iH(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const oH={rowCellValueRenderer:Cz,headCellRenderer:az,autoResize:!1},lH=[{id:"checked",label:"",initialWidth:55,headCellRenderer:ZB,rowCellValueRenderer:Qz},{id:"createdDate",get label(){return ei().text("Created")},rowCellValueRenderer:tH,initialWidth:256},{id:"name",get label(){return ei().text("Query")},autoResize:!0,rowCellValueRenderer:aH,minWidth:150},{id:"total",get label(){return ei().text("Record count")},rowCellValueRenderer:nH,headCellRenderer:jz,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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){iH(e,t,r[t])}))}return e}({},oH,e)));function sH(){return sH=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},sH.apply(null,arguments)}const cH=({items:e,loading:t,filterWord:r,onSelectItem:n,onDeselectAllItems:a,onSearchApply:i,onDeleteItem:o,onLoadTotalForItem:l})=>{const s=MB(),c=(0,ap.useMemo)((()=>({cellBorder:s.cellBorder})),[s]),[u,p]=(0,ap.useState)(null);(0,ap.useEffect)((()=>a),[a]);const d=(0,ap.useMemo)((()=>({mode:B.uJ.recent,onSelectItem:n,onSearchApply:i,onDeleteItem:o,onLoadTotalForItem:l})),[o,l,n,i]),m=(0,ap.useMemo)((()=>(0,v.isEmptyValue)(r)?{LogoRenderer:xE.SELECT_ATTRIBUTES,text:ei().text("No recent searches."),secondaryText:ei().text("Your recent search history will appear here.")}:{LogoRenderer:xE.SEARCH_RESULTS,text:ei().text("No results found."),secondaryText:ei().text("Try adjusting your search or filter to find what you're looking for.")}),[r]);return ip().createElement("div",{className:s.tableWrapper},e.length>0?ip().createElement(wd.M,{columnsData:lH,rowsData:e,context:d,getRowCellHeight:null,defaultColumnWidth:50,defaultColumnMinWidth:50,defaultRowHeight:48,headRowHeight:47,hoverStateEnabled:!0,hoverRowIndex:u,onRowHover:p,classes:c}):ip().createElement(CE,sH({},m,{variant:SE.embedded})),t&&ip().createElement(wE.z,null))};cH.propTypes={items:lp().arrayOf(lp().shape({uri:lp().string,name:lp().string,isPublic:lp().bool,isFavorite:lp().bool,isOwnSearch:lp().bool,checked:lp().bool,owner:lp().string,createdDate:lp().number,query:lp().string})),loading:lp().bool,filterWord:lp().string,onSelectItem:lp().func,onSearchApply:lp().func,onDeselectAllItems:lp().func,onDeleteItem:lp().func};const uH=(0,sp.connect)((e=>({items:Os(e),loading:Ss(e),filterWord:vs(e)})),{onSearchApply:(e,t=B.XU)=>({type:Vr,payload:{search:e,debounceTime:t}}),onSelectItem:(e,t)=>({type:_r,payload:{searchCreatedDate:e,checked:t}}),onDeselectAllItems:ds,onDeleteItem:e=>({type:kr,payload:e}),onLoadTotalForItem:e=>({type:Mr,payload:e})})(cH),pH=({open:e,onClose:t})=>{const r=fB(),n=(0,sp.useDispatch)(),a=(0,ap.useMemo)((()=>[{value:B.uJ.saved,label:ei().text("Saved searches"),content:ip().createElement(Kz,null),dataReltioId:"reltio-search-saved-searches"},{value:B.uJ.recent,label:ei().text("Recent searches"),content:ip().createElement(uH,null),dataReltioId:"reltio-search-recent-searches"}]),[]),[i,o]=(0,ap.useState)(a[0].value);return(0,ap.useEffect)((()=>{e&&(i===B.uJ.saved?n({type:Qt}):n({type:wr}))}),[e,n,i]),ip().createElement(Ij(),{classes:{paper:r.dialogPaper},fullWidth:!0,maxWidth:"lg",open:e,onClose:t},ip().createElement(jB,{type:i,onClose:t}),ip().createElement(fF(),{classes:{root:r.contentRoot}},ip().createElement("div",{className:r.tabsWrapper},ip().createElement(OI,{value:i,tabs:a,onChange:o,scrollButtons:"auto"})),ip().createElement("div",{className:r.tabContent},a.find((0,O.propEq)("value",i)).content)))};pH.propTypes={open:lp().bool,onClose:lp().func};const dH=pH,mH=(0,Sp.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"}}))),fH=({showTypography:e})=>{const t=mH(),r=(0,sp.useDispatch)(),n=(0,sp.useSelector)(Ti.tm),a=ei().text("Saved & recent searches"),i=(0,ap.useCallback)((()=>r(si(!0))),[r]),o=(0,ap.useCallback)((()=>r(si(!1))),[r]);return ip().createElement(ip().Fragment,null,ip().createElement(ng(),{title:e?"":a},ip().createElement(Gh(),{className:t.button,variant:"outlined",startIcon:ip().createElement(mB(),{className:up()({[t.compact]:!e}),color:"action"}),onClick:i,"data-reltio-id":"reltio-search-saved-and-recent-search"},e&&ip().createElement(hf(),{variant:"button",color:"textPrimary",className:t.buttonText},a))),ip().createElement(dH,{open:n,onClose:o}))},yH=(0,Sp.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"}}))),gH="search",hH="geoLocation",EH={},bH=()=>{const e=yH(),t=(0,sp.useDispatch)(),r=(0,sp.useSelector)(C.Mp),n=(0,sp.useSelector)(C.X0),a=(0,sp.useSelector)(Xa.Qw)||EH,i=(0,sp.useSelector)(A().selectors.getSearchKeyword),o=(0,sp.useSelector)(A().selectors.getDateMask),l=(0,sp.useSelector)(A().selectors.getDateTimeMask),s=(0,sp.useSelector)(A().selectors.getAttributesPresentation)||EH,c=(0,sp.useSelector)(Ti.IJ),u=(0,sp.useSelector)((e=>(0,Xa.NU)(e,{entityTypeUri:void 0}))),p=(0,sp.useSelector)(Hi.go),d=(0,ap.useContext)(EV._),[m,f]=(0,ap.useState)([]),[y,g]=(0,ap.useState)(0),[h,E]=(0,ap.useState)(!1),b=(0,ap.useRef)(null),[T,S]=(0,ap.useState)(!0);(0,ap.useEffect)((()=>{f(x())}),[r,n,a,i]),(0,ap.useEffect)((()=>{g(m.length),E(!0)}),[m]),(0,ap.useEffect)((()=>{if(h){const e=I();g(e),E(!1)}}),[h,n]);const x=(0,ap.useCallback)((()=>{const e=Object.values((0,Ia.t8)(n,r)).filter((e=>e.values&&e.values.length)).map((e=>{const t=e.title||e.hiddenTitle,r=(0,Ia.MI)([...e.data||[],...e.filteredData||[]],(0,O.path)(["attrType","type"],e)===v.DataTypes.TYPE_DATE?e.values.map((e=>e.map((e=>v.utils.dates.toLocalDate(e).getTime())))):e.values.map((0,v.mapFilterValue)((0,v.applyPresentationStrategyToValue)((e=>(0,v.getNumberFormat)((0,v.getAttrDataTypeDefinition)(e.attrType),s,v.intl.getLocale()).strategy)(e)))),e.type,{dateMask:o,dateTimeMask:l});return{fieldName:e.fieldName,title:t,values:r}}));i&&e.push({fieldName:gH,title:ei().text("Search"),values:[i.value]});const{values:[t]=[],type:c}=(0,O.pathOr)({},["mapSearch"],a);return t&&e.push({fieldName:hH,values:(0,v.getMapSearchValues)(c,t),title:(0,v.getMapSearchLabel)(c)}),e}),[r,n,a,i,s,o,l]),R=(0,ap.useCallback)((()=>{g(m.length),E(!0)}),[m]),_=(0,ap.useCallback)((e=>{S(e>=450)}),[]),I=(0,ap.useCallback)((()=>{if(!b.current)return 0;const{firstChild:e,offsetLeft:t,offsetWidth:r}=b.current,n=t+r;return([...e.childNodes]||[]).filter((a=n,e=>e.offsetLeft+e.offsetWidth<=a)).length;var a}),[b]),N=(0,ap.useCallback)((e=>r=>{switch(r.stopPropagation(),e){case gH:t(w.search.actions.keywordUpdated(null));break;case hH:t(Ha(null));break;default:t(Ga(e,[]))}}),[t]),P=(0,ap.useCallback)((()=>{t(Ma({silent:!0})),t(w.search.actions.keywordUpdated({debounceTime:B.XU}))}),[t]),D=(0,ap.useMemo)((()=>m.map((e=>ip().createElement(TV,{key:e.fieldName,title:e.title,values:e.values,onDelete:N(e.fieldName)})))),[m,N]),k=D.slice(0,y),L=D.slice(y),U=(0,O.when)((0,O.propEq)("length",1),(0,O.reject)(v.isEmptySearchGroup))(p),j=0===D.length&&0===U.length,F=!c&&D.length>0;return ip().createElement("div",{className:e.container,"data-reltio-id":"search-bar"},ip().createElement("div",{className:e.header},ip().createElement("div",{className:e.captionWrapper,"data-reltio-id":"search-bar-total-profiles"},ip().createElement(hf(),{component:"span",classes:{body1:e.profileNumber}},ei().number(u,"0,0")),ip().createElement(hf(),{variant:"body2",component:"span",classes:{root:e.profileText}},ei().text("total profiles"))),ip().createElement(pB,null),ip().createElement(cB,null),ip().createElement(Gh(),{color:"primary",className:e.clearButton,onClick:P,disabled:j,"data-reltio-id":"reltio-search-clear"},ei().text("clear")),!d&&ip().createElement("div",{className:e.searchBarControls,"data-reltio-id":"search-bar-controls"},ip().createElement(Up.ZP,{handleWidth:!0,handleHeight:!1,onResize:_}),ip().createElement(oB,null),ip().createElement(Cf(),{orientation:"vertical",className:e.splitter}),ip().createElement(fH,{showTypography:T}))),ip().createElement(Up.ZP,{handleWidth:!0,handleHeight:!1,onResize:R}),ip().createElement(hV(),{in:F,timeout:500},ip().createElement("div",{ref:b,className:e.facetsBar,"data-reltio-id":"search-facets-bar"},ip().createElement("div",{className:e.showBar},k),L.length>0&&ip().createElement(SV,{items:L}))))},vH=(0,Sp.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"}}),TH=({onBackBtnClick:e})=>{const t=vH();return ip().createElement(EF(),{disableGutters:!0,classes:{root:t.toolBar}},ip().createElement(gd.k,{tooltipTitle:ei().text("Switch to basic mode"),size:"L",icon:NI(),className:t.backButtonContainer,onClick:e}),ip().createElement(hf(),{variant:"subtitle1",className:t.title},ei().text("Advanced search")))};TH.propTypes={onBackBtnClick:lp().func};const OH=TH,SH=(0,Sp.Z)((e=>({query:{color:e.palette.text.secondary,fontSize:"12px",letterSpacing:0,lineHeight:"16px"},[v.READABLE_QUERY_PRIMITIVE_TYPES.entityTypeLabel]:{color:"#03904A"},[v.READABLE_QUERY_PRIMITIVE_TYPES.attributeLabel]:{color:"#059BEA"},[v.READABLE_QUERY_PRIMITIVE_TYPES.specialAttributeLabel]:{color:"#EA05CF"},[v.READABLE_QUERY_PRIMITIVE_TYPES.attributeFilter]:{color:"#7F00FF"},[v.READABLE_QUERY_PRIMITIVE_TYPES.attributeValue]:{color:"#000000"}})));function xH(){return xH=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},xH.apply(null,arguments)}const CH=(0,ap.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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["readableQuery","className"]);const i=SH();return ip().createElement("span",xH({ref:t,className:up()(i.query,n),"data-reltio-id":"search-readable-query"},a),r.map((({type:e,text:t},r)=>ip().createElement("span",{key:r,className:i[e]},t))))}));CH.displayName="ReadableSearchQuery";var wH=r(82466),AH=r.n(wH);const RH=(0,Sp.Z)({collapseIcon:{transform:"rotate(0deg)",transition:"transform 0.35s ease"},"collapseIcon--inverted":{transform:"rotate(-180deg)"}});function _H(){return _H=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},_H.apply(null,arguments)}const IH=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["collapseBtnActive","onCollapseBtnClick"]);const a=RH();return ip().createElement(gd.k,_H({size:"L",icon:AH(),tooltipTitle:t?ei().text("Collapse panel"):ei().text("Expand panel"),onClick:r,iconClassName:up()(a.collapseIcon,{[a["collapseIcon--inverted"]]:!t}),"data-reltio-id":"reltio-search-advanced-search-collapse-panel"},n))};IH.propTypes={backBtnDisabled:lp().bool,onBackBtnClick:lp().func,collapseBtnActive:lp().bool,onCollapseBtnClick:lp().func};const NH=IH;var PH=r(89808),DH=r.n(PH),kH=r(19820),LH=r.n(kH);function UH(){return UH=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},UH.apply(null,arguments)}const jH=e=>{let{isFullscreen:t=!1,onClick:r=O.identity}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["isFullscreen","onClick"]);return ip().createElement(gd.k,UH({size:"L",icon:t?LH():DH(),tooltipTitle:t?ei().text("Exit full screen"):ei().text("Full screen"),onClick:r,"data-reltio-id":"reltio-search-advanced-search-full-screen"},n))};jH.propTypes={isFullscreen:lp().bool,onClick:lp().func};const FH=jH,MH=(0,Sp.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"}}),VH=({groups:e,hasMinSize:t,lookups:r,metadata:n,attributesPresentation:a,collapseBtnActive:i,isFullscreen:o,onCollapseBtnClick:l,onFullScreenBtnClick:s,keyword:c,map:u,dispatch:p})=>{const d=MH(),[m,f]=(0,ap.useState)(0),[y,g]=(0,ap.useState)(0),h=(0,ap.useMemo)((()=>(0,_a.Jk)((0,lt.P0)(n,e))),[n,e]),E=(0,v.buildReadableQuery)(n,a,r,e,c,u),b=ei().text("Copy to clipboard"),[T,O]=(0,ap.useState)(b),S=(0,ap.useCallback)((0,v.debounce)((()=>{p({type:it})}),500),[p]),x=(0,ap.useCallback)((()=>{JV((0,v.buildReadableQueryToString)(n,a,r,e,c,u)).then((()=>O(ei().text("Query was copied")))).catch((()=>O(ei().text("Error"))))}),[e,a,r,n,c,u]),C=(0,ap.useCallback)((()=>{O(b)}),[b]),w=(0,ap.useCallback)((e=>{f(e.clientX),g(e.clientY)}),[]);(0,mE.D)(S,[S,h]);const A=(0,ap.useMemo)((()=>({anchorEl:{clientWidth:1,clientHeight:1,getBoundingClientRect:()=>({left:m,bottom:y,height:1,right:m,width:1,top:y})}})),[m,y]);return ip().createElement("div",{className:d.resultQueryPanel},ip().createElement("div",{className:d.resultQuery},ei().text("Search query"),ip().createElement("div",{className:up()(d.queryContainer,{[d.queryContainerMinHeight]:t})},E.length>0?ip().createElement(ng(),{key:T,title:T,onClose:C,PopperProps:A},ip().createElement(CH,{readableQuery:E,onMouseEnter:w,onClick:x,className:d.query})):ip().createElement("span",{className:d.noQuery},ei().text("Build your search and view your search query here")))),ip().createElement("div",{className:d.actionsPanel},ip().createElement(NH,{collapseBtnActive:i,onCollapseBtnClick:l,className:d.collapseButton}),ip().createElement(FH,{isFullscreen:o,onClick:s})))};var BH=r(28345),zH=r.n(BH),HH=r(68157);const YH=(0,Sp.Z)((e=>({readOnlyLogicOperatorContainer:{display:"flex",alignItems:"center",marginRight:"40px",width:"76px",fontSize:"14px",color:e.palette.text.secondary,maxHeight:"46px"}}))),WH=({className:e,rowData:t})=>{const r=YH();return ip().createElement("div",{className:up()(r.readOnlyLogicOperatorContainer,e)},t&&t.operator?(0,HH.capitalize)(t.operator):ei().text("Where"))},GH=(0,Sp.Z)((e=>({readOnlyFilter:{display:"flex",alignItems:"center",fontSize:"14px",color:e.palette.text.secondary,width:"50px",marginLeft:"12px",maxHeight:"46px"}}))),qH=({className:e,rowData:t})=>{const r=GH();return ip().createElement("div",{className:up()(r.readOnlyFilter,e)},t&&t.filter?(0,v.getFilterOptionLabel)(t.filter):ei().text("equals"))},ZH=(0,Sp.Z)((()=>({row:{display:"flex",marginBottom:"12px"},rowItem:{paddingRight:"10px",display:"flex"},fullWidth:{flexGrow:"1",flexBasis:"0",overflow:"hidden"},hidden:{visibility:"hidden"}}))),$H=e=>{let{classes:t={},rowData:r,previousRowData:n,LogicOperatorComponent:a=WH,AttributeSelectorComponent:i,FilterSelectorComponent:o=qH,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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["classes","rowData","previousRowData","LogicOperatorComponent","AttributeSelectorComponent","FilterSelectorComponent","ValuesEditorComponent","ActionsComponent","filterSelectorRef","attributeSelectorProps"]);const d=ZH();return ip().createElement("div",{className:up()(d.row,t.root),"data-reltio-id":"query-builder-row"},ip().createElement(a,{className:t.logicOperatorContainer,rowContext:p,rowData:n}),ip().createElement("div",{className:up()(d.rowItem,t.attributeSelectorContainer),"data-reltio-id":"query-builder-row-attribute-selector"},ip().createElement(i,{attributeSelectorProps:u,rowContext:p,rowData:r})),ip().createElement("div",{className:up()(d.rowItem,t.filterSelectorContainer),"data-reltio-id":"query-builder-row-filter-selector"},ip().createElement(o,{textFieldInputRef:c,rowContext:p,rowData:r})),ip().createElement("div",{className:up()(d.rowItem,d.fullWidth,t.valuesEditorContainer),"data-reltio-id":"query-builder-row-values-editor"},ip().createElement(l,{rowContext:p,rowData:r})),ip().createElement("div",{className:up()(d.rowItem,t.actionsContainer,{[d.hidden]:!r}),"data-reltio-id":"query-builder-row-actions"},ip().createElement(s,{rowContext:p,rowData:r})))},KH=(0,ap.memo)($H);function XH(){return XH=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},XH.apply(null,arguments)}const QH=(0,ip().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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.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,O.path)([t-1],n):null,c=t===n.length?{attributeSelectorProps:a}:{};return ip().createElement(KH,XH({key:e&&e.id,rowData:e,previousRowData:s,classes:r,filterSelectorRef:t===o?i:void 0},l,c))};return ip().createElement("div",{"data-reltio-id":"reltio-query-builder-rows-group",className:t},n.map(s),s(null,n.length,n))})),JH=(0,Sp.Z)((()=>({select:{padding:"6px 16px 7px"},dropDown:{width:"100px","&:before":{content:"none !important"}}}))),eY=({className:e,value:t,onChange:r})=>{const n=JH();return ip().createElement(AV.k,{className:up()(n.dropDown,e),classes:n,value:t,entries:v.operatorOptions,onChange:r})},tY={position:"absolute",width:1,background:"rgba(43, 152, 240, 0.3)",height:16,left:36};function rY(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){nY(e,t,r[t])}))}return e}function nY(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const aY=(0,Sp.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:rY({},tY),upperLine:{marginTop:-18},lowerLine:{marginBottom:-16,bottom:0}}))),iY="46px",oY=(0,Sp.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:iY},filterSelect:{width:"190px"},valuesWrapper:{width:"100%",display:"flex",minHeight:iY,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:{}})));var lY=r(58282),sY=r.n(lY);const cY=e=>e.join(", "),uY=e=>`calc(${(0,O.isNil)(e)?"100%":`${e}px`} - 35px)`,pY=(0,Sp.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)"}}),dY=({list:e,maxWidth:t})=>{const r=pY(),n=(0,ap.useRef)(),[a,i]=(0,ap.useState)(0);(0,ap.useEffect)((()=>{i(((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)})(e,n.current))}),[e]);const o=cY(e),l=a>0,s=l?cY(e.slice(0,-a)):o;return ip().createElement(ng(),{title:l?o:""},ip().createElement("div",{className:r.listLabelContainer},ip().createElement("div",{style:{width:uY(t)},className:r.listLabel,ref:n},o),ip().createElement("div",{className:r.visibleItemsLabel},s),l&&ip().createElement("div",{className:r.hiddenCount},`+${a}`)))};function mY(){return mY=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},mY.apply(null,arguments)}const fY=(0,O.always)(32),yY=(0,ap.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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["selectedItems","onItemClick","focusIndex","width","height"]);return ip().createElement(Fp,mY({getItemSize:fY,renderItem:(e,{item:a},i)=>{const o=!!t.find((e=>a.uri===e)),l=i===n;return ip().createElement(cd,{key:a.uri,onClick:r,checked:o,data:a,label:ip().createElement(ud.o,{text:a.label,highlight:a.filterText}),labelInText:a.label,style:e,isFocused:l,hideIcon:!0,LogoIcon:a.LogoIcon})},focusIndex:n,fixedTitle:!1,disableHorizontalScrollbar:!0,width:a,height:i},o))}));yY.displayName="SelectMetadataTypesList";const gY=(0,Sp.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 hY(){return hY=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hY.apply(null,arguments)}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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){bY(e,t,r[t])}))}return e}function bY(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const vY=(0,ap.memo)((({placeholder:e,classes:t={},items:r,selectedItemsUris:n,onChange:a,ListLabelProps:i={},disabled:o,enableEmptyValueUnderline:l,single:s,label:c,dataReltioId:u,selectionPopupTitle:p})=>{const d=gY(),[m,f]=(0,ap.useState)(!1),y=(0,ap.useCallback)((()=>f(!0)),[]),g=(0,ap.useCallback)((()=>f(!1)),[]),[h,E]=(0,ap.useState)(""),b=(0,ap.useCallback)((()=>E("")),[]),T=(0,ap.useCallback)((0,O.pipe)(b,g),[g,b]),S=r.filter((({label:e})=>v.utils.strings.search(e,h))).map(((e,t)=>({item:{item:EY({},e,{filterText:h})},index:t}))),x=(0,ap.useMemo)((()=>(0,O.pipe)((0,O.map)((e=>r.find((0,O.propEq)("uri",e)))),(0,O.reject)(O.isNil),(0,O.pluck)("label"))(n)),[n,r]),C=(0,ap.useCallback)(((e,t)=>{s?(a(t?[e.uri]:[]),T()):a(t?n.concat(e.uri):n.filter((t=>t!==e.uri)))}),[n,a,s,T]),w=(0,ap.useCallback)((({item:e})=>{const t=!n.includes(e.uri);C(e,t)}),[n,C]),{focusIndex:A,handleKeyDown:R}=Mp({items:S,open:m,onSelectFocusedItem:w,selectedItems:n,onClose:T}),_=(0,ap.useRef)(),I=_.current?_.current.getBoundingClientRect().width:0,N=Math.max(I,255),P=0===n.length;return ip().createElement(ip().Fragment,null,ip().createElement(QV(),{label:c,ref:_,InputProps:{startAdornment:P&&!e?null:ip().createElement("div",{className:up()(d.inputText,t.inputText)},P?ip().createElement("div",null,e):ip().createElement(dY,hY({},i,{list:x}))),classes:{root:d.inputRoot,input:up()(d.input,t.input,{[d.emptyInput]:P&&!e}),disabled:up()(d.disabledInput,{[d.disabledPointer]:o}),underline:d.disabledUnderline},endAdornment:ip().createElement(Op.T,{size:"L",icon:sY(),iconClassName:up()(d.icon,{[d["popup-opened-icon"]]:m}),disabled:o}),readOnly:!0,disableUnderline:P&&!l},inputProps:{tabIndex:-1},InputLabelProps:{classes:{root:up()(d.inputLabel,t.label)}},value:"",onClick:o?void 0:y,classes:{root:up()(d.root,t.root)},size:"small",variant:"filled",disabled:o,"data-reltio-id":u}),ip().createElement(Pp,{open:m,anchorEl:_.current,onClose:T,onSearch:E,title:p,containerWidth:N,containerHeight:355,searchInputOnKeyDown:R,transformOrigin:{horizontal:"left",vertical:"top"},anchorOrigin:{horizontal:"left",vertical:"bottom"},PaperProps:{"data-reltio-id":`${u}-popup`}},ip().createElement(yY,{items:S,onItemClick:C,selectedItems:n,width:N,height:245,focusIndex:A})))}));vY.displayName="MetadataTypesSelector";const TY=(0,ap.memo)((({entityTypes:e,selectedEntityTypes:t,single:r,placeholder:n,enableEmptyValueUnderline:a,onChange:i,classes:o={},ListLabelProps:l={},disabled:s=!1})=>{const c=(0,ap.useMemo)((()=>e.filter(v.isAvailableEntityType)),[e]);return ip().createElement(vY,{items:c,selectedItemsUris:t,single:r,placeholder:n,enableEmptyValueUnderline:a,onChange:i,classes:o,ListLabelProps:l,disabled:s,label:ei().text("Entity type"),dataReltioId:"entity-type-selector",selectionPopupTitle:ei().text("Select entity types")})}));TY.displayName="EntityTypesSelector";const OY=({selectedEntityTypes:e,onChange:t,classes:r={},ListLabelProps:n={}})=>{const a=(0,sp.useSelector)(A().selectors.getMetadata),i=(0,sp.useSelector)(Xa.t9),o=(0,sp.useSelector)(Ti.Xf),l=(0,ap.useCallback)(o?({uri:e})=>o.includes(e):O.identity,[o]),s=(0,ap.useMemo)((()=>a.entityTypes.filter(l).sort(o?(0,v.orderByArrayComparator)(o,"uri"):e=>0).filter((({uri:e})=>(0,v.isAvailableEntityTypeForDataTenant)(i,e)))),[a,i,l,o]);return ip().createElement(TY,{classes:r,entityTypes:s,onChange:t,selectedEntityTypes:e,ListLabelProps:n,placeholder:ei().text("All"),enableEmptyValueUnderline:!0})};OY.propTypes={selectedEntityTypes:lp().arrayOf(lp().string).isRequired,onChange:lp().func.isRequired,classes:lp().shape({root:lp().string,label:lp().string}),ListLabelProps:lp().shape({maxWidth:lp().number})};const SY=OY,xY=(0,Sp.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)"}}}}),CY=(0,O.either)((0,O.prop)("title"),(0,O.prop)("fieldName")),wY=({value:e,getLabel:t=CY,onSelectAttributeClick:r,disabled:n=!1})=>{const a=xY(),i=e&&t(e);return ip().createElement("div",{onClick:n?void 0:r,className:up()(a.attribute,{[a.attributeWithValue]:!!i},{[a.disabled]:n})},ip().createElement(ad.Y,{value:i},ip().createElement("div",{className:up()(a.name,{[a.disabled]:n})},i||ip().createElement("span",{className:a.noSelect},ei().text("Select attribute")))),ip().createElement(Op.T,{size:"M",icon:sY(),disabled:n}))},AY=(0,Sp.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 RY(){return RY=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},RY.apply(null,arguments)}function _Y(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){IY(e,t,r[t])}))}return e}function IY(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const NY=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["selectedAttributes","onItemClick","focusIndex","hideCheckBox"]);const o=AY(),l=(0,Uf.AH)();return ip().createElement(Fp,RY({getItemSize:(e,t)=>t.items?40:28,renderItem:(e,{item:i,level:o,groupId:l,groupName:s},c)=>{const u=sL(i,t),p=c===n;return ip().createElement(cd,{key:`item-${l}-${i.fieldName}`,onClick:r,checked:u,data:_Y({},i,{groupName:s}),notSelectable:i.notSelectable,hideCheckBox:a,label:ip().createElement(ud.o,{text:i.title,highlight:i.filterText}),labelInText:i.title,level:o,style:e,isFocused:p,groupId:l,LogoIcon:i.LogoIcon})},renderGroupTitle:(e,t)=>ip().createElement($m(),{component:"div",className:o.subHeader,style:e,key:`group-${t.item.id}`},t.item.needGroupIcon&&ip().createElement(Ff,{group:t.item,metadata:l}),t.item.title),focusIndex:n},i))},PY=(0,ap.memo)(NY);function DY(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){kY(e,t,r[t])}))}return e}function kY(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const LY=(e,t)=>e.title.toLowerCase().includes(t.toLowerCase()),UY=(e,t)=>LY(e,t)||(e.children||[]).some((e=>UY(e,t))),jY=(e,t)=>e.findIndex(lL(t)),FY=(0,v.getMaxItemWidth)("title"),MY=(e,t,r,n,a=0,i=!1)=>{const o=LY(e,n);return[{item:n?DY({},e,{filterText:n}):e,level:a,groupId:t,groupName:r}].concat(e.children?e.children.filter((e=>i||o||UY(e,n))).flatMap((e=>MY(e,t,r,n,a+1,i||o))):[]).flat()},VY=(0,O.curry)(((e,t)=>t.map((t=>({item:t,items:t.attributes.filter((t=>UY(t,e))).map((r=>MY(r,t.id,t.title,e)))}))).filter((e=>e.items.length)))),BY=(0,Sp.Z)({selector:{minWidth:"200px",width:"100%",alignItems:"stretch",background:"rgba(0,0,0, 0.0267)",boxSizing:"border-box",borderRadius:"4px",display:"flex"}}),zY=({className:e,itemsGroups:t,value:r,getLabel:n,onSelect:a,onRestoreFocus:i=O.identity,onOpenPopup:o=O.identity,disableRestoreFocus:l=!1,disableEnforceFocus:s=!1,single:c=!1,ungroup:u=!1,disabled:p=!1,hideCheckBox:d=!1})=>{const m=BY(),[f,y]=(0,ap.useState)(null),g=(0,ap.useCallback)((()=>y(null)),[]),h=!!f,[E,b]=(0,ap.useState)(""),v=(0,ap.useCallback)((()=>b("")),[]),[T,S]=(0,ap.useState)([]),x=(0,ap.useCallback)((()=>S([])),[]),C=(0,ap.useMemo)((()=>VY(E,t)),[t,E]),w=(0,ap.useMemo)((()=>(0,O.pipe)((0,O.when)((0,O.always)(u),(0,O.chain)((0,O.pipe)((0,O.prop)("items"),O.flatten,(0,O.map)((0,O.pick)(["item","level"]))))),Dp)(C)),[u,C]),A=(0,ap.useMemo)((()=>Math.max(FY(C),308)),[C]),R=(0,O.pipe)((0,O.tap)((0,O.pipe)(x,v,g)),i),_=(0,ap.useRef)(),I=(0,ap.useCallback)(((e,t)=>{a({checked:t,attribute:e,index:t?T.length:jY(T,e),selectedAttributes:T}),c?(S(t?[e]:[]),R({})):(S((({attribute:e,selectedAttributes:t,checked:r})=>r?t.concat(e):t.filter((t=>!lL(e,t))))({selectedAttributes:T,attribute:e,checked:t})),_.current&&_.current.focus())}),[T,a,c,R,_]),N=(0,ap.useCallback)((({onListItemClick:e,selectedAttributes:t})=>({item:r,groupData:n})=>{const a=sL(r,t);e(DY({},r,{groupName:n.groupName}),!a)})({onListItemClick:I,selectedAttributes:T}),[I,T]),{focusIndex:P,handleKeyDown:D}=Mp({items:w,open:h,onSelectFocusedItem:N,selectedItems:T,onClose:R});return ip().createElement("div",{className:up()(m.selector,e),"data-reltio-id":"attribute-selector"},ip().createElement(wY,{value:r,getLabel:n,onSelectAttributeClick:e=>{o(),y(e.currentTarget)},disabled:p}),ip().createElement(Pp,{open:h,anchorEl:f,onClose:R,onSearch:b,title:ei().text("Select attribute"),containerWidth:A,containerHeight:507,searchInputOnKeyDown:D,anchorOrigin:{horizontal:"right",vertical:"bottom"},searchInputRef:_,disableRestoreFocus:l,disableEnforceFocus:s},ip().createElement(PY,{items:w,onItemClick:I,selectedAttributes:T,width:A,height:400,focusIndex:P,hideCheckBox:d})))},HY=(0,ap.memo)(zY);var YY=r(80349);function WY(){return WY=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},WY.apply(null,arguments)}const GY=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["entityTypes","recommendedAttributes","showReferencedEntityAttributes","firstLevelAttributesFilter"]);const o=(0,sp.useSelector)(A().selectors.getMetadata),l=(0,sp.useSelector)(Xa.t9),s=(0,sp.useSelector)(A().selectors.getCanUserReadWorkflowDataTask),c=(0,sp.useSelector)(Ti.Xf),u=(0,sp.useSelector)(A().selectors.getDataTenants),p=(0,ap.useMemo)((()=>(0,O.pipe)(YY.s1,(0,O.when)((0,O.always)(!n),YY.a),(0,I.ED)(l),(e=>(0,v.filterMaskedAttributes)(o,e)))({allowedEntityTypes:c,firstLevelAttributesFilter:a},o,t,r,u,s)),[t,o,l,c,a,r,n,u,s]);return ip().createElement(HY,WY({},i,{itemsGroups:p}))},qY=(0,ap.memo)(GY),ZY=({rowData:e,rowContext:{entityTypes:t,dispatchGroupAction:r},attributeSelectorProps:n={}})=>{const a=oY(),i=e&&e.id,o=(0,ap.useCallback)((e=>{r(Uo,i,e)}),[i,r]),l=(0,ap.useCallback)((e=>(0,v.getSearchGroupAttributeLabel)({data:e})),[]);return ip().createElement(qY,{className:a.attributeSelect,value:e&&e.data,getLabel:l,entityTypes:t,onSelect:o,onRestoreFocus:n.onRestoreFocus,onOpenPopup:n.onOpen,disableRestoreFocus:n.disablePopoverRestoreFocus,disableEnforceFocus:n.disablePopoverRestoreFocus})};ZY.propTypes={rowData:YB,rowContext:lp().shape({entityTypes:lp().arrayOf(lp().string),dispatchGroupAction:lp().func}),attributeSelectorProps:lp().shape({onRestoreFocus:lp().func,onOpen:lp().func,disablePopoverRestoreFocus:lp().bool})};const $Y=(0,ap.memo)(ZY);function KY(){return KY=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},KY.apply(null,arguments)}const XY=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return ip().createElement("svg",KY({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),ip().createElement("defs",null,ip().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"})),ip().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},ip().createElement("g",null,ip().createElement("g",{transform:"translate(-2 -2)"},ip().createElement("mask",{id:"svg397942461b",fill:"#fff"},ip().createElement("use",{xlinkHref:"#svg397942461a"})),ip().createElement("g",{mask:"url(#svg397942461b)",fill:"#000",fillOpacity:".54"},ip().createElement("path",{d:"M0 0h24v24H0z"}))))))},QY=e=>!(e&&e.data),JY=({rowData:e,rowContext:{dispatchGroupAction:t}})=>{const r=oY(),n=e&&e.id,a=(0,ap.useCallback)((()=>t(Mo,n)),[n,t]),i=(0,ap.useCallback)((()=>t(Vo,n)),[n,t]),o=(0,ap.useCallback)((()=>t(Po,n)),[n,t]);return e&&ip().createElement("div",{className:up()(r.actions)},ip().createElement(ng(),{title:ei().text("Add"),placement:"bottom"},ip().createElement(zH(),{className:r.actionIcon,onClick:o})),!QY(e)&&ip().createElement(ng(),{title:ei().text("Duplicate"),placement:"bottom"},ip().createElement("div",{className:r.actionIcon,tabIndex:-1},ip().createElement(XY,{onClick:i,tabIndex:-1}))),ip().createElement(ng(),{title:ei().text("Delete"),placement:"bottom"},ip().createElement(Ep(),{onClick:a,className:r.actionIcon})))};JY.propTypes={rowData:YB,rowContext:lp().shape({dispatchGroupAction:lp().func})};const eW=(0,ap.memo)(JY),tW={BY_LABEL:(0,r(95933).c)({stringify:(0,O.prop)("label")})},rW=({className:e,attribute:t,textFieldInputRef:r,isDisabled:n,height:a,onChange:i})=>{const o=(0,O.pipe)(v.getFilterOptionLabel,HH.capitalize);return ip().createElement(aj,{label:"",placeholder:ei().text("Equals"),className:e,value:n?void 0:{value:t.filter,label:o(t.filter)},options:t&&t.data&&t.data.filterOptions.map((e=>({value:e,label:o(e)})))||[],height:a,onChange:i,isDisabled:n,filterOption:tW.BY_LABEL,textFieldInputRef:r})};rW.propTypes={className:lp().string,attribute:YB,textFieldInputRef:lp().object,isDisabled:lp().bool,onChange:lp().func,height:lp().number};const nW=(0,ap.memo)(rW),aW=({rowData:e,rowContext:{dispatchGroupAction:t},textFieldInputRef:r})=>{const n=oY(),a=e&&e.id,i=(0,ap.useCallback)((e=>t(Bo,a,e.value)),[t,a]);return ip().createElement(nW,{className:n.filterSelect,attribute:e,textFieldInputRef:r,isDisabled:QY(e),onChange:i})};aW.propTypes={rowData:YB,rowContext:lp().shape({dispatchGroupAction:lp().func}),textFieldInputRef:lp().object};const iW=(0,ap.memo)(aW);var oW=r(23821);const lW=(0,Sp.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"}}),sW=({attribute:e,groupId:t,onChange:r,updateValues:n,filterValues:a})=>{const{values:i,data:{attrType:o,fieldName:l}={},id:s}=e,c=(0,sp.useSelector)((e=>(0,Hi.Sw)(e,t,s)))||{},u=(0,sp.useSelector)((e=>(0,Hi.Ly)(e))),p=(0,sp.useSelector)((e=>(0,Xa.Sg)(e,l)));(0,ap.useEffect)((()=>{u&&n()}),[i,u,p]),(0,ap.useEffect)((()=>{u||n()}),[i,u]);const d=(0,ap.useMemo)((()=>(0,O.propOr)([],0,i)),[i]),m=(0,ap.useCallback)((0,O.pipe)(v.wrapInArray,r),[r]),{default:f,filtered:y}=c;return!f&&o?ip().createElement("div",{className:"ValuesEditor-styles-loadingWrapper--_rOmn"},ip().createElement(um(),{size:20,className:"ValuesEditor-styles-loading--mLFVu"})):ip().createElement(tg,{values:d,defaultOptions:f,filteredOptions:y,onChange:m,getSuggestions:a,tabSelectsValue:!1,canLoadMore:!(0,Ia.tW)(e.data)})};sW.propTypes={attribute:YB.isRequired,groupId:lp().string,onChange:lp().func,updateValues:lp().func,filterValues:lp().func};const cW=sW,uW=({attribute:e,dispatchGroupAction:t,groupId:r})=>{const{values:n,data:{attrType:a,fieldName:i}={},filter:o}=e,l=lW(),s=(0,v.isTypeaheadAttrType)(a)||(0,O.allPass)([(0,O.propSatisfies)((0,O.either)(O.isNil,v.isEntityTypeUri),"uri"),(0,O.prop)("faceted"),(0,O.propEq)("type",v.DataTypes.TYPE_BLOB)])(a),c=(0,v.isEnumAttrType)(a)||(0,v.isLookupAttrType)(a),u=r=>t(zo,e.id,r);if((s||c)&&(0,v.isMultiValueOption)(o)){const n=()=>t(Wo,e),a=({value:r,pageNumber:n,currentOptions:a})=>t(Ho,{attribute:e,value:r,debounceTime:500,pageNumber:n,currentOptions:a});return ip().createElement(cW,{attribute:e,groupId:r,onChange:u,filterValues:a,updateValues:n})}{const e=c?{type:v.DataTypes.TYPE_STRING}:(0,v.getAttrDataTypeDefinition)(a),t=(0,v.getDataTypeDefinitionForFilterValue)(e,o),r=(0,v.isDateType)(t.type)&&!(0,v.isDateRangeFilterOption)(o)&&l.dateRoot||(0,v.isBooleanType)(t.type)&&l.boolRoot||l.root;return ip().createElement(oW.n,{filter:{filter:o,fieldName:i,values:n||[]},onChange:u,dataTypeDefinition:t,fullWidth:!0,TextFieldProps:{InputProps:{classes:{root:l.input},disableUnderline:(0,O.isNil)(n)||(0,O.isEmpty)((0,O.flatten)(n))}},color:"primary",booleanRadioEditorClassName:l.booleanRadioEditor,classes:{root:r},orientation:"horizontal"})}};uW.propTypes={attribute:YB.isRequired,groupId:lp().string,dispatchGroupAction:lp().func};const pW=(0,ap.memo)(uW),dW=({rowData:e,rowContext:{dispatchGroupAction:t,groupId:r}})=>{const n=oY(),a=e&&(0,v.checkIfOptionHasValues)(e.filter);return ip().createElement("div",{className:n.valuesWrapper,"data-reltio-id":"advanced-search-values-editor-wrapper"},!QY(e)&&a&&ip().createElement(pW,{attribute:e,dispatchGroupAction:t,groupId:r}))};dW.propTypes={rowData:YB,rowContext:lp().shape({dispatchGroupAction:lp().func,groupId:lp().string})};const mW=(0,ap.memo)(dW),fW=({rowData:e,rowContext:{dispatchGroupAction:t}})=>{const r=oY(),n=e&&e.id,a=e&&e.operator,i=(0,ap.useCallback)((e=>t(jo,n,e)),[t,n]);return ip().createElement("div",{className:r.logicOperatorContainer},a?ip().createElement(eY,{className:r.logicOperator,value:a,onChange:i}):ip().createElement("div",{className:up()(r.logicOperator,r.logicOperatorPlaceholder)},ei().text("Where")))};fW.propTypes={rowData:YB,rowContext:lp().shape({dispatchGroupAction:lp().func})};const yW=(0,ap.memo)(fW);function gW(){return gW=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gW.apply(null,arguments)}const hW=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["showLogicOperator","group","dispatch","onAddEmptyGroup"]);const c=aY(),u=oY(),p=(0,ap.useCallback)((()=>o({type:We,payload:{groupId:r,id:(0,Me.x0)()}})),[r,o]),d=(0,ap.useCallback)((()=>o({type:He,payload:{groupId:r}})),[r,o]),m=(0,ap.useCallback)((e=>o(((e,t)=>({type:ze,payload:{groupId:e,operator:t}}))(r,e))),[r,o]),f=(0,ap.useCallback)((e=>o(((e,t)=>({type:Ve,payload:{groupId:e,entityTypes:t}}))(r,e))),[r,o]),y=(0,ap.useCallback)(((e,...t)=>o(e(r,...t))),[r,o]),g=(0,ap.useRef)(null),h=(0,ap.useRef)(null),E=(0,ap.useRef)(null);E.current=n.length;const b=(0,ap.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),g.current&&h.current!==E.current&&(g.current.querySelector("input").focus(),h.current=null)}),[]),v=(0,ap.useCallback)((()=>{h.current=n.length}),[n.length]),T=(0,ap.useMemo)((()=>[{text:ei().text("Add set"),onClick:l,id:"-group-add-set"},{text:ei().text("Duplicate set"),onClick:p,id:"-group-duplicate-set"},{text:ei().text("Delete set"),onClick:d,id:"-group-delete-set"}]),[l,p,d]),O=(0,ap.useMemo)((()=>({root:u.row})),[u]),S=(0,ap.useMemo)((()=>({onRestoreFocus:b,onOpen:v,disablePopoverRestoreFocus:!!b})),[b,v]);return ip().createElement(ip().Fragment,null,ip().createElement("div",gW({className:c.container},s),ip().createElement("div",{className:c.title},ei().text("Set")),ip().createElement("div",{className:c.entityTypeSelectorContainer},ip().createElement(SY,{classes:{root:c.entityTypeSelector},selectedEntityTypes:i,onChange:f})),ip().createElement("div",{className:c.rows},ip().createElement(QH,{rowClasses:O,rowsData:n,AttributeSelectorComponent:$Y,FilterSelectorComponent:iW,ValuesEditorComponent:mW,ActionsComponent:eW,LogicOperatorComponent:yW,filterSelectorRefIndex:h.current,filterSelectorRef:g,lastRowAttributeSelectorProps:S,entityTypes:i,groupId:r,dispatchGroupAction:y}),ip().createElement("div",{className:c.actions},ip().createElement(xN,{menuId:`query-builder-group-actions-${r}`,buttonComponent:Op.T,buttonProps:{icon:Id(),size:"L","data-reltio-id":"reltio-search-query-builder-group-actions"},menuItems:T})))),t&&ip().createElement("div",{className:c.logicOperator},ip().createElement("div",{className:up()(c.verticalOperatorLine,c.upperLine)}),ip().createElement("div",{className:up()(c.verticalOperatorLine,c.lowerLine)}),ip().createElement(eY,{value:a,onChange:m})))};hW.propTypes={showLogicOperator:lp().bool,group:lp().shape({id:lp().string,attributes:lp().arrayOf(YB),entityTypes:lp().arrayOf(lp().string),operator:lp().string}),onAddEmptyGroup:lp().func,dispatch:lp().func};const EW=(0,ap.memo)(hW);function bW(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){vW(e,t,r[t])}))}return e}function vW(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const TW=(0,Sp.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:bW({},tY),upperLine:{marginTop:-18},searchByOvContainer:{marginLeft:-6,marginBottom:-14}}))),OW=({groups:e,uiConfigShowSearchByOv:t,dispatch:r})=>{const n=TW(),a=(0,ap.useRef)(null),i=(0,ap.useRef)(null),o=(0,ap.useCallback)((()=>r({type:Ye,payload:{group:Yt([])}})),[r]);return(0,ap.useEffect)((()=>{if(0===e.length)o();else if(!(0,O.isNil)(i.current)&&i.current<e.length&&a.current){const e=a.current.childNodes;e[e.length-2].scrollIntoView({behavior:"smooth"})}i.current=e.length}),[e.length,o]),ip().createElement("div",{className:n.scrollWrapper},ip().createElement("div",{className:n.groupsContainer,ref:a},t&&ip().createElement("div",{className:n.searchByOvContainer},ip().createElement(Ih,{variant:"queryGroups"})),e.map(((e,t,n)=>ip().createElement(EW,{key:e.id,group:e,dispatch:r,showLogicOperator:t!==n.length-1,onAddEmptyGroup:o,"data-reltio-id":`reltio-search-advansed-search-group-builder-${t}`}))),ip().createElement("div",{className:n.button},ip().createElement("div",{className:up()(n.verticalOperatorLine,n.upperLine)}),ip().createElement(Gh(),{onClick:o,color:"primary",size:"small","data-reltio-id":"reltio-search-advanced-search-add-set-button"},ip().createElement(zH(),{color:"primary",className:n.icon,fontSize:"small"}),ei().text("ADD SET")))))};OW.propTypes={groups:lp().array,dispatch:lp().func,uiConfigShowSearchByOv:lp().bool};const SW=(0,sp.connect)((e=>({groups:(0,Hi.go)(e),uiConfigShowSearchByOv:A().selectors.getShowSearchByOv(e)??(0,Ti.cC)(e)})))(OW),xW=w.search.actions.updateState({}),CW=({open:e,onClose:t})=>{const r=(0,sp.useDispatch)(),n=(0,ap.useCallback)((()=>{t(),r(xW)}),[r,t]),a=(0,ap.useCallback)((()=>{t(),r(ci(!0,xW))}),[r,t]),i=(0,sp.useSelector)(co.LA),o=(0,sp.useSelector)(Xa.ai),l=(0,sp.useSelector)(co.WH),s=(0,sp.useSelector)(co.Jv),c=i?s&&!l:!o;return ip().createElement(VB.U,{open:e,title:ei().text("Search filters cannot be displayed in Quick filters"),content:ei().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:ei().text("Clear search"),saveCaption:ei().text("Save search"),disabledSave:c,onCancel:t,onDiscard:n,onSave:a})};CW.propTypes={open:lp().bool,onClose:lp().func};const wW=CW,AW=(0,sp.connect)((e=>({metadata:A().selectors.getMetadata(e),attributesPresentation:A().selectors.getAttributesPresentation(e),groups:(0,Hi.go)(e),lookups:A().selectors.getLookups(e),keyword:A().selectors.getSearchKeyword(e),map:(0,Xa.vH)(e),dataTenants:A().selectors.getDataTenants(e)})))((({metadata:e,attributesPresentation:t,lookups:r,groups:n,keyword:a,map:i,onClose:o,collapsed:l,isFullscreen:s,onCollapse:c,onExpand:u,onFullscreen:p,dataTenants:d,dispatch:m})=>{const f=TW(),[y,g]=(0,ap.useState)(!1),h=(0,O.ifElse)((0,O.always)(ka(e,n,d)),(0,O.pipe)(o,u),(()=>g(!0)));return ip().createElement("div",{className:f.container},ip().createElement(OH,{onBackBtnClick:h}),ip().createElement(SW,null),ip().createElement(VH,{groups:n,lookups:r,dispatch:m,metadata:e,attributesPresentation:t,hasMinSize:l,collapseBtnActive:!l,isFullscreen:s,onCollapseBtnClick:l?u:c,onFullScreenBtnClick:s?u:p,keyword:a,map:i}),ip().createElement(wW,{open:y,onClose:()=>g(!1)}))})),RW=({isOpenAdvancedSearch:e,onCloseAdvancedSearch:t})=>{const r=eE(),[n,a]=(0,ap.useState)(!1),[i,o]=(0,ap.useState)("50%"),l=(0,ap.useCallback)((()=>{a(!0),o("120px")}),[]),s=(0,ap.useCallback)((()=>{a(!1),o("50%")}),[]),c=(0,ap.useCallback)((({percentageSize:e,isMaxSize:t,isMinSize:r})=>{a(r),o(t?-53:e)}),[]),u=(0,ap.useCallback)((()=>{a(!1),o(-53)}),[]),p=ip().createElement(ip().Fragment,null,ip().createElement(bH,null),ip().createElement(Cf(),{className:r.divider})),d=ip().createElement(ip().Fragment,null,p,ip().createElement(AW,{collapsed:n,isFullscreen:-53===i,onClose:t,onCollapse:l,onExpand:s,onFullscreen:u}));return ip().createElement(lE,{className:r.resizablePanesWrapper,orientation:"horizontal",size:e?i:0,minSize:120,maxSize:-53,allowResize:e,onChange:c},ip().createElement("div",{className:r.pane},e&&d),ip().createElement("div",{className:r.pane},!e&&p,ip().createElement(yV,null)))};RW.propTypes={isOpenAdvancedSearch:lp().bool,onCloseAdvancedSearch:lp().func};const _W=RW;function IW(){return IW=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},IW.apply(null,arguments)}const NW=e=>ip().createElement("svg",IW({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgTenant"},e),ip().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"})),PW=(0,Sp.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)"}}))),DW=({className:e})=>{const t=PW(),r=(0,Uf.xz)(),n=(0,Uf.fN)(),a=`${r}${n?" - "+n.toUpperCase():""}`;return ip().createElement("div",{className:up()(t.labelWrapper,e)},ip().createElement(NW,{className:t.tenantIcon,"data-reltio-id":"reltio-tenant-icon"}),ip().createElement(hf(),{className:t.tenantLabel},a))},kW=(0,Sp.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)"}}))),LW=()=>{const e=kW(),t=(0,sp.useSelector)(A().selectors.getMetadata),r=(0,sp.useSelector)(Bc),n=(0,sp.useSelector)(Mc),a=(0,sp.useSelector)(Jc),i=(0,sp.useSelector)(Xa.hX),o=(0,sp.useSelector)(eu),l=(0,sp.useSelector)(Xc),s=(0,v.getEntityTypeLabel)(t,{type:r}),c=(0,sp.useSelector)(Qc),u=(0,sp.useDispatch)(),p=(()=>{const e=(0,sp.useSelector)(A().selectors.getMetadata),t=(0,sp.useSelector)(A().selectors.getLookups),r=(0,sp.useSelector)(A().selectors.getAttributesPresentation),n=(0,sp.useSelector)(Hi.go),a=(0,sp.useSelector)(A().selectors.getSearchKeyword),i=(0,sp.useSelector)(Xa.vH),o=(0,sp.useSelector)(A().selectors.getDataTenants),l=(0,sp.useSelector)(C.X0),s=(0,sp.useSelector)(C.Mp),c=(0,ap.useMemo)((()=>Object.values((0,Ia.t8)(l,s))),[l,s]);return(0,ap.useMemo)((()=>{const l=(0,O.isEmpty)(n)?(0,Go.h)(e,o,c):n;return(e=>!(1===e.length&&(0,O.isEmpty)(e[0].attributes)&&1===e[0].entityTypes.length))(l)||i||a?(0,v.buildReadableQuery)(e,r,t,l,a,i):[]}),[a,i,e,o,r,n,c,t])})();(0,ap.useEffect)((()=>{0!==i&&(a&&o>=i||!a&&o<=0)&&u(nc())}),[a,i,o,u]);const d=(0,ap.useCallback)((e=>u(((e,t)=>({type:In,payload:{filterText:e,debounceTime:t}}))(e,B.XU))),[u]);return ip().createElement(ip().Fragment,null,ip().createElement(EF(),{className:up()(e.container,{[e.borderBottom]:n>0})},ip().createElement(hf(),{component:"span",className:e.entityTypeTitle},s),ip().createElement(Cf(),{orientation:"vertical",className:e.splitter}),ip().createElement(hf(),{component:"span",className:e.profileNumber},ei().number(o,"0,0")),ip().createElement(hf(),{variant:"body2",component:"span",className:e.profileText},ei().text(" profiles are selected for bulk edit.")),0===n&&ip().createElement(ip().Fragment,null,ip().createElement(Gh(),{color:"primary",className:e.clearButton,onClick:()=>{u(nc())},"data-reltio-id":"reltio-search-bulk-update-"+(a?"select-all-profiles":"clear-selection")},a?`${ei().text("Select all")} ${ei().number(i,"0,0")} ${ei().text("profiles")}`:ei().text("Clear selection")),ip().createElement(_p,{classes:{root:e.searchBox},value:c,onSearch:d,"data-reltio-id":"reltio-search-bulk-update-search-input"}),ip().createElement(Cf(),{orientation:"vertical",className:e.splitter}),ip().createElement(xd,{entityTypeUri:r,headColumns:l,onSelectColumns:e=>{const t=(0,vi.tU)(e,l);u(oc(e)),t&&u(rc())},"data-reltio-id":"reltio-search-bulk-update-add-remove-columns"}))),0===n&&!(0,O.isEmpty)(p)&&ip().createElement(EF(),{className:e.searchQueryContainer},ei().text("Search query"),ip().createElement(CH,{readableQuery:p,className:e.searchQuery})))};function UW(){return UW=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},UW.apply(null,arguments)}const jW=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return ip().createElement("svg",UW({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),ip().createElement("defs",null,ip().createElement("path",{id:"svg3533951039a",d:"M15 6v5l2 2v2h-4v4l-.992 1L11 19v-4H7v-2l2-2V6H8V4h8v2z"})),ip().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},ip().createElement("mask",{id:"svg3533951039b",fill:"#fff"},ip().createElement("use",{xlinkHref:"#svg3533951039a"})),ip().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg3533951039b)",d:"M0 0h24v24H0z"})))};function FW(){return FW=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},FW.apply(null,arguments)}const MW=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return ip().createElement("svg",FW({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),ip().createElement("defs",null,ip().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"})),ip().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},ip().createElement("mask",{id:"svg1464898421b",fill:"#fff"},ip().createElement("use",{xlinkHref:"#svg1464898421a"})),ip().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg1464898421b)",d:"M0 0h24v24H0z"})))},VW=(0,Sp.Z)({editor:{marginBottom:0},editorValue:{width:"100%",marginRight:"8px"}}),BW=({valueProperty:e,emptyEditorValue:t,attributeType:r,value:n,fieldName:a,onChangeValue:i})=>{const o=VW(),l=!r.uri,s=(0,O.pipe)((0,O.ifElse)((0,O.has)("lookupCode"),O.identity,(0,O.objOf)("value")),(0,O.filter)((e=>void 0!==e)),(0,O.mergeRight)(t))(n);return(0,ap.useEffect)((()=>{(0,v.isLookupAttrType)(r)||""===t.value||i(e)(t)}),[]),l?ip().createElement("div",{key:e,className:up()(o.editor,o.editorValue),"data-reltio-id":"bulk-update-special-attribute-change-editor"},ip().createElement(Xk.Z,{fieldName:a,value:n,dataTypeDefinition:(0,v.getAttrDataTypeDefinition)(r),onChange:(0,O.pipe)((0,O.objOf)("value"),i(e)),fullWidth:!0})):ip().createElement(AL,{key:e,className:o.editor,mode:v.Mode.Editing,attributeType:r,attributeValue:s,onChangeAttribute:i(e)})},zW={flex:"0 0 auto"},HW=(0,Sp.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:zW,type_Boolean:zW,type_Date:zW}),YW=(0,ap.memo)((({id:e,groupId:t,operation:r,operationParameters:n})=>{const a=HW(),i=(0,sp.useDispatch)(),{attributeType:o,fieldName:l}=n.attributeTypeData,s=(0,ap.useMemo)((()=>(0,v.createNewAttribute)({parentUri:"entities/fakeEntity",attributeType:o})),[o]),c=(0,ap.useCallback)((r=>n=>{const{value:a}=n,l=""===a&&(0,v.isLookupAttrType)(o)?{lookupCode:"",value:""}:a;i(uc({id:e,groupId:t,operationParameters:{[r]:l}}))}),[e,t,o,i]),u=Lc(r).map((e=>ip().createElement(BW,{key:e,valueProperty:e,value:n[e],emptyEditorValue:s,fieldName:l,attributeType:o,onChangeValue:c})));if(!u.length)return null;const p=ip().createElement("div",{key:"to",className:a.to},ei().text("with"));return ip().createElement("div",{className:up()(a.container,a[`type_${o.type}`],{[a.singleEditor]:1===u.length})},2===u.length?(0,O.insert)(1,p,u):u)}));YW.displayName="ChangeEditor";const WW=(0,Sp.Z)((()=>({entitySelector:{marginTop:"10px",width:"100%",maxWidth:"452px"},label:{"&:not($labelShrink)":{transform:"translate(12px, 10px)"}},labelShrink:{}}))),GW=({attributeType:e,value:t,onChange:r})=>{const n=WW(),a=(0,sp.useDispatch)(),i=(0,sp.useSelector)(A().selectors.getMetadata),o=(0,sp.useSelector)((e=>A().selectors.getGlobalSearchRequestOptions(e,["ovOnly"]))),l=v.Mode.Editing,s=null==t?void 0:t.entityUri,c=(0,v.getReferencedEntityTypeUriFromAttrType)(e),u=(0,ap.useCallback)((t=>(0,v.referencedEntityAttributeTypesSelectionStrategy)(e,t)),[e]),p=(0,ap.useCallback)((e=>{const{uri:t,type:n,label:i}=e;(0,v.isTempUri)(s)&&a(w.profile.modifiedEntities.actions.entityDeleted(s)),r((0,O.isEmpty)(e)?null:{entityUri:t,entityType:n,entityLabel:i})}),[a,r,s]),d=(0,ap.useCallback)(((e,t)=>{const r=(0,v.getEntityType)(i,c),n=(0,O.pipe)(u,(0,v.getCreatableAttributeTypes)(l))(r),o=(0,v.createTemporaryEntity)({entityTypeUri:e,initValue:t,attributeTypes:n,metadata:i,mode:l});p(o),a(w.profile.modifiedEntities.actions.entityCreated(o))}),[a,p,u,i,l,c]);return ip().createElement(wU,{className:n.entitySelector,entity:t,entityTypesUris:(0,Ka.l0)(c),metadata:i,globalSearchRequestOptions:o,onChange:p,onCreate:d,height:40,disableLinkClick:!0,attributeTypesSelectionStrategy:u,mode:l,TextFieldProps:{InputLabelProps:{classes:{root:n.label,shrink:n.labelShrink}}}})},qW=e=>(0,O.last)(e.type.split("/")),ZW=e=>({attributes:{[qW(e)]:[e]}}),$W=(e,t)=>{const r=qW(e);return t.attributes[r][0]},KW=({attributeValue:e,onChange:t})=>{const r=(0,ap.useRef)(e);r.current=e;return{onChangeAttribute:(0,ap.useCallback)((({value:e,attributeType:n,uri:a})=>{const i=ZW(r.current),o=(0,v.editAttribute)({entity:i,attributeType:n,uri:a,value:e});t($W(r.current,o))}),[t]),onDeleteAttribute:(0,ap.useCallback)((({attributeType:e,uri:n})=>{const a=ZW(r.current),i=(0,v.removeAttribute)({entity:a,attributeType:e,uri:n});t($W(r.current,i))}),[t]),onAddAttributes:(0,ap.useCallback)((e=>{const n=ZW(r.current),a=e.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:a}=t;return(0,v.addAttribute)({entity:e,attributeType:r,parentUri:n,index:a})}),n);t($W(r.current,a))}),[t]),onTogglePin:(0,ap.useCallback)((e=>{const n=(({parentAttributeValue:e,uri:t})=>{const r=t.split(e.uri+"/")[1].split("/"),n=[];for(;r.length;){n.push("value");const t=r.shift(),a=r.shift();n.push(t);const i=(0,O.view)((0,O.lensPath)(n),e);if(!i)return null;const o=i.findIndex((({uri:e})=>e.endsWith("/"+a)));n.push(o)}return n.length?(n.push("pin"),(0,O.over)((0,O.lensPath)(n),O.not,e)):null})({parentAttributeValue:r.current,uri:e});n&&t(n)}),[t])}},XW=(0,Sp.Z)((e=>({pinIcon:{marginRight:"-8px"},pinIconActive:{"& svg > g > path":{fill:e.palette.primary.main,fillOpacity:1}}}))),QW=({onTogglePin:e,subAttributeValue:t})=>{const r=XW();return ip().createElement(gd.k,{icon:jW,onClick:()=>e(t.uri),size:"L",className:up()(r.pinIcon,t.pin&&r.pinIconActive)})},JW=(0,O.curry)(((e,t,{attributeValue:r})=>r.uri===e?null:ip().createElement(QW,{onTogglePin:t,subAttributeValue:r})));function eG(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const tG=({attributeType:e,attributeValue:t,onChange:r})=>{const n=(0,sp.useSelector)(A().selectors.getMetadata),a=(0,ap.useMemo)((()=>{const t=(0,v.getAttributeTypeSubAttributes)(n,e),r=(0,v.createNewAttribute)({parentUri:"entities/fakeEntity",attributeType: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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){eG(e,t,r[t])}))}return e}({},r,{value:(0,v.createDefaultValues)({attributeTypes:t,parentUri:r.uri,metadata:n,mode:v.Mode.Editing})})}),[e,n]),i=t||a,{onChangeAttribute:o,onDeleteAttribute:l,onAddAttributes:s,onTogglePin:c}=KW({attributeValue:i,onChange:r}),u=(0,ap.useCallback)(JW(i.uri,c),[i.uri,c]);return ip().createElement(FL,{attributeType:e,attributeValue:i,showEmptyEditors:!0,mode:v.Mode.Editing,metadata:n,onAddAttributes:s,onDeleteAttribute:l,onChangeAttribute:o,hideDeleteButton:!0,additionalControlsRenderer:u})};function rG(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const nG=({attributeType:e,attributeValue:t,onChange:r})=>{const n=(0,sp.useSelector)(A().selectors.getMetadata),a=(0,ap.useMemo)((()=>{const t=(0,v.getEditableAttributeTypeSubAttributes)(n,e),r=(0,v.createNewAttribute)({parentUri:"entities/fakeEntity",attributeType: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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){rG(e,t,r[t])}))}return e}({},r,{value:(0,v.createDefaultValues)({attributeTypes:t,parentUri:r.uri,metadata:n,mode:v.Mode.Editing})})}),[e,n]),i=t||a,{onChangeAttribute:o,onDeleteAttribute:l,onAddAttributes:s,onTogglePin:c}=KW({attributeValue:i,onChange:r}),u=(0,ap.useCallback)(JW(i.uri,c),[i.uri,c]);return ip().createElement(IU,{attributeType:e,attributeValue:i,showEmptyEditors:!0,mode:v.Mode.Editing,metadata:n,onAddAttributes:s,onDeleteAttribute:l,onChangeAttribute:o,hideDeleteButton:!0,additionalControlsRenderer:u})},aG=({operation:e,attributeType:t,attributeValue:r,onChange:n})=>e===$n.d.RepointReference?ip().createElement(GW,{attributeType:t,value:r,onChange:n}):(0,v.isNested)(t)?ip().createElement(tG,{attributeType:t,attributeValue:r,onChange:n}):(0,v.isReference)(t)?ip().createElement(nG,{attributeType:t,attributeValue:r,onChange:n}):null,iG=(0,O.curry)(((e,t,r)=>(0,O.assoc)(t,(0,O.prop)(e,r),(0,O.dissoc)(e,r)))),oG=(0,O.pipe)((0,O.pick)(["fieldName","title","pathToTitle","attrType"]),iG("attrType","attributeType")),lG=(0,O.unless)(O.isNil,iG("attributeType","attrType")),sG="1px solid #e4e4e4",cG=(0,Sp.Z)((e=>({mainRowContent:{display:"flex",alignItems:"center","&>*":{marginRight:8}},row:{borderBottom:sG,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}}}))),uG={enabled:!0,queueSizeThreshold:5},pG=({id:e,operation:t,operationParameters:r,groupId:n,groupAttributeType:a,hasConditions:i})=>{const o=cG(),l=(0,sp.useDispatch)(),s=(0,sp.useSelector)(Bc),c=(0,Ka.l0)(s),{pin:u,addNestedAttribute:p,attributeTypeData:d}=r||{},{attributeType:m}=d||{},f=t&&d,y=(0,ap.useCallback)((({attribute:t,checked:r})=>{r&&l((({id:e,groupId:t,attribute:r})=>({type:kn,payload:{id:e,groupId:t,attribute:r}}))({id:e,groupId:n,attribute:oG(t)}))}),[e,n,l]),g=(0,ap.useCallback)((t=>{l(uc({id:e,groupId:n,operationParameters:{attributeValue:t}}))}),[l,e,n]),h=(0,ap.useCallback)((()=>{l((({id:e,groupId:t})=>({type:Wn,payload:{id:e,groupId:t}}))({id:e,groupId:n}))}),[e,n,l]),E=(0,ap.useCallback)((()=>{l((({id:e,groupId:t})=>({type:Gn,payload:{id:e,groupId:t}}))({id:e,groupId:n}))}),[e,n,l]),b=(0,ap.useCallback)((()=>{l(cc({id:e,groupId:n}))}),[e,n,l]),T=(0,ap.useCallback)((t=>{l((({id:e,groupId:t,operation:r})=>({type:Ln,payload:{id:e,groupId:t,operation:r}}))({id:e,groupId:n,operation:t.value}))}),[e,n,l]),S=(0,v.isComplexAttribute)(m)&&[$n.d.AddNew,$n.d.ReplaceAllWith,$n.d.RepointReference].includes(t),x=[$n.d.AddNew,$n.d.ReplaceAllWith,$n.d.FindAndReplace].includes(t)&&!(null==m||!m.uri),C=a&&m&&m.uri===a.uri,w=n&&!C&&t===$n.d.AddNew&&!(0,v.isReference)(a),A=(0,ap.useMemo)((()=>{return m?(e=m,t=i&&C,(0,O.cond)([[(0,O.both)(v.isNested,(0,O.always)(t)),(0,O.always)((0,O.without)([$n.d.AddNew,$n.d.ReplaceAllWith],B.DY))],[v.isNested,(0,O.always)(B.DY)],[(0,O.both)(v.isReference,(0,O.always)(t)),(0,O.always)((0,O.without)([$n.d.AddNew],B.hS))],[v.isReference,(0,O.always)(B.hS)],[O.T,(0,O.always)(B.pG)]])(e)).map((e=>({value:$n.d[e],label:B.WN[e]}))):[];var e,t}),[i,m,C]),R=(0,ap.useMemo)((()=>A.find((e=>e.value===t))),[t,A]),_=(0,ap.useMemo)((()=>lG(d)),[d]),I=(0,ap.useCallback)(a?(0,YY.xM)(a):(0,O.ifElse)(YY.XF,(0,O.pipe)((0,O.pathEq)(["fieldName"],"tags")),(0,O.pipe)((0,O.prop)("attrType"),(0,O.both)((0,O.complement)(v.isImage),(0,O.complement)(v.isAnalyticAttribute)))),[a]),N=(0,ap.useCallback)((e=>(0,v.getSearchGroupAttributeLabel)({data:e})),[]);return(0,ap.useEffect)((()=>{!R&&A[0]&&d&&T(A[0])}),[A,R,d,T]),(0,ap.useEffect)((()=>{u&&!x&&h()}),[x,u,h]),(0,ap.useEffect)((()=>{p&&!w&&E()}),[w,p,E]),ip().createElement("div",{"data-reltio-id":"bulk-update-dialog-action-row",className:up()(o.row,{[o.withoutLine]:!!n})},ip().createElement("div",{className:o.mainRowContent},ip().createElement(qY,{className:o.attrSelector,single:!0,showReferencedEntityAttributes:!1,entityTypes:c,value:_,onSelect:y,firstLevelAttributesFilter:I,ungroup:!!n,getLabel:N}),ip().createElement(aj,{label:"",isDisabled:!_,placeholder:ei().text("Select operation"),className:o.operationSelector,value:R,options:A,height:40,onChange:T}),f&&ip().createElement(ip().Fragment,null,!S&&ip().createElement(YW,{id:e,groupId:n,operation:t,operationParameters:r}),ip().createElement("div",{className:o.icons},x&&ip().createElement(gd.k,{className:up()(o.actionIcon,{[o.actionIconActive]:u}),size:"M",tooltipTitle:ei().text("Make this Operational Value"),icon:jW,onClick:h}),w&&ip().createElement(gd.k,{className:up()(o.actionIcon,{[o.actionIconActive]:p}),size:"M",tooltipTitle:ei().text("Create parent attribute if none exists"),icon:MW,onClick:E}),ip().createElement(gd.k,{size:"M",tooltipTitle:ei().text("Delete"),icon:Ep(),onClick:b})))),f&&S&&ip().createElement(uL.Provider,{value:uG},ip().createElement(aG,{operation:t,attributeType:m,attributeValue:r.attributeValue,onChange:g})))},dG=(0,ap.memo)(pG);var mG=r(80510),fG=r.n(mG);function yG(){return yG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},yG.apply(null,arguments)}const gG=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeType","showReferencedEntityAttributes","subattributesGroupTitle","additionalItemsGroups"]);const o=(0,sp.useSelector)(A().selectors.getMetadata),l=t.uri.split("/").slice(0,3).join("/"),s=(0,Ka.l0)(l),c=(0,ap.useCallback)((0,YY.xM)(t),[t]),u=(0,ap.useMemo)((()=>(0,O.pipe)(YY.s1,(0,O.when)((0,O.always)(!r),YY.a),(0,O.map)((0,O.evolve)({attributes:(0,O.pathOr)([],[0,"children"]),title:(0,O.when)((0,O.always)(n),(0,O.always)(n))})),(0,O.when)((0,O.always)(a),(0,O.concat)(a)))({firstLevelAttributesFilter:c},o,s)),[a,n,r,s,o,c]);return ip().createElement(HY,yG({},i,{ungroup:!a,itemsGroups:u}))},hG=(0,ap.memo)(gG);function EG(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){bG(e,t,r[t])}))}return e}function bG(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const vG=(e,t)=>(0,Da.nT)(`${B.E_}_group`,ei().text("Profile"),[EG({},(0,Da.o)(EG({title:(0,v.getEntityTypeLabel)(t,{type:(0,v.getReferencedEntityTypeUriFromAttrType)(e)}),fieldName:B.E_},e)),{enforcedFilterOptions:[v.FilterOptions.EQUALS]})]),TG=(0,Sp.Z)({selector:{width:"254px",height:"40px"}}),OG=(0,ap.memo)((({rowData:e,rowContext:{attributeType:t,dispatchGroupAction:r},attributeSelectorProps:n={}})=>{const a=TG(),i=(0,sp.useSelector)(A().selectors.getMetadata),o=e&&e.id,l=(0,ap.useMemo)((()=>(0,v.isReference)(t)?[vG(t,i)]:null),[t,i]),s=(0,ap.useCallback)((e=>{r(fc,o,e)}),[o,r]);return ip().createElement(hG,{className:a.selector,value:e&&e.data,attributeType:t,additionalItemsGroups:l,subattributesGroupTitle:(0,v.isReference)(t)?ei().text("Reference attributes"):"",onSelect:s,onRestoreFocus:n.onRestoreFocus,onOpenPopup:n.onOpen,disableRestoreFocus:n.disablePopoverRestoreFocus,disableEnforceFocus:n.disablePopoverRestoreFocus})}));OG.displayName="ConditionAttributeSelector";const SG=e=>!(e&&e.data),xG=(0,O.pathEq)(["data","fieldName"],B.E_),CG=(0,Sp.Z)({selector:{width:"190px"}}),wG=(0,ap.memo)((({rowData:e,rowContext:{dispatchGroupAction:t},textFieldInputRef:r})=>{const n=CG(),a=e&&e.id,i=(0,ap.useCallback)((e=>t(gc,a,e.value)),[t,a]);return ip().createElement(nW,{height:40,className:n.selector,attribute:e,textFieldInputRef:r,isDisabled:SG(e),onChange:i})}));wG.displayName="ConditionFilterSelector";const AG=(0,Sp.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:{}}),RG=(0,ap.memo)((({condition:e,dispatchGroupAction:t})=>{const{values:r=[],data:{attrType:n,fieldName:a}={},filter:i}=e,o=AG(),l=(0,sp.useSelector)(A().selectors.getMetadata),s=(0,sp.useSelector)((e=>A().selectors.getGlobalSearchRequestOptions(e,["ovOnly"]))),c=(0,ap.useCallback)((r=>t(hc,e.id,r)),[t,e.id]),u=(0,ap.useCallback)((({uri:e,type:t,label:r})=>{c([{entityUri:e,entityType:t,entityLabel:r}])}),[c]),p=(0,v.getAttrDataTypeDefinition)(n),d=(0,v.getDataTypeDefinitionForFilterValue)(p,i);return xG(e)?ip().createElement(wU,{className:o.entitySelector,entity:r[0],entityTypesUris:(0,Ka.l0)((0,v.getReferencedEntityTypeUriFromAttrType)(n)),metadata:l,mode:v.Mode.Editing,globalSearchRequestOptions:s,onChange:u,height:40,disableLinkClick:!0,TextFieldProps:{InputLabelProps:{classes:{root:o.entitySelectorLabel,shrink:o.entitySelectorLabelShrink}}}}):ip().createElement(oW.n,{filter:{filter:i,fieldName:a,values:r||[]},onChange:c,dataTypeDefinition:d,fullWidth:!0,TextFieldProps:{InputProps:{classes:{root:o.input}}},color:"primary",classes:{root:o.root},orientation:"horizontal"})}));RG.displayName="ConditionValuesEditor";const _G=(0,Sp.Z)({root:{width:"100%",display:"flex",minHeight:"40px",alignItems:"flex-start",boxSizing:"border-box"}}),IG=(0,ap.memo)((({rowData:e,rowContext:{dispatchGroupAction:t}})=>{const r=_G(),n=SG(e),a=e&&(0,v.checkIfOptionHasValues)(e.filter);return ip().createElement("div",{className:r.root},!n&&a&&ip().createElement(RG,{condition:e,dispatchGroupAction:t}))}));IG.displayName="ConditionValuesEditorWrapper";const NG=(0,Sp.Z)({root:{paddingTop:"8px",height:"24px",display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:"0"}}),PG=(0,ap.memo)((({rowData:e,rowContext:{dispatchGroupAction:t}})=>{const r=NG(),n=e&&e.id,a=(0,ap.useCallback)((()=>t(yc,n)),[n,t]);return e?ip().createElement("div",{className:r.root},ip().createElement(gd.k,{tooltipTitle:ei().text("Delete"),tooltipPlacement:"bottom",icon:Ep(),size:"M",onClick:a})):null}));PG.displayName="ConditionActions";const DG=(0,Sp.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"}}))),kG=({attributeType:e,conditions:t,groupId:r})=>{const n=DG(),a=(0,sp.useDispatch)(),i=(0,ap.useCallback)(((e,...t)=>a(e(r,...t))),[r,a]),o=(0,ap.useMemo)((()=>({root:n.row,logicOperatorContainer:n.logicOperatorContainer,actionsContainer:n.actions})),[n]);return ip().createElement(ip().Fragment,null,ip().createElement(hf(),{variant:"caption",component:"div",className:n.caption},ei().text("If the following conditions are met")),ip().createElement(QH,{className:n.conditions,rowClasses:o,rowsData:t,AttributeSelectorComponent:OG,FilterSelectorComponent:wG,ValuesEditorComponent:IG,ActionsComponent:PG,attributeType:e,dispatchGroupAction:i}),ip().createElement(hf(),{variant:"caption",component:"div",className:n.caption},ei().text("Then perform the change")))},LG=(0,Sp.Z)((e=>({complexRow:{borderBottom:sG,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 UG(){return UG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},UG.apply(null,arguments)}const jG=(0,ap.memo)((({id:e,fieldName:t,actions:r,conditions:n})=>{const a=LG(),i=(0,sp.useDispatch)(),o=(0,sp.useSelector)(Bc),l=(0,sp.useSelector)(A().selectors.getMetadata),s=(0,ap.useMemo)((()=>{const e=(0,v.searchUriToAttrUri)(t,o);return(0,v.findAttributeTypeByUri)(l,e,o)}),[l,t,o]),c=!!n,u=((e,t)=>(0,O.any)((0,O.both)((0,O.pipe)((0,O.prop)("operation"),(0,O.includes)(O.__,[$n.d.AddNew,$n.d.ReplaceAllWith])),(0,O.pathEq)(["operationParameters","attributeTypeData","attributeType","uri"],t.uri)))(e))(r,s),p=(0,ap.useCallback)((()=>i({type:Fn,payload:e})),[e,i]),d=(t={})=>ip().createElement(dG,UG({key:t.id},t,{groupId:e,groupAttributeType:s,hasConditions:c}));return(0,ap.useEffect)((()=>{c||0!==r.length||i(cc({id:e,groupId:void 0}))}),[e,c,r.length,i]),ip().createElement("div",{className:a.complexRow},ip().createElement("div",{className:a.header},ip().createElement("div",{className:a.attributeLabel},s.label),ip().createElement(Gh(),{disabled:u,color:"primary",className:a.conditionsToggleButton,onClick:p},c?ip().createElement(ip().Fragment,null,ip().createElement(fG(),{className:a.conditionsToggleIcon}),ei().text("Remove")," "):ip().createElement(ip().Fragment,null,ip().createElement(zH(),{className:a.conditionsToggleIcon}),ei().text("Add")," "),ei().text("conditions"))),n&&ip().createElement(kG,{attributeType:s,conditions:n,groupId:e}),ip().createElement("div",{className:a.actionsBlock},r.map(d),d()))}));jG.displayName="ComplexActionRow";const FG=(0,Sp.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 MG(){return MG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},MG.apply(null,arguments)}const VG=e=>"actions"in e?ip().createElement(jG,MG({key:e.id},e)):ip().createElement(dG,MG({key:e.id},e)),BG=()=>{const e=FG(),t=(0,sp.useSelector)(ru);return ip().createElement("div",{className:e.wrapper},ip().createElement("div",{className:e.container},t.map(VG),ip().createElement(dG,null)))};var zG=r(99261),HG=r.n(zG),YG=r(26518),WG=r.n(YG),GG=r(60158),qG=r.n(GG),ZG=r(61887),$G=r.n(ZG);const KG=(0,Sp.Z)((()=>({buttonWrapper:{position:"relative"},progress:{position:"absolute",left:"calc(50% - 12px)",top:"calc(50% - 12px)"}})));function XG(){return XG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},XG.apply(null,arguments)}const QG=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["isInProgress","disabled","circularColor","className","children"]);const l=KG();return ip().createElement(Gh(),XG({},o,{className:up()(l.buttonWrapper,a),disabled:r||t}),i,t&&ip().createElement("div",{className:l.progress,"data-reltio-id":"reltio-circular-load-indicator"},ip().createElement(um(),{size:24,color:n})))},JG=(0,Sp.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"}}))),eq=({activeStep:e,steps:t,isPending:r=!1,shouldCompleteSteps:n=!0,onConfirm:a,onChangeStep:i})=>{const o=JG(),l=e===t.length-1,s=t=>{t!==e&&i(t)},c=(0,O.propOr)(!0,"enabled"),u=e=>{if(e>0){const r=e-1;c(t[r])?s(r):u(r)}},p=e=>{if(e<t.length-1){const r=e+1;c(t[r])?s(r):p(r)}},d=l&&!!a,m=d||(0,O.any)(c,(0,O.drop)(e+1,t));return ip().createElement("div",{className:o.container},ip().createElement("div",{className:o.placeholder}),ip().createElement(HG(),{nonLinear:!0,activeStep:e,className:o.stepper},t.map((({label:t,enabled:a=!0,hasError:i,hasWarning:l},c)=>{const u=!a||r,p=n&&!u&&c<e;return ip().createElement(WG(),{key:t,completed:p,disabled:u},ip().createElement(qG(),{className:o.stepButton,onClick:()=>s(c),"data-reltio-id":`reltio-search-bulk-update-${c}`},ip().createElement($G(),{error:i||l,classes:{error:i?o.errorLabel:o.warningLabel}},t)))}))),ip().createElement("div",{className:o.buttons},e>0&&ip().createElement(Gh(),{variant:"outlined",className:o.backButton,onClick:()=>u(e),disabled:r,"data-reltio-id":"reltio-search-bulk-update-back"},ei().text("Back")),ip().createElement(QG,{variant:"contained",color:"primary",disabled:!m,isInProgress:r,onClick:l?a:()=>p(e),"data-reltio-id":"reltio-search-bulk-update-"+(l?"confirm":"continue")},d?ei().text("Confirm"):ei().text("Continue"))))},tq=()=>{const e=(0,sp.useDispatch)(),t=(0,sp.useSelector)(Mc),r=(0,sp.useSelector)(tu),n=(0,sp.useSelector)(Fc),a=!(0,O.isNil)(n),i=(0,sp.useSelector)(iu),o=(0,sp.useSelector)(ou),l=[{label:ei().text("Select profiles")},{label:ei().text("Select operation"),enabled:r},{label:ei().text("Define changes"),enabled:r&&a&&n===B.dV.UpdateProfiles},{label:ei().text("Review changes"),enabled:r&&a&&(i||n===B.dV.DeleteProfiles)}];return ip().createElement(eq,{activeStep:t,steps:l,isPending:o,onChangeStep:t=>e((e=>({type:bn,payload:e}))(t)),onConfirm:()=>e({type:qn})})},rq=(0,Sp.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"}}))),nq=({children:e,onClose:t})=>{const r=rq();return ip().createElement(gF(),{position:"static",color:"default",className:r.appBar},ip().createElement(EF(),{className:r.toolbar},ip().createElement(gd.k,{edge:"start",tooltipTitle:ei().text("Close"),"aria-label":ei().text("Close"),icon:Ep(),onClick:t,className:r.closeButton,size:"L","data-reltio-id":"reltio-search-bulk-update-close"}),ip().createElement(hf(),{variant:"h6",className:r.title},e)),ip().createElement(EF(),{className:r.toolbar},ip().createElement(tq,null)))};nq.propTypes={children:lp().node,onClose:lp().func};const aq=nq,iq=(0,Sp.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"}}))),oq=(0,O.equals)(B.v6.include);function lq(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const sq=()=>{const e=iq(),t=(0,sp.useDispatch)(),r=(0,sp.useSelector)(A().selectors.getMetadata),n=(0,sp.useSelector)(Bc),a=(0,sp.useSelector)(Xc),i=(0,sp.useSelector)(Wc),o=(0,sp.useSelector)($c),l=(0,sp.useSelector)(Kc),s=(0,sp.useSelector)(Hc),c=(0,sp.useSelector)(qc),u=(0,sp.useSelector)(Zc),p=(0,sp.useSelector)(Vc),d=(0,sp.useSelector)(Gc),m=(0,sp.useSelector)(Yc),f=(0,ap.useMemo)((()=>((e,t,r)=>(0,O.pipe)((0,O.map)((0,O.prop)("uri")),oq(e)?(0,O.intersection)(t):(0,O.without)(t))(r))(m,d,i)),[m,d,i]),y=((e,t)=>0!==e.length&&(e.length===t.length||null))(f,i),g=(0,ap.useMemo)((()=>(0,vi.oq)(r,n,a)),[r,n,a]),h=(0,ap.useCallback)((({field:e,order:r})=>t((({field:e,order:t})=>({type:An,payload:{field:e,order:t}}))({field:r?e:null,order:r}))),[t]),E=(0,ap.useCallback)((({what:e,where:r})=>{const n=(0,O.move)(e.columnIndex,r.columnIndex,a);t(oc(n))}),[t,a]),b=(0,ap.useCallback)((({columns:e})=>{const r=(0,vi.tU)(e,a);t(oc(e)),r&&t(rc())}),[t,a]),v=(0,ap.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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){lq(e,t,r[t])}))}return e}({},t,{size:e[r].size})));t(oc(r))}),[t,a]),T=(0,ap.useCallback)(((e,r)=>{t(e?((e,t)=>({type:On,payload:{uri:e,checked:t}}))(e,r):{type:Sn,payload:!y})}),[y,t]),S=(0,ap.useRef)(null);return ip().createElement("div",{className:e.tableContainer},p&&ip().createElement(wE.z,null),ip().createElement(nf,{entities:i,entityTypeUri:n,headColumns:a,additionalColumns:g,canCheck:!0,onCheck:T,checkedEntitiesUris:f,headerCheckboxState:y,dndColumnReorderingEnabled:!0,sortField:o,sortOrder:l,onSort:h,onReorderingColumn:E,onChangeColumnsList:b,onChangeColumnsSize:v,entitiesTableRef:S}),s>B.Tu[0]&&ip().createElement("div",{className:e.pagination},ip().createElement(gE.Z,{count:s,rowsPerPageOptions:B.Tu,rowsPerPage:u||B.Tu[0],page:c||0,onChangePage:e=>t(ic(e)),onChangeRowsPerPage:e=>t((e=>({type:Cn,payload:e}))(e)),basicTableRef:S})))},cq=(0,Sp.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"}}))),uq=()=>{const e=cq(),t=(0,sp.useDispatch)(),r=(0,sp.useSelector)(Fc),n=(0,sp.useSelector)(A().selectors.getCanUserDeleteProfiles);(0,ap.useEffect)((()=>{(0,O.isNil)(r)&&t(sc(B.dV.UpdateProfiles))}),[r,t]);const a=(0,O.pipe)(Tp.NA,sc,t);return ip().createElement("div",{className:e.tableContainer},ip().createElement(hf(),{className:e.title},ei().text("Choose Bulk Update Operation")),ip().createElement(Eh(),{value:r,onChange:a},ip().createElement(vh(),{classes:{label:e.label},value:B.dV.UpdateProfiles,control:ip().createElement(gh(),{className:e.radioButton}),label:ei().text("Update Profiles - Update attribute values of selected profiles")}),ip().createElement(vh(),{disabled:!n,classes:{label:e.label},value:B.dV.DeleteProfiles,control:ip().createElement(gh(),{className:e.radioButton}),label:ei().text("Delete Profiles - Delete selected profiles")})))};var pq=r(49850),dq=r.n(pq),mq=r(28012),fq=r.n(mq),yq=r(18878),gq=r.n(yq),hq=r(70918),Eq=r.n(hq),bq=r(51159),vq=r.n(bq),Tq=r(35681),Oq=r.n(Tq);const Sq=({value:e,attributeType:t,lookups:r})=>((0,v.isLookupAttrType)(t)&&"string"==typeof e&&(e={lookupCode:e,value:(0,v.getResolvedLookupValue)(r,(0,v.getAttrTypeLookupCode)(t),e)}),ip().createElement(Md.x,{dataTypeDefinition:(0,v.getAttrDataTypeDefinition)(t),value:e})),xq=({operation:e})=>ip().createElement(ip().Fragment,null,B.WN[e]),Cq=({conditions:e,attributesPresentation:t,metadata:r,lookups:n})=>{if((0,v.isEmptyValue)(e))return ip().createElement(ip().Fragment,null,"-");const a=(0,v.buildAttributesReadableQuery)(r,t,n,e,!1);return ip().createElement(CH,{readableQuery:a})},wq="8px",Aq="1px",Rq="1px solid #AFD4E9",_q=(0,Sp.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:Aq,left:wq,top:0,borderLeft:Rq}},scaffoldHalfVert:{"&:before":{content:'""',position:"absolute",display:"block",boxSizing:"border-box",height:"50%",width:Aq,left:wq,top:0,borderLeft:Rq}},scaffoldHor:{"&:after":{content:'""',position:"absolute",display:"block",boxSizing:"border-box",height:Aq,width:"5px",left:wq,top:"50%",borderBottom:Rq}},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%"}}))),Iq=({attributeTypeData:{pathToTitle:e,title:t}})=>{const r=_q();return Boolean(e&&e.length>2)?ip().createElement(cg,{placement:"bottom-start",pathToTitle:e},ip().createElement("span",{className:r.nestedLabel},t)):ip().createElement(ip().Fragment,null,t)};function Nq(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function Pq(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Dq(e,t,r[t])}))}return e}function Dq(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const kq={EMPTY:"empty",FULL_VERT:"full_vert",FULL_VERT_HOR:"full_vert_hor",HALF_VERT_HOR:"half_vert_hor"},Lq=e=>e.map(((t,r)=>(({hasLowerSubAttrs:e,isFirstValue:t,isLastScaffold:r})=>{const n=r&&t;return e?n?kq.FULL_VERT_HOR:kq.FULL_VERT:n?kq.HALF_VERT_HOR:kq.EMPTY})(Pq({},t,{isLastScaffold:r===e.length-1})))),Uq=({operation:e,operationParameters:t})=>(0,v.wrapInArrayIfNeeded)(Pq({},t,{operation:e})),jq=(e,t,r=[],n=[])=>{const a=(0,v.findAttributeTypeByUri)(e,t.type),i=a.label||a.name,o={attributeTypeData:{attributeType:a,title:i,pathToTitle:[...r,i]},scaffolds:Lq(n),pin:t.pin};if((0,v.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 jq(e,t,[...r,i],[...n,s])}))));return[o,...l]}return[Pq({},o,{attributeValue:(0,v.getAttributeValue)(t)})]},Fq=(0,O.curry)(((e,{operation:t,operationParameters:r})=>{const{attributeValue:n,attributeTypeData:a}=r,i=Nq(r,["attributeValue","attributeTypeData"]),[o,...l]=jq(e,n,a.pathToTitle.slice(0,-1));return[Pq({},o,{operation:t},i),...l]})),Mq=(0,O.curry)(((e,{operation:t,operationParameters:r})=>{const{attributeValue:n,attributeTypeData:a}=r,i=Nq(r,["attributeValue","attributeTypeData"]),[o,...l]=jq(e,n,a.pathToTitle.slice(0,-1)),{label:s,refEntity:c}=n,[{objectURI:u,type:p}]=c;return[Pq({},o,{operation:t},i,{attributeValue:{entityUri:u,entityLabel:s,entityType:p}}),...l]})),Vq=(0,O.curry)(((e,t)=>(0,O.cond)([[Nc,Fq(e)],[Pc,Mq(e)],[O.T,Uq]])(t))),Bq=(0,O.curry)(((e,t)=>(0,O.pipe)((0,O.defaultTo)([]),(0,O.chain)((0,O.ifElse)(vc,(0,O.pipe)(Tc,Bq(e)),Vq(e))))(t))),zq=({scaffold:e})=>{const t=_q();return ip().createElement("div",{className:up()(t.scaffold,{[t.scaffoldFullVert]:e===kq.FULL_VERT||e===kq.FULL_VERT_HOR,[t.scaffoldHalfVert]:e===kq.HALF_VERT_HOR,[t.scaffoldHor]:e===kq.FULL_VERT_HOR||e===kq.HALF_VERT_HOR})})};zq.propTypes={scaffold:lp().oneOf((0,O.values)(kq))};const Hq=({scaffolds:e})=>{const t=_q();return ip().createElement("div",{className:t.scaffoldsContainer},e.map(((e,t)=>ip().createElement(zq,{key:t,scaffold:e}))))};Hq.propTypes={scaffolds:lp().arrayOf(zq.propTypes.scaffold)};const Yq=Hq,Wq=({children:e})=>{const t=_q();return ip().createElement("div",{className:t.noWrapContainer},e)};Wq.propTypes={children:lp().node};const Gq=Wq,qq=({pin:e,addParent:t})=>{const r=_q();return ip().createElement(Gq,null,ip().createElement("div",{className:up()(r.optionContainer,{[r.opaque]:!e})},ip().createElement(jW,null)),ip().createElement("div",{className:up()(r.optionContainer,{[r.opaque]:!t})},ip().createElement(MW,null)))};qq.propTypes={pin:lp().bool,addParent:lp().bool};const Zq=qq,$q=({entity:{entityLabel:e,entityUri:t},attributeType:r})=>{const n=_q(),a=(0,sp.useSelector)((e=>A().selectors.getModifiedEntity(e,t)))||null,i=(0,sp.useSelector)(A().selectors.getMetadata),o=(0,ap.useCallback)((()=>{const e=(0,v.getReferencedEntityTypeUriFromAttrType)(r),t=(0,v.getEntityType)(i,e);return(0,v.evaluateDeepEntityLabel)(a,t.dataLabelPattern)}),[r,i,a]),l=a?o():e;return ip().createElement(Gq,null,(0,v.getLabel)(l),(0,v.isTempUri)(t)&&ip().createElement("div",{className:n.newIcon},ei().text("New")))},Kq=(0,Sp.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%"}}))),Xq=()=>{const e=Kq(),t=(0,sp.useSelector)(nu),r=(0,sp.useSelector)(A().selectors.getMetadata),n=(0,sp.useSelector)(A().selectors.getAttributesPresentation),a=(0,sp.useSelector)(A().selectors.getLookups),i=(0,ap.useMemo)((()=>Bq(r,t)),[t,r]);return ip().createElement(Eq(),{className:e.tableContainer,component:BI()},ip().createElement(dq(),{className:e.table},ip().createElement(vq(),null,ip().createElement(Oq(),null,ip().createElement(gq(),{className:e.attributeColumn},ei().text("Attribute")),ip().createElement(gq(),{className:e.conditionColumn},ei().text("Condition")),ip().createElement(gq(),{className:e.operatorColumn},ei().text("Operator")),ip().createElement(gq(),{className:e.valueColumn,colSpan:2}),ip().createElement(gq(),{className:e.valueColumn}),ip().createElement(gq(),{className:e.optionsColumn}))),ip().createElement(fq(),null,i.map((({scaffolds:e,attributeTypeData:t,conditions:i,operation:o,attributeValueToFind:l,attributeValue:s,pin:c,addNestedAttribute:u},p)=>{const d=!(0,O.isNil)(s),m=!(0,O.isNil)(l);return ip().createElement(Oq(),{key:p},ip().createElement(gq(),null,ip().createElement(Gq,null,e&&ip().createElement(Yq,{scaffolds:e}),ip().createElement(Iq,{attributeTypeData:t}))),ip().createElement(gq(),null,ip().createElement(Cq,{attributesPresentation:n,metadata:r,lookups:a,conditions:i})),ip().createElement(gq(),null,o&&ip().createElement(xq,{operation:o})),ip().createElement(gq(),null,m&&ip().createElement(Sq,{lookups:a,attributeType:t.attributeType,value:l})),ip().createElement(gq(),{align:"right"},m&&d&&ip().createElement(Gq,null,ip().createElement("span",null,ei().text("with")))),ip().createElement(gq(),null,d&&((0,v.isReference)(t.attributeType)?ip().createElement($q,{entity:s,attributeType:t.attributeType}):ip().createElement(Sq,{lookups:a,attributeType:t.attributeType,value:s}))),ip().createElement(gq(),{align:"right"},ip().createElement(Zq,{pin:c,addParent:u})))})))))},Qq=(0,Sp.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=Qq(),t=(0,sp.useSelector)(Fc),r=(0,sp.useSelector)(eu);return t===B.dV.UpdateProfiles?ip().createElement(Xq,null):ip().createElement("div",{className:e.tableContainer},ip().createElement("div",{className:e.text},ip().createElement("p",null,`${ei().text("Please confirm that you wish to start deletion of the selected")}`,ip().createElement("b",null,` ${ei().number(r,"0,0")} `),ei().text(" profiles.")),ip().createElement("p",null,ei().text("Click on Confirm to proceed."))))},eZ=(0,Sp.Z)((()=>({contentRoot:{padding:"0 0 5px",position:"relative",backgroundColor:"#FAFAFA"},tenantLabel:{marginLeft:"23px"}}))),tZ=()=>{const e=eZ(),t=(0,sp.useSelector)(Ti.Ue),r=(0,sp.useSelector)(Mc),n=(0,sp.useDispatch)(),a=()=>n(bi(!1));return ip().createElement(Ij(),{fullScreen:!0,open:t,onClose:a,disableEnforceFocus:!0},ip().createElement(aq,{onClose:a},ei().text("Bulk update"),ip().createElement(DW,{className:e.tenantLabel})),ip().createElement(LW,null),ip().createElement(fF(),{classes:{root:e.contentRoot}},(()=>{switch(r){case 0:return ip().createElement(sq,null);case 1:return ip().createElement(uq,null);case 2:return ip().createElement(BG,null);case 3:return ip().createElement(Jq,null)}})()))},rZ="1px solid rgba(0, 0, 0, 0.33)",nZ=(0,Sp.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:rZ},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:rZ,boxShadow:"0 1px 3px 0 rgba(0,0,0,0.12)"}}))),aZ=(0,id.T)(bf()),iZ=(0,sp.connect)((e=>({isReadyAppData:!!(0,Ti.$s)(e),openAdvancedSearch:(0,Ti.IJ)(e),tenant:A().selectors.getTenant(e)})))((({openAdvancedSearch:e,isReadyAppData:t,tenant:r,dispatch:n})=>{const a=(0,ap.useCallback)((()=>{n({type:R.k.CONVERT_FROM_ADVANCED_SEARCH}),n(ui(!1))}),[n]),i=(0,ap.useCallback)((()=>{n(ui(!0)),n({type:ot})}),[n]),[o,l]=(0,ap.useState)(!0),s=(0,ap.useCallback)((e=>{l(e<=0)}),[]),c=nZ(),u=!e;return(0,ap.useEffect)((()=>()=>v.memoizeWith.clearCache()),[r]),t?ip().createElement(ip().Fragment,null,ip().createElement("div",{className:c.root},ip().createElement(yf,{variant:"persistent",anchor:"left",open:u,classes:{root:c.drawer,paper:c.drawerPaper,docked:c.docked},"data-reltio-id":"reltio-search-facet-search-panel"},ip().createElement(aZ,{tooltipTitle:ei().text("Switch to Advanced search"),tooltipPlacement:"bottom-end",variant:"extended",classes:{root:c.buttonRoot,extended:c.buttonExtended},onClick:i,"data-reltio-id":"reltio-search-advanced-search-button"},ip().createElement(Tf(),{color:"primary",className:c.menuIcon}),ip().createElement("span",{className:c.buttonLabel},ei().text("Advanced search")),ip().createElement(Sf(),{color:"action",className:c.goToActionIcon})),ip().createElement(hf(),{variant:"button",classes:{root:up()(c.quickFilterRoot,{[c.withBottomBorder]:!o})}},ei().text("Quick filters")),ip().createElement(Lh,{onScroll:s})),ip().createElement(jh,{className:up()(c.mainContent,{[c["mainContent--shifted"]]:u})},ip().createElement(_W,{isOpenAdvancedSearch:e,onCloseAdvancedSearch:a}))),ip().createElement(Vh,null),ip().createElement(Jh,null),ip().createElement(tZ,null)):null})),oZ=cf()({productionPrefix:"searchTable",disableGlobal:!0,seed:"srch"});v.userPreferencesComparator.register("searchState",((e,t)=>(0,v.looseEquals)((0,O.omit)(["query"],e),(0,O.omit)(["query"],t))));const lZ=()=>ip().createElement(af.DynamicModuleLoader,{modules:[np()]},ip().createElement(pf(),{generateClassName:oZ},ip().createElement(lf._,{dateAdapter:of.Q},ip().createElement(iZ,null))))}}]);
|