@reltio/remotes 1.4.1274 → 1.4.1276

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/4621.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"4621.js","mappings":"kPAEO,MAAMA,GAAYC,E,SAAAA,GAAW,CAChCC,aAAc,CACVC,WAAY,kBACZC,YAAa,OACbC,QAAS,OAEbC,MAAO,CACHC,KAAM,YACNJ,WAAY,OACZK,SAAU,OACVC,WAAY,uBACZJ,QAAS,QACTD,YAAa,OAEjBM,eAAgB,CACZC,MAAO,mBACPC,YAAa,SCARC,EAAwB,IAA8B,IAA7B,MAACC,EAAD,SAAQC,GAAqB,EAC/D,MAAOC,EAAOC,IAAYC,EAAAA,EAAAA,UAASJ,IAC5BK,EAAQC,IAAaF,EAAAA,EAAAA,YAAWJ,IACvCO,EAAAA,EAAAA,YAAU,KACNJ,EAASH,KACV,CAACA,IACJ,MAAMQ,EAAStB,IACTuB,EAAWP,GAASA,EAAMQ,OAEhC,OAAOL,EACH,kBAAC,EAAAM,MAAD,CACIC,UAAWJ,EAAOhB,MAClBU,MAAOA,EACPW,WAAW,EACXC,YAAaC,IAAAA,KAAU,UACvBC,kBAAkB,EAClBf,UAAUgB,EAAAA,EAAAA,MAAKC,EAAAA,GAAUf,GACzBP,eACI,kBAAC,EAAAuB,eAAD,CAAgBC,SAAS,SACrB,kBAACC,EAAA,QAAD,CAAYT,UAAWJ,EAAOZ,kBAGtC0B,aACI,kBAAC,EAAAH,eAAD,CAAgBC,SAAS,OACpBX,GACG,kBAACc,EAAA,EAAD,CACIC,KAAK,IACLC,KAAMC,EAAAA,QACNC,SAASV,EAAAA,EAAAA,MAAKW,EAAAA,EAAGtB,GAAWuB,EAAAA,EAAAA,QAAO,KAAKC,EAAAA,EAAAA,KAAI7B,GAAWE,MAKvE4B,YAAYC,EAAAA,EAAAA,OAAKC,EAAAA,EAAAA,QAAO,MAAO,UAAUhB,EAAAA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qBJ,EAAMM,GAC3BT,EAAU50C,QAAQ6wC,YAAY,CAC1BrX,OAAQ,cACR1gB,GAAIu8B,EACJ3oB,IAAK8oB,EACLrE,OAAQtsB,EAAQssB,OAChB3gB,KAAAA,OAGP2H,OAAOvd,IACJg7B,EAAMh7B,WAGdm6B,EAAKlD,O,uICjNjB,MAqUA,GACIj2B,WAAY,CACR,IAAK,CAtUT,gBACA,aACA,WACA,qBACA,eACA,aACA,YACA,cACA,SACA,gBACA,gBACA,cACA,UACA,gBACA,iBACA,cACA,OACA,QACA,OACA,KACA,WACA,aACA,QACA,OACA,gBACA,YACA,YACA,QACA,sBACA,8BACA,gBACA,kBACA,oBACA,mBACA,SACA,KACA,KACA,IACA,aACA,UACA,kBACA,YACA,UACA,UACA,oBACA,MACA,KACA,KACA,WACA,YACA,oBACA,MACA,WACA,4BACA,OACA,eACA,YACA,SACA,YACA,cACA,cACA,gBACA,cACA,YACA,mBACA,eACA,aACA,eACA,cACA,SACA,OACA,KACA,KACA,KACA,KACA,aACA,+BACA,6BACA,WACA,oBACA,gBACA,UACA,SACA,cACA,iBACA,KACA,cACA,kBACA,KACA,MACA,YACA,IACA,KACA,KACA,KACA,KACA,eACA,mBACA,UACA,YACA,aACA,WACA,OACA,eACA,iBACA,iBACA,oBACA,QACA,aACA,aACA,eACA,eACA,cACA,cACA,OACA,mBACA,YACA,eACA,MACA,QACA,SACA,MACA,OACA,OACA,aACA,SACA,UACA,WACA,QACA,SACA,cACA,SACA,WACA,oBACA,qBACA,WACA,cACA,OACA,aACA,sBACA,mBACA,eACA,iBACA,SACA,YACA,YACA,YACA,gBACA,sBACA,iBACA,IACA,SACA,OACA,OACA,mBACA,cACA,YACA,qBACA,mBACA,UACA,SACA,SACA,KACA,KACA,QACA,OACA,kBACA,QACA,UACA,mBACA,mBACA,QACA,eACA,cACA,eACA,QACA,QACA,cACA,aACA,eACA,yBACA,0BACA,SACA,SACA,mBACA,oBACA,iBACA,kBACA,oBACA,iBACA,eACA,QACA,eACA,iBACA,cACA,SACA,UACA,UACA,cACA,kBACA,iBACA,aACA,KACA,YACA,OACA,KACA,KACA,qBACA,sBACA,UACA,eACA,gBACA,eACA,eACA,YACA,gBACA,iBACA,SACA,UACA,aACA,gBACA,gBACA,UACA,aACA,aACA,QACA,SACA,eACA,eACA,IACA,WACA,KACA,KACA,mBACA,IACA,KACA,KACA,mBACA,IACA,aAuFgC,aAAc,cAC1Ck6B,IAAK,CAAC,MAAO,SAAU,MAAO,QAAS,WACvCz+C,KAAM,CAAC,OAAQ,OACf0+C,OAAQ,CAAC,OACTC,EAAG,CAAC,SAER9hB,KAAM,CAzFN,UACA,eACA,gBACA,mBACA,QACA,MACA,SACA,UACA,OACA,UACA,WACA,OACA,OACA,QACA,IACA,SACA,OACA,gBACA,UACA,MACA,SACA,SACA,OACA,YACA,mBACA,iBACA,gBACA,gBACA,QACA,QACA,iBACA,iBACA,OACA,SACA,UACA,QACA,OACA,OACA,UACA,WACA,OACA,OACA,MACA,iBACA,eACA,cACA,SACA,UACA,OACA,OACA,UACA,WACA,OACA,OACA,IACA,MACA,SACA,MACA,WACA,cACA,eACA,QACA,WACA,WACA,OACA,OACA,QACA,WACA,WACA,OACA,QACA,WACA,gBACA,SACA,SACA,gBACA,SACA,QACA,OAWuB,IAAK,OAAQ,QAAS,SAAU,SAAU,Q,wcC1U9D,MAAM+hB,EAAmB,KAC5B,MAAM,kBAACC,EAAD,YAAoBC,GAAeC,IAAAA,UACnC,WAACx6B,EAAD,KAAasY,GAAQmiB,EACrBxxB,EAAoB,CACtBsxB,YAAaA,EAAY/5B,OAAO8X,GAChCgiB,kBAAmB,EAAF,GAAMA,EAAsBt6B,GAC7C06B,qBAAqB,GAEzB,OAAQnC,GAAiBiC,GAAAA,CAAajC,EAAMtvB,I,mgBCkBzC,MAAM0xB,EAAS,WAAuD,YAAtD77B,EAAsD,uDAA3B,GAC9C,MAAOy5B,EAAME,IAAWxhD,EAAAA,EAAAA,aACjB2jD,EAAkBpC,IAA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C,IAAa7lD,IACnE4lD,EAAiBt8C,SAAU,EAC3Bq7C,OAEL,CAACA,EAAe3kD,EAAM6lD,IAClB,CAACxB,UAAAA,EAAWzI,OAAQ+I,K","sources":["webpack://@reltio/remotes/../components/src/components/ExpandableSearchInput/styles.ts","webpack://@reltio/remotes/../components/src/components/ExpandableSearchInput/ExpandableSearchInput.tsx","webpack://@reltio/remotes/../components/src/components/FacetViewHeader/styles.ts","webpack://@reltio/remotes/../components/src/components/FacetViewHeader/FacetViewHeader.tsx","webpack://@reltio/remotes/../components/src/components/HideOnShrink/HideOnShrink.js","webpack://@reltio/remotes/../components/src/components/ImportButton/styles.ts","webpack://@reltio/remotes/../components/src/components/ImportButton/ImportButton.tsx","webpack://@reltio/remotes/../components/src/components/Link/styles.js","webpack://@reltio/remotes/../components/src/components/Link/Link.tsx","webpack://@reltio/remotes/../components/src/components/ModeSwitcherSelect/styles.ts","webpack://@reltio/remotes/../components/src/components/ModeSwitcherSelect/ModeSwitcherSelect.tsx","webpack://@reltio/remotes/../components/src/components/ProfileMatchCard/styles.ts","webpack://@reltio/remotes/../components/src/components/ProfileMatchCard/ProfileMatchCard.tsx","webpack://@reltio/remotes/../components/src/components/ProfilesList/helpers.ts","webpack://@reltio/remotes/../components/src/components/ProfilesList/styles.ts","webpack://@reltio/remotes/../components/src/components/ProfilesList/index.ts","webpack://@reltio/remotes/../components/src/components/ProfilesList/ProfilesList.tsx","webpack://@reltio/remotes/../components/src/components/ReactSortableTree/utils/classnames.js","webpack://@reltio/remotes/../components/src/components/ReactSortableTree/treeNodeStyle.js","webpack://@reltio/remotes/../components/src/components/ReactSortableTree/tree-node.js","webpack://@reltio/remotes/../components/src/components/ReactSortableTree/node-renderer-default.js","webpack://@reltio/remotes/../components/src/components/ReactSortableTree/tree-placeholder.js","webpack://@reltio/remotes/../components/src/components/ReactSortableTree/placeholderRendererDefaultStyle.js","webpack://@reltio/remotes/../components/src/components/ReactSortableTree/placeholder-renderer-default.js","webpack://@reltio/remotes/../components/src/components/ReactSortableTree/utils/memoized-tree-data-utils.js","webpack://@reltio/remotes/../components/src/components/ReactSortableTree/utils/dnd-manager.js","webpack://@reltio/remotes/../components/src/components/ReactSortableTree/react-sortable-tree.js","webpack://@reltio/remotes/../components/src/components/ReactSortableTree/utils/generic-utils.js","webpack://@reltio/remotes/../components/src/components/ReactSortableTree/reactSortableTreeStyles.js","webpack://@reltio/remotes/../components/src/components/ReactSortableTree/index.js","webpack://@reltio/remotes/../components/src/components/ReactSortableTree/utils/default-handlers.js","webpack://@reltio/remotes/../components/src/components/ReactSortableTree/utils/tree-data-utils.js","webpack://@reltio/remotes/../components/src/components/RelationEditor/styles.js","webpack://@reltio/remotes/../components/src/components/RelationEditor/RelationEditor.js","webpack://@reltio/remotes/../components/src/components/RelationEditor/index.js","webpack://@reltio/remotes/../components/src/components/ReltioGridLayout/helpers.js","webpack://@reltio/remotes/../components/src/components/ReltioGridLayout/icons/ResizeIcon.svg.ts","webpack://@reltio/remotes/../components/src/components/ReltioGridLayout/styles.js","webpack://@reltio/remotes/../components/src/components/ReltioGridLayout/ReltioGridLayout.js","webpack://@reltio/remotes/../components/src/components/ReltioMap/MapControls/MapControlContainer/MapControlContrainer.tsx","webpack://@reltio/remotes/../components/src/icons/Radius.tsx","webpack://@reltio/remotes/../components/src/icons/Draw.tsx","webpack://@reltio/remotes/../components/src/components/ReltioMap/MapControls/TopRightMapControls/styles.ts","webpack://@reltio/remotes/../components/src/components/ReltioMap/MapControls/TopRightMapControls/TopRightMapControls.tsx","webpack://@reltio/remotes/../components/src/components/ReltioMap/MapControls/TopCenterMapControls/styles.ts","webpack://@reltio/remotes/../components/src/components/ReltioMap/MapControls/TopCenterMapControls/TopCenterMapControls.tsx","webpack://@reltio/remotes/../components/src/components/ReltioMap/helpers/index.ts","webpack://@reltio/remotes/../components/src/components/ReltioMap/EntityMarker/icons/marker.inline.svg.ts","webpack://@reltio/remotes/../components/src/components/ReltioMap/EntityMarker/styles.ts","webpack://@reltio/remotes/../components/src/components/ReltioMap/EntityMarker/EntityMarker.tsx","webpack://@reltio/remotes/../components/src/components/ReltioMap/EntityMarker/icons/marker-hover.inline.svg.ts","webpack://@reltio/remotes/../components/src/components/ReltioMap/styles.ts","webpack://@reltio/remotes/../components/src/components/ReltioMap/index.tsx","webpack://@reltio/remotes/../components/src/components/attributes/readMode/AttributesView/styles.ts","webpack://@reltio/remotes/../components/src/components/attributes/readMode/AttributesView/index.ts","webpack://@reltio/remotes/../components/src/components/attributes/readMode/AttributesView/AttributesView.tsx","webpack://@reltio/remotes/../components/src/components/attributes/editMode/AttributesView/styles.ts","webpack://@reltio/remotes/../components/src/components/attributes/editMode/AttributesView/AttributesView.tsx","webpack://@reltio/remotes/../components/src/components/attributes/editMode/AttributesView/index.ts","webpack://@reltio/remotes/../components/src/components/attributes/AttributesView/AttributesView.tsx","webpack://@reltio/remotes/../components/src/components/attributes/AttributesView/index.ts","webpack://@reltio/remotes/../components/src/components/history/hooks/useHistoryDiff.ts","webpack://@reltio/remotes/../components/src/components/workflow/cards/GenericWorkflowTaskCard/styles.ts","webpack://@reltio/remotes/../components/src/components/workflow/components/AssigneeSelector/AssigneeSelector.tsx","webpack://@reltio/remotes/../components/src/components/workflow/components/DueDateField/styles.ts","webpack://@reltio/remotes/../components/src/components/workflow/hooks/useWorkflowDueDate.ts","webpack://@reltio/remotes/../components/src/components/workflow/components/DueDateField/DueDateField.tsx","webpack://@reltio/remotes/../components/src/components/workflow/components/PrioritySelector/PrioritySelector.tsx","webpack://@reltio/remotes/../components/src/components/workflow/hooks/useWorkflowPriority.ts","webpack://@reltio/remotes/../components/src/components/workflow/components/TaskActions/TaskActions.tsx","webpack://@reltio/remotes/../components/src/components/workflow/hooks/useWorkflowActions.ts","webpack://@reltio/remotes/../components/src/components/workflow/components/LineDecorator/styles.ts","webpack://@reltio/remotes/../components/src/components/workflow/components/LineDecorator/LineDecorator.tsx","webpack://@reltio/remotes/../components/src/components/workflow/hooks/useWorkflowColor.ts","webpack://@reltio/remotes/../components/src/icons/CollaborationIcon.tsx","webpack://@reltio/remotes/../components/src/components/workflow/cards/GenericWorkflowTaskCard/GenericWorkflowTaskCard.tsx","webpack://@reltio/remotes/../components/src/icons/DcrTaskIcon.tsx","webpack://@reltio/remotes/../components/src/components/workflow/constants/operations.ts","webpack://@reltio/remotes/../components/src/components/workflow/components/AttributesChanges/helpers/helpers.ts","webpack://@reltio/remotes/../components/src/components/workflow/components/AttributesChanges/helpers/attributesHelpers.ts","webpack://@reltio/remotes/../components/src/components/workflow/components/AttributesChanges/helpers/mergeHelpers.ts","webpack://@reltio/remotes/../components/src/components/workflow/components/AttributesChanges/components/ShowMoreLink/styles.ts","webpack://@reltio/remotes/../components/src/components/workflow/components/AttributesChanges/components/ShowMoreLink/ShowMoreLink.tsx","webpack://@reltio/remotes/../components/src/components/workflow/components/AttributesChanges/components/ChangeView/styles.ts","webpack://@reltio/remotes/../components/src/components/workflow/components/AttributesChanges/components/ChangeView/ChangeView.tsx","webpack://@reltio/remotes/../components/src/components/workflow/components/AttributesChanges/contexts/AttributesChangesContext.tsx","webpack://@reltio/remotes/../components/src/components/workflow/components/AttributesChanges/components/DiffRenderer/styles.ts","webpack://@reltio/remotes/../components/src/components/workflow/components/AttributesChanges/components/DiffRenderer/DiffRenderer.tsx","webpack://@reltio/remotes/../components/src/components/workflow/components/AttributesChanges/components/DCRChangesList/styles.ts","webpack://@reltio/remotes/../components/src/components/workflow/components/AttributesChanges/components/DCRChangesList/DCRChangesList.tsx","webpack://@reltio/remotes/../components/src/components/workflow/components/AttributesChanges/helpers/contextHelpers.ts","webpack://@reltio/remotes/../components/src/components/workflow/components/AttributesChanges/styles.ts","webpack://@reltio/remotes/../components/src/components/workflow/components/AttributesChanges/AttributesChanges.tsx","webpack://@reltio/remotes/../components/src/components/workflow/components/AttributesChanges/hooks/useCollapsibleList.ts","webpack://@reltio/remotes/../components/src/components/workflow/helpers/dcrHelpers.ts","webpack://@reltio/remotes/../components/src/components/workflow/hooks/useChangeRequest.ts","webpack://@reltio/remotes/../components/src/components/workflow/cards/DataChangeRequestTaskCard/DataChangeRequestTaskCard.tsx","webpack://@reltio/remotes/../components/src/components/workflow/cards/PotentialMatchTaskCard/styles.ts","webpack://@reltio/remotes/../components/src/icons/PmTaskIcon.tsx","webpack://@reltio/remotes/../components/src/components/workflow/cards/PotentialMatchTaskCard/PotentialMatchTaskCard.tsx","webpack://@reltio/remotes/../components/src/icons/DefaultTaskIcon.tsx","webpack://@reltio/remotes/../components/src/icons/DeleteRequestTaskIcon.tsx","webpack://@reltio/remotes/../components/src/components/workflow/cards/WorkflowTaskCardsFactory.tsx","webpack://@reltio/remotes/../components/src/components/workflow/cards/WorkflowTaskCard.ts","webpack://@reltio/remotes/../components/src/components/workflow/components/AddWorkflowDialog/styles.ts","webpack://@reltio/remotes/../components/src/components/workflow/components/AddWorkflowDialog/AddWorkflowDialog.tsx","webpack://@reltio/remotes/../components/src/components/workflow/hooks/useWorkflowDefinitions.ts","webpack://@reltio/remotes/../components/src/components/workflow/hooks/useWorkflowProcessInstance.ts","webpack://@reltio/remotes/../components/src/components/workflow/components/AddWorkflowButton/styles.ts","webpack://@reltio/remotes/../components/src/components/workflow/components/AddWorkflowButton/AddWorkflowButton.tsx","webpack://@reltio/remotes/../components/src/components/workflow/hooks/useWorkflowTasks.ts","webpack://@reltio/remotes/../components/src/constants/map.ts","webpack://@reltio/remotes/../components/src/contexts/EntityMarkerContext/index.ts","webpack://@reltio/remotes/../components/src/contexts/InterceptHandlersContext/index.ts","webpack://@reltio/remotes/../components/src/contexts/ProfilePerspectiveViewContext/index.ts","webpack://@reltio/remotes/../components/src/contexts/SandboxAPIContext/index.ts","webpack://@reltio/remotes/../components/src/hooks/useAPI/API.ts","webpack://@reltio/remotes/../components/src/hooks/useAPI/helpers.ts","webpack://@reltio/remotes/../components/src/hooks/helpers/sanitizerOptions.ts","webpack://@reltio/remotes/../components/src/hooks/useHtmlSanitizer.ts","webpack://@reltio/remotes/../components/src/hooks/useAPI/useAPI.ts","webpack://@reltio/remotes/../components/src/hooks/useCommentsEntitiesMap.ts","webpack://@reltio/remotes/../components/src/hooks/useConfigPermissions.ts","webpack://@reltio/remotes/../components/src/hooks/useRelationsLoader.ts"],"sourcesContent":["import {makeStyles} from '@material-ui/core/styles';\n\nexport const useStyles = makeStyles({\n searchButton: {\n marginLeft: 'auto !important',\n marginRight: '-4px',\n padding: '8px'\n },\n input: {\n flex: '1 0 200px',\n marginLeft: '70px',\n fontSize: '14px',\n background: 'rgba(0,0,0,0.03) 2px',\n padding: '4px 0',\n marginRight: '4px'\n },\n startAdornment: {\n color: 'rgba(0,0,0,0.54)',\n paddingLeft: '8px'\n }\n});\n","import React, {useState, useEffect} from 'react';\nimport i18n from 'ui-i18n';\nimport {always, F, pipe, propEq, T, tap, trim, when} from 'ramda';\nimport CloseIcon from '@material-ui/icons/Close';\nimport {IconButton as IconButton} from '@material-ui/core';\nimport {Input as Input} from '@material-ui/core';\nimport {InputAdornment as InputAdornment} from '@material-ui/core';\nimport SearchIcon from '@material-ui/icons/Search';\nimport {SmallIconButton} from '../SmallIconButton';\nimport {getValue} from '../../core';\n\nimport {useStyles} from './styles';\n\ntype Props = {\n query: string;\n onChange: (value: string) => void;\n};\n\nexport const ExpandableSearchInput = ({query, onChange}: Props) => {\n const [value, setValue] = useState(query);\n const [isOpen, setIsOpen] = useState(!!query);\n useEffect(() => {\n setValue(query);\n }, [query]);\n const styles = useStyles();\n const hasValue = value && value.length;\n\n return isOpen ? (\n <Input\n className={styles.input}\n value={value}\n autoFocus={true}\n placeholder={i18n.text('Search')}\n disableUnderline={true}\n onChange={pipe(getValue, setValue)}\n startAdornment={\n <InputAdornment position=\"start\">\n <SearchIcon className={styles.startAdornment} />\n </InputAdornment>\n }\n endAdornment={\n <InputAdornment position=\"end\">\n {hasValue && (\n <SmallIconButton\n size=\"S\"\n icon={CloseIcon}\n onClick={pipe(F, setIsOpen, always(''), tap(onChange), setValue)}\n />\n )}\n </InputAdornment>\n }\n onKeyPress={when(propEq('key', 'Enter'), pipe(always(value), trim, onChange))}\n />\n ) : (\n <IconButton className={styles.searchButton} onClick={pipe(T, setIsOpen)}>\n <SearchIcon />\n </IconButton>\n );\n};\n","import {makeStyles} from '@material-ui/core/styles';\n\nexport const useStyles = makeStyles({\n container: {\n padding: '0 16px',\n minHeight: '48px'\n },\n title: {\n fontSize: '16px',\n lineHeight: '19px',\n paddingTop: '16px',\n paddingBottom: '13px',\n justifyContent: 'flex-start'\n }\n});\n","import React from 'react';\nimport classnames from 'classnames';\nimport BasicViewHeader from '../BasicViewHeader/BasicViewHeader';\nimport {useStyles} from './styles';\n\ntype Props = {\n className?: string;\n title: string;\n children?: React.ReactNode;\n};\n\nconst FacetViewHeader = ({className, title, children}: Props) => {\n const styles = useStyles();\n return (\n <BasicViewHeader title={title} classes={{root: classnames(styles.container, className), title: styles.title}}>\n {children}\n </BasicViewHeader>\n );\n};\n\nexport default FacetViewHeader;\n","import PropTypes from 'prop-types';\nimport React from 'react';\nimport ReactResizeDetector from 'react-resize-detector';\n\nconst EmptyStub = () => <div style={{display: 'none'}} />;\n\nconst HideOnShrink = ({widthToHide, children}) => (\n <ReactResizeDetector\n handleWidth={true}\n render={({width}) => (width > widthToHide ? <>{children}</> : <EmptyStub />)}\n />\n);\n\nHideOnShrink.propTypes = {\n children: PropTypes.node,\n widthToHide: PropTypes.number.isRequired\n};\n\nexport default HideOnShrink;\n","import {makeStyles} from '@material-ui/core/styles';\n\nexport const useStyles = makeStyles({\n root: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: '24px',\n height: '24px'\n },\n check: {\n color: '#8CC152'\n }\n});\n","import React from 'react';\n\nimport {CircularProgress as CircularProgress} from '@material-ui/core';\nimport {SmallIconButtonWithTooltip} from '../SmallIconButton';\nimport CloudDownloadIcon from '@material-ui/icons/CloudDownload';\nimport DoneIcon from '@material-ui/icons/Done';\nimport {noop} from '../../core';\nimport classnames from 'classnames';\nimport {useStyles} from './styles';\n\nexport enum ImportModes {\n INIT = 1,\n PROGRESS = 2,\n SUCCESS = 3,\n DONE = 4\n}\n\ntype Props = {\n tooltip?: string;\n onClick?: () => void;\n classes?: Partial<Record<'root' | 'spinner' | 'button' | 'check', string>>;\n mode?: ImportModes;\n};\n\nconst ImportButton = ({classes = {}, tooltip = '', onClick = noop, mode = ImportModes.INIT}: Props) => {\n const styles = useStyles();\n\n const renderCurrentMode = () => {\n switch (mode) {\n case ImportModes.INIT: {\n return (\n <SmallIconButtonWithTooltip\n className={classes.button}\n size={'M'}\n tooltipTitle={tooltip}\n icon={CloudDownloadIcon}\n onClick={onClick}\n />\n );\n }\n case ImportModes.PROGRESS:\n return <CircularProgress className={classes.spinner} size={24} />;\n case ImportModes.SUCCESS:\n return <DoneIcon className={classnames(styles.check, classes.check)} />;\n default:\n return null;\n }\n };\n return <div className={classnames(styles.root, classes.root)}>{renderCurrentMode()}</div>;\n};\n\nexport default ImportButton;\n","import {makeStyles} from '@material-ui/core/styles';\n\nexport const useStyles = makeStyles({\n link: {\n textDecoration: 'inherit',\n color: 'inherit',\n '&:visited': {\n textDecoration: 'inherit',\n color: 'inherit'\n }\n }\n});\n","import React, {ReactNode} from 'react';\nimport {useStyles} from './styles';\n\ntype LinkProps = {\n to?: string;\n children?: ReactNode;\n onClick?: () => void;\n};\nconst Link = ({to, children, onClick}: LinkProps) => {\n const styles = useStyles();\n return (\n <a\n href={to}\n onClick={(e) => {\n if (onClick) {\n onClick();\n e.stopPropagation();\n e.preventDefault();\n }\n }}\n className={styles.link}\n >\n {children}\n </a>\n );\n};\n\nexport default Link;\n","import {makeStyles} from '@material-ui/core/styles';\n\nconst MAX_WIDTH_SELECT = 200;\nconst SELECT_PADDING_RIGHT = 32;\nconst SELECT_PADDING_LEFT = 12;\nconst CALCULATED_MAX_WIDTH_SELECT = MAX_WIDTH_SELECT - SELECT_PADDING_LEFT - SELECT_PADDING_RIGHT;\n\nexport const useStyles = makeStyles((theme) => ({\n root: {\n maxWidth: CALCULATED_MAX_WIDTH_SELECT,\n paddingTop: '9px',\n paddingBottom: '9px'\n },\n outlined: {\n paddingRight: SELECT_PADDING_RIGHT,\n paddingLeft: SELECT_PADDING_LEFT\n },\n arrowIcon: {\n fontSize: '18px',\n top: 'calc(50% - 9px)',\n right: '12px',\n color: theme.palette.text.secondary\n },\n currentValue: {\n display: 'flex',\n alignItems: 'center'\n },\n currentValueIcon: {\n fontSize: '18px',\n marginRight: '8px',\n color: theme.palette.text.secondary\n },\n currentValueText: {\n fontSize: '14px',\n lineHeight: '16px',\n textTransform: 'uppercase',\n fontWeight: 500,\n color: theme.palette.text.primary,\n whiteSpace: 'nowrap',\n textOverflow: 'ellipsis',\n overflow: 'hidden'\n },\n menuItem: {\n padding: '9px 12px 7px'\n },\n firstMenuItemButton: {\n borderTop: '1px solid #e4e4e4'\n },\n menuItemInner: {\n display: 'flex',\n alignItems: 'flex-start'\n },\n menuItemIcon: {\n fontSize: '18px',\n color: theme.palette.text.secondary,\n marginRight: '9px'\n },\n menuItemLabel: {\n fontSize: '14px',\n lineHeight: '16px',\n fontWeight: 500,\n color: theme.palette.text.primary\n },\n menuItemDescription: {\n fontSize: '10px',\n lineHeight: '16px',\n color: theme.palette.text.secondary\n }\n}));\n","import React from 'react';\nimport {propEq} from 'ramda';\nimport classnames from 'classnames';\nimport {Select as Select} from '@material-ui/core';\nimport {MenuItem as MenuItem} from '@material-ui/core';\nimport {Box as Box} from '@material-ui/core';\nimport {Typography as Typography} from '@material-ui/core';\nimport {Tooltip as Tooltip} from '@material-ui/core';\nimport {useStyles} from './styles';\n\ntype Option = {\n label: string;\n value: string;\n description: string;\n icon: React.ElementType;\n};\n\ntype Button = Option & {\n onClick: (value: string) => void;\n};\n\ntype ModeSwitcherSelectProps = {\n optionsGroup: Option[];\n buttonsGroup: Button[];\n value: string;\n onChange?: (value: string) => void;\n disabled?: boolean;\n};\n\ntype MenuItemProps = React.ComponentPropsWithoutRef<typeof MenuItem>;\n\nconst isButton = (value: Option | Button): value is Button => 'onClick' in value;\n\nexport const ModeSwitcherSelect = ({\n optionsGroup,\n buttonsGroup,\n value,\n onChange,\n disabled = false\n}: ModeSwitcherSelectProps) => {\n const styles = useStyles();\n\n const handleChange = (e: React.ChangeEvent<{value: string}>) => {\n const {value} = e.target;\n const isOption = optionsGroup.some(propEq('value', value));\n if (isOption) onChange(value);\n };\n\n const renderMenuItems = (items: (Option | Button)[]) => {\n const firstButtonIdx = items.findIndex(isButton);\n\n return items.map((item, idx) => {\n const {value, description, icon: IconComponent} = item;\n\n const menuItemProps: MenuItemProps = {\n value: value,\n className: styles.menuItem\n };\n\n if (isButton(item)) {\n menuItemProps.onClick = () => item.onClick(value);\n menuItemProps.className = classnames(menuItemProps.className, {\n [styles.firstMenuItemButton]: idx === firstButtonIdx\n });\n }\n\n return (\n <MenuItem key={value} {...menuItemProps} data-reltio-id={`reltio-profile-select-mode-${value}`}>\n <Box className={styles.menuItemInner}>\n <IconComponent className={styles.menuItemIcon} />\n <Box>\n <Typography className={styles.menuItemLabel}>{value}</Typography>\n <Typography className={styles.menuItemDescription}>{description}</Typography>\n </Box>\n </Box>\n </MenuItem>\n );\n });\n };\n\n return (\n <Select\n classes={{\n root: styles.root,\n icon: styles.arrowIcon,\n outlined: styles.outlined\n }}\n value={value}\n onChange={handleChange}\n variant=\"outlined\"\n renderValue={(value) => {\n const {icon: IconComponent, label = value} = optionsGroup.find(propEq('value', value)) || {};\n return (\n <Box className={styles.currentValue}>\n {IconComponent && <IconComponent className={styles.currentValueIcon} />}\n <Tooltip title={label}>\n <Typography className={styles.currentValueText}>{label}</Typography>\n </Tooltip>\n </Box>\n );\n }}\n MenuProps={{\n anchorOrigin: {\n vertical: 'bottom',\n horizontal: 'right'\n },\n transformOrigin: {\n vertical: 'top',\n horizontal: 'right'\n },\n getContentAnchorEl: null\n }}\n disabled={disabled}\n data-reltio-id=\"reltio-profile-select-mode\"\n >\n {renderMenuItems([...optionsGroup, ...buttonsGroup])}\n </Select>\n );\n};\n","import {makeStyles} from '@material-ui/core/styles';\n\nexport const useStyles = makeStyles({\n root: {\n display: 'flex',\n flexDirection: 'column',\n paddingRight: '12px',\n paddingTop: '8px',\n paddingBottom: '8px',\n '& + &': {\n borderTop: '1px solid rgba(0,0,0, 0.12)'\n }\n },\n profileCardWrapper: {\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center',\n gap: '4px'\n },\n profileCardContainer: {\n flexGrow: 1,\n paddingBottom: '8px',\n paddingTop: '8px'\n },\n rulesContainer: {\n paddingLeft: '52px',\n marginBottom: '8px'\n }\n});\n","import React from 'react';\nimport {Entity, Metadata, Match} from '@reltio/mdm-sdk';\nimport {useStyles} from './styles';\nimport ProfileCard from '../ProfileCard/ProfileCard';\nimport MatchRulesBlock from '../MatchRulesBlock/MatchRulesBlock';\nimport classnames from 'classnames';\n\ntype Props = {\n entitiesMap: {\n [key: string]: Pick<Entity, 'uri' | 'type' | 'label'>;\n };\n entity: Entity;\n match: Match;\n metadata: Metadata;\n children?: React.ReactNode;\n className?: string;\n};\n\nexport const ProfileMatchCard = ({children, entitiesMap, entity, match, metadata, className}: Props) => {\n const styles = useStyles();\n return (\n <div className={classnames(styles.root, className)}>\n <div className={styles.profileCardWrapper}>\n <ProfileCard entity={match.object} classes={{container: styles.profileCardContainer}} />\n {children}\n </div>\n <div className={styles.rulesContainer}>\n {match.matchRules && (\n <MatchRulesBlock match={match} metadata={metadata} entitiesMap={entitiesMap} entity={entity} />\n )}\n </div>\n </div>\n );\n};\n","export const scroll = (element) => element && element.scrollIntoView({block: 'end', behavior: 'smooth'});\n\nexport const clearScrollTimer = (scrollTimer) => {\n if (scrollTimer) {\n clearTimeout(scrollTimer);\n }\n};\n\nexport const isScrolledIntoView = (element, scrollableParent) => {\n if (element && scrollableParent) {\n const elemTop = element.offsetTop;\n const elemBottom = element.offsetTop + element.clientHeight;\n const {clientHeight, scrollTop} = scrollableParent;\n return elemTop >= 0 && elemBottom > scrollTop && elemBottom < scrollTop + clientHeight;\n }\n};\n","import {fade, makeStyles} from '@material-ui/core/styles';\nimport {Theme} from '@material-ui/core';\n\nexport const useStyles = makeStyles(\n (\n theme: Theme & {\n inactiveBackground: string;\n inactiveHoverBackground: string;\n inactiveSelectedBackground: string;\n inactiveSelectedHoverBackground: string;\n }\n ) => {\n return {\n '@keyframes animate': {\n from: {background: 'transparent'},\n '66%': {background: '#f2e68e'},\n '100%': {background: 'transparent'}\n },\n\n highlighted: {\n animationName: '$animate',\n animationDuration: '3s',\n animationIterationCount: 1\n },\n\n item: {\n display: 'flex',\n minHeight: '40px',\n borderBottom: '1px solid rgba(0, 0, 0, 0.1)',\n flexDirection: 'row',\n\n '&:after': {\n // IE flex & min-height workaround\n content: '',\n minHeight: 'inherit',\n fontSize: 0\n },\n\n '&:hover': {\n backgroundColor: 'rgba(0, 0, 0, 0.03)'\n }\n },\n\n clickable: {\n cursor: 'pointer'\n },\n\n selected: {\n background: fade(theme.palette.primary.main, 0.12),\n '&:hover': {\n background: fade(theme.palette.primary.main, 0.24)\n }\n },\n\n inactive: {\n background: theme.inactiveBackground,\n\n '&:hover': {\n background: theme.inactiveHoverBackground\n },\n\n '&$selected': {\n background: theme.inactiveSelectedBackground,\n\n '&:hover': {\n background: theme.inactiveSelectedHoverBackground\n }\n }\n },\n\n justImported: {\n backgroundColor: '#FFFBEB !important'\n },\n\n avatar: {\n marginLeft: '20px'\n },\n\n image: {\n height: '32px',\n width: '32px',\n marginTop: '8px',\n marginBottom: '7px'\n },\n\n info: {\n marginLeft: '20px',\n flexGrow: 1,\n display: 'flex',\n flexDirection: 'column',\n justifyContent: 'center',\n fontSize: '13px',\n width: '100%',\n overflow: 'hidden',\n overflowWrap: 'break-word',\n wordWrap: 'break-word' // for IE\n },\n\n label: {\n fontSize: '13px',\n lineHeight: '15px',\n fontWeight: 500,\n color: theme.palette.primary.main,\n marginRight: '17px',\n textDecoration: 'none'\n },\n\n secondaryLabel: {\n marginRight: '12px'\n },\n\n businessCard: {\n color: 'rgba(0, 0, 0, 0.54)'\n },\n\n secondRow: {\n display: 'flex',\n marginTop: '2px',\n alignItems: 'center',\n color: 'rgba(0, 0, 0, 0.54)',\n fontSize: '12px'\n }\n };\n }\n);\n","import {connect} from 'react-redux';\nimport mdmModule from '@reltio/mdm-module';\nimport ProfilesList from './ProfilesList';\n\nconst mapStateToProps = (state) => {\n return {\n metadata: mdmModule.selectors.getMetadata(state)\n };\n};\n\nexport {ProfilesList};\n\nexport default connect(mapStateToProps)(ProfilesList);\n","import React, {useRef} from 'react';\nimport classnames from 'classnames';\nimport {prop} from 'ramda';\nimport {\n Entity,\n getBusinessCardAttributesText,\n getEntityId,\n getEntityUriForLink,\n getLabel,\n isActiveObject,\n Metadata\n} from '@reltio/mdm-sdk';\nimport EntityTypeBadge from '../EntityTypeBadge/EntityTypeBadge';\nimport EntityUriLink from '../EntityUriLink/EntityUriLink';\nimport EntityAvatar from '../EntityAvatar/EntityAvatar';\nimport {ImportModes} from '../ImportButton/ImportButton';\nimport {clearScrollTimer, isScrolledIntoView, scroll} from './helpers';\nimport {useDidUpdateEffect} from '../../hooks';\n\nimport {useStyles} from './styles';\n\nconst SECOND_SCROLL_PAUSE = 1000;\n\ntype Props = {\n metadata: Metadata;\n entities: Entity[];\n entityToHighlight?: string;\n selectedEntityUri?: string;\n onEntityClick?: (entityUri: string) => void;\n onEntityHover?: (entityUri: string) => void;\n entitiesImportStatus?: {entityUri: string};\n entityButtonsRenderer?: (entity: Entity) => void;\n};\n\nconst ProfilesList = ({\n entities,\n metadata,\n entityToHighlight,\n selectedEntityUri,\n onEntityClick,\n onEntityHover,\n entitiesImportStatus,\n entityButtonsRenderer\n}: Props) => {\n const styles = useStyles();\n\n const list = useRef(null);\n const scrollTimer = useRef(null);\n\n useDidUpdateEffect(() => {\n if (entityToHighlight) {\n const element = list.current?.querySelectorAll(`[data-entity-uri='${entityToHighlight}']`);\n clearScrollTimer(scrollTimer.current);\n if (element?.length > 0) {\n const scrollableParent = list.current?.parentElement;\n if (!isScrolledIntoView(element[0], scrollableParent)) {\n scroll(element[0]);\n scrollTimer.current = setTimeout(() => {\n if (!isScrolledIntoView(element[0], scrollableParent)) {\n scroll(element[0]);\n }\n }, SECOND_SCROLL_PAUSE);\n }\n }\n }\n\n return () => {\n clearScrollTimer(scrollTimer.current);\n };\n }, [entityToHighlight]);\n\n return (\n <div ref={list}>\n {(entities || []).map((entity) => {\n const label = getLabel(entity.label);\n const secondaryLabel = entity.secondaryLabel;\n const businessCardText = getBusinessCardAttributesText(metadata, entity);\n const isActive = isActiveObject(entity);\n const entityUri = entity.uri;\n const entityUriForLink = getEntityUriForLink(entity);\n\n const importStatus = prop(entityUri, entitiesImportStatus);\n\n return (\n <div\n key={entityUri}\n className={classnames(styles.item, {\n [styles.clickable]: !!onEntityClick,\n [styles.selected]: entityUri === selectedEntityUri,\n [styles.highlighted]: entityUri === entityToHighlight,\n [styles.inactive]: !isActive,\n [styles.justImported]: importStatus === ImportModes.SUCCESS\n })}\n onClick={onEntityClick ? () => onEntityClick(entityUri) : undefined}\n onMouseEnter={onEntityHover ? () => onEntityHover(entityUri) : undefined}\n onMouseLeave={onEntityHover ? () => onEntityHover(null) : undefined}\n data-entity-uri={entityUri}\n >\n <EntityAvatar entity={entity} avatarClassName={styles.avatar} imageClassName={styles.image} />\n <div className={styles.info}>\n <div>\n <EntityUriLink value={entityUriForLink} className={styles.label}>\n {label}\n </EntityUriLink>\n {secondaryLabel && <span className={styles.secondaryLabel}>{secondaryLabel} </span>}\n {businessCardText && <span className={styles.businessCard}>{businessCardText}</span>}\n </div>\n <div className={styles.secondRow}>\n <EntityTypeBadge entity={entity} />\n <div>{getEntityId(entity)}</div>\n </div>\n </div>\n {entityButtonsRenderer && entityButtonsRenderer(entity)}\n </div>\n );\n })}\n </div>\n );\n};\n\nexport default ProfilesList;\n","// very simple className utility for creating a classname string...\n// Falsy arguments are ignored:\n//\n// const active = true\n// const className = classnames(\n// \"class1\",\n// !active && \"class2\",\n// active && \"class3\"\n// ); // returns -> class1 class3\";\n//\nexport default function classnames(...classes) {\n // Use Boolean constructor as a filter callback\n // Allows for loose type truthy/falsey checks\n // Boolean(\"\") === false;\n // Boolean(false) === false;\n // Boolean(undefined) === false;\n // Boolean(null) === false;\n // Boolean(0) === false;\n // Boolean(\"classname\") === true;\n return classes.filter(Boolean).join(' ');\n}\n","import {makeStyles} from '@material-ui/core/styles';\n\nexport const useStyles = makeStyles(() => ({\n '@global .rst__node': {\n minWidth: '100%',\n whiteSpace: 'nowrap',\n position: 'relative',\n textAlign: 'left'\n },\n\n '@global .rst__node.rst__rtl': {\n textAlign: 'right'\n },\n\n '@global .rst__nodeContent': {\n position: 'absolute',\n top: 0,\n bottom: 0\n },\n\n /* ==========================================================================\n Scaffold\n \n Line-overlaid blocks used for showing the tree structure\n ========================================================================== */\n '@global .rst__lineBlock, .rst__absoluteLineBlock': {\n height: '100%',\n position: 'relative',\n display: 'inline-block'\n },\n\n '@global .rst__absoluteLineBlock': {\n position: 'absolute',\n top: 0\n },\n\n '@global .rst__lineHalfHorizontalRight::before, .rst__lineFullVertical::after, .rst__lineHalfVerticalTop::after, .rst__lineHalfVerticalBottom::after': {\n position: 'absolute',\n content: '',\n backgroundColor: 'black'\n },\n\n /**\n * +-----+\n * | |\n * | +--+\n * | |\n * +-----+\n */\n '@global .rst__lineHalfHorizontalRight::before': {\n height: '1px',\n top: '50%',\n right: 0,\n width: '50%'\n },\n\n '@global .rst__rtl.rst__lineHalfHorizontalRight::before': {\n left: 0,\n right: 'initial'\n },\n\n /**\n * +--+--+\n * | | |\n * | | |\n * | | |\n * +--+--+\n */\n '@global .rst__lineFullVertical::after, .rst__lineHalfVerticalTop::after, .rst__lineHalfVerticalBottom::after': {\n width: '1px',\n left: '50%',\n top: 0,\n height: '100%'\n },\n\n /**\n * +--+--+\n * | | |\n * | | |\n * | | |\n * +--+--+\n */\n '@global .rst__rtl.rst__lineFullVertical::after, .rst__rtl.rst__lineHalfVerticalTop::after, .rst__rtl.rst__lineHalfVerticalBottom::after': {\n right: '50%',\n left: 'initial'\n },\n\n /**\n * +-----+\n * | | |\n * | + |\n * | |\n * +-----+\n */\n '@global .rst__lineHalfVerticalTop::after': {\n height: '50%'\n },\n\n /**\n * +-----+\n * | |\n * | + |\n * | | |\n * +-----+\n */\n '@global .rst__lineHalfVerticalBottom::after': {\n top: 'auto',\n bottom: 0,\n height: '50%'\n },\n\n /* Highlight line for pointing to dragged row destination\n ========================================================================== */\n /**\n * +--+--+\n * | | |\n * | | |\n * | | |\n * +--+--+\n */\n '@global .rst__highlightLineVertical': {\n zIndex: 3\n },\n '@global .rst__highlightLineVertical::before': {\n position: 'absolute',\n content: '',\n backgroundColor: '#36c2f6',\n width: '8px',\n marginLeft: '-4px',\n left: '50%',\n top: 0,\n height: '100%'\n },\n\n '@global .rst__rtl.rst__highlightLineVertical::before': {\n marginLeft: 'initial',\n marginRight: '-4px',\n left: 'initial',\n right: '50%'\n },\n\n '@keyframes arrow-pulse': {\n '0%': {\n transform: 'translate(0, 0)',\n opacity: 0\n },\n '30%': {\n transform: 'translate(0, 300%)',\n opacity: 1\n },\n '70%': {\n transform: 'translate(0, 700%)',\n opacity: 1\n },\n '100%': {\n transform: 'translate(0, 1000%)',\n opacity: 0\n }\n },\n '@global .rst__highlightLineVertical::after': {\n content: '',\n position: 'absolute',\n height: 0,\n marginLeft: '-4px',\n left: '50%',\n top: 0,\n borderLeft: '4px solid transparent',\n borderRight: '4px solid transparent',\n borderTop: '4px solid white',\n animation: 'arrow-pulse 1s infinite linear both'\n },\n\n '@global .rst__rtl.rst__highlightLineVertical::after': {\n marginLeft: 'initial',\n marginRight: '-4px',\n right: '50%',\n left: 'initial'\n },\n\n /**\n * +-----+\n * | |\n * | +--+\n * | | |\n * +--+--+\n */\n '@global .rst__highlightTopLeftCorner::before': {\n zIndex: 3,\n content: '',\n position: 'absolute',\n borderTop: 'solid 8px #36c2f6',\n borderLeft: 'solid 8px #36c2f6',\n boxSizing: 'border-box',\n height: 'calc(50% + 4px)',\n top: '50%',\n marginTop: '-4px',\n right: 0,\n width: 'calc(50% + 4px)'\n },\n\n '@global .rst__rtl.rst__highlightTopLeftCorner::before': {\n borderRight: 'solid 8px #36c2f6',\n borderLeft: 'none',\n left: 0,\n right: 'initial'\n },\n\n /**\n * +--+--+\n * | | |\n * | | |\n * | +->|\n * +-----+\n */\n '@global .rst__highlightBottomLeftCorner': {\n zIndex: 3\n },\n '@global .rst__highlightBottomLeftCorner::before': {\n content: '',\n position: 'absolute',\n borderBottom: 'solid 8px #36c2f6',\n borderLeft: 'solid 8px #36c2f6',\n boxSizing: 'border-box',\n height: 'calc(100% + 4px)',\n top: 0,\n right: '12px',\n width: 'calc(50% - 8px)'\n },\n\n '@global .rst__rtl.rst__highlightBottomLeftCorner::before': {\n borderRight: 'solid 8px #36c2f6',\n borderLeft: 'none',\n left: '12px',\n right: 'initial'\n },\n\n '@global .rst__highlightBottomLeftCorner::after': {\n content: '',\n position: 'absolute',\n height: 0,\n right: 0,\n top: '100%',\n marginTop: '-12px',\n borderTop: '12px solid transparent',\n borderBottom: '12px solid transparent',\n borderLeft: '12px solid #36c2f6'\n },\n\n '@global .rst__rtl.rst__highlightBottomLeftCorner::after': {\n left: 0,\n right: 'initial',\n borderRight: '12px solid #36c2f6',\n borderLeft: 'none'\n }\n}));\n","import React, {Children, cloneElement} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from './utils/classnames';\nimport {useStyles} from './treeNodeStyle';\n\nconst TreeNode = ({\n children,\n listIndex,\n swapFrom,\n swapLength,\n swapDepth,\n scaffoldBlockPxWidth,\n lowerSiblingCounts,\n connectDropTarget,\n isOver,\n draggedNode,\n canDrop,\n treeIndex,\n /* eslint-disable */\n treeId, // Delete from otherProps\n getPrevRow, // Delete from otherProps\n node, // Delete from otherProps\n path, // Delete from otherProps\n /* eslint-enable */\n rowDirection,\n ...otherProps\n}) => {\n useStyles();\n const rowDirectionClass = rowDirection === 'rtl' ? 'rst__rtl' : null;\n\n // Construct the scaffold representing the structure of the tree\n const scaffoldBlockCount = lowerSiblingCounts.length;\n const scaffold = [];\n lowerSiblingCounts.forEach((lowerSiblingCount, i) => {\n let lineClass = '';\n if (lowerSiblingCount > 0) {\n // At this level in the tree, the nodes had sibling nodes further down\n\n if (listIndex === 0) {\n // Top-left corner of the tree\n // +-----+\n // | |\n // | +--+\n // | | |\n // +--+--+\n lineClass = 'rst__lineHalfHorizontalRight rst__lineHalfVerticalBottom';\n } else if (i === scaffoldBlockCount - 1) {\n // Last scaffold block in the row, right before the row content\n // +--+--+\n // | | |\n // | +--+\n // | | |\n // +--+--+\n lineClass = 'rst__lineHalfHorizontalRight rst__lineFullVertical';\n } else {\n // Simply connecting the line extending down to the next sibling on this level\n // +--+--+\n // | | |\n // | | |\n // | | |\n // +--+--+\n lineClass = 'rst__lineFullVertical';\n }\n } else if (listIndex === 0) {\n // Top-left corner of the tree, but has no siblings\n // +-----+\n // | |\n // | +--+\n // | |\n // +-----+\n lineClass = 'rst__lineHalfHorizontalRight';\n } else if (i === scaffoldBlockCount - 1) {\n // The last or only node in this level of the tree\n // +--+--+\n // | | |\n // | +--+\n // | |\n // +-----+\n lineClass = 'rst__lineHalfVerticalTop rst__lineHalfHorizontalRight';\n }\n\n scaffold.push(\n <div\n key={`pre_${1 + i}`}\n style={{width: scaffoldBlockPxWidth}}\n className={classnames('rst__lineBlock', lineClass, rowDirectionClass)}\n />\n );\n\n if (treeIndex !== listIndex && i === swapDepth) {\n // This row has been shifted, and is at the depth of\n // the line pointing to the new destination\n let highlightLineClass = '';\n\n if (listIndex === swapFrom + swapLength - 1) {\n // This block is on the bottom (target) line\n // This block points at the target block (where the row will go when released)\n highlightLineClass = 'rst__highlightBottomLeftCorner';\n } else if (treeIndex === swapFrom) {\n // This block is on the top (source) line\n highlightLineClass = 'rst__highlightTopLeftCorner';\n } else {\n // This block is between the bottom and top\n highlightLineClass = 'rst__highlightLineVertical';\n }\n\n let style;\n if (rowDirection === 'rtl') {\n style = {\n width: scaffoldBlockPxWidth,\n right: scaffoldBlockPxWidth * i\n };\n } else {\n // Default ltr\n style = {\n width: scaffoldBlockPxWidth,\n left: scaffoldBlockPxWidth * i\n };\n }\n\n scaffold.push(\n <div\n // eslint-disable-next-line react/no-array-index-key\n key={i}\n style={style}\n className={classnames('rst__absoluteLineBlock', highlightLineClass, rowDirectionClass)}\n />\n );\n }\n });\n\n let style;\n if (rowDirection === 'rtl') {\n style = {right: scaffoldBlockPxWidth * scaffoldBlockCount};\n } else {\n // Default ltr\n style = {left: scaffoldBlockPxWidth * scaffoldBlockCount};\n }\n\n return connectDropTarget(\n <div {...otherProps} className={classnames('rst__node', rowDirectionClass)}>\n {scaffold}\n\n <div className=\"rst__nodeContent\" style={style}>\n {Children.map(children, (child) =>\n cloneElement(child, {\n isOver,\n canDrop,\n draggedNode\n })\n )}\n </div>\n </div>\n );\n};\n\nTreeNode.defaultProps = {\n swapFrom: null,\n swapDepth: null,\n swapLength: null,\n canDrop: false,\n draggedNode: null,\n rowDirection: 'ltr'\n};\n\nTreeNode.propTypes = {\n treeIndex: PropTypes.number.isRequired,\n treeId: PropTypes.string.isRequired,\n swapFrom: PropTypes.number,\n swapDepth: PropTypes.number,\n swapLength: PropTypes.number,\n scaffoldBlockPxWidth: PropTypes.number.isRequired,\n lowerSiblingCounts: PropTypes.arrayOf(PropTypes.number).isRequired,\n\n listIndex: PropTypes.number.isRequired,\n children: PropTypes.node.isRequired,\n\n // Drop target\n connectDropTarget: PropTypes.func.isRequired,\n isOver: PropTypes.bool.isRequired,\n canDrop: PropTypes.bool,\n draggedNode: PropTypes.shape({}),\n\n // used in dndManager\n getPrevRow: PropTypes.func.isRequired,\n node: PropTypes.shape({}).isRequired,\n path: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])).isRequired,\n\n // rtl support\n rowDirection: PropTypes.string\n};\n\nexport default TreeNode;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport {isDescendant} from './utils/tree-data-utils';\nimport classnames from './utils/classnames';\n//import {useStyles} from './nodeRendererDefaultStyle';\n\nconst NodeRendererDefault = ({\n scaffoldBlockPxWidth,\n toggleChildrenVisibility,\n connectDragPreview,\n connectDragSource,\n isDragging,\n canDrop,\n canDrag,\n node,\n title,\n subtitle,\n draggedNode,\n path,\n treeIndex,\n isSearchMatch,\n isSearchFocus,\n buttons,\n className,\n style,\n didDrop,\n /* eslint-disable */\n treeId,\n isOver, // Not needed, but preserved for other renderers\n parentNode, // Needed for dndManager\n /* eslint-enable */\n rowDirection,\n ...otherProps\n}) => {\n //useStyles();\n const nodeTitle = title || node.title;\n const nodeSubtitle = subtitle || node.subtitle;\n const rowDirectionClass = rowDirection === 'rtl' ? 'rst__rtl' : null;\n\n let handle;\n if (canDrag) {\n if (typeof node.children === 'function' && node.expanded) {\n // Show a loading symbol on the handle when the children are expanded\n // and yet still defined by a function (a callback to fetch the children)\n handle = (\n <div className=\"rst__loadingHandle\">\n <div className=\"rst__loadingCircle\">\n {[...new Array(12)].map((_, index) => (\n <div\n // eslint-disable-next-line react/no-array-index-key\n key={index}\n className={classnames('rst__loadingCirclePoint', rowDirectionClass)}\n />\n ))}\n </div>\n </div>\n );\n } else {\n // Show the handle used to initiate a drag-and-drop\n handle = connectDragSource(<div className=\"rst__moveHandle\" />, {\n dropEffect: 'copy'\n });\n }\n }\n\n const isDraggedDescendant = draggedNode && isDescendant(draggedNode, node);\n const isLandingPadActive = !didDrop && isDragging;\n\n let buttonStyle = {left: -0.5 * scaffoldBlockPxWidth};\n if (rowDirection === 'rtl') {\n buttonStyle = {right: -0.5 * scaffoldBlockPxWidth};\n }\n\n return (\n <div style={{height: '100%'}} {...otherProps}>\n {toggleChildrenVisibility &&\n node.children &&\n (node.children.length > 0 || typeof node.children === 'function') && (\n <div>\n <button\n type=\"button\"\n aria-label={node.expanded ? 'Collapse' : 'Expand'}\n className={classnames(\n node.expanded ? 'rst__collapseButton' : 'rst__expandButton',\n rowDirectionClass\n )}\n style={buttonStyle}\n onClick={() =>\n toggleChildrenVisibility({\n node,\n path,\n treeIndex\n })\n }\n />\n\n {node.expanded && !isDragging && (\n <div\n style={{width: scaffoldBlockPxWidth}}\n className={classnames('rst__lineChildren', rowDirectionClass)}\n />\n )}\n </div>\n )}\n\n <div className={classnames('rst__rowWrapper', rowDirectionClass)}>\n {/* Set the row preview to be used during drag and drop */}\n {connectDragPreview(\n <div\n className={classnames(\n 'rst__row',\n isLandingPadActive && 'rst__rowLandingPad',\n isLandingPadActive && !canDrop && 'rst__rowCancelPad',\n isSearchMatch && 'rst__rowSearchMatch',\n isSearchFocus && 'rst__rowSearchFocus',\n rowDirectionClass,\n className\n )}\n style={{\n opacity: isDraggedDescendant ? 0.5 : 1,\n ...style\n }}\n >\n {handle}\n\n <div\n className={classnames(\n 'rst__rowContents',\n !canDrag && 'rst__rowContentsDragDisabled',\n rowDirectionClass\n )}\n >\n <div className={classnames('rst__rowLabel', rowDirectionClass)}>\n <span\n className={classnames(\n 'rst__rowTitle',\n node.subtitle && 'rst__rowTitleWithSubtitle'\n )}\n >\n {typeof nodeTitle === 'function'\n ? nodeTitle({\n node,\n path,\n treeIndex\n })\n : nodeTitle}\n </span>\n\n {nodeSubtitle && (\n <span className=\"rst__rowSubtitle\">\n {typeof nodeSubtitle === 'function'\n ? nodeSubtitle({\n node,\n path,\n treeIndex\n })\n : nodeSubtitle}\n </span>\n )}\n </div>\n\n <div className=\"rst__rowToolbar\">\n {buttons.map((btn, index) => (\n <div\n key={index} // eslint-disable-line react/no-array-index-key\n className=\"rst__toolbarButton\"\n >\n {btn}\n </div>\n ))}\n </div>\n </div>\n </div>\n )}\n </div>\n </div>\n );\n};\n\nNodeRendererDefault.defaultProps = {\n isSearchMatch: false,\n isSearchFocus: false,\n canDrag: false,\n toggleChildrenVisibility: null,\n buttons: [],\n className: '',\n style: {},\n parentNode: null,\n draggedNode: null,\n canDrop: false,\n title: null,\n subtitle: null,\n rowDirection: 'ltr'\n};\n\nNodeRendererDefault.propTypes = {\n node: PropTypes.shape({}).isRequired,\n title: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),\n subtitle: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),\n path: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])).isRequired,\n treeIndex: PropTypes.number.isRequired,\n treeId: PropTypes.string.isRequired,\n isSearchMatch: PropTypes.bool,\n isSearchFocus: PropTypes.bool,\n canDrag: PropTypes.bool,\n scaffoldBlockPxWidth: PropTypes.number.isRequired,\n toggleChildrenVisibility: PropTypes.func,\n buttons: PropTypes.arrayOf(PropTypes.node),\n className: PropTypes.string,\n style: PropTypes.shape({}),\n\n // Drag and drop API functions\n // Drag source\n connectDragPreview: PropTypes.func.isRequired,\n connectDragSource: PropTypes.func.isRequired,\n parentNode: PropTypes.shape({}), // Needed for dndManager\n isDragging: PropTypes.bool.isRequired,\n didDrop: PropTypes.bool.isRequired,\n draggedNode: PropTypes.shape({}),\n // Drop target\n isOver: PropTypes.bool.isRequired,\n canDrop: PropTypes.bool,\n\n // rtl support\n rowDirection: PropTypes.string\n};\n\nexport default NodeRendererDefault;\n","import React, {Children, cloneElement, Component} from 'react';\nimport PropTypes from 'prop-types';\n\nclass TreePlaceholder extends Component {\n render() {\n // eslint-disable-next-line no-unused-vars\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const {children, connectDropTarget, treeId, drop, ...otherProps} = this.props;\n return connectDropTarget(\n <div>\n {Children.map(children, (child) =>\n cloneElement(child, {\n ...otherProps\n })\n )}\n </div>\n );\n }\n}\n\nTreePlaceholder.defaultProps = {\n canDrop: false,\n draggedNode: null\n};\n\nTreePlaceholder.propTypes = {\n children: PropTypes.node.isRequired,\n\n // Drop target\n connectDropTarget: PropTypes.func.isRequired,\n isOver: PropTypes.bool.isRequired,\n canDrop: PropTypes.bool,\n draggedNode: PropTypes.shape({}),\n treeId: PropTypes.string.isRequired,\n drop: PropTypes.func.isRequired\n};\n\nexport default TreePlaceholder;\n","import {makeStyles} from '@material-ui/core/styles';\n\nexport const useStyles = makeStyles(() => ({\n '@global .rst__placeholder': {\n position: 'relative',\n height: '68px',\n maxWidth: '300px',\n padding: '10px'\n },\n '@global .rst__placeholder, .rst__placeholder > *': {\n boxSizing: 'border-box'\n },\n '@global .rst__placeholder::before': {\n border: '3px dashed #d9d9d9',\n content: '',\n position: 'absolute',\n top: '5px',\n right: '5px',\n bottom: '5px',\n left: '5px',\n zIndex: -1\n },\n\n /**\n * The outline of where the element will go if dropped, displayed while dragging\n */\n '@global .rst__placeholderLandingPad, .rst__placeholderCancelPad': {\n border: 'none !important',\n boxShadow: 'none !important',\n outline: 'none !important'\n },\n '@global .rst__placeholderLandingPad *, .rst__placeholderCancelPad *': {\n opacity: '0 !important'\n },\n '@global .rst__placeholderLandingPad::before, .rst__placeholderCancelPad::before': {\n backgroundColor: 'lightblue',\n borderColor: 'white'\n },\n\n /**\n * Alternate appearance of the landing pad when the dragged location is invalid\n */\n '@global .rst__placeholderCancelPad::before': {\n backgroundColor: '#e6a8ad'\n }\n}));\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from './utils/classnames';\nimport {useStyles} from './placeholderRendererDefaultStyle';\n\nconst PlaceholderRendererDefault = ({isOver, canDrop}) => {\n useStyles();\n return (\n <div\n className={classnames(\n 'rst__placeholder',\n canDrop && 'rst__placeholderLandingPad',\n canDrop && !isOver && 'rst__placeholderCancelPad'\n )}\n />\n );\n};\n\nPlaceholderRendererDefault.defaultProps = {\n isOver: false,\n canDrop: false\n};\n\nPlaceholderRendererDefault.propTypes = {\n isOver: PropTypes.bool,\n canDrop: PropTypes.bool\n};\n\nexport default PlaceholderRendererDefault;\n","import {insertNode, getDescendantCount, getFlatDataFromTree} from './tree-data-utils';\n\nconst memoize = (f) => {\n let savedArgsArray = [];\n let savedKeysArray = [];\n let savedResult = null;\n\n return (args) => {\n const keysArray = Object.keys(args).sort();\n const argsArray = keysArray.map((key) => args[key]);\n\n // If the arguments for the last insert operation are different than this time,\n // recalculate the result\n if (\n argsArray.length !== savedArgsArray.length ||\n argsArray.some((arg, index) => arg !== savedArgsArray[index]) ||\n keysArray.some((key, index) => key !== savedKeysArray[index])\n ) {\n savedArgsArray = argsArray;\n savedKeysArray = keysArray;\n savedResult = f(args);\n }\n\n return savedResult;\n };\n};\n\nexport const memoizedInsertNode = memoize(insertNode);\nexport const memoizedGetFlatDataFromTree = memoize(getFlatDataFromTree);\nexport const memoizedGetDescendantCount = memoize(getDescendantCount);\n","import {DragSource as dragSource, DropTarget as dropTarget} from 'react-dnd';\nimport {findDOMNode} from 'react-dom';\nimport {equals} from 'ramda';\nimport {getDepth} from './tree-data-utils';\nimport {memoizedInsertNode} from './memoized-tree-data-utils';\n\nexport default class DndManager {\n constructor(treeRef) {\n this.treeRef = treeRef;\n this.resetDragVariables();\n }\n\n get startDrag() {\n return this.treeRef.startDrag;\n }\n\n get dragHover() {\n return this.treeRef.dragHover;\n }\n\n get endDrag() {\n return this.treeRef.endDrag;\n }\n\n get drop() {\n return this.treeRef.drop;\n }\n\n get treeId() {\n return this.treeRef.treeId;\n }\n\n get dndType() {\n return this.treeRef.dndType;\n }\n\n get treeData() {\n return this.treeRef.state.draggingTreeData || this.treeRef.props.treeData;\n }\n\n get getNodeKey() {\n return this.treeRef.props.getNodeKey;\n }\n\n get customCanDrop() {\n return this.treeRef.props.canDrop;\n }\n\n get maxDepth() {\n return this.treeRef.props.maxDepth;\n }\n\n resetDragVariables() {\n this.lastDropTargetNode = null;\n this.lastDropTargetDepth = null;\n this.hoverProps = null;\n this.lastCanDropResult = null;\n this.lastCanDropProps = null;\n this.shouldSkipMoreFrames = false;\n this.rafId = null;\n }\n getTargetDepth(dropTargetProps, monitor, component) {\n let dropTargetDepth = 0;\n\n const rowAbove = dropTargetProps.getPrevRow();\n if (rowAbove) {\n let {path} = rowAbove;\n const aboveNodeCannotHaveChildren = !this.treeRef.canNodeHaveChildren(rowAbove.node);\n if (aboveNodeCannotHaveChildren) {\n path = path.slice(0, path.length - 1);\n }\n\n // Limit the length of the path to the deepest possible\n dropTargetDepth = Math.min(path.length, dropTargetProps.path.length);\n }\n\n let blocksOffset;\n let dragSourceInitialDepth = (monitor.getItem().path || []).length;\n\n // When adding node from external source\n if (monitor.getItem().treeId !== this.treeId) {\n // Ignore the tree depth of the source, if it had any to begin with\n dragSourceInitialDepth = 0;\n\n if (component) {\n const relativePosition = findDOMNode(component).getBoundingClientRect(); // eslint-disable-line react/no-find-dom-node\n const leftShift = monitor.getSourceClientOffset().x - relativePosition.left;\n blocksOffset = Math.round(leftShift / dropTargetProps.scaffoldBlockPxWidth);\n } else {\n blocksOffset = dropTargetProps.path.length;\n }\n } else {\n // handle row direction support\n const direction = dropTargetProps.rowDirection === 'rtl' ? -1 : 1;\n\n blocksOffset = Math.round(\n (direction * monitor.getDifferenceFromInitialOffset().x) / dropTargetProps.scaffoldBlockPxWidth\n );\n }\n\n let targetDepth = Math.min(dropTargetDepth, Math.max(0, dragSourceInitialDepth + blocksOffset - 1));\n\n // If a maxDepth is defined, constrain the target depth\n if (typeof this.maxDepth !== 'undefined' && this.maxDepth !== null) {\n const draggedNode = monitor.getItem().node;\n const draggedChildDepth = getDepth(draggedNode);\n\n targetDepth = Math.max(0, Math.min(targetDepth, this.maxDepth - draggedChildDepth - 1));\n }\n\n return targetDepth;\n }\n\n canDrop(dropTargetProps, monitor) {\n if (!monitor.isOver()) {\n return false;\n }\n\n const rowAbove = dropTargetProps.getPrevRow();\n const abovePath = rowAbove ? rowAbove.path : [];\n const aboveNode = rowAbove ? rowAbove.node : {};\n const blocksOffset = Math.round(\n monitor.getDifferenceFromInitialOffset().x / dropTargetProps.scaffoldBlockPxWidth\n );\n const newCanDropProps = {\n nodeId: dropTargetProps.node.nodeId !== undefined ? dropTargetProps.node.nodeId : dropTargetProps.node,\n rowAbove,\n abovePath,\n aboveNodeId: aboveNode.nodeId !== undefined ? aboveNode.nodeId : aboveNode,\n blocksOffset\n };\n if (equals(this.lastCanDropProps, newCanDropProps)) {\n return this.lastCanDropResult;\n }\n this.lastCanDropProps = newCanDropProps;\n const targetDepth = this.getTargetDepth(dropTargetProps, monitor, null);\n\n // Cannot drop if we're adding to the children of the row above and\n // the row above is a function\n if (targetDepth >= abovePath.length && typeof aboveNode.children === 'function') {\n return (this.lastCanDropResult = false);\n }\n\n if (typeof this.customCanDrop === 'function') {\n const {node} = monitor.getItem();\n const addedResult = memoizedInsertNode({\n treeData: this.treeData,\n newNode: node,\n depth: targetDepth,\n getNodeKey: this.getNodeKey,\n minimumTreeIndex: dropTargetProps.listIndex,\n expandParent: true\n });\n\n return (this.lastCanDropResult = this.customCanDrop({\n node,\n prevPath: monitor.getItem().path,\n prevParent: monitor.getItem().parentNode,\n prevTreeIndex: monitor.getItem().treeIndex, // Equals -1 when dragged from external tree\n nextPath: addedResult.path,\n nextParent: addedResult.parentNode,\n nextTreeIndex: addedResult.treeIndex\n }));\n }\n return (this.lastCanDropResult = true);\n }\n\n wrapSource(el) {\n const nodeDragSource = {\n beginDrag: (props) => {\n this.startDrag(props);\n\n return {\n node: props.node,\n parentNode: props.parentNode,\n path: props.path,\n treeIndex: props.treeIndex,\n treeId: props.treeId\n };\n },\n\n endDrag: (props, monitor) => {\n if (this.rafId) {\n cancelAnimationFrame(this.rafId);\n }\n this.endDrag(monitor.getDropResult());\n this.resetDragVariables();\n },\n\n isDragging: (props, monitor) => {\n const dropTargetNode = monitor.getItem().node;\n const draggedNode = props.node;\n\n return draggedNode === dropTargetNode;\n }\n };\n\n function nodeDragSourcePropInjection(connect, monitor) {\n return {\n connectDragSource: connect.dragSource(),\n connectDragPreview: connect.dragPreview(),\n isDragging: monitor.isDragging(),\n didDrop: monitor.didDrop()\n };\n }\n\n return dragSource(this.dndType, nodeDragSource, nodeDragSourcePropInjection)(el);\n }\n hoverHandler = () => {\n if (this.hoverProps === null) {\n return;\n }\n const {dropTargetProps, monitor, component} = this.hoverProps;\n\n const item = monitor.getItem();\n if (!item) {\n return;\n }\n const targetDepth = this.getTargetDepth(dropTargetProps, monitor, component);\n const draggedNode = item.node;\n const needsRedraw =\n dropTargetProps.node !== this.lastDropTargetNode || targetDepth !== this.lastDropTargetDepth;\n\n if (!needsRedraw) {\n return;\n }\n this.lastDropTargetNode = dropTargetProps.node;\n this.lastDropTargetDepth = targetDepth;\n\n this.dragHover({\n node: draggedNode,\n path: item.path,\n minimumTreeIndex: dropTargetProps.listIndex,\n depth: targetDepth\n });\n\n this.hoverProps = null;\n };\n\n deferredCallHoverHandler = () => {\n if (this.shouldSkipMoreFrames) {\n this.shouldSkipMoreFrames = false;\n this.rafId = requestAnimationFrame(this.deferredCallHoverHandler);\n return;\n }\n this.rafId = null;\n this.hoverHandler();\n };\n\n wrapTarget(el) {\n const nodeDropTarget = {\n drop: (dropTargetProps, monitor, component) => {\n if (this.rafId) {\n cancelAnimationFrame(this.rafId);\n }\n const result = {\n node: monitor.getItem().node,\n path: monitor.getItem().path,\n treeIndex: monitor.getItem().treeIndex,\n treeId: this.treeId,\n minimumTreeIndex: dropTargetProps.treeIndex,\n depth: this.getTargetDepth(dropTargetProps, monitor, component)\n };\n this.lastDropTargetNode = null;\n this.drop(result);\n\n return result;\n },\n\n hover: (dropTargetProps, monitor, component) => {\n if (this.rafId) {\n this.shouldSkipMoreFrames = true;\n return;\n }\n this.shouldSkipMoreFrames = false;\n this.hoverProps = {\n dropTargetProps,\n monitor,\n component\n };\n this.rafId = requestAnimationFrame(this.deferredCallHoverHandler);\n },\n\n canDrop: this.canDrop.bind(this)\n };\n\n function nodeDropTargetPropInjection(connect, monitor) {\n const dragged = monitor.getItem();\n return {\n connectDropTarget: connect.dropTarget(),\n isOver: monitor.isOver(),\n canDrop: monitor.canDrop(),\n draggedNode: dragged ? dragged.node : null\n };\n }\n\n return dropTarget(this.dndType, nodeDropTarget, nodeDropTargetPropInjection)(el);\n }\n\n wrapPlaceholder(el) {\n const placeholderDropTarget = {\n drop: (dropTargetProps, monitor) => {\n const {node, path, treeIndex} = monitor.getItem();\n const result = {\n node,\n path,\n treeIndex,\n treeId: this.treeId,\n minimumTreeIndex: 0,\n depth: 0\n };\n\n this.drop(result);\n\n return result;\n }\n };\n\n function placeholderPropInjection(connect, monitor) {\n const dragged = monitor.getItem();\n return {\n connectDropTarget: connect.dropTarget(),\n isOver: monitor.isOver(),\n canDrop: monitor.canDrop(),\n draggedNode: dragged ? dragged.node : null\n };\n }\n\n return dropTarget(this.dndType, placeholderDropTarget, placeholderPropInjection)(el);\n }\n}\n","import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport {AutoSizer, List} from 'react-virtualized';\nimport {equals, append, when, always, gt, uniqWith, eqBy, pipe} from 'ramda';\nimport withScrolling, {\n createScrollingComponent,\n createVerticalStrength,\n createHorizontalStrength\n} from 'frontend-collective-react-dnd-scrollzone';\nimport {DndContext} from 'react-dnd';\nimport {polyfill} from 'react-lifecycles-compat';\nimport {withStyles} from '@material-ui/core/styles';\nimport {DragAndDrop} from '../DragAndDrop/DragAndDrop';\nimport TreeNode from './tree-node';\nimport NodeRendererDefault from './node-renderer-default';\nimport TreePlaceholder from './tree-placeholder';\nimport PlaceholderRendererDefault from './placeholder-renderer-default';\nimport {walk, changeNodeAtPath, removeNode, insertNode, find, toggleExpandedForAll} from './utils/tree-data-utils';\nimport {\n memoizedInsertNode,\n memoizedGetFlatDataFromTree,\n memoizedGetDescendantCount\n} from './utils/memoized-tree-data-utils';\nimport {slideRows} from './utils/generic-utils';\nimport {defaultGetNodeKey, defaultSearchMethod} from './utils/default-handlers';\nimport DndManager from './utils/dnd-manager';\nimport classnames from './utils/classnames';\nimport {styles} from './reactSortableTreeStyles';\n\nlet treeIdCounter = 1;\n\nconst mergeTheme = (props) => {\n const merged = {\n ...props,\n style: {...props.theme.style, ...props.style},\n innerStyle: {...props.theme.innerStyle, ...props.innerStyle},\n reactVirtualizedListProps: {\n ...props.theme.reactVirtualizedListProps,\n ...props.reactVirtualizedListProps\n }\n };\n\n const overridableDefaults = {\n nodeContentRenderer: NodeRendererDefault,\n placeholderRenderer: PlaceholderRendererDefault,\n rowHeight: 62,\n scaffoldBlockPxWidth: 44,\n slideRegionSize: 100,\n treeNodeRenderer: TreeNode\n };\n Object.keys(overridableDefaults).forEach((propKey) => {\n // If prop has been specified, do not change it\n // If prop is specified in theme, use the theme setting\n // If all else fails, fall back to the default\n if (props[propKey] === null) {\n merged[propKey] =\n typeof props.theme[propKey] !== 'undefined' ? props.theme[propKey] : overridableDefaults[propKey];\n }\n });\n\n return merged;\n};\n\nclass ReactSortableTree extends Component {\n constructor(props) {\n super(props);\n\n const {dndType, nodeContentRenderer, treeNodeRenderer, isVirtualized, slideRegionSize} = mergeTheme(props);\n\n this.dndManager = new DndManager(this);\n\n // Wrapping classes for use with react-dnd\n this.treeId = `rst__${treeIdCounter}`;\n treeIdCounter += 1;\n this.dndType = dndType || this.treeId;\n this.nodeContentRenderer = this.dndManager.wrapSource(nodeContentRenderer);\n this.treePlaceholderRenderer = this.dndManager.wrapPlaceholder(TreePlaceholder);\n this.treeNodeRenderer = this.dndManager.wrapTarget(treeNodeRenderer);\n\n // Prepare scroll-on-drag options for this list\n if (isVirtualized) {\n this.scrollZoneVirtualList = (createScrollingComponent || withScrolling)(List);\n this.vStrength = createVerticalStrength(slideRegionSize);\n this.hStrength = createHorizontalStrength(slideRegionSize);\n }\n\n this.state = {\n draggingTreeData: null,\n draggedNode: null,\n draggedMinimumTreeIndex: null,\n draggedDepth: null,\n searchMatches: [],\n searchFocusTreeIndex: null,\n dragging: false,\n draggingExpandedPaths: [],\n ignoreOneTreeUpdate: false,\n\n // props that need to be used in gDSFP or static functions will be stored here\n instanceProps: {\n treeData: this.props.treeData || [],\n searchQuery: null,\n searchFocusOffset: null,\n ignoreTreeChanges: false\n }\n };\n\n this.toggleChildrenVisibility = this.toggleChildrenVisibility.bind(this);\n this.moveNode = this.moveNode.bind(this);\n this.startDrag = this.startDrag.bind(this);\n this.dragHover = this.dragHover.bind(this);\n this.endDrag = this.endDrag.bind(this);\n this.drop = this.drop.bind(this);\n this.handleDndMonitorChange = this.handleDndMonitorChange.bind(this);\n }\n\n componentDidMount() {\n ReactSortableTree.loadLazyChildren(this.props);\n const stateUpdate = ReactSortableTree.search(this.props, this.state, true, true, false);\n this.setState(stateUpdate);\n\n // Hook into react-dnd state changes to detect when the drag ends\n // TODO: This is very brittle, so it needs to be replaced if react-dnd\n // offers a more official way to detect when a drag ends\n this.clearMonitorSubscription = this.props.dragDropManager\n .getMonitor()\n .subscribeToStateChange(this.handleDndMonitorChange);\n }\n\n static getDerivedStateFromProps(nextProps, prevState) {\n const {instanceProps} = prevState;\n const newState = {};\n\n if (!equals(instanceProps.searchQuery, nextProps.searchQuery)) {\n Object.assign(newState, ReactSortableTree.search(nextProps, prevState, true, true, false));\n } else if (instanceProps.searchFocusOffset !== nextProps.searchFocusOffset) {\n Object.assign(newState, ReactSortableTree.search(nextProps, prevState, true, true, true));\n }\n\n instanceProps.searchQuery = nextProps.searchQuery;\n instanceProps.searchFocusOffset = nextProps.searchFocusOffset;\n newState.instanceProps = instanceProps;\n\n return newState;\n }\n\n // listen to dragging\n componentDidUpdate(prevProps, prevState) {\n // if it is not the same then call the onDragStateChanged\n if (this.state.dragging !== prevState.dragging) {\n if (this.props.onDragStateChanged) {\n this.props.onDragStateChanged({\n isDragging: this.state.dragging,\n draggedNode: this.state.draggedNode\n });\n }\n }\n if (this.state.dragging) {\n const isTreeDataEqual = equals(this.props.treeData, prevProps.treeData);\n if (!isTreeDataEqual) {\n const {treeData: draggingTreeData} = removeNode({\n treeData: this.props.treeData,\n path: prevState.draggedPath,\n getNodeKey: this.props.getNodeKey\n });\n\n this.setState(({draggingExpandedPaths}) => ({\n draggingTreeData: draggingExpandedPaths.reduce((treeData, path) => {\n let newTree;\n try {\n newTree = changeNodeAtPath({\n treeData,\n path,\n newNode: ({node}) => ({...node, expanded: true}),\n getNodeKey: this.props.getNodeKey\n });\n } catch (e) {\n newTree = treeData;\n }\n return newTree;\n }, draggingTreeData)\n }));\n } else if (this.state.draggingTreeData && prevState.draggingTreeData !== this.state.draggingTreeData) {\n walk({\n treeData: this.state.draggingTreeData,\n getNodeKey: this.props.getNodeKey,\n callback: ({node, path, lowerSiblingCounts, treeIndex}) => {\n if (node.pending && node.expanded) {\n this.props.onLazyLoadChildren({\n node,\n path,\n lowerSiblingCounts,\n treeIndex\n });\n }\n }\n });\n }\n } else if (this.props.treeData !== prevProps.treeData) {\n const isTreeDataEqual = equals(this.props.treeData, prevProps.treeData);\n const {ignoreOneTreeUpdate, instanceProps} = this.state;\n const newState = {};\n if (!isTreeDataEqual) {\n if (ignoreOneTreeUpdate) {\n newState.ignoreOneTreeUpdate = false;\n } else {\n newState.searchFocusTreeIndex = null;\n ReactSortableTree.loadLazyChildren(this.props);\n Object.assign(newState, ReactSortableTree.search(this.props, this.state, false, false, false));\n }\n\n newState.draggingTreeData = null;\n newState.draggedNode = null;\n newState.draggedMinimumTreeIndex = null;\n newState.draggedDepth = null;\n newState.dragging = false;\n newState.draggingExpandedPaths = [];\n newState.instanceProps = {...instanceProps, treeData: this.props.treeData};\n\n this.setState(newState);\n }\n }\n }\n\n componentWillUnmount() {\n this.clearMonitorSubscription();\n }\n\n getRows(treeData) {\n return memoizedGetFlatDataFromTree({\n ignoreCollapsed: true,\n getNodeKey: this.props.getNodeKey,\n treeData\n });\n }\n\n handleDndMonitorChange() {\n const monitor = this.props.dragDropManager.getMonitor();\n // If the drag ends and the tree is still in a mid-drag state,\n // it means that the drag was canceled or the dragSource dropped\n // elsewhere, and we should reset the state of this tree\n if (!monitor.isDragging() && this.state.draggingTreeData) {\n this.endDrag();\n }\n }\n\n toggleChildrenVisibility({node: targetNode, path}) {\n const {instanceProps} = this.state;\n\n const treeData = changeNodeAtPath({\n treeData: instanceProps.treeData,\n path,\n newNode: ({node}) => ({...node, expanded: !node.expanded}),\n getNodeKey: this.props.getNodeKey\n });\n\n this.props.onChange(treeData);\n\n this.props.onVisibilityToggle({\n treeData,\n node: targetNode,\n expanded: !targetNode.expanded,\n path\n });\n }\n\n moveNode({node, path: prevPath, treeIndex: prevTreeIndex, depth, minimumTreeIndex}) {\n const {treeData, treeIndex, path, parentNode: nextParentNode} = insertNode({\n treeData: this.state.draggingTreeData,\n newNode: node,\n depth,\n minimumTreeIndex,\n expandParent: true,\n getNodeKey: this.props.getNodeKey\n });\n this.setState(\n {\n draggingTreeData: null,\n draggedNode: null,\n draggedMinimumTreeIndex: null,\n draggedDepth: null,\n dragging: false,\n draggingExpandedPaths: []\n },\n () => {\n this.props.onChange(treeData);\n\n this.props.onMoveNode({\n treeData,\n node,\n treeIndex,\n path,\n nextPath: path,\n nextTreeIndex: treeIndex,\n prevPath,\n prevTreeIndex,\n nextParentNode\n });\n }\n );\n }\n\n // returns the new state after search\n static search(props, state, seekIndex, expand, singleSearch) {\n const {\n onChange,\n getNodeKey,\n searchFinishCallback,\n searchQuery,\n searchMethod,\n searchFocusOffset,\n onlyExpandSearchedNodes\n } = props;\n\n const {instanceProps} = state;\n\n // Skip search if no conditions are specified\n if (!searchQuery && !searchMethod) {\n if (searchFinishCallback) {\n searchFinishCallback([]);\n }\n\n return {searchMatches: []};\n }\n\n const newState = {};\n\n // if onlyExpandSearchedNodes collapse the tree and search\n const {treeData: expandedTreeData, matches: searchMatches} = find({\n getNodeKey,\n treeData: onlyExpandSearchedNodes\n ? toggleExpandedForAll({\n treeData: instanceProps.treeData,\n expanded: false\n })\n : instanceProps.treeData,\n searchQuery,\n searchMethod: searchMethod || defaultSearchMethod,\n searchFocusOffset,\n expandAllMatchPaths: expand && !singleSearch,\n expandFocusMatchPaths: !!expand\n });\n\n // Update the tree with data leaving all paths leading to matching nodes open\n if (expand) {\n newState.ignoreOneTreeUpdate = true; // Prevents infinite loop\n onChange(expandedTreeData);\n }\n\n if (searchFinishCallback) {\n searchFinishCallback(searchMatches);\n }\n\n let searchFocusTreeIndex = null;\n if (seekIndex && searchFocusOffset !== null && searchFocusOffset < searchMatches.length) {\n searchFocusTreeIndex = searchMatches[searchFocusOffset].treeIndex;\n }\n\n newState.searchMatches = searchMatches;\n newState.searchFocusTreeIndex = searchFocusTreeIndex;\n\n return newState;\n }\n\n startDrag({path}) {\n this.setState((prevState) => {\n const {treeData: draggingTreeData, node: draggedNode, treeIndex: draggedMinimumTreeIndex} = removeNode({\n treeData: prevState.instanceProps.treeData,\n path,\n getNodeKey: this.props.getNodeKey\n });\n\n return {\n draggingTreeData,\n draggedNode,\n draggedDepth: path.length - 1,\n draggedMinimumTreeIndex,\n draggedPath: path,\n dragging: true\n };\n });\n }\n\n dragHover({node: draggedNode, depth: draggedDepth, minimumTreeIndex: draggedMinimumTreeIndex}) {\n // Ignore this hover if it is at the same position as the last hover\n if (\n this.state.draggedDepth === draggedDepth &&\n this.state.draggedMinimumTreeIndex === draggedMinimumTreeIndex\n ) {\n return;\n }\n this.setState(({draggingTreeData, instanceProps, draggingExpandedPaths}) => {\n // Fall back to the tree data if something is being dragged in from\n // an external element\n const newDraggingTreeData = draggingTreeData || instanceProps.treeData;\n\n const addedResult = memoizedInsertNode({\n treeData: newDraggingTreeData,\n newNode: draggedNode,\n depth: draggedDepth,\n minimumTreeIndex: draggedMinimumTreeIndex,\n expandParent: true,\n getNodeKey: this.props.getNodeKey\n });\n\n const rows = this.getRows(addedResult.treeData);\n const expandedParentPath = rows[addedResult.treeIndex].path;\n const nodePath = expandedParentPath.slice(0, -1);\n\n const newDraggingExpandedPaths = pipe(\n when(always(gt(nodePath.length, 0)), append(nodePath)),\n uniqWith(eqBy(String))\n )(draggingExpandedPaths);\n return {\n draggedNode,\n draggedDepth,\n draggedMinimumTreeIndex,\n draggingTreeData: changeNodeAtPath({\n treeData: newDraggingTreeData,\n path: nodePath,\n newNode: ({node}) => ({...node, expanded: true}),\n getNodeKey: this.props.getNodeKey\n }),\n // reset the scroll focus so it doesn't jump back\n // to a search result while dragging\n searchFocusTreeIndex: null,\n dragging: true,\n draggingExpandedPaths: newDraggingExpandedPaths\n };\n });\n }\n\n endDrag(dropResult) {\n const {instanceProps} = this.state;\n\n const resetTree = () =>\n this.setState({\n draggingTreeData: null,\n draggedNode: null,\n draggedMinimumTreeIndex: null,\n draggedDepth: null,\n dragging: false\n });\n\n // Drop was cancelled\n if (!dropResult) {\n resetTree();\n } else if (dropResult.treeId !== this.treeId) {\n // The node was dropped in an external drop target or tree\n const {node, path, treeIndex} = dropResult;\n let shouldCopy = this.props.shouldCopyOnOutsideDrop;\n if (typeof shouldCopy === 'function') {\n shouldCopy = shouldCopy({\n node,\n prevTreeIndex: treeIndex,\n prevPath: path\n });\n }\n\n let treeData = this.state.draggingTreeData || instanceProps.treeData;\n\n // If copying is enabled, a drop outside leaves behind a copy in the\n // source tree\n if (shouldCopy) {\n treeData = changeNodeAtPath({\n treeData: instanceProps.treeData, // use treeData unaltered by the drag operation\n path,\n newNode: ({node: copyNode}) => ({...copyNode}), // create a shallow copy of the node\n getNodeKey: this.props.getNodeKey\n });\n }\n\n this.props.onChange(treeData);\n\n this.props.onMoveNode({\n treeData,\n node,\n treeIndex: null,\n path: null,\n nextPath: null,\n nextTreeIndex: null,\n prevPath: path,\n prevTreeIndex: treeIndex\n });\n }\n }\n\n drop(dropResult) {\n this.moveNode(dropResult);\n }\n\n canNodeHaveChildren(node) {\n const {canNodeHaveChildren} = this.props;\n if (canNodeHaveChildren) {\n return canNodeHaveChildren(node);\n }\n return true;\n }\n\n // Load any children in the tree that are given by a function\n // calls the onChange callback on the new treeData\n static loadLazyChildren(props) {\n walk({\n treeData: props.treeData,\n getNodeKey: props.getNodeKey,\n callback: ({node, path, lowerSiblingCounts, treeIndex}) => {\n // If the node has children defined by a function, and is either expanded\n // or set to load even before expansion, run the function.\n if (node.pending && (node.expanded || props.loadCollapsedLazyChildren)) {\n // Call the children fetching function\n props.onLazyLoadChildren({\n node,\n path,\n lowerSiblingCounts,\n treeIndex,\n\n // Provide a helper to append the new data when it is received\n done: (childrenArray) =>\n props.onChange(\n changeNodeAtPath({\n treeData: props.treeData,\n path,\n newNode: ({node: oldNode}) =>\n // Only replace the old node if it's the one we set off to find children\n // for in the first place\n oldNode === node\n ? {\n ...oldNode,\n children: childrenArray\n }\n : oldNode,\n getNodeKey: props.getNodeKey\n }),\n true\n )\n });\n }\n }\n });\n }\n\n renderRow(row, {listIndex, style, getPrevRow, matchKeys, swapFrom, swapDepth, swapLength}) {\n const {node, parentNode, path, lowerSiblingCounts, treeIndex} = row;\n\n const {canDrag, generateNodeProps, scaffoldBlockPxWidth, searchFocusOffset, rowDirection} = mergeTheme(\n this.props\n );\n const TreeNodeRenderer = this.treeNodeRenderer;\n const NodeContentRenderer = this.nodeContentRenderer;\n const nodeKey = path[path.length - 1];\n const isSearchMatch = nodeKey in matchKeys;\n const isSearchFocus = isSearchMatch && matchKeys[nodeKey] === searchFocusOffset;\n const callbackParams = {\n node,\n parentNode,\n path,\n lowerSiblingCounts,\n treeIndex,\n isSearchMatch,\n isSearchFocus\n };\n const nodeProps = !generateNodeProps ? {} : generateNodeProps(callbackParams);\n const rowCanDrag = typeof canDrag !== 'function' ? canDrag : canDrag(callbackParams);\n\n const sharedProps = {\n treeIndex,\n scaffoldBlockPxWidth,\n node,\n path,\n treeId: this.treeId,\n rowDirection\n };\n\n return (\n <TreeNodeRenderer\n style={style}\n key={nodeKey}\n listIndex={listIndex}\n getPrevRow={getPrevRow}\n lowerSiblingCounts={lowerSiblingCounts}\n swapFrom={swapFrom}\n swapLength={swapLength}\n swapDepth={swapDepth}\n {...sharedProps}\n >\n <NodeContentRenderer\n parentNode={parentNode}\n isSearchMatch={isSearchMatch}\n isSearchFocus={isSearchFocus}\n canDrag={rowCanDrag}\n toggleChildrenVisibility={this.toggleChildrenVisibility}\n {...sharedProps}\n {...nodeProps}\n />\n </TreeNodeRenderer>\n );\n }\n\n render() {\n const {\n dragDropManager,\n style,\n className,\n innerStyle,\n rowHeight,\n isVirtualized,\n placeholderRenderer,\n reactVirtualizedListProps,\n getNodeKey,\n rowDirection\n } = mergeTheme(this.props);\n const {searchMatches, searchFocusTreeIndex, draggedNode, draggedDepth, draggedMinimumTreeIndex} = this.state;\n\n const treeData = this.state.draggingTreeData || this.props.treeData;\n const rowDirectionClass = rowDirection === 'rtl' ? 'rst__rtl' : null;\n\n let rows;\n let swapFrom = null;\n let swapLength = null;\n if (draggedNode && draggedMinimumTreeIndex !== null) {\n const addedResult = memoizedInsertNode({\n treeData,\n newNode: draggedNode,\n depth: draggedDepth,\n minimumTreeIndex: draggedMinimumTreeIndex,\n expandParent: true,\n getNodeKey\n });\n\n const swapTo = draggedMinimumTreeIndex;\n swapFrom = addedResult.treeIndex;\n swapLength = 1 + memoizedGetDescendantCount({node: draggedNode});\n rows = slideRows(this.getRows(addedResult.treeData), swapFrom, swapTo, swapLength);\n } else {\n rows = this.getRows(treeData);\n }\n\n // Get indices for rows that match the search conditions\n const matchKeys = {};\n searchMatches.forEach(({path}, i) => {\n matchKeys[path[path.length - 1]] = i;\n });\n\n // Seek to the focused search result if there is one specified\n const scrollToInfo = searchFocusTreeIndex !== null ? {scrollToIndex: searchFocusTreeIndex} : {};\n\n let containerStyle = style;\n let list;\n if (rows.length < 1) {\n const Placeholder = this.treePlaceholderRenderer;\n const PlaceholderContent = placeholderRenderer;\n list = (\n <Placeholder treeId={this.treeId} drop={this.drop}>\n <PlaceholderContent />\n </Placeholder>\n );\n } else if (isVirtualized) {\n containerStyle = {height: '100%', ...containerStyle};\n\n const ScrollZoneVirtualList = this.scrollZoneVirtualList;\n // Render list with react-virtualized\n list = (\n <AutoSizer>\n {({height, width}) => (\n <ScrollZoneVirtualList\n {...scrollToInfo}\n dragDropManager={dragDropManager}\n verticalStrength={this.vStrength}\n horizontalStrength={this.hStrength}\n speed={30}\n scrollToAlignment=\"start\"\n className={this.props.classes.rst__virtualScrollOverride}\n width={width}\n onScroll={({scrollTop}) => {\n this.scrollTop = scrollTop;\n }}\n height={height}\n style={innerStyle}\n rowCount={rows.length}\n estimatedRowSize={typeof rowHeight !== 'function' ? rowHeight : undefined}\n rowHeight={\n typeof rowHeight !== 'function'\n ? rowHeight\n : ({index}) =>\n rowHeight({\n index,\n treeIndex: index,\n node: rows[index].node,\n path: rows[index].path\n })\n }\n rowRenderer={({index, style: rowStyle}) =>\n this.renderRow(rows[index], {\n listIndex: index,\n style: rowStyle,\n getPrevRow: () => rows[index - 1] || null,\n matchKeys,\n swapFrom,\n swapDepth: draggedDepth,\n swapLength\n })\n }\n {...reactVirtualizedListProps}\n />\n )}\n </AutoSizer>\n );\n } else {\n // Render list without react-virtualized\n list = rows.map((row, index) =>\n this.renderRow(row, {\n listIndex: index,\n style: {\n height:\n typeof rowHeight !== 'function'\n ? rowHeight\n : rowHeight({\n index,\n treeIndex: index,\n node: row.node,\n path: row.path\n })\n },\n getPrevRow: () => rows[index - 1] || null,\n matchKeys,\n swapFrom,\n swapDepth: draggedDepth,\n swapLength\n })\n );\n }\n\n return (\n <div className={classnames('rst__tree', className, rowDirectionClass)} style={containerStyle}>\n {list}\n </div>\n );\n }\n}\n\nReactSortableTree.propTypes = {\n classes: PropTypes.object,\n dragDropManager: PropTypes.shape({\n getMonitor: PropTypes.func\n }).isRequired,\n\n // Tree data in the following format:\n // [{title: 'main', subtitle: 'sub'}, { title: 'value2', expanded: true, children: [{ title: 'value3') }] }]\n // `title` is the primary label for the node\n // `subtitle` is a secondary label for the node\n // `expanded` shows children of the node if true, or hides them if false. Defaults to false.\n // `children` is an array of child nodes belonging to the node.\n treeData: PropTypes.arrayOf(PropTypes.object).isRequired,\n\n // Style applied to the container wrapping the tree (style defaults to {height: '100%'})\n style: PropTypes.shape({}),\n\n // Class name for the container wrapping the tree\n className: PropTypes.string,\n\n // Style applied to the inner, scrollable container (for padding, etc.)\n innerStyle: PropTypes.shape({}),\n\n // Used by react-virtualized\n // Either a fixed row height (number) or a function that returns the\n // height of a row given its index: `({ index: number }): number`\n rowHeight: PropTypes.oneOfType([PropTypes.number, PropTypes.func]),\n\n // Size in px of the region near the edges that initiates scrolling on dragover\n slideRegionSize: PropTypes.number,\n\n // Custom properties to hand to the react-virtualized list\n // https://github.com/bvaughn/react-virtualized/blob/master/docs/List.md#prop-types\n reactVirtualizedListProps: PropTypes.shape({}),\n\n // The width of the blocks containing the lines representing the structure of the tree.\n scaffoldBlockPxWidth: PropTypes.number,\n\n // Maximum depth nodes can be inserted at. Defaults to infinite.\n maxDepth: PropTypes.number,\n\n // The method used to search nodes.\n // Defaults to a function that uses the `searchQuery` string to search for nodes with\n // matching `title` or `subtitle` values.\n // NOTE: Changing `searchMethod` will not update the search, but changing the `searchQuery` will.\n searchMethod: PropTypes.func,\n\n // Used by the `searchMethod` to highlight and scroll to matched nodes.\n // Should be a string for the default `searchMethod`, but can be anything when using a custom search.\n searchQuery: PropTypes.any, // eslint-disable-line react/forbid-prop-types\n\n // Outline the <`searchFocusOffset`>th node and scroll to it.\n searchFocusOffset: PropTypes.number,\n\n // Get the nodes that match the search criteria. Used for counting total matches, etc.\n searchFinishCallback: PropTypes.func,\n\n // Generate an object with additional props to be passed to the node renderer.\n // Use this for adding buttons via the `buttons` key,\n // or additional `style` / `className` settings.\n generateNodeProps: PropTypes.func,\n\n // Set to false to disable virtualization.\n // NOTE: Auto-scrolling while dragging, and scrolling to the `searchFocusOffset` will be disabled.\n isVirtualized: PropTypes.bool,\n\n treeNodeRenderer: PropTypes.func,\n\n // Override the default component for rendering nodes (but keep the scaffolding generator)\n // This is an advanced option for complete customization of the appearance.\n // It is best to copy the component in `node-renderer-default.js` to use as a base, and customize as needed.\n nodeContentRenderer: PropTypes.func,\n\n // Override the default component for rendering an empty tree\n // This is an advanced option for complete customization of the appearance.\n // It is best to copy the component in `placeholder-renderer-default.js` to use as a base,\n // and customize as needed.\n placeholderRenderer: PropTypes.func,\n\n theme: PropTypes.shape({\n style: PropTypes.shape({}),\n innerStyle: PropTypes.shape({}),\n reactVirtualizedListProps: PropTypes.shape({}),\n scaffoldBlockPxWidth: PropTypes.number,\n slideRegionSize: PropTypes.number,\n rowHeight: PropTypes.oneOfType([PropTypes.number, PropTypes.func]),\n treeNodeRenderer: PropTypes.func,\n nodeContentRenderer: PropTypes.func,\n placeholderRenderer: PropTypes.func\n }),\n\n // Determine the unique key used to identify each node and\n // generate the `path` array passed in callbacks.\n // By default, returns the index in the tree (omitting hidden nodes).\n getNodeKey: PropTypes.func,\n\n // Called whenever tree data changed.\n // Just like with React input elements, you have to update your\n // own component's data to see the changes reflected.\n onChange: PropTypes.func.isRequired,\n\n // Called after node move operation.\n onMoveNode: PropTypes.func,\n\n // Determine whether a node can be dragged. Set to false to disable dragging on all nodes.\n canDrag: PropTypes.oneOfType([PropTypes.func, PropTypes.bool]),\n\n // Determine whether a node can be dropped based on its path and parents'.\n canDrop: PropTypes.func,\n\n // Determine whether a node can have children\n canNodeHaveChildren: PropTypes.func,\n\n // When true, or a callback returning true, dropping nodes to react-dnd\n // drop targets outside of this tree will not remove them from this tree\n shouldCopyOnOutsideDrop: PropTypes.oneOfType([PropTypes.func, PropTypes.bool]),\n\n // Called after children nodes collapsed or expanded.\n onVisibilityToggle: PropTypes.func,\n\n dndType: PropTypes.string,\n\n // Called to track between dropped and dragging\n onDragStateChanged: PropTypes.func,\n\n // Specify that nodes that do not match search will be collapsed\n onlyExpandSearchedNodes: PropTypes.bool,\n\n // rtl support\n rowDirection: PropTypes.string,\n\n onLazyLoadChildren: PropTypes.func,\n ignoreTreeChanges: PropTypes.bool\n};\n\nReactSortableTree.defaultProps = {\n canDrag: true,\n canDrop: null,\n canNodeHaveChildren: () => true,\n className: '',\n dndType: null,\n generateNodeProps: null,\n getNodeKey: defaultGetNodeKey,\n innerStyle: {},\n isVirtualized: true,\n maxDepth: null,\n treeNodeRenderer: null,\n nodeContentRenderer: null,\n onMoveNode: () => {},\n onVisibilityToggle: () => {},\n placeholderRenderer: null,\n reactVirtualizedListProps: {},\n rowHeight: null,\n scaffoldBlockPxWidth: null,\n searchFinishCallback: null,\n searchFocusOffset: null,\n searchMethod: null,\n searchQuery: null,\n shouldCopyOnOutsideDrop: false,\n slideRegionSize: null,\n style: {},\n theme: {},\n onDragStateChanged: () => {},\n onlyExpandSearchedNodes: false,\n rowDirection: 'ltr',\n onLazyLoadChildren: () => {},\n ignoreTreeChanges: false\n};\n\npolyfill(ReactSortableTree);\n\nconst StyledReactSortableTree = withStyles(styles)(ReactSortableTree);\n\nconst SortableTreeWithoutDndContext = (props) => (\n <DndContext.Consumer>\n {({dragDropManager}) =>\n dragDropManager === undefined ? null : (\n <StyledReactSortableTree {...props} dragDropManager={dragDropManager} />\n )\n }\n </DndContext.Consumer>\n);\n\nconst SortableTree = (props) => {\n return (\n <DragAndDrop>\n <SortableTreeWithoutDndContext {...props} />\n </DragAndDrop>\n );\n};\n\n// Export the tree component without the react-dnd DragDropContext,\n// for when component is used with other components using react-dnd.\n// see: https://github.com/gaearon/react-dnd/issues/186\nexport {SortableTreeWithoutDndContext};\n\nexport default SortableTree;\n","/* eslint-disable import/prefer-default-export */\n\nexport function slideRows(rows, fromIndex, toIndex, count = 1) {\n const rowsWithoutMoved = [...rows.slice(0, fromIndex), ...rows.slice(fromIndex + count)];\n\n return [\n ...rowsWithoutMoved.slice(0, toIndex),\n ...rows.slice(fromIndex, fromIndex + count),\n ...rowsWithoutMoved.slice(toIndex)\n ];\n}\n","export const styles = () => ({\n /* import styles from react-virtualized/styles.css */\n\n /* Grid default theme */\n '@global .ReactVirtualized__Grid__innerScrollContainer': {\n overflow: 'visible !important' // override base style\n },\n\n '@global .ReactVirtualized__Grid': {\n outline: 'none' //override base style,\n },\n\n /* List default theme */\n '@global .ReactVirtualized__List': {},\n\n // New styles\n rst__virtualScrollOverride: {\n overflow: 'auto !important'\n },\n\n '@global .rst__rtl .ReactVirtualized__Grid__innerScrollContainer': {\n direction: 'rtl'\n }\n});\n","import SortableTree, {SortableTreeWithoutDndContext} from './react-sortable-tree';\n\nexport * from './utils/default-handlers';\nexport * from './utils/tree-data-utils';\nexport default SortableTree;\n\n// Export the tree component without the react-dnd DragDropContext,\n// for when component is used with other components using react-dnd.\n// see: https://github.com/gaearon/react-dnd/issues/186\nexport {SortableTreeWithoutDndContext};\n","export function defaultGetNodeKey({treeIndex}) {\n return treeIndex;\n}\n\n// Cheap hack to get the text of a react object\nfunction getReactElementText(parent) {\n if (typeof parent === 'string') {\n return parent;\n }\n\n if (\n parent === null ||\n typeof parent !== 'object' ||\n !parent.props ||\n !parent.props.children ||\n (typeof parent.props.children !== 'string' && typeof parent.props.children !== 'object')\n ) {\n return '';\n }\n\n if (typeof parent.props.children === 'string') {\n return parent.props.children;\n }\n\n return parent.props.children.map((child) => getReactElementText(child)).join('');\n}\n\n// Search for a query string inside a node property\nfunction stringSearch(key, searchQuery, node, path, treeIndex) {\n if (typeof node[key] === 'function') {\n // Search within text after calling its function to generate the text\n return String(node[key]({node, path, treeIndex})).indexOf(searchQuery) > -1;\n }\n if (typeof node[key] === 'object') {\n // Search within text inside react elements\n return getReactElementText(node[key]).indexOf(searchQuery) > -1;\n }\n\n // Search within string\n return node[key] && String(node[key]).indexOf(searchQuery) > -1;\n}\n\nexport function defaultSearchMethod({node, path, treeIndex, searchQuery}) {\n return (\n stringSearch('title', searchQuery, node, path, treeIndex) ||\n stringSearch('subtitle', searchQuery, node, path, treeIndex)\n );\n}\n\nexport default {defaultSearchMethod, defaultGetNodeKey};\n","/**\n * Performs a depth-first traversal over all of the node descendants,\n * incrementing currentIndex by 1 for each\n */\nfunction getNodeDataAtTreeIndexOrNextIndex({\n targetIndex,\n node,\n currentIndex,\n getNodeKey,\n path = [],\n lowerSiblingCounts = [],\n ignoreCollapsed = true,\n isPseudoRoot = false\n}) {\n // The pseudo-root is not considered in the path\n const selfPath = !isPseudoRoot ? [...path, getNodeKey({node, treeIndex: currentIndex})] : [];\n\n // Return target node when found\n if (currentIndex === targetIndex) {\n return {\n node,\n lowerSiblingCounts,\n path: selfPath\n };\n }\n\n // Add one and continue for nodes with no children or hidden children\n if (!node.children || (ignoreCollapsed && node.expanded !== true)) {\n return {nextIndex: currentIndex + 1};\n }\n\n // Iterate over each child and their descendants and return the\n // target node if childIndex reaches the targetIndex\n let childIndex = currentIndex + 1;\n const childCount = node.children.length;\n for (let i = 0; i < childCount; i += 1) {\n const result = getNodeDataAtTreeIndexOrNextIndex({\n ignoreCollapsed,\n getNodeKey,\n targetIndex,\n node: node.children[i],\n currentIndex: childIndex,\n lowerSiblingCounts: [...lowerSiblingCounts, childCount - i - 1],\n path: selfPath\n });\n\n if (result.node) {\n return result;\n }\n\n childIndex = result.nextIndex;\n }\n\n // If the target node is not found, return the farthest traversed index\n return {nextIndex: childIndex};\n}\n\nexport function getDescendantCount({node, ignoreCollapsed = true}) {\n return (\n getNodeDataAtTreeIndexOrNextIndex({\n getNodeKey: () => {},\n ignoreCollapsed,\n node,\n currentIndex: 0,\n targetIndex: -1\n }).nextIndex - 1\n );\n}\n\n/**\n * Walk all descendants of the given node, depth-first\n *\n * @param {Object} args - Function parameters\n * @param {function} args.callback - Function to call on each node\n * @param {function} args.getNodeKey - Function to get the key from the nodeData and tree index\n * @param {boolean} args.ignoreCollapsed - Ignore children of nodes without `expanded` set to `true`\n * @param {boolean=} args.isPseudoRoot - If true, this node has no real data, and only serves\n * as the parent of all the nodes in the tree\n * @param {Object} args.node - A tree node\n * @param {Object=} args.parentNode - The parent node of `node`\n * @param {number} args.currentIndex - The treeIndex of `node`\n * @param {number[]|string[]} args.path - Array of keys leading up to node to be changed\n * @param {number[]} args.lowerSiblingCounts - An array containing the count of siblings beneath the\n * previous nodes in this path\n *\n * @return {number|false} nextIndex - Index of the next sibling of `node`,\n * or false if the walk should be terminated\n */\nfunction walkDescendants({\n callback,\n getNodeKey,\n ignoreCollapsed,\n isPseudoRoot = false,\n node,\n parentNode = null,\n currentIndex,\n path = [],\n lowerSiblingCounts = []\n}) {\n // The pseudo-root is not considered in the path\n const selfPath = isPseudoRoot ? [] : [...path, getNodeKey({node, treeIndex: currentIndex})];\n const selfInfo = isPseudoRoot\n ? null\n : {\n node,\n parentNode,\n path: selfPath,\n lowerSiblingCounts,\n treeIndex: currentIndex\n };\n\n if (!isPseudoRoot) {\n const callbackResult = callback(selfInfo);\n\n // Cut walk short if the callback returned false\n if (callbackResult === false) {\n return false;\n }\n }\n\n // Return self on nodes with no children or hidden children\n if (!node.children || (node.expanded !== true && ignoreCollapsed && !isPseudoRoot)) {\n return currentIndex;\n }\n\n // Get all descendants\n let childIndex = currentIndex;\n const childCount = node.children.length;\n if (typeof node.children !== 'function') {\n for (let i = 0; i < childCount; i += 1) {\n childIndex = walkDescendants({\n callback,\n getNodeKey,\n ignoreCollapsed,\n node: node.children[i],\n parentNode: isPseudoRoot ? null : node,\n currentIndex: childIndex + 1,\n lowerSiblingCounts: [...lowerSiblingCounts, childCount - i - 1],\n path: selfPath\n });\n\n // Cut walk short if the callback returned false\n if (childIndex === false) {\n return false;\n }\n }\n }\n\n return childIndex;\n}\n\n/**\n * Perform a change on the given node and all its descendants, traversing the tree depth-first\n *\n * @param {Object} args - Function parameters\n * @param {function} args.callback - Function to call on each node\n * @param {function} args.getNodeKey - Function to get the key from the nodeData and tree index\n * @param {boolean} args.ignoreCollapsed - Ignore children of nodes without `expanded` set to `true`\n * @param {boolean=} args.isPseudoRoot - If true, this node has no real data, and only serves\n * as the parent of all the nodes in the tree\n * @param {Object} args.node - A tree node\n * @param {Object=} args.parentNode - The parent node of `node`\n * @param {number} args.currentIndex - The treeIndex of `node`\n * @param {number[]|string[]} args.path - Array of keys leading up to node to be changed\n * @param {number[]} args.lowerSiblingCounts - An array containing the count of siblings beneath the\n * previous nodes in this path\n *\n * @return {number|false} nextIndex - Index of the next sibling of `node`,\n * or false if the walk should be terminated\n */\nfunction mapDescendants({\n callback,\n getNodeKey,\n ignoreCollapsed,\n isPseudoRoot = false,\n node,\n parentNode = null,\n currentIndex,\n path = [],\n lowerSiblingCounts = []\n}) {\n const nextNode = {...node};\n\n // The pseudo-root is not considered in the path\n const selfPath = isPseudoRoot ? [] : [...path, getNodeKey({node: nextNode, treeIndex: currentIndex})];\n const selfInfo = {\n node: nextNode,\n parentNode,\n path: selfPath,\n lowerSiblingCounts,\n treeIndex: currentIndex\n };\n\n // Return self on nodes with no children or hidden children\n if (!nextNode.children || (nextNode.expanded !== true && ignoreCollapsed && !isPseudoRoot)) {\n return {\n treeIndex: currentIndex,\n node: callback(selfInfo)\n };\n }\n\n // Get all descendants\n let childIndex = currentIndex;\n const childCount = nextNode.children.length;\n if (typeof nextNode.children !== 'function') {\n nextNode.children = nextNode.children.map((child, i) => {\n const mapResult = mapDescendants({\n callback,\n getNodeKey,\n ignoreCollapsed,\n node: child,\n parentNode: isPseudoRoot ? null : nextNode,\n currentIndex: childIndex + 1,\n lowerSiblingCounts: [...lowerSiblingCounts, childCount - i - 1],\n path: selfPath\n });\n childIndex = mapResult.treeIndex;\n\n return mapResult.node;\n });\n }\n\n return {\n node: callback(selfInfo),\n treeIndex: childIndex\n };\n}\n\n/**\n * Count all the visible (expanded) descendants in the tree data.\n *\n * @param {!Object[]} treeData - Tree data\n *\n * @return {number} count\n */\nexport function getVisibleNodeCount({treeData}) {\n const traverse = (node) => {\n if (!node.children || node.expanded !== true || typeof node.children === 'function') {\n return 1;\n }\n\n return 1 + node.children.reduce((total, currentNode) => total + traverse(currentNode), 0);\n };\n\n return treeData.reduce((total, currentNode) => total + traverse(currentNode), 0);\n}\n\n/**\n * Get the <targetIndex>th visible node in the tree data.\n *\n * @param {!Object[]} treeData - Tree data\n * @param {!number} targetIndex - The index of the node to search for\n * @param {!function} getNodeKey - Function to get the key from the nodeData and tree index\n *\n * @return {{\n * node: Object,\n * path: []string|[]number,\n * lowerSiblingCounts: []number\n * }|null} node - The node at targetIndex, or null if not found\n */\nexport function getVisibleNodeInfoAtIndex({treeData, index: targetIndex, getNodeKey}) {\n if (!treeData || treeData.length < 1) {\n return null;\n }\n\n // Call the tree traversal with a pseudo-root node\n const result = getNodeDataAtTreeIndexOrNextIndex({\n targetIndex,\n getNodeKey,\n node: {\n children: treeData,\n expanded: true\n },\n currentIndex: -1,\n path: [],\n lowerSiblingCounts: [],\n isPseudoRoot: true\n });\n\n if (result.node) {\n return result;\n }\n\n return null;\n}\n\n/**\n * Walk descendants depth-first and call a callback on each\n *\n * @param {!Object[]} treeData - Tree data\n * @param {!function} getNodeKey - Function to get the key from the nodeData and tree index\n * @param {function} callback - Function to call on each node\n * @param {boolean=} ignoreCollapsed - Ignore children of nodes without `expanded` set to `true`\n *\n * @return void\n */\nexport function walk({treeData, getNodeKey, callback, ignoreCollapsed = true}) {\n if (!treeData || treeData.length < 1) {\n return;\n }\n\n walkDescendants({\n callback,\n getNodeKey,\n ignoreCollapsed,\n isPseudoRoot: true,\n node: {children: treeData},\n currentIndex: -1,\n path: [],\n lowerSiblingCounts: []\n });\n}\n\n/**\n * Perform a depth-first transversal of the descendants and\n * make a change to every node in the tree\n *\n * @param {!Object[]} treeData - Tree data\n * @param {!function} getNodeKey - Function to get the key from the nodeData and tree index\n * @param {function} callback - Function to call on each node\n * @param {boolean=} ignoreCollapsed - Ignore children of nodes without `expanded` set to `true`\n *\n * @return {Object[]} changedTreeData - The changed tree data\n */\nexport function map({treeData, getNodeKey, callback, ignoreCollapsed = true}) {\n if (!treeData || treeData.length < 1) {\n return [];\n }\n\n return mapDescendants({\n callback,\n getNodeKey,\n ignoreCollapsed,\n isPseudoRoot: true,\n node: {children: treeData},\n currentIndex: -1,\n path: [],\n lowerSiblingCounts: []\n }).node.children;\n}\n\n/**\n * Expand or close every node in the tree\n *\n * @param {!Object[]} treeData - Tree data\n * @param {?boolean} expanded - Whether the node is expanded or not\n *\n * @return {Object[]} changedTreeData - The changed tree data\n */\nexport function toggleExpandedForAll({treeData, expanded = true}) {\n return map({\n treeData,\n callback: ({node}) => ({...node, expanded}),\n getNodeKey: ({treeIndex}) => treeIndex,\n ignoreCollapsed: false\n });\n}\n\nexport const RESULT_MISS_ERROR_MESSAGE = 'No node found at the given path.';\n\n/**\n * Replaces node at path with object, or callback-defined object\n *\n * @param {!Object[]} treeData\n * @param {number[]|string[]} path - Array of keys leading up to node to be changed\n * @param {function|any} newNode - Node to replace the node at the path with, or a function producing the new node\n * @param {!function} getNodeKey - Function to get the key from the nodeData and tree index\n * @param {boolean=} ignoreCollapsed - Ignore children of nodes without `expanded` set to `true`\n *\n * @return {Object[]} changedTreeData - The changed tree data\n */\nexport function changeNodeAtPath({treeData, path, newNode, getNodeKey, ignoreCollapsed = true}) {\n const RESULT_MISS = 'RESULT_MISS';\n const traverse = ({isPseudoRoot = false, node, currentTreeIndex, pathIndex}) => {\n if (!isPseudoRoot && getNodeKey({node, treeIndex: currentTreeIndex}) !== path[pathIndex]) {\n return RESULT_MISS;\n }\n\n if (pathIndex >= path.length - 1) {\n // If this is the final location in the path, return its changed form\n return typeof newNode === 'function' ? newNode({node, treeIndex: currentTreeIndex}) : newNode;\n }\n if (!node.children) {\n // If this node is part of the path, but has no children, return the unchanged node\n throw new Error('Path referenced children of node with no children.');\n }\n\n let nextTreeIndex = currentTreeIndex + 1;\n for (let i = 0; i < node.children.length; i += 1) {\n const result = traverse({\n node: node.children[i],\n currentTreeIndex: nextTreeIndex,\n pathIndex: pathIndex + 1\n });\n\n // If the result went down the correct path\n if (result !== RESULT_MISS) {\n if (result) {\n // If the result was truthy (in this case, an object),\n // pass it to the next level of recursion up\n return {\n ...node,\n children: [...node.children.slice(0, i), result, ...node.children.slice(i + 1)]\n };\n }\n // If the result was falsy (returned from the newNode function), then\n // delete the node from the array.\n return {\n ...node,\n children: [...node.children.slice(0, i), ...node.children.slice(i + 1)]\n };\n }\n\n nextTreeIndex += 1 + getDescendantCount({node: node.children[i], ignoreCollapsed});\n }\n\n return RESULT_MISS;\n };\n\n // Use a pseudo-root node in the beginning traversal\n const result = traverse({\n node: {children: treeData},\n currentTreeIndex: -1,\n pathIndex: -1,\n isPseudoRoot: true\n });\n\n if (result === RESULT_MISS) {\n throw new Error(RESULT_MISS_ERROR_MESSAGE);\n }\n\n return result.children;\n}\n\n/**\n * Removes the node at the specified path and returns the resulting treeData.\n *\n * @param {!Object[]} treeData\n * @param {number[]|string[]} path - Array of keys leading up to node to be deleted\n * @param {!function} getNodeKey - Function to get the key from the nodeData and tree index\n * @param {boolean=} ignoreCollapsed - Ignore children of nodes without `expanded` set to `true`\n *\n * @return {Object[]} changedTreeData - The tree data with the node removed\n */\nexport function removeNodeAtPath({treeData, path, getNodeKey, ignoreCollapsed = true}) {\n return changeNodeAtPath({\n treeData,\n path,\n getNodeKey,\n ignoreCollapsed,\n newNode: null // Delete the node\n });\n}\n\n/**\n * Removes the node at the specified path and returns the resulting treeData.\n *\n * @param {!Object[]} treeData\n * @param {number[]|string[]} path - Array of keys leading up to node to be deleted\n * @param {!function} getNodeKey - Function to get the key from the nodeData and tree index\n * @param {boolean=} ignoreCollapsed - Ignore children of nodes without `expanded` set to `true`\n *\n * @return {Object} result\n * @return {Object[]} result.treeData - The tree data with the node removed\n * @return {Object} result.node - The node that was removed\n * @return {number} result.treeIndex - The previous treeIndex of the removed node\n */\nexport function removeNode({treeData, path, getNodeKey, ignoreCollapsed = true}) {\n let removedNode = null;\n let removedTreeIndex = null;\n const nextTreeData = changeNodeAtPath({\n treeData,\n path,\n getNodeKey,\n ignoreCollapsed,\n newNode: ({node, treeIndex}) => {\n // Store the target node and delete it from the tree\n removedNode = node;\n removedTreeIndex = treeIndex;\n\n return null;\n }\n });\n\n return {\n treeData: nextTreeData,\n node: removedNode,\n treeIndex: removedTreeIndex\n };\n}\n\n/**\n * Gets the node at the specified path\n *\n * @param {!Object[]} treeData\n * @param {number[]|string[]} path - Array of keys leading up to node to be deleted\n * @param {!function} getNodeKey - Function to get the key from the nodeData and tree index\n * @param {boolean=} ignoreCollapsed - Ignore children of nodes without `expanded` set to `true`\n *\n * @return {Object|null} nodeInfo - The node info at the given path, or null if not found\n */\nexport function getNodeAtPath({treeData, path, getNodeKey, ignoreCollapsed = true}) {\n let foundNodeInfo = null;\n\n try {\n changeNodeAtPath({\n treeData,\n path,\n getNodeKey,\n ignoreCollapsed,\n newNode: ({node, treeIndex}) => {\n foundNodeInfo = {node, treeIndex};\n return node;\n }\n });\n } catch (err) {\n // Ignore the error -- the null return will be explanation enough\n }\n\n return foundNodeInfo;\n}\n\n/**\n * Adds the node to the specified parent and returns the resulting treeData.\n *\n * @param {!Object[]} treeData\n * @param {!Object} newNode - The node to insert\n * @param {number|string} parentKey - The key of the to-be parentNode of the node\n * @param {!function} getNodeKey - Function to get the key from the nodeData and tree index\n * @param {boolean=} ignoreCollapsed - Ignore children of nodes without `expanded` set to `true`\n * @param {boolean=} expandParent - If true, expands the parentNode specified by parentPath\n * @param {boolean=} addAsFirstChild - If true, adds new node as first child of tree\n *\n * @return {Object} result\n * @return {Object[]} result.treeData - The updated tree data\n * @return {number} result.treeIndex - The tree index at which the node was inserted\n */\nexport function addNodeUnderParent({\n treeData,\n newNode,\n parentKey = null,\n getNodeKey,\n ignoreCollapsed = true,\n expandParent = false,\n addAsFirstChild = false\n}) {\n if (parentKey === null) {\n return addAsFirstChild\n ? {\n treeData: [newNode, ...(treeData || [])],\n treeIndex: 0\n }\n : {\n treeData: [...(treeData || []), newNode],\n treeIndex: (treeData || []).length\n };\n }\n\n let insertedTreeIndex = null;\n let hasBeenAdded = false;\n const changedTreeData = map({\n treeData,\n getNodeKey,\n ignoreCollapsed,\n callback: ({node, treeIndex, path}) => {\n const key = path ? path[path.length - 1] : null;\n // Return nodes that are not the parent as-is\n if (hasBeenAdded || key !== parentKey) {\n return node;\n }\n hasBeenAdded = true;\n\n const parentNode = {\n ...node\n };\n\n if (expandParent) {\n parentNode.expanded = true;\n }\n\n // If no children exist yet, just add the single newNode\n if (!parentNode.children) {\n insertedTreeIndex = treeIndex + 1;\n return {\n ...parentNode,\n children: [newNode]\n };\n }\n\n if (typeof parentNode.children === 'function') {\n throw new Error('Cannot add to children defined by a function');\n }\n\n let nextTreeIndex = treeIndex + 1;\n for (let i = 0; i < parentNode.children.length; i += 1) {\n nextTreeIndex += 1 + getDescendantCount({node: parentNode.children[i], ignoreCollapsed});\n }\n\n insertedTreeIndex = nextTreeIndex;\n\n const children = addAsFirstChild ? [newNode, ...parentNode.children] : [...parentNode.children, newNode];\n\n return {\n ...parentNode,\n children\n };\n }\n });\n\n if (!hasBeenAdded) {\n throw new Error('No node found with the given key.');\n }\n\n return {\n treeData: changedTreeData,\n treeIndex: insertedTreeIndex\n };\n}\n\nfunction addNodeAtDepthAndIndex({\n targetDepth,\n minimumTreeIndex,\n newNode,\n ignoreCollapsed,\n expandParent,\n isPseudoRoot = false,\n isLastChild,\n node,\n currentIndex,\n currentDepth,\n getNodeKey,\n path = []\n}) {\n const selfPath = (n) => (isPseudoRoot ? [] : [...path, getNodeKey({node: n, treeIndex: currentIndex})]);\n\n // If the current position is the only possible place to add, add it\n if (currentIndex >= minimumTreeIndex - 1 || (isLastChild && !(node.children && node.children.length))) {\n if (typeof node.children === 'function') {\n throw new Error('Cannot add to children defined by a function');\n } else {\n const extraNodeProps = expandParent ? {expanded: true} : {};\n const nextNode = {\n ...node,\n\n ...extraNodeProps,\n children: node.children ? [newNode, ...node.children] : [newNode]\n };\n\n return {\n node: nextNode,\n nextIndex: currentIndex + 2,\n insertedTreeIndex: currentIndex + 1,\n parentPath: selfPath(nextNode),\n parentNode: isPseudoRoot ? null : nextNode\n };\n }\n }\n\n // If this is the target depth for the insertion,\n // i.e., where the newNode can be added to the current node's children\n if (currentDepth >= targetDepth - 1) {\n // Skip over nodes with no children or hidden children\n if (\n !node.children ||\n typeof node.children === 'function' ||\n (node.expanded !== true && ignoreCollapsed && !isPseudoRoot)\n ) {\n return {node, nextIndex: currentIndex + 1};\n }\n\n // Scan over the children to see if there's a place among them that fulfills\n // the minimumTreeIndex requirement\n let childIndex = currentIndex + 1;\n let insertedTreeIndex = null;\n let insertIndex = null;\n for (let i = 0; i < node.children.length; i += 1) {\n // If a valid location is found, mark it as the insertion location and\n // break out of the loop\n if (childIndex >= minimumTreeIndex) {\n insertedTreeIndex = childIndex;\n insertIndex = i;\n break;\n }\n\n // Increment the index by the child itself plus the number of descendants it has\n childIndex += 1 + getDescendantCount({node: node.children[i], ignoreCollapsed});\n }\n\n // If no valid indices to add the node were found\n if (insertIndex === null) {\n // If the last position in this node's children is less than the minimum index\n // and there are more children on the level of this node, return without insertion\n if (childIndex < minimumTreeIndex && !isLastChild) {\n return {node, nextIndex: childIndex};\n }\n\n // Use the last position in the children array to insert the newNode\n insertedTreeIndex = childIndex;\n insertIndex = node.children.length;\n }\n\n // Insert the newNode at the insertIndex\n const nextNode = {\n ...node,\n children: [...node.children.slice(0, insertIndex), newNode, ...node.children.slice(insertIndex)]\n };\n\n // Return node with successful insert result\n return {\n node: nextNode,\n nextIndex: childIndex,\n insertedTreeIndex,\n parentPath: selfPath(nextNode),\n parentNode: isPseudoRoot ? null : nextNode\n };\n }\n\n // Skip over nodes with no children or hidden children\n if (\n !node.children ||\n typeof node.children === 'function' ||\n (node.expanded !== true && ignoreCollapsed && !isPseudoRoot)\n ) {\n return {node, nextIndex: currentIndex + 1};\n }\n\n // Get all descendants\n let insertedTreeIndex = null;\n let pathFragment = null;\n let parentNode = null;\n let childIndex = currentIndex + 1;\n let newChildren = node.children;\n if (typeof newChildren !== 'function') {\n newChildren = newChildren.map((child, i) => {\n if (insertedTreeIndex !== null) {\n return child;\n }\n\n const mapResult = addNodeAtDepthAndIndex({\n targetDepth,\n minimumTreeIndex,\n newNode,\n ignoreCollapsed,\n expandParent,\n isLastChild: isLastChild && i === newChildren.length - 1,\n node: child,\n currentIndex: childIndex,\n currentDepth: currentDepth + 1,\n getNodeKey,\n path: [] // Cannot determine the parent path until the children have been processed\n });\n\n if ('insertedTreeIndex' in mapResult) {\n ({insertedTreeIndex, parentNode, parentPath: pathFragment} = mapResult);\n }\n\n childIndex = mapResult.nextIndex;\n\n return mapResult.node;\n });\n }\n\n const nextNode = {...node, children: newChildren};\n const result = {\n node: nextNode,\n nextIndex: childIndex\n };\n\n if (insertedTreeIndex !== null) {\n result.insertedTreeIndex = insertedTreeIndex;\n result.parentPath = [...selfPath(nextNode), ...pathFragment];\n result.parentNode = parentNode;\n }\n\n return result;\n}\n\n/**\n * Insert a node into the tree at the given depth, after the minimum index\n *\n * @param {!Object[]} treeData - Tree data\n * @param {!number} depth - The depth to insert the node at (the first level of the array being depth 0)\n * @param {!number} minimumTreeIndex - The lowest possible treeIndex to insert the node at\n * @param {!Object} newNode - The node to insert into the tree\n * @param {boolean=} ignoreCollapsed - Ignore children of nodes without `expanded` set to `true`\n * @param {boolean=} expandParent - If true, expands the parent of the inserted node\n * @param {!function} getNodeKey - Function to get the key from the nodeData and tree index\n *\n * @return {Object} result\n * @return {Object[]} result.treeData - The tree data with the node added\n * @return {number} result.treeIndex - The tree index at which the node was inserted\n * @return {number[]|string[]} result.path - Array of keys leading to the node location after insertion\n * @return {Object} result.parentNode - The parent node of the inserted node\n */\nexport function insertNode({\n treeData,\n depth: targetDepth,\n minimumTreeIndex,\n newNode,\n getNodeKey = () => {},\n ignoreCollapsed = true,\n expandParent = false\n}) {\n if (!treeData && targetDepth === 0) {\n return {\n treeData: [newNode],\n treeIndex: 0,\n path: [getNodeKey({node: newNode, treeIndex: 0})],\n parentNode: null\n };\n }\n\n const insertResult = addNodeAtDepthAndIndex({\n targetDepth,\n minimumTreeIndex,\n newNode,\n ignoreCollapsed,\n expandParent,\n getNodeKey,\n isPseudoRoot: true,\n isLastChild: true,\n node: {children: treeData},\n currentIndex: -1,\n currentDepth: -1\n });\n\n if (!('insertedTreeIndex' in insertResult)) {\n throw new Error('No suitable position found to insert.');\n }\n\n const treeIndex = insertResult.insertedTreeIndex;\n return {\n treeData: insertResult.node.children,\n treeIndex,\n path: [...insertResult.parentPath, getNodeKey({node: newNode, treeIndex})],\n parentNode: insertResult.parentNode\n };\n}\n\n/**\n * Get tree data flattened.\n *\n * @param {!Object[]} treeData - Tree data\n * @param {!function} getNodeKey - Function to get the key from the nodeData and tree index\n * @param {boolean=} ignoreCollapsed - Ignore children of nodes without `expanded` set to `true`\n *\n * @return {{\n * node: Object,\n * path: []string|[]number,\n * lowerSiblingCounts: []number\n * }}[] nodes - The node array\n */\nexport function getFlatDataFromTree({treeData, getNodeKey, ignoreCollapsed = true}) {\n if (!treeData || treeData.length < 1) {\n return [];\n }\n\n const flattened = [];\n walk({\n treeData,\n getNodeKey,\n ignoreCollapsed,\n callback: (nodeInfo) => {\n flattened.push(nodeInfo);\n }\n });\n\n return flattened;\n}\n\n/**\n * Generate a tree structure from flat data.\n *\n * @param {!Object[]} flatData\n * @param {!function=} getKey - Function to get the key from the nodeData\n * @param {!function=} getParentKey - Function to get the parent key from the nodeData\n * @param {string|number=} rootKey - The value returned by `getParentKey` that corresponds to the root node.\n * For example, if your nodes have id 1-99, you might use rootKey = 0\n *\n * @return {Object[]} treeData - The flat data represented as a tree\n */\nexport function getTreeFromFlatData({\n flatData,\n getKey = (node) => node.id,\n getParentKey = (node) => node.parentId,\n rootKey = '0'\n}) {\n if (!flatData) {\n return [];\n }\n\n const childrenToParents = {};\n flatData.forEach((child) => {\n const parentKey = getParentKey(child);\n\n if (parentKey in childrenToParents) {\n childrenToParents[parentKey].push(child);\n } else {\n childrenToParents[parentKey] = [child];\n }\n });\n\n if (!(rootKey in childrenToParents)) {\n return [];\n }\n\n const trav = (parent) => {\n const parentKey = getKey(parent);\n if (parentKey in childrenToParents) {\n return {\n ...parent,\n children: childrenToParents[parentKey].map((child) => trav(child))\n };\n }\n\n return {...parent};\n };\n\n return childrenToParents[rootKey].map((child) => trav(child));\n}\n\n/**\n * Check if a node is a descendant of another node.\n *\n * @param {!Object} older - Potential ancestor of younger node\n * @param {!Object} younger - Potential descendant of older node\n *\n * @return {boolean}\n */\nexport function isDescendant(older, younger) {\n return (\n !!older.children &&\n typeof older.children !== 'function' &&\n older.children.some((child) => child === younger || isDescendant(child, younger))\n );\n}\n\n/**\n * Get the maximum depth of the children (the depth of the root node is 0).\n *\n * @param {!Object} node - Node in the tree\n * @param {?number} depth - The current depth\n *\n * @return {number} maxDepth - The deepest depth in the tree\n */\nexport function getDepth(node, depth = 0) {\n if (!node.children) {\n return depth;\n }\n\n if (typeof node.children === 'function') {\n return depth + 1;\n }\n\n return node.children.reduce((deepest, child) => Math.max(deepest, getDepth(child, depth + 1)), depth);\n}\n\n/**\n * Find nodes matching a search query in the tree,\n *\n * @param {!function} getNodeKey - Function to get the key from the nodeData and tree index\n * @param {!Object[]} treeData - Tree data\n * @param {?string|number} searchQuery - Function returning a boolean to indicate whether the node is a match or not\n * @param {!function} searchMethod - Function returning a boolean to indicate whether the node is a match or not\n * @param {?number} searchFocusOffset - The offset of the match to focus on\n * (e.g., 0 focuses on the first match, 1 on the second)\n * @param {boolean=} expandAllMatchPaths - If true, expands the paths to any matched node\n * @param {boolean=} expandFocusMatchPaths - If true, expands the path to the focused node\n *\n * @return {Object[]} matches - An array of objects containing the matching `node`s, their `path`s and `treeIndex`s\n * @return {Object[]} treeData - The original tree data with all relevant nodes expanded.\n * If expandAllMatchPaths and expandFocusMatchPaths are both false,\n * it will be the same as the original tree data.\n */\nexport function find({\n getNodeKey,\n treeData,\n searchQuery,\n searchMethod,\n searchFocusOffset,\n expandAllMatchPaths = false,\n expandFocusMatchPaths = true\n}) {\n let matchCount = 0;\n const trav = ({isPseudoRoot = false, node, currentIndex, path = []}) => {\n let matches = [];\n let isSelfMatch = false;\n let hasFocusMatch = false;\n // The pseudo-root is not considered in the path\n const selfPath = isPseudoRoot ? [] : [...path, getNodeKey({node, treeIndex: currentIndex})];\n const extraInfo = isPseudoRoot\n ? null\n : {\n path: selfPath,\n treeIndex: currentIndex\n };\n\n // Nodes with with children that aren't lazy\n const hasChildren = node.children && typeof node.children !== 'function' && node.children.length > 0;\n\n // Examine the current node to see if it is a match\n if (!isPseudoRoot && searchMethod({...extraInfo, node, searchQuery})) {\n if (matchCount === searchFocusOffset) {\n hasFocusMatch = true;\n }\n\n // Keep track of the number of matching nodes, so we know when the searchFocusOffset\n // is reached\n matchCount += 1;\n\n // We cannot add this node to the matches right away, as it may be changed\n // during the search of the descendants. The entire node is used in\n // comparisons between nodes inside the `matches` and `treeData` results\n // of this method (`find`)\n isSelfMatch = true;\n }\n\n let childIndex = currentIndex;\n const newNode = {...node};\n if (hasChildren) {\n // Get all descendants\n newNode.children = newNode.children.map((child) => {\n const mapResult = trav({\n node: child,\n currentIndex: childIndex + 1,\n path: selfPath\n });\n\n // Ignore hidden nodes by only advancing the index counter to the returned treeIndex\n // if the child is expanded.\n //\n // The child could have been expanded from the start,\n // or expanded due to a matching node being found in its descendants\n if (mapResult.node.expanded) {\n childIndex = mapResult.treeIndex;\n } else {\n childIndex += 1;\n }\n\n if (mapResult.matches.length > 0 || mapResult.hasFocusMatch) {\n matches = [...matches, ...mapResult.matches];\n if (mapResult.hasFocusMatch) {\n hasFocusMatch = true;\n }\n\n // Expand the current node if it has descendants matching the search\n // and the settings are set to do so.\n if (\n (expandAllMatchPaths && mapResult.matches.length > 0) ||\n ((expandAllMatchPaths || expandFocusMatchPaths) && mapResult.hasFocusMatch)\n ) {\n newNode.expanded = true;\n }\n }\n\n return mapResult.node;\n });\n }\n\n // Cannot assign a treeIndex to hidden nodes\n if (!isPseudoRoot && !newNode.expanded) {\n matches = matches.map((match) => ({\n ...match,\n treeIndex: null\n }));\n }\n\n // Add this node to the matches if it fits the search criteria.\n // This is performed at the last minute so newNode can be sent in its final form.\n if (isSelfMatch) {\n matches = [{...extraInfo, node: newNode}, ...matches];\n }\n\n return {\n node: matches.length > 0 ? newNode : node,\n matches,\n hasFocusMatch,\n treeIndex: childIndex\n };\n };\n\n const result = trav({\n node: {children: treeData},\n isPseudoRoot: true,\n currentIndex: -1\n });\n\n return {\n matches: result.matches,\n treeData: result.node.children\n };\n}\n\nexport default {\n find,\n getDepth,\n isDescendant,\n getTreeFromFlatData,\n getFlatDataFromTree,\n insertNode,\n addNodeUnderParent,\n getNodeAtPath,\n removeNode,\n removeNodeAtPath,\n changeNodeAtPath,\n toggleExpandedForAll,\n map,\n walk,\n getVisibleNodeInfoAtIndex,\n getVisibleNodeCount,\n getDescendantCount\n};\n","import {makeStyles} from '@material-ui/core/styles';\n\nexport const useStyles = makeStyles({\n editor: {\n display: 'flex',\n flexDirection: 'column',\n padding: '0 24px 5px'\n },\n title: {\n color: 'rgba(0, 0, 0, 0.6)',\n fontSize: '16px',\n letterSpacing: '0.15px',\n lineHeight: '24px',\n margin: '17px 0 24px'\n },\n item: {\n marginBottom: '20px'\n },\n dense: {\n marginBottom: 0\n },\n actionButtons: {\n display: 'flex',\n justifyContent: 'flex-end',\n margin: '0 8px 10px',\n\n '& > button': {\n fontSize: '14px',\n lineHeight: '16px',\n marginLeft: '8px',\n padding: '10px 8px',\n backgroundColor: 'rgba(98, 2, 238, 0)'\n }\n }\n});\n","import React, {useCallback, useEffect, useMemo, useRef} from 'react';\nimport PropTypes from 'prop-types';\nimport {Button as Button} from '@material-ui/core';\nimport {Typography as Typography} from '@material-ui/core';\nimport i18n from 'ui-i18n';\nimport classnames from 'classnames';\nimport {always, concat, differenceWith, equals, forEach, path, pipe, prop, when, uniq} from 'ramda';\n\nimport {useStyles} from './styles';\n\nimport {\n AttributeErrorType,\n ConnectionType,\n createTemporaryEntity,\n EntityType,\n findRelatedTemporaryEntities,\n getActivenessAttributes,\n getCreatableAttributeTypes,\n getEntityType,\n getErrorMessage,\n getErrorId,\n MetadataType,\n omitMarks,\n relationEditorAttributeTypesSelectionStrategy,\n RelationsConfigType,\n validateConnection,\n updateConnectionEntityLabel,\n isTempUri,\n isEmptyValue,\n getRelationAttributesList,\n getDefaultRelationTypeObject,\n getInOutRelations\n} from '@reltio/mdm-sdk';\nimport {profile} from '@reltio/mdm-module';\nimport {Divider as Divider} from '@material-ui/core';\nimport ConnectionRelationTypeSelector from '../ConnectionRelationTypeSelector/ConnectionRelationTypeSelector';\nimport ErrorWrapper from '../ErrorWrapper/ErrorWrapper';\nimport EntitySelector from '../attributes/editMode/EntitySelector/EntitySelector';\nimport AttributesList from '../attributes/editMode/AttributesList';\n\nconst areRelatedEntitiesChanged = (initial, actual) =>\n initial.length !== actual.length || initial.some((_, i) => initial[i] !== actual[i]);\n\nconst RelationEditor = ({\n connection,\n modifiedEntity,\n allModifiedEntities,\n dispatch,\n config,\n mode,\n metadata,\n globalSearchRequestOptions,\n error\n}) => {\n const {relationUri, relationType, direction} = connection.relation;\n const isNew = connection.isNew;\n const styles = useStyles();\n const {inRelations: inRelationTypes = [], outRelations: outRelationTypes = []} = useMemo(\n () =>\n getInOutRelations({\n content: connection.parentEntityUri ? config.contentSecondLevel : config.content,\n direction,\n relationType,\n mode,\n metadata\n }),\n [config, direction, relationType, mode, metadata, connection.parentEntityUri]\n );\n const firstLevelRelationAttrTypes = useMemo(() => getRelationAttributesList(metadata, relationType), [\n relationType,\n metadata\n ]);\n const attributeListEntity = useMemo(\n () => ({\n attributes: {\n ...profile.relations.selectors.getRelationAttributesFromConnection(connection)\n },\n ...getActivenessAttributes(connection.relation)\n }),\n [connection]\n );\n\n const initialConnection = useRef(connection);\n const initialModifiedEntity = useRef(modifiedEntity);\n const relatedTempEntities = useMemo(() => findRelatedTemporaryEntities(allModifiedEntities, modifiedEntity), [\n allModifiedEntities,\n modifiedEntity\n ]);\n const relatedTempEntitiesUrisHistory = useRef([]);\n useEffect(() => {\n relatedTempEntitiesUrisHistory.current = pipe(\n concat(relatedTempEntities.map(prop('uri'))),\n uniq\n )(relatedTempEntitiesUrisHistory.current);\n }, [relatedTempEntities]);\n const initialRelatedTempEntities = useRef(relatedTempEntities);\n const defaultRelationType = getDefaultRelationTypeObject(inRelationTypes, outRelationTypes);\n const hasChanges =\n initialConnection.current !== connection ||\n initialModifiedEntity.current !== modifiedEntity ||\n areRelatedEntitiesChanged(initialRelatedTempEntities.current, relatedTempEntities) ||\n (connection.isNew && !isEmptyValue(path(['relation', 'object', 'attributes'], connection)));\n const applyAction = isNew ? profile.relations.actions.addRelation : profile.relations.actions.editRelation;\n\n const onRelationTypeChange = useCallback(\n pipe(profile.relations.actions.setRelationType(config.id, relationUri), dispatch),\n [config, relationUri, dispatch]\n );\n\n const handleClose = useCallback(\n () => pipe(profile.relations.actions.closeRelationEditor, dispatch)(config.id, relationUri),\n [config, relationUri, dispatch]\n );\n\n const updateModifiedEntityLabel = useCallback(\n (connection) => {\n if (modifiedEntity) {\n const entityType = getEntityType(metadata, modifiedEntity.type);\n return updateConnectionEntityLabel(entityType, modifiedEntity, connection);\n }\n return connection;\n },\n [modifiedEntity, metadata]\n );\n\n const setModifiedEntity = useCallback(\n (entity) => dispatch(profile.modifiedEntities.actions.entityCreated(entity)),\n [dispatch]\n );\n\n const deleteModifiedEntity = useCallback(\n (entityUri) => dispatch(profile.modifiedEntities.actions.entityDeleted(entityUri)),\n [dispatch]\n );\n\n const onChangeEntity = useCallback(\n (entity) => {\n if (modifiedEntity) {\n deleteModifiedEntity(modifiedEntity.uri);\n }\n dispatch(profile.relations.actions.setRelationEntity(config.id, relationUri, entity));\n if (error) {\n dispatch(profile.errors.actions.errorDeactivated(getErrorId(error)));\n }\n },\n [config.id, relationUri, dispatch, modifiedEntity, deleteModifiedEntity, error]\n );\n\n const validate = useCallback(() => {\n const errors = validateConnection(metadata, allModifiedEntities, connection);\n dispatch(profile.errors.actions.errorsSet(errors));\n return errors.length === 0;\n }, [connection, metadata, allModifiedEntities, dispatch]);\n\n const resetErrors = useCallback(() => dispatch(profile.errors.actions.errorsSet([])), [dispatch]);\n\n const onApply = useCallback(\n pipe(\n always(connection),\n when(\n validate,\n pipe(\n omitMarks,\n updateModifiedEntityLabel,\n applyAction(config.id),\n dispatch,\n always(\n differenceWith(\n equals,\n relatedTempEntitiesUrisHistory.current,\n relatedTempEntities.map(prop('uri'))\n )\n ),\n forEach(deleteModifiedEntity),\n handleClose\n )\n )\n ),\n [connection, config, dispatch, updateModifiedEntityLabel, validate, relatedTempEntities]\n );\n\n const onCancel = useCallback(() => {\n const initialEntity = initialModifiedEntity.current;\n if (modifiedEntity !== initialEntity) {\n if (initialEntity) {\n setModifiedEntity(initialEntity);\n if (modifiedEntity && modifiedEntity.uri !== initialEntity.uri) {\n deleteModifiedEntity(modifiedEntity.uri);\n }\n } else {\n deleteModifiedEntity(modifiedEntity.uri);\n }\n }\n const initialTempEntities = initialRelatedTempEntities.current;\n const entitiesUrisToDelete = differenceWith(\n equals,\n relatedTempEntitiesUrisHistory.current,\n initialTempEntities.map(prop('uri'))\n );\n entitiesUrisToDelete.forEach(deleteModifiedEntity);\n initialTempEntities.forEach(setModifiedEntity);\n resetErrors();\n handleClose();\n }, [handleClose, setModifiedEntity, deleteModifiedEntity, resetErrors, modifiedEntity]);\n\n const onAddAttributes = useCallback(\n (params) =>\n pipe(profile.actions.addAttributes, dispatch)(params.map((param) => ({...param, viewId: config.id}))),\n [config.id, dispatch]\n );\n\n const onChangeAttribute = useCallback(\n (params) => pipe(profile.actions.modifyAttribute, dispatch)({...params, viewId: config.id}),\n [config.id, dispatch]\n );\n\n const onDeleteAttribute = useCallback(\n (params) => pipe(profile.actions.removeAttribute, dispatch)({...params, viewId: config.id}),\n [config.id, dispatch]\n );\n\n const onCreateEntity = useCallback(\n (entityTypeUri, initValue) => {\n const entityType = getEntityType(metadata, entityTypeUri);\n const newEntityAttrTypes = pipe(\n relationEditorAttributeTypesSelectionStrategy,\n getCreatableAttributeTypes(mode)\n )(entityType);\n const newEntity = createTemporaryEntity({\n entityTypeUri,\n initValue,\n attributeTypes: newEntityAttrTypes,\n metadata,\n mode\n });\n onChangeEntity(newEntity);\n setModifiedEntity(newEntity);\n },\n [setModifiedEntity, onChangeEntity, mode, metadata]\n );\n const errorMessage = getErrorMessage(error);\n\n const getEntityTypesUris = useCallback(() => {\n const {content, contentSecondLevel} = config;\n\n if (contentSecondLevel && connection.parentEntityUri) {\n return contentSecondLevel.entityTypes;\n }\n\n return content.entityTypes;\n }, [config, connection.parentEntityUri]);\n\n return (\n <>\n <div className={styles.editor}>\n <Typography className={styles.title}>\n {isNew ? i18n.text('Add new item') : i18n.text('Edit item')}\n </Typography>\n {defaultRelationType === null && (\n <ConnectionRelationTypeSelector\n className={styles.item}\n relation={connection.relation}\n inRelationTypes={inRelationTypes}\n outRelationTypes={outRelationTypes}\n onChange={onRelationTypeChange}\n />\n )}\n {Boolean(relationType) && (\n <>\n <ErrorWrapper errorMessage={errorMessage}>\n <EntitySelector\n className={classnames(styles.item, {\n [styles.dense]:\n errorMessage || (connection.entity && isTempUri(connection.entity.entityUri))\n })}\n entity={connection.entity || {}}\n entityTypesUris={getEntityTypesUris() || []}\n max={config.max || 20}\n globalSearchRequestOptions={globalSearchRequestOptions}\n mode={mode}\n onChange={onChangeEntity}\n onCreate={onCreateEntity}\n metadata={metadata}\n attributeTypesSelectionStrategy={relationEditorAttributeTypesSelectionStrategy}\n />\n </ErrorWrapper>\n <AttributesList\n className={styles.item}\n attrTypes={firstLevelRelationAttrTypes}\n entity={attributeListEntity}\n showEmptyEditors={true}\n crosswalks={connection.crosswalks}\n mode={mode}\n parentUri={relationUri}\n onAddAttributes={onAddAttributes}\n onChangeAttribute={onChangeAttribute}\n onDeleteAttribute={onDeleteAttribute}\n />\n </>\n )}\n </div>\n <div className={styles.actionButtons}>\n <Button onClick={onCancel}>{i18n.text('Cancel')}</Button>\n <Button color=\"primary\" disabled={!hasChanges} onClick={onApply}>\n {i18n.text('Apply')}\n </Button>\n </div>\n <Divider />\n </>\n );\n};\n\nRelationEditor.propTypes = {\n connection: ConnectionType,\n modifiedEntity: EntityType,\n allModifiedEntities: PropTypes.object,\n dispatch: PropTypes.func,\n config: RelationsConfigType,\n mode: PropTypes.string,\n metadata: MetadataType,\n globalSearchRequestOptions: PropTypes.object,\n error: AttributeErrorType,\n parentEntityUri: PropTypes.string\n};\n\nexport default RelationEditor;\n","import RelationEditor from './RelationEditor';\nimport mdmModule, {profile} from '@reltio/mdm-module';\nimport {connect} from 'react-redux';\nimport {getRelationEditorActiveError, isTempUri} from '@reltio/mdm-sdk';\n\nconst getConnectionEntityUri = (props) => profile.relations.selectors.getEntityUriFromConnection(props.connection);\n\nconst mapStateToProps = (state, ownProps) => {\n const entityUri = getConnectionEntityUri(ownProps);\n const isTempEntity = isTempUri(entityUri);\n return {\n modifiedEntity: isTempEntity ? mdmModule.selectors.getModifiedEntity(state, entityUri) : null,\n allModifiedEntities: isTempEntity ? mdmModule.selectors.getModifiedEntities(state) : null,\n globalSearchRequestOptions: mdmModule.selectors.getGlobalSearchRequestOptions(state, ['ovOnly']),\n error: getRelationEditorActiveError(ownProps.connection, mdmModule.selectors.getProfileErrors(state))\n };\n};\n\nexport {RelationEditor};\n\nexport default connect(mapStateToProps)(RelationEditor);\n","import {curry, defaultTo, mergeAll, pick, pipe, prop, propEq, __} from 'ramda';\n\nexport const getReltioViewId = (id) => id.split(/\\d+_/)[1];\n\nexport const reltioLayoutItemToReactGridLayoutItem = ({\n x,\n y,\n width,\n height,\n id,\n minWidth,\n minHeight,\n maxWidth,\n maxHeight,\n isStatic\n}) => ({\n x,\n y,\n w: width,\n h: height,\n minW: minWidth,\n minH: minHeight,\n maxW: maxWidth,\n maxH: maxHeight,\n i: id,\n static: isStatic\n});\n\nexport const reactGridLayoutItemToReltioLayoutItem = ({x, y, w, h, maxW, minW, minH, maxH, i, ...obj}) => ({\n x,\n y,\n width: w,\n height: h,\n minWidth: minW,\n minHeight: minH,\n maxWidth: maxW,\n maxHeight: maxH,\n id: i,\n isStatic: obj.static\n});\n\nexport const reltioLayoutToReactGridLayout = (layout) => (layout || []).map(reltioLayoutItemToReactGridLayoutItem);\n\nexport const reactGridLayoutToReltioLayout = (layout) => (layout || []).map(reactGridLayoutItemToReltioLayoutItem);\n\nexport const getReltioLayoutItemById = curry((layout, id) => (layout || []).find(propEq('id', id)));\n\nconst updateExtraPropsInLayoutItem = curry((props, from, to) => mergeAll([to, pick(props, from)]));\n\nexport const copyPropsFromPreviousLayout = curry((props, oldReltioLayout, reltioLayout) =>\n (reltioLayout || []).map((layoutItem) =>\n pipe(\n prop('id'),\n getReltioLayoutItemById(oldReltioLayout),\n defaultTo({}),\n updateExtraPropsInLayoutItem(props, __, layoutItem)\n )(layoutItem)\n )\n);\n\nexport const calcHeight = (height, options) => {\n const {margin, rowHeight} = options;\n\n return Math.ceil((height + margin[1]) / (rowHeight + margin[1]));\n};\n","export const RESIZE_ICON = `<svg width=\"10\" height=\"10\" viewBox=\"0 0 10 10\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path stroke=\"#505050\" stroke-opacity=\".54\" d=\"M9.5 0v10M0 9.5h9M7.5 4v4M4 7.5h3\"/>\n</svg>`;\n","import {makeStyles} from '@material-ui/core/styles';\nimport {svg2Url} from '@reltio/mdm-sdk';\nimport {RESIZE_ICON} from './icons/ResizeIcon.svg';\n\nexport const useStyles = makeStyles((_) => ({\n gridLayout: {\n position: 'relative',\n width: '100%',\n '& .react-grid-item': {\n '&.react-grid-placeholder': {\n background: 'rgba(0, 0, 0, 0.03)',\n border: '2px dashed rgba(0, 0, 0, 0.3)',\n borderRadius: '3px',\n transitionDuration: '100ms',\n zIndex: 7,\n userSelect: 'none',\n '& .react-resizable-handle': {\n display: 'none'\n }\n },\n '&.static .react-resizable-handle': {\n display: 'none'\n },\n '&.cssTransforms': {\n transitionProperty: 'transform'\n },\n '&.resizing': {\n zIndex: 9,\n willChange: 'width, height',\n pointerEvents: 'none'\n },\n '&.react-draggable-dragging': {\n transition: 'none',\n zIndex: 8,\n willChange: 'transform',\n '& .react-resizable-handle': {\n backgroundImage: 'none'\n }\n },\n '& .react-resizable-handle': {\n position: 'absolute',\n width: '17px',\n height: '17px',\n bottom: 0,\n right: 0,\n zIndex: 20,\n backgroundImage: `url('${svg2Url(RESIZE_ICON)}')`,\n backgroundRepeat: 'no-repeat',\n backgroundOrigin: 'content-box',\n boxSizing: 'border-box',\n cursor: 'se-resize'\n },\n '&.fullscreen': {\n visibility: 'visible',\n position: 'unset',\n width: '100% !important',\n height: '100% !important',\n transform: 'translate(0) !important'\n }\n }\n },\n\n gridFullscreen: {\n height: '100% !important',\n overflowY: 'hidden',\n '& .react-resizable-handle, & .react-grid-item': {\n visibility: 'hidden'\n }\n }\n}));\n","import PropTypes from 'prop-types';\nimport React, {useCallback, useMemo, useRef, useState, memo} from 'react';\nimport GridLayout from 'react-grid-layout';\nimport ReactResizeDetector from 'react-resize-detector';\nimport {identity, pipe} from 'ramda';\nimport classnames from 'classnames';\nimport {\n reltioLayoutToReactGridLayout,\n reactGridLayoutToReltioLayout,\n reactGridLayoutItemToReltioLayoutItem,\n copyPropsFromPreviousLayout,\n calcHeight,\n getReltioLayoutItemById\n} from './helpers';\n\nimport {useStyles} from './styles';\n\nconst ReltioGridLayout = ({\n views,\n layout,\n layoutOptions,\n onLayoutChanged,\n draggableHandle,\n LayoutItem,\n onRemove,\n onDrop,\n droppingItem,\n isDroppable,\n classes\n}) => {\n const ref = useRef();\n const styles = useStyles();\n const [fullscreenItemId, setFullscreenItemId] = useState(null);\n const [width, setWidth] = useState(0);\n const {cols, rowHeight, margin} = layoutOptions;\n const processedLayout = useMemo(() => reltioLayoutToReactGridLayout(layout), [layout]);\n const onReltioLayoutChanged = pipe(\n reactGridLayoutToReltioLayout,\n copyPropsFromPreviousLayout(['autosizing'], layout),\n onLayoutChanged\n );\n const handleDrop = (layout, layoutItem, e) => {\n if (onDrop) {\n onDrop(reactGridLayoutToReltioLayout(layout), reactGridLayoutItemToReltioLayoutItem(layoutItem), e);\n }\n };\n const onToggleFullscreen = useCallback((id) => setFullscreenItemId((prevId) => (prevId ? null : id)), []);\n const isFullscreenEnabled = fullscreenItemId !== null;\n\n const onItemHeightResize = useCallback(\n (height, layoutId) => {\n let isLayoutChanged = false;\n\n const newLayout = layout.map((layoutItem) => {\n if (layoutItem.id === layoutId && height) {\n const newHeight = calcHeight(height, layoutOptions);\n\n if (layoutItem.height !== newHeight) {\n isLayoutChanged = true;\n return {\n ...layoutItem,\n minHeight: newHeight,\n maxHeight: newHeight,\n height: newHeight\n };\n }\n }\n return layoutItem;\n });\n\n if (isLayoutChanged) {\n onLayoutChanged(newLayout);\n }\n },\n [layout, layoutOptions, onLayoutChanged]\n );\n\n const getAutosizeComponent = (layoutItemId) => {\n return (\n <ReactResizeDetector\n handleHeight\n onResize={(width, height) => {\n onItemHeightResize(height, layoutItemId);\n }}\n />\n );\n };\n\n return (\n <>\n <ReactResizeDetector\n refreshMode=\"debounce\"\n refreshRate={50}\n handleWidth={true}\n onResize={(width) => setWidth(width)}\n />\n <GridLayout\n innerRef={ref}\n layout={processedLayout}\n cols={cols}\n draggableHandle={draggableHandle}\n autoSize={true}\n rowHeight={rowHeight}\n width={width}\n margin={margin}\n onLayoutChange={onReltioLayoutChanged}\n isResizable={!isFullscreenEnabled}\n isDraggable={!isFullscreenEnabled}\n className={classnames(classes.root, styles.gridLayout, {[styles.gridFullscreen]: isFullscreenEnabled})}\n onDrop={handleDrop}\n droppingItem={droppingItem}\n isDroppable={isDroppable}\n >\n {processedLayout.map((layoutItem) => {\n const isItemFullscreen = fullscreenItemId === layoutItem.i;\n const isAutosize = (getReltioLayoutItemById(layout, layoutItem.i) || {}).autosizing;\n const autosizeComponent = isAutosize ? {AutosizeComponent: getAutosizeComponent(layoutItem.i)} : {};\n return (\n <LayoutItem\n key={layoutItem.i}\n layoutItemConfig={layoutItem}\n views={views}\n onToggleFullscreen={onToggleFullscreen}\n onRemove={onRemove}\n className={classnames({fullscreen: isItemFullscreen}, classes.item)}\n isFullscreen={isItemFullscreen}\n {...autosizeComponent}\n />\n );\n })}\n </GridLayout>\n </>\n );\n};\n\nReltioGridLayout.defaultProps = {\n layoutOptions: {\n cols: 4,\n rowHeight: 30,\n margin: [15, 15]\n },\n onConfigChanged: identity,\n onLayoutChanged: identity,\n classes: {}\n};\nReltioGridLayout.propTypes = {\n views: PropTypes.array,\n layout: PropTypes.array,\n layoutOptions: PropTypes.object,\n onConfigChanged: PropTypes.func,\n onLayoutChanged: PropTypes.func,\n onDrop: PropTypes.func,\n onRemove: PropTypes.func,\n LayoutItem: PropTypes.elementType,\n draggableHandle: PropTypes.string,\n isDroppable: PropTypes.bool,\n droppingItem: PropTypes.object,\n classes: PropTypes.shape({\n root: PropTypes.string,\n item: PropTypes.string\n })\n};\n\nexport default memo(ReltioGridLayout);\n","import React, {useEffect, useState} from 'react';\nimport {createPortal} from 'react-dom';\nimport {MapInstance} from '../../types';\n\ntype Props = {\n children: React.ReactNode;\n className?: string;\n position: number;\n map: MapInstance;\n};\n\nexport const MapControlContainer = ({children, className, position, map}: Props) => {\n const [controlElement, setControlElement] = useState(null);\n\n useEffect(() => {\n const controlDiv = document.createElement('div');\n const divIndex = map.controls[position].length;\n map.controls[position].push(controlDiv);\n setControlElement(controlDiv);\n\n return () => {\n map.controls[position].removeAt(divIndex);\n };\n }, [map, position]);\n\n useEffect(() => {\n if (controlElement && className) {\n controlElement.classList.add(className);\n }\n }, [className, controlElement]);\n\n if (controlElement) {\n return createPortal(children, controlElement);\n }\n\n return null;\n};\n","import React from 'react';\n\nconst SvgRadius: React.FC<React.SVGProps<SVGSVGElement>> = (props) => {\n return (\n <svg width={18} height={18} viewBox=\"0 0 18 18\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <path\n 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\"\n fill=\"#000\"\n stroke=\"none\"\n strokeWidth={1}\n fillRule=\"evenodd\"\n opacity={0.54}\n />\n </svg>\n );\n};\n\nexport default SvgRadius;\n","import React from 'react';\n\nconst SvgDraw: React.FC<React.SVGProps<SVGSVGElement>> = (props) => {\n return (\n <svg\n width={24}\n height={24}\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlnsXlink=\"http://www.w3.org/1999/xlink\"\n {...props}\n >\n <defs>\n <path\n 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\"\n id=\"Draw_svg__a\"\n />\n </defs>\n <g stroke=\"none\" strokeWidth={1} fill=\"none\" fillRule=\"evenodd\">\n <mask id=\"Draw_svg__b\" fill=\"#fff\">\n <use xlinkHref=\"#Draw_svg__a\" />\n </mask>\n <g mask=\"url(#Draw_svg__b)\" fill=\"#000\" fillOpacity={0.54}>\n <path d=\"M0 0h24v24H0z\" />\n </g>\n </g>\n </svg>\n );\n};\n\nexport default SvgDraw;\n","import {makeStyles} from '@material-ui/core/styles';\n\nexport const useStyles = makeStyles({\n container: {\n margin: '2px',\n display: 'flex',\n alignItems: 'center'\n },\n button: {\n color: 'rgba(0,0,0,0.54)',\n padding: 0,\n height: '24px',\n width: '24px',\n minWidth: 0\n },\n icon: {\n width: '20px',\n height: '20px'\n }\n});\n","import React from 'react';\nimport i18n from 'ui-i18n';\nimport {Button as Button} from '@material-ui/core';\nimport {withTooltip} from '../../../../HOCs';\nimport HighlightOffIcon from '@material-ui/icons/HighlightOff';\nimport {MAP_DRAWING_MODES} from '../../../../constants';\nimport RadiusIcon from '../../../../icons/Radius';\nimport DrawIcon from '../../../../icons/Draw';\nimport {DrawingMode, DrawingModes} from '../../types';\nimport {useStyles} from './styles';\n\nexport const ButtonWithTooltip = withTooltip(Button);\n\nconst getIcon = (mode: DrawingMode) => {\n switch (mode) {\n case MAP_DRAWING_MODES.CIRCLE:\n return RadiusIcon;\n case MAP_DRAWING_MODES.POLYGON:\n return DrawIcon;\n default:\n return null;\n }\n};\n\ntype Props = {\n onDrawingModeChanged: (value: DrawingMode | null) => void;\n drawingMode: DrawingMode | null;\n drawingModes: DrawingModes;\n hasActiveOverlay: boolean;\n onClearOverlay: () => void;\n};\n\nexport const TopRightMapControls = ({\n drawingMode,\n drawingModes = [],\n hasActiveOverlay,\n onDrawingModeChanged,\n onClearOverlay\n}: Props) => {\n const styles = useStyles();\n\n const changeDrawingModeTo = (drawingMode) => () => {\n onDrawingModeChanged(drawingMode);\n };\n\n return (\n <div className={styles.container}>\n {drawingMode || hasActiveOverlay ? (\n <ButtonWithTooltip\n tooltipTitle={i18n.text('Clear area')}\n className={styles.button}\n onClick={hasActiveOverlay ? onClearOverlay : changeDrawingModeTo(null)}\n >\n <HighlightOffIcon className={styles.icon} />\n </ButtonWithTooltip>\n ) : (\n drawingModes.map((mode) => {\n const Icon = getIcon(mode);\n return (\n <ButtonWithTooltip\n tooltipTitle={i18n.text('Draw area')}\n key={mode}\n className={styles.button}\n onClick={changeDrawingModeTo(mode)}\n >\n <Icon className={styles.icon} />\n </ButtonWithTooltip>\n );\n })\n )}\n </div>\n );\n};\n","import {makeStyles} from '@material-ui/core/styles';\n\nexport const useStyles = makeStyles({\n container: {\n height: '28px',\n marginRight: '7px',\n marginLeft: 0\n },\n label: {\n fontSize: '11px',\n alignSelf: 'center',\n lineHeight: '13px',\n marginLeft: '2px',\n letterSpacing: 0\n },\n checkbox: {\n width: '20px',\n height: '20px',\n padding: '5px',\n '& svg': {\n width: '16px',\n height: '16px'\n }\n }\n});\n","import React from 'react';\nimport i18n from 'ui-i18n';\nimport {FormControlLabel as FormControlLabel} from '@material-ui/core';\nimport {Checkbox as Checkbox} from '@material-ui/core';\nimport {useStyles} from './styles';\n\ntype Props = {\n isSearchOnMapMove: boolean;\n onChangeIsSearchOnMapMove: (value: boolean) => void;\n};\n\nexport const TopCenterMapControls = ({isSearchOnMapMove, onChangeIsSearchOnMapMove}: Props) => {\n const styles = useStyles();\n const onChange = (event) => {\n onChangeIsSearchOnMapMove(event.target.checked);\n };\n return (\n <FormControlLabel\n classes={{\n root: styles.container,\n label: styles.label\n }}\n control={\n <Checkbox checked={isSearchOnMapMove} onChange={onChange} color=\"primary\" className={styles.checkbox} />\n }\n label={i18n.text('Search as I move the map')}\n />\n );\n};\n","import {MAP_DRAWING_MODES, MAP_MINIMUM_SCALE_RADIUS} from '../../../constants';\nimport {DrawingMode, EntityMarker, Overlay, MapInstance} from '../types';\n\nexport const getMapBoundsPolygon = (map: MapInstance) => {\n const bounds = map.getBounds();\n const ne = bounds.getNorthEast();\n const sw = bounds.getSouthWest();\n const neLat = ne.lat(),\n neLng = ne.lng(),\n swLat = sw.lat(),\n swLng = sw.lng();\n const additionalPoint1 = [];\n const additionalPoint2 = [];\n if (!((neLng === 180 && swLng === -180) || (neLng === -180 && swLng === 180))) {\n // excluding corner case when we see more than one \"map unfolding\" (in this case google maps automatically set 180 and -180),\n // we can't describe map bounds as just rectangle, because lng distance can be more than 180\",\n // so we need to add additional points to have correct polygon\n const center = bounds.getCenter();\n additionalPoint1.push([neLat, center.lng()]);\n additionalPoint2.push([swLat, center.lng()]);\n }\n return [[neLat, neLng], ...additionalPoint1, [neLat, swLng], [swLat, swLng], ...additionalPoint2, [swLat, neLng]];\n};\n\nexport const getDrawingMode = (drawingMode: DrawingMode) => {\n switch (drawingMode) {\n case MAP_DRAWING_MODES.CIRCLE:\n return window.google.maps.drawing.OverlayType.CIRCLE;\n case MAP_DRAWING_MODES.POLYGON:\n return window.google.maps.drawing.OverlayType.POLYGON;\n default:\n return null;\n }\n};\n\nexport const fitMapBoundsForMarkers = (markers: EntityMarker[], map: MapInstance, overlay: Overlay) => {\n const bounds = new window.google.maps.LatLngBounds();\n\n markers.forEach((marker) => bounds.extend(marker.point));\n\n if (markers.length === 1) {\n const center = bounds.getCenter();\n\n bounds.extend(\n new window.google.maps.LatLng(\n center.lat() + MAP_MINIMUM_SCALE_RADIUS,\n center.lng() + MAP_MINIMUM_SCALE_RADIUS\n )\n );\n bounds.extend(\n new window.google.maps.LatLng(\n center.lat() - MAP_MINIMUM_SCALE_RADIUS,\n center.lng() - MAP_MINIMUM_SCALE_RADIUS\n )\n );\n }\n\n map.fitBounds(bounds);\n\n if (overlay) {\n fitMapBoundsForOverlay(map, overlay, bounds);\n }\n};\n\nexport const fitMapBoundsForOverlay = (map: MapInstance, overlay: Overlay, existingBounds?) => {\n if (overlay.path) {\n const bounds = existingBounds || new window.google.maps.LatLngBounds();\n overlay.path.forEach(({lat, lng}) => bounds.extend(new window.google.maps.LatLng(lat, lng)));\n map.fitBounds(bounds);\n }\n};\n","export const MARKER = `<?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>`;\n","import {makeStyles} from '@material-ui/core/styles';\n\nexport const useStyles = makeStyles({\n popper: {\n maxWidth: '263px',\n minWidth: '150px',\n 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)',\n backgroundColor: 'white',\n borderRadius: '2px'\n }\n});\n","import React, {memo, useCallback, useContext, useRef, useState} from 'react';\nimport {pathEq} from 'ramda';\nimport {Marker, InfoBox, MarkerProps} from '@react-google-maps/api';\nimport ProfileCard from '../../ProfileCard/ProfileCard';\nimport Popper from '../../Popper/Popper';\nimport {debounce, svg2Url} from '@reltio/mdm-sdk';\nimport {EntityMarkerContext} from '../../../contexts';\nimport {MARKER} from './icons/marker.inline.svg';\nimport {HOVERED_MARKER} from './icons/marker-hover.inline.svg';\nimport {EntityMarker as EntityMarkerType} from '../types';\nimport {useStyles} from './styles';\n\nconst HIDE_DEBOUNCE_INTERVAL = 50;\nconst MARKER_WIDTH = 22;\nconst MARKER_HEIGHT = 32;\nconst MARKER_CARD_MARGIN = 8;\n\nconst hoveredMarkerIcon = svg2Url(HOVERED_MARKER);\nconst markerIcon = svg2Url(MARKER);\n\ntype Props = {\n marker: EntityMarkerType;\n onClick: (marker: EntityMarkerType) => void;\n} & Omit<MarkerProps, 'onClick' | 'icon' | 'position' | 'visible' | 'onMouseOver' | 'onMouseOut'>;\n\nconst EntityMarker = ({marker, onClick, ...otherProps}: Props) => {\n const styles = useStyles();\n const popperAnchor = useRef();\n const [hovered, setHovered] = useState(false);\n const {activeEntityUri} = useContext(EntityMarkerContext);\n const isActive = pathEq(['entity', 'uri'], activeEntityUri, marker);\n const position = {lat: marker.point.lat, lng: marker.point.lng};\n const setHoveredDebounced = useCallback(debounce(setHovered, HIDE_DEBOUNCE_INTERVAL), []);\n const onMouseOver = useCallback(() => setHoveredDebounced(true), [setHoveredDebounced]);\n const onMouseOut = useCallback(() => setHoveredDebounced(false), [setHoveredDebounced]);\n const handleClick = useCallback(() => onClick(marker), [onClick, marker]);\n\n return (\n <>\n <Popper\n anchorEl={popperAnchor.current}\n open={hovered}\n className={styles.popper}\n modal={false}\n placement=\"top\"\n >\n <ProfileCard entity={marker.entity} onMouseOver={onMouseOver} onMouseOut={onMouseOut} />\n </Popper>\n <Marker\n icon={{\n url: hovered || isActive ? hoveredMarkerIcon : markerIcon,\n // needed for IE:\n scaledSize: new google.maps.Size(MARKER_WIDTH, MARKER_HEIGHT) //eslint-disable-line\n }}\n position={position}\n onClick={handleClick}\n visible={marker.visible !== false}\n onMouseOver={onMouseOver}\n onMouseOut={onMouseOut}\n {...otherProps}\n />\n <InfoBox\n options={{\n alignBottom: true,\n pane: 'mapPane',\n pixelOffset: new google.maps.Size(0, -(MARKER_HEIGHT + MARKER_CARD_MARGIN)), //eslint-disable-line\n closeBoxURL: '',\n enableEventPropagation: true,\n disableAutoPan: true\n }}\n position={position}\n >\n <span ref={popperAnchor} />\n </InfoBox>\n </>\n );\n};\n\nexport default memo(EntityMarker);\n","export const HOVERED_MARKER = `<?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>`;\n","import {makeStyles} from '@material-ui/core/styles';\n\nexport const useStyles = makeStyles({\n mapControlContainer: {\n borderRadius: '2px',\n backgroundColor: '#FFFFFF',\n boxShadow: '0 1px 3px 0 rgba(0,0,0,0.15)',\n margin: '10px'\n }\n});\n","import React, {useCallback, useEffect, useMemo, useRef, useState} from 'react';\nimport {propEq, isEmpty, prop} from 'ramda';\nimport {\n GoogleMap,\n useJsApiLoader,\n GoogleMapProps,\n Polygon,\n DrawingManager,\n MarkerClusterer,\n LoadScriptProps,\n MarkerClustererProps\n} from '@react-google-maps/api';\nimport {MapControlContainer} from './MapControls/MapControlContainer/MapControlContrainer';\nimport {TopRightMapControls} from './MapControls/TopRightMapControls/TopRightMapControls';\nimport {TopCenterMapControls} from './MapControls/TopCenterMapControls/TopCenterMapControls';\nimport {getMapBoundsPolygon, getDrawingMode, fitMapBoundsForMarkers, fitMapBoundsForOverlay} from './helpers';\nimport EntityMarker from './EntityMarker/EntityMarker';\nimport {DEFAULT_GOOGLE_MAP_OPTIONS, DEFAULT_OVERLAY_OPTIONS, MAP_DRAWING_MODES} from '../../constants';\nimport {DrawingModes, EntityMarker as Marker, MapBounds, Overlay, OverlayPath} from './types';\nimport {useStyles} from './styles';\nimport {usePrevious} from '../../hooks';\n\nconst ON_MAP_MOVE_DEBOUNCE_INTERVAL = 1000;\n\ntype Props = {\n markers: Marker[];\n mapKey: string;\n defaultZoom: GoogleMapProps['zoom'];\n defaultCenter: GoogleMapProps['center'];\n loadingElement: JSX.Element;\n isSearchOnMapMove?: boolean;\n isSearchEnabled?: boolean;\n activeOverlay?: Overlay;\n overlayOptions?: google.maps.PolygonOptions | google.maps.CircleOptions;\n drawingModes?: DrawingModes;\n markerClusterer?: boolean;\n markerClustererOptions?: MarkerClustererProps['options'];\n mapOptions?: google.maps.MapOptions;\n mapContainerClassName: string;\n onMapBoundsChanged?: (value: MapBounds | null) => void;\n onOverlayUpdated?: (value: {data: OverlayPath; type: string}) => void;\n onMarkerClicked?: (value: Marker) => void;\n};\n\nconst libraries = ['drawing'] as LoadScriptProps['libraries'];\n\nconst useFitMapBounds = ({markers, activeOverlay, isSearchOnMapMove, map}) => {\n const prevMarkers = usePrevious(markers);\n const prevActiveOverlay = usePrevious(activeOverlay);\n const apiIsLoaded = map && window.google;\n\n useEffect(() => {\n if (apiIsLoaded && !isSearchOnMapMove && markers.length && markers !== prevMarkers) {\n fitMapBoundsForMarkers(markers, map, activeOverlay);\n } else if (apiIsLoaded && activeOverlay && activeOverlay !== prevActiveOverlay) {\n fitMapBoundsForOverlay(map, activeOverlay);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [map, markers, activeOverlay]);\n};\n\nexport const ReltioMap = ({\n markers = [],\n mapKey,\n defaultZoom,\n defaultCenter,\n loadingElement,\n isSearchOnMapMove,\n isSearchEnabled,\n activeOverlay,\n overlayOptions,\n drawingModes = [],\n markerClusterer,\n markerClustererOptions,\n mapOptions,\n mapContainerClassName,\n onMapBoundsChanged,\n onOverlayUpdated,\n onMarkerClicked\n}: Props) => {\n const styles = useStyles();\n const {isLoaded, loadError} = useJsApiLoader({\n googleMapsApiKey: mapKey,\n libraries\n });\n\n const mapMoveEndTimer = useRef(null);\n const [map, setMap] = useState(null);\n const [polygon, setPolygon] = useState(null);\n const [drawingMode, setDrawingMode] = useState(null);\n\n useFitMapBounds({markers, activeOverlay, map, isSearchOnMapMove});\n\n const allOverlayOptions = useMemo(\n () => ({\n ...DEFAULT_OVERLAY_OPTIONS,\n ...(overlayOptions || {})\n }),\n [overlayOptions]\n );\n\n const googleMapOptions = useMemo(\n () => ({\n ...DEFAULT_GOOGLE_MAP_OPTIONS,\n ...(mapOptions || {})\n }),\n [mapOptions]\n );\n\n const handleChangeIsSearchOnMapMove = useCallback(\n (isSearchOnMapMove: boolean) => {\n onMapBoundsChanged(isSearchOnMapMove ? getMapBoundsPolygon(map) : null);\n setDrawingMode(null);\n clearTimeout(mapMoveEndTimer.current);\n },\n [map, onMapBoundsChanged]\n );\n\n const handleMapMoveStart = useCallback(() => {\n clearTimeout(mapMoveEndTimer.current);\n }, []);\n\n const handleMapMoveEnd = useCallback(() => {\n if (isSearchOnMapMove) {\n onMapBoundsChanged(getMapBoundsPolygon(map));\n }\n }, [isSearchOnMapMove, map, onMapBoundsChanged]);\n\n const handleMapIdle = useCallback(() => {\n if (isSearchOnMapMove) {\n clearTimeout(mapMoveEndTimer.current);\n mapMoveEndTimer.current = setTimeout(handleMapMoveEnd, ON_MAP_MOVE_DEBOUNCE_INTERVAL);\n }\n }, [handleMapMoveEnd, isSearchOnMapMove]);\n\n const handleOverlayChange = useCallback(\n (e, propOverlay?) => {\n const stateOverlay =\n propOverlay ||\n (polygon && {\n type: MAP_DRAWING_MODES.POLYGON,\n overlay: polygon\n });\n\n if (!isEmpty(stateOverlay) && typeof onOverlayUpdated === 'function') {\n const {overlay, type} = stateOverlay;\n\n const typeActions = {\n [MAP_DRAWING_MODES.POLYGON]: () => {\n return overlay\n .getPath()\n .getArray()\n .map((latlng) => [latlng.lat(), latlng.lng()]);\n },\n [MAP_DRAWING_MODES.CIRCLE]: () => {\n return {radius: overlay.getRadius() / 1000, center: overlay.getCenter()};\n }\n };\n\n const data = typeActions[type] && typeActions[type]();\n data && onOverlayUpdated({data, type});\n }\n },\n [onOverlayUpdated, polygon]\n );\n\n const handleOverlayComplete = useCallback(\n (type) => (overlay) => {\n handleOverlayChange(null, {type, overlay});\n overlay.setMap(null);\n setDrawingMode(null);\n },\n [handleOverlayChange]\n );\n\n const handleClearOverlay = useCallback(() => {\n onOverlayUpdated(null);\n }, [onOverlayUpdated]);\n\n const renderMarkers = (clusterer?) => {\n return markers\n .filter(prop('point'))\n .map((marker) => (\n <EntityMarker key={marker.id} marker={marker} clusterer={clusterer} onClick={onMarkerClicked} />\n ));\n };\n\n const renderMarkerClusterer = (options) => {\n return <MarkerClusterer options={options}>{renderMarkers}</MarkerClusterer>;\n };\n\n if (loadError) {\n return null;\n }\n\n if (!isLoaded) {\n return loadingElement;\n }\n\n return (\n <GoogleMap\n mapTypeId={window.google.maps.MapTypeId.ROADMAP}\n options={googleMapOptions}\n onLoad={setMap}\n zoom={defaultZoom}\n center={defaultCenter}\n onZoomChanged={handleMapMoveStart}\n onDragStart={handleMapMoveStart}\n onIdle={handleMapIdle}\n mapContainerClassName={mapContainerClassName}\n >\n {map && isSearchEnabled && Boolean(drawingModes.length) && (\n <MapControlContainer\n className={styles.mapControlContainer}\n position={window.google.maps.ControlPosition.TOP_RIGHT}\n map={map}\n >\n <TopRightMapControls\n hasActiveOverlay={!!activeOverlay}\n drawingModes={drawingModes}\n drawingMode={drawingMode}\n onDrawingModeChanged={setDrawingMode}\n onClearOverlay={handleClearOverlay}\n />\n </MapControlContainer>\n )}\n\n {map && isSearchEnabled && (\n <MapControlContainer\n className={styles.mapControlContainer}\n position={window.google.maps.ControlPosition.TOP_CENTER}\n map={map}\n >\n <TopCenterMapControls\n onChangeIsSearchOnMapMove={handleChangeIsSearchOnMapMove}\n isSearchOnMapMove={isSearchOnMapMove}\n />\n </MapControlContainer>\n )}\n\n {markerClusterer ? renderMarkerClusterer(markerClustererOptions) : renderMarkers()}\n\n {!getDrawingMode(drawingMode) &&\n activeOverlay &&\n propEq('type', MAP_DRAWING_MODES.POLYGON, activeOverlay) && (\n <Polygon\n onLoad={setPolygon}\n path={activeOverlay.path}\n editable={true}\n options={allOverlayOptions}\n onMouseUp={handleOverlayChange}\n onDragEnd={handleOverlayChange}\n />\n )}\n\n {isSearchEnabled && Boolean(drawingModes.length) && (\n <DrawingManager\n onPolygonComplete={handleOverlayComplete(MAP_DRAWING_MODES.POLYGON)}\n onCircleComplete={handleOverlayComplete(MAP_DRAWING_MODES.CIRCLE)}\n drawingMode={getDrawingMode(drawingMode)}\n options={{\n drawingControl: false,\n circleOptions: allOverlayOptions,\n polygonOptions: allOverlayOptions\n }}\n />\n )}\n </GoogleMap>\n );\n};\n","import {makeStyles} from '@material-ui/core/styles';\n\nexport const useStyles = makeStyles({\n attributesContainer: {\n padding: '0 16px 16px 16px'\n },\n header: {\n marginBottom: '4px'\n },\n noCaption: {\n paddingTop: '16px'\n },\n noData: {\n fontSize: '13px',\n color: 'rgba(0,0,0,0.54)'\n }\n});\n","import {connect} from 'react-redux';\nimport mdmModule from '@reltio/mdm-module';\nimport {AttributesViewStateProps} from '../../types';\nimport AttributesView from './AttributesView';\n\nconst mapStateToProps = (state): AttributesViewStateProps => ({\n metadata: mdmModule.selectors.getMetadata(state)\n});\n\nexport {AttributesView};\n\nexport default connect(mapStateToProps)(AttributesView);\n","import React, {useMemo} from 'react';\nimport {useSelector} from 'react-redux';\nimport mdm from '@reltio/mdm-module';\nimport {Entity, getAttributesListForReadMode, isEmptyValue, PivotingAttribute} from '@reltio/mdm-sdk';\nimport classnames from 'classnames';\nimport i18n from 'ui-i18n';\nimport {Box as Box} from '@material-ui/core';\nimport {Typography as Typography} from '@material-ui/core';\nimport {PivotingAttributeContext} from '../../../../contexts';\nimport BasicView from '../../../BasicView/BasicView';\nimport FacetViewHeader from '../../../FacetViewHeader/FacetViewHeader';\nimport AttributesList from '../AttributesList';\nimport {AttributesViewProps} from '../../types';\nimport {getFilteredAttrTypes} from '../../helpers/attributesView';\nimport {useStyles} from './styles';\n\ntype Props = Omit<AttributesViewProps, 'mode'>;\n\nconst AttributesView = ({\n className,\n entity = {} as Entity,\n metadata,\n caption = '',\n excludeUris = [],\n includeUris = [],\n attributesCount = 16\n}: Props) => {\n const styles = useStyles();\n const pivotingAttributes: PivotingAttribute[] = useSelector(mdm.selectors.getPivotingAttributes);\n\n const filteredAttrTypes = useMemo(() => getFilteredAttrTypes(metadata, entity.type, includeUris, excludeUris), [\n excludeUris,\n includeUris,\n metadata,\n entity.type\n ]);\n\n const attributesList = getAttributesListForReadMode(filteredAttrTypes, entity);\n\n const isShowAttributeList = attributesList.filter(({values}) => !isEmptyValue(values)).length > 0;\n\n return isShowAttributeList || !isEmptyValue(caption) ? (\n <PivotingAttributeContext.Provider value={pivotingAttributes}>\n <BasicView className={className}>\n {caption && <FacetViewHeader className={styles.header} title={caption} />}\n <Box className={classnames(styles.attributesContainer, {[styles.noCaption]: !caption})}>\n {isShowAttributeList ? (\n <AttributesList\n entity={entity}\n attrTypes={filteredAttrTypes}\n parentUri={entity.uri}\n drawLines={false}\n max={attributesCount}\n />\n ) : (\n <Typography className={styles.noData}>{i18n.text('No data found')}</Typography>\n )}\n </Box>\n </BasicView>\n </PivotingAttributeContext.Provider>\n ) : null;\n};\n\nexport default AttributesView;\n","import {makeStyles} from '@material-ui/core/styles';\n\nexport const useStyles = makeStyles({\n attributesContainer: {\n padding: '0 16px 16px 16px'\n },\n header: {\n marginBottom: '4px'\n },\n noCaption: {\n paddingTop: '16px'\n }\n});\n","import React, {useCallback, useContext, useMemo} from 'react';\nimport {useDispatch, useSelector} from 'react-redux';\nimport classnames from 'classnames';\nimport {pipe} from 'ramda';\nimport mdmModule, {profile} from '@reltio/mdm-module';\nimport {Entity, isTempUri, getPinnedAttributesForUser, AttributeItem} from '@reltio/mdm-sdk';\nimport {Box as Box} from '@material-ui/core';\nimport BasicView from '../../../BasicView/BasicView';\nimport FacetViewHeader from '../../../FacetViewHeader/FacetViewHeader';\nimport AttributesList from '../AttributesList';\nimport {ViewIdContext} from '../../../../contexts';\nimport {AttributesViewProps} from '../../types';\nimport {getFilteredAttrTypes} from '../../helpers/attributesView';\nimport {PinnedAttributesContext} from '../contexts/PinnedAttributesContext';\nimport {useStyles} from './styles';\n\ntype Props = Omit<AttributesViewProps, 'attributesCount'>;\n\nconst AttributesView = ({\n className,\n entity = {} as Entity,\n mode,\n metadata,\n caption = '',\n excludeUris = [],\n includeUris = [],\n pinnedAttributes\n}: Props) => {\n const styles = useStyles();\n const dispatch = useDispatch();\n const viewId = useContext(ViewIdContext);\n const userRoles = useSelector(mdmModule.selectors.getUserRoles);\n const pinnedAttributeUris = useMemo(() => getPinnedAttributesForUser(pinnedAttributes, userRoles), [\n pinnedAttributes,\n userRoles\n ]);\n const modifiedEntity = useSelector(\n (state) => mdmModule.selectors.getModifiedEntity(state, entity.uri) || ({} as Entity)\n );\n\n const filteredAttrTypes = useMemo(\n () => getFilteredAttrTypes(metadata, modifiedEntity.type, includeUris, excludeUris),\n [excludeUris, includeUris, metadata, modifiedEntity.type]\n );\n\n const onAddAttributes = useCallback(\n (params: AttributeItem[]) =>\n pipe(profile.actions.addAttributes, dispatch)(params.map((param) => ({...param, viewId}))),\n [viewId, dispatch]\n );\n\n const onChangeAttribute = useCallback(\n (params: AttributeItem) => pipe(profile.actions.modifyAttribute, dispatch)({...params, viewId}),\n [viewId, dispatch]\n );\n\n const onDeleteAttribute = useCallback(\n (params: AttributeItem) => pipe(profile.actions.removeAttribute, dispatch)({...params, viewId}),\n [viewId, dispatch]\n );\n\n return (\n <BasicView className={className}>\n {caption && <FacetViewHeader className={styles.header} title={caption} />}\n <Box className={classnames(styles.attributesContainer, {[styles.noCaption]: !caption})}>\n <PinnedAttributesContext.Provider value={pinnedAttributeUris}>\n <AttributesList\n entity={modifiedEntity}\n attrTypes={filteredAttrTypes}\n parentUri={modifiedEntity.uri}\n drawLines={false}\n mode={mode}\n showEmptyEditors={isTempUri(modifiedEntity.uri)}\n crosswalks={modifiedEntity.crosswalks}\n onAddAttributes={onAddAttributes}\n onChangeAttribute={onChangeAttribute}\n onDeleteAttribute={onDeleteAttribute}\n />\n </PinnedAttributesContext.Provider>\n </Box>\n </BasicView>\n );\n};\n\nexport default AttributesView;\n","import {connect} from 'react-redux';\nimport mdmModule from '@reltio/mdm-module';\nimport {AttributesViewStateProps} from '../../types';\nimport AttributesView from './AttributesView';\n\nconst mapStateToProps = (state): AttributesViewStateProps => ({\n metadata: mdmModule.selectors.getMetadata(state)\n});\n\nexport {AttributesView};\n\nexport default connect(mapStateToProps)(AttributesView);\n","import React from 'react';\nimport {isViewMode, Mode} from '@reltio/mdm-sdk';\nimport {AttributesViewOwnProps} from '../types';\nimport ReadModeAttributesView from '../readMode/AttributesView';\nimport EditModeAttributesView from '../editMode/AttributesView';\nimport {EntityContext} from '../../../contexts';\n\nconst AttributesView = ({\n mode = Mode.Viewing,\n attributesCount,\n pinnedAttributes,\n entity,\n ...restProps\n}: AttributesViewOwnProps) => {\n return (\n <EntityContext.Provider value={entity}>\n {isViewMode(mode) ? (\n <ReadModeAttributesView attributesCount={attributesCount} entity={entity} {...restProps} />\n ) : (\n <EditModeAttributesView\n mode={mode}\n pinnedAttributes={pinnedAttributes}\n entity={entity}\n {...restProps}\n />\n )}\n </EntityContext.Provider>\n );\n};\n\nexport default AttributesView;\n","import {connect} from 'react-redux';\nimport mdm from '@reltio/mdm-module';\nimport {AttributesViewOwnProps} from '../types';\nimport AttributesView from './AttributesView';\n\ntype Props = Pick<AttributesViewOwnProps, 'entity' | 'mode'>;\n\nconst mapStateToProps = (state, ownProps: Props): Props => ({\n entity: ownProps.entity || mdm.selectors.getEntityWithDiff(state),\n mode: ownProps.mode || mdm.selectors.getMode(state)\n});\n\nexport {AttributesView};\n\nexport default connect(mapStateToProps)(AttributesView);\n","import {useEffect} from 'react';\nimport {useDispatch, useSelector} from 'react-redux';\nimport {evolve, map} from 'ramda';\nimport {entity as History, HistoryDiff, wrapInArrayIfNeeded} from '@reltio/mdm-sdk';\nimport mdmModule, {HistoryMode, profile} from '@reltio/mdm-module';\n\nexport const defaultHistoryDiff: HistoryDiff = {\n appearance: {},\n attributes: {},\n roles: [],\n tags: []\n};\n\nconst fixRefEntity = evolve({\n refEntity: wrapInArrayIfNeeded,\n refRelation: wrapInArrayIfNeeded\n});\n\nconst prepareHistorySlice = (historySlice) => {\n if (historySlice) {\n return evolve({\n attributes: map(map(fixRefEntity))\n })(historySlice);\n }\n return historySlice;\n};\n\nexport const useHistoryDiff = () => {\n const dispatch = useDispatch();\n const historySlice = useSelector(mdmModule.selectors.getHistorySlice);\n const historyDiff = useSelector(mdmModule.selectors.getHistoryDiff);\n const historyMode = useSelector(mdmModule.selectors.getHistoryMode);\n const entity = useSelector(mdmModule.selectors.getEntity);\n\n useEffect(() => {\n if (historySlice) {\n const {aEntity, bEntity} = historySlice;\n const historyManager = History.HistoryManager.createHistoryManager(History.AttributesDiff);\n const historyDiff: HistoryDiff = historyManager.computeEntityHistoryDiff(\n prepareHistorySlice(historyMode === HistoryMode.Current ? entity : bEntity),\n prepareHistorySlice(aEntity)\n );\n dispatch(profile.history.actions.setHistoryDiff(historyDiff));\n }\n }, [historySlice, historyMode, dispatch, entity]);\n\n return historyDiff || defaultHistoryDiff;\n};\n","import {makeStyles} from '@material-ui/core/styles';\n\nexport const useStyles = makeStyles((theme) => ({\n card: {\n borderBottom: '1px solid rgba(0,0,0,0.06)'\n },\n withBackground: {\n backgroundColor: 'rgba(0, 0, 0, 0.03)'\n },\n lineWrapper: {\n position: 'relative'\n },\n icon: {\n position: 'absolute',\n top: '8px',\n left: '16px',\n width: '32px',\n height: '32px',\n zIndex: 1\n },\n line: ({color}: {color: string}) => ({\n borderLeft: `3px solid ${color}`,\n position: 'absolute',\n left: 0,\n top: 0,\n bottom: 0\n }),\n info: {\n fontSize: '13px',\n color: theme.palette.text.secondary,\n wordWrap: 'break-word',\n lineHeight: '15px'\n },\n commentsInfo: {\n display: 'flex',\n alignItems: 'center',\n marginBottom: '-4px',\n marginTop: '7px'\n },\n commentsIcon: {\n width: '11px',\n height: '11px',\n marginLeft: '2px',\n marginRight: '6px',\n marginTop: '-2px'\n },\n infoValue: {\n color: theme.palette.text.primary\n },\n infoBlock: {\n display: 'flex',\n flexDirection: 'row',\n marginBottom: '5px'\n },\n header: {\n display: 'flex',\n flexDirection: 'row',\n paddingBottom: '12px'\n },\n flex: {\n flex: 1\n },\n caption: {\n fontSize: '16px',\n color: theme.palette.text.primary\n },\n title: {\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center',\n marginBottom: '-4px'\n },\n flag: {\n height: '13px',\n width: '13px',\n marginTop: '-2px',\n stroke: '#000000',\n fill: 'none',\n margin: '2px 5px 0 5px'\n },\n date: {\n fontSize: '13px',\n color: theme.palette.text.primary\n },\n mainInfo: {\n display: 'flex',\n flexDirection: 'column',\n flex: 1\n },\n controlsBox: {\n marginRight: '16px',\n marginBottom: '12px',\n marginTop: '13px'\n },\n controlsInRow: {\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n marginBottom: '20px'\n },\n priority: {\n width: '162px'\n },\n comments: {\n marginLeft: '11px'\n }\n}));\n","import React from 'react';\nimport i18n from 'ui-i18n';\nimport {WorkflowTaskData} from '@reltio/mdm-sdk';\n\nimport DropDownSelector from '../../../DropDownSelector/DropDownSelector';\nimport {useWorkflowAssignee} from '../../hooks/useWorkflowAssignee';\n\ntype Props = Pick<WorkflowTaskData, 'taskId' | 'assignee'> & {\n isTaskOpen?: WorkflowTaskData['isOpen'];\n};\n\nconst AssigneeSelector = ({taskId, assignee, isTaskOpen}: Props) => {\n const {\n assignee: currentAssignee,\n getAssignees,\n updateAssignee,\n updateRequestIsInProgress,\n readOnly\n } = useWorkflowAssignee({\n taskId,\n assignee,\n isOpen: isTaskOpen\n });\n const disabled = updateRequestIsInProgress || readOnly;\n\n return (\n <DropDownSelector\n isDisabled={disabled}\n getOptions={getAssignees}\n onChange={updateAssignee}\n hideSelectedOptions={false}\n label={i18n.text('Assigned to')}\n value={currentAssignee}\n defaultOptions={true}\n TextFieldProps={{disabled}}\n height={40}\n />\n );\n};\n\nexport default AssigneeSelector;\n","import {makeStyles} from '@material-ui/core/styles';\n\nexport const useStyles = makeStyles({\n dueDate: {\n marginTop: 0,\n marginBottom: 0\n },\n dueDateInput: {\n height: '40px'\n },\n inputLabel: {\n fontSize: '14px'\n }\n});\n","import {useState, useCallback, useContext} from 'react';\nimport {useSelector} from 'react-redux';\nimport {updateDueDateForTask, WorkflowTaskData} from '@reltio/mdm-sdk';\nimport mdmModule from '@reltio/mdm-module';\nimport {useSafePromise} from '../../../hooks';\nimport {WorkflowTasksContext} from '../../../contexts/WorkflowTasksContext';\nimport {showWorkflowError} from '../helpers/errors';\nimport {useWorkflowCheckPermission} from './useWorkflowCheckPermission';\nimport {isOpenTask} from '../helpers';\n\nexport const useWorkflowDueDate = ({\n dueDate,\n taskId,\n isOpen\n}: Pick<WorkflowTaskData, 'dueDate' | 'taskId' | 'isOpen'>) => {\n const {updateTaskState} = useContext(WorkflowTasksContext) || {};\n const workflowPath: string = useSelector(mdmModule.selectors.getWorkflowPath);\n const environment: string = useSelector(mdmModule.selectors.getWorkflowEnvironmentUrl);\n const tenant: string = useSelector(mdmModule.selectors.getTenant);\n const safePromise = useSafePromise();\n const [updateRequestIsInProgress, setUpdateRequestIsInProgress] = useState(false);\n const checkWorkflowPermission = useWorkflowCheckPermission();\n const canUpdateTask = checkWorkflowPermission('UPDATE_TASK') && isOpenTask(isOpen);\n\n const updateDueDate = useCallback(\n (newValue: number) => {\n if (workflowPath && canUpdateTask && taskId && newValue && dueDate !== newValue) {\n setUpdateRequestIsInProgress(true);\n safePromise(\n updateDueDateForTask({\n taskId,\n workflowPath,\n environment,\n tenant,\n dueDate: newValue\n })\n )\n .then(() => {\n updateTaskState?.(taskId, {dueDate: newValue});\n })\n .catch(showWorkflowError)\n .finally(() => {\n setUpdateRequestIsInProgress(false);\n });\n }\n },\n [workflowPath, taskId, environment, tenant, updateTaskState, safePromise, dueDate, canUpdateTask]\n );\n return {updateDueDate, updateRequestIsInProgress, readOnly: !canUpdateTask};\n};\n","import React from 'react';\nimport i18n from 'ui-i18n';\nimport classnames from 'classnames';\nimport {pipe} from 'ramda';\nimport {WorkflowTaskData} from '@reltio/mdm-sdk';\n\nimport {useStyles} from './styles';\nimport {DateEditor} from '../../../editors';\nimport {useWorkflowDueDate} from '../../hooks/useWorkflowDueDate';\n\ntype Props = Pick<WorkflowTaskData, 'taskId' | 'dueDate'> & {\n isTaskOpen?: WorkflowTaskData['isOpen'];\n className?: string;\n};\nconst DueDateField = ({taskId, dueDate, isTaskOpen, className}: Props) => {\n const styles = useStyles();\n const {updateDueDate, updateRequestIsInProgress, readOnly} = useWorkflowDueDate({\n dueDate,\n taskId,\n isOpen: isTaskOpen\n });\n\n return (\n <DateEditor\n className={classnames(styles.dueDate, className)}\n disabled={updateRequestIsInProgress || readOnly}\n value={dueDate}\n label={i18n.text('Due date')}\n onChange={pipe((date) => date && date.getTime(), updateDueDate)}\n margin=\"dense\"\n InputProps={{className: styles.dueDateInput}}\n InputLabelProps={{classes: {root: styles.inputLabel}}}\n />\n );\n};\n\nexport default DueDateField;\n","import React from 'react';\nimport i18n from 'ui-i18n';\nimport {propEq} from 'ramda';\nimport {WorkflowTaskData} from '@reltio/mdm-sdk';\n\nimport DropDownSelector from '../../../DropDownSelector/DropDownSelector';\nimport {useWorkflowPriority} from '../../hooks/useWorkflowPriority';\n\ntype Props = Pick<WorkflowTaskData, 'taskId' | 'priority'> & {\n isTaskOpen?: WorkflowTaskData['isOpen'];\n className?: string;\n};\n\nconst PrioritySelector = ({taskId, priority, isTaskOpen, className}: Props) => {\n const {priorities, updatePriority, updateRequestIsInProgress, readOnly} = useWorkflowPriority({\n taskId,\n priority,\n isOpen: isTaskOpen\n });\n const disabled = updateRequestIsInProgress || readOnly;\n\n return (\n <DropDownSelector\n className={className}\n isDisabled={disabled}\n options={priorities}\n onChange={updatePriority}\n hideSelectedOptions={false}\n label={i18n.text('Priority')}\n value={priorities.find(propEq('value', priority))}\n TextFieldProps={{disabled}}\n height={40}\n />\n );\n};\n\nexport default PrioritySelector;\n","import {useState, useCallback, useContext, useMemo} from 'react';\nimport {useSelector} from 'react-redux';\nimport i18n from 'ui-i18n';\nimport {updatePriorityForTask, WorkflowPriority, WorkflowTaskData} from '@reltio/mdm-sdk';\nimport mdmModule from '@reltio/mdm-module';\nimport {useSafePromise} from '../../../hooks';\nimport {WorkflowTasksContext} from '../../../contexts/WorkflowTasksContext';\nimport {showWorkflowError} from '../helpers/errors';\nimport {useWorkflowCheckPermission} from './useWorkflowCheckPermission';\nimport {isOpenTask} from '../helpers';\n\ntype PriorityOption = {label: string; value: number};\n\nexport const useWorkflowPriority = ({\n priority,\n taskId,\n isOpen\n}: Pick<WorkflowTaskData, 'taskId' | 'priority' | 'isOpen'>) => {\n const {updateTaskState} = useContext(WorkflowTasksContext) || {};\n const workflowPath: string = useSelector(mdmModule.selectors.getWorkflowPath);\n const environment: string = useSelector(mdmModule.selectors.getWorkflowEnvironmentUrl);\n const tenant: string = useSelector(mdmModule.selectors.getTenant);\n const safePromise = useSafePromise();\n const [updateRequestIsInProgress, setUpdateRequestIsInProgress] = useState(false);\n const checkWorkflowPermission = useWorkflowCheckPermission();\n const canUpdateTask = checkWorkflowPermission('UPDATE_TASK') && isOpenTask(isOpen);\n\n const updatePriority = useCallback(\n (newValue: PriorityOption) => {\n const {value: newPriority} = newValue;\n if (workflowPath && canUpdateTask && taskId && priority !== newPriority) {\n setUpdateRequestIsInProgress(true);\n safePromise(\n updatePriorityForTask({\n taskId,\n workflowPath,\n environment,\n tenant,\n priority: newPriority\n })\n )\n .then(() => {\n updateTaskState?.(taskId, {priority: newPriority});\n })\n .catch(showWorkflowError)\n .finally(() => {\n setUpdateRequestIsInProgress(false);\n });\n }\n },\n [workflowPath, taskId, environment, tenant, updateTaskState, safePromise, priority, canUpdateTask]\n );\n\n const priorities: PriorityOption[] = useMemo(\n () => [\n {\n label: i18n.text('Low'),\n value: WorkflowPriority.low\n },\n {\n label: i18n.text('Medium'),\n value: WorkflowPriority.medium\n },\n {\n label: i18n.text('High'),\n value: WorkflowPriority.high\n },\n {\n label: i18n.text('Urgent'),\n value: WorkflowPriority.urgent\n }\n ],\n []\n );\n return {priorities, updatePriority, updateRequestIsInProgress, readOnly: !canUpdateTask};\n};\n","import React from 'react';\nimport {WorkflowTaskData} from '@reltio/mdm-sdk';\nimport MoreVertIcon from '@material-ui/icons/MoreVert';\n\nimport {useWorkflowActions} from '../../hooks/useWorkflowActions';\nimport DropDownMenuButton from '../../../DropDownMenuButton/DropDownMenuButton';\nimport SmallIconButton from '../../../SmallIconButton/SmallIconButton';\n\ntype Props = Pick<WorkflowTaskData, 'taskId' | 'possibleActions' | 'assignee'> & {\n isTaskOpen?: WorkflowTaskData['isOpen'];\n};\n\nconst TaskActions = ({taskId, possibleActions, assignee, isTaskOpen}: Props) => {\n const {actions, actionRequestIsInProgress: disabled} = useWorkflowActions({\n taskId,\n possibleActions,\n assignee,\n isOpen: isTaskOpen\n });\n\n return actions.length > 0 ? (\n <DropDownMenuButton\n buttonComponent={SmallIconButton}\n buttonProps={{\n icon: MoreVertIcon,\n size: 'L',\n disabled\n }}\n menuId={'workflow-actions'}\n menuItems={actions}\n />\n ) : null;\n};\n\nexport default TaskActions;\n","import {useCallback, useContext, useMemo, useState} from 'react';\nimport {useDispatch, useSelector} from 'react-redux';\nimport {runTaskAction, WorkflowTaskData} from '@reltio/mdm-sdk';\nimport mdmModule, {profile, ui} from '@reltio/mdm-module';\nimport {ViewIdContext} from '../../../contexts/ViewIdContext';\nimport {showWorkflowError} from '../helpers/errors';\nimport {WorkflowTasksContext} from '../../../contexts/WorkflowTasksContext';\nimport {isOpenTask} from '../helpers';\n\ntype TaskAction = {text: string; onClick: () => void};\n\nexport const useWorkflowActions = ({\n possibleActions,\n assignee,\n taskId,\n isOpen\n}: Pick<WorkflowTaskData, 'taskId' | 'possibleActions' | 'assignee' | 'isOpen'>) => {\n const {loadWorkflowTasks} = useContext(WorkflowTasksContext) || {};\n const workflowPath: string = useSelector(mdmModule.selectors.getWorkflowPath);\n const environment: string = useSelector(mdmModule.selectors.getWorkflowEnvironmentUrl);\n const tenant: string = useSelector(mdmModule.selectors.getTenant);\n const username: string = useSelector(mdmModule.selectors.getUserName);\n const entityUri: string = useSelector(mdmModule.selectors.getEntityUri);\n const [actionRequestIsInProgress, setActionRequestIsInProgress] = useState(false);\n const viewId = useContext(ViewIdContext);\n const dispatch = useDispatch();\n\n const performTaskAction = useCallback(\n (action: string) => () => {\n if (workflowPath && taskId) {\n setActionRequestIsInProgress(true);\n runTaskAction({\n taskId,\n workflowPath,\n environment,\n tenant,\n action\n })\n .then(() => {\n if (action === 'Delete') {\n dispatch(ui.actions.entityDeletionFinished());\n } else {\n // entity refreshing\n dispatch(profile.entity.actions.loadEntity({viewId, uri: entityUri}));\n loadWorkflowTasks?.();\n }\n })\n .catch(showWorkflowError)\n .finally(() => {\n setActionRequestIsInProgress(false);\n });\n }\n },\n [workflowPath, taskId, environment, tenant, dispatch, entityUri, viewId, loadWorkflowTasks]\n );\n\n const actions: TaskAction[] = useMemo(\n () =>\n username === assignee && isOpenTask(isOpen)\n ? (possibleActions || []).map(({action, label}) => ({\n text: label,\n onClick: performTaskAction(action)\n }))\n : [],\n [possibleActions, performTaskAction, username, assignee, isOpen]\n );\n return {actions, actionRequestIsInProgress};\n};\n","import {makeStyles} from '@material-ui/core/styles';\n\nconst pointColor = '#d8d8d8';\nconst lineStyle = '2px solid rgba(0,0,0,0.06)';\nconst pointSize = 6;\nconst blockWidth = 56;\nconst linePadding = 10;\nconst pointPadding = 15;\n\nexport const useStyles = makeStyles({\n decorator: {\n display: 'flex',\n alignItems: 'stretch'\n },\n lineBlock: {\n width: `${blockWidth}px`,\n flexShrink: 0\n },\n withLinePadding: {\n '& $noLine': {\n height: `${linePadding}px`\n },\n '& $line': {\n height: `calc(100% - ${linePadding}px)`\n }\n },\n noLine: {\n height: '0'\n },\n line: {\n height: '100%',\n position: 'relative',\n marginLeft: '31px',\n borderLeft: lineStyle,\n '&:before': {\n position: 'absolute',\n height: pointSize,\n width: pointSize,\n borderRadius: '50%',\n left: -pointSize + 1,\n top: `${pointPadding}px`,\n background: pointColor,\n content: '\"\"',\n display: 'block',\n border: '1px solid white'\n },\n '&$plain': {\n '&:before': {\n width: 0,\n border: 'none'\n }\n },\n '&$last': {\n height: `${pointPadding}px`\n }\n },\n content: {\n flex: 1,\n minWidth: 0\n },\n plain: {},\n last: {},\n rowDivider: {\n marginLeft: 0\n }\n});\n","import React from 'react';\nimport classnames from 'classnames';\nimport {useStyles} from './styles';\nimport {Divider as Divider} from '@material-ui/core';\n\ntype Props = {\n className?: string;\n children: React.ReactNode;\n plain?: boolean;\n first?: boolean;\n last?: boolean;\n transparent?: boolean;\n divider?: boolean;\n};\n\nconst LineDecorator = ({className, children, plain, first, last, transparent, divider}: Props) => {\n const styles = useStyles();\n return (\n <div className={classnames(className, styles.decorator)}>\n <div className={classnames(styles.lineBlock, {[styles.withLinePadding]: first})}>\n {!transparent && (\n <>\n <div className={styles.noLine} />\n <div className={classnames(styles.line, {[styles.plain]: plain}, {[styles.last]: last})} />\n </>\n )}\n </div>\n <div className={styles.content}>\n {children}\n {divider && <Divider className={styles.rowDivider} light variant=\"inset\" />}\n </div>\n </div>\n );\n};\n\nexport default LineDecorator;\n","import {WorkflowTaskData} from '@reltio/mdm-sdk';\n\nlet taskToColor = {};\nconst COLORS = [\n '#DC057B',\n '#5DC003',\n '#FEC92F',\n '#F57F27',\n '#B71137',\n '#056B97',\n '#4499AE',\n '#BD81BE',\n '#5F3577',\n '#A68560',\n '#555962'\n];\nlet colorIndex = 0;\n\nexport const resetTaskToColor = () => {\n taskToColor = {};\n colorIndex = 0;\n};\n\nexport const useWorkflowColor = ({\n processDefinitionDisplayName\n}: Pick<WorkflowTaskData, 'processDefinitionDisplayName'>) => {\n const hash = processDefinitionDisplayName;\n if (!taskToColor[hash]) {\n taskToColor[hash] = COLORS[colorIndex];\n colorIndex++;\n if (colorIndex > COLORS.length - 1) {\n colorIndex = 0;\n }\n }\n return taskToColor[hash];\n};\n","import React from 'react';\n\nconst SvgCollaborationIcon: React.FC<React.SVGProps<SVGSVGElement>> = (props) => {\n return (\n <svg\n width={20}\n height={20}\n viewBox=\"0 0 20 20\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlnsXlink=\"http://www.w3.org/1999/xlink\"\n {...props}\n >\n <defs>\n <path\n d=\"M4 17.17L5.17 16H20V4H4v13.17zM20 2c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H6l-4 4V4c0-1.1.9-2 2-2h16zm-3 9H7v2h10v-2zm0-4H7v2h10V7z\"\n id=\"CollaborationIcon_svg__a\"\n />\n </defs>\n <g transform=\"translate(-2 -2)\" stroke=\"none\" strokeWidth={1} fill=\"none\" fillRule=\"evenodd\">\n <mask id=\"CollaborationIcon_svg__b\" fill=\"#fff\">\n <use xlinkHref=\"#CollaborationIcon_svg__a\" />\n </mask>\n <path fillOpacity={0.54} fill=\"#000\" mask=\"url(#CollaborationIcon_svg__b)\" d=\"M0 0h24v24H0z\" />\n </g>\n </svg>\n );\n};\n\nexport default SvgCollaborationIcon;\n","import React, {useState} from 'react';\nimport classnames from 'classnames';\nimport FlagIcon from '@material-ui/icons/Flag';\nimport i18n from 'ui-i18n';\nimport {WorkflowTaskData} from '@reltio/mdm-sdk';\nimport {Tooltip as Tooltip} from '@material-ui/core';\n\nimport {useStyles} from './styles';\n\nimport CollapseButton from '../../../CollapseButton/CollapseButton';\nimport AssigneeSelector from '../../components/AssigneeSelector/AssigneeSelector';\nimport DueDateField from '../../components/DueDateField/DueDateField';\nimport PrioritySelector from '../../components/PrioritySelector/PrioritySelector';\nimport WorkflowComments from '../../components/WorkflowComments';\nimport {getDCRId} from '../../helpers';\nimport TaskActions from '../../components/TaskActions/TaskActions';\nimport LineDecorator from '../../components/LineDecorator/LineDecorator';\nimport {useWorkflowColor} from '../../hooks/useWorkflowColor';\nimport {useWorkflowCheckPermission} from '../../hooks/useWorkflowCheckPermission';\nimport CollaborationIcon from '../../../../icons/CollaborationIcon';\n\ntype Props = {\n task: WorkflowTaskData;\n children?: React.ReactNode;\n actions?: React.ReactNode;\n Icon?: React.ElementType;\n};\n\nconst GenericWorkflowTaskCard = ({task, children, actions, Icon}: Props) => {\n const {\n taskId,\n dueDate,\n priority,\n assignee,\n createdBy,\n createTime,\n displayName: step,\n processDefinitionDisplayName,\n objectURIs,\n processInstanceComments,\n possibleActions,\n isOpen: isTaskOpen\n } = task;\n const dcrId = getDCRId(objectURIs);\n const color = useWorkflowColor({processDefinitionDisplayName});\n const styles = useStyles({color});\n const [isExpanded, setExpanded] = useState(false);\n const checkWorkflowPermission = useWorkflowCheckPermission();\n const canViewComments = checkWorkflowPermission('VIEW_PROCESS_INSTANCE_COMMENTS');\n return (\n <div className={styles.card}>\n <div className={classnames({[styles.withBackground]: isExpanded})}>\n <div className={styles.lineWrapper}>\n <div className={styles.line} />\n {Icon && <Icon className={styles.icon} />}\n <LineDecorator plain first transparent={!isExpanded}>\n <div className={styles.mainInfo}>\n <div className={styles.title}>\n <div className={classnames(styles.caption, styles.flex)}>\n {processDefinitionDisplayName}\n </div>\n <FlagIcon className={styles.flag} />\n <Tooltip title={i18n.text('Due date')}>\n <span className={styles.date}>{i18n.date(dueDate, 'L')}</span>\n </Tooltip>\n <CollapseButton\n isOpen={isExpanded}\n size=\"L\"\n onClick={() => {\n setExpanded(!isExpanded);\n }}\n />\n </div>\n <div className={styles.infoBlock}>\n <div className={styles.flex}>\n {dcrId && (\n <div className={styles.info}>\n {i18n.text('DCR ID')}\n {': '}\n <span className={styles.infoValue}>{dcrId}</span>\n </div>\n )}\n <div className={styles.info}>\n {i18n.text('Created by')}\n {': '}\n <span className={styles.infoValue}>{createdBy}</span> {i18n.text('on')}{' '}\n <span className={styles.infoValue}>{i18n.date(createTime, 'L')}</span>\n </div>\n <div className={styles.info}>\n {i18n.text('Step')}\n {': '}\n <span className={styles.infoValue}>{step}</span>\n </div>\n {canViewComments && processInstanceComments?.length > 0 && (\n <div className={styles.commentsInfo}>\n <CollaborationIcon className={styles.commentsIcon} />\n <div className={styles.infoValue}>{processInstanceComments.length}</div>\n </div>\n )}\n </div>\n {actions || (\n <TaskActions\n taskId={taskId}\n possibleActions={possibleActions}\n assignee={assignee}\n isTaskOpen={isTaskOpen}\n />\n )}\n </div>\n </div>\n </LineDecorator>\n </div>\n {isExpanded && (\n <LineDecorator plain>\n <div className={styles.controlsBox}>\n <div className={styles.controlsInRow}>\n <DueDateField taskId={taskId} dueDate={dueDate} isTaskOpen={isTaskOpen} />\n <PrioritySelector\n taskId={taskId}\n priority={priority}\n className={styles.priority}\n isTaskOpen={isTaskOpen}\n />\n </div>\n <AssigneeSelector taskId={taskId} assignee={assignee} isTaskOpen={isTaskOpen} />\n </div>\n </LineDecorator>\n )}\n </div>\n {isExpanded && (\n <>\n {children}\n {canViewComments && (\n <div className={styles.comments}>\n <WorkflowComments\n taskId={taskId}\n processInstanceComments={processInstanceComments}\n isTaskOpen={isTaskOpen}\n />\n </div>\n )}\n </>\n )}\n </div>\n );\n};\n\nexport default GenericWorkflowTaskCard;\n","import React from 'react';\n\nconst SvgDcrTaskIcon: React.FC<React.SVGProps<SVGSVGElement>> = (props) => {\n return (\n <svg width={28} height={28} viewBox=\"0 0 28 28\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <g stroke=\"none\" strokeWidth={1} fill=\"none\" fillRule=\"evenodd\">\n <circle fill=\"#42A5F5\" cx={14} cy={14} r={14} />\n <path\n d=\"M16.43 9.87c0 1.59 1.25 2.87 2.79 2.87 1.53 0 2.78-1.28 2.78-2.87C22 8.29 20.75 7 19.22 7c-1.54 0-2.79 1.29-2.79 2.87zm1.4 0c0-.79.62-1.43 1.39-1.43.77 0 1.39.64 1.39 1.43 0 .79-.62 1.44-1.39 1.44-.77 0-1.39-.65-1.39-1.44zm-6.26 8.26c0-1.59-1.25-2.87-2.79-2.87-1.53 0-2.78 1.28-2.78 2.87C6 19.71 7.25 21 8.78 21c1.54 0 2.79-1.29 2.79-2.87zM8.09 9.15v4.31h1.39v-2.87h2.78v2.15l2.78-2.87L12.26 7v2.15H8.09zm11.82 9.7v-4.31h-1.39v2.87h-2.78v-2.15l-2.78 2.87L15.74 21v-2.15h4.17z\"\n fill=\"#FFF\"\n opacity={0.87}\n />\n </g>\n </svg>\n );\n};\n\nexport default SvgDcrTaskIcon;\n","export enum OperationTypes {\n ADDED = 'added',\n EDITED = 'edited',\n DELETED = 'deleted',\n PINNED = 'pinned',\n IGNORED = 'ignored',\n PIN_DELETED = 'pin_deleted',\n IGNORE_DELETED = 'ignore_deleted'\n}\n\nexport enum DCRTypes {\n INSERT_ATTRIBUTE = 'INSERT_ATTRIBUTE',\n UPDATE_ATTRIBUTE = 'UPDATE_ATTRIBUTE',\n DELETE_ATTRIBUTE = 'DELETE_ATTRIBUTE',\n PIN_ATTRIBUTE = 'PIN_ATTRIBUTE',\n IGNORE_ATTRIBUTE = 'IGNORE_ATTRIBUTE',\n CREATE_ENTITY = 'CREATE_ENTITY',\n CREATE_RELATIONSHIP = 'CREATE_RELATIONSHIP',\n UPDATE_TAGS = 'UPDATE_TAGS',\n UPDATE_ROLES = 'UPDATE_ROLES',\n UPDATE_START_DATE = 'UPDATE_START_DATE',\n UPDATE_END_DATE = 'UPDATE_END_DATE',\n UPDATE_PROFILE_PIC_BY_URL = 'UPDATE_PROFILE_PIC_BY_URL',\n UPDATE_PROFILE_PIC_BY_URI = 'UPDATE_PROFILE_PIC_BY_URI',\n DELETE_RELATIONSHIP = 'DELETE_RELATIONSHIP'\n}\n","import i18n from 'ui-i18n';\nimport {allPass, always, equals, evolve, pipe, prop, when} from 'ramda';\nimport {AttributeType, DataTypes, getAttrDataTypeDefinition, isUrl} from '@reltio/mdm-sdk';\nimport {DCRTypes, OperationTypes} from '../../../constants/operations';\nimport {DCRAttributeValue, DCRObjectsInfo, EntityInfo, RelationInfo, Value} from '../../../types/dcrTypes';\n\nexport const getOperationType = (type: string, oldValue?: DCRAttributeValue) => {\n switch (type) {\n case DCRTypes.CREATE_RELATIONSHIP:\n case DCRTypes.INSERT_ATTRIBUTE:\n return OperationTypes.ADDED;\n case DCRTypes.UPDATE_TAGS:\n case DCRTypes.UPDATE_ROLES:\n case DCRTypes.UPDATE_ATTRIBUTE:\n return OperationTypes.EDITED;\n case DCRTypes.DELETE_ATTRIBUTE:\n case DCRTypes.DELETE_RELATIONSHIP:\n return OperationTypes.DELETED;\n case DCRTypes.PIN_ATTRIBUTE:\n return oldValue?.pin ? OperationTypes.PIN_DELETED : OperationTypes.PINNED;\n case DCRTypes.IGNORE_ATTRIBUTE:\n return oldValue?.ignored ? OperationTypes.IGNORE_DELETED : OperationTypes.IGNORED;\n }\n};\n\nexport const getOperationLabel = (operation: OperationTypes) => {\n const labels = {\n [OperationTypes.ADDED]: i18n.text('added'),\n [OperationTypes.EDITED]: i18n.text('edited'),\n [OperationTypes.DELETED]: i18n.text('deleted'),\n [OperationTypes.PINNED]: i18n.text('pinned'),\n [OperationTypes.PIN_DELETED]: i18n.text('pin deleted'),\n [OperationTypes.IGNORED]: i18n.text('ignored'),\n [OperationTypes.IGNORE_DELETED]: i18n.text('ignore deleted')\n };\n\n return labels[operation] || '';\n};\n\nexport const getAttributeDescription = (\n attrType: AttributeType,\n value: DCRAttributeValue,\n currentEntityUri: string,\n objectsInfo: DCRObjectsInfo = {}\n) => {\n let objectLabel: string, objectUri: string;\n\n const relation = objectsInfo[value.refObjectURI] as RelationInfo;\n if (relation) {\n objectUri = currentEntityUri === relation.startObjectUri ? relation.endObjectUri : relation.startObjectUri;\n objectLabel =\n currentEntityUri === relation.startObjectUri ? relation.endObjectLabel : relation.startObjectLabel;\n } else if (value.refEntity) {\n objectUri = value.refEntity.objectURI;\n objectLabel = (objectsInfo[objectUri] as EntityInfo).label;\n }\n\n return {\n objectUri,\n objectLabel\n };\n};\n\nexport const getDataTypeDefinition = (attributeType: AttributeType, attributeValue: Value) => {\n return when(\n allPass([pipe(prop('type'), equals(DataTypes.TYPE_STRING)), () => isUrl(attributeValue)]),\n evolve({type: always(DataTypes.TYPE_URL)})\n )(getAttrDataTypeDefinition(attributeType));\n};\n","import {complement, curry, flatten, is, isEmpty, pathOr, propOr, times} from 'ramda';\nimport {\n AttributeType,\n DataTypes,\n getAttributeTypeSubAttributes,\n getLabel,\n getRelationAttributesList,\n getRelationType,\n isEmptyValue,\n isSpecialAttribute,\n Metadata\n} from '@reltio/mdm-sdk';\nimport {DCRAttributes, DCRAttributeValue, DCRChange, EntityInfo, RelationInfo} from '../../../types/dcrTypes';\nimport {Diff} from '../types/diffTypes';\nimport {getFilteredAttrTypes} from '../../../../attributes/helpers/attributesView';\nimport {getOperationType} from './helpers';\nimport {DCRTypes} from '../../../constants/operations';\n\nconst getValues = (attributes: DCRAttributes | DCRChange, attrType: AttributeType) => {\n if ('newValue' in attributes || 'oldValue' in attributes) {\n const {newValue, oldValue, type} = attributes;\n const newAttrValues = pathOr([], ['value', attrType.name])(newValue);\n const oldAttrValues = pathOr([], ['value', attrType.name])(oldValue);\n\n const length = Math.max(newAttrValues.length, oldAttrValues.length);\n return times((index) => {\n const attributeValue = {\n newValue: newAttrValues[index],\n oldValue: oldAttrValues[index],\n type\n };\n\n return [{value: attributeValue}];\n }, length);\n }\n const values = attributes[attrType.name];\n return values ? [values] : [];\n};\n\nconst getEntityChanges = curry((metadata: Metadata, entityInfo: EntityInfo, changes: DCRAttributes) => {\n const attrTypes: AttributeType[] = getFilteredAttrTypes(metadata, entityInfo.type, [], []);\n return getAttributesList(metadata, attrTypes, changes);\n});\n\nconst getRelationChanges = curry(\n (metadata: Metadata, relationInfo: RelationInfo, changes: DCRAttributes, changeType: DCRTypes): Diff[] => {\n const addRelationOperationIfNeeded = (changes: DCRAttributes, changeType: DCRTypes) => {\n if (changeType === DCRTypes.CREATE_RELATIONSHIP || isEmptyValue(changes)) {\n const operation = getOperationType(changeType);\n return operation ? {operation} : {};\n }\n return {};\n };\n\n const relationType = getRelationType(metadata, relationInfo.type);\n const attrTypes = getRelationAttributesList(metadata, relationInfo.type);\n return flatten([\n {\n level: 1,\n label: propOr('', 'label', relationType),\n attributeType: relationType,\n attributeValue: {...relationInfo, ...changes},\n ...addRelationOperationIfNeeded(changes, changeType)\n },\n getAttributesList(metadata, attrTypes, changes, 2)\n ]);\n }\n);\n\nconst getAttributesList = (\n metadata: Metadata,\n attrTypes: AttributeType[],\n attributes: DCRAttributes | DCRChange,\n level = 0\n): Diff[] => {\n return flatten(\n attrTypes\n .map((attrType) => {\n return getValues(attributes, attrType).map((value) => {\n return value.map((attributeValue) => {\n return dcrAttributesFactory(metadata, attrType, attributeValue, level);\n });\n });\n })\n .filter(complement(isEmpty))\n );\n};\n\nconst getSimpleAttributeValue = (attributeType: AttributeType, attributeValue: DCRAttributeValue) => {\n const value = isSpecialAttribute(attributeType) ? attributeValue : attributeValue.value;\n return is(Object, value) ? value : {newValue: attributeValue, type: DCRTypes.INSERT_ATTRIBUTE};\n};\n\nconst dcrAttributesFactory = (\n metadata: Metadata,\n attributeType: AttributeType,\n attributeValue: DCRAttributeValue,\n level: number\n) => {\n switch (attributeType.type) {\n case DataTypes.TYPE_NESTED:\n case DataTypes.TYPE_IMAGE:\n return getNestedAttributeChange(metadata, attributeType, attributeValue, level);\n case DataTypes.TYPE_REFERENCE:\n return getReferenceAttributeChange(metadata, attributeType, attributeValue, level);\n default: {\n const value = getSimpleAttributeValue(attributeType, attributeValue);\n return getSimpleAttributeChange(attributeType, value as DCRChange, level);\n }\n }\n};\n\nconst getNestedAttributeChange = (\n metadata: Metadata,\n attributeType: AttributeType,\n attributeValue: DCRAttributeValue,\n level: number\n) => {\n const attributeTypeList = getAttributeTypeSubAttributes({} as Metadata, attributeType);\n const label = getLabel(attributeType?.label || attributeType?.name);\n return [\n {level, label, attributeType, attributeValue},\n getAttributesList(metadata, attributeTypeList, attributeValue.value as DCRAttributes, level + 1)\n ];\n};\n\nconst getReferenceAttributeChange = (\n metadata: Metadata,\n attributeType: AttributeType,\n attributeValue: DCRAttributeValue,\n level: number\n) => {\n const attributeTypeList = getAttributeTypeSubAttributes(metadata, attributeType);\n const label = attributeType?.label || attributeType?.name;\n\n return [\n {level, label, attributeType, attributeValue},\n getAttributesList(metadata, attributeTypeList, attributeValue.value as DCRAttributes, level + 1)\n ];\n};\n\nconst getDiffParameters = ({newValue, oldValue, type}: DCRChange) => {\n return type === DCRTypes.UPDATE_ATTRIBUTE ? {type, newValue, oldValue} : {type, newValue: oldValue || newValue};\n};\n\nconst getSimpleAttributeChange = (attributeType: AttributeType, attributeValue: DCRChange, level: number) => {\n const {newValue, oldValue, type} = getDiffParameters(attributeValue);\n const operation = getOperationType(type, oldValue as DCRAttributeValue);\n\n const label = attributeType?.label || attributeType?.name;\n\n return {\n attributeType,\n newValue,\n oldValue,\n operation,\n label,\n level\n };\n};\n\nexport {getEntityChanges, getRelationChanges};\n","import {\n concat,\n curry,\n difference,\n flatten,\n identity,\n isNil,\n omit,\n path,\n pick,\n pipe,\n propEq,\n propOr,\n reduce\n} from 'ramda';\nimport {\n Entity,\n EntityAttrTypes,\n generateTempUri,\n getRoleLabel,\n isEmptyValue,\n Metadata,\n Relation\n} from '@reltio/mdm-sdk';\nimport {DCRTypes} from '../../../constants/operations';\nimport {Diff} from '../types/diffTypes';\nimport {getEntityChanges, getRelationChanges} from './attributesHelpers';\n\nimport {\n DCRAttributes,\n DCRAttributeValue,\n DCRChange,\n DCRChanges,\n DCRObjectInfo,\n EntityInfo,\n RelationInfo\n} from '../../../types/dcrTypes';\n\nconst ATTRIBUTE_DELIMITER = '/';\nconst SPECIAL_ATTRIBUTES_NAMES = [\n 'defaultProfilePicValue',\n EntityAttrTypes.tags.name,\n EntityAttrTypes.roles.name,\n EntityAttrTypes.startDate.name,\n EntityAttrTypes.endDate.name\n];\n\nconst prepareStartOrEndDate = ({newValue, oldValue}: DCRChange): DCRChange[] => {\n const parseValue = (value) => (isNaN(value) || isEmptyValue(value) ? value : parseInt(value));\n\n const isExistedValue = (value) => value?.length && !isEmptyValue(value) && !isEmptyValue(value[0]);\n\n const isExistNewValue = isExistedValue(newValue);\n const isExistOldValue = isExistedValue(oldValue);\n if (isExistNewValue && isExistOldValue) {\n return [\n {\n type: DCRTypes.UPDATE_ATTRIBUTE,\n oldValue: {value: parseValue(oldValue[0])},\n newValue: {value: parseValue(newValue[0])}\n }\n ];\n } else if (isExistNewValue) {\n return [\n {\n type: DCRTypes.INSERT_ATTRIBUTE,\n newValue: {value: parseValue(newValue[0])}\n }\n ];\n } else if (isExistOldValue) {\n return [\n {\n type: DCRTypes.DELETE_ATTRIBUTE,\n oldValue: {value: parseValue(oldValue[0])}\n }\n ];\n }\n};\n\nconst prepareRolesOrTags = (metadata: Metadata, change: DCRChange): DCRChange[] => {\n const {newValue = [], oldValue = [], type} = change;\n const getLabel = type === DCRTypes.UPDATE_ROLES ? getRoleLabel(metadata) : identity;\n\n const diffNewValue = difference(newValue, oldValue);\n const diffOldValue = difference(oldValue, newValue);\n\n const items = [];\n\n if (diffNewValue.length) {\n items.push({\n type: DCRTypes.INSERT_ATTRIBUTE,\n newValue: {value: diffNewValue.map(getLabel).join(', ')}\n });\n }\n\n if (diffOldValue.length) {\n items.push({\n type: DCRTypes.DELETE_ATTRIBUTE,\n oldValue: {value: diffOldValue.map(getLabel).join(', ')}\n });\n }\n\n return items;\n};\n\nconst getPath = (change: DCRChange): string => {\n const {type, attributePath, refObjectURI, refAttributeType} = change;\n\n const path = type === DCRTypes.INSERT_ATTRIBUTE ? generateTempUri(attributePath) : attributePath;\n\n if (refObjectURI) {\n const typePath = refAttributeType.split('/attributes/');\n const id = refObjectURI.split(ATTRIBUTE_DELIMITER)[1];\n return [typePath[1], id, path].join(ATTRIBUTE_DELIMITER);\n }\n return path;\n};\n\nconst prepareAttribute = (container: DCRAttributes, change: DCRChange) => {\n const changePath = getPath(change);\n\n const pathArray = changePath.split(ATTRIBUTE_DELIMITER);\n\n let holder: DCRAttributes | DCRAttributeValue = container;\n\n for (let i = 0; i < pathArray.length - 1; i = i + 2) {\n const key = pathArray[i];\n const id = pathArray[i + 1];\n\n const currentValue = (holder[key] || []).find(propEq('id', id));\n\n const newValue = pathArray.length === i + 2 ? change : {};\n const value = currentValue ? currentValue : ({id, value: newValue} as DCRAttributeValue);\n\n const refObjectURI = change.refObjectURI?.indexOf(id) >= 0 && change.refObjectURI;\n if (refObjectURI) {\n value.refObjectURI = refObjectURI;\n }\n\n if (isNil(currentValue)) {\n holder[key] = (holder[key] || []).concat(value);\n }\n\n holder = value.value;\n }\n return container;\n};\n\nconst createEntityOrRelation = (metadata: Metadata, value: Entity | Relation) => {\n const {attributes = {}, startDate, endDate} = value;\n const {roles, tags, defaultProfilePicValue} = value as Entity;\n const newObject = {...attributes} as DCRAttributes;\n\n if (defaultProfilePicValue) {\n newObject['defaultProfilePicValue'] = [defaultProfilePicValue];\n }\n if (roles) {\n newObject[EntityAttrTypes.roles.name] = [\n {\n type: DCRTypes.INSERT_ATTRIBUTE,\n newValue: {value: roles.map(getRoleLabel(metadata)).join(', ')}\n }\n ];\n }\n if (tags) {\n newObject[EntityAttrTypes.tags.name] = [\n {\n type: DCRTypes.INSERT_ATTRIBUTE,\n newValue: {value: tags.join(', ')}\n }\n ];\n }\n if (startDate) {\n newObject[EntityAttrTypes.startDate.name] = [\n {\n type: DCRTypes.INSERT_ATTRIBUTE,\n newValue: {value: startDate}\n }\n ];\n }\n if (endDate) {\n newObject[EntityAttrTypes.endDate.name] = [\n {\n type: DCRTypes.INSERT_ATTRIBUTE,\n newValue: {value: endDate}\n }\n ];\n }\n return newObject;\n};\n\nconst mergeAttributesInChange = (\n metadata: Metadata,\n objectInfo: DCRObjectInfo,\n change: DCRChange,\n container: DCRAttributes = {}\n) => {\n const {type} = change;\n\n switch (type) {\n case DCRTypes.UPDATE_PROFILE_PIC_BY_URL:\n container['defaultProfilePicValue'] = [change.newValue];\n break;\n case DCRTypes.UPDATE_TAGS:\n container[EntityAttrTypes.tags.name] = prepareRolesOrTags(metadata, change);\n break;\n case DCRTypes.UPDATE_ROLES: {\n container[EntityAttrTypes.roles.name] = prepareRolesOrTags(metadata, change);\n break;\n }\n case DCRTypes.UPDATE_START_DATE:\n container[EntityAttrTypes.startDate.name] = prepareStartOrEndDate(change);\n break;\n case DCRTypes.UPDATE_END_DATE:\n container[EntityAttrTypes.endDate.name] = prepareStartOrEndDate(change);\n break;\n case DCRTypes.CREATE_RELATIONSHIP:\n case DCRTypes.CREATE_ENTITY: {\n return {\n ...container,\n ...createEntityOrRelation(metadata, change.newValue as Entity | Relation)\n };\n }\n case DCRTypes.INSERT_ATTRIBUTE:\n case DCRTypes.UPDATE_ATTRIBUTE:\n case DCRTypes.DELETE_ATTRIBUTE:\n case DCRTypes.PIN_ATTRIBUTE:\n case DCRTypes.IGNORE_ATTRIBUTE:\n prepareAttribute(container, change);\n break;\n default:\n break;\n }\n\n return container;\n};\n\nconst updateRelation = (metadata: Metadata, changes: DCRChanges, relationInfo: RelationInfo) => {\n const relationChanges: DCRChange[] = propOr([], relationInfo.uri)(changes);\n return relationChanges.reduce((result: DCRAttributes, change) => {\n return mergeAttributesInChange(metadata, relationInfo, change, result);\n }, {});\n};\n\nconst mergeChanges = (\n metadata: Metadata,\n changes: DCRChanges,\n entityInfo: EntityInfo,\n relationsInfo: RelationInfo[]\n): [Diff[], Diff[]] => {\n const getAttributeChanges = (attributeName: string) =>\n pipe(pick([attributeName]), getEntityChanges(metadata, entityInfo));\n const concatChanges = curry((getters, attributesTree) =>\n reduce((acc, getter) => concat(acc, getter(attributesTree)), [], getters)\n );\n\n const entityInfoChanges: DCRChange[] = propOr([], entityInfo.uri)(changes);\n\n const changesTree = entityInfoChanges.reduce((result: DCRAttributes, change: DCRChange) => {\n return mergeAttributesInChange(metadata, entityInfo, change, result);\n }, {});\n\n const relationsTrees = relationsInfo.map((relationInfo) => updateRelation(metadata, changes, relationInfo));\n\n const entityChanges: Diff[] = concatChanges(\n [\n pipe(omit(SPECIAL_ATTRIBUTES_NAMES), getEntityChanges(metadata, entityInfo)),\n getAttributeChanges(EntityAttrTypes.roles.name),\n getAttributeChanges(EntityAttrTypes.tags.name),\n getAttributeChanges(EntityAttrTypes.startDate.name),\n getAttributeChanges(EntityAttrTypes.endDate.name)\n ],\n changesTree\n );\n\n const relationsChanges: Diff[] = flatten(\n relationsInfo.map((relationInfo, index) => {\n const changeType: DCRTypes = path([relationInfo.uri, 0, 'type'], changes);\n return getRelationChanges(metadata, relationInfo, relationsTrees[index], changeType);\n })\n );\n\n return [entityChanges, relationsChanges];\n};\n\nexport {mergeChanges};\n","import {makeStyles} from '@material-ui/core/styles';\nimport {Theme} from '@material-ui/core';\n\nexport const useStyles = makeStyles((theme: Theme) => ({\n linkLabel: {\n color: theme.palette.primary.main,\n fontSize: '12px',\n letterSpacing: 0,\n lineHeight: '16px'\n }\n}));\n","import React from 'react';\nimport i18n from 'ui-i18n';\nimport {Link as Link} from '@material-ui/core';\n\nimport {useStyles} from './styles';\n\ntype Props = {\n onClick: () => void;\n suggestionsCount: number;\n isExpanded: boolean;\n className?: string;\n};\n\nconst ShowMoreLink = ({suggestionsCount, isExpanded, onClick, className}: Props) => {\n const styles = useStyles();\n return (\n <Link component=\"button\" variant=\"caption\" underline=\"none\" onClick={onClick} className={className}>\n <span className={styles.linkLabel}>\n {isExpanded\n ? i18n.text('View less suggestions')\n : i18n.text('View ${suggestionsCount} more suggestions', {suggestionsCount})}\n </span>\n </Link>\n );\n};\n\nexport default ShowMoreLink;\n","import {makeStyles} from '@material-ui/core/styles';\n\nexport const useStyles = makeStyles((theme) => ({\n field: {\n fontSize: '12px',\n lineHeight: '20px',\n color: theme.palette.text.primary,\n marginTop: '6px',\n overflow: 'hidden',\n wordBreak: 'break-word'\n },\n fieldName: {\n color: theme.palette.text.secondary,\n marginRight: '8px'\n },\n difference: {\n marginRight: '8px'\n },\n arrow: {\n margin: '0 4px',\n fontSize: '12px',\n color: theme.palette.text.primary\n },\n chip: {\n height: '20px',\n fontSize: '10px',\n fontWeight: 500,\n lineHeight: '16px',\n letterSpacing: 0,\n flexShrink: 0,\n textTransform: 'capitalize',\n color: theme.palette.primary.main,\n borderColor: theme.palette.primary.main,\n '&.edited': {\n color: '#CC7500',\n borderColor: '#CC7500'\n },\n '&.added': {\n color: '#599E0E',\n borderColor: '#599E0E'\n },\n '&.deleted': {\n color: '#CF0E26',\n borderColor: '#CF0E26'\n }\n }\n}));\n","import React from 'react';\nimport classnames from 'classnames';\nimport {isNil} from 'ramda';\nimport ArrowRightAltIcon from '@material-ui/icons/ArrowRightAlt';\nimport {Chip as Chip} from '@material-ui/core';\nimport {OperationTypes} from '../../../../constants/operations';\nimport {getOperationLabel} from '../../helpers/helpers';\n\nimport {useStyles} from './styles';\n\ntype Props = {\n label: React.ReactNode;\n oldValue?: React.ReactNode;\n newValue?: React.ReactNode;\n operation?: OperationTypes;\n className?: string;\n};\n\nconst ChangeView = ({label, oldValue, newValue, operation, className}: Props) => {\n const styles = useStyles();\n const value = oldValue || newValue;\n\n return (\n <div className={classnames(styles.field, className)}>\n <span className={styles.fieldName}>{label}:</span>\n {!isNil(value) && (\n <span className={styles.difference}>\n {value}\n {newValue && oldValue && (\n <>\n <ArrowRightAltIcon className={styles.arrow} />\n {newValue}\n </>\n )}\n </span>\n )}\n {operation && (\n <Chip\n variant=\"outlined\"\n label={getOperationLabel(operation)}\n className={classnames(styles.chip, operation)}\n />\n )}\n </div>\n );\n};\n\nexport default ChangeView;\n","import React from 'react';\nimport {DCRObjectsInfo} from '../../../types/dcrTypes';\n\nexport const AttributesChangesContext = React.createContext<DCRObjectsInfo>(null);\n\nAttributesChangesContext.displayName = 'AttributesChangesContext';\n","import {makeStyles} from '@material-ui/core/styles';\n\ntype StylesProps = {\n level: number;\n};\n\nexport const useStyles = makeStyles((theme) => ({\n linkContainer: {\n textDecoration: 'none',\n cursor: 'pointer',\n marginLeft: '4px'\n },\n linkLabel: {\n color: theme.palette.primary.main,\n fontSize: '12px',\n letterSpacing: 0,\n lineHeight: '16px'\n },\n disabledLink: {\n pointerEvents: 'none',\n cursor: 'default'\n },\n label: {\n color: theme.palette.text.primary\n },\n change: ({level = 0}: StylesProps) => ({\n marginLeft: `${level * 16}px`\n })\n}));\n","import React, {useCallback, useContext, useMemo} from 'react';\nimport {useSelector} from 'react-redux';\nimport {anyPass, ifElse, isNil, hasPath, path, when} from 'ramda';\nimport classnames from 'classnames';\nimport {getAttributeValue, getLabel, isReference} from '@reltio/mdm-sdk';\nimport mdmModule from '@reltio/mdm-module';\nimport ChangeView from '../ChangeView/ChangeView';\nimport {AttributesChangesContext} from '../../contexts/AttributesChangesContext';\nimport {getAttributeDescription, getDataTypeDefinition} from '../../helpers/helpers';\nimport {Diff, RelationAttributeValue} from '../../types/diffTypes';\nimport {ChangeValue, DCRAttributeValue, Value} from '../../../../types/dcrTypes';\nimport DataTypeValue from '../../../../../DataTypeValue/DataTypeValue';\nimport EntityUriLink from '../../../../../EntityUriLink/EntityUriLink';\n\nimport {useStyles} from './styles';\n\nconst DiffRenderer = ({label, level, attributeType, attributeValue, oldValue, newValue, operation}: Diff) => {\n const styles = useStyles({level});\n const entityUri = useSelector(mdmModule.selectors.getEntityUri);\n const objectsInfo = useContext(AttributesChangesContext);\n\n const getLinkDescription = useCallback(() => {\n if (isReference(attributeType)) {\n const value: DCRAttributeValue = when(\n anyPass([hasPath(['value', 'newValue']), hasPath(['value', 'oldValue'])]),\n ifElse(hasPath(['value', 'newValue']), path(['value', 'newValue']), path(['value', 'oldValue']))\n )(attributeValue);\n return getAttributeDescription(attributeType, value, entityUri, objectsInfo);\n } else if ('endObject' in attributeType) {\n const {endObjectUri, endObjectLabel} = attributeValue as RelationAttributeValue;\n return {\n objectUri: endObjectUri,\n objectLabel: endObjectLabel\n };\n }\n }, [attributeType, attributeValue, entityUri, objectsInfo]);\n\n const renderLink = useCallback(() => {\n const {objectUri, objectLabel} = getLinkDescription() || {};\n\n if (!isNil(objectUri) && !isNil(objectLabel)) {\n const isNotExist = objectsInfo[objectUri]?.isExist === false;\n return (\n <EntityUriLink\n value={objectUri}\n className={classnames(styles.linkContainer, {[styles.disabledLink]: isNotExist})}\n >\n <span className={classnames(styles.linkLabel, {[styles.label]: isNotExist})}>\n {getLabel(objectLabel)}\n </span>\n </EntityUriLink>\n );\n }\n return null;\n }, [getLinkDescription, objectsInfo, styles]);\n\n const changeLabel = useMemo(() => {\n return (\n <span>\n {label}\n {renderLink()}\n </span>\n );\n }, [label, renderLink]);\n\n const renderValue = useCallback(\n (value: ChangeValue) => {\n const attrValue: Value = getAttributeValue(value);\n return (\n <DataTypeValue value={attrValue} dataTypeDefinition={getDataTypeDefinition(attributeType, attrValue)} />\n );\n },\n [attributeType]\n );\n\n return (\n <ChangeView\n className={styles.change}\n label={changeLabel}\n oldValue={oldValue && renderValue(oldValue)}\n newValue={newValue && renderValue(newValue)}\n operation={operation}\n />\n );\n};\n\nexport default DiffRenderer;\n","import {makeStyles} from '@material-ui/core/styles';\n\nexport const useStyles = makeStyles({\n title: {\n fontSize: '12px',\n letterSpacing: 0,\n lineHeight: '16px',\n fontWeight: 500,\n marginTop: '8px'\n }\n});\n","import React from 'react';\nimport {has} from 'ramda';\nimport DiffRenderer from '../DiffRenderer/DiffRenderer';\nimport {Diff, Title} from '../../types/diffTypes';\n\nimport {useStyles} from './styles';\n\ntype Props = {\n changes: (Diff | Title)[];\n};\n\nconst DCRChangesList = ({changes}: Props) => {\n const styles = useStyles();\n return (\n <>\n {changes.map((change, index) => {\n return has('level', change) ? (\n <DiffRenderer {...(change as Diff)} key={index} />\n ) : (\n <div className={styles.title} key={index}>\n {change.label}\n </div>\n );\n })}\n </>\n );\n};\n\nexport default DCRChangesList;\n","import {has, filter, length, pipe} from 'ramda';\n\nexport const getSuggestionsCount = pipe(filter(has('operation')), length);\n","import {makeStyles} from '@material-ui/core/styles';\nimport {Theme} from '@material-ui/core';\n\nexport const useStyles = makeStyles((theme: Theme) => ({\n container: {\n boxSizing: 'border-box',\n border: '1px solid rgba(0,0,0,0.03)',\n borderRadius: '3px',\n backgroundColor: 'rgba(0,0,0,0.03)',\n padding: '10px',\n margin: '12px 16px 12px 0'\n },\n uri: {\n color: theme.palette.primary.main,\n textDecoration: 'none',\n cursor: 'pointer'\n },\n label: {\n fontSize: '12px',\n letterSpacing: 0,\n lineHeight: '16px'\n },\n showMoreLink: {\n marginTop: '8px'\n }\n}));\n","import React, {useMemo} from 'react';\nimport {useSelector} from 'react-redux';\nimport i18n from 'ui-i18n';\nimport {flatten} from 'ramda';\nimport mdmModule from '@reltio/mdm-module';\nimport {getEntityUriForLink, getLabel, Metadata} from '@reltio/mdm-sdk';\nimport {DCRChanges, DCRObjectsInfo, EntityInfo, RelationInfo} from '../../types/dcrTypes';\nimport {Diff, Title} from './types/diffTypes';\nimport {mergeChanges} from './helpers/mergeHelpers';\nimport ShowMoreLink from './components/ShowMoreLink/ShowMoreLink';\nimport DCRChangesList from './components/DCRChangesList/DCRChangesList';\nimport {AttributesChangesContext} from './contexts/AttributesChangesContext';\nimport {useCollapsibleList} from './hooks/useCollapsibleList';\nimport EntityUriLink from '../../../EntityUriLink/EntityUriLink';\n\nimport {useStyles} from './styles';\n\ntype Props = {\n changes: DCRChanges;\n objectsInfo: DCRObjectsInfo;\n entityInfo: EntityInfo;\n relationsInfo?: RelationInfo[];\n max?: number;\n};\n\nconst AttributesChanges = ({changes, objectsInfo, entityInfo, relationsInfo, max}: Props) => {\n const styles = useStyles();\n const metadata: Metadata = useSelector(mdmModule.selectors.getMetadata);\n\n const [mergedEntityChanges, mergedRelationsChanges] = useMemo(\n () => mergeChanges(metadata, changes, entityInfo, relationsInfo),\n [metadata, changes, entityInfo, relationsInfo]\n );\n\n const changesList: (Diff | Title)[] = useMemo(() => {\n const relationshipTitle: Title = {label: i18n.text('Relationships')};\n return mergedRelationsChanges.length > 0\n ? flatten([mergedEntityChanges, relationshipTitle, mergedRelationsChanges])\n : mergedEntityChanges;\n }, [mergedEntityChanges, mergedRelationsChanges]);\n\n const {isExpanded, onToggle, itemsToShow, collapsedSuggestionsCount} = useCollapsibleList(changesList, max);\n\n return (\n <AttributesChangesContext.Provider value={objectsInfo}>\n <div className={styles.container}>\n <EntityUriLink className={styles.uri} value={getEntityUriForLink(entityInfo)}>\n <div className={styles.label}>{getLabel(entityInfo.label)}</div>\n </EntityUriLink>\n <DCRChangesList changes={itemsToShow} />\n {collapsedSuggestionsCount > 0 && (\n <ShowMoreLink\n onClick={onToggle}\n suggestionsCount={collapsedSuggestionsCount}\n isExpanded={isExpanded}\n className={styles.showMoreLink}\n />\n )}\n </div>\n </AttributesChangesContext.Provider>\n );\n};\n\nexport default AttributesChanges;\n","import {useCallback, useMemo, useState} from 'react';\nimport {getSuggestionsCount} from '../helpers/contextHelpers';\nimport {Diff, Title} from '../types/diffTypes';\n\nconst DEFAULT_VISIBLE_ITEMS_COUNT = 3;\n\nexport const useCollapsibleList = (items: (Diff | Title)[], limit = DEFAULT_VISIBLE_ITEMS_COUNT) => {\n const [isExpanded, setIsExpanded] = useState(false);\n const onToggle = useCallback(() => setIsExpanded((value) => !value), []);\n\n const collapsedItems = useMemo(() => items.slice(0, limit), [items, limit]);\n const suggestionsCount = useMemo(() => getSuggestionsCount(items), [items]);\n const visibleSuggestionsCount = useMemo(() => getSuggestionsCount(collapsedItems), [collapsedItems]);\n\n const itemsToShow = isExpanded ? items : collapsedItems;\n const collapsedSuggestionsCount = suggestionsCount - visibleSuggestionsCount;\n\n return {isExpanded, onToggle, itemsToShow, collapsedSuggestionsCount};\n};\n","import {isEntityUri, isRelationUri} from '@reltio/mdm-sdk';\nimport {allPass, concat, curry, equals, filter, keys, map, pathOr, pipe, prop, uniq} from 'ramda';\nimport {\n GroupedObjectsInfo,\n DCRChanges,\n DCRObjectInfo,\n DCRObjectsInfo,\n EntityInfo,\n RelationInfo\n} from '../types/dcrTypes';\n\nexport const getEntitiesObjects = filter(pipe(prop('uri'), isEntityUri));\nexport const getRelationsObjects = filter(pipe(prop('uri'), isRelationUri));\n\nconst getRelations = (objectsWithChanges: DCRObjectInfo, entityUri: string) => {\n return filter(allPass([pipe(prop('uri'), isRelationUri), pipe(prop('startObjectUri'), equals(entityUri))]))(\n objectsWithChanges\n );\n};\n\nexport const extractObjectsFromChangeRequest = (changes: DCRChanges, objectsInfo: DCRObjectsInfo): DCRObjectInfo[] => {\n const getChange = (key) => prop([key], changes);\n return pipe(\n keys,\n filter(getChange),\n map((key) => ({...objectsInfo[key], uri: key}))\n )(objectsInfo);\n};\n\nexport const createEntityRelationsObjectByEntity = curry((objectsWithChanges: DCRObjectInfo, entity: EntityInfo) => {\n return {\n entity,\n relations: getRelations(objectsWithChanges, entity.uri)\n };\n});\n\nexport const createEntityRelationsObjectByRelation = curry((objectsInfo: DCRObjectInfo, relation: RelationInfo) => {\n const entity = objectsInfo[relation.startObjectUri];\n const relations = [relation];\n\n return entity ? {entity: {...entity, uri: relation.startObjectUri}, relations} : {relations};\n});\n\nexport const concatEntityRelationsObjects = (acc: Record<string, GroupedObjectsInfo>, object: GroupedObjectsInfo) => {\n const {entity, relations} = object;\n const {uri: entityUri} = entity;\n\n const mergedRelations = pipe(pathOr([], [entityUri, 'relations']), concat(relations), uniq)(acc);\n\n acc[entityUri] = {\n entity,\n relations: mergedRelations\n };\n\n return acc;\n};\n","import {useCallback, useEffect, useState} from 'react';\nimport {flatten, has, isEmpty, map, partition, path, pipe, reduce, values} from 'ramda';\nimport {getDataChangeRequest, getEntitiesByUris} from '@reltio/mdm-sdk';\nimport {useSafePromise} from '../../../hooks';\nimport {\n concatEntityRelationsObjects,\n createEntityRelationsObjectByEntity,\n createEntityRelationsObjectByRelation,\n extractObjectsFromChangeRequest,\n getEntitiesObjects,\n getRelationsObjects\n} from '../helpers/dcrHelpers';\nimport {GroupedObjectsInfo, ChangeRequest} from '../types/dcrTypes';\nimport {showWorkflowError} from '../helpers/errors';\n\nexport const useChangeRequest = (dcrUri: string) => {\n const [groupedObjects, setGroupedObjects] = useState<GroupedObjectsInfo[]>([]);\n const [dcr, setDcr] = useState<ChangeRequest>(null);\n const safePromise = useSafePromise();\n\n const requestEntities = useCallback((entityUris: string[]) => {\n if (isEmpty(entityUris)) {\n return Promise.resolve([]);\n }\n\n return safePromise(getEntitiesByUris(entityUris, {searchOptions: 'ovOnly', defaultMaxValues: 1}));\n }, []); // eslint-disable-line\n\n useEffect(() => {\n getDataChangeRequest(dcrUri)\n .then((dcr: ChangeRequest) => {\n const {changes, objectsInfo} = dcr;\n\n const objectsWithChanges = extractObjectsFromChangeRequest(changes, objectsInfo);\n\n const entityObjectsWithRelations: GroupedObjectsInfo[] = pipe(\n getEntitiesObjects,\n map(createEntityRelationsObjectByEntity(objectsWithChanges))\n )(objectsWithChanges);\n\n const relationsObjects: GroupedObjectsInfo[] = pipe(\n getRelationsObjects,\n map(createEntityRelationsObjectByRelation(objectsInfo))\n )(objectsWithChanges);\n\n const [relationsObjectsWithEntity, relationsObjectsWithoutEntity] = partition(\n has('entity'),\n relationsObjects\n );\n\n const entityUris: string[] = relationsObjectsWithoutEntity.map(\n path(['relations', 0, 'startObjectUri'])\n );\n\n requestEntities(entityUris)\n .then((entities) => {\n const relationsObjectsWithRequestedEntities = relationsObjectsWithoutEntity.map(\n (relationsObject, index) => {\n return {\n ...relationsObject,\n entity: entities[index]\n };\n }\n );\n\n pipe(\n flatten,\n reduce(concatEntityRelationsObjects, {}),\n values,\n setGroupedObjects\n )([\n entityObjectsWithRelations,\n relationsObjectsWithEntity,\n relationsObjectsWithRequestedEntities\n ]);\n })\n .catch(showWorkflowError);\n\n setDcr(dcr);\n })\n .catch(showWorkflowError);\n }, [dcrUri, requestEntities]);\n\n return {dcr, groupedObjects};\n};\n","import React from 'react';\nimport {WorkflowTaskData} from '@reltio/mdm-sdk';\nimport GenericWorkflowTaskCard from '../GenericWorkflowTaskCard/GenericWorkflowTaskCard';\nimport LineDecorator from '../../components/LineDecorator/LineDecorator';\nimport {getDCRUri} from '../../helpers';\nimport DcrTaskIcon from '../../../../icons/DcrTaskIcon';\nimport AttributesChanges from '../../components/AttributesChanges/AttributesChanges';\nimport {useChangeRequest} from '../../hooks/useChangeRequest';\n\ntype Props = {\n task: WorkflowTaskData;\n};\n\nconst DataChangeRequestTaskCard = ({task}: Props) => {\n const {objectURIs} = task;\n const dcrUri = getDCRUri(objectURIs);\n\n const {dcr, groupedObjects} = useChangeRequest(dcrUri);\n\n return (\n <GenericWorkflowTaskCard task={task} Icon={DcrTaskIcon}>\n {dcr &&\n groupedObjects.map((object, index: number) => (\n <LineDecorator key={index} last={index === groupedObjects.length - 1} divider={true}>\n <AttributesChanges\n entityInfo={object.entity}\n relationsInfo={object.relations}\n changes={dcr.changes}\n objectsInfo={dcr.objectsInfo}\n />\n </LineDecorator>\n ))}\n </GenericWorkflowTaskCard>\n );\n};\n\nexport default DataChangeRequestTaskCard;\n","import {makeStyles} from '@material-ui/core/styles';\n\nexport const useStyles = makeStyles({\n pmCard: {\n marginLeft: '-15px'\n }\n});\n","import React from 'react';\n\nconst SvgPmTaskIcon: React.FC<React.SVGProps<SVGSVGElement>> = (props) => {\n return (\n <svg width={28} height={28} viewBox=\"0 0 28 28\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <g stroke=\"none\" strokeWidth={1} fill=\"none\" fillRule=\"evenodd\">\n <circle fill=\"#1976D2\" cx={14} cy={14} r={14} />\n <path\n d=\"M22.5 14L18 9.5V13h-3.5L9 7.5 7.5 9l6.04 6H18v3.5l4.5-4.5zm-11.46 1.46L7.5 19 9 20.5l3.54-3.54-1.5-1.5z\"\n fill=\"#FFF\"\n opacity={0.87}\n />\n </g>\n </svg>\n );\n};\n\nexport default SvgPmTaskIcon;\n","import React from 'react';\nimport {useSelector} from 'react-redux';\nimport {WorkflowTaskData} from '@reltio/mdm-sdk';\nimport mdmModule from '@reltio/mdm-module';\n\nimport {useStyles} from './styles';\n\nimport GenericWorkflowTaskCard from '../GenericWorkflowTaskCard/GenericWorkflowTaskCard';\nimport LineDecorator from '../../components/LineDecorator/LineDecorator';\nimport PmTaskIcon from '../../../../icons/PmTaskIcon';\nimport {useMatchesLoader} from '../../../../hooks/useMatchesLoader';\nimport {ProfileMatchCard} from '../../../ProfileMatchCard/ProfileMatchCard';\n\ntype Props = {\n task: WorkflowTaskData;\n};\n\nconst defaultOptions = {\n showTransitiveMatches: true,\n showInactiveEntities: false\n};\n\nconst PotentialMatchTaskCard = ({task}: Props) => {\n const styles = useStyles();\n const {objectURIs} = task;\n const entity = useSelector(mdmModule.selectors.getEntity);\n const metadata = useSelector(mdmModule.selectors.getMetadata);\n const {matches, entitiesMap} = useMatchesLoader({\n enabled: !!entity.uri,\n entity,\n filter: '',\n rowsPerPage: Number.MAX_SAFE_INTEGER,\n page: 0,\n options: defaultOptions\n });\n const match = matches?.find(({object}) => objectURIs.includes(object.uri));\n\n return (\n <GenericWorkflowTaskCard task={task} Icon={PmTaskIcon}>\n {match && (\n <LineDecorator last>\n <div className={styles.pmCard}>\n <ProfileMatchCard metadata={metadata} entity={entity} match={match} entitiesMap={entitiesMap} />\n </div>\n </LineDecorator>\n )}\n </GenericWorkflowTaskCard>\n );\n};\n\nexport default PotentialMatchTaskCard;\n","import React from 'react';\n\nconst SvgDefaultTaskIcon: React.FC<React.SVGProps<SVGSVGElement>> = (props) => {\n return (\n <svg width={28} height={28} viewBox=\"0 0 28 28\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <g stroke=\"none\" strokeWidth={1} fill=\"none\" fillRule=\"evenodd\">\n <circle fill=\"#205191\" cx={14} cy={14} r={14} />\n <path\n d=\"M9.667 20.622c-.92 0-1.667-.744-1.667-1.662V8.99c0-.916.747-1.66 1.667-1.66h2.446A1.993 1.993 0 0114 6l.162.006a1.992 1.992 0 011.725 1.323h2.446c.92 0 1.667.745 1.667 1.662v9.97c0 .917-.747 1.661-1.667 1.661zm9-1.33V8.66h-1.334v1.993h-6.666V8.66H9.333v10.634h9.334zM15.86 14.46v1.302h-5.206V14.46h5.206zm1.494-2v1.302h-6.7V12.46h6.7zM14 7.33c.367 0 .667.298.667.664a.668.668 0 01-1.334 0c0-.366.3-.665.667-.665z\"\n fill=\"#FFF\"\n opacity={0.87}\n />\n </g>\n </svg>\n );\n};\n\nexport default SvgDefaultTaskIcon;\n","import React from 'react';\n\nconst SvgDeleteRequestTaskIcon: React.FC<React.SVGProps<SVGSVGElement>> = (props) => {\n return (\n <svg width={28} height={28} viewBox=\"0 0 28 28\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <g stroke=\"none\" strokeWidth={1} fill=\"none\" fillRule=\"evenodd\" opacity={0.87}>\n <circle fill=\"#0D47A1\" cx={14} cy={14} r={14} />\n <path\n d=\"M8.17 9.824v8.995c0 .886.72 1.606 1.607 1.606h8.352c.192 0 .375-.035.546-.097l1.38 1.382.804-.804-1.32-1.32-1.09-1.089-8.993-8.994-1.092-1.092-1.317-1.317-.803.803L8.17 9.824zm9.316 9.316h-8.03v-8.03l8.03 8.03zM9.777 7.575c-.192 0-.376.033-.55.094L10.42 8.86h.32v.322l1.607 1.606h4.819V8.86h1.284v8.03l1.285 1.286V9.182c0-.887-.72-1.607-1.606-1.607h-2.358a1.931 1.931 0 00-1.818-1.285 1.93 1.93 0 00-1.818 1.285H9.777zm3.533.643c0-.353.29-.643.643-.643.353 0 .642.29.642.643a.644.644 0 01-.642.642.644.644 0 01-.643-.642z\"\n fill=\"#FFF\"\n />\n </g>\n </svg>\n );\n};\n\nexport default SvgDeleteRequestTaskIcon;\n","import React from 'react';\nimport {PredefinedWorkflowProcessType, WorkflowTaskData} from '@reltio/mdm-sdk';\nimport GenericWorkflowTaskCard from './GenericWorkflowTaskCard/GenericWorkflowTaskCard';\nimport DataChangeRequestTaskCard from './DataChangeRequestTaskCard/DataChangeRequestTaskCard';\nimport PotentialMatchTaskCard from './PotentialMatchTaskCard/PotentialMatchTaskCard';\n\nimport DefaultTaskIcon from '../../../icons/DefaultTaskIcon';\nimport DeleteRequestTaskIcon from '../../../icons/DeleteRequestTaskIcon';\n\nexport type FactoryProps = {\n task: WorkflowTaskData;\n};\n\nclass WorkflowTaskCardsFactory {\n static build = ({task}: FactoryProps) => {\n const {processType} = task;\n switch (processType) {\n case PredefinedWorkflowProcessType.dataChangeRequestReview:\n return <DataChangeRequestTaskCard task={task} />;\n case PredefinedWorkflowProcessType.potentialMatchReview:\n return <PotentialMatchTaskCard task={task} />;\n case PredefinedWorkflowProcessType.recommendForDelete:\n return <GenericWorkflowTaskCard task={task} Icon={DeleteRequestTaskIcon} />;\n default:\n return <GenericWorkflowTaskCard task={task} Icon={DefaultTaskIcon} />;\n }\n };\n}\n\nexport default WorkflowTaskCardsFactory;\n","import WorkflowTaskCardsFactory, {FactoryProps} from './WorkflowTaskCardsFactory';\n\nexport const WorkflowTaskCard = ({task}: FactoryProps) => WorkflowTaskCardsFactory.build({task});\n","import {makeStyles} from '@material-ui/core/styles';\n\nexport const useStyles = makeStyles((theme) => ({\n popoverPaper: {\n width: '464px'\n },\n title: {\n fontSize: '20px',\n fontWeight: 500,\n letterSpacing: '0.25px',\n lineHeight: '24px',\n color: theme.palette.text.primary,\n marginBottom: '17px'\n },\n content: {\n display: 'flex',\n flexDirection: 'column',\n padding: '23px 24px 14px 24px'\n },\n simpleDropDownSelector: {\n marginBottom: '20px'\n },\n inputRoot: {\n paddingTop: '0 !important',\n paddingBottom: '0 !important'\n },\n select: {\n fontSize: '14px'\n },\n footer: {\n display: 'flex',\n justifyContent: 'flex-end',\n padding: '5px 8px 8px',\n borderTop: '1px solid rgba(0,0,0,0.12)'\n },\n cancelButton: {\n marginRight: '8px'\n },\n input: {\n fontSize: '14px'\n }\n}));\n","import React, {useState} from 'react';\nimport i18n from 'ui-i18n';\nimport {TextField as TextField} from '@material-ui/core';\nimport {Portal as Portal} from '@material-ui/core';\nimport {Snackbar as Snackbar} from '@material-ui/core';\nimport {Popover as Popover} from '@material-ui/core';\nimport {Typography as Typography} from '@material-ui/core';\nimport {Button as Button} from '@material-ui/core';\nimport SimpleDropDownSelector from '../../../SimpleDropDownSelector/SimpleDropDownSelector';\nimport {useWorkflowDefinitions} from '../../hooks/useWorkflowDefinitions';\nimport {useWorkflowProcessInstance} from '../../hooks/useWorkflowProcessInstance';\nimport {useStyles} from './styles';\n\ntype Props = {\n anchorEl: Element;\n onClose: () => void;\n};\n\nexport const AddWorkflowDialog = ({anchorEl, onClose}: Props) => {\n const styles = useStyles();\n\n const [comment, setComment] = useState('');\n const [taskType, setTaskType] = useState(null);\n const [isOpenSnackbar, setIsOpenSnackbar] = useState(false);\n\n const {definitions} = useWorkflowDefinitions();\n const {processInstance, loading} = useWorkflowProcessInstance();\n\n const handleChangeComment = (e) => {\n setComment(e.target.value);\n };\n\n const handleChangeTaskType = (value) => {\n setTaskType(value);\n };\n\n const handleStart = () => {\n processInstance(comment, taskType?.value)\n .then(() => {\n setIsOpenSnackbar(true);\n setComment('');\n setTaskType(null);\n onClose();\n })\n .catch(() => {});\n };\n\n const handleCloseSnackbar = () => {\n setIsOpenSnackbar(false);\n };\n\n const open = Boolean(anchorEl);\n\n return (\n <>\n <Popover\n open={open}\n anchorEl={anchorEl}\n onClose={onClose}\n anchorOrigin={{\n vertical: 'bottom',\n horizontal: 'right'\n }}\n transformOrigin={{\n vertical: 'top',\n horizontal: 'right'\n }}\n classes={{\n paper: styles.popoverPaper\n }}\n >\n <div className={styles.content}>\n <Typography className={styles.title}>{i18n.text('Add new workflow')}</Typography>\n <SimpleDropDownSelector\n className={styles.simpleDropDownSelector}\n variant=\"filled\"\n height={40}\n TextFieldProps={{\n InputProps: {\n disableUnderline: true\n }\n }}\n placeholder={i18n.text('Select task type')}\n value={taskType}\n onChange={handleChangeTaskType}\n label={''}\n options={definitions.map((definition) => {\n return {\n value: definition.type,\n label: definition.displayName\n };\n })}\n />\n <TextField\n variant=\"filled\"\n hiddenLabel\n size=\"small\"\n placeholder=\"Type a comment\"\n InputProps={{\n disableUnderline: true,\n classes: {\n input: styles.input,\n root: styles.inputRoot\n }\n }}\n value={comment}\n onChange={handleChangeComment}\n multiline={true}\n />\n </div>\n <div className={styles.footer}>\n <Button disabled={loading} className={styles.cancelButton} onClick={onClose}>\n {i18n.text('Cancel')}\n </Button>\n <Button disabled={loading} color=\"primary\" onClick={handleStart}>\n {i18n.text('Start')}\n </Button>\n </div>\n </Popover>\n <Portal container={document.body}>\n <Snackbar\n open={isOpenSnackbar}\n autoHideDuration={5000}\n onClose={handleCloseSnackbar}\n message={i18n.text('A new workflow has started')}\n />\n </Portal>\n </>\n );\n};\n","import {useEffect, useState} from 'react';\nimport mdmModule from '@reltio/mdm-module';\nimport {Entity, processDefinitions} from '@reltio/mdm-sdk';\nimport {useSelector} from 'react-redux';\n\nconst filterDefinitions = (definitions, entityType) => {\n return definitions.filter(({manualStart, objectTypes}) => {\n return manualStart && (!objectTypes || objectTypes?.some((_entityType) => _entityType === entityType));\n });\n};\n\nexport const useWorkflowDefinitions = () => {\n const [definitions, setDefinitions] = useState([]);\n\n const workflowPath: string = useSelector(mdmModule.selectors.getWorkflowPath);\n const environment: string = useSelector(mdmModule.selectors.getWorkflowEnvironmentUrl);\n const tenant: string = useSelector(mdmModule.selectors.getTenant);\n const entity: Entity = useSelector(mdmModule.selectors.getEntity);\n const entityType = entity.type;\n\n useEffect(() => {\n processDefinitions({workflowPath, environment, tenant}).then(({data}) =>\n setDefinitions(filterDefinitions(data, entityType))\n );\n }, [entityType, workflowPath, environment, tenant]);\n\n return {definitions};\n};\n","import {useCallback, useContext, useState} from 'react';\nimport {useSelector} from 'react-redux';\nimport mdmModule from '@reltio/mdm-module';\nimport {Entity, startProcessInstance} from '@reltio/mdm-sdk';\nimport {WorkflowTasksContext} from '../../../contexts/WorkflowTasksContext';\nimport {showWorkflowError} from '../helpers/errors';\n\nexport const useWorkflowProcessInstance = () => {\n const {loadWorkflowTasks} = useContext(WorkflowTasksContext);\n const workflowPath: string = useSelector(mdmModule.selectors.getWorkflowPath);\n const environment: string = useSelector(mdmModule.selectors.getWorkflowEnvironmentUrl);\n const tenant: string = useSelector(mdmModule.selectors.getTenant);\n const entity: Entity = useSelector(mdmModule.selectors.getEntity);\n const entityUri = entity.uri;\n const [loading, setLoading] = useState(false);\n\n const processInstance = useCallback(\n (comment, taskType) => {\n setLoading(true);\n\n return startProcessInstance({\n workflowPath,\n tenant,\n environment,\n processType: taskType,\n comment,\n objectURIs: [entityUri]\n })\n .then(() => {\n loadWorkflowTasks();\n })\n .catch((error) => {\n showWorkflowError(error);\n throw error;\n })\n .finally(() => {\n setLoading(false);\n });\n },\n [entityUri, environment, loadWorkflowTasks, tenant, workflowPath]\n );\n\n return {processInstance, loading};\n};\n","import {makeStyles} from '@material-ui/core/styles';\n\nexport const useStyles = makeStyles({\n button: {\n padding: '9px 16px 9px 12px',\n marginLeft: 'auto',\n marginRight: '8px'\n },\n buttonLabel: {\n fontSize: '14px',\n fontWeight: 500,\n lineHeight: '16px'\n },\n icon: {\n fontSize: '18px',\n marginRight: '8px'\n }\n});\n","import React, {useState} from 'react';\nimport i18n from 'ui-i18n';\nimport {Button as Button} from '@material-ui/core';\nimport AddIcon from '@material-ui/icons/Add';\nimport {useWorkflowCheckPermission} from '../../hooks/useWorkflowCheckPermission';\nimport {AddWorkflowDialog} from '../AddWorkflowDialog/AddWorkflowDialog';\nimport {useStyles} from './styles';\n\nexport const AddWorkflowButton = () => {\n const styles = useStyles();\n const [anchorEl, setAnchorEl] = useState(null);\n\n const checkWorkflowPermission = useWorkflowCheckPermission();\n const canStartProcess = checkWorkflowPermission('START_PROCESS_INSTANCE');\n const canViewProcessDefinitions = checkWorkflowPermission('VIEW_PROCESS_DEFINITIONS');\n\n const handleOpen = (e) => setAnchorEl(e.currentTarget);\n const handleClose = () => setAnchorEl(null);\n\n return canStartProcess && canViewProcessDefinitions ? (\n <>\n <Button color=\"primary\" className={styles.button} onClick={handleOpen}>\n <AddIcon className={styles.icon} />\n <div className={styles.buttonLabel}>{i18n.text('Add')}</div>\n </Button>\n <AddWorkflowDialog anchorEl={anchorEl} onClose={handleClose} />\n </>\n ) : null;\n};\n","import {useCallback, useEffect, useState} from 'react';\nimport {useSelector} from 'react-redux';\nimport {filter, flatten, isNil, map, pipe, prop, reject, uniqBy} from 'ramda';\nimport mdmModule from '@reltio/mdm-module';\nimport {getTasksForEntity, isTempUri, WorkflowTaskData} from '@reltio/mdm-sdk';\nimport {useSafePromise} from '../../../hooks/useSafePromise';\nimport {useWorkflowCheckPermission} from './useWorkflowCheckPermission';\n\ntype Config = {\n processTypes?: string[];\n assignee?: string;\n showClosedTasks?: boolean;\n};\n\nexport const useWorkflowTasks = (config?: Config) => {\n const {processTypes, assignee, showClosedTasks} = config || {};\n const safePromise = useSafePromise();\n const workflowPath: string = useSelector(mdmModule.selectors.getWorkflowPath);\n const environment: string = useSelector(mdmModule.selectors.getWorkflowEnvironmentUrl);\n const isWorkflowEnabled = useSelector(mdmModule.selectors.isWorkflowEnabled);\n const tenant: string = useSelector(mdmModule.selectors.getTenant);\n const entityUri = useSelector(mdmModule.selectors.getEntityUri);\n const isEditableMode = useSelector(mdmModule.selectors.getIsEditableMode);\n const checkWorkflowPermission = useWorkflowCheckPermission();\n const canViewTasks = checkWorkflowPermission('VIEW_TASKS');\n const enabled = !!(workflowPath && environment) && isWorkflowEnabled && canViewTasks;\n const [tasks, setTasks] = useState<WorkflowTaskData[]>(null);\n const [total, setTotal] = useState<number>(0);\n const [loading, setLoading] = useState<boolean>(false);\n\n const loadWorkflowTasks = useCallback(() => {\n setLoading(true);\n const parsedProcessTypes = !Array.isArray(processTypes) || processTypes.includes('*') ? null : processTypes;\n const requests = (parsedProcessTypes || [null]).map((processType) =>\n getTasksForEntity({\n entityUri,\n workflowPath,\n environment,\n tenant,\n filter: {assignee, processType},\n includeClosed: !!showClosedTasks\n })\n );\n safePromise(Promise.all(requests))\n .then((responses) => {\n const tasks: WorkflowTaskData[] = pipe(\n map(prop('data')),\n reject(isNil),\n flatten,\n uniqBy(prop('taskId')),\n filter(isRequestedTask(parsedProcessTypes, assignee))\n )(responses);\n setTasks(tasks);\n setTotal(tasks.length);\n })\n .catch((error) => {\n console.warn('Workflow error', error);\n })\n .finally(() => {\n setLoading(false);\n });\n }, [entityUri, environment, safePromise, tenant, workflowPath, assignee, showClosedTasks, processTypes]);\n\n useEffect(() => {\n if (entityUri && enabled && !isTempUri(entityUri)) {\n loadWorkflowTasks();\n } else {\n setTasks(null);\n setTotal(0);\n }\n }, [enabled, entityUri, loadWorkflowTasks, isEditableMode]);\n\n const updateTaskState = useCallback((taskId: WorkflowTaskData['taskId'], payload: Partial<WorkflowTaskData>) => {\n setTasks((tasks) =>\n tasks.map((task) => {\n return task.taskId === taskId\n ? {\n ...task,\n ...payload\n }\n : task;\n })\n );\n }, []);\n\n return {tasks, total, loading, updateTaskState, loadWorkflowTasks};\n};\n\nconst isRequestedTask = (processTypes: string[], assignee: string) => (task: WorkflowTaskData) =>\n (!processTypes || processTypes.includes(task.processType)) && (!assignee || assignee === task.assignee);\n","export const MAP_DRAWING_MODES = {\n CIRCLE: 'circle',\n POLYGON: 'polygon'\n};\n\nexport const DEFAULT_OVERLAY_OPTIONS = {\n fillColor: 'rgb(242,82,82)',\n fillOpacity: 0.1,\n strokeWeight: 2,\n strokeColor: '#F25252',\n clickable: false,\n editable: true,\n zIndex: 1\n};\n\nexport const DEFAULT_GOOGLE_MAP_OPTIONS = {\n mapTypeControl: false,\n streetViewControl: false,\n fullscreenControl: false\n};\n\nexport const MAP_MINIMUM_SCALE_RADIUS = 0.001;\n","import React from 'react';\n\ntype Value = {\n activeEntityUri?: string;\n};\n\nexport const EntityMarkerContext = React.createContext<Value>({});\nEntityMarkerContext.displayName = 'EntityMarkerContext';\n","import React from 'react';\nimport {InterceptHandlers} from '@reltio/mdm-sdk';\n\nexport const InterceptHandlersContext = React.createContext<InterceptHandlers>({});\n\nInterceptHandlersContext.displayName = 'InterceptHandlersContext';\n","import React from 'react';\n\nexport const ProfilePerspectiveViewContext = React.createContext(false);\n\nProfilePerspectiveViewContext.displayName = 'ProfilePerspectiveViewContext';\n","import React from 'react';\nimport {InterceptHandlers} from '@reltio/mdm-sdk';\n\ntype SandboxAPI = {\n interceptors?: InterceptHandlers;\n getCurrentPerspectiveId: () => string;\n showPerspective: (perspective) => void;\n setEntityUri: (entityUri: string, listener: () => void) => void;\n};\n\nexport const SandboxAPIContext = React.createContext<SandboxAPI>({\n getCurrentPerspectiveId: () => '',\n setEntityUri: () => {},\n showPerspective: () => {}\n});\n","import {\n AccessToken,\n CustomActionTaskParams,\n CustomViewConfig,\n getAccessToken,\n RequestAction,\n sendRequestFromCustomSandbox,\n sendWorkflowRequest,\n startProcessFromQuery\n} from '@reltio/mdm-sdk';\nimport {isNewUI} from './helpers';\nimport {ProcessRequestParams} from './types';\n\nconst processFromQuery = (\n params: CustomActionTaskParams,\n permissions?: string[] | undefined,\n workflowPath?: string,\n tenant?: string,\n environment?: string\n) => {\n if (!params.processDefinitionId) {\n return new Promise((resolve) => resolve({errorMessage: 'processDefinitionId is empty'}));\n }\n if (!params.searchString) {\n return new Promise((resolve) => resolve({errorMessage: 'searchString is empty'}));\n }\n if (!workflowPath) {\n return new Promise((resolve) => resolve({errorMessage: 'Workflow path is not defined'}));\n }\n const errors = validateParams({url: '/processInstances/_generateFromQuery', ...params}, permissions);\n if (errors) {\n return new Promise((resolve) => resolve(errors));\n }\n\n return startProcessFromQuery({\n workflowPath,\n processType: params.processDefinitionId,\n searchString: params.searchString,\n tenant,\n environment\n });\n};\n\nconst getHeaders = async (params: CustomActionTaskParams, signHandler?: () => Promise<AccessToken>) => {\n const {accessToken} = await signHandler?.();\n return accessToken\n ? {\n ...params.headers,\n Authorization: `Bearer ${accessToken}`\n }\n : params.headers;\n};\n\nconst workflowRequest = async (\n params: CustomActionTaskParams,\n permissions?: string[],\n workflowPath?: string,\n tenant?: string,\n signHandler?: () => Promise<AccessToken>\n) => {\n const {url} = params;\n const errors = validateParams(params, permissions);\n if (errors) {\n return errors;\n }\n const isExternalUrl = url.includes('http:') || url.includes('https:');\n if (!workflowPath && !isExternalUrl) {\n return {errorMessage: 'Workflow path is not defined'};\n }\n const headers = await getHeaders(params, signHandler);\n return await sendWorkflowRequest({\n url,\n method: params.method || 'GET',\n data: params.data,\n tenant,\n headers,\n workflowPath\n });\n};\n\nconst sendApiRequest = async (\n params: CustomActionTaskParams,\n permissions?: string[],\n signHandler?: () => Promise<AccessToken>\n) => {\n const errors = validateParams(params, permissions);\n if (errors) {\n return errors;\n }\n const headers = await getHeaders(params, signHandler);\n return await sendRequestFromCustomSandbox({\n url: params.url,\n method: params.method,\n data: params.data,\n headers,\n noRequestProcessor: true\n });\n};\n\nconst validateParams = (params: CustomActionTaskParams, permissions?: string[]) => {\n const {url} = params;\n if (!url) return {errorMessage: 'URL is empty'};\n const allowed = permissions?.some((perm) => {\n const parsed = perm.match(\n /^(?:([^:?#]+):)?(?:\\/\\/((?:(([^:@?]*)(?::([^:@?]*))?)?@)?((?:\\[[0-9A-Fa-f:]+)|(?:[^:?#]*))(?::(\\d*))?))?((((?:[^?#]*\\/)*)([^?#]*))(?:\\?([^#]*))?(?:#(.*))?)/\n );\n const protocol = parsed[1];\n const host = parsed[6];\n const protocolAndHost = `${protocol}://${host}`;\n const re = new RegExp('^' + perm + '$');\n const formattedPerm = perm.replace(/\\/*$/, '');\n return (\n formattedPerm === url ||\n (host && host === formattedPerm) ||\n (host && protocolAndHost === formattedPerm) ||\n (formattedPerm && formattedPerm.indexOf('/') === 0 && url && url.indexOf(formattedPerm) === 0) ||\n (formattedPerm && re.test(url))\n );\n });\n\n if (!allowed || (permissions?.length || 0) === 0) {\n return {errorMessage: 'Not enough permissions'};\n }\n return false;\n};\n\nexport const processRequest = ({\n name,\n paramObject,\n permissions,\n worker,\n metadata,\n config,\n apiPath,\n servicesPath,\n user,\n workflowPath,\n entity,\n tenant,\n entityUri,\n query,\n openSearch,\n environment,\n getCurrentPerspectiveId,\n showPerspective,\n workflowCheckPermission,\n setEntityUri\n}: ProcessRequestParams) => {\n const handleRequest = (request: Promise<any>) => {\n request\n .then((data) => {\n worker.postMessage({\n action: 'response',\n result: {data, headers: paramObject.params.headers, status: 200},\n ...paramObject.params\n });\n })\n .catch((error) => {\n worker.postMessage({\n action: 'response',\n result: {data: error, headers: paramObject.params.headers, status: 0},\n ...paramObject.params\n });\n });\n };\n const shouldSignRequest = isNewUI(servicesPath);\n const signHandler = shouldSignRequest\n ? () => getAccessToken({servicesPath})\n : () => Promise.resolve({accessToken: ''});\n\n switch (name) {\n case RequestAction.API: {\n const request = sendApiRequest(paramObject.params, permissions, signHandler);\n handleRequest(request);\n break;\n }\n case RequestAction.WORKFLOW: {\n const request = workflowRequest(paramObject.params, permissions, workflowPath, tenant, signHandler);\n handleRequest(request);\n break;\n }\n case RequestAction.WORKFLOW_START_PROCESS_FROM_QUERY: {\n const request = processFromQuery(paramObject.params, permissions, workflowPath, tenant, environment);\n handleRequest(request);\n break;\n }\n case RequestAction.GET_CONFIGURATION: {\n worker.postMessage({action: 'response', result: metadata, ...paramObject.params});\n break;\n }\n case RequestAction.GET_UI_CONFIGURATION: {\n const response = {...config, action: {...config.action}};\n if (response.action.permissions) {\n delete response.action.permissions;\n }\n worker.postMessage({action: 'response', result: response, ...paramObject.params});\n break;\n }\n case RequestAction.SET_ENTITY_URI: {\n const listener = () => worker.postMessage({action: 'response', result: entity, ...paramObject.params});\n setEntityUri(entityUri, listener);\n break;\n }\n case RequestAction.SET_PERSPECTIVE: {\n showPerspective(paramObject.params.perspective);\n worker.postMessage({\n action: 'response',\n result: getCurrentPerspectiveId(),\n ...paramObject.params\n });\n break;\n }\n case RequestAction.GET_PERSPECTIVE: {\n if (getCurrentPerspectiveId) {\n worker.postMessage({\n action: 'response',\n result: getCurrentPerspectiveId(),\n ...paramObject.params\n });\n }\n break;\n }\n case RequestAction.WORKFLOW_CHECK_PERMISSION: {\n worker.postMessage({\n action: 'response',\n result: workflowCheckPermission(paramObject.params.permission),\n ...paramObject.params\n });\n break;\n }\n case RequestAction.GET_SEARCH_QUERY: {\n worker.postMessage({action: 'response', result: query, ...paramObject.params});\n break;\n }\n case RequestAction.OPEN_SEARCH: {\n openSearch({viewId: (config as CustomViewConfig).id, searchState: paramObject.params.searchState || {}});\n break;\n }\n case RequestAction.GET_ENTITY_URI: {\n worker.postMessage({action: 'response', result: entityUri, ...paramObject.params});\n break;\n }\n case RequestAction.GET_ENTITY: {\n worker.postMessage({action: 'response', result: entity, ...paramObject.params});\n break;\n }\n case RequestAction.GET_API_PATH: {\n worker.postMessage({action: 'response', result: apiPath, ...paramObject.params});\n break;\n }\n case RequestAction.WORKFLOW_GET_WORKFLOW_PATH: {\n worker.postMessage({action: 'response', result: workflowPath, ...paramObject.params});\n break;\n }\n case RequestAction.GET_TENANT: {\n worker.postMessage({action: 'response', result: tenant, ...paramObject.params});\n break;\n }\n case RequestAction.GET_USER: {\n worker.postMessage({action: 'response', result: user, ...paramObject.params});\n break;\n }\n case RequestAction.ALERT: {\n worker.postMessage({\n action: 'response',\n result: window.alert(paramObject.params.text),\n ...paramObject.params\n });\n break;\n }\n case RequestAction.CONFIRM: {\n worker.postMessage({\n action: 'response',\n result: window.confirm(paramObject.params.text),\n ...paramObject.params\n });\n break;\n }\n case RequestAction.PROMPT: {\n worker.postMessage({\n action: 'response',\n result: window.prompt(paramObject.params.text, paramObject.params.defaultText || ''),\n ...paramObject.params\n });\n break;\n }\n case RequestAction.OPEN_WINDOW: {\n window.open(paramObject.params.url, '_blank');\n break;\n }\n case RequestAction.RELOAD_PAGE: {\n location.reload();\n break;\n }\n }\n};\n","import nanoid from 'nanoid';\n\nexport const isNewUI = (path?: string): boolean => {\n return path?.includes('/nui');\n};\n\nexport const getWorkerURL = (uiPath: string, tenant: string) => {\n if (isNewUI(uiPath)) {\n return `${uiPath.replace(`${tenant}/`, '')}worker_api.js`;\n } else {\n return `${uiPath}worker_api.js`;\n }\n};\n\nexport const getFilesWithArrayBuffer = (files: FileList) => {\n const readFilePromises = Array.from(files).map((file) => {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onload = (event) => {\n const content = event.target.result;\n const {lastModified, name, size, type} = file;\n resolve({lastModified, name, size, type, content});\n };\n reader.onerror = (error) => {\n reject(error);\n };\n reader.readAsArrayBuffer(file);\n });\n });\n return Promise.all(readFilePromises);\n};\n\nconst processInnerHtml = (parent: HTMLElement, worker: Worker, setTooltip) => {\n let handlersToReset = [];\n const uiActions = parent.getAttribute('ui-actions');\n const uiTooltip = parent.getAttribute('ui-tooltip');\n const id = parent.getAttribute('id') || parent.getAttribute('name');\n if (uiActions) {\n uiActions.split(',').forEach((uiAction) => {\n const handler = (event: Event) => {\n const target = event.target as HTMLInputElement;\n const postEventMessage = (files?) => {\n worker.postMessage({\n action: 'event',\n type: 'uiAction',\n data: {type: uiAction, id, event: {...event, files}}\n });\n };\n if (target.files?.length) {\n getFilesWithArrayBuffer(target.files).then(postEventMessage);\n } else {\n postEventMessage();\n }\n };\n parent.addEventListener(uiAction, handler);\n handlersToReset.push(() => {\n parent.removeEventListener(uiAction, handler);\n });\n });\n parent.removeAttribute('ui-actions');\n }\n if (uiTooltip) {\n setTooltip(uiTooltip);\n }\n parent.childNodes.forEach((child) => {\n if (child.nodeType === 1) {\n //Node.ELEMENT_NODE\n handlersToReset = handlersToReset.concat(processInnerHtml(child as HTMLElement, worker, setTooltip));\n }\n });\n return handlersToReset;\n};\n\ntype ResetHTMLParams = {\n worker: Worker;\n setTooltip: any;\n html?: string;\n innerText?: string;\n setListenersToReset: any;\n setHtml: any;\n};\n\nexport const resetHtml = ({worker, setTooltip, innerText, html, setListenersToReset, setHtml}: ResetHTMLParams) => {\n const docBlock = document.createElement('div');\n docBlock.innerHTML = html || innerText;\n\n const handlersToReset = processInnerHtml(docBlock, worker, setTooltip);\n setListenersToReset(handlersToReset);\n setHtml(docBlock);\n};\n\nconst isURLtoProcess = (processApi: string[], url: string) =>\n (processApi || []).some((request) => {\n const regExp = new RegExp(`^${request}$`);\n return request.replace(/\\/*$/, '') === url || (request && regExp.test(url));\n });\n\nexport const setUpQooxdooRequestInterceptor = ({workerRef, setRequestListeners}) => ({\n processApiRequest: (url, method, headers, data, next) => {\n const requestId = nanoid();\n const options = {url, method, headers, noRequestProcessor: true};\n setRequestListeners(options, next, requestId);\n workerRef.current.postMessage({\n action: 'apiRequest',\n id: requestId,\n url,\n method,\n headers,\n data\n });\n }\n});\n\nexport const setUpQooxdooResponseInterceptor = ({workerRef, setResponseListeners}) => ({\n processApiResponse: (url, method, data, next) => {\n const responseId = nanoid();\n setResponseListeners(next, responseId);\n workerRef.current.postMessage({\n action: 'apiResponse',\n id: responseId,\n url,\n method,\n data\n });\n }\n});\n\nexport const setUpRequestInterceptor = ({\n apiPath,\n reltioPath,\n tenant,\n processApiRequest,\n workerRef,\n setRequestListeners\n}) => ({\n options = {},\n url,\n next\n}: {\n next: (url: string, options: RequestInit) => void;\n abort?: (error: Error) => void;\n url: string;\n options: RequestInit;\n}) => {\n const fakeURL =\n url.startsWith('/') && !url.startsWith(apiPath)\n ? `${reltioPath}/api/${tenant}${url}`\n : `${reltioPath}${url.replace(apiPath, '')}`;\n const isProcessableUrl = isURLtoProcess(processApiRequest, fakeURL);\n if (isProcessableUrl) {\n const requestId = nanoid();\n setRequestListeners(options, next, requestId);\n workerRef.current.postMessage({\n action: 'apiRequest',\n id: requestId,\n url: fakeURL,\n method: options.method,\n headers: {...options.headers, origin: 'ui', requestId},\n data: options.body\n });\n } else {\n next(url, options);\n }\n};\n\nexport const setUpResponseInterceptor = ({\n reltioPath,\n apiPath,\n processApiResponse,\n workerRef,\n setResponseListeners\n}) => ({url, response, next, options, abort}) => {\n if (options?.headers?.origin === 'ui') {\n response\n .json()\n .then((data) => {\n setResponseListeners(next, options.headers.requestId);\n workerRef.current.postMessage({\n action: 'response',\n result: {data, status: response.status},\n id: options?.id,\n name: options?.task?.params?.name\n });\n })\n .catch((error) => {\n abort(error);\n });\n } else {\n const fakeURL = `${reltioPath}${url.replace(apiPath, '')}`;\n const isProcessableUrl = isURLtoProcess(processApiResponse, fakeURL);\n\n if (isProcessableUrl) {\n const responseId = nanoid();\n response\n .json()\n .then((data) => {\n setResponseListeners(next, responseId);\n workerRef.current.postMessage({\n action: 'apiResponse',\n id: responseId,\n url: fakeURL,\n method: options.method,\n data\n });\n })\n .catch((error) => {\n abort(error);\n });\n } else {\n next(response);\n }\n }\n};\n","const defaultAttributes = [\n 'accent-height',\n 'accumulate',\n 'additive',\n 'alignment-baseline',\n 'allowReorder',\n 'alphabetic',\n 'amplitude',\n 'arabic-form',\n 'ascent',\n 'attributeName',\n 'attributeType',\n 'autoReverse',\n 'azimuth',\n 'baseFrequency',\n 'baseline-shift',\n 'baseProfile',\n 'bbox',\n 'begin',\n 'bias',\n 'by',\n 'calcMode',\n 'cap-height',\n 'class',\n 'clip',\n 'clipPathUnits',\n 'clip-path',\n 'clip-rule',\n 'color',\n 'color-interpolation',\n 'color-interpolation-filters',\n 'color-profile',\n 'color-rendering',\n 'contentScriptType',\n 'contentStyleType',\n 'cursor',\n 'cx',\n 'cy',\n 'd',\n 'decelerate',\n 'descent',\n 'diffuseConstant',\n 'direction',\n 'display',\n 'divisor',\n 'dominant-baseline',\n 'dur',\n 'dx',\n 'dy',\n 'edgeMode',\n 'elevation',\n 'enable-background',\n 'end',\n 'exponent',\n 'externalResourcesRequired',\n 'fill',\n 'fill-opacity',\n 'fill-rule',\n 'filter',\n 'filterRes',\n 'filterUnits',\n 'flood-color',\n 'flood-opacity',\n 'font-family',\n 'font-size',\n 'font-size-adjust',\n 'font-stretch',\n 'font-style',\n 'font-variant',\n 'font-weight',\n 'format',\n 'from',\n 'fx',\n 'fy',\n 'g1',\n 'g2',\n 'glyph-name',\n 'glyph-orientation-horizontal',\n 'glyph-orientation-vertical',\n 'glyphRef',\n 'gradientTransform',\n 'gradientUnits',\n 'hanging',\n 'height',\n 'horiz-adv-x',\n 'horiz-origin-x',\n 'id',\n 'ideographic',\n 'image-rendering',\n 'in',\n 'in2',\n 'intercept',\n 'k',\n 'k1',\n 'k2',\n 'k3',\n 'k4',\n 'kernelMatrix',\n 'kernelUnitLength',\n 'kerning',\n 'keyPoints',\n 'keySplines',\n 'keyTimes',\n 'lang',\n 'lengthAdjust',\n 'letter-spacing',\n 'lighting-color',\n 'limitingConeAngle',\n 'local',\n 'marker-end',\n 'marker-mid',\n 'marker-start',\n 'markerHeight',\n 'markerUnits',\n 'markerWidth',\n 'mask',\n 'maskContentUnits',\n 'maskUnits',\n 'mathematical',\n 'max',\n 'media',\n 'method',\n 'min',\n 'mode',\n 'name',\n 'numOctaves',\n 'offset',\n 'opacity',\n 'operator',\n 'order',\n 'orient',\n 'orientation',\n 'origin',\n 'overflow',\n 'overline-position',\n 'overline-thickness',\n 'panose-1',\n 'paint-order',\n 'path',\n 'pathLength',\n 'patternContentUnits',\n 'patternTransform',\n 'patternUnits',\n 'pointer-events',\n 'points',\n 'pointsAtX',\n 'pointsAtY',\n 'pointsAtZ',\n 'preserveAlpha',\n 'preserveAspectRatio',\n 'primitiveUnits',\n 'r',\n 'radius',\n 'refX',\n 'refY',\n 'rendering-intent',\n 'repeatCount',\n 'repeatDur',\n 'requiredExtensions',\n 'requiredFeatures',\n 'restart',\n 'result',\n 'rotate',\n 'rx',\n 'ry',\n 'scale',\n 'seed',\n 'shape-rendering',\n 'slope',\n 'spacing',\n 'specularConstant',\n 'specularExponent',\n 'speed',\n 'spreadMethod',\n 'startOffset',\n 'stdDeviation',\n 'stemh',\n 'stemv',\n 'stitchTiles',\n 'stop-color',\n 'stop-opacity',\n 'strikethrough-position',\n 'strikethrough-thickness',\n 'string',\n 'stroke',\n 'stroke-dasharray',\n 'stroke-dashoffset',\n 'stroke-linecap',\n 'stroke-linejoin',\n 'stroke-miterlimit',\n 'stroke-opacity',\n 'stroke-width',\n 'style',\n 'surfaceScale',\n 'systemLanguage',\n 'tableValues',\n 'target',\n 'targetX',\n 'targetY',\n 'text-anchor',\n 'text-decoration',\n 'text-rendering',\n 'textLength',\n 'to',\n 'transform',\n 'type',\n 'u1',\n 'u2',\n 'underline-position',\n 'underline-thickness',\n 'unicode',\n 'unicode-bidi',\n 'unicode-range',\n 'units-per-em',\n 'v-alphabetic',\n 'v-hanging',\n 'v-ideographic',\n 'v-mathematical',\n 'values',\n 'version',\n 'vert-adv-y',\n 'vert-origin-x',\n 'vert-origin-y',\n 'viewBox',\n 'viewTarget',\n 'visibility',\n 'width',\n 'widths',\n 'word-spacing',\n 'writing-mode',\n 'x',\n 'x-height',\n 'x1',\n 'x2',\n 'xChannelSelector',\n 'y',\n 'y1',\n 'y2',\n 'yChannelSelector',\n 'z',\n 'zoomAndPan'\n];\n\nconst defaultTags = [\n 'animate',\n 'animateColor',\n 'animateMotion',\n 'animateTransform',\n 'mpath',\n 'set',\n 'circle',\n 'ellipse',\n 'line',\n 'polygon',\n 'polyline',\n 'rect',\n 'defs',\n 'glyph',\n 'g',\n 'marker',\n 'mask',\n 'missing-glyph',\n 'pattern',\n 'svg',\n 'switch',\n 'symbol',\n 'font',\n 'font-face',\n 'font-face-format',\n 'font-face-name',\n 'font-face-src',\n 'font-face-uri',\n 'hkern',\n 'vkern',\n 'linearGradient',\n 'radialGradient',\n 'stop',\n 'circle',\n 'ellipse',\n 'image',\n 'line',\n 'path',\n 'polygon',\n 'polyline',\n 'rect',\n 'text',\n 'use',\n 'feDistantLight',\n 'fePointLight',\n 'feSpotLight',\n 'circle',\n 'ellipse',\n 'line',\n 'path',\n 'polygon',\n 'polyline',\n 'rect',\n 'defs',\n 'g',\n 'svg',\n 'symbol',\n 'use',\n 'altGlyph',\n 'altGlyphDef',\n 'altGlyphItem',\n 'glyph',\n 'glyphRef',\n 'textPath',\n 'text',\n 'tref',\n 'tspan',\n 'altGlyph',\n 'textPath',\n 'tref',\n 'tspan',\n 'clipPath',\n 'color-profile',\n 'cursor',\n 'filter',\n 'foreignObject',\n 'script',\n 'style',\n 'view'\n];\n\nexport default {\n attributes: {\n '*': [...defaultAttributes, 'ui-actions', 'ui-tooltip'],\n img: ['src', 'srcset', 'alt', 'title', 'loading'],\n link: ['href', 'rel'],\n iframe: ['src'],\n a: ['href']\n },\n tags: [...defaultTags, 'a', 'link', 'input', 'button', 'iframe', 'img']\n};\n","import sanitizeHtml, {IOptions} from 'sanitize-html';\nimport sanitizeOptions from './helpers/sanitizerOptions';\n\nexport const useHtmlSanitizer = () => {\n const {allowedAttributes, allowedTags} = sanitizeHtml.defaults;\n const {attributes, tags} = sanitizeOptions;\n const options: IOptions = {\n allowedTags: allowedTags.concat(tags),\n allowedAttributes: {...allowedAttributes, ...attributes},\n allowVulnerableTags: true\n };\n return (html: string) => sanitizeHtml(html, options);\n};\n","import {useCallback, useContext, useEffect, useRef, useState, CSSProperties} from 'react';\nimport {useDispatch, useSelector} from 'react-redux';\nimport mdmModule, {ui} from '@reltio/mdm-module';\nimport {\n CustomAction,\n CustomActionTaskParams,\n CustomScriptPlatform,\n CustomViewConfig,\n Entity,\n initializeWebWorker,\n isEmptyValue,\n ProcessParams\n} from '@reltio/mdm-sdk';\nimport {omit} from 'ramda';\nimport {useWorkflowCheckPermission} from '../../components/workflow';\nimport {useHtmlSanitizer} from '../useHtmlSanitizer';\nimport {InterceptHandlersContext, SandboxAPIContext, SnackbarContext} from '../../contexts';\nimport {processRequest} from './API';\nimport {\n getWorkerURL,\n resetHtml,\n isNewUI,\n setUpResponseInterceptor,\n setUpRequestInterceptor,\n setUpQooxdooRequestInterceptor,\n setUpQooxdooResponseInterceptor\n} from './helpers';\nimport {Request} from './types';\n\nexport const useAPI = (config: CustomViewConfig = {} as CustomViewConfig) => {\n const [html, setHtml] = useState<HTMLElement>();\n const [listenersToReset, setListenersToReset] = useState<Array<() => void>>([]);\n const [popupListenersToReset, setPopupListenersToReset] = useState<Array<() => void>>([]);\n const [visible, setVisible] = useState(true);\n const [popup, setPopup] = useState<HTMLElement>();\n const [tooltip, setTooltip] = useState<string>(null);\n const [customStyles, setCustomStyles] = useState<{\n height?: number | string;\n width?: number | string;\n pointerEvents?: CSSProperties['pointerEvents'];\n }>({});\n const workerRef = useRef<Worker>();\n const requestListeners = useRef({});\n const responseListeners = useRef({});\n\n const dispatch = useDispatch();\n const sanitizeHtml = useHtmlSanitizer();\n\n const uiPath = useSelector(mdmModule.selectors.getUIPath);\n const tenant: string = useSelector(mdmModule.selectors.getTenant);\n const workerUrl = getWorkerURL(uiPath, tenant);\n\n const showSnackbarMessage = useContext(SnackbarContext);\n const qxApi = useContext(SandboxAPIContext);\n const interceptHandlers = useContext(InterceptHandlersContext);\n\n const workflowCheckPermission = useWorkflowCheckPermission();\n\n const metadata = useSelector(mdmModule.selectors.getMetadata) || {};\n const entity = useSelector(mdmModule.selectors.getEntity) || ({} as Entity);\n const apiPath: string = useSelector(mdmModule.selectors.getApiPath);\n const servicesPath = useSelector(mdmModule.selectors.getServicesPath);\n const reltioPath = useSelector(mdmModule.selectors.getReltioPath);\n const workflowPath = useSelector(mdmModule.selectors.getWorkflowPath);\n const user = useSelector(mdmModule.selectors.getUser);\n const entityUri = useSelector(mdmModule.selectors.getEntityUri);\n const environment = useSelector(mdmModule.selectors.getWorkflowEnvironmentUrl);\n const {type: typeSearch, data: search} = useSelector(mdmModule.selectors.getSearchProviderData) || {};\n const isOldUI = !isNewUI(servicesPath);\n const supportedInterceptHandlers = isOldUI ? qxApi.interceptors : interceptHandlers;\n\n const openSearch = (search) => dispatch(ui.actions.openSearch(search));\n\n let innerText = '';\n let popupText = '';\n const process = ({task, worker}: ProcessParams) => {\n if (task) {\n switch (task.action) {\n case CustomAction.SET_HTML: {\n const sanitizedHtml = sanitizeHtml((task.params as CustomActionTaskParams).html);\n if ((task.params as CustomActionTaskParams).id) {\n const elem = document.getElementById((task.params as CustomActionTaskParams).id as string);\n elem.innerHTML = sanitizedHtml;\n } else if (innerText !== sanitizedHtml) {\n innerText = sanitizedHtml;\n resetHtml({\n worker,\n setTooltip,\n html: sanitizedHtml,\n innerText,\n setListenersToReset,\n setHtml\n });\n }\n break;\n }\n case CustomAction.SHOW_POPUP: {\n const sanitizedPopup = sanitizeHtml(task.params as string);\n popupText = sanitizedPopup;\n resetHtml({\n worker,\n setTooltip,\n html: sanitizedPopup,\n innerText: popupText,\n setListenersToReset: setPopupListenersToReset,\n setHtml: setPopup\n });\n break;\n }\n case CustomAction.HIDE_POPUP: {\n popupText = '';\n setPopup(null);\n break;\n }\n case CustomAction.SET_VISIBILITY: {\n if (task.params === 'visible') {\n setVisible(true);\n resetHtml({\n worker,\n setTooltip,\n innerText,\n setListenersToReset,\n setHtml\n });\n } else {\n setVisible(false);\n }\n break;\n }\n case CustomAction.SET_TOOLTIP: {\n setTooltip(task.params as string);\n break;\n }\n case CustomAction.SET_HEIGHT: {\n setCustomStyles((prev) => ({\n ...prev,\n height: task.params as string | number\n }));\n break;\n }\n case CustomAction.SET_WIDTH: {\n setCustomStyles((prev) => ({\n ...prev,\n width: task.params as string | number\n }));\n break;\n }\n case CustomAction.SET_ENABLED: {\n setCustomStyles((prev) =>\n task.params ? omit(['pointer-events'], prev) : {...prev, 'pointer-events': 'none'}\n );\n break;\n }\n case CustomAction.LOG: {\n console.log(task.params); //eslint-disable-line no-console\n break;\n }\n case CustomAction.MESSAGE: {\n showSnackbarMessage(task.params as string);\n break;\n }\n case CustomAction.REQUEST: {\n if ((task.params as CustomActionTaskParams)?.headers?.origin !== 'ui') {\n processRequest({\n name: (task.params as CustomActionTaskParams).name,\n paramObject: task as Request,\n permissions: config.action.permissions,\n worker,\n metadata,\n config: config as CustomViewConfig,\n user,\n servicesPath,\n apiPath: isOldUI ? apiPath : reltioPath,\n tenant,\n workflowPath,\n entity,\n entityUri,\n environment,\n query: typeSearch === 'search' ? search?.query : null,\n openSearch,\n workflowCheckPermission,\n ...qxApi\n });\n } else {\n const {headers, id, url: fakeURL, method, data} = task.params as CustomActionTaskParams;\n const url = fakeURL.replace(reltioPath, apiPath);\n if (requestListeners.current[headers.requestId]) {\n requestListeners.current[headers.requestId].next(url, {\n body: data,\n id,\n task,\n headers,\n method\n });\n requestListeners.current = omit([headers.requestId], requestListeners.current);\n }\n }\n break;\n }\n case CustomAction.RETURN_PROCESSED_API_RESPONSE:\n case CustomAction.RETURN_PROCESSED_API_REQUEST: {\n const {id, data} = task.params as CustomActionTaskParams;\n if (responseListeners.current[id]) {\n responseListeners.current[id].next(data);\n responseListeners.current = omit([id], responseListeners.current);\n }\n break;\n }\n }\n }\n };\n\n const setRequestListeners = (options, next, requestId) => {\n requestListeners.current = {\n ...requestListeners.current,\n [requestId]: {options, next, id: requestId}\n };\n };\n\n const setResponseListeners = (next, responseId) => {\n responseListeners.current = {\n ...responseListeners.current,\n [responseId]: {next}\n };\n };\n\n const qooxdooRequestInterceptor = setUpQooxdooRequestInterceptor({workerRef, setRequestListeners});\n const qooxdooResponseInterceptor = setUpQooxdooResponseInterceptor({workerRef, setResponseListeners});\n const requestInterceptor = setUpRequestInterceptor({\n apiPath,\n reltioPath,\n tenant,\n processApiRequest: config?.action?.processApiRequest,\n workerRef,\n setRequestListeners\n });\n const responseInterceptor = setUpResponseInterceptor({\n reltioPath,\n apiPath,\n processApiResponse: config?.action?.processApiResponse,\n workerRef,\n setResponseListeners\n });\n\n useEffect(() => {\n if (!isEmptyValue(config.action) && config.action.platform !== CustomScriptPlatform.CLASSIC) {\n workerRef.current = initializeWebWorker(workerUrl, process, config);\n }\n }, [entity]);\n\n useEffect(\n () => () => {\n listenersToReset.forEach((listener) => listener());\n },\n [listenersToReset]\n );\n //we need to have separate handlers in opposite case main window listeners will be removed on the popup appear\n useEffect(\n () => () => {\n popupListenersToReset.forEach((listener) => listener());\n },\n [popupListenersToReset, listenersToReset]\n );\n\n const onClick = useCallback(() => {\n workerRef.current?.postMessage({\n action: 'event',\n type: 'execute',\n data: null\n });\n }, [config]);\n\n useEffect(() => {\n if (\n !isEmptyValue(supportedInterceptHandlers) &&\n (config?.action?.processApiRequest || config?.action?.processApiResponse)\n ) {\n const {\n addInternalRequestInterceptor,\n addInternalResponseInterceptor,\n removeInternalRequestInterceptor,\n removeInternalResponseInterceptor\n } = supportedInterceptHandlers;\n\n if (isOldUI) {\n addInternalRequestInterceptor(config?.action?.processApiRequest, qooxdooRequestInterceptor);\n addInternalResponseInterceptor(config?.action?.processApiResponse, qooxdooResponseInterceptor);\n return () => {\n removeInternalRequestInterceptor(qooxdooRequestInterceptor);\n removeInternalResponseInterceptor(qooxdooResponseInterceptor);\n };\n } else {\n addInternalRequestInterceptor(requestInterceptor);\n addInternalResponseInterceptor(responseInterceptor);\n return () => {\n removeInternalRequestInterceptor(requestInterceptor);\n removeInternalResponseInterceptor(responseInterceptor);\n };\n }\n }\n }, [config]);\n\n return {html, visible, tooltip, customStyles, onClick, popup};\n};\n","import {useCallback, useEffect, useState} from 'react';\nimport {concat, difference, isEmpty, map, pipe, prop, reduce, reject, uniq} from 'ramda';\nimport {useSelector} from 'react-redux';\nimport mdm from '@reltio/mdm-module';\nimport {\n ActivityFilters,\n Comment,\n Entity,\n FilterOptions,\n getFilteredEntities,\n isEntityUri,\n getEntity,\n EntitiesMap\n} from '@reltio/mdm-sdk';\nimport {useSafePromise} from './useSafePromise';\n\nconst SELECT_OPTION = 'uri,label,type';\n\nexport const useCommentsEntitiesMap = (comments: Comment[]) => {\n const safePromise = useSafePromise();\n const currentEntityUri = useSelector(mdm.selectors.getEntityUriWithDataTenant);\n\n const [entitiesMap, setEntitiesMap] = useState<EntitiesMap>({});\n\n const getEntities = useCallback(\n (entitiesUris: string[]) => {\n const requestFilters = [\n {\n filter: FilterOptions.EQUALS,\n fieldName: 'uri',\n values: entitiesUris\n }\n ];\n\n const requestOptions = {\n max: entitiesUris.length,\n activeness: ActivityFilters.ALL,\n select: 'uri,label,type'\n };\n return safePromise(getFilteredEntities(requestFilters, requestOptions));\n },\n [safePromise]\n );\n\n const getNotFoundEntity = (entityUri: string) => {\n return getEntity(entityUri, {options: SELECT_OPTION})\n .then((entity: Entity) => ({...entity, uri: entityUri} as Entity))\n .catch(() => ({}));\n };\n\n const addNotFoundEntities = useCallback(\n (entitiesUris: string[], entities: Entity[]) => {\n return safePromise(\n Promise.all((entitiesUris || []).map(getNotFoundEntity))\n ).then((notFoundEntities: Entity[]) => pipe(reject(isEmpty), concat(entities))(notFoundEntities));\n },\n [safePromise]\n );\n\n useEffect(() => {\n const uniqEntitiesUris = pipe(\n reduce((entitiesUris, comment) => {\n const {objectType: type, relatedObjectUris} = comment;\n\n if (type === 'relation' || type === 'potentialMatch') {\n (relatedObjectUris || []).forEach((uri) => {\n if (uri !== currentEntityUri && isEntityUri(uri) && !entitiesMap[uri]) {\n entitiesUris.push(uri);\n }\n });\n }\n return entitiesUris;\n }, []),\n uniq\n )(comments || []);\n\n if (uniqEntitiesUris.length) {\n getEntities(uniqEntitiesUris)\n .then((results: Entity[]) => {\n const getNotFoundUris = pipe(map(prop('uri')), difference(uniqEntitiesUris));\n\n const notFoundEntities = getNotFoundUris(results);\n return addNotFoundEntities(notFoundEntities, results);\n })\n .then((results) => {\n setEntitiesMap((prevEntitiesMap) =>\n results.reduce(\n (entities, entity) => {\n entities[entity.uri] = entity;\n return entities;\n },\n {...prevEntitiesMap}\n )\n );\n })\n .catch(() => {});\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [getEntities, addNotFoundEntities, comments, currentEntityUri]);\n\n return entitiesMap;\n};\n","import {useSelector} from 'react-redux';\nimport mdmModule from '@reltio/mdm-module';\nimport {checkConfigPermission, ConfigPermissions} from '@reltio/mdm-sdk';\nimport {useCallback} from 'react';\n\nconst emptyArray = [];\n\nexport const useConfigPermissions = () => {\n const userRoles = useSelector(mdmModule.selectors.getUserRoles) || emptyArray;\n\n return {\n canCreate: useCallback(checkConfigPermission(ConfigPermissions.CREATE, userRoles), [userRoles]),\n canRead: useCallback(checkConfigPermission(ConfigPermissions.READ, userRoles), [userRoles]),\n canUpdate: useCallback(checkConfigPermission(ConfigPermissions.UPDATE, userRoles), [userRoles]),\n canDelete: useCallback(checkConfigPermission(ConfigPermissions.DELETE, userRoles), [userRoles])\n };\n};\n","import {useCallback, useEffect, useRef, useState} from 'react';\nimport {useDispatch, useSelector} from 'react-redux';\nimport {cond, pipe, prop, T, when, identity, times, length, ifElse, always} from 'ramda';\nimport mdm, {profile} from '@reltio/mdm-module';\nimport {\n ActivityFilter,\n addGlobalFilterToQuery,\n Entity,\n getRelationsForDataTenantEntity,\n getRelationsForEntity,\n GlobalSearchRequestOptions,\n isDataTenantEntity,\n isTempUri,\n Mode,\n wrapInArrayIfNeeded\n} from '@reltio/mdm-sdk';\nimport {useSafePromise} from './useSafePromise';\nimport {usePrevious} from './usePrevious';\n\ntype Props = {\n sorting?: {\n field: string;\n order: string;\n };\n filter?: string;\n page: number;\n rowsPerPage: number;\n config: {\n id: string;\n content: Record<string, unknown>;\n suggested?: Record<string, unknown>[] | Record<string, unknown>;\n };\n entity: Entity;\n relationActivityFilter?: ActivityFilter;\n mode: Mode;\n};\n\nconst buildSuggestedIds = when(\n identity,\n pipe(\n wrapInArrayIfNeeded,\n length,\n times((n) => n + 1)\n )\n);\n\nexport const useRelationsLoader = ({\n sorting,\n filter,\n page,\n rowsPerPage,\n config,\n entity,\n relationActivityFilter,\n mode\n}: Props) => {\n const [isLoading, setIsLoading] = useState(false);\n const dispatch = useDispatch();\n const tenant = useSelector(mdm.selectors.getTenant) as string;\n const dtssPath = useSelector(mdm.selectors.getDtssPath) as string;\n const {activityFilter, globalFilter}: GlobalSearchRequestOptions =\n useSelector(mdm.selectors.getGlobalSearchRequestOptions) || {};\n const safePromise = useSafePromise();\n const suggested = config.suggested;\n const loadRelations = useCallback(() => {\n if (entity?.uri) {\n const requestConfig = {\n ...config.content,\n sortBy: sorting?.field,\n order: sorting?.order,\n returnDates: true,\n returnObjects: true,\n activeness: {\n relation: relationActivityFilter || ActivityFilter.ALL,\n entity: activityFilter\n },\n max: rowsPerPage,\n offset: page * rowsPerPage,\n filter: addGlobalFilterToQuery(globalFilter, filter) || undefined,\n suggested: buildSuggestedIds(suggested)\n };\n const configs = [requestConfig].concat(\n ifElse(\n identity,\n pipe(wrapInArrayIfNeeded, (suggested) =>\n suggested.map((config, i) => ({...config, id: requestConfig.suggested[i]}))\n ),\n always([])\n )(suggested)\n );\n const request = cond([\n [pipe(prop('uri'), isTempUri), () => Promise.resolve([{total: 0}])],\n [\n isDataTenantEntity,\n (entity) =>\n getRelationsForDataTenantEntity({\n entityUri: entity.uri,\n configs: configs,\n customerTenant: tenant,\n dataTenant: entity.dataTenant,\n dtssPath\n })\n ],\n [T, (entity) => getRelationsForEntity(entity.uri, configs)]\n ]);\n setIsLoading(true);\n safePromise(request(entity))\n .then(([{connections, total}]) => {\n dispatch(profile.relations.actions.relationsLoaded({id: config.id, connections, total}));\n })\n .finally(() => {\n setIsLoading(false);\n });\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n activityFilter,\n config,\n dispatch,\n dtssPath,\n entity?.uri,\n entity?.dataTenant,\n filter,\n globalFilter,\n page,\n relationActivityFilter,\n rowsPerPage,\n safePromise,\n sorting,\n tenant\n ]);\n const isRequestSentRef = useRef<boolean>(false);\n isRequestSentRef.current = false;\n useEffect(() => {\n isRequestSentRef.current = true;\n loadRelations();\n }, [loadRelations]);\n const prevMode = usePrevious(mode);\n useEffect(() => {\n if (mode === Mode.Viewing && !isRequestSentRef.current && prevMode !== mode) {\n isRequestSentRef.current = true;\n loadRelations();\n }\n }, [loadRelations, mode, prevMode]);\n return {isLoading, reload: loadRelations};\n};\n"],"names":["useStyles","makeStyles","searchButton","marginLeft","marginRight","padding","input","flex","fontSize","background","startAdornment","color","paddingLeft","ExpandableSearchInput","query","onChange","value","setValue","useState","isOpen","setIsOpen","useEffect","styles","hasValue","length","Input","className","autoFocus","placeholder","i18n","disableUnderline","pipe","getValue","InputAdornment","position","Search","endAdornment","SmallIconButton","size","icon","CloseIcon","onClick","F","always","tap","onKeyPress","when","propEq","trim","IconButton","T","container","minHeight","title","lineHeight","paddingTop","paddingBottom","justifyContent","children","BasicViewHeader","classes","root","classnames","EmptyStub","style","display","HideOnShrink","widthToHide","handleWidth","render","width","propTypes","PropTypes","alignItems","height","check","ImportModes","tooltip","noop","mode","INIT","button","tooltipTitle","CloudDownloadIcon","PROGRESS","CircularProgress","spinner","SUCCESS","Done","renderCurrentMode","link","textDecoration","to","href","e","stopPropagation","preventDefault","theme","maxWidth","MAX_WIDTH_SELECT","outlined","paddingRight","arrowIcon","top","right","palette","text","secondary","currentValue","currentValueIcon","currentValueText","textTransform","fontWeight","primary","whiteSpace","textOverflow","overflow","menuItem","firstMenuItemButton","borderTop","menuItemInner","menuItemIcon","menuItemLabel","menuItemDescription","isButton","ModeSwitcherSelect","optionsGroup","buttonsGroup","disabled","Select","target","some","variant","renderValue","IconComponent","label","find","Box","Tooltip","Typography","MenuProps","anchorOrigin","vertical","horizontal","transformOrigin","getContentAnchorEl","items","firstButtonIdx","findIndex","map","item","idx","description","menuItemProps","MenuItem","key","renderMenuItems","flexDirection","profileCardWrapper","gap","profileCardContainer","flexGrow","rulesContainer","marginBottom","ProfileMatchCard","entitiesMap","entity","match","metadata","ProfileCard","object","matchRules","MatchRulesBlock","scroll","element","scrollIntoView","block","behavior","clearScrollTimer","scrollTimer","clearTimeout","isScrolledIntoView","scrollableParent","elemTop","offsetTop","elemBottom","clientHeight","scrollTop","from","highlighted","animationName","animationDuration","animationIterationCount","borderBottom","content","backgroundColor","clickable","cursor","selected","fade","main","inactive","inactiveBackground","inactiveHoverBackground","inactiveSelectedBackground","inactiveSelectedHoverBackground","justImported","avatar","image","marginTop","info","overflowWrap","wordWrap","secondaryLabel","businessCard","secondRow","connect","state","mdmModule","entities","entityToHighlight","selectedEntityUri","onEntityClick","onEntityHover","entitiesImportStatus","entityButtonsRenderer","list","useRef","useDidUpdateEffect","current","querySelectorAll","parentElement","setTimeout","ref","getLabel","businessCardText","getBusinessCardAttributesText","isActive","isActiveObject","entityUri","uri","entityUriForLink","getEntityUriForLink","importStatus","prop","undefined","onMouseEnter","onMouseLeave","EntityAvatar","avatarClassName","imageClassName","EntityUriLink","EntityTypeBadge","getEntityId","filter","Boolean","join","minWidth","textAlign","bottom","left","zIndex","transform","opacity","borderLeft","borderRight","animation","boxSizing","TreeNode","listIndex","swapFrom","swapLength","swapDepth","scaffoldBlockPxWidth","lowerSiblingCounts","connectDropTarget","isOver","draggedNode","canDrop","treeIndex","treeId","getPrevRow","node","path","rowDirection","otherProps","rowDirectionClass","scaffoldBlockCount","scaffold","forEach","lowerSiblingCount","i","lineClass","push","highlightLineClass","Children","child","cloneElement","defaultProps","isRequired","NodeRendererDefault","toggleChildrenVisibility","connectDragPreview","connectDragSource","isDragging","canDrag","subtitle","isSearchMatch","isSearchFocus","buttons","didDrop","parentNode","nodeTitle","nodeSubtitle","handle","expanded","Array","_","index","dropEffect","isDraggedDescendant","isDescendant","isLandingPadActive","buttonStyle","type","btn","TreePlaceholder","Component","this","props","drop","border","boxShadow","outline","borderColor","PlaceholderRendererDefault","memoize","f","savedArgsArray","savedKeysArray","savedResult","args","keysArray","Object","keys","sort","argsArray","arg","memoizedInsertNode","insertNode","memoizedGetFlatDataFromTree","getFlatDataFromTree","memoizedGetDescendantCount","getDescendantCount","DndManager","constructor","treeRef","hoverHandler","hoverProps","dropTargetProps","monitor","component","getItem","targetDepth","getTargetDepth","lastDropTargetNode","lastDropTargetDepth","dragHover","minimumTreeIndex","depth","deferredCallHoverHandler","shouldSkipMoreFrames","rafId","requestAnimationFrame","resetDragVariables","startDrag","endDrag","dndType","treeData","draggingTreeData","getNodeKey","customCanDrop","maxDepth","lastCanDropResult","lastCanDropProps","dropTargetDepth","rowAbove","canNodeHaveChildren","slice","Math","min","blocksOffset","dragSourceInitialDepth","relativePosition","findDOMNode","getBoundingClientRect","leftShift","getSourceClientOffset","x","round","direction","getDifferenceFromInitialOffset","max","draggedChildDepth","getDepth","abovePath","aboveNode","newCanDropProps","nodeId","aboveNodeId","equals","addedResult","newNode","expandParent","prevPath","prevParent","prevTreeIndex","nextPath","nextParent","nextTreeIndex","wrapSource","el","nodeDragSource","beginDrag","cancelAnimationFrame","getDropResult","dropTargetNode","dragSource","dragPreview","wrapTarget","nodeDropTarget","result","hover","bind","dropTarget","dragged","wrapPlaceholder","placeholderDropTarget","treeIdCounter","mergeTheme","merged","innerStyle","reactVirtualizedListProps","overridableDefaults","nodeContentRenderer","placeholderRenderer","rowHeight","slideRegionSize","treeNodeRenderer","propKey","ReactSortableTree","super","isVirtualized","dndManager","treePlaceholderRenderer","scrollZoneVirtualList","createScrollingComponent","withScrolling","List","vStrength","createVerticalStrength","hStrength","createHorizontalStrength","draggedMinimumTreeIndex","draggedDepth","searchMatches","searchFocusTreeIndex","dragging","draggingExpandedPaths","ignoreOneTreeUpdate","instanceProps","searchQuery","searchFocusOffset","ignoreTreeChanges","moveNode","handleDndMonitorChange","componentDidMount","loadLazyChildren","stateUpdate","search","setState","clearMonitorSubscription","dragDropManager","getMonitor","subscribeToStateChange","nextProps","prevState","newState","assign","componentDidUpdate","prevProps","onDragStateChanged","walk","callback","pending","onLazyLoadChildren","removeNode","draggedPath","reduce","newTree","changeNodeAtPath","isTreeDataEqual","componentWillUnmount","getRows","ignoreCollapsed","targetNode","onVisibilityToggle","nextParentNode","onMoveNode","seekIndex","expand","singleSearch","searchFinishCallback","searchMethod","onlyExpandSearchedNodes","expandedTreeData","matches","toggleExpandedForAll","defaultSearchMethod","expandAllMatchPaths","expandFocusMatchPaths","newDraggingTreeData","nodePath","newDraggingExpandedPaths","gt","append","uniqWith","eqBy","String","dropResult","shouldCopy","shouldCopyOnOutsideDrop","copyNode","resetTree","loadCollapsedLazyChildren","done","childrenArray","oldNode","renderRow","row","matchKeys","generateNodeProps","TreeNodeRenderer","NodeContentRenderer","nodeKey","callbackParams","nodeProps","rowCanDrag","sharedProps","rows","swapTo","fromIndex","toIndex","count","rowsWithoutMoved","slideRows","scrollToInfo","scrollToIndex","containerStyle","Placeholder","PlaceholderContent","ScrollZoneVirtualList","verticalStrength","horizontalStrength","speed","scrollToAlignment","rst__virtualScrollOverride","onScroll","rowCount","estimatedRowSize","rowRenderer","rowStyle","defaultGetNodeKey","polyfill","StyledReactSortableTree","withStyles","SortableTreeWithoutDndContext","DndContext","DragAndDrop","getReactElementText","parent","stringSearch","indexOf","getNodeDataAtTreeIndexOrNextIndex","targetIndex","currentIndex","isPseudoRoot","selfPath","nextIndex","childIndex","childCount","walkDescendants","mapDescendants","nextNode","selfInfo","mapResult","RESULT_MISS","traverse","currentTreeIndex","pathIndex","Error","removedNode","removedTreeIndex","addNodeAtDepthAndIndex","isLastChild","currentDepth","n","insertedTreeIndex","parentPath","insertIndex","pathFragment","newChildren","insertResult","flattened","nodeInfo","older","younger","deepest","matchCount","trav","isSelfMatch","hasFocusMatch","extraInfo","hasChildren","getTreeFromFlatData","flatData","getKey","id","getParentKey","parentId","rootKey","childrenToParents","parentKey","addNodeUnderParent","addAsFirstChild","hasBeenAdded","changedTreeData","getNodeAtPath","foundNodeInfo","err","removeNodeAtPath","getVisibleNodeInfoAtIndex","getVisibleNodeCount","total","currentNode","editor","letterSpacing","margin","dense","actionButtons","RelationEditor","connection","modifiedEntity","allModifiedEntities","dispatch","config","globalSearchRequestOptions","error","relationUri","relationType","relation","isNew","inRelations","inRelationTypes","outRelations","outRelationTypes","useMemo","getInOutRelations","parentEntityUri","contentSecondLevel","firstLevelRelationAttrTypes","getRelationAttributesList","attributeListEntity","attributes","profile","getActivenessAttributes","initialConnection","initialModifiedEntity","relatedTempEntities","findRelatedTemporaryEntities","relatedTempEntitiesUrisHistory","concat","uniq","initialRelatedTempEntities","defaultRelationType","getDefaultRelationTypeObject","hasChanges","initial","actual","isEmptyValue","applyAction","onRelationTypeChange","useCallback","handleClose","updateModifiedEntityLabel","entityType","getEntityType","updateConnectionEntityLabel","setModifiedEntity","deleteModifiedEntity","onChangeEntity","getErrorId","validate","errors","validateConnection","resetErrors","onApply","omitMarks","differenceWith","onCancel","initialEntity","initialTempEntities","onAddAttributes","params","param","viewId","onChangeAttribute","onDeleteAttribute","onCreateEntity","entityTypeUri","initValue","newEntityAttrTypes","relationEditorAttributeTypesSelectionStrategy","getCreatableAttributeTypes","newEntity","createTemporaryEntity","attributeTypes","errorMessage","getErrorMessage","getEntityTypesUris","entityTypes","ConnectionRelationTypeSelector","ErrorWrapper","EntitySelector","isTempUri","entityTypesUris","onCreate","attributeTypesSelectionStrategy","AttributesList","attrTypes","showEmptyEditors","crosswalks","parentUri","Button","Divider","ConnectionType","EntityType","RelationsConfigType","MetadataType","AttributeErrorType","ownProps","isTempEntity","getRelationEditorActiveError","reltioLayoutItemToReactGridLayoutItem","y","maxHeight","isStatic","w","h","minW","minH","maxW","maxH","static","reactGridLayoutItemToReltioLayoutItem","reactGridLayoutToReltioLayout","layout","getReltioLayoutItemById","curry","updateExtraPropsInLayoutItem","mergeAll","pick","copyPropsFromPreviousLayout","oldReltioLayout","reltioLayout","layoutItem","defaultTo","__","gridLayout","borderRadius","transitionDuration","userSelect","transitionProperty","willChange","pointerEvents","transition","backgroundImage","svg2Url","backgroundRepeat","backgroundOrigin","visibility","gridFullscreen","overflowY","ReltioGridLayout","views","layoutOptions","onLayoutChanged","draggableHandle","LayoutItem","onRemove","onDrop","droppingItem","isDroppable","fullscreenItemId","setFullscreenItemId","setWidth","cols","processedLayout","reltioLayoutToReactGridLayout","onReltioLayoutChanged","onToggleFullscreen","prevId","isFullscreenEnabled","onItemHeightResize","layoutId","isLayoutChanged","newLayout","newHeight","options","ceil","calcHeight","refreshMode","refreshRate","onResize","innerRef","autoSize","onLayoutChange","isResizable","isDraggable","isItemFullscreen","autosizeComponent","autosizing","AutosizeComponent","layoutItemId","handleHeight","layoutItemConfig","fullscreen","isFullscreen","onConfigChanged","identity","memo","MapControlContainer","controlElement","setControlElement","controlDiv","document","createElement","divIndex","controls","removeAt","classList","add","createPortal","viewBox","xmlns","d","fill","stroke","strokeWidth","fillRule","xmlnsXlink","xlinkHref","mask","fillOpacity","ButtonWithTooltip","withTooltip","TopRightMapControls","drawingMode","drawingModes","hasActiveOverlay","onDrawingModeChanged","onClearOverlay","changeDrawingModeTo","HighlightOff","Icon","MAP_DRAWING_MODES","RadiusIcon","DrawIcon","getIcon","alignSelf","checkbox","TopCenterMapControls","isSearchOnMapMove","onChangeIsSearchOnMapMove","FormControlLabel","control","Checkbox","checked","event","getMapBoundsPolygon","bounds","getBounds","ne","getNorthEast","sw","getSouthWest","neLat","lat","neLng","lng","swLat","swLng","additionalPoint1","additionalPoint2","center","getCenter","getDrawingMode","window","google","maps","drawing","OverlayType","CIRCLE","POLYGON","fitMapBoundsForOverlay","overlay","existingBounds","LatLngBounds","extend","LatLng","fitBounds","popper","hoveredMarkerIcon","markerIcon","marker","popperAnchor","hovered","setHovered","activeEntityUri","useContext","EntityMarkerContext","pathEq","point","setHoveredDebounced","debounce","onMouseOver","onMouseOut","handleClick","Popper","anchorEl","open","modal","placement","url","scaledSize","Size","visible","alignBottom","pane","pixelOffset","closeBoxURL","enableEventPropagation","disableAutoPan","mapControlContainer","libraries","ReltioMap","markers","mapKey","defaultZoom","defaultCenter","loadingElement","isSearchEnabled","activeOverlay","overlayOptions","markerClusterer","markerClustererOptions","mapOptions","mapContainerClassName","onMapBoundsChanged","onOverlayUpdated","onMarkerClicked","isLoaded","loadError","useJsApiLoader","googleMapsApiKey","mapMoveEndTimer","setMap","polygon","setPolygon","setDrawingMode","prevMarkers","usePrevious","prevActiveOverlay","apiIsLoaded","MAP_MINIMUM_SCALE_RADIUS","fitMapBoundsForMarkers","useFitMapBounds","allOverlayOptions","DEFAULT_OVERLAY_OPTIONS","googleMapOptions","DEFAULT_GOOGLE_MAP_OPTIONS","handleChangeIsSearchOnMapMove","handleMapMoveStart","handleMapMoveEnd","handleMapIdle","handleOverlayChange","propOverlay","stateOverlay","isEmpty","typeActions","getPath","getArray","latlng","radius","getRadius","data","handleOverlayComplete","handleClearOverlay","renderMarkers","clusterer","mapTypeId","MapTypeId","ROADMAP","onLoad","zoom","onZoomChanged","onDragStart","onIdle","ControlPosition","TOP_RIGHT","TOP_CENTER","editable","onMouseUp","onDragEnd","onPolygonComplete","onCircleComplete","drawingControl","circleOptions","polygonOptions","attributesContainer","header","noCaption","noData","caption","excludeUris","includeUris","attributesCount","pivotingAttributes","useSelector","mdm","filteredAttrTypes","getFilteredAttrTypes","isShowAttributeList","getAttributesListForReadMode","values","PivotingAttributeContext","BasicView","FacetViewHeader","drawLines","pinnedAttributes","useDispatch","ViewIdContext","userRoles","pinnedAttributeUris","getPinnedAttributesForUser","PinnedAttributesContext","Mode","restProps","EntityContext","isViewMode","defaultHistoryDiff","appearance","roles","tags","fixRefEntity","evolve","refEntity","wrapInArrayIfNeeded","refRelation","prepareHistorySlice","historySlice","useHistoryDiff","historyDiff","historyMode","aEntity","bEntity","History","computeEntityHistoryDiff","HistoryMode","card","withBackground","lineWrapper","line","commentsInfo","commentsIcon","infoValue","infoBlock","flag","date","mainInfo","controlsBox","controlsInRow","priority","comments","taskId","assignee","isTaskOpen","currentAssignee","getAssignees","updateAssignee","updateRequestIsInProgress","readOnly","useWorkflowAssignee","DropDownSelector","isDisabled","getOptions","hideSelectedOptions","defaultOptions","TextFieldProps","dueDate","dueDateInput","inputLabel","updateDueDate","updateTaskState","WorkflowTasksContext","workflowPath","environment","tenant","safePromise","useSafePromise","setUpdateRequestIsInProgress","canUpdateTask","useWorkflowCheckPermission","checkWorkflowPermission","isOpenTask","newValue","updateDueDateForTask","then","catch","showWorkflowError","finally","useWorkflowDueDate","DateEditor","getTime","InputProps","InputLabelProps","priorities","updatePriority","newPriority","updatePriorityForTask","WorkflowPriority","useWorkflowPriority","possibleActions","actions","actionRequestIsInProgress","loadWorkflowTasks","username","setActionRequestIsInProgress","performTaskAction","action","runTaskAction","ui","useWorkflowActions","DropDownMenuButton","buttonComponent","buttonProps","MoreVertIcon","menuId","menuItems","decorator","lineBlock","flexShrink","withLinePadding","noLine","plain","last","rowDivider","first","transparent","divider","light","taskToColor","COLORS","colorIndex","task","createdBy","createTime","displayName","step","processDefinitionDisplayName","objectURIs","processInstanceComments","dcrId","getDCRId","hash","useWorkflowColor","isExpanded","setExpanded","canViewComments","Flag","CollapseButton","CollaborationIcon","WorkflowComments","cx","cy","r","OperationTypes","DCRTypes","getOperationType","oldValue","CREATE_RELATIONSHIP","INSERT_ATTRIBUTE","ADDED","UPDATE_TAGS","UPDATE_ROLES","UPDATE_ATTRIBUTE","EDITED","DELETE_ATTRIBUTE","DELETE_RELATIONSHIP","DELETED","PIN_ATTRIBUTE","pin","PIN_DELETED","PINNED","IGNORE_ATTRIBUTE","ignored","IGNORE_DELETED","IGNORED","getOperationLabel","operation","getDataTypeDefinition","attributeType","attributeValue","allPass","DataTypes","isUrl","getAttrDataTypeDefinition","getValues","attrType","newAttrValues","pathOr","name","oldAttrValues","times","getEntityChanges","entityInfo","changes","getAttributesList","getRelationChanges","relationInfo","changeType","getRelationType","flatten","level","propOr","addRelationOperationIfNeeded","dcrAttributesFactory","complement","getNestedAttributeChange","getReferenceAttributeChange","isSpecialAttribute","is","getSimpleAttributeValue","getSimpleAttributeChange","attributeTypeList","getAttributeTypeSubAttributes","getDiffParameters","SPECIAL_ATTRIBUTES_NAMES","EntityAttrTypes","prepareStartOrEndDate","parseValue","isNaN","parseInt","isExistedValue","isExistNewValue","isExistOldValue","prepareRolesOrTags","change","getRoleLabel","diffNewValue","difference","diffOldValue","prepareAttribute","changePath","attributePath","refObjectURI","refAttributeType","generateTempUri","typePath","split","pathArray","holder","isNil","createEntityOrRelation","startDate","endDate","defaultProfilePicValue","newObject","mergeAttributesInChange","objectInfo","UPDATE_PROFILE_PIC_BY_URL","UPDATE_START_DATE","UPDATE_END_DATE","CREATE_ENTITY","linkLabel","suggestionsCount","Link","underline","field","wordBreak","fieldName","arrow","chip","ArrowRightAlt","Chip","AttributesChangesContext","React","linkContainer","disabledLink","objectsInfo","getLinkDescription","isReference","anyPass","hasPath","ifElse","currentEntityUri","objectLabel","objectUri","startObjectUri","endObjectUri","endObjectLabel","startObjectLabel","objectURI","getAttributeDescription","renderLink","isNotExist","isExist","changeLabel","attrValue","getAttributeValue","DataTypeValue","dataTypeDefinition","has","getSuggestionsCount","showMoreLink","relationsInfo","mergedEntityChanges","mergedRelationsChanges","getAttributeChanges","attributeName","concatChanges","getters","attributesTree","acc","getter","changesTree","relationsTrees","updateRelation","omit","mergeChanges","changesList","relationshipTitle","onToggle","itemsToShow","collapsedSuggestionsCount","limit","setIsExpanded","collapsedItems","visibleSuggestionsCount","useCollapsibleList","Provider","getEntitiesObjects","isEntityUri","getRelationsObjects","isRelationUri","getRelations","objectsWithChanges","createEntityRelationsObjectByEntity","relations","createEntityRelationsObjectByRelation","concatEntityRelationsObjects","mergedRelations","dcrUri","getDCRUri","dcr","groupedObjects","setGroupedObjects","setDcr","requestEntities","entityUris","Promise","resolve","getEntitiesByUris","searchOptions","defaultMaxValues","getDataChangeRequest","extractObjectsFromChangeRequest","entityObjectsWithRelations","relationsObjects","relationsObjectsWithEntity","relationsObjectsWithoutEntity","partition","relationsObjectsWithRequestedEntities","relationsObject","useChangeRequest","DcrTaskIcon","pmCard","showTransitiveMatches","showInactiveEntities","useMatchesLoader","enabled","rowsPerPage","Number","MAX_SAFE_INTEGER","page","includes","PmTaskIcon","WorkflowTaskCardsFactory","build","processType","PredefinedWorkflowProcessType","DeleteRequestTaskIcon","DefaultTaskIcon","WorkflowTaskCard","popoverPaper","simpleDropDownSelector","inputRoot","select","footer","cancelButton","AddWorkflowDialog","onClose","comment","setComment","taskType","setTaskType","isOpenSnackbar","setIsOpenSnackbar","definitions","setDefinitions","processDefinitions","manualStart","objectTypes","_entityType","filterDefinitions","useWorkflowDefinitions","processInstance","loading","setLoading","startProcessInstance","useWorkflowProcessInstance","Popover","paper","SimpleDropDownSelector","definition","TextField","hiddenLabel","multiline","Portal","body","Snackbar","autoHideDuration","message","buttonLabel","AddWorkflowButton","setAnchorEl","canStartProcess","canViewProcessDefinitions","currentTarget","Add","useWorkflowTasks","processTypes","showClosedTasks","isWorkflowEnabled","isEditableMode","canViewTasks","tasks","setTasks","setTotal","parsedProcessTypes","isArray","requests","getTasksForEntity","includeClosed","all","responses","reject","uniqBy","isRequestedTask","console","warn","payload","fillColor","strokeWeight","strokeColor","mapTypeControl","streetViewControl","fullscreenControl","InterceptHandlersContext","ProfilePerspectiveViewContext","SandboxAPIContext","getCurrentPerspectiveId","setEntityUri","showPerspective","getHeaders","async","signHandler","accessToken","headers","Authorization","validateParams","permissions","perm","parsed","protocol","host","protocolAndHost","re","RegExp","formattedPerm","replace","test","processRequest","paramObject","worker","apiPath","servicesPath","user","openSearch","workflowCheckPermission","handleRequest","request","postMessage","status","isNewUI","getAccessToken","RequestAction","sendRequestFromCustomSandbox","method","noRequestProcessor","sendApiRequest","isExternalUrl","sendWorkflowRequest","workflowRequest","processDefinitionId","searchString","startProcessFromQuery","processFromQuery","response","perspective","permission","searchState","alert","confirm","prompt","defaultText","location","reload","getWorkerURL","uiPath","processInnerHtml","setTooltip","handlersToReset","uiActions","getAttribute","uiTooltip","uiAction","handler","postEventMessage","files","readFilePromises","file","reader","FileReader","onload","lastModified","onerror","readAsArrayBuffer","getFilesWithArrayBuffer","addEventListener","removeEventListener","removeAttribute","childNodes","nodeType","resetHtml","innerText","html","setListenersToReset","setHtml","docBlock","innerHTML","isURLtoProcess","processApi","regExp","setUpQooxdooRequestInterceptor","workerRef","setRequestListeners","processApiRequest","next","requestId","nanoid","setUpQooxdooResponseInterceptor","setResponseListeners","processApiResponse","responseId","setUpRequestInterceptor","reltioPath","fakeURL","startsWith","origin","setUpResponseInterceptor","abort","json","img","iframe","a","useHtmlSanitizer","allowedAttributes","allowedTags","sanitizeHtml","sanitizeOptions","allowVulnerableTags","useAPI","listenersToReset","popupListenersToReset","setPopupListenersToReset","setVisible","popup","setPopup","customStyles","setCustomStyles","requestListeners","responseListeners","workerUrl","showSnackbarMessage","SnackbarContext","qxApi","interceptHandlers","typeSearch","isOldUI","supportedInterceptHandlers","interceptors","popupText","process","CustomAction","sanitizedHtml","getElementById","sanitizedPopup","prev","log","qooxdooRequestInterceptor","qooxdooResponseInterceptor","requestInterceptor","responseInterceptor","platform","CustomScriptPlatform","initializeWebWorker","listener","addInternalRequestInterceptor","addInternalResponseInterceptor","removeInternalRequestInterceptor","removeInternalResponseInterceptor","useCommentsEntitiesMap","setEntitiesMap","getEntities","entitiesUris","requestFilters","FilterOptions","requestOptions","activeness","ActivityFilters","getFilteredEntities","getNotFoundEntity","getEntity","addNotFoundEntities","notFoundEntities","uniqEntitiesUris","objectType","relatedObjectUris","results","getNotFoundUris","prevEntitiesMap","emptyArray","useConfigPermissions","canCreate","checkConfigPermission","ConfigPermissions","canRead","canUpdate","canDelete","buildSuggestedIds","useRelationsLoader","sorting","relationActivityFilter","isLoading","setIsLoading","dtssPath","activityFilter","globalFilter","suggested","loadRelations","requestConfig","sortBy","order","returnDates","returnObjects","ActivityFilter","offset","addGlobalFilterToQuery","configs","cond","isDataTenantEntity","getRelationsForDataTenantEntity","customerTenant","dataTenant","getRelationsForEntity","connections","isRequestSentRef","prevMode"],"sourceRoot":""}
1
+ {"version":3,"file":"4621.js","mappings":"kPAEO,MAAMA,GAAYC,E,SAAAA,GAAW,CAChCC,aAAc,CACVC,WAAY,kBACZC,YAAa,OACbC,QAAS,OAEbC,MAAO,CACHC,KAAM,YACNJ,WAAY,OACZK,SAAU,OACVC,WAAY,uBACZJ,QAAS,QACTD,YAAa,OAEjBM,eAAgB,CACZC,MAAO,mBACPC,YAAa,SCARC,EAAwB,IAA8B,IAA7B,MAACC,EAAD,SAAQC,GAAqB,EAC/D,MAAOC,EAAOC,IAAYC,EAAAA,EAAAA,UAASJ,IAC5BK,EAAQC,IAAaF,EAA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A,4BACA,OACA,eACA,YACA,SACA,YACA,cACA,cACA,gBACA,cACA,YACA,mBACA,eACA,aACA,eACA,cACA,SACA,OACA,KACA,KACA,KACA,KACA,aACA,+BACA,6BACA,WACA,oBACA,gBACA,UACA,SACA,cACA,iBACA,KACA,cACA,kBACA,KACA,MACA,YACA,IACA,KACA,KACA,KACA,KACA,eACA,mBACA,UACA,YACA,aACA,WACA,OACA,eACA,iBACA,iBACA,oBACA,QACA,aACA,aACA,eACA,eACA,cACA,cACA,OACA,mBACA,YACA,eACA,MACA,QACA,SACA,MACA,OACA,OACA,aACA,SACA,UACA,WACA,QACA,SACA,cACA,SACA,WACA,oBACA,qBACA,WACA,cACA,OACA,aACA,sBACA,mBACA,eACA,iBACA,SACA,YACA,YACA,YACA,gBACA,sBACA,iBACA,IACA,SACA,OACA,OACA,mBACA,cACA,YACA,qBACA,mBACA,UACA,SACA,SACA,KACA,KACA,QACA,OACA,kBACA,QACA,UACA,mBACA,mBACA,QACA,eACA,cACA,eACA,QACA,QACA,cACA,aACA,eACA,yBACA,0BACA,SACA,SACA,mBACA,oBACA,iBACA,kBACA,oBACA,iBACA,eACA,QACA,eACA,iBACA,cACA,SACA,UACA,UACA,cACA,kBACA,iBACA,aACA,KACA,YACA,OACA,KACA,KACA,qBACA,sBACA,UACA,eACA,gBACA,eACA,eACA,YACA,gBACA,iBACA,SACA,UACA,aACA,gBACA,gBACA,UACA,aACA,aACA,QACA,SACA,eACA,eACA,IACA,WACA,KACA,KACA,mBACA,IACA,KACA,KACA,mBACA,IACA,aAuFgC,aAAc,cAC1Ck6B,IAAK,CAAC,MAAO,SAAU,MAAO,QAAS,WACvCz+C,KAAM,CAAC,OAAQ,OACf0+C,OAAQ,CAAC,OACTC,EAAG,CAAC,SAER9hB,KAAM,CAzFN,UACA,eACA,gBACA,mBACA,QACA,MACA,SACA,UACA,OACA,UACA,WACA,OACA,OACA,QACA,IACA,SACA,OACA,gBACA,UACA,MACA,SACA,SACA,OACA,YACA,mBACA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EAAO0E,IAAKm7C,MAEtDd,GAAa,GACbvjB,EAAYmZ,EAAQ30C,IACfi8B,MAAK,IAA4B,KAA1B,YAACmkB,EAAD,MAAcviC,IAAY,EAC9BW,EAASoB,EAAAA,GAAAA,UAAAA,QAAAA,gBAA0C,CAAC/C,GAAI4B,EAAO5B,GAAIujC,YAAAA,EAAaviC,MAAAA,QAEnFue,SAAQ,KACL2iB,GAAa,SAI1B,CACCE,EACAxgC,EACAD,EACAwgC,EACAh/C,MAAAA,OALD,EAKCA,EAAQ0E,IACR1E,MAAAA,OAND,EAMCA,EAAQkgD,WACR16C,EACA05C,EACA5R,EACAuR,EACA1R,EACA3R,EACAojB,EACArjB,IAEE8kB,GAAmBx8C,EAAAA,EAAAA,SAAgB,GACzCw8C,EAAiBt8C,SAAU,GAC3BhN,EAAAA,EAAAA,YAAU,KACNspD,EAAiBt8C,SAAU,EAC3Bq7C,MACD,CAACA,IACJ,MAAMkB,GAAWvtB,EAAAA,EAAAA,GAAYt4B,GAO7B,OANA1D,EAAAA,EAAAA,YAAU,KACF0D,IAASi9B,EAAAA,IAAAA,SAAiB2oB,EAAiBt8C,SAAWu8C,IAAa7lD,IACnE4lD,EAAiBt8C,SAAU,EAC3Bq7C,OAEL,CAACA,EAAe3kD,EAAM6lD,IAClB,CAACxB,UAAAA,EAAWzI,OAAQ+I,K","sources":["webpack://@reltio/remotes/../components/src/components/ExpandableSearchInput/styles.ts","webpack://@reltio/remotes/../components/src/components/ExpandableSearchInput/ExpandableSearchInput.tsx","webpack://@reltio/remotes/../components/src/components/FacetViewHeader/styles.ts","webpack://@reltio/remotes/../components/src/components/FacetViewHeader/FacetViewHeader.tsx","webpack://@reltio/remotes/../components/src/components/HideOnShrink/HideOnShrink.js","webpack://@reltio/remotes/../components/src/components/ImportButton/styles.ts","webpack://@reltio/remotes/../components/src/components/ImportButton/ImportButton.tsx","webpack://@reltio/remotes/../components/src/components/Link/styles.js","webpack://@reltio/remotes/../components/src/components/Link/Link.tsx","webpack://@reltio/remotes/../components/src/components/ModeSwitcherSelect/styles.ts","webpack://@reltio/remotes/../components/src/components/ModeSwitcherSelect/ModeSwitcherSelect.tsx","webpack://@reltio/remotes/../components/src/components/ProfileMatchCard/styles.ts","webpack://@reltio/remotes/../components/src/components/ProfileMatchCard/ProfileMatchCard.tsx","webpack://@reltio/remotes/../components/src/components/ProfilesList/helpers.ts","webpack://@reltio/remotes/../components/src/components/ProfilesList/styles.ts","webpack://@reltio/remotes/../components/src/components/ProfilesList/index.ts","webpack://@reltio/remotes/../components/src/components/ProfilesList/ProfilesList.tsx","webpack://@reltio/remotes/../components/src/components/ReactSortableTree/utils/classnames.js","webpack://@reltio/remotes/../components/src/components/ReactSortableTree/treeNodeStyle.js","webpack://@reltio/remotes/../components/src/components/ReactSortableTree/tree-node.js","webpack://@reltio/remotes/../components/src/components/ReactSortableTree/node-renderer-default.js","webpack://@reltio/remotes/../components/src/components/ReactSortableTree/tree-placeholder.js","webpack://@reltio/remotes/../components/src/components/ReactSortableTree/placeholderRendererDefaultStyle.js","webpack://@reltio/remotes/../components/src/components/ReactSortableTree/placeholder-renderer-default.js","webpack://@reltio/remotes/../components/src/components/ReactSortableTree/utils/memoized-tree-data-utils.js","webpack://@reltio/remotes/../components/src/components/ReactSortableTree/utils/dnd-manager.js","webpack://@reltio/remotes/../components/src/components/ReactSortableTree/react-sortable-tree.js","webpack://@reltio/remotes/../components/src/components/ReactSortableTree/utils/generic-utils.js","webpack://@reltio/remotes/../components/src/components/ReactSortableTree/reactSortableTreeStyles.js","webpack://@reltio/remotes/../components/src/components/ReactSortableTree/index.js","webpack://@reltio/remotes/../components/src/components/ReactSortableTree/utils/default-handlers.js","webpack://@reltio/remotes/../components/src/components/ReactSortableTree/utils/tree-data-utils.js","webpack://@reltio/remotes/../components/src/components/RelationEditor/styles.js","webpack://@reltio/remotes/../components/src/components/RelationEditor/RelationEditor.js","webpack://@reltio/remotes/../components/src/components/RelationEditor/index.js","webpack://@reltio/remotes/../components/src/components/ReltioGridLayout/helpers.js","webpack://@reltio/remotes/../components/src/components/ReltioGridLayout/icons/ResizeIcon.svg.ts","webpack://@reltio/remotes/../components/src/components/ReltioGridLayout/styles.js","webpack://@reltio/remotes/../components/src/components/ReltioGridLayout/ReltioGridLayout.js","webpack://@reltio/remotes/../components/src/components/ReltioMap/MapControls/MapControlContainer/MapControlContrainer.tsx","webpack://@reltio/remotes/../components/src/icons/Radius.tsx","webpack://@reltio/remotes/../components/src/icons/Draw.tsx","webpack://@reltio/remotes/../components/src/components/ReltioMap/MapControls/TopRightMapControls/styles.ts","webpack://@reltio/remotes/../components/src/components/ReltioMap/MapControls/TopRightMapControls/TopRightMapControls.tsx","webpack://@reltio/remotes/../components/src/components/ReltioMap/MapControls/TopCenterMapControls/styles.ts","webpack://@reltio/remotes/../components/src/components/ReltioMap/MapControls/TopCenterMapControls/TopCenterMapControls.tsx","webpack://@reltio/remotes/../components/src/components/ReltioMap/helpers/index.ts","webpack://@reltio/remotes/../components/src/components/ReltioMap/EntityMarker/icons/marker.inline.svg.ts","webpack://@reltio/remotes/../components/src/components/ReltioMap/EntityMarker/styles.ts","webpack://@reltio/remotes/../components/src/components/ReltioMap/EntityMarker/EntityMarker.tsx","webpack://@reltio/remotes/../components/src/components/ReltioMap/EntityMarker/icons/marker-hover.inline.svg.ts","webpack://@reltio/remotes/../components/src/components/ReltioMap/styles.ts","webpack://@reltio/remotes/../components/src/components/ReltioMap/index.tsx","webpack://@reltio/remotes/../components/src/components/attributes/readMode/AttributesView/styles.ts","webpack://@reltio/remotes/../components/src/components/attributes/readMode/AttributesView/index.ts","webpack://@reltio/remotes/../components/src/components/attributes/readMode/AttributesView/AttributesView.tsx","webpack://@reltio/remotes/../components/src/components/attributes/editMode/AttributesView/styles.ts","webpack://@reltio/remotes/../components/src/components/attributes/editMode/AttributesView/AttributesView.tsx","webpack://@reltio/remotes/../components/src/components/attributes/editMode/AttributesView/index.ts","webpack://@reltio/remotes/../components/src/components/attributes/AttributesView/AttributesView.tsx","webpack://@reltio/remotes/../components/src/components/attributes/AttributesView/index.ts","webpack://@reltio/remotes/../components/src/components/history/hooks/useHistoryDiff.ts","webpack://@reltio/remotes/../components/src/components/workflow/cards/GenericWorkflowTaskCard/styles.ts","webpack://@reltio/remotes/../components/src/components/workflow/components/AssigneeSelector/AssigneeSelector.tsx","webpack://@reltio/remotes/../components/src/components/workflow/components/DueDateField/styles.ts","webpack://@reltio/remotes/../components/src/components/workflow/hooks/useWorkflowDueDate.ts","webpack://@reltio/remotes/../components/src/components/workflow/components/DueDateField/DueDateField.tsx","webpack://@reltio/remotes/../components/src/components/workflow/components/PrioritySelector/PrioritySelector.tsx","webpack://@reltio/remotes/../components/src/components/workflow/hooks/useWorkflowPriority.ts","webpack://@reltio/remotes/../components/src/components/workflow/components/TaskActions/TaskActions.tsx","webpack://@reltio/remotes/../components/src/components/workflow/hooks/useWorkflowActions.ts","webpack://@reltio/remotes/../components/src/components/workflow/components/LineDecorator/styles.ts","webpack://@reltio/remotes/../components/src/components/workflow/components/LineDecorator/LineDecorator.tsx","webpack://@reltio/remotes/../components/src/components/workflow/hooks/useWorkflowColor.ts","webpack://@reltio/remotes/../components/src/icons/CollaborationIcon.tsx","webpack://@reltio/remotes/../components/src/components/workflow/cards/GenericWorkflowTaskCard/GenericWorkflowTaskCard.tsx","webpack://@reltio/remotes/../components/src/icons/DcrTaskIcon.tsx","webpack://@reltio/remotes/../components/src/components/workflow/constants/operations.ts","webpack://@reltio/remotes/../components/src/components/workflow/components/AttributesChanges/helpers/helpers.ts","webpack://@reltio/remotes/../components/src/components/workflow/components/AttributesChanges/helpers/attributesHelpers.ts","webpack://@reltio/remotes/../components/src/components/workflow/components/AttributesChanges/helpers/mergeHelpers.ts","webpack://@reltio/remotes/../components/src/components/workflow/components/AttributesChanges/components/ShowMoreLink/styles.ts","webpack://@reltio/remotes/../components/src/components/workflow/components/AttributesChanges/components/ShowMoreLink/ShowMoreLink.tsx","webpack://@reltio/remotes/../components/src/components/workflow/components/AttributesChanges/components/ChangeView/styles.ts","webpack://@reltio/remotes/../components/src/components/workflow/components/AttributesChanges/components/ChangeView/ChangeView.tsx","webpack://@reltio/remotes/../components/src/components/workflow/components/AttributesChanges/contexts/AttributesChangesContext.tsx","webpack://@reltio/remotes/../components/src/components/workflow/components/AttributesChanges/components/DiffRenderer/styles.ts","webpack://@reltio/remotes/../components/src/components/workflow/components/AttributesChanges/components/DiffRenderer/DiffRenderer.tsx","webpack://@reltio/remotes/../components/src/components/workflow/components/AttributesChanges/components/DCRChangesList/styles.ts","webpack://@reltio/remotes/../components/src/components/workflow/components/AttributesChanges/components/DCRChangesList/DCRChangesList.tsx","webpack://@reltio/remotes/../components/src/components/workflow/components/AttributesChanges/helpers/contextHelpers.ts","webpack://@reltio/remotes/../components/src/components/workflow/components/AttributesChanges/styles.ts","webpack://@reltio/remotes/../components/src/components/workflow/components/AttributesChanges/AttributesChanges.tsx","webpack://@reltio/remotes/../components/src/components/workflow/components/AttributesChanges/hooks/useCollapsibleList.ts","webpack://@reltio/remotes/../components/src/components/workflow/helpers/dcrHelpers.ts","webpack://@reltio/remotes/../components/src/components/workflow/hooks/useChangeRequest.ts","webpack://@reltio/remotes/../components/src/components/workflow/cards/DataChangeRequestTaskCard/DataChangeRequestTaskCard.tsx","webpack://@reltio/remotes/../components/src/components/workflow/cards/PotentialMatchTaskCard/styles.ts","webpack://@reltio/remotes/../components/src/icons/PmTaskIcon.tsx","webpack://@reltio/remotes/../components/src/components/workflow/cards/PotentialMatchTaskCard/PotentialMatchTaskCard.tsx","webpack://@reltio/remotes/../components/src/icons/DefaultTaskIcon.tsx","webpack://@reltio/remotes/../components/src/icons/DeleteRequestTaskIcon.tsx","webpack://@reltio/remotes/../components/src/components/workflow/cards/WorkflowTaskCardsFactory.tsx","webpack://@reltio/remotes/../components/src/components/workflow/cards/WorkflowTaskCard.ts","webpack://@reltio/remotes/../components/src/components/workflow/components/AddWorkflowDialog/styles.ts","webpack://@reltio/remotes/../components/src/components/workflow/components/AddWorkflowDialog/AddWorkflowDialog.tsx","webpack://@reltio/remotes/../components/src/components/workflow/hooks/useWorkflowDefinitions.ts","webpack://@reltio/remotes/../components/src/components/workflow/hooks/useWorkflowProcessInstance.ts","webpack://@reltio/remotes/../components/src/components/workflow/components/AddWorkflowButton/styles.ts","webpack://@reltio/remotes/../components/src/components/workflow/components/AddWorkflowButton/AddWorkflowButton.tsx","webpack://@reltio/remotes/../components/src/components/workflow/hooks/useWorkflowTasks.ts","webpack://@reltio/remotes/../components/src/constants/map.ts","webpack://@reltio/remotes/../components/src/contexts/EntityMarkerContext/index.ts","webpack://@reltio/remotes/../components/src/contexts/InterceptHandlersContext/index.ts","webpack://@reltio/remotes/../components/src/contexts/ProfilePerspectiveViewContext/index.ts","webpack://@reltio/remotes/../components/src/contexts/SandboxAPIContext/index.ts","webpack://@reltio/remotes/../components/src/hooks/useAPI/API.ts","webpack://@reltio/remotes/../components/src/hooks/useAPI/helpers.ts","webpack://@reltio/remotes/../components/src/hooks/helpers/sanitizerOptions.ts","webpack://@reltio/remotes/../components/src/hooks/useHtmlSanitizer.ts","webpack://@reltio/remotes/../components/src/hooks/useAPI/useAPI.ts","webpack://@reltio/remotes/../components/src/hooks/useCommentsEntitiesMap.ts","webpack://@reltio/remotes/../components/src/hooks/useConfigPermissions.ts","webpack://@reltio/remotes/../components/src/hooks/useRelationsLoader.ts"],"sourcesContent":["import {makeStyles} from '@material-ui/core/styles';\n\nexport const useStyles = makeStyles({\n searchButton: {\n marginLeft: 'auto !important',\n marginRight: '-4px',\n padding: '8px'\n },\n input: {\n flex: '1 0 200px',\n marginLeft: '70px',\n fontSize: '14px',\n background: 'rgba(0,0,0,0.03) 2px',\n padding: '4px 0',\n marginRight: '4px'\n },\n startAdornment: {\n color: 'rgba(0,0,0,0.54)',\n paddingLeft: '8px'\n }\n});\n","import React, {useState, useEffect} from 'react';\nimport i18n from 'ui-i18n';\nimport {always, F, pipe, propEq, T, tap, trim, when} from 'ramda';\nimport CloseIcon from '@material-ui/icons/Close';\nimport {IconButton as IconButton} from '@material-ui/core';\nimport {Input as Input} from '@material-ui/core';\nimport {InputAdornment as InputAdornment} from '@material-ui/core';\nimport SearchIcon from '@material-ui/icons/Search';\nimport {SmallIconButton} from '../SmallIconButton';\nimport {getValue} from '../../core';\n\nimport {useStyles} from './styles';\n\ntype Props = {\n query: string;\n onChange: (value: string) => void;\n};\n\nexport const ExpandableSearchInput = ({query, onChange}: Props) => {\n const [value, setValue] = useState(query);\n const [isOpen, setIsOpen] = useState(!!query);\n useEffect(() => {\n setValue(query);\n }, [query]);\n const styles = useStyles();\n const hasValue = value && value.length;\n\n return isOpen ? (\n <Input\n className={styles.input}\n value={value}\n autoFocus={true}\n placeholder={i18n.text('Search')}\n disableUnderline={true}\n onChange={pipe(getValue, setValue)}\n startAdornment={\n <InputAdornment position=\"start\">\n <SearchIcon className={styles.startAdornment} />\n </InputAdornment>\n }\n endAdornment={\n <InputAdornment position=\"end\">\n {hasValue && (\n <SmallIconButton\n size=\"S\"\n icon={CloseIcon}\n onClick={pipe(F, setIsOpen, always(''), tap(onChange), setValue)}\n />\n )}\n </InputAdornment>\n }\n onKeyPress={when(propEq('key', 'Enter'), pipe(always(value), trim, onChange))}\n />\n ) : (\n <IconButton className={styles.searchButton} onClick={pipe(T, setIsOpen)}>\n <SearchIcon />\n </IconButton>\n );\n};\n","import {makeStyles} from '@material-ui/core/styles';\n\nexport const useStyles = makeStyles({\n container: {\n padding: '0 16px',\n minHeight: '48px'\n },\n title: {\n fontSize: '16px',\n lineHeight: '19px',\n paddingTop: '16px',\n paddingBottom: '13px',\n justifyContent: 'flex-start'\n }\n});\n","import React from 'react';\nimport classnames from 'classnames';\nimport BasicViewHeader from '../BasicViewHeader/BasicViewHeader';\nimport {useStyles} from './styles';\n\ntype Props = {\n className?: string;\n title: string;\n children?: React.ReactNode;\n};\n\nconst FacetViewHeader = ({className, title, children}: Props) => {\n const styles = useStyles();\n return (\n <BasicViewHeader title={title} classes={{root: classnames(styles.container, className), title: styles.title}}>\n {children}\n </BasicViewHeader>\n );\n};\n\nexport default FacetViewHeader;\n","import PropTypes from 'prop-types';\nimport React from 'react';\nimport ReactResizeDetector from 'react-resize-detector';\n\nconst EmptyStub = () => <div style={{display: 'none'}} />;\n\nconst HideOnShrink = ({widthToHide, children}) => (\n <ReactResizeDetector\n handleWidth={true}\n render={({width}) => (width > widthToHide ? <>{children}</> : <EmptyStub />)}\n />\n);\n\nHideOnShrink.propTypes = {\n children: PropTypes.node,\n widthToHide: PropTypes.number.isRequired\n};\n\nexport default HideOnShrink;\n","import {makeStyles} from '@material-ui/core/styles';\n\nexport const useStyles = makeStyles({\n root: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: '24px',\n height: '24px'\n },\n check: {\n color: '#8CC152'\n }\n});\n","import React from 'react';\n\nimport {CircularProgress as CircularProgress} from '@material-ui/core';\nimport {SmallIconButtonWithTooltip} from '../SmallIconButton';\nimport CloudDownloadIcon from '@material-ui/icons/CloudDownload';\nimport DoneIcon from '@material-ui/icons/Done';\nimport {noop} from '../../core';\nimport classnames from 'classnames';\nimport {useStyles} from './styles';\n\nexport enum ImportModes {\n INIT = 1,\n PROGRESS = 2,\n SUCCESS = 3,\n DONE = 4\n}\n\ntype Props = {\n tooltip?: string;\n onClick?: () => void;\n classes?: Partial<Record<'root' | 'spinner' | 'button' | 'check', string>>;\n mode?: ImportModes;\n};\n\nconst ImportButton = ({classes = {}, tooltip = '', onClick = noop, mode = ImportModes.INIT}: Props) => {\n const styles = useStyles();\n\n const renderCurrentMode = () => {\n switch (mode) {\n case ImportModes.INIT: {\n return (\n <SmallIconButtonWithTooltip\n className={classes.button}\n size={'M'}\n tooltipTitle={tooltip}\n icon={CloudDownloadIcon}\n onClick={onClick}\n />\n );\n }\n case ImportModes.PROGRESS:\n return <CircularProgress className={classes.spinner} size={24} />;\n case ImportModes.SUCCESS:\n return <DoneIcon className={classnames(styles.check, classes.check)} />;\n default:\n return null;\n }\n };\n return <div className={classnames(styles.root, classes.root)}>{renderCurrentMode()}</div>;\n};\n\nexport default ImportButton;\n","import {makeStyles} from '@material-ui/core/styles';\n\nexport const useStyles = makeStyles({\n link: {\n textDecoration: 'inherit',\n color: 'inherit',\n '&:visited': {\n textDecoration: 'inherit',\n color: 'inherit'\n }\n }\n});\n","import React, {ReactNode} from 'react';\nimport {useStyles} from './styles';\n\ntype LinkProps = {\n to?: string;\n children?: ReactNode;\n onClick?: () => void;\n};\nconst Link = ({to, children, onClick}: LinkProps) => {\n const styles = useStyles();\n return (\n <a\n href={to}\n onClick={(e) => {\n if (onClick) {\n onClick();\n e.stopPropagation();\n e.preventDefault();\n }\n }}\n className={styles.link}\n >\n {children}\n </a>\n );\n};\n\nexport default Link;\n","import {makeStyles} from '@material-ui/core/styles';\n\nconst MAX_WIDTH_SELECT = 200;\nconst SELECT_PADDING_RIGHT = 32;\nconst SELECT_PADDING_LEFT = 12;\nconst CALCULATED_MAX_WIDTH_SELECT = MAX_WIDTH_SELECT - SELECT_PADDING_LEFT - SELECT_PADDING_RIGHT;\n\nexport const useStyles = makeStyles((theme) => ({\n root: {\n maxWidth: CALCULATED_MAX_WIDTH_SELECT,\n paddingTop: '9px',\n paddingBottom: '9px'\n },\n outlined: {\n paddingRight: SELECT_PADDING_RIGHT,\n paddingLeft: SELECT_PADDING_LEFT\n },\n arrowIcon: {\n fontSize: '18px',\n top: 'calc(50% - 9px)',\n right: '12px',\n color: theme.palette.text.secondary\n },\n currentValue: {\n display: 'flex',\n alignItems: 'center'\n },\n currentValueIcon: {\n fontSize: '18px',\n marginRight: '8px',\n color: theme.palette.text.secondary\n },\n currentValueText: {\n fontSize: '14px',\n lineHeight: '16px',\n textTransform: 'uppercase',\n fontWeight: 500,\n color: theme.palette.text.primary,\n whiteSpace: 'nowrap',\n textOverflow: 'ellipsis',\n overflow: 'hidden'\n },\n menuItem: {\n padding: '9px 12px 7px'\n },\n firstMenuItemButton: {\n borderTop: '1px solid #e4e4e4'\n },\n menuItemInner: {\n display: 'flex',\n alignItems: 'flex-start'\n },\n menuItemIcon: {\n fontSize: '18px',\n color: theme.palette.text.secondary,\n marginRight: '9px'\n },\n menuItemLabel: {\n fontSize: '14px',\n lineHeight: '16px',\n fontWeight: 500,\n color: theme.palette.text.primary\n },\n menuItemDescription: {\n fontSize: '10px',\n lineHeight: '16px',\n color: theme.palette.text.secondary\n }\n}));\n","import React from 'react';\nimport {propEq} from 'ramda';\nimport classnames from 'classnames';\nimport {Select as Select} from '@material-ui/core';\nimport {MenuItem as MenuItem} from '@material-ui/core';\nimport {Box as Box} from '@material-ui/core';\nimport {Typography as Typography} from '@material-ui/core';\nimport {Tooltip as Tooltip} from '@material-ui/core';\nimport {useStyles} from './styles';\n\ntype Option = {\n label: string;\n value: string;\n description: string;\n icon: React.ElementType;\n};\n\ntype Button = Option & {\n onClick: (value: string) => void;\n};\n\ntype ModeSwitcherSelectProps = {\n optionsGroup: Option[];\n buttonsGroup: Button[];\n value: string;\n onChange?: (value: string) => void;\n disabled?: boolean;\n};\n\ntype MenuItemProps = React.ComponentPropsWithoutRef<typeof MenuItem>;\n\nconst isButton = (value: Option | Button): value is Button => 'onClick' in value;\n\nexport const ModeSwitcherSelect = ({\n optionsGroup,\n buttonsGroup,\n value,\n onChange,\n disabled = false\n}: ModeSwitcherSelectProps) => {\n const styles = useStyles();\n\n const handleChange = (e: React.ChangeEvent<{value: string}>) => {\n const {value} = e.target;\n const isOption = optionsGroup.some(propEq('value', value));\n if (isOption) onChange(value);\n };\n\n const renderMenuItems = (items: (Option | Button)[]) => {\n const firstButtonIdx = items.findIndex(isButton);\n\n return items.map((item, idx) => {\n const {value, description, icon: IconComponent} = item;\n\n const menuItemProps: MenuItemProps = {\n value: value,\n className: styles.menuItem\n };\n\n if (isButton(item)) {\n menuItemProps.onClick = () => item.onClick(value);\n menuItemProps.className = classnames(menuItemProps.className, {\n [styles.firstMenuItemButton]: idx === firstButtonIdx\n });\n }\n\n return (\n <MenuItem key={value} {...menuItemProps} data-reltio-id={`reltio-profile-select-mode-${value}`}>\n <Box className={styles.menuItemInner}>\n <IconComponent className={styles.menuItemIcon} />\n <Box>\n <Typography className={styles.menuItemLabel}>{value}</Typography>\n <Typography className={styles.menuItemDescription}>{description}</Typography>\n </Box>\n </Box>\n </MenuItem>\n );\n });\n };\n\n return (\n <Select\n classes={{\n root: styles.root,\n icon: styles.arrowIcon,\n outlined: styles.outlined\n }}\n value={value}\n onChange={handleChange}\n variant=\"outlined\"\n renderValue={(value) => {\n const {icon: IconComponent, label = value} = optionsGroup.find(propEq('value', value)) || {};\n return (\n <Box className={styles.currentValue}>\n {IconComponent && <IconComponent className={styles.currentValueIcon} />}\n <Tooltip title={label}>\n <Typography className={styles.currentValueText}>{label}</Typography>\n </Tooltip>\n </Box>\n );\n }}\n MenuProps={{\n anchorOrigin: {\n vertical: 'bottom',\n horizontal: 'right'\n },\n transformOrigin: {\n vertical: 'top',\n horizontal: 'right'\n },\n getContentAnchorEl: null\n }}\n disabled={disabled}\n data-reltio-id=\"reltio-profile-select-mode\"\n >\n {renderMenuItems([...optionsGroup, ...buttonsGroup])}\n </Select>\n );\n};\n","import {makeStyles} from '@material-ui/core/styles';\n\nexport const useStyles = makeStyles({\n root: {\n display: 'flex',\n flexDirection: 'column',\n paddingRight: '12px',\n paddingTop: '8px',\n paddingBottom: '8px',\n '& + &': {\n borderTop: '1px solid rgba(0,0,0, 0.12)'\n }\n },\n profileCardWrapper: {\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center',\n gap: '4px'\n },\n profileCardContainer: {\n flexGrow: 1,\n paddingBottom: '8px',\n paddingTop: '8px'\n },\n rulesContainer: {\n paddingLeft: '52px',\n marginBottom: '8px'\n }\n});\n","import React from 'react';\nimport {Entity, Metadata, Match} from '@reltio/mdm-sdk';\nimport {useStyles} from './styles';\nimport ProfileCard from '../ProfileCard/ProfileCard';\nimport MatchRulesBlock from '../MatchRulesBlock/MatchRulesBlock';\nimport classnames from 'classnames';\n\ntype Props = {\n entitiesMap: {\n [key: string]: Pick<Entity, 'uri' | 'type' | 'label'>;\n };\n entity: Entity;\n match: Match;\n metadata: Metadata;\n children?: React.ReactNode;\n className?: string;\n};\n\nexport const ProfileMatchCard = ({children, entitiesMap, entity, match, metadata, className}: Props) => {\n const styles = useStyles();\n return (\n <div className={classnames(styles.root, className)}>\n <div className={styles.profileCardWrapper}>\n <ProfileCard entity={match.object} classes={{container: styles.profileCardContainer}} />\n {children}\n </div>\n <div className={styles.rulesContainer}>\n {match.matchRules && (\n <MatchRulesBlock match={match} metadata={metadata} entitiesMap={entitiesMap} entity={entity} />\n )}\n </div>\n </div>\n );\n};\n","export const scroll = (element) => element && element.scrollIntoView({block: 'end', behavior: 'smooth'});\n\nexport const clearScrollTimer = (scrollTimer) => {\n if (scrollTimer) {\n clearTimeout(scrollTimer);\n }\n};\n\nexport const isScrolledIntoView = (element, scrollableParent) => {\n if (element && scrollableParent) {\n const elemTop = element.offsetTop;\n const elemBottom = element.offsetTop + element.clientHeight;\n const {clientHeight, scrollTop} = scrollableParent;\n return elemTop >= 0 && elemBottom > scrollTop && elemBottom < scrollTop + clientHeight;\n }\n};\n","import {fade, makeStyles} from '@material-ui/core/styles';\nimport {Theme} from '@material-ui/core';\n\nexport const useStyles = makeStyles(\n (\n theme: Theme & {\n inactiveBackground: string;\n inactiveHoverBackground: string;\n inactiveSelectedBackground: string;\n inactiveSelectedHoverBackground: string;\n }\n ) => {\n return {\n '@keyframes animate': {\n from: {background: 'transparent'},\n '66%': {background: '#f2e68e'},\n '100%': {background: 'transparent'}\n },\n\n highlighted: {\n animationName: '$animate',\n animationDuration: '3s',\n animationIterationCount: 1\n },\n\n item: {\n display: 'flex',\n minHeight: '40px',\n borderBottom: '1px solid rgba(0, 0, 0, 0.1)',\n flexDirection: 'row',\n\n '&:after': {\n // IE flex & min-height workaround\n content: '',\n minHeight: 'inherit',\n fontSize: 0\n },\n\n '&:hover': {\n backgroundColor: 'rgba(0, 0, 0, 0.03)'\n }\n },\n\n clickable: {\n cursor: 'pointer'\n },\n\n selected: {\n background: fade(theme.palette.primary.main, 0.12),\n '&:hover': {\n background: fade(theme.palette.primary.main, 0.24)\n }\n },\n\n inactive: {\n background: theme.inactiveBackground,\n\n '&:hover': {\n background: theme.inactiveHoverBackground\n },\n\n '&$selected': {\n background: theme.inactiveSelectedBackground,\n\n '&:hover': {\n background: theme.inactiveSelectedHoverBackground\n }\n }\n },\n\n justImported: {\n backgroundColor: '#FFFBEB !important'\n },\n\n avatar: {\n marginLeft: '20px'\n },\n\n image: {\n height: '32px',\n width: '32px',\n marginTop: '8px',\n marginBottom: '7px'\n },\n\n info: {\n marginLeft: '20px',\n flexGrow: 1,\n display: 'flex',\n flexDirection: 'column',\n justifyContent: 'center',\n fontSize: '13px',\n width: '100%',\n overflow: 'hidden',\n overflowWrap: 'break-word',\n wordWrap: 'break-word' // for IE\n },\n\n label: {\n fontSize: '13px',\n lineHeight: '15px',\n fontWeight: 500,\n color: theme.palette.primary.main,\n marginRight: '17px',\n textDecoration: 'none'\n },\n\n secondaryLabel: {\n marginRight: '12px'\n },\n\n businessCard: {\n color: 'rgba(0, 0, 0, 0.54)'\n },\n\n secondRow: {\n display: 'flex',\n marginTop: '2px',\n alignItems: 'center',\n color: 'rgba(0, 0, 0, 0.54)',\n fontSize: '12px'\n }\n };\n }\n);\n","import {connect} from 'react-redux';\nimport mdmModule from '@reltio/mdm-module';\nimport ProfilesList from './ProfilesList';\n\nconst mapStateToProps = (state) => {\n return {\n metadata: mdmModule.selectors.getMetadata(state)\n };\n};\n\nexport {ProfilesList};\n\nexport default connect(mapStateToProps)(ProfilesList);\n","import React, {useRef} from 'react';\nimport classnames from 'classnames';\nimport {prop} from 'ramda';\nimport {\n Entity,\n getBusinessCardAttributesText,\n getEntityId,\n getEntityUriForLink,\n getLabel,\n isActiveObject,\n Metadata\n} from '@reltio/mdm-sdk';\nimport EntityTypeBadge from '../EntityTypeBadge/EntityTypeBadge';\nimport EntityUriLink from '../EntityUriLink/EntityUriLink';\nimport EntityAvatar from '../EntityAvatar/EntityAvatar';\nimport {ImportModes} from '../ImportButton/ImportButton';\nimport {clearScrollTimer, isScrolledIntoView, scroll} from './helpers';\nimport {useDidUpdateEffect} from '../../hooks';\n\nimport {useStyles} from './styles';\n\nconst SECOND_SCROLL_PAUSE = 1000;\n\ntype Props = {\n metadata: Metadata;\n entities: Entity[];\n entityToHighlight?: string;\n selectedEntityUri?: string;\n onEntityClick?: (entityUri: string) => void;\n onEntityHover?: (entityUri: string) => void;\n entitiesImportStatus?: {entityUri: string};\n entityButtonsRenderer?: (entity: Entity) => void;\n};\n\nconst ProfilesList = ({\n entities,\n metadata,\n entityToHighlight,\n selectedEntityUri,\n onEntityClick,\n onEntityHover,\n entitiesImportStatus,\n entityButtonsRenderer\n}: Props) => {\n const styles = useStyles();\n\n const list = useRef(null);\n const scrollTimer = useRef(null);\n\n useDidUpdateEffect(() => {\n if (entityToHighlight) {\n const element = list.current?.querySelectorAll(`[data-entity-uri='${entityToHighlight}']`);\n clearScrollTimer(scrollTimer.current);\n if (element?.length > 0) {\n const scrollableParent = list.current?.parentElement;\n if (!isScrolledIntoView(element[0], scrollableParent)) {\n scroll(element[0]);\n scrollTimer.current = setTimeout(() => {\n if (!isScrolledIntoView(element[0], scrollableParent)) {\n scroll(element[0]);\n }\n }, SECOND_SCROLL_PAUSE);\n }\n }\n }\n\n return () => {\n clearScrollTimer(scrollTimer.current);\n };\n }, [entityToHighlight]);\n\n return (\n <div ref={list}>\n {(entities || []).map((entity) => {\n const label = getLabel(entity.label);\n const secondaryLabel = entity.secondaryLabel;\n const businessCardText = getBusinessCardAttributesText(metadata, entity);\n const isActive = isActiveObject(entity);\n const entityUri = entity.uri;\n const entityUriForLink = getEntityUriForLink(entity);\n\n const importStatus = prop(entityUri, entitiesImportStatus);\n\n return (\n <div\n key={entityUri}\n className={classnames(styles.item, {\n [styles.clickable]: !!onEntityClick,\n [styles.selected]: entityUri === selectedEntityUri,\n [styles.highlighted]: entityUri === entityToHighlight,\n [styles.inactive]: !isActive,\n [styles.justImported]: importStatus === ImportModes.SUCCESS\n })}\n onClick={onEntityClick ? () => onEntityClick(entityUri) : undefined}\n onMouseEnter={onEntityHover ? () => onEntityHover(entityUri) : undefined}\n onMouseLeave={onEntityHover ? () => onEntityHover(null) : undefined}\n data-entity-uri={entityUri}\n >\n <EntityAvatar entity={entity} avatarClassName={styles.avatar} imageClassName={styles.image} />\n <div className={styles.info}>\n <div>\n <EntityUriLink value={entityUriForLink} className={styles.label}>\n {label}\n </EntityUriLink>\n {secondaryLabel && <span className={styles.secondaryLabel}>{secondaryLabel} </span>}\n {businessCardText && <span className={styles.businessCard}>{businessCardText}</span>}\n </div>\n <div className={styles.secondRow}>\n <EntityTypeBadge entity={entity} />\n <div>{getEntityId(entity)}</div>\n </div>\n </div>\n {entityButtonsRenderer && entityButtonsRenderer(entity)}\n </div>\n );\n })}\n </div>\n );\n};\n\nexport default ProfilesList;\n","// very simple className utility for creating a classname string...\n// Falsy arguments are ignored:\n//\n// const active = true\n// const className = classnames(\n// \"class1\",\n// !active && \"class2\",\n// active && \"class3\"\n// ); // returns -> class1 class3\";\n//\nexport default function classnames(...classes) {\n // Use Boolean constructor as a filter callback\n // Allows for loose type truthy/falsey checks\n // Boolean(\"\") === false;\n // Boolean(false) === false;\n // Boolean(undefined) === false;\n // Boolean(null) === false;\n // Boolean(0) === false;\n // Boolean(\"classname\") === true;\n return classes.filter(Boolean).join(' ');\n}\n","import {makeStyles} from '@material-ui/core/styles';\n\nexport const useStyles = makeStyles(() => ({\n '@global .rst__node': {\n minWidth: '100%',\n whiteSpace: 'nowrap',\n position: 'relative',\n textAlign: 'left'\n },\n\n '@global .rst__node.rst__rtl': {\n textAlign: 'right'\n },\n\n '@global .rst__nodeContent': {\n position: 'absolute',\n top: 0,\n bottom: 0\n },\n\n /* ==========================================================================\n Scaffold\n \n Line-overlaid blocks used for showing the tree structure\n ========================================================================== */\n '@global .rst__lineBlock, .rst__absoluteLineBlock': {\n height: '100%',\n position: 'relative',\n display: 'inline-block'\n },\n\n '@global .rst__absoluteLineBlock': {\n position: 'absolute',\n top: 0\n },\n\n '@global .rst__lineHalfHorizontalRight::before, .rst__lineFullVertical::after, .rst__lineHalfVerticalTop::after, .rst__lineHalfVerticalBottom::after': {\n position: 'absolute',\n content: '',\n backgroundColor: 'black'\n },\n\n /**\n * +-----+\n * | |\n * | +--+\n * | |\n * +-----+\n */\n '@global .rst__lineHalfHorizontalRight::before': {\n height: '1px',\n top: '50%',\n right: 0,\n width: '50%'\n },\n\n '@global .rst__rtl.rst__lineHalfHorizontalRight::before': {\n left: 0,\n right: 'initial'\n },\n\n /**\n * +--+--+\n * | | |\n * | | |\n * | | |\n * +--+--+\n */\n '@global .rst__lineFullVertical::after, .rst__lineHalfVerticalTop::after, .rst__lineHalfVerticalBottom::after': {\n width: '1px',\n left: '50%',\n top: 0,\n height: '100%'\n },\n\n /**\n * +--+--+\n * | | |\n * | | |\n * | | |\n * +--+--+\n */\n '@global .rst__rtl.rst__lineFullVertical::after, .rst__rtl.rst__lineHalfVerticalTop::after, .rst__rtl.rst__lineHalfVerticalBottom::after': {\n right: '50%',\n left: 'initial'\n },\n\n /**\n * +-----+\n * | | |\n * | + |\n * | |\n * +-----+\n */\n '@global .rst__lineHalfVerticalTop::after': {\n height: '50%'\n },\n\n /**\n * +-----+\n * | |\n * | + |\n * | | |\n * +-----+\n */\n '@global .rst__lineHalfVerticalBottom::after': {\n top: 'auto',\n bottom: 0,\n height: '50%'\n },\n\n /* Highlight line for pointing to dragged row destination\n ========================================================================== */\n /**\n * +--+--+\n * | | |\n * | | |\n * | | |\n * +--+--+\n */\n '@global .rst__highlightLineVertical': {\n zIndex: 3\n },\n '@global .rst__highlightLineVertical::before': {\n position: 'absolute',\n content: '',\n backgroundColor: '#36c2f6',\n width: '8px',\n marginLeft: '-4px',\n left: '50%',\n top: 0,\n height: '100%'\n },\n\n '@global .rst__rtl.rst__highlightLineVertical::before': {\n marginLeft: 'initial',\n marginRight: '-4px',\n left: 'initial',\n right: '50%'\n },\n\n '@keyframes arrow-pulse': {\n '0%': {\n transform: 'translate(0, 0)',\n opacity: 0\n },\n '30%': {\n transform: 'translate(0, 300%)',\n opacity: 1\n },\n '70%': {\n transform: 'translate(0, 700%)',\n opacity: 1\n },\n '100%': {\n transform: 'translate(0, 1000%)',\n opacity: 0\n }\n },\n '@global .rst__highlightLineVertical::after': {\n content: '',\n position: 'absolute',\n height: 0,\n marginLeft: '-4px',\n left: '50%',\n top: 0,\n borderLeft: '4px solid transparent',\n borderRight: '4px solid transparent',\n borderTop: '4px solid white',\n animation: 'arrow-pulse 1s infinite linear both'\n },\n\n '@global .rst__rtl.rst__highlightLineVertical::after': {\n marginLeft: 'initial',\n marginRight: '-4px',\n right: '50%',\n left: 'initial'\n },\n\n /**\n * +-----+\n * | |\n * | +--+\n * | | |\n * +--+--+\n */\n '@global .rst__highlightTopLeftCorner::before': {\n zIndex: 3,\n content: '',\n position: 'absolute',\n borderTop: 'solid 8px #36c2f6',\n borderLeft: 'solid 8px #36c2f6',\n boxSizing: 'border-box',\n height: 'calc(50% + 4px)',\n top: '50%',\n marginTop: '-4px',\n right: 0,\n width: 'calc(50% + 4px)'\n },\n\n '@global .rst__rtl.rst__highlightTopLeftCorner::before': {\n borderRight: 'solid 8px #36c2f6',\n borderLeft: 'none',\n left: 0,\n right: 'initial'\n },\n\n /**\n * +--+--+\n * | | |\n * | | |\n * | +->|\n * +-----+\n */\n '@global .rst__highlightBottomLeftCorner': {\n zIndex: 3\n },\n '@global .rst__highlightBottomLeftCorner::before': {\n content: '',\n position: 'absolute',\n borderBottom: 'solid 8px #36c2f6',\n borderLeft: 'solid 8px #36c2f6',\n boxSizing: 'border-box',\n height: 'calc(100% + 4px)',\n top: 0,\n right: '12px',\n width: 'calc(50% - 8px)'\n },\n\n '@global .rst__rtl.rst__highlightBottomLeftCorner::before': {\n borderRight: 'solid 8px #36c2f6',\n borderLeft: 'none',\n left: '12px',\n right: 'initial'\n },\n\n '@global .rst__highlightBottomLeftCorner::after': {\n content: '',\n position: 'absolute',\n height: 0,\n right: 0,\n top: '100%',\n marginTop: '-12px',\n borderTop: '12px solid transparent',\n borderBottom: '12px solid transparent',\n borderLeft: '12px solid #36c2f6'\n },\n\n '@global .rst__rtl.rst__highlightBottomLeftCorner::after': {\n left: 0,\n right: 'initial',\n borderRight: '12px solid #36c2f6',\n borderLeft: 'none'\n }\n}));\n","import React, {Children, cloneElement} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from './utils/classnames';\nimport {useStyles} from './treeNodeStyle';\n\nconst TreeNode = ({\n children,\n listIndex,\n swapFrom,\n swapLength,\n swapDepth,\n scaffoldBlockPxWidth,\n lowerSiblingCounts,\n connectDropTarget,\n isOver,\n draggedNode,\n canDrop,\n treeIndex,\n /* eslint-disable */\n treeId, // Delete from otherProps\n getPrevRow, // Delete from otherProps\n node, // Delete from otherProps\n path, // Delete from otherProps\n /* eslint-enable */\n rowDirection,\n ...otherProps\n}) => {\n useStyles();\n const rowDirectionClass = rowDirection === 'rtl' ? 'rst__rtl' : null;\n\n // Construct the scaffold representing the structure of the tree\n const scaffoldBlockCount = lowerSiblingCounts.length;\n const scaffold = [];\n lowerSiblingCounts.forEach((lowerSiblingCount, i) => {\n let lineClass = '';\n if (lowerSiblingCount > 0) {\n // At this level in the tree, the nodes had sibling nodes further down\n\n if (listIndex === 0) {\n // Top-left corner of the tree\n // +-----+\n // | |\n // | +--+\n // | | |\n // +--+--+\n lineClass = 'rst__lineHalfHorizontalRight rst__lineHalfVerticalBottom';\n } else if (i === scaffoldBlockCount - 1) {\n // Last scaffold block in the row, right before the row content\n // +--+--+\n // | | |\n // | +--+\n // | | |\n // +--+--+\n lineClass = 'rst__lineHalfHorizontalRight rst__lineFullVertical';\n } else {\n // Simply connecting the line extending down to the next sibling on this level\n // +--+--+\n // | | |\n // | | |\n // | | |\n // +--+--+\n lineClass = 'rst__lineFullVertical';\n }\n } else if (listIndex === 0) {\n // Top-left corner of the tree, but has no siblings\n // +-----+\n // | |\n // | +--+\n // | |\n // +-----+\n lineClass = 'rst__lineHalfHorizontalRight';\n } else if (i === scaffoldBlockCount - 1) {\n // The last or only node in this level of the tree\n // +--+--+\n // | | |\n // | +--+\n // | |\n // +-----+\n lineClass = 'rst__lineHalfVerticalTop rst__lineHalfHorizontalRight';\n }\n\n scaffold.push(\n <div\n key={`pre_${1 + i}`}\n style={{width: scaffoldBlockPxWidth}}\n className={classnames('rst__lineBlock', lineClass, rowDirectionClass)}\n />\n );\n\n if (treeIndex !== listIndex && i === swapDepth) {\n // This row has been shifted, and is at the depth of\n // the line pointing to the new destination\n let highlightLineClass = '';\n\n if (listIndex === swapFrom + swapLength - 1) {\n // This block is on the bottom (target) line\n // This block points at the target block (where the row will go when released)\n highlightLineClass = 'rst__highlightBottomLeftCorner';\n } else if (treeIndex === swapFrom) {\n // This block is on the top (source) line\n highlightLineClass = 'rst__highlightTopLeftCorner';\n } else {\n // This block is between the bottom and top\n highlightLineClass = 'rst__highlightLineVertical';\n }\n\n let style;\n if (rowDirection === 'rtl') {\n style = {\n width: scaffoldBlockPxWidth,\n right: scaffoldBlockPxWidth * i\n };\n } else {\n // Default ltr\n style = {\n width: scaffoldBlockPxWidth,\n left: scaffoldBlockPxWidth * i\n };\n }\n\n scaffold.push(\n <div\n // eslint-disable-next-line react/no-array-index-key\n key={i}\n style={style}\n className={classnames('rst__absoluteLineBlock', highlightLineClass, rowDirectionClass)}\n />\n );\n }\n });\n\n let style;\n if (rowDirection === 'rtl') {\n style = {right: scaffoldBlockPxWidth * scaffoldBlockCount};\n } else {\n // Default ltr\n style = {left: scaffoldBlockPxWidth * scaffoldBlockCount};\n }\n\n return connectDropTarget(\n <div {...otherProps} className={classnames('rst__node', rowDirectionClass)}>\n {scaffold}\n\n <div className=\"rst__nodeContent\" style={style}>\n {Children.map(children, (child) =>\n cloneElement(child, {\n isOver,\n canDrop,\n draggedNode\n })\n )}\n </div>\n </div>\n );\n};\n\nTreeNode.defaultProps = {\n swapFrom: null,\n swapDepth: null,\n swapLength: null,\n canDrop: false,\n draggedNode: null,\n rowDirection: 'ltr'\n};\n\nTreeNode.propTypes = {\n treeIndex: PropTypes.number.isRequired,\n treeId: PropTypes.string.isRequired,\n swapFrom: PropTypes.number,\n swapDepth: PropTypes.number,\n swapLength: PropTypes.number,\n scaffoldBlockPxWidth: PropTypes.number.isRequired,\n lowerSiblingCounts: PropTypes.arrayOf(PropTypes.number).isRequired,\n\n listIndex: PropTypes.number.isRequired,\n children: PropTypes.node.isRequired,\n\n // Drop target\n connectDropTarget: PropTypes.func.isRequired,\n isOver: PropTypes.bool.isRequired,\n canDrop: PropTypes.bool,\n draggedNode: PropTypes.shape({}),\n\n // used in dndManager\n getPrevRow: PropTypes.func.isRequired,\n node: PropTypes.shape({}).isRequired,\n path: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])).isRequired,\n\n // rtl support\n rowDirection: PropTypes.string\n};\n\nexport default TreeNode;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport {isDescendant} from './utils/tree-data-utils';\nimport classnames from './utils/classnames';\n//import {useStyles} from './nodeRendererDefaultStyle';\n\nconst NodeRendererDefault = ({\n scaffoldBlockPxWidth,\n toggleChildrenVisibility,\n connectDragPreview,\n connectDragSource,\n isDragging,\n canDrop,\n canDrag,\n node,\n title,\n subtitle,\n draggedNode,\n path,\n treeIndex,\n isSearchMatch,\n isSearchFocus,\n buttons,\n className,\n style,\n didDrop,\n /* eslint-disable */\n treeId,\n isOver, // Not needed, but preserved for other renderers\n parentNode, // Needed for dndManager\n /* eslint-enable */\n rowDirection,\n ...otherProps\n}) => {\n //useStyles();\n const nodeTitle = title || node.title;\n const nodeSubtitle = subtitle || node.subtitle;\n const rowDirectionClass = rowDirection === 'rtl' ? 'rst__rtl' : null;\n\n let handle;\n if (canDrag) {\n if (typeof node.children === 'function' && node.expanded) {\n // Show a loading symbol on the handle when the children are expanded\n // and yet still defined by a function (a callback to fetch the children)\n handle = (\n <div className=\"rst__loadingHandle\">\n <div className=\"rst__loadingCircle\">\n {[...new Array(12)].map((_, index) => (\n <div\n // eslint-disable-next-line react/no-array-index-key\n key={index}\n className={classnames('rst__loadingCirclePoint', rowDirectionClass)}\n />\n ))}\n </div>\n </div>\n );\n } else {\n // Show the handle used to initiate a drag-and-drop\n handle = connectDragSource(<div className=\"rst__moveHandle\" />, {\n dropEffect: 'copy'\n });\n }\n }\n\n const isDraggedDescendant = draggedNode && isDescendant(draggedNode, node);\n const isLandingPadActive = !didDrop && isDragging;\n\n let buttonStyle = {left: -0.5 * scaffoldBlockPxWidth};\n if (rowDirection === 'rtl') {\n buttonStyle = {right: -0.5 * scaffoldBlockPxWidth};\n }\n\n return (\n <div style={{height: '100%'}} {...otherProps}>\n {toggleChildrenVisibility &&\n node.children &&\n (node.children.length > 0 || typeof node.children === 'function') && (\n <div>\n <button\n type=\"button\"\n aria-label={node.expanded ? 'Collapse' : 'Expand'}\n className={classnames(\n node.expanded ? 'rst__collapseButton' : 'rst__expandButton',\n rowDirectionClass\n )}\n style={buttonStyle}\n onClick={() =>\n toggleChildrenVisibility({\n node,\n path,\n treeIndex\n })\n }\n />\n\n {node.expanded && !isDragging && (\n <div\n style={{width: scaffoldBlockPxWidth}}\n className={classnames('rst__lineChildren', rowDirectionClass)}\n />\n )}\n </div>\n )}\n\n <div className={classnames('rst__rowWrapper', rowDirectionClass)}>\n {/* Set the row preview to be used during drag and drop */}\n {connectDragPreview(\n <div\n className={classnames(\n 'rst__row',\n isLandingPadActive && 'rst__rowLandingPad',\n isLandingPadActive && !canDrop && 'rst__rowCancelPad',\n isSearchMatch && 'rst__rowSearchMatch',\n isSearchFocus && 'rst__rowSearchFocus',\n rowDirectionClass,\n className\n )}\n style={{\n opacity: isDraggedDescendant ? 0.5 : 1,\n ...style\n }}\n >\n {handle}\n\n <div\n className={classnames(\n 'rst__rowContents',\n !canDrag && 'rst__rowContentsDragDisabled',\n rowDirectionClass\n )}\n >\n <div className={classnames('rst__rowLabel', rowDirectionClass)}>\n <span\n className={classnames(\n 'rst__rowTitle',\n node.subtitle && 'rst__rowTitleWithSubtitle'\n )}\n >\n {typeof nodeTitle === 'function'\n ? nodeTitle({\n node,\n path,\n treeIndex\n })\n : nodeTitle}\n </span>\n\n {nodeSubtitle && (\n <span className=\"rst__rowSubtitle\">\n {typeof nodeSubtitle === 'function'\n ? nodeSubtitle({\n node,\n path,\n treeIndex\n })\n : nodeSubtitle}\n </span>\n )}\n </div>\n\n <div className=\"rst__rowToolbar\">\n {buttons.map((btn, index) => (\n <div\n key={index} // eslint-disable-line react/no-array-index-key\n className=\"rst__toolbarButton\"\n >\n {btn}\n </div>\n ))}\n </div>\n </div>\n </div>\n )}\n </div>\n </div>\n );\n};\n\nNodeRendererDefault.defaultProps = {\n isSearchMatch: false,\n isSearchFocus: false,\n canDrag: false,\n toggleChildrenVisibility: null,\n buttons: [],\n className: '',\n style: {},\n parentNode: null,\n draggedNode: null,\n canDrop: false,\n title: null,\n subtitle: null,\n rowDirection: 'ltr'\n};\n\nNodeRendererDefault.propTypes = {\n node: PropTypes.shape({}).isRequired,\n title: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),\n subtitle: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),\n path: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])).isRequired,\n treeIndex: PropTypes.number.isRequired,\n treeId: PropTypes.string.isRequired,\n isSearchMatch: PropTypes.bool,\n isSearchFocus: PropTypes.bool,\n canDrag: PropTypes.bool,\n scaffoldBlockPxWidth: PropTypes.number.isRequired,\n toggleChildrenVisibility: PropTypes.func,\n buttons: PropTypes.arrayOf(PropTypes.node),\n className: PropTypes.string,\n style: PropTypes.shape({}),\n\n // Drag and drop API functions\n // Drag source\n connectDragPreview: PropTypes.func.isRequired,\n connectDragSource: PropTypes.func.isRequired,\n parentNode: PropTypes.shape({}), // Needed for dndManager\n isDragging: PropTypes.bool.isRequired,\n didDrop: PropTypes.bool.isRequired,\n draggedNode: PropTypes.shape({}),\n // Drop target\n isOver: PropTypes.bool.isRequired,\n canDrop: PropTypes.bool,\n\n // rtl support\n rowDirection: PropTypes.string\n};\n\nexport default NodeRendererDefault;\n","import React, {Children, cloneElement, Component} from 'react';\nimport PropTypes from 'prop-types';\n\nclass TreePlaceholder extends Component {\n render() {\n // eslint-disable-next-line no-unused-vars\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const {children, connectDropTarget, treeId, drop, ...otherProps} = this.props;\n return connectDropTarget(\n <div>\n {Children.map(children, (child) =>\n cloneElement(child, {\n ...otherProps\n })\n )}\n </div>\n );\n }\n}\n\nTreePlaceholder.defaultProps = {\n canDrop: false,\n draggedNode: null\n};\n\nTreePlaceholder.propTypes = {\n children: PropTypes.node.isRequired,\n\n // Drop target\n connectDropTarget: PropTypes.func.isRequired,\n isOver: PropTypes.bool.isRequired,\n canDrop: PropTypes.bool,\n draggedNode: PropTypes.shape({}),\n treeId: PropTypes.string.isRequired,\n drop: PropTypes.func.isRequired\n};\n\nexport default TreePlaceholder;\n","import {makeStyles} from '@material-ui/core/styles';\n\nexport const useStyles = makeStyles(() => ({\n '@global .rst__placeholder': {\n position: 'relative',\n height: '68px',\n maxWidth: '300px',\n padding: '10px'\n },\n '@global .rst__placeholder, .rst__placeholder > *': {\n boxSizing: 'border-box'\n },\n '@global .rst__placeholder::before': {\n border: '3px dashed #d9d9d9',\n content: '',\n position: 'absolute',\n top: '5px',\n right: '5px',\n bottom: '5px',\n left: '5px',\n zIndex: -1\n },\n\n /**\n * The outline of where the element will go if dropped, displayed while dragging\n */\n '@global .rst__placeholderLandingPad, .rst__placeholderCancelPad': {\n border: 'none !important',\n boxShadow: 'none !important',\n outline: 'none !important'\n },\n '@global .rst__placeholderLandingPad *, .rst__placeholderCancelPad *': {\n opacity: '0 !important'\n },\n '@global .rst__placeholderLandingPad::before, .rst__placeholderCancelPad::before': {\n backgroundColor: 'lightblue',\n borderColor: 'white'\n },\n\n /**\n * Alternate appearance of the landing pad when the dragged location is invalid\n */\n '@global .rst__placeholderCancelPad::before': {\n backgroundColor: '#e6a8ad'\n }\n}));\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from './utils/classnames';\nimport {useStyles} from './placeholderRendererDefaultStyle';\n\nconst PlaceholderRendererDefault = ({isOver, canDrop}) => {\n useStyles();\n return (\n <div\n className={classnames(\n 'rst__placeholder',\n canDrop && 'rst__placeholderLandingPad',\n canDrop && !isOver && 'rst__placeholderCancelPad'\n )}\n />\n );\n};\n\nPlaceholderRendererDefault.defaultProps = {\n isOver: false,\n canDrop: false\n};\n\nPlaceholderRendererDefault.propTypes = {\n isOver: PropTypes.bool,\n canDrop: PropTypes.bool\n};\n\nexport default PlaceholderRendererDefault;\n","import {insertNode, getDescendantCount, getFlatDataFromTree} from './tree-data-utils';\n\nconst memoize = (f) => {\n let savedArgsArray = [];\n let savedKeysArray = [];\n let savedResult = null;\n\n return (args) => {\n const keysArray = Object.keys(args).sort();\n const argsArray = keysArray.map((key) => args[key]);\n\n // If the arguments for the last insert operation are different than this time,\n // recalculate the result\n if (\n argsArray.length !== savedArgsArray.length ||\n argsArray.some((arg, index) => arg !== savedArgsArray[index]) ||\n keysArray.some((key, index) => key !== savedKeysArray[index])\n ) {\n savedArgsArray = argsArray;\n savedKeysArray = keysArray;\n savedResult = f(args);\n }\n\n return savedResult;\n };\n};\n\nexport const memoizedInsertNode = memoize(insertNode);\nexport const memoizedGetFlatDataFromTree = memoize(getFlatDataFromTree);\nexport const memoizedGetDescendantCount = memoize(getDescendantCount);\n","import {DragSource as dragSource, DropTarget as dropTarget} from 'react-dnd';\nimport {findDOMNode} from 'react-dom';\nimport {equals} from 'ramda';\nimport {getDepth} from './tree-data-utils';\nimport {memoizedInsertNode} from './memoized-tree-data-utils';\n\nexport default class DndManager {\n constructor(treeRef) {\n this.treeRef = treeRef;\n this.resetDragVariables();\n }\n\n get startDrag() {\n return this.treeRef.startDrag;\n }\n\n get dragHover() {\n return this.treeRef.dragHover;\n }\n\n get endDrag() {\n return this.treeRef.endDrag;\n }\n\n get drop() {\n return this.treeRef.drop;\n }\n\n get treeId() {\n return this.treeRef.treeId;\n }\n\n get dndType() {\n return this.treeRef.dndType;\n }\n\n get treeData() {\n return this.treeRef.state.draggingTreeData || this.treeRef.props.treeData;\n }\n\n get getNodeKey() {\n return this.treeRef.props.getNodeKey;\n }\n\n get customCanDrop() {\n return this.treeRef.props.canDrop;\n }\n\n get maxDepth() {\n return this.treeRef.props.maxDepth;\n }\n\n resetDragVariables() {\n this.lastDropTargetNode = null;\n this.lastDropTargetDepth = null;\n this.hoverProps = null;\n this.lastCanDropResult = null;\n this.lastCanDropProps = null;\n this.shouldSkipMoreFrames = false;\n this.rafId = null;\n }\n getTargetDepth(dropTargetProps, monitor, component) {\n let dropTargetDepth = 0;\n\n const rowAbove = dropTargetProps.getPrevRow();\n if (rowAbove) {\n let {path} = rowAbove;\n const aboveNodeCannotHaveChildren = !this.treeRef.canNodeHaveChildren(rowAbove.node);\n if (aboveNodeCannotHaveChildren) {\n path = path.slice(0, path.length - 1);\n }\n\n // Limit the length of the path to the deepest possible\n dropTargetDepth = Math.min(path.length, dropTargetProps.path.length);\n }\n\n let blocksOffset;\n let dragSourceInitialDepth = (monitor.getItem().path || []).length;\n\n // When adding node from external source\n if (monitor.getItem().treeId !== this.treeId) {\n // Ignore the tree depth of the source, if it had any to begin with\n dragSourceInitialDepth = 0;\n\n if (component) {\n const relativePosition = findDOMNode(component).getBoundingClientRect(); // eslint-disable-line react/no-find-dom-node\n const leftShift = monitor.getSourceClientOffset().x - relativePosition.left;\n blocksOffset = Math.round(leftShift / dropTargetProps.scaffoldBlockPxWidth);\n } else {\n blocksOffset = dropTargetProps.path.length;\n }\n } else {\n // handle row direction support\n const direction = dropTargetProps.rowDirection === 'rtl' ? -1 : 1;\n\n blocksOffset = Math.round(\n (direction * monitor.getDifferenceFromInitialOffset().x) / dropTargetProps.scaffoldBlockPxWidth\n );\n }\n\n let targetDepth = Math.min(dropTargetDepth, Math.max(0, dragSourceInitialDepth + blocksOffset - 1));\n\n // If a maxDepth is defined, constrain the target depth\n if (typeof this.maxDepth !== 'undefined' && this.maxDepth !== null) {\n const draggedNode = monitor.getItem().node;\n const draggedChildDepth = getDepth(draggedNode);\n\n targetDepth = Math.max(0, Math.min(targetDepth, this.maxDepth - draggedChildDepth - 1));\n }\n\n return targetDepth;\n }\n\n canDrop(dropTargetProps, monitor) {\n if (!monitor.isOver()) {\n return false;\n }\n\n const rowAbove = dropTargetProps.getPrevRow();\n const abovePath = rowAbove ? rowAbove.path : [];\n const aboveNode = rowAbove ? rowAbove.node : {};\n const blocksOffset = Math.round(\n monitor.getDifferenceFromInitialOffset().x / dropTargetProps.scaffoldBlockPxWidth\n );\n const newCanDropProps = {\n nodeId: dropTargetProps.node.nodeId !== undefined ? dropTargetProps.node.nodeId : dropTargetProps.node,\n rowAbove,\n abovePath,\n aboveNodeId: aboveNode.nodeId !== undefined ? aboveNode.nodeId : aboveNode,\n blocksOffset\n };\n if (equals(this.lastCanDropProps, newCanDropProps)) {\n return this.lastCanDropResult;\n }\n this.lastCanDropProps = newCanDropProps;\n const targetDepth = this.getTargetDepth(dropTargetProps, monitor, null);\n\n // Cannot drop if we're adding to the children of the row above and\n // the row above is a function\n if (targetDepth >= abovePath.length && typeof aboveNode.children === 'function') {\n return (this.lastCanDropResult = false);\n }\n\n if (typeof this.customCanDrop === 'function') {\n const {node} = monitor.getItem();\n const addedResult = memoizedInsertNode({\n treeData: this.treeData,\n newNode: node,\n depth: targetDepth,\n getNodeKey: this.getNodeKey,\n minimumTreeIndex: dropTargetProps.listIndex,\n expandParent: true\n });\n\n return (this.lastCanDropResult = this.customCanDrop({\n node,\n prevPath: monitor.getItem().path,\n prevParent: monitor.getItem().parentNode,\n prevTreeIndex: monitor.getItem().treeIndex, // Equals -1 when dragged from external tree\n nextPath: addedResult.path,\n nextParent: addedResult.parentNode,\n nextTreeIndex: addedResult.treeIndex\n }));\n }\n return (this.lastCanDropResult = true);\n }\n\n wrapSource(el) {\n const nodeDragSource = {\n beginDrag: (props) => {\n this.startDrag(props);\n\n return {\n node: props.node,\n parentNode: props.parentNode,\n path: props.path,\n treeIndex: props.treeIndex,\n treeId: props.treeId\n };\n },\n\n endDrag: (props, monitor) => {\n if (this.rafId) {\n cancelAnimationFrame(this.rafId);\n }\n this.endDrag(monitor.getDropResult());\n this.resetDragVariables();\n },\n\n isDragging: (props, monitor) => {\n const dropTargetNode = monitor.getItem().node;\n const draggedNode = props.node;\n\n return draggedNode === dropTargetNode;\n }\n };\n\n function nodeDragSourcePropInjection(connect, monitor) {\n return {\n connectDragSource: connect.dragSource(),\n connectDragPreview: connect.dragPreview(),\n isDragging: monitor.isDragging(),\n didDrop: monitor.didDrop()\n };\n }\n\n return dragSource(this.dndType, nodeDragSource, nodeDragSourcePropInjection)(el);\n }\n hoverHandler = () => {\n if (this.hoverProps === null) {\n return;\n }\n const {dropTargetProps, monitor, component} = this.hoverProps;\n\n const item = monitor.getItem();\n if (!item) {\n return;\n }\n const targetDepth = this.getTargetDepth(dropTargetProps, monitor, component);\n const draggedNode = item.node;\n const needsRedraw =\n dropTargetProps.node !== this.lastDropTargetNode || targetDepth !== this.lastDropTargetDepth;\n\n if (!needsRedraw) {\n return;\n }\n this.lastDropTargetNode = dropTargetProps.node;\n this.lastDropTargetDepth = targetDepth;\n\n this.dragHover({\n node: draggedNode,\n path: item.path,\n minimumTreeIndex: dropTargetProps.listIndex,\n depth: targetDepth\n });\n\n this.hoverProps = null;\n };\n\n deferredCallHoverHandler = () => {\n if (this.shouldSkipMoreFrames) {\n this.shouldSkipMoreFrames = false;\n this.rafId = requestAnimationFrame(this.deferredCallHoverHandler);\n return;\n }\n this.rafId = null;\n this.hoverHandler();\n };\n\n wrapTarget(el) {\n const nodeDropTarget = {\n drop: (dropTargetProps, monitor, component) => {\n if (this.rafId) {\n cancelAnimationFrame(this.rafId);\n }\n const result = {\n node: monitor.getItem().node,\n path: monitor.getItem().path,\n treeIndex: monitor.getItem().treeIndex,\n treeId: this.treeId,\n minimumTreeIndex: dropTargetProps.treeIndex,\n depth: this.getTargetDepth(dropTargetProps, monitor, component)\n };\n this.lastDropTargetNode = null;\n this.drop(result);\n\n return result;\n },\n\n hover: (dropTargetProps, monitor, component) => {\n if (this.rafId) {\n this.shouldSkipMoreFrames = true;\n return;\n }\n this.shouldSkipMoreFrames = false;\n this.hoverProps = {\n dropTargetProps,\n monitor,\n component\n };\n this.rafId = requestAnimationFrame(this.deferredCallHoverHandler);\n },\n\n canDrop: this.canDrop.bind(this)\n };\n\n function nodeDropTargetPropInjection(connect, monitor) {\n const dragged = monitor.getItem();\n return {\n connectDropTarget: connect.dropTarget(),\n isOver: monitor.isOver(),\n canDrop: monitor.canDrop(),\n draggedNode: dragged ? dragged.node : null\n };\n }\n\n return dropTarget(this.dndType, nodeDropTarget, nodeDropTargetPropInjection)(el);\n }\n\n wrapPlaceholder(el) {\n const placeholderDropTarget = {\n drop: (dropTargetProps, monitor) => {\n const {node, path, treeIndex} = monitor.getItem();\n const result = {\n node,\n path,\n treeIndex,\n treeId: this.treeId,\n minimumTreeIndex: 0,\n depth: 0\n };\n\n this.drop(result);\n\n return result;\n }\n };\n\n function placeholderPropInjection(connect, monitor) {\n const dragged = monitor.getItem();\n return {\n connectDropTarget: connect.dropTarget(),\n isOver: monitor.isOver(),\n canDrop: monitor.canDrop(),\n draggedNode: dragged ? dragged.node : null\n };\n }\n\n return dropTarget(this.dndType, placeholderDropTarget, placeholderPropInjection)(el);\n }\n}\n","import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport {AutoSizer, List} from 'react-virtualized';\nimport {equals, append, when, always, gt, uniqWith, eqBy, pipe} from 'ramda';\nimport withScrolling, {\n createScrollingComponent,\n createVerticalStrength,\n createHorizontalStrength\n} from 'frontend-collective-react-dnd-scrollzone';\nimport {DndContext} from 'react-dnd';\nimport {polyfill} from 'react-lifecycles-compat';\nimport {withStyles} from '@material-ui/core/styles';\nimport {DragAndDrop} from '../DragAndDrop/DragAndDrop';\nimport TreeNode from './tree-node';\nimport NodeRendererDefault from './node-renderer-default';\nimport TreePlaceholder from './tree-placeholder';\nimport PlaceholderRendererDefault from './placeholder-renderer-default';\nimport {walk, changeNodeAtPath, removeNode, insertNode, find, toggleExpandedForAll} from './utils/tree-data-utils';\nimport {\n memoizedInsertNode,\n memoizedGetFlatDataFromTree,\n memoizedGetDescendantCount\n} from './utils/memoized-tree-data-utils';\nimport {slideRows} from './utils/generic-utils';\nimport {defaultGetNodeKey, defaultSearchMethod} from './utils/default-handlers';\nimport DndManager from './utils/dnd-manager';\nimport classnames from './utils/classnames';\nimport {styles} from './reactSortableTreeStyles';\n\nlet treeIdCounter = 1;\n\nconst mergeTheme = (props) => {\n const merged = {\n ...props,\n style: {...props.theme.style, ...props.style},\n innerStyle: {...props.theme.innerStyle, ...props.innerStyle},\n reactVirtualizedListProps: {\n ...props.theme.reactVirtualizedListProps,\n ...props.reactVirtualizedListProps\n }\n };\n\n const overridableDefaults = {\n nodeContentRenderer: NodeRendererDefault,\n placeholderRenderer: PlaceholderRendererDefault,\n rowHeight: 62,\n scaffoldBlockPxWidth: 44,\n slideRegionSize: 100,\n treeNodeRenderer: TreeNode\n };\n Object.keys(overridableDefaults).forEach((propKey) => {\n // If prop has been specified, do not change it\n // If prop is specified in theme, use the theme setting\n // If all else fails, fall back to the default\n if (props[propKey] === null) {\n merged[propKey] =\n typeof props.theme[propKey] !== 'undefined' ? props.theme[propKey] : overridableDefaults[propKey];\n }\n });\n\n return merged;\n};\n\nclass ReactSortableTree extends Component {\n constructor(props) {\n super(props);\n\n const {dndType, nodeContentRenderer, treeNodeRenderer, isVirtualized, slideRegionSize} = mergeTheme(props);\n\n this.dndManager = new DndManager(this);\n\n // Wrapping classes for use with react-dnd\n this.treeId = `rst__${treeIdCounter}`;\n treeIdCounter += 1;\n this.dndType = dndType || this.treeId;\n this.nodeContentRenderer = this.dndManager.wrapSource(nodeContentRenderer);\n this.treePlaceholderRenderer = this.dndManager.wrapPlaceholder(TreePlaceholder);\n this.treeNodeRenderer = this.dndManager.wrapTarget(treeNodeRenderer);\n\n // Prepare scroll-on-drag options for this list\n if (isVirtualized) {\n this.scrollZoneVirtualList = (createScrollingComponent || withScrolling)(List);\n this.vStrength = createVerticalStrength(slideRegionSize);\n this.hStrength = createHorizontalStrength(slideRegionSize);\n }\n\n this.state = {\n draggingTreeData: null,\n draggedNode: null,\n draggedMinimumTreeIndex: null,\n draggedDepth: null,\n searchMatches: [],\n searchFocusTreeIndex: null,\n dragging: false,\n draggingExpandedPaths: [],\n ignoreOneTreeUpdate: false,\n\n // props that need to be used in gDSFP or static functions will be stored here\n instanceProps: {\n treeData: this.props.treeData || [],\n searchQuery: null,\n searchFocusOffset: null,\n ignoreTreeChanges: false\n }\n };\n\n this.toggleChildrenVisibility = this.toggleChildrenVisibility.bind(this);\n this.moveNode = this.moveNode.bind(this);\n this.startDrag = this.startDrag.bind(this);\n this.dragHover = this.dragHover.bind(this);\n this.endDrag = this.endDrag.bind(this);\n this.drop = this.drop.bind(this);\n this.handleDndMonitorChange = this.handleDndMonitorChange.bind(this);\n }\n\n componentDidMount() {\n ReactSortableTree.loadLazyChildren(this.props);\n const stateUpdate = ReactSortableTree.search(this.props, this.state, true, true, false);\n this.setState(stateUpdate);\n\n // Hook into react-dnd state changes to detect when the drag ends\n // TODO: This is very brittle, so it needs to be replaced if react-dnd\n // offers a more official way to detect when a drag ends\n this.clearMonitorSubscription = this.props.dragDropManager\n .getMonitor()\n .subscribeToStateChange(this.handleDndMonitorChange);\n }\n\n static getDerivedStateFromProps(nextProps, prevState) {\n const {instanceProps} = prevState;\n const newState = {};\n\n if (!equals(instanceProps.searchQuery, nextProps.searchQuery)) {\n Object.assign(newState, ReactSortableTree.search(nextProps, prevState, true, true, false));\n } else if (instanceProps.searchFocusOffset !== nextProps.searchFocusOffset) {\n Object.assign(newState, ReactSortableTree.search(nextProps, prevState, true, true, true));\n }\n\n instanceProps.searchQuery = nextProps.searchQuery;\n instanceProps.searchFocusOffset = nextProps.searchFocusOffset;\n newState.instanceProps = instanceProps;\n\n return newState;\n }\n\n // listen to dragging\n componentDidUpdate(prevProps, prevState) {\n // if it is not the same then call the onDragStateChanged\n if (this.state.dragging !== prevState.dragging) {\n if (this.props.onDragStateChanged) {\n this.props.onDragStateChanged({\n isDragging: this.state.dragging,\n draggedNode: this.state.draggedNode\n });\n }\n }\n if (this.state.dragging) {\n const isTreeDataEqual = equals(this.props.treeData, prevProps.treeData);\n if (!isTreeDataEqual) {\n const {treeData: draggingTreeData} = removeNode({\n treeData: this.props.treeData,\n path: prevState.draggedPath,\n getNodeKey: this.props.getNodeKey\n });\n\n this.setState(({draggingExpandedPaths}) => ({\n draggingTreeData: draggingExpandedPaths.reduce((treeData, path) => {\n let newTree;\n try {\n newTree = changeNodeAtPath({\n treeData,\n path,\n newNode: ({node}) => ({...node, expanded: true}),\n getNodeKey: this.props.getNodeKey\n });\n } catch (e) {\n newTree = treeData;\n }\n return newTree;\n }, draggingTreeData)\n }));\n } else if (this.state.draggingTreeData && prevState.draggingTreeData !== this.state.draggingTreeData) {\n walk({\n treeData: this.state.draggingTreeData,\n getNodeKey: this.props.getNodeKey,\n callback: ({node, path, lowerSiblingCounts, treeIndex}) => {\n if (node.pending && node.expanded) {\n this.props.onLazyLoadChildren({\n node,\n path,\n lowerSiblingCounts,\n treeIndex\n });\n }\n }\n });\n }\n } else if (this.props.treeData !== prevProps.treeData) {\n const isTreeDataEqual = equals(this.props.treeData, prevProps.treeData);\n const {ignoreOneTreeUpdate, instanceProps} = this.state;\n const newState = {};\n if (!isTreeDataEqual) {\n if (ignoreOneTreeUpdate) {\n newState.ignoreOneTreeUpdate = false;\n } else {\n newState.searchFocusTreeIndex = null;\n ReactSortableTree.loadLazyChildren(this.props);\n Object.assign(newState, ReactSortableTree.search(this.props, this.state, false, false, false));\n }\n\n newState.draggingTreeData = null;\n newState.draggedNode = null;\n newState.draggedMinimumTreeIndex = null;\n newState.draggedDepth = null;\n newState.dragging = false;\n newState.draggingExpandedPaths = [];\n newState.instanceProps = {...instanceProps, treeData: this.props.treeData};\n\n this.setState(newState);\n }\n }\n }\n\n componentWillUnmount() {\n this.clearMonitorSubscription();\n }\n\n getRows(treeData) {\n return memoizedGetFlatDataFromTree({\n ignoreCollapsed: true,\n getNodeKey: this.props.getNodeKey,\n treeData\n });\n }\n\n handleDndMonitorChange() {\n const monitor = this.props.dragDropManager.getMonitor();\n // If the drag ends and the tree is still in a mid-drag state,\n // it means that the drag was canceled or the dragSource dropped\n // elsewhere, and we should reset the state of this tree\n if (!monitor.isDragging() && this.state.draggingTreeData) {\n this.endDrag();\n }\n }\n\n toggleChildrenVisibility({node: targetNode, path}) {\n const {instanceProps} = this.state;\n\n const treeData = changeNodeAtPath({\n treeData: instanceProps.treeData,\n path,\n newNode: ({node}) => ({...node, expanded: !node.expanded}),\n getNodeKey: this.props.getNodeKey\n });\n\n this.props.onChange(treeData);\n\n this.props.onVisibilityToggle({\n treeData,\n node: targetNode,\n expanded: !targetNode.expanded,\n path\n });\n }\n\n moveNode({node, path: prevPath, treeIndex: prevTreeIndex, depth, minimumTreeIndex}) {\n const {treeData, treeIndex, path, parentNode: nextParentNode} = insertNode({\n treeData: this.state.draggingTreeData,\n newNode: node,\n depth,\n minimumTreeIndex,\n expandParent: true,\n getNodeKey: this.props.getNodeKey\n });\n this.setState(\n {\n draggingTreeData: null,\n draggedNode: null,\n draggedMinimumTreeIndex: null,\n draggedDepth: null,\n dragging: false,\n draggingExpandedPaths: []\n },\n () => {\n this.props.onChange(treeData);\n\n this.props.onMoveNode({\n treeData,\n node,\n treeIndex,\n path,\n nextPath: path,\n nextTreeIndex: treeIndex,\n prevPath,\n prevTreeIndex,\n nextParentNode\n });\n }\n );\n }\n\n // returns the new state after search\n static search(props, state, seekIndex, expand, singleSearch) {\n const {\n onChange,\n getNodeKey,\n searchFinishCallback,\n searchQuery,\n searchMethod,\n searchFocusOffset,\n onlyExpandSearchedNodes\n } = props;\n\n const {instanceProps} = state;\n\n // Skip search if no conditions are specified\n if (!searchQuery && !searchMethod) {\n if (searchFinishCallback) {\n searchFinishCallback([]);\n }\n\n return {searchMatches: []};\n }\n\n const newState = {};\n\n // if onlyExpandSearchedNodes collapse the tree and search\n const {treeData: expandedTreeData, matches: searchMatches} = find({\n getNodeKey,\n treeData: onlyExpandSearchedNodes\n ? toggleExpandedForAll({\n treeData: instanceProps.treeData,\n expanded: false\n })\n : instanceProps.treeData,\n searchQuery,\n searchMethod: searchMethod || defaultSearchMethod,\n searchFocusOffset,\n expandAllMatchPaths: expand && !singleSearch,\n expandFocusMatchPaths: !!expand\n });\n\n // Update the tree with data leaving all paths leading to matching nodes open\n if (expand) {\n newState.ignoreOneTreeUpdate = true; // Prevents infinite loop\n onChange(expandedTreeData);\n }\n\n if (searchFinishCallback) {\n searchFinishCallback(searchMatches);\n }\n\n let searchFocusTreeIndex = null;\n if (seekIndex && searchFocusOffset !== null && searchFocusOffset < searchMatches.length) {\n searchFocusTreeIndex = searchMatches[searchFocusOffset].treeIndex;\n }\n\n newState.searchMatches = searchMatches;\n newState.searchFocusTreeIndex = searchFocusTreeIndex;\n\n return newState;\n }\n\n startDrag({path}) {\n this.setState((prevState) => {\n const {treeData: draggingTreeData, node: draggedNode, treeIndex: draggedMinimumTreeIndex} = removeNode({\n treeData: prevState.instanceProps.treeData,\n path,\n getNodeKey: this.props.getNodeKey\n });\n\n return {\n draggingTreeData,\n draggedNode,\n draggedDepth: path.length - 1,\n draggedMinimumTreeIndex,\n draggedPath: path,\n dragging: true\n };\n });\n }\n\n dragHover({node: draggedNode, depth: draggedDepth, minimumTreeIndex: draggedMinimumTreeIndex}) {\n // Ignore this hover if it is at the same position as the last hover\n if (\n this.state.draggedDepth === draggedDepth &&\n this.state.draggedMinimumTreeIndex === draggedMinimumTreeIndex\n ) {\n return;\n }\n this.setState(({draggingTreeData, instanceProps, draggingExpandedPaths}) => {\n // Fall back to the tree data if something is being dragged in from\n // an external element\n const newDraggingTreeData = draggingTreeData || instanceProps.treeData;\n\n const addedResult = memoizedInsertNode({\n treeData: newDraggingTreeData,\n newNode: draggedNode,\n depth: draggedDepth,\n minimumTreeIndex: draggedMinimumTreeIndex,\n expandParent: true,\n getNodeKey: this.props.getNodeKey\n });\n\n const rows = this.getRows(addedResult.treeData);\n const expandedParentPath = rows[addedResult.treeIndex].path;\n const nodePath = expandedParentPath.slice(0, -1);\n\n const newDraggingExpandedPaths = pipe(\n when(always(gt(nodePath.length, 0)), append(nodePath)),\n uniqWith(eqBy(String))\n )(draggingExpandedPaths);\n return {\n draggedNode,\n draggedDepth,\n draggedMinimumTreeIndex,\n draggingTreeData: changeNodeAtPath({\n treeData: newDraggingTreeData,\n path: nodePath,\n newNode: ({node}) => ({...node, expanded: true}),\n getNodeKey: this.props.getNodeKey\n }),\n // reset the scroll focus so it doesn't jump back\n // to a search result while dragging\n searchFocusTreeIndex: null,\n dragging: true,\n draggingExpandedPaths: newDraggingExpandedPaths\n };\n });\n }\n\n endDrag(dropResult) {\n const {instanceProps} = this.state;\n\n const resetTree = () =>\n this.setState({\n draggingTreeData: null,\n draggedNode: null,\n draggedMinimumTreeIndex: null,\n draggedDepth: null,\n dragging: false\n });\n\n // Drop was cancelled\n if (!dropResult) {\n resetTree();\n } else if (dropResult.treeId !== this.treeId) {\n // The node was dropped in an external drop target or tree\n const {node, path, treeIndex} = dropResult;\n let shouldCopy = this.props.shouldCopyOnOutsideDrop;\n if (typeof shouldCopy === 'function') {\n shouldCopy = shouldCopy({\n node,\n prevTreeIndex: treeIndex,\n prevPath: path\n });\n }\n\n let treeData = this.state.draggingTreeData || instanceProps.treeData;\n\n // If copying is enabled, a drop outside leaves behind a copy in the\n // source tree\n if (shouldCopy) {\n treeData = changeNodeAtPath({\n treeData: instanceProps.treeData, // use treeData unaltered by the drag operation\n path,\n newNode: ({node: copyNode}) => ({...copyNode}), // create a shallow copy of the node\n getNodeKey: this.props.getNodeKey\n });\n }\n\n this.props.onChange(treeData);\n\n this.props.onMoveNode({\n treeData,\n node,\n treeIndex: null,\n path: null,\n nextPath: null,\n nextTreeIndex: null,\n prevPath: path,\n prevTreeIndex: treeIndex\n });\n }\n }\n\n drop(dropResult) {\n this.moveNode(dropResult);\n }\n\n canNodeHaveChildren(node) {\n const {canNodeHaveChildren} = this.props;\n if (canNodeHaveChildren) {\n return canNodeHaveChildren(node);\n }\n return true;\n }\n\n // Load any children in the tree that are given by a function\n // calls the onChange callback on the new treeData\n static loadLazyChildren(props) {\n walk({\n treeData: props.treeData,\n getNodeKey: props.getNodeKey,\n callback: ({node, path, lowerSiblingCounts, treeIndex}) => {\n // If the node has children defined by a function, and is either expanded\n // or set to load even before expansion, run the function.\n if (node.pending && (node.expanded || props.loadCollapsedLazyChildren)) {\n // Call the children fetching function\n props.onLazyLoadChildren({\n node,\n path,\n lowerSiblingCounts,\n treeIndex,\n\n // Provide a helper to append the new data when it is received\n done: (childrenArray) =>\n props.onChange(\n changeNodeAtPath({\n treeData: props.treeData,\n path,\n newNode: ({node: oldNode}) =>\n // Only replace the old node if it's the one we set off to find children\n // for in the first place\n oldNode === node\n ? {\n ...oldNode,\n children: childrenArray\n }\n : oldNode,\n getNodeKey: props.getNodeKey\n }),\n true\n )\n });\n }\n }\n });\n }\n\n renderRow(row, {listIndex, style, getPrevRow, matchKeys, swapFrom, swapDepth, swapLength}) {\n const {node, parentNode, path, lowerSiblingCounts, treeIndex} = row;\n\n const {canDrag, generateNodeProps, scaffoldBlockPxWidth, searchFocusOffset, rowDirection} = mergeTheme(\n this.props\n );\n const TreeNodeRenderer = this.treeNodeRenderer;\n const NodeContentRenderer = this.nodeContentRenderer;\n const nodeKey = path[path.length - 1];\n const isSearchMatch = nodeKey in matchKeys;\n const isSearchFocus = isSearchMatch && matchKeys[nodeKey] === searchFocusOffset;\n const callbackParams = {\n node,\n parentNode,\n path,\n lowerSiblingCounts,\n treeIndex,\n isSearchMatch,\n isSearchFocus\n };\n const nodeProps = !generateNodeProps ? {} : generateNodeProps(callbackParams);\n const rowCanDrag = typeof canDrag !== 'function' ? canDrag : canDrag(callbackParams);\n\n const sharedProps = {\n treeIndex,\n scaffoldBlockPxWidth,\n node,\n path,\n treeId: this.treeId,\n rowDirection\n };\n\n return (\n <TreeNodeRenderer\n style={style}\n key={nodeKey}\n listIndex={listIndex}\n getPrevRow={getPrevRow}\n lowerSiblingCounts={lowerSiblingCounts}\n swapFrom={swapFrom}\n swapLength={swapLength}\n swapDepth={swapDepth}\n {...sharedProps}\n >\n <NodeContentRenderer\n parentNode={parentNode}\n isSearchMatch={isSearchMatch}\n isSearchFocus={isSearchFocus}\n canDrag={rowCanDrag}\n toggleChildrenVisibility={this.toggleChildrenVisibility}\n {...sharedProps}\n {...nodeProps}\n />\n </TreeNodeRenderer>\n );\n }\n\n render() {\n const {\n dragDropManager,\n style,\n className,\n innerStyle,\n rowHeight,\n isVirtualized,\n placeholderRenderer,\n reactVirtualizedListProps,\n getNodeKey,\n rowDirection\n } = mergeTheme(this.props);\n const {searchMatches, searchFocusTreeIndex, draggedNode, draggedDepth, draggedMinimumTreeIndex} = this.state;\n\n const treeData = this.state.draggingTreeData || this.props.treeData;\n const rowDirectionClass = rowDirection === 'rtl' ? 'rst__rtl' : null;\n\n let rows;\n let swapFrom = null;\n let swapLength = null;\n if (draggedNode && draggedMinimumTreeIndex !== null) {\n const addedResult = memoizedInsertNode({\n treeData,\n newNode: draggedNode,\n depth: draggedDepth,\n minimumTreeIndex: draggedMinimumTreeIndex,\n expandParent: true,\n getNodeKey\n });\n\n const swapTo = draggedMinimumTreeIndex;\n swapFrom = addedResult.treeIndex;\n swapLength = 1 + memoizedGetDescendantCount({node: draggedNode});\n rows = slideRows(this.getRows(addedResult.treeData), swapFrom, swapTo, swapLength);\n } else {\n rows = this.getRows(treeData);\n }\n\n // Get indices for rows that match the search conditions\n const matchKeys = {};\n searchMatches.forEach(({path}, i) => {\n matchKeys[path[path.length - 1]] = i;\n });\n\n // Seek to the focused search result if there is one specified\n const scrollToInfo = searchFocusTreeIndex !== null ? {scrollToIndex: searchFocusTreeIndex} : {};\n\n let containerStyle = style;\n let list;\n if (rows.length < 1) {\n const Placeholder = this.treePlaceholderRenderer;\n const PlaceholderContent = placeholderRenderer;\n list = (\n <Placeholder treeId={this.treeId} drop={this.drop}>\n <PlaceholderContent />\n </Placeholder>\n );\n } else if (isVirtualized) {\n containerStyle = {height: '100%', ...containerStyle};\n\n const ScrollZoneVirtualList = this.scrollZoneVirtualList;\n // Render list with react-virtualized\n list = (\n <AutoSizer>\n {({height, width}) => (\n <ScrollZoneVirtualList\n {...scrollToInfo}\n dragDropManager={dragDropManager}\n verticalStrength={this.vStrength}\n horizontalStrength={this.hStrength}\n speed={30}\n scrollToAlignment=\"start\"\n className={this.props.classes.rst__virtualScrollOverride}\n width={width}\n onScroll={({scrollTop}) => {\n this.scrollTop = scrollTop;\n }}\n height={height}\n style={innerStyle}\n rowCount={rows.length}\n estimatedRowSize={typeof rowHeight !== 'function' ? rowHeight : undefined}\n rowHeight={\n typeof rowHeight !== 'function'\n ? rowHeight\n : ({index}) =>\n rowHeight({\n index,\n treeIndex: index,\n node: rows[index].node,\n path: rows[index].path\n })\n }\n rowRenderer={({index, style: rowStyle}) =>\n this.renderRow(rows[index], {\n listIndex: index,\n style: rowStyle,\n getPrevRow: () => rows[index - 1] || null,\n matchKeys,\n swapFrom,\n swapDepth: draggedDepth,\n swapLength\n })\n }\n {...reactVirtualizedListProps}\n />\n )}\n </AutoSizer>\n );\n } else {\n // Render list without react-virtualized\n list = rows.map((row, index) =>\n this.renderRow(row, {\n listIndex: index,\n style: {\n height:\n typeof rowHeight !== 'function'\n ? rowHeight\n : rowHeight({\n index,\n treeIndex: index,\n node: row.node,\n path: row.path\n })\n },\n getPrevRow: () => rows[index - 1] || null,\n matchKeys,\n swapFrom,\n swapDepth: draggedDepth,\n swapLength\n })\n );\n }\n\n return (\n <div className={classnames('rst__tree', className, rowDirectionClass)} style={containerStyle}>\n {list}\n </div>\n );\n }\n}\n\nReactSortableTree.propTypes = {\n classes: PropTypes.object,\n dragDropManager: PropTypes.shape({\n getMonitor: PropTypes.func\n }).isRequired,\n\n // Tree data in the following format:\n // [{title: 'main', subtitle: 'sub'}, { title: 'value2', expanded: true, children: [{ title: 'value3') }] }]\n // `title` is the primary label for the node\n // `subtitle` is a secondary label for the node\n // `expanded` shows children of the node if true, or hides them if false. Defaults to false.\n // `children` is an array of child nodes belonging to the node.\n treeData: PropTypes.arrayOf(PropTypes.object).isRequired,\n\n // Style applied to the container wrapping the tree (style defaults to {height: '100%'})\n style: PropTypes.shape({}),\n\n // Class name for the container wrapping the tree\n className: PropTypes.string,\n\n // Style applied to the inner, scrollable container (for padding, etc.)\n innerStyle: PropTypes.shape({}),\n\n // Used by react-virtualized\n // Either a fixed row height (number) or a function that returns the\n // height of a row given its index: `({ index: number }): number`\n rowHeight: PropTypes.oneOfType([PropTypes.number, PropTypes.func]),\n\n // Size in px of the region near the edges that initiates scrolling on dragover\n slideRegionSize: PropTypes.number,\n\n // Custom properties to hand to the react-virtualized list\n // https://github.com/bvaughn/react-virtualized/blob/master/docs/List.md#prop-types\n reactVirtualizedListProps: PropTypes.shape({}),\n\n // The width of the blocks containing the lines representing the structure of the tree.\n scaffoldBlockPxWidth: PropTypes.number,\n\n // Maximum depth nodes can be inserted at. Defaults to infinite.\n maxDepth: PropTypes.number,\n\n // The method used to search nodes.\n // Defaults to a function that uses the `searchQuery` string to search for nodes with\n // matching `title` or `subtitle` values.\n // NOTE: Changing `searchMethod` will not update the search, but changing the `searchQuery` will.\n searchMethod: PropTypes.func,\n\n // Used by the `searchMethod` to highlight and scroll to matched nodes.\n // Should be a string for the default `searchMethod`, but can be anything when using a custom search.\n searchQuery: PropTypes.any, // eslint-disable-line react/forbid-prop-types\n\n // Outline the <`searchFocusOffset`>th node and scroll to it.\n searchFocusOffset: PropTypes.number,\n\n // Get the nodes that match the search criteria. Used for counting total matches, etc.\n searchFinishCallback: PropTypes.func,\n\n // Generate an object with additional props to be passed to the node renderer.\n // Use this for adding buttons via the `buttons` key,\n // or additional `style` / `className` settings.\n generateNodeProps: PropTypes.func,\n\n // Set to false to disable virtualization.\n // NOTE: Auto-scrolling while dragging, and scrolling to the `searchFocusOffset` will be disabled.\n isVirtualized: PropTypes.bool,\n\n treeNodeRenderer: PropTypes.func,\n\n // Override the default component for rendering nodes (but keep the scaffolding generator)\n // This is an advanced option for complete customization of the appearance.\n // It is best to copy the component in `node-renderer-default.js` to use as a base, and customize as needed.\n nodeContentRenderer: PropTypes.func,\n\n // Override the default component for rendering an empty tree\n // This is an advanced option for complete customization of the appearance.\n // It is best to copy the component in `placeholder-renderer-default.js` to use as a base,\n // and customize as needed.\n placeholderRenderer: PropTypes.func,\n\n theme: PropTypes.shape({\n style: PropTypes.shape({}),\n innerStyle: PropTypes.shape({}),\n reactVirtualizedListProps: PropTypes.shape({}),\n scaffoldBlockPxWidth: PropTypes.number,\n slideRegionSize: PropTypes.number,\n rowHeight: PropTypes.oneOfType([PropTypes.number, PropTypes.func]),\n treeNodeRenderer: PropTypes.func,\n nodeContentRenderer: PropTypes.func,\n placeholderRenderer: PropTypes.func\n }),\n\n // Determine the unique key used to identify each node and\n // generate the `path` array passed in callbacks.\n // By default, returns the index in the tree (omitting hidden nodes).\n getNodeKey: PropTypes.func,\n\n // Called whenever tree data changed.\n // Just like with React input elements, you have to update your\n // own component's data to see the changes reflected.\n onChange: PropTypes.func.isRequired,\n\n // Called after node move operation.\n onMoveNode: PropTypes.func,\n\n // Determine whether a node can be dragged. Set to false to disable dragging on all nodes.\n canDrag: PropTypes.oneOfType([PropTypes.func, PropTypes.bool]),\n\n // Determine whether a node can be dropped based on its path and parents'.\n canDrop: PropTypes.func,\n\n // Determine whether a node can have children\n canNodeHaveChildren: PropTypes.func,\n\n // When true, or a callback returning true, dropping nodes to react-dnd\n // drop targets outside of this tree will not remove them from this tree\n shouldCopyOnOutsideDrop: PropTypes.oneOfType([PropTypes.func, PropTypes.bool]),\n\n // Called after children nodes collapsed or expanded.\n onVisibilityToggle: PropTypes.func,\n\n dndType: PropTypes.string,\n\n // Called to track between dropped and dragging\n onDragStateChanged: PropTypes.func,\n\n // Specify that nodes that do not match search will be collapsed\n onlyExpandSearchedNodes: PropTypes.bool,\n\n // rtl support\n rowDirection: PropTypes.string,\n\n onLazyLoadChildren: PropTypes.func,\n ignoreTreeChanges: PropTypes.bool\n};\n\nReactSortableTree.defaultProps = {\n canDrag: true,\n canDrop: null,\n canNodeHaveChildren: () => true,\n className: '',\n dndType: null,\n generateNodeProps: null,\n getNodeKey: defaultGetNodeKey,\n innerStyle: {},\n isVirtualized: true,\n maxDepth: null,\n treeNodeRenderer: null,\n nodeContentRenderer: null,\n onMoveNode: () => {},\n onVisibilityToggle: () => {},\n placeholderRenderer: null,\n reactVirtualizedListProps: {},\n rowHeight: null,\n scaffoldBlockPxWidth: null,\n searchFinishCallback: null,\n searchFocusOffset: null,\n searchMethod: null,\n searchQuery: null,\n shouldCopyOnOutsideDrop: false,\n slideRegionSize: null,\n style: {},\n theme: {},\n onDragStateChanged: () => {},\n onlyExpandSearchedNodes: false,\n rowDirection: 'ltr',\n onLazyLoadChildren: () => {},\n ignoreTreeChanges: false\n};\n\npolyfill(ReactSortableTree);\n\nconst StyledReactSortableTree = withStyles(styles)(ReactSortableTree);\n\nconst SortableTreeWithoutDndContext = (props) => (\n <DndContext.Consumer>\n {({dragDropManager}) =>\n dragDropManager === undefined ? null : (\n <StyledReactSortableTree {...props} dragDropManager={dragDropManager} />\n )\n }\n </DndContext.Consumer>\n);\n\nconst SortableTree = (props) => {\n return (\n <DragAndDrop>\n <SortableTreeWithoutDndContext {...props} />\n </DragAndDrop>\n );\n};\n\n// Export the tree component without the react-dnd DragDropContext,\n// for when component is used with other components using react-dnd.\n// see: https://github.com/gaearon/react-dnd/issues/186\nexport {SortableTreeWithoutDndContext};\n\nexport default SortableTree;\n","/* eslint-disable import/prefer-default-export */\n\nexport function slideRows(rows, fromIndex, toIndex, count = 1) {\n const rowsWithoutMoved = [...rows.slice(0, fromIndex), ...rows.slice(fromIndex + count)];\n\n return [\n ...rowsWithoutMoved.slice(0, toIndex),\n ...rows.slice(fromIndex, fromIndex + count),\n ...rowsWithoutMoved.slice(toIndex)\n ];\n}\n","export const styles = () => ({\n /* import styles from react-virtualized/styles.css */\n\n /* Grid default theme */\n '@global .ReactVirtualized__Grid__innerScrollContainer': {\n overflow: 'visible !important' // override base style\n },\n\n '@global .ReactVirtualized__Grid': {\n outline: 'none' //override base style,\n },\n\n /* List default theme */\n '@global .ReactVirtualized__List': {},\n\n // New styles\n rst__virtualScrollOverride: {\n overflow: 'auto !important'\n },\n\n '@global .rst__rtl .ReactVirtualized__Grid__innerScrollContainer': {\n direction: 'rtl'\n }\n});\n","import SortableTree, {SortableTreeWithoutDndContext} from './react-sortable-tree';\n\nexport * from './utils/default-handlers';\nexport * from './utils/tree-data-utils';\nexport default SortableTree;\n\n// Export the tree component without the react-dnd DragDropContext,\n// for when component is used with other components using react-dnd.\n// see: https://github.com/gaearon/react-dnd/issues/186\nexport {SortableTreeWithoutDndContext};\n","export function defaultGetNodeKey({treeIndex}) {\n return treeIndex;\n}\n\n// Cheap hack to get the text of a react object\nfunction getReactElementText(parent) {\n if (typeof parent === 'string') {\n return parent;\n }\n\n if (\n parent === null ||\n typeof parent !== 'object' ||\n !parent.props ||\n !parent.props.children ||\n (typeof parent.props.children !== 'string' && typeof parent.props.children !== 'object')\n ) {\n return '';\n }\n\n if (typeof parent.props.children === 'string') {\n return parent.props.children;\n }\n\n return parent.props.children.map((child) => getReactElementText(child)).join('');\n}\n\n// Search for a query string inside a node property\nfunction stringSearch(key, searchQuery, node, path, treeIndex) {\n if (typeof node[key] === 'function') {\n // Search within text after calling its function to generate the text\n return String(node[key]({node, path, treeIndex})).indexOf(searchQuery) > -1;\n }\n if (typeof node[key] === 'object') {\n // Search within text inside react elements\n return getReactElementText(node[key]).indexOf(searchQuery) > -1;\n }\n\n // Search within string\n return node[key] && String(node[key]).indexOf(searchQuery) > -1;\n}\n\nexport function defaultSearchMethod({node, path, treeIndex, searchQuery}) {\n return (\n stringSearch('title', searchQuery, node, path, treeIndex) ||\n stringSearch('subtitle', searchQuery, node, path, treeIndex)\n );\n}\n\nexport default {defaultSearchMethod, defaultGetNodeKey};\n","/**\n * Performs a depth-first traversal over all of the node descendants,\n * incrementing currentIndex by 1 for each\n */\nfunction getNodeDataAtTreeIndexOrNextIndex({\n targetIndex,\n node,\n currentIndex,\n getNodeKey,\n path = [],\n lowerSiblingCounts = [],\n ignoreCollapsed = true,\n isPseudoRoot = false\n}) {\n // The pseudo-root is not considered in the path\n const selfPath = !isPseudoRoot ? [...path, getNodeKey({node, treeIndex: currentIndex})] : [];\n\n // Return target node when found\n if (currentIndex === targetIndex) {\n return {\n node,\n lowerSiblingCounts,\n path: selfPath\n };\n }\n\n // Add one and continue for nodes with no children or hidden children\n if (!node.children || (ignoreCollapsed && node.expanded !== true)) {\n return {nextIndex: currentIndex + 1};\n }\n\n // Iterate over each child and their descendants and return the\n // target node if childIndex reaches the targetIndex\n let childIndex = currentIndex + 1;\n const childCount = node.children.length;\n for (let i = 0; i < childCount; i += 1) {\n const result = getNodeDataAtTreeIndexOrNextIndex({\n ignoreCollapsed,\n getNodeKey,\n targetIndex,\n node: node.children[i],\n currentIndex: childIndex,\n lowerSiblingCounts: [...lowerSiblingCounts, childCount - i - 1],\n path: selfPath\n });\n\n if (result.node) {\n return result;\n }\n\n childIndex = result.nextIndex;\n }\n\n // If the target node is not found, return the farthest traversed index\n return {nextIndex: childIndex};\n}\n\nexport function getDescendantCount({node, ignoreCollapsed = true}) {\n return (\n getNodeDataAtTreeIndexOrNextIndex({\n getNodeKey: () => {},\n ignoreCollapsed,\n node,\n currentIndex: 0,\n targetIndex: -1\n }).nextIndex - 1\n );\n}\n\n/**\n * Walk all descendants of the given node, depth-first\n *\n * @param {Object} args - Function parameters\n * @param {function} args.callback - Function to call on each node\n * @param {function} args.getNodeKey - Function to get the key from the nodeData and tree index\n * @param {boolean} args.ignoreCollapsed - Ignore children of nodes without `expanded` set to `true`\n * @param {boolean=} args.isPseudoRoot - If true, this node has no real data, and only serves\n * as the parent of all the nodes in the tree\n * @param {Object} args.node - A tree node\n * @param {Object=} args.parentNode - The parent node of `node`\n * @param {number} args.currentIndex - The treeIndex of `node`\n * @param {number[]|string[]} args.path - Array of keys leading up to node to be changed\n * @param {number[]} args.lowerSiblingCounts - An array containing the count of siblings beneath the\n * previous nodes in this path\n *\n * @return {number|false} nextIndex - Index of the next sibling of `node`,\n * or false if the walk should be terminated\n */\nfunction walkDescendants({\n callback,\n getNodeKey,\n ignoreCollapsed,\n isPseudoRoot = false,\n node,\n parentNode = null,\n currentIndex,\n path = [],\n lowerSiblingCounts = []\n}) {\n // The pseudo-root is not considered in the path\n const selfPath = isPseudoRoot ? [] : [...path, getNodeKey({node, treeIndex: currentIndex})];\n const selfInfo = isPseudoRoot\n ? null\n : {\n node,\n parentNode,\n path: selfPath,\n lowerSiblingCounts,\n treeIndex: currentIndex\n };\n\n if (!isPseudoRoot) {\n const callbackResult = callback(selfInfo);\n\n // Cut walk short if the callback returned false\n if (callbackResult === false) {\n return false;\n }\n }\n\n // Return self on nodes with no children or hidden children\n if (!node.children || (node.expanded !== true && ignoreCollapsed && !isPseudoRoot)) {\n return currentIndex;\n }\n\n // Get all descendants\n let childIndex = currentIndex;\n const childCount = node.children.length;\n if (typeof node.children !== 'function') {\n for (let i = 0; i < childCount; i += 1) {\n childIndex = walkDescendants({\n callback,\n getNodeKey,\n ignoreCollapsed,\n node: node.children[i],\n parentNode: isPseudoRoot ? null : node,\n currentIndex: childIndex + 1,\n lowerSiblingCounts: [...lowerSiblingCounts, childCount - i - 1],\n path: selfPath\n });\n\n // Cut walk short if the callback returned false\n if (childIndex === false) {\n return false;\n }\n }\n }\n\n return childIndex;\n}\n\n/**\n * Perform a change on the given node and all its descendants, traversing the tree depth-first\n *\n * @param {Object} args - Function parameters\n * @param {function} args.callback - Function to call on each node\n * @param {function} args.getNodeKey - Function to get the key from the nodeData and tree index\n * @param {boolean} args.ignoreCollapsed - Ignore children of nodes without `expanded` set to `true`\n * @param {boolean=} args.isPseudoRoot - If true, this node has no real data, and only serves\n * as the parent of all the nodes in the tree\n * @param {Object} args.node - A tree node\n * @param {Object=} args.parentNode - The parent node of `node`\n * @param {number} args.currentIndex - The treeIndex of `node`\n * @param {number[]|string[]} args.path - Array of keys leading up to node to be changed\n * @param {number[]} args.lowerSiblingCounts - An array containing the count of siblings beneath the\n * previous nodes in this path\n *\n * @return {number|false} nextIndex - Index of the next sibling of `node`,\n * or false if the walk should be terminated\n */\nfunction mapDescendants({\n callback,\n getNodeKey,\n ignoreCollapsed,\n isPseudoRoot = false,\n node,\n parentNode = null,\n currentIndex,\n path = [],\n lowerSiblingCounts = []\n}) {\n const nextNode = {...node};\n\n // The pseudo-root is not considered in the path\n const selfPath = isPseudoRoot ? [] : [...path, getNodeKey({node: nextNode, treeIndex: currentIndex})];\n const selfInfo = {\n node: nextNode,\n parentNode,\n path: selfPath,\n lowerSiblingCounts,\n treeIndex: currentIndex\n };\n\n // Return self on nodes with no children or hidden children\n if (!nextNode.children || (nextNode.expanded !== true && ignoreCollapsed && !isPseudoRoot)) {\n return {\n treeIndex: currentIndex,\n node: callback(selfInfo)\n };\n }\n\n // Get all descendants\n let childIndex = currentIndex;\n const childCount = nextNode.children.length;\n if (typeof nextNode.children !== 'function') {\n nextNode.children = nextNode.children.map((child, i) => {\n const mapResult = mapDescendants({\n callback,\n getNodeKey,\n ignoreCollapsed,\n node: child,\n parentNode: isPseudoRoot ? null : nextNode,\n currentIndex: childIndex + 1,\n lowerSiblingCounts: [...lowerSiblingCounts, childCount - i - 1],\n path: selfPath\n });\n childIndex = mapResult.treeIndex;\n\n return mapResult.node;\n });\n }\n\n return {\n node: callback(selfInfo),\n treeIndex: childIndex\n };\n}\n\n/**\n * Count all the visible (expanded) descendants in the tree data.\n *\n * @param {!Object[]} treeData - Tree data\n *\n * @return {number} count\n */\nexport function getVisibleNodeCount({treeData}) {\n const traverse = (node) => {\n if (!node.children || node.expanded !== true || typeof node.children === 'function') {\n return 1;\n }\n\n return 1 + node.children.reduce((total, currentNode) => total + traverse(currentNode), 0);\n };\n\n return treeData.reduce((total, currentNode) => total + traverse(currentNode), 0);\n}\n\n/**\n * Get the <targetIndex>th visible node in the tree data.\n *\n * @param {!Object[]} treeData - Tree data\n * @param {!number} targetIndex - The index of the node to search for\n * @param {!function} getNodeKey - Function to get the key from the nodeData and tree index\n *\n * @return {{\n * node: Object,\n * path: []string|[]number,\n * lowerSiblingCounts: []number\n * }|null} node - The node at targetIndex, or null if not found\n */\nexport function getVisibleNodeInfoAtIndex({treeData, index: targetIndex, getNodeKey}) {\n if (!treeData || treeData.length < 1) {\n return null;\n }\n\n // Call the tree traversal with a pseudo-root node\n const result = getNodeDataAtTreeIndexOrNextIndex({\n targetIndex,\n getNodeKey,\n node: {\n children: treeData,\n expanded: true\n },\n currentIndex: -1,\n path: [],\n lowerSiblingCounts: [],\n isPseudoRoot: true\n });\n\n if (result.node) {\n return result;\n }\n\n return null;\n}\n\n/**\n * Walk descendants depth-first and call a callback on each\n *\n * @param {!Object[]} treeData - Tree data\n * @param {!function} getNodeKey - Function to get the key from the nodeData and tree index\n * @param {function} callback - Function to call on each node\n * @param {boolean=} ignoreCollapsed - Ignore children of nodes without `expanded` set to `true`\n *\n * @return void\n */\nexport function walk({treeData, getNodeKey, callback, ignoreCollapsed = true}) {\n if (!treeData || treeData.length < 1) {\n return;\n }\n\n walkDescendants({\n callback,\n getNodeKey,\n ignoreCollapsed,\n isPseudoRoot: true,\n node: {children: treeData},\n currentIndex: -1,\n path: [],\n lowerSiblingCounts: []\n });\n}\n\n/**\n * Perform a depth-first transversal of the descendants and\n * make a change to every node in the tree\n *\n * @param {!Object[]} treeData - Tree data\n * @param {!function} getNodeKey - Function to get the key from the nodeData and tree index\n * @param {function} callback - Function to call on each node\n * @param {boolean=} ignoreCollapsed - Ignore children of nodes without `expanded` set to `true`\n *\n * @return {Object[]} changedTreeData - The changed tree data\n */\nexport function map({treeData, getNodeKey, callback, ignoreCollapsed = true}) {\n if (!treeData || treeData.length < 1) {\n return [];\n }\n\n return mapDescendants({\n callback,\n getNodeKey,\n ignoreCollapsed,\n isPseudoRoot: true,\n node: {children: treeData},\n currentIndex: -1,\n path: [],\n lowerSiblingCounts: []\n }).node.children;\n}\n\n/**\n * Expand or close every node in the tree\n *\n * @param {!Object[]} treeData - Tree data\n * @param {?boolean} expanded - Whether the node is expanded or not\n *\n * @return {Object[]} changedTreeData - The changed tree data\n */\nexport function toggleExpandedForAll({treeData, expanded = true}) {\n return map({\n treeData,\n callback: ({node}) => ({...node, expanded}),\n getNodeKey: ({treeIndex}) => treeIndex,\n ignoreCollapsed: false\n });\n}\n\nexport const RESULT_MISS_ERROR_MESSAGE = 'No node found at the given path.';\n\n/**\n * Replaces node at path with object, or callback-defined object\n *\n * @param {!Object[]} treeData\n * @param {number[]|string[]} path - Array of keys leading up to node to be changed\n * @param {function|any} newNode - Node to replace the node at the path with, or a function producing the new node\n * @param {!function} getNodeKey - Function to get the key from the nodeData and tree index\n * @param {boolean=} ignoreCollapsed - Ignore children of nodes without `expanded` set to `true`\n *\n * @return {Object[]} changedTreeData - The changed tree data\n */\nexport function changeNodeAtPath({treeData, path, newNode, getNodeKey, ignoreCollapsed = true}) {\n const RESULT_MISS = 'RESULT_MISS';\n const traverse = ({isPseudoRoot = false, node, currentTreeIndex, pathIndex}) => {\n if (!isPseudoRoot && getNodeKey({node, treeIndex: currentTreeIndex}) !== path[pathIndex]) {\n return RESULT_MISS;\n }\n\n if (pathIndex >= path.length - 1) {\n // If this is the final location in the path, return its changed form\n return typeof newNode === 'function' ? newNode({node, treeIndex: currentTreeIndex}) : newNode;\n }\n if (!node.children) {\n // If this node is part of the path, but has no children, return the unchanged node\n throw new Error('Path referenced children of node with no children.');\n }\n\n let nextTreeIndex = currentTreeIndex + 1;\n for (let i = 0; i < node.children.length; i += 1) {\n const result = traverse({\n node: node.children[i],\n currentTreeIndex: nextTreeIndex,\n pathIndex: pathIndex + 1\n });\n\n // If the result went down the correct path\n if (result !== RESULT_MISS) {\n if (result) {\n // If the result was truthy (in this case, an object),\n // pass it to the next level of recursion up\n return {\n ...node,\n children: [...node.children.slice(0, i), result, ...node.children.slice(i + 1)]\n };\n }\n // If the result was falsy (returned from the newNode function), then\n // delete the node from the array.\n return {\n ...node,\n children: [...node.children.slice(0, i), ...node.children.slice(i + 1)]\n };\n }\n\n nextTreeIndex += 1 + getDescendantCount({node: node.children[i], ignoreCollapsed});\n }\n\n return RESULT_MISS;\n };\n\n // Use a pseudo-root node in the beginning traversal\n const result = traverse({\n node: {children: treeData},\n currentTreeIndex: -1,\n pathIndex: -1,\n isPseudoRoot: true\n });\n\n if (result === RESULT_MISS) {\n throw new Error(RESULT_MISS_ERROR_MESSAGE);\n }\n\n return result.children;\n}\n\n/**\n * Removes the node at the specified path and returns the resulting treeData.\n *\n * @param {!Object[]} treeData\n * @param {number[]|string[]} path - Array of keys leading up to node to be deleted\n * @param {!function} getNodeKey - Function to get the key from the nodeData and tree index\n * @param {boolean=} ignoreCollapsed - Ignore children of nodes without `expanded` set to `true`\n *\n * @return {Object[]} changedTreeData - The tree data with the node removed\n */\nexport function removeNodeAtPath({treeData, path, getNodeKey, ignoreCollapsed = true}) {\n return changeNodeAtPath({\n treeData,\n path,\n getNodeKey,\n ignoreCollapsed,\n newNode: null // Delete the node\n });\n}\n\n/**\n * Removes the node at the specified path and returns the resulting treeData.\n *\n * @param {!Object[]} treeData\n * @param {number[]|string[]} path - Array of keys leading up to node to be deleted\n * @param {!function} getNodeKey - Function to get the key from the nodeData and tree index\n * @param {boolean=} ignoreCollapsed - Ignore children of nodes without `expanded` set to `true`\n *\n * @return {Object} result\n * @return {Object[]} result.treeData - The tree data with the node removed\n * @return {Object} result.node - The node that was removed\n * @return {number} result.treeIndex - The previous treeIndex of the removed node\n */\nexport function removeNode({treeData, path, getNodeKey, ignoreCollapsed = true}) {\n let removedNode = null;\n let removedTreeIndex = null;\n const nextTreeData = changeNodeAtPath({\n treeData,\n path,\n getNodeKey,\n ignoreCollapsed,\n newNode: ({node, treeIndex}) => {\n // Store the target node and delete it from the tree\n removedNode = node;\n removedTreeIndex = treeIndex;\n\n return null;\n }\n });\n\n return {\n treeData: nextTreeData,\n node: removedNode,\n treeIndex: removedTreeIndex\n };\n}\n\n/**\n * Gets the node at the specified path\n *\n * @param {!Object[]} treeData\n * @param {number[]|string[]} path - Array of keys leading up to node to be deleted\n * @param {!function} getNodeKey - Function to get the key from the nodeData and tree index\n * @param {boolean=} ignoreCollapsed - Ignore children of nodes without `expanded` set to `true`\n *\n * @return {Object|null} nodeInfo - The node info at the given path, or null if not found\n */\nexport function getNodeAtPath({treeData, path, getNodeKey, ignoreCollapsed = true}) {\n let foundNodeInfo = null;\n\n try {\n changeNodeAtPath({\n treeData,\n path,\n getNodeKey,\n ignoreCollapsed,\n newNode: ({node, treeIndex}) => {\n foundNodeInfo = {node, treeIndex};\n return node;\n }\n });\n } catch (err) {\n // Ignore the error -- the null return will be explanation enough\n }\n\n return foundNodeInfo;\n}\n\n/**\n * Adds the node to the specified parent and returns the resulting treeData.\n *\n * @param {!Object[]} treeData\n * @param {!Object} newNode - The node to insert\n * @param {number|string} parentKey - The key of the to-be parentNode of the node\n * @param {!function} getNodeKey - Function to get the key from the nodeData and tree index\n * @param {boolean=} ignoreCollapsed - Ignore children of nodes without `expanded` set to `true`\n * @param {boolean=} expandParent - If true, expands the parentNode specified by parentPath\n * @param {boolean=} addAsFirstChild - If true, adds new node as first child of tree\n *\n * @return {Object} result\n * @return {Object[]} result.treeData - The updated tree data\n * @return {number} result.treeIndex - The tree index at which the node was inserted\n */\nexport function addNodeUnderParent({\n treeData,\n newNode,\n parentKey = null,\n getNodeKey,\n ignoreCollapsed = true,\n expandParent = false,\n addAsFirstChild = false\n}) {\n if (parentKey === null) {\n return addAsFirstChild\n ? {\n treeData: [newNode, ...(treeData || [])],\n treeIndex: 0\n }\n : {\n treeData: [...(treeData || []), newNode],\n treeIndex: (treeData || []).length\n };\n }\n\n let insertedTreeIndex = null;\n let hasBeenAdded = false;\n const changedTreeData = map({\n treeData,\n getNodeKey,\n ignoreCollapsed,\n callback: ({node, treeIndex, path}) => {\n const key = path ? path[path.length - 1] : null;\n // Return nodes that are not the parent as-is\n if (hasBeenAdded || key !== parentKey) {\n return node;\n }\n hasBeenAdded = true;\n\n const parentNode = {\n ...node\n };\n\n if (expandParent) {\n parentNode.expanded = true;\n }\n\n // If no children exist yet, just add the single newNode\n if (!parentNode.children) {\n insertedTreeIndex = treeIndex + 1;\n return {\n ...parentNode,\n children: [newNode]\n };\n }\n\n if (typeof parentNode.children === 'function') {\n throw new Error('Cannot add to children defined by a function');\n }\n\n let nextTreeIndex = treeIndex + 1;\n for (let i = 0; i < parentNode.children.length; i += 1) {\n nextTreeIndex += 1 + getDescendantCount({node: parentNode.children[i], ignoreCollapsed});\n }\n\n insertedTreeIndex = nextTreeIndex;\n\n const children = addAsFirstChild ? [newNode, ...parentNode.children] : [...parentNode.children, newNode];\n\n return {\n ...parentNode,\n children\n };\n }\n });\n\n if (!hasBeenAdded) {\n throw new Error('No node found with the given key.');\n }\n\n return {\n treeData: changedTreeData,\n treeIndex: insertedTreeIndex\n };\n}\n\nfunction addNodeAtDepthAndIndex({\n targetDepth,\n minimumTreeIndex,\n newNode,\n ignoreCollapsed,\n expandParent,\n isPseudoRoot = false,\n isLastChild,\n node,\n currentIndex,\n currentDepth,\n getNodeKey,\n path = []\n}) {\n const selfPath = (n) => (isPseudoRoot ? [] : [...path, getNodeKey({node: n, treeIndex: currentIndex})]);\n\n // If the current position is the only possible place to add, add it\n if (currentIndex >= minimumTreeIndex - 1 || (isLastChild && !(node.children && node.children.length))) {\n if (typeof node.children === 'function') {\n throw new Error('Cannot add to children defined by a function');\n } else {\n const extraNodeProps = expandParent ? {expanded: true} : {};\n const nextNode = {\n ...node,\n\n ...extraNodeProps,\n children: node.children ? [newNode, ...node.children] : [newNode]\n };\n\n return {\n node: nextNode,\n nextIndex: currentIndex + 2,\n insertedTreeIndex: currentIndex + 1,\n parentPath: selfPath(nextNode),\n parentNode: isPseudoRoot ? null : nextNode\n };\n }\n }\n\n // If this is the target depth for the insertion,\n // i.e., where the newNode can be added to the current node's children\n if (currentDepth >= targetDepth - 1) {\n // Skip over nodes with no children or hidden children\n if (\n !node.children ||\n typeof node.children === 'function' ||\n (node.expanded !== true && ignoreCollapsed && !isPseudoRoot)\n ) {\n return {node, nextIndex: currentIndex + 1};\n }\n\n // Scan over the children to see if there's a place among them that fulfills\n // the minimumTreeIndex requirement\n let childIndex = currentIndex + 1;\n let insertedTreeIndex = null;\n let insertIndex = null;\n for (let i = 0; i < node.children.length; i += 1) {\n // If a valid location is found, mark it as the insertion location and\n // break out of the loop\n if (childIndex >= minimumTreeIndex) {\n insertedTreeIndex = childIndex;\n insertIndex = i;\n break;\n }\n\n // Increment the index by the child itself plus the number of descendants it has\n childIndex += 1 + getDescendantCount({node: node.children[i], ignoreCollapsed});\n }\n\n // If no valid indices to add the node were found\n if (insertIndex === null) {\n // If the last position in this node's children is less than the minimum index\n // and there are more children on the level of this node, return without insertion\n if (childIndex < minimumTreeIndex && !isLastChild) {\n return {node, nextIndex: childIndex};\n }\n\n // Use the last position in the children array to insert the newNode\n insertedTreeIndex = childIndex;\n insertIndex = node.children.length;\n }\n\n // Insert the newNode at the insertIndex\n const nextNode = {\n ...node,\n children: [...node.children.slice(0, insertIndex), newNode, ...node.children.slice(insertIndex)]\n };\n\n // Return node with successful insert result\n return {\n node: nextNode,\n nextIndex: childIndex,\n insertedTreeIndex,\n parentPath: selfPath(nextNode),\n parentNode: isPseudoRoot ? null : nextNode\n };\n }\n\n // Skip over nodes with no children or hidden children\n if (\n !node.children ||\n typeof node.children === 'function' ||\n (node.expanded !== true && ignoreCollapsed && !isPseudoRoot)\n ) {\n return {node, nextIndex: currentIndex + 1};\n }\n\n // Get all descendants\n let insertedTreeIndex = null;\n let pathFragment = null;\n let parentNode = null;\n let childIndex = currentIndex + 1;\n let newChildren = node.children;\n if (typeof newChildren !== 'function') {\n newChildren = newChildren.map((child, i) => {\n if (insertedTreeIndex !== null) {\n return child;\n }\n\n const mapResult = addNodeAtDepthAndIndex({\n targetDepth,\n minimumTreeIndex,\n newNode,\n ignoreCollapsed,\n expandParent,\n isLastChild: isLastChild && i === newChildren.length - 1,\n node: child,\n currentIndex: childIndex,\n currentDepth: currentDepth + 1,\n getNodeKey,\n path: [] // Cannot determine the parent path until the children have been processed\n });\n\n if ('insertedTreeIndex' in mapResult) {\n ({insertedTreeIndex, parentNode, parentPath: pathFragment} = mapResult);\n }\n\n childIndex = mapResult.nextIndex;\n\n return mapResult.node;\n });\n }\n\n const nextNode = {...node, children: newChildren};\n const result = {\n node: nextNode,\n nextIndex: childIndex\n };\n\n if (insertedTreeIndex !== null) {\n result.insertedTreeIndex = insertedTreeIndex;\n result.parentPath = [...selfPath(nextNode), ...pathFragment];\n result.parentNode = parentNode;\n }\n\n return result;\n}\n\n/**\n * Insert a node into the tree at the given depth, after the minimum index\n *\n * @param {!Object[]} treeData - Tree data\n * @param {!number} depth - The depth to insert the node at (the first level of the array being depth 0)\n * @param {!number} minimumTreeIndex - The lowest possible treeIndex to insert the node at\n * @param {!Object} newNode - The node to insert into the tree\n * @param {boolean=} ignoreCollapsed - Ignore children of nodes without `expanded` set to `true`\n * @param {boolean=} expandParent - If true, expands the parent of the inserted node\n * @param {!function} getNodeKey - Function to get the key from the nodeData and tree index\n *\n * @return {Object} result\n * @return {Object[]} result.treeData - The tree data with the node added\n * @return {number} result.treeIndex - The tree index at which the node was inserted\n * @return {number[]|string[]} result.path - Array of keys leading to the node location after insertion\n * @return {Object} result.parentNode - The parent node of the inserted node\n */\nexport function insertNode({\n treeData,\n depth: targetDepth,\n minimumTreeIndex,\n newNode,\n getNodeKey = () => {},\n ignoreCollapsed = true,\n expandParent = false\n}) {\n if (!treeData && targetDepth === 0) {\n return {\n treeData: [newNode],\n treeIndex: 0,\n path: [getNodeKey({node: newNode, treeIndex: 0})],\n parentNode: null\n };\n }\n\n const insertResult = addNodeAtDepthAndIndex({\n targetDepth,\n minimumTreeIndex,\n newNode,\n ignoreCollapsed,\n expandParent,\n getNodeKey,\n isPseudoRoot: true,\n isLastChild: true,\n node: {children: treeData},\n currentIndex: -1,\n currentDepth: -1\n });\n\n if (!('insertedTreeIndex' in insertResult)) {\n throw new Error('No suitable position found to insert.');\n }\n\n const treeIndex = insertResult.insertedTreeIndex;\n return {\n treeData: insertResult.node.children,\n treeIndex,\n path: [...insertResult.parentPath, getNodeKey({node: newNode, treeIndex})],\n parentNode: insertResult.parentNode\n };\n}\n\n/**\n * Get tree data flattened.\n *\n * @param {!Object[]} treeData - Tree data\n * @param {!function} getNodeKey - Function to get the key from the nodeData and tree index\n * @param {boolean=} ignoreCollapsed - Ignore children of nodes without `expanded` set to `true`\n *\n * @return {{\n * node: Object,\n * path: []string|[]number,\n * lowerSiblingCounts: []number\n * }}[] nodes - The node array\n */\nexport function getFlatDataFromTree({treeData, getNodeKey, ignoreCollapsed = true}) {\n if (!treeData || treeData.length < 1) {\n return [];\n }\n\n const flattened = [];\n walk({\n treeData,\n getNodeKey,\n ignoreCollapsed,\n callback: (nodeInfo) => {\n flattened.push(nodeInfo);\n }\n });\n\n return flattened;\n}\n\n/**\n * Generate a tree structure from flat data.\n *\n * @param {!Object[]} flatData\n * @param {!function=} getKey - Function to get the key from the nodeData\n * @param {!function=} getParentKey - Function to get the parent key from the nodeData\n * @param {string|number=} rootKey - The value returned by `getParentKey` that corresponds to the root node.\n * For example, if your nodes have id 1-99, you might use rootKey = 0\n *\n * @return {Object[]} treeData - The flat data represented as a tree\n */\nexport function getTreeFromFlatData({\n flatData,\n getKey = (node) => node.id,\n getParentKey = (node) => node.parentId,\n rootKey = '0'\n}) {\n if (!flatData) {\n return [];\n }\n\n const childrenToParents = {};\n flatData.forEach((child) => {\n const parentKey = getParentKey(child);\n\n if (parentKey in childrenToParents) {\n childrenToParents[parentKey].push(child);\n } else {\n childrenToParents[parentKey] = [child];\n }\n });\n\n if (!(rootKey in childrenToParents)) {\n return [];\n }\n\n const trav = (parent) => {\n const parentKey = getKey(parent);\n if (parentKey in childrenToParents) {\n return {\n ...parent,\n children: childrenToParents[parentKey].map((child) => trav(child))\n };\n }\n\n return {...parent};\n };\n\n return childrenToParents[rootKey].map((child) => trav(child));\n}\n\n/**\n * Check if a node is a descendant of another node.\n *\n * @param {!Object} older - Potential ancestor of younger node\n * @param {!Object} younger - Potential descendant of older node\n *\n * @return {boolean}\n */\nexport function isDescendant(older, younger) {\n return (\n !!older.children &&\n typeof older.children !== 'function' &&\n older.children.some((child) => child === younger || isDescendant(child, younger))\n );\n}\n\n/**\n * Get the maximum depth of the children (the depth of the root node is 0).\n *\n * @param {!Object} node - Node in the tree\n * @param {?number} depth - The current depth\n *\n * @return {number} maxDepth - The deepest depth in the tree\n */\nexport function getDepth(node, depth = 0) {\n if (!node.children) {\n return depth;\n }\n\n if (typeof node.children === 'function') {\n return depth + 1;\n }\n\n return node.children.reduce((deepest, child) => Math.max(deepest, getDepth(child, depth + 1)), depth);\n}\n\n/**\n * Find nodes matching a search query in the tree,\n *\n * @param {!function} getNodeKey - Function to get the key from the nodeData and tree index\n * @param {!Object[]} treeData - Tree data\n * @param {?string|number} searchQuery - Function returning a boolean to indicate whether the node is a match or not\n * @param {!function} searchMethod - Function returning a boolean to indicate whether the node is a match or not\n * @param {?number} searchFocusOffset - The offset of the match to focus on\n * (e.g., 0 focuses on the first match, 1 on the second)\n * @param {boolean=} expandAllMatchPaths - If true, expands the paths to any matched node\n * @param {boolean=} expandFocusMatchPaths - If true, expands the path to the focused node\n *\n * @return {Object[]} matches - An array of objects containing the matching `node`s, their `path`s and `treeIndex`s\n * @return {Object[]} treeData - The original tree data with all relevant nodes expanded.\n * If expandAllMatchPaths and expandFocusMatchPaths are both false,\n * it will be the same as the original tree data.\n */\nexport function find({\n getNodeKey,\n treeData,\n searchQuery,\n searchMethod,\n searchFocusOffset,\n expandAllMatchPaths = false,\n expandFocusMatchPaths = true\n}) {\n let matchCount = 0;\n const trav = ({isPseudoRoot = false, node, currentIndex, path = []}) => {\n let matches = [];\n let isSelfMatch = false;\n let hasFocusMatch = false;\n // The pseudo-root is not considered in the path\n const selfPath = isPseudoRoot ? [] : [...path, getNodeKey({node, treeIndex: currentIndex})];\n const extraInfo = isPseudoRoot\n ? null\n : {\n path: selfPath,\n treeIndex: currentIndex\n };\n\n // Nodes with with children that aren't lazy\n const hasChildren = node.children && typeof node.children !== 'function' && node.children.length > 0;\n\n // Examine the current node to see if it is a match\n if (!isPseudoRoot && searchMethod({...extraInfo, node, searchQuery})) {\n if (matchCount === searchFocusOffset) {\n hasFocusMatch = true;\n }\n\n // Keep track of the number of matching nodes, so we know when the searchFocusOffset\n // is reached\n matchCount += 1;\n\n // We cannot add this node to the matches right away, as it may be changed\n // during the search of the descendants. The entire node is used in\n // comparisons between nodes inside the `matches` and `treeData` results\n // of this method (`find`)\n isSelfMatch = true;\n }\n\n let childIndex = currentIndex;\n const newNode = {...node};\n if (hasChildren) {\n // Get all descendants\n newNode.children = newNode.children.map((child) => {\n const mapResult = trav({\n node: child,\n currentIndex: childIndex + 1,\n path: selfPath\n });\n\n // Ignore hidden nodes by only advancing the index counter to the returned treeIndex\n // if the child is expanded.\n //\n // The child could have been expanded from the start,\n // or expanded due to a matching node being found in its descendants\n if (mapResult.node.expanded) {\n childIndex = mapResult.treeIndex;\n } else {\n childIndex += 1;\n }\n\n if (mapResult.matches.length > 0 || mapResult.hasFocusMatch) {\n matches = [...matches, ...mapResult.matches];\n if (mapResult.hasFocusMatch) {\n hasFocusMatch = true;\n }\n\n // Expand the current node if it has descendants matching the search\n // and the settings are set to do so.\n if (\n (expandAllMatchPaths && mapResult.matches.length > 0) ||\n ((expandAllMatchPaths || expandFocusMatchPaths) && mapResult.hasFocusMatch)\n ) {\n newNode.expanded = true;\n }\n }\n\n return mapResult.node;\n });\n }\n\n // Cannot assign a treeIndex to hidden nodes\n if (!isPseudoRoot && !newNode.expanded) {\n matches = matches.map((match) => ({\n ...match,\n treeIndex: null\n }));\n }\n\n // Add this node to the matches if it fits the search criteria.\n // This is performed at the last minute so newNode can be sent in its final form.\n if (isSelfMatch) {\n matches = [{...extraInfo, node: newNode}, ...matches];\n }\n\n return {\n node: matches.length > 0 ? newNode : node,\n matches,\n hasFocusMatch,\n treeIndex: childIndex\n };\n };\n\n const result = trav({\n node: {children: treeData},\n isPseudoRoot: true,\n currentIndex: -1\n });\n\n return {\n matches: result.matches,\n treeData: result.node.children\n };\n}\n\nexport default {\n find,\n getDepth,\n isDescendant,\n getTreeFromFlatData,\n getFlatDataFromTree,\n insertNode,\n addNodeUnderParent,\n getNodeAtPath,\n removeNode,\n removeNodeAtPath,\n changeNodeAtPath,\n toggleExpandedForAll,\n map,\n walk,\n getVisibleNodeInfoAtIndex,\n getVisibleNodeCount,\n getDescendantCount\n};\n","import {makeStyles} from '@material-ui/core/styles';\n\nexport const useStyles = makeStyles({\n editor: {\n display: 'flex',\n flexDirection: 'column',\n padding: '0 24px 5px'\n },\n title: {\n color: 'rgba(0, 0, 0, 0.6)',\n fontSize: '16px',\n letterSpacing: '0.15px',\n lineHeight: '24px',\n margin: '17px 0 24px'\n },\n item: {\n marginBottom: '20px'\n },\n dense: {\n marginBottom: 0\n },\n actionButtons: {\n display: 'flex',\n justifyContent: 'flex-end',\n margin: '0 8px 10px',\n\n '& > button': {\n fontSize: '14px',\n lineHeight: '16px',\n marginLeft: '8px',\n padding: '10px 8px',\n backgroundColor: 'rgba(98, 2, 238, 0)'\n }\n }\n});\n","import React, {useCallback, useEffect, useMemo, useRef} from 'react';\nimport PropTypes from 'prop-types';\nimport {Button as Button} from '@material-ui/core';\nimport {Typography as Typography} from '@material-ui/core';\nimport i18n from 'ui-i18n';\nimport classnames from 'classnames';\nimport {always, concat, differenceWith, equals, forEach, path, pipe, prop, when, uniq} from 'ramda';\n\nimport {useStyles} from './styles';\n\nimport {\n AttributeErrorType,\n ConnectionType,\n createTemporaryEntity,\n EntityType,\n findRelatedTemporaryEntities,\n getActivenessAttributes,\n getCreatableAttributeTypes,\n getEntityType,\n getErrorMessage,\n getErrorId,\n MetadataType,\n omitMarks,\n relationEditorAttributeTypesSelectionStrategy,\n RelationsConfigType,\n validateConnection,\n updateConnectionEntityLabel,\n isTempUri,\n isEmptyValue,\n getRelationAttributesList,\n getDefaultRelationTypeObject,\n getInOutRelations\n} from '@reltio/mdm-sdk';\nimport {profile} from '@reltio/mdm-module';\nimport {Divider as Divider} from '@material-ui/core';\nimport ConnectionRelationTypeSelector from '../ConnectionRelationTypeSelector/ConnectionRelationTypeSelector';\nimport ErrorWrapper from '../ErrorWrapper/ErrorWrapper';\nimport EntitySelector from '../attributes/editMode/EntitySelector/EntitySelector';\nimport AttributesList from '../attributes/editMode/AttributesList';\n\nconst areRelatedEntitiesChanged = (initial, actual) =>\n initial.length !== actual.length || initial.some((_, i) => initial[i] !== actual[i]);\n\nconst RelationEditor = ({\n connection,\n modifiedEntity,\n allModifiedEntities,\n dispatch,\n config,\n mode,\n metadata,\n globalSearchRequestOptions,\n error\n}) => {\n const {relationUri, relationType, direction} = connection.relation;\n const isNew = connection.isNew;\n const styles = useStyles();\n const {inRelations: inRelationTypes = [], outRelations: outRelationTypes = []} = useMemo(\n () =>\n getInOutRelations({\n content: connection.parentEntityUri ? config.contentSecondLevel : config.content,\n direction,\n relationType,\n mode,\n metadata\n }),\n [config, direction, relationType, mode, metadata, connection.parentEntityUri]\n );\n const firstLevelRelationAttrTypes = useMemo(() => getRelationAttributesList(metadata, relationType), [\n relationType,\n metadata\n ]);\n const attributeListEntity = useMemo(\n () => ({\n attributes: {\n ...profile.relations.selectors.getRelationAttributesFromConnection(connection)\n },\n ...getActivenessAttributes(connection.relation)\n }),\n [connection]\n );\n\n const initialConnection = useRef(connection);\n const initialModifiedEntity = useRef(modifiedEntity);\n const relatedTempEntities = useMemo(() => findRelatedTemporaryEntities(allModifiedEntities, modifiedEntity), [\n allModifiedEntities,\n modifiedEntity\n ]);\n const relatedTempEntitiesUrisHistory = useRef([]);\n useEffect(() => {\n relatedTempEntitiesUrisHistory.current = pipe(\n concat(relatedTempEntities.map(prop('uri'))),\n uniq\n )(relatedTempEntitiesUrisHistory.current);\n }, [relatedTempEntities]);\n const initialRelatedTempEntities = useRef(relatedTempEntities);\n const defaultRelationType = getDefaultRelationTypeObject(inRelationTypes, outRelationTypes);\n const hasChanges =\n initialConnection.current !== connection ||\n initialModifiedEntity.current !== modifiedEntity ||\n areRelatedEntitiesChanged(initialRelatedTempEntities.current, relatedTempEntities) ||\n (connection.isNew && !isEmptyValue(path(['relation', 'object', 'attributes'], connection)));\n const applyAction = isNew ? profile.relations.actions.addRelation : profile.relations.actions.editRelation;\n\n const onRelationTypeChange = useCallback(\n pipe(profile.relations.actions.setRelationType(config.id, relationUri), dispatch),\n [config, relationUri, dispatch]\n );\n\n const handleClose = useCallback(\n () => pipe(profile.relations.actions.closeRelationEditor, dispatch)(config.id, relationUri),\n [config, relationUri, dispatch]\n );\n\n const updateModifiedEntityLabel = useCallback(\n (connection) => {\n if (modifiedEntity) {\n const entityType = getEntityType(metadata, modifiedEntity.type);\n return updateConnectionEntityLabel(entityType, modifiedEntity, connection);\n }\n return connection;\n },\n [modifiedEntity, metadata]\n );\n\n const setModifiedEntity = useCallback(\n (entity) => dispatch(profile.modifiedEntities.actions.entityCreated(entity)),\n [dispatch]\n );\n\n const deleteModifiedEntity = useCallback(\n (entityUri) => dispatch(profile.modifiedEntities.actions.entityDeleted(entityUri)),\n [dispatch]\n );\n\n const onChangeEntity = useCallback(\n (entity) => {\n if (modifiedEntity) {\n deleteModifiedEntity(modifiedEntity.uri);\n }\n dispatch(profile.relations.actions.setRelationEntity(config.id, relationUri, entity));\n if (error) {\n dispatch(profile.errors.actions.errorDeactivated(getErrorId(error)));\n }\n },\n [config.id, relationUri, dispatch, modifiedEntity, deleteModifiedEntity, error]\n );\n\n const validate = useCallback(() => {\n const errors = validateConnection(metadata, allModifiedEntities, connection);\n dispatch(profile.errors.actions.errorsSet(errors));\n return errors.length === 0;\n }, [connection, metadata, allModifiedEntities, dispatch]);\n\n const resetErrors = useCallback(() => dispatch(profile.errors.actions.errorsSet([])), [dispatch]);\n\n const onApply = useCallback(\n pipe(\n always(connection),\n when(\n validate,\n pipe(\n omitMarks,\n updateModifiedEntityLabel,\n applyAction(config.id),\n dispatch,\n always(\n differenceWith(\n equals,\n relatedTempEntitiesUrisHistory.current,\n relatedTempEntities.map(prop('uri'))\n )\n ),\n forEach(deleteModifiedEntity),\n handleClose\n )\n )\n ),\n [connection, config, dispatch, updateModifiedEntityLabel, validate, relatedTempEntities]\n );\n\n const onCancel = useCallback(() => {\n const initialEntity = initialModifiedEntity.current;\n if (modifiedEntity !== initialEntity) {\n if (initialEntity) {\n setModifiedEntity(initialEntity);\n if (modifiedEntity && modifiedEntity.uri !== initialEntity.uri) {\n deleteModifiedEntity(modifiedEntity.uri);\n }\n } else {\n deleteModifiedEntity(modifiedEntity.uri);\n }\n }\n const initialTempEntities = initialRelatedTempEntities.current;\n const entitiesUrisToDelete = differenceWith(\n equals,\n relatedTempEntitiesUrisHistory.current,\n initialTempEntities.map(prop('uri'))\n );\n entitiesUrisToDelete.forEach(deleteModifiedEntity);\n initialTempEntities.forEach(setModifiedEntity);\n resetErrors();\n handleClose();\n }, [handleClose, setModifiedEntity, deleteModifiedEntity, resetErrors, modifiedEntity]);\n\n const onAddAttributes = useCallback(\n (params) =>\n pipe(profile.actions.addAttributes, dispatch)(params.map((param) => ({...param, viewId: config.id}))),\n [config.id, dispatch]\n );\n\n const onChangeAttribute = useCallback(\n (params) => pipe(profile.actions.modifyAttribute, dispatch)({...params, viewId: config.id}),\n [config.id, dispatch]\n );\n\n const onDeleteAttribute = useCallback(\n (params) => pipe(profile.actions.removeAttribute, dispatch)({...params, viewId: config.id}),\n [config.id, dispatch]\n );\n\n const onCreateEntity = useCallback(\n (entityTypeUri, initValue) => {\n const entityType = getEntityType(metadata, entityTypeUri);\n const newEntityAttrTypes = pipe(\n relationEditorAttributeTypesSelectionStrategy,\n getCreatableAttributeTypes(mode)\n )(entityType);\n const newEntity = createTemporaryEntity({\n entityTypeUri,\n initValue,\n attributeTypes: newEntityAttrTypes,\n metadata,\n mode\n });\n onChangeEntity(newEntity);\n setModifiedEntity(newEntity);\n },\n [setModifiedEntity, onChangeEntity, mode, metadata]\n );\n const errorMessage = getErrorMessage(error);\n\n const getEntityTypesUris = useCallback(() => {\n const {content, contentSecondLevel} = config;\n\n if (contentSecondLevel && connection.parentEntityUri) {\n return contentSecondLevel.entityTypes;\n }\n\n return content.entityTypes;\n }, [config, connection.parentEntityUri]);\n\n return (\n <>\n <div className={styles.editor}>\n <Typography className={styles.title}>\n {isNew ? i18n.text('Add new item') : i18n.text('Edit item')}\n </Typography>\n {defaultRelationType === null && (\n <ConnectionRelationTypeSelector\n className={styles.item}\n relation={connection.relation}\n inRelationTypes={inRelationTypes}\n outRelationTypes={outRelationTypes}\n onChange={onRelationTypeChange}\n />\n )}\n {Boolean(relationType) && (\n <>\n <ErrorWrapper errorMessage={errorMessage}>\n <EntitySelector\n className={classnames(styles.item, {\n [styles.dense]:\n errorMessage || (connection.entity && isTempUri(connection.entity.entityUri))\n })}\n entity={connection.entity || {}}\n entityTypesUris={getEntityTypesUris() || []}\n max={config.max || 20}\n globalSearchRequestOptions={globalSearchRequestOptions}\n mode={mode}\n onChange={onChangeEntity}\n onCreate={onCreateEntity}\n metadata={metadata}\n attributeTypesSelectionStrategy={relationEditorAttributeTypesSelectionStrategy}\n />\n </ErrorWrapper>\n <AttributesList\n className={styles.item}\n attrTypes={firstLevelRelationAttrTypes}\n entity={attributeListEntity}\n showEmptyEditors={true}\n crosswalks={connection.crosswalks}\n mode={mode}\n parentUri={relationUri}\n onAddAttributes={onAddAttributes}\n onChangeAttribute={onChangeAttribute}\n onDeleteAttribute={onDeleteAttribute}\n />\n </>\n )}\n </div>\n <div className={styles.actionButtons}>\n <Button onClick={onCancel}>{i18n.text('Cancel')}</Button>\n <Button color=\"primary\" disabled={!hasChanges} onClick={onApply}>\n {i18n.text('Apply')}\n </Button>\n </div>\n <Divider />\n </>\n );\n};\n\nRelationEditor.propTypes = {\n connection: ConnectionType,\n modifiedEntity: EntityType,\n allModifiedEntities: PropTypes.object,\n dispatch: PropTypes.func,\n config: RelationsConfigType,\n mode: PropTypes.string,\n metadata: MetadataType,\n globalSearchRequestOptions: PropTypes.object,\n error: AttributeErrorType,\n parentEntityUri: PropTypes.string\n};\n\nexport default RelationEditor;\n","import RelationEditor from './RelationEditor';\nimport mdmModule, {profile} from '@reltio/mdm-module';\nimport {connect} from 'react-redux';\nimport {getRelationEditorActiveError, isTempUri} from '@reltio/mdm-sdk';\n\nconst getConnectionEntityUri = (props) => profile.relations.selectors.getEntityUriFromConnection(props.connection);\n\nconst mapStateToProps = (state, ownProps) => {\n const entityUri = getConnectionEntityUri(ownProps);\n const isTempEntity = isTempUri(entityUri);\n return {\n modifiedEntity: isTempEntity ? mdmModule.selectors.getModifiedEntity(state, entityUri) : null,\n allModifiedEntities: isTempEntity ? mdmModule.selectors.getModifiedEntities(state) : null,\n globalSearchRequestOptions: mdmModule.selectors.getGlobalSearchRequestOptions(state, ['ovOnly']),\n error: getRelationEditorActiveError(ownProps.connection, mdmModule.selectors.getProfileErrors(state))\n };\n};\n\nexport {RelationEditor};\n\nexport default connect(mapStateToProps)(RelationEditor);\n","import {curry, defaultTo, mergeAll, pick, pipe, prop, propEq, __} from 'ramda';\n\nexport const getReltioViewId = (id) => id.split(/\\d+_/)[1];\n\nexport const reltioLayoutItemToReactGridLayoutItem = ({\n x,\n y,\n width,\n height,\n id,\n minWidth,\n minHeight,\n maxWidth,\n maxHeight,\n isStatic\n}) => ({\n x,\n y,\n w: width,\n h: height,\n minW: minWidth,\n minH: minHeight,\n maxW: maxWidth,\n maxH: maxHeight,\n i: id,\n static: isStatic\n});\n\nexport const reactGridLayoutItemToReltioLayoutItem = ({x, y, w, h, maxW, minW, minH, maxH, i, ...obj}) => ({\n x,\n y,\n width: w,\n height: h,\n minWidth: minW,\n minHeight: minH,\n maxWidth: maxW,\n maxHeight: maxH,\n id: i,\n isStatic: obj.static\n});\n\nexport const reltioLayoutToReactGridLayout = (layout) => (layout || []).map(reltioLayoutItemToReactGridLayoutItem);\n\nexport const reactGridLayoutToReltioLayout = (layout) => (layout || []).map(reactGridLayoutItemToReltioLayoutItem);\n\nexport const getReltioLayoutItemById = curry((layout, id) => (layout || []).find(propEq('id', id)));\n\nconst updateExtraPropsInLayoutItem = curry((props, from, to) => mergeAll([to, pick(props, from)]));\n\nexport const copyPropsFromPreviousLayout = curry((props, oldReltioLayout, reltioLayout) =>\n (reltioLayout || []).map((layoutItem) =>\n pipe(\n prop('id'),\n getReltioLayoutItemById(oldReltioLayout),\n defaultTo({}),\n updateExtraPropsInLayoutItem(props, __, layoutItem)\n )(layoutItem)\n )\n);\n\nexport const calcHeight = (height, options) => {\n const {margin, rowHeight} = options;\n\n return Math.ceil((height + margin[1]) / (rowHeight + margin[1]));\n};\n","export const RESIZE_ICON = `<svg width=\"10\" height=\"10\" viewBox=\"0 0 10 10\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path stroke=\"#505050\" stroke-opacity=\".54\" d=\"M9.5 0v10M0 9.5h9M7.5 4v4M4 7.5h3\"/>\n</svg>`;\n","import {makeStyles} from '@material-ui/core/styles';\nimport {svg2Url} from '@reltio/mdm-sdk';\nimport {RESIZE_ICON} from './icons/ResizeIcon.svg';\n\nexport const useStyles = makeStyles((_) => ({\n gridLayout: {\n position: 'relative',\n width: '100%',\n '& .react-grid-item': {\n '&.react-grid-placeholder': {\n background: 'rgba(0, 0, 0, 0.03)',\n border: '2px dashed rgba(0, 0, 0, 0.3)',\n borderRadius: '3px',\n transitionDuration: '100ms',\n zIndex: 7,\n userSelect: 'none',\n '& .react-resizable-handle': {\n display: 'none'\n }\n },\n '&.static .react-resizable-handle': {\n display: 'none'\n },\n '&.cssTransforms': {\n transitionProperty: 'transform'\n },\n '&.resizing': {\n zIndex: 9,\n willChange: 'width, height',\n pointerEvents: 'none'\n },\n '&.react-draggable-dragging': {\n transition: 'none',\n zIndex: 8,\n willChange: 'transform',\n '& .react-resizable-handle': {\n backgroundImage: 'none'\n }\n },\n '& .react-resizable-handle': {\n position: 'absolute',\n width: '17px',\n height: '17px',\n bottom: 0,\n right: 0,\n zIndex: 20,\n backgroundImage: `url('${svg2Url(RESIZE_ICON)}')`,\n backgroundRepeat: 'no-repeat',\n backgroundOrigin: 'content-box',\n boxSizing: 'border-box',\n cursor: 'se-resize'\n },\n '&.fullscreen': {\n visibility: 'visible',\n position: 'unset',\n width: '100% !important',\n height: '100% !important',\n transform: 'translate(0) !important'\n }\n }\n },\n\n gridFullscreen: {\n height: '100% !important',\n overflowY: 'hidden',\n '& .react-resizable-handle, & .react-grid-item': {\n visibility: 'hidden'\n }\n }\n}));\n","import PropTypes from 'prop-types';\nimport React, {useCallback, useMemo, useRef, useState, memo} from 'react';\nimport GridLayout from 'react-grid-layout';\nimport ReactResizeDetector from 'react-resize-detector';\nimport {identity, pipe} from 'ramda';\nimport classnames from 'classnames';\nimport {\n reltioLayoutToReactGridLayout,\n reactGridLayoutToReltioLayout,\n reactGridLayoutItemToReltioLayoutItem,\n copyPropsFromPreviousLayout,\n calcHeight,\n getReltioLayoutItemById\n} from './helpers';\n\nimport {useStyles} from './styles';\n\nconst ReltioGridLayout = ({\n views,\n layout,\n layoutOptions,\n onLayoutChanged,\n draggableHandle,\n LayoutItem,\n onRemove,\n onDrop,\n droppingItem,\n isDroppable,\n classes\n}) => {\n const ref = useRef();\n const styles = useStyles();\n const [fullscreenItemId, setFullscreenItemId] = useState(null);\n const [width, setWidth] = useState(0);\n const {cols, rowHeight, margin} = layoutOptions;\n const processedLayout = useMemo(() => reltioLayoutToReactGridLayout(layout), [layout]);\n const onReltioLayoutChanged = pipe(\n reactGridLayoutToReltioLayout,\n copyPropsFromPreviousLayout(['autosizing'], layout),\n onLayoutChanged\n );\n const handleDrop = (layout, layoutItem, e) => {\n if (onDrop) {\n onDrop(reactGridLayoutToReltioLayout(layout), reactGridLayoutItemToReltioLayoutItem(layoutItem), e);\n }\n };\n const onToggleFullscreen = useCallback((id) => setFullscreenItemId((prevId) => (prevId ? null : id)), []);\n const isFullscreenEnabled = fullscreenItemId !== null;\n\n const onItemHeightResize = useCallback(\n (height, layoutId) => {\n let isLayoutChanged = false;\n\n const newLayout = layout.map((layoutItem) => {\n if (layoutItem.id === layoutId && height) {\n const newHeight = calcHeight(height, layoutOptions);\n\n if (layoutItem.height !== newHeight) {\n isLayoutChanged = true;\n return {\n ...layoutItem,\n minHeight: newHeight,\n maxHeight: newHeight,\n height: newHeight\n };\n }\n }\n return layoutItem;\n });\n\n if (isLayoutChanged) {\n onLayoutChanged(newLayout);\n }\n },\n [layout, layoutOptions, onLayoutChanged]\n );\n\n const getAutosizeComponent = (layoutItemId) => {\n return (\n <ReactResizeDetector\n handleHeight\n onResize={(width, height) => {\n onItemHeightResize(height, layoutItemId);\n }}\n />\n );\n };\n\n return (\n <>\n <ReactResizeDetector\n refreshMode=\"debounce\"\n refreshRate={50}\n handleWidth={true}\n onResize={(width) => setWidth(width)}\n />\n <GridLayout\n innerRef={ref}\n layout={processedLayout}\n cols={cols}\n draggableHandle={draggableHandle}\n autoSize={true}\n rowHeight={rowHeight}\n width={width}\n margin={margin}\n onLayoutChange={onReltioLayoutChanged}\n isResizable={!isFullscreenEnabled}\n isDraggable={!isFullscreenEnabled}\n className={classnames(classes.root, styles.gridLayout, {[styles.gridFullscreen]: isFullscreenEnabled})}\n onDrop={handleDrop}\n droppingItem={droppingItem}\n isDroppable={isDroppable}\n >\n {processedLayout.map((layoutItem) => {\n const isItemFullscreen = fullscreenItemId === layoutItem.i;\n const isAutosize = (getReltioLayoutItemById(layout, layoutItem.i) || {}).autosizing;\n const autosizeComponent = isAutosize ? {AutosizeComponent: getAutosizeComponent(layoutItem.i)} : {};\n return (\n <LayoutItem\n key={layoutItem.i}\n layoutItemConfig={layoutItem}\n views={views}\n onToggleFullscreen={onToggleFullscreen}\n onRemove={onRemove}\n className={classnames({fullscreen: isItemFullscreen}, classes.item)}\n isFullscreen={isItemFullscreen}\n {...autosizeComponent}\n />\n );\n })}\n </GridLayout>\n </>\n );\n};\n\nReltioGridLayout.defaultProps = {\n layoutOptions: {\n cols: 4,\n rowHeight: 30,\n margin: [15, 15]\n },\n onConfigChanged: identity,\n onLayoutChanged: identity,\n classes: {}\n};\nReltioGridLayout.propTypes = {\n views: PropTypes.array,\n layout: PropTypes.array,\n layoutOptions: PropTypes.object,\n onConfigChanged: PropTypes.func,\n onLayoutChanged: PropTypes.func,\n onDrop: PropTypes.func,\n onRemove: PropTypes.func,\n LayoutItem: PropTypes.elementType,\n draggableHandle: PropTypes.string,\n isDroppable: PropTypes.bool,\n droppingItem: PropTypes.object,\n classes: PropTypes.shape({\n root: PropTypes.string,\n item: PropTypes.string\n })\n};\n\nexport default memo(ReltioGridLayout);\n","import React, {useEffect, useState} from 'react';\nimport {createPortal} from 'react-dom';\nimport {MapInstance} from '../../types';\n\ntype Props = {\n children: React.ReactNode;\n className?: string;\n position: number;\n map: MapInstance;\n};\n\nexport const MapControlContainer = ({children, className, position, map}: Props) => {\n const [controlElement, setControlElement] = useState(null);\n\n useEffect(() => {\n const controlDiv = document.createElement('div');\n const divIndex = map.controls[position].length;\n map.controls[position].push(controlDiv);\n setControlElement(controlDiv);\n\n return () => {\n map.controls[position].removeAt(divIndex);\n };\n }, [map, position]);\n\n useEffect(() => {\n if (controlElement && className) {\n controlElement.classList.add(className);\n }\n }, [className, controlElement]);\n\n if (controlElement) {\n return createPortal(children, controlElement);\n }\n\n return null;\n};\n","import React from 'react';\n\nconst SvgRadius: React.FC<React.SVGProps<SVGSVGElement>> = (props) => {\n return (\n <svg width={18} height={18} viewBox=\"0 0 18 18\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <path\n 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\"\n fill=\"#000\"\n stroke=\"none\"\n strokeWidth={1}\n fillRule=\"evenodd\"\n opacity={0.54}\n />\n </svg>\n );\n};\n\nexport default SvgRadius;\n","import React from 'react';\n\nconst SvgDraw: React.FC<React.SVGProps<SVGSVGElement>> = (props) => {\n return (\n <svg\n width={24}\n height={24}\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlnsXlink=\"http://www.w3.org/1999/xlink\"\n {...props}\n >\n <defs>\n <path\n 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\"\n id=\"Draw_svg__a\"\n />\n </defs>\n <g stroke=\"none\" strokeWidth={1} fill=\"none\" fillRule=\"evenodd\">\n <mask id=\"Draw_svg__b\" fill=\"#fff\">\n <use xlinkHref=\"#Draw_svg__a\" />\n </mask>\n <g mask=\"url(#Draw_svg__b)\" fill=\"#000\" fillOpacity={0.54}>\n <path d=\"M0 0h24v24H0z\" />\n </g>\n </g>\n </svg>\n );\n};\n\nexport default SvgDraw;\n","import {makeStyles} from '@material-ui/core/styles';\n\nexport const useStyles = makeStyles({\n container: {\n margin: '2px',\n display: 'flex',\n alignItems: 'center'\n },\n button: {\n color: 'rgba(0,0,0,0.54)',\n padding: 0,\n height: '24px',\n width: '24px',\n minWidth: 0\n },\n icon: {\n width: '20px',\n height: '20px'\n }\n});\n","import React from 'react';\nimport i18n from 'ui-i18n';\nimport {Button as Button} from '@material-ui/core';\nimport {withTooltip} from '../../../../HOCs';\nimport HighlightOffIcon from '@material-ui/icons/HighlightOff';\nimport {MAP_DRAWING_MODES} from '../../../../constants';\nimport RadiusIcon from '../../../../icons/Radius';\nimport DrawIcon from '../../../../icons/Draw';\nimport {DrawingMode, DrawingModes} from '../../types';\nimport {useStyles} from './styles';\n\nexport const ButtonWithTooltip = withTooltip(Button);\n\nconst getIcon = (mode: DrawingMode) => {\n switch (mode) {\n case MAP_DRAWING_MODES.CIRCLE:\n return RadiusIcon;\n case MAP_DRAWING_MODES.POLYGON:\n return DrawIcon;\n default:\n return null;\n }\n};\n\ntype Props = {\n onDrawingModeChanged: (value: DrawingMode | null) => void;\n drawingMode: DrawingMode | null;\n drawingModes: DrawingModes;\n hasActiveOverlay: boolean;\n onClearOverlay: () => void;\n};\n\nexport const TopRightMapControls = ({\n drawingMode,\n drawingModes = [],\n hasActiveOverlay,\n onDrawingModeChanged,\n onClearOverlay\n}: Props) => {\n const styles = useStyles();\n\n const changeDrawingModeTo = (drawingMode) => () => {\n onDrawingModeChanged(drawingMode);\n };\n\n return (\n <div className={styles.container}>\n {drawingMode || hasActiveOverlay ? (\n <ButtonWithTooltip\n tooltipTitle={i18n.text('Clear area')}\n className={styles.button}\n onClick={hasActiveOverlay ? onClearOverlay : changeDrawingModeTo(null)}\n >\n <HighlightOffIcon className={styles.icon} />\n </ButtonWithTooltip>\n ) : (\n drawingModes.map((mode) => {\n const Icon = getIcon(mode);\n return (\n <ButtonWithTooltip\n tooltipTitle={i18n.text('Draw area')}\n key={mode}\n className={styles.button}\n onClick={changeDrawingModeTo(mode)}\n >\n <Icon className={styles.icon} />\n </ButtonWithTooltip>\n );\n })\n )}\n </div>\n );\n};\n","import {makeStyles} from '@material-ui/core/styles';\n\nexport const useStyles = makeStyles({\n container: {\n height: '28px',\n marginRight: '7px',\n marginLeft: 0\n },\n label: {\n fontSize: '11px',\n alignSelf: 'center',\n lineHeight: '13px',\n marginLeft: '2px',\n letterSpacing: 0\n },\n checkbox: {\n width: '20px',\n height: '20px',\n padding: '5px',\n '& svg': {\n width: '16px',\n height: '16px'\n }\n }\n});\n","import React from 'react';\nimport i18n from 'ui-i18n';\nimport {FormControlLabel as FormControlLabel} from '@material-ui/core';\nimport {Checkbox as Checkbox} from '@material-ui/core';\nimport {useStyles} from './styles';\n\ntype Props = {\n isSearchOnMapMove: boolean;\n onChangeIsSearchOnMapMove: (value: boolean) => void;\n};\n\nexport const TopCenterMapControls = ({isSearchOnMapMove, onChangeIsSearchOnMapMove}: Props) => {\n const styles = useStyles();\n const onChange = (event) => {\n onChangeIsSearchOnMapMove(event.target.checked);\n };\n return (\n <FormControlLabel\n classes={{\n root: styles.container,\n label: styles.label\n }}\n control={\n <Checkbox checked={isSearchOnMapMove} onChange={onChange} color=\"primary\" className={styles.checkbox} />\n }\n label={i18n.text('Search as I move the map')}\n />\n );\n};\n","import {MAP_DRAWING_MODES, MAP_MINIMUM_SCALE_RADIUS} from '../../../constants';\nimport {DrawingMode, EntityMarker, Overlay, MapInstance} from '../types';\n\nexport const getMapBoundsPolygon = (map: MapInstance) => {\n const bounds = map.getBounds();\n const ne = bounds.getNorthEast();\n const sw = bounds.getSouthWest();\n const neLat = ne.lat(),\n neLng = ne.lng(),\n swLat = sw.lat(),\n swLng = sw.lng();\n const additionalPoint1 = [];\n const additionalPoint2 = [];\n if (!((neLng === 180 && swLng === -180) || (neLng === -180 && swLng === 180))) {\n // excluding corner case when we see more than one \"map unfolding\" (in this case google maps automatically set 180 and -180),\n // we can't describe map bounds as just rectangle, because lng distance can be more than 180\",\n // so we need to add additional points to have correct polygon\n const center = bounds.getCenter();\n additionalPoint1.push([neLat, center.lng()]);\n additionalPoint2.push([swLat, center.lng()]);\n }\n return [[neLat, neLng], ...additionalPoint1, [neLat, swLng], [swLat, swLng], ...additionalPoint2, [swLat, neLng]];\n};\n\nexport const getDrawingMode = (drawingMode: DrawingMode) => {\n switch (drawingMode) {\n case MAP_DRAWING_MODES.CIRCLE:\n return window.google.maps.drawing.OverlayType.CIRCLE;\n case MAP_DRAWING_MODES.POLYGON:\n return window.google.maps.drawing.OverlayType.POLYGON;\n default:\n return null;\n }\n};\n\nexport const fitMapBoundsForMarkers = (markers: EntityMarker[], map: MapInstance, overlay: Overlay) => {\n const bounds = new window.google.maps.LatLngBounds();\n\n markers.forEach((marker) => bounds.extend(marker.point));\n\n if (markers.length === 1) {\n const center = bounds.getCenter();\n\n bounds.extend(\n new window.google.maps.LatLng(\n center.lat() + MAP_MINIMUM_SCALE_RADIUS,\n center.lng() + MAP_MINIMUM_SCALE_RADIUS\n )\n );\n bounds.extend(\n new window.google.maps.LatLng(\n center.lat() - MAP_MINIMUM_SCALE_RADIUS,\n center.lng() - MAP_MINIMUM_SCALE_RADIUS\n )\n );\n }\n\n map.fitBounds(bounds);\n\n if (overlay) {\n fitMapBoundsForOverlay(map, overlay, bounds);\n }\n};\n\nexport const fitMapBoundsForOverlay = (map: MapInstance, overlay: Overlay, existingBounds?) => {\n if (overlay.path) {\n const bounds = existingBounds || new window.google.maps.LatLngBounds();\n overlay.path.forEach(({lat, lng}) => bounds.extend(new window.google.maps.LatLng(lat, lng)));\n map.fitBounds(bounds);\n }\n};\n","export const MARKER = `<?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>`;\n","import {makeStyles} from '@material-ui/core/styles';\n\nexport const useStyles = makeStyles({\n popper: {\n maxWidth: '263px',\n minWidth: '150px',\n 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)',\n backgroundColor: 'white',\n borderRadius: '2px'\n }\n});\n","import React, {memo, useCallback, useContext, useRef, useState} from 'react';\nimport {pathEq} from 'ramda';\nimport {Marker, InfoBox, MarkerProps} from '@react-google-maps/api';\nimport ProfileCard from '../../ProfileCard/ProfileCard';\nimport Popper from '../../Popper/Popper';\nimport {debounce, svg2Url} from '@reltio/mdm-sdk';\nimport {EntityMarkerContext} from '../../../contexts';\nimport {MARKER} from './icons/marker.inline.svg';\nimport {HOVERED_MARKER} from './icons/marker-hover.inline.svg';\nimport {EntityMarker as EntityMarkerType} from '../types';\nimport {useStyles} from './styles';\n\nconst HIDE_DEBOUNCE_INTERVAL = 50;\nconst MARKER_WIDTH = 22;\nconst MARKER_HEIGHT = 32;\nconst MARKER_CARD_MARGIN = 8;\n\nconst hoveredMarkerIcon = svg2Url(HOVERED_MARKER);\nconst markerIcon = svg2Url(MARKER);\n\ntype Props = {\n marker: EntityMarkerType;\n onClick: (marker: EntityMarkerType) => void;\n} & Omit<MarkerProps, 'onClick' | 'icon' | 'position' | 'visible' | 'onMouseOver' | 'onMouseOut'>;\n\nconst EntityMarker = ({marker, onClick, ...otherProps}: Props) => {\n const styles = useStyles();\n const popperAnchor = useRef();\n const [hovered, setHovered] = useState(false);\n const {activeEntityUri} = useContext(EntityMarkerContext);\n const isActive = pathEq(['entity', 'uri'], activeEntityUri, marker);\n const position = {lat: marker.point.lat, lng: marker.point.lng};\n const setHoveredDebounced = useCallback(debounce(setHovered, HIDE_DEBOUNCE_INTERVAL), []);\n const onMouseOver = useCallback(() => setHoveredDebounced(true), [setHoveredDebounced]);\n const onMouseOut = useCallback(() => setHoveredDebounced(false), [setHoveredDebounced]);\n const handleClick = useCallback(() => onClick(marker), [onClick, marker]);\n\n return (\n <>\n <Popper\n anchorEl={popperAnchor.current}\n open={hovered}\n className={styles.popper}\n modal={false}\n placement=\"top\"\n >\n <ProfileCard entity={marker.entity} onMouseOver={onMouseOver} onMouseOut={onMouseOut} />\n </Popper>\n <Marker\n icon={{\n url: hovered || isActive ? hoveredMarkerIcon : markerIcon,\n // needed for IE:\n scaledSize: new google.maps.Size(MARKER_WIDTH, MARKER_HEIGHT) //eslint-disable-line\n }}\n position={position}\n onClick={handleClick}\n visible={marker.visible !== false}\n onMouseOver={onMouseOver}\n onMouseOut={onMouseOut}\n {...otherProps}\n />\n <InfoBox\n options={{\n alignBottom: true,\n pane: 'mapPane',\n pixelOffset: new google.maps.Size(0, -(MARKER_HEIGHT + MARKER_CARD_MARGIN)), //eslint-disable-line\n closeBoxURL: '',\n enableEventPropagation: true,\n disableAutoPan: true\n }}\n position={position}\n >\n <span ref={popperAnchor} />\n </InfoBox>\n </>\n );\n};\n\nexport default memo(EntityMarker);\n","export const HOVERED_MARKER = `<?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>`;\n","import {makeStyles} from '@material-ui/core/styles';\n\nexport const useStyles = makeStyles({\n mapControlContainer: {\n borderRadius: '2px',\n backgroundColor: '#FFFFFF',\n boxShadow: '0 1px 3px 0 rgba(0,0,0,0.15)',\n margin: '10px'\n }\n});\n","import React, {useCallback, useEffect, useMemo, useRef, useState} from 'react';\nimport {propEq, isEmpty, prop} from 'ramda';\nimport {\n GoogleMap,\n useJsApiLoader,\n GoogleMapProps,\n Polygon,\n DrawingManager,\n MarkerClusterer,\n LoadScriptProps,\n MarkerClustererProps\n} from '@react-google-maps/api';\nimport {MapControlContainer} from './MapControls/MapControlContainer/MapControlContrainer';\nimport {TopRightMapControls} from './MapControls/TopRightMapControls/TopRightMapControls';\nimport {TopCenterMapControls} from './MapControls/TopCenterMapControls/TopCenterMapControls';\nimport {getMapBoundsPolygon, getDrawingMode, fitMapBoundsForMarkers, fitMapBoundsForOverlay} from './helpers';\nimport EntityMarker from './EntityMarker/EntityMarker';\nimport {DEFAULT_GOOGLE_MAP_OPTIONS, DEFAULT_OVERLAY_OPTIONS, MAP_DRAWING_MODES} from '../../constants';\nimport {DrawingModes, EntityMarker as Marker, MapBounds, Overlay, OverlayPath} from './types';\nimport {useStyles} from './styles';\nimport {usePrevious} from '../../hooks';\n\nconst ON_MAP_MOVE_DEBOUNCE_INTERVAL = 1000;\n\ntype Props = {\n markers: Marker[];\n mapKey: string;\n defaultZoom: GoogleMapProps['zoom'];\n defaultCenter: GoogleMapProps['center'];\n loadingElement: JSX.Element;\n isSearchOnMapMove?: boolean;\n isSearchEnabled?: boolean;\n activeOverlay?: Overlay;\n overlayOptions?: google.maps.PolygonOptions | google.maps.CircleOptions;\n drawingModes?: DrawingModes;\n markerClusterer?: boolean;\n markerClustererOptions?: MarkerClustererProps['options'];\n mapOptions?: google.maps.MapOptions;\n mapContainerClassName: string;\n onMapBoundsChanged?: (value: MapBounds | null) => void;\n onOverlayUpdated?: (value: {data: OverlayPath; type: string}) => void;\n onMarkerClicked?: (value: Marker) => void;\n};\n\nconst libraries = ['drawing'] as LoadScriptProps['libraries'];\n\nconst useFitMapBounds = ({markers, activeOverlay, isSearchOnMapMove, map}) => {\n const prevMarkers = usePrevious(markers);\n const prevActiveOverlay = usePrevious(activeOverlay);\n const apiIsLoaded = map && window.google;\n\n useEffect(() => {\n if (apiIsLoaded && !isSearchOnMapMove && markers.length && markers !== prevMarkers) {\n fitMapBoundsForMarkers(markers, map, activeOverlay);\n } else if (apiIsLoaded && activeOverlay && activeOverlay !== prevActiveOverlay) {\n fitMapBoundsForOverlay(map, activeOverlay);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [map, markers, activeOverlay]);\n};\n\nexport const ReltioMap = ({\n markers = [],\n mapKey,\n defaultZoom,\n defaultCenter,\n loadingElement,\n isSearchOnMapMove,\n isSearchEnabled,\n activeOverlay,\n overlayOptions,\n drawingModes = [],\n markerClusterer,\n markerClustererOptions,\n mapOptions,\n mapContainerClassName,\n onMapBoundsChanged,\n onOverlayUpdated,\n onMarkerClicked\n}: Props) => {\n const styles = useStyles();\n const {isLoaded, loadError} = useJsApiLoader({\n googleMapsApiKey: mapKey,\n libraries\n });\n\n const mapMoveEndTimer = useRef(null);\n const [map, setMap] = useState(null);\n const [polygon, setPolygon] = useState(null);\n const [drawingMode, setDrawingMode] = useState(null);\n\n useFitMapBounds({markers, activeOverlay, map, isSearchOnMapMove});\n\n const allOverlayOptions = useMemo(\n () => ({\n ...DEFAULT_OVERLAY_OPTIONS,\n ...(overlayOptions || {})\n }),\n [overlayOptions]\n );\n\n const googleMapOptions = useMemo(\n () => ({\n ...DEFAULT_GOOGLE_MAP_OPTIONS,\n ...(mapOptions || {})\n }),\n [mapOptions]\n );\n\n const handleChangeIsSearchOnMapMove = useCallback(\n (isSearchOnMapMove: boolean) => {\n onMapBoundsChanged(isSearchOnMapMove ? getMapBoundsPolygon(map) : null);\n setDrawingMode(null);\n clearTimeout(mapMoveEndTimer.current);\n },\n [map, onMapBoundsChanged]\n );\n\n const handleMapMoveStart = useCallback(() => {\n clearTimeout(mapMoveEndTimer.current);\n }, []);\n\n const handleMapMoveEnd = useCallback(() => {\n if (isSearchOnMapMove) {\n onMapBoundsChanged(getMapBoundsPolygon(map));\n }\n }, [isSearchOnMapMove, map, onMapBoundsChanged]);\n\n const handleMapIdle = useCallback(() => {\n if (isSearchOnMapMove) {\n clearTimeout(mapMoveEndTimer.current);\n mapMoveEndTimer.current = setTimeout(handleMapMoveEnd, ON_MAP_MOVE_DEBOUNCE_INTERVAL);\n }\n }, [handleMapMoveEnd, isSearchOnMapMove]);\n\n const handleOverlayChange = useCallback(\n (e, propOverlay?) => {\n const stateOverlay =\n propOverlay ||\n (polygon && {\n type: MAP_DRAWING_MODES.POLYGON,\n overlay: polygon\n });\n\n if (!isEmpty(stateOverlay) && typeof onOverlayUpdated === 'function') {\n const {overlay, type} = stateOverlay;\n\n const typeActions = {\n [MAP_DRAWING_MODES.POLYGON]: () => {\n return overlay\n .getPath()\n .getArray()\n .map((latlng) => [latlng.lat(), latlng.lng()]);\n },\n [MAP_DRAWING_MODES.CIRCLE]: () => {\n return {radius: overlay.getRadius() / 1000, center: overlay.getCenter()};\n }\n };\n\n const data = typeActions[type] && typeActions[type]();\n data && onOverlayUpdated({data, type});\n }\n },\n [onOverlayUpdated, polygon]\n );\n\n const handleOverlayComplete = useCallback(\n (type) => (overlay) => {\n handleOverlayChange(null, {type, overlay});\n overlay.setMap(null);\n setDrawingMode(null);\n },\n [handleOverlayChange]\n );\n\n const handleClearOverlay = useCallback(() => {\n onOverlayUpdated(null);\n }, [onOverlayUpdated]);\n\n const renderMarkers = (clusterer?) => {\n return markers\n .filter(prop('point'))\n .map((marker) => (\n <EntityMarker key={marker.id} marker={marker} clusterer={clusterer} onClick={onMarkerClicked} />\n ));\n };\n\n const renderMarkerClusterer = (options) => {\n return <MarkerClusterer options={options}>{renderMarkers}</MarkerClusterer>;\n };\n\n if (loadError) {\n return null;\n }\n\n if (!isLoaded) {\n return loadingElement;\n }\n\n return (\n <GoogleMap\n mapTypeId={window.google.maps.MapTypeId.ROADMAP}\n options={googleMapOptions}\n onLoad={setMap}\n zoom={defaultZoom}\n center={defaultCenter}\n onZoomChanged={handleMapMoveStart}\n onDragStart={handleMapMoveStart}\n onIdle={handleMapIdle}\n mapContainerClassName={mapContainerClassName}\n >\n {map && isSearchEnabled && Boolean(drawingModes.length) && (\n <MapControlContainer\n className={styles.mapControlContainer}\n position={window.google.maps.ControlPosition.TOP_RIGHT}\n map={map}\n >\n <TopRightMapControls\n hasActiveOverlay={!!activeOverlay}\n drawingModes={drawingModes}\n drawingMode={drawingMode}\n onDrawingModeChanged={setDrawingMode}\n onClearOverlay={handleClearOverlay}\n />\n </MapControlContainer>\n )}\n\n {map && isSearchEnabled && (\n <MapControlContainer\n className={styles.mapControlContainer}\n position={window.google.maps.ControlPosition.TOP_CENTER}\n map={map}\n >\n <TopCenterMapControls\n onChangeIsSearchOnMapMove={handleChangeIsSearchOnMapMove}\n isSearchOnMapMove={isSearchOnMapMove}\n />\n </MapControlContainer>\n )}\n\n {markerClusterer ? renderMarkerClusterer(markerClustererOptions) : renderMarkers()}\n\n {!getDrawingMode(drawingMode) &&\n activeOverlay &&\n propEq('type', MAP_DRAWING_MODES.POLYGON, activeOverlay) && (\n <Polygon\n onLoad={setPolygon}\n path={activeOverlay.path}\n editable={true}\n options={allOverlayOptions}\n onMouseUp={handleOverlayChange}\n onDragEnd={handleOverlayChange}\n />\n )}\n\n {isSearchEnabled && Boolean(drawingModes.length) && (\n <DrawingManager\n onPolygonComplete={handleOverlayComplete(MAP_DRAWING_MODES.POLYGON)}\n onCircleComplete={handleOverlayComplete(MAP_DRAWING_MODES.CIRCLE)}\n drawingMode={getDrawingMode(drawingMode)}\n options={{\n drawingControl: false,\n circleOptions: allOverlayOptions,\n polygonOptions: allOverlayOptions\n }}\n />\n )}\n </GoogleMap>\n );\n};\n","import {makeStyles} from '@material-ui/core/styles';\n\nexport const useStyles = makeStyles({\n attributesContainer: {\n padding: '0 16px 16px 16px'\n },\n header: {\n marginBottom: '4px'\n },\n noCaption: {\n paddingTop: '16px'\n },\n noData: {\n fontSize: '13px',\n color: 'rgba(0,0,0,0.54)'\n }\n});\n","import {connect} from 'react-redux';\nimport mdmModule from '@reltio/mdm-module';\nimport {AttributesViewStateProps} from '../../types';\nimport AttributesView from './AttributesView';\n\nconst mapStateToProps = (state): AttributesViewStateProps => ({\n metadata: mdmModule.selectors.getMetadata(state)\n});\n\nexport {AttributesView};\n\nexport default connect(mapStateToProps)(AttributesView);\n","import React, {useMemo} from 'react';\nimport {useSelector} from 'react-redux';\nimport mdm from '@reltio/mdm-module';\nimport {Entity, getAttributesListForReadMode, isEmptyValue, PivotingAttribute} from '@reltio/mdm-sdk';\nimport classnames from 'classnames';\nimport i18n from 'ui-i18n';\nimport {Box as Box} from '@material-ui/core';\nimport {Typography as Typography} from '@material-ui/core';\nimport {PivotingAttributeContext} from '../../../../contexts';\nimport BasicView from '../../../BasicView/BasicView';\nimport FacetViewHeader from '../../../FacetViewHeader/FacetViewHeader';\nimport AttributesList from '../AttributesList';\nimport {AttributesViewProps} from '../../types';\nimport {getFilteredAttrTypes} from '../../helpers/attributesView';\nimport {useStyles} from './styles';\n\ntype Props = Omit<AttributesViewProps, 'mode'>;\n\nconst AttributesView = ({\n className,\n entity = {} as Entity,\n metadata,\n caption = '',\n excludeUris = [],\n includeUris = [],\n attributesCount = 16\n}: Props) => {\n const styles = useStyles();\n const pivotingAttributes: PivotingAttribute[] = useSelector(mdm.selectors.getPivotingAttributes);\n\n const filteredAttrTypes = useMemo(() => getFilteredAttrTypes(metadata, entity.type, includeUris, excludeUris), [\n excludeUris,\n includeUris,\n metadata,\n entity.type\n ]);\n\n const attributesList = getAttributesListForReadMode(filteredAttrTypes, entity);\n\n const isShowAttributeList = attributesList.filter(({values}) => !isEmptyValue(values)).length > 0;\n\n return isShowAttributeList || !isEmptyValue(caption) ? (\n <PivotingAttributeContext.Provider value={pivotingAttributes}>\n <BasicView className={className}>\n {caption && <FacetViewHeader className={styles.header} title={caption} />}\n <Box className={classnames(styles.attributesContainer, {[styles.noCaption]: !caption})}>\n {isShowAttributeList ? (\n <AttributesList\n entity={entity}\n attrTypes={filteredAttrTypes}\n parentUri={entity.uri}\n drawLines={false}\n max={attributesCount}\n />\n ) : (\n <Typography className={styles.noData}>{i18n.text('No data found')}</Typography>\n )}\n </Box>\n </BasicView>\n </PivotingAttributeContext.Provider>\n ) : null;\n};\n\nexport default AttributesView;\n","import {makeStyles} from '@material-ui/core/styles';\n\nexport const useStyles = makeStyles({\n attributesContainer: {\n padding: '0 16px 16px 16px'\n },\n header: {\n marginBottom: '4px'\n },\n noCaption: {\n paddingTop: '16px'\n }\n});\n","import React, {useCallback, useContext, useMemo} from 'react';\nimport {useDispatch, useSelector} from 'react-redux';\nimport classnames from 'classnames';\nimport {pipe} from 'ramda';\nimport mdmModule, {profile} from '@reltio/mdm-module';\nimport {Entity, isTempUri, getPinnedAttributesForUser, AttributeItem} from '@reltio/mdm-sdk';\nimport {Box as Box} from '@material-ui/core';\nimport BasicView from '../../../BasicView/BasicView';\nimport FacetViewHeader from '../../../FacetViewHeader/FacetViewHeader';\nimport AttributesList from '../AttributesList';\nimport {ViewIdContext} from '../../../../contexts';\nimport {AttributesViewProps} from '../../types';\nimport {getFilteredAttrTypes} from '../../helpers/attributesView';\nimport {PinnedAttributesContext} from '../contexts/PinnedAttributesContext';\nimport {useStyles} from './styles';\n\ntype Props = Omit<AttributesViewProps, 'attributesCount'>;\n\nconst AttributesView = ({\n className,\n entity = {} as Entity,\n mode,\n metadata,\n caption = '',\n excludeUris = [],\n includeUris = [],\n pinnedAttributes\n}: Props) => {\n const styles = useStyles();\n const dispatch = useDispatch();\n const viewId = useContext(ViewIdContext);\n const userRoles = useSelector(mdmModule.selectors.getUserRoles);\n const pinnedAttributeUris = useMemo(() => getPinnedAttributesForUser(pinnedAttributes, userRoles), [\n pinnedAttributes,\n userRoles\n ]);\n const modifiedEntity = useSelector(\n (state) => mdmModule.selectors.getModifiedEntity(state, entity.uri) || ({} as Entity)\n );\n\n const filteredAttrTypes = useMemo(\n () => getFilteredAttrTypes(metadata, modifiedEntity.type, includeUris, excludeUris),\n [excludeUris, includeUris, metadata, modifiedEntity.type]\n );\n\n const onAddAttributes = useCallback(\n (params: AttributeItem[]) =>\n pipe(profile.actions.addAttributes, dispatch)(params.map((param) => ({...param, viewId}))),\n [viewId, dispatch]\n );\n\n const onChangeAttribute = useCallback(\n (params: AttributeItem) => pipe(profile.actions.modifyAttribute, dispatch)({...params, viewId}),\n [viewId, dispatch]\n );\n\n const onDeleteAttribute = useCallback(\n (params: AttributeItem) => pipe(profile.actions.removeAttribute, dispatch)({...params, viewId}),\n [viewId, dispatch]\n );\n\n return (\n <BasicView className={className}>\n {caption && <FacetViewHeader className={styles.header} title={caption} />}\n <Box className={classnames(styles.attributesContainer, {[styles.noCaption]: !caption})}>\n <PinnedAttributesContext.Provider value={pinnedAttributeUris}>\n <AttributesList\n entity={modifiedEntity}\n attrTypes={filteredAttrTypes}\n parentUri={modifiedEntity.uri}\n drawLines={false}\n mode={mode}\n showEmptyEditors={isTempUri(modifiedEntity.uri)}\n crosswalks={modifiedEntity.crosswalks}\n onAddAttributes={onAddAttributes}\n onChangeAttribute={onChangeAttribute}\n onDeleteAttribute={onDeleteAttribute}\n />\n </PinnedAttributesContext.Provider>\n </Box>\n </BasicView>\n );\n};\n\nexport default AttributesView;\n","import {connect} from 'react-redux';\nimport mdmModule from '@reltio/mdm-module';\nimport {AttributesViewStateProps} from '../../types';\nimport AttributesView from './AttributesView';\n\nconst mapStateToProps = (state): AttributesViewStateProps => ({\n metadata: mdmModule.selectors.getMetadata(state)\n});\n\nexport {AttributesView};\n\nexport default connect(mapStateToProps)(AttributesView);\n","import React from 'react';\nimport {isViewMode, Mode} from '@reltio/mdm-sdk';\nimport {AttributesViewOwnProps} from '../types';\nimport ReadModeAttributesView from '../readMode/AttributesView';\nimport EditModeAttributesView from '../editMode/AttributesView';\nimport {EntityContext} from '../../../contexts';\n\nconst AttributesView = ({\n mode = Mode.Viewing,\n attributesCount,\n pinnedAttributes,\n entity,\n ...restProps\n}: AttributesViewOwnProps) => {\n return (\n <EntityContext.Provider value={entity}>\n {isViewMode(mode) ? (\n <ReadModeAttributesView attributesCount={attributesCount} entity={entity} {...restProps} />\n ) : (\n <EditModeAttributesView\n mode={mode}\n pinnedAttributes={pinnedAttributes}\n entity={entity}\n {...restProps}\n />\n )}\n </EntityContext.Provider>\n );\n};\n\nexport default AttributesView;\n","import {connect} from 'react-redux';\nimport mdm from '@reltio/mdm-module';\nimport {AttributesViewOwnProps} from '../types';\nimport AttributesView from './AttributesView';\n\ntype Props = Pick<AttributesViewOwnProps, 'entity' | 'mode'>;\n\nconst mapStateToProps = (state, ownProps: Props): Props => ({\n entity: ownProps.entity || mdm.selectors.getEntityWithDiff(state),\n mode: ownProps.mode || mdm.selectors.getMode(state)\n});\n\nexport {AttributesView};\n\nexport default connect(mapStateToProps)(AttributesView);\n","import {useEffect} from 'react';\nimport {useDispatch, useSelector} from 'react-redux';\nimport {evolve, map} from 'ramda';\nimport {entity as History, HistoryDiff, wrapInArrayIfNeeded} from '@reltio/mdm-sdk';\nimport mdmModule, {HistoryMode, profile} from '@reltio/mdm-module';\n\nexport const defaultHistoryDiff: HistoryDiff = {\n appearance: {},\n attributes: {},\n roles: [],\n tags: []\n};\n\nconst fixRefEntity = evolve({\n refEntity: wrapInArrayIfNeeded,\n refRelation: wrapInArrayIfNeeded\n});\n\nconst prepareHistorySlice = (historySlice) => {\n if (historySlice) {\n return evolve({\n attributes: map(map(fixRefEntity))\n })(historySlice);\n }\n return historySlice;\n};\n\nexport const useHistoryDiff = () => {\n const dispatch = useDispatch();\n const historySlice = useSelector(mdmModule.selectors.getHistorySlice);\n const historyDiff = useSelector(mdmModule.selectors.getHistoryDiff);\n const historyMode = useSelector(mdmModule.selectors.getHistoryMode);\n const entity = useSelector(mdmModule.selectors.getEntity);\n\n useEffect(() => {\n if (historySlice) {\n const {aEntity, bEntity} = historySlice;\n const historyManager = History.HistoryManager.createHistoryManager(History.AttributesDiff);\n const historyDiff: HistoryDiff = historyManager.computeEntityHistoryDiff(\n prepareHistorySlice(historyMode === HistoryMode.Current ? entity : bEntity),\n prepareHistorySlice(aEntity)\n );\n dispatch(profile.history.actions.setHistoryDiff(historyDiff));\n }\n }, [historySlice, historyMode, dispatch, entity]);\n\n return historyDiff || defaultHistoryDiff;\n};\n","import {makeStyles} from '@material-ui/core/styles';\n\nexport const useStyles = makeStyles((theme) => ({\n card: {\n borderBottom: '1px solid rgba(0,0,0,0.06)'\n },\n withBackground: {\n backgroundColor: 'rgba(0, 0, 0, 0.03)'\n },\n lineWrapper: {\n position: 'relative'\n },\n icon: {\n position: 'absolute',\n top: '8px',\n left: '16px',\n width: '32px',\n height: '32px',\n zIndex: 1\n },\n line: ({color}: {color: string}) => ({\n borderLeft: `3px solid ${color}`,\n position: 'absolute',\n left: 0,\n top: 0,\n bottom: 0\n }),\n info: {\n fontSize: '13px',\n color: theme.palette.text.secondary,\n wordWrap: 'break-word',\n lineHeight: '15px'\n },\n commentsInfo: {\n display: 'flex',\n alignItems: 'center',\n marginBottom: '-4px',\n marginTop: '7px'\n },\n commentsIcon: {\n width: '11px',\n height: '11px',\n marginLeft: '2px',\n marginRight: '6px',\n marginTop: '-2px'\n },\n infoValue: {\n color: theme.palette.text.primary\n },\n infoBlock: {\n display: 'flex',\n flexDirection: 'row',\n marginBottom: '5px'\n },\n header: {\n display: 'flex',\n flexDirection: 'row',\n paddingBottom: '12px'\n },\n flex: {\n flex: 1\n },\n caption: {\n fontSize: '16px',\n color: theme.palette.text.primary\n },\n title: {\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center',\n marginBottom: '-4px'\n },\n flag: {\n height: '13px',\n width: '13px',\n marginTop: '-2px',\n stroke: '#000000',\n fill: 'none',\n margin: '2px 5px 0 5px'\n },\n date: {\n fontSize: '13px',\n color: theme.palette.text.primary\n },\n mainInfo: {\n display: 'flex',\n flexDirection: 'column',\n flex: 1\n },\n controlsBox: {\n marginRight: '16px',\n marginBottom: '12px',\n marginTop: '13px'\n },\n controlsInRow: {\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n marginBottom: '20px'\n },\n priority: {\n width: '162px'\n },\n comments: {\n marginLeft: '11px'\n }\n}));\n","import React from 'react';\nimport i18n from 'ui-i18n';\nimport {WorkflowTaskData} from '@reltio/mdm-sdk';\n\nimport DropDownSelector from '../../../DropDownSelector/DropDownSelector';\nimport {useWorkflowAssignee} from '../../hooks/useWorkflowAssignee';\n\ntype Props = Pick<WorkflowTaskData, 'taskId' | 'assignee'> & {\n isTaskOpen?: WorkflowTaskData['isOpen'];\n};\n\nconst AssigneeSelector = ({taskId, assignee, isTaskOpen}: Props) => {\n const {\n assignee: currentAssignee,\n getAssignees,\n updateAssignee,\n updateRequestIsInProgress,\n readOnly\n } = useWorkflowAssignee({\n taskId,\n assignee,\n isOpen: isTaskOpen\n });\n const disabled = updateRequestIsInProgress || readOnly;\n\n return (\n <DropDownSelector\n isDisabled={disabled}\n getOptions={getAssignees}\n onChange={updateAssignee}\n hideSelectedOptions={false}\n label={i18n.text('Assigned to')}\n value={currentAssignee}\n defaultOptions={true}\n TextFieldProps={{disabled}}\n height={40}\n />\n );\n};\n\nexport default AssigneeSelector;\n","import {makeStyles} from '@material-ui/core/styles';\n\nexport const useStyles = makeStyles({\n dueDate: {\n marginTop: 0,\n marginBottom: 0\n },\n dueDateInput: {\n height: '40px'\n },\n inputLabel: {\n fontSize: '14px'\n }\n});\n","import {useState, useCallback, useContext} from 'react';\nimport {useSelector} from 'react-redux';\nimport {updateDueDateForTask, WorkflowTaskData} from '@reltio/mdm-sdk';\nimport mdmModule from '@reltio/mdm-module';\nimport {useSafePromise} from '../../../hooks';\nimport {WorkflowTasksContext} from '../../../contexts/WorkflowTasksContext';\nimport {showWorkflowError} from '../helpers/errors';\nimport {useWorkflowCheckPermission} from './useWorkflowCheckPermission';\nimport {isOpenTask} from '../helpers';\n\nexport const useWorkflowDueDate = ({\n dueDate,\n taskId,\n isOpen\n}: Pick<WorkflowTaskData, 'dueDate' | 'taskId' | 'isOpen'>) => {\n const {updateTaskState} = useContext(WorkflowTasksContext) || {};\n const workflowPath: string = useSelector(mdmModule.selectors.getWorkflowPath);\n const environment: string = useSelector(mdmModule.selectors.getWorkflowEnvironmentUrl);\n const tenant: string = useSelector(mdmModule.selectors.getTenant);\n const safePromise = useSafePromise();\n const [updateRequestIsInProgress, setUpdateRequestIsInProgress] = useState(false);\n const checkWorkflowPermission = useWorkflowCheckPermission();\n const canUpdateTask = checkWorkflowPermission('UPDATE_TASK') && isOpenTask(isOpen);\n\n const updateDueDate = useCallback(\n (newValue: number) => {\n if (workflowPath && canUpdateTask && taskId && newValue && dueDate !== newValue) {\n setUpdateRequestIsInProgress(true);\n safePromise(\n updateDueDateForTask({\n taskId,\n workflowPath,\n environment,\n tenant,\n dueDate: newValue\n })\n )\n .then(() => {\n updateTaskState?.(taskId, {dueDate: newValue});\n })\n .catch(showWorkflowError)\n .finally(() => {\n setUpdateRequestIsInProgress(false);\n });\n }\n },\n [workflowPath, taskId, environment, tenant, updateTaskState, safePromise, dueDate, canUpdateTask]\n );\n return {updateDueDate, updateRequestIsInProgress, readOnly: !canUpdateTask};\n};\n","import React from 'react';\nimport i18n from 'ui-i18n';\nimport classnames from 'classnames';\nimport {pipe} from 'ramda';\nimport {WorkflowTaskData} from '@reltio/mdm-sdk';\n\nimport {useStyles} from './styles';\nimport {DateEditor} from '../../../editors';\nimport {useWorkflowDueDate} from '../../hooks/useWorkflowDueDate';\n\ntype Props = Pick<WorkflowTaskData, 'taskId' | 'dueDate'> & {\n isTaskOpen?: WorkflowTaskData['isOpen'];\n className?: string;\n};\nconst DueDateField = ({taskId, dueDate, isTaskOpen, className}: Props) => {\n const styles = useStyles();\n const {updateDueDate, updateRequestIsInProgress, readOnly} = useWorkflowDueDate({\n dueDate,\n taskId,\n isOpen: isTaskOpen\n });\n\n return (\n <DateEditor\n className={classnames(styles.dueDate, className)}\n disabled={updateRequestIsInProgress || readOnly}\n value={dueDate}\n label={i18n.text('Due date')}\n onChange={pipe((date) => date && date.getTime(), updateDueDate)}\n margin=\"dense\"\n InputProps={{className: styles.dueDateInput}}\n InputLabelProps={{classes: {root: styles.inputLabel}}}\n />\n );\n};\n\nexport default DueDateField;\n","import React from 'react';\nimport i18n from 'ui-i18n';\nimport {propEq} from 'ramda';\nimport {WorkflowTaskData} from '@reltio/mdm-sdk';\n\nimport DropDownSelector from '../../../DropDownSelector/DropDownSelector';\nimport {useWorkflowPriority} from '../../hooks/useWorkflowPriority';\n\ntype Props = Pick<WorkflowTaskData, 'taskId' | 'priority'> & {\n isTaskOpen?: WorkflowTaskData['isOpen'];\n className?: string;\n};\n\nconst PrioritySelector = ({taskId, priority, isTaskOpen, className}: Props) => {\n const {priorities, updatePriority, updateRequestIsInProgress, readOnly} = useWorkflowPriority({\n taskId,\n priority,\n isOpen: isTaskOpen\n });\n const disabled = updateRequestIsInProgress || readOnly;\n\n return (\n <DropDownSelector\n className={className}\n isDisabled={disabled}\n options={priorities}\n onChange={updatePriority}\n hideSelectedOptions={false}\n label={i18n.text('Priority')}\n value={priorities.find(propEq('value', priority))}\n TextFieldProps={{disabled}}\n height={40}\n />\n );\n};\n\nexport default PrioritySelector;\n","import {useState, useCallback, useContext, useMemo} from 'react';\nimport {useSelector} from 'react-redux';\nimport i18n from 'ui-i18n';\nimport {updatePriorityForTask, WorkflowPriority, WorkflowTaskData} from '@reltio/mdm-sdk';\nimport mdmModule from '@reltio/mdm-module';\nimport {useSafePromise} from '../../../hooks';\nimport {WorkflowTasksContext} from '../../../contexts/WorkflowTasksContext';\nimport {showWorkflowError} from '../helpers/errors';\nimport {useWorkflowCheckPermission} from './useWorkflowCheckPermission';\nimport {isOpenTask} from '../helpers';\n\ntype PriorityOption = {label: string; value: number};\n\nexport const useWorkflowPriority = ({\n priority,\n taskId,\n isOpen\n}: Pick<WorkflowTaskData, 'taskId' | 'priority' | 'isOpen'>) => {\n const {updateTaskState} = useContext(WorkflowTasksContext) || {};\n const workflowPath: string = useSelector(mdmModule.selectors.getWorkflowPath);\n const environment: string = useSelector(mdmModule.selectors.getWorkflowEnvironmentUrl);\n const tenant: string = useSelector(mdmModule.selectors.getTenant);\n const safePromise = useSafePromise();\n const [updateRequestIsInProgress, setUpdateRequestIsInProgress] = useState(false);\n const checkWorkflowPermission = useWorkflowCheckPermission();\n const canUpdateTask = checkWorkflowPermission('UPDATE_TASK') && isOpenTask(isOpen);\n\n const updatePriority = useCallback(\n (newValue: PriorityOption) => {\n const {value: newPriority} = newValue;\n if (workflowPath && canUpdateTask && taskId && priority !== newPriority) {\n setUpdateRequestIsInProgress(true);\n safePromise(\n updatePriorityForTask({\n taskId,\n workflowPath,\n environment,\n tenant,\n priority: newPriority\n })\n )\n .then(() => {\n updateTaskState?.(taskId, {priority: newPriority});\n })\n .catch(showWorkflowError)\n .finally(() => {\n setUpdateRequestIsInProgress(false);\n });\n }\n },\n [workflowPath, taskId, environment, tenant, updateTaskState, safePromise, priority, canUpdateTask]\n );\n\n const priorities: PriorityOption[] = useMemo(\n () => [\n {\n label: i18n.text('Low'),\n value: WorkflowPriority.low\n },\n {\n label: i18n.text('Medium'),\n value: WorkflowPriority.medium\n },\n {\n label: i18n.text('High'),\n value: WorkflowPriority.high\n },\n {\n label: i18n.text('Urgent'),\n value: WorkflowPriority.urgent\n }\n ],\n []\n );\n return {priorities, updatePriority, updateRequestIsInProgress, readOnly: !canUpdateTask};\n};\n","import React from 'react';\nimport {WorkflowTaskData} from '@reltio/mdm-sdk';\nimport MoreVertIcon from '@material-ui/icons/MoreVert';\n\nimport {useWorkflowActions} from '../../hooks/useWorkflowActions';\nimport DropDownMenuButton from '../../../DropDownMenuButton/DropDownMenuButton';\nimport SmallIconButton from '../../../SmallIconButton/SmallIconButton';\n\ntype Props = Pick<WorkflowTaskData, 'taskId' | 'possibleActions' | 'assignee'> & {\n isTaskOpen?: WorkflowTaskData['isOpen'];\n};\n\nconst TaskActions = ({taskId, possibleActions, assignee, isTaskOpen}: Props) => {\n const {actions, actionRequestIsInProgress: disabled} = useWorkflowActions({\n taskId,\n possibleActions,\n assignee,\n isOpen: isTaskOpen\n });\n\n return actions.length > 0 ? (\n <DropDownMenuButton\n buttonComponent={SmallIconButton}\n buttonProps={{\n icon: MoreVertIcon,\n size: 'L',\n disabled\n }}\n menuId={'workflow-actions'}\n menuItems={actions}\n />\n ) : null;\n};\n\nexport default TaskActions;\n","import {useCallback, useContext, useMemo, useState} from 'react';\nimport {useDispatch, useSelector} from 'react-redux';\nimport {runTaskAction, WorkflowTaskData} from '@reltio/mdm-sdk';\nimport mdmModule, {profile, ui} from '@reltio/mdm-module';\nimport {ViewIdContext} from '../../../contexts/ViewIdContext';\nimport {showWorkflowError} from '../helpers/errors';\nimport {WorkflowTasksContext} from '../../../contexts/WorkflowTasksContext';\nimport {isOpenTask} from '../helpers';\n\ntype TaskAction = {text: string; onClick: () => void};\n\nexport const useWorkflowActions = ({\n possibleActions,\n assignee,\n taskId,\n isOpen\n}: Pick<WorkflowTaskData, 'taskId' | 'possibleActions' | 'assignee' | 'isOpen'>) => {\n const {loadWorkflowTasks} = useContext(WorkflowTasksContext) || {};\n const workflowPath: string = useSelector(mdmModule.selectors.getWorkflowPath);\n const environment: string = useSelector(mdmModule.selectors.getWorkflowEnvironmentUrl);\n const tenant: string = useSelector(mdmModule.selectors.getTenant);\n const username: string = useSelector(mdmModule.selectors.getUserName);\n const entityUri: string = useSelector(mdmModule.selectors.getEntityUri);\n const [actionRequestIsInProgress, setActionRequestIsInProgress] = useState(false);\n const viewId = useContext(ViewIdContext);\n const dispatch = useDispatch();\n\n const performTaskAction = useCallback(\n (action: string) => () => {\n if (workflowPath && taskId) {\n setActionRequestIsInProgress(true);\n runTaskAction({\n taskId,\n workflowPath,\n environment,\n tenant,\n action\n })\n .then(() => {\n if (action === 'Delete') {\n dispatch(ui.actions.entityDeletionFinished());\n } else {\n // entity refreshing\n dispatch(profile.entity.actions.loadEntity({viewId, uri: entityUri}));\n loadWorkflowTasks?.();\n }\n })\n .catch(showWorkflowError)\n .finally(() => {\n setActionRequestIsInProgress(false);\n });\n }\n },\n [workflowPath, taskId, environment, tenant, dispatch, entityUri, viewId, loadWorkflowTasks]\n );\n\n const actions: TaskAction[] = useMemo(\n () =>\n username === assignee && isOpenTask(isOpen)\n ? (possibleActions || []).map(({action, label}) => ({\n text: label,\n onClick: performTaskAction(action)\n }))\n : [],\n [possibleActions, performTaskAction, username, assignee, isOpen]\n );\n return {actions, actionRequestIsInProgress};\n};\n","import {makeStyles} from '@material-ui/core/styles';\n\nconst pointColor = '#d8d8d8';\nconst lineStyle = '2px solid rgba(0,0,0,0.06)';\nconst pointSize = 6;\nconst blockWidth = 56;\nconst linePadding = 10;\nconst pointPadding = 15;\n\nexport const useStyles = makeStyles({\n decorator: {\n display: 'flex',\n alignItems: 'stretch'\n },\n lineBlock: {\n width: `${blockWidth}px`,\n flexShrink: 0\n },\n withLinePadding: {\n '& $noLine': {\n height: `${linePadding}px`\n },\n '& $line': {\n height: `calc(100% - ${linePadding}px)`\n }\n },\n noLine: {\n height: '0'\n },\n line: {\n height: '100%',\n position: 'relative',\n marginLeft: '31px',\n borderLeft: lineStyle,\n '&:before': {\n position: 'absolute',\n height: pointSize,\n width: pointSize,\n borderRadius: '50%',\n left: -pointSize + 1,\n top: `${pointPadding}px`,\n background: pointColor,\n content: '\"\"',\n display: 'block',\n border: '1px solid white'\n },\n '&$plain': {\n '&:before': {\n width: 0,\n border: 'none'\n }\n },\n '&$last': {\n height: `${pointPadding}px`\n }\n },\n content: {\n flex: 1,\n minWidth: 0\n },\n plain: {},\n last: {},\n rowDivider: {\n marginLeft: 0\n }\n});\n","import React from 'react';\nimport classnames from 'classnames';\nimport {useStyles} from './styles';\nimport {Divider as Divider} from '@material-ui/core';\n\ntype Props = {\n className?: string;\n children: React.ReactNode;\n plain?: boolean;\n first?: boolean;\n last?: boolean;\n transparent?: boolean;\n divider?: boolean;\n};\n\nconst LineDecorator = ({className, children, plain, first, last, transparent, divider}: Props) => {\n const styles = useStyles();\n return (\n <div className={classnames(className, styles.decorator)}>\n <div className={classnames(styles.lineBlock, {[styles.withLinePadding]: first})}>\n {!transparent && (\n <>\n <div className={styles.noLine} />\n <div className={classnames(styles.line, {[styles.plain]: plain}, {[styles.last]: last})} />\n </>\n )}\n </div>\n <div className={styles.content}>\n {children}\n {divider && <Divider className={styles.rowDivider} light variant=\"inset\" />}\n </div>\n </div>\n );\n};\n\nexport default LineDecorator;\n","import {WorkflowTaskData} from '@reltio/mdm-sdk';\n\nlet taskToColor = {};\nconst COLORS = [\n '#DC057B',\n '#5DC003',\n '#FEC92F',\n '#F57F27',\n '#B71137',\n '#056B97',\n '#4499AE',\n '#BD81BE',\n '#5F3577',\n '#A68560',\n '#555962'\n];\nlet colorIndex = 0;\n\nexport const resetTaskToColor = () => {\n taskToColor = {};\n colorIndex = 0;\n};\n\nexport const useWorkflowColor = ({\n processDefinitionDisplayName\n}: Pick<WorkflowTaskData, 'processDefinitionDisplayName'>) => {\n const hash = processDefinitionDisplayName;\n if (!taskToColor[hash]) {\n taskToColor[hash] = COLORS[colorIndex];\n colorIndex++;\n if (colorIndex > COLORS.length - 1) {\n colorIndex = 0;\n }\n }\n return taskToColor[hash];\n};\n","import React from 'react';\n\nconst SvgCollaborationIcon: React.FC<React.SVGProps<SVGSVGElement>> = (props) => {\n return (\n <svg\n width={20}\n height={20}\n viewBox=\"0 0 20 20\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlnsXlink=\"http://www.w3.org/1999/xlink\"\n {...props}\n >\n <defs>\n <path\n d=\"M4 17.17L5.17 16H20V4H4v13.17zM20 2c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H6l-4 4V4c0-1.1.9-2 2-2h16zm-3 9H7v2h10v-2zm0-4H7v2h10V7z\"\n id=\"CollaborationIcon_svg__a\"\n />\n </defs>\n <g transform=\"translate(-2 -2)\" stroke=\"none\" strokeWidth={1} fill=\"none\" fillRule=\"evenodd\">\n <mask id=\"CollaborationIcon_svg__b\" fill=\"#fff\">\n <use xlinkHref=\"#CollaborationIcon_svg__a\" />\n </mask>\n <path fillOpacity={0.54} fill=\"#000\" mask=\"url(#CollaborationIcon_svg__b)\" d=\"M0 0h24v24H0z\" />\n </g>\n </svg>\n );\n};\n\nexport default SvgCollaborationIcon;\n","import React, {useState} from 'react';\nimport classnames from 'classnames';\nimport FlagIcon from '@material-ui/icons/Flag';\nimport i18n from 'ui-i18n';\nimport {WorkflowTaskData} from '@reltio/mdm-sdk';\nimport {Tooltip as Tooltip} from '@material-ui/core';\n\nimport {useStyles} from './styles';\n\nimport CollapseButton from '../../../CollapseButton/CollapseButton';\nimport AssigneeSelector from '../../components/AssigneeSelector/AssigneeSelector';\nimport DueDateField from '../../components/DueDateField/DueDateField';\nimport PrioritySelector from '../../components/PrioritySelector/PrioritySelector';\nimport WorkflowComments from '../../components/WorkflowComments';\nimport {getDCRId} from '../../helpers';\nimport TaskActions from '../../components/TaskActions/TaskActions';\nimport LineDecorator from '../../components/LineDecorator/LineDecorator';\nimport {useWorkflowColor} from '../../hooks/useWorkflowColor';\nimport {useWorkflowCheckPermission} from '../../hooks/useWorkflowCheckPermission';\nimport CollaborationIcon from '../../../../icons/CollaborationIcon';\n\ntype Props = {\n task: WorkflowTaskData;\n children?: React.ReactNode;\n actions?: React.ReactNode;\n Icon?: React.ElementType;\n};\n\nconst GenericWorkflowTaskCard = ({task, children, actions, Icon}: Props) => {\n const {\n taskId,\n dueDate,\n priority,\n assignee,\n createdBy,\n createTime,\n displayName: step,\n processDefinitionDisplayName,\n objectURIs,\n processInstanceComments,\n possibleActions,\n isOpen: isTaskOpen\n } = task;\n const dcrId = getDCRId(objectURIs);\n const color = useWorkflowColor({processDefinitionDisplayName});\n const styles = useStyles({color});\n const [isExpanded, setExpanded] = useState(false);\n const checkWorkflowPermission = useWorkflowCheckPermission();\n const canViewComments = checkWorkflowPermission('VIEW_PROCESS_INSTANCE_COMMENTS');\n return (\n <div className={styles.card}>\n <div className={classnames({[styles.withBackground]: isExpanded})}>\n <div className={styles.lineWrapper}>\n <div className={styles.line} />\n {Icon && <Icon className={styles.icon} />}\n <LineDecorator plain first transparent={!isExpanded}>\n <div className={styles.mainInfo}>\n <div className={styles.title}>\n <div className={classnames(styles.caption, styles.flex)}>\n {processDefinitionDisplayName}\n </div>\n <FlagIcon className={styles.flag} />\n <Tooltip title={i18n.text('Due date')}>\n <span className={styles.date}>{i18n.date(dueDate, 'L')}</span>\n </Tooltip>\n <CollapseButton\n isOpen={isExpanded}\n size=\"L\"\n onClick={() => {\n setExpanded(!isExpanded);\n }}\n />\n </div>\n <div className={styles.infoBlock}>\n <div className={styles.flex}>\n {dcrId && (\n <div className={styles.info}>\n {i18n.text('DCR ID')}\n {': '}\n <span className={styles.infoValue}>{dcrId}</span>\n </div>\n )}\n <div className={styles.info}>\n {i18n.text('Created by')}\n {': '}\n <span className={styles.infoValue}>{createdBy}</span> {i18n.text('on')}{' '}\n <span className={styles.infoValue}>{i18n.date(createTime, 'L')}</span>\n </div>\n <div className={styles.info}>\n {i18n.text('Step')}\n {': '}\n <span className={styles.infoValue}>{step}</span>\n </div>\n {canViewComments && processInstanceComments?.length > 0 && (\n <div className={styles.commentsInfo}>\n <CollaborationIcon className={styles.commentsIcon} />\n <div className={styles.infoValue}>{processInstanceComments.length}</div>\n </div>\n )}\n </div>\n {actions || (\n <TaskActions\n taskId={taskId}\n possibleActions={possibleActions}\n assignee={assignee}\n isTaskOpen={isTaskOpen}\n />\n )}\n </div>\n </div>\n </LineDecorator>\n </div>\n {isExpanded && (\n <LineDecorator plain>\n <div className={styles.controlsBox}>\n <div className={styles.controlsInRow}>\n <DueDateField taskId={taskId} dueDate={dueDate} isTaskOpen={isTaskOpen} />\n <PrioritySelector\n taskId={taskId}\n priority={priority}\n className={styles.priority}\n isTaskOpen={isTaskOpen}\n />\n </div>\n <AssigneeSelector taskId={taskId} assignee={assignee} isTaskOpen={isTaskOpen} />\n </div>\n </LineDecorator>\n )}\n </div>\n {isExpanded && (\n <>\n {children}\n {canViewComments && (\n <div className={styles.comments}>\n <WorkflowComments\n taskId={taskId}\n processInstanceComments={processInstanceComments}\n isTaskOpen={isTaskOpen}\n />\n </div>\n )}\n </>\n )}\n </div>\n );\n};\n\nexport default GenericWorkflowTaskCard;\n","import React from 'react';\n\nconst SvgDcrTaskIcon: React.FC<React.SVGProps<SVGSVGElement>> = (props) => {\n return (\n <svg width={28} height={28} viewBox=\"0 0 28 28\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <g stroke=\"none\" strokeWidth={1} fill=\"none\" fillRule=\"evenodd\">\n <circle fill=\"#42A5F5\" cx={14} cy={14} r={14} />\n <path\n d=\"M16.43 9.87c0 1.59 1.25 2.87 2.79 2.87 1.53 0 2.78-1.28 2.78-2.87C22 8.29 20.75 7 19.22 7c-1.54 0-2.79 1.29-2.79 2.87zm1.4 0c0-.79.62-1.43 1.39-1.43.77 0 1.39.64 1.39 1.43 0 .79-.62 1.44-1.39 1.44-.77 0-1.39-.65-1.39-1.44zm-6.26 8.26c0-1.59-1.25-2.87-2.79-2.87-1.53 0-2.78 1.28-2.78 2.87C6 19.71 7.25 21 8.78 21c1.54 0 2.79-1.29 2.79-2.87zM8.09 9.15v4.31h1.39v-2.87h2.78v2.15l2.78-2.87L12.26 7v2.15H8.09zm11.82 9.7v-4.31h-1.39v2.87h-2.78v-2.15l-2.78 2.87L15.74 21v-2.15h4.17z\"\n fill=\"#FFF\"\n opacity={0.87}\n />\n </g>\n </svg>\n );\n};\n\nexport default SvgDcrTaskIcon;\n","export enum OperationTypes {\n ADDED = 'added',\n EDITED = 'edited',\n DELETED = 'deleted',\n PINNED = 'pinned',\n IGNORED = 'ignored',\n PIN_DELETED = 'pin_deleted',\n IGNORE_DELETED = 'ignore_deleted'\n}\n\nexport enum DCRTypes {\n INSERT_ATTRIBUTE = 'INSERT_ATTRIBUTE',\n UPDATE_ATTRIBUTE = 'UPDATE_ATTRIBUTE',\n DELETE_ATTRIBUTE = 'DELETE_ATTRIBUTE',\n PIN_ATTRIBUTE = 'PIN_ATTRIBUTE',\n IGNORE_ATTRIBUTE = 'IGNORE_ATTRIBUTE',\n CREATE_ENTITY = 'CREATE_ENTITY',\n CREATE_RELATIONSHIP = 'CREATE_RELATIONSHIP',\n UPDATE_TAGS = 'UPDATE_TAGS',\n UPDATE_ROLES = 'UPDATE_ROLES',\n UPDATE_START_DATE = 'UPDATE_START_DATE',\n UPDATE_END_DATE = 'UPDATE_END_DATE',\n UPDATE_PROFILE_PIC_BY_URL = 'UPDATE_PROFILE_PIC_BY_URL',\n UPDATE_PROFILE_PIC_BY_URI = 'UPDATE_PROFILE_PIC_BY_URI',\n DELETE_RELATIONSHIP = 'DELETE_RELATIONSHIP'\n}\n","import i18n from 'ui-i18n';\nimport {allPass, always, equals, evolve, pipe, prop, when} from 'ramda';\nimport {AttributeType, DataTypes, getAttrDataTypeDefinition, isUrl} from '@reltio/mdm-sdk';\nimport {DCRTypes, OperationTypes} from '../../../constants/operations';\nimport {DCRAttributeValue, DCRObjectsInfo, EntityInfo, RelationInfo, Value} from '../../../types/dcrTypes';\n\nexport const getOperationType = (type: string, oldValue?: DCRAttributeValue) => {\n switch (type) {\n case DCRTypes.CREATE_RELATIONSHIP:\n case DCRTypes.INSERT_ATTRIBUTE:\n return OperationTypes.ADDED;\n case DCRTypes.UPDATE_TAGS:\n case DCRTypes.UPDATE_ROLES:\n case DCRTypes.UPDATE_ATTRIBUTE:\n return OperationTypes.EDITED;\n case DCRTypes.DELETE_ATTRIBUTE:\n case DCRTypes.DELETE_RELATIONSHIP:\n return OperationTypes.DELETED;\n case DCRTypes.PIN_ATTRIBUTE:\n return oldValue?.pin ? OperationTypes.PIN_DELETED : OperationTypes.PINNED;\n case DCRTypes.IGNORE_ATTRIBUTE:\n return oldValue?.ignored ? OperationTypes.IGNORE_DELETED : OperationTypes.IGNORED;\n }\n};\n\nexport const getOperationLabel = (operation: OperationTypes) => {\n const labels = {\n [OperationTypes.ADDED]: i18n.text('added'),\n [OperationTypes.EDITED]: i18n.text('edited'),\n [OperationTypes.DELETED]: i18n.text('deleted'),\n [OperationTypes.PINNED]: i18n.text('pinned'),\n [OperationTypes.PIN_DELETED]: i18n.text('pin deleted'),\n [OperationTypes.IGNORED]: i18n.text('ignored'),\n [OperationTypes.IGNORE_DELETED]: i18n.text('ignore deleted')\n };\n\n return labels[operation] || '';\n};\n\nexport const getAttributeDescription = (\n attrType: AttributeType,\n value: DCRAttributeValue,\n currentEntityUri: string,\n objectsInfo: DCRObjectsInfo = {}\n) => {\n let objectLabel: string, objectUri: string;\n\n const relation = objectsInfo[value.refObjectURI] as RelationInfo;\n if (relation) {\n objectUri = currentEntityUri === relation.startObjectUri ? relation.endObjectUri : relation.startObjectUri;\n objectLabel =\n currentEntityUri === relation.startObjectUri ? relation.endObjectLabel : relation.startObjectLabel;\n } else if (value.refEntity) {\n objectUri = value.refEntity.objectURI;\n objectLabel = (objectsInfo[objectUri] as EntityInfo).label;\n }\n\n return {\n objectUri,\n objectLabel\n };\n};\n\nexport const getDataTypeDefinition = (attributeType: AttributeType, attributeValue: Value) => {\n return when(\n allPass([pipe(prop('type'), equals(DataTypes.TYPE_STRING)), () => isUrl(attributeValue)]),\n evolve({type: always(DataTypes.TYPE_URL)})\n )(getAttrDataTypeDefinition(attributeType));\n};\n","import {complement, curry, flatten, is, isEmpty, pathOr, propOr, times} from 'ramda';\nimport {\n AttributeType,\n DataTypes,\n getAttributeTypeSubAttributes,\n getLabel,\n getRelationAttributesList,\n getRelationType,\n isEmptyValue,\n isSpecialAttribute,\n Metadata\n} from '@reltio/mdm-sdk';\nimport {DCRAttributes, DCRAttributeValue, DCRChange, EntityInfo, RelationInfo} from '../../../types/dcrTypes';\nimport {Diff} from '../types/diffTypes';\nimport {getFilteredAttrTypes} from '../../../../attributes/helpers/attributesView';\nimport {getOperationType} from './helpers';\nimport {DCRTypes} from '../../../constants/operations';\n\nconst getValues = (attributes: DCRAttributes | DCRChange, attrType: AttributeType) => {\n if ('newValue' in attributes || 'oldValue' in attributes) {\n const {newValue, oldValue, type} = attributes;\n const newAttrValues = pathOr([], ['value', attrType.name])(newValue);\n const oldAttrValues = pathOr([], ['value', attrType.name])(oldValue);\n\n const length = Math.max(newAttrValues.length, oldAttrValues.length);\n return times((index) => {\n const attributeValue = {\n newValue: newAttrValues[index],\n oldValue: oldAttrValues[index],\n type\n };\n\n return [{value: attributeValue}];\n }, length);\n }\n const values = attributes[attrType.name];\n return values ? [values] : [];\n};\n\nconst getEntityChanges = curry((metadata: Metadata, entityInfo: EntityInfo, changes: DCRAttributes) => {\n const attrTypes: AttributeType[] = getFilteredAttrTypes(metadata, entityInfo.type, [], []);\n return getAttributesList(metadata, attrTypes, changes);\n});\n\nconst getRelationChanges = curry(\n (metadata: Metadata, relationInfo: RelationInfo, changes: DCRAttributes, changeType: DCRTypes): Diff[] => {\n const addRelationOperationIfNeeded = (changes: DCRAttributes, changeType: DCRTypes) => {\n if (changeType === DCRTypes.CREATE_RELATIONSHIP || isEmptyValue(changes)) {\n const operation = getOperationType(changeType);\n return operation ? {operation} : {};\n }\n return {};\n };\n\n const relationType = getRelationType(metadata, relationInfo.type);\n const attrTypes = getRelationAttributesList(metadata, relationInfo.type);\n return flatten([\n {\n level: 1,\n label: propOr('', 'label', relationType),\n attributeType: relationType,\n attributeValue: {...relationInfo, ...changes},\n ...addRelationOperationIfNeeded(changes, changeType)\n },\n getAttributesList(metadata, attrTypes, changes, 2)\n ]);\n }\n);\n\nconst getAttributesList = (\n metadata: Metadata,\n attrTypes: AttributeType[],\n attributes: DCRAttributes | DCRChange,\n level = 0\n): Diff[] => {\n return flatten(\n attrTypes\n .map((attrType) => {\n return getValues(attributes, attrType).map((value) => {\n return value.map((attributeValue) => {\n return dcrAttributesFactory(metadata, attrType, attributeValue, level);\n });\n });\n })\n .filter(complement(isEmpty))\n );\n};\n\nconst getSimpleAttributeValue = (attributeType: AttributeType, attributeValue: DCRAttributeValue) => {\n const value = isSpecialAttribute(attributeType) ? attributeValue : attributeValue.value;\n return is(Object, value) ? value : {newValue: attributeValue, type: DCRTypes.INSERT_ATTRIBUTE};\n};\n\nconst dcrAttributesFactory = (\n metadata: Metadata,\n attributeType: AttributeType,\n attributeValue: DCRAttributeValue,\n level: number\n) => {\n switch (attributeType.type) {\n case DataTypes.TYPE_NESTED:\n case DataTypes.TYPE_IMAGE:\n return getNestedAttributeChange(metadata, attributeType, attributeValue, level);\n case DataTypes.TYPE_REFERENCE:\n return getReferenceAttributeChange(metadata, attributeType, attributeValue, level);\n default: {\n const value = getSimpleAttributeValue(attributeType, attributeValue);\n return getSimpleAttributeChange(attributeType, value as DCRChange, level);\n }\n }\n};\n\nconst getNestedAttributeChange = (\n metadata: Metadata,\n attributeType: AttributeType,\n attributeValue: DCRAttributeValue,\n level: number\n) => {\n const attributeTypeList = getAttributeTypeSubAttributes({} as Metadata, attributeType);\n const label = getLabel(attributeType?.label || attributeType?.name);\n return [\n {level, label, attributeType, attributeValue},\n getAttributesList(metadata, attributeTypeList, attributeValue.value as DCRAttributes, level + 1)\n ];\n};\n\nconst getReferenceAttributeChange = (\n metadata: Metadata,\n attributeType: AttributeType,\n attributeValue: DCRAttributeValue,\n level: number\n) => {\n const attributeTypeList = getAttributeTypeSubAttributes(metadata, attributeType);\n const label = attributeType?.label || attributeType?.name;\n\n return [\n {level, label, attributeType, attributeValue},\n getAttributesList(metadata, attributeTypeList, attributeValue.value as DCRAttributes, level + 1)\n ];\n};\n\nconst getDiffParameters = ({newValue, oldValue, type}: DCRChange) => {\n return type === DCRTypes.UPDATE_ATTRIBUTE ? {type, newValue, oldValue} : {type, newValue: oldValue || newValue};\n};\n\nconst getSimpleAttributeChange = (attributeType: AttributeType, attributeValue: DCRChange, level: number) => {\n const {newValue, oldValue, type} = getDiffParameters(attributeValue);\n const operation = getOperationType(type, oldValue as DCRAttributeValue);\n\n const label = attributeType?.label || attributeType?.name;\n\n return {\n attributeType,\n newValue,\n oldValue,\n operation,\n label,\n level\n };\n};\n\nexport {getEntityChanges, getRelationChanges};\n","import {\n concat,\n curry,\n difference,\n flatten,\n identity,\n isNil,\n omit,\n path,\n pick,\n pipe,\n propEq,\n propOr,\n reduce\n} from 'ramda';\nimport {\n Entity,\n EntityAttrTypes,\n generateTempUri,\n getRoleLabel,\n isEmptyValue,\n Metadata,\n Relation\n} from '@reltio/mdm-sdk';\nimport {DCRTypes} from '../../../constants/operations';\nimport {Diff} from '../types/diffTypes';\nimport {getEntityChanges, getRelationChanges} from './attributesHelpers';\n\nimport {\n DCRAttributes,\n DCRAttributeValue,\n DCRChange,\n DCRChanges,\n DCRObjectInfo,\n EntityInfo,\n RelationInfo\n} from '../../../types/dcrTypes';\n\nconst ATTRIBUTE_DELIMITER = '/';\nconst SPECIAL_ATTRIBUTES_NAMES = [\n 'defaultProfilePicValue',\n EntityAttrTypes.tags.name,\n EntityAttrTypes.roles.name,\n EntityAttrTypes.startDate.name,\n EntityAttrTypes.endDate.name\n];\n\nconst prepareStartOrEndDate = ({newValue, oldValue}: DCRChange): DCRChange[] => {\n const parseValue = (value) => (isNaN(value) || isEmptyValue(value) ? value : parseInt(value));\n\n const isExistedValue = (value) => value?.length && !isEmptyValue(value) && !isEmptyValue(value[0]);\n\n const isExistNewValue = isExistedValue(newValue);\n const isExistOldValue = isExistedValue(oldValue);\n if (isExistNewValue && isExistOldValue) {\n return [\n {\n type: DCRTypes.UPDATE_ATTRIBUTE,\n oldValue: {value: parseValue(oldValue[0])},\n newValue: {value: parseValue(newValue[0])}\n }\n ];\n } else if (isExistNewValue) {\n return [\n {\n type: DCRTypes.INSERT_ATTRIBUTE,\n newValue: {value: parseValue(newValue[0])}\n }\n ];\n } else if (isExistOldValue) {\n return [\n {\n type: DCRTypes.DELETE_ATTRIBUTE,\n oldValue: {value: parseValue(oldValue[0])}\n }\n ];\n }\n};\n\nconst prepareRolesOrTags = (metadata: Metadata, change: DCRChange): DCRChange[] => {\n const {newValue = [], oldValue = [], type} = change;\n const getLabel = type === DCRTypes.UPDATE_ROLES ? getRoleLabel(metadata) : identity;\n\n const diffNewValue = difference(newValue, oldValue);\n const diffOldValue = difference(oldValue, newValue);\n\n const items = [];\n\n if (diffNewValue.length) {\n items.push({\n type: DCRTypes.INSERT_ATTRIBUTE,\n newValue: {value: diffNewValue.map(getLabel).join(', ')}\n });\n }\n\n if (diffOldValue.length) {\n items.push({\n type: DCRTypes.DELETE_ATTRIBUTE,\n oldValue: {value: diffOldValue.map(getLabel).join(', ')}\n });\n }\n\n return items;\n};\n\nconst getPath = (change: DCRChange): string => {\n const {type, attributePath, refObjectURI, refAttributeType} = change;\n\n const path = type === DCRTypes.INSERT_ATTRIBUTE ? generateTempUri(attributePath) : attributePath;\n\n if (refObjectURI) {\n const typePath = refAttributeType.split('/attributes/');\n const id = refObjectURI.split(ATTRIBUTE_DELIMITER)[1];\n return [typePath[1], id, path].join(ATTRIBUTE_DELIMITER);\n }\n return path;\n};\n\nconst prepareAttribute = (container: DCRAttributes, change: DCRChange) => {\n const changePath = getPath(change);\n\n const pathArray = changePath.split(ATTRIBUTE_DELIMITER);\n\n let holder: DCRAttributes | DCRAttributeValue = container;\n\n for (let i = 0; i < pathArray.length - 1; i = i + 2) {\n const key = pathArray[i];\n const id = pathArray[i + 1];\n\n const currentValue = (holder[key] || []).find(propEq('id', id));\n\n const newValue = pathArray.length === i + 2 ? change : {};\n const value = currentValue ? currentValue : ({id, value: newValue} as DCRAttributeValue);\n\n const refObjectURI = change.refObjectURI?.indexOf(id) >= 0 && change.refObjectURI;\n if (refObjectURI) {\n value.refObjectURI = refObjectURI;\n }\n\n if (isNil(currentValue)) {\n holder[key] = (holder[key] || []).concat(value);\n }\n\n holder = value.value;\n }\n return container;\n};\n\nconst createEntityOrRelation = (metadata: Metadata, value: Entity | Relation) => {\n const {attributes = {}, startDate, endDate} = value;\n const {roles, tags, defaultProfilePicValue} = value as Entity;\n const newObject = {...attributes} as DCRAttributes;\n\n if (defaultProfilePicValue) {\n newObject['defaultProfilePicValue'] = [defaultProfilePicValue];\n }\n if (roles) {\n newObject[EntityAttrTypes.roles.name] = [\n {\n type: DCRTypes.INSERT_ATTRIBUTE,\n newValue: {value: roles.map(getRoleLabel(metadata)).join(', ')}\n }\n ];\n }\n if (tags) {\n newObject[EntityAttrTypes.tags.name] = [\n {\n type: DCRTypes.INSERT_ATTRIBUTE,\n newValue: {value: tags.join(', ')}\n }\n ];\n }\n if (startDate) {\n newObject[EntityAttrTypes.startDate.name] = [\n {\n type: DCRTypes.INSERT_ATTRIBUTE,\n newValue: {value: startDate}\n }\n ];\n }\n if (endDate) {\n newObject[EntityAttrTypes.endDate.name] = [\n {\n type: DCRTypes.INSERT_ATTRIBUTE,\n newValue: {value: endDate}\n }\n ];\n }\n return newObject;\n};\n\nconst mergeAttributesInChange = (\n metadata: Metadata,\n objectInfo: DCRObjectInfo,\n change: DCRChange,\n container: DCRAttributes = {}\n) => {\n const {type} = change;\n\n switch (type) {\n case DCRTypes.UPDATE_PROFILE_PIC_BY_URL:\n container['defaultProfilePicValue'] = [change.newValue];\n break;\n case DCRTypes.UPDATE_TAGS:\n container[EntityAttrTypes.tags.name] = prepareRolesOrTags(metadata, change);\n break;\n case DCRTypes.UPDATE_ROLES: {\n container[EntityAttrTypes.roles.name] = prepareRolesOrTags(metadata, change);\n break;\n }\n case DCRTypes.UPDATE_START_DATE:\n container[EntityAttrTypes.startDate.name] = prepareStartOrEndDate(change);\n break;\n case DCRTypes.UPDATE_END_DATE:\n container[EntityAttrTypes.endDate.name] = prepareStartOrEndDate(change);\n break;\n case DCRTypes.CREATE_RELATIONSHIP:\n case DCRTypes.CREATE_ENTITY: {\n return {\n ...container,\n ...createEntityOrRelation(metadata, change.newValue as Entity | Relation)\n };\n }\n case DCRTypes.INSERT_ATTRIBUTE:\n case DCRTypes.UPDATE_ATTRIBUTE:\n case DCRTypes.DELETE_ATTRIBUTE:\n case DCRTypes.PIN_ATTRIBUTE:\n case DCRTypes.IGNORE_ATTRIBUTE:\n prepareAttribute(container, change);\n break;\n default:\n break;\n }\n\n return container;\n};\n\nconst updateRelation = (metadata: Metadata, changes: DCRChanges, relationInfo: RelationInfo) => {\n const relationChanges: DCRChange[] = propOr([], relationInfo.uri)(changes);\n return relationChanges.reduce((result: DCRAttributes, change) => {\n return mergeAttributesInChange(metadata, relationInfo, change, result);\n }, {});\n};\n\nconst mergeChanges = (\n metadata: Metadata,\n changes: DCRChanges,\n entityInfo: EntityInfo,\n relationsInfo: RelationInfo[]\n): [Diff[], Diff[]] => {\n const getAttributeChanges = (attributeName: string) =>\n pipe(pick([attributeName]), getEntityChanges(metadata, entityInfo));\n const concatChanges = curry((getters, attributesTree) =>\n reduce((acc, getter) => concat(acc, getter(attributesTree)), [], getters)\n );\n\n const entityInfoChanges: DCRChange[] = propOr([], entityInfo.uri)(changes);\n\n const changesTree = entityInfoChanges.reduce((result: DCRAttributes, change: DCRChange) => {\n return mergeAttributesInChange(metadata, entityInfo, change, result);\n }, {});\n\n const relationsTrees = relationsInfo.map((relationInfo) => updateRelation(metadata, changes, relationInfo));\n\n const entityChanges: Diff[] = concatChanges(\n [\n pipe(omit(SPECIAL_ATTRIBUTES_NAMES), getEntityChanges(metadata, entityInfo)),\n getAttributeChanges(EntityAttrTypes.roles.name),\n getAttributeChanges(EntityAttrTypes.tags.name),\n getAttributeChanges(EntityAttrTypes.startDate.name),\n getAttributeChanges(EntityAttrTypes.endDate.name)\n ],\n changesTree\n );\n\n const relationsChanges: Diff[] = flatten(\n relationsInfo.map((relationInfo, index) => {\n const changeType: DCRTypes = path([relationInfo.uri, 0, 'type'], changes);\n return getRelationChanges(metadata, relationInfo, relationsTrees[index], changeType);\n })\n );\n\n return [entityChanges, relationsChanges];\n};\n\nexport {mergeChanges};\n","import {makeStyles} from '@material-ui/core/styles';\nimport {Theme} from '@material-ui/core';\n\nexport const useStyles = makeStyles((theme: Theme) => ({\n linkLabel: {\n color: theme.palette.primary.main,\n fontSize: '12px',\n letterSpacing: 0,\n lineHeight: '16px'\n }\n}));\n","import React from 'react';\nimport i18n from 'ui-i18n';\nimport {Link as Link} from '@material-ui/core';\n\nimport {useStyles} from './styles';\n\ntype Props = {\n onClick: () => void;\n suggestionsCount: number;\n isExpanded: boolean;\n className?: string;\n};\n\nconst ShowMoreLink = ({suggestionsCount, isExpanded, onClick, className}: Props) => {\n const styles = useStyles();\n return (\n <Link component=\"button\" variant=\"caption\" underline=\"none\" onClick={onClick} className={className}>\n <span className={styles.linkLabel}>\n {isExpanded\n ? i18n.text('View less suggestions')\n : i18n.text('View ${suggestionsCount} more suggestions', {suggestionsCount})}\n </span>\n </Link>\n );\n};\n\nexport default ShowMoreLink;\n","import {makeStyles} from '@material-ui/core/styles';\n\nexport const useStyles = makeStyles((theme) => ({\n field: {\n fontSize: '12px',\n lineHeight: '20px',\n color: theme.palette.text.primary,\n marginTop: '6px',\n overflow: 'hidden',\n wordBreak: 'break-word'\n },\n fieldName: {\n color: theme.palette.text.secondary,\n marginRight: '8px'\n },\n difference: {\n marginRight: '8px'\n },\n arrow: {\n margin: '0 4px',\n fontSize: '12px',\n color: theme.palette.text.primary\n },\n chip: {\n height: '20px',\n fontSize: '10px',\n fontWeight: 500,\n lineHeight: '16px',\n letterSpacing: 0,\n flexShrink: 0,\n textTransform: 'capitalize',\n color: theme.palette.primary.main,\n borderColor: theme.palette.primary.main,\n '&.edited': {\n color: '#CC7500',\n borderColor: '#CC7500'\n },\n '&.added': {\n color: '#599E0E',\n borderColor: '#599E0E'\n },\n '&.deleted': {\n color: '#CF0E26',\n borderColor: '#CF0E26'\n }\n }\n}));\n","import React from 'react';\nimport classnames from 'classnames';\nimport {isNil} from 'ramda';\nimport ArrowRightAltIcon from '@material-ui/icons/ArrowRightAlt';\nimport {Chip as Chip} from '@material-ui/core';\nimport {OperationTypes} from '../../../../constants/operations';\nimport {getOperationLabel} from '../../helpers/helpers';\n\nimport {useStyles} from './styles';\n\ntype Props = {\n label: React.ReactNode;\n oldValue?: React.ReactNode;\n newValue?: React.ReactNode;\n operation?: OperationTypes;\n className?: string;\n};\n\nconst ChangeView = ({label, oldValue, newValue, operation, className}: Props) => {\n const styles = useStyles();\n const value = oldValue || newValue;\n\n return (\n <div className={classnames(styles.field, className)}>\n <span className={styles.fieldName}>{label}:</span>\n {!isNil(value) && (\n <span className={styles.difference}>\n {value}\n {newValue && oldValue && (\n <>\n <ArrowRightAltIcon className={styles.arrow} />\n {newValue}\n </>\n )}\n </span>\n )}\n {operation && (\n <Chip\n variant=\"outlined\"\n label={getOperationLabel(operation)}\n className={classnames(styles.chip, operation)}\n />\n )}\n </div>\n );\n};\n\nexport default ChangeView;\n","import React from 'react';\nimport {DCRObjectsInfo} from '../../../types/dcrTypes';\n\nexport const AttributesChangesContext = React.createContext<DCRObjectsInfo>(null);\n\nAttributesChangesContext.displayName = 'AttributesChangesContext';\n","import {makeStyles} from '@material-ui/core/styles';\n\ntype StylesProps = {\n level: number;\n};\n\nexport const useStyles = makeStyles((theme) => ({\n linkContainer: {\n textDecoration: 'none',\n cursor: 'pointer',\n marginLeft: '4px'\n },\n linkLabel: {\n color: theme.palette.primary.main,\n fontSize: '12px',\n letterSpacing: 0,\n lineHeight: '16px'\n },\n disabledLink: {\n pointerEvents: 'none',\n cursor: 'default'\n },\n label: {\n color: theme.palette.text.primary\n },\n change: ({level = 0}: StylesProps) => ({\n marginLeft: `${level * 16}px`\n })\n}));\n","import React, {useCallback, useContext, useMemo} from 'react';\nimport {useSelector} from 'react-redux';\nimport {anyPass, ifElse, isNil, hasPath, path, when} from 'ramda';\nimport classnames from 'classnames';\nimport {getAttributeValue, getLabel, isReference} from '@reltio/mdm-sdk';\nimport mdmModule from '@reltio/mdm-module';\nimport ChangeView from '../ChangeView/ChangeView';\nimport {AttributesChangesContext} from '../../contexts/AttributesChangesContext';\nimport {getAttributeDescription, getDataTypeDefinition} from '../../helpers/helpers';\nimport {Diff, RelationAttributeValue} from '../../types/diffTypes';\nimport {ChangeValue, DCRAttributeValue, Value} from '../../../../types/dcrTypes';\nimport DataTypeValue from '../../../../../DataTypeValue/DataTypeValue';\nimport EntityUriLink from '../../../../../EntityUriLink/EntityUriLink';\n\nimport {useStyles} from './styles';\n\nconst DiffRenderer = ({label, level, attributeType, attributeValue, oldValue, newValue, operation}: Diff) => {\n const styles = useStyles({level});\n const entityUri = useSelector(mdmModule.selectors.getEntityUri);\n const objectsInfo = useContext(AttributesChangesContext);\n\n const getLinkDescription = useCallback(() => {\n if (isReference(attributeType)) {\n const value: DCRAttributeValue = when(\n anyPass([hasPath(['value', 'newValue']), hasPath(['value', 'oldValue'])]),\n ifElse(hasPath(['value', 'newValue']), path(['value', 'newValue']), path(['value', 'oldValue']))\n )(attributeValue);\n return getAttributeDescription(attributeType, value, entityUri, objectsInfo);\n } else if ('endObject' in attributeType) {\n const {endObjectUri, endObjectLabel} = attributeValue as RelationAttributeValue;\n return {\n objectUri: endObjectUri,\n objectLabel: endObjectLabel\n };\n }\n }, [attributeType, attributeValue, entityUri, objectsInfo]);\n\n const renderLink = useCallback(() => {\n const {objectUri, objectLabel} = getLinkDescription() || {};\n\n if (!isNil(objectUri) && !isNil(objectLabel)) {\n const isNotExist = objectsInfo[objectUri]?.isExist === false;\n return (\n <EntityUriLink\n value={objectUri}\n className={classnames(styles.linkContainer, {[styles.disabledLink]: isNotExist})}\n >\n <span className={classnames(styles.linkLabel, {[styles.label]: isNotExist})}>\n {getLabel(objectLabel)}\n </span>\n </EntityUriLink>\n );\n }\n return null;\n }, [getLinkDescription, objectsInfo, styles]);\n\n const changeLabel = useMemo(() => {\n return (\n <span>\n {label}\n {renderLink()}\n </span>\n );\n }, [label, renderLink]);\n\n const renderValue = useCallback(\n (value: ChangeValue) => {\n const attrValue: Value = getAttributeValue(value);\n return (\n <DataTypeValue value={attrValue} dataTypeDefinition={getDataTypeDefinition(attributeType, attrValue)} />\n );\n },\n [attributeType]\n );\n\n return (\n <ChangeView\n className={styles.change}\n label={changeLabel}\n oldValue={oldValue && renderValue(oldValue)}\n newValue={newValue && renderValue(newValue)}\n operation={operation}\n />\n );\n};\n\nexport default DiffRenderer;\n","import {makeStyles} from '@material-ui/core/styles';\n\nexport const useStyles = makeStyles({\n title: {\n fontSize: '12px',\n letterSpacing: 0,\n lineHeight: '16px',\n fontWeight: 500,\n marginTop: '8px'\n }\n});\n","import React from 'react';\nimport {has} from 'ramda';\nimport DiffRenderer from '../DiffRenderer/DiffRenderer';\nimport {Diff, Title} from '../../types/diffTypes';\n\nimport {useStyles} from './styles';\n\ntype Props = {\n changes: (Diff | Title)[];\n};\n\nconst DCRChangesList = ({changes}: Props) => {\n const styles = useStyles();\n return (\n <>\n {changes.map((change, index) => {\n return has('level', change) ? (\n <DiffRenderer {...(change as Diff)} key={index} />\n ) : (\n <div className={styles.title} key={index}>\n {change.label}\n </div>\n );\n })}\n </>\n );\n};\n\nexport default DCRChangesList;\n","import {has, filter, length, pipe} from 'ramda';\n\nexport const getSuggestionsCount = pipe(filter(has('operation')), length);\n","import {makeStyles} from '@material-ui/core/styles';\nimport {Theme} from '@material-ui/core';\n\nexport const useStyles = makeStyles((theme: Theme) => ({\n container: {\n boxSizing: 'border-box',\n border: '1px solid rgba(0,0,0,0.03)',\n borderRadius: '3px',\n backgroundColor: 'rgba(0,0,0,0.03)',\n padding: '10px',\n margin: '12px 16px 12px 0'\n },\n uri: {\n color: theme.palette.primary.main,\n textDecoration: 'none',\n cursor: 'pointer'\n },\n label: {\n fontSize: '12px',\n letterSpacing: 0,\n lineHeight: '16px'\n },\n showMoreLink: {\n marginTop: '8px'\n }\n}));\n","import React, {useMemo} from 'react';\nimport {useSelector} from 'react-redux';\nimport i18n from 'ui-i18n';\nimport {flatten} from 'ramda';\nimport mdmModule from '@reltio/mdm-module';\nimport {getEntityUriForLink, getLabel, Metadata} from '@reltio/mdm-sdk';\nimport {DCRChanges, DCRObjectsInfo, EntityInfo, RelationInfo} from '../../types/dcrTypes';\nimport {Diff, Title} from './types/diffTypes';\nimport {mergeChanges} from './helpers/mergeHelpers';\nimport ShowMoreLink from './components/ShowMoreLink/ShowMoreLink';\nimport DCRChangesList from './components/DCRChangesList/DCRChangesList';\nimport {AttributesChangesContext} from './contexts/AttributesChangesContext';\nimport {useCollapsibleList} from './hooks/useCollapsibleList';\nimport EntityUriLink from '../../../EntityUriLink/EntityUriLink';\n\nimport {useStyles} from './styles';\n\ntype Props = {\n changes: DCRChanges;\n objectsInfo: DCRObjectsInfo;\n entityInfo: EntityInfo;\n relationsInfo?: RelationInfo[];\n max?: number;\n};\n\nconst AttributesChanges = ({changes, objectsInfo, entityInfo, relationsInfo, max}: Props) => {\n const styles = useStyles();\n const metadata: Metadata = useSelector(mdmModule.selectors.getMetadata);\n\n const [mergedEntityChanges, mergedRelationsChanges] = useMemo(\n () => mergeChanges(metadata, changes, entityInfo, relationsInfo),\n [metadata, changes, entityInfo, relationsInfo]\n );\n\n const changesList: (Diff | Title)[] = useMemo(() => {\n const relationshipTitle: Title = {label: i18n.text('Relationships')};\n return mergedRelationsChanges.length > 0\n ? flatten([mergedEntityChanges, relationshipTitle, mergedRelationsChanges])\n : mergedEntityChanges;\n }, [mergedEntityChanges, mergedRelationsChanges]);\n\n const {isExpanded, onToggle, itemsToShow, collapsedSuggestionsCount} = useCollapsibleList(changesList, max);\n\n return (\n <AttributesChangesContext.Provider value={objectsInfo}>\n <div className={styles.container}>\n <EntityUriLink className={styles.uri} value={getEntityUriForLink(entityInfo)}>\n <div className={styles.label}>{getLabel(entityInfo.label)}</div>\n </EntityUriLink>\n <DCRChangesList changes={itemsToShow} />\n {collapsedSuggestionsCount > 0 && (\n <ShowMoreLink\n onClick={onToggle}\n suggestionsCount={collapsedSuggestionsCount}\n isExpanded={isExpanded}\n className={styles.showMoreLink}\n />\n )}\n </div>\n </AttributesChangesContext.Provider>\n );\n};\n\nexport default AttributesChanges;\n","import {useCallback, useMemo, useState} from 'react';\nimport {getSuggestionsCount} from '../helpers/contextHelpers';\nimport {Diff, Title} from '../types/diffTypes';\n\nconst DEFAULT_VISIBLE_ITEMS_COUNT = 3;\n\nexport const useCollapsibleList = (items: (Diff | Title)[], limit = DEFAULT_VISIBLE_ITEMS_COUNT) => {\n const [isExpanded, setIsExpanded] = useState(false);\n const onToggle = useCallback(() => setIsExpanded((value) => !value), []);\n\n const collapsedItems = useMemo(() => items.slice(0, limit), [items, limit]);\n const suggestionsCount = useMemo(() => getSuggestionsCount(items), [items]);\n const visibleSuggestionsCount = useMemo(() => getSuggestionsCount(collapsedItems), [collapsedItems]);\n\n const itemsToShow = isExpanded ? items : collapsedItems;\n const collapsedSuggestionsCount = suggestionsCount - visibleSuggestionsCount;\n\n return {isExpanded, onToggle, itemsToShow, collapsedSuggestionsCount};\n};\n","import {isEntityUri, isRelationUri} from '@reltio/mdm-sdk';\nimport {allPass, concat, curry, equals, filter, keys, map, pathOr, pipe, prop, uniq} from 'ramda';\nimport {\n GroupedObjectsInfo,\n DCRChanges,\n DCRObjectInfo,\n DCRObjectsInfo,\n EntityInfo,\n RelationInfo\n} from '../types/dcrTypes';\n\nexport const getEntitiesObjects = filter(pipe(prop('uri'), isEntityUri));\nexport const getRelationsObjects = filter(pipe(prop('uri'), isRelationUri));\n\nconst getRelations = (objectsWithChanges: DCRObjectInfo, entityUri: string) => {\n return filter(allPass([pipe(prop('uri'), isRelationUri), pipe(prop('startObjectUri'), equals(entityUri))]))(\n objectsWithChanges\n );\n};\n\nexport const extractObjectsFromChangeRequest = (changes: DCRChanges, objectsInfo: DCRObjectsInfo): DCRObjectInfo[] => {\n const getChange = (key) => prop([key], changes);\n return pipe(\n keys,\n filter(getChange),\n map((key) => ({...objectsInfo[key], uri: key}))\n )(objectsInfo);\n};\n\nexport const createEntityRelationsObjectByEntity = curry((objectsWithChanges: DCRObjectInfo, entity: EntityInfo) => {\n return {\n entity,\n relations: getRelations(objectsWithChanges, entity.uri)\n };\n});\n\nexport const createEntityRelationsObjectByRelation = curry((objectsInfo: DCRObjectInfo, relation: RelationInfo) => {\n const entity = objectsInfo[relation.startObjectUri];\n const relations = [relation];\n\n return entity ? {entity: {...entity, uri: relation.startObjectUri}, relations} : {relations};\n});\n\nexport const concatEntityRelationsObjects = (acc: Record<string, GroupedObjectsInfo>, object: GroupedObjectsInfo) => {\n const {entity, relations} = object;\n const {uri: entityUri} = entity;\n\n const mergedRelations = pipe(pathOr([], [entityUri, 'relations']), concat(relations), uniq)(acc);\n\n acc[entityUri] = {\n entity,\n relations: mergedRelations\n };\n\n return acc;\n};\n","import {useCallback, useEffect, useState} from 'react';\nimport {flatten, has, isEmpty, map, partition, path, pipe, reduce, values} from 'ramda';\nimport {getDataChangeRequest, getEntitiesByUris} from '@reltio/mdm-sdk';\nimport {useSafePromise} from '../../../hooks';\nimport {\n concatEntityRelationsObjects,\n createEntityRelationsObjectByEntity,\n createEntityRelationsObjectByRelation,\n extractObjectsFromChangeRequest,\n getEntitiesObjects,\n getRelationsObjects\n} from '../helpers/dcrHelpers';\nimport {GroupedObjectsInfo, ChangeRequest} from '../types/dcrTypes';\nimport {showWorkflowError} from '../helpers/errors';\n\nexport const useChangeRequest = (dcrUri: string) => {\n const [groupedObjects, setGroupedObjects] = useState<GroupedObjectsInfo[]>([]);\n const [dcr, setDcr] = useState<ChangeRequest>(null);\n const safePromise = useSafePromise();\n\n const requestEntities = useCallback((entityUris: string[]) => {\n if (isEmpty(entityUris)) {\n return Promise.resolve([]);\n }\n\n return safePromise(getEntitiesByUris(entityUris, {searchOptions: 'ovOnly', defaultMaxValues: 1}));\n }, []); // eslint-disable-line\n\n useEffect(() => {\n getDataChangeRequest(dcrUri)\n .then((dcr: ChangeRequest) => {\n const {changes, objectsInfo} = dcr;\n\n const objectsWithChanges = extractObjectsFromChangeRequest(changes, objectsInfo);\n\n const entityObjectsWithRelations: GroupedObjectsInfo[] = pipe(\n getEntitiesObjects,\n map(createEntityRelationsObjectByEntity(objectsWithChanges))\n )(objectsWithChanges);\n\n const relationsObjects: GroupedObjectsInfo[] = pipe(\n getRelationsObjects,\n map(createEntityRelationsObjectByRelation(objectsInfo))\n )(objectsWithChanges);\n\n const [relationsObjectsWithEntity, relationsObjectsWithoutEntity] = partition(\n has('entity'),\n relationsObjects\n );\n\n const entityUris: string[] = relationsObjectsWithoutEntity.map(\n path(['relations', 0, 'startObjectUri'])\n );\n\n requestEntities(entityUris)\n .then((entities) => {\n const relationsObjectsWithRequestedEntities = relationsObjectsWithoutEntity.map(\n (relationsObject, index) => {\n return {\n ...relationsObject,\n entity: entities[index]\n };\n }\n );\n\n pipe(\n flatten,\n reduce(concatEntityRelationsObjects, {}),\n values,\n setGroupedObjects\n )([\n entityObjectsWithRelations,\n relationsObjectsWithEntity,\n relationsObjectsWithRequestedEntities\n ]);\n })\n .catch(showWorkflowError);\n\n setDcr(dcr);\n })\n .catch(showWorkflowError);\n }, [dcrUri, requestEntities]);\n\n return {dcr, groupedObjects};\n};\n","import React from 'react';\nimport {WorkflowTaskData} from '@reltio/mdm-sdk';\nimport GenericWorkflowTaskCard from '../GenericWorkflowTaskCard/GenericWorkflowTaskCard';\nimport LineDecorator from '../../components/LineDecorator/LineDecorator';\nimport {getDCRUri} from '../../helpers';\nimport DcrTaskIcon from '../../../../icons/DcrTaskIcon';\nimport AttributesChanges from '../../components/AttributesChanges/AttributesChanges';\nimport {useChangeRequest} from '../../hooks/useChangeRequest';\n\ntype Props = {\n task: WorkflowTaskData;\n};\n\nconst DataChangeRequestTaskCard = ({task}: Props) => {\n const {objectURIs} = task;\n const dcrUri = getDCRUri(objectURIs);\n\n const {dcr, groupedObjects} = useChangeRequest(dcrUri);\n\n return (\n <GenericWorkflowTaskCard task={task} Icon={DcrTaskIcon}>\n {dcr &&\n groupedObjects.map((object, index: number) => (\n <LineDecorator key={index} last={index === groupedObjects.length - 1} divider={true}>\n <AttributesChanges\n entityInfo={object.entity}\n relationsInfo={object.relations}\n changes={dcr.changes}\n objectsInfo={dcr.objectsInfo}\n />\n </LineDecorator>\n ))}\n </GenericWorkflowTaskCard>\n );\n};\n\nexport default DataChangeRequestTaskCard;\n","import {makeStyles} from '@material-ui/core/styles';\n\nexport const useStyles = makeStyles({\n pmCard: {\n marginLeft: '-15px'\n }\n});\n","import React from 'react';\n\nconst SvgPmTaskIcon: React.FC<React.SVGProps<SVGSVGElement>> = (props) => {\n return (\n <svg width={28} height={28} viewBox=\"0 0 28 28\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <g stroke=\"none\" strokeWidth={1} fill=\"none\" fillRule=\"evenodd\">\n <circle fill=\"#1976D2\" cx={14} cy={14} r={14} />\n <path\n d=\"M22.5 14L18 9.5V13h-3.5L9 7.5 7.5 9l6.04 6H18v3.5l4.5-4.5zm-11.46 1.46L7.5 19 9 20.5l3.54-3.54-1.5-1.5z\"\n fill=\"#FFF\"\n opacity={0.87}\n />\n </g>\n </svg>\n );\n};\n\nexport default SvgPmTaskIcon;\n","import React from 'react';\nimport {useSelector} from 'react-redux';\nimport {WorkflowTaskData} from '@reltio/mdm-sdk';\nimport mdmModule from '@reltio/mdm-module';\n\nimport {useStyles} from './styles';\n\nimport GenericWorkflowTaskCard from '../GenericWorkflowTaskCard/GenericWorkflowTaskCard';\nimport LineDecorator from '../../components/LineDecorator/LineDecorator';\nimport PmTaskIcon from '../../../../icons/PmTaskIcon';\nimport {useMatchesLoader} from '../../../../hooks/useMatchesLoader';\nimport {ProfileMatchCard} from '../../../ProfileMatchCard/ProfileMatchCard';\n\ntype Props = {\n task: WorkflowTaskData;\n};\n\nconst defaultOptions = {\n showTransitiveMatches: true,\n showInactiveEntities: false\n};\n\nconst PotentialMatchTaskCard = ({task}: Props) => {\n const styles = useStyles();\n const {objectURIs} = task;\n const entity = useSelector(mdmModule.selectors.getEntity);\n const metadata = useSelector(mdmModule.selectors.getMetadata);\n const {matches, entitiesMap} = useMatchesLoader({\n enabled: !!entity.uri,\n entity,\n filter: '',\n rowsPerPage: Number.MAX_SAFE_INTEGER,\n page: 0,\n options: defaultOptions\n });\n const match = matches?.find(({object}) => objectURIs.includes(object.uri));\n\n return (\n <GenericWorkflowTaskCard task={task} Icon={PmTaskIcon}>\n {match && (\n <LineDecorator last>\n <div className={styles.pmCard}>\n <ProfileMatchCard metadata={metadata} entity={entity} match={match} entitiesMap={entitiesMap} />\n </div>\n </LineDecorator>\n )}\n </GenericWorkflowTaskCard>\n );\n};\n\nexport default PotentialMatchTaskCard;\n","import React from 'react';\n\nconst SvgDefaultTaskIcon: React.FC<React.SVGProps<SVGSVGElement>> = (props) => {\n return (\n <svg width={28} height={28} viewBox=\"0 0 28 28\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <g stroke=\"none\" strokeWidth={1} fill=\"none\" fillRule=\"evenodd\">\n <circle fill=\"#205191\" cx={14} cy={14} r={14} />\n <path\n d=\"M9.667 20.622c-.92 0-1.667-.744-1.667-1.662V8.99c0-.916.747-1.66 1.667-1.66h2.446A1.993 1.993 0 0114 6l.162.006a1.992 1.992 0 011.725 1.323h2.446c.92 0 1.667.745 1.667 1.662v9.97c0 .917-.747 1.661-1.667 1.661zm9-1.33V8.66h-1.334v1.993h-6.666V8.66H9.333v10.634h9.334zM15.86 14.46v1.302h-5.206V14.46h5.206zm1.494-2v1.302h-6.7V12.46h6.7zM14 7.33c.367 0 .667.298.667.664a.668.668 0 01-1.334 0c0-.366.3-.665.667-.665z\"\n fill=\"#FFF\"\n opacity={0.87}\n />\n </g>\n </svg>\n );\n};\n\nexport default SvgDefaultTaskIcon;\n","import React from 'react';\n\nconst SvgDeleteRequestTaskIcon: React.FC<React.SVGProps<SVGSVGElement>> = (props) => {\n return (\n <svg width={28} height={28} viewBox=\"0 0 28 28\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <g stroke=\"none\" strokeWidth={1} fill=\"none\" fillRule=\"evenodd\" opacity={0.87}>\n <circle fill=\"#0D47A1\" cx={14} cy={14} r={14} />\n <path\n d=\"M8.17 9.824v8.995c0 .886.72 1.606 1.607 1.606h8.352c.192 0 .375-.035.546-.097l1.38 1.382.804-.804-1.32-1.32-1.09-1.089-8.993-8.994-1.092-1.092-1.317-1.317-.803.803L8.17 9.824zm9.316 9.316h-8.03v-8.03l8.03 8.03zM9.777 7.575c-.192 0-.376.033-.55.094L10.42 8.86h.32v.322l1.607 1.606h4.819V8.86h1.284v8.03l1.285 1.286V9.182c0-.887-.72-1.607-1.606-1.607h-2.358a1.931 1.931 0 00-1.818-1.285 1.93 1.93 0 00-1.818 1.285H9.777zm3.533.643c0-.353.29-.643.643-.643.353 0 .642.29.642.643a.644.644 0 01-.642.642.644.644 0 01-.643-.642z\"\n fill=\"#FFF\"\n />\n </g>\n </svg>\n );\n};\n\nexport default SvgDeleteRequestTaskIcon;\n","import React from 'react';\nimport {PredefinedWorkflowProcessType, WorkflowTaskData} from '@reltio/mdm-sdk';\nimport GenericWorkflowTaskCard from './GenericWorkflowTaskCard/GenericWorkflowTaskCard';\nimport DataChangeRequestTaskCard from './DataChangeRequestTaskCard/DataChangeRequestTaskCard';\nimport PotentialMatchTaskCard from './PotentialMatchTaskCard/PotentialMatchTaskCard';\n\nimport DefaultTaskIcon from '../../../icons/DefaultTaskIcon';\nimport DeleteRequestTaskIcon from '../../../icons/DeleteRequestTaskIcon';\n\nexport type FactoryProps = {\n task: WorkflowTaskData;\n};\n\nclass WorkflowTaskCardsFactory {\n static build = ({task}: FactoryProps) => {\n const {processType} = task;\n switch (processType) {\n case PredefinedWorkflowProcessType.dataChangeRequestReview:\n return <DataChangeRequestTaskCard task={task} />;\n case PredefinedWorkflowProcessType.potentialMatchReview:\n return <PotentialMatchTaskCard task={task} />;\n case PredefinedWorkflowProcessType.recommendForDelete:\n return <GenericWorkflowTaskCard task={task} Icon={DeleteRequestTaskIcon} />;\n default:\n return <GenericWorkflowTaskCard task={task} Icon={DefaultTaskIcon} />;\n }\n };\n}\n\nexport default WorkflowTaskCardsFactory;\n","import WorkflowTaskCardsFactory, {FactoryProps} from './WorkflowTaskCardsFactory';\n\nexport const WorkflowTaskCard = ({task}: FactoryProps) => WorkflowTaskCardsFactory.build({task});\n","import {makeStyles} from '@material-ui/core/styles';\n\nexport const useStyles = makeStyles((theme) => ({\n popoverPaper: {\n width: '464px'\n },\n title: {\n fontSize: '20px',\n fontWeight: 500,\n letterSpacing: '0.25px',\n lineHeight: '24px',\n color: theme.palette.text.primary,\n marginBottom: '17px'\n },\n content: {\n display: 'flex',\n flexDirection: 'column',\n padding: '23px 24px 14px 24px'\n },\n simpleDropDownSelector: {\n marginBottom: '20px'\n },\n inputRoot: {\n paddingTop: '0 !important',\n paddingBottom: '0 !important'\n },\n select: {\n fontSize: '14px'\n },\n footer: {\n display: 'flex',\n justifyContent: 'flex-end',\n padding: '5px 8px 8px',\n borderTop: '1px solid rgba(0,0,0,0.12)'\n },\n cancelButton: {\n marginRight: '8px'\n },\n input: {\n fontSize: '14px'\n }\n}));\n","import React, {useState} from 'react';\nimport i18n from 'ui-i18n';\nimport {TextField as TextField} from '@material-ui/core';\nimport {Portal as Portal} from '@material-ui/core';\nimport {Snackbar as Snackbar} from '@material-ui/core';\nimport {Popover as Popover} from '@material-ui/core';\nimport {Typography as Typography} from '@material-ui/core';\nimport {Button as Button} from '@material-ui/core';\nimport SimpleDropDownSelector from '../../../SimpleDropDownSelector/SimpleDropDownSelector';\nimport {useWorkflowDefinitions} from '../../hooks/useWorkflowDefinitions';\nimport {useWorkflowProcessInstance} from '../../hooks/useWorkflowProcessInstance';\nimport {useStyles} from './styles';\n\ntype Props = {\n anchorEl: Element;\n onClose: () => void;\n};\n\nexport const AddWorkflowDialog = ({anchorEl, onClose}: Props) => {\n const styles = useStyles();\n\n const [comment, setComment] = useState('');\n const [taskType, setTaskType] = useState(null);\n const [isOpenSnackbar, setIsOpenSnackbar] = useState(false);\n\n const {definitions} = useWorkflowDefinitions();\n const {processInstance, loading} = useWorkflowProcessInstance();\n\n const handleChangeComment = (e) => {\n setComment(e.target.value);\n };\n\n const handleChangeTaskType = (value) => {\n setTaskType(value);\n };\n\n const handleStart = () => {\n processInstance(comment, taskType?.value)\n .then(() => {\n setIsOpenSnackbar(true);\n setComment('');\n setTaskType(null);\n onClose();\n })\n .catch(() => {});\n };\n\n const handleCloseSnackbar = () => {\n setIsOpenSnackbar(false);\n };\n\n const open = Boolean(anchorEl);\n\n return (\n <>\n <Popover\n open={open}\n anchorEl={anchorEl}\n onClose={onClose}\n anchorOrigin={{\n vertical: 'bottom',\n horizontal: 'right'\n }}\n transformOrigin={{\n vertical: 'top',\n horizontal: 'right'\n }}\n classes={{\n paper: styles.popoverPaper\n }}\n >\n <div className={styles.content}>\n <Typography className={styles.title}>{i18n.text('Add new workflow')}</Typography>\n <SimpleDropDownSelector\n className={styles.simpleDropDownSelector}\n variant=\"filled\"\n height={40}\n TextFieldProps={{\n InputProps: {\n disableUnderline: true\n }\n }}\n placeholder={i18n.text('Select task type')}\n value={taskType}\n onChange={handleChangeTaskType}\n label={''}\n options={definitions.map((definition) => {\n return {\n value: definition.type,\n label: definition.displayName\n };\n })}\n />\n <TextField\n variant=\"filled\"\n hiddenLabel\n size=\"small\"\n placeholder=\"Type a comment\"\n InputProps={{\n disableUnderline: true,\n classes: {\n input: styles.input,\n root: styles.inputRoot\n }\n }}\n value={comment}\n onChange={handleChangeComment}\n multiline={true}\n />\n </div>\n <div className={styles.footer}>\n <Button disabled={loading} className={styles.cancelButton} onClick={onClose}>\n {i18n.text('Cancel')}\n </Button>\n <Button disabled={loading} color=\"primary\" onClick={handleStart}>\n {i18n.text('Start')}\n </Button>\n </div>\n </Popover>\n <Portal container={document.body}>\n <Snackbar\n open={isOpenSnackbar}\n autoHideDuration={5000}\n onClose={handleCloseSnackbar}\n message={i18n.text('A new workflow has started')}\n />\n </Portal>\n </>\n );\n};\n","import {useEffect, useState} from 'react';\nimport mdmModule from '@reltio/mdm-module';\nimport {Entity, processDefinitions} from '@reltio/mdm-sdk';\nimport {useSelector} from 'react-redux';\n\nconst filterDefinitions = (definitions, entityType) => {\n return definitions.filter(({manualStart, objectTypes}) => {\n return manualStart && (!objectTypes || objectTypes?.some((_entityType) => _entityType === entityType));\n });\n};\n\nexport const useWorkflowDefinitions = () => {\n const [definitions, setDefinitions] = useState([]);\n\n const workflowPath: string = useSelector(mdmModule.selectors.getWorkflowPath);\n const environment: string = useSelector(mdmModule.selectors.getWorkflowEnvironmentUrl);\n const tenant: string = useSelector(mdmModule.selectors.getTenant);\n const entity: Entity = useSelector(mdmModule.selectors.getEntity);\n const entityType = entity.type;\n\n useEffect(() => {\n processDefinitions({workflowPath, environment, tenant}).then(({data}) =>\n setDefinitions(filterDefinitions(data, entityType))\n );\n }, [entityType, workflowPath, environment, tenant]);\n\n return {definitions};\n};\n","import {useCallback, useContext, useState} from 'react';\nimport {useSelector} from 'react-redux';\nimport mdmModule from '@reltio/mdm-module';\nimport {Entity, startProcessInstance} from '@reltio/mdm-sdk';\nimport {WorkflowTasksContext} from '../../../contexts/WorkflowTasksContext';\nimport {showWorkflowError} from '../helpers/errors';\n\nexport const useWorkflowProcessInstance = () => {\n const {loadWorkflowTasks} = useContext(WorkflowTasksContext);\n const workflowPath: string = useSelector(mdmModule.selectors.getWorkflowPath);\n const environment: string = useSelector(mdmModule.selectors.getWorkflowEnvironmentUrl);\n const tenant: string = useSelector(mdmModule.selectors.getTenant);\n const entity: Entity = useSelector(mdmModule.selectors.getEntity);\n const entityUri = entity.uri;\n const [loading, setLoading] = useState(false);\n\n const processInstance = useCallback(\n (comment, taskType) => {\n setLoading(true);\n\n return startProcessInstance({\n workflowPath,\n tenant,\n environment,\n processType: taskType,\n comment,\n objectURIs: [entityUri]\n })\n .then(() => {\n loadWorkflowTasks();\n })\n .catch((error) => {\n showWorkflowError(error);\n throw error;\n })\n .finally(() => {\n setLoading(false);\n });\n },\n [entityUri, environment, loadWorkflowTasks, tenant, workflowPath]\n );\n\n return {processInstance, loading};\n};\n","import {makeStyles} from '@material-ui/core/styles';\n\nexport const useStyles = makeStyles({\n button: {\n padding: '9px 16px 9px 12px',\n marginLeft: 'auto',\n marginRight: '8px'\n },\n buttonLabel: {\n fontSize: '14px',\n fontWeight: 500,\n lineHeight: '16px'\n },\n icon: {\n fontSize: '18px',\n marginRight: '8px'\n }\n});\n","import React, {useState} from 'react';\nimport i18n from 'ui-i18n';\nimport {Button as Button} from '@material-ui/core';\nimport AddIcon from '@material-ui/icons/Add';\nimport {useWorkflowCheckPermission} from '../../hooks/useWorkflowCheckPermission';\nimport {AddWorkflowDialog} from '../AddWorkflowDialog/AddWorkflowDialog';\nimport {useStyles} from './styles';\n\nexport const AddWorkflowButton = () => {\n const styles = useStyles();\n const [anchorEl, setAnchorEl] = useState(null);\n\n const checkWorkflowPermission = useWorkflowCheckPermission();\n const canStartProcess = checkWorkflowPermission('START_PROCESS_INSTANCE');\n const canViewProcessDefinitions = checkWorkflowPermission('VIEW_PROCESS_DEFINITIONS');\n\n const handleOpen = (e) => setAnchorEl(e.currentTarget);\n const handleClose = () => setAnchorEl(null);\n\n return canStartProcess && canViewProcessDefinitions ? (\n <>\n <Button color=\"primary\" className={styles.button} onClick={handleOpen}>\n <AddIcon className={styles.icon} />\n <div className={styles.buttonLabel}>{i18n.text('Add')}</div>\n </Button>\n <AddWorkflowDialog anchorEl={anchorEl} onClose={handleClose} />\n </>\n ) : null;\n};\n","import {useCallback, useEffect, useState} from 'react';\nimport {useSelector} from 'react-redux';\nimport {filter, flatten, isNil, map, pipe, prop, reject, uniqBy} from 'ramda';\nimport mdmModule from '@reltio/mdm-module';\nimport {getTasksForEntity, isTempUri, WorkflowTaskData} from '@reltio/mdm-sdk';\nimport {useSafePromise} from '../../../hooks/useSafePromise';\nimport {useWorkflowCheckPermission} from './useWorkflowCheckPermission';\n\ntype Config = {\n processTypes?: string[];\n assignee?: string;\n showClosedTasks?: boolean;\n};\n\nexport const useWorkflowTasks = (config?: Config) => {\n const {processTypes, assignee, showClosedTasks} = config || {};\n const safePromise = useSafePromise();\n const workflowPath: string = useSelector(mdmModule.selectors.getWorkflowPath);\n const environment: string = useSelector(mdmModule.selectors.getWorkflowEnvironmentUrl);\n const isWorkflowEnabled = useSelector(mdmModule.selectors.isWorkflowEnabled);\n const tenant: string = useSelector(mdmModule.selectors.getTenant);\n const entityUri = useSelector(mdmModule.selectors.getEntityUri);\n const isEditableMode = useSelector(mdmModule.selectors.getIsEditableMode);\n const checkWorkflowPermission = useWorkflowCheckPermission();\n const canViewTasks = checkWorkflowPermission('VIEW_TASKS');\n const enabled = !!(workflowPath && environment) && isWorkflowEnabled && canViewTasks;\n const [tasks, setTasks] = useState<WorkflowTaskData[]>(null);\n const [total, setTotal] = useState<number>(0);\n const [loading, setLoading] = useState<boolean>(false);\n\n const loadWorkflowTasks = useCallback(() => {\n setLoading(true);\n const parsedProcessTypes = !Array.isArray(processTypes) || processTypes.includes('*') ? null : processTypes;\n const requests = (parsedProcessTypes || [null]).map((processType) =>\n getTasksForEntity({\n entityUri,\n workflowPath,\n environment,\n tenant,\n filter: {assignee, processType},\n includeClosed: !!showClosedTasks\n })\n );\n safePromise(Promise.all(requests))\n .then((responses) => {\n const tasks: WorkflowTaskData[] = pipe(\n map(prop('data')),\n reject(isNil),\n flatten,\n uniqBy(prop('taskId')),\n filter(isRequestedTask(parsedProcessTypes, assignee))\n )(responses);\n setTasks(tasks);\n setTotal(tasks.length);\n })\n .catch((error) => {\n console.warn('Workflow error', error);\n })\n .finally(() => {\n setLoading(false);\n });\n }, [entityUri, environment, safePromise, tenant, workflowPath, assignee, showClosedTasks, processTypes]);\n\n useEffect(() => {\n if (entityUri && enabled && !isTempUri(entityUri)) {\n loadWorkflowTasks();\n } else {\n setTasks(null);\n setTotal(0);\n }\n }, [enabled, entityUri, loadWorkflowTasks, isEditableMode]);\n\n const updateTaskState = useCallback((taskId: WorkflowTaskData['taskId'], payload: Partial<WorkflowTaskData>) => {\n setTasks((tasks) =>\n tasks.map((task) => {\n return task.taskId === taskId\n ? {\n ...task,\n ...payload\n }\n : task;\n })\n );\n }, []);\n\n return {tasks, total, loading, updateTaskState, loadWorkflowTasks};\n};\n\nconst isRequestedTask = (processTypes: string[], assignee: string) => (task: WorkflowTaskData) =>\n (!processTypes || processTypes.includes(task.processType)) && (!assignee || assignee === task.assignee);\n","export const MAP_DRAWING_MODES = {\n CIRCLE: 'circle',\n POLYGON: 'polygon'\n};\n\nexport const DEFAULT_OVERLAY_OPTIONS = {\n fillColor: 'rgb(242,82,82)',\n fillOpacity: 0.1,\n strokeWeight: 2,\n strokeColor: '#F25252',\n clickable: false,\n editable: true,\n zIndex: 1\n};\n\nexport const DEFAULT_GOOGLE_MAP_OPTIONS = {\n mapTypeControl: false,\n streetViewControl: false,\n fullscreenControl: false\n};\n\nexport const MAP_MINIMUM_SCALE_RADIUS = 0.001;\n","import React from 'react';\n\ntype Value = {\n activeEntityUri?: string;\n};\n\nexport const EntityMarkerContext = React.createContext<Value>({});\nEntityMarkerContext.displayName = 'EntityMarkerContext';\n","import React from 'react';\nimport {InterceptHandlers} from '@reltio/mdm-sdk';\n\nexport const InterceptHandlersContext = React.createContext<InterceptHandlers>({});\n\nInterceptHandlersContext.displayName = 'InterceptHandlersContext';\n","import React from 'react';\n\nexport const ProfilePerspectiveViewContext = React.createContext(false);\n\nProfilePerspectiveViewContext.displayName = 'ProfilePerspectiveViewContext';\n","import React from 'react';\nimport {InterceptHandlers} from '@reltio/mdm-sdk';\n\ntype SandboxAPI = {\n interceptors?: InterceptHandlers;\n getCurrentPerspectiveId: () => string;\n showPerspective: (perspective) => void;\n setEntityUri: (entityUri: string, listener: () => void) => void;\n};\n\nexport const SandboxAPIContext = React.createContext<SandboxAPI>({\n getCurrentPerspectiveId: () => '',\n setEntityUri: () => {},\n showPerspective: () => {}\n});\n","import {\n AccessToken,\n CustomActionTaskParams,\n CustomActionExtension,\n CustomActionViewConfig,\n CustomScriptExtension,\n getAccessToken,\n RequestAction,\n sendRequestFromCustomSandbox,\n sendWorkflowRequest,\n startProcessFromQuery\n} from '@reltio/mdm-sdk';\nimport {isNewUI} from './helpers';\nimport {ProcessRequestParams} from './types';\n\ntype Config = CustomActionExtension | CustomActionViewConfig | CustomScriptExtension;\n\nconst processFromQuery = (\n params: CustomActionTaskParams,\n permissions?: string[] | undefined,\n workflowPath?: string,\n tenant?: string,\n environment?: string\n) => {\n if (!params.processDefinitionId) {\n return new Promise((resolve) => resolve({errorMessage: 'processDefinitionId is empty'}));\n }\n if (!params.searchString) {\n return new Promise((resolve) => resolve({errorMessage: 'searchString is empty'}));\n }\n if (!workflowPath) {\n return new Promise((resolve) => resolve({errorMessage: 'Workflow path is not defined'}));\n }\n const errors = validateParams({url: '/processInstances/_generateFromQuery', ...params}, permissions);\n if (errors) {\n return new Promise((resolve) => resolve(errors));\n }\n\n return startProcessFromQuery({\n workflowPath,\n processType: params.processDefinitionId,\n searchString: params.searchString,\n tenant,\n environment\n });\n};\n\nconst getHeaders = async (params: CustomActionTaskParams, signHandler?: () => Promise<AccessToken>) => {\n const {accessToken} = await signHandler?.();\n return accessToken\n ? {\n ...params.headers,\n Authorization: `Bearer ${accessToken}`\n }\n : params.headers;\n};\n\nconst workflowRequest = async (\n params: CustomActionTaskParams,\n permissions?: string[],\n workflowPath?: string,\n tenant?: string,\n signHandler?: () => Promise<AccessToken>\n) => {\n const {url} = params;\n const errors = validateParams(params, permissions);\n if (errors) {\n return errors;\n }\n const isExternalUrl = url.includes('http:') || url.includes('https:');\n if (!workflowPath && !isExternalUrl) {\n return {errorMessage: 'Workflow path is not defined'};\n }\n const headers = await getHeaders(params, signHandler);\n return await sendWorkflowRequest({\n url,\n method: params.method || 'GET',\n data: params.data,\n tenant,\n headers,\n workflowPath\n });\n};\n\nconst sendApiRequest = async (\n params: CustomActionTaskParams,\n permissions?: string[],\n signHandler?: () => Promise<AccessToken>\n) => {\n const errors = validateParams(params, permissions);\n if (errors) {\n return errors;\n }\n const headers = await getHeaders(params, signHandler);\n return await sendRequestFromCustomSandbox({\n url: params.url,\n method: params.method,\n data: params.data,\n headers,\n noRequestProcessor: true\n });\n};\n\nconst validateParams = (params: CustomActionTaskParams, permissions?: string[]) => {\n const {url} = params;\n if (!url) return {errorMessage: 'URL is empty'};\n const allowed = permissions?.some((perm) => {\n const parsed = perm.match(\n /^(?:([^:?#]+):)?(?:\\/\\/((?:(([^:@?]*)(?::([^:@?]*))?)?@)?((?:\\[[0-9A-Fa-f:]+)|(?:[^:?#]*))(?::(\\d*))?))?((((?:[^?#]*\\/)*)([^?#]*))(?:\\?([^#]*))?(?:#(.*))?)/\n );\n const protocol = parsed[1];\n const host = parsed[6];\n const protocolAndHost = `${protocol}://${host}`;\n const re = new RegExp('^' + perm + '$');\n const formattedPerm = perm.replace(/\\/*$/, '');\n return (\n formattedPerm === url ||\n (host && host === formattedPerm) ||\n (host && protocolAndHost === formattedPerm) ||\n (formattedPerm && formattedPerm.indexOf('/') === 0 && url && url.indexOf(formattedPerm) === 0) ||\n (formattedPerm && re.test(url))\n );\n });\n\n if (!allowed || (permissions?.length || 0) === 0) {\n return {errorMessage: 'Not enough permissions'};\n }\n return false;\n};\n\nexport const processRequest = ({\n name,\n paramObject,\n permissions,\n worker,\n metadata,\n config,\n apiPath,\n servicesPath,\n user,\n workflowPath,\n entity,\n tenant,\n entityUri,\n query,\n openSearch,\n environment,\n getCurrentPerspectiveId,\n showPerspective,\n workflowCheckPermission,\n setEntityUri\n}: ProcessRequestParams) => {\n const handleRequest = (request: Promise<any>) => {\n request\n .then((data) => {\n worker.postMessage({\n action: 'response',\n result: {data, headers: paramObject.params.headers, status: 200},\n ...paramObject.params\n });\n })\n .catch((error) => {\n worker.postMessage({\n action: 'response',\n result: {data: error, headers: paramObject.params.headers, status: 0},\n ...paramObject.params\n });\n });\n };\n const shouldSignRequest = isNewUI(servicesPath);\n const signHandler = shouldSignRequest\n ? () => getAccessToken({servicesPath})\n : () => Promise.resolve({accessToken: ''});\n\n switch (name) {\n case RequestAction.API: {\n const request = sendApiRequest(paramObject.params, permissions, signHandler);\n handleRequest(request);\n break;\n }\n case RequestAction.WORKFLOW: {\n const request = workflowRequest(paramObject.params, permissions, workflowPath, tenant, signHandler);\n handleRequest(request);\n break;\n }\n case RequestAction.WORKFLOW_START_PROCESS_FROM_QUERY: {\n const request = processFromQuery(paramObject.params, permissions, workflowPath, tenant, environment);\n handleRequest(request);\n break;\n }\n case RequestAction.GET_CONFIGURATION: {\n worker.postMessage({action: 'response', result: metadata, ...paramObject.params});\n break;\n }\n case RequestAction.GET_UI_CONFIGURATION: {\n const response = {...config, action: {...config.action}};\n if (response.action.permissions) {\n delete response.action.permissions;\n }\n worker.postMessage({action: 'response', result: response, ...paramObject.params});\n break;\n }\n case RequestAction.SET_ENTITY_URI: {\n const listener = () => worker.postMessage({action: 'response', result: entity, ...paramObject.params});\n setEntityUri(entityUri, listener);\n break;\n }\n case RequestAction.SET_PERSPECTIVE: {\n showPerspective(paramObject.params.perspective);\n worker.postMessage({\n action: 'response',\n result: getCurrentPerspectiveId(),\n ...paramObject.params\n });\n break;\n }\n case RequestAction.GET_PERSPECTIVE: {\n if (getCurrentPerspectiveId) {\n worker.postMessage({\n action: 'response',\n result: getCurrentPerspectiveId(),\n ...paramObject.params\n });\n }\n break;\n }\n case RequestAction.WORKFLOW_CHECK_PERMISSION: {\n worker.postMessage({\n action: 'response',\n result: workflowCheckPermission(paramObject.params.permission),\n ...paramObject.params\n });\n break;\n }\n case RequestAction.GET_SEARCH_QUERY: {\n worker.postMessage({action: 'response', result: query, ...paramObject.params});\n break;\n }\n case RequestAction.OPEN_SEARCH: {\n openSearch({viewId: (config as Config).id, searchState: paramObject.params.searchState || {}});\n break;\n }\n case RequestAction.GET_ENTITY_URI: {\n worker.postMessage({action: 'response', result: entityUri, ...paramObject.params});\n break;\n }\n case RequestAction.GET_ENTITY: {\n worker.postMessage({action: 'response', result: entity, ...paramObject.params});\n break;\n }\n case RequestAction.GET_API_PATH: {\n worker.postMessage({action: 'response', result: apiPath, ...paramObject.params});\n break;\n }\n case RequestAction.WORKFLOW_GET_WORKFLOW_PATH: {\n worker.postMessage({action: 'response', result: workflowPath, ...paramObject.params});\n break;\n }\n case RequestAction.GET_TENANT: {\n worker.postMessage({action: 'response', result: tenant, ...paramObject.params});\n break;\n }\n case RequestAction.GET_USER: {\n worker.postMessage({action: 'response', result: user, ...paramObject.params});\n break;\n }\n case RequestAction.ALERT: {\n worker.postMessage({\n action: 'response',\n result: window.alert(paramObject.params.text),\n ...paramObject.params\n });\n break;\n }\n case RequestAction.CONFIRM: {\n worker.postMessage({\n action: 'response',\n result: window.confirm(paramObject.params.text),\n ...paramObject.params\n });\n break;\n }\n case RequestAction.PROMPT: {\n worker.postMessage({\n action: 'response',\n result: window.prompt(paramObject.params.text, paramObject.params.defaultText || ''),\n ...paramObject.params\n });\n break;\n }\n case RequestAction.OPEN_WINDOW: {\n window.open(paramObject.params.url, '_blank');\n break;\n }\n case RequestAction.RELOAD_PAGE: {\n location.reload();\n break;\n }\n }\n};\n","import nanoid from 'nanoid';\n\nexport const isNewUI = (path?: string): boolean => {\n return path?.includes('/nui');\n};\n\nexport const getWorkerURL = (uiPath: string, tenant: string) => {\n if (isNewUI(uiPath)) {\n return `${uiPath.replace(`${tenant}/`, '')}worker_api.js`;\n } else {\n return `${uiPath}worker_api.js`;\n }\n};\n\nexport const getFilesWithArrayBuffer = (files: FileList) => {\n const readFilePromises = Array.from(files).map((file) => {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onload = (event) => {\n const content = event.target.result;\n const {lastModified, name, size, type} = file;\n resolve({lastModified, name, size, type, content});\n };\n reader.onerror = (error) => {\n reject(error);\n };\n reader.readAsArrayBuffer(file);\n });\n });\n return Promise.all(readFilePromises);\n};\n\nconst processInnerHtml = (parent: HTMLElement, worker: Worker, setTooltip) => {\n let handlersToReset = [];\n const uiActions = parent.getAttribute('ui-actions');\n const uiTooltip = parent.getAttribute('ui-tooltip');\n const id = parent.getAttribute('id') || parent.getAttribute('name');\n if (uiActions) {\n uiActions.split(',').forEach((uiAction) => {\n const handler = (event: Event) => {\n const target = event.target as HTMLInputElement;\n const postEventMessage = (files?) => {\n worker.postMessage({\n action: 'event',\n type: 'uiAction',\n data: {type: uiAction, id, event: {...event, files}}\n });\n };\n if (target.files?.length) {\n getFilesWithArrayBuffer(target.files).then(postEventMessage);\n } else {\n postEventMessage();\n }\n };\n parent.addEventListener(uiAction, handler);\n handlersToReset.push(() => {\n parent.removeEventListener(uiAction, handler);\n });\n });\n parent.removeAttribute('ui-actions');\n }\n if (uiTooltip) {\n setTooltip(uiTooltip);\n }\n parent.childNodes.forEach((child) => {\n if (child.nodeType === 1) {\n //Node.ELEMENT_NODE\n handlersToReset = handlersToReset.concat(processInnerHtml(child as HTMLElement, worker, setTooltip));\n }\n });\n return handlersToReset;\n};\n\ntype ResetHTMLParams = {\n worker: Worker;\n setTooltip: any;\n html?: string;\n innerText?: string;\n setListenersToReset: any;\n setHtml: any;\n};\n\nexport const resetHtml = ({worker, setTooltip, innerText, html, setListenersToReset, setHtml}: ResetHTMLParams) => {\n const docBlock = document.createElement('div');\n docBlock.innerHTML = html || innerText;\n\n const handlersToReset = processInnerHtml(docBlock, worker, setTooltip);\n setListenersToReset(handlersToReset);\n setHtml(docBlock);\n};\n\nconst isURLtoProcess = (processApi: string[], url: string) =>\n (processApi || []).some((request) => {\n const regExp = new RegExp(`^${request}$`);\n return request.replace(/\\/*$/, '') === url || (request && regExp.test(url));\n });\n\nexport const setUpQooxdooRequestInterceptor = ({workerRef, setRequestListeners}) => ({\n processApiRequest: (url, method, headers, data, next) => {\n const requestId = nanoid();\n const options = {url, method, headers, noRequestProcessor: true};\n setRequestListeners(options, next, requestId);\n workerRef.current.postMessage({\n action: 'apiRequest',\n id: requestId,\n url,\n method,\n headers,\n data\n });\n }\n});\n\nexport const setUpQooxdooResponseInterceptor = ({workerRef, setResponseListeners}) => ({\n processApiResponse: (url, method, data, next) => {\n const responseId = nanoid();\n setResponseListeners(next, responseId);\n workerRef.current.postMessage({\n action: 'apiResponse',\n id: responseId,\n url,\n method,\n data\n });\n }\n});\n\nexport const setUpRequestInterceptor = ({\n apiPath,\n reltioPath,\n tenant,\n processApiRequest,\n workerRef,\n setRequestListeners\n}) => ({\n options = {},\n url,\n next\n}: {\n next: (url: string, options: RequestInit) => void;\n abort?: (error: Error) => void;\n url: string;\n options: RequestInit;\n}) => {\n const fakeURL =\n url.startsWith('/') && !url.startsWith(apiPath)\n ? `${reltioPath}/api/${tenant}${url}`\n : `${reltioPath}${url.replace(apiPath, '')}`;\n const isProcessableUrl = isURLtoProcess(processApiRequest, fakeURL);\n if (isProcessableUrl) {\n const requestId = nanoid();\n setRequestListeners(options, next, requestId);\n workerRef.current.postMessage({\n action: 'apiRequest',\n id: requestId,\n url: fakeURL,\n method: options.method,\n headers: {...options.headers, origin: 'ui', requestId},\n data: options.body\n });\n } else {\n next(url, options);\n }\n};\n\nexport const setUpResponseInterceptor = ({\n reltioPath,\n apiPath,\n processApiResponse,\n workerRef,\n setResponseListeners\n}) => ({url, response, next, options, abort}) => {\n if (options?.headers?.origin === 'ui') {\n response\n .json()\n .then((data) => {\n setResponseListeners(next, options.headers.requestId);\n workerRef.current.postMessage({\n action: 'response',\n result: {data, status: response.status},\n id: options?.id,\n name: options?.task?.params?.name\n });\n })\n .catch((error) => {\n abort(error);\n });\n } else {\n const fakeURL = `${reltioPath}${url.replace(apiPath, '')}`;\n const isProcessableUrl = isURLtoProcess(processApiResponse, fakeURL);\n\n if (isProcessableUrl) {\n const responseId = nanoid();\n response\n .json()\n .then((data) => {\n setResponseListeners(next, responseId);\n workerRef.current.postMessage({\n action: 'apiResponse',\n id: responseId,\n url: fakeURL,\n method: options.method,\n data\n });\n })\n .catch((error) => {\n abort(error);\n });\n } else {\n next(response);\n }\n }\n};\n","const defaultAttributes = [\n 'accent-height',\n 'accumulate',\n 'additive',\n 'alignment-baseline',\n 'allowReorder',\n 'alphabetic',\n 'amplitude',\n 'arabic-form',\n 'ascent',\n 'attributeName',\n 'attributeType',\n 'autoReverse',\n 'azimuth',\n 'baseFrequency',\n 'baseline-shift',\n 'baseProfile',\n 'bbox',\n 'begin',\n 'bias',\n 'by',\n 'calcMode',\n 'cap-height',\n 'class',\n 'clip',\n 'clipPathUnits',\n 'clip-path',\n 'clip-rule',\n 'color',\n 'color-interpolation',\n 'color-interpolation-filters',\n 'color-profile',\n 'color-rendering',\n 'contentScriptType',\n 'contentStyleType',\n 'cursor',\n 'cx',\n 'cy',\n 'd',\n 'decelerate',\n 'descent',\n 'diffuseConstant',\n 'direction',\n 'display',\n 'divisor',\n 'dominant-baseline',\n 'dur',\n 'dx',\n 'dy',\n 'edgeMode',\n 'elevation',\n 'enable-background',\n 'end',\n 'exponent',\n 'externalResourcesRequired',\n 'fill',\n 'fill-opacity',\n 'fill-rule',\n 'filter',\n 'filterRes',\n 'filterUnits',\n 'flood-color',\n 'flood-opacity',\n 'font-family',\n 'font-size',\n 'font-size-adjust',\n 'font-stretch',\n 'font-style',\n 'font-variant',\n 'font-weight',\n 'format',\n 'from',\n 'fx',\n 'fy',\n 'g1',\n 'g2',\n 'glyph-name',\n 'glyph-orientation-horizontal',\n 'glyph-orientation-vertical',\n 'glyphRef',\n 'gradientTransform',\n 'gradientUnits',\n 'hanging',\n 'height',\n 'horiz-adv-x',\n 'horiz-origin-x',\n 'id',\n 'ideographic',\n 'image-rendering',\n 'in',\n 'in2',\n 'intercept',\n 'k',\n 'k1',\n 'k2',\n 'k3',\n 'k4',\n 'kernelMatrix',\n 'kernelUnitLength',\n 'kerning',\n 'keyPoints',\n 'keySplines',\n 'keyTimes',\n 'lang',\n 'lengthAdjust',\n 'letter-spacing',\n 'lighting-color',\n 'limitingConeAngle',\n 'local',\n 'marker-end',\n 'marker-mid',\n 'marker-start',\n 'markerHeight',\n 'markerUnits',\n 'markerWidth',\n 'mask',\n 'maskContentUnits',\n 'maskUnits',\n 'mathematical',\n 'max',\n 'media',\n 'method',\n 'min',\n 'mode',\n 'name',\n 'numOctaves',\n 'offset',\n 'opacity',\n 'operator',\n 'order',\n 'orient',\n 'orientation',\n 'origin',\n 'overflow',\n 'overline-position',\n 'overline-thickness',\n 'panose-1',\n 'paint-order',\n 'path',\n 'pathLength',\n 'patternContentUnits',\n 'patternTransform',\n 'patternUnits',\n 'pointer-events',\n 'points',\n 'pointsAtX',\n 'pointsAtY',\n 'pointsAtZ',\n 'preserveAlpha',\n 'preserveAspectRatio',\n 'primitiveUnits',\n 'r',\n 'radius',\n 'refX',\n 'refY',\n 'rendering-intent',\n 'repeatCount',\n 'repeatDur',\n 'requiredExtensions',\n 'requiredFeatures',\n 'restart',\n 'result',\n 'rotate',\n 'rx',\n 'ry',\n 'scale',\n 'seed',\n 'shape-rendering',\n 'slope',\n 'spacing',\n 'specularConstant',\n 'specularExponent',\n 'speed',\n 'spreadMethod',\n 'startOffset',\n 'stdDeviation',\n 'stemh',\n 'stemv',\n 'stitchTiles',\n 'stop-color',\n 'stop-opacity',\n 'strikethrough-position',\n 'strikethrough-thickness',\n 'string',\n 'stroke',\n 'stroke-dasharray',\n 'stroke-dashoffset',\n 'stroke-linecap',\n 'stroke-linejoin',\n 'stroke-miterlimit',\n 'stroke-opacity',\n 'stroke-width',\n 'style',\n 'surfaceScale',\n 'systemLanguage',\n 'tableValues',\n 'target',\n 'targetX',\n 'targetY',\n 'text-anchor',\n 'text-decoration',\n 'text-rendering',\n 'textLength',\n 'to',\n 'transform',\n 'type',\n 'u1',\n 'u2',\n 'underline-position',\n 'underline-thickness',\n 'unicode',\n 'unicode-bidi',\n 'unicode-range',\n 'units-per-em',\n 'v-alphabetic',\n 'v-hanging',\n 'v-ideographic',\n 'v-mathematical',\n 'values',\n 'version',\n 'vert-adv-y',\n 'vert-origin-x',\n 'vert-origin-y',\n 'viewBox',\n 'viewTarget',\n 'visibility',\n 'width',\n 'widths',\n 'word-spacing',\n 'writing-mode',\n 'x',\n 'x-height',\n 'x1',\n 'x2',\n 'xChannelSelector',\n 'y',\n 'y1',\n 'y2',\n 'yChannelSelector',\n 'z',\n 'zoomAndPan'\n];\n\nconst defaultTags = [\n 'animate',\n 'animateColor',\n 'animateMotion',\n 'animateTransform',\n 'mpath',\n 'set',\n 'circle',\n 'ellipse',\n 'line',\n 'polygon',\n 'polyline',\n 'rect',\n 'defs',\n 'glyph',\n 'g',\n 'marker',\n 'mask',\n 'missing-glyph',\n 'pattern',\n 'svg',\n 'switch',\n 'symbol',\n 'font',\n 'font-face',\n 'font-face-format',\n 'font-face-name',\n 'font-face-src',\n 'font-face-uri',\n 'hkern',\n 'vkern',\n 'linearGradient',\n 'radialGradient',\n 'stop',\n 'circle',\n 'ellipse',\n 'image',\n 'line',\n 'path',\n 'polygon',\n 'polyline',\n 'rect',\n 'text',\n 'use',\n 'feDistantLight',\n 'fePointLight',\n 'feSpotLight',\n 'circle',\n 'ellipse',\n 'line',\n 'path',\n 'polygon',\n 'polyline',\n 'rect',\n 'defs',\n 'g',\n 'svg',\n 'symbol',\n 'use',\n 'altGlyph',\n 'altGlyphDef',\n 'altGlyphItem',\n 'glyph',\n 'glyphRef',\n 'textPath',\n 'text',\n 'tref',\n 'tspan',\n 'altGlyph',\n 'textPath',\n 'tref',\n 'tspan',\n 'clipPath',\n 'color-profile',\n 'cursor',\n 'filter',\n 'foreignObject',\n 'script',\n 'style',\n 'view'\n];\n\nexport default {\n attributes: {\n '*': [...defaultAttributes, 'ui-actions', 'ui-tooltip'],\n img: ['src', 'srcset', 'alt', 'title', 'loading'],\n link: ['href', 'rel'],\n iframe: ['src'],\n a: ['href']\n },\n tags: [...defaultTags, 'a', 'link', 'input', 'button', 'iframe', 'img']\n};\n","import sanitizeHtml, {IOptions} from 'sanitize-html';\nimport sanitizeOptions from './helpers/sanitizerOptions';\n\nexport const useHtmlSanitizer = () => {\n const {allowedAttributes, allowedTags} = sanitizeHtml.defaults;\n const {attributes, tags} = sanitizeOptions;\n const options: IOptions = {\n allowedTags: allowedTags.concat(tags),\n allowedAttributes: {...allowedAttributes, ...attributes},\n allowVulnerableTags: true\n };\n return (html: string) => sanitizeHtml(html, options);\n};\n","import {useCallback, useContext, useEffect, useRef, useState, CSSProperties} from 'react';\nimport {useDispatch, useSelector} from 'react-redux';\nimport mdmModule, {ui} from '@reltio/mdm-module';\nimport {\n CustomAction,\n CustomActionTaskParams,\n CustomScriptPlatform,\n CustomActionViewConfig,\n CustomActionExtension,\n Entity,\n initializeWebWorker,\n isEmptyValue,\n ProcessParams\n} from '@reltio/mdm-sdk';\nimport {omit} from 'ramda';\nimport {useWorkflowCheckPermission} from '../../components/workflow';\nimport {useHtmlSanitizer} from '../useHtmlSanitizer';\nimport {InterceptHandlersContext, SandboxAPIContext, SnackbarContext} from '../../contexts';\nimport {processRequest} from './API';\nimport {\n getWorkerURL,\n resetHtml,\n isNewUI,\n setUpResponseInterceptor,\n setUpRequestInterceptor,\n setUpQooxdooRequestInterceptor,\n setUpQooxdooResponseInterceptor\n} from './helpers';\nimport {Request} from './types';\n\ntype Config = CustomActionViewConfig | CustomActionExtension;\n\nexport const useAPI = (config: Config = {} as Config) => {\n const [html, setHtml] = useState<HTMLElement>();\n const [listenersToReset, setListenersToReset] = useState<Array<() => void>>([]);\n const [popupListenersToReset, setPopupListenersToReset] = useState<Array<() => void>>([]);\n const [visible, setVisible] = useState(true);\n const [popup, setPopup] = useState<HTMLElement>();\n const [tooltip, setTooltip] = useState<string>(null);\n const [customStyles, setCustomStyles] = useState<{\n height?: number | string;\n width?: number | string;\n pointerEvents?: CSSProperties['pointerEvents'];\n }>({});\n const workerRef = useRef<Worker>();\n const requestListeners = useRef({});\n const responseListeners = useRef({});\n\n const dispatch = useDispatch();\n const sanitizeHtml = useHtmlSanitizer();\n\n const uiPath = useSelector(mdmModule.selectors.getUIPath);\n const tenant: string = useSelector(mdmModule.selectors.getTenant);\n const workerUrl = getWorkerURL(uiPath, tenant);\n\n const showSnackbarMessage = useContext(SnackbarContext);\n const qxApi = useContext(SandboxAPIContext);\n const interceptHandlers = useContext(InterceptHandlersContext);\n\n const workflowCheckPermission = useWorkflowCheckPermission();\n\n const metadata = useSelector(mdmModule.selectors.getMetadata) || {};\n const entity = useSelector(mdmModule.selectors.getEntity) || ({} as Entity);\n const apiPath: string = useSelector(mdmModule.selectors.getApiPath);\n const servicesPath = useSelector(mdmModule.selectors.getServicesPath);\n const reltioPath = useSelector(mdmModule.selectors.getReltioPath);\n const workflowPath = useSelector(mdmModule.selectors.getWorkflowPath);\n const user = useSelector(mdmModule.selectors.getUser);\n const entityUri = useSelector(mdmModule.selectors.getEntityUri);\n const environment = useSelector(mdmModule.selectors.getWorkflowEnvironmentUrl);\n const {type: typeSearch, data: search} = useSelector(mdmModule.selectors.getSearchProviderData) || {};\n const isOldUI = !isNewUI(servicesPath);\n const supportedInterceptHandlers = isOldUI ? qxApi.interceptors : interceptHandlers;\n\n const openSearch = (search) => dispatch(ui.actions.openSearch(search));\n\n let innerText = '';\n let popupText = '';\n const process = ({task, worker}: ProcessParams) => {\n if (task) {\n switch (task.action) {\n case CustomAction.SET_HTML: {\n const sanitizedHtml = sanitizeHtml((task.params as CustomActionTaskParams).html);\n if ((task.params as CustomActionTaskParams).id) {\n const elem = document.getElementById((task.params as CustomActionTaskParams).id as string);\n elem.innerHTML = sanitizedHtml;\n } else if (innerText !== sanitizedHtml) {\n innerText = sanitizedHtml;\n resetHtml({\n worker,\n setTooltip,\n html: sanitizedHtml,\n innerText,\n setListenersToReset,\n setHtml\n });\n }\n break;\n }\n case CustomAction.SHOW_POPUP: {\n const sanitizedPopup = sanitizeHtml(task.params as string);\n popupText = sanitizedPopup;\n resetHtml({\n worker,\n setTooltip,\n html: sanitizedPopup,\n innerText: popupText,\n setListenersToReset: setPopupListenersToReset,\n setHtml: setPopup\n });\n break;\n }\n case CustomAction.HIDE_POPUP: {\n popupText = '';\n setPopup(null);\n break;\n }\n case CustomAction.SET_VISIBILITY: {\n if (task.params === 'visible') {\n setVisible(true);\n resetHtml({\n worker,\n setTooltip,\n innerText,\n setListenersToReset,\n setHtml\n });\n } else {\n setVisible(false);\n }\n break;\n }\n case CustomAction.SET_TOOLTIP: {\n setTooltip(task.params as string);\n break;\n }\n case CustomAction.SET_HEIGHT: {\n setCustomStyles((prev) => ({\n ...prev,\n height: task.params as string | number\n }));\n break;\n }\n case CustomAction.SET_WIDTH: {\n setCustomStyles((prev) => ({\n ...prev,\n width: task.params as string | number\n }));\n break;\n }\n case CustomAction.SET_ENABLED: {\n setCustomStyles((prev) =>\n task.params ? omit(['pointer-events'], prev) : {...prev, 'pointer-events': 'none'}\n );\n break;\n }\n case CustomAction.LOG: {\n console.log(task.params); //eslint-disable-line no-console\n break;\n }\n case CustomAction.MESSAGE: {\n showSnackbarMessage(task.params as string);\n break;\n }\n case CustomAction.REQUEST: {\n if ((task.params as CustomActionTaskParams)?.headers?.origin !== 'ui') {\n processRequest({\n name: (task.params as CustomActionTaskParams).name,\n paramObject: task as Request,\n permissions: config.action.permissions,\n worker,\n metadata,\n config: config as Config,\n user,\n servicesPath,\n apiPath: isOldUI ? apiPath : reltioPath,\n tenant,\n workflowPath,\n entity,\n entityUri,\n environment,\n query: typeSearch === 'search' ? search?.query : null,\n openSearch,\n workflowCheckPermission,\n ...qxApi\n });\n } else {\n const {headers, id, url: fakeURL, method, data} = task.params as CustomActionTaskParams;\n const url = fakeURL.replace(reltioPath, apiPath);\n if (requestListeners.current[headers.requestId]) {\n requestListeners.current[headers.requestId].next(url, {\n body: data,\n id,\n task,\n headers,\n method\n });\n requestListeners.current = omit([headers.requestId], requestListeners.current);\n }\n }\n break;\n }\n case CustomAction.RETURN_PROCESSED_API_RESPONSE:\n case CustomAction.RETURN_PROCESSED_API_REQUEST: {\n const {id, data} = task.params as CustomActionTaskParams;\n if (responseListeners.current[id]) {\n responseListeners.current[id].next(data);\n responseListeners.current = omit([id], responseListeners.current);\n }\n break;\n }\n }\n }\n };\n\n const setRequestListeners = (options, next, requestId) => {\n requestListeners.current = {\n ...requestListeners.current,\n [requestId]: {options, next, id: requestId}\n };\n };\n\n const setResponseListeners = (next, responseId) => {\n responseListeners.current = {\n ...responseListeners.current,\n [responseId]: {next}\n };\n };\n\n const qooxdooRequestInterceptor = setUpQooxdooRequestInterceptor({workerRef, setRequestListeners});\n const qooxdooResponseInterceptor = setUpQooxdooResponseInterceptor({workerRef, setResponseListeners});\n const requestInterceptor = setUpRequestInterceptor({\n apiPath,\n reltioPath,\n tenant,\n processApiRequest: config?.action?.processApiRequest,\n workerRef,\n setRequestListeners\n });\n const responseInterceptor = setUpResponseInterceptor({\n reltioPath,\n apiPath,\n processApiResponse: config?.action?.processApiResponse,\n workerRef,\n setResponseListeners\n });\n\n useEffect(() => {\n if (!isEmptyValue(config.action) && config.action.platform !== CustomScriptPlatform.CLASSIC) {\n workerRef.current = initializeWebWorker(workerUrl, process, config);\n }\n }, [entity]);\n\n useEffect(\n () => () => {\n listenersToReset.forEach((listener) => listener());\n },\n [listenersToReset]\n );\n //we need to have separate handlers in opposite case main window listeners will be removed on the popup appear\n useEffect(\n () => () => {\n popupListenersToReset.forEach((listener) => listener());\n },\n [popupListenersToReset, listenersToReset]\n );\n\n const onClick = useCallback(() => {\n workerRef.current?.postMessage({\n action: 'event',\n type: 'execute',\n data: null\n });\n }, [config]);\n\n useEffect(() => {\n if (\n !isEmptyValue(supportedInterceptHandlers) &&\n (config?.action?.processApiRequest || config?.action?.processApiResponse)\n ) {\n const {\n addInternalRequestInterceptor,\n addInternalResponseInterceptor,\n removeInternalRequestInterceptor,\n removeInternalResponseInterceptor\n } = supportedInterceptHandlers;\n\n if (isOldUI) {\n addInternalRequestInterceptor(config?.action?.processApiRequest, qooxdooRequestInterceptor);\n addInternalResponseInterceptor(config?.action?.processApiResponse, qooxdooResponseInterceptor);\n return () => {\n removeInternalRequestInterceptor(qooxdooRequestInterceptor);\n removeInternalResponseInterceptor(qooxdooResponseInterceptor);\n };\n } else {\n addInternalRequestInterceptor(requestInterceptor);\n addInternalResponseInterceptor(responseInterceptor);\n return () => {\n removeInternalRequestInterceptor(requestInterceptor);\n removeInternalResponseInterceptor(responseInterceptor);\n };\n }\n }\n }, [config]);\n\n return {html, visible, tooltip, customStyles, onClick, popup};\n};\n","import {useCallback, useEffect, useState} from 'react';\nimport {concat, difference, isEmpty, map, pipe, prop, reduce, reject, uniq} from 'ramda';\nimport {useSelector} from 'react-redux';\nimport mdm from '@reltio/mdm-module';\nimport {\n ActivityFilters,\n Comment,\n Entity,\n FilterOptions,\n getFilteredEntities,\n isEntityUri,\n getEntity,\n EntitiesMap\n} from '@reltio/mdm-sdk';\nimport {useSafePromise} from './useSafePromise';\n\nconst SELECT_OPTION = 'uri,label,type';\n\nexport const useCommentsEntitiesMap = (comments: Comment[]) => {\n const safePromise = useSafePromise();\n const currentEntityUri = useSelector(mdm.selectors.getEntityUriWithDataTenant);\n\n const [entitiesMap, setEntitiesMap] = useState<EntitiesMap>({});\n\n const getEntities = useCallback(\n (entitiesUris: string[]) => {\n const requestFilters = [\n {\n filter: FilterOptions.EQUALS,\n fieldName: 'uri',\n values: entitiesUris\n }\n ];\n\n const requestOptions = {\n max: entitiesUris.length,\n activeness: ActivityFilters.ALL,\n select: 'uri,label,type'\n };\n return safePromise(getFilteredEntities(requestFilters, requestOptions));\n },\n [safePromise]\n );\n\n const getNotFoundEntity = (entityUri: string) => {\n return getEntity(entityUri, {options: SELECT_OPTION})\n .then((entity: Entity) => ({...entity, uri: entityUri} as Entity))\n .catch(() => ({}));\n };\n\n const addNotFoundEntities = useCallback(\n (entitiesUris: string[], entities: Entity[]) => {\n return safePromise(\n Promise.all((entitiesUris || []).map(getNotFoundEntity))\n ).then((notFoundEntities: Entity[]) => pipe(reject(isEmpty), concat(entities))(notFoundEntities));\n },\n [safePromise]\n );\n\n useEffect(() => {\n const uniqEntitiesUris = pipe(\n reduce((entitiesUris, comment) => {\n const {objectType: type, relatedObjectUris} = comment;\n\n if (type === 'relation' || type === 'potentialMatch') {\n (relatedObjectUris || []).forEach((uri) => {\n if (uri !== currentEntityUri && isEntityUri(uri) && !entitiesMap[uri]) {\n entitiesUris.push(uri);\n }\n });\n }\n return entitiesUris;\n }, []),\n uniq\n )(comments || []);\n\n if (uniqEntitiesUris.length) {\n getEntities(uniqEntitiesUris)\n .then((results: Entity[]) => {\n const getNotFoundUris = pipe(map(prop('uri')), difference(uniqEntitiesUris));\n\n const notFoundEntities = getNotFoundUris(results);\n return addNotFoundEntities(notFoundEntities, results);\n })\n .then((results) => {\n setEntitiesMap((prevEntitiesMap) =>\n results.reduce(\n (entities, entity) => {\n entities[entity.uri] = entity;\n return entities;\n },\n {...prevEntitiesMap}\n )\n );\n })\n .catch(() => {});\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [getEntities, addNotFoundEntities, comments, currentEntityUri]);\n\n return entitiesMap;\n};\n","import {useSelector} from 'react-redux';\nimport mdmModule from '@reltio/mdm-module';\nimport {checkConfigPermission, ConfigPermissions} from '@reltio/mdm-sdk';\nimport {useCallback} from 'react';\n\nconst emptyArray = [];\n\nexport const useConfigPermissions = () => {\n const userRoles = useSelector(mdmModule.selectors.getUserRoles) || emptyArray;\n\n return {\n canCreate: useCallback(checkConfigPermission(ConfigPermissions.CREATE, userRoles), [userRoles]),\n canRead: useCallback(checkConfigPermission(ConfigPermissions.READ, userRoles), [userRoles]),\n canUpdate: useCallback(checkConfigPermission(ConfigPermissions.UPDATE, userRoles), [userRoles]),\n canDelete: useCallback(checkConfigPermission(ConfigPermissions.DELETE, userRoles), [userRoles])\n };\n};\n","import {useCallback, useEffect, useRef, useState} from 'react';\nimport {useDispatch, useSelector} from 'react-redux';\nimport {cond, pipe, prop, T, when, identity, times, length, ifElse, always} from 'ramda';\nimport mdm, {profile} from '@reltio/mdm-module';\nimport {\n ActivityFilter,\n addGlobalFilterToQuery,\n Entity,\n getRelationsForDataTenantEntity,\n getRelationsForEntity,\n GlobalSearchRequestOptions,\n isDataTenantEntity,\n isTempUri,\n Mode,\n wrapInArrayIfNeeded\n} from '@reltio/mdm-sdk';\nimport {useSafePromise} from './useSafePromise';\nimport {usePrevious} from './usePrevious';\n\ntype Props = {\n sorting?: {\n field: string;\n order: string;\n };\n filter?: string;\n page: number;\n rowsPerPage: number;\n config: {\n id: string;\n content: Record<string, unknown>;\n suggested?: Record<string, unknown>[] | Record<string, unknown>;\n };\n entity: Entity;\n relationActivityFilter?: ActivityFilter;\n mode: Mode;\n};\n\nconst buildSuggestedIds = when(\n identity,\n pipe(\n wrapInArrayIfNeeded,\n length,\n times((n) => n + 1)\n )\n);\n\nexport const useRelationsLoader = ({\n sorting,\n filter,\n page,\n rowsPerPage,\n config,\n entity,\n relationActivityFilter,\n mode\n}: Props) => {\n const [isLoading, setIsLoading] = useState(false);\n const dispatch = useDispatch();\n const tenant = useSelector(mdm.selectors.getTenant) as string;\n const dtssPath = useSelector(mdm.selectors.getDtssPath) as string;\n const {activityFilter, globalFilter}: GlobalSearchRequestOptions =\n useSelector(mdm.selectors.getGlobalSearchRequestOptions) || {};\n const safePromise = useSafePromise();\n const suggested = config.suggested;\n const loadRelations = useCallback(() => {\n if (entity?.uri) {\n const requestConfig = {\n ...config.content,\n sortBy: sorting?.field,\n order: sorting?.order,\n returnDates: true,\n returnObjects: true,\n activeness: {\n relation: relationActivityFilter || ActivityFilter.ALL,\n entity: activityFilter\n },\n max: rowsPerPage,\n offset: page * rowsPerPage,\n filter: addGlobalFilterToQuery(globalFilter, filter) || undefined,\n suggested: buildSuggestedIds(suggested)\n };\n const configs = [requestConfig].concat(\n ifElse(\n identity,\n pipe(wrapInArrayIfNeeded, (suggested) =>\n suggested.map((config, i) => ({...config, id: requestConfig.suggested[i]}))\n ),\n always([])\n )(suggested)\n );\n const request = cond([\n [pipe(prop('uri'), isTempUri), () => Promise.resolve([{total: 0}])],\n [\n isDataTenantEntity,\n (entity) =>\n getRelationsForDataTenantEntity({\n entityUri: entity.uri,\n configs: configs,\n customerTenant: tenant,\n dataTenant: entity.dataTenant,\n dtssPath\n })\n ],\n [T, (entity) => getRelationsForEntity(entity.uri, configs)]\n ]);\n setIsLoading(true);\n safePromise(request(entity))\n .then(([{connections, total}]) => {\n dispatch(profile.relations.actions.relationsLoaded({id: config.id, connections, total}));\n })\n .finally(() => {\n setIsLoading(false);\n });\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n activityFilter,\n config,\n dispatch,\n dtssPath,\n entity?.uri,\n entity?.dataTenant,\n filter,\n globalFilter,\n page,\n relationActivityFilter,\n rowsPerPage,\n safePromise,\n sorting,\n tenant\n ]);\n const isRequestSentRef = useRef<boolean>(false);\n isRequestSentRef.current = false;\n useEffect(() => {\n isRequestSentRef.current = true;\n loadRelations();\n }, [loadRelations]);\n const prevMode = usePrevious(mode);\n useEffect(() => {\n if (mode === Mode.Viewing && !isRequestSentRef.current && prevMode !== mode) {\n isRequestSentRef.current = true;\n loadRelations();\n }\n }, [loadRelations, mode, prevMode]);\n return {isLoading, reload: loadRelations};\n};\n"],"names":["useStyles","makeStyles","searchButton","marginLeft","marginRight","padding","input","flex","fontSize","background","startAdornment","color","paddingLeft","ExpandableSearchInput","query","onChange","value","setValue","useState","isOpen","setIsOpen","useEffect","styles","hasValue","length","Input","className","autoFocus","placeholder","i18n","disableUnderline","pipe","getValue","InputAdornment","position","Search","endAdornment","SmallIconButton","size","icon","CloseIcon","onClick","F","always","tap","onKeyPress","when","propEq","trim","IconButton","T","container","minHeight","title","lineHeight","paddingTop","paddingBottom","justifyContent","children","BasicViewHeader","classes","root","classnames","EmptyStub","style","display","HideOnShrink","widthToHide","handleWidth","render","width","propTypes","PropTypes","alignItems","height","check","ImportModes","tooltip","noop","mode","INIT","button","tooltipTitle","CloudDownloadIcon","PROGRESS","CircularProgress","spinner","SUCCESS","Done","renderCurrentMode","link","textDecoration","to","href","e","stopPropagation","preventDefault","theme","maxWidth","MAX_WIDTH_SELECT","outlined","paddingRight","arrowIcon","top","right","palette","text","secondary","currentValue","currentValueIcon","currentValueText","textTransform","fontWeight","primary","whiteSpace","textOverflow","overflow","menuItem","firstMenuItemButton","borderTop","menuItemInner","menuItemIcon","menuItemLabel","menuItemDescription","isButton","ModeSwitcherSelect","optionsGroup","buttonsGroup","disabled","Select","target","some","variant","renderValue","IconComponent","label","find","Box","Tooltip","Typography","MenuProps","anchorOrigin","vertical","horizontal","transformOrigin","getContentAnchorEl","items","firstButtonIdx","findIndex","map","item","idx","description","menuItemProps","MenuItem","key","renderMenuItems","flexDirection","profileCardWrapper","gap","profileCardContainer","flexGrow","rulesContainer","marginBottom","ProfileMatchCard","entitiesMap","entity","match","metadata","ProfileCard","object","matchRules","MatchRulesBlock","scroll","element","scrollIntoView","block","behavior","clearScrollTimer","scrollTimer","clearTimeout","isScrolledIntoView","scrollableParent","elemTop","offsetTop","elemBottom","clientHeight","scrollTop","from","highlighted","animationName","animationDuration","animationIterationCount","borderBottom","content","backgroundColor","clickable","cursor","selected","fade","main","inactive","inactiveBackground","inactiveHoverBackground","inactiveSelectedBackground","inactiveSelectedHoverBackground","justImported","avatar","image","marginTop","info","overflowWrap","wordWrap","secondaryLabel","businessCard","secondRow","connect","state","mdmModule","entities","entityToHighlight","selectedEntityUri","onEntityClick","onEntityHover","entitiesImportStatus","entityButtonsRenderer","list","useRef","useDidUpdateEffect","current","querySelectorAll","parentElement","setTimeout","ref","getLabel","businessCardText","getBusinessCardAttributesText","isActive","isActiveObject","entityUri","uri","entityUriForLink","getEntityUriForLink","importStatus","prop","undefined","onMouseEnter","onMouseLeave","EntityAvatar","avatarClassName","imageClassName","EntityUriLink","EntityTypeBadge","getEntityId","filter","Boolean","join","minWidth","textAlign","bottom","left","zIndex","transform","opacity","borderLeft","borderRight","animation","boxSizing","TreeNode","listIndex","swapFrom","swapLength","swapDepth","scaffoldBlockPxWidth","lowerSiblingCounts","connectDropTarget","isOver","draggedNode","canDrop","treeIndex","treeId","getPrevRow","node","path","rowDirection","otherProps","rowDirectionClass","scaffoldBlockCount","scaffold","forEach","lowerSiblingCount","i","lineClass","push","highlightLineClass","Children","child","cloneElement","defaultProps","isRequired","NodeRendererDefault","toggleChildrenVisibility","connectDragPreview","connectDragSource","isDragging","canDrag","subtitle","isSearchMatch","isSearchFocus","buttons","didDrop","parentNode","nodeTitle","nodeSubtitle","handle","expanded","Array","_","index","dropEffect","isDraggedDescendant","isDescendant","isLandingPadActive","buttonStyle","type","btn","TreePlaceholder","Component","this","props","drop","border","boxShadow","outline","borderColor","PlaceholderRendererDefault","memoize","f","savedArgsArray","savedKeysArray","savedResult","args","keysArray","Object","keys","sort","argsArray","arg","memoizedInsertNode","insertNode","memoizedGetFlatDataFromTree","getFlatDataFromTree","memoizedGetDescendantCount","getDescendantCount","DndManager","constructor","treeRef","hoverHandler","hoverProps","dropTargetProps","monitor","component","getItem","targetDepth","getTargetDepth","lastDropTargetNode","lastDropTargetDepth","dragHover","minimumTreeIndex","depth","deferredCallHoverHandler","shouldSkipMoreFrames","rafId","requestAnimationFrame","resetDragVariables","startDrag","endDrag","dndType","treeData","draggingTreeData","getNodeKey","customCanDrop","maxDepth","lastCanDropResult","lastCanDropProps","dropTargetDepth","rowAbove","canNodeHaveChildren","slice","Math","min","blocksOffset","dragSourceInitialDepth","relativePosition","findDOMNode","getBoundingClientRect","leftShift","getSourceClientOffset","x","round","direction","getDifferenceFromInitialOffset","max","draggedChildDepth","getDepth","abovePath","aboveNode","newCanDropProps","nodeId","aboveNodeId","equals","addedResult","newNode","expandParent","prevPath","prevParent","prevTreeIndex","nextPath","nextParent","nextTreeIndex","wrapSource","el","nodeDragSource","beginDrag","cancelAnimationFrame","getDropResult","dropTargetNode","dragSource","dragPreview","wrapTarget","nodeDropTarget","result","hover","bind","dropTarget","dragged","wrapPlaceholder","placeholderDropTarget","treeIdCounter","mergeTheme","merged","innerStyle","reactVirtualizedListProps","overridableDefaults","nodeContentRenderer","placeholderRenderer","rowHeight","slideRegionSize","treeNodeRenderer","propKey","ReactSortableTree","super","isVirtualized","dndManager","treePlaceholderRenderer","scrollZoneVirtualList","createScrollingComponent","withScrolling","List","vStrength","createVerticalStrength","hStrength","createHorizontalStrength","draggedMinimumTreeIndex","draggedDepth","searchMatches","searchFocusTreeIndex","dragging","draggingExpandedPaths","ignoreOneTreeUpdate","instanceProps","searchQuery","searchFocusOffset","ignoreTreeChanges","moveNode","handleDndMonitorChange","componentDidMount","loadLazyChildren","stateUpdate","search","setState","clearMonitorSubscription","dragDropManager","getMonitor","subscribeToStateChange","nextProps","prevState","newState","assign","componentDidUpdate","prevProps","onDragStateChanged","walk","callback","pending","onLazyLoadChildren","removeNode","draggedPath","reduce","newTree","changeNodeAtPath","isTreeDataEqual","componentWillUnmount","getRows","ignoreCollapsed","targetNode","onVisibilityToggle","nextParentNode","onMoveNode","seekIndex","expand","singleSearch","searchFinishCallback","searchMethod","onlyExpandSearchedNodes","expandedTreeData","matches","toggleExpandedForAll","defaultSearchMethod","expandAllMatchPaths","expandFocusMatchPaths","newDraggingTreeData","nodePath","newDraggingExpandedPaths","gt","append","uniqWith","eqBy","String","dropResult","shouldCopy","shouldCopyOnOutsideDrop","copyNode","resetTree","loadCollapsedLazyChildren","done","childrenArray","oldNode","renderRow","row","matchKeys","generateNodeProps","TreeNodeRenderer","NodeContentRenderer","nodeKey","callbackParams","nodeProps","rowCanDrag","sharedProps","rows","swapTo","fromIndex","toIndex","count","rowsWithoutMoved","slideRows","scrollToInfo","scrollToIndex","containerStyle","Placeholder","PlaceholderContent","ScrollZoneVirtualList","verticalStrength","horizontalStrength","speed","scrollToAlignment","rst__virtualScrollOverride","onScroll","rowCount","estimatedRowSize","rowRenderer","rowStyle","defaultGetNodeKey","polyfill","StyledReactSortableTree","withStyles","SortableTreeWithoutDndContext","DndContext","DragAndDrop","getReactElementText","parent","stringSearch","indexOf","getNodeDataAtTreeIndexOrNextIndex","targetIndex","currentIndex","isPseudoRoot","selfPath","nextIndex","childIndex","childCount","walkDescendants","mapDescendants","nextNode","selfInfo","mapResult","RESULT_MISS","traverse","currentTreeIndex","pathIndex","Error","removedNode","removedTreeIndex","addNodeAtDepthAndIndex","isLastChild","currentDepth","n","insertedTreeIndex","parentPath","insertIndex","pathFragment","newChildren","insertResult","flattened","nodeInfo","older","younger","deepest","matchCount","trav","isSelfMatch","hasFocusMatch","extraInfo","hasChildren","getTreeFromFlatData","flatData","getKey","id","getParentKey","parentId","rootKey","childrenToParents","parentKey","addNodeUnderParent","addAsFirstChild","hasBeenAdded","changedTreeData","getNodeAtPath","foundNodeInfo","err","removeNodeAtPath","getVisibleNodeInfoAtIndex","getVisibleNodeCount","total","currentNode","editor","letterSpacing","margin","dense","actionButtons","RelationEditor","connection","modifiedEntity","allModifiedEntities","dispatch","config","globalSearchRequestOptions","error","relationUri","relationType","relation","isNew","inRelations","inRelationTypes","outRelations","outRelationTypes","useMemo","getInOutRelations","parentEntityUri","contentSecondLevel","firstLevelRelationAttrTypes","getRelationAttributesList","attributeListEntity","attributes","profile","getActivenessAttributes","initialConnection","initialModifiedEntity","relatedTempEntities","findRelatedTemporaryEntities","relatedTempEntitiesUrisHistory","concat","uniq","initialRelatedTempEntities","defaultRelationType","getDefaultRelationTypeObject","hasChanges","initial","actual","isEmptyValue","applyAction","onRelationTypeChange","useCallback","handleClose","updateModifiedEntityLabel","entityType","getEntityType","updateConnectionEntityLabel","setModifiedEntity","deleteModifiedEntity","onChangeEntity","getErrorId","validate","errors","validateConnection","resetErrors","onApply","omitMarks","differenceWith","onCancel","initialEntity","initialTempEntities","onAddAttributes","params","param","viewId","onChangeAttribute","onDeleteAttribute","onCreateEntity","entityTypeUri","initValue","newEntityAttrTypes","relationEditorAttributeTypesSelectionStrategy","getCreatableAttributeTypes","newEntity","createTemporaryEntity","attributeTypes","errorMessage","getErrorMessage","getEntityTypesUris","entityTypes","ConnectionRelationTypeSelector","ErrorWrapper","EntitySelector","isTempUri","entityTypesUris","onCreate","attributeTypesSelectionStrategy","AttributesList","attrTypes","showEmptyEditors","crosswalks","parentUri","Button","Divider","ConnectionType","EntityType","RelationsConfigType","MetadataType","AttributeErrorType","ownProps","isTempEntity","getRelationEditorActiveError","reltioLayoutItemToReactGridLayoutItem","y","maxHeight","isStatic","w","h","minW","minH","maxW","maxH","static","reactGridLayoutItemToReltioLayoutItem","reactGridLayoutToReltioLayout","layout","getReltioLayoutItemById","curry","updateExtraPropsInLayoutItem","mergeAll","pick","copyPropsFromPreviousLayout","oldReltioLayout","reltioLayout","layoutItem","defaultTo","__","gridLayout","borderRadius","transitionDuration","userSelect","transitionProperty","willChange","pointerEvents","transition","backgroundImage","svg2Url","backgroundRepeat","backgroundOrigin","visibility","gridFullscreen","overflowY","ReltioGridLayout","views","layoutOptions","onLayoutChanged","draggableHandle","LayoutItem","onRemove","onDrop","droppingItem","isDroppable","fullscreenItemId","setFullscreenItemId","setWidth","cols","processedLayout","reltioLayoutToReactGridLayout","onReltioLayoutChanged","onToggleFullscreen","prevId","isFullscreenEnabled","onItemHeightResize","layoutId","isLayoutChanged","newLayout","newHeight","options","ceil","calcHeight","refreshMode","refreshRate","onResize","innerRef","autoSize","onLayoutChange","isResizable","isDraggable","isItemFullscreen","autosizeComponent","autosizing","AutosizeComponent","layoutItemId","handleHeight","layoutItemConfig","fullscreen","isFullscreen","onConfigChanged","identity","memo","MapControlContainer","controlElement","setControlElement","controlDiv","document","createElement","divIndex","controls","removeAt","classList","add","createPortal","viewBox","xmlns","d","fill","stroke","strokeWidth","fillRule","xmlnsXlink","xlinkHref","mask","fillOpacity","ButtonWithTooltip","withTooltip","TopRightMapControls","drawingMode","drawingModes","hasActiveOverlay","onDrawingModeChanged","onClearOverlay","changeDrawingModeTo","HighlightOff","Icon","MAP_DRAWING_MODES","RadiusIcon","DrawIcon","getIcon","alignSelf","checkbox","TopCenterMapControls","isSearchOnMapMove","onChangeIsSearchOnMapMove","FormControlLabel","control","Checkbox","checked","event","getMapBoundsPolygon","bounds","getBounds","ne","getNorthEast","sw","getSouthWest","neLat","lat","neLng","lng","swLat","swLng","additionalPoint1","additionalPoint2","center","getCenter","getDrawingMode","window","google","maps","drawing","OverlayType","CIRCLE","POLYGON","fitMapBoundsForOverlay","overlay","existingBounds","LatLngBounds","extend","LatLng","fitBounds","popper","hoveredMarkerIcon","markerIcon","marker","popperAnchor","hovered","setHovered","activeEntityUri","useContext","EntityMarkerContext","pathEq","point","setHoveredDebounced","debounce","onMouseOver","onMouseOut","handleClick","Popper","anchorEl","open","modal","placement","url","scaledSize","Size","visible","alignBottom","pane","pixelOffset","closeBoxURL","enableEventPropagation","disableAutoPan","mapControlContainer","libraries","ReltioMap","markers","mapKey","defaultZoom","defaultCenter","loadingElement","isSearchEnabled","activeOverlay","overlayOptions","markerClusterer","markerClustererOptions","mapOptions","mapContainerClassName","onMapBoundsChanged","onOverlayUpdated","onMarkerClicked","isLoaded","loadError","useJsApiLoader","googleMapsApiKey","mapMoveEndTimer","setMap","polygon","setPolygon","setDrawingMode","prevMarkers","usePrevious","prevActiveOverlay","apiIsLoaded","MAP_MINIMUM_SCALE_RADIUS","fitMapBoundsForMarkers","useFitMapBounds","allOverlayOptions","DEFAULT_OVERLAY_OPTIONS","googleMapOptions","DEFAULT_GOOGLE_MAP_OPTIONS","handleChangeIsSearchOnMapMove","handleMapMoveStart","handleMapMoveEnd","handleMapIdle","handleOverlayChange","propOverlay","stateOverlay","isEmpty","typeActions","getPath","getArray","latlng","radius","getRadius","data","handleOverlayComplete","handleClearOverlay","renderMarkers","clusterer","mapTypeId","MapTypeId","ROADMAP","onLoad","zoom","onZoomChanged","onDragStart","onIdle","ControlPosition","TOP_RIGHT","TOP_CENTER","editable","onMouseUp","onDragEnd","onPolygonComplete","onCircleComplete","drawingControl","circleOptions","polygonOptions","attributesContainer","header","noCaption","noData","caption","excludeUris","includeUris","attributesCount","pivotingAttributes","useSelector","mdm","filteredAttrTypes","getFilteredAttrTypes","isShowAttributeList","getAttributesListForReadMode","values","PivotingAttributeContext","BasicView","FacetViewHeader","drawLines","pinnedAttributes","useDispatch","ViewIdContext","userRoles","pinnedAttributeUris","getPinnedAttributesForUser","PinnedAttributesContext","Mode","restProps","EntityContext","isViewMode","defaultHistoryDiff","appearance","roles","tags","fixRefEntity","evolve","refEntity","wrapInArrayIfNeeded","refRelation","prepareHistorySlice","historySlice","useHistoryDiff","historyDiff","historyMode","aEntity","bEntity","History","computeEntityHistoryDiff","HistoryMode","card","withBackground","lineWrapper","line","commentsInfo","commentsIcon","infoValue","infoBlock","flag","date","mainInfo","controlsBox","controlsInRow","priority","comments","taskId","assignee","isTaskOpen","currentAssignee","getAssignees","updateAssignee","updateRequestIsInProgress","readOnly","useWorkflowAssignee","DropDownSelector","isDisabled","getOptions","hideSelectedOptions","defaultOptions","TextFieldProps","dueDate","dueDateInput","inputLabel","updateDueDate","updateTaskState","WorkflowTasksContext","workflowPath","environment","tenant","safePromise","useSafePromise","setUpdateRequestIsInProgress","canUpdateTask","useWorkflowCheckPermission","checkWorkflowPermission","isOpenTask","newValue","updateDueDateForTask","then","catch","showWorkflowError","finally","useWorkflowDueDate","DateEditor","getTime","InputProps","InputLabelProps","priorities","updatePriority","newPriority","updatePriorityForTask","WorkflowPriority","useWorkflowPriority","possibleActions","actions","actionRequestIsInProgress","loadWorkflowTasks","username","setActionRequestIsInProgress","performTaskAction","action","runTaskAction","ui","useWorkflowActions","DropDownMenuButton","buttonComponent","buttonProps","MoreVertIcon","menuId","menuItems","decorator","lineBlock","flexShrink","withLinePadding","noLine","plain","last","rowDivider","first","transparent","divider","light","taskToColor","COLORS","colorIndex","task","createdBy","createTime","displayName","step","processDefinitionDisplayName","objectURIs","processInstanceComments","dcrId","getDCRId","hash","useWorkflowColor","isExpanded","setExpanded","canViewComments","Flag","CollapseButton","CollaborationIcon","WorkflowComments","cx","cy","r","OperationTypes","DCRTypes","getOperationType","oldValue","CREATE_RELATIONSHIP","INSERT_ATTRIBUTE","ADDED","UPDATE_TAGS","UPDATE_ROLES","UPDATE_ATTRIBUTE","EDITED","DELETE_ATTRIBUTE","DELETE_RELATIONSHIP","DELETED","PIN_ATTRIBUTE","pin","PIN_DELETED","PINNED","IGNORE_ATTRIBUTE","ignored","IGNORE_DELETED","IGNORED","getOperationLabel","operation","getDataTypeDefinition","attributeType","attributeValue","allPass","DataTypes","isUrl","getAttrDataTypeDefinition","getValues","attrType","newAttrValues","pathOr","name","oldAttrValues","times","getEntityChanges","entityInfo","changes","getAttributesList","getRelationChanges","relationInfo","changeType","getRelationType","flatten","level","propOr","addRelationOperationIfNeeded","dcrAttributesFactory","complement","getNestedAttributeChange","getReferenceAttributeChange","isSpecialAttribute","is","getSimpleAttributeValue","getSimpleAttributeChange","attributeTypeList","getAttributeTypeSubAttributes","getDiffParameters","SPECIAL_ATTRIBUTES_NAMES","EntityAttrTypes","prepareStartOrEndDate","parseValue","isNaN","parseInt","isExistedValue","isExistNewValue","isExistOldValue","prepareRolesOrTags","change","getRoleLabel","diffNewValue","difference","diffOldValue","prepareAttribute","changePath","attributePath","refObjectURI","refAttributeType","generateTempUri","typePath","split","pathArray","holder","isNil","createEntityOrRelation","startDate","endDate","defaultProfilePicValue","newObject","mergeAttributesInChange","objectInfo","UPDATE_PROFILE_PIC_BY_URL","UPDATE_START_DATE","UPDATE_END_DATE","CREATE_ENTITY","linkLabel","suggestionsCount","Link","underline","field","wordBreak","fieldName","arrow","chip","ArrowRightAlt","Chip","AttributesChangesContext","React","linkContainer","disabledLink","objectsInfo","getLinkDescription","isReference","anyPass","hasPath","ifElse","currentEntityUri","objectLabel","objectUri","startObjectUri","endObjectUri","endObjectLabel","startObjectLabel","objectURI","getAttributeDescription","renderLink","isNotExist","isExist","changeLabel","attrValue","getAttributeValue","DataTypeValue","dataTypeDefinition","has","getSuggestionsCount","showMoreLink","relationsInfo","mergedEntityChanges","mergedRelationsChanges","getAttributeChanges","attributeName","concatChanges","getters","attributesTree","acc","getter","changesTree","relationsTrees","updateRelation","omit","mergeChanges","changesList","relationshipTitle","onToggle","itemsToShow","collapsedSuggestionsCount","limit","setIsExpanded","collapsedItems","visibleSuggestionsCount","useCollapsibleList","Provider","getEntitiesObjects","isEntityUri","getRelationsObjects","isRelationUri","getRelations","objectsWithChanges","createEntityRelationsObjectByEntity","relations","createEntityRelationsObjectByRelation","concatEntityRelationsObjects","mergedRelations","dcrUri","getDCRUri","dcr","groupedObjects","setGroupedObjects","setDcr","requestEntities","entityUris","Promise","resolve","getEntitiesByUris","searchOptions","defaultMaxValues","getDataChangeRequest","extractObjectsFromChangeRequest","entityObjectsWithRelations","relationsObjects","relationsObjectsWithEntity","relationsObjectsWithoutEntity","partition","relationsObjectsWithRequestedEntities","relationsObject","useChangeRequest","DcrTaskIcon","pmCard","showTransitiveMatches","showInactiveEntities","useMatchesLoader","enabled","rowsPerPage","Number","MAX_SAFE_INTEGER","page","includes","PmTaskIcon","WorkflowTaskCardsFactory","build","processType","PredefinedWorkflowProcessType","DeleteRequestTaskIcon","DefaultTaskIcon","WorkflowTaskCard","popoverPaper","simpleDropDownSelector","inputRoot","select","footer","cancelButton","AddWorkflowDialog","onClose","comment","setComment","taskType","setTaskType","isOpenSnackbar","setIsOpenSnackbar","definitions","setDefinitions","processDefinitions","manualStart","objectTypes","_entityType","filterDefinitions","useWorkflowDefinitions","processInstance","loading","setLoading","startProcessInstance","useWorkflowProcessInstance","Popover","paper","SimpleDropDownSelector","definition","TextField","hiddenLabel","multiline","Portal","body","Snackbar","autoHideDuration","message","buttonLabel","AddWorkflowButton","setAnchorEl","canStartProcess","canViewProcessDefinitions","currentTarget","Add","useWorkflowTasks","processTypes","showClosedTasks","isWorkflowEnabled","isEditableMode","canViewTasks","tasks","setTasks","setTotal","parsedProcessTypes","isArray","requests","getTasksForEntity","includeClosed","all","responses","reject","uniqBy","isRequestedTask","console","warn","payload","fillColor","strokeWeight","strokeColor","mapTypeControl","streetViewControl","fullscreenControl","InterceptHandlersContext","ProfilePerspectiveViewContext","SandboxAPIContext","getCurrentPerspectiveId","setEntityUri","showPerspective","getHeaders","async","signHandler","accessToken","headers","Authorization","validateParams","permissions","perm","parsed","protocol","host","protocolAndHost","re","RegExp","formattedPerm","replace","test","processRequest","paramObject","worker","apiPath","servicesPath","user","openSearch","workflowCheckPermission","handleRequest","request","postMessage","status","isNewUI","getAccessToken","RequestAction","sendRequestFromCustomSandbox","method","noRequestProcessor","sendApiRequest","isExternalUrl","sendWorkflowRequest","workflowRequest","processDefinitionId","searchString","startProcessFromQuery","processFromQuery","response","perspective","permission","searchState","alert","confirm","prompt","defaultText","location","reload","getWorkerURL","uiPath","processInnerHtml","setTooltip","handlersToReset","uiActions","getAttribute","uiTooltip","uiAction","handler","postEventMessage","files","readFilePromises","file","reader","FileReader","onload","lastModified","onerror","readAsArrayBuffer","getFilesWithArrayBuffer","addEventListener","removeEventListener","removeAttribute","childNodes","nodeType","resetHtml","innerText","html","setListenersToReset","setHtml","docBlock","innerHTML","isURLtoProcess","processApi","regExp","setUpQooxdooRequestInterceptor","workerRef","setRequestListeners","processApiRequest","next","requestId","nanoid","setUpQooxdooResponseInterceptor","setResponseListeners","processApiResponse","responseId","setUpRequestInterceptor","reltioPath","fakeURL","startsWith","origin","setUpResponseInterceptor","abort","json","img","iframe","a","useHtmlSanitizer","allowedAttributes","allowedTags","sanitizeHtml","sanitizeOptions","allowVulnerableTags","useAPI","listenersToReset","popupListenersToReset","setPopupListenersToReset","setVisible","popup","setPopup","customStyles","setCustomStyles","requestListeners","responseListeners","workerUrl","showSnackbarMessage","SnackbarContext","qxApi","interceptHandlers","typeSearch","isOldUI","supportedInterceptHandlers","interceptors","popupText","process","CustomAction","sanitizedHtml","getElementById","sanitizedPopup","prev","log","qooxdooRequestInterceptor","qooxdooResponseInterceptor","requestInterceptor","responseInterceptor","platform","CustomScriptPlatform","initializeWebWorker","listener","addInternalRequestInterceptor","addInternalResponseInterceptor","removeInternalRequestInterceptor","removeInternalResponseInterceptor","useCommentsEntitiesMap","setEntitiesMap","getEntities","entitiesUris","requestFilters","FilterOptions","requestOptions","activeness","ActivityFilters","getFilteredEntities","getNotFoundEntity","getEntity","addNotFoundEntities","notFoundEntities","uniqEntitiesUris","objectType","relatedObjectUris","results","getNotFoundUris","prevEntitiesMap","emptyArray","useConfigPermissions","canCreate","checkConfigPermission","ConfigPermissions","canRead","canUpdate","canDelete","buildSuggestedIds","useRelationsLoader","sorting","relationActivityFilter","isLoading","setIsLoading","dtssPath","activityFilter","globalFilter","suggested","loadRelations","requestConfig","sortBy","order","returnDates","returnObjects","ActivityFilter","offset","addGlobalFilterToQuery","configs","cond","isDataTenantEntity","getRelationsForDataTenantEntity","customerTenant","dataTenant","getRelationsForEntity","connections","isRequestSentRef","prevMode"],"sourceRoot":""}