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,EAAAA,KAACirE,GAAO,CAACj8B,OAAQA,EAAQV,MAAOA,KAChCtuC,EAAAA,EAAAA,KAACypB,GAAAA,EAAqB,CAACjG,SAAS,aAChCxjB,EAAAA,EAAAA,KAACu1E,GAAAA,EAAsB,KACvBv1E,EAAAA,EAAAA,KAACw1E,GAAW,aAMxB,CAEA,SAASA,KAGP,OAFgB39D,EAAAA,EAAAA,OAGdxU,EAAAA,EAAAA,MAAAC,EAAAA,SAAA,CAAAC,SAAA,EACEvD,EAAAA,EAAAA,KAAC+wE,GAAgB,KACjB/wE,EAAAA,EAAAA,KAACq0E,GAAO,OAER,IACN,C","sources":["components/molecules/editors/NodeNotesPanel.jsx","components/atoms/inputs/StandardEditPopover.jsx","renderers/tree/common/VecMath.js","components/atoms/inputs/ColorSelect.jsx","hooks/useTreeActions.js","components/atoms/views/SmoothCollapse.jsx","components/molecules/panels/DuplicatePanel.jsx","components/molecules/NodeHeaderPanel.jsx","hooks/useCard.js","components/atoms/icons/NewSiblingIcon.jsx","components/atoms/icons/NewChildIcon.jsx","components/molecules/controllers/NodeActionButtons.jsx","components/molecules/panels/ActionButtonCard.jsx","providers/SwipableCardProvider.js","components/organisms/views/NodeView.jsx","components/organisms/views/SearchView.jsx","components/atoms/cards/MobileCard.jsx","components/atoms/inputs/GButton.jsx","components/atoms/cards/DesktopCard.jsx","components/atoms/cards/EmbedCard.jsx","components/atoms/cards/DynamicCard.jsx","components/atoms/inputs/StandardInputSelect.jsx","components/molecules/panels/SharePanel.jsx","components/molecules/controllers/ShareController.jsx","common/common.js","api/tree.js","components/pages/map/advisor/AdvisorBubble.jsx","components/atoms/ErrorBoundary.jsx","components/pages/map/advisor/common/SchemaExecutor.js","components/pages/map/advisor/PlayerBubble.jsx","components/pages/map/advisor/AdvisorPanel.jsx","components/pages/map/advisor/AdvisorController.jsx","components/molecules/overlays/MobileMapOverlay.jsx","components/atoms/ResourceMoveInfoDialog.jsx","components/molecules/controllers/PaneController.jsx","components/atoms/icons/MapIcon.jsx","components/molecules/panels/ContextSwitcherPanel.jsx","components/molecules/controllers/ContextController.jsx","components/molecules/controllers/OnlineStateController.jsx","components/molecules/overlays/DesktopMapOverlay.jsx","components/molecules/editors/MapNotesPanel.jsx","components/atoms/inputs/ImageSelect.jsx","components/atoms/views/Accordion.jsx","components/organisms/views/MapSettingsView.jsx","components/molecules/overlays/EmbedOverlay.jsx","components/organisms/views/MapDescriptionView.jsx","renderers/tree/pixi.js","renderers/tree/synapses/RasterSynapse.js","renderers/tree/common/AABB.js","renderers/tree/nodes/NodeBase.js","renderers/tree/nodes/RootAttachmentNode.js","renderers/tree/layouts/BaseLayout.js","renderers/tree/layouts/RootLayout.js","renderers/tree/nodes/RootNode.js","renderers/tree/text/DynamicChar.js","renderers/tree/text/DynamicTextStyle.js","renderers/tree/text/DynamicCharOverride.js","renderers/tree/text/Overrides.js","renderers/tree/text/TextMetrics.js","renderers/tree/text/DynamicAtlas.js","renderers/tree/text/DynamicText.js","renderers/tree/nodes/InteractiveNode.js","renderers/tree/common/RasterStyles.js","renderers/tree/layouts/ClusterLayout.js","renderers/tree/common/RemoteDragHandler.js","renderers/tree/common/NodeEventHandler.js","renderers/tree/common/LinkRenderer.js","renderers/tree/common/Screenshot.js","renderers/tree/TreeRenderer.js","renderers/tree/common/TreeKeyboardShortcuts.js","renderers/tree/common/PinchGesturePlugin.js","renderers/tree/renderer.js","hooks/useTreeReferenceRenderer.js","components/organisms/views/NotFoundView.jsx","components/organisms/routehandlers/RouteWithNodeId.jsx","components/organisms/routehandlers/RouteWithResourceId.jsx","components/organisms/routehandlers/RouteWithoutNodeId.jsx","components/pages/map/MapCard.jsx","renderers/tree/useTreeEngine.js","components/molecules/panels/NodeCreatePanel.jsx","components/organisms/dialogs/NodeCreateDialog.jsx","components/organisms/onboarding/Tour.jsx","components/organisms/onboarding/AppTour.jsx","components/pages/map/MapView.jsx"],"sourcesContent":["import { useCallback, useEffect, useMemo } from \"react\";\r\nimport { useSelector, useDispatch } from \"react-redux\";\r\nimport { SetNotesFullscreen } from \"../../../actions/app\";\r\nimport { useDevice } from \"../../../providers/DeviceContext\";\r\nimport { SetInboundLinksPanel } from \"../../../actions/search\";\r\nimport { useEntity, useContextId } from \"@emberly/dataplane\";\r\nimport Reference from \"../../../renderers/editortools/reference/Reference\";\r\nimport { CompactNotesEditor } from \"@emberly/editor\";\r\nimport { useHistory, useLocation } from \"react-router\";\r\n\r\nconst templates = [\"empty\", \"learningplan\", \"feynman\", \"knowledgeoverview\", \"informationsorting\"];\r\n\r\nexport default function NodeNotesPanel(props) {\r\n const { onFocused, active, nodeId, onMounted } = props;\r\n const notesFullscreen = useSelector(state => state.app.notesFullscreen);\r\n const { isMobilePortrait, isEmbed, isIos, isMobile } = useDevice();\r\n const contextId = useContextId();\r\n const { entity: node } = useEntity(\"Node\", nodeId);\r\n\r\n // handle notesFullscreen\r\n const history = useHistory();\r\n const location = useLocation();\r\n const dispatch = useDispatch();\r\n\r\n useEffect(() => { // TODO\r\n if (!notesFullscreen && location.search.indexOf(\"editor\") !== -1 && !isEmbed) {\r\n dispatch(SetNotesFullscreen(true));\r\n } else if (notesFullscreen && location.search.indexOf(\"editor\") === -1 && !isEmbed) {\r\n dispatch(SetNotesFullscreen(false));\r\n }\r\n }, [location.search, notesFullscreen, dispatch, isEmbed]);\r\n\r\n const onFullscreen = useCallback(() => {\r\n if (notesFullscreen) {\r\n history.replace({\r\n pathname: location.pathname,\r\n search: \"\",\r\n removeParameter: \"editor\"\r\n });\r\n } else {\r\n history.push({\r\n pathname: location.pathname,\r\n search: \"?editor=full\"\r\n });\r\n }\r\n }, [location, history, notesFullscreen]);\r\n\r\n const onViewBacklinks = useCallback(() => dispatch(SetInboundLinksPanel(true)), [dispatch]); // TODO maybe make this a part of editor.\r\n\r\n const plugins = useMemo(() => ({\r\n reference: {\r\n class: Reference,\r\n config: {\r\n dispatch: dispatch\r\n },\r\n shortcut: \"CMD+SHIFT+K\"\r\n }\r\n }), [dispatch]);\r\n\r\n return (\r\n <CompactNotesEditor\r\n onMounted={onMounted}\r\n placeholder=\"Write any thoughts about this topic...\"\r\n contextId={contextId}\r\n noteId={`node-${nodeId}`}\r\n active={active}\r\n onFocused={onFocused}\r\n title={!!node ? node.name : \"\"}\r\n templates={templates}\r\n readonly={isEmbed}\r\n swipeEnabled\r\n fullscreen={isEmbed ? undefined : notesFullscreen}\r\n onFullscreen={onFullscreen}\r\n history={history}\r\n isMobile={isMobile}\r\n isMobilePortraitView={isMobilePortrait}\r\n isIos={isIos}\r\n plugins={plugins}\r\n onViewBacklinks={onViewBacklinks}\r\n backlinks\r\n />\r\n );\r\n}\r\n","import { useState, useCallback } from \"react\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport { Popover, Button } from \"@mui/material\";\r\nimport { ExpandMore as ExpandMoreIcon, ExpandLess as ExpandLessIcon } from \"@mui/icons-material\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n button: {\r\n borderRadius: theme.spacing(0.5),\r\n padding: theme.spacing(1),\r\n height: \"32px\",\r\n paddingTop: \"auto\",\r\n paddingBottom: \"auto\",\r\n \"&.Mui-disabled\": {\r\n color: theme.palette.text.secondary,\r\n border: `1px solid ${theme.palette.divider}`,\r\n borderRadius: \"16px\",\r\n marginRight: theme.spacing(0.5),\r\n marginLeft: theme.spacing(0.5),\r\n }\r\n },\r\n chevron: {\r\n fontSize: \"16px !important\",\r\n color: theme.palette.text.secondary,\r\n marginLeft: \"-8px\"\r\n }\r\n}));\r\n\r\nconst anchorOrigin = {\r\n vertical: \"bottom\",\r\n horizontal: \"center\",\r\n};\r\n\r\nconst transformOrigin = {\r\n vertical: \"top\",\r\n horizontal: \"center\",\r\n};\r\n\r\nconst paperProps = {\r\n style: {\r\n marginTop: \"8px\",\r\n marginLeft: \"0px\"\r\n }\r\n};\r\n\r\nexport default function StandardEditPopover(props) {\r\n const classes = useStyles();\r\n const { id, componentClassName, disabled } = props;\r\n\r\n const [anchorEl, setAnchorEl] = useState(null);\r\n const onPanelClick = useCallback((ev) => setAnchorEl(ev.currentTarget), []);\r\n const onPanelClose = useCallback(() => setAnchorEl(null), []);\r\n\r\n const panelOpen = !!anchorEl;\r\n const panelId = panelOpen ? id : undefined;\r\n\r\n return (\r\n <>\r\n <Button\r\n className={`${classes.button} ${componentClassName || \"\"}`}\r\n endIcon={disabled ? null : panelOpen ? <ExpandLessIcon className={classes.chevron} /> : <ExpandMoreIcon className={classes.chevron} />}\r\n onClick={onPanelClick}\r\n disabled={disabled}\r\n >\r\n {props.component || null}\r\n </Button>\r\n <Popover\r\n id={panelId}\r\n open={panelOpen}\r\n anchorEl={anchorEl}\r\n onClose={onPanelClose}\r\n anchorOrigin={anchorOrigin}\r\n transformOrigin={transformOrigin}\r\n PaperProps={paperProps}\r\n >\r\n {props.children}\r\n </Popover>\r\n </>\r\n );\r\n}","\r\n\r\nexport default class VecMath {\r\n\r\n static Distance2F(x0, y0, x1, y1) {\r\n const dx = x0 - x1;\r\n const dy = y0 - y1;\r\n return dx * dx + dy * dy;\r\n }\r\n\r\n static ColorToSigned24Bit(s) {\r\n switch (s.length) {\r\n case 0:\r\n case 1: return 0x0;\r\n case 4: return VecMath.ColorToSigned24Bit(`#${s.substr(1).split(\"\").map(t => t + t).join(\"\")}`);\r\n case 7: return parseInt(s.substr(1), 16);\r\n default: return 0x0;\r\n }\r\n }\r\n\r\n static Signed24BitToColor(n) {\r\n if (n === null || n === undefined) return null;\r\n let c = (n & 0x00FFFFFF).toString(16).toUpperCase();\r\n return \"#\" + \"00000\".substring(0, 6 - c.length) + c;\r\n }\r\n\r\n}\r\n","import { useCallback, useState, useEffect } from \"react\";\r\nimport { Grid, ButtonBase, IconButton, Typography, Dialog, Collapse, Divider } from \"@mui/material\";\r\nimport { makeStyles, useTheme } from \"@mui/styles\";\r\nimport VecMath from \"../../../renderers/tree/common/VecMath\";\r\nimport { Add as AddIcon, ExpandMore as ExpandMoreIcon, ExpandLess as ExpandLessIcon } from \"@mui/icons-material\";\r\nimport { HexColorPicker, HexColorInput } from \"react-colorful\";\r\nimport CardHeader from \"../CardHeader\";\r\nimport Scrollbar from \"../Scrollbar\";\r\nimport usePlan from \"../../../hooks/usePlan\";\r\nimport { useDevice } from \"../../../providers/DeviceContext\";\r\nimport StandardToggle from \"./StandardToggle\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n root: {\r\n width: \"calc(100% + 8px)\",\r\n marginBottom: theme.spacing(1),\r\n marginTop: 0\r\n },\r\n button: {\r\n width: \"28px\",\r\n height: \"28px\",\r\n borderRadius: \"50%\",\r\n zIndex: 999999,\r\n filter: theme.palette.common.saturateFilter\r\n },\r\n customColorButton: {\r\n width: \"28px\",\r\n height: \"28px\",\r\n padding: theme.spacing(0.5),\r\n border: `4px solid ${theme.palette.grey[500]}`,\r\n boxShadow: \"none\",\r\n borderRadius: \"50%\"\r\n },\r\n customColorButtonSelected: {\r\n width: \"28px\",\r\n height: \"28px\",\r\n padding: theme.spacing(0.5),\r\n border: \"4px solid rgba(5,0,56,0.2)\",\r\n boxShadow: theme.shadows[2],\r\n borderRadius: \"50%\"\r\n },\r\n customColorButtonIcon: {\r\n fontSize: \"24px\",\r\n margin: \"-5px\"\r\n },\r\n gridItem: {\r\n textAlign: \"center\"\r\n },\r\n menu: {\r\n borderRadius: theme.spacing(0.5),\r\n overflow: \"visible\",\r\n outline: \"none\",\r\n \"& *:focus\": {\r\n outline: \"none\"\r\n }\r\n },\r\n list: {\r\n padding: 0\r\n },\r\n hexTextDesktop: {\r\n marginTop: theme.spacing(1)\r\n },\r\n colorPickerRoot: {\r\n position: \"relative\",\r\n width: \"100%\",\r\n padding: theme.spacing(1),\r\n marginTop: theme.spacing(1),\r\n \"& .react-colorful__saturation\": {\r\n filter: theme.palette.common.saturateFilter\r\n }\r\n },\r\n colorPickerRootMobile: {\r\n position: \"relative\",\r\n width: \"100%\",\r\n padding: theme.spacing(2),\r\n \"& .react-colorful__saturation\": {\r\n filter: theme.palette.common.saturateFilter\r\n }\r\n },\r\n colorPickerItem: {\r\n width: \"100%\",\r\n marginBottom: theme.spacing(2)\r\n },\r\n hexColorPickerItem: {\r\n width: \"100%\"\r\n },\r\n hexPicker: {\r\n position: \"relative\",\r\n width: \"100% !important\",\r\n height: \"308px !important\",\r\n \"& .react-colorful__saturation\": {\r\n width: \"100%\",\r\n height: \"248px\",\r\n borderRadius: theme.spacing(0.5),\r\n border: \"none\",\r\n filter: `drop-shadow(0px 4px 10px rgba(0, 0, 0, 0.2)) ${theme.palette.common.saturateFilter}`\r\n },\r\n \"& .react-colorful__hue\": {\r\n borderRadius: theme.spacing(0.5),\r\n marginTop: theme.spacing(3),\r\n color: theme.palette.text.secondary\r\n }\r\n },\r\n hexInput: {\r\n ...theme.typography.body1,\r\n height: \"45px\",\r\n width: \"100%\",\r\n paddingLeft: theme.spacing(1),\r\n border: `1px solid ${theme.palette.divider}`,\r\n outline: \"none\",\r\n \"& :focus\": {\r\n borderColor: theme.palette.primary.main\r\n }\r\n },\r\n hexText: {\r\n marginBottom: theme.spacing(0.5)\r\n },\r\n teaserImage: {\r\n width: \"200px\",\r\n height: \"256px\"\r\n },\r\n collapse: {\r\n width: \"100%\"\r\n },\r\n followParentContainer: {\r\n marginTop: theme.spacing(1)\r\n },\r\n followParentSubHeader: {\r\n maxWidth: \"calc(100% - 50px)\"\r\n },\r\n switch: {\r\n marginRight: theme.spacing(1)\r\n },\r\n divider: {\r\n marginBottom: theme.spacing(1.5)\r\n }\r\n}));\r\n\r\nconst colors = [\r\n // top\r\n \"#009AA0\", \"#48B4B8\", \"#77C4C7\",\r\n \"#0093D1\", \"#48AFDA\", \"#77C0DF\",\r\n \"#5484FF\", \"#83A4FA\", \"#A1B9F6\",\r\n\r\n // bottom\r\n \"#A968FF\", \"#BE91FA\", \"#CBABF6\",\r\n \"#EA6888\", \"#F197A9\", \"#EFAEBA\",\r\n \"#707070\", \"#ABABAB\"\r\n];\r\n\r\nconst colorsSet = new Set(colors);\r\n\r\n\r\nexport default function ColorSelect(props) {\r\n const { isMobilePortraitView } = useDevice();\r\n const classes = useStyles();\r\n const { value, onChange, className, onUnsetColor, allowUnset } = props;\r\n const currentColor = VecMath.Signed24BitToColor(value);\r\n const customSelected = !colorsSet.has(currentColor);\r\n const [customOpen, setCustomOpen] = useState(false);\r\n const { canUseCustomColors, showLimitReachedDialog, isOwner } = usePlan();\r\n\r\n const onCustomClose = () => setCustomOpen(false);\r\n\r\n\r\n const onCustomValueChange = (value) => {\r\n if (isMobilePortraitView) {\r\n setCustomOpen(false);\r\n }\r\n onChange(value);\r\n };\r\n\r\n const onCustomClick = () => {\r\n if (customOpen) {\r\n setCustomOpen(false);\r\n } else if (canUseCustomColors) {\r\n setCustomOpen(true);\r\n } else {\r\n showLimitReachedDialog(\r\n \"Upgrade to use custom colors\",\r\n isOwner ? \"Custom colors is unavailable in the free plan. Subscribe to the Plus or Plus Ultra plan to enable custom colors.\" : \"Custom colors is unavailable in the free plan. Tell the owner of the map to upgrade to enable custom colors.\",\r\n (\r\n <Grid item container justifyContent=\"center\" alignItems=\"center\">\r\n <img className={classes.teaserImage} src=\"/assets/custom_colors.png\" alt=\"custom colors\"></img>\r\n </Grid>\r\n )\r\n );\r\n }\r\n };\r\n\r\n const onFollowCheckbox = (checked) => {\r\n if (checked) {\r\n onUnsetColor();\r\n } else {\r\n onChange(VecMath.ColorToSigned24Bit(colors[0]));\r\n }\r\n };\r\n\r\n const currentColorOrDefault = currentColor || colors[0];\r\n\r\n return (\r\n <Grid\r\n container\r\n className={`${classes.root} ${className || \"\"}`}\r\n alignItems=\"center\"\r\n justifyContent=\"center\"\r\n spacing={1}\r\n >\r\n\r\n <Grid item container spacing={1} alignItems=\"center\" justifyContent=\"center\">\r\n {colors.map((color, index) => (<ColorSelectButton onClick={onChange} key={index} color={color} selected={currentColor === color} />))}\r\n <Grid item className={classes.gridItem}>\r\n <IconButton\r\n className={customSelected ? classes.customColorButtonSelected : classes.customColorButton}\r\n style={customSelected ? { borderColor: currentColor } : undefined}\r\n onClick={onCustomClick}\r\n size=\"large\">\r\n {isMobilePortraitView ? (\r\n <AddIcon className={classes.customColorButtonIcon} />\r\n ) : (\r\n customOpen ? <ExpandLessIcon className={classes.customColorButtonIcon} /> : <ExpandMoreIcon className={classes.customColorButtonIcon} />\r\n )}\r\n </IconButton>\r\n </Grid>\r\n </Grid>\r\n\r\n {\r\n isMobilePortraitView ? (\r\n <ColorPickerMobile open={customOpen} onChange={onCustomValueChange} onClose={onCustomClose} currentColor={currentColorOrDefault} />\r\n ) : (\r\n <ColorPickerDesktop open={customOpen} onChange={onCustomValueChange} currentColor={currentColorOrDefault} />\r\n )\r\n }\r\n {\r\n allowUnset ? (\r\n <Grid item container xs={12} direction=\"row\" justifyContent=\"space-between\" className={classes.followParentContainer}>\r\n \r\n <Grid item xs={12}>\r\n <Divider className={classes.divider} />\r\n </Grid>\r\n\r\n <Grid item>\r\n <Typography variant=\"body1\">\r\n Follow parent color\r\n </Typography>\r\n </Grid>\r\n\r\n <Grid item>\r\n <StandardToggle\r\n className={classes.switch}\r\n checked={currentColor === null}\r\n onChange={onFollowCheckbox}\r\n color=\"primary\"\r\n />\r\n </Grid>\r\n\r\n <Grid item xs={12}>\r\n <Typography variant=\"body2\" color=\"textSecondary\" className={classes.followParentSubHeader}>\r\n {currentColor === null ? \"Turn this off to set an individual color on this topic.\" : \"Turn this on to make this topic follow the parent's color.\"}\r\n </Typography>\r\n </Grid>\r\n\r\n </Grid>\r\n\r\n ) : null\r\n }\r\n </Grid>\r\n );\r\n}\r\n\r\nfunction ColorSelectButton(props) {\r\n const classes = useStyles();\r\n const { color, onClick, selected } = props;\r\n const theme = useTheme();\r\n\r\n const style = {\r\n background: color,\r\n border: selected ? \"4px solid rgba(5,0,56,0.2)\" : \"none\",\r\n boxShadow: selected ? theme.shadows[2] : \"none\"\r\n };\r\n\r\n return (\r\n <Grid className={classes.gridItem} item >\r\n <ButtonBase\r\n className={classes.button}\r\n variant=\"outlined\"\r\n color=\"primary\"\r\n style={style}\r\n onClick={() => onClick(VecMath.ColorToSigned24Bit(color))}\r\n >\r\n </ButtonBase>\r\n </Grid>\r\n );\r\n}\r\n\r\nfunction ColorPickerMobile(props) {\r\n const { open, onChange, onClose, currentColor } = props;\r\n const [color, setColor] = useState(currentColor);\r\n const classes = useStyles();\r\n\r\n useEffect(() => {\r\n setColor(currentColor);\r\n }, [setColor, currentColor]);\r\n\r\n const onConfirm = useCallback(() => {\r\n if (currentColor !== color) {\r\n onChange(VecMath.ColorToSigned24Bit(color));\r\n }\r\n }, [currentColor, color, onChange]);\r\n\r\n return (\r\n <Dialog\r\n open={open}\r\n onClose={onClose}\r\n aria-labelledby=\"alert-dialog-title\"\r\n aria-describedby=\"alert-dialog-description\"\r\n fullWidth\r\n maxWidth=\"sm\"\r\n fullScreen\r\n >\r\n <Scrollbar>\r\n <CardHeader\r\n title=\"Pick color\"\r\n onConfirm={onConfirm}\r\n onClose={onClose}\r\n />\r\n <Grid className={classes.colorPickerRootMobile} container justifyContent=\"flex-start\" direction=\"column\" alignItems=\"center\">\r\n <Grid item className={classes.colorPickerItem}>\r\n <HexColorPicker color={color} onChange={setColor} className={classes.hexPicker} />\r\n </Grid>\r\n <Grid item container direction=\"column\" alignItems=\"flex-start\" className={classes.colorPickerItem}>\r\n <Typography variant=\"subtitle2\" color=\"textSecondary\" className={classes.hexText}>HEX</Typography>\r\n <HexColorInput color={color} onChange={setColor} className={classes.hexInput} />\r\n </Grid>\r\n </Grid>\r\n </Scrollbar>\r\n </Dialog>\r\n );\r\n}\r\n\r\nfunction ColorPickerDesktop(props) {\r\n const { open, onChange, currentColor } = props;\r\n const classes = useStyles();\r\n const [color, setColor] = useState(currentColor);\r\n\r\n useEffect(() => {\r\n setColor(currentColor);\r\n }, [setColor, currentColor]);\r\n\r\n useEffect(() => {\r\n if (currentColor !== color) {\r\n const fn = () => onChange(VecMath.ColorToSigned24Bit(color));\r\n const timer = setTimeout(fn, 250);\r\n return () => {\r\n clearTimeout(timer);\r\n };\r\n }\r\n }, [currentColor, color, onChange]);\r\n\r\n return (\r\n <Collapse in={open} className={classes.collapse}>\r\n <Grid className={classes.colorPickerRoot} container justifyContent=\"flex-start\" direction=\"column\" alignItems=\"center\">\r\n <Grid item className={classes.colorPickerItem}>\r\n <HexColorPicker color={color} onChange={setColor} className={classes.hexPicker} />\r\n </Grid>\r\n <Grid item container direction=\"column\" alignItems=\"flex-start\" className={classes.hexColorPickerItem}>\r\n <Typography variant=\"subtitle2\" color=\"textSecondary\" className={classes.hexText}>HEX</Typography>\r\n <HexColorInput color={color} onChange={setColor} className={classes.hexInput} />\r\n </Grid>\r\n </Grid>\r\n </Collapse>\r\n );\r\n}\r\n\r\n","import { useEffect, useMemo, useCallback, useRef, useState } from \"react\";\r\nimport { useSelector, useDispatch } from \"react-redux\";\r\nimport * as TreeActions from \"../actions/tree\";\r\nimport { useCollection } from \"@emberly/dataplane\";\r\nimport * as AppActions from \"../actions/app\";\r\nimport { getRootUrl } from \"./useApp\";\r\nimport { useHistory, useLocation } from \"react-router\";\r\n\r\n\r\nexport default function useTreeActions() {\r\n const dispatch = useDispatch();\r\n const { collection } = useCollection(\"Node\");\r\n const { dragEnabled, activeNodeId, loadedContextId } = useSelector(state => state.tree);\r\n const history = useHistory();\r\n const location = useLocation();\r\n\r\n const dragEnabledRef = useRef(dragEnabled);\r\n dragEnabledRef.current = dragEnabled;\r\n const [updateCount, setUpdateCount] = useState(0);\r\n\r\n useEffect(() => {\r\n // attach listeners\r\n if (collection) {\r\n const onUpdated = () => setUpdateCount(t => t + 1);\r\n collection.onGlobalEvent(\"*\", onUpdated);\r\n\r\n // detach listeners\r\n return () => {\r\n collection.offGlobalEvent(\"*\", onUpdated);\r\n };\r\n }\r\n }, [collection, setUpdateCount]);\r\n\r\n const beginCreateNode = useCallback((nodeId, sidePreference = 0) => {\r\n dispatch(TreeActions.AddCreateNodeDialog(nodeId, sidePreference));\r\n }, [dispatch]);\r\n\r\n const beginCreateSibling = useCallback(() => {\r\n if (collection) {\r\n const node = collection.getEntityById(activeNodeId);\r\n if (!!node && !node.isRoot) {\r\n beginCreateNode(node.parentId, node.side);\r\n }\r\n }\r\n }, [beginCreateNode, activeNodeId, collection]);\r\n\r\n const beginCreateChild = useCallback(() => {\r\n if (collection) {\r\n const node = collection.getEntityById(activeNodeId);\r\n if (!!node) {\r\n beginCreateNode(activeNodeId, node.side);\r\n } else if (collection.root) {\r\n beginCreateNode(collection.root.id, 0);\r\n }\r\n }\r\n }, [beginCreateNode, activeNodeId, collection]);\r\n\r\n const beginCreateCategoryNode = useCallback(() => {\r\n if (collection && collection.root) {\r\n beginCreateNode(collection.root.id, 0);\r\n }\r\n }, [beginCreateNode, collection]);\r\n\r\n const collapse = useCallback((doCollapse) => {\r\n if (collection) {\r\n const node = collection.getEntityById(activeNodeId);\r\n node?.setIsCollapsed(doCollapse === undefined || typeof doCollapse !== \"boolean\" ? !node.isCollapsed : doCollapse)\r\n }\r\n }, [activeNodeId, collection]);\r\n\r\n const setShowHasNotes = useCallback((visible) => {\r\n if (collection && collection.root) { // TODO load?\r\n collection.root.setHasNotes(typeof visible === \"boolean\" ? visible : !(collection.root.state & 0b1000))\r\n }\r\n }, [collection]);\r\n\r\n const setShowHasResources = useCallback((visible) => {\r\n if (collection && collection.root) {\r\n collection.root.setHasResources(typeof visible === \"boolean\" ? visible : !(collection.root.state & 0b100));\r\n }\r\n }, [collection]);\r\n\r\n const deleteNode = useCallback((entity) => {\r\n const tree = TreeActions.getTree();\r\n const node = tree.getNodeById(entity.id);\r\n\r\n if (!!node && !node.isRoot) {\r\n if (node.parent.isRoot) {\r\n const closestSibling = tree.findClosestCallback(node.container.x, node.container.y, t => t !== node && t.depth === 1, 9999999);\r\n if (closestSibling === null) {\r\n history.push(getRootUrl(location.pathname));\r\n } else {\r\n dispatch(TreeActions.NodeFocusedDebounce(closestSibling.getNodeData(), history, true));\r\n }\r\n } else {\r\n dispatch(TreeActions.NodeFocusedDebounce(node.parent.getNodeData(), history, true));\r\n }\r\n\r\n entity.deleteBranch({\r\n historyGroup: \"ui_deleted\",\r\n filter: (e) => {\r\n const n = tree.getNodeById(e.id);\r\n return n?.synapse?.detached ? false : true;\r\n }\r\n });\r\n\r\n dispatch(AppActions.DisplayNotification({\r\n text: \"Deleted branch!\",\r\n actionText: \"UNDO\",\r\n action: () => {\r\n tree.manager.undo(\"ui_deleted\");\r\n dispatch(AppActions.DisplayNotification(\"Restored branch!\"));\r\n }\r\n }));\r\n\r\n }\r\n }, [history, dispatch, location]);\r\n\r\n const setDragEnabled = useCallback(\r\n (enabled) => dispatch(TreeActions.SetDragEnabled(enabled === undefined || typeof enabled !== \"boolean\" ? !dragEnabledRef.current : enabled)),\r\n [dispatch, dragEnabledRef]\r\n );\r\n\r\n return useMemo(() => {\r\n const node = collection?.getEntityById(activeNodeId) || null;\r\n const children = collection?.getChildren(activeNodeId) || [];\r\n const isRoot = !node || node.isRoot;\r\n const isFullTree = collection?.isFullTree() || false;\r\n const state = collection?.root?.state || 0;\r\n const isEmpty = collection?.isEmpty() || false;\r\n\r\n return {\r\n beginCreateNode,\r\n beginCreateChild,\r\n beginCreateSibling,\r\n beginCreateCategoryNode,\r\n setDragEnabled,\r\n collapse,\r\n setShowHasNotes,\r\n setShowHasResources,\r\n deleteNode,\r\n dragEnabled,\r\n activeNodeId,\r\n loadedContextId,\r\n activeNode: node,\r\n hasNode: !isRoot,\r\n activeNodeIsRoot: isRoot,\r\n canCreateSibling: !isRoot && !!node && (node.depth > 1 || isFullTree),\r\n canCollapse: !!node && !isRoot && children.length !== 0,\r\n isCollapsed: !!node && !!node.isCollapsed,\r\n isFullTree: isFullTree,\r\n canCreateChild: isFullTree || !isRoot || isEmpty,\r\n showHasNotes: !!(state & 0b1000),\r\n showHasResources: !!(state & 0b100),\r\n };\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [updateCount, collection, deleteNode, setShowHasNotes, setShowHasResources, beginCreateNode, collapse, beginCreateChild, beginCreateSibling, beginCreateCategoryNode, setDragEnabled, dragEnabled, activeNodeId, loadedContextId]);\r\n}\r\n\r\nexport function useActiveNode(nodeId = null, allowPan = false) {\r\n const dispatch = useDispatch();\r\n const location = useLocation();\r\n const loadedContextId = useSelector(state => state.tree.loadedContextId);\r\n\r\n useEffect(() => {\r\n dispatch(TreeActions.SetActiveNodeId(nodeId));\r\n }, [nodeId, dispatch, loadedContextId]);\r\n\r\n useEffect(() => {\r\n if (allowPan && location.hash.includes(`panto=${nodeId}`)) {\r\n const tree = TreeActions.getTree();\r\n const node = tree.getNodeById(nodeId);\r\n if (!!node) {\r\n dispatch(TreeActions.PanToNode(node));\r\n }\r\n }\r\n }, [allowPan, location.hash, dispatch, nodeId]);\r\n}","import { useEffect, useRef } from \"react\";\r\nimport { makeStyles } from \"@mui/styles\";\r\n\r\nconst useStyles = makeStyles(_ => ({\r\n root: {\r\n overflow: \"hidden\",\r\n height: \"auto\",\r\n transition: \"height 0.25s ease-out;\",\r\n willChange: \"transform\",\r\n transformOrigin: \"center top\"\r\n }\r\n}));\r\n\r\nexport default function SmoothCollapse(props) {\r\n const classes = useStyles();\r\n const ref = useRef(null);\r\n const inRef = useRef(props.in);\r\n\r\n // skip animation on mount\r\n useEffect(() => {\r\n if (ref.current) {\r\n if (inRef.current) {\r\n // start expanded\r\n ref.current.style.height = \"auto\";\r\n } else {\r\n // start collapsed\r\n ref.current.style.height = \"0px\";\r\n }\r\n }\r\n }, []);\r\n\r\n useEffect(() => {\r\n if (!!ref.current) {\r\n const element = ref.current;\r\n if (props.in) {\r\n const timer = expandSection(element);\r\n return () => {\r\n timer();\r\n }\r\n } else {\r\n collapseSection(element);\r\n }\r\n }\r\n }, [props.in]);\r\n\r\n return (\r\n <div ref={ref} className={`${classes.root} ${props.className || \"\"}`}>\r\n {props.children}\r\n </div>\r\n );\r\n}\r\n\r\n\r\nfunction collapseSection(element) {\r\n \r\n // get the height of the element's inner content, regardless of its actual size\r\n const sectionHeight = element.scrollHeight;\r\n\r\n // temporarily disable all css transitions\r\n const elementTransition = element.style.transition;\r\n element.style.transition = \"\";\r\n\r\n // on the next frame (as soon as the previous style change has taken effect),\r\n // explicitly set the element's height to its current pixel height, so we \r\n // aren't transitioning out of 'auto'\r\n requestAnimationFrame(() => {\r\n element.style.height = sectionHeight + \"px\";\r\n element.style.transition = elementTransition;\r\n requestAnimationFrame(() => {\r\n element.style.height = \"0px\";\r\n });\r\n });\r\n}\r\n\r\nfunction expandSection(element) {\r\n if (element.style.height === \"auto\") { // patch, dont run this animation if height is already auto.\r\n return () => {};\r\n }\r\n\r\n const sectionHeight = element.scrollHeight;\r\n let timer = null;\r\n\r\n const listener = () => {\r\n clearTimeout(timer);\r\n element.removeEventListener(\"transitionend\", listener);\r\n element.style.height = null;\r\n }\r\n \r\n // when the next css transition finishes (which should be the one we just triggered)\r\n element.style.height = sectionHeight + \"px\";\r\n element.addEventListener(\"transitionend\", listener);\r\n timer = setTimeout(listener, 251);\r\n return listener;\r\n}\r\n","import { useState } from \"react\";\r\nimport { Grid, DialogActions, DialogTitle, DialogContent, Typography, Select, FormControl, Divider, MenuItem, FormControlLabel, Checkbox, Button, FormGroup, CircularProgress } from \"@mui/material\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport CardHeader from \"../../atoms/CardHeader\";\r\nimport { usePlanWithMapLimits } from \"../../../hooks/usePlan\";\r\nimport { useDevice } from \"../../../providers/DeviceContext\";\r\nimport { useCollection, useContextId, useEverything } from \"@emberly/dataplane\";\r\nimport { useHistory } from \"react-router\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n content: {\r\n minWidth: \"100px\",\r\n width: \"448px\",\r\n maxWidth: \"100%\"\r\n },\r\n contentMobile: {\r\n width: \"100%\"\r\n },\r\n select: {\r\n marginTop: theme.spacing(1),\r\n marginBottom: theme.spacing(2),\r\n width: \"100%\"\r\n },\r\n header: {\r\n marginBottom: theme.spacing(2)\r\n },\r\n confirmItem: {\r\n paddingTop: theme.spacing(2)\r\n }\r\n}));\r\n\r\nexport default function DuplicatePanel(props) {\r\n const classes = useStyles();\r\n const { nodeId, onClose } = props;\r\n const { collection } = useCollection(\"Node\");\r\n const [targetContextId, setTargetContextId] = useState(\"new\");\r\n const { entities } = useEverything(\"Map\", true, \"default\");\r\n const contextId = useContextId();\r\n const filteredMaps = entities.filter(t => t.access >= 2 && t.id !== contextId).sort((a, b) => b.lastOpened - a.lastOpened);\r\n const currentMap = entities.find(t => t.id === contextId && t.access >= 2);\r\n const { isPortrait, isMobile, isEmbed } = useDevice();\r\n const isMobilePortrait = isPortrait && isMobile && !isEmbed;\r\n const { canCreateMaps } = usePlanWithMapLimits();\r\n const history = useHistory();\r\n const [working, setWorking] = useState(false);\r\n\r\n const [checked, setChecked] = useState({\r\n includeRatings: false,\r\n includeNotes: true,\r\n includeResources: true,\r\n includeResourceRatings: true,\r\n includeResourceTags: false\r\n });\r\n\r\n const onChecked = ev => {\r\n const target = ev.target;\r\n if (!!target) {\r\n setChecked(checked => ({ ...checked, [target.name]: target.checked }));\r\n }\r\n };\r\n\r\n const onConfirm = async () => {\r\n try {\r\n setWorking(true);\r\n\r\n const target = nodeId ? (\r\n await collection.duplicateBranch(nodeId, entities.find(t => t.id === targetContextId), checked)\r\n ) : (\r\n await collection.duplicateMap(entities.find(t => t.id === targetContextId), checked)\r\n );\r\n //setWorking(false);\r\n onClose();\r\n\r\n if (target && target.id !== contextId) {\r\n history.pushWithoutParams(`/map/${target.publicUserId}/${target.id}/edit`);\r\n }\r\n\r\n } catch (err) {\r\n setWorking(false);\r\n console.log(err);\r\n }\r\n };\r\n\r\n // TODO change cardheader title when over limit etc.\r\n const canDuplicate = canCreateMaps || targetContextId === contextId;\r\n\r\n return (\r\n <>\r\n\r\n {\r\n isMobilePortrait ? (\r\n <div className={classes.header}>\r\n <CardHeader\r\n title={nodeId ? \"Duplicate branch\" : \"Duplicate map\"}\r\n onClose={onClose}\r\n border\r\n />\r\n </div>\r\n ) : (\r\n <DialogTitle>\r\n {nodeId ? \"Duplicate branch\" : \"Duplicate map\"}\r\n </DialogTitle>\r\n )\r\n }\r\n\r\n <DialogContent className={isMobilePortrait ? classes.contentMobile : classes.content}>\r\n\r\n <Grid item>\r\n <Typography variant=\"body2\" color=\"textSecondary\">Destination</Typography>\r\n <FormControl variant=\"outlined\" className={classes.select}>\r\n <Select\r\n value={targetContextId}\r\n id=\"map-select\"\r\n onChange={ev => setTargetContextId(ev.target.value)}\r\n color=\"primary\"\r\n disabled={working}\r\n fullWidth\r\n >\r\n <MenuItem value=\"new\">Create new map</MenuItem>\r\n {!!currentMap ? (\r\n <MenuItem value={currentMap.id}>\r\n <b>{currentMap.name} - Current map</b>\r\n </MenuItem>\r\n ) : null}\r\n <Divider />\r\n {filteredMaps.map((map, idx) =>\r\n <MenuItem key={idx} value={map.id}>\r\n {map.id === contextId ? <b>{map.name} - Current map</b> : map.name}\r\n </MenuItem>\r\n )}\r\n </Select>\r\n </FormControl>\r\n </Grid>\r\n\r\n <Grid item>\r\n <Typography variant=\"body2\" color=\"textSecondary\">Include in duplicate</Typography>\r\n <FormControl component=\"fieldset\" sx={{ pl: 1 }}>\r\n <FormGroup >\r\n <FormControlLabel\r\n control={<Checkbox checked={checked.includeRatings} onChange={onChecked} name=\"includeRatings\" color=\"primary\" disabled={working} />}\r\n label=\"Topic rating and plan\"\r\n />\r\n <FormControlLabel\r\n control={<Checkbox checked={checked.includeNotes} onChange={onChecked} name=\"includeNotes\" color=\"primary\" disabled={working} />}\r\n label=\"Notes\"\r\n />\r\n <FormControlLabel\r\n control={<Checkbox checked={checked.includeResources} onChange={onChecked} name=\"includeResources\" color=\"primary\" disabled={working} />}\r\n label=\"Resources\"\r\n />\r\n <FormControlLabel\r\n control={<Checkbox checked={checked.includeResourceRatings && checked.includeResources} onChange={onChecked} name=\"includeResourceRatings\" disabled={!checked.includeResources || working} color=\"primary\" />}\r\n label=\"Resource ratings\"\r\n />\r\n <FormControlLabel\r\n control={<Checkbox checked={checked.includeResourceTags && checked.includeResources} onChange={onChecked} name=\"includeResourceTags\" disabled={!checked.includeResources || working} color=\"primary\" />}\r\n label=\"Resource tags\"\r\n />\r\n </FormGroup>\r\n </FormControl>\r\n </Grid>\r\n\r\n {\r\n isMobilePortrait ? (\r\n <Grid item className={classes.confirmItem}>\r\n <Button\r\n color=\"primary\"\r\n variant=\"contained\"\r\n onClick={onConfirm}\r\n disabled={working || !canDuplicate}\r\n fullWidth\r\n size=\"large\"\r\n endIcon={\r\n working ? (\r\n <CircularProgress variant=\"indeterminate\" color=\"inherit\" size=\"14px\" />\r\n ) : null\r\n }\r\n >\r\n {targetContextId === \"new\" ? (canDuplicate ? \"Duplicate to new map\" : \"Limit reached\") : \"Duplicate into map\"}\r\n </Button>\r\n </Grid>\r\n ) : null\r\n }\r\n\r\n </DialogContent>\r\n\r\n {\r\n !isMobilePortrait ? (\r\n <DialogActions>\r\n <Button variant=\"outlined\" color=\"neutral\" onClick={onClose} disabled={working}>\r\n Cancel\r\n </Button>\r\n <Button\r\n color=\"primary\"\r\n variant=\"contained\"\r\n onClick={onConfirm}\r\n disabled={working || !canDuplicate}\r\n endIcon={\r\n working ? (\r\n <CircularProgress variant=\"indeterminate\" color=\"inherit\" size=\"14px\" />\r\n ) : null\r\n }\r\n >\r\n {targetContextId === \"new\" ? (canDuplicate ? \"Duplicate to new map\" : \"Limit reached\") : \"Duplicate into map\"}\r\n </Button>\r\n </DialogActions>\r\n ) : null\r\n }\r\n </>\r\n )\r\n}","import { useState, useCallback, useMemo, useEffect } from \"react\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport { useDispatch, useSelector } from \"react-redux\";\r\nimport { Grid, IconButton, Button, Menu, MenuItem, ListItemIcon, ListItemText, Divider, Dialog } from \"@mui/material\";\r\nimport { Rating } from '@mui/material';\r\nimport {\r\n MoreVert as MoreVertIcon,\r\n FiberManualRecord as RatingIcon,\r\n Favorite as HeartIcon,\r\n FlagOutlined as FlagIcon,\r\n RemoveCircleOutline as RemoveIcon,\r\n DeleteForeverOutlined as DeleteForeverIcon,\r\n FileCopyOutlined as FileCopyIcon,\r\n EditOutlined as EditIcon,\r\n EditOffOutlined as EditOffIcon,\r\n AutoAwesomeOutlined as AutoAwesomeIcon\r\n} from \"@mui/icons-material\";\r\n\r\nimport * as AppActions from \"../../actions/app\";\r\nimport CardHeader from \"../atoms/CardHeader\";\r\nimport { useCanEdit, useEntity } from \"@emberly/dataplane\";\r\nimport StandardEditPopover from \"../atoms/inputs/StandardEditPopover\";\r\nimport ColorSelect from \"../atoms/inputs/ColorSelect\";\r\nimport useTreeActions from \"../../hooks/useTreeActions\";\r\nimport SmoothCollapse from \"../atoms/views/SmoothCollapse\";\r\nimport { SharedInputBase } from \"@emberly/dataplane\";\r\nimport DuplicatePanel from \"./panels/DuplicatePanel\";\r\nimport { useDevice } from \"../../providers/DeviceContext\";\r\nimport QuizPanel from \"../pages/map/quiz/QuizPanel\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n root: {\r\n position: \"relative\",\r\n overflow: \"hidden\",\r\n width: \"100%\",\r\n height: \"auto\",\r\n background: theme.palette.background.paper\r\n },\r\n title: {\r\n ...theme.typography.h5,\r\n paddingLeft: theme.spacing(3),\r\n paddingRight: theme.spacing(3),\r\n marginBottom: theme.spacing(1),\r\n align: \"center\",\r\n textAlign: \"center\",\r\n \"& input\": {\r\n textAlign: \"center !important\",\r\n },\r\n \"& .Mui-disabled\": {\r\n color: theme.palette.text.primary,\r\n WebkitTextFillColor: theme.palette.text.primary\r\n }\r\n },\r\n swipeHandle: {\r\n background: \"#DADBDF\",\r\n position: \"relative\",\r\n marginBottom: \"8px\",\r\n marginLeft: \"auto\",\r\n marginRight: \"auto\",\r\n height: \"4px\",\r\n borderRadius: \"2px\",\r\n width: \"28px\"\r\n },\r\n fullScreenHeaderContainer: {\r\n position: \"relative\",\r\n },\r\n headerContainer: {\r\n zIndex: 0,\r\n paddingTop: theme.spacing(1.75),\r\n paddingBottom: theme.spacing(1),\r\n paddingLeft: theme.spacing(2),\r\n paddingRight: theme.spacing(2),\r\n position: \"relative\",\r\n width: \"100%\",\r\n },\r\n colorComponent: {\r\n position: \"relative\",\r\n height: \"12px\",\r\n width: \"36px\",\r\n borderRadius: \"6px\",\r\n background: theme.palette.grey[500],\r\n filter: theme.palette.common.saturateFilter\r\n },\r\n colorPickerContainer: {\r\n width: \"356px\",\r\n minHeight: \"32px\",\r\n maxWidth: \"calc(100vw - 32px)\",\r\n padding: theme.spacing(2)\r\n },\r\n ratingContainer: {\r\n padding: theme.spacing(2)\r\n },\r\n stateContainer: {\r\n padding: theme.spacing(1),\r\n \"& svg\": {\r\n marginRight: theme.spacing(1)\r\n }\r\n },\r\n ratingIcon: {\r\n color: theme.palette.common.rating,\r\n fontSize: \"18px\",\r\n marginLeft: \"-3px\"\r\n },\r\n heartIcon: {\r\n color: theme.palette.common.heart,\r\n marginRight: theme.spacing(0.5),\r\n fontSize: \"16px\"\r\n },\r\n flagIcon: {\r\n color: theme.palette.text.primary,\r\n marginRight: theme.spacing(0.5),\r\n fontSize: \"16px\"\r\n },\r\n removeIcon: {\r\n color: theme.palette.text.primary,\r\n marginRight: theme.spacing(0.5),\r\n fontSize: \"16px\"\r\n },\r\n stateButtonSelected: {\r\n color: theme.palette.primary.dark,\r\n paddingRight: theme.spacing(3)\r\n },\r\n stateButton: {\r\n paddingRight: theme.spacing(3)\r\n },\r\n textComponent: {\r\n color: theme.palette.text.secondary\r\n },\r\n overflowMenuButton: {\r\n position: \"absolute\",\r\n right: theme.spacing(1),\r\n top: theme.spacing(2.5),\r\n padding: theme.spacing(0.5)\r\n },\r\n menu: {\r\n borderRadius: theme.spacing(0.5),\r\n minWidth: \"120px\"\r\n },\r\n menuItemWarning: {\r\n color: theme.palette.error.main\r\n }\r\n}));\r\n\r\nconst inputProps = { min: 0, maxLength: 160, style: { textAlign: \"center\" } };\r\n\r\nconst preventNewline = (ev) => {\r\n if (ev.key === \"Enter\") {\r\n ev.preventDefault();\r\n document.activeElement?.blur();\r\n }\r\n};\r\n\r\nexport default function NodeHeaderPanel(props) {\r\n const { nodeId, compactView, notesActive, setNotesActive } = props;\r\n const { deleteNode } = useTreeActions();\r\n const dispatch = useDispatch();\r\n const classes = useStyles();\r\n const contextCardState = useSelector(state => state.app.contextCardState);\r\n const canEdit = useCanEdit();\r\n const { isMobilePortraitView, isEmbed, isEmbedView } = useDevice();\r\n const { entity: node, updateCount, collection } = useEntity(\"Node\", nodeId);\r\n const [focused, setFocused] = useState(false);\r\n\r\n const [editOpen, setEditOpen] = useState(false);\r\n\r\n const [duplicateOpen, setDuplicateOpen] = useState(false);\r\n const handleDuplicateClose = useCallback(() => setDuplicateOpen(false), []);\r\n\r\n const [quizOpen, setQuizOpen] = useState(false);\r\n const handleQuizClose = useCallback(() => setQuizOpen(false), []);\r\n\r\n\r\n const onClose = useCallback(() => {\r\n if (notesActive) {\r\n setNotesActive(false);\r\n } else {\r\n dispatch(AppActions.SetContextCard(2));\r\n }\r\n }, [notesActive, dispatch, setNotesActive]);\r\n\r\n const onMenu = useCallback((key) => {\r\n switch (key) {\r\n case \"edit\":\r\n setEditOpen(true);\r\n break;\r\n case \"delete\":\r\n deleteNode(node);\r\n break;\r\n case \"duplicate\":\r\n setDuplicateOpen(true);\r\n break;\r\n case \"quiz\":\r\n setQuizOpen(true);\r\n break;\r\n default:\r\n break;\r\n }\r\n }, [deleteNode, node]);\r\n\r\n return useMemo(() => (\r\n <div className={classes.root}>\r\n <div className={`${classes.fullScreenHeaderContainer} ${compactView ? classes.headerActive : \"\"}`}>\r\n <SmoothCollapse in={compactView && !editOpen && !focused}>\r\n <CardHeader\r\n title={node?.name}\r\n onExpandMore={(!notesActive && contextCardState === 3 && isMobilePortraitView) || (contextCardState === 1 && !isMobilePortraitView && notesActive && isEmbedView && !isEmbed) ? onClose : undefined}\r\n border={notesActive && !isEmbed}\r\n onConfirm={!isEmbed && notesActive && (compactView || isMobilePortraitView) ? onClose : undefined}\r\n menuItems={!canEdit ? [\r\n {\r\n value: \"duplicate\",\r\n text: \"Duplicate branch\",\r\n icon: <FileCopyIcon />,\r\n },\r\n {\r\n value: \"quiz\",\r\n text: \"AI Quiz\",\r\n icon: <EditIcon />\r\n }\r\n ] : [\r\n {\r\n value: \"edit\",\r\n text: \"Edit topic settings\",\r\n icon: <EditIcon />,\r\n },\r\n \"---\",\r\n {\r\n value: \"duplicate\",\r\n text: \"Duplicate branch\",\r\n icon: <FileCopyIcon />,\r\n },\r\n {\r\n value: \"quiz\",\r\n text: \"AI Quiz\",\r\n icon: <AutoAwesomeIcon />\r\n },\r\n \"---\",\r\n {\r\n value: \"delete\",\r\n text: \"Delete topic\",\r\n className: classes.menuItemWarning,\r\n icon: <DeleteForeverIcon className={classes.menuItemWarning} />,\r\n },\r\n ]}\r\n onMenu={notesActive || isEmbedView ? undefined : onMenu}\r\n />\r\n </SmoothCollapse>\r\n </div>\r\n <SmoothCollapse in={!compactView || editOpen || focused}>\r\n <LargeHeaderPanel\r\n canEdit={canEdit}\r\n hasSwipeHandle={isMobilePortraitView}\r\n node={node}\r\n collection={collection}\r\n updateCount={updateCount}\r\n deleteNode={deleteNode}\r\n setDuplicateOpen={setDuplicateOpen}\r\n setEditOpen={setEditOpen}\r\n editOpen={editOpen}\r\n setFocused={setFocused}\r\n isEmbedView={isEmbedView}\r\n setQuizOpen={setQuizOpen}\r\n />\r\n </SmoothCollapse>\r\n <Dialog open={duplicateOpen} onClose={handleDuplicateClose} fullScreen={isMobilePortraitView}>\r\n <DuplicatePanel nodeId={nodeId} onClose={handleDuplicateClose} />\r\n </Dialog>\r\n {quizOpen ? (\r\n <QuizPanel parentId={`node-${nodeId}`} onClose={handleQuizClose} title={node?.name} />\r\n ) : null}\r\n </div>\r\n ), [classes, setQuizOpen, quizOpen, handleQuizClose, duplicateOpen, editOpen, setDuplicateOpen, handleDuplicateClose, collection, nodeId, focused, node, updateCount, onMenu, isMobilePortraitView, compactView, notesActive, onClose, contextCardState, canEdit, isEmbed, isEmbedView, deleteNode]);\r\n}\r\n\r\nexport function LargeHeaderPanel(props) {\r\n const { hasSwipeHandle, node, canEdit, collection, updateCount, deleteNode, setDuplicateOpen, editOpen, setEditOpen, setFocused, isEmbedView, setQuizOpen } = props;\r\n const classes = useStyles();\r\n const disabled = !canEdit;\r\n\r\n const [nodeName, setNodeName] = useState(node?.name || \"\");\r\n\r\n useEffect(() => {\r\n if (!!node) {\r\n setNodeName(node.name);\r\n }\r\n }, [node, updateCount, setNodeName]);\r\n\r\n useEffect(() => {\r\n if (!!node && nodeName !== node.name) {\r\n const timer = setTimeout(() => node.setName(nodeName), 250);\r\n return () => {\r\n clearTimeout(timer);\r\n };\r\n }\r\n }, [node, nodeName]);\r\n\r\n\r\n const onNameInput = useCallback((ev) => setNodeName(ev.target.value), [setNodeName]);\r\n\r\n const state = node?.getLearningState() || 0;\r\n\r\n const [anchorEl, setAnchorEl] = useState(null);\r\n const open = Boolean(anchorEl);\r\n\r\n const handleClick = ev => {\r\n setAnchorEl(ev.currentTarget);\r\n };\r\n\r\n const handleClose = () => {\r\n setAnchorEl(null);\r\n };\r\n\r\n const menuClasses = useMemo(() => ({ paper: classes.menu }), [classes]);\r\n const isCategory = collection?.isCategoryNode(node) || false;\r\n\r\n\r\n return (\r\n <Grid container item xs={12} alignItems=\"flex-start\" justifyContent=\"center\" className={classes.headerContainer}>\r\n {\r\n hasSwipeHandle ? (\r\n <Grid item xs={12} >\r\n <div className={`${classes.swipeHandle} noselect`}></div>\r\n </Grid>\r\n ) : null\r\n }\r\n <Grid item xs={12} >\r\n <SharedInputBase\r\n id=\"edit-topic-name\"\r\n resourceId={node?.id || \"empty\"}\r\n inputId=\"name\"\r\n placeholder=\"Topic name\"\r\n className={classes.title}\r\n value={nodeName}\r\n onKeyDown={preventNewline}\r\n onChange={onNameInput}\r\n spellCheck={false}\r\n inputProps={inputProps}\r\n multiline\r\n fullWidth\r\n disabled={disabled}\r\n onFocus={() => setFocused(true)}\r\n onBlur={() => setFocused(false)}\r\n />\r\n {\r\n !isEmbedView ? (\r\n <IconButton className={classes.overflowMenuButton} onClick={handleClick} size=\"medium\">\r\n <MoreVertIcon fontSize=\"small\" />\r\n </IconButton>\r\n ) : null\r\n }\r\n </Grid>\r\n\r\n {\r\n canEdit ? (\r\n <Grid item>\r\n <StandardEditPopover\r\n componentClassName={classes.textComponent}\r\n component={\r\n node?.rgbColor !== null ? \r\n <div className={classes.colorComponent} style={{ backgroundColor: node?.hexColor }}></div> : \r\n \"Add color\"\r\n }\r\n >\r\n <Grid container className={classes.colorPickerContainer} justifyContent=\"flex-start\" alignItems=\"flex-start\" direction=\"column\">\r\n <ColorSelect value={node?.rgbColor} onChange={(color) => node.setColor(color)} onUnsetColor={() => node.unsetColor()} allowUnset={!isCategory} />\r\n </Grid>\r\n </StandardEditPopover>\r\n </Grid>\r\n ) : null\r\n }\r\n\r\n {\r\n canEdit || node?.rating > 0 ? (\r\n <Grid item>\r\n <StandardEditPopover\r\n disabled={disabled}\r\n componentClassName={classes.textComponent}\r\n component={\r\n node?.rating > 0 ? (\r\n [...Array(node?.rating)].map((e, i) => <RatingIcon key={i} className={classes.ratingIcon} />)\r\n ) : (\r\n disabled ? \"No rating\" : \"Add rating\"\r\n )\r\n }\r\n >\r\n <Grid container className={classes.ratingContainer} justifyContent=\"flex-start\" alignItems=\"flex-start\" direction=\"column\">\r\n <Grid container item direction=\"row\" justifyContent=\"center\" alignItems=\"center\">\r\n <Rating\r\n className={classes.rating}\r\n name=\"skill-level\"\r\n value={node?.rating}\r\n onChange={(ev, rating) => node?.setRating(rating === node.rating ? 0 : (rating === null ? 0 : rating))}\r\n max={5}\r\n size=\"large\"\r\n emptyIcon={<RatingIcon fontSize=\"inherit\" />}\r\n icon={<RatingIcon color=\"secondary\" fontSize=\"inherit\" />}\r\n />\r\n <Button color=\"neutral\" onClick={() => node?.setRating(0)}>Clear rating</Button>\r\n </Grid>\r\n </Grid>\r\n </StandardEditPopover>\r\n </Grid>\r\n\r\n ) : null\r\n }\r\n\r\n {canEdit || state !== 0 ? (\r\n <Grid item>\r\n <StandardEditPopover\r\n disabled={disabled}\r\n componentClassName={classes.textComponent}\r\n component={\r\n state === 0 ? (\r\n \"Add plan\"\r\n ) : (\r\n <StateText state={state} />\r\n )\r\n }\r\n >\r\n <Grid container className={classes.stateContainer} justifyContent=\"flex-start\" alignItems=\"flex-start\" direction=\"column\">\r\n <StateButton state={2} selected={state === 2} onClick={() => node?.setLearningState(2)} />\r\n <StateButton state={1} selected={state === 1} onClick={() => node?.setLearningState(1)} />\r\n <StateButton state={0} selected={state === 0} onClick={() => node?.setLearningState(0)} />\r\n </Grid>\r\n </StandardEditPopover>\r\n </Grid>\r\n ) : null}\r\n\r\n <Menu\r\n classes={menuClasses}\r\n anchorEl={anchorEl}\r\n keepMounted\r\n open={open}\r\n onClose={handleClose}\r\n >\r\n {editOpen ? (\r\n <MenuItem onClick={() => ((handleClose(), setEditOpen(false)))}>\r\n <ListItemIcon>\r\n <EditOffIcon />\r\n </ListItemIcon>\r\n <ListItemText>Hide topic settings</ListItemText>\r\n </MenuItem>\r\n ) : null}\r\n {editOpen ? (\r\n <Divider />\r\n ) : null}\r\n <MenuItem onClick={() => ((handleClose(), setDuplicateOpen(true)))}>\r\n <ListItemIcon>\r\n <FileCopyIcon />\r\n </ListItemIcon>\r\n <ListItemText>Duplicate branch</ListItemText>\r\n </MenuItem>\r\n <MenuItem onClick={() => ((handleClose(), setQuizOpen(true)))}>\r\n <ListItemIcon>\r\n <AutoAwesomeIcon />\r\n </ListItemIcon>\r\n <ListItemText>AI Quiz</ListItemText>\r\n </MenuItem>\r\n <Divider />\r\n <MenuItem color=\"error\" onClick={() => ((handleClose(), deleteNode(node)))} disabled={!canEdit}>\r\n <ListItemIcon>\r\n <DeleteForeverIcon color=\"error\" />\r\n </ListItemIcon>\r\n <ListItemText className={classes.menuItemWarning}>Delete topic</ListItemText>\r\n </MenuItem>\r\n </Menu>\r\n </Grid >\r\n );\r\n}\r\n\r\nfunction StateText(props) {\r\n const { state } = props;\r\n const classes = useStyles();\r\n\r\n return (\r\n <>\r\n {\r\n state === 1 ? (\r\n <FlagIcon className={classes.flagIcon} />\r\n ) : state === 2 ? (\r\n <HeartIcon className={classes.heartIcon} />\r\n ) : (\r\n <RemoveIcon className={classes.removeIcon} />\r\n )\r\n }\r\n {\r\n state === 1 ? (\r\n \"Up next\"\r\n ) : state === 2 ? (\r\n \"In focus\"\r\n ) : (\r\n \"No plan\"\r\n )\r\n }\r\n </>\r\n );\r\n}\r\n\r\nfunction StateButton(props) {\r\n const { state, onClick, selected } = props;\r\n const classes = useStyles();\r\n\r\n return (\r\n <Button onClick={onClick} className={selected ? classes.stateButtonSelected : classes.stateButton} color=\"neutral\">\r\n <StateText state={state} />\r\n </Button>\r\n );\r\n}\r\n\r\n","import { useEffect, useMemo, useCallback, useRef } from \"react\";\r\nimport { useSelector, useDispatch } from \"react-redux\";\r\nimport * as AppActions from \"../actions/app\";\r\nimport { useDevice } from \"../providers/DeviceContext\";\r\n\r\nexport default function useCard(initialPosition = null) {\r\n const dispatch = useDispatch();\r\n const contextCardState = useSelector(state => state.app.contextCardState);\r\n const stateRef = useRef(contextCardState);\r\n const { isMobilePortraitView } = useDevice();\r\n \r\n useEffect(() => {\r\n stateRef.current = contextCardState;\r\n }, [stateRef, contextCardState]);\r\n \r\n useEffect(() => {\r\n if (initialPosition !== null) {\r\n if (initialPosition === true) {\r\n dispatch(AppActions.SetContextCard(isMobilePortraitView ? 3 : 1));\r\n } else if (initialPosition === false) {\r\n dispatch(AppActions.SetContextCard(0));\r\n } else if (typeof initialPosition === \"number\") {\r\n dispatch(AppActions.SetContextCard(initialPosition));\r\n }\r\n }\r\n },[dispatch, initialPosition, isMobilePortraitView]);\r\n\r\n const setCardState = useCallback((state) => {\r\n if (typeof state === \"function\") {\r\n dispatch(AppActions.SetContextCard(state(stateRef.current)));\r\n } else if (state === true) {\r\n dispatch(AppActions.SetContextCard(isMobilePortraitView ? 3 : 1));\r\n } else if (state === false) {\r\n dispatch(AppActions.SetContextCard(0));\r\n } else if (typeof initialPosition === \"number\") {\r\n dispatch(AppActions.SetContextCard(initialPosition));\r\n } else if (state !== stateRef.current) {\r\n dispatch(AppActions.SetContextCard(state));\r\n }\r\n }, [dispatch, stateRef, isMobilePortraitView, initialPosition]);\r\n\r\n\r\n return useMemo(() => {\r\n return {\r\n isMobilePortraitView,\r\n contextCardState,\r\n setCardState,\r\n previousContextCardState: stateRef.current\r\n }\r\n },[isMobilePortraitView, contextCardState, setCardState, stateRef]);\r\n}\r\n\r\nexport function useDefaultCard() {\r\n return useCard(true);\r\n}\r\n\r\nexport function useDefaultOpenCard(defaultOpen = true) {\r\n const { isDesktopView } = useDevice();\r\n return useCard(defaultOpen || isDesktopView);\r\n}\r\n","import SvgIcon from \"@mui/material/SvgIcon\";\r\n\r\nexport default function NewSiblingIcon(props) {\r\n return (\r\n <SvgIcon>\r\n <path d=\"M17 13L17 17L17 21M13 17L21 17\" stroke={props.iconColor} strokeWidth=\"2\" />\r\n <path d=\"M3 7L7 7L7 5L3 5L3 7ZM7 7L16 7L16 5L7 5L7 7ZM6 6L6 12.5L8 12.5L8 6L6 6ZM6 12.5C6 13.8574 6.26723 15.2375 7.08238 16.2972C7.93438 17.4048 9.2571 18 11 18L11 16C9.7429 16 9.06562 15.5952 8.66762 15.0778C8.23277 14.5125 8 13.6426 8 12.5L6 12.5Z\" fill={props.iconColor} />\r\n <circle cx=\"17\" cy=\"6\" r=\"2\" fill={props.iconColor} />\r\n </SvgIcon>\r\n );\r\n}","import SvgIcon from \"@mui/material/SvgIcon\";\r\n\r\nexport default function NewChildIcon(props) {\r\n return (\r\n <SvgIcon color=\"inherit\">\r\n <path d=\"M17 8L17 12L17 16M13 12L21 12\" stroke={props.iconColor} strokeWidth=\"2\" />\r\n <path d=\"M6 12L11 12\" stroke={props.iconColor} strokeWidth=\"2\" />\r\n <circle cx=\"5\" cy=\"12\" r=\"2\" fill={props.iconColor} />\r\n </SvgIcon>\r\n );\r\n}","import { useMemo } from \"react\";\r\nimport { Grid, Button } from \"@mui/material\";\r\nimport { makeStyles, useTheme } from \"@mui/styles\";\r\nimport { \r\n ExpandMore as ExpandMoreIcon,\r\n ExpandLess as ExpandLessIcon\r\n} from \"@mui/icons-material\";\r\nimport NewSiblingIcon from \"../../atoms/icons/NewSiblingIcon\";\r\nimport NewChildIcon from \"../../atoms/icons/NewChildIcon\";\r\nimport useTree from \"../../../hooks/useTreeActions\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n actionButtonContainer: {\r\n display: \"flex\",\r\n alignItems: \"center\",\r\n height: \"100%\"\r\n },\r\n actionButton: {\r\n textAlign: \"center\",\r\n display: \"flex\"\r\n },\r\n buttonRoot: {\r\n position: \"relative\",\r\n height: \"100%\",\r\n width: \"100%\",\r\n display: \"flex\",\r\n flexDirection: \"column\",\r\n ...theme.typography.caption,\r\n },\r\n buttonStartIcon: {\r\n marginLeft: 0,\r\n marginRight: 0,\r\n marginBottom: \"4px\"\r\n },\r\n disabled: {\r\n color: theme.palette.text.secondary\r\n }\r\n}));\r\n\r\nfunction ActionButton(props) {\r\n const { title, xs, onClick, icon, disabled } = props;\r\n const classes = useStyles();\r\n const buttonClasses = { startIcon: `${classes.buttonStartIcon} ${disabled ? classes.disabled : \"\"}` };\r\n\r\n return (\r\n <Grid item xs={xs} className={classes.actionButton}>\r\n <Button\r\n disabled={disabled}\r\n color=\"neutral\"\r\n className={classes.buttonRoot}\r\n classes={buttonClasses}\r\n onClick={onClick}\r\n startIcon={icon}\r\n >\r\n {title}\r\n </Button>\r\n </Grid>\r\n );\r\n}\r\n\r\nexport default function NodeActionButtons() {\r\n const classes = useStyles();\r\n const { beginCreateChild, beginCreateSibling, collapse, isCollapsed, canCreateSibling, canCollapse } = useTree();\r\n const theme = useTheme();\r\n \r\n return useMemo(() => (\r\n <Grid container spacing={1} className={classes.actionButtonContainer} justifyContent=\"space-around\" alignItems=\"center\" >\r\n <ActionButton\r\n xs={4}\r\n title=\"New Sibling\"\r\n onClick={beginCreateSibling}\r\n icon={<NewSiblingIcon iconColor={canCreateSibling ? theme.palette.text.primary : theme.palette.text.secondary} />}\r\n disabled={!canCreateSibling}\r\n />\r\n <ActionButton\r\n xs={4}\r\n title=\"New Child\"\r\n onClick={beginCreateChild}\r\n icon={<NewChildIcon iconColor={theme.palette.text.primary} />}\r\n />\r\n <ActionButton\r\n xs={4}\r\n title={isCollapsed ? \"Expand\" : \"Collapse\"}\r\n onClick={collapse}\r\n icon={isCollapsed ? <ExpandMoreIcon/> : <ExpandLessIcon/>}\r\n disabled={!canCollapse}\r\n />\r\n </Grid>\r\n ), [theme, beginCreateSibling, beginCreateChild, collapse, canCollapse, isCollapsed, canCreateSibling, classes]);\r\n}","import { Paper } from \"@mui/material\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport NodeActionButtons from \"../controllers/NodeActionButtons\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n paper: {\r\n position: \"fixed\",\r\n bottom: \"0\",\r\n left: 0,\r\n zIndex: 3,\r\n width: \"100%\",\r\n borderRadius: 0,\r\n height: \"72px\",\r\n transform: \"translate3d(0,72px,0)\",\r\n transition: \"transform 0.25s\",\r\n boxShadow: theme.inverseShadows[0],\r\n willChange: \"transform\"\r\n },\r\n active: {\r\n transform: \"translate3d(0,0,0)\"\r\n }\r\n}));\r\n\r\nexport default function ActionButtonCard(props) {\r\n const { active } = props;\r\n const classes = useStyles();\r\n\r\n return (\r\n <Paper className={`${classes.paper} ${active ? classes.active : \"\"}`} elevation={2}>\r\n <NodeActionButtons />\r\n </Paper>\r\n );\r\n}","import { useEffect, useRef } from \"react\";\r\nimport { useDispatch, useSelector } from \"react-redux\";\r\nimport { SetCanSwipeOnContent, SetCardSwipeActive } from \"../actions/app\";\r\nimport { useDevice } from \"./DeviceContext\";\r\n\r\nconst findScrollable = (target) => {\r\n let element = target;\r\n\r\n while (!!element) {\r\n if (element.className === \"scrollv\") {\r\n return element;\r\n } \r\n element = element.parentNode;\r\n }\r\n}\r\n\r\n\r\nexport default function SwipableCardProvider(props) {\r\n const active = props.active;\r\n const ref = useRef(null);\r\n const disabledRef = useRef(false);\r\n const positionsRef = useRef([]);\r\n const elementsRef = useRef([]);\r\n const cardApproachingFullscreen = useSelector(state => state.app.cardApproachingFullscreen);\r\n const { isMobilePortraitView } = useDevice();\r\n disabledRef.current = !cardApproachingFullscreen;\r\n const dispatch = useDispatch();\r\n\r\n useEffect(() => {\r\n if (ref.current && isMobilePortraitView && active) {\r\n const view = ref.current;\r\n\r\n let isOnTop = false;\r\n let isOnBottom = false;\r\n\r\n const handleTarget = (target, force = false) => {\r\n const top = target.scrollTop <= 6;\r\n const bottom = target.scrollHeight - target.clientHeight - 4 <= target.scrollTop;\r\n\r\n if (target.scrollTop < 2) {\r\n target.scrollTop = 2;\r\n }\r\n\r\n if (top !== isOnTop || bottom !== isOnBottom || force) {\r\n isOnTop = top;\r\n isOnBottom = bottom;\r\n dispatch(SetCanSwipeOnContent(\r\n isOnBottom,\r\n isOnTop\r\n ));\r\n }\r\n }\r\n\r\n const handleScroll = (e) => {\r\n const target = e.target;\r\n\r\n if (disabledRef.current) {\r\n \r\n if (e.cancelable) {\r\n e.preventDefault();\r\n }\r\n \r\n if (positionsRef.current.length === elementsRef.current.length) {\r\n elementsRef.current.forEach((t, i) => {\r\n t.scrollTop = positionsRef.current[i];\r\n });\r\n }\r\n\r\n } else {\r\n if (target.scrollTop < 1 && e.cancelable) {\r\n e.preventDefault();\r\n }\r\n handleTarget(target);\r\n }\r\n };\r\n\r\n\r\n const handleTouchStart = (e) => {\r\n const target = findScrollable(e.target);\r\n if (target) {\r\n handleTarget(target, true);\r\n }\r\n };\r\n\r\n const handleTouchMove = (e) => {\r\n //const target = e.path.find(t => t.className === \"scrollv\");\r\n //console.log(target?.style.overflowY);\r\n\r\n if (disabledRef.current && e.cancelable) {\r\n e.preventDefault();\r\n }\r\n };\r\n\r\n const list = [...view.getElementsByClassName(\"scrollv\")];\r\n elementsRef.current = list;\r\n\r\n list.forEach(scroll => {\r\n scroll.addEventListener(\"scroll\", handleScroll, { passive: false })\r\n scroll.addEventListener(\"touchstart\", handleTouchStart);\r\n scroll.addEventListener(\"touchmove\", handleTouchMove, { passive: false });\r\n // initialize targets\r\n });\r\n\r\n dispatch(SetCardSwipeActive(true));\r\n\r\n return () => {\r\n list.forEach(scroll => {\r\n scroll.removeEventListener(\"scroll\", handleScroll, { passive: false });\r\n scroll.removeEventListener(\"touchstart\", handleTouchStart);\r\n scroll.removeEventListener(\"touchmove\", handleTouchMove);\r\n });\r\n\r\n dispatch(SetCardSwipeActive(false));\r\n };\r\n }\r\n }, [isMobilePortraitView, dispatch, active]);\r\n\r\n\r\n\r\n\r\n useEffect(() => { // fallback for iOS\r\n if (isMobilePortraitView && active) {\r\n if (cardApproachingFullscreen) {\r\n elementsRef.current.forEach(t => t.style.overflowY = \"scroll\");\r\n } else {\r\n if (elementsRef.current) {\r\n positionsRef.current = elementsRef.current.map(t => Math.max(2,t.scrollTop));\r\n }\r\n elementsRef.current.forEach(t => t.style.overflowY = \"visible\");\r\n }\r\n }\r\n }, [cardApproachingFullscreen, active, isMobilePortraitView]);\r\n\r\n return (\r\n <div ref={ref} className={props.className}>\r\n {props.children}\r\n </div>\r\n );\r\n}\r\n\r\n","import { useEffect, useMemo, useCallback, useRef, useState } from \"react\";\r\nimport { Typography, Tab, Tabs, Fade, Grid } from \"@mui/material\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport { useSelector, useDispatch } from \"react-redux\";\r\nimport NodeNotesPanel from \"../../molecules/editors/NodeNotesPanel\";\r\nimport ControlledResourcesList from \"../../molecules/ControlledResourcesList\";\r\nimport NodeHeaderPanel from \"../../molecules/NodeHeaderPanel\";\r\nimport InboundLinksDialog from \"../dialogs/InboundLinksDialog\";\r\nimport { SetNodeViewTabIndex } from \"../../../actions/app\";\r\nimport useWindowSize from \"../../../hooks/useWindowSize\";\r\nimport useCard from \"../../../hooks/useCard\";\r\nimport { ConditionalPortal } from \"../../atoms/views/ConditionalPortalView\";\r\nimport ActionButtonCard from \"../../molecules/panels/ActionButtonCard\";\r\nimport { useCanEdit, useChildren } from \"@emberly/dataplane\";\r\nimport SwipableCardProvider from \"../../../providers/SwipableCardProvider\";\r\nimport SmoothCollapse from \"../../atoms/views/SmoothCollapse\";\r\nimport { useDevice } from \"../../../providers/DeviceContext\";\r\nimport { useRouteMatch } from \"react-router\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n grid: {\r\n position: \"absolute\",\r\n height: \"100%\",\r\n width: \"100%\"\r\n },\r\n contentContainer: {\r\n position: \"relative\",\r\n touchAction: \"none\"\r\n },\r\n contentItem: {\r\n position: \"absolute\",\r\n top: 0,\r\n left: 0,\r\n width: \"100%\",\r\n height: \"100%\"\r\n },\r\n tabCollapse: {\r\n height: \"49px\",\r\n zIndex: 1\r\n },\r\n tabs: {\r\n height: \"49px\",\r\n position: \"relative\",\r\n overflowY: \"visible\",\r\n background: theme.palette.background.paper,\r\n borderBottom: `1px solid ${theme.palette.divider}`\r\n },\r\n tab: {\r\n touchAction: \"none\",\r\n maxWidth: \"50vw\",\r\n \"& p\": {\r\n maxWidth: \"100%\",\r\n whiteSpace: \"nowrap\",\r\n overflow: \"hidden\",\r\n textOverflow: \"ellipsis\",\r\n }\r\n },\r\n tabIndicator: {\r\n position: \"absolute\",\r\n display: \"flex\",\r\n justifyContent: \"center\",\r\n backgroundColor: \"transparent\",\r\n height: \"4px\",\r\n overflow: \"visible\",\r\n \"& > span\": {\r\n position: \"fixed\",\r\n bottom: \"0px\",\r\n height: \"4px\",\r\n borderRadius: \"2px\",\r\n width: \"180px\",\r\n maxWidth: \"calc(50% - 24px)\",\r\n backgroundColor: theme.palette.primary.dark\r\n }\r\n },\r\n contentCard: {\r\n zIndex: 2,\r\n position: \"relative\",\r\n width: \"100%\",\r\n borderBottomLeftRadius: 0,\r\n borderBottomRightRadius: 0,\r\n touchAction: \"none\",\r\n background: \"none\"\r\n }\r\n}));\r\n\r\nconst fadeDuration = { enter: 200, exit: 200 };\r\nconst resourceAccumulator = (count, resource) => resource.archived ? count : count + 1;\r\n\r\nexport default function NodeView() {\r\n const classes = useStyles();\r\n const dispatch = useDispatch();\r\n const match = useRouteMatch();\r\n const { nodeId } = match.params;\r\n const { height } = useWindowSize();\r\n const { isMobilePortraitView, isEmbed, isEmbedView } = useDevice();\r\n const { nodeViewTabIndex, notesFullscreen } = useSelector(state => state.app);\r\n const { inboundLinksPanelOpen, selectHandles } = useSelector(state => state.search);\r\n const [tabsActive, setTabsActive] = useState(!isEmbed);\r\n const [notesActive, setNotesActive] = useState(false);\r\n const [mounted, setMounted] = useState(false);\r\n const tabActions = useRef(null);\r\n const { children: resources, loading } = useChildren(\"Resource\", nodeId);\r\n const { contextCardState, setCardState } = useCard(true);\r\n const canEdit = useCanEdit() && !isEmbedView;\r\n\r\n useEffect(() => {\r\n setCardState((state) => Math.max(state, 1));\r\n }, [nodeId, setCardState]);\r\n\r\n const fullScreen = (contextCardState === 3 && isMobilePortraitView) || (!isMobilePortraitView && height < 570);\r\n const notesExpanded = fullScreen && notesActive && nodeViewTabIndex === 1 && !isEmbed;\r\n const showController = (nodeViewTabIndex === 0 && contextCardState >= 2) || !isMobilePortraitView;\r\n const showActionButtons = contextCardState === 1 && isMobilePortraitView;\r\n\r\n const onTabClick = useCallback((ev, val) => dispatch(SetNodeViewTabIndex(val)), [dispatch]);\r\n\r\n useEffect(() => {\r\n if (nodeViewTabIndex !== 1 || (contextCardState !== 3 && isMobilePortraitView)) {\r\n setNotesActive(false);\r\n }\r\n }, [nodeViewTabIndex, setNotesActive, contextCardState, isMobilePortraitView]);\r\n\r\n useEffect(() => {\r\n if (notesActive) {\r\n setCardState(true);\r\n }\r\n }, [setCardState, notesActive, isEmbed]);\r\n\r\n useEffect(() => {\r\n return () => {\r\n tabActions.current = null;\r\n };\r\n }, [dispatch, tabActions]);\r\n\r\n useEffect(() => {\r\n if (contextCardState !== 0 && isEmbedView) {\r\n const tabs = setTimeout(() => setTabsActive(true), 250);\r\n\r\n const timer = setTimeout(() => {\r\n if (tabActions.current !== null) {\r\n tabActions.current.updateIndicator();\r\n }\r\n }, 500);\r\n\r\n return () => {\r\n setTabsActive(false);\r\n clearTimeout(tabs);\r\n clearTimeout(timer);\r\n };\r\n }\r\n }, [tabActions, contextCardState, isEmbedView]);\r\n\r\n const resourceCount = resources.reduce(resourceAccumulator, 0);\r\n\r\n return useMemo(() =>\r\n <>\r\n <Grid container direction=\"column\" className={classes.grid} alignItems=\"stretch\">\r\n <Grid item>\r\n {!notesFullscreen ? <NodeHeaderPanel nodeId={nodeId} compactView={fullScreen} notesActive={notesActive} setNotesActive={setNotesActive} /> : null}\r\n </Grid>\r\n\r\n <Grid item xs container direction=\"column\" className={classes.contentCard}>\r\n\r\n <SmoothCollapse in={!notesExpanded && !notesFullscreen} className={classes.tabCollapse}>\r\n <Tabs\r\n className={classes.tabs}\r\n value={notesFullscreen ? 1 : nodeViewTabIndex}\r\n onChange={onTabClick}\r\n variant=\"fullWidth\"\r\n indicatorColor=\"primary\"\r\n TabIndicatorProps={{ children: <span /> }}\r\n classes={{ indicator: classes.tabIndicator }}\r\n action={isEmbedView ? tabActions : undefined}\r\n textColor=\"inherit\"\r\n >\r\n {tabsActive ? <Tab className={classes.tab} value={0} label={<Typography variant=\"body2\">{`Resources (${!loading ? resourceCount : \"\"})`}</Typography>} /> : null}\r\n {tabsActive ? <Tab className={classes.tab} value={1} label={<Typography variant=\"body2\">Notes</Typography>} /> : null}\r\n </Tabs>\r\n </SmoothCollapse>\r\n\r\n <Grid item xs\r\n className={classes.contentContainer}\r\n >\r\n <SwipableCardProvider active={!inboundLinksPanelOpen && selectHandles.length === 0 && mounted && !notesExpanded}>\r\n\r\n <Fade in={nodeViewTabIndex === 0} timeout={fadeDuration}>\r\n <div className={classes.contentItem}>\r\n <ControlledResourcesList nodeId={nodeId} controllerEnabled={showController} swipeEnabled />\r\n </div>\r\n </Fade>\r\n\r\n <Fade in={nodeViewTabIndex === 1} timeout={fadeDuration}>\r\n <div className={classes.contentItem}>\r\n <NodeNotesPanel onFocused={setNotesActive} active={notesActive} nodeId={nodeId} onMounted={setMounted} />\r\n </div>\r\n </Fade>\r\n\r\n </SwipableCardProvider>\r\n </Grid>\r\n </Grid>\r\n </Grid>\r\n\r\n {inboundLinksPanelOpen ? <InboundLinksDialog noteId={`node-${nodeId}`} /> : null}\r\n\r\n {isMobilePortraitView && canEdit ? (\r\n <ConditionalPortal active portalId=\"mapview\">\r\n <ActionButtonCard active={showActionButtons} />\r\n </ConditionalPortal>\r\n ) : null}\r\n\r\n </>,\r\n [isEmbedView, classes, tabsActive, selectHandles.length, nodeId, inboundLinksPanelOpen, mounted, canEdit, showActionButtons, setNotesActive, notesActive, showController, tabActions, nodeViewTabIndex, isMobilePortraitView, resourceCount, onTabClick, loading, notesExpanded, fullScreen, notesFullscreen]\r\n );\r\n}","import { useCallback } from \"react\";\r\nimport SearchPanel from \"../../molecules/panels/SearchPanel\";\r\nimport { getRootUrl } from \"../../../hooks/useApp\";\r\nimport { useDefaultOpenCard } from \"../../../hooks/useCard\";\r\nimport CardHeader from \"../../atoms/CardHeader\";\r\nimport { Grid, Typography } from \"@mui/material\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport { useDevice } from \"../../../providers/DeviceContext\";\r\nimport { useHistory, useLocation } from \"react-router\";\r\nimport { useRTACPlan } from \"@emberly/dataplane\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n root: {\r\n position: \"absolute\",\r\n width: \"100%\",\r\n height: \"100%\",\r\n background: theme.palette.background.paper\r\n },\r\n header: {\r\n padding: theme.spacing(2),\r\n paddingBottom: 0,\r\n marginTop: \"2px\",\r\n userSelect: \"none\"\r\n },\r\n gridItem: {\r\n \"@media (max-height: 350px)\": {\r\n display: \"none\"\r\n }\r\n }\r\n}));\r\n\r\nexport default function SearchView() {\r\n const history = useHistory();\r\n const location = useLocation();\r\n const { isMobilePortraitView } = useDevice();\r\n const classes = useStyles();\r\n\r\n const isSearch = location.pathname.endsWith(\"/search\");\r\n\r\n useDefaultOpenCard(isSearch);\r\n const onCancel = useCallback(() => history.push(getRootUrl()), [history]);\r\n const { plan } = useRTACPlan(\"default\");\r\n \r\n return (\r\n <Grid container className={classes.root} direction=\"column\">\r\n <Grid className={!isMobilePortraitView ? classes.gridItem : undefined}>\r\n {\r\n isMobilePortraitView ? (\r\n <CardHeader\r\n title=\"Quick access\"\r\n border\r\n onExpandMore={onCancel}\r\n />\r\n ) : (\r\n <Typography variant=\"h5\" className={classes.header}>\r\n Quick access\r\n </Typography>\r\n )\r\n }\r\n </Grid>\r\n <Grid item xs>\r\n <SearchPanel includeTopics includeResources includeNoteBlocks={plan?.type > 0} isGlobal placeholder=\"Search this map\" autofocus={isSearch} />\r\n </Grid>\r\n </Grid>\r\n );\r\n}\r\n","import { useState, useMemo, useEffect, useCallback, useRef } from \"react\";\r\nimport { Paper } from \"@mui/material\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport { SetCardApproachingFullscreen, ReportCardPosition } from \"../../../actions/app\";\r\nimport { useDispatch, useSelector } from \"react-redux\";\r\nimport useWindowSize from \"../../../hooks/useWindowSize\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n root: {\r\n position: \"absolute\",\r\n width: \"100%\",\r\n height: \"100%\",\r\n top: 0,\r\n left: 0,\r\n overflow: \"hidden\"\r\n },\r\n card: {\r\n zIndex: 2,\r\n position: \"fixed\",\r\n left: 0,\r\n top: 0,\r\n width: \"100%\",\r\n height: \"100%\",\r\n borderTopLeftRadius: \"8px\",\r\n borderTopRightRadius: \"8px\",\r\n borderBottomLeftRadius: 0,\r\n borderBottomRightRadius: 0,\r\n transform: \"translate3d(0,0,0)\",\r\n willChange: \"transform\",\r\n touchAction: \"none\",\r\n overflow: \"hidden\",\r\n background: theme.palette.background.paper\r\n },\r\n fullScreen: {\r\n borderRadius: 0,\r\n overflow: \"hidden\"\r\n }\r\n}));\r\n\r\nlet timer = 0;\r\n\r\nfunction updateCard(card, background, top, bottom, cover, layout) {\r\n if (!!card.current) {\r\n const fs = layout.cardApproachingFullscreen;\r\n const y = layout.positionY;\r\n\r\n card.current.style.transform = `translate3d(0,${y}px,0)`;\r\n card.current.style.transition = layout.touchActive ? \"none\" : \"transform 0.25s\";\r\n \r\n if (fs && y > 0) {\r\n clearTimeout(timer);\r\n timer = setTimeout(() => {\r\n layout.dispatch(SetCardApproachingFullscreen(false));\r\n layout.cardApproachingFullscreen = false;\r\n }, 1);\r\n } else if (!fs && y === 0) {\r\n clearTimeout(timer);\r\n timer = setTimeout(() => {\r\n layout.dispatch(SetCardApproachingFullscreen(true));\r\n layout.cardApproachingFullscreen = true;\r\n }, 1);\r\n }\r\n }\r\n if (!!background.current) {\r\n background.current.style.transform = `translate3d(0,${Math.max((layout.positionY - layout.height) * 0.5, -layout.peekHeight * 0.5)}px,0)`;\r\n background.current.style.transition = layout.touchActive ? \"none\" : \"transform 0.25s\";\r\n }\r\n if (!!top.current) {\r\n top.current.style.opacity = Math.max(Math.min(((layout.positionY - 64) / 64), 1), 0);\r\n top.current.style.transition = layout.touchActive ? \"none\" : \"opacity 0.25s\";\r\n top.current.style.display = layout.positionY === 0 ? \"none\" : \"block\";\r\n }\r\n if (!!bottom.current) {\r\n bottom.current.style.transform = `translate3d(0,${Math.max(layout.positionY, layout.height - layout.headerHeight)}px,0)`;\r\n bottom.current.style.transition = layout.touchActive ? \"none\" : \"transform 0.25s\";\r\n }\r\n if (!!cover.current) {\r\n cover.current.style.display = layout.touchActive ? \"block\" : \"none\";\r\n }\r\n}\r\n\r\nexport default function MobileCard(props) {\r\n const { headerHeight, peekHeight, cardId, active, maxHeaderHeight, backgroundRef, hasOverlay, Overlay } = props;\r\n const classes = useStyles();\r\n const dispatch = useDispatch();\r\n const { cardApproachingFullscreen, canSwipeUpOnContent, canSwipeDownOnContent } = useSelector(state => state.app);\r\n const { height } = useWindowSize();\r\n const cardRef = useRef(null);\r\n const topRef = useRef(null);\r\n const bottomRef = useRef(null);\r\n const coverRef = useRef(null);\r\n\r\n const [layout] = useState({ deltaY: 0, positionY: 0, offsetY: 0, velocityY: 0, touchActiveTime: 0, touchActive: 0, peekHeight, height, headerHeight, dispatch, cardApproachingFullscreen });\r\n const [internalCardState, internalOnCardStateChange] = useState(0);\r\n\r\n const cardState = props.cardState !== undefined ? props.cardState : internalCardState;\r\n const onCardStateChange = props.onCardStateChange !== undefined ? props.onCardStateChange : internalOnCardStateChange;\r\n\r\n\r\n\r\n const positions = useMemo(() => {\r\n let p = [height];\r\n\r\n if (peekHeight !== undefined) {\r\n p.push(height - peekHeight);\r\n }\r\n\r\n if (headerHeight !== undefined) {\r\n p.push(height - Math.min(headerHeight, (maxHeaderHeight || 1) * height));\r\n }\r\n\r\n p.push(0);\r\n\r\n layout.peekHeight = peekHeight;\r\n layout.height = height;\r\n layout.headerHeight = Math.min(headerHeight, (maxHeaderHeight || 1) * height);\r\n\r\n updateCard(cardRef, backgroundRef, topRef, bottomRef, coverRef, layout);\r\n\r\n return p;\r\n }, [coverRef, cardRef, backgroundRef, topRef, bottomRef, layout, headerHeight, peekHeight, height, maxHeaderHeight]);\r\n\r\n const isFullScreen = cardState === positions.length - 1;\r\n\r\n useEffect(() => {\r\n if (!layout.touchActive) {\r\n layout.positionY = positions[cardState];\r\n dispatch(ReportCardPosition(0, Math.min(height - positions[cardState], height * 0.5))); // TODO do i even need this anymore\r\n\r\n updateCard(cardRef, backgroundRef, topRef, bottomRef, coverRef, layout);\r\n }\r\n\r\n return () => dispatch(ReportCardPosition(0, 0));\r\n }, [coverRef, positions, backgroundRef, cardState, height, dispatch, cardId, layout, topRef, bottomRef, cardRef, cardApproachingFullscreen]);\r\n\r\n const onTouchStart = useCallback((ev) => {\r\n let y = ev.nativeEvent.touches[0].clientY - layout.positionY;\r\n if (active && (\r\n (!isFullScreen && y <= 148) ||\r\n (isFullScreen && y <= 96) ||\r\n !cardApproachingFullscreen)\r\n ) {\r\n layout.deltaY = ev.nativeEvent.touches[0].clientY;\r\n layout.offsetY = y;\r\n layout.touchActiveTime = Date.now();\r\n layout.touchActive = true;\r\n updateCard(cardRef, backgroundRef, topRef, bottomRef, coverRef, layout);\r\n }\r\n }, [coverRef, layout, active, cardApproachingFullscreen, isFullScreen, cardRef, topRef, bottomRef, backgroundRef]);\r\n\r\n const onTouchEnd = useCallback((ev) => {\r\n if (layout.touchActive) {\r\n let result = ev.nativeEvent.changedTouches[0].clientY - layout.offsetY + layout.velocityY * 250;\r\n let state = 0;\r\n let minDistance = 99999;\r\n\r\n for (let i = 0; i < positions.length; i++) {\r\n let dist = Math.abs(positions[i] - result);\r\n\r\n if (dist < minDistance) {\r\n state = i;\r\n minDistance = dist;\r\n }\r\n }\r\n\r\n layout.positionY = positions[state];\r\n layout.touchActive = false;\r\n\r\n if (state !== cardState) {\r\n onCardStateChange(state)\r\n }\r\n }\r\n\r\n layout.deltaY = -1;\r\n layout.velocityY = 0;\r\n\r\n updateCard(cardRef, backgroundRef, topRef, bottomRef, coverRef, layout);\r\n\r\n }, [coverRef, layout, onCardStateChange, positions, cardState, topRef, bottomRef, cardRef, backgroundRef]);\r\n\r\n\r\n\r\n const onTouchMove = useCallback((ev) => {\r\n let time = Date.now();\r\n let y = ev.nativeEvent.touches[0].clientY;\r\n let deltaTime = Math.max(1, time - layout.touchActiveTime);\r\n let velocity = layout.deltaY === -1 ? 0 : (y - layout.deltaY) / deltaTime;\r\n\r\n layout.velocityY = velocity;\r\n layout.touchActiveTime = time;\r\n layout.deltaY = y;\r\n\r\n if (layout.touchActive) {\r\n // TODO test without capture etc\r\n const dY = Math.max(0, y - layout.offsetY);\r\n layout.positionY = dY;\r\n\r\n } else if (active) {\r\n if ((velocity < 0 && canSwipeUpOnContent && cardState !== 3) || (velocity > 0 && canSwipeDownOnContent) || cardState !== 3) {\r\n layout.offsetY = y - layout.positionY;\r\n layout.touchActive = true;\r\n }\r\n }\r\n\r\n updateCard(cardRef, backgroundRef, topRef, bottomRef, coverRef, layout);\r\n\r\n }, [coverRef, layout, active, cardState, cardRef, topRef, bottomRef, backgroundRef, canSwipeUpOnContent, canSwipeDownOnContent]);\r\n\r\n useEffect(() => {\r\n if (!!bottomRef.current && hasOverlay) {\r\n updateCard(cardRef, backgroundRef, topRef, bottomRef, coverRef, layout);\r\n }\r\n }, [topRef, cardRef, backgroundRef, layout, coverRef, hasOverlay]);\r\n\r\n\r\n return (\r\n <div className={classes.root}>\r\n\r\n {hasOverlay ? (\r\n <Overlay\r\n topRef={topRef}\r\n bottomRef={bottomRef}\r\n cardState={cardState}\r\n />\r\n ) : null}\r\n\r\n <Paper\r\n ref={cardRef}\r\n className={`${classes.card} ${isFullScreen ? classes.fullScreen : \"\"} noselect`}\r\n onTouchStart={onTouchStart}\r\n onTouchEnd={onTouchEnd}\r\n onTouchMoveCapture={onTouchMove}\r\n elevation={7}\r\n >\r\n {props.children}\r\n </Paper>\r\n </div>\r\n );\r\n}","import { Children } from \"react\";\r\nimport { Paper, Grid, Fade } from \"@mui/material\";\r\nimport { makeStyles } from \"@mui/styles\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n paper: {\r\n zIndex: 2,\r\n overflow: \"hidden\"\r\n },\r\n gridContainer: {\r\n position: \"relative\",\r\n height: \"100%\"\r\n }\r\n}));\r\n\r\n\r\nexport default function GButton(props) {\r\n const { direction, active, justify } = props;\r\n const classes = useStyles();\r\n\r\n return (\r\n <Fade\r\n in={(active === undefined || active)}\r\n >\r\n <Paper\r\n style={props.style}\r\n className={`${classes.paper} ${props.className || \"\"}`}\r\n elevation={4}\r\n >\r\n <Grid className={classes.gridContainer} container direction={direction} justifyContent={justify || \"space-evenly\"} alignItems=\"center\">\r\n {\r\n Children.map(props.children, (child, index) =>\r\n (\r\n <Grid item key={index}>\r\n {child}\r\n </Grid>\r\n )\r\n )\r\n }\r\n </Grid>\r\n </Paper>\r\n </Fade>\r\n );\r\n}","import { useState, useMemo, useEffect, useCallback } from \"react\";\r\nimport { Paper, IconButton } from \"@mui/material\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport * as AppActions from \"../../../actions/app\";\r\nimport { useDispatch } from \"react-redux\";\r\nimport useWindowSize from \"../../../hooks/useWindowSize\";\r\nimport GButton from \"../inputs/GButton\";\r\nimport { ChevronLeft as ChevronLeftIcon, ChevronRight as ChevronRightIcon } from \"@mui/icons-material\";\r\nimport { ConditionalPortalView } from \"../views/ConditionalPortalView\";\r\nimport { useDevice } from \"../../../providers/DeviceContext\";\r\n\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n card: {\r\n position: \"fixed\",\r\n height: \"100%\",\r\n top: 0,\r\n right: 0,\r\n zIndex: 2,\r\n borderRadius: 0,\r\n background: theme.palette.background.paper\r\n },\r\n swipeArea: {\r\n position: \"absolute\",\r\n height: \"calc(100% - 128px)\",\r\n width: \"20px\",\r\n top: \"128px\",\r\n left: -10,\r\n zIndex: 1,\r\n opacity: 0,\r\n background: \"none\"\r\n },\r\n portal: {\r\n position: \"absolute\",\r\n top: theme.spacing(9),\r\n left: \"-48px\",\r\n width: \"48px\",\r\n zIndex: 0,\r\n height: \"auto\",\r\n borderTopRightRadius: 0,\r\n borderBottomRightRadius: 0,\r\n borderRight: `1px solid ${theme.palette.common.softShadowBorder}`,\r\n clipPath: \"inset(-32px -0.1px -32px -32px)\"\r\n },\r\n toggleButton: {\r\n position: \"absolute\",\r\n top: theme.spacing(1),\r\n left: \"-48px\",\r\n width: \"48px\",\r\n zIndex: 0,\r\n height: \"48px\",\r\n borderTopRightRadius: 0,\r\n borderBottomRightRadius: 0,\r\n borderRight: `1px solid ${theme.palette.common.softShadowBorder}`,\r\n clipPath: \"inset(-32px -0.1px -32px -32px)\"\r\n },\r\n iconButton: {\r\n borderRadius: theme.spacing(0.5),\r\n borderTopRightRadius: 0,\r\n borderBottomRightRadius: 0,\r\n padding: theme.spacing(1.5),\r\n color: theme.palette.neutral.button\r\n }\r\n}));\r\n\r\nexport default function DesktopCard(props) {\r\n const { swipeableSize, cardWidth, active, hasOverlay, Overlay, backgroundRef, fullscreen } = props;\r\n const { isMobile } = useDevice();\r\n const classes = useStyles();\r\n const dispatch = useDispatch();\r\n const [internalCardState, internalOnCardStateChange] = useState(1);\r\n const cardState = Math.min(props.cardState !== undefined ? props.cardState : internalCardState, 1);\r\n const onCardStateChange = props.onCardStateChange !== undefined ? props.onCardStateChange : internalOnCardStateChange;\r\n const { width } = useWindowSize();\r\n const [deltaX, setDeltaX] = useState(cardWidth);\r\n const [touchActive, setTouchActive] = useState(false);\r\n const [touchActiveTime, setTouchActiveTime] = useState(0);\r\n const [velocityX, setVelocityX] = useState(0);\r\n\r\n const finalCardWidth = fullscreen ? width : cardWidth;\r\n\r\n useEffect(() => {\r\n if (!!backgroundRef.current) {\r\n backgroundRef.current.style.transform = `translate3d(0,0,0)`;\r\n }\r\n }, [backgroundRef]);\r\n\r\n const positions = useMemo(() => {\r\n return [\r\n 0, // closed\r\n finalCardWidth // open\r\n ];\r\n }, [finalCardWidth]);\r\n\r\n\r\n const styles = {\r\n transform: `translate3d(${-deltaX + finalCardWidth}px, 0, 0)`,\r\n transition: touchActive ? \"none\" : \"transform 0.25s\",\r\n width: finalCardWidth\r\n };\r\n\r\n const swipeableStyles = useMemo(() => ({\r\n left: -10,\r\n width: swipeableSize * 0.5\r\n }), [swipeableSize]);\r\n\r\n useEffect(() => {\r\n setDeltaX(positions[cardState]);\r\n dispatch(AppActions.ReportCardPosition(positions[cardState], 0));\r\n return () => dispatch(AppActions.ReportCardPosition(0, 0));\r\n }, [cardState, positions, width, dispatch, setDeltaX]);\r\n\r\n const onTouchStart = useCallback(() => {\r\n setTouchActive(true);\r\n setTouchActiveTime(Date.now());\r\n }, [setTouchActive, setTouchActiveTime]);\r\n\r\n const onTouchEnd = (ev) => {\r\n let result = (window.innerWidth - ev.nativeEvent.changedTouches[0].clientX) + velocityX * 250;\r\n let state = 0;\r\n let minDistance = 9999;\r\n\r\n for (let i = 0; i < positions.length; i++) {\r\n let dist = Math.abs(positions[i] - result);\r\n if (dist < minDistance) {\r\n state = i;\r\n minDistance = dist;\r\n }\r\n }\r\n\r\n setDeltaX(positions[state]);\r\n setTouchActive(false);\r\n onCardStateChange(state);\r\n setVelocityX(0);\r\n };\r\n\r\n const onTouchMove = (ev) => {\r\n if (touchActive) {\r\n let time = Date.now();\r\n let x = Math.min(window.innerWidth - ev.nativeEvent.touches[0].clientX, finalCardWidth);\r\n let deltaTime = Math.max(1, time - touchActiveTime);\r\n setVelocityX((x - deltaX) / deltaTime);\r\n setDeltaX(x);\r\n setTouchActiveTime(time);\r\n }\r\n };\r\n\r\n const onToggleCard = useCallback(() => onCardStateChange(cardState === 0 ? 1 : 0), [onCardStateChange, cardState]);\r\n\r\n return (\r\n <div>\r\n\r\n {hasOverlay ? (\r\n <Overlay deltaX={deltaX} width={width} touchActive={touchActive} cardWidth={finalCardWidth} />\r\n ) : null}\r\n\r\n <Paper\r\n className={classes.card}\r\n elevation={7}\r\n style={styles}\r\n >\r\n\r\n <GButton className={classes.toggleButton} direction=\"column\">\r\n <IconButton className={classes.iconButton} onClick={onToggleCard} size=\"medium\">\r\n {cardState === 1 ? <ChevronRightIcon fontSize=\"medium\" /> : <ChevronLeftIcon fontSize=\"medium\" />}\r\n </IconButton>\r\n </GButton>\r\n\r\n <div className={classes.portal}>\r\n <ConditionalPortalView />\r\n </div>\r\n\r\n {active && isMobile ? (\r\n <div\r\n style={swipeableStyles}\r\n className={classes.swipeArea}\r\n onTouchStart={onTouchStart}\r\n onTouchEnd={onTouchEnd}\r\n onTouchMove={onTouchMove}\r\n ></div>\r\n ) : null}\r\n {props.children}\r\n </Paper>\r\n </div>\r\n );\r\n}","import { useState, useMemo, useEffect, useCallback } from \"react\";\r\nimport { Paper, IconButton, Zoom, Grid } from \"@mui/material\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport * as AppActions from \"../../../actions/app\";\r\nimport { useDispatch, useSelector } from \"react-redux\";\r\nimport useWindowSize from \"../../../hooks/useWindowSize\";\r\nimport { ChevronLeft as ChevronLeftIcon, Close as CloseIcon } from \"@mui/icons-material\";\r\nimport { useDevice } from \"../../../providers/DeviceContext\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n root: {\r\n position: \"absolute\",\r\n width: \"100%\",\r\n top: 0,\r\n left: 0\r\n },\r\n background: {\r\n position: \"fixed\",\r\n width: \"100%\",\r\n height: \"100%\",\r\n top: 0,\r\n left: 0,\r\n transform: \"translate3d(0,0,0)\",\r\n willChange: \"transform\"\r\n },\r\n paperButton: {\r\n borderRadius: theme.spacing(0.5),\r\n position: \"fixed\",\r\n zIndex: 3,\r\n top: \"12px\",\r\n right: \"12px\",\r\n overflow: \"hidden\",\r\n transform: \"translate3d(0,0,0)\",\r\n willChange: \"transform\",\r\n },\r\n paperContainer: {\r\n borderRadius: theme.spacing(0.5),\r\n position: \"fixed\",\r\n zIndex: 3,\r\n top: \"12px\",\r\n right: \"12px\",\r\n overflow: \"hidden\",\r\n transform: \"translate3d(0,0,0)\",\r\n willChange: \"transform\",\r\n background: theme.palette.background.paper\r\n },\r\n container: {\r\n transform: \"translate3d(0,0,0)\",\r\n position: \"absolute\",\r\n height: \"100%\",\r\n width: \"100%\",\r\n overflow: \"hidden\",\r\n },\r\n button: {\r\n color: theme.palette.neutral.button,\r\n borderRadius: theme.spacing(0.5),\r\n textAlign: \"center\",\r\n },\r\n closeButton: {\r\n position: \"absolute\",\r\n top: \"6px\",\r\n right: \"8px\",\r\n zIndex: 999999,\r\n borderRadius: theme.spacing(0.5)\r\n }\r\n}));\r\n\r\nexport default function EmbedCard(props) {\r\n const { cardWidth, hasOverlay, Overlay, fullscreen } = props;\r\n const classes = useStyles();\r\n const dispatch = useDispatch();\r\n const activeNodeId = useSelector(state => state.tree.activeNodeId);\r\n const showEmbedDescription = useSelector(state => state.app.showEmbedDescription);\r\n const { isMobile, isPortrait, isEmbed } = useDevice();\r\n const [internalCardState, internalOnCardStateChange] = useState(1);\r\n const cardState = props.cardState !== undefined ? props.cardState : internalCardState;\r\n const onCardStateChange = props.onCardStateChange !== undefined ? props.onCardStateChange : internalOnCardStateChange;\r\n const { width } = useWindowSize();\r\n\r\n const positions = useMemo(() => {\r\n return [\r\n 0, // closed\r\n width < 500 ? width - 24 : Math.min(cardWidth, width * 0.75) // open\r\n ];\r\n }, [cardWidth, width]);\r\n\r\n useEffect(() => {\r\n dispatch(AppActions.ReportCardPosition(positions[cardState], 0));\r\n return () => dispatch(AppActions.ReportCardPosition(0, 0));\r\n }, [cardState, positions, dispatch]);\r\n\r\n const onToggleCard = useCallback(() => onCardStateChange(cardState === 0 ? 1 : 0), [onCardStateChange, cardState]);\r\n\r\n const growStyle = useMemo(() => ({ transformOrigin: \"top right 0\" }), []);\r\n const activeStyle = useMemo(() => fullscreen ? ({ height: \"100%\", width: \"100%\", borderRadius: 0, top: 0, right: 0 }) : ({ height: \"calc(100% - 24px)\", width: positions[1] }), [positions, fullscreen]);\r\n const widgetActive = cardState === 0 && ( !!activeNodeId || showEmbedDescription );\r\n\r\n const isMobileView = !isEmbed && isMobile && isPortrait \r\n\r\n const iconSize = isMobileView ? \"large\" : \"medium\";\r\n const fontSize = isMobileView ? \"medium\" : \"small\";\r\n\r\n return (\r\n <div>\r\n\r\n {hasOverlay ? (\r\n <Overlay deltaX={positions[cardState]} width={width} widgetActive={widgetActive} cardWidth={cardWidth} />\r\n ) : null}\r\n\r\n <Zoom in={widgetActive} style={growStyle}>\r\n <Paper className={classes.paperButton} elevation={4}>\r\n <Grid className={classes.gridContainer} container justifyContent=\"space-evenly\" alignItems=\"center\">\r\n <IconButton onClick={onToggleCard} className={classes.button} size={iconSize}>\r\n <ChevronLeftIcon fontSize={fontSize} />\r\n </IconButton>\r\n </Grid>\r\n </Paper>\r\n </Zoom>\r\n\r\n <Zoom in={cardState === 1} style={growStyle}>\r\n <Paper className={classes.paperContainer} style={activeStyle} elevation={4}>\r\n {\r\n !fullscreen ? (\r\n <IconButton onClick={onToggleCard} className={classes.closeButton} size=\"medium\">\r\n <CloseIcon fontSize=\"small\" />\r\n </IconButton>\r\n ) : null\r\n }\r\n <div className={classes.container}>\r\n {props.children}\r\n </div>\r\n </Paper>\r\n </Zoom>\r\n\r\n </div>\r\n );\r\n}","import MobileCard from \"./MobileCard\"\r\nimport DesktopCard from \"./DesktopCard\"\r\nimport EmbedCard from \"./EmbedCard\";\r\nimport { useDevice } from \"../../../providers/DeviceContext\";\r\n\r\nexport default function DynamicCard(props) {\r\n const { fullscreen, headerHeight, peekHeight, swipeableSize, cardId, cardWidth, cardState, onCardStateChange, active, maxHeaderHeight, hasOverlay, backgroundRef, MobileOverlay, DesktopOverlay, EmbedOverlay } = props;\r\n const { isMobilePortraitView, isEmbedView } = useDevice();\r\n\r\n return (\r\n isEmbedView ? (\r\n <EmbedCard\r\n cardId={cardId}\r\n swipeableSize={swipeableSize}\r\n cardWidth={cardWidth}\r\n cardState={cardState}\r\n onCardStateChange={onCardStateChange}\r\n active={active}\r\n backgroundRef={backgroundRef}\r\n hasOverlay={hasOverlay}\r\n Overlay={EmbedOverlay}\r\n fullscreen={fullscreen}\r\n >\r\n {props.children}\r\n </EmbedCard>\r\n ) : (\r\n isMobilePortraitView ? (\r\n <MobileCard\r\n cardId={cardId}\r\n headerHeight={headerHeight}\r\n maxHeaderHeight={maxHeaderHeight}\r\n peekHeight={peekHeight}\r\n swipeableSize={swipeableSize}\r\n cardState={cardState}\r\n onCardStateChange={onCardStateChange}\r\n active={active}\r\n backgroundRef={backgroundRef}\r\n hasOverlay={hasOverlay}\r\n Overlay={MobileOverlay}\r\n >\r\n {props.children}\r\n </MobileCard >\r\n ) : (\r\n <DesktopCard\r\n cardId={cardId}\r\n swipeableSize={swipeableSize}\r\n cardWidth={cardWidth}\r\n cardState={cardState}\r\n onCardStateChange={onCardStateChange}\r\n active={active}\r\n backgroundRef={backgroundRef}\r\n hasOverlay={hasOverlay}\r\n Overlay={DesktopOverlay}\r\n fullscreen={fullscreen}\r\n >\r\n {props.children}\r\n </DesktopCard>\r\n )\r\n )\r\n );\r\n}","import { useState, useEffect, useCallback } from \"react\";\r\nimport { Grid, InputBase, Select, Typography } from \"@mui/material\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport {\r\n ExpandMore as ExpandIcon\r\n} from \"@mui/icons-material\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n root: {\r\n \r\n },\r\n inputItem: {\r\n border: `1px solid ${theme.palette.divider}`,\r\n borderRadius: theme.spacing(0.5),\r\n },\r\n input: {\r\n minHeight: \"40px\",\r\n marginRight: \"-1px\",\r\n paddingLeft: theme.spacing(1),\r\n fontSize: \"14px\",\r\n lineHeight: \"20px\",\r\n letterSpacing: \"0.25px\"\r\n },\r\n select: {\r\n border: \"none !important\",\r\n height: \"100%\",\r\n marginRight: theme.spacing(1),\r\n marginLeft: theme.spacing(1),\r\n \"& div\": {\r\n paddingLeft: theme.spacing(0.5),\r\n },\r\n \"& svg\": {\r\n fontSize: \"16px\"\r\n }\r\n },\r\n helperText: {\r\n marginLeft: theme.spacing(0.5),\r\n fontSize: \"14px\"\r\n },\r\n helperTextError: {\r\n color: theme.palette.error.main\r\n }\r\n}));\r\n\r\nexport default function StandardInputSelect(props) {\r\n const { placeholder, type, onClick, label, id, className, value, selectValue, onChange, disabled, error, helperText } = props;\r\n const classes = useStyles();\r\n const [text, setText] = useState(value || \"\");\r\n const [select, setSelect] = useState(selectValue || 0);\r\n\r\n useEffect(() => {\r\n if (typeof value === \"string\") {\r\n setText(value);\r\n }\r\n }, [value]);\r\n\r\n useEffect(() => {\r\n if (typeof selectValue !== \"undefined\" && selectValue !== null) {\r\n setSelect(selectValue);\r\n }\r\n }, [selectValue]);\r\n\r\n const onInternalChangeText = useCallback((ev) => ((!!onChange ? onChange(ev.target.value, select) : null, setText(ev.target.value))), [setText, select, onChange]);\r\n const onInternalChangeSelect = useCallback((ev) => ((!!onChange ? onChange(text, ev.target.value) : null, setSelect(ev.target.value))), [setSelect, text, onChange]);\r\n \r\n\r\n return (\r\n <Grid container className={`${classes.root} ${className || \"\"}`}>\r\n <Grid item container className={classes.inputItem} alignItems=\"center\" direction=\"row\">\r\n <Grid item xs>\r\n <InputBase id={id} label={label} className={classes.input} placeholder={placeholder} type={type} value={value || text} onChange={onInternalChangeText} onSubmit={onClick} disabled={disabled} fullWidth multiline />\r\n </Grid>\r\n <Grid item>\r\n <Select className={classes.select} variant=\"standard\" disableUnderline IconComponent={ExpandIcon} onChange={onInternalChangeSelect} value={select} disabled={disabled}>\r\n {props.children}\r\n </Select>\r\n </Grid>\r\n </Grid>\r\n {!!helperText ? (\r\n <Typography className={`${classes.helperText} ${error ? classes.helperTextError : \"\"}`} variant=\"caption\">{helperText}</Typography>\r\n ) : null}\r\n </Grid>\r\n );\r\n}","import { useCallback, useState } from \"react\";\r\nimport { Divider, Button, Typography, Grid, Select, List, ListItem, ListItemIcon, ListItemText, MenuItem, TextField } from \"@mui/material\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport {\r\n ExpandMore as ExpandIcon,\r\n Link as LinkIcon,\r\n Code as CodeIcon,\r\n PersonOutline as PersonIcon,\r\n} from \"@mui/icons-material\";\r\nimport Scrollbars from \"react-custom-scrollbars-2\";\r\nimport { useDispatch } from \"react-redux\";\r\nimport StandardToggle from \"../../atoms/inputs/StandardToggle\";\r\nimport StandardInputSelect from \"../../atoms/inputs/StandardInputSelect\";\r\nimport { DisplayNotification } from \"../../../actions/app\";\r\nimport { getRootUrl } from \"../../../hooks/useApp\";\r\nimport DelayedLinearProgress from \"../../atoms/display/DelayedLinearProgress\";\r\nimport { useDevice } from \"../../../providers/DeviceContext\";\r\nimport { useContextId, useEntity, useEverything, useAccessLevel, useRTACProfile } from \"@emberly/dataplane\";\r\nimport useWindowSize from \"../../../hooks/useWindowSize\";\r\nimport usePlan from \"../../../hooks/usePlan\";\r\nimport { Link } from \"react-router-dom\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n root: {\r\n position: \"relative\",\r\n width: \"392px\",\r\n maxWidth: \"80vw\",\r\n maxHeight: \"80vh\",\r\n overflow: \"hidden\"\r\n },\r\n sectionTop: {\r\n width: \"100%\",\r\n padding: theme.spacing(3),\r\n paddingTop: theme.spacing(2),\r\n paddingBottom: theme.spacing(2)\r\n },\r\n sectionMiddle: {\r\n width: \"100%\",\r\n padding: theme.spacing(3),\r\n paddingTop: theme.spacing(2),\r\n paddingBottom: 0,\r\n },\r\n sectionBottom: {\r\n width: \"100%\",\r\n padding: theme.spacing(2),\r\n paddingBottom: theme.spacing(3)\r\n },\r\n sectionBottomPending: {\r\n width: \"100%\",\r\n padding: theme.spacing(2)\r\n },\r\n listHeader: {\r\n marginLeft: theme.spacing(2)\r\n },\r\n switch: {\r\n float: \"right\"\r\n },\r\n copyButton: {\r\n marginRight: theme.spacing(1),\r\n marginTop: theme.spacing(2)\r\n },\r\n selectContainer: {\r\n marginTop: theme.spacing(1),\r\n },\r\n peopleSelector: {\r\n marginTop: theme.spacing(1.5),\r\n marginBottom: theme.spacing(1)\r\n },\r\n select: {\r\n border: \"none !important\",\r\n height: \"100%\",\r\n marginRight: theme.spacing(1),\r\n marginLeft: theme.spacing(1),\r\n \"& svg\": {\r\n fontSize: \"16px\"\r\n },\r\n \"& div\": {\r\n paddingLeft: theme.spacing(0.5),\r\n }\r\n },\r\n divider: {\r\n marginBottom: theme.spacing(2)\r\n },\r\n email: {\r\n paddingRight: \"72px\",\r\n maxWidth: \"240px\",\r\n textOverflow: \"ellipsis\",\r\n overflow: \"hidden\"\r\n },\r\n watermarkInfoText: {\r\n \"& a\": {\r\n color: \"inherit\"\r\n }\r\n },\r\n descriptionForToggle: {\r\n maxWidth: \"calc(100% - 60px)\"\r\n }\r\n}));\r\n\r\n\r\n\r\nexport default function SharePanel() {\r\n const currentContextId = useContextId();\r\n const classes = useStyles();\r\n const { entity, loading: mapLoading } = useEntity(\"Map\", currentContextId, true, \"default\");\r\n const { entities: invites, collection: inviteCollection, loading: invitesLoading } = useEverything(\"Invite\");\r\n const { profile } = useRTACProfile();\r\n const dispatch = useDispatch();\r\n const [access, setAccess] = useState(1);\r\n const [emails, setEmails] = useState(\"\");\r\n const [shareText, setShareText] = useState(null);\r\n const accessLevel = useAccessLevel();\r\n const [hasInvalidEmail, setHasInvalidEmail] = useState(false);\r\n const { canDisableWatermarks } = usePlan();\r\n const isLoading = invitesLoading || mapLoading || !entity || !profile;\r\n const members = entity?.members || [];\r\n\r\n const pendingInvites = invites.filter(t => !t.declined && !t.accepted);\r\n const activeMembers = members.filter(t => t.access > 0);\r\n\r\n const { isMobilePortraitView } = useDevice();\r\n const showDescription = true; // TODODODODODODDO!!!!!!!!!!!!!!!!!!\r\n\r\n const canEditMap = accessLevel >= 4;\r\n const canInvite = accessLevel >= 3;\r\n\r\n \r\n const { height } = useWindowSize();\r\n\r\n const onCopy = useCallback((ev, value, isLink = false) => {\r\n\r\n if (!!ev) {\r\n ev.preventDefault();\r\n }\r\n\r\n const fn = async () => {\r\n try {\r\n if (navigator.share && isLink) {\r\n await navigator.share({\r\n title: `Emberly - ${entity?.name || \"Shared Map\"}`,\r\n url: value\r\n });\r\n } else if (navigator.clipboard) {\r\n await navigator.clipboard.writeText(value);\r\n dispatch(DisplayNotification(\"Copied to clipboard!\"));\r\n } else {\r\n setShareText(value);\r\n }\r\n\r\n } catch (err) {\r\n console.log(err);\r\n dispatch(DisplayNotification(\"Unable to access clipboard!\"));\r\n }\r\n };\r\n\r\n fn();\r\n }, [dispatch, entity]);\r\n\r\n const onSubmitInvites = () => {\r\n const list = emails.split(\",\").map(t => t.trim().toLowerCase());\r\n\r\n if (list.some(t => !validateEmail(t))) {\r\n console.log(\"list includes invalid emails\");\r\n setHasInvalidEmail(true);\r\n } else {\r\n setEmails(\"\");\r\n for (let i = 0; i < list.length; i++) {\r\n let email = list[i];\r\n\r\n if (!invites.some(t => t.email === email && !t.accepted && !t.declined) && !activeMembers.some(t => t.email === email)) { // TODO also check existing members\r\n inviteCollection.createEntity({\r\n email,\r\n access,\r\n contextName: entity.name,\r\n contextId: entity.id,\r\n username: profile.fullName,\r\n ownerPublicId: entity.publicUserId\r\n });\r\n } else {\r\n // member already invites\r\n console.log(\"member already invited\", email);\r\n }\r\n }\r\n }\r\n };\r\n\r\n const baseUrl = `${window.location.origin}${getRootUrl()}${showDescription ? \"?description=true\" : \"\"}`;\r\n\r\n return (\r\n <div className={isMobilePortraitView ? undefined : classes.root}>\r\n <Scrollbars autoHide hideTracksWhenNotNeeded autoHeight autoHeightMax={isMobilePortraitView ? height - 48 : Math.min(height * 0.8, 600)}>\r\n {isLoading ? <DelayedLinearProgress variant=\"indeterminate\" color=\"primary\" /> : null}\r\n\r\n <Grid container className={classes.sectionTop} direction=\"row\" justifyContent=\"space-between\" alignItems=\"center\">\r\n\r\n <Grid container item xs={12} className={classes.selectContainer} alignItems=\"center\">\r\n <Grid item>\r\n <Typography variant=\"subtitle1\">Share to web</Typography>\r\n </Grid>\r\n\r\n <Grid item xs>\r\n <StandardToggle\r\n className={classes.switch}\r\n checked={entity?.isPublic || false}\r\n onChange={val => entity?.setIsPublic(val)}\r\n color=\"secondary\"\r\n disabled={isLoading || !canEditMap}\r\n />\r\n </Grid>\r\n </Grid>\r\n\r\n {\r\n entity?.isPublic ? (\r\n <>\r\n <Grid item xs={12}>\r\n <Typography variant=\"body2\" className={classes.descriptionForToggle}>\r\n Your map is currently visible to anyone with the link. No sign-in required.\r\n </Typography>\r\n </Grid>\r\n\r\n <Grid item xs={12}>\r\n <Button\r\n component=\"a\"\r\n href={baseUrl}\r\n color=\"primary\"\r\n className={classes.copyButton}\r\n startIcon={<LinkIcon />}\r\n onClick={(ev) => onCopy(ev, baseUrl, true)}\r\n >\r\n Get link\r\n </Button>\r\n <Button\r\n color=\"primary\"\r\n className={classes.copyButton}\r\n startIcon={<CodeIcon />}\r\n onClick={(ev) => onCopy(ev, `<iframe width=\"640\" height=\"400\" src=\"${baseUrl}\" frameBorder=\"0\"></iframe>`)}\r\n >\r\n Get embed code\r\n </Button>\r\n </Grid>\r\n\r\n {!!shareText ? (\r\n <Grid item xs={12}>\r\n <TextField\r\n value={shareText}\r\n fullWidth\r\n />\r\n </Grid>\r\n ) : null}\r\n\r\n <Grid container item xs={12} className={classes.selectContainer} alignItems=\"center\">\r\n <Grid item>\r\n <Typography variant=\"body1\">Allow duplicating</Typography>\r\n </Grid>\r\n\r\n <Grid item xs>\r\n <StandardToggle\r\n className={classes.switch}\r\n checked={entity?.duplicateEnabled || false}\r\n onChange={val => entity?.setDuplicateEnabled(val)}\r\n color=\"secondary\"\r\n disabled={!canEditMap}\r\n />\r\n </Grid>\r\n </Grid>\r\n\r\n <Grid container item xs={12} className={classes.selectContainer} alignItems=\"center\">\r\n <Grid item>\r\n <Typography variant=\"body1\">Watermark in embed</Typography>\r\n {!canDisableWatermarks ? <Typography className={classes.watermarkInfoText} variant=\"caption\" color=\"textSecondary\">Can only be disabled with a <Link to=\"/app/settings/plans\">paid plan.</Link></Typography> : null}\r\n </Grid>\r\n\r\n <Grid item xs>\r\n <StandardToggle\r\n className={classes.switch}\r\n checked={entity?.watermarkEnabled || false}\r\n onChange={val => entity?.setWatermarkEnabled(val)}\r\n color=\"secondary\"\r\n disabled={!canEditMap || !canDisableWatermarks}\r\n />\r\n </Grid>\r\n </Grid>\r\n </>\r\n ) : (\r\n <Grid item xs={12}>\r\n <Typography variant=\"body2\">\r\n Your map is currently not shared publicly.\r\n </Typography>\r\n </Grid>\r\n )\r\n }\r\n\r\n </Grid>\r\n\r\n <Divider />\r\n\r\n <Grid container className={classes.sectionMiddle} direction=\"row\" justifyContent=\"space-between\" alignItems=\"center\">\r\n <Grid item xs={12}>\r\n <Typography variant=\"subtitle1\">Invite people</Typography>\r\n </Grid>\r\n\r\n\r\n <Grid item xs={12}>\r\n <StandardInputSelect\r\n className={classes.peopleSelector}\r\n placeholder=\"Email, comma seperated\"\r\n selectValue={access}\r\n value={emails}\r\n onChange={(a, b) => ((setEmails(a), setAccess(b), setHasInvalidEmail(false)))}\r\n disabled={isLoading || !canInvite}\r\n helperText={hasInvalidEmail ? \"The field contains invalid email(s)\" : undefined}\r\n error={hasInvalidEmail}\r\n >\r\n {accessLevel >= 1 ? <MenuItem value={1}>can view</MenuItem> : null}\r\n {accessLevel >= 2 ? <MenuItem value={2}>can edit</MenuItem> : null}\r\n {accessLevel >= 3 ? <MenuItem value={3}>can invite</MenuItem> : null}\r\n </StandardInputSelect>\r\n </Grid>\r\n\r\n\r\n <Grid item xs={12}>\r\n <Button fullWidth variant=\"contained\" color=\"primary\" disabled={!emails || isLoading || !canInvite} onClick={onSubmitInvites}>\r\n Add people\r\n </Button>\r\n </Grid>\r\n\r\n\r\n </Grid>\r\n\r\n\r\n {\r\n pendingInvites.length !== 0 ? (\r\n <>\r\n <List className={classes.sectionBottomPending} subheader={<Typography className={classes.listHeader} variant=\"body2\">Pending invites</Typography>}>\r\n {pendingInvites.map((invite, i) => (\r\n <InviteItem key={i} email={invite.rawEmail} access={invite.access} invite={invite} myAccessLevel={accessLevel} profile={profile} />\r\n ))}\r\n </List>\r\n <Divider className={classes.divider} />\r\n </>\r\n ) : null\r\n }\r\n\r\n <List className={classes.sectionBottom} subheader={<Typography className={classes.listHeader} variant=\"body2\">Members</Typography>}>\r\n {activeMembers.map((member, i) => (\r\n <InviteItem key={i} email={member.email} access={member.access} member={member} map={entity} myAccessLevel={accessLevel} profile={profile} />\r\n ))}\r\n </List>\r\n\r\n </Scrollbars>\r\n </div>\r\n );\r\n}\r\n\r\n\r\nfunction InviteItem(props) {\r\n const { email, access, myAccessLevel, invite, member, profile, map } = props; // TODO\r\n const isOwner = access === 4;\r\n const isAdmin = myAccessLevel >= 3;\r\n const classes = useStyles();\r\n const isSelf = member?.publicUserId === profile.publicId\r\n\r\n const onChange = (ev) => {\r\n const val = ev.target.value;\r\n\r\n if (invite) {\r\n if (val === 0) {\r\n invite.delete();\r\n } else {\r\n invite.setAccess(val);\r\n }\r\n } else if (member && map) {\r\n map.setMemberAccess(member.publicUserId, val);\r\n }\r\n }\r\n\r\n return (\r\n <ListItem secondaryAction={\r\n <Select className={classes.select} variant=\"standard\" disableUnderline IconComponent={ExpandIcon} onChange={onChange} value={access} disabled={isOwner || !isAdmin}>\r\n <MenuItem value={0} disabled={!isAdmin}>{!!invite ? \"cancel invite\" : \"remove member\"}</MenuItem>\r\n <MenuItem value={1} disabled={!isAdmin}>can view</MenuItem>\r\n <MenuItem value={2} disabled={!isAdmin}>can edit</MenuItem>\r\n <MenuItem value={3} disabled={!isAdmin}>can invite</MenuItem>\r\n <MenuItem value={4} disabled>owner</MenuItem>\r\n </Select>\r\n }>\r\n\r\n <ListItemIcon>\r\n <PersonIcon />\r\n </ListItemIcon>\r\n\r\n <ListItemText primary={\r\n <Typography variant=\"body2\" className={classes.email}>\r\n {isSelf ? \"You\" : email}\r\n </Typography>\r\n } />\r\n\r\n </ListItem>\r\n );\r\n}\r\n\r\n\r\nfunction validateEmail(email) {\r\n // eslint-disable-next-line no-useless-escape\r\n const re = /^(([^<>()[\\]\\\\.,;:\\s@\\\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\\\"]+)*)|(\\\".+\\\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\r\n return re.test(email);\r\n}","import { useCallback, useState, useEffect, useRef } from \"react\";\r\nimport { IconButton, Paper, Popover, Tooltip, Portal } from \"@mui/material\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport { PersonAddOutlined as PersonAddIcon, PeopleOutline as PeopleIcon, Public as PublicIcon } from \"@mui/icons-material\";\r\nimport SharePanel from \"../panels/SharePanel\";\r\nimport CardHeader from \"../../atoms/CardHeader\";\r\nimport { useDevice } from \"../../../providers/DeviceContext\";\r\nimport { useContextId, useEntity } from \"@emberly/dataplane\";\r\nimport { useLocation } from \"react-router\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n iconButton: {\r\n borderRadius: 0,\r\n color: theme.palette.neutral.button\r\n },\r\n paperMobile: {\r\n position: \"absolute\",\r\n top: 0,\r\n left: 0,\r\n width: \"100%\",\r\n height: \"100%\",\r\n zIndex: 100,\r\n background: theme.palette.background.paper\r\n },\r\n activeIcon: {\r\n color: theme.palette.primary.main\r\n },\r\n}));\r\n\r\nconst anchorOrigin = {\r\n vertical: \"bottom\",\r\n horizontal: \"center\",\r\n};\r\n\r\nconst anchorOriginSlim = {\r\n vertical: \"top\",\r\n horizontal: \"right\",\r\n}\r\n\r\nconst transformOrigin = {\r\n vertical: \"top\",\r\n horizontal: \"center\",\r\n};\r\n\r\nconst paperProps = {\r\n style: {\r\n marginTop: \"8px\",\r\n marginLeft: \"0px\"\r\n }\r\n};\r\n\r\nexport default function ShareController(props) {\r\n const { slimMode } = props;\r\n const classes = useStyles();\r\n const [anchorEl, setAnchorEl] = useState(null);\r\n const contextId = useContextId();\r\n const { entity } = useEntity(\"Map\", contextId, true, \"default\");\r\n const { isMobilePortraitView } = useDevice();\r\n const anchorRef = useRef(anchorEl);\r\n anchorRef.current = anchorEl;\r\n\r\n const location = useLocation();\r\n\r\n useEffect(() => {\r\n if (!!anchorRef.current && isMobilePortraitView) {\r\n setAnchorEl(null);\r\n }\r\n }, [location.pathname, isMobilePortraitView]);\r\n\r\n\r\n const onSharePanelClick = useCallback((ev) => setAnchorEl(ev.currentTarget), []);\r\n const onSharePanelClose = useCallback(() => setAnchorEl(null), []);\r\n\r\n const sharePanelOpen = !!anchorEl;\r\n const sharePanelId = sharePanelOpen ? \"share-panel\" : undefined;\r\n\r\n return <>\r\n <Tooltip title=\"Share menu\" enterDelay={500} placement={slimMode ? \"left\" : undefined}>\r\n <IconButton\r\n className={`${classes.iconButton} ${sharePanelOpen ? classes.activeIcon : \"\"} share-controller`}\r\n onClick={onSharePanelClick}\r\n size=\"large\">\r\n {entity?.isPublic ? <PublicIcon /> : (entity?.members?.length > 1 ? <PeopleIcon /> : <PersonAddIcon />)}\r\n </IconButton>\r\n </Tooltip>\r\n {isMobilePortraitView ? (\r\n sharePanelOpen ? (\r\n <Portal>\r\n <Paper className={classes.paperMobile}>\r\n <CardHeader\r\n title=\"Share\"\r\n onBack={onSharePanelClose}\r\n border\r\n />\r\n <SharePanel />\r\n </Paper>\r\n </Portal>\r\n ) : null\r\n ) : (\r\n\r\n <Popover\r\n id={sharePanelId}\r\n anchorEl={anchorEl}\r\n open={sharePanelOpen}\r\n onClose={onSharePanelClose}\r\n anchorOrigin={anchorOrigin}\r\n transformOrigin={slimMode ? anchorOriginSlim : transformOrigin}\r\n PaperProps={paperProps}\r\n >\r\n <SharePanel />\r\n </Popover>\r\n )\r\n }\r\n </>;\r\n}","import { FetchSuggestedTopics } from \"../api/tree\";\r\n\r\n\r\nexport function stripEmoji(str) {\r\n return str.replace(/([\\u2700-\\u27BF]|[\\uE000-\\uF8FF]|\\uD83C[\\uDC00-\\uDFFF]|\\uD83D[\\uDC00-\\uDFFF]|[\\u2011-\\u26FF]|\\uD83E[\\uDD10-\\uDDFF])/g, \"\");\r\n}\r\n\r\nexport function stripSource(source) {\r\n try {\r\n if (source.startsWith(\"https://\") || source.startsWith(\"http://\")) {\r\n let url = (new URL(source)).hostname;\r\n return url.startsWith(\"www.\") ? url.substr(4) : url;\r\n } else {\r\n return source;\r\n }\r\n } catch (err) {\r\n return source;\r\n }\r\n}\r\n\r\n\r\nexport function verifyEntities(list) {\r\n\r\n console.log(\"running verify\");\r\n const parents = new Map();\r\n const collisions = new Set();\r\n\r\n list.forEach(t => {\r\n\r\n if (!parents.has(t.parentId)) {\r\n parents.set(t.parentId, new Set());\r\n }\r\n\r\n let parent = parents.get(t.parentId);\r\n\r\n if (parent.has(t.index)) {\r\n console.log(\"collision\", t.index, parent, t.parentId, t.name);\r\n collisions.add(t.parentId);\r\n } else {\r\n parent.add(t.index);\r\n }\r\n });\r\n\r\n\r\n collisions.forEach(parentId => {\r\n console.log(\"collisions for\", parentId);\r\n const children = list.filter(t => t.parentId === parentId);\r\n console.log(children.map(t => `${t.side} => ${t.index}`));\r\n });\r\n}\r\n\r\nexport async function fetchSuggestedTopics(nodeCollection, nodeId) {\r\n const entity = nodeCollection.getEntityById(nodeId);\r\n entity.updatePath();\r\n let path = entity.isRoot ? [...entity.path] : [...entity.path, entity.name]\r\n let topic = entity.isRoot ? null : entity.name;\r\n\r\n if (path.length > 3) {\r\n path = path.filter((_, i) => i > path.length - 4);\r\n }\r\n else if (path.length < 3) {\r\n const rootEntity = nodeCollection.root;\r\n const useRootTitle = rootEntity.name.startsWith(\"TXT://\") && rootEntity.name !== \"TXT://New Map\" && rootEntity.side === 0;\r\n const useBranchRootTitle = !useRootTitle && rootEntity.side !== 0;\r\n const title = useBranchRootTitle ? null : useRootTitle ? rootEntity.name.substr(6) : await fetchMapName(nodeCollection);\r\n if (!!title && (title !== \"New Map\" || path.length === 0)) {\r\n path = [title, ...path];\r\n }\r\n if (!topic) {\r\n topic = title;\r\n }\r\n }\r\n\r\n const branch = { name: path[0], children: [] }\r\n let buffer = branch;\r\n\r\n for (let i = 1; i < path.length; i++) {\r\n const node = { name: path[i], children: null };\r\n buffer.children = [node];\r\n buffer = node;\r\n }\r\n\r\n const children = nodeCollection.getChildren(nodeId).filter((_, i) => i < 10);\r\n buffer.children = children.map(child => ({ name: child.name, children: [] }));\r\n //console.log(path);\r\n //console.log(JSON.stringify(branch,0,2), topic);\r\n\r\n try {\r\n const data = await FetchSuggestedTopics(topic, branch, children.length !== 0);\r\n return data?.suggestions;\r\n } catch {\r\n return [];\r\n }\r\n}\r\n\r\nasync function fetchMapName(nodeCollection) {\r\n const mapCollection = await nodeCollection.context.getCollectionInContext(\"Map\", \"default\");\r\n try {\r\n await mapCollection.loadEntity(nodeCollection.contextId);\r\n const map = mapCollection?.getEntityById(nodeCollection.contextId);\r\n return map.name === \"New Map\" ? \"Common Mind-map topics\" : map.name;\r\n } finally {\r\n mapCollection.unloadEntity(nodeCollection.contextId);\r\n }\r\n}\r\n\r\n\r\nexport function hexToRGB(hex) {\r\n return parseInt(hex.startsWith(\"#\") ? hex.substr(1) : hex, 16);\r\n}\r\n\r\n\r\nexport function findVisibleNoteBlocks() {\r\n return [...document.querySelectorAll(\".ce-block\")].filter(el => isScrolledIntoView(el)).map(t => t.id).filter(t => !!t);\r\n}\r\n\r\nfunction isScrolledIntoView(el) {\r\n const rect = el.getBoundingClientRect();\r\n const elemTop = rect.top;\r\n const elemBottom = rect.bottom;\r\n\r\n // Only completely visible elements return true:\r\n const isVisible = (elemTop >= 0) && (elemBottom <= window.innerHeight);\r\n // Partially visible elements return true:\r\n //isVisible = elemTop < window.innerHeight && elemBottom >= 0;\r\n return isVisible && window.getComputedStyle(el).visibility !== \"hidden\";\r\n}\r\n\r\n\r\n\r\nexport async function getNodeByParentId(context, parentId) {\r\n const nodes = context.getCollection(\"Node\");\r\n\r\n if (!parentId) return nodes.root;\r\n\r\n if (parentId.startsWith(\"node-\")) {\r\n return nodes.getEntityById(parentId.substr(5));\r\n }\r\n\r\n if (parentId.startsWith(\"resource-\")) {\r\n const resources = context.getCollection(\"Resource\");\r\n\r\n const resourceId = parentId.substr(9);\r\n const resource = resources.getEntityById(resourceId);\r\n\r\n return !!resource ? nodes.getEntityById(resource.parentId) : null;\r\n }\r\n\r\n return nodes.root;\r\n}\r\n\r\n\r\nexport async function addListItemsToMap(collection, parentNode, list) {\r\n if (!parentNode) return;\r\n\r\n for (let i = 0; i < list.length; i++) {\r\n const item = list[i];\r\n\r\n if (typeof item === \"string\") {\r\n // add item directly\r\n await collection.createEntity({\r\n \"name\": sanitizeNodeName(item),\r\n \"parentId\": parentNode.id\r\n });\r\n } else {\r\n const node = await collection.createEntity({\r\n \"name\": sanitizeNodeName(item.content),\r\n \"parentId\": parentNode.id\r\n });\r\n\r\n if (item.items?.length > 0) {\r\n await addListItemsToMap(collection, node, item.items);\r\n }\r\n }\r\n }\r\n}\r\n\r\n\r\nfunction sanitizeNodeName(name) {\r\n if (!name || typeof name !== \"string\") return \"New Topic\";\r\n\r\n const sanitized = name.replace(/(<([^>]+)>)/ig, \"\");\r\n\r\n if (sanitized.length > 128) {\r\n return sanitized.substring(0,128);\r\n }\r\n\r\n return sanitized;\r\n}","import axios from \"axios\";\r\nimport { Retry } from \"@emberly/dataplane\";\r\n\r\n\r\nexport async function FetchSuggestedTopics(topic, branch, hasChildren) {\r\n const result = await Retry.Axios(async () => await axios.post(`/api/node/context/suggestions`, { topic, branch, hasChildren }));\r\n return result.data;\r\n}","import { useCallback, useMemo, useState } from \"react\";\r\nimport { Chip, Grid } from \"@mui/material\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport { ReactEditorBlock } from \"@emberly/editor\";\r\nimport { useEntities } from \"@emberly/dataplane\";\r\nimport { useHistory } from \"react-router\";\r\nimport { useDispatch } from \"react-redux\";\r\nimport { DisplayNotification, SetContextCard, SetNodeViewTabIndex } from \"../../../../actions/app\";\r\nimport { FormatQuote as QuoteIcon, Add as AddIcon, Check as CheckIcon, Undo as UndoIcon } from \"@mui/icons-material\";\r\nimport { getNodeByParentId, addListItemsToMap } from \"../../../../common/common\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n root: {\r\n position: \"relative\",\r\n width: \"100%\",\r\n marginBottom: theme.spacing(4),\r\n \"& div\": {\r\n position: \"relative\"\r\n }\r\n },\r\n bubble: {\r\n background: theme.palette.common.npcChatBubble,\r\n padding: theme.spacing(2),\r\n borderRadius: \"16px 16px 16px 0px\",\r\n maxWidth: \"calc(100% - 32px)\",\r\n whiteSpace: \"normal\",\r\n wordWrap: \"break-word\",\r\n \"&:has(.codeflask)\": {\r\n width: \"calc(100% - 32px)\"\r\n },\r\n \"& .ce-block:not(:last-child)\": {\r\n marginBottom: theme.spacing(1)\r\n }\r\n },\r\n bubbleEditMode: {\r\n opacity: 0.5\r\n },\r\n break: {\r\n flexBasis: \"100%\",\r\n height: 0\r\n },\r\n chip: {\r\n maxWidth: \"calc(100% - 32px)\",\r\n marginTop: theme.spacing(0.5),\r\n marginRight: theme.spacing(0.5),\r\n \"& .MuiChip-label\": {\r\n paddingLeft: theme.spacing(1)\r\n }\r\n },\r\n buttonContainer: {\r\n minHeight: \"30px\"\r\n }\r\n}));\r\n\r\nexport default function AdvisorBubble(props) {\r\n const classes = useStyles();\r\n const history = useHistory();\r\n const dispatch = useDispatch();\r\n const { message, groupUrl, parentId, canEdit, context, isMobilePortraitView, isLast, editMode, onClose, className, canUseButtons } = props;\r\n const [triggered, setTriggered] = useState(message.schemas?.triggered || false);\r\n\r\n const { nodeIds, resourceIds, blocksMemo, hasExecutor, hasList } = useMemo(() => {\r\n const blocksParsed = JSON.parse(message.blocks);\r\n const hasList = !!blocksParsed.find(t => t.type === \"list\");\r\n\r\n return {\r\n nodeIds: message.sourceIds\r\n .filter(t => t.startsWith(\"node-\"))\r\n .map(t => t.substring(5)),\r\n resourceIds: message.sourceIds\r\n .filter(t => t.startsWith(\"resource-\"))\r\n .map(t => t.substr(9)),\r\n blocksMemo: blocksParsed,\r\n hasExecutor: !!message.schemas,\r\n hasList\r\n };\r\n }, [message]);\r\n\r\n\r\n const { entities: nodes } = useEntities(\"Node\", nodeIds);\r\n const { entities: resources } = useEntities(\"Resource\", resourceIds);\r\n\r\n const addToNotes = useCallback(async () => {\r\n\r\n const collection = context.getCollection(\"Note\");\r\n\r\n for (let i = 0; i < blocksMemo.length; i++) {\r\n const block = blocksMemo[i];\r\n\r\n const data = {\r\n type: block.type,\r\n data: block.data,\r\n parentId: parentId,\r\n references: []\r\n };\r\n\r\n await collection?.createEntity(data, { sync: true, historyGroup: parentId });\r\n dispatch(SetNodeViewTabIndex(1));\r\n dispatch(DisplayNotification(`Reply copied to current notes`));\r\n }\r\n\r\n }, [blocksMemo, parentId, context, dispatch]);\r\n\r\n\r\n const addListToMap = useCallback(async () => {\r\n \r\n dispatch(DisplayNotification(`Adding list to map..`));\r\n const parentNode = await getNodeByParentId(context, parentId);\r\n const listBlocks = blocksMemo.filter(t => t.type === \"list\");\r\n const collection = context.getCollection(\"Node\");\r\n\r\n for (let i = 0; i < listBlocks.length; i++) {\r\n const block = listBlocks[i];\r\n await addListItemsToMap(collection, parentNode, block.data.items);\r\n }\r\n \r\n dispatch(DisplayNotification(`List added to map`));\r\n\r\n }, [blocksMemo, context, parentId, dispatch]);\r\n\r\n\r\n const executeOperations = useCallback(() => {\r\n if (triggered) {\r\n setTriggered(false);\r\n message.schemas.undo(parentId);\r\n } else {\r\n setTriggered(true);\r\n message.schemas.execute(parentId);\r\n }\r\n }, [parentId, message, triggered]);\r\n\r\n\r\n return (\r\n <Grid item container xs={12} direction=\"row\" alignItems=\"flex-end\" justifyContent={\"flex-start\"} className={`${classes.root} ${className || \"\"}`} spacing={0}>\r\n <div variant=\"body1\" className={`${classes.bubble} ${editMode && isLast ? classes.bubbleEditMode : \"\"}`} component=\"div\">\r\n {\r\n useMemo(() =>\r\n blocksMemo.map((block, index) => (\r\n <ReactEditorBlock\r\n key={index}\r\n block={block}\r\n allowLinks\r\n />\r\n )), [blocksMemo])\r\n }\r\n {useMemo(() => !!hasExecutor ? (<ReactEditorBlock block={message.schemas.summary} />) : null, [hasExecutor, message])}\r\n </div>\r\n\r\n {canUseButtons ? (\r\n\r\n <Grid item container xs={12} className={classes.buttonContainer}>\r\n\r\n {\r\n !!canEdit && !!hasExecutor ? (\r\n <Chip\r\n label={triggered ? \"Undo changes\" : \"Accept changes\"}\r\n icon={triggered ? <UndoIcon fontSize=\"small\" /> : <CheckIcon fontSize=\"small\" />}\r\n variant=\"outlined\"\r\n color=\"primary\"\r\n className={classes.chip}\r\n onClick={executeOperations}\r\n />\r\n ) : null\r\n }\r\n {\r\n !!canEdit && !!parentId && !hasExecutor ? (\r\n <Chip\r\n label=\"Add to notes\"\r\n icon={<AddIcon fontSize=\"small\" />}\r\n variant=\"outlined\"\r\n color=\"primary\"\r\n className={classes.chip}\r\n onClick={addToNotes}\r\n />\r\n ) : null\r\n }\r\n {\r\n !!canEdit && !hasExecutor && hasList ? (\r\n <Chip\r\n label=\"Add list to map\"\r\n icon={<AddIcon fontSize=\"small\" />}\r\n variant=\"outlined\"\r\n color=\"primary\"\r\n className={classes.chip}\r\n onClick={addListToMap}\r\n />\r\n ) : null\r\n }\r\n {\r\n nodes.map((n, i) => (\r\n <Chip\r\n key={i}\r\n variant=\"outlined\"\r\n className={classes.chip}\r\n label={n.name}\r\n icon={<QuoteIcon fontSize=\"small\" />}\r\n color=\"primary\"\r\n onClick={() => {\r\n dispatch(SetNodeViewTabIndex(1));\r\n history.push({ pathname: `${groupUrl}/node/${n.id}`, search: window.location.search, hash: `#panto=${n.id}` });\r\n if (isMobilePortraitView) {\r\n dispatch(SetContextCard(3));\r\n onClose();\r\n }\r\n }} />\r\n ))\r\n }\r\n {\r\n resources.map((r, i) => (\r\n <Chip\r\n key={i}\r\n variant=\"outlined\"\r\n className={classes.chip}\r\n label={r.name}\r\n icon={<QuoteIcon fontSize=\"small\" />}\r\n color=\"primary\"\r\n onClick={() => {\r\n dispatch(SetNodeViewTabIndex(1));\r\n history.push({ pathname: `${groupUrl}/resource/${r.id}`, search: window.location.search, hash: `#panto=${r.parentId}` });\r\n }} />\r\n ))\r\n }\r\n </Grid>\r\n\r\n ) : null}\r\n </Grid>\r\n )\r\n}","import React from \"react\";\r\n\r\nexport default class ErrorBoundary extends React.Component {\r\n constructor(props) {\r\n super(props);\r\n this.state = { hasError: false };\r\n }\r\n\r\n static getDerivedStateFromError(error) {\r\n // Update state so the next render will show the fallback UI.\r\n return { hasError: true };\r\n }\r\n\r\n componentDidCatch(error, errorInfo) {\r\n // You can also log the error to an error reporting service\r\n console.log(error, errorInfo);\r\n }\r\n\r\n render() {\r\n if (this.state.hasError) {\r\n // You can render any custom fallback UI\r\n return null;\r\n }\r\n\r\n return this.props.children; \r\n }\r\n}","import { hexToRGB } from \"../../../../../common/common\";\r\nimport { Entity } from \"@emberly/dataplane\";\r\n\r\n\r\n\r\nexport default class SchemaExecutor {\r\n\r\n constructor(operations, context) {\r\n this.id = Entity.MakeId();\r\n this.operations = operations;\r\n this.context = context;\r\n this.summary = this.makeSummary();\r\n this.idMap = new Map();\r\n this.inverseIdMap = new Map();\r\n this.nodeCollection = this.context.getCollection(\"Node\");\r\n this.noteCollection = this.context.getCollection(\"Note\");\r\n this.triggered = false;\r\n this.firstNodeId = null;\r\n }\r\n\r\n async execute(parentId) {\r\n this.triggered = true;\r\n this.idMap.clear();\r\n this.inverseIdMap.clear();\r\n const validParentId = this.parseResourceParentId(parentId);\r\n this.remapIds(validParentId);\r\n\r\n for (let i = 0; i < this.operations.length; i++) {\r\n const operation = this.operations[i];\r\n switch (operation.schema) {\r\n case \"Node\":\r\n await this.processNodeUpdate(operation, validParentId);\r\n break;\r\n case \"Note\":\r\n await this.processNoteUpdate(operation, validParentId);\r\n break;\r\n default:\r\n console.log(\"Unknown Schema\", operation.schema);\r\n }\r\n }\r\n }\r\n\r\n remapIds(validParentId) {\r\n // TODO!!\r\n\r\n for (let i = 0; i < this.operations.length; i++) {\r\n const data = this.operations[i];\r\n if (!!data) {\r\n data.id = this.remapId(data.id, validParentId);\r\n data.parentId = this.remapParentId(data.parentId, validParentId);\r\n }\r\n }\r\n }\r\n\r\n\r\n remapParentId(id, validParentId) {\r\n if (!!id) {\r\n if (this.idMap.has(id)) return id;\r\n if (this.inverseIdMap.has(id)) return this.inverseIdMap.get(id);\r\n\r\n const entity = this.nodeCollection.getEntityById(id);\r\n if (!entity || entity?._deleted) {\r\n const newId = validParentId;\r\n this.idMap.set(newId, id);\r\n this.inverseIdMap.set(id, newId);\r\n return newId;\r\n }\r\n }\r\n return id;\r\n }\r\n\r\n\r\n remapId(id) {\r\n if (!!id) {\r\n if (this.idMap.has(id)) return id;\r\n if (this.inverseIdMap.has(id)) return this.inverseIdMap.get(id);\r\n\r\n const entity = this.nodeCollection.getEntityById(id);\r\n const newId = !!entity && !entity._deleted ? entity.id : Entity.MakeId(); \r\n this.idMap.set(newId, id);\r\n this.inverseIdMap.set(id, newId);\r\n return newId;\r\n }\r\n return id;\r\n }\r\n\r\n\r\n async processNodeUpdate(data, parentId) {\r\n const node = this.nodeCollection.getEntityById(data.id);\r\n\r\n if (!!node && !node?._deleted) {\r\n // update\r\n\r\n if (!!data.name) {\r\n node.setName(data.name, { historyGroup: this.id});\r\n //console.log(\"set node name\", data.name, \"old name\", node.name);\r\n }\r\n\r\n if (!!data.color) {\r\n const newColor = hexToRGB(data.color);\r\n node.setColor(newColor, { historyGroup: this.id});\r\n //console.log(\"set node color\", newColor, \"old color\", node.color);\r\n }\r\n\r\n if (!!data.parentId && data.parentId !== node.parentId && this.validParentExists(node, data.parentId, this.nodeCollection)) {\r\n node.setParentId(data.parentId, { historyGroup: this.id});\r\n //console.log(\"set node parent\", data.parentId, \"old parent\", node.parentId);\r\n }\r\n this.firstNodeId = node.id;\r\n } else {\r\n // create\r\n /*\r\n console.log(\"create node\", data);\r\n */\r\n await this.nodeCollection.createEntity(\r\n {\r\n \"id\": data.id,\r\n \"name\": data.name,\r\n \"parentId\": this.fetchValidParent(data, this.nodeCollection, parentId),\r\n \"color\": !!data.color ? hexToRGB(data.color) : undefined,\r\n \"rating\": 0,\r\n \"state\": 0,\r\n \"side\": 0,\r\n },\r\n {\r\n historyGroup: this.id\r\n }\r\n );\r\n\r\n this.firstNodeId = data.id;\r\n }\r\n\r\n // process the fields and check if match, esp color.\r\n }\r\n\r\n fetchValidParent(data, collection, parentId) {\r\n if (!!data.parentId) {\r\n const parent = collection.getEntityById(data.parentId);\r\n if (!!parent) {\r\n // if root\r\n if ((!parent.parentId && parent.side === 0) || !!parent.parentId) return parent.id;\r\n }\r\n }\r\n\r\n if (!!parentId) return parentId;\r\n\r\n const root = collection.root;\r\n\r\n if (root.side === 0) return root.id;\r\n\r\n const rootChildren = collection.getChildren(root.id);\r\n\r\n if (rootChildren.length === 0) return root.id;\r\n\r\n return rootChildren[0].id;\r\n }\r\n\r\n\r\n validParentExists(node, parentId, collection) {\r\n const parent = collection.getEntityById(parentId);\r\n if (!parent) return false;\r\n if (parent.side !== 0 && !parent.parentId) return false;\r\n return collection.isValidParent(node, parentId);\r\n }\r\n\r\n parseResourceParentId(id) {\r\n if (id.startsWith(\"node-\")) return id.substring(5);\r\n\r\n if (id.startsWith(\"resource-\")) {\r\n const resourceId = id.substring(9);\r\n const resource = this.context.getCollection(\"Resource\").getEntityById(resourceId);\r\n if (!!resource) return resource.parentId;\r\n }\r\n\r\n return this.nodeCollection?.root?.id || id;\r\n }\r\n\r\n\r\n async processNoteUpdate(data, parentId) {\r\n \r\n if (!data.blocks) return;\r\n\r\n const blocks = JSON.parse(data.blocks);\r\n const validParentId = !!data.parentId ? data.parentId : parentId;\r\n const verifiedParentId = !!this.nodeCollection.getEntityById(validParentId) ? validParentId : this.firstNodeId;\r\n\r\n if (!!verifiedParentId) {\r\n // create\r\n for (let i = 0; i < blocks.length; i++) {\r\n const block = blocks[i];\r\n await this.noteCollection.createEntity({\r\n parentId: `node-${validParentId}`,\r\n references: [],\r\n type: block.type,\r\n data: block.data\r\n });\r\n }\r\n\r\n }\r\n }\r\n\r\n undo() {\r\n this.triggered = false;\r\n this.nodeCollection.undo(this.id);\r\n this.noteCollection.undo(this.id);\r\n }\r\n\r\n makeSummary() {\r\n\r\n return {\r\n type: \"table\",\r\n data: {\r\n withHeadings: false,\r\n content: [\r\n [\"<b>Data</b>\", \"<b>Changes</b>\"], // headings\r\n [\"Topics\", \"\" + this.operations.reduce((acc, op) => acc + (op.schema === \"Node\" ? 1 : 0), 0)],\r\n [\"Notes\", \"\" + this.operations.reduce((acc, op) => acc + (op.schema === \"Note\" ? 1 : 0), 0)]\r\n ]\r\n }\r\n };\r\n }\r\n\r\n}\r\n","import { Grid, IconButton, Tooltip, Typography } from \"@mui/material\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport { Replay as ReplayIcon, DeleteOutline as DeleteIcon, EditOutlined as EditIcon, CancelScheduleSend as CancelScheduleSendIcon } from \"@mui/icons-material\";\r\n\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n root: {\r\n position: \"relative\",\r\n width: \"100%\",\r\n \"& div\": {\r\n position: \"relative\"\r\n },\r\n \"&:hover .button-container\": {\r\n opacity: 1\r\n }\r\n },\r\n playerBubble: {\r\n background: theme.palette.common.playerChatBubble,\r\n padding: theme.spacing(2),\r\n borderRadius: \"16px 0px 16px 16px\",\r\n maxWidth: \"calc(100% - 160px)\",\r\n whiteSpace: \"normal\",\r\n wordWrap: \"break-word\",\r\n \"@media (max-width: 500px)\": {\r\n maxWidth: \"calc(100% - 96px)\"\r\n }\r\n },\r\n playerBubbleEditMode: {\r\n opacity: 0.5\r\n },\r\n avatar: {\r\n width: \"64px\",\r\n height: \"64px\",\r\n borderRadius: \"16px\",\r\n marginRight: theme.spacing(2)\r\n },\r\n iconButtonContainer: {\r\n minHeight: \"30px\",\r\n marginTop: theme.spacing(0.5),\r\n opacity: 1,\r\n transition: \"opacity 0.25s\",\r\n \"@media not all and (hover: none)\": {\r\n opacity: 0\r\n }\r\n },\r\n iconButtonContainerHidden: {\r\n opacity: \"0 !important\"\r\n },\r\n iconButton: {\r\n borderRadius: \"50%\",\r\n color: theme.palette.text.secondary\r\n }\r\n}));\r\n\r\nexport default function PlayerBubble(props) {\r\n const { text, className, onDeleteMessage, onEditMessage, onRetryMessage, messageOperations, isWriting, isLast, editMode } = props;\r\n const classes = useStyles();\r\n\r\n return (\r\n <Grid item container xs={12} direction=\"row\" alignItems=\"flex-end\" justifyContent={\"flex-end\"} className={`${classes.root} ${className || \"\"}`} spacing={0}>\r\n\r\n <Typography variant=\"body1\" className={`${classes.playerBubble} ${editMode && isLast ? classes.playerBubbleEditMode : \"\"}`} component=\"div\">\r\n {text}\r\n </Typography>\r\n\r\n <Grid item container justifyContent=\"flex-end\" className={`${classes.iconButtonContainer} button-container ${!isLast ? classes.iconButtonContainerHidden : \"\"}`}>\r\n\r\n {!isWriting && isLast ? (\r\n <>\r\n <Tooltip title=\"Replay message\" enterDelay={500}>\r\n <IconButton\r\n className={classes.iconButton}\r\n size=\"small\"\r\n onClick={onRetryMessage}\r\n >\r\n <ReplayIcon fontSize=\"small\" />\r\n </IconButton>\r\n </Tooltip>\r\n\r\n <Tooltip title=\"Edit message\" enterDelay={500}>\r\n <IconButton\r\n className={classes.iconButton}\r\n size=\"small\"\r\n onClick={onEditMessage}\r\n >\r\n <EditIcon fontSize=\"small\" />\r\n </IconButton>\r\n </Tooltip>\r\n\r\n <Tooltip title=\"Delete message\" enterDelay={500}>\r\n <IconButton\r\n className={classes.iconButton}\r\n size=\"small\"\r\n onClick={onDeleteMessage}\r\n >\r\n <DeleteIcon fontSize=\"small\" />\r\n </IconButton>\r\n </Tooltip>\r\n </>\r\n ) : isLast ? (\r\n <IconButton\r\n className={classes.iconButton}\r\n size=\"small\"\r\n onClick={messageOperations.cancel}\r\n >\r\n <CancelScheduleSendIcon fontSize=\"small\" />\r\n </IconButton>\r\n ) : null}\r\n\r\n </Grid>\r\n </Grid>\r\n )\r\n}","import { useRef, useEffect, useState } from \"react\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport { useDevice } from \"../../../../providers/DeviceContext\";\r\nimport Scrollbar from \"../../../atoms/Scrollbar\";\r\nimport ChatInput from \"../common/ChatInput\";\r\nimport { Grid } from \"@mui/material\";\r\nimport { useCanEdit, useGroup, useGroupName } from \"@emberly/dataplane\";\r\nimport ChatBubble from \"../common/ChatBubble\";\r\nimport AdvisorBubble from \"./AdvisorBubble\";\r\nimport { useCallback } from \"react\";\r\nimport { useGroupUrl, useNotesEditor } from \"../../../../hooks/useApp\";\r\nimport ErrorBoundary from \"../../../atoms/ErrorBoundary\";\r\nimport SchemaExecutor from \"./common/SchemaExecutor\";\r\nimport { findVisibleNoteBlocks } from \"../../../../common/common\";\r\nimport PlayerBubble from \"./PlayerBubble\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n root: {\r\n position: \"relative\",\r\n width: \"450px\",\r\n maxWidth: \"100vw\",\r\n minHeight: \"60vh\",\r\n height: \"500px\",\r\n maxHeight: \"80vh\",\r\n overflow: \"hidden\"\r\n },\r\n rootMobile: {\r\n position: \"absolute\",\r\n width: \"100%\",\r\n height: \"calc(100% - 48px)\"\r\n },\r\n scrollbar: {\r\n padding: theme.spacing(2),\r\n paddingBottom: \"32px\",\r\n },\r\n scrollbarMobile: {\r\n padding: theme.spacing(2),\r\n },\r\n chatContainer: {\r\n position: \"relative\",\r\n },\r\n input: {\r\n paddingLeft: theme.spacing(2),\r\n paddingRight: theme.spacing(2)\r\n },\r\n bubble: {\r\n marginBottom: theme.spacing(1),\r\n },\r\n firstBubble: {\r\n marginBottom: theme.spacing(0.5),\r\n \"& div\": {\r\n borderBottomRightRadius: 0\r\n }\r\n },\r\n secondBubble: {\r\n marginBottom: theme.spacing(5),\r\n \"& div\": {\r\n borderTopRightRadius: 0,\r\n borderTopLeftRadius: 0\r\n }\r\n }\r\n}));\r\n\r\nconst INITIAL_MESSAGE = {\r\n blocks: `[{\"id\":\"63f22b462529985087d92d8a\",\"type\":\"paragraph\",\"data\":{\"text\":\"Hi, I'm your virtual assistant. I can help you with advice and guidance based on the information in this map. How may I assist you? 👋\"}}]`,\r\n sourceIds: []\r\n};\r\n\r\nconst INITIAL_MESSAGE_BETA = {\r\n blocks: `[\r\n {\"id\":\"63f22b462529985087d92d8a\",\"type\":\"paragraph\",\"data\":{\"text\":\"âš ï¸ I'm in beta, so my responses may not be perfect, but I'm learning and trying to help. If I can't answer, try being more specific.\"}},\r\n {\"id\":\"63f22b462529985087d92d8a\",\"type\":\"paragraph\",\"data\":{\"text\":\"Here is some recommended reading for <a href=\\\\\"https://blog.ember.ly/mastering-emberly-advisor\\\\\" target=\\\\\"blank\\\\\">geting started</a>.\"}}\r\n ]`,\r\n sourceIds: []\r\n};\r\n\r\nconst ERROR_BLOCKS = `[{\"id\":\"63f22b462529985087d92d8a\",\"type\":\"paragraph\",\"data\":{\"text\":\"Error encountered.\"}}]`\r\n\r\nlet HISTORY_CONTEXT_ID = \"\";\r\nlet MOUNTED = false;\r\n\r\nexport default function AdvisorPanel(props) {\r\n const { isMobilePortraitView, isMobile } = useDevice();\r\n const { onClose, HISTORY } = props;\r\n const classes = useStyles();\r\n const panelRef = useRef(null);\r\n\r\n const defaultName = useGroupName();\r\n const { group: context } = useGroup(defaultName);\r\n \r\n const [thinking, setThinking] = useState(HISTORY.thinking);\r\n const groupUrl = useGroupUrl();\r\n\r\n const [conversation, setConversation] = useState(HISTORY.conversation);\r\n const [showThinking, setShowThinking] = useState(HISTORY.thinking);\r\n const [initialThinking, setInitialThinking] = useState(HISTORY.conversation.length === 0);\r\n const [editMode, setEditMode] = useState(false);\r\n const { parentId } = useNotesEditor();\r\n const canEdit = useCanEdit();\r\n const inputRefs = useRef({});\r\n const messageRefs = useRef({});\r\n\r\n\r\n useEffect(() => {\r\n MOUNTED = true;\r\n if (!!context && context.getContextId() !== HISTORY_CONTEXT_ID) {\r\n HISTORY_CONTEXT_ID = context.getContextId();\r\n HISTORY.messages = [];\r\n HISTORY.conversation = [];\r\n HISTORY.entities = [];\r\n HISTORY.thinking = false;\r\n setThinking(false);\r\n setShowThinking(false);\r\n setConversation([]);\r\n } \r\n\r\n const timer = setTimeout(() => setInitialThinking(false), 800);\r\n return () => {\r\n clearTimeout(timer);\r\n MOUNTED = false;\r\n };\r\n }, [context, HISTORY]);\r\n\r\n // scroll down on new message\r\n useEffect(() => {\r\n if (!!panelRef.current) {\r\n panelRef.current.parentElement.scroll({ top: panelRef.current.offsetHeight, behavior: \"smooth\" });\r\n }\r\n }, [showThinking, conversation]);\r\n\r\n HISTORY.setConversation = setConversation;\r\n HISTORY.setThinking = setThinking;\r\n\r\n const onEditLastMessage = useCallback(() => {\r\n if (!!inputRefs.current.setText) {\r\n const setText = inputRefs.current.setText;\r\n if (editMode) {\r\n setText(\"\");\r\n } else {\r\n const lastMessage = HISTORY.messages[HISTORY.messages.length - 2];\r\n setText(lastMessage);\r\n inputRefs.current.focus();\r\n }\r\n }\r\n setEditMode(!editMode);\r\n },[editMode, HISTORY]);\r\n\r\n const onDeleteLastMessage = useCallback(() => { \r\n\r\n const updatedConversation = HISTORY.conversation.slice(0,-2);\r\n HISTORY.conversation = updatedConversation;\r\n setConversation(updatedConversation);\r\n\r\n const updatedHistory = HISTORY.messages.slice(0,-2);\r\n HISTORY.messages = updatedHistory;\r\n //setHistory(updatedHistory);\r\n \r\n setEditMode(false);\r\n }, [HISTORY]);\r\n\r\n const onCancel = useCallback(() => {\r\n setEditMode(false);\r\n inputRefs.current?.setText(\"\");\r\n }, []);\r\n\r\n const onSubmit = useCallback((text) => {\r\n if (!text || !context) return;\r\n\r\n if (editMode) {\r\n onDeleteLastMessage();\r\n }\r\n\r\n HISTORY.setThinking(true);\r\n HISTORY.thinking = true;\r\n HISTORY.setConversation(c => [...c, text]);\r\n HISTORY.conversation = [...HISTORY.conversation, text];\r\n\r\n const contextId = context.getContextId();\r\n let cancelled = false;\r\n\r\n \r\n messageRefs.current.cancel = () => {\r\n cancelled = true;\r\n HISTORY.setConversation(c => c.slice(0, -1));\r\n HISTORY.conversation = HISTORY.conversation.slice(0,-1);\r\n HISTORY.thinking = false;\r\n HISTORY.setThinking(false);\r\n inputRefs.current?.setText(text);\r\n inputRefs.current?.focus();\r\n };\r\n\r\n context.send(\"MessageAdvisor\", {\r\n history: HISTORY.messages,\r\n entities: [], //use this parameter to override conversation context\r\n message: text,\r\n visibleBlocks: findVisibleNoteBlocks(),\r\n parentId\r\n })\r\n .then((res) => {\r\n \r\n if (contextId !== HISTORY_CONTEXT_ID || cancelled) return;\r\n\r\n if (!res || !res.message || res.blocks === \"[]\") {\r\n // TODO\r\n HISTORY.messages = [...HISTORY.messages, text, \"Error\"].slice(-8);\r\n\r\n HISTORY.setConversation(list => {\r\n const buf = [...list, { blocks: ERROR_BLOCKS, sourceIds: [] }]; // TODO add sources\r\n HISTORY.conversation = buf;\r\n return buf;\r\n });\r\n\r\n HISTORY.entities = [];\r\n\r\n } else if (MOUNTED) {\r\n HISTORY.messages = [...HISTORY.messages, text, res.message].slice(-8);\r\n HISTORY.setConversation(list => {\r\n const buf = [...list, { blocks: res.blocks, sourceIds: res.sourceIds, schemas: !!res.schemas ? new SchemaExecutor(JSON.parse(res.schemas), context) : null }]; // TODO add sources\r\n HISTORY.conversation = buf;\r\n return buf;\r\n });\r\n\r\n HISTORY.entities = res.entities;\r\n } else {\r\n HISTORY.messages = [...HISTORY.messages, text, res.message];\r\n HISTORY.conversation = [...HISTORY.conversation, { blocks: res.blocks, sourceIds: res.sourceIds, schemas: !!res.schemas ? new SchemaExecutor(JSON.parse(res.schemas), context) : null }];\r\n if (typeof HISTORY.onNotification === \"function\") {\r\n HISTORY.onNotification();\r\n }\r\n }\r\n\r\n HISTORY.thinking = false;\r\n HISTORY.setThinking(false);\r\n })\r\n .catch(err => {\r\n console.log(\"error message advisor\", err);\r\n })\r\n }, [context, HISTORY, parentId, onDeleteLastMessage, editMode]);\r\n\r\n const onRetryMessage = useCallback(() => {\r\n const lastMessage = HISTORY.messages[HISTORY.messages.length - 2];\r\n onDeleteLastMessage();\r\n onSubmit(lastMessage);\r\n }, [HISTORY, onDeleteLastMessage, onSubmit]);\r\n\r\n useEffect(() => {\r\n if (thinking) {\r\n const timer = setTimeout(() => setShowThinking(true), 300);\r\n return () => {\r\n clearTimeout(timer);\r\n setShowThinking(false);\r\n }\r\n }\r\n }, [thinking]);\r\n\r\n return (\r\n <Grid container direction=\"column\" spacing={0} className={isMobilePortraitView ? classes.rootMobile : classes.root}>\r\n\r\n <Grid xs item container direction=\"row\" className={classes.chatContainer}>\r\n <Scrollbar>\r\n <Grid item container direction=\"row\" className={`${classes.scrollbar} ${isMobilePortraitView ? classes.scrollbarMobile : \"\"}`} ref={panelRef}>\r\n\r\n {initialThinking ? (\r\n <ChatBubble\r\n isNpc\r\n writing\r\n />\r\n ) : (\r\n <>\r\n <AdvisorBubble\r\n className={classes.firstBubble}\r\n message={INITIAL_MESSAGE}\r\n groupUrl={groupUrl}\r\n />\r\n <AdvisorBubble\r\n className={classes.secondBubble}\r\n message={INITIAL_MESSAGE_BETA}\r\n groupUrl={groupUrl}\r\n />\r\n </>\r\n )}\r\n\r\n {conversation.slice(-20).map((message, idx, list) => typeof message === \"string\" ? (\r\n <PlayerBubble\r\n className={classes.bubble}\r\n key={idx}\r\n text={message}\r\n isLast={idx >= list.length - 2}\r\n isWriting={thinking}\r\n onEditMessage={onEditLastMessage}\r\n onDeleteMessage={onDeleteLastMessage}\r\n onRetryMessage={onRetryMessage}\r\n messageOperations={messageRefs.current}\r\n editMode={editMode}\r\n />\r\n ) : (\r\n <ErrorBoundary key={idx}>\r\n <AdvisorBubble\r\n key={idx}\r\n className={classes.bubble}\r\n message={message}\r\n groupUrl={groupUrl}\r\n canEdit={canEdit}\r\n parentId={parentId}\r\n context={context}\r\n isMobilePortraitView={isMobilePortraitView}\r\n onClose={onClose}\r\n editMode={editMode}\r\n isLast={idx >= list.length - 2}\r\n canUseButtons\r\n />\r\n </ErrorBoundary>\r\n ))}\r\n\r\n {\r\n showThinking ? (\r\n <ChatBubble\r\n isNpc\r\n writing\r\n />\r\n ) : null\r\n }\r\n\r\n </Grid>\r\n </Scrollbar>\r\n </Grid>\r\n\r\n <ChatInput\r\n dataRef={inputRefs}\r\n className={classes.input}\r\n onSubmit={onSubmit}\r\n isMobile={isMobilePortraitView}\r\n autoFocus={!isMobile}\r\n disabled={thinking}\r\n placeholder=\"Write a message..\"\r\n onCancel={!!editMode ? onCancel : undefined}\r\n />\r\n\r\n </Grid>\r\n );\r\n}\r\n","import { useCallback, useState, useEffect } from \"react\";\r\nimport { IconButton, Tooltip, Badge } from \"@mui/material\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport {\r\n AutoAwesomeOutlined as AdvisorIcon,\r\n} from \"@mui/icons-material\";\r\nimport AdvisorPanel from \"./AdvisorPanel\";\r\nimport { useGroupName } from \"@emberly/dataplane\";\r\nimport DynamicPanel from \"../../../atoms/DynamicPanel\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n iconButton: {\r\n borderRadius: 0,\r\n color: theme.palette.neutral.button,\r\n },\r\n iconButtonRounded: {\r\n color: theme.palette.common.hardIcon\r\n },\r\n activeIcon: {\r\n color: theme.palette.primary.main\r\n },\r\n badge: {\r\n background: theme.palette.error.main\r\n },\r\n}));\r\n\r\nconst HISTORY = { messages: [], conversation: [], entities: [], thinking: false, onNotification: null, active: false };\r\n\r\nexport default function AdvisorController(props) {\r\n const { slimMode, rounded } = props;\r\n const classes = useStyles();\r\n const [anchorEl, setAnchorEl] = useState(null);\r\n const [showBadge, setShowBadge] = useState(false);\r\n const groupName = useGroupName();\r\n\r\n\r\n useEffect(() => {\r\n HISTORY.active = false;\r\n\r\n HISTORY.onNotification = () => {\r\n setShowBadge(HISTORY.active);\r\n };\r\n\r\n return () => {\r\n HISTORY.onNotification = null;\r\n }\r\n }, [groupName]);\r\n\r\n const onAdvisorPanelClick = useCallback((ev) => {\r\n const target = ev.currentTarget;\r\n setAnchorEl(t => !!t ? null : target);\r\n setShowBadge(false);\r\n HISTORY.active = true;\r\n }, []);\r\n\r\n\r\n const onAdvisorPanelClose = useCallback(() => setAnchorEl(null), []);\r\n\r\n const advisorPanelOpen = !!anchorEl;\r\n\r\n return <>\r\n <Tooltip title=\"Advisor (Beta)\" enterDelay={500} placement={slimMode ? \"left\" : undefined}>\r\n <IconButton\r\n className={`${rounded ? classes.iconButtonRounded : classes.iconButton} advisor-controller`}\r\n onClick={onAdvisorPanelClick}\r\n size=\"large\"\r\n >\r\n <Badge color=\"primary\" classes={{ badge: classes.badge }} overlap=\"circular\" variant=\"dot\" invisible={!showBadge}>\r\n <AdvisorIcon className={advisorPanelOpen ? classes.activeIcon : undefined} />\r\n </Badge>\r\n </IconButton>\r\n </Tooltip>\r\n <DynamicPanel\r\n title=\"Advisor\"\r\n forceDialog={slimMode}\r\n anchorEl={anchorEl}\r\n onClose={onAdvisorPanelClose}\r\n >\r\n <AdvisorPanel\r\n onClose={onAdvisorPanelClose} \r\n HISTORY={HISTORY} \r\n />\r\n </DynamicPanel>\r\n </>;\r\n}","import { useMemo, useCallback, useEffect } from \"react\";\r\nimport { IconButton, Typography, Grid, Divider } from \"@mui/material\";\r\nimport { makeStyles, useTheme } from \"@mui/styles\";\r\nimport GButton from \"../../atoms/inputs/GButton\";\r\nimport NewChildIcon from \"../../atoms/icons/NewChildIcon\";\r\nimport {\r\n HomeOutlined as HomeIcon,\r\n Search as SearchIcon,\r\n Undo as UndoIcon,\r\n Redo as RedoIcon,\r\n Check as CheckIcon,\r\n Tune as TuneIcon,\r\n LockOpen as EditIcon\r\n} from \"@mui/icons-material\";\r\nimport { useRootUrl } from \"../../../hooks/useApp\";\r\nimport { useCanEdit, useTimeline } from \"@emberly/dataplane\";\r\nimport useTree from \"../../../hooks/useTreeActions\";\r\nimport ShareController from \"../controllers/ShareController\";\r\nimport InboxController from \"../controllers/InboxController\";\r\nimport { useHistory } from \"react-router\";\r\nimport AdvisorController from \"../../pages/map/advisor/AdvisorController\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n topLeft: {\r\n position: \"absolute\",\r\n width: \"48px\",\r\n height: \"48px\",\r\n left: theme.spacing(1),\r\n top: theme.spacing(1)\r\n },\r\n topRight: {\r\n position: \"absolute\",\r\n width: \"auto\",\r\n height: \"48px\",\r\n right: theme.spacing(1),\r\n top: theme.spacing(1)\r\n },\r\n bottomLeft: {\r\n position: \"absolute\",\r\n width: \"48px\",\r\n height: \"48px\",\r\n left: theme.spacing(1),\r\n bottom: theme.spacing(1)\r\n },\r\n bottomLeftActive: {\r\n width: `calc(100% - ${theme.spacing(3)} - 96px)`\r\n },\r\n bottomRight: {\r\n position: \"absolute\",\r\n width: \"48px\",\r\n height: \"48px\",\r\n right: theme.spacing(1),\r\n bottom: theme.spacing(1),\r\n zIndex: 2\r\n },\r\n bottomRightExpanded: {\r\n position: \"absolute\",\r\n width: \"96px\",\r\n height: \"48px\",\r\n right: theme.spacing(1),\r\n bottom: theme.spacing(1)\r\n },\r\n bottomPanel: {\r\n position: \"absolute\",\r\n top: 0,\r\n left: 0,\r\n width: \"100%\",\r\n height: 0,\r\n transition: \"transform 0.25s\",\r\n zIndex: 1\r\n },\r\n topPanel: {\r\n position: \"absolute\",\r\n top: 0,\r\n left: 0,\r\n width: \"100%\",\r\n height: 0,\r\n transition: \"opacity 0.25s\",\r\n zIndex: 1\r\n },\r\n editModeItem: {\r\n position: \"relative\",\r\n width: \"100%\"\r\n },\r\n checkItem: {\r\n height: \"48px\",\r\n width: \"48px\",\r\n background: theme.palette.mode === \"dark\" ? theme.palette.primary.main : theme.palette.secondary.main,\r\n lineHeight: \"48px\"\r\n },\r\n editButton: {\r\n position: \"relative\",\r\n width: \"48px\",\r\n color: theme.palette.neutral.button,\r\n maxWidth: \"100%\"\r\n },\r\n editModeTextItem: {\r\n marginLeft: theme.spacing(1)\r\n },\r\n iconButton: {\r\n color: theme.palette.neutral.button\r\n },\r\n divider: {\r\n height: \"32px\"\r\n }\r\n}));\r\n\r\nexport default function MobileMapOverlay(props) {\r\n const { topRef, bottomRef } = props;\r\n const classes = useStyles();\r\n const theme = useTheme();\r\n const history = useHistory();\r\n const { dragEnabled, setDragEnabled, hasNode, beginCreateCategoryNode, canCreateChild } = useTree();\r\n const { undo, redo, historyLength, undoneHistoryLength } = useTimeline(\"Node\");\r\n\r\n\r\n const rootUrl = useRootUrl();\r\n const canEdit = useCanEdit();\r\n\r\n useEffect(() => { setDragEnabled(false); }, [setDragEnabled]);\r\n\r\n const onOpenSearch = useCallback(() => history.push(`${rootUrl}/search`), [history, rootUrl]);\r\n const onOpenEdit = useCallback(() => history.push(`${rootUrl}/edit`), [history, rootUrl]);\r\n const onClose = useCallback(() => history.push(\"/app/home\"), [history]);\r\n\r\n return <>\r\n\r\n <div ref={topRef} className={classes.topPanel}>\r\n {useMemo(() => (\r\n <>\r\n <GButton className={classes.topLeft} direction=\"row\" active>\r\n <IconButton\r\n className={`${classes.iconButton} exit-map home`}\r\n onClick={onClose}\r\n size=\"large\">\r\n <HomeIcon />\r\n </IconButton>\r\n </GButton>\r\n\r\n <GButton className={classes.topRight} direction=\"row\" active>\r\n\r\n <ShareController />\r\n\r\n <InboxController />\r\n\r\n <AdvisorController />\r\n\r\n <Divider orientation=\"vertical\" flexItem className={classes.divider} />\r\n\r\n <IconButton\r\n className={classes.iconButton}\r\n onClick={onOpenSearch}\r\n size=\"large\">\r\n <SearchIcon />\r\n </IconButton>\r\n\r\n <IconButton\r\n className={classes.iconButton}\r\n onClick={onOpenEdit}\r\n size=\"large\">\r\n <TuneIcon />\r\n </IconButton>\r\n\r\n </GButton>\r\n </>\r\n ), [classes, onOpenSearch, onOpenEdit, onClose])}\r\n </div>\r\n\r\n <div ref={bottomRef} className={classes.bottomPanel}>\r\n {useMemo(() => (\r\n <>\r\n <GButton className={classes.bottomLeft} direction=\"row\" active={!dragEnabled && canEdit}>\r\n <IconButton onClick={setDragEnabled} className={classes.editButton} size=\"large\">\r\n <EditIcon />\r\n </IconButton>\r\n </GButton>\r\n\r\n <GButton className={`${classes.bottomLeft} ${classes.bottomLeftActive}`} direction=\"row\" justify=\"flex-start\" active={dragEnabled && canEdit}>\r\n <Grid item className={classes.checkItem}>\r\n <IconButton onClick={setDragEnabled} className={classes.checkItem} size=\"large\">\r\n <CheckIcon />\r\n </IconButton>\r\n </Grid>\r\n <Grid item className={classes.editModeTextItem}>\r\n <Typography variant=\"subtitle2\" fontWeight=\"500\">Edit mode ACTIVE</Typography>\r\n <Typography variant=\"body2\">Drag topics to move</Typography>\r\n </Grid>\r\n </GButton>\r\n\r\n <GButton className={classes.bottomRightExpanded} direction=\"row\" active={dragEnabled && canEdit}>\r\n <IconButton\r\n className={classes.iconButton}\r\n onClick={undo}\r\n disabled={!historyLength}\r\n size=\"large\">\r\n <UndoIcon />\r\n </IconButton>\r\n <IconButton\r\n className={classes.iconButton}\r\n onClick={redo}\r\n disabled={!undoneHistoryLength}\r\n size=\"large\">\r\n <RedoIcon />\r\n </IconButton>\r\n </GButton>\r\n\r\n <GButton className={`${classes.bottomRight} ${canEdit && canCreateChild && !hasNode && !dragEnabled ? \"new-child\" : \"\"}`} direction=\"row\" active={!dragEnabled && !hasNode && canEdit && canCreateChild}>\r\n <IconButton\r\n onClick={beginCreateCategoryNode}\r\n className={classes.editButton}\r\n size=\"large\">\r\n <NewChildIcon iconColor={theme.palette.neutral.button} />\r\n </IconButton>\r\n </GButton>\r\n\r\n </>\r\n ), [classes, redo, undoneHistoryLength, historyLength, undo, dragEnabled, setDragEnabled, hasNode, canCreateChild, theme, canEdit, beginCreateCategoryNode])}\r\n </div>\r\n\r\n </>;\r\n}","import { useMemo } from \"react\";\r\nimport { useSelector } from \"react-redux\";\r\nimport { Grid, Paper, Typography, Fade } from \"@mui/material\";\r\nimport { makeStyles } from \"@mui/styles\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n paper: {\r\n position: \"absolute\",\r\n width: \"300px\",\r\n top: theme.spacing(1),\r\n left: \"calc(50% - 150px)\",\r\n borderRadius: theme.spacing(0.5),\r\n overflow: \"hidden\",\r\n zIndex: 2,\r\n userSelect: \"none\"\r\n },\r\n header: {\r\n paddingLeft: theme.spacing(2),\r\n },\r\n headerText: {\r\n marginTop: theme.spacing(2),\r\n fontWeight: \"500\"\r\n },\r\n text: {\r\n margin: theme.spacing(2),\r\n marginTop: theme.spacing(0.5)\r\n }\r\n}));\r\n\r\nexport default function ResourceMoveInfoDialog(props) {\r\n const classes = useStyles();\r\n const dragOverActive = useSelector(state => state.app.dragOverActive) && !props.slimMode;\r\n const cardLimits = useSelector(state => state.app.cardLimits);\r\n\r\n return useMemo(() => (\r\n <Fade in={dragOverActive}>\r\n <Paper className={classes.paper} style={{ left: `calc(50% - 150px - ${cardLimits[0]/2}px)`}} elevation={4}>\r\n <Grid container>\r\n <Grid item container className={classes.header} justifyContent=\"flex-start\" alignItems=\"baseline\">\r\n <Grid item xs>\r\n <Typography variant=\"subtitle1\" className={classes.headerText}>Moving resources</Typography>\r\n </Grid>\r\n </Grid>\r\n <Grid item>\r\n <Typography variant=\"body1\" className={classes.text}>Choose the topic you want to move the resources to.</Typography>\r\n </Grid>\r\n </Grid>\r\n </Paper>\r\n </Fade>\r\n ),[dragOverActive, cardLimits, classes]);\r\n}","import { useCallback } from \"react\";\r\nimport { useDispatch } from \"react-redux\";\r\nimport { Divider, IconButton } from \"@mui/material\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport GButton from \"../../atoms/inputs/GButton\";\r\nimport * as TreeActions from \"../../../actions/tree\";\r\nimport {\r\n Undo as UndoIcon,\r\n Redo as RedoIcon,\r\n Add as AddIcon,\r\n Remove as RemoveIcon,\r\n FitScreenOutlined as FitScreenIcon\r\n} from \"@mui/icons-material\";\r\nimport { useTimeline } from \"@emberly/dataplane\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n root: {\r\n borderRadius: \"4px\",\r\n padding: \"4px\",\r\n zIndex: 2,\r\n transition: \"transform 0.25s\",\r\n background: theme.palette.background.glass,\r\n boxShadow: \"none\"\r\n },\r\n iconButton: {\r\n color: theme.palette.neutral.button\r\n },\r\n divider: {\r\n height: \"32px\",\r\n marginLeft: \"4px\",\r\n marginRight: \"4px\"\r\n }\r\n}));\r\n\r\nexport default function PaneController(props) {\r\n const { className, active } = props;\r\n const classes = useStyles();\r\n const dispatch = useDispatch();\r\n const { undo, redo, historyLength, undoneHistoryLength } = useTimeline(\"Node\");\r\n\r\n const onCenterView = useCallback(() => dispatch(TreeActions.CenterView()), [dispatch]);\r\n const onZoomIn = useCallback(() => dispatch(TreeActions.Zoom(0.75)), [dispatch]);\r\n const onZoomOut = useCallback(() => dispatch(TreeActions.Zoom(-0.75)), [dispatch]);\r\n\r\n return (\r\n <GButton className={`${classes.root} ${className || \"\"}`} direction={\"row\"} active={active}>\r\n <IconButton\r\n onClick={undo}\r\n disabled={!historyLength}\r\n className={classes.iconButton}\r\n size=\"medium\">\r\n <UndoIcon fontSize=\"small\" />\r\n </IconButton>\r\n <IconButton\r\n onClick={redo}\r\n disabled={!undoneHistoryLength}\r\n className={classes.iconButton}\r\n size=\"medium\">\r\n <RedoIcon fontSize=\"small\" />\r\n </IconButton>\r\n <Divider orientation=\"vertical\" flexItem className={classes.divider} />\r\n <IconButton className={classes.iconButton} onClick={onZoomOut} size=\"medium\">\r\n <RemoveIcon fontSize=\"small\" />\r\n </IconButton>\r\n <IconButton className={classes.iconButton} onClick={onZoomIn} size=\"medium\">\r\n <AddIcon fontSize=\"small\" />\r\n </IconButton>\r\n <IconButton className={classes.iconButton} onClick={onCenterView} size=\"medium\">\r\n <FitScreenIcon fontSize=\"small\" />\r\n </IconButton>\r\n </GButton>\r\n );\r\n}","import SvgIcon from \"@mui/material/SvgIcon\";\r\n\r\nexport default function MapIcon() {\r\n return (\r\n <SvgIcon color=\"inherit\" viewBox=\"0 0 22 18\">\r\n <path d=\"M21.5 6V0H15.5V2.25H12.5C12.1023 2.2504 11.721 2.40856 11.4398 2.68978C11.1586 2.971 11.0004 3.3523 11 3.75V8.25H6.5V6H0.5V12H6.5V9.75H11V14.25C11.0004 14.6477 11.1586 15.029 11.4398 15.3102C11.721 15.5914 12.1023 15.7496 12.5 15.75H15.5V18H21.5V12H15.5V14.25H12.5V3.75H15.5V6H21.5ZM5 10.5H2V7.5H5V10.5ZM17 13.5H20V16.5H17V13.5ZM17 1.5H20V4.5H17V1.5Z\"/>\r\n </SvgIcon>\r\n );\r\n}\r\n\r\n","import { useState, Fragment, useMemo } from \"react\";\r\nimport { Divider, IconButton, Button, Typography, Grid, List, ListItem, ListItemText, ListItemAvatar, Avatar, ListItemSecondaryAction, Menu, MenuItem, Tooltip } from \"@mui/material\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport {\r\n MoreVert as MoreVertIcon\r\n} from \"@mui/icons-material\";\r\nimport { useContextId, useEverything } from \"@emberly/dataplane\";\r\nimport MapIcon from \"../../atoms/icons/MapIcon\";\r\nimport Scrollbars from \"react-custom-scrollbars-2\";\r\nimport { useDispatch } from \"react-redux\";\r\nimport { AddConfirmDialog } from \"../../../actions/app\";\r\nimport DelayedLinearProgress from \"../../atoms/display/DelayedLinearProgress\";\r\nimport useWindowSize from \"../../../hooks/useWindowSize\";\r\nimport { useHistory } from \"react-router\";\r\nimport { usePlanWithMapLimits } from \"../../../hooks/usePlan\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n root: {\r\n position: \"relative\",\r\n width: \"400px\",\r\n maxWidth: \"80vw\"\r\n },\r\n header: {\r\n width: \"100%\",\r\n height: \"56px\",\r\n borderBottom: `1px solid ${theme.palette.divider}`\r\n },\r\n headerText: {\r\n paddingLeft: theme.spacing(3)\r\n },\r\n createMapButton: {\r\n marginRight: theme.spacing(2)\r\n },\r\n list: {\r\n width: \"100%\"\r\n },\r\n avatar: {\r\n background: theme.palette.background.paper,\r\n boxShadow: `0px 1px 3px rgba(0, 0, 0, 0.1)`,\r\n color: theme.palette.text.primary,\r\n height: \"36px\",\r\n width: \"36px\"\r\n },\r\n menuButton: {\r\n borderRadius: \"4px\"\r\n },\r\n selectedItemText: {\r\n fontWeight: \"500\"\r\n },\r\n footer: {\r\n height: \"38px\",\r\n borderTop: `1px solid ${theme.palette.divider}`\r\n }\r\n}));\r\n\r\n\r\nexport default function ContextSwitcherPanel(props) {\r\n const { onClose, onCreateNewMap } = props;\r\n const currentContextId = useContextId();\r\n const classes = useStyles();\r\n const { entities, loading } = useEverything(\"Map\", true, \"default\");\r\n const sortedEntities = useMemo(() => entities.sort((a, b) => b.lastOpened - a.lastOpened).filter(t => t.id !== currentContextId), [entities, currentContextId]);\r\n const currentMap = entities.find(t => t.id === currentContextId);\r\n const { height } = useWindowSize();\r\n const { canCreateMaps } = usePlanWithMapLimits();\r\n\r\n return (\r\n <div className={classes.root}>\r\n\r\n <Grid container className={classes.header} direction=\"row\" justifyContent=\"space-between\" alignItems=\"center\">\r\n <Typography variant=\"body2\" className={classes.headerText}>Recent maps</Typography>\r\n <Tooltip title={canCreateMaps ? \"\" : \"Limit reached. Upgrade to make more maps.\"}>\r\n <span>\r\n <Button className={classes.createMapButton} onClick={onCreateNewMap} color=\"primary\" variant=\"text\" disabled={!canCreateMaps}>\r\n Create new map\r\n </Button>\r\n </span>\r\n </Tooltip>\r\n </Grid>\r\n\r\n {loading ? <DelayedLinearProgress variant=\"indeterminate\" color=\"primary\" /> : null}\r\n\r\n <Scrollbars autoHide hideTracksWhenNotNeeded autoHeight autoHeightMax={Math.min(Math.min(height * 0.8, Math.max(height - 140, 64)), 400)}>\r\n <List className={classes.list}>\r\n {!!currentMap ? (\r\n <>\r\n <ContextSwitcherItem entity={currentMap} selected onClose={onClose} classes={classes} />\r\n {\r\n sortedEntities.length !== 0 ? (\r\n <Divider variant=\"inset\" component=\"li\" />\r\n ) : null\r\n }\r\n </>\r\n ) : null}\r\n {useMemo(() => sortedEntities.map((entity, i) => (\r\n <Fragment key={i}>\r\n <ContextSwitcherItem entity={entity} onClose={onClose} classes={classes} />\r\n {i !== sortedEntities.length - 1 ? <Divider variant=\"inset\" component=\"li\" /> : null}\r\n </Fragment>\r\n )),[sortedEntities, onClose, classes])}\r\n </List>\r\n </Scrollbars>\r\n\r\n\r\n <Grid container className={classes.footer} direction=\"row\" justifyContent=\"space-between\" alignItems=\"center\">\r\n\r\n </Grid>\r\n\r\n </div>\r\n );\r\n}\r\n\r\n\r\nfunction ContextSwitcherItem(props) {\r\n const { entity, selected, onClose, classes } = props;\r\n const history = useHistory();\r\n const [anchorEl, setAnchorEl] = useState(null);\r\n const dispatch = useDispatch();\r\n const isOwner = entity.isOwner;\r\n\r\n const openMap = () => {\r\n if (!selected && !anchorEl) {\r\n onClose();\r\n setTimeout(() => history.push(`/map/${entity.publicUserId}/${entity.id}`), 1);\r\n }\r\n };\r\n\r\n\r\n const handleClick = (event) => {\r\n setAnchorEl(event.currentTarget);\r\n };\r\n\r\n const handleClose = () => {\r\n setAnchorEl(null);\r\n };\r\n\r\n const handleOpen = () => {\r\n handleClose();\r\n onClose();\r\n history.push(`/map/${entity.publicUserId}/${entity.id}/edit`);\r\n };\r\n\r\n const handleOpenMapInNewTab = () => {\r\n handleClose();\r\n onClose();\r\n setTimeout(() => window.open(`/map/${entity.publicUserId}/${entity.id}`, \"_blank\"), 1);\r\n };\r\n\r\n const handleEdit = () => {\r\n handleClose();\r\n onClose();\r\n history.push(`/map/${entity.publicUserId}/${entity.id}/edit`);\r\n };\r\n\r\n const handleDelete = () => {\r\n handleClose();\r\n\r\n dispatch(AddConfirmDialog(\r\n `${isOwner ? \"Delete\" : \"Leave\"} ${entity.name}?`,\r\n isOwner ? \"This will delete the map.\" : \"Leaving the map.\",\r\n isOwner ? \"Delete\" : \"Leave\",\r\n \"error\",\r\n () => { },\r\n () => {\r\n\r\n if (isOwner) {\r\n entity.delete();\r\n }\r\n\r\n if (selected) {\r\n onClose();\r\n history.push(\"/app/home\");\r\n }\r\n }\r\n ));\r\n };\r\n\r\n return (\r\n <ListItem onClick={openMap} button={!selected} disabled={entity.access === 0}>\r\n <Menu\r\n id=\"map-menu\"\r\n anchorEl={anchorEl}\r\n keepMounted\r\n open={Boolean(anchorEl)}\r\n onClose={handleClose}\r\n >\r\n <MenuItem onClick={handleOpen}>Open</MenuItem>\r\n <MenuItem onClick={handleOpenMapInNewTab}>Open in new tab</MenuItem>\r\n <MenuItem onClick={handleEdit}>Edit</MenuItem>\r\n <MenuItem onClick={handleDelete}>Delete</MenuItem>\r\n </Menu>\r\n <ListItemAvatar>\r\n <Avatar variant=\"rounded\" className={classes.avatar}>\r\n <MapIcon />\r\n </Avatar>\r\n </ListItemAvatar>\r\n <ListItemText\r\n primary={<Typography variant=\"body1\" className={selected ? classes.selectedItemText : undefined}>{entity.name}</Typography>}\r\n secondary={`Edited ${entity.getTimeSinceLastEdit()}`}\r\n />\r\n <ListItemSecondaryAction>\r\n <IconButton\r\n edge=\"end\"\r\n aria-label=\"map menu\"\r\n className={classes.menuButton}\r\n onClick={handleClick}\r\n size=\"large\">\r\n <MoreVertIcon />\r\n </IconButton>\r\n </ListItemSecondaryAction>\r\n </ListItem>\r\n );\r\n}","import { useCallback, useState } from \"react\";\r\nimport { Divider, IconButton, Button, Popover, Tooltip } from \"@mui/material\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport GButton from \"../../atoms/inputs/GButton\";\r\nimport {\r\n StarOutlineRounded as StarOutlineIcon,\r\n StarRounded as StarIcon,\r\n ExpandMore as ExpandMoreIcon,\r\n ExpandLess as ExpandLessIcon,\r\n HomeOutlined as HomeIcon\r\n} from \"@mui/icons-material\";\r\nimport ContextSwitcherPanel from \"../panels/ContextSwitcherPanel\";\r\nimport { useContextId, useEntity } from \"@emberly/dataplane\";\r\nimport { useHistory } from \"react-router\";\r\nimport DynamicPanel from \"../../atoms/DynamicPanel\";\r\nimport CreateMapPanel from \"../panels/CreateMapPanel\";\r\n\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n root: {\r\n height: \"48px\",\r\n },\r\n iconButton: {\r\n borderRadius: 0,\r\n color: theme.palette.neutral.button\r\n },\r\n iconButtonFavorite: {\r\n borderRadius: 0,\r\n width: \"40px\",\r\n color: theme.palette.neutral.button\r\n },\r\n divider: {\r\n height: \"32px\"\r\n },\r\n contextButton: {\r\n height: \"48px\",\r\n paddingLeft: theme.spacing(2),\r\n paddingRight: theme.spacing(2),\r\n color: theme.palette.neutral.button,\r\n borderRadius: 0,\r\n \"& .MuiButton-endIcon\": {\r\n marginLeft: \"4px\",\r\n \"& svg\": {\r\n fontSize: \"16px\"\r\n }\r\n }\r\n },\r\n contextButtonText: {\r\n whiteSpace: \"nowrap\",\r\n overflow: \"hidden\",\r\n textOverflow: \"ellipsis\",\r\n maxWidth: \"180px\"\r\n },\r\n favoriteIcon: {\r\n height: \"24px\",\r\n color: theme.palette.action.active\r\n },\r\n favoriteActiveIcon: {\r\n height: \"24px\",\r\n color: theme.palette.secondary.main\r\n }\r\n}));\r\n\r\nconst anchorOrigin = {\r\n vertical: \"bottom\",\r\n horizontal: \"center\",\r\n};\r\n\r\nconst transformOrigin = {\r\n vertical: \"top\",\r\n horizontal: \"center\",\r\n};\r\n\r\nconst paperProps = {\r\n style: {\r\n marginTop: \"8px\",\r\n marginLeft: \"-8px\"\r\n }\r\n};\r\n\r\nexport default function ContextController(props) {\r\n const { className, slimMode, active } = props;\r\n const classes = useStyles();\r\n const currentContextId = useContextId();\r\n const history = useHistory();\r\n const { entity } = useEntity(\"Map\", currentContextId, true, \"default\");\r\n const [anchorEl, setAnchorEl] = useState(null);\r\n\r\n const onClose = useCallback(() => history.push(\"/app/home\"), [history]);\r\n const onFavoriteClick = useCallback(() => entity?.setFavorite(!entity.favorite), [entity]);\r\n\r\n const onContextSwitcherClick = useCallback((ev) => setAnchorEl(ev.currentTarget), []);\r\n const onContextSwitcherClose = useCallback(() => setAnchorEl(null), []);\r\n\r\n const contextSwitcherOpen = !!anchorEl;\r\n const contextSwitcherId = contextSwitcherOpen ? \"context-switcher\" : undefined;\r\n\r\n\r\n const [createMapAnchor, setCreateMapAnchor] = useState(null);\r\n \r\n const onCreateMapPanelClick = useCallback((ev) => {\r\n onContextSwitcherClose();\r\n const target = ev.currentTarget;\r\n setCreateMapAnchor(t => !!t ? null : target);\r\n }, [onContextSwitcherClose]);\r\n\r\n const onCreateMapPanelClose = useCallback(() => setCreateMapAnchor(null), []);\r\n\r\n\r\n return slimMode ? (\r\n <GButton className={`${classes.root} ${className || \"\"}`} direction={\"row\"} in={active}>\r\n <Tooltip title=\"Show dashboard\" enterDelay={500}>\r\n <IconButton onClick={onClose} className={`${classes.iconButton} home`} size=\"large\">\r\n <HomeIcon />\r\n </IconButton>\r\n </Tooltip>\r\n </GButton>\r\n ) : (\r\n <GButton className={`${classes.root} ${className || \"\"}`} direction={\"row\"} in={active}>\r\n <Tooltip title=\"Show dashboard\" enterDelay={500}>\r\n <IconButton onClick={onClose} className={`${classes.iconButton} home`} size=\"large\">\r\n <HomeIcon />\r\n </IconButton>\r\n </Tooltip>\r\n <Divider orientation=\"vertical\" flexItem className={classes.divider} />\r\n <Tooltip title=\"Select map\" enterDelay={500}>\r\n <Button\r\n color=\"neutral\"\r\n className={classes.contextButton}\r\n endIcon={contextSwitcherOpen ? <ExpandLessIcon /> : <ExpandMoreIcon />}\r\n onClick={onContextSwitcherClick}\r\n >\r\n <span className={classes.contextButtonText}>\r\n {entity?.name || \"loading\"}\r\n </span>\r\n </Button>\r\n </Tooltip>\r\n <Popover\r\n id={contextSwitcherId}\r\n open={contextSwitcherOpen}\r\n anchorEl={anchorEl}\r\n onClose={onContextSwitcherClose}\r\n anchorOrigin={anchorOrigin}\r\n transformOrigin={transformOrigin}\r\n PaperProps={paperProps}\r\n >\r\n <ContextSwitcherPanel onClose={onContextSwitcherClose} onCreateNewMap={onCreateMapPanelClick} />\r\n </Popover>\r\n <Divider orientation=\"vertical\" flexItem className={classes.divider} />\r\n <Tooltip title=\"Mark map as favorite\" enterDelay={500}>\r\n <IconButton onClick={onFavoriteClick} className={classes.iconButtonFavorite} size=\"large\">\r\n {entity?.favorite ? <StarIcon fontSize=\"small\" className={classes.favoriteActiveIcon} /> : <StarOutlineIcon fontSize=\"small\" className={classes.favoriteIcon} />}\r\n </IconButton>\r\n </Tooltip>\r\n <DynamicPanel\r\n anchorEl={createMapAnchor}\r\n onClose={onCreateMapPanelClose}\r\n forceDialog\r\n >\r\n <CreateMapPanel onClose={onCreateMapPanelClose} />\r\n </DynamicPanel>\r\n </GButton>\r\n );\r\n}","import { useMemo } from \"react\";\r\nimport { Grid, Typography, Tooltip, Avatar, Fade } from \"@mui/material\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport { useGroupMembers } from \"@emberly/dataplane\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n root: {\r\n height: \"34px\",\r\n width: \"auto\",\r\n marginRight: \"12px\"\r\n },\r\n avatar: {\r\n position: \"relative\",\r\n border: \"2px solid #EEEDF1\",\r\n width: \"30px\",\r\n height: \"30px\",\r\n marginRight: \"4px\",\r\n },\r\n overflowAvatar: {\r\n position: \"relative\",\r\n border: \"2px solid #EEEDF1\",\r\n width: \"30px\",\r\n height: \"30px\",\r\n marginRight: \"4px\",\r\n backgroundColor: theme.palette.background.paper\r\n },\r\n tooltipText: {\r\n color: theme.palette.common.white,\r\n marginRight: theme.spacing(2)\r\n },\r\n tooltipRole: {\r\n color: theme.palette.grey[500]\r\n },\r\n overflowGridContainer: {\r\n width: \"auto\",\r\n height: \"auto\"\r\n },\r\n colorDot: {\r\n width: \"8px\",\r\n height: \"8px\",\r\n borderRadius: \"50%\",\r\n background: \"black\",\r\n marginRight: theme.spacing(1)\r\n },\r\n overflowMemberItem: {\r\n marginTop: theme.spacing(0.5),\r\n marginBottom: theme.spacing(0.5),\r\n marginLeft: theme.spacing(1),\r\n marginRight: theme.spacing(1),\r\n },\r\n tooltip: {\r\n maxWidth: \"none\",\r\n \"& .MuiTooltip-tooltip\": {\r\n maxWidth: \"none\"\r\n },\r\n }\r\n}));\r\n\r\nconst RENDER_COUNT = 2;\r\n\r\n\r\n\r\nexport default function OnlineStateController(props) {\r\n const { className, slimMode, active } = props;\r\n const classes = useStyles();\r\n const { activeMembers } = useGroupMembers();\r\n const renderCount = slimMode ? 0 : RENDER_COUNT;\r\n const renderMembers = activeMembers.filter((_, i) => i < renderCount);\r\n const overflowMembers = activeMembers.filter((_, i) => i >= renderCount);\r\n\r\n const tooltipClasses = useMemo(() => ({ popper: classes.tooltip}), [classes]);\r\n\r\n return (\r\n <Fade in={active}>\r\n <Grid container className={`${classes.root} ${className || \"\"}`} justifyContent=\"center\" alignItems=\"center\" direction=\"row\">\r\n {overflowMembers.length !== 0 ? (\r\n <Tooltip classes={tooltipClasses} arrow title={\r\n <Grid container className={classes.overflowGridContainer}>\r\n {overflowMembers.map((m, i) => (\r\n <OverflowMemberItem member={m} key={i} />\r\n ))}\r\n </Grid>\r\n }>\r\n <Avatar className={classes.overflowAvatar}>\r\n <Typography variant=\"body2\" color=\"textSecondary\">\r\n +{overflowMembers.length}\r\n </Typography>\r\n </Avatar>\r\n </Tooltip>\r\n ) : null}\r\n {renderMembers.map((m, i) => (\r\n <Tooltip classes={tooltipClasses} arrow title={\r\n <Grid container className={classes.overflowGridContainer}>\r\n <OverflowMemberItem member={m} />\r\n </Grid>\r\n } key={i}>\r\n <Avatar className={classes.avatar} src={m.avatarUrl} alt={m.fullName} style={{ borderColor: m.color }} />\r\n </Tooltip>\r\n ))}\r\n </Grid>\r\n </Fade>\r\n );\r\n}\r\n\r\nfunction OverflowMemberItem(props) {\r\n const { member } = props;\r\n const classes = useStyles();\r\n\r\n return (\r\n <Grid item container xs={12} justifyContent=\"flex-start\" alignItems=\"center\" className={classes.overflowMemberItem}>\r\n <div className={classes.colorDot} style={{ backgroundColor: member.color }} ></div>\r\n <Typography variant=\"body2\" color=\"textSecondary\" className={classes.tooltipText}>\r\n {member.fullName}\r\n </Typography>\r\n <Grid item container justifyContent=\"flex-end\" xs>\r\n <Typography variant=\"caption\" className={classes.tooltipRole} align=\"right\">\r\n {getRole(member.access)}\r\n </Typography>\r\n </Grid>\r\n </Grid>\r\n );\r\n}\r\n\r\n\r\nfunction getRole(access) {\r\n switch (access) {\r\n case 1: return \"Can view\";\r\n case 2: return \"Can edit\";\r\n case 3: return \"Can invite\";\r\n case 4: return \"Owner\";\r\n default: return \"No access\";\r\n }\r\n}","import { useMemo, useCallback, useEffect } from \"react\";\r\nimport { useSelector, useDispatch } from \"react-redux\";\r\nimport { Grid, IconButton, Tooltip, Fade, Divider } from \"@mui/material\";\r\nimport { makeStyles, useTheme } from \"@mui/styles\";\r\nimport GButton from \"../../atoms/inputs/GButton\";\r\nimport * as AppActions from \"../../../actions/app\";\r\nimport NewSiblingIcon from \"../../atoms/icons/NewSiblingIcon\";\r\nimport NewChildIcon from \"../../atoms/icons/NewChildIcon\";\r\nimport {\r\n Search as SearchIcon,\r\n ExpandMore as ExpandMoreIcon,\r\n ExpandLess as ExpandLessIcon,\r\n Tune as TuneIcon\r\n} from \"@mui/icons-material\";\r\nimport ResourceMoveInfoDialog from \"../../atoms/ResourceMoveInfoDialog\";\r\nimport PaneController from \"../controllers/PaneController\";\r\nimport { useRootUrl } from \"../../../hooks/useApp\";\r\nimport useTree from \"../../../hooks/useTreeActions\";\r\nimport { ConditionalPortal } from \"../../atoms/views/ConditionalPortalView\";\r\nimport { useCanEdit } from \"@emberly/dataplane\";\r\nimport ContextController from \"../controllers/ContextController\";\r\nimport ShareController from \"../controllers/ShareController\";\r\nimport OnlineStateController from \"../controllers/OnlineStateController\";\r\nimport InboxController from \"../controllers/InboxController\";\r\nimport HelpCenterController from \"../controllers/HelpCenterController\";\r\nimport { useHistory, useLocation } from \"react-router\";\r\nimport AdvisorController from \"../../pages/map/advisor/AdvisorController\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n topRight: {\r\n position: \"absolute\",\r\n width: \"auto\",\r\n height: \"48px\",\r\n right: \"64px\",\r\n top: theme.spacing(1),\r\n zIndex: 2\r\n },\r\n topRightButtonSlim: {\r\n borderTopRightRadius: 0,\r\n borderBottomRightRadius: 0\r\n },\r\n topRightOnlineStateController: {\r\n marginTop: \"8px\"\r\n },\r\n slimTopRightOnlineStateController: {\r\n marginTop: \"8px\",\r\n marginRight: theme.spacing(-0.5)\r\n },\r\n topCenter: {\r\n position: \"absolute\",\r\n width: \"144px\",\r\n height: \"48px\",\r\n right: 0,\r\n top: theme.spacing(1),\r\n zIndex: 2\r\n },\r\n topLeft: {\r\n position: \"absolute\",\r\n height: \"48px\",\r\n left: theme.spacing(1),\r\n top: theme.spacing(1)\r\n },\r\n bottomLeft: {\r\n position: \"absolute\",\r\n left: theme.spacing(0.5),\r\n bottom: theme.spacing(0.5)\r\n },\r\n helpCenterContainer: {\r\n position: \"absolute\",\r\n right: theme.spacing(0.5),\r\n bottom: theme.spacing(0.5),\r\n zIndex: 2\r\n },\r\n iconButton: {\r\n borderRadius: theme.spacing(0),\r\n color: theme.palette.neutral.button\r\n },\r\n iconButtonActive: {\r\n background: `${theme.palette.action.canvasButtonActive} !important`\r\n },\r\n dividerVertical: {\r\n height: \"32px\"\r\n },\r\n dividerHorizontal: {\r\n width: \"32px\"\r\n }\r\n}));\r\n\r\nexport default function DesktopMapOverlay(props) {\r\n const { deltaX, width, touchActive } = props;\r\n const classes = useStyles();\r\n const dispatch = useDispatch();\r\n const theme = useTheme();\r\n\r\n const history = useHistory();\r\n const location = useLocation();\r\n const dragOverActive = useSelector(state => state.app.dragOverActive);\r\n const semiSlimMode = width < 1200;\r\n const slimMode = width < 1024;\r\n\r\n const { canCreateChild, collapse, canCollapse, isCollapsed, setDragEnabled, beginCreateChild, beginCreateSibling, canCreateSibling } = useTree();\r\n useEffect(() => { setDragEnabled(true); }, [setDragEnabled]);\r\n\r\n\r\n const rootUrl = useRootUrl();\r\n const canEdit = useCanEdit();\r\n\r\n const onOpenSearch = useCallback(() => ((history.push(rootUrl), dispatch(AppActions.SetContextCard(1)))), [history, dispatch, rootUrl]);\r\n const onOpenEdit = useCallback(() => ((history.push(`${rootUrl}/edit`), dispatch(AppActions.SetContextCard(1)))), [history, dispatch, rootUrl]);\r\n\r\n const { editActive, searchActive } = useMemo(() => ({\r\n editActive: location.pathname === `${rootUrl}/edit`,\r\n searchActive: location.pathname === rootUrl\r\n }), [location.pathname, rootUrl]);\r\n\r\n\r\n const topRightStyle = {\r\n transform: `translate3d(${-deltaX}px,0,0)`,\r\n transition: touchActive ? \"none\" : \"transform 0.25s\"\r\n };\r\n\r\n const toolbarWidth = (canCreateChild + (canCreateSibling * !slimMode) + canCollapse) * 48;\r\n\r\n const centerStyle = {\r\n transform: `translate3d(${-Math.max((width / 2) - (toolbarWidth / 2), deltaX + 64 + (130 + 232) * !slimMode + (44) * slimMode)}px,0,0)`, // the 130px offset here is due to TODO this used to be 208, not 232, hmm\r\n transition: touchActive ? \"none\" : \"transform 0.25s\",\r\n width: toolbarWidth\r\n };\r\n\r\n const bottomRightStyle = {\r\n transform: `translateX(${-deltaX}px)`,\r\n transition: touchActive ? \"none\" : \"transform 0.25s\"\r\n };\r\n\r\n return <>\r\n\r\n <PaneController className={classes.bottomLeft} active={!dragOverActive} />\r\n\r\n <ContextController className={classes.topLeft} slimMode={semiSlimMode} active={!dragOverActive} />\r\n\r\n <Fade in={!dragOverActive}>\r\n <div style={bottomRightStyle} className={classes.helpCenterContainer} >\r\n <HelpCenterController size=\"small\" />\r\n </div>\r\n </Fade>\r\n\r\n <div className={classes.topRight} style={topRightStyle}>\r\n {useMemo(() => (\r\n <>\r\n <Grid container>\r\n <Grid item>\r\n <OnlineStateController className={slimMode ? classes.slimTopRightOnlineStateController : classes.topRightOnlineStateController} slimMode={slimMode} active={!dragOverActive} />\r\n </Grid>\r\n\r\n\r\n <Grid item>\r\n <ConditionalPortal active={slimMode}>\r\n <GButton direction={slimMode ? \"column\" : \"row\"} active={!dragOverActive} className={slimMode ? classes.topRightButtonSlim : undefined}>\r\n\r\n <ShareController slimMode={slimMode} />\r\n\r\n <InboxController slimMode={slimMode} />\r\n\r\n <AdvisorController slimMode={slimMode} />\r\n\r\n <Divider orientation={slimMode ? \"horizontal\" : \"vertical\"} flexItem className={slimMode ? classes.dividerHorizontal : classes.dividerVertical} />\r\n\r\n <Tooltip title=\"Open search\" enterDelay={500} placement={slimMode ? \"left\" : undefined}>\r\n <IconButton\r\n className={`${classes.iconButton} ${searchActive ? classes.iconButtonActive : \"\"}`}\r\n onClick={onOpenSearch}\r\n size=\"large\">\r\n <SearchIcon />\r\n </IconButton>\r\n </Tooltip>\r\n\r\n <Tooltip title=\"Edit map\" enterDelay={500} placement={slimMode ? \"left\" : undefined}>\r\n <IconButton\r\n className={`${classes.iconButton} ${editActive ? classes.iconButtonActive : \"\"}`}\r\n onClick={onOpenEdit}\r\n size=\"large\">\r\n <TuneIcon />\r\n </IconButton>\r\n </Tooltip>\r\n\r\n </GButton>\r\n </ConditionalPortal>\r\n\r\n </Grid>\r\n </Grid>\r\n\r\n </>\r\n ), [classes, slimMode, onOpenEdit, onOpenSearch, dragOverActive, searchActive, editActive])}\r\n </div>\r\n\r\n <div className={classes.topCenter} style={centerStyle}>\r\n {useMemo(() => (\r\n <GButton direction=\"row\" active={!dragOverActive && canEdit}>\r\n {canCreateSibling && !slimMode ? (\r\n <Tooltip title=\"Add sibling\" enterDelay={500}>\r\n <IconButton className={classes.iconButton} onClick={beginCreateSibling} size=\"large\">\r\n <NewSiblingIcon iconColor={theme.palette.neutral.button} />\r\n </IconButton>\r\n </Tooltip>\r\n ) : null}\r\n {canCreateChild ? (\r\n <Tooltip title=\"Add child\" enterDelay={500}>\r\n <IconButton className={`${classes.iconButton} new-child`} onClick={beginCreateChild} size=\"large\">\r\n <NewChildIcon iconColor={theme.palette.neutral.button} />\r\n </IconButton>\r\n </Tooltip>\r\n ) : null}\r\n {!!canCollapse ? (\r\n <Tooltip title={isCollapsed ? \"Expand\" : \"Collapse\"} enterDelay={500}>\r\n <IconButton\r\n className={classes.iconButton}\r\n onClick={collapse}\r\n disabled={!canCollapse}\r\n size=\"large\">\r\n {isCollapsed ? <ExpandMoreIcon /> : <ExpandLessIcon />}\r\n </IconButton>\r\n </Tooltip>\r\n ) : null}\r\n </GButton>\r\n ), [classes, slimMode, beginCreateSibling, beginCreateChild, collapse, theme, dragOverActive, isCollapsed, canCollapse, canEdit, canCreateChild, canCreateSibling])}\r\n </div>\r\n\r\n <ResourceMoveInfoDialog slimMode={slimMode} />\r\n </>;\r\n}","import { useState } from \"react\";\r\nimport { CompactNotesEditor } from \"@emberly/editor\";\r\nimport { useContextId } from \"@emberly/dataplane\";\r\nimport { useDevice } from \"../../../providers/DeviceContext\";\r\nimport { useHistory } from \"react-router\";\r\n\r\nconst templates = [\"empty\", \"description\", \"copyrightlicense\", \"cv\"];\r\n\r\nexport default function MapNotesPanel(props) {\r\n const { readonly, onFocused, active } = props;\r\n const contextId = useContextId();\r\n const [notesActive, setNotesActive] = useState(false);\r\n\r\n const { isMobilePortraitView, isIos, isMobile } = useDevice();\r\n const history = useHistory();\r\n\r\n return (\r\n <CompactNotesEditor \r\n title=\"\"\r\n placeholder=\"\"\r\n noteId={`description-${contextId}`}\r\n active={active === undefined ? notesActive : active}\r\n onFocused={onFocused === undefined ? setNotesActive : onFocused}\r\n scrollAreaDisabled={!readonly}\r\n readonly={readonly}\r\n fullscreenDisabled={!readonly}\r\n templates={templates}\r\n swipeEnabled={readonly}\r\n history={history}\r\n isMobile={isMobile}\r\n isMobilePortraitView={isMobilePortraitView}\r\n isIos={isIos}\r\n />\r\n );\r\n}\r\n","import { useCallback, useState } from \"react\";\r\nimport { Grid, IconButton, Typography, Dialog, Slider, Button } from \"@mui/material\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport { CloudUploadOutlined as CloudUploadIcon, RotateRightOutlined as RotateIcon } from \"@mui/icons-material\";\r\nimport CardHeader from \"../CardHeader\";\r\nimport Cropper from \"react-easy-crop\";\r\nimport ImageUtility from \"../../../common/ImageUtility\";\r\nimport { useDevice } from \"../../../providers/DeviceContext\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n desktopRoot: {\r\n width: \"294px\",\r\n padding: theme.spacing(2)\r\n },\r\n mobileRoot: {\r\n position: \"relative\",\r\n width: \"100%\",\r\n padding: theme.spacing(2)\r\n },\r\n gridItem: {\r\n position: \"relative\",\r\n marginTop: theme.spacing(2),\r\n width: \"100%\"\r\n },\r\n gridItemEditor: {\r\n position: \"relative\",\r\n marginTop: theme.spacing(3),\r\n marginBottom: theme.spacing(2),\r\n width: \"100%\"\r\n },\r\n inputHidden: {\r\n position: \"absolute\",\r\n left: 0,\r\n top: 0,\r\n width: \"100%\",\r\n height: \"100%\",\r\n zIndex: 10,\r\n opacity: 0,\r\n overflow: \"hidden\"\r\n },\r\n formHidden: {\r\n marginLeft: \"auto\",\r\n marginRight: \"auto\",\r\n position: \"relative\",\r\n width: \"180px\",\r\n height: \"180px\",\r\n zIndex: 10,\r\n border: `3px dashed ${theme.palette.divider}`,\r\n borderRadius: \"50%\"\r\n },\r\n editorContainer: {\r\n position: \"relative\",\r\n borderRadius: \"50%\",\r\n width: \"180px\",\r\n height: \"180px\",\r\n overflow: \"hidden\",\r\n border: `1px solid ${theme.palette.grey[500_80]}`,\r\n \"& div div\": {\r\n border: \"none\",\r\n \"&::after, &::before\": {\r\n borderColor: theme.palette.grey[500_80]\r\n }\r\n }\r\n },\r\n uploadIcon: {\r\n position: \"absolute\",\r\n top: \"48px\",\r\n left: \"calc(50% - 18px)\",\r\n width: \"36px\",\r\n height: \"36px\",\r\n color: theme.palette.common.hardIcon\r\n },\r\n uploadText: {\r\n position: \"absolute\",\r\n top: \"50%\",\r\n left: \"calc(50% - 70px)\",\r\n width: \"140px\"\r\n },\r\n slider: {\r\n height: \"180px\",\r\n marginLeft: theme.spacing(1)\r\n },\r\n clearButton: {\r\n position: \"absolute\",\r\n top: theme.spacing(0),\r\n right: theme.spacing(0)\r\n },\r\n rotateButton: {\r\n marginRight: -theme.spacing(2),\r\n marginTop: -theme.spacing(1)\r\n },\r\n useButton: {\r\n width: `calc(50% - ${theme.spacing(0.5)})`,\r\n marginLeft: theme.spacing(0.5)\r\n },\r\n removeButton: {\r\n width: `calc(50% - ${theme.spacing(0.5)})`,\r\n marginRight: theme.spacing(0.5)\r\n }\r\n}));\r\n\r\nconst cropSize = { width: 180, height: 180 };\r\n\r\nexport default function ImageSelect(props) {\r\n const { open, onConfirm, onClose } = props;\r\n const { isMobilePortraitView } = useDevice();\r\n const classes = useStyles();\r\n const [file, setFile] = useState(null);\r\n const [zoom, setZoom] = useState(1);\r\n const [minZoom, setMinZoom] = useState(1);\r\n const [rotation, setRotation] = useState(0);\r\n const [crop, setCrop] = useState({ x: 0, y: 0 });\r\n const [croppedAreaPixels, setCroppedAreaPixels] = useState(null);\r\n\r\n const onCropComplete = useCallback((croppedArea, croppedAreaPixels, c) => {\r\n setCroppedAreaPixels(croppedAreaPixels);\r\n }, [setCroppedAreaPixels]);\r\n\r\n const onMediaLoaded = useCallback((mediaSize) => { // TODO !!!! add minZoom and cropSize to avatarEditor!??\r\n const m = Math.max(mediaSize.naturalWidth / mediaSize.naturalHeight, mediaSize.naturalHeight / mediaSize.naturalWidth);\r\n setMinZoom(m);\r\n setZoom(Math.max(zoom, m));\r\n }, [setMinZoom, setZoom, zoom]);\r\n\r\n const onChange = useCallback((ev) => {\r\n if (!!ev.target.files && ev.target.files.length !== 0) {\r\n setZoom(minZoom);\r\n setRotation(0);\r\n const f = ev.target.files[0];\r\n setFile(URL.createObjectURL(f));\r\n }\r\n }, [setFile, setZoom, setRotation, minZoom]);\r\n\r\n const handleClear = useCallback(() => setFile(null), [setFile]);\r\n const onZoom = useCallback((ev, val) => setZoom(val), [setZoom]);\r\n const onRotate = useCallback(() => setRotation(r => (r + 90) % 360), [setRotation]);\r\n\r\n const handleClose = useCallback(() => {\r\n setFile(null);\r\n onClose();\r\n }, [onClose, setFile]);\r\n\r\n const handleConfirm = useCallback(() => {\r\n const fn = async () => {\r\n const imageData = await ImageUtility.GetCroppedImage(\r\n file,\r\n croppedAreaPixels,\r\n rotation\r\n );\r\n onConfirm(imageData);\r\n handleClose();\r\n };\r\n fn();\r\n }, [handleClose, onConfirm, file, croppedAreaPixels, rotation]);\r\n\r\n return (\r\n <Dialog\r\n open={open}\r\n onClose={handleClose}\r\n aria-labelledby=\"alert-dialog-title\"\r\n aria-describedby=\"alert-dialog-description\"\r\n fullWidth={isMobilePortraitView}\r\n fullScreen={isMobilePortraitView}\r\n >\r\n {isMobilePortraitView ? (\r\n <CardHeader\r\n title=\"Choose image\"\r\n onClose={handleClose}\r\n />\r\n ) : null}\r\n <Grid className={isMobilePortraitView ? classes.mobileRoot : classes.desktopRoot} container justifyContent=\"flex-start\" direction=\"column\" alignItems=\"center\">\r\n {!isMobilePortraitView ? (\r\n <Grid item container justifyContent=\"center\">\r\n <Typography variant=\"h6\">Choose image</Typography>\r\n </Grid>\r\n ) : null}\r\n\r\n <Grid item container className={classes.gridItemEditor} justifyContent=\"center\">\r\n {!file ? (\r\n <form className={classes.formHidden}>\r\n <input\r\n className={classes.inputHidden}\r\n type=\"file\"\r\n name=\"Avatar Editor\"\r\n accept=\"image/jpeg,image/png\"\r\n onChange={onChange}\r\n multiple={false}\r\n />\r\n <CloudUploadIcon className={classes.uploadIcon} />\r\n <Typography variant=\"body1\" className={classes.uploadText} align=\"center\">\r\n Drop image here<br/>\r\n or click to upload\r\n </Typography>\r\n </form>\r\n ) : (\r\n <Grid container justifyContent=\"center\" alignItems=\"flex-start\" flexWrap=\"nowrap\">\r\n <IconButton className={classes.rotateButton} onClick={onRotate} size=\"large\">\r\n <RotateIcon />\r\n </IconButton>\r\n <div className={classes.editorContainer}>\r\n <Cropper\r\n width={211}\r\n height={211}\r\n image={file}\r\n crop={crop}\r\n zoom={zoom}\r\n showGrid={true}\r\n cropShape=\"round\"\r\n rotation={rotation}\r\n onCropChange={setCrop}\r\n onCropComplete={onCropComplete}\r\n onZoomChange={setZoom}\r\n cropSize={cropSize}\r\n minZoom={minZoom}\r\n maxZoom={8}\r\n onMediaLoaded={onMediaLoaded}\r\n />\r\n </div>\r\n <Slider\r\n color=\"primary\"\r\n orientation=\"vertical\"\r\n className={classes.slider}\r\n value={zoom}\r\n min={minZoom}\r\n max={8}\r\n step={0.01}\r\n onChange={onZoom}\r\n />\r\n </Grid>\r\n )}\r\n </Grid>\r\n <Grid item container className={classes.gridItem} justifyContent=\"space-between\">\r\n {\r\n !file ? (\r\n <Button onClick={handleClose} fullWidth>Cancel</Button>\r\n ) : (\r\n <>\r\n <Button className={classes.removeButton} onClick={handleClear} fullWidth>Remove</Button>\r\n <Button className={classes.useButton} onClick={handleConfirm} variant=\"contained\" color=\"primary\" fullWidth>Use</Button>\r\n </>\r\n )\r\n }\r\n </Grid>\r\n </Grid>\r\n </Dialog>\r\n );\r\n}\r\n","import withStyles from '@mui/styles/withStyles';\r\nimport MuiAccordion from \"@mui/material/Accordion\";\r\nimport MuiAccordionSummary from \"@mui/material/AccordionSummary\";\r\nimport MuiAccordionDetails from \"@mui/material/AccordionDetails\";\r\n\r\nexport const Accordion = withStyles({\r\n root: {\r\n border: \"1px solid rgba(0, 0, 0, .125)\",\r\n borderLeft: 0,\r\n borderRight: 0,\r\n boxShadow: \"none\",\r\n \"&:not(:last-child)\": {\r\n borderBottom: 0,\r\n },\r\n \"&:before\": {\r\n display: \"none\",\r\n },\r\n \"&$expanded\": {\r\n margin: \"auto\",\r\n },\r\n },\r\n expanded: {},\r\n})(MuiAccordion);\r\n\r\nexport const AccordionSummary = withStyles({\r\n root: {\r\n minHeight: 56,\r\n \"&$expanded\": {\r\n minHeight: 56\r\n },\r\n },\r\n content: {\r\n \"&$expanded\": {\r\n margin: \"12px 0\",\r\n },\r\n },\r\n expanded: {},\r\n})(MuiAccordionSummary);\r\n\r\nexport const AccordionDetails = withStyles((theme) => ({\r\n root: {\r\n padding: theme.spacing(2),\r\n paddingTop: theme.spacing(0)\r\n },\r\n}))(MuiAccordionDetails);","import { useCallback, useMemo, useEffect, useState } from \"react\";\r\nimport { Grid, Typography, Divider, Button, LinearProgress, TextField, Collapse, Table, TableCell, TableRow, TableBody, Dialog } from \"@mui/material\";\r\nimport { LoadingButton } from \"@mui/lab\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport { useSelector, useDispatch } from \"react-redux\";\r\nimport CardHeader from \"../../atoms/CardHeader\";\r\nimport Scrollbar from \"../../atoms/Scrollbar\";\r\nimport { getRootUrl } from \"../../../hooks/useApp\";\r\nimport { FileCopyOutlined as FileCopyIcon, DeleteForeverOutlined as DeleteIcon, PhotoOutlined as PhotoIcon, TextFieldsOutlined as TextIcon, Notes as NoteIcon, Attachment as LinkIcon, ExpandMore as ExpandMoreIcon } from \"@mui/icons-material\";\r\nimport MapNotesPanel from \"../../molecules/editors/MapNotesPanel\";\r\nimport ConfirmDialog from \"../../atoms/views/ConfirmDialog\";\r\nimport { useDefaultOpenCard } from \"../../../hooks/useCard\";\r\nimport StandardToggle from \"../../atoms/inputs/StandardToggle\";\r\nimport ImageSelect from \"../../atoms/inputs/ImageSelect\";\r\nimport { Accordion, AccordionSummary, AccordionDetails } from \"../../atoms/views/Accordion\";\r\nimport { usePlanWithTreeLimits } from \"../../../hooks/usePlan\";\r\nimport DuplicatePanel from \"../../molecules/panels/DuplicatePanel\";\r\nimport { Link, useHistory, useLocation, useRouteMatch } from \"react-router-dom\";\r\nimport { useDevice } from \"../../../providers/DeviceContext\";\r\nimport { useRTACProfileById, useEntityFirstOrDefault, useChildren, useEntity } from \"@emberly/dataplane\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n root: {\r\n position: \"relative\",\r\n width: \"100%\",\r\n height: \"100%\"\r\n },\r\n header: {\r\n padding: theme.spacing(2),\r\n paddingBottom: theme.spacing(3),\r\n paddingTop: `calc(${theme.spacing(2)} + 2px)`,\r\n userSelect: \"none\",\r\n background: theme.palette.background.paper,\r\n borderBottom: `1px solid ${theme.palette.divider}`\r\n },\r\n collapse: {\r\n background: theme.palette.background.paper\r\n },\r\n item: {\r\n paddingLeft: 0,\r\n paddingRight: 0,\r\n width: \"100%\"\r\n },\r\n contentItem: {\r\n paddingLeft: theme.spacing(2),\r\n paddingRight: theme.spacing(2),\r\n paddingTop: theme.spacing(2),\r\n width: \"100%\"\r\n },\r\n accordionItem: {\r\n paddingLeft: theme.spacing(0),\r\n paddingRight: theme.spacing(0),\r\n paddingTop: theme.spacing(0),\r\n width: \"100%\"\r\n },\r\n accordionRoot: {\r\n borderColor: theme.palette.divider\r\n },\r\n progress: {\r\n position: \"absolute\",\r\n top: 0,\r\n width: \"100%\"\r\n },\r\n mapNameTextField: {\r\n marginBottom: theme.spacing(2.5),\r\n \"& > p\": {\r\n marginLeft: \"0 !important\"\r\n }\r\n },\r\n centerTextField: {\r\n marginTop: theme.spacing(2),\r\n marginBottom: theme.spacing(1)\r\n },\r\n topButton: {\r\n justifyContent: \"flex-start\",\r\n marginBottom: theme.spacing(1),\r\n },\r\n deleteButton: {\r\n justifyContent: \"flex-start\",\r\n marginTop: theme.spacing(1),\r\n marginBottom: theme.spacing(1),\r\n },\r\n uploadButton: {\r\n justifyContent: \"flex-start\",\r\n marginTop: theme.spacing(1),\r\n marginBottom: theme.spacing(1),\r\n },\r\n button: {\r\n justifyContent: \"flex-start\",\r\n marginTop: theme.spacing(1),\r\n marginBottom: theme.spacing(1),\r\n },\r\n commentContainer: {\r\n position: \"relative\",\r\n minHeight: \"auto\",\r\n height: \"100%\",\r\n maxWidth: \"100%\",\r\n overflowX: \"visible\",\r\n overflowY: \"visible\",\r\n borderTop: `1px solid ${theme.palette.divider}`\r\n },\r\n layoutButtonGrid: {\r\n marginTop: theme.spacing(0.5),\r\n marginBottom: theme.spacing(2),\r\n \"& > :first-child\": {\r\n marginRight: theme.spacing(1)\r\n },\r\n \"& > :last-child\": {\r\n marginLeft: theme.spacing(1)\r\n }\r\n },\r\n layoutButton: {\r\n height: \"152px\",\r\n flexGrow: 0.5,\r\n background: theme.palette.common.canvas,\r\n \"& > span > img\": {\r\n maxWidth: \"100%\",\r\n },\r\n \"&:disabled\": {\r\n border: `3px solid ${theme.palette.softOutlines} !important`,\r\n background: theme.palette.background.paper,\r\n \"& > span > img\": {\r\n filter: \"grayscale(50%)\"\r\n }\r\n },\r\n },\r\n layoutButtonSelected: {\r\n border: `3px solid ${theme.palette.primary.main} !important`\r\n },\r\n layoutButtonCaption: {\r\n marginTop: theme.spacing(-1),\r\n marginBottom: theme.spacing(1),\r\n display: \"block\"\r\n },\r\n switch: {\r\n float: \"right\",\r\n margin: 0\r\n },\r\n caption: {\r\n marginBottom: theme.spacing(2),\r\n display: \"block\"\r\n },\r\n icon: {\r\n color: theme.palette.common.softIcon\r\n },\r\n table: {\r\n\r\n },\r\n tableCellHeader: {\r\n border: \"none\",\r\n paddingLeft: \"1px\"\r\n },\r\n tableCellBody: {\r\n border: \"none\",\r\n paddingLeft: \"1px\",\r\n color: theme.palette.text.secondary,\r\n \"& a\": {\r\n textDecoration: \"none\",\r\n color: theme.palette.primary.main,\r\n fontWeight: \"bold\"\r\n }\r\n }\r\n}));\r\n\r\nconst textFieldProps = { maxLength: 160 };\r\n\r\nexport default function MapSettingsView() {\r\n const history = useHistory();\r\n const match = useRouteMatch();\r\n const location = useLocation();\r\n const id = match.params.mapId;\r\n const classes = useStyles();\r\n const notesFullscreen = useSelector(state => state.app.notesFullscreen);\r\n const { isMobilePortraitView } = useDevice();\r\n const { entity: map, loading } = useEntity(\"Map\", id, true, \"default\");\r\n const { entity: rootNode, updateCount: nodeUpdateCount } = useEntityFirstOrDefault(\"Node\", t => t.isRoot, true);\r\n const { children } = useChildren(\"Node\", rootNode?.id, false);\r\n const { currentTreeTopics, currentTreeTopicLimit, isOwner } = usePlanWithTreeLimits();\r\n const { profile: lastModifiedByProfile } = useRTACProfileById(map && map.lastModifiedBy.length !== 0 ? map.lastModifiedBy[0].userId : null);\r\n const { profile: ownerProfile } = useRTACProfileById(map?.publicUserId);\r\n\r\n const [name, setName] = useState(\"\");\r\n const [centerText, setCenterText] = useState(\"\");\r\n const [deleteDialogOpen, setDeleteDialogOpen] = useState(false);\r\n const [duplicateDialogOpen, setDuplicateDialogOpen] = useState(false);\r\n const [notesActive, setNotesActive] = useState(false);\r\n const [imageDialogOpen, setImageDialogOpen] = useState(false);\r\n\r\n const setShowHasNotes = useCallback((visible) => {\r\n if (rootNode) {\r\n rootNode.setHasNotes(typeof visible === \"boolean\" ? visible : !rootNode.hasNotes())\r\n }\r\n }, [rootNode]);\r\n\r\n const setShowHasResources = useCallback((visible) => {\r\n if (rootNode) {\r\n rootNode.setHasResources(typeof visible === \"boolean\" ? visible : !rootNode.hasResources())\r\n }\r\n }, [rootNode]);\r\n\r\n const canDisableFullTree = children.length === 1;\r\n const isTreeEmpty = children.length === 0;\r\n const isFullTree = rootNode ? rootNode.side === 0 : true;\r\n\r\n const dispatch = useDispatch();\r\n useDefaultOpenCard(location.pathname.endsWith(\"/edit\"));\r\n\r\n const expandedCommentField = isMobilePortraitView && notesActive;\r\n\r\n useEffect(() => {\r\n if (!!map) {\r\n setName(map.name);\r\n }\r\n }, [map, setName]);\r\n\r\n useEffect(() => {\r\n if (!!map && !!name && name !== map.name) { // TODO if name is root or unknown we default to avatar, if it is IMG[url] we use a custom image, if it is TEXT[text] we use custom text, and add string escape!\r\n const timer = setTimeout(() => {\r\n map.setName(name);\r\n }, 500);\r\n return () => {\r\n clearTimeout(timer);\r\n }\r\n }\r\n }, [name, map]);\r\n\r\n\r\n const useTextAsCenter = useMemo(() => {\r\n if (!!rootNode) {\r\n if (rootNode.hasCustomText()) {\r\n setCenterText(rootNode.customTextValue());\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n } else {\r\n return false;\r\n }\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [setCenterText, rootNode, nodeUpdateCount]);\r\n\r\n const toggleUseCustomText = useCallback(() => {\r\n if (!!rootNode) {\r\n if (rootNode.hasCustomText()) {\r\n rootNode.setCustomImage(null);\r\n } else {\r\n rootNode.setCustomText(map.name);\r\n setCenterText(map.name);\r\n }\r\n }\r\n }, [map, rootNode]);\r\n\r\n useEffect(() => {\r\n if (rootNode && !!centerText && rootNode.isFullTree() && useTextAsCenter) {\r\n const timer = setTimeout(() => rootNode?.setCustomText(centerText), 250);\r\n return () => clearTimeout(timer);\r\n }\r\n }, [centerText, dispatch, rootNode, useTextAsCenter]); // TODO\r\n\r\n const onClose = useCallback(() => {\r\n if (expandedCommentField) {\r\n setNotesActive(false);\r\n } else {\r\n history.push(getRootUrl());\r\n }\r\n }, [history, setNotesActive, expandedCommentField]);\r\n\r\n const onChangeName = useCallback(ev => setName(ev.target.value), [setName]);\r\n const onChangeCenterText = useCallback(ev => setCenterText(ev.target.value), [setCenterText]);\r\n const onDuplicateInit = useCallback(() => setDuplicateDialogOpen(true), [setDuplicateDialogOpen]);\r\n const onDuplicateCancel = useCallback(() => setDuplicateDialogOpen(false), [setDuplicateDialogOpen]);\r\n\r\n const onDeleteInit = useCallback(() => setDeleteDialogOpen(true), [setDeleteDialogOpen]);\r\n const onDeleteCancel = useCallback(() => setDeleteDialogOpen(false), [setDeleteDialogOpen]);\r\n\r\n const onDeleteConfirm = useCallback(() => {\r\n setDeleteDialogOpen(false);\r\n setTimeout(() => {\r\n map.delete();\r\n history.push(\"/app/home\");\r\n }, 1);\r\n }, [history, map]);\r\n\r\n const toggleFullTree = useCallback((val) => {\r\n if (val !== null && (canDisableFullTree || !isFullTree)) {\r\n rootNode?.setFullTree(val);\r\n }\r\n }, [canDisableFullTree, isFullTree, rootNode]);\r\n\r\n const onOpenImageDialog = useCallback(() => setImageDialogOpen(true), [setImageDialogOpen]);\r\n const onCloseImageDialog = useCallback(() => setImageDialogOpen(false), [setImageDialogOpen]);\r\n\r\n const [uploadingCenterImage, setUploadingCenterImage] = useState(false);\r\n\r\n const onImageUpload = useCallback((imageData) => {\r\n setUploadingCenterImage(true);\r\n rootNode?.uploadCenterImage(map.id, imageData)\r\n .then(() => {\r\n setUploadingCenterImage(false);\r\n })\r\n .catch(() => {\r\n setUploadingCenterImage(false);\r\n });\r\n }, [rootNode, map]);\r\n\r\n const layoutDisabled = isFullTree && !canDisableFullTree;\r\n\r\n return <>\r\n <Grid className={classes.root} container spacing={0} direction=\"column\" justifyContent=\"flex-start\" alignItems=\"stretch\">\r\n <Grid item className={classes.item}>\r\n {\r\n isMobilePortraitView ? (\r\n <CardHeader\r\n title={expandedCommentField ? \"Description\" : \"Edit Map\"}\r\n onConfirm={expandedCommentField ? onClose : undefined}\r\n onExpandMore={expandedCommentField ? undefined : onClose}\r\n border\r\n />\r\n ) : (\r\n null\r\n )\r\n }\r\n </Grid>\r\n {\r\n (loading || !map) ? (\r\n <LinearProgress variant=\"indeterminate\" className={classes.progress} color=\"neutral\" />\r\n ) : (\r\n <Grid item xs container>\r\n <Scrollbar>\r\n\r\n {!isMobilePortraitView ? (\r\n <Typography variant=\"h5\" className={classes.header}>\r\n Map settings\r\n </Typography>\r\n ) : null}\r\n\r\n <Collapse in={!expandedCommentField && !notesFullscreen} className={classes.collapse}>\r\n <Grid item className={classes.contentItem}>\r\n <Typography variant=\"subtitle1\">Map name</Typography>\r\n </Grid>\r\n\r\n <Grid item className={classes.contentItem}>\r\n <TextField\r\n id=\"map-name\"\r\n inputProps={textFieldProps}\r\n className={classes.mapNameTextField}\r\n value={name}\r\n onChange={onChangeName}\r\n variant=\"outlined\"\r\n fullWidth\r\n disabled={!isOwner}\r\n />\r\n </Grid>\r\n\r\n <Accordion defaultExpanded className={classes.accordionRoot}>\r\n <AccordionSummary expandIcon={<ExpandMoreIcon />} >\r\n <Typography variant=\"subtitle1\">Map info</Typography>\r\n </AccordionSummary>\r\n <AccordionDetails>\r\n <Table size=\"small\" className={classes.table}>\r\n <TableBody>\r\n <TableRow>\r\n <TableCell className={classes.tableCellHeader}>Topics</TableCell>\r\n <TableCell className={classes.tableCellBody}>\r\n {currentTreeTopics}{typeof currentTreeTopicLimit === \"number\" ? ` out of ${currentTreeTopicLimit}` : \"\"} {typeof currentTreeTopicLimit === \"number\" && isOwner ? (<Link to=\"/app/settings/plans\">Upgrade</Link>) : null}\r\n </TableCell>\r\n </TableRow>\r\n\r\n <TableRow>\r\n <TableCell className={classes.tableCellHeader}>Owner</TableCell>\r\n <TableCell className={classes.tableCellBody}>{ownerProfile?.fullName}</TableCell>\r\n </TableRow>\r\n\r\n {\r\n map.lastModifiedBy.length !== 0 ? (\r\n <TableRow>\r\n <TableCell className={classes.tableCellHeader}>Modified</TableCell>\r\n <TableCell className={classes.tableCellBody}>{new Date(map.lastModifiedBy[0].time).toDateString()}{lastModifiedByProfile?.fullName ? ` by ${lastModifiedByProfile?.fullName}` : \"\"}</TableCell>\r\n </TableRow>\r\n ) : null\r\n }\r\n\r\n <TableRow>\r\n <TableCell className={classes.tableCellHeader}>Created</TableCell>\r\n <TableCell className={classes.tableCellBody}>{map.created.toDateString()}</TableCell>\r\n </TableRow>\r\n\r\n </TableBody>\r\n </Table>\r\n\r\n </AccordionDetails>\r\n </Accordion>\r\n\r\n <Accordion defaultExpanded className={classes.accordionRoot}>\r\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\r\n <Typography variant=\"subtitle1\">Layout</Typography>\r\n </AccordionSummary>\r\n <AccordionDetails>\r\n <Grid item xs container>\r\n\r\n <Grid container item className={classes.accordionItem} direction=\"column\">\r\n <Grid item container className={classes.layoutButtonGrid} justifyContent=\"space-between\" alignItems=\"center\">\r\n <Button className={`${classes.layoutButton} ${isFullTree ? classes.layoutButtonSelected : \"\"}`} variant=\"outlined\" disabled={layoutDisabled || !isOwner} onClick={() => toggleFullTree(true)}>\r\n <img src=\"/assets/layout_tree.svg\" alt=\"layout tree\"></img>\r\n </Button>\r\n <Button className={`${classes.layoutButton} ${!isFullTree ? classes.layoutButtonSelected : \"\"}`} variant=\"outlined\" disabled={layoutDisabled || !isOwner} onClick={() => toggleFullTree(false)}>\r\n <img src=\"/assets/layout_sapling.svg\" alt=\"layout branch\"></img>\r\n </Button>\r\n </Grid>\r\n {layoutDisabled ? (\r\n <Grid item>\r\n <Typography variant=\"caption\" color=\"textSecondary\" className={classes.layoutButtonCaption}>\r\n {isTreeEmpty ? \"Create a single branch if you want to switch layout\" : \"Reduce to one branch if you want to switch layout\"}\r\n </Typography>\r\n </Grid>\r\n ) : null}\r\n </Grid>\r\n\r\n {isFullTree ? (\r\n <>\r\n <Grid item className={classes.accordionItem}>\r\n <Button className={classes.button} onClick={toggleUseCustomText} color=\"neutral\" startIcon={<TextIcon className={classes.icon} />} fullWidth disabled={!isOwner}>\r\n Use text as center node\r\n <Grid item xs container justifyContent=\"flex-end\">\r\n <StandardToggle\r\n className={classes.switch}\r\n checked={useTextAsCenter}\r\n color=\"secondary\"\r\n disabled={!isOwner}\r\n />\r\n </Grid>\r\n </Button>\r\n </Grid>\r\n\r\n {useTextAsCenter ? (\r\n <Grid item className={classes.accordionItem}>\r\n <TextField\r\n id=\"map-root-name\"\r\n label=\"Center text\"\r\n value={centerText}\r\n className={classes.centerTextField}\r\n onChange={onChangeCenterText}\r\n variant=\"outlined\"\r\n fullWidth\r\n disabled={!isOwner}\r\n inputProps={textFieldProps}\r\n />\r\n </Grid>\r\n ) : (\r\n <Grid item className={classes.accordionItem}>\r\n <LoadingButton \r\n className={classes.uploadButton} \r\n loading={uploadingCenterImage} \r\n loadingPosition=\"start\"\r\n onClick={onOpenImageDialog} \r\n color=\"neutral\" \r\n startIcon={<PhotoIcon className={classes.icon} />} \r\n disabled={!isOwner}\r\n fullWidth \r\n >\r\n Upload custom photo\r\n </LoadingButton>\r\n </Grid>\r\n )}\r\n </>\r\n ) : null}\r\n </Grid>\r\n </AccordionDetails>\r\n </Accordion>\r\n\r\n <Accordion className={classes.accordionRoot}>\r\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\r\n <Typography variant=\"subtitle1\">Show icons</Typography>\r\n </AccordionSummary>\r\n <AccordionDetails>\r\n <Grid item xs container>\r\n\r\n <Grid item className={classes.accordionItem}>\r\n <Button className={classes.topButton} onClick={setShowHasNotes} startIcon={<NoteIcon className={classes.icon} />} color=\"neutral\" fullWidth disabled={!isOwner}>\r\n Has notes\r\n <Grid item xs container justifyContent=\"flex-end\">\r\n <StandardToggle\r\n className={classes.switch}\r\n checked={rootNode?.hasNotes() || false}\r\n color=\"secondary\"\r\n disabled={!isOwner}\r\n />\r\n </Grid>\r\n </Button>\r\n </Grid>\r\n\r\n <Grid item className={classes.accordionItem}>\r\n <Button className={classes.button} onClick={setShowHasResources} startIcon={<LinkIcon className={classes.icon} />} color=\"neutral\" fullWidth disabled={!isOwner}>\r\n Has resources\r\n <Grid item xs container justifyContent=\"flex-end\">\r\n <StandardToggle\r\n className={classes.switch}\r\n checked={rootNode?.hasResources() || false}\r\n color=\"secondary\"\r\n disabled={!isOwner}\r\n />\r\n </Grid>\r\n </Button>\r\n </Grid>\r\n\r\n </Grid>\r\n </AccordionDetails>\r\n </Accordion>\r\n\r\n <Accordion className={classes.accordionRoot}>\r\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\r\n <Typography variant=\"subtitle1\">Actions</Typography>\r\n </AccordionSummary>\r\n <AccordionDetails>\r\n <Grid item xs container>\r\n\r\n <Grid item className={classes.accordionItem}>\r\n <Button color=\"neutral\" variant=\"text\" className={classes.topButton} onClick={onDuplicateInit} startIcon={<FileCopyIcon className={classes.icon} />} fullWidth>\r\n Duplicate\r\n </Button>\r\n </Grid>\r\n\r\n <Grid item className={classes.accordionItem}>\r\n <Button className={classes.deleteButton} color=\"error\" onClick={onDeleteInit} startIcon={<DeleteIcon />} fullWidth>\r\n {isOwner ? \"Move to trash\" : \"Leave map\"}\r\n </Button>\r\n </Grid>\r\n\r\n </Grid>\r\n </AccordionDetails>\r\n </Accordion>\r\n\r\n <Divider />\r\n\r\n <Grid item className={classes.contentItem}>\r\n <Typography variant=\"subtitle1\">Notes</Typography>\r\n <Typography className={classes.caption} variant=\"caption\" color=\"textSecondary\">Visible when you share map</Typography>\r\n </Grid>\r\n\r\n </Collapse>\r\n\r\n <Grid item className={classes.commentContainer}>\r\n <MapNotesPanel\r\n onFocused={setNotesActive}\r\n active={notesActive}\r\n />\r\n </Grid>\r\n\r\n </Scrollbar>\r\n </Grid>\r\n )\r\n }\r\n </Grid>\r\n <ImageSelect\r\n open={imageDialogOpen}\r\n onClose={onCloseImageDialog}\r\n onConfirm={onImageUpload}\r\n />\r\n <ConfirmDialog\r\n open={deleteDialogOpen}\r\n title={isOwner ? \"Move to trash?\" : \"Leave map?\"}\r\n confirmText={isOwner ? \"Move to trash\" : \"Leave map\"}\r\n confirmColor=\"error\"\r\n cancelText=\"Cancel\"\r\n description={\r\n isOwner ?\r\n \"Are you sure you want to move this map to trash? If this map has any members, they will be removed.\" :\r\n \"Are you sure you want to leave this map?\"\r\n }\r\n onCancel={onDeleteCancel}\r\n onConfirm={onDeleteConfirm}\r\n />\r\n <Dialog open={duplicateDialogOpen} onClose={onDuplicateCancel} fullScreen={isMobilePortraitView}>\r\n <DuplicatePanel onClose={onDuplicateCancel} />\r\n </Dialog>\r\n </>;\r\n}","import { useMemo, useEffect, useCallback, useState } from \"react\";\r\nimport { makeStyles, useTheme } from \"@mui/styles\";\r\nimport { Tooltip, IconButton, Grid, Button, Divider, Menu, MenuItem, Dialog } from \"@mui/material\";\r\nimport * as TreeActions from \"../../../actions/tree\";\r\nimport * as AppActions from \"../../../actions/app\";\r\nimport { useDispatch, useSelector } from \"react-redux\";\r\nimport { getRootUrl } from \"../../../hooks/useApp\";\r\nimport {\r\n Add as AddIcon,\r\n Remove as RemoveIcon,\r\n OpenInNew as OpenInNewIcon,\r\n CommentOutlined as CommentIcon,\r\n Search as SearchIcon,\r\n MoreHoriz as MoreHorizIcon,\r\n FitScreenOutlined as FitScreenIcon\r\n} from \"@mui/icons-material\";\r\nimport { useDevice } from \"../../../providers/DeviceContext\";\r\nimport DuplicatePanel from \"../panels/DuplicatePanel\";\r\nimport { useContextId, useEntity, useRTACAuth, useRTACProfile } from \"@emberly/dataplane\";\r\nimport { setAffiliateId } from \"../../../common/AffiliateHandler\";\r\nimport { useHistory, useLocation } from \"react-router\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n bottomLeftGridEmbed: { // TODO\r\n position: \"absolute\",\r\n bottom: \"4px\",\r\n left: \"4px\",\r\n height: \"auto\",\r\n width: \"auto\"\r\n },\r\n bottomRightGrid: {\r\n position: \"absolute\",\r\n bottom: \"8px\",\r\n right: \"12px\",\r\n height: \"auto\",\r\n width: \"auto\"\r\n },\r\n bottomRightGridEmbed: {\r\n position: \"absolute\",\r\n bottom: \"4px\",\r\n right: \"4px\",\r\n height: \"auto\",\r\n width: \"auto\"\r\n },\r\n topLeftGrid: {\r\n position: \"absolute\",\r\n top: \"8px\",\r\n left: \"8px\",\r\n height: \"auto\",\r\n width: \"auto\"\r\n },\r\n topLeftGridMobile: {\r\n position: \"absolute\",\r\n top: \"8px\",\r\n left: \"8px\",\r\n height: \"56px\",\r\n width: \"auto\"\r\n },\r\n topRightGrid: {\r\n position: \"absolute\",\r\n top: \"8px\",\r\n right: \"12px\",\r\n height: \"auto\",\r\n width: \"auto\"\r\n },\r\n glass: {\r\n borderRadius: \"4px\",\r\n padding: \"4px\",\r\n zIndex: 2,\r\n transition: \"transform 0.25s\",\r\n background: theme.palette.background.glass,\r\n },\r\n divider: {\r\n height: \"32px\",\r\n marginTop: \"auto\",\r\n marginBottom: \"auto\",\r\n marginLeft: \"4px\",\r\n marginRight: \"4px\"\r\n },\r\n iconButton: {\r\n\r\n },\r\n logo: {\r\n height: \"16px\"\r\n },\r\n translateLeft: {\r\n transform: props => `translateX(-${props.cardWidth+8}px)`\r\n },\r\n translateLeftWidget: {\r\n transform: \"translateX(-48px)\"\r\n },\r\n active: {\r\n background: theme.palette.action.hover\r\n },\r\n mobileLink: {\r\n position: \"absolute\",\r\n bottom: \"16px\",\r\n width: \"88px\",\r\n left: \"50%\",\r\n marginLeft: \"-44px\"\r\n },\r\n image: {\r\n width: \"100%\",\r\n height: \"auto\"\r\n },\r\n error: {\r\n color: theme.palette.error.main\r\n }\r\n}));\r\n\r\nexport default function EmbedOverlay(props) {\r\n const { deltaX, widgetActive, width } = props;\r\n const classes = useStyles(props);\r\n const dispatch = useDispatch();\r\n const history = useHistory();\r\n const location = useLocation();\r\n const showEmbedDescription = useSelector(state => state.app.showEmbedDescription);\r\n const { isPortrait, isMobile, isEmbed } = useDevice();\r\n const isMobilePortrait = isPortrait && isMobile && !isEmbed;\r\n const contextId = useContextId();\r\n const { isAuthenticated, loading, context, logout } = useRTACAuth();\r\n const { profile } = useRTACProfile(false);\r\n const { entity } = useEntity(\"Map\", contextId, true, \"default\");\r\n const [duplicateOpen, setDuplicateOpen] = useState(false);\r\n const [anchorEl, setAnchorEl] = useState(null);\r\n const hideTopLeft = width - deltaX < 280 && !widgetActive;\r\n const theme = useTheme();\r\n \r\n const handleDuplicateClose = useCallback(() => {\r\n setDuplicateOpen(false);\r\n }, []);\r\n\r\n\r\n const onZoomIn = useCallback(() => dispatch(TreeActions.Zoom(0.75)), [dispatch]);\r\n const onZoomOut = useCallback(() => dispatch(TreeActions.Zoom(-0.75)), [dispatch]);\r\n const onFit = useCallback(() => dispatch(TreeActions.CenterView()), [dispatch])\r\n const onOpenDescription = useCallback(() => ((history.push(`${getRootUrl()}/description`), dispatch(AppActions.SetContextCard(1)))), [history, dispatch]);\r\n const onOpenSearch = useCallback(() => ((history.push(`${getRootUrl()}/search`), dispatch(AppActions.SetContextCard(1)))), [history, dispatch]);\r\n const onOpenEmberly = useCallback(() => history.push(\"/\"), [history]);\r\n\r\n const onOpenDuplicate = useCallback(() => {\r\n if (isAuthenticated) {\r\n setDuplicateOpen(true);\r\n setAnchorEl(null);\r\n } else {\r\n if (!!entity?.publicUserId) {\r\n setAffiliateId(entity.publicUserId, true);\r\n }\r\n\r\n context?.authProvider?.loginWithRedirect({\r\n redirect_uri: window.location.origin + \"/app\",\r\n screen_hint: \"signup\",\r\n appState: { targetUrl: window.location.pathname, searchParams: window.location.search + \"&forceduplicate=true\" }\r\n });\r\n }\r\n }, [isAuthenticated, context, entity]);\r\n\r\n useEffect(() => {\r\n if (isAuthenticated && window.location.search.includes(\"forceduplicate\")) {\r\n onOpenDuplicate();\r\n }\r\n }, [isAuthenticated, onOpenDuplicate]);\r\n\r\n const onLogin = useCallback(() => {\r\n if (!isAuthenticated) {\r\n if (!!entity?.publicUserId) {\r\n setAffiliateId(entity.publicUserId, true);\r\n }\r\n\r\n context?.authProvider?.loginWithRedirect({\r\n redirect_uri: window.location.origin + \"/app\",\r\n screen_hint: \"signup\",\r\n appState: { targetUrl: window.location.pathname, searchParams: window.location.search }\r\n });\r\n }\r\n }, [context, isAuthenticated, entity]);\r\n\r\n\r\n useEffect(() => { dispatch(TreeActions.SetDragEnabled(!isMobilePortrait)); }, [dispatch, isMobilePortrait]);\r\n\r\n const descriptionActive = useMemo(() => location.pathname === `${getRootUrl(location.pathname)}/description`, [location.pathname]);\r\n const searchActive = useMemo(() => location.pathname === `${getRootUrl(location.pathname)}/search`, [location.pathname]);\r\n const open = deltaX !== 0;\r\n const showAuth = !isAuthenticated && !loading;\r\n const iconSize = isMobilePortrait ? \"medium\" : \"small\";\r\n const buttonSize = isMobilePortrait ? \"large\" : \"medium\";\r\n\r\n\r\n const handleClick = useCallback((ev) => {\r\n ev.stopPropagation();\r\n ev.preventDefault();\r\n setAnchorEl(ev.currentTarget);\r\n }, []);\r\n\r\n const handleClose = useCallback((ev) => {\r\n ev.preventDefault();\r\n setAnchorEl(null);\r\n }, []);\r\n\r\n const onCopyLink = useCallback(() => {\r\n\r\n const fn = async () => {\r\n const value = `${window.location.origin}${getRootUrl()}`;\r\n\r\n try {\r\n if (navigator.share) {\r\n await navigator.share({\r\n title: `Emberly - ${entity?.name || \"Shared Map\"}`,\r\n text: \"\",\r\n url: value,\r\n });\r\n\r\n } else if (navigator.clipboard) {\r\n await navigator.clipboard.writeText(value);\r\n dispatch(AppActions.DisplayNotification(\"Copied to clipboard!\"));\r\n } else {\r\n window.open(value, \"_blank\");\r\n }\r\n\r\n } catch (err) {\r\n console.log(err);\r\n dispatch(AppActions.DisplayNotification(\"Unable to access clipboard!\"));\r\n }\r\n };\r\n\r\n fn();\r\n\r\n }, [dispatch, entity]);\r\n\r\n const onReport = useCallback(() => {\r\n const body = encodeURIComponent(`Map: ${entity.publicUserId}/${entity.id}\\nName: ${entity.name}\\nLink: https://ember.ly/map/${entity.publicUserId}/${entity.id}\\n\\nReason: <insert>`);\r\n window.open(`mailto:hi@ember.ly?subject=Report map violation&body=${body}`, \"_blank\");\r\n }, [entity]);\r\n\r\n const icon = useMemo(() => theme.palette.mode === \"dark\" ? \"/icons/emberly_logo_text_white.svg\" : \"/icons/emberly_logo_text.svg\", [theme]);\r\n\r\n return useMemo(() => (\r\n <>\r\n\r\n {\r\n !isEmbed && !isMobilePortrait && !hideTopLeft ? (\r\n <Grid container className={`${classes.topLeftGrid} ${classes.glass}`} direction=\"row\" justifyContent=\"center\" alignItems=\"center\">\r\n\r\n <Tooltip title=\"Visit Emberly\" enterDelay={250}>\r\n <a href=\"https://ember.ly\" target=\"_blank\" rel=\"noreferrer\">\r\n <Button color=\"neutral\" size=\"medium\">\r\n <img className={classes.logo} src={icon} alt=\"emberly logo\"></img>\r\n </Button>\r\n </a>\r\n </Tooltip>\r\n\r\n {\r\n entity?.duplicateEnabled ? (\r\n <Divider orientation=\"vertical\" flexItem className={classes.divider} />\r\n ) : null\r\n }\r\n\r\n {\r\n entity?.duplicateEnabled ? (\r\n <Tooltip title=\"Duplicate map\" enterDelay={250}>\r\n <Button color=\"neutral\" size=\"medium\" onClick={onOpenDuplicate}>\r\n Duplicate map\r\n </Button>\r\n </Tooltip>\r\n ) : null\r\n }\r\n\r\n </Grid>\r\n ) : (\r\n isMobilePortrait && !isEmbed ? (\r\n <Grid container className={`${classes.topLeftGridMobile} ${classes.glass}`} direction=\"row\" justifyContent=\"center\" alignItems=\"center\">\r\n <Tooltip title=\"Open notes\" enterDelay={250}>\r\n <Button color=\"neutral\" size={buttonSize} startIcon={<CommentIcon fontSize={iconSize} />} className={descriptionActive ? classes.active : undefined} onClick={onOpenDescription}>\r\n Notes\r\n </Button>\r\n </Tooltip>\r\n </Grid>\r\n ) : null\r\n )\r\n }\r\n\r\n {\r\n !isEmbed ? (\r\n <Grid container className={`${classes.topRightGrid} ${classes.glass} ${open ? classes.translateLeft : widgetActive ? classes.translateLeftWidget : \"\"}`} direction=\"row\" justifyContent=\"center\" alignItems=\"center\">\r\n\r\n {\r\n !isMobilePortrait ? (\r\n <>\r\n <Tooltip title=\"Open notes\" enterDelay={250}>\r\n <Button color=\"neutral\" size={buttonSize} startIcon={<CommentIcon fontSize={iconSize} />} className={descriptionActive ? classes.active : undefined} onClick={onOpenDescription}>\r\n Notes\r\n </Button>\r\n </Tooltip>\r\n\r\n <Divider orientation=\"vertical\" flexItem className={classes.divider} />\r\n </>\r\n ) : null\r\n }\r\n\r\n <Tooltip title=\"Open search\" enterDelay={250}>\r\n {\r\n isMobile ? (\r\n <IconButton size={buttonSize} className={searchActive ? classes.active : undefined} onClick={onOpenSearch}>\r\n <SearchIcon fontSize={iconSize} />\r\n </IconButton>\r\n ) : (\r\n <Button color=\"neutral\" size={buttonSize} startIcon={<SearchIcon fontSize={iconSize} />} className={searchActive ? classes.active : undefined} onClick={onOpenSearch}>\r\n Search\r\n </Button>\r\n )\r\n }\r\n </Tooltip>\r\n\r\n <IconButton size={buttonSize} onClick={handleClick}>\r\n <MoreHorizIcon fontSize={iconSize} />\r\n </IconButton>\r\n\r\n </Grid>\r\n ) : null\r\n }\r\n\r\n {\r\n isEmbed ? (\r\n <Grid container className={`${classes.bottomLeftGridEmbed} ${classes.glass}`} direction=\"row\" justifyContent=\"center\" alignItems=\"center\">\r\n {\r\n entity?.watermarkEnabled && isEmbed ? (\r\n <Tooltip title=\"Visit Emberly\" enterDelay={250}>\r\n <a href=\"https://ember.ly\" target=\"_blank\" rel=\"noreferrer\">\r\n <Button color=\"neutral\" size=\"medium\">\r\n <img className={classes.logo} src={icon} alt=\"emberly logo\"></img>\r\n </Button>\r\n </a>\r\n </Tooltip>\r\n ) : null\r\n }\r\n\r\n {\r\n showEmbedDescription && entity?.watermarkEnabled && isEmbed ? (\r\n <Divider orientation=\"vertical\" flexItem className={classes.divider} />\r\n ) : null\r\n }\r\n\r\n {\r\n showEmbedDescription ? (\r\n <Tooltip title=\"Open notes\" enterDelay={250}>\r\n <Button color=\"neutral\" size=\"medium\" startIcon={<CommentIcon fontSize=\"small\" />} className={descriptionActive ? classes.active : undefined} onClick={onOpenDescription}>\r\n Notes\r\n </Button>\r\n </Tooltip>\r\n ) : null\r\n }\r\n </Grid>\r\n ) : null\r\n }\r\n\r\n {\r\n !isMobilePortrait ? (\r\n <Grid container className={`${isEmbed ? classes.bottomRightGridEmbed : classes.bottomRightGrid} ${classes.glass} ${open ? classes.translateLeft : \"\"}`} direction=\"row\" justifyContent=\"center\" alignItems=\"center\">\r\n\r\n <IconButton className={classes.iconButton} onClick={onZoomOut} size=\"medium\">\r\n <RemoveIcon fontSize=\"small\" />\r\n </IconButton>\r\n\r\n <IconButton className={classes.iconButton} onClick={onZoomIn} size=\"medium\">\r\n <AddIcon fontSize=\"small\" />\r\n </IconButton>\r\n\r\n {isEmbed ? (\r\n <Tooltip title=\"Open in new window\" enterDelay={250}>\r\n <a href={location.pathname} target=\"_blank\" rel=\"noreferrer\">\r\n <IconButton className={classes.iconButton} size=\"medium\">\r\n <OpenInNewIcon fontSize=\"small\" />\r\n </IconButton>\r\n </a>\r\n </Tooltip>\r\n ) : (\r\n <Tooltip title=\"Zoom to fit\" enterDelay={250}>\r\n <IconButton className={classes.iconButton} onClick={onFit} size=\"medium\">\r\n <FitScreenIcon fontSize=\"small\" />\r\n </IconButton>\r\n </Tooltip>\r\n )}\r\n\r\n </Grid>\r\n ) : null\r\n }\r\n\r\n {\r\n isMobilePortrait && entity?.watermarkEnabled ? (\r\n <Tooltip title=\"Visit Emberly\" enterDelay={250}>\r\n <a href=\"https://ember.ly\" target=\"_blank\" rel=\"noreferrer\" className={classes.mobileLink}>\r\n <Button color=\"neutral\" size=\"medium\" className={classes.glass}>\r\n <img className={classes.image} src={icon} alt=\"emberly logo\"></img>\r\n </Button>\r\n </a>\r\n </Tooltip>\r\n ) : null\r\n }\r\n\r\n <Menu\r\n id=\"map-menu\"\r\n anchorEl={anchorEl}\r\n keepMounted\r\n open={Boolean(anchorEl)}\r\n onClose={handleClose}\r\n >\r\n {showAuth ? (\r\n <MenuItem onClick={onLogin}>\r\n Log in/Sign up\r\n </MenuItem>\r\n ) : (\r\n <MenuItem onClick={logout}>\r\n Sign out\r\n </MenuItem>\r\n )}\r\n\r\n <MenuItem onClick={onOpenEmberly}>\r\n Open Emberly\r\n </MenuItem>\r\n\r\n {\r\n isMobilePortrait && entity?.duplicateEnabled ? (\r\n <MenuItem onClick={onOpenDuplicate}>\r\n Duplicate map\r\n </MenuItem>\r\n ) : null\r\n }\r\n\r\n <MenuItem onClick={onCopyLink}>\r\n Copy link\r\n </MenuItem>\r\n\r\n {isMobilePortrait ? <Divider /> : null}\r\n\r\n <MenuItem className={classes.error} onClick={onReport}>\r\n Report map\r\n </MenuItem>\r\n </Menu>\r\n\r\n {\r\n !showAuth && !isEmbed ? (\r\n <Dialog open={duplicateOpen && profile?.onboarded} onClose={handleDuplicateClose} fullScreen={isMobilePortrait}>\r\n <DuplicatePanel onClose={handleDuplicateClose} />\r\n </Dialog>\r\n ) : null\r\n }\r\n\r\n </>\r\n ), [icon, onOpenEmberly, profile, isEmbed, hideTopLeft, onOpenDuplicate, isMobilePortrait, onReport, logout, onLogin, onCopyLink, classes, entity?.watermarkEnabled, entity?.duplicateEnabled, buttonSize, iconSize, descriptionActive, onOpenDescription, open, widgetActive, isMobile, searchActive, onOpenSearch, handleClick, showEmbedDescription, onZoomOut, onZoomIn, location.pathname, onFit, anchorEl, handleClose, showAuth, duplicateOpen, handleDuplicateClose]);\r\n}","import useCard from \"../../../hooks/useCard\";\r\nimport MapNotesPanel from \"../../molecules/editors/MapNotesPanel\";\r\nimport { useSelector } from \"react-redux\";\r\nimport SwipableCardProvider from \"../../../providers/SwipableCardProvider\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport { useDevice } from \"../../../providers/DeviceContext\";\r\nimport { useEffect } from \"react\";\r\nimport { useLocation } from \"react-router\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n root: {\r\n width: \"100%\",\r\n height: \"100%\",\r\n position: \"absolute\"\r\n }\r\n}));\r\n\r\nexport default function MapDescriptionView() {\r\n const classes = useStyles();\r\n const location = useLocation();\r\n const showEmbedDescription = useSelector(state => state.app.showEmbedDescription);\r\n const { isMobilePortraitView, isEmbed } = useDevice();\r\n const { setCardState } = useCard(location.pathname.endsWith(\"/description\") || (!isEmbed && !isMobilePortraitView) ? 1 : 0);\r\n\r\n useEffect(() => {\r\n if (!showEmbedDescription && !location.pathname.endsWith(\"/description\")) {\r\n setCardState(0);\r\n }\r\n }, [showEmbedDescription, setCardState, location])\r\n\r\n return (\r\n showEmbedDescription || !isEmbed ? (\r\n <SwipableCardProvider active className={classes.root}>\r\n <MapNotesPanel readonly />\r\n </SwipableCardProvider>\r\n ) : null\r\n );\r\n}\r\n","import * as utils from '@pixi/utils';\r\n\r\n\r\nimport { BatchRenderer, extensions } from '@pixi/core';\r\nimport { InteractionManager } from '@pixi/interaction';\r\nimport '@pixi/canvas-display';\r\nimport { CanvasGraphicsRenderer } from '@pixi/canvas-graphics';\r\nimport { CanvasSpriteRenderer } from '@pixi/canvas-sprite';\r\n\r\nexport { utils };\r\nexport * from '@pixi/constants';\r\nexport * from '@pixi/math';\r\nexport * from '@pixi/settings';\r\nexport * from '@pixi/display';\r\nexport * from '@pixi/core';\r\nexport * from '@pixi/sprite';\r\nexport * from '@pixi/graphics';\r\nexport * from '@pixi/text';\r\n\r\nextensions.add(BatchRenderer);\r\nextensions.add(InteractionManager);\r\nextensions.add(CanvasGraphicsRenderer);\r\nextensions.add(CanvasSpriteRenderer);\r\n\r\n/*\r\nyarn upgrade pixi.js@6.5.2 @pixi/core@6.5.2 @pixi/events@6.5.2 @pixi/extract@6.5.2 @pixi/canvas-text@6.5.2 @pixi/canvas-extract@6.5.2 @pixi/canvas-renderer@6.5.2 @pixi/ticker@6.5.2 @pixi/utils@6.5.2 @pixi/interaction@6.5.2 @pixi/canvas-display@6.5.2 @pixi/canvas-graphics@6.5.2 @pixi/canvas-sprite@6.5.2 @pixi/constants@6.5.2 @pixi/math@6.5.2 @pixi/settings@6.5.2 @pixi/display@6.5.2 @pixi/core@6.5.2 @pixi/sprite@6.5.2 @pixi/graphics@6.5.2 @pixi/text@6.5.2\r\n*/\r\n\r\n","import { Graphics } from \"../pixi\";\r\nimport VecMath from \"../common/VecMath\";\r\n\r\nexport default class RasterSynapse {\r\n\r\n constructor(parent, child) {\r\n this.parent = parent;\r\n this.child = child;\r\n this.graphics = new Graphics();\r\n this.detached = false;\r\n this.attachTarget = parent;\r\n }\r\n\r\n render() {\r\n // TODO this one integrated into interactivenode, this one draws the box?\r\n\r\n const parent = this.detached ? this.attachTarget : this.parent;\r\n const g = this.graphics;\r\n \r\n // fetch container\r\n let pc = parent.container;\r\n let cc = this.child.container;\r\n \r\n // select joints\r\n const deltaX = pc.x - cc.x;\r\n const deltaY = pc.y - cc.y;\r\n\r\n const originX = Math.sign(deltaX) * this.child.width * 0.5;\r\n const destX = deltaX - Math.sign(deltaX) * parent.width * 0.5;\r\n \r\n const mid0X = originX + (destX - originX) / 1.5;\r\n const mid1X = destX - (destX - originX) / 2;\r\n\r\n let lineWidth = this.child.getTextStyle().fontSize * 0.4;\r\n let alpha = 1;\r\n \r\n if (this.child.dragging && !this.detached) {\r\n const side = this.child.layout.getSide();\r\n const pW05 = this.parent.width * 0.5;\r\n const cW05 = this.child.width * 0.5;\r\n\r\n const ccX = cc.x - side * cW05;\r\n const cX = this.parent.container.x + (this.child.optimalPositionX + pW05 + cW05) * side - side * cW05;\r\n const cY = this.child.getPositionY();\r\n \r\n const pX = parent.getPositionX() + side * pW05;\r\n const pY = parent.getPositionY();\r\n\r\n const neutralDistance = VecMath.Distance2F(pX, pY, cX, cY);\r\n const distanceFromParent = VecMath.Distance2F(pX, pY, ccX, cc.y);\r\n lineWidth *= Math.max(0.7, Math.min(1.5, 1.5 - 0.4*(distanceFromParent / neutralDistance)));\r\n\r\n } else if (this.detached){\r\n alpha = 0.5;\r\n }\r\n\r\n g.clear();\r\n g.lineStyle(lineWidth, this.child.renderColor, alpha);\r\n\r\n // draw the line\r\n g.moveTo(originX, 0);\r\n g.bezierCurveTo(\r\n mid0X, 0,\r\n mid1X, deltaY,\r\n destX, deltaY\r\n );\r\n \r\n const lineWidth05 = lineWidth / 2.0;\r\n g.lineStyle(0, this.child.renderColor);\r\n g.beginFill(this.child.renderColor);\r\n g.drawCircle(originX, 0, lineWidth05);\r\n \r\n const nextSibling = this.child.getNextSibling();\r\n\r\n if ((!nextSibling || this.child.dragging || nextSibling.dragging) && !this.detached) {\r\n if (!this.parent.entity?.isCollapsed) {\r\n g.drawCircle(destX, deltaY, lineWidth05);\r\n }\r\n } else if (this.detached) { \r\n g.drawCircle(destX, deltaY, lineWidth05);\r\n this.drawDotOnParent();\r\n }\r\n \r\n g.endFill();\r\n }\r\n\r\n drawDotOnParent() {\r\n const children = this.parent.children;\r\n const len = children.length;\r\n const parentEntity = this.parent.entity;\r\n\r\n if (len > 1 && (!parentEntity || !parentEntity.isCollapsed) && this.parent.isVisible) {\r\n let pc = this.parent.container;\r\n let cc = this.child.container;\r\n // select joints\r\n const deltaX = pc.x - cc.x;\r\n const deltaY = pc.y - cc.y;\r\n let side = Math.sign(deltaX);\r\n\r\n if (this.parent.isRoot) {\r\n const index = this.child.indexInParent;\r\n \r\n if (index === len - 1) {\r\n const prev = children[index - 1];\r\n if (!!prev) {\r\n this.graphics.endFill();\r\n this.graphics.beginFill(prev.renderColor);\r\n side = Math.sign(pc.x - prev.container.x)\r\n \r\n }\r\n } else {\r\n return;\r\n }\r\n }\r\n\r\n const destX = deltaX - side * this.parent.width * 0.5;\r\n \r\n this.graphics.drawCircle(destX, deltaY, this.child.getTextStyle().fontSize * 0.2);\r\n }\r\n }\r\n\r\n setDetached(detached, attachTarget) {\r\n this.detached = detached;\r\n this.attachTarget = attachTarget || this.attachTarget;\r\n }\r\n\r\n invalidateNode(node) {\r\n if (this.detached) {\r\n if (this.attachTarget === node) {\r\n this.attachTarget = this.attachTarget.parent || null;\r\n }\r\n \r\n if (this.parent === node) {\r\n this.parent = node.parent || node.renderer.root;\r\n }\r\n }\r\n }\r\n\r\n update() {\r\n this.render();\r\n }\r\n}","\r\nexport default class AABB {\r\n constructor(startX, startY, endX, endY) {\r\n this.startX = startX;\r\n this.startY = startY;\r\n this.endX = endX;\r\n this.endY = endY;\r\n }\r\n\r\n update(node) {\r\n const w05 = node.width / 2;\r\n const h05 = node.height / 2;\r\n this.startX = Math.min(this.startX, node.globalPositionX - w05);\r\n this.startY = Math.min(this.startY, node.globalPositionY - h05);\r\n this.endX = Math.max(this.endX, node.globalPositionX + w05);\r\n this.endY = Math.max(this.endY, node.globalPositionY + h05);\r\n }\r\n\r\n getMidPoint() {\r\n const x = this.startX + (this.endX - this.startX) / 2;\r\n const y = this.startY + (this.endY - this.startY) / 2;\r\n return { x, y };\r\n }\r\n\r\n getHeight() {\r\n return (this.endY - this.startY) * 1.02;\r\n }\r\n\r\n getWidth() {\r\n return (this.endX - this.startX) * 1.02;\r\n }\r\n}","import { Graphics } from \"../pixi\";\r\nimport RasterSynapse from \"../synapses/RasterSynapse\";\r\nimport AABB from \"../common/AABB\";\r\nimport { Entity } from \"@emberly/dataplane\";\r\n\r\n\r\nexport default class NodeBase {\r\n\r\n constructor(entity, renderer, layout) {\r\n this.id = entity.id;\r\n this.entity = entity;\r\n this.renderer = renderer;\r\n this.container = new Graphics();\r\n this.isVisible = true;\r\n this.hoverNode = null;\r\n\r\n this.parent = null;\r\n this.indexInParent = 0;\r\n this.isCollapsed = entity.isCollapsed;\r\n this.children = [];\r\n this.side = entity.side;\r\n this.color = entity.color;\r\n this.renderColor = entity.color;\r\n\r\n this.synapse = null;\r\n this.depth = entity.depth;\r\n this.dirty = false;\r\n\r\n // interaction\r\n this.dragging = false;\r\n\r\n // joint offsets\r\n this.width = 0;\r\n this.height = 0;\r\n\r\n // positions\r\n this.globalPositionX = 0;\r\n this.globalPositionY = 0;\r\n this.optimalPositionX = 0;\r\n this.optimalPositionY = 0;\r\n this.offsetPositionX = 0;\r\n this.offsetPositionY = 0;\r\n this.textOffsetX = 0;\r\n this.textOffsetY = 0;\r\n this.isRoot = false;\r\n\r\n // init\r\n this.layout = layout;\r\n\r\n if (this.layout) {\r\n this.layout.setNode(this);\r\n }\r\n\r\n this.container.interactive = true;\r\n this.container.buttonMode = true;\r\n\r\n this.container\r\n .on(\"click\", ev => this.renderer.emit(\"nodeclick\", this, ev))\r\n .on(\"pointerdown\", ev => this.renderer.emit(\"nodepointerdown\", this, ev));\r\n }\r\n\r\n delete() {\r\n this.parent.removeChild(this);\r\n let nodes = [];\r\n this.getNodes(nodes);\r\n this.renderer.deleteNodes(nodes.sort((a, b) => b.depth - a.depth));\r\n }\r\n\r\n getNodes(arr) {\r\n arr.push(this);\r\n this.children.forEach(c => c.getNodes(arr));\r\n }\r\n\r\n removeChild(node) {\r\n let idx = this.children.indexOf(node);\r\n if (idx !== -1) {\r\n this.children.splice(idx, 1);\r\n this.children.forEach((c, i) => { c.indexInParent = i });\r\n this.renderer.removeChild(node);\r\n this.render();\r\n this.setLayoutDirty();\r\n }\r\n }\r\n\r\n addChild(node) {\r\n\r\n const nodeVisible = this.isVisible && !this.isCollapsed;\r\n const root = this.renderer.root;\r\n\r\n node.parent = this;\r\n node.side = node.side || this.side;\r\n node.updateDepth();\r\n node.setVisibility(nodeVisible);\r\n\r\n if (this.children.length === 0) {\r\n node.indexInParent = this.children.length;\r\n this.children.push(node);\r\n } else {\r\n node.indexInParent = this.children.length;\r\n this.children.push(node);\r\n\r\n const next = node.getNextSibling()?.entity.index;\r\n const prev = node.getPreviousSibling()?.entity.index;\r\n const key = node.entity.index;\r\n if (\r\n (next && next < key) ||\r\n (prev && prev > key)\r\n ) {\r\n this.sortChildrenByEntity();\r\n }\r\n }\r\n\r\n\r\n this.renderer.addChild(node);\r\n\r\n if (node.synapse !== null) {\r\n node.synapse.parent = this;\r\n node.synapse.setDetached(false);\r\n } else {\r\n\r\n node.synapse = new RasterSynapse(this, node);\r\n node.container.addChild(node.synapse.graphics);\r\n\r\n if (!this.renderer.isFullTree() && this.isRoot) {\r\n node.synapse.graphics.visible = false;\r\n }\r\n\r\n if (this.renderer.isLoaded) {\r\n node.setPosition(this.container.x, this.container.y);\r\n } else {\r\n if (nodeVisible) {\r\n node.setAlpha(0.01);\r\n }\r\n node.setPosition(root.globalPositionX + this.width * this.side * 0.5, root.globalPositionY);\r\n }\r\n }\r\n\r\n node.updateColor();\r\n this.setLayoutDirty();\r\n }\r\n\r\n updateDepth() {\r\n this.depth = this.parent.depth + 1;\r\n this.side = this.parent.side || this.side;\r\n this.children.forEach(c => c.updateDepth());\r\n }\r\n\r\n onTick(delta) {\r\n if (this.dirty && this.isVisible) {\r\n const x = this.getPositionX();\r\n const y = this.getPositionY();\r\n const g = this.container;\r\n\r\n // TODO normalize velocity, vX etc, dont let it jump too far because of delta.\r\n const vX = x + this.offsetPositionX - g.x;\r\n const vY = y + this.offsetPositionY - g.y;\r\n const vel = vX * vX + vY * vY;\r\n const hasDelta = vel > 0.05;\r\n\r\n if (!this.dragging) {\r\n this.setPosition(\r\n g.x + vX * Math.min(0.25, delta * 12),\r\n g.y + vY * Math.min(0.25, delta * 12)\r\n );\r\n }\r\n\r\n if (hasDelta) {\r\n if (this.synapse) {\r\n this.synapse.update();\r\n }\r\n }\r\n\r\n const parent = this.depth === 1 ? this.renderer.root : this.parent;\r\n\r\n if (!hasDelta && !this.dragging && this.hoverNode === null && (this.parent === null || !parent.dirty)) {\r\n this.dirty = false;\r\n this.setPosition(\r\n x + this.offsetPositionX,\r\n y + this.offsetPositionY\r\n );\r\n\r\n if (this.synapse) {\r\n this.synapse.update();\r\n }\r\n }\r\n }\r\n }\r\n\r\n skipAnimations() {\r\n this.dirty = false;\r\n this.setAlpha(1);\r\n const x = this.getPositionX();\r\n const y = this.getPositionY();\r\n this.setPosition(x, y);\r\n\r\n if (this.synapse) {\r\n this.synapse.update();\r\n }\r\n }\r\n\r\n updateColor() {\r\n if (this.parent !== null) {\r\n if (this.entity.rgbColor === null) {\r\n this.onUpdateColor();\r\n } else {\r\n this.desaturateColor();\r\n }\r\n }\r\n\r\n this.render();\r\n\r\n if (!!this.synapse) {\r\n this.synapse.update();\r\n }\r\n\r\n this.children.forEach(c => c.updateColor());\r\n }\r\n\r\n setColor(color, force = false) {\r\n if (this.color !== color || force) {\r\n this.color = color;\r\n this.updateColor();\r\n }\r\n }\r\n\r\n hasParent(node) {\r\n return this.parent !== null && (this.parent === node || this.parent.hasParent(node));\r\n }\r\n\r\n onClick(ev) { } // Override\r\n\r\n onDoubleClick(ev) { } // Override\r\n\r\n onUpdateColor() { } // Override\r\n\r\n render() { } // Override\r\n\r\n onNodeHoverEnter(node) {\r\n this.hoverNode = node;\r\n this.setDirty();\r\n }\r\n\r\n onNodeHoverMove(node) {\r\n const dc = node.container;\r\n const dcX = dc.x;\r\n const dcY = dc.y;\r\n\r\n let deltaDragX = (dcX - this.container.x) / 10;\r\n let deltaDragY = (dcY - this.container.y);\r\n\r\n let dragDelta = Math.max(Math.sqrt(deltaDragX * deltaDragX + deltaDragY * deltaDragY), 1);\r\n this.offsetPositionX = -(deltaDragX / dragDelta) * 15;\r\n this.offsetPositionY = -(deltaDragY / dragDelta) * 25;\r\n\r\n this.setDirty();\r\n }\r\n\r\n onNodeHoverExit() {\r\n this.hoverNode = null;\r\n this.offsetPositionX = 0;\r\n this.offsetPositionY = 0;\r\n this.setDirty();\r\n }\r\n\r\n setPosition(x, y) {\r\n const container = this.container;\r\n container.x = x;\r\n container.y = y;\r\n }\r\n\r\n // TODO override this one so we dont need branch here\r\n getPositionX() {\r\n if (this.parent === null) {\r\n return this.optimalPositionX;\r\n }\r\n\r\n const side = this.parent.layout.getSide();\r\n return this.parent.container.x + (this.optimalPositionX + (this.parent.width + this.width) / 2) * side;\r\n }\r\n\r\n // TODO override this one so we dont need branch here.\r\n getPositionY() {\r\n return this.parent === null ? this.optimalPositionY : this.parent.container.y + this.optimalPositionY;\r\n }\r\n\r\n setLayoutDirty() {\r\n if (!!this.layout) {\r\n this.renderer.setDirty(this.layout.getSide());\r\n }\r\n }\r\n\r\n setDirty() {\r\n this.subSetDirty();\r\n this.renderer.setTickDirty();\r\n }\r\n\r\n subSetDirty() {\r\n this.dirty = true;\r\n\r\n if (this.children && this.children.length !== 0) {\r\n this.children.forEach(c => c.subSetDirty());\r\n }\r\n }\r\n\r\n setVisibility(visibility) {\r\n if (this.dragging && !visibility && this.renderer.nodeEventHandler?.draggingNode === this) return;\r\n \r\n this.isVisible = visibility;\r\n this.container.visible = visibility;\r\n\r\n if (!this.isCollapsed) {\r\n this.children.forEach(c => c.setVisibility(visibility));\r\n }\r\n\r\n this.render();\r\n }\r\n\r\n onUpdated() {\r\n this.subSetDirty();\r\n if (this.isCollapsed !== this.entity.isCollapsed) {\r\n this.setIsCollapsed(this.entity.isCollapsed, true);\r\n } else if (!this.entity.isCollapsed) {\r\n this.renderer.nodeEventHandler.handleRemoteUncollapse(this);\r\n }\r\n\r\n if (this.color !== this.entity.color) {\r\n this.setColor(this.entity.color);\r\n }\r\n\r\n const next = this.getNextSibling();\r\n const prev = this.getPreviousSibling();\r\n\r\n const shouldMoveIndex = (!!next && next.entity.index < this.entity.index) || (!!prev && prev.entity.index > this.entity.index);\r\n const hasMove = this.parent !== null && (\r\n this.parent.id !== this.entity.parentId ||\r\n (this.side !== this.entity.side && this.depth === 1) ||\r\n shouldMoveIndex\r\n );\r\n\r\n if (hasMove) {\r\n const index = this.findFittingIndex(this.entity.index);\r\n this.move(this.entity.parentId, index, this.entity.side, false, false, true);\r\n } else {\r\n this.setLayoutDirty();\r\n }\r\n \r\n this.render();\r\n this.renderer.nodeEventHandler.onUpdatedNode(this);\r\n }\r\n\r\n // TODO refactor this to sync with entity unless reArrange is set?\r\n move(parentId = null, indexInParent = null, side = null, rearrange = false, sync = true, skipEvents = false) {\r\n const parent = typeof parentId === \"string\" && parentId !== \"inbox\" ? this.renderer.getNodeById(parentId) : this.parent;\r\n\r\n if (parent === null) return false;\r\n\r\n const nIndex = typeof indexInParent === \"number\" ? indexInParent : parent.children.length;\r\n const nSide = typeof side === \"number\" ? side : this.side;\r\n const movedParent = parent.id !== this.parent.id;\r\n const movedSide = (nSide !== this.side || nSide !== this.entity.side) && parent.isRoot;\r\n const movedIndex = movedParent || movedSide || nIndex !== this.indexInParent || rearrange;\r\n const oldParent = this.parent;\r\n\r\n const oldParentId = this.parent.id;\r\n const oldSide = this.side;\r\n const oldIndex = this.indexInParent;\r\n\r\n\r\n // move parent\r\n if (movedParent) {\r\n const oldColor = this.getFirstSetColor();\r\n const oldParent = this.parent;\r\n this.parent.removeChild(this);\r\n parent.addChild(this, nSide);\r\n\r\n if (!!this.synapse) {\r\n this.synapse.attachTarget = this.parent;\r\n }\r\n \r\n if (parent.isRoot) {\r\n if (this.entity.rgbColor === null) {\r\n\r\n\r\n this.entity.setColor(oldColor, { sync: false });\r\n }\r\n \r\n this.setColor(this.entity.color, true);\r\n } else if (oldParent.isRoot && sync) {\r\n this.entity.unsetColor({ sync: false });\r\n }\r\n\r\n if (!skipEvents) {\r\n parent.setIsCollapsed(false);\r\n if (!this.parent.isRoot && sync) {\r\n this.parent.entity.setIsCollapsed(false, { instanceId: this.renderer.instanceId });\r\n\r\n if (oldParent.children.length === 0 && !!oldParent.entity?.isCollapsed) {\r\n oldParent.setIsCollapsed(false);\r\n oldParent.entity.setIsCollapsed(false, { instanceId: this.renderer.instanceId });\r\n oldParent.render();\r\n }\r\n }\r\n }\r\n\r\n if (rearrange) {\r\n this.entity.setParentId(this.parent.id, { sync: false, refresh: true, instanceId: this.renderer.instanceId });\r\n }\r\n }\r\n\r\n // move side\r\n if (movedSide) {\r\n let oldSide = this.side;\r\n this.side = nSide;\r\n\r\n if (this.depth === 1 && oldSide !== this.side) {\r\n parent.removeChild(this);\r\n this.renderer.root.addChild(this, this.side);\r\n }\r\n\r\n if (rearrange) {\r\n this.entity.setSide(this.side, { sync: false });\r\n }\r\n }\r\n\r\n // move index\r\n if (movedIndex) {\r\n const siblings = this.parent.children;\r\n if (rearrange) {\r\n siblings.sort((a, b) => a.container.y - b.container.y);\r\n siblings.forEach((n, i) => { n.indexInParent = i; n.setZIndex(); });\r\n const prev = this.getPreviousSibling();\r\n const next = this.getNextSibling();\r\n this.entity.placeBetween(prev?.entity, next?.entity, { sync: false, instanceId: this.renderer.instanceId });\r\n this.setLayoutDirty();\r\n } else {\r\n this.parent.sortChildrenByEntity();\r\n }\r\n // TODO update render on root change\r\n parent.updateColor();\r\n this.renderer.updateLayerOrder();\r\n } \r\n\r\n if (movedParent || movedSide) {\r\n oldParent.sortChildrenByEntity();\r\n }\r\n\r\n this.updateDepth();\r\n\r\n const hasUpdate = oldParentId !== this.parent.id || oldSide !== this.side || oldIndex !== this.indexInParent;\r\n\r\n // Sync\r\n if (sync && hasUpdate) {\r\n this.entity.depth = this.depth;\r\n this.entity.update(\"updated\", { instanceId: this.renderer.instanceId });\r\n }\r\n\r\n this.renderer.removeFromParentBuffer(this.id);\r\n\r\n return movedIndex;\r\n }\r\n\r\n findFittingIndex(indexKey) {\r\n const siblings = this.getSiblings();\r\n for (let i = 0; i < siblings.length; i++) {\r\n const key = siblings[i].entity.index;\r\n if (key > indexKey) return Math.max(0, i - 1);\r\n }\r\n return siblings.length;\r\n }\r\n\r\n sortChildrenByEntity() {\r\n this.children.sort((a, b) => Entity.Compare(a.entity, b.entity));\r\n this.children.forEach((t, i) => { t.indexInParent = i; t.setZIndex(); });\r\n this.setLayoutDirty();\r\n }\r\n\r\n setIsCollapsed(isCollapsed, force = false) {\r\n if ((this.isCollapsed !== isCollapsed && this.children.length !== 0) || force) {\r\n this.isCollapsed = isCollapsed;\r\n\r\n if (!this.isCollapsed) {\r\n const side = Math.sign(this.container.x - this.renderer.root.container.x);\r\n this.callRecursive(c => c !== this && !c.isVisible && c.setPosition(this.container.x + this.getWidth() * side, this.container.y));\r\n }\r\n\r\n this.children.forEach(c => c.setVisibility(!this.isCollapsed));\r\n this.render();\r\n this.setLayoutDirty();\r\n this.renderer.linkRenderer.render();\r\n }\r\n }\r\n\r\n getWidth() {\r\n return 0;\r\n }\r\n\r\n getHeight() {\r\n return 0;\r\n }\r\n\r\n getDepth() {\r\n let maxDepth = this.depth;\r\n\r\n for (let i = 0; i < this.children.length; i++) {\r\n maxDepth = Math.max(maxDepth, this.children[i].getDepth());\r\n }\r\n\r\n return maxDepth;\r\n }\r\n\r\n isLeaf() {\r\n return this.children.length === 0 || this.isCollapsed;\r\n }\r\n\r\n isLeftMost() {\r\n return this.indexInParent === 0;\r\n }\r\n\r\n isRightMost() {\r\n return this.indexInParent === this.parent.children.length - 1;\r\n }\r\n\r\n getSiblings() {\r\n return this.parent === null ? [this] : this.parent.children;\r\n }\r\n\r\n getGlobalSiblings() {\r\n let result = [];\r\n\r\n if (this.side === -1) {\r\n this.renderer.root.leftTree.fillGlobalSiblings(result, this.depth);\r\n } else {\r\n this.renderer.root.rightTree.fillGlobalSiblings(result, this.depth);\r\n }\r\n\r\n return result;\r\n }\r\n\r\n fillGlobalSiblings(result, depth) {\r\n if (this.depth === depth) {\r\n result.push(this);\r\n } else {\r\n for (let i = 0; i < this.children.length; i++) {\r\n this.children[i].fillGlobalSiblings(result, depth);\r\n }\r\n }\r\n }\r\n\r\n getPreviousSibling() {\r\n if (this.isLeftMost()) {\r\n return null;\r\n } else {\r\n return this.parent.children[this.indexInParent - 1];\r\n }\r\n }\r\n\r\n getNextSibling() {\r\n if (this.isRightMost()) {\r\n return null;\r\n } else {\r\n return this.parent.children[this.indexInParent + 1];\r\n }\r\n }\r\n\r\n getLeftMostSibling() {\r\n if (this.isLeftMost()) {\r\n return this;\r\n } else {\r\n return this.parent.children[0];\r\n }\r\n }\r\n\r\n getLeftMostChild() {\r\n return this.children.length === 0 || this.isCollapsed ? null : this.children[0];\r\n }\r\n\r\n getRightMostChild() {\r\n return this.children.length === 0 || this.isCollapsed ? null : this.children[this.children.length - 1];\r\n }\r\n\r\n callRecursive(fn) {\r\n fn(this);\r\n for (let i = 0; i < this.children.length; i++) {\r\n this.children[i].callRecursive(fn);\r\n }\r\n }\r\n\r\n getBranch() {\r\n const arr = [];\r\n this.callRecursive(c => arr.push(c));\r\n return arr;\r\n }\r\n\r\n getBranchExclusive() {\r\n const arr = [];\r\n const callback = c => arr.push(c);\r\n this.children.forEach(n => n.callRecursive(callback));\r\n return arr;\r\n }\r\n\r\n getPath() {\r\n let result = [];\r\n let n = this;\r\n\r\n while (n !== null && !n.isRoot) {\r\n result.push(n.name);\r\n n = n.parent;\r\n }\r\n\r\n result.reverse();\r\n\r\n return result;\r\n }\r\n\r\n callParents(fn) {\r\n if (this.parent !== null && !this.parent.isRoot) {\r\n fn(this.parent);\r\n this.parent.callParents(fn);\r\n }\r\n }\r\n\r\n getAABB(maxDepth = 100) {\r\n const w05 = this.width / 2;\r\n const h05 = this.height / 2;\r\n const aabb = new AABB(this.globalPositionX - w05, this.globalPositionY - h05, this.globalPositionX + w05, this.globalPositionY + h05);\r\n this.fillAABB(aabb, maxDepth);\r\n return aabb;\r\n }\r\n\r\n fillAABB(aabb, maxDepth) {\r\n if (this.isVisible) {\r\n aabb.update(this);\r\n if (--maxDepth > 0) {\r\n this.children.forEach(c => c.fillAABB(aabb, maxDepth));\r\n }\r\n }\r\n }\r\n\r\n getNodeData() {\r\n return {\r\n id: this.id,\r\n parentId: this.parent ? this.parent.id : null,\r\n indexInParent: this.indexInParent,\r\n depth: this.depth,\r\n side: this.depth === 1 ? this.parent.layout.side : undefined\r\n };\r\n }\r\n\r\n getBranchRoot() {\r\n if (this.depth === 0) {\r\n return null;\r\n } else if (this.depth === 1 || this.parent?.isRoot) {\r\n return this;\r\n }\r\n return this.parent.getBranchRoot();\r\n }\r\n\r\n // recur towards root and look for first parent with a color thats actually set.\r\n getFirstSetColor() {\r\n if (!this.parent) {\r\n return 0x0;\r\n } else if (this.entity.rgbColor !== null) {\r\n return this.entity.rgbColor;\r\n }\r\n return this.parent.getFirstSetColor();\r\n }\r\n\r\n isSelected() {\r\n return !this.renderer.closed && (this.id === this.renderer.nodeEventHandler.activeNodeId || this === this.renderer.nodeEventHandler.dragOverNode);\r\n }\r\n\r\n hasActiveLink() {\r\n return this.renderer.linkRenderer.hasActiveNode() && this.renderer.linkRenderer.targetNodeIdSet.has(this.id);\r\n }\r\n\r\n getFirstInvisibleParent() {\r\n if (this.parent === null || this.parent.isVisible) {\r\n return this;\r\n } else {\r\n return this.parent.getFirstInvisibleParent();\r\n }\r\n }\r\n\r\n isBranchDragging() {\r\n let buf = this.parent;\r\n\r\n while (buf != null) {\r\n \r\n if (buf.synapse?.detached) {\r\n return true;\r\n }\r\n\r\n buf = buf.parent;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n isCategoryNode() {\r\n return this.depth === 1 && (this.parent.id === \"left_attachment\" || this.parent.id === \"right_attachment\");\r\n }\r\n\r\n setZIndex() { }\r\n\r\n destroy() {\r\n if (!!this.synapse) {\r\n this.synapse.graphics.destroy();\r\n }\r\n\r\n this.container.destroy();\r\n }\r\n\r\n isInPath(node) {\r\n let parent = this;\r\n while (!!parent) {\r\n if (node === parent) {\r\n return true;\r\n }\r\n parent = parent.parent;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n\r\n invalidateNode(node) {\r\n if (!!this.synapse && node !== this) {\r\n // invalidate synapse\r\n this.synapse.invalidateNode(node);\r\n } else if (node === this) {\r\n // stop all motions and events, this node is now invalid\r\n const handler = this.renderer.nodeEventHandler;\r\n\r\n if (handler?.draggingNode?.id === this.id) {\r\n handler.cancelDrag();\r\n }\r\n\r\n if (this.isSelected()) {\r\n //this.renderer.root\r\n this.renderer.emit(\"onNodeFocused\", this.renderer.root);\r\n }\r\n\r\n }\r\n }\r\n\r\n setAlpha(alpha) {\r\n this.container.alpha = alpha;\r\n }\r\n\r\n}","import NodeBase from \"./NodeBase\";\r\n\r\nexport default class RootAttachmentNode extends NodeBase { // TODO not inherit from basenode ?\r\n\r\n constructor(entity, renderer, layout, root) {\r\n super(entity, renderer, layout);\r\n this.root = root;\r\n this.isRoot = true;\r\n this.container.interactiveChildren = false;\r\n this.container.interactive = false;\r\n }\r\n\r\n render() {\r\n this.width = this.root.width;\r\n }\r\n\r\n getWidth() {\r\n return this.renderer.styles.rootWidth;\r\n }\r\n\r\n getPositionX() {\r\n return this.root.optimalPositionX;\r\n }\r\n\r\n // TODO override this one so we dont need branch here.\r\n getPositionY() {\r\n return this.root.optimalPositionY;\r\n }\r\n}","\r\nexport default class BaseLayout {\r\n \r\n constructor() {\r\n this.node = null;\r\n this.x = 0;\r\n this.y = 0;\r\n this.span = 0;\r\n this.mod = 0;\r\n this.width = 0;\r\n this.height = 0;\r\n }\r\n\r\n getSide() {\r\n return 1;\r\n }\r\n\r\n getNodeSize() {\r\n return this.node.depth === 1 ? 1.5 : 0.75;\r\n }\r\n\r\n setNode(node) {\r\n this.node = node;\r\n }\r\n\r\n update() {\r\n const n = this.node;\r\n const children = n.children;\r\n const side = n.side;\r\n const w = n.width;\r\n\r\n for (let i = 0; i < children.length; i++) {\r\n const { x, y } = this.getChildPosition(i);\r\n const child = children[i];\r\n\r\n child.optimalPositionX = x;\r\n child.optimalPositionY = y;\r\n child.globalPositionX = n.globalPositionX + (x + (w + child.width) * 0.5) * side;\r\n child.globalPositionY = n.globalPositionY + y;\r\n child.layout.update();\r\n }\r\n }\r\n\r\n getMaxX() {\r\n const children = this.node.children;\r\n return children.length === 0 ? 1 : children[children.length - 1].layout.x;\r\n }\r\n\r\n updateWidth() {\r\n this.initializeNodes(0);\r\n this.calculateInitialX();\r\n this.calculateFinalPositions(0);\r\n }\r\n\r\n initializeNodes(depth) {\r\n const { nodeWidth, layerSpacingWidth } = this.node.renderer.styles;\r\n const width = this.node.width;\r\n this.x = -1;\r\n this.mod = 0;\r\n this.width = 0;\r\n this.height = 0;\r\n\r\n this.y = Math.floor(depth / (nodeWidth / 4)); \r\n this.span = Math.max(1, Math.ceil(width / (nodeWidth / 4)) + 3);\r\n \r\n if (!this.node.isCollapsed) {\r\n const children = this.node.children;\r\n const len = children.length;\r\n for (let i = 0; i < len; i++) {\r\n children[i].layout.initializeNodes(depth + width + layerSpacingWidth);\r\n }\r\n }\r\n }\r\n\r\n calculateFinalPositions(modSum) {\r\n this.x += modSum;\r\n modSum += this.mod;\r\n\r\n if (this.node.isLeaf()) {\r\n this.width = this.x;\r\n this.height = this.y;\r\n } else {\r\n \r\n const children = this.node.children;\r\n const len = children.length;\r\n for (let i = 0; i < len; i++) {\r\n children[i].layout.calculateFinalPositions(modSum);\r\n }\r\n\r\n this.width = this.getMaxWidth();\r\n this.height = this.getMaxHeight();\r\n }\r\n }\r\n\r\n calculateInitialX() {\r\n if (this.node.isLeaf()) {\r\n if (!this.node.isLeftMost()) {\r\n this.x = this.node.getPreviousSibling().layout.x + this.getNodeSize();\r\n } else {\r\n this.x = 0;\r\n }\r\n } else if (this.node.children.length === 1) {\r\n \r\n const children = this.node.children;\r\n const len = children.length;\r\n for (let i = 0; i < len; i++) {\r\n children[i].layout.calculateInitialX();\r\n }\r\n\r\n if (this.node.isLeftMost()) {\r\n this.x = this.node.children[0].layout.x;\r\n } else {\r\n this.x = this.node.getPreviousSibling().layout.x + this.getNodeSize();\r\n this.mod = this.x - this.node.children[0].layout.x;\r\n }\r\n } else {\r\n\r\n const children = this.node.children;\r\n const len = children.length;\r\n for (let i = 0; i < len; i++) {\r\n children[i].layout.calculateInitialX();\r\n }\r\n\r\n let leftChild = this.node.getLeftMostChild();\r\n let rightChild = this.node.getRightMostChild();\r\n let mid = (leftChild.layout.x + rightChild.layout.x) / 2;\r\n\r\n if (this.node.isLeftMost()) {\r\n this.x = mid;\r\n } else {\r\n this.x = this.node.getPreviousSibling().layout.x + this.getNodeSize();\r\n this.mod = this.x - mid;\r\n }\r\n }\r\n\r\n if (!this.node.isLeftMost()) {\r\n this.checkForConflicts();\r\n }\r\n }\r\n\r\n checkForConflicts() {\r\n let sibling = this.node.getLeftMostSibling();\r\n \r\n if (sibling === null) {\r\n return;\r\n }\r\n\r\n const minDistance = 1.5 * this.getNodeSize(); // TODO mul here decided distance between trees\r\n let shiftValue = 0;\r\n\r\n let nodeContour = new Map();\r\n let siblingContour = new Map();\r\n this.getLeftContour(0, nodeContour);\r\n\r\n while (sibling !== null && sibling !== this.node) {\r\n \r\n siblingContour.clear();\r\n siblingContour.lastKey = 0;\r\n sibling.layout.getRightContour(0, siblingContour);\r\n\r\n let minDepth = Math.min(\r\n siblingContour.lastKey, \r\n nodeContour.lastKey\r\n );\r\n\r\n let y0 = Math.min(\r\n sibling.layout.y + sibling.layout.span, \r\n this.y + this.span\r\n ); // TODO this might need +1 on each\r\n\r\n for (let level = y0; level < minDepth; level++) {\r\n let distance = nodeContour.get(level) - siblingContour.get(level);\r\n\r\n if (distance + shiftValue < minDistance) {\r\n shiftValue = Math.max(minDistance - distance, shiftValue);\r\n }\r\n }\r\n \r\n // TODO moved this outside the loop? prioritize deeper nodes\r\n if (shiftValue > 0) {\r\n this.x += shiftValue;\r\n this.mod += shiftValue;\r\n shiftValue = 0;\r\n nodeContour.clear();\r\n nodeContour.lastKey = 0;\r\n this.getLeftContour(0, nodeContour);\r\n }\r\n\r\n sibling = sibling.getNextSibling();\r\n }\r\n }\r\n\r\n getLeftContour(modSum, values) {\r\n const len = this.y + this.span;\r\n\r\n for (let y = this.y; y <= len; y++) {\r\n if (!values.has(y)) {\r\n values.set(y, this.x + modSum);\r\n } else {\r\n values.set(y, Math.min(values.get(y), this.x + modSum));\r\n }\r\n values.lastKey = Math.max(y, values.lastKey || 0);\r\n }\r\n\r\n modSum += this.mod;\r\n if (!this.node.isLeaf()) {\r\n const children = this.node.children;\r\n const l = children.length;\r\n for (let i = 0; i < l; i++) {\r\n children[i].layout.getLeftContour(modSum, values);\r\n }\r\n }\r\n }\r\n\r\n getRightContour(modSum, values) {\r\n const len = this.y + this.span;\r\n \r\n for (let y = this.y; y <= len; y++) {\r\n if (!values.has(y)) {\r\n values.set(y, this.x + modSum);\r\n } else {\r\n values.set(y, Math.max(values.get(y), this.x + modSum));\r\n }\r\n values.lastKey = Math.max(y, values.lastKey || 0);\r\n }\r\n\r\n modSum += this.mod;\r\n if (!this.node.isLeaf()) {\r\n const children = this.node.children;\r\n const l = children.length;\r\n for (let i = 0; i < l; i++) {\r\n children[i].layout.getRightContour(modSum, values);\r\n }\r\n }\r\n }\r\n\r\n getLeftContourMin() {\r\n const children = this.node.children;\r\n let contour = this.x;\r\n\r\n for (let i = 0; i < children.length; i++) {\r\n contour = Math.min(contour, children[i].layout.getLeftContourMin());\r\n }\r\n\r\n return contour;\r\n }\r\n\r\n getRightContourMax() {\r\n const children = this.node.children;\r\n let contour = this.x;\r\n\r\n for (let i = 0; i < children.length; i++) {\r\n contour = Math.max(contour, children[i].layout.getRightContourMax());\r\n }\r\n\r\n return contour;\r\n }\r\n\r\n // utility methods\r\n\r\n getMaxWidth() {\r\n const children = this.node.children;\r\n let maxW = 0;\r\n\r\n for (let i = 0; i < children.length; i++) {\r\n let w = children[i].layout.width;\r\n maxW = Math.max(w, maxW);\r\n }\r\n\r\n return maxW;\r\n }\r\n\r\n getMaxHeight() {\r\n const children = this.node.children;\r\n let maxH = 0;\r\n\r\n for (let i = 0; i < children.length; i++) {\r\n let h = children[i].layout.height;\r\n maxH = Math.max(h, maxH);\r\n }\r\n\r\n return maxH;\r\n }\r\n}\r\n","import BaseLayout from \"./BaseLayout\";\r\n\r\nexport default class RootLayout extends BaseLayout {\r\n\r\n constructor(side) {\r\n super();\r\n this.side = side;\r\n }\r\n\r\n getSide() {\r\n return this.side;\r\n }\r\n\r\n getChildPosition(i) {\r\n const { layerSpacingWidth, layerSpacingHeight } = this.node.renderer.styles;\r\n\r\n return { \r\n x: layerSpacingWidth * (this.node.renderer.isFullTree() ? 5 : 0.1), \r\n y: (this.node.children[i].layout.x - this.x) * layerSpacingHeight\r\n };\r\n }\r\n}\r\n\r\n\r\n","import { Sprite, Texture, Text, Graphics, TextStyle } from \"../pixi\";\r\nimport NodeBase from \"./NodeBase\";\r\nimport RootAttachmentNode from \"./RootAttachmentNode\";\r\nimport RootLayout from \"../layouts/RootLayout\";\r\n\r\nexport default class RootNode extends NodeBase {\r\n\r\n constructor(entity, renderer, layout) {\r\n super(entity, renderer, layout);\r\n this.avatar = null;\r\n this.leftTree = new RootAttachmentNode(entity, this.renderer, new RootLayout(-1), this);\r\n this.rightTree = new RootAttachmentNode(entity, this.renderer, new RootLayout(1), this);\r\n this.leftTree.side = -1;\r\n this.rightTree.side = 1;\r\n this.isRoot = true;\r\n this.mask = new Graphics();\r\n this.customText = null;\r\n this.textStyle = null;\r\n this.container.addChild(this.mask);\r\n this.container.alpha = 0;\r\n this.hasCustomText = false;\r\n this.hasCustomImage = false;\r\n this.customTextValue = \"\";\r\n this.customImageValue = \"\";\r\n this.state = entity.state;\r\n }\r\n\r\n onClick() {\r\n this.renderer.emit(\"onRootFocused\", this);\r\n }\r\n\r\n getSmallestSide() {\r\n const balance = Math.sign(this.leftTree.layout.width - this.rightTree.layout.width);\r\n\r\n if (balance !== 0)\r\n return balance;\r\n\r\n const count = Math.sign(this.leftTree.children.length - this.rightTree.children.length);\r\n return count === 0 ? 1 : count;\r\n }\r\n\r\n addChild(node, tree) {\r\n if (tree === 0 || tree === undefined) {\r\n tree = this.getSmallestSide();\r\n }\r\n\r\n const isBranch = this.layout.side === 1;\r\n\r\n if (isBranch) {\r\n const count = this.leftTree.children.length + this.rightTree.children.length;\r\n if (count !== 0) {\r\n this.entity.setFullTree(true);\r\n }\r\n }\r\n\r\n if (tree === -1) {\r\n this.leftTree.addChild(node);\r\n } else {\r\n this.rightTree.addChild(node);\r\n }\r\n }\r\n\r\n removeChild(node) {\r\n this.leftTree.removeChild(node);\r\n this.rightTree.removeChild(node);\r\n }\r\n\r\n render(retry = false) {\r\n if (!this.renderer.running) return;\r\n \r\n this.container.zIndex = 20000;\r\n \r\n \r\n if (this.renderer.isFullTree()) {\r\n this.hasCustomText = this.entity.name.startsWith(\"TXT://\");\r\n this.hasCustomImage = this.entity.name.startsWith(\"IMG://\");\r\n \r\n const customValue = this.hasCustomText || this.hasCustomImage ? this.entity.name.substr(6) : null;\r\n\r\n if (this.hasCustomImage && customValue !== this.customImageValue && this.avatar) {\r\n this.customImageValue = customValue;\r\n this.avatar.destroy();\r\n this.avatar = null;\r\n }\r\n\r\n // TODO next session, figure out how we updated avatar earlier, and perhaps we need to track name of rootNode..\r\n if (!this.hasCustomText && this.avatar === null) { \r\n this.customImageValue = customValue;\r\n const avatar = this.hasCustomImage ? Texture.from(customValue) : this.renderer.styles.avatar;\r\n \r\n if (this.customText !== null) {\r\n this.container.removeChild(this.customText);\r\n this.customText.destroy();\r\n this.customText = null;\r\n }\r\n\r\n // Avatar Background\r\n let width = this.getWidth();\r\n const offset = width / 2;\r\n this.mask.clear();\r\n this.mask.x = -offset;\r\n this.mask.y = -offset;\r\n this.mask.beginFill(0xffffff, 1);\r\n this.mask.drawCircle(width / 2, width / 2, width / 2);\r\n this.mask.endFill();\r\n this.mask.zIndex = 1;\r\n\r\n this.avatar = new Sprite(avatar);\r\n this.avatar.x = -offset;\r\n this.avatar.y = -offset;\r\n this.avatar.width = width;\r\n this.avatar.height = width;\r\n this.avatar.mask = this.mask;\r\n this.avatar.zIndex = 2;\r\n\r\n this.container.addChild(this.avatar);\r\n\r\n if (!!avatar && !avatar.valid && !retry) {\r\n if (this.renderer.running) {\r\n setTimeout(() => this.renderer.setTickDirty(), 500);\r\n }\r\n setTimeout(() => this.updateAvatarUrl(), 2000);\r\n }\r\n\r\n this.width = width;\r\n this.height = width;\r\n\r\n } else if (this.hasCustomText) {\r\n // Text background\r\n this.customTextValue = customValue;\r\n\r\n if (this.textStyle === null) {\r\n this.textStyle = new TextStyle({\r\n fontFamily: `\"IBM Plex Sans\", sans-serif`,\r\n fontSize: 100,\r\n fontStyle: \"normal\",\r\n fontWeight: \"600\",\r\n fill: [this.renderer.themeMode === \"dark\" ? \"#DEDEDE\" : \"#555\"],\r\n wordWrap: true,\r\n breakWords: true,\r\n wordWrapWidth: 1000,\r\n align: \"center\"\r\n });\r\n }\r\n\r\n if (this.customText === null) {\r\n if (this.avatar !== null) {\r\n this.container.removeChild(this.avatar);\r\n this.avatar.destroy();\r\n this.avatar = null;\r\n this.mask.clear();\r\n }\r\n this.customText = new Text(this.customTextValue, this.textStyle);\r\n this.container.addChild(this.customText);\r\n } else {\r\n this.customText.text = this.customTextValue;\r\n }\r\n\r\n this.width = this.customText.width + 150;\r\n this.height = this.customText.height + 150;\r\n this.customText.x = -this.customText.width / 2;\r\n this.customText.y = (-this.customText.height / 2) - 12;\r\n }\r\n } else {\r\n this.width = 1;\r\n this.height = 1;\r\n\r\n if (!!this.avatar) {\r\n this.container.removeChild(this.avatar);\r\n this.avatar.destroy();\r\n this.avatar = null;\r\n this.mask.clear();\r\n }\r\n\r\n if (!!this.customText) {\r\n this.container.removeChild(this.customText);\r\n this.customText.destroy();\r\n this.customText = null;\r\n }\r\n }\r\n\r\n this.leftTree.render();\r\n this.rightTree.render();\r\n }\r\n\r\n updateColor() {\r\n if (!!this.customText) {\r\n this.customText.style.fill = this.renderer.themeMode === \"dark\" ? 0xDEDEDE : 0x555555;\r\n }\r\n \r\n this.leftTree.updateColor();\r\n this.rightTree.updateColor();\r\n }\r\n\r\n updateAvatarUrl() {\r\n setTimeout(() => {\r\n if (!this.renderer.running) {\r\n return;\r\n } else if (!!this.avatar && !this.avatar.valid) {\r\n this.renderer.setTickDirty();\r\n return;\r\n }\r\n\r\n if (!!this.avatar) {\r\n this.container.removeChild(this.avatar);\r\n }\r\n\r\n this.avatar = null;\r\n this.render(true);\r\n this.renderer.setTickDirty()\r\n }, 2000);\r\n }\r\n\r\n getWidth() {\r\n return this.renderer.isFullTree() ? this.renderer.styles.rootWidth : 1;\r\n }\r\n\r\n getDepth() {\r\n return Math.max(this.leftTree.getDepth(), this.rightTree.getDepth());\r\n }\r\n\r\n setPosition(x, y) {\r\n super.setPosition(x, y);\r\n this.leftTree.setPosition(x, y);\r\n this.rightTree.setPosition(x, y);\r\n }\r\n\r\n setGlobalPosition(x, y) {\r\n this.optimalPositionX = x;\r\n this.optimalPositionY = y;\r\n this.globalPositionX = x;\r\n this.globalPositionY = y;\r\n this.leftTree.globalPositionX = x;\r\n this.leftTree.globalPositionY = y;\r\n this.rightTree.globalPositionX = x;\r\n this.rightTree.globalPositionY = y;\r\n }\r\n\r\n subSetDirty() {\r\n this.dirty = true;\r\n this.leftTree.subSetDirty();\r\n this.rightTree.subSetDirty();\r\n }\r\n\r\n onTick(delta) {\r\n if (this.dirty) {\r\n const x = this.container.x;\r\n const y = this.container.y;\r\n this.leftTree.setPosition(x, y);\r\n this.rightTree.setPosition(x, y);\r\n super.onTick(delta);\r\n }\r\n }\r\n\r\n callRecursive(fn) {\r\n this.leftTree.callRecursive(fn);\r\n this.rightTree.callRecursive(fn);\r\n }\r\n\r\n fillAABB(aabb, maxDepth) {\r\n this.leftTree?.fillAABB(aabb, maxDepth);\r\n this.rightTree?.fillAABB(aabb, maxDepth);\r\n }\r\n\r\n // TODO override this one so we dont need branch here\r\n getPositionX() {\r\n return this.optimalPositionX;\r\n }\r\n\r\n // TODO override this one so we dont need branch here.\r\n getPositionY() {\r\n return this.optimalPositionY;\r\n }\r\n\r\n sortChildrenByEntity() {\r\n this.leftTree.sortChildrenByEntity();\r\n this.rightTree.sortChildrenByEntity();\r\n }\r\n\r\n onUpdated() {\r\n if (this.entity.side !== this.layout.side) {\r\n // change tree style\r\n const fullTree = this.entity.side === 0;\r\n this.layout.side = fullTree ? 0 : 1;\r\n this.container.visible = fullTree;\r\n this.isVisible = fullTree;\r\n this.container.alpha = 1;\r\n this.setLayoutDirty();\r\n this.renderer.nodes.filter(t => !!t.parent && t.parent.isRoot).forEach(t => {\r\n t.synapse.graphics.visible = fullTree;\r\n });\r\n }\r\n \r\n if (this.entity.state !== this.state) {\r\n this.state = this.entity.state;\r\n this.renderer.nodes.forEach(t => {\r\n if (!t.isRoot) {\r\n t.render();\r\n }\r\n });\r\n }\r\n\r\n this.render();\r\n this.setDirty();\r\n this.renderer.setTickDirty();\r\n }\r\n\r\n}","\r\nexport default class DynamicChar {\r\n\r\n constructor() {\r\n this.style = null;\r\n\r\n // char data\r\n this.data = null;\r\n\r\n // is this char space?\r\n this.space = false;\r\n\r\n this.emoji = false;\r\n\r\n this.paint = false;\r\n\r\n // charcode\r\n this.charcode = 0;\r\n\r\n // char string value\r\n this.value = \"\";\r\n\r\n // word index\r\n this.wordIndex = -1;\r\n\r\n // line index of char\r\n this.lineIndex = -1;\r\n }\r\n}\r\n\r\n","\r\nexport default class DynamicTextStyle {\r\n\r\n constructor(parent) {\r\n this.respectDirty = true;\r\n this._parent = parent || null;\r\n this._scale = 1;\r\n this._align = \"left\";\r\n this._fontFamily = `\"IBM Plex Sans\", sans-serif`;\r\n this._fontSize = 48;\r\n this._fontWeight = \"normal\";\r\n this._fontStyle = \"normal\";\r\n this._letterSpacing = 0;\r\n this._lineHeight = 0;\r\n this._verticalAlign = 0;\r\n this._rotation = 0;\r\n this._skew = 0;\r\n this._fill = \"#fff\";\r\n this._resolution = 2;\r\n this._inverseResolution = 0.5;\r\n }\r\n\r\n clone() {\r\n const style = new DynamicTextStyle();\r\n style.merge(this);\r\n return style;\r\n }\r\n\r\n merge(style) {\r\n if (typeof style === \"object\") {\r\n this.respectDirty = false;\r\n for (const param in style) {\r\n const val = style[param];\r\n\r\n if (typeof val === \"function\" || param === \"respectDirty\" || param === \"_parent\") continue;\r\n this[param] = style[param];\r\n }\r\n this.respectDirty = true;\r\n this._dirty = true;\r\n }\r\n }\r\n\r\n\r\n ctxKey(char) {\r\n return [char, this.fill, this.fontWeight, this.fontSize].join(\"|\");\r\n }\r\n\r\n ctxFont() {\r\n const fontSize = `${Math.min(200, Math.max(1, this.renderFontSize || 26))}px`;\r\n return `${this.fontWeight} ${this.fontStyle} ${fontSize} ${this.fontFamily}`;\r\n }\r\n\r\n set _dirty(val) {\r\n if (this.respectDirty) {\r\n if (this._parent !== null) {\r\n this._parent.dirtyStyle = val;\r\n this._parent.update();\r\n }\r\n }\r\n }\r\n\r\n get scale() {\r\n return this._scale;\r\n }\r\n\r\n set scale(val) {\r\n if (val !== this._scale) {\r\n this._scale = val;\r\n this._dirty = true;\r\n }\r\n }\r\n\r\n get align() {\r\n return this._align;\r\n }\r\n\r\n set align(val) {\r\n if (val !== this._align) {\r\n this._align = val;\r\n this._dirty = true;\r\n }\r\n }\r\n\r\n get fontFamily() {\r\n return this._fontFamily;\r\n }\r\n\r\n set fontFamily(val) {\r\n if (val !== this._fontFamily) {\r\n this._fontFamily = val;\r\n this._dirty = true;\r\n }\r\n }\r\n\r\n get renderFontSize() {\r\n return this._fontSize * this._resolution;\r\n }\r\n\r\n get fontSize() {\r\n return this._fontSize;\r\n }\r\n\r\n set fontSize(val) {\r\n if (val !== this._fontSize) {\r\n this._fontSize = val;\r\n this._dirty = true;\r\n }\r\n }\r\n\r\n get fontWeight() {\r\n return this._fontWeight;\r\n }\r\n\r\n set fontWeight(val) {\r\n if (val !== this._fontWeight) {\r\n this._fontWeight = val;\r\n this._dirty = true;\r\n }\r\n }\r\n\r\n get fontStyle() {\r\n return this._fontStyle;\r\n }\r\n\r\n set fontStyle(val) {\r\n if (val !== this._fontStyle) {\r\n this._fontStyle = val;\r\n this._dirty = true;\r\n }\r\n }\r\n\r\n get letterSpacing() {\r\n return this._letterSpacing;\r\n }\r\n\r\n set letterSpacing(val) {\r\n if (val !== this._letterSpacing) {\r\n this._letterSpacing = val;\r\n this._dirty = true;\r\n }\r\n }\r\n\r\n get lineHeight() {\r\n return this._lineHeight;\r\n }\r\n\r\n set lineHeight(val) {\r\n if (val !== this._lineHeight) {\r\n this._lineHeight = val;\r\n this._dirty = true;\r\n }\r\n }\r\n\r\n get verticalAlign() {\r\n return this._verticalAlign;\r\n }\r\n\r\n set verticalAlign(val) {\r\n if (val !== this._verticalAlign) {\r\n this._verticalAlign = val;\r\n this._dirty = true;\r\n }\r\n }\r\n\r\n get rotation() {\r\n return this._rotation;\r\n }\r\n\r\n set rotation(val) {\r\n if (val !== this._rotation) {\r\n this._rotation = val;\r\n this._dirty = true;\r\n }\r\n }\r\n\r\n get skew() {\r\n return this._skew;\r\n }\r\n\r\n set skew(val) {\r\n if (val !== this._skew) {\r\n this._skew = val;\r\n this._dirty = true;\r\n }\r\n }\r\n\r\n get fill() {\r\n return this._fill;\r\n }\r\n\r\n set fill(val) {\r\n if (val !== this._fill) {\r\n this._fill = val;\r\n this._dirty = true;\r\n }\r\n }\r\n\r\n get resolution() {\r\n return this._resolution;\r\n }\r\n\r\n get inverseResolution() {\r\n return this._inverseResolution;\r\n }\r\n\r\n set resolution(val) {\r\n if (val !== this._resolution) {\r\n this._resolution = val;\r\n this._inverseResolution = 1 / val;\r\n this._dirty = true;\r\n }\r\n }\r\n\r\n \r\n\r\n}\r\n","\r\nexport default class DynamicCharOverride {\r\n\r\n constructor(char, optionsCallback, renderCallback) {\r\n this.char = char;\r\n this.optionsCallback = optionsCallback;\r\n this.renderCallback = renderCallback;\r\n }\r\n\r\n draw(context, obj, offsetX, offsetY) {\r\n this.renderCallback(context, obj, offsetX, offsetY);\r\n }\r\n\r\n getCharData(style) {\r\n return this.optionsCallback(style);\r\n }\r\n\r\n}","import DynamicCharOverride from \"./DynamicCharOverride\";\r\nimport { Rectangle } from \"../pixi\";\r\n\r\nconst overrides = [\r\n new DynamicCharOverride(\r\n \"•\",\r\n (style) => ({\r\n \"rect\": new Rectangle(\r\n style.fontSize * 0.175,\r\n -style.fontSize * 1.4,\r\n style.fontSize * 1.65,\r\n style.fontSize * 1.4\r\n ),\r\n \"width\": style.fontSize * 1.65,\r\n \"descent\": 1,\r\n \"lineHeight\": style.fontSize * 2,\r\n \"emoji\": true,\r\n \"paint\": false\r\n }),\r\n (g, obj, offsetX, offsetY) => {\r\n const fontSize = obj.fontSize;\r\n const radius = fontSize * 0.7;\r\n g.fillStyle = \"#FFCF54\";\r\n g.beginPath();\r\n g.arc(offsetX + radius + obj.rectX, offsetY - radius, radius, 0, 2 * Math.PI, false);\r\n g.fill();\r\n }\r\n ),\r\n new DynamicCharOverride(\r\n \"â¤\",\r\n (style) => ({\r\n \"rect\": new Rectangle(\r\n style.fontSize * 0.25,\r\n -style.fontSize * 1.6,\r\n style.fontSize * 1.8,\r\n style.fontSize * 1.6\r\n ),\r\n \"width\": style.fontSize * 1.8,\r\n \"descent\": 1,\r\n \"lineHeight\": style.fontSize * 2,\r\n \"emoji\": true,\r\n \"paint\": false\r\n }),\r\n (g, obj, offsetX, offsetY) => {\r\n const w = obj.fontSize * 1.45;\r\n const h = obj.fontSize * 1.5;\r\n const radius = w * 0.5;\r\n\r\n drawHeart(g, offsetX + radius + obj.rectX, offsetY - h, w, h, \"#FF3C38\");\r\n }\r\n ),\r\n new DynamicCharOverride( // Flag\r\n \"â–¨\",\r\n (style) => ({\r\n \"rect\": new Rectangle(\r\n style.fontSize * 0.4,\r\n -style.fontSize * 1.4,\r\n style.fontSize * 1.6,\r\n style.fontSize * 1.4\r\n ),\r\n \"width\": style.fontSize * 1.6,\r\n \"descent\": 1,\r\n \"lineHeight\": style.fontSize * 2,\r\n \"emoji\": false,\r\n \"paint\": false\r\n }),\r\n (g, obj, offsetX, offsetY) => {\r\n const fontSize = obj.fontSize;\r\n const h = fontSize * 1.2;\r\n const radiusH = h * 0.5;\r\n const radiusW = h * 0.4;\r\n const lineWidth = fontSize * 0.15;\r\n const x = offsetX + obj.rectX + lineWidth / 2;\r\n const y = offsetY - h;\r\n const oldStrokeStyle = g.strokeStyle;\r\n g.strokeStyle = \"#fff\";\r\n g.lineWidth = lineWidth;\r\n g.beginPath();\r\n g.moveTo(x, y);\r\n g.lineTo(x + radiusW, y);\r\n g.lineTo(x + radiusW + lineWidth / 4, y + lineWidth);\r\n g.lineTo(x + radiusW * 2, y + lineWidth);\r\n g.lineTo(x + radiusW * 2, y + lineWidth + radiusH);\r\n g.lineTo(x + radiusW + lineWidth / 4, y + lineWidth + radiusH);\r\n g.lineTo(x + radiusW, y + radiusH);\r\n g.lineTo(x, y + radiusH);\r\n g.lineTo(x, y + h);\r\n g.lineTo(x, y - lineWidth / 2);\r\n g.stroke();\r\n g.strokeStyle = oldStrokeStyle;\r\n }\r\n ),\r\n new DynamicCharOverride( // Notes\r\n \"â–¤\",\r\n (style) => ({\r\n \"rect\": new Rectangle(\r\n style.fontSize * 0.165,\r\n -style.fontSize * 1.45,\r\n style.fontSize * 1.65,\r\n style.fontSize * 1.4\r\n ),\r\n \"width\": style.fontSize * 1.65,\r\n \"descent\": 1,\r\n \"lineHeight\": style.fontSize * 2,\r\n \"emoji\": false,\r\n \"paint\": false\r\n }),\r\n (g, obj, offsetX, offsetY) => {\r\n const fontSize = obj.fontSize;\r\n const h = fontSize * 1.2;\r\n const radiusW = h * 1.1;\r\n const lineWidth = fontSize * 0.15;\r\n const x = offsetX + obj.rectX + lineWidth / 2;\r\n const y = offsetY - h + lineWidth;\r\n const oldStrokeStyle = g.strokeStyle;\r\n g.strokeStyle = \"#fff\";\r\n g.lineWidth = lineWidth;\r\n \r\n g.beginPath();\r\n g.moveTo(x, y);\r\n g.lineTo(x + radiusW, y);\r\n g.stroke();\r\n\r\n g.beginPath();\r\n g.moveTo(x, y + lineWidth * 2.5);\r\n g.lineTo(x + radiusW, y + lineWidth * 2.5);\r\n g.stroke();\r\n \r\n g.beginPath();\r\n g.moveTo(x, y + lineWidth * 5);\r\n g.lineTo(x + radiusW * 0.5, y + lineWidth * 5);\r\n g.stroke();\r\n\r\n g.strokeStyle = oldStrokeStyle;\r\n }\r\n ),\r\n new DynamicCharOverride( // Resources\r\n \"â–°\",\r\n (style) => ({\r\n \"rect\": new Rectangle(\r\n style.fontSize * 0.1375,\r\n -style.fontSize * 1.5,\r\n style.fontSize * 1.65,\r\n style.fontSize * 1.4\r\n ),\r\n \"width\": style.fontSize * 1.65,\r\n \"descent\": 1,\r\n \"lineHeight\": style.fontSize * 2,\r\n \"emoji\": false,\r\n \"paint\": false\r\n }),\r\n (g, obj, offsetX, offsetY) => {\r\n const fontSize = obj.fontSize;\r\n const h = fontSize * 1.2;\r\n const unitW = fontSize / 6;\r\n const unitH = unitW * 0.75;\r\n const lineWidth = unitH;\r\n const x = offsetX + obj.rectX + fontSize * 0.15;\r\n const y = offsetY - h + lineWidth / 2;\r\n const oldStrokeStyle = g.strokeStyle;\r\n g.strokeStyle = \"#fff\";\r\n g.lineWidth = lineWidth;\r\n \r\n g.beginPath();\r\n g.moveTo(x + unitW * 6.5, y + unitH * 2);\r\n\r\n g.arc(\r\n x + unitW * 3.5, y + unitH * 3,\r\n unitH * 1,\r\n Math.PI * 1.5,\r\n Math.PI * 0.5,\r\n true\r\n );\r\n\r\n g.arc(\r\n x + unitW * 6.75, y + unitH * 2,\r\n unitH * 2,\r\n Math.PI * 2.5,\r\n Math.PI * 1.5,\r\n true\r\n );\r\n\r\n g.arc(\r\n x + unitW * 2.75, y + unitH * 3,\r\n unitH * 3,\r\n Math.PI * 1.5,\r\n Math.PI * 0.5,\r\n true\r\n );\r\n\r\n g.lineTo(x + unitW * 6.5, y + unitH * 6);\r\n g.stroke();\r\n\r\n g.strokeStyle = oldStrokeStyle;\r\n }\r\n ),\r\n new DynamicCharOverride( // Uncollapse Dongle\r\n \"â–±\",\r\n (style) => ({\r\n \"rect\": new Rectangle(\r\n style.fontSize * 0.5,\r\n -style.fontSize * 1.3,\r\n style.fontSize * 4.35,\r\n style.fontSize * 1.3\r\n ),\r\n \"width\": style.fontSize * 4.35,\r\n \"descent\": 0,\r\n \"lineHeight\": style.fontSize * 2,\r\n \"emoji\": false,\r\n \"paint\": true\r\n }),\r\n (g, obj, offsetX, offsetY) => {\r\n const fontSize = obj.fontSize;\r\n const h = fontSize;\r\n const w = fontSize * 2.5;\r\n const r = h * 0.5;\r\n const y = offsetY - r - h * 0.2;\r\n\r\n g.fillStyle = \"#ffffff\";\r\n\r\n g.fillRect(\r\n offsetX + obj.rectX + r,\r\n offsetY - h - h * 0.2, \r\n w, \r\n h\r\n );\r\n\r\n g.beginPath();\r\n g.arc(offsetX + obj.rectX + r, y, r, 0, Math.PI * 2, false);\r\n g.fill();\r\n\r\n g.beginPath();\r\n g.arc(offsetX + obj.rectX + r + w, y, r, 0, Math.PI * 2, false);\r\n g.fill();\r\n\r\n const oldComposite = g.globalCompositeOperation;\r\n g.globalCompositeOperation = \"destination-out\";\r\n \r\n g.beginPath();\r\n g.arc(offsetX + obj.rectX + w * 0.05 + r, y, r * 0.55, 0, Math.PI * 2, false);\r\n g.fill();\r\n\r\n g.beginPath();\r\n g.arc(offsetX + obj.rectX + w * 0.5 + r, y, r * 0.55, 0, Math.PI * 2, false);\r\n g.fill();\r\n\r\n g.beginPath();\r\n g.arc(offsetX + obj.rectX + w * 0.95 + r, y, r * 0.55, 0, Math.PI * 2, false);\r\n g.fill();\r\n\r\n g.globalCompositeOperation = oldComposite;\r\n }\r\n )\r\n];\r\n\r\n// TODO render the heart and flag using canvas ops instead of painting the image\r\n\r\n\r\nfunction drawHeart(ctx, fromx, fromy, lw, hlen, color) {\r\n\r\n var x = fromx;\r\n var y = fromy;\r\n var width = lw;\r\n var height = hlen;\r\n\r\n ctx.save();\r\n ctx.beginPath();\r\n var topCurveHeight = height * 0.4;\r\n ctx.moveTo(x, y + topCurveHeight - hlen * 0.1);\r\n\r\n // top left curve\r\n ctx.bezierCurveTo(\r\n x + lw * 0.05, y + hlen * 0.1, \r\n x - width / 2, y, \r\n x - width / 2, y + topCurveHeight\r\n );\r\n\r\n // bottom left curve\r\n ctx.bezierCurveTo(\r\n x - width / 2, y + (height + topCurveHeight) / 2, \r\n x, y + height, \r\n x, y + height\r\n );\r\n\r\n // bottom right curve\r\n ctx.bezierCurveTo(\r\n x, y + height, \r\n x + width / 2, y + (height + topCurveHeight) / 2, \r\n x + width / 2, y + topCurveHeight\r\n );\r\n\r\n // top right curve\r\n ctx.bezierCurveTo(\r\n x + width / 2, y, \r\n x - lw * 0.05, y + hlen * 0.1, \r\n x, y + topCurveHeight - hlen * 0.1\r\n );\r\n\r\n ctx.closePath();\r\n ctx.fillStyle = color;\r\n ctx.fill();\r\n ctx.restore();\r\n}\r\n\r\nexport default overrides;","import { Rectangle } from \"../pixi\";\r\n\r\nconst textMetrics = {\r\n \" |#fff|600|80\": {\r\n \"width\": 38,\r\n \"lineHeight\": 200\r\n },\r\n \"!|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 11,\r\n -114,\r\n 29,\r\n 117\r\n ),\r\n \"width\": 49,\r\n \"descent\": 1,\r\n \"lineHeight\": 200\r\n },\r\n \"\\\"|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 11,\r\n -120,\r\n 55,\r\n 53\r\n ),\r\n \"width\": 75,\r\n \"descent\": -69,\r\n \"lineHeight\": 200\r\n },\r\n \"#|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 3,\r\n -114,\r\n 101,\r\n 115\r\n ),\r\n \"width\": 105,\r\n \"descent\": -1,\r\n \"lineHeight\": 200\r\n },\r\n \"$|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 5,\r\n -126,\r\n 86,\r\n 140\r\n ),\r\n \"width\": 96,\r\n \"descent\": 12,\r\n \"lineHeight\": 200\r\n },\r\n \"%|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 8,\r\n -116,\r\n 140,\r\n 119\r\n ),\r\n \"width\": 154,\r\n \"descent\": 1,\r\n \"lineHeight\": 200\r\n },\r\n \"&|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 8,\r\n -116,\r\n 107,\r\n 119\r\n ),\r\n \"width\": 114,\r\n \"descent\": 1,\r\n \"lineHeight\": 200\r\n },\r\n \"'|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 11,\r\n -120,\r\n 22,\r\n 53\r\n ),\r\n \"width\": 42,\r\n \"descent\": -69,\r\n \"lineHeight\": 200\r\n },\r\n \"(|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 7,\r\n -124,\r\n 51,\r\n 147\r\n ),\r\n \"width\": 54,\r\n \"descent\": 21,\r\n \"lineHeight\": 200\r\n },\r\n \")|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n -2,\r\n -124,\r\n 51,\r\n 147\r\n ),\r\n \"width\": 54,\r\n \"descent\": 21,\r\n \"lineHeight\": 200\r\n },\r\n \"*|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 5,\r\n -122,\r\n 81,\r\n 78\r\n ),\r\n \"width\": 89,\r\n \"descent\": -46,\r\n \"lineHeight\": 200\r\n },\r\n \"+|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 10,\r\n -90,\r\n 78,\r\n 81\r\n ),\r\n \"width\": 96,\r\n \"descent\": -11,\r\n \"lineHeight\": 200\r\n },\r\n \",|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 5,\r\n -27,\r\n 35,\r\n 50\r\n ),\r\n \"width\": 48,\r\n \"descent\": 21,\r\n \"lineHeight\": 200\r\n },\r\n \"-|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 9,\r\n -61,\r\n 49,\r\n 23\r\n ),\r\n \"width\": 64,\r\n \"descent\": -40,\r\n \"lineHeight\": 200\r\n },\r\n \".|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 10,\r\n -26,\r\n 29,\r\n 29\r\n ),\r\n \"width\": 48,\r\n \"descent\": 1,\r\n \"lineHeight\": 200\r\n },\r\n \"/|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 0,\r\n -120,\r\n 67,\r\n 145\r\n ),\r\n \"width\": 70,\r\n \"descent\": 23,\r\n \"lineHeight\": 200\r\n },\r\n \"0|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 6,\r\n -116,\r\n 86,\r\n 119\r\n ),\r\n \"width\": 96,\r\n \"descent\": 1,\r\n \"lineHeight\": 200\r\n },\r\n \"1|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 6,\r\n -114,\r\n 88,\r\n 115\r\n ),\r\n \"width\": 96,\r\n \"descent\": -1,\r\n \"lineHeight\": 200\r\n },\r\n \"2|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 7,\r\n -116,\r\n 83,\r\n 117\r\n ),\r\n \"width\": 96,\r\n \"descent\": -1,\r\n \"lineHeight\": 200\r\n },\r\n \"3|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 3,\r\n -116,\r\n 84,\r\n 119\r\n ),\r\n \"width\": 96,\r\n \"descent\": 1,\r\n \"lineHeight\": 200\r\n },\r\n \"4|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 4,\r\n -114,\r\n 89,\r\n 115\r\n ),\r\n \"width\": 96,\r\n \"descent\": -1,\r\n \"lineHeight\": 200\r\n },\r\n \"5|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 8,\r\n -114,\r\n 83,\r\n 117\r\n ),\r\n \"width\": 96,\r\n \"descent\": 1,\r\n \"lineHeight\": 200\r\n },\r\n \"6|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 7,\r\n -114,\r\n 85,\r\n 117\r\n ),\r\n \"width\": 96,\r\n \"descent\": 1,\r\n \"lineHeight\": 200\r\n },\r\n \"7|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 9,\r\n -114,\r\n 81,\r\n 115\r\n ),\r\n \"width\": 96,\r\n \"descent\": -1,\r\n \"lineHeight\": 200\r\n },\r\n \"8|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 6,\r\n -116,\r\n 86,\r\n 119\r\n ),\r\n \"width\": 96,\r\n \"descent\": 1,\r\n \"lineHeight\": 200\r\n },\r\n \"9|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 6,\r\n -116,\r\n 85,\r\n 117\r\n ),\r\n \"width\": 96,\r\n \"descent\": -1,\r\n \"lineHeight\": 200\r\n },\r\n \":|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 12,\r\n -87,\r\n 29,\r\n 90\r\n ),\r\n \"width\": 51,\r\n \"descent\": 1,\r\n \"lineHeight\": 200\r\n },\r\n \";|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 7,\r\n -87,\r\n 34,\r\n 110\r\n ),\r\n \"width\": 51,\r\n \"descent\": 21,\r\n \"lineHeight\": 200\r\n },\r\n \"<|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 15,\r\n -97,\r\n 68,\r\n 99\r\n ),\r\n \"width\": 96,\r\n \"descent\": 0,\r\n \"lineHeight\": 200\r\n },\r\n \"=|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 10,\r\n -77,\r\n 78,\r\n 55\r\n ),\r\n \"width\": 96,\r\n \"descent\": -24,\r\n \"lineHeight\": 200\r\n },\r\n \">|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 15,\r\n -97,\r\n 68,\r\n 99\r\n ),\r\n \"width\": 96,\r\n \"descent\": 0,\r\n \"lineHeight\": 200\r\n },\r\n \"?|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 2,\r\n -116,\r\n 75,\r\n 119\r\n ),\r\n \"width\": 79,\r\n \"descent\": 1,\r\n \"lineHeight\": 200\r\n },\r\n \"@|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 9,\r\n -115,\r\n 128,\r\n 135\r\n ),\r\n \"width\": 144,\r\n \"descent\": 18,\r\n \"lineHeight\": 200\r\n },\r\n \"A|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 3,\r\n -114,\r\n 104,\r\n 115\r\n ),\r\n \"width\": 108,\r\n \"descent\": -1,\r\n \"lineHeight\": 200\r\n },\r\n \"B|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 12,\r\n -114,\r\n 89,\r\n 115\r\n ),\r\n \"width\": 106,\r\n \"descent\": -1,\r\n \"lineHeight\": 200\r\n },\r\n \"C|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 8,\r\n -116,\r\n 93,\r\n 119\r\n ),\r\n \"width\": 103,\r\n \"descent\": 1,\r\n \"lineHeight\": 200\r\n },\r\n \"D|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 12,\r\n -114,\r\n 93,\r\n 115\r\n ),\r\n \"width\": 110,\r\n \"descent\": -1,\r\n \"lineHeight\": 200\r\n },\r\n \"E|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 12,\r\n -114,\r\n 77,\r\n 115\r\n ),\r\n \"width\": 96,\r\n \"descent\": -1,\r\n \"lineHeight\": 200\r\n },\r\n \"F|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 12,\r\n -114,\r\n 76,\r\n 115\r\n ),\r\n \"width\": 92,\r\n \"descent\": -1,\r\n \"lineHeight\": 200\r\n },\r\n \"G|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 8,\r\n -116,\r\n 97,\r\n 119\r\n ),\r\n \"width\": 114,\r\n \"descent\": 1,\r\n \"lineHeight\": 200\r\n },\r\n \"H|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 12,\r\n -114,\r\n 93,\r\n 115\r\n ),\r\n \"width\": 115,\r\n \"descent\": -1,\r\n \"lineHeight\": 200\r\n },\r\n \"I|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 8,\r\n -114,\r\n 54,\r\n 115\r\n ),\r\n \"width\": 68,\r\n \"descent\": -1,\r\n \"lineHeight\": 200\r\n },\r\n \"J|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 3,\r\n -114,\r\n 74,\r\n 117\r\n ),\r\n \"width\": 87,\r\n \"descent\": 1,\r\n \"lineHeight\": 200\r\n },\r\n \"K|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 12,\r\n -114,\r\n 97,\r\n 115\r\n ),\r\n \"width\": 108,\r\n \"descent\": -1,\r\n \"lineHeight\": 200\r\n },\r\n \"L|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 12,\r\n -114,\r\n 69,\r\n 115\r\n ),\r\n \"width\": 83,\r\n \"descent\": -1,\r\n \"lineHeight\": 200\r\n },\r\n \"M|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 12,\r\n -114,\r\n 108,\r\n 115\r\n ),\r\n \"width\": 131,\r\n \"descent\": -1,\r\n \"lineHeight\": 200\r\n },\r\n \"N|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 12,\r\n -114,\r\n 93,\r\n 115\r\n ),\r\n \"width\": 115,\r\n \"descent\": -1,\r\n \"lineHeight\": 200\r\n },\r\n \"O|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 8,\r\n -116,\r\n 100,\r\n 119\r\n ),\r\n \"width\": 114,\r\n \"descent\": 1,\r\n \"lineHeight\": 200\r\n },\r\n \"P|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 12,\r\n -114,\r\n 87,\r\n 115\r\n ),\r\n \"width\": 103,\r\n \"descent\": -1,\r\n \"lineHeight\": 200\r\n },\r\n \"Q|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 8,\r\n -116,\r\n 100,\r\n 145\r\n ),\r\n \"width\": 114,\r\n \"descent\": 27,\r\n \"lineHeight\": 200\r\n },\r\n \"R|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 12,\r\n -114,\r\n 89,\r\n 115\r\n ),\r\n \"width\": 106,\r\n \"descent\": -1,\r\n \"lineHeight\": 200\r\n },\r\n \"S|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 5,\r\n -116,\r\n 88,\r\n 119\r\n ),\r\n \"width\": 98,\r\n \"descent\": 1,\r\n \"lineHeight\": 200\r\n },\r\n \"T|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 3,\r\n -114,\r\n 88,\r\n 115\r\n ),\r\n \"width\": 93,\r\n \"descent\": -1,\r\n \"lineHeight\": 200\r\n },\r\n \"U|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 12,\r\n -114,\r\n 89,\r\n 117\r\n ),\r\n \"width\": 110,\r\n \"descent\": 1,\r\n \"lineHeight\": 200\r\n },\r\n \"V|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 2,\r\n -114,\r\n 100,\r\n 115\r\n ),\r\n \"width\": 102,\r\n \"descent\": -1,\r\n \"lineHeight\": 200\r\n },\r\n \"W|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 3,\r\n -114,\r\n 147,\r\n 115\r\n ),\r\n \"width\": 152,\r\n \"descent\": -1,\r\n \"lineHeight\": 200\r\n },\r\n \"X|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 2,\r\n -114,\r\n 103,\r\n 115\r\n ),\r\n \"width\": 105,\r\n \"descent\": -1,\r\n \"lineHeight\": 200\r\n },\r\n \"Y|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 1,\r\n -114,\r\n 101,\r\n 115\r\n ),\r\n \"width\": 101,\r\n \"descent\": -1,\r\n \"lineHeight\": 200\r\n },\r\n \"Z|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 5,\r\n -114,\r\n 88,\r\n 115\r\n ),\r\n \"width\": 96,\r\n \"descent\": -1,\r\n \"lineHeight\": 200\r\n },\r\n \"[|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 12,\r\n -124,\r\n 35,\r\n 147\r\n ),\r\n \"width\": 53,\r\n \"descent\": 21,\r\n \"lineHeight\": 200\r\n },\r\n \"\\\\|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 5,\r\n -120,\r\n 67,\r\n 145\r\n ),\r\n \"width\": 70,\r\n \"descent\": 23,\r\n \"lineHeight\": 200\r\n },\r\n \"]|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 8,\r\n -124,\r\n 34,\r\n 147\r\n ),\r\n \"width\": 53,\r\n \"descent\": 21,\r\n \"lineHeight\": 200\r\n },\r\n \"^|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 6,\r\n -114,\r\n 86,\r\n 70\r\n ),\r\n \"width\": 96,\r\n \"descent\": -46,\r\n \"lineHeight\": 200\r\n },\r\n \"_|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 4,\r\n 10,\r\n 83,\r\n 20\r\n ),\r\n \"width\": 89,\r\n \"descent\": 28,\r\n \"lineHeight\": 200\r\n },\r\n \"`|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 25,\r\n -131,\r\n 36,\r\n 39\r\n ),\r\n \"width\": 96,\r\n \"descent\": -94,\r\n \"lineHeight\": 200\r\n },\r\n \"a|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 5,\r\n -87,\r\n 82,\r\n 90\r\n ),\r\n \"width\": 89,\r\n \"descent\": 1,\r\n \"lineHeight\": 200\r\n },\r\n \"b|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 11,\r\n -120,\r\n 81,\r\n 123\r\n ),\r\n \"width\": 96,\r\n \"descent\": 1,\r\n \"lineHeight\": 200\r\n },\r\n \"c|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 5,\r\n -87,\r\n 76,\r\n 90\r\n ),\r\n \"width\": 82,\r\n \"descent\": 1,\r\n \"lineHeight\": 200\r\n },\r\n \"d|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 6,\r\n -120,\r\n 81,\r\n 123\r\n ),\r\n \"width\": 96,\r\n \"descent\": 1,\r\n \"lineHeight\": 200\r\n },\r\n \"e|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 5,\r\n -87,\r\n 81,\r\n 90\r\n ),\r\n \"width\": 89,\r\n \"descent\": 1,\r\n \"lineHeight\": 200\r\n },\r\n \"f|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 3,\r\n -120,\r\n 53,\r\n 121\r\n ),\r\n \"width\": 56,\r\n \"descent\": -1,\r\n \"lineHeight\": 200\r\n },\r\n \"g|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 4,\r\n -100,\r\n 86,\r\n 135\r\n ),\r\n \"width\": 87,\r\n \"descent\": 33,\r\n \"lineHeight\": 200\r\n },\r\n \"h|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 11,\r\n -120,\r\n 75,\r\n 121\r\n ),\r\n \"width\": 94,\r\n \"descent\": -1,\r\n \"lineHeight\": 200\r\n },\r\n \"i|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 9,\r\n -121,\r\n 28,\r\n 122\r\n ),\r\n \"width\": 44,\r\n \"descent\": -1,\r\n \"lineHeight\": 200\r\n },\r\n \"j|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n -2,\r\n -121,\r\n 39,\r\n 154\r\n ),\r\n \"width\": 44,\r\n \"descent\": 31,\r\n \"lineHeight\": 200\r\n },\r\n \"k|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 11,\r\n -120,\r\n 81,\r\n 121\r\n ),\r\n \"width\": 90,\r\n \"descent\": -1,\r\n \"lineHeight\": 200\r\n },\r\n \"l|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 11,\r\n -120,\r\n 35,\r\n 121\r\n ),\r\n \"width\": 47,\r\n \"descent\": -1,\r\n \"lineHeight\": 200\r\n },\r\n \"m|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 11,\r\n -87,\r\n 123,\r\n 88\r\n ),\r\n \"width\": 142,\r\n \"descent\": -1,\r\n \"lineHeight\": 200\r\n },\r\n \"n|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 11,\r\n -87,\r\n 75,\r\n 88\r\n ),\r\n \"width\": 94,\r\n \"descent\": -1,\r\n \"lineHeight\": 200\r\n },\r\n \"o|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 5,\r\n -87,\r\n 82,\r\n 90\r\n ),\r\n \"width\": 90,\r\n \"descent\": 1,\r\n \"lineHeight\": 200\r\n },\r\n \"p|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 11,\r\n -87,\r\n 81,\r\n 120\r\n ),\r\n \"width\": 96,\r\n \"descent\": 31,\r\n \"lineHeight\": 200\r\n },\r\n \"q|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 6,\r\n -87,\r\n 81,\r\n 120\r\n ),\r\n \"width\": 96,\r\n \"descent\": 31,\r\n \"lineHeight\": 200\r\n },\r\n \"r|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 11,\r\n -86,\r\n 51,\r\n 87\r\n ),\r\n \"width\": 63,\r\n \"descent\": -1,\r\n \"lineHeight\": 200\r\n },\r\n \"s|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 4,\r\n -87,\r\n 72,\r\n 90\r\n ),\r\n \"width\": 80,\r\n \"descent\": 1,\r\n \"lineHeight\": 200\r\n },\r\n \"t|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 3,\r\n -109,\r\n 54,\r\n 110\r\n ),\r\n \"width\": 60,\r\n \"descent\": -1,\r\n \"lineHeight\": 200\r\n },\r\n \"u|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 10,\r\n -86,\r\n 75,\r\n 89\r\n ),\r\n \"width\": 94,\r\n \"descent\": 1,\r\n \"lineHeight\": 200\r\n },\r\n \"v|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 1,\r\n -86,\r\n 84,\r\n 87\r\n ),\r\n \"width\": 84,\r\n \"descent\": -1,\r\n \"lineHeight\": 200\r\n },\r\n \"w|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 3,\r\n -86,\r\n 127,\r\n 87\r\n ),\r\n \"width\": 131,\r\n \"descent\": -1,\r\n \"lineHeight\": 200\r\n },\r\n \"x|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 2,\r\n -86,\r\n 85,\r\n 87\r\n ),\r\n \"width\": 87,\r\n \"descent\": -1,\r\n \"lineHeight\": 200\r\n },\r\n \"y|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 1,\r\n -86,\r\n 84,\r\n 119\r\n ),\r\n \"width\": 84,\r\n \"descent\": 31,\r\n \"lineHeight\": 200\r\n },\r\n \"z|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 5,\r\n -86,\r\n 72,\r\n 87\r\n ),\r\n \"width\": 80,\r\n \"descent\": -1,\r\n \"lineHeight\": 200\r\n },\r\n \"{|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 2,\r\n -124,\r\n 50,\r\n 147\r\n ),\r\n \"width\": 58,\r\n \"descent\": 21,\r\n \"lineHeight\": 200\r\n },\r\n \"||#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 21,\r\n -124,\r\n 20,\r\n 147\r\n ),\r\n \"width\": 60,\r\n \"descent\": 21,\r\n \"lineHeight\": 200\r\n },\r\n \"}|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 8,\r\n -124,\r\n 50,\r\n 147\r\n ),\r\n \"width\": 58,\r\n \"descent\": 21,\r\n \"lineHeight\": 200\r\n },\r\n \"~|#fff|600|80\": {\r\n \"rect\": new Rectangle(\r\n 8,\r\n -64,\r\n 82,\r\n 30\r\n ),\r\n \"width\": 96,\r\n \"descent\": -36,\r\n \"lineHeight\": 200\r\n },\r\n \" |#fff|normal|48\": {\r\n \"width\": 23,\r\n \"lineHeight\": 120\r\n },\r\n \"!|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 7,\r\n -69,\r\n 15,\r\n 72\r\n ),\r\n \"width\": 27,\r\n \"descent\": 1,\r\n \"lineHeight\": 120\r\n },\r\n \"\\\"|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 7,\r\n -73,\r\n 28,\r\n 31\r\n ),\r\n \"width\": 40,\r\n \"descent\": -44,\r\n \"lineHeight\": 120\r\n },\r\n \"#|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 5,\r\n -69,\r\n 60,\r\n 71\r\n ),\r\n \"width\": 68,\r\n \"descent\": 0,\r\n \"lineHeight\": 120\r\n },\r\n \"$|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 4,\r\n -77,\r\n 51,\r\n 87\r\n ),\r\n \"width\": 57,\r\n \"descent\": 8,\r\n \"lineHeight\": 120\r\n },\r\n \"%|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 5,\r\n -70,\r\n 81,\r\n 73\r\n ),\r\n \"width\": 89,\r\n \"descent\": 1,\r\n \"lineHeight\": 120\r\n },\r\n \"&|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 6,\r\n -70,\r\n 61,\r\n 73\r\n ),\r\n \"width\": 67,\r\n \"descent\": 1,\r\n \"lineHeight\": 120\r\n },\r\n \"'|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 7,\r\n -73,\r\n 11,\r\n 31\r\n ),\r\n \"width\": 23,\r\n \"descent\": -44,\r\n \"lineHeight\": 120\r\n },\r\n \"(|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 7,\r\n -75,\r\n 28,\r\n 90\r\n ),\r\n \"width\": 32,\r\n \"descent\": 13,\r\n \"lineHeight\": 120\r\n },\r\n \")|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n -1,\r\n -75,\r\n 28,\r\n 90\r\n ),\r\n \"width\": 32,\r\n \"descent\": 13,\r\n \"lineHeight\": 120\r\n },\r\n \"*|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 3,\r\n -74,\r\n 40,\r\n 39\r\n ),\r\n \"width\": 43,\r\n \"descent\": -37,\r\n \"lineHeight\": 120\r\n },\r\n \"+|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 6,\r\n -55,\r\n 48,\r\n 51\r\n ),\r\n \"width\": 58,\r\n \"descent\": -6,\r\n \"lineHeight\": 120\r\n },\r\n \",|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 3,\r\n -13,\r\n 19,\r\n 28\r\n ),\r\n \"width\": 26,\r\n \"descent\": 13,\r\n \"lineHeight\": 120\r\n },\r\n \"-|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 6,\r\n -35,\r\n 28,\r\n 12\r\n ),\r\n \"width\": 38,\r\n \"descent\": -25,\r\n \"lineHeight\": 120\r\n },\r\n \".|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 6,\r\n -13,\r\n 16,\r\n 16\r\n ),\r\n \"width\": 26,\r\n \"descent\": 1,\r\n \"lineHeight\": 120\r\n },\r\n \"/|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 0,\r\n -73,\r\n 36,\r\n 90\r\n ),\r\n \"width\": 37,\r\n \"descent\": 15,\r\n \"lineHeight\": 120\r\n },\r\n \"0|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 5,\r\n -70,\r\n 50,\r\n 73\r\n ),\r\n \"width\": 58,\r\n \"descent\": 1,\r\n \"lineHeight\": 120\r\n },\r\n \"1|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 4,\r\n -69,\r\n 51,\r\n 71\r\n ),\r\n \"width\": 58,\r\n \"descent\": 0,\r\n \"lineHeight\": 120\r\n },\r\n \"2|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 6,\r\n -70,\r\n 48,\r\n 72\r\n ),\r\n \"width\": 58,\r\n \"descent\": 0,\r\n \"lineHeight\": 120\r\n },\r\n \"3|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 3,\r\n -70,\r\n 48,\r\n 73\r\n ),\r\n \"width\": 58,\r\n \"descent\": 1,\r\n \"lineHeight\": 120\r\n },\r\n \"4|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 3,\r\n -69,\r\n 53,\r\n 71\r\n ),\r\n \"width\": 58,\r\n \"descent\": 0,\r\n \"lineHeight\": 120\r\n },\r\n \"5|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 7,\r\n -69,\r\n 47,\r\n 72\r\n ),\r\n \"width\": 58,\r\n \"descent\": 1,\r\n \"lineHeight\": 120\r\n },\r\n \"6|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 6,\r\n -69,\r\n 48,\r\n 72\r\n ),\r\n \"width\": 58,\r\n \"descent\": 1,\r\n \"lineHeight\": 120\r\n },\r\n \"7|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 6,\r\n -69,\r\n 47,\r\n 71\r\n ),\r\n \"width\": 58,\r\n \"descent\": 0,\r\n \"lineHeight\": 120\r\n },\r\n \"8|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 5,\r\n -70,\r\n 50,\r\n 73\r\n ),\r\n \"width\": 58,\r\n \"descent\": 1,\r\n \"lineHeight\": 120\r\n },\r\n \"9|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 6,\r\n -70,\r\n 48,\r\n 72\r\n ),\r\n \"width\": 58,\r\n \"descent\": 0,\r\n \"lineHeight\": 120\r\n },\r\n \":|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 7,\r\n -52,\r\n 16,\r\n 55\r\n ),\r\n \"width\": 28,\r\n \"descent\": 1,\r\n \"lineHeight\": 120\r\n },\r\n \";|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 4,\r\n -52,\r\n 19,\r\n 67\r\n ),\r\n \"width\": 28,\r\n \"descent\": 13,\r\n \"lineHeight\": 120\r\n },\r\n \"<|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 8,\r\n -56,\r\n 44,\r\n 59\r\n ),\r\n \"width\": 58,\r\n \"descent\": 1,\r\n \"lineHeight\": 120\r\n },\r\n \"=|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 6,\r\n -44,\r\n 48,\r\n 30\r\n ),\r\n \"width\": 58,\r\n \"descent\": -16,\r\n \"lineHeight\": 120\r\n },\r\n \">|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 8,\r\n -56,\r\n 44,\r\n 59\r\n ),\r\n \"width\": 58,\r\n \"descent\": 1,\r\n \"lineHeight\": 120\r\n },\r\n \"?|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 1,\r\n -70,\r\n 44,\r\n 73\r\n ),\r\n \"width\": 46,\r\n \"descent\": 1,\r\n \"lineHeight\": 120\r\n },\r\n \"@|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 5,\r\n -70,\r\n 77,\r\n 84\r\n ),\r\n \"width\": 86,\r\n \"descent\": 12,\r\n \"lineHeight\": 120\r\n },\r\n \"A|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 1,\r\n -69,\r\n 61,\r\n 71\r\n ),\r\n \"width\": 62,\r\n \"descent\": 0,\r\n \"lineHeight\": 120\r\n },\r\n \"B|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 8,\r\n -69,\r\n 51,\r\n 71\r\n ),\r\n \"width\": 63,\r\n \"descent\": 0,\r\n \"lineHeight\": 120\r\n },\r\n \"C|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 5,\r\n -70,\r\n 54,\r\n 73\r\n ),\r\n \"width\": 60,\r\n \"descent\": 1,\r\n \"lineHeight\": 120\r\n },\r\n \"D|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 8,\r\n -69,\r\n 54,\r\n 71\r\n ),\r\n \"width\": 64,\r\n \"descent\": 0,\r\n \"lineHeight\": 120\r\n },\r\n \"E|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 8,\r\n -69,\r\n 45,\r\n 71\r\n ),\r\n \"width\": 56,\r\n \"descent\": 0,\r\n \"lineHeight\": 120\r\n },\r\n \"F|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 8,\r\n -69,\r\n 44,\r\n 71\r\n ),\r\n \"width\": 54,\r\n \"descent\": 0,\r\n \"lineHeight\": 120\r\n },\r\n \"G|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 5,\r\n -70,\r\n 58,\r\n 73\r\n ),\r\n \"width\": 67,\r\n \"descent\": 1,\r\n \"lineHeight\": 120\r\n },\r\n \"H|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 8,\r\n -69,\r\n 54,\r\n 71\r\n ),\r\n \"width\": 68,\r\n \"descent\": 0,\r\n \"lineHeight\": 120\r\n },\r\n \"I|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 5,\r\n -69,\r\n 30,\r\n 71\r\n ),\r\n \"width\": 38,\r\n \"descent\": 0,\r\n \"lineHeight\": 120\r\n },\r\n \"J|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 2,\r\n -69,\r\n 41,\r\n 72\r\n ),\r\n \"width\": 49,\r\n \"descent\": 1,\r\n \"lineHeight\": 120\r\n },\r\n \"K|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 8,\r\n -69,\r\n 54,\r\n 71\r\n ),\r\n \"width\": 61,\r\n \"descent\": 0,\r\n \"lineHeight\": 120\r\n },\r\n \"L|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 8,\r\n -69,\r\n 40,\r\n 71\r\n ),\r\n \"width\": 48,\r\n \"descent\": 0,\r\n \"lineHeight\": 120\r\n },\r\n \"M|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 8,\r\n -69,\r\n 64,\r\n 71\r\n ),\r\n \"width\": 78,\r\n \"descent\": 0,\r\n \"lineHeight\": 120\r\n },\r\n \"N|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 8,\r\n -69,\r\n 54,\r\n 71\r\n ),\r\n \"width\": 68,\r\n \"descent\": 0,\r\n \"lineHeight\": 120\r\n },\r\n \"O|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 5,\r\n -70,\r\n 60,\r\n 73\r\n ),\r\n \"width\": 68,\r\n \"descent\": 1,\r\n \"lineHeight\": 120\r\n },\r\n \"P|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 8,\r\n -69,\r\n 49,\r\n 71\r\n ),\r\n \"width\": 58,\r\n \"descent\": 0,\r\n \"lineHeight\": 120\r\n },\r\n \"Q|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 5,\r\n -70,\r\n 60,\r\n 88\r\n ),\r\n \"width\": 68,\r\n \"descent\": 16,\r\n \"lineHeight\": 120\r\n },\r\n \"R|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 8,\r\n -69,\r\n 51,\r\n 71\r\n ),\r\n \"width\": 61,\r\n \"descent\": 0,\r\n \"lineHeight\": 120\r\n },\r\n \"S|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 3,\r\n -70,\r\n 51,\r\n 73\r\n ),\r\n \"width\": 56,\r\n \"descent\": 1,\r\n \"lineHeight\": 120\r\n },\r\n \"T|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 1,\r\n -69,\r\n 55,\r\n 71\r\n ),\r\n \"width\": 55,\r\n \"descent\": 0,\r\n \"lineHeight\": 120\r\n },\r\n \"U|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 8,\r\n -69,\r\n 51,\r\n 72\r\n ),\r\n \"width\": 65,\r\n \"descent\": 1,\r\n \"lineHeight\": 120\r\n },\r\n \"V|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 1,\r\n -69,\r\n 58,\r\n 71\r\n ),\r\n \"width\": 58,\r\n \"descent\": 0,\r\n \"lineHeight\": 120\r\n },\r\n \"W|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 1,\r\n -69,\r\n 85,\r\n 71\r\n ),\r\n \"width\": 86,\r\n \"descent\": 0,\r\n \"lineHeight\": 120\r\n },\r\n \"X|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 2,\r\n -69,\r\n 57,\r\n 71\r\n ),\r\n \"width\": 59,\r\n \"descent\": 0,\r\n \"lineHeight\": 120\r\n },\r\n \"Y|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 1,\r\n -69,\r\n 57,\r\n 71\r\n ),\r\n \"width\": 57,\r\n \"descent\": 0,\r\n \"lineHeight\": 120\r\n },\r\n \"Z|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 3,\r\n -69,\r\n 52,\r\n 71\r\n ),\r\n \"width\": 56,\r\n \"descent\": 0,\r\n \"lineHeight\": 120\r\n },\r\n \"[|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 8,\r\n -75,\r\n 19,\r\n 90\r\n ),\r\n \"width\": 30,\r\n \"descent\": 13,\r\n \"lineHeight\": 120\r\n },\r\n \"\\\\|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 3,\r\n -73,\r\n 35,\r\n 90\r\n ),\r\n \"width\": 37,\r\n \"descent\": 15,\r\n \"lineHeight\": 120\r\n },\r\n \"]|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 5,\r\n -75,\r\n 19,\r\n 90\r\n ),\r\n \"width\": 30,\r\n \"descent\": 13,\r\n \"lineHeight\": 120\r\n },\r\n \"^|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 4,\r\n -69,\r\n 52,\r\n 43\r\n ),\r\n \"width\": 58,\r\n \"descent\": -28,\r\n \"lineHeight\": 120\r\n },\r\n \"_|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 2,\r\n 7,\r\n 52,\r\n 11\r\n ),\r\n \"width\": 54,\r\n \"descent\": 16,\r\n \"lineHeight\": 120\r\n },\r\n \"`|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 17,\r\n -77,\r\n 19,\r\n 23\r\n ),\r\n \"width\": 58,\r\n \"descent\": -56,\r\n \"lineHeight\": 120\r\n },\r\n \"a|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 3,\r\n -53,\r\n 48,\r\n 56\r\n ),\r\n \"width\": 51,\r\n \"descent\": 1,\r\n \"lineHeight\": 120\r\n },\r\n \"b|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 7,\r\n -73,\r\n 47,\r\n 76\r\n ),\r\n \"width\": 56,\r\n \"descent\": 1,\r\n \"lineHeight\": 120\r\n },\r\n \"c|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 4,\r\n -53,\r\n 44,\r\n 56\r\n ),\r\n \"width\": 48,\r\n \"descent\": 1,\r\n \"lineHeight\": 120\r\n },\r\n \"d|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 4,\r\n -73,\r\n 46,\r\n 76\r\n ),\r\n \"width\": 56,\r\n \"descent\": 1,\r\n \"lineHeight\": 120\r\n },\r\n \"e|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 4,\r\n -53,\r\n 47,\r\n 56\r\n ),\r\n \"width\": 53,\r\n \"descent\": 1,\r\n \"lineHeight\": 120\r\n },\r\n \"f|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 2,\r\n -73,\r\n 30,\r\n 75\r\n ),\r\n \"width\": 31,\r\n \"descent\": 0,\r\n \"lineHeight\": 120\r\n },\r\n \"g|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 3,\r\n -58,\r\n 50,\r\n 80\r\n ),\r\n \"width\": 51,\r\n \"descent\": 20,\r\n \"lineHeight\": 120\r\n },\r\n \"h|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 7,\r\n -73,\r\n 43,\r\n 75\r\n ),\r\n \"width\": 55,\r\n \"descent\": 0,\r\n \"lineHeight\": 120\r\n },\r\n \"i|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 7,\r\n -73,\r\n 12,\r\n 75\r\n ),\r\n \"width\": 24,\r\n \"descent\": 0,\r\n \"lineHeight\": 120\r\n },\r\n \"j|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n -1,\r\n -73,\r\n 20,\r\n 94\r\n ),\r\n \"width\": 24,\r\n \"descent\": 19,\r\n \"lineHeight\": 120\r\n },\r\n \"k|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 7,\r\n -73,\r\n 45,\r\n 75\r\n ),\r\n \"width\": 51,\r\n \"descent\": 0,\r\n \"lineHeight\": 120\r\n },\r\n \"l|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 7,\r\n -73,\r\n 19,\r\n 75\r\n ),\r\n \"width\": 26,\r\n \"descent\": 0,\r\n \"lineHeight\": 120\r\n },\r\n \"m|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 7,\r\n -53,\r\n 72,\r\n 55\r\n ),\r\n \"width\": 84,\r\n \"descent\": 0,\r\n \"lineHeight\": 120\r\n },\r\n \"n|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 7,\r\n -53,\r\n 43,\r\n 55\r\n ),\r\n \"width\": 55,\r\n \"descent\": 0,\r\n \"lineHeight\": 120\r\n },\r\n \"o|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 4,\r\n -53,\r\n 48,\r\n 56\r\n ),\r\n \"width\": 54,\r\n \"descent\": 1,\r\n \"lineHeight\": 120\r\n },\r\n \"p|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 7,\r\n -53,\r\n 47,\r\n 74\r\n ),\r\n \"width\": 56,\r\n \"descent\": 19,\r\n \"lineHeight\": 120\r\n },\r\n \"q|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 4,\r\n -53,\r\n 46,\r\n 74\r\n ),\r\n \"width\": 56,\r\n \"descent\": 19,\r\n \"lineHeight\": 120\r\n },\r\n \"r|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 7,\r\n -52,\r\n 29,\r\n 54\r\n ),\r\n \"width\": 35,\r\n \"descent\": 0,\r\n \"lineHeight\": 120\r\n },\r\n \"s|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 3,\r\n -53,\r\n 41,\r\n 56\r\n ),\r\n \"width\": 47,\r\n \"descent\": 1,\r\n \"lineHeight\": 120\r\n },\r\n \"t|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 2,\r\n -66,\r\n 30,\r\n 68\r\n ),\r\n \"width\": 34,\r\n \"descent\": 0,\r\n \"lineHeight\": 120\r\n },\r\n \"u|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 7,\r\n -52,\r\n 42,\r\n 55\r\n ),\r\n \"width\": 55,\r\n \"descent\": 1,\r\n \"lineHeight\": 120\r\n },\r\n \"v|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 1,\r\n -52,\r\n 47,\r\n 54\r\n ),\r\n \"width\": 47,\r\n \"descent\": 0,\r\n \"lineHeight\": 120\r\n },\r\n \"w|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 2,\r\n -52,\r\n 72,\r\n 54\r\n ),\r\n \"width\": 74,\r\n \"descent\": 0,\r\n \"lineHeight\": 120\r\n },\r\n \"x|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 1,\r\n -52,\r\n 48,\r\n 54\r\n ),\r\n \"width\": 49,\r\n \"descent\": 0,\r\n \"lineHeight\": 120\r\n },\r\n \"y|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 1,\r\n -52,\r\n 48,\r\n 73\r\n ),\r\n \"width\": 48,\r\n \"descent\": 19,\r\n \"lineHeight\": 120\r\n },\r\n \"z|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 2,\r\n -52,\r\n 42,\r\n 54\r\n ),\r\n \"width\": 45,\r\n \"descent\": 0,\r\n \"lineHeight\": 120\r\n },\r\n \"{|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 1,\r\n -75,\r\n 29,\r\n 90\r\n ),\r\n \"width\": 33,\r\n \"descent\": 13,\r\n \"lineHeight\": 120\r\n },\r\n \"||#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 11,\r\n -75,\r\n 10,\r\n 90\r\n ),\r\n \"width\": 30,\r\n \"descent\": 13,\r\n \"lineHeight\": 120\r\n },\r\n \"}|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 5,\r\n -75,\r\n 29,\r\n 90\r\n ),\r\n \"width\": 33,\r\n \"descent\": 13,\r\n \"lineHeight\": 120\r\n },\r\n \"~|#fff|normal|48\": {\r\n \"rect\": new Rectangle(\r\n 5,\r\n -38,\r\n 50,\r\n 18\r\n ),\r\n \"width\": 58,\r\n \"descent\": -22,\r\n \"lineHeight\": 120\r\n }\r\n};\r\n\r\nexport default textMetrics;","import { Rectangle, BaseTexture, Texture, utils } from \"../pixi\";\r\nimport DynamicText from \"./DynamicText\";\r\nimport DynamicTextStyle from \"./DynamicTextStyle\";\r\nimport Overrides from \"./Overrides\";\r\nimport TextMetrics from \"./TextMetrics\";\r\n\r\n// Atlas\r\nconst metricsCanvas = document.createElement(\"canvas\");\r\nconst metricsContext = metricsCanvas.getContext(\"2d\", { willReadFrequently: true });\r\n\r\nmetricsCanvas.width = 100;\r\nmetricsCanvas.height = 100;\r\n\r\n// TODO add resolution to style, and multiply rendered fontsize with it.\r\n// http://homepages.math.uic.edu/~leon/mcs425-s08/handouts/char_freq2.pdf\r\nexport default class DynamicAtlas {\r\n\r\n constructor(padding) {\r\n this.padding = padding;\r\n this.canvas = null;\r\n this.context = null;\r\n this.objects = null;\r\n this.newObjects = [];\r\n this.baseTexture = null;\r\n this.lazyTimeout = null;\r\n this.rootNode = null;\r\n this.canvasList = [];\r\n this.atlasdim = 0;\r\n this.startdim = 1024;\r\n this.maxdim = 4096;\r\n this.fontFamilyCache = {};\r\n this.overrides = new Map();\r\n this.addCanvas();\r\n }\r\n\r\n addCanvas() {\r\n // create new canvas\r\n this.canvas = document.createElement(\"canvas\");\r\n this.context = this.canvas.getContext(\"2d\", { willReadFrequently: true });\r\n this.canvasList.push(this.canvas);\r\n\r\n // reset dimentions\r\n this.atlasdim = this.startdim;\r\n this.canvas.width = this.canvas.height = this.atlasdim;\r\n this.rootNode = new AtlasNode(this.atlasdim, this.atlasdim);\r\n\r\n // reset array with canvas objects and create new atlas\r\n this.objects = [];\r\n\r\n // set new basetexture\r\n this.baseTexture = BaseTexture.fromCanvas(this.canvas);\r\n this.baseTexture.mipmap = false; // if not, pixi bug resizing POW2\r\n this.baseTexture.resolution = 1; // todo: support all resolutions\r\n this.baseTexture.update();\r\n\r\n // add char overrides\r\n Overrides.forEach(t => this.overrides.set(t.char, t));\r\n\r\n // Debug Spritesheet\r\n if (DynamicText.settings.debugSpriteSheet) {\r\n this.canvas.className = \"DynamicText_SpriteSheet\";\r\n document.body.appendChild(this.canvas);\r\n }\r\n }\r\n\r\n drawObjects(arr, resized) {\r\n if (resized) {\r\n this.baseTexture.update();\r\n }\r\n\r\n for (let i = 0; i < arr.length; i++) { this.drawObject(arr[i]); }\r\n\r\n if (resized) {\r\n for (let i = 0; i < this.objects.length; i++) {\r\n const obj = this.objects[i];\r\n if (!!obj.texture) {\r\n obj.texture.updateUvs();\r\n }\r\n }\r\n }\r\n }\r\n\r\n drawObject(obj) {\r\n const offsetX = obj.frame.x - obj.rectX;\r\n const offsetY = obj.frame.y - obj.rectY;\r\n\r\n if (this.overrides.has(obj.value)) {\r\n this.overrides.get(obj.value).draw(this.context, obj, offsetX, offsetY);\r\n } else {\r\n this.context.font = obj.font;\r\n this.context.fillStyle = obj.fill;\r\n this.context.fillText(obj.value, offsetX, offsetY);\r\n }\r\n\r\n obj.texture.frame = obj.frame;\r\n obj.texture.update();\r\n }\r\n\r\n getCharObject(char, style) {\r\n const font = style.ctxFont();\r\n\r\n // create new cache for fontFamily\r\n let familyCache = this.fontFamilyCache[font];\r\n\r\n if (!familyCache) {\r\n familyCache = {};\r\n this.fontFamilyCache[font] = familyCache;\r\n }\r\n\r\n // get char data\r\n const key = style.ctxKey(char);\r\n let obj = familyCache[key];\r\n\r\n if (!obj) {\r\n // create char object\r\n\r\n const metrics = !!TextMetrics[key] ? { ...TextMetrics[key] } : this.overrides.has(char) ? this.overrides.get(char).getCharData(style) : this.generateCharData(char, style);\r\n const hasRect = !!metrics.rect;\r\n\r\n // temp resize if doesnt fit (not nesseary when we dont need to generate textures)\r\n if (hasRect) {\r\n if (this.canvas.width < metrics.rect.width || this.canvas.height < metrics.rect.height) {\r\n this.canvas.width = this.canvas.height = Math.max(metrics.rect.width, metrics.rect.height);\r\n this.baseTexture.update();\r\n }\r\n }\r\n\r\n // todo: cleanup when we know whats needed\r\n obj = {\r\n metrics,\r\n font,\r\n emoji: !!metrics.emoji,\r\n paint: !!metrics.paint,\r\n value: char,\r\n frame: metrics.rect,\r\n fill: style.fill,\r\n fontSize: style.fontSize,\r\n baseTexture: hasRect ? this.baseTexture : null,\r\n rectX: hasRect ? metrics.rect.x : 0,\r\n rectY: hasRect ? metrics.rect.y : 0,\r\n xOffset: hasRect ? metrics.rect.x : 0, // TODO merge with xOffset\r\n yOffset: metrics.descent || 0,\r\n width: metrics.width || 0,\r\n lineHeight: metrics.lineHeight || 0,\r\n texture: metrics.rect ? new Texture(this.baseTexture, metrics.rect) : null, // temp texture\r\n };\r\n\r\n // add to collections\r\n familyCache[key] = obj;\r\n\r\n // add to atlas if visible char\r\n if (hasRect) {\r\n this.newObjects.push(obj);\r\n\r\n if (this.lazyTimeout === null) {\r\n this.lazyTimeout = setTimeout(() => {\r\n this.addNewObjects();\r\n this.lazyTimeout = null;\r\n }, 0);\r\n }\r\n }\r\n }\r\n\r\n return obj;\r\n }\r\n\r\n // TODO debug resize canvas\r\n addNewObjects() {\r\n this.newObjects.sort(compareFunction);\r\n let _resized = false;\r\n let _newcanvas = false;\r\n\r\n for (let i = 0; i < this.newObjects.length; i++) {\r\n const obj = this.newObjects[i];\r\n const node = this.rootNode.insert(obj.frame.width + this.padding, obj.frame.height + this.padding, obj);\r\n\r\n if (node !== null) {\r\n if (_newcanvas) obj.texture.baseTexture = this.baseTexture; // update this.basetexture if new canvas was created (temp)\r\n this.objects.push(obj);\r\n continue;\r\n }\r\n\r\n // step one back (so it will be added after resize/new canvas)\r\n i--;\r\n\r\n if (this.atlasdim < this.maxdim) {\r\n _resized = true;\r\n this.resizeCanvas(this.atlasdim * 2);\r\n continue;\r\n }\r\n\r\n // close current spritesheet and make a new one\r\n this.drawObjects(this.objects, _resized);\r\n this.addCanvas();\r\n _newcanvas = true;\r\n _resized = false;\r\n }\r\n\r\n this.drawObjects(_resized || _newcanvas ? this.objects : this.newObjects, _resized);\r\n this.newObjects = [];\r\n }\r\n\r\n resizeCanvas(dim) {\r\n this.canvas.width = this.canvas.height = this.atlasdim = dim;\r\n\r\n this.rootNode = new AtlasNode(dim, dim);\r\n this.objects.sort(compareFunction);\r\n\r\n for (let i = 0; i < this.objects.length; i++) {\r\n const obj = this.objects[i];\r\n this.rootNode.insert(obj.frame.width + this.padding, obj.frame.height + this.padding, obj);\r\n }\r\n };\r\n\r\n generateCharData(char, style) {\r\n const fontSize = Math.max(1, int(style.renderFontSize, 26));\r\n const lineHeight = fontSize * 1.25;\r\n\r\n // Start our returnobject\r\n const data = {\r\n lineHeight,\r\n width: 0,\r\n };\r\n\r\n // Return if newline\r\n if (!char) { return data; }\r\n\r\n // Ctx font string\r\n const font = style.ctxFont();\r\n\r\n metricsContext.font = font;\r\n\r\n // Get char width\r\n data.width = Math.round(metricsContext.measureText(char).width);\r\n\r\n // Return if char = space\r\n if (char === \" \") return data;\r\n\r\n // set canvas size (with this.padding so we can messure)\r\n const paddingY = Math.round(fontSize * 0.7);\r\n const paddingX = Math.max(5, Math.round(fontSize * 0.7));\r\n\r\n metricsCanvas.width = (Math.ceil(data.width) + paddingX * 2);\r\n metricsCanvas.height = 1.5 * fontSize;\r\n const w = metricsCanvas.width;\r\n const h = metricsCanvas.height;\r\n const baseline = (h / 2) + (paddingY * 0.5);\r\n\r\n // set font again after resize\r\n metricsContext.font = font;\r\n\r\n // make sure canvas is clean\r\n metricsContext.clearRect(0, 0, w, h);\r\n\r\n // save clean state with font\r\n metricsContext.save();\r\n\r\n // draw text\r\n //console.time(\"char get\")\r\n metricsContext.fillStyle = style.fill;\r\n metricsContext.fillText(char, paddingX, baseline); // TODO use this with metrics to accelerate the paint later on, by doing this instead of copying the image\r\n metricsContext.restore();\r\n //console.timeEnd(\"char get\") \r\n\r\n // begin messuring\r\n // TODO TODO TODO to load faster, we can skip the entire measure, and dont fetch pixeldata if we simply pre-gen it for all common chars!\r\n const pixelData = metricsContext.getImageData(0, 0, w, h).data;\r\n\r\n let i = 3;\r\n const line = w * 4;\r\n const len = pixelData.length;\r\n\r\n // scanline on alpha\r\n while (i < len && !pixelData[i]) { i += 4; }\r\n\r\n const ascent = (i / line) | 0;\r\n\r\n if (i < len) {\r\n // rev scanline on alpha\r\n i = len - 1;\r\n while (i > 0 && !pixelData[i]) { i -= 4; }\r\n\r\n const descent = (i / line) | 0;\r\n\r\n // left to right scanline on alpha\r\n for (i = 3; i < len && !pixelData[i];) {\r\n i += line;\r\n if (i >= len) { i = (i - len) + 4; }\r\n }\r\n\r\n const minx = ((i % line) / 4) | 0;\r\n\r\n // right to left scanline on alpha\r\n let step = 1;\r\n\r\n for (i = len - 1; i >= 0 && !pixelData[i];) {\r\n i -= line;\r\n if (i < 0) { i = (len - 1) - (step++) * 4; }\r\n }\r\n\r\n const maxx = ((i % line) / 4) + 1 | 0;\r\n\r\n // set font metrics\r\n data.ascent = Math.round(baseline - ascent);\r\n data.descent = Math.round(descent - baseline);\r\n\r\n const finalMinX = minx - paddingX;\r\n const finalMaxX = maxx - paddingX;\r\n\r\n data.rect = new Rectangle(\r\n finalMinX,\r\n -data.ascent - 2,\r\n finalMaxX - finalMinX + 2,\r\n data.ascent + data.descent + 4,\r\n );\r\n }\r\n\r\n return data;\r\n }\r\n\r\n generateMetricsData() {\r\n const FONT_H1 = new DynamicTextStyle();\r\n FONT_H1.fontSize = 80;\r\n FONT_H1.fontStyle = \"normal\";\r\n FONT_H1.fontWeight = \"600\";\r\n\r\n const FONT_H3 = new DynamicTextStyle();\r\n const styles = [FONT_H1, FONT_H3];\r\n\r\n const tempCache = {};\r\n\r\n styles.forEach(style => {\r\n\r\n for (let i = 32; i < 127; i++) {\r\n const char = String.fromCharCode(i);\r\n const key = style.ctxKey(char);\r\n const data = this.generateCharData(char, style);\r\n\r\n tempCache[key] = {\r\n rect: data.rect,\r\n width: data.width,\r\n descent: data.descent,\r\n lineHeight: data.lineHeight\r\n };\r\n }\r\n });\r\n\r\n console.log(JSON.stringify(tempCache, 0, 2));\r\n }\r\n\r\n}\r\n\r\nexport class AtlasNode {\r\n\r\n constructor(w, h) {\r\n this.children = [];\r\n this.rect = new Rectangle(0, 0, w || 0, h || 0);\r\n this.data = null;\r\n }\r\n\r\n insert(width, height, obj) {\r\n\r\n if (this.children.length > 0) {\r\n const newNode = this.children[0].insert(width, height, obj);\r\n if (newNode !== null) return newNode;\r\n return this.children[1].insert(width, height, obj);\r\n }\r\n\r\n if (this.data !== null) return null;\r\n\r\n if (width > this.rect.width || height > this.rect.height) return null;\r\n\r\n if (width === this.rect.width && height === this.rect.height) {\r\n this.data = obj;\r\n obj.frame.x = this.rect.x;\r\n obj.frame.y = this.rect.y;\r\n return this;\r\n }\r\n\r\n this.children.push(new AtlasNode());\r\n this.children.push(new AtlasNode());\r\n\r\n const dw = this.rect.width - width;\r\n const dh = this.rect.height - height;\r\n\r\n if (dw > dh) {\r\n this.children[0].rect = new Rectangle(this.rect.x, this.rect.y, width, this.rect.height);\r\n this.children[1].rect = new Rectangle(this.rect.x + width, this.rect.y, this.rect.width - width, this.rect.height);\r\n }\r\n else {\r\n this.children[0].rect = new Rectangle(this.rect.x, this.rect.y, this.rect.width, height);\r\n this.children[1].rect = new Rectangle(this.rect.x, this.rect.y + height, this.rect.width, this.rect.height - height);\r\n }\r\n\r\n return this.children[0].insert(width, height, obj);\r\n }\r\n\r\n}\r\n\r\n// helper function for int or default\r\nfunction int(val, def) {\r\n if (isNaN(val)) return def;\r\n\r\n return parseInt(val);\r\n}\r\n\r\nconst compareFunction = function (a, b) {\r\n if (a.frame.height < b.frame.height) { return 1; }\r\n\r\n if (a.frame.height > b.frame.height) { return -1; }\r\n\r\n if (a.frame.width < b.frame.width) { return 1; }\r\n\r\n if (a.frame.width > b.frame.width) { return -1; }\r\n\r\n return 0;\r\n};\r\n\r\n\r\nBaseTexture.fromCanvas = function (canvas, scaleMode, origin) {\r\n origin = origin || 'canvas';\r\n if (!canvas._pixiId) {\r\n canvas._pixiId = `${origin}_${Date.now()}`;\r\n }\r\n\r\n let baseTexture = utils.BaseTextureCache[canvas._pixiId];\r\n\r\n if (!baseTexture) {\r\n baseTexture = new BaseTexture(canvas, scaleMode);\r\n BaseTexture.addToCache(baseTexture, canvas._pixiId);\r\n } else {\r\n baseTexture.update();\r\n }\r\n\r\n return baseTexture;\r\n}","import DynamicChar from \"./DynamicChar\";\r\nimport DynamicAtlas from \"./DynamicAtlas\";\r\nimport emojiRegex from \"emoji-regex\";\r\nimport { Sprite, Point, Container } from \"../pixi\";\r\n\r\nlet atlas = null;\r\n\r\n/**\r\n* An dynamic text object with auto generated atlas\r\n*\r\n* @class\r\n* @extends PIXI.UI.UIBase\r\n* @memberof PIXI.UI\r\n* @param text {String} Text content\r\n* @param [width=0] {Number|String} width of textbox. 0 = this.autoWidth\r\n* @param [height=0] {Number|String} height of textbox. 0 = this.autoHeight\r\n* @param [allowTags=true] {boolean} Allow inline styling\r\n* @param [options=null] {} Additional text settings\r\n*/\r\n\r\n// TODO optimize, and remove everything we dont need.\r\n// TODO use tint instead of two different styles for color when active.\r\n\r\nconst KNOWN_EMOJIS = new Set();\r\n\r\n\r\nexport default class DynamicText extends Container { // TODO extend container\r\n\r\n\r\n constructor(text, options) {\r\n super();\r\n this.options = options || {};\r\n\r\n // create atlas\r\n if (atlas === null) { atlas = new DynamicAtlas(1); }\r\n\r\n this.autoWidth = !this.options.width;\r\n\r\n // this._style for this textobject\r\n this._style = this.options.style;\r\n\r\n //this._style.merge(this.options.style); // TODO dont recreate this one.. to prevent recreate on setting style.\r\n\r\n // collection of all processed char\r\n this.chars = [];\r\n this.renderChars = [];\r\n this.spriteCache = []; \r\n\r\n // the input text\r\n this._inputText = text;\r\n\r\n // states\r\n this.lastWidth = 0;\r\n this.lastHeight = 0;\r\n\r\n this.textWidth = 0;\r\n this.textHeight = 0;\r\n\r\n\r\n this.dirty = !!text;\r\n this.dirtyText = this.dirty;\r\n this.dirtyStyle = this.dirty;\r\n this.dirtyRender = this.dirty;\r\n\r\n // dictionary for line data\r\n this.lineFontSizeData = 0;\r\n this.lineAlignmentData = \"left\";\r\n\r\n this.renderCount = 0;\r\n this.charCount = 0;\r\n\r\n this.lazyUpdate = null;\r\n this.paintColor = 0xffffff;\r\n\r\n if (this.dirty) {\r\n this.updateImmediate();\r\n }\r\n }\r\n\r\n _render(renderer) {\r\n this.updateImmediate();\r\n super._render(renderer);\r\n }\r\n\r\n onRender() {\r\n let yOffset = this.lineHeightData;\r\n let xOffset = 0;\r\n let i;\r\n\r\n if (this.spriteCache.length > this.renderCount) {\r\n for (i = this.renderCount; i < this.spriteCache.length; i++) {\r\n const removeSprite = this.spriteCache[i];\r\n if (removeSprite) { \r\n removeSprite.visible = false; \r\n }\r\n }\r\n }\r\n\r\n let char;\r\n let lineWidth = this.lineWidthData;\r\n let lineHeight = this.lineHeightData;\r\n\r\n switch (this.lineAlignmentData) {\r\n case \"right\": xOffset = this._width - lineWidth; break;\r\n case \"center\": xOffset = (this._width - lineWidth) * 0.5; break;\r\n default: xOffset = 0;\r\n }\r\n\r\n for (i = 0; i < this.renderCount; i++) {\r\n char = this.renderChars[i];\r\n\r\n // no reason to render a blank space or 0x0 letters (no texture created)\r\n if (!char.data.texture || char.space) {\r\n if (this.spriteCache[i]) { this.spriteCache[i].visible = false; }\r\n continue;\r\n }\r\n\r\n // add new sprite\r\n const tex = char.data.texture;\r\n let sprite = this.spriteCache[i];\r\n\r\n if (!sprite) {\r\n sprite = this.spriteCache[i] = new Sprite(tex);\r\n sprite.anchor.set(0.5);\r\n } else { \r\n sprite.texture = tex; \r\n }\r\n\r\n sprite.visible = true;\r\n sprite.x = char.x + xOffset + tex.width * 0.5;\r\n sprite.y = char.y + yOffset - tex.height * 0.5 - (lineHeight - this.lineFontSizeData);\r\n \r\n sprite.tint = char.emoji ? 0xffffff : (char.paint ? this.paintColor : this.tint);\r\n sprite.rotation = float(char.style.rotation, 0);\r\n sprite.skew.x = float(char.style.skew, 0);\r\n \r\n if (!sprite.parent) {\r\n this.addChild(sprite);\r\n }\r\n }\r\n \r\n const inverseResolution = this._style.inverseResolution;\r\n this.scale.set(inverseResolution, inverseResolution);\r\n this.textWidth = lineWidth * inverseResolution;\r\n this.textHeight = lineHeight * inverseResolution;\r\n }\r\n\r\n prepareForRender() {\r\n const pos = new Point();\r\n let wordIndex = 0;\r\n let lineHeight = 0;\r\n let lineFontSize = 0;\r\n let lineAlignment = this._style.align;\r\n let style;\r\n let renderIndex = 0;\r\n let i;\r\n\r\n for (i = 0; i < this.charCount; i++) {\r\n const char = this.chars[i];\r\n\r\n style = char.style;\r\n\r\n // lineheight\r\n lineHeight = Math.max(lineHeight, this._style.lineHeight || style.lineHeight || char.data.lineHeight);\r\n\r\n // set word index\r\n if (char.space) {\r\n wordIndex++;\r\n } else {\r\n char.wordIndex = wordIndex;\r\n }\r\n\r\n // textheight\r\n lineFontSize = Math.max(lineFontSize, style.renderFontSize);\r\n\r\n // lineindex\r\n char.lineIndex = 0;\r\n\r\n // lineAlignment\r\n if (style.align !== this._style.align) lineAlignment = style.align;\r\n\r\n const size = Math.round(char.data.width) + float(style.letterSpacing, 0);\r\n \r\n // position\r\n char.x = pos.x + char.data.xOffset;\r\n char.y = parseFloat(style.verticalAlign) + char.data.yOffset;\r\n pos.x += size;\r\n this.renderChars[renderIndex] = char;\r\n renderIndex++;\r\n }\r\n\r\n const lastChar = this.chars[this.charCount - 1];\r\n\r\n if (lastChar) {\r\n pos.x -= lastChar.style.letterSpacing;\r\n }\r\n\r\n if (lastChar.space) {\r\n pos.x -= lastChar.data.width;\r\n pos.x -= float(style.letterSpacing, 0);\r\n }\r\n\r\n this.lineWidthData = pos.x;\r\n this.lineHeightData = lineHeight;\r\n this.lineFontSizeData = lineFontSize;\r\n this.lineAlignmentData = lineAlignment;\r\n this.renderCount = renderIndex;\r\n }\r\n\r\n processInputText() {\r\n let charIndex = 0;\r\n const regex = emojiRegex();\r\n const inputArray = Array.from(this._inputText);\r\n \r\n let match;\r\n let offset = 0;\r\n \r\n while ((match = regex.exec(this._inputText))) {\r\n const m = match[0];\r\n const size = [ ...m ].length;\r\n inputArray.splice(match.index - offset, size, m);\r\n KNOWN_EMOJIS.add(m);\r\n offset += size + (m.length - size) - 1;\r\n }\r\n\r\n for (let i = 0; i < inputArray.length; i++) {\r\n let c = inputArray[i];\r\n let char = this.chars[charIndex];\r\n \r\n if (!char) {\r\n char = new DynamicChar();\r\n this.chars[charIndex] = char;\r\n }\r\n\r\n char.style = this._style;\r\n char.data = atlas.getCharObject(c, char.style);\r\n char.value = c;\r\n char.space = c === \" \";\r\n char.emoji = KNOWN_EMOJIS.has(c) || char.data.emoji;\r\n char.paint = !!char.data.paint;\r\n charIndex++;\r\n }\r\n \r\n this.charCount = charIndex;\r\n }\r\n\r\n update() {\r\n if (this.lazyUpdate !== null) return;\r\n this.lazyUpdate = setTimeout(() => {\r\n this.updateImmediate();\r\n this.lazyUpdate = null;\r\n }, 0);\r\n }\r\n\r\n updateImmediate() {\r\n\r\n if (this.dirtyText || this.dirtyStyle) {\r\n this.dirtyText = this.dirtyStyle = false;\r\n this.dirtyRender = true; // force render after textchange\r\n this.processInputText();\r\n }\r\n\r\n if (this.dirtyRender) {\r\n this.dirtyRender = false;\r\n this.dirty = false;\r\n this.lastWidth = this._width;\r\n this.lastHeight = this.height;\r\n this.prepareForRender();\r\n this.onRender();\r\n }\r\n }\r\n\r\n\r\n get value() {\r\n return this._inputText;\r\n }\r\n\r\n set value(val) {\r\n if (val !== this._inputText) {\r\n this._inputText = val;\r\n this.dirtyText = true;\r\n this.updateImmediate();\r\n }\r\n }\r\n\r\n get text() {\r\n return this.value;\r\n }\r\n\r\n set text(val) {\r\n this.value = val;\r\n }\r\n\r\n get style() {\r\n return this._style;\r\n }\r\n\r\n set style(val) {\r\n if (val !== this._style && this._inputText !== \"\") {\r\n this._style = val;\r\n this.dirtyStyle = true;\r\n this.updateImmediate();\r\n } else {\r\n this._style = val;\r\n }\r\n }\r\n\r\n setTextAndStyle(text, style, tint, paintColor) {\r\n this.dirtyText = (this._inputText !== text && !!text) || this.dirtyText;\r\n this.dirtyStyle = (this._style !== style && !!style) || this.dirtyStyle;\r\n\r\n if (this.dirtyText || this.dirtyStyle) {\r\n this.tint = tint;\r\n this.paintColor = paintColor;\r\n this._style = style || this.style; \r\n this._inputText = text || this._inputText;\r\n this.updateImmediate();\r\n } else {\r\n this.setTint(tint, paintColor);\r\n }\r\n }\r\n\r\n setTint(tint, paintColor = 0xffffff) {\r\n if (this.tint !== tint || this.paintColor !== paintColor) {\r\n this.tint = tint;\r\n this.paintColor = paintColor;\r\n \r\n for (let i = 0; i < this.renderChars.length; i++) {\r\n const c = this.renderChars[i];\r\n const s = this.spriteCache[i];\r\n\r\n if (!!c.paint && !!s) {\r\n s.tint = paintColor;\r\n } else if (!c.emoji && !!s) {\r\n s.tint = tint;\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\n// TODO DynamicText.prototype = Object.create(Widget.prototype);\r\n//DynamicText.prototype.constructor = DynamicText;\r\n\r\nDynamicText.settings = {\r\n debugSpriteSheet: false,\r\n defaultEmojiFont: \"Segoe UI Emoji\", // force one font family for emojis so we dont rerender them multiple times\r\n};\r\n\r\n\r\n// helper function for float or default\r\nfunction float(val, def) {\r\n if (isNaN(val)) return def;\r\n\r\n return parseFloat(val);\r\n}\r\n","import { Rectangle } from \"../pixi\";\r\nimport NodeBase from \"./NodeBase.js\";\r\nimport DynamicText from \"../text/DynamicText\";\r\nimport DynamicTextStyle from \"../text/DynamicTextStyle\";\r\n\r\nconst FONT_H1 = new DynamicTextStyle();\r\nFONT_H1.fontSize = 80;\r\nFONT_H1.fontStyle = \"normal\";\r\nFONT_H1.fontWeight = \"600\";\r\n\r\nconst FONT_H3 = new DynamicTextStyle();\r\n\r\nconst RATING_STRINGS = [\r\n \"\",\r\n \"•\",\r\n \"••\",\r\n \"•••\",\r\n \"••••\",\r\n \"•••••\"\r\n];\r\n\r\n\r\nexport default class InteractiveNode extends NodeBase {\r\n\r\n constructor(entity, renderer, layout) {\r\n super(entity, renderer, layout);\r\n this.renderText = new DynamicText(\"\", { style: FONT_H3 });\r\n this.renderText.zIndex = 1000000;\r\n this.renderText.tint = 0x555;\r\n this.renderText.visible = false;\r\n this.container.hitArea = new Rectangle(0, 0, 0, 0);\r\n this.container.interactiveChildren = false;\r\n }\r\n\r\n onClick(ev) {\r\n if (this.isCollapsed) {\r\n const coords = this.renderer.viewport.toWorld(ev.data.global.x, ev.data.global.y);\r\n\r\n const offsetX = coords.x - this.container.x + this.width / 2;\r\n const dongleWidth = this.renderText.style.fontSize * 2.35;\r\n\r\n if (\r\n (this.side === 1 && offsetX > this.width - dongleWidth) ||\r\n (this.side === -1 && offsetX < dongleWidth)\r\n ) {\r\n if (this.renderer.manager.canEdit()) {\r\n this.entity.setIsCollapsed(false);\r\n } else {\r\n this.entity.isCollapsed = false;\r\n this.setIsCollapsed(false);\r\n }\r\n } else {\r\n this.renderer.emit(\"onNodeFocused\", this);\r\n }\r\n } else {\r\n this.renderer.emit(\"onNodeFocused\", this);\r\n }\r\n }\r\n\r\n onDoubleClick(ev) {\r\n this.renderer.emit(\"onNodeEdit\", this);\r\n console.log(this);\r\n }\r\n\r\n onUpdateColor() {\r\n const index = this.indexInParent;\r\n if (this.entity.rgbColor !== null) {\r\n this.renderColor = this.entity.rgbColor;\r\n } else {\r\n const color = this.parent.renderColor;\r\n const mul = Math.sin(index * Math.PI / 4) * 6;\r\n let red = Math.max(0, Math.min(255, ((color >> 16) & 0xff) + mul));\r\n let green = Math.max(0, Math.min(255, ((color >> 8) & 0xff) + mul));\r\n let blue = Math.max(0, Math.min(255, (color & 0xff) + mul));\r\n this.renderColor = (red << 16) | (green << 8) | blue;\r\n }\r\n \r\n this.color = this.renderColor;\r\n }\r\n\r\n desaturateColor(f = 0.15, val = 0.8) {\r\n const color = this.entity.color;\r\n if (this.renderer.themeMode === \"dark\") {\r\n let red = Math.max(0, Math.min(255, ((color >> 16) & 0xff))) * val;\r\n let green = Math.max(0, Math.min(255, ((color >> 8) & 0xff))) * val;\r\n let blue = Math.max(0, Math.min(255, (color & 0xff))) * val;\r\n const L = 0.3 * red + 0.6 * green + 0.1* blue;\r\n this.renderColor = ((red + f * (L - red)) << 16) | ((green + f * (L - green)) << 8) | blue + f * (L - blue);\r\n } else {\r\n this.renderColor = color;\r\n }\r\n }\r\n\r\n\r\n getRatingString() {\r\n return RATING_STRINGS[Math.min(5, Math.max(0, this.entity.rating))];\r\n }\r\n\r\n getStateString() {\r\n const filter = this.entity.state & this.renderer.root.entity.state;\r\n const hasFlag = this.entity.state & 0b1 === 1;\r\n const hasHeart = (this.entity.state & 0b10) >> 1 === 1;\r\n const hasResources = (filter & 0b100) >> 2 === 1;\r\n const hasNotes = (filter & 0b1000) >> 3 === 1;\r\n return `${hasHeart ? \"â¤\" : hasFlag ? \"â–¨\" : \"\"}${hasNotes ? \"â–¤\" : \"\"}${hasResources ? \"â–°\" : \"\"}`;\r\n }\r\n\r\n setZIndex() {\r\n this.container.zIndex = 10000 - this.depth * 100 + this.indexInParent;\r\n }\r\n\r\n render() { // TODO Cleanup!!!\r\n this.container.clear();\r\n\r\n if (!this.isVisible) return;\r\n\r\n const selected = this.isSelected();\r\n const style = this.getTextStyle();\r\n const activeLink = this.hasActiveLink();\r\n\r\n this.container.zIndex = 10000 - this.depth * 100 + this.indexInParent;\r\n\r\n const decorations = `${this.getRatingString()}${this.getStateString()}`;\r\n const oldTextWidth = this.renderText.textWidth;\r\n const color = selected ? this.renderColor : activeLink ? this.renderer.linkRenderer.linkColor : this.renderColor;\r\n \r\n let isCollapsed = this.isCollapsed;\r\n\r\n if (!isCollapsed && this.entity.isCollapsed) {\r\n isCollapsed = this.renderer.nodeEventHandler.isTempVisible(this);\r\n }\r\n\r\n this.renderText.setTextAndStyle(\r\n `${isCollapsed && this.side === -1 ? \"â–±\" : \"\"}${this.entity.name}${decorations}${isCollapsed && this.side === 1 ? \"â–±\" : \"\"}`,\r\n style,\r\n this.renderer.themeMode === \"dark\" ? (activeLink ? 0x555555 : 0xDEDEDE) : (selected ? 0xF5F7F6 : 0x555555),\r\n color\r\n );\r\n\r\n\r\n this.renderText.visible = true;\r\n const isCategory = this.depth === 1;\r\n\r\n const fontSize = style.fontSize;\r\n const paddingH = fontSize * 0.15;\r\n const paddingW = fontSize * 0.4;\r\n\r\n const width = this.renderText.textWidth + paddingW * 2 - isCategory * 8;\r\n const height = fontSize + paddingH * 2;\r\n const height05 = height / 2;\r\n const width05 = width / 2;\r\n\r\n const offsetY = -height05 - 2;\r\n\r\n this.textOffsetX = -width05 + paddingW - (this.side === -1) * fontSize * 0.05 + isCategory * (this.side * 3 - 4);\r\n this.textOffsetY = offsetY;\r\n\r\n if (selected || activeLink) {\r\n this.container.beginFill(color, 1);\r\n const collapseOffset = isCollapsed * (isCategory ? 176 : 110);\r\n\r\n this.container.drawRoundedRect(\r\n -width05 + (this.side === -1) * (collapseOffset * 1.01),\r\n offsetY,\r\n width - collapseOffset,\r\n height\r\n );\r\n }\r\n\r\n this.width = width;\r\n this.height = height;\r\n this.container.hitArea.x = -width05 - this.side * isCollapsed * fontSize * (0.25 - (this.side === 1) * 0.15);\r\n this.container.hitArea.y = offsetY;\r\n this.container.hitArea.width = width - isCollapsed * fontSize * 0.325;\r\n this.container.hitArea.height = height;\r\n\r\n if (oldTextWidth !== 0) {\r\n const diff = this.renderText.textWidth - oldTextWidth;\r\n\r\n if (diff !== 0 && !!this.synapse) {\r\n this.container.x += diff * this.side * 0.5;\r\n\r\n if (this.side === -1) {\r\n this.renderText.x -= diff;\r\n }\r\n this.synapse.update();\r\n this.children.forEach(t => t.synapse.update());\r\n }\r\n }\r\n\r\n this.renderer.setTickDirty();\r\n }\r\n\r\n getWidth() {\r\n return this.width;\r\n }\r\n\r\n getHeight() {\r\n const fontSize = this.renderText.style.fontSize;\r\n return fontSize + fontSize * 0.3;\r\n }\r\n\r\n getPositionX() {\r\n const side = this.parent.layout.getSide();\r\n return this.parent.container.x + (this.optimalPositionX + (this.parent.width + this.width) / 2) * side;\r\n }\r\n\r\n // TODO override this one so we dont need branch here.\r\n getPositionY() {\r\n return this.parent === null ? this.optimalPositionY : this.parent.container.y + this.optimalPositionY;\r\n }\r\n\r\n getTextStyle() {\r\n return this.depth === 1 ? FONT_H1 : FONT_H3;\r\n }\r\n\r\n setPosition(x, y) {\r\n const container = this.container;\r\n const text = this.renderText;\r\n container.x = x;\r\n container.y = y;\r\n text.x = x + this.textOffsetX;\r\n text.y = y + this.textOffsetY;\r\n }\r\n\r\n \r\n setAlpha(alpha) {\r\n this.container.alpha = alpha;\r\n this.renderText.alpha = alpha;\r\n }\r\n\r\n setVisibility(visibility) {\r\n if (this.dragging && !visibility && this.renderer.nodeEventHandler?.draggingNode === this) return;\r\n \r\n this.isVisible = visibility;\r\n this.container.visible = visibility;\r\n this.renderText.visible = visibility;\r\n\r\n if (!this.isCollapsed) {\r\n this.children.forEach(c => c.setVisibility(visibility));\r\n }\r\n\r\n this.render();\r\n }\r\n\r\n destroy() {\r\n super.destroy();\r\n this.renderText.destroy();\r\n }\r\n}","import { Texture } from \"../pixi\";\r\n\r\nexport default class RasterStyles {\r\n\r\n constructor() {\r\n this.rootWidth = 350;\r\n this.nodeWidth = 400;\r\n this.layerSpacingWidth = 150;\r\n this.layerSpacingHeight = 85;\r\n this.padding = 8;\r\n this.fontFamily = `\"IBM Plex Sans\", sans-serif`;\r\n\r\n this.snapOptions = {\r\n removeOnComplete: true,\r\n removeOnInterrupt: true,\r\n time: 500\r\n };\r\n\r\n this.avatarUrl = null;\r\n this.avatar = null;\r\n\r\n this.synapseColors = [\r\n 0x0093D1, 0x77C0DF, 0x48AFDA\r\n ];\r\n }\r\n\r\n updateAvatarUrl(url) {\r\n const hasUpdate = url !== this.avatarUrl && !!url;\r\n if (hasUpdate) {\r\n this.avatar = Texture.from(url);\r\n this.avatarUrl = url;\r\n }\r\n return hasUpdate;\r\n }\r\n\r\n getSynapseColor(i, side) {\r\n const len = this.synapseColors.length;\r\n\r\n if (side === 1) {\r\n return this.synapseColors[len - (i % len) - 1];\r\n }\r\n\r\n return this.synapseColors[i % len];\r\n }\r\n}","import BaseLayout from \"./BaseLayout\";\r\n\r\nexport default class ClusterLayout extends BaseLayout {\r\n getSide() {\r\n return Math.sign(this.node.container.x - this.node.renderer.root.container.x);\r\n }\r\n\r\n getChildPosition(i) {\r\n const { layerSpacingWidth, layerSpacingHeight } = this.node.renderer.styles;\r\n\r\n return { \r\n x: layerSpacingWidth * 2, \r\n y: (this.node.children[i].layout.x - this.x) * layerSpacingHeight\r\n };\r\n }\r\n}\r\n","\r\n\r\nexport default class RemoteDragHandler {\r\n\r\n\r\n constructor(sas, eventHandler) {\r\n this.sas = sas;\r\n this.eventHandler = eventHandler;\r\n this.node = null;\r\n this.nodeId = null;\r\n this.detached = false;\r\n this.timer = null;\r\n this.endTimerCall = () => this.forceDragEnd();\r\n this.targetX = 0;\r\n this.targetY = 0;\r\n this.lastMove = 0;\r\n }\r\n\r\n onTick(delta) {\r\n if (this.node !== null) {\r\n const ticks = 250.0 / (delta * 1000.0);\r\n const { x, y } = this.node.container;\r\n\r\n const dX = this.targetX - x;\r\n const dY = this.targetY - y;\r\n\r\n this.node.setPosition(\r\n x + dX / ticks,\r\n y + dY / ticks\r\n );\r\n\r\n if (this.node.synapse) {\r\n this.node.synapse.update();\r\n }\r\n }\r\n }\r\n\r\n onDrag(sas, ev) {\r\n const { nodeId, targetId, x, y, detached } = ev;\r\n // TODO update along bezier curve, etc. also remember to update redux\r\n if (nodeId !== this.nodeId) {\r\n\r\n if (this.node !== null) {\r\n // end dragging\r\n this.node.dragging = false;\r\n this.updateNode();\r\n }\r\n\r\n this.nodeId = nodeId;\r\n this.node = this.eventHandler.tree.getNodeById(nodeId);\r\n this.eventHandler.notify();\r\n this.node.dragging = true;\r\n this.node.setPosition(x, y);\r\n }\r\n\r\n if (this.node !== null) {\r\n this.node.dragging = true;\r\n\r\n this.targetX = x;\r\n this.targetY = y;\r\n\r\n if (detached && !!this.node.synapse) {\r\n const target = this.eventHandler.tree.getNodeById(targetId);\r\n this.node.synapse.setDetached(true, target);\r\n }\r\n\r\n this.updateNode();\r\n }\r\n\r\n this.pingEndTimer();\r\n }\r\n\r\n onDragEnd(sas, ev) {\r\n try {\r\n clearTimeout(this.timer);\r\n if (this.node !== null) {\r\n const { targetId, index, side, detached, x, y, disconnected } = ev;\r\n\r\n if (disconnected) {\r\n this.node.synapse.setDetached(false);\r\n } else if (detached) {\r\n this.node.setPosition(x, y);\r\n\r\n // Move node to new parent\r\n this.node.move(targetId, index, side, true, false);\r\n\r\n if (this.node.synapse.detached) {\r\n this.node.synapse.setDetached(false);\r\n }\r\n this.lastMove = Date.now();\r\n //parentId = null, indexInParent = null, side = null, rearrange = false, sync = true\r\n } else {\r\n this.node.setPosition(x, y);\r\n\r\n // Sort the nodes\r\n const parent = this.node.parent;\r\n if (!!parent) {\r\n const side = Math.sign(this.node.container.x - parent.container.x);\r\n this.node.move(null, null, side, true, false);\r\n this.lastMove = Date.now();\r\n }\r\n }\r\n\r\n this.node.dragging = false;\r\n this.node = null;\r\n this.nodeId = null;\r\n this.updateNode();\r\n this.eventHandler.notify();\r\n }\r\n } catch { }\r\n }\r\n\r\n onDisconnected() {\r\n const diff = Date.now() - this.lastMove;\r\n this.lastMove = 0;\r\n this.forceDragEnd();\r\n return diff > 500;\r\n }\r\n\r\n forceDragEnd() {\r\n if (this.node !== null) {\r\n console.log(\"force drag end\");\r\n this.node.dragging = false;\r\n this.node = null;\r\n this.nodeId = null;\r\n this.updateNode();\r\n this.eventHandler.notify();\r\n }\r\n }\r\n\r\n pingEndTimer() {\r\n clearTimeout(this.timer);\r\n this.timer = setTimeout(this.endTimerCall, 60000);\r\n }\r\n\r\n updateNode() {\r\n if (this.node !== null) {\r\n this.node.setDirty();\r\n this.eventHandler.tree.setTickDirty();\r\n }\r\n }\r\n\r\n get active() {\r\n return this.node !== null;\r\n }\r\n\r\n destroy() {\r\n this.lastMove = 0;\r\n this.node = null;\r\n clearTimeout(this.timer); // Next Session!!: if this is called before 500ms after a change has occured, and is not due to a shutdown, we trigger resync.!!!!\r\n }\r\n}\r\n","import { Point } from \"../pixi\";\r\nimport { Debounce } from \"@emberly/dataplane\";\r\nimport RemoteDragHandler from \"./RemoteDragHandler\";\r\n\r\nexport default class NodeEventHandler {\r\n\r\n constructor(tree, viewport, context) {\r\n this.viewport = viewport;\r\n this.context = context;\r\n this.hidden = false;\r\n this.tree = tree;\r\n this.draggingNode = null;\r\n this.closestNode = null;\r\n this.closestNodes = new Set();\r\n this.eventData = null;\r\n this.dragging = false;\r\n this.dragMoved = false;\r\n this.eventOffset = new Point(0, 0);\r\n this.eventPosition = new Point(0, 0);\r\n this.deltaClick = Date.now();\r\n this.clickedNode = null;\r\n this.dragEnabled = false;\r\n this.dragOverActive = false;\r\n this.dragOverX = 0;\r\n this.dragOverY = 0;\r\n this.renderDragOverX = 0;\r\n this.renderDragOverY = 0;\r\n this.dragOverNode = null;\r\n this.activeNodeId = null;\r\n this.lastMovedNode = null;\r\n this.collapsedParent = null;\r\n this.searchDebouncer = new Debounce(8);\r\n this.detachDebouncer = new Debounce(8);\r\n this.tempUncollapsedNodes = [];\r\n this.contextLost = false;\r\n this.activeDrags = new Map();\r\n this.dirty = false;\r\n\r\n this.transmitTimer = null;\r\n this.lastTransmitEvent = null;\r\n this.lastTransmitTime = 0;\r\n this.onTransmitDragEvent = () => this.transmitDragEvent(this.lastTransmitEvent);\r\n\r\n this.onPointerUp = event => this.onNodePointerUp(null, event);\r\n this.onPointerMove = event => this.onNodePointerMove(null, event);\r\n this.onPointerOut = ev => this.tree.emit(\"treepointerout\", this.tree, ev);\r\n this.onPointerOver = event => this.tree.resetRenderTimer();\r\n\r\n this.viewport\r\n .on(\"pointerover\", this.onPointerOver)\r\n .on(\"pointermove\", this.onPointerMove)\r\n .on(\"pointerup\", this.onPointerUp)\r\n .on(\"pointerout\", this.onPointerOut);\r\n\r\n this.tree\r\n .on(\"nodeclick\", (node, event) => this.onNodeClick(node, event))\r\n .on(\"nodepointerdown\", (node, event) => this.onNodePointerDown(node, event))\r\n .on(\"treepointerout\", (tree, event) => this.onTreePointerOut(tree, event));\r\n\r\n\r\n this.onHandleRemoteDrag = (sas, ev) => this.onRemoteDrag(sas, ev);\r\n this.onHandleRemoteDragEnd = (sas, ev) => this.onRemoteDragEnd(sas, ev);\r\n\r\n this.context\r\n .on(\"OnDrag\", this.onHandleRemoteDrag)\r\n .on(\"OnDragEnd\", this.onHandleRemoteDragEnd);\r\n\r\n\r\n this.onRemoteActiveInput = (sas, resourceId, inputId) => {\r\n // When disconnect, end the drag if its active.\r\n if (resourceId === null && inputId === null) {\r\n this.onRemoteDragEnd(sas, { disconnected: true });\r\n }\r\n };\r\n\r\n this.onRemoteBlur = (contextId, inputId) => {\r\n if (this.tree.contextId === contextId && !!this.draggingNode && this.draggingNode.id === inputId) {\r\n this.cancelDrag();\r\n }\r\n };\r\n\r\n this.onHandleRemoteDragDisconnected = (sas) => this.onRemoteDragDisconnected(sas);\r\n\r\n this.context.getConnections()\r\n .on(\"onActiveInput\", this.onRemoteActiveInput)\r\n .on(\"onBlur\", this.onRemoteBlur)\r\n .on(\"onUserDisconnected\", this.onHandleRemoteDragDisconnected);\r\n\r\n this.visibilityCallback = () => this.run();\r\n document.addEventListener(\"visibilitychange\", this.visibilityCallback, false);\r\n }\r\n\r\n onRemoteDrag(sas, ev) {\r\n if (!this.activeDrags.has(sas.pcid)) {\r\n this.activeDrags.set(sas.pcid, new RemoteDragHandler(sas, this));\r\n }\r\n\r\n this.activeDrags.get(sas.pcid).onDrag(sas, ev);\r\n }\r\n\r\n onRemoteDragEnd(sas, ev) {\r\n if (!this.activeDrags.has(sas.pcid)) {\r\n this.activeDrags.set(sas.pcid, new RemoteDragHandler(sas, this));\r\n }\r\n\r\n this.activeDrags.get(sas.pcid).onDragEnd(sas, ev);\r\n }\r\n\r\n onRemoteDragDisconnected(sas) {\r\n if (this.activeDrags.has(sas.pcid)) {\r\n if (!this.activeDrags.get(sas.pcid).onDisconnected()) {\r\n this.tree.manager.syncToRemote();\r\n }\r\n }\r\n }\r\n\r\n isAnyDragActive() {\r\n if (this.dragging) {\r\n return true;\r\n } else if (this.activeDrags.size !== 0) {\r\n for (let drag of this.activeDrags.values()) {\r\n if (drag.node !== null) {\r\n return true;\r\n }\r\n }\r\n }\r\n\r\n return false;\r\n }\r\n\r\n run() {\r\n const hidden = document.visibilityState === \"hidden\";\r\n if (hidden !== this.hidden) {\r\n this.hidden = hidden;\r\n if (!this.hidden) {\r\n if (this.contextLost) {\r\n window.location.reload();\r\n }\r\n }\r\n }\r\n }\r\n\r\n onNodeClick(node, event) {\r\n const time = Date.now();\r\n const delta = time - this.deltaClick;\r\n\r\n if (delta > 25 && (this.draggingNode === null || this.draggingNode === node) && !this.dragMoved) {\r\n this.deltaClick = time;\r\n\r\n if (delta > 300) {\r\n node.onClick(event);\r\n } else if (node === this.clickedNode) {\r\n node.onDoubleClick(event);\r\n }\r\n\r\n this.clickedNode = node;\r\n this.deltaClick = Date.now();\r\n }\r\n }\r\n\r\n onNodePointerDown(node, event) {\r\n\r\n const touches = event?.data?.originalEvent?.touches?.length || 1;\r\n\r\n if (this.draggingNode === null && !node.dragging && touches <= 1) { // TODO enable clicking even when there is a dragging node.\r\n this.eventsTransmitted = 0;\r\n\r\n if (this.dragEnabled) {\r\n this.tree.pause();\r\n }\r\n\r\n this.draggingNode = node;\r\n this.draggingNode.dragging = true;\r\n this.eventData = event.data;\r\n\r\n if (!!this.draggingNode.renderText) {\r\n this.draggingNode.renderText.alpha = 0.5;\r\n }\r\n\r\n this.dragging = true;\r\n this.dragMoved = false;\r\n const container = node.container;\r\n\r\n const vt = this.tree.viewport.transform;\r\n\r\n this.eventOffset.set(\r\n -container.x + (event.data.global.x - vt.position.x) / vt.scale.x,\r\n -container.y + (event.data.global.y - vt.position.y) / vt.scale.y\r\n );\r\n\r\n this.eventPosition.set(\r\n event.data.global.x,\r\n event.data.global.y\r\n )\r\n\r\n this.draggingNode.setDirty();\r\n }\r\n }\r\n\r\n onNodePointerUp(node, event) {\r\n this.searchDebouncer.clear();\r\n this.detachDebouncer.clear();\r\n\r\n if (!this.dragging) {\r\n return;\r\n }\r\n\r\n // Clear transmit to context\r\n clearTimeout(this.transmitTimer);\r\n this.lastTransmitEvent = null;\r\n\r\n\r\n const n = this.draggingNode;\r\n const x = n.container.x;\r\n const synapse = n.synapse;\r\n\r\n const transmit = this.context.getConnections().hasConnections();\r\n\r\n if (this.dragMoved && n.depth !== 0 && this.dragEnabled === true && !!synapse && this.context.canEdit()) {\r\n // TODO calculate index based on position.\r\n const detached = synapse.detached;\r\n const parent = synapse.attachTarget.isRoot ? this.tree.root : synapse.attachTarget;\r\n const side = Math.sign(x - parent.container.x);\r\n\r\n n.move(\r\n parent.id,\r\n null,\r\n side,\r\n true,\r\n true\r\n );\r\n\r\n // if we didnt successfully move, set the synapse to no longer be detached.\r\n if (synapse.detached) {\r\n synapse.setDetached(false);\r\n }\r\n\r\n if (transmit) {\r\n this.context.send(\"OnDragEnd\", { x, y: n.container.y, nodeId: n.id, targetId: synapse ? synapse.attachTarget.id : null, index: n.indexInParent, side, detached });\r\n }\r\n } else if (transmit && this.eventsTransmitted > 0) {\r\n this.context.send(\"OnDragEnd\", { x, y: n.container.y, nodeId: n.id, targetId: synapse ? synapse.attachTarget.id : null, index: n.indexInParent, side: 0, detached: false });\r\n }\r\n\r\n this.context.getConnections().blurActiveInput(this.tree.contextId);\r\n this.closestNodes.forEach(c => c.onNodeHoverExit(n));\r\n this.closestNodes.clear();\r\n\r\n if (!!n.renderText) {\r\n n.renderText.alpha = 1;\r\n }\r\n\r\n n.dragging = false;\r\n\r\n if (n.parent?.isCollapsed && n.isVisible) {\r\n n.setVisibility(false);\r\n if (this.activeNodeId === n.id) {\r\n this.setActiveNodeId(n.id, true);\r\n }\r\n }\r\n\r\n\r\n if (this.dragEnabled) {\r\n this.tree.resume();\r\n }\r\n\r\n this.onNodeClick(n, event);\r\n\r\n this.eventData = null;\r\n this.dragMoved = false;\r\n this.dragging = false;\r\n this.draggingNode = null;\r\n }\r\n\r\n cancelDrag() {\r\n clearTimeout(this.transmitTimer);\r\n this.dragMoved = false;\r\n this.searchDebouncer.clear();\r\n this.detachDebouncer.clear();\r\n this.lastTransmitEvent = null;\r\n\r\n if (!!this.draggingNode) {\r\n this.closestNodes.forEach(c => c.onNodeHoverExit(this.draggingNode));\r\n this.closestNodes.clear();\r\n if (!!this.draggingNode.renderText) {\r\n this.draggingNode.renderText.alpha = 1;\r\n }\r\n this.draggingNode.dragging = false;\r\n }\r\n\r\n if (this.dragEnabled) {\r\n this.tree.resume();\r\n }\r\n\r\n this.eventData = null;\r\n this.dragMoved = false;\r\n this.dragging = false;\r\n this.draggingNode = null;\r\n }\r\n\r\n onNodePointerMove(node, event) {\r\n if (this.dragging) {\r\n\r\n if (event?.data?.originalEvent?.touches?.length > 1) {\r\n this.onNodePointerUp(node, event);\r\n return;\r\n }\r\n\r\n const n = this.draggingNode;\r\n const container = n.container;\r\n const synapse = n.synapse;\r\n const newPosition = this.eventData.getLocalPosition(container.parent);\r\n const pX = newPosition.x - this.eventOffset.x;\r\n const pY = newPosition.y - this.eventOffset.y;\r\n\r\n if (!this.dragMoved) {\r\n let deltaX = (event.data.global.x - this.eventPosition.x);\r\n let deltaY = (event.data.global.y - this.eventPosition.y);\r\n let dist = Math.sqrt(deltaX * deltaX + deltaY * deltaY);\r\n this.dragMoved = this.dragEnabled ? dist > 4 : dist > 10;\r\n\r\n if (n.isBranchDragging() || (this.dragMoved && !this.context.getConnections().setActiveInput(this.tree.contextId, n.id))) {\r\n this.cancelDrag();\r\n }\r\n }\r\n\r\n if (this.dragEnabled === false) {\r\n return;\r\n }\r\n\r\n n.setPosition(pX, pY);\r\n\r\n if (n === this.tree.root) {\r\n this.transmitDragEvent({ x: pX, y: pY, nodeId: n.id, targetId: null, detached: false })\r\n return;\r\n }\r\n\r\n // TODO\r\n const w05 = n.width / 2;\r\n const h05 = n.height / 2;\r\n\r\n const closest = this.searchDebouncer.debounce(\r\n () => new Set(\r\n this.tree.findInAABB(\r\n container.x - w05,\r\n container.y - h05,\r\n container.x + w05,\r\n container.y + h05,\r\n n\r\n )\r\n )\r\n );\r\n\r\n this.closestNodes.forEach(c => {\r\n if (!closest.has(c)) {\r\n c.onNodeHoverExit(n);\r\n }\r\n });\r\n\r\n closest.forEach(c => {\r\n if (!this.closestNodes.has(c)) {\r\n c.onNodeHoverEnter(n);\r\n }\r\n c.onNodeHoverMove(n);\r\n });\r\n\r\n this.closestNodes = closest;\r\n\r\n // handle detach\r\n if (!!synapse && this.context.canEdit()) {\r\n let deltaWidth = (n.parent.width + n.width) * 0.5;\r\n let defaultDistance = (n.getPositionX() - n.parent.getPositionX()) * n.side - deltaWidth;\r\n let offsetParentX = (container.x - n.parent.container.x) * n.side - deltaWidth;\r\n\r\n let leftChild = n.parent.getLeftMostChild();\r\n let rightChild = n.parent.getRightMostChild();\r\n\r\n let minY = !!leftChild ? leftChild.getPositionY() - n.height * 3 : 0;\r\n let maxY = !!rightChild ? rightChild.getPositionY() + n.height * 3 : 9999999;\r\n let y = container.y;\r\n\r\n if (\r\n ((y < minY || y > maxY || offsetParentX < 0) && n.depth > 1) ||\r\n offsetParentX > defaultDistance * 1.5 ||\r\n (n.depth === 1 && Math.abs(offsetParentX) > defaultDistance * 2.5)\r\n ) {\r\n synapse.setDetached(true);\r\n }\r\n\r\n // find closest and set to renderTarget\r\n if (synapse.detached) {\r\n let attachTarget = this.detachDebouncer.debounce(() => this.tree.findClosestByOpposingJoints(n, 1500));\r\n\r\n if (attachTarget && !attachTarget.isBranchDragging() && !attachTarget.synapse?.detached) {\r\n attachTarget.setDirty();\r\n synapse.setDetached(true, attachTarget);\r\n }\r\n }\r\n }\r\n\r\n n.setDirty();\r\n \r\n const p = n.getPreviousSibling();\r\n \r\n if (!!p) {\r\n p.dirty = true;\r\n }\r\n\r\n this.tree.setTickDirty();\r\n this.transmitDragEvent({ x: pX, y: pY, nodeId: n.id, targetId: synapse ? synapse.attachTarget.id : null, detached: synapse ? synapse.detached : false })\r\n }\r\n\r\n }\r\n\r\n onResourceDrop(ev) {\r\n\r\n if (!this.context.canEdit()) {\r\n return;\r\n }\r\n\r\n const viewport = this.tree.viewport;\r\n const data = ev.dataTransfer.getData(\"text\");\r\n const coords = viewport.toWorld(ev.clientX, ev.clientY);\r\n let closestNode = this.tree.findNode(coords.x, coords.y);\r\n\r\n if (closestNode !== null && closestNode !== this.tree.root) {\r\n\r\n if (data.startsWith(\"http\")) {\r\n // add url as new resource\r\n this.tree.emit(\"onResourceCreateRequested\", closestNode.id, data);\r\n } else {\r\n // TODO handle file uploads\r\n this.tree.emit(\"onFileUploadRequested\", closestNode.id, ev.dataTransfer);\r\n }\r\n }\r\n }\r\n\r\n transmitDragEvent(ev) {\r\n const time = Date.now();\r\n const timeSinceTransmit = time - this.lastTransmitTime;\r\n this.lastTransmitEvent = ev;\r\n this.eventsTransmitted++;\r\n clearTimeout(this.transmitTimer);\r\n\r\n if (timeSinceTransmit > 250 && this.lastTransmitEvent !== null) {\r\n this.lastTransmitTime = time;\r\n if (this.context.getConnections().hasConnections()) {\r\n this.context.send(\"OnDrag\", this.lastTransmitEvent);\r\n }\r\n } else {\r\n this.transmitTimer = setTimeout(this.onTransmitDragEvent, 250);\r\n }\r\n }\r\n\r\n onTreePointerOut(tree, event) {\r\n if (this.dragging) {\r\n this.onNodePointerUp(null, event);\r\n }\r\n }\r\n\r\n setDragEnabled(enabled) {\r\n this.dragEnabled = enabled;\r\n }\r\n\r\n setActiveNodeId(id, force = false) {\r\n if (id !== this.activeNodeId || force) {\r\n\r\n this.tree.linkRenderer.clear();\r\n const newNode = this.tree.getNodeById(id);\r\n const oldNode = this.tree.getNodeById(this.activeNodeId);\r\n this.activeNodeId = id;\r\n let prevCollapsedParent = null;\r\n\r\n if (!!oldNode) {\r\n oldNode.render();\r\n\r\n if (this.collapsedParent !== null && this.collapsedParent.parent !== null && this.tempUncollapsedNodes.length !== 0) {\r\n\r\n this.tempUncollapsedNodes.forEach(parent => {\r\n parent.setIsCollapsed((parent.entity?.isCollapsed || false) && parent.children.length !== 0, true);\r\n });\r\n\r\n this.tempUncollapsedNodes = [];\r\n this.collapsedParent.setLayoutDirty();\r\n }\r\n\r\n prevCollapsedParent = this.collapsedParent;\r\n this.collapsedParent = null;\r\n }\r\n\r\n if (!!newNode) {\r\n if (!newNode.isVisible || (!!prevCollapsedParent && newNode.isInPath(prevCollapsedParent))) {\r\n const hNode = newNode.getFirstInvisibleParent();\r\n\r\n newNode.callParents((parent) => {\r\n if (parent.isCollapsed || parent.entity.isCollapsed) {\r\n parent.isCollapsed = false;\r\n this.tempUncollapsedNodes.push(parent);\r\n }\r\n });\r\n\r\n this.collapsedParent = hNode;\r\n hNode.setVisibility(true);\r\n this.tree.setDirty(0);\r\n }\r\n\r\n newNode.render();\r\n }\r\n }\r\n\r\n this.tree.setTickDirty();\r\n }\r\n\r\n handleRemoteUncollapse(node) {\r\n if (this.isTempVisible(node)) {\r\n this.setActiveNodeId(this.activeNodeId, true);\r\n }\r\n }\r\n\r\n isTempVisible(node) {\r\n return this.collapsedParent !== null && !!this.tempUncollapsedNodes.find(t => t.id === node.id);\r\n }\r\n\r\n onUpdatedNode() {\r\n if (!!this.activeNodeId) {\r\n const node = this.tree.getNodeById(this.activeNodeId);\r\n if (!!node && !node.isVisible) {\r\n this.setActiveNodeId(this.activeNodeId, true);\r\n }\r\n }\r\n }\r\n\r\n setDragOverActive(active) {\r\n if (this.dragOverActive !== active) {\r\n\r\n this.dragOverActive = active;\r\n this.dragOverX = 0;\r\n this.dragOverY = 0;\r\n let node = this.dragOverNode;\r\n this.dragOverNode = null;\r\n\r\n if (node !== null) {\r\n node.render();\r\n }\r\n }\r\n }\r\n\r\n onDragOver(x, y) {\r\n this.dragOverX = x;\r\n this.dragOverY = y;\r\n this.tree.setTickDirty();\r\n }\r\n\r\n render() {\r\n if (this.dragOverActive && (this.renderDragOverX !== this.dragOverX || this.renderDragOverY !== this.dragOverY)) {\r\n this.renderDragOverX = this.dragOverX;\r\n this.renderDragOverY = this.dragOverY;\r\n\r\n const viewport = this.tree.viewport;\r\n const coords = viewport.toWorld(this.dragOverX, this.dragOverY);\r\n let closestNode = this.tree.findNode(coords.x, coords.y);\r\n\r\n if (closestNode !== null && closestNode !== this.tree.root && this.dragOverNode !== closestNode) {\r\n const node = this.dragOverNode;\r\n this.dragOverNode = closestNode;\r\n\r\n if (node !== null) {\r\n node.render();\r\n }\r\n\r\n this.dragOverNode.render();\r\n } else if (closestNode === null && this.dragOverNode !== null) {\r\n const node = this.dragOverNode;\r\n this.dragOverNode = null;\r\n if (node !== null) {\r\n node.render();\r\n }\r\n }\r\n }\r\n }\r\n\r\n onTick(delta) {\r\n if (this.dirty) {\r\n this.activeDrags.forEach(t => t.onTick(delta));\r\n }\r\n }\r\n\r\n setContextLost() {\r\n if (this.hidden) {\r\n this.contextLost = true;\r\n } else {\r\n window.location.reload();\r\n }\r\n }\r\n\r\n notify() {\r\n this.dirty = false;\r\n this.activeDrags.forEach(t => {\r\n this.dirty = this.dirty || t.active\r\n });\r\n }\r\n\r\n destroy() {\r\n document.removeEventListener(\"visibilitychange\", this.visibilityCallback, false);\r\n\r\n clearTimeout(this.transmitTimer);\r\n\r\n if (this.dragging) {\r\n try {\r\n this.cancelDrag();\r\n this.context.getConnections().blurActiveInput(this.tree.contextId);\r\n } catch { }\r\n }\r\n\r\n this.activeDrags.forEach(t => t.destroy());\r\n this.activeDrags.clear();\r\n\r\n this.context\r\n .off(\"OnDrag\", this.onHandleRemoteDrag)\r\n .off(\"OnDragEnd\", this.onHandleRemoteDragEnd);\r\n\r\n this.context.getConnections()\r\n .off(\"onUserDisconnected\", this.onHandleRemoteDragDisconnected)\r\n .off(\"onActiveInput\", this.onRemoteActiveInput)\r\n .off(\"onBlur\", this.onRemoteBlur);\r\n\r\n this.viewport\r\n .off(\"pointermove\", this.onPointerMove)\r\n .off(\"pointerup\", this.onPointerUp)\r\n .off(\"pointerout\", this.onPointerOut);\r\n }\r\n}","import { Graphics } from \"../pixi\";\r\n\r\nexport default class LinkRenderer {\r\n\r\n constructor(tree) {\r\n this.tree = tree;\r\n this.container = new Graphics();\r\n this.nodeId = null;\r\n this.node = null;\r\n this.noteId = null;\r\n this.waitingNodeIds = null;\r\n this.targetNodeIds = [];\r\n this.targetNodes = [];\r\n this.targetNodeIdSet = new Set();\r\n this.linkColor = 0xDADCE0;\r\n this.synapseColor = 0xD3D3DA;\r\n this.onParentOrReferencesUpdated = null;\r\n this.onResourcesUpdated = null;\r\n }\r\n\r\n clear() {\r\n this.node = null;\r\n this.nodeId = null;\r\n this.targetNodeIdSet?.clear();\r\n this.targetNodeIds = [];\r\n this.targetNodes.forEach(n => n.render());\r\n this.targetNodes = [];\r\n this.container?.clear();\r\n }\r\n\r\n destroy() {\r\n this.container.clear();\r\n this.container.destroy();\r\n\r\n this.node = null;\r\n this.nodeId = null;\r\n this.targetNodes = null;\r\n this.targetNodeIds = null;\r\n this.targetNodeIdSet = null;\r\n this.container = null;\r\n }\r\n\r\n onLoaded() {\r\n if (this.waitingNodeIds !== null) {\r\n this.setLinkedNodes(this.waitingNodeIds);\r\n this.waitingNodeIds = null;\r\n }\r\n }\r\n\r\n onNodeCreated(nodeId) {\r\n if (this.targetNodeIdSet.has(nodeId)) {\r\n this.targetNodes = this.targetNodeIds.map(id => this.tree.getNodeById(id)).filter(n => n !== null);\r\n this.targetNodes.forEach(n => n.render());\r\n this.render();\r\n }\r\n }\r\n\r\n setLinkedNodes(nodeIds, selectedNodeId = null) {\r\n\r\n if (!this.tree.isLoaded) {\r\n this.waitingNodeIds = nodeIds;\r\n return false;\r\n } else if (!this.tree.running) {\r\n return false;\r\n } \r\n\r\n const newTargetNodeIdSet = new Set(nodeIds);\r\n const activeNodeId = this.tree.nodeEventHandler.activeNodeId;\r\n\r\n if (!!selectedNodeId && activeNodeId !== selectedNodeId) {\r\n return false;\r\n }\r\n\r\n if (!this.compareSets(newTargetNodeIdSet, this.targetNodeIdSet) || this.nodeId !== activeNodeId) {\r\n this.targetNodeIdSet.clear();\r\n this.targetNodes.forEach(n => n.render());\r\n \r\n this.targetNodeIdSet = newTargetNodeIdSet;\r\n \r\n this.nodeId = activeNodeId;\r\n \r\n if (!!this.nodeId) {\r\n this.targetNodeIds = [...this.targetNodeIdSet].filter(n => n !== this.nodeId);\r\n this.node = this.tree.getNodeById(this.nodeId);\r\n this.targetNodes = this.targetNodeIds.map(id => this.tree.getNodeById(id)).filter(n => n !== null);\r\n this.targetNodes.forEach(n => n.render());\r\n }\r\n \r\n this.render();\r\n this.tree.setTickDirty();\r\n }\r\n\r\n return true;\r\n }\r\n\r\n compareSets(a, b) {\r\n return a.size === b.size && [...a].every(value => b.has(value));\r\n }\r\n\r\n // TODO require massive cleanup of this crap.\r\n // TODO in render node, fetch generated color from linkrenderer.\r\n render() {\r\n const g = this.container;\r\n\r\n g.clear();\r\n\r\n if (this.hasActiveNode()) {\r\n const node = this.node;\r\n const height = node.height;\r\n const height05 = height / 2;\r\n const x = node.container.x - (node.isCollapsed ? node.getTextStyle().fontSize * 1.125 * node.side : 0);\r\n const y = node.container.y;\r\n g.x = x;\r\n g.y = y;\r\n\r\n g.lineStyle(15, this.synapseColor, 1, 0.5);\r\n\r\n for (let i = 0; i < this.targetNodeIds.length; i++) {\r\n\r\n let target = this.targetNodes[i];\r\n\r\n if (!target || target.isRoot) continue;\r\n\r\n if (!target.isVisible) {\r\n\r\n target = target.getFirstInvisibleParent().parent;\r\n const style = target.getTextStyle();\r\n\r\n const ty = target.container.y;\r\n const size = style.fontSize;\r\n const dy = ty - y;\r\n const absY = Math.abs(dy) * 0.5;\r\n const isCategory = target.depth === 1;\r\n\r\n const destX = target.container.x - x + target.side * (target.textOffsetX + target.renderText.textWidth - size * 1.07 + (isCategory && target.side === -1) * size * 0.1);\r\n const originY = Math.sign(dy - 0.001) * Math.min(height05, absY);\r\n\r\n g.moveTo(0, originY);\r\n this.bezierCurveTo(originY, destX + 1.5 * target.side, dy - 2, dy + 50, (height + target.height) / 2);\r\n g.drawCircle(destX + 1.5 * target.side, dy - 2, size * 0.09);\r\n\r\n } else {\r\n\r\n const offset = target.isCollapsed ? target.getTextStyle().fontSize * 1.125 * target.side : 0;\r\n const ty = target.container.y;\r\n const dy = ty - y;\r\n const absY = Math.abs(dy) * 0.5;\r\n const signY = Math.sign(dy + 0.001);\r\n const originY = signY * Math.min(height05, absY) * 0.8;\r\n const destX = target.container.x - x - offset;\r\n const destY = dy - signY * Math.min(target.height, absY) * 0.46;\r\n\r\n g.moveTo(0, originY);\r\n this.bezierCurveTo(originY, destX, destY, dy + 25 * signY, (height + target.height) / 2);\r\n }\r\n }\r\n }\r\n }\r\n\r\n bezierCurveTo(originY, destX, destY, dy, h) {\r\n const ddy = (destY - originY) / 2;\r\n const offset = Math.max(0, (h * Math.min(Math.abs(dy * 0.025), 1)) - Math.abs(dy)) * Math.sign(dy + 0.0001) * 2;\r\n const mid0Y = originY + ddy + offset;\r\n const mid1Y = destY - ddy + offset;\r\n\r\n this.container.bezierCurveTo(\r\n 0, mid0Y,\r\n destX, mid1Y,\r\n destX, destY\r\n );\r\n }\r\n\r\n hasActiveNode() {\r\n if (!this.tree || !this.tree.nodeEventHandler) return false;\r\n const activeId = this.tree.nodeEventHandler.activeNodeId;\r\n return !!this.node && !!this.nodeId && !!activeId && activeId === this.nodeId;\r\n }\r\n\r\n idArrayIsEqual(a, b) {\r\n return a.length === b.length && a.every((v, i) => v.sourceNodeId === b[i].sourceNodeId && v.targetNodeId === b[i].targetNodeId);\r\n }\r\n\r\n invalidateNode(node) {\r\n if (!!node && this.targetNodeIdSet.has(node.id)) {\r\n this.targetNodeIdSet.delete(node.id);\r\n this.targetNodeIds = this.targetNodeIds.filter(t => t !== node.id);\r\n this.targetNodes = this.targetNodes.filter(t => t !== node);\r\n this.render();\r\n } else if (this.node === node) {\r\n this.clear();\r\n this.render();\r\n }\r\n }\r\n}","import { utils } from \"../pixi\";\r\nconst BYTES_PER_PIXEL = 4;\r\n\r\nexport function renderToCanvas(renderer, target, aabb, maxWidth = 1200, resolutionOverride = null) {\r\n if (!renderer.renderTexture) return null;\r\n\r\n const w = Math.ceil(aabb.getWidth());\r\n const h = Math.ceil(aabb.getHeight());\r\n const maxTextureSize = renderer?.context?.gl?.getParameter(renderer?.context?.gl?.MAX_TEXTURE_SIZE) || 4096;\r\n const m = Math.max(w, h);\r\n const s = Math.min(maxTextureSize * 0.95, maxWidth * 2) / m;\r\n\r\n const resolutionBase = Math.min(Math.max(0.2, s), 2.5);\r\n let renderTexture = renderer.generateTexture(target, { resolution: typeof resolutionOverride === \"number\" ? resolutionOverride : resolutionBase });\r\n let resolution = renderTexture.baseTexture.resolution;\r\n let frame = renderTexture.frame;\r\n renderer.renderTexture.bind(renderTexture);\r\n\r\n const width = Math.floor((frame.width * resolution) + 1e-4);\r\n const height = Math.floor((frame.height * resolution) + 1e-4);\r\n let canvasBuffer = new utils.CanvasRenderTarget(width, height, 1);\r\n const webglPixels = new Uint8Array(BYTES_PER_PIXEL * width * height);\r\n\r\n // read pixels to the array\r\n const gl = renderer.gl;\r\n gl.readPixels(\r\n frame.x * resolution,\r\n frame.y * resolution,\r\n width,\r\n height,\r\n gl.RGBA,\r\n gl.UNSIGNED_BYTE,\r\n webglPixels\r\n );\r\n // add the pixels to the canvas\r\n const canvasData = canvasBuffer.context.getImageData(0, 0, width, height);\r\n const valid = arrayPostDivide(webglPixels, canvasData.data);\r\n \r\n canvasBuffer.context.putImageData(canvasData, 0, 0);\r\n renderTexture.destroy(true);\r\n \r\n return valid ? canvasBuffer.canvas : null;\r\n}\r\n\r\n\r\nfunction arrayPostDivide(pixels, out) {\r\n let empty = true;\r\n for (let i = 0; i < pixels.length; i += 4) {\r\n const alpha = out[i + 3] = pixels[i + 3];\r\n if (alpha !== 0) {\r\n empty = false;\r\n out[i] = Math.round(Math.min(pixels[i] * 255.0 / alpha, 255.0));\r\n out[i + 1] = Math.round(Math.min(pixels[i + 1] * 255.0 / alpha, 255.0));\r\n out[i + 2] = Math.round(Math.min(pixels[i + 2] * 255.0 / alpha, 255.0));\r\n }\r\n else {\r\n out[i] = pixels[i];\r\n out[i + 1] = pixels[i + 1];\r\n out[i + 2] = pixels[i + 2];\r\n }\r\n }\r\n return !empty;\r\n}","import RootNode from \"./nodes/RootNode\";\r\nimport InteractiveNode from \"./nodes/InteractiveNode\";\r\nimport RasterStyles from \"./common/RasterStyles\";\r\nimport RootLayout from \"./layouts/RootLayout\";\r\nimport ClusterLayout from \"./layouts/ClusterLayout\";\r\nimport EventEmitter from \"events\";\r\nimport NodeEventHandler from \"./common/NodeEventHandler\";\r\nimport LinkRenderer from \"./common/LinkRenderer\";\r\nimport ImageUtility from \"../../common/ImageUtility\";\r\nimport { TreeHelper } from \"@emberly/dataplane\";\r\nimport { renderToCanvas } from \"./common/Screenshot\";\r\n\r\nlet initialLoad = false;\r\nconst MAX_ANIMATED = 200;\r\n\r\nexport default class TreeRenderer extends EventEmitter {\r\n\r\n constructor(contextId, isEmbed, renderer, viewport, collection, themeMode = \"light\") {\r\n super();\r\n this.contextId = contextId;\r\n this.isEmbed = isEmbed;\r\n this.styles = new RasterStyles();\r\n this.viewport = viewport;\r\n this.renderer = renderer;\r\n this.eventsEnabled = false;\r\n this.isLoaded = false;\r\n this.instanceId = Date.now() + \"\";\r\n this.worldHeight = 10000;\r\n this.worldWidth = 10000;\r\n\r\n this.themeMode = themeMode;\r\n\r\n // render state\r\n this.opened = false;\r\n this.closed = false;\r\n this.mounted = false;\r\n this.tickDirty = true;\r\n this.dirty = true;\r\n this.dirtySide = 0;\r\n this.renderTimer = 0;\r\n this.zoomWidthTarget = 1000;\r\n this.alpha = 0.01;\r\n\r\n // nodes\r\n this.root = null;\r\n this.nodes = [];\r\n this.nodeDictionary = new Map();\r\n this.parentBuffer = new Map();\r\n this.parentBufferLinks = new Map();\r\n this.lastRenderTick = performance.now();\r\n this.running = true;\r\n\r\n this.screenshotTimer = null;\r\n\r\n this.onScreenshotEvent = (timeout = 9000) => {\r\n clearTimeout(this.screenshotTimer);\r\n this.screenshotTimer = setTimeout(() => this.takeScreenshot(), typeof timeout === \"number\" ? timeout : 9000);\r\n };\r\n\r\n this.requestRenderTickReference = (time) => this.requestRenderTick(time);\r\n\r\n // handlers\r\n this.manager = collection;\r\n this.nodeEventHandler = new NodeEventHandler(this, viewport, this.manager.context);\r\n\r\n // Add LinkRenderer\r\n this.linkRenderer = new LinkRenderer(this);\r\n this.viewport.addChild(this.linkRenderer.container);\r\n\r\n // TODO handlers\r\n this.onNodeUpdated = (entity, instanceId) => {\r\n if (this.instanceId !== instanceId && this.nodeDictionary.has(entity.id)) {\r\n this.nodeDictionary.get(entity.id).onUpdated();\r\n }\r\n };\r\n\r\n this.onNodeDeleted = (entity, instanceId) => {\r\n if (this.instanceId !== instanceId && this.nodeDictionary.has(entity.id)) {\r\n const node = this.getNodeById(entity.id);\r\n if (!!node) {\r\n this.nodes.forEach(t => t.invalidateNode(node));\r\n this.linkRenderer.invalidateNode(node);\r\n node.parent.removeChild(node);\r\n this.deleteNodes([node], false);\r\n }\r\n }\r\n };\r\n\r\n this.onNodeCreated = (entity, instanceId) => {\r\n if (this.instanceId !== instanceId) {\r\n this.createNode(entity);\r\n this.linkRenderer.onNodeCreated(entity.id);\r\n }\r\n };\r\n\r\n // TODO!!!!\r\n\r\n // initial setup\r\n this.renderer.render(this.viewport.parent);\r\n document.fonts.ready.then(() => this.setup());\r\n }\r\n\r\n async setup() {\r\n this.timers = [];\r\n\r\n const profile = await this.manager.context.getOwnerProfile();\r\n this.styles.updateAvatarUrl(profile.avatarUrl);\r\n\r\n if (await this.load()) {\r\n setTimeout(() => {\r\n requestAnimationFrame(this.requestRenderTickReference);\r\n }, 1);\r\n\r\n this.manager.onFlush(this.onScreenshotEvent);\r\n\r\n if (this.manager.canEdit() && this.nodes.length > 1) {\r\n const handler = await this.manager?.getContext()?.getCollectionInContext(\"Map\", \"default\");\r\n const mapEntity = handler?.getEntityById(this.contextId);\r\n if (!!mapEntity && !mapEntity.hasPreview) {\r\n this.onScreenshotEvent(5000);\r\n }\r\n } \r\n }\r\n }\r\n\r\n resetRenderTimer() {\r\n this.renderTimer = 0;\r\n }\r\n\r\n requestRenderTick(time) {\r\n // TODO chrome will set us to 30 fps for a few seconds when starting the rendering process. maybe \r\n if (this.running) {\r\n let delta = (time - this.lastRenderTick) / 1000;\r\n this.lastRenderTick = time;\r\n\r\n if (this.closed) {\r\n if (this.alpha === 0) {\r\n this.destroy();\r\n return;\r\n } else if (delta < 0.25) {\r\n this.setAlpha(this.alpha * (1 - delta * 3) - delta);\r\n this.tickDirty = true;\r\n }\r\n } else if (!this.opened && delta < 0.25) {\r\n this.linkRenderer.onLoaded();\r\n this.setAlphaGeared(this.alpha * (1 + delta) + delta);\r\n this.opened = this.alpha === 1;\r\n this.tickDirty = true;\r\n }\r\n\r\n if (this.tickDirty || this.dirty || this.viewport.moving || this.viewport.zooming || this.nodeEventHandler.dirty) {\r\n this.tick(delta);\r\n this.renderer.render(this.viewport.parent);\r\n this.renderTimer = 0;\r\n } else if (this.renderTimer < 60) {\r\n this.tick(delta);\r\n this.renderer.render(this.viewport.parent);\r\n this.renderTimer++;\r\n }\r\n\r\n requestAnimationFrame(this.requestRenderTickReference);\r\n }\r\n }\r\n\r\n tick(delta) {\r\n if (this.dirty) {\r\n this.updateLayout();\r\n } else if (delta < 0.5 || !this.tickDirty) {\r\n const len = this.nodes.length;\r\n let i = 0;\r\n let dirtyNodes = false;\r\n\r\n this.nodeEventHandler.onTick(delta);\r\n\r\n for (; i < len; i++) {\r\n let node = this.nodes[i];\r\n node.onTick(delta);\r\n dirtyNodes = dirtyNodes || (node.dirty && node.isVisible);\r\n }\r\n\r\n this.nodeEventHandler.render(delta);\r\n\r\n if (dirtyNodes) {\r\n this.linkRenderer.render();\r\n }\r\n\r\n this.tickDirty = dirtyNodes;\r\n }\r\n }\r\n\r\n setTickDirty() {\r\n this.tickDirty = true;\r\n }\r\n\r\n close(isSwitch) {\r\n if (!isSwitch) {\r\n initialLoad = false;\r\n }\r\n\r\n this.manager.offFlush(this.onScreenshotEvent);\r\n clearTimeout(this.screenshotTimer);\r\n this.closed = true;\r\n const visibleSum = TreeRenderer.SumVisibleNodes(this.nodes);\r\n\r\n if (visibleSum > MAX_ANIMATED) {\r\n this.nodes.forEach(t => {\r\n if (!t.isRoot && t.isVisible) {\r\n t.dirty = true;\r\n }\r\n });\r\n } else {\r\n this.nodes.forEach(t => {\r\n if (!t.isRoot && t.isVisible) {\r\n t.optimalPositionX = 0;\r\n t.optimalPositionY = t.optimalPositionY * 0.05;\r\n t.dirty = true;\r\n }\r\n });\r\n }\r\n this.removeAllListeners();\r\n this.setTickDirty();\r\n }\r\n\r\n destroy() {\r\n try {\r\n this.running = false;\r\n\r\n this.manager.externalEvents\r\n .off(this.manager.getGlobalEventKey(\"updated\"), this.onNodeUpdated)\r\n .off(this.manager.getGlobalEventKey(\"deleted\"), this.onNodeDeleted)\r\n .off(this.manager.getGlobalEventKey(\"created\"), this.onNodeCreated);\r\n\r\n this.nodes.forEach(t => {\r\n this.viewport.removeChild(t.container);\r\n if (!!t.renderText) {\r\n this.viewport.removeChild(t.renderText);\r\n }\r\n });\r\n\r\n this.viewport.removeChild(this.linkRenderer.container);\r\n\r\n this.nodes.forEach(node => node.destroy());\r\n\r\n this.removeAllListeners();\r\n this.nodeEventHandler.destroy();\r\n this.linkRenderer.destroy();\r\n\r\n this.root.children = [];\r\n this.root.leftTree = null;\r\n this.root.rightTree = null;\r\n\r\n\r\n this.renderer.render(this.viewport.parent);\r\n this.renderer = null;\r\n this.nodes = [];\r\n this.nodeDictionary.clear();\r\n\r\n this.manager = null;\r\n this.nodeEventHandler = null;\r\n\r\n\r\n } catch (err) {\r\n console.log(\"error destroying pixi\", err);\r\n }\r\n }\r\n\r\n async load(skipAnimations = false) {\r\n if (await this.manager.loadEverything(true)) {\r\n\r\n const list = TreeHelper.GetOrderedTreeByReference(this.manager.entityIndex);\r\n\r\n this.manager.externalEvents\r\n .on(this.manager.getGlobalEventKey(\"updated\"), this.onNodeUpdated)\r\n .on(this.manager.getGlobalEventKey(\"deleted\"), this.onNodeDeleted)\r\n .on(this.manager.getGlobalEventKey(\"created\"), this.onNodeCreated);\r\n\r\n const rootEntity = list[0];\r\n\r\n this.root = new RootNode(rootEntity, this, new RootLayout(rootEntity.side));\r\n this.root.container.zIndex = 99999999;\r\n this.root.isVisible = this.isFullTree();\r\n this.root.setGlobalPosition(this.worldWidth / 2, this.worldHeight / 2);\r\n this.root.setPosition(this.root.optimalPositionX, this.root.optimalPositionY);\r\n this.root.render();\r\n this.nodes = [];\r\n\r\n this.addChild(this.root);\r\n let nodes = [];\r\n\r\n // load nodes\r\n for (let i = 1; i < list.length; i++) {\r\n const n = new InteractiveNode(list[i], this, new ClusterLayout());\r\n nodes.push(n);\r\n this.nodeDictionary.set(n.id, n);\r\n }\r\n\r\n for (let i = 0; i < nodes.length; i++) {\r\n let node = nodes[i];\r\n let parentId = node.entity.parentId;\r\n let parent = this.nodeDictionary.has(parentId) ? this.nodeDictionary.get(parentId) : (node.entity.depth === 1 ? this.root : null);\r\n\r\n if (parent === null) {\r\n console.log(\"found loose hanging node, adding to root..\");\r\n this.addToParentBuffer(parentId, node.id);\r\n parent = this.root;\r\n }\r\n\r\n parent.addChild(node, node.side);\r\n\r\n if (node.depth === 1 && node.color === -1) {\r\n node.color = this.styles.getSynapseColor(node.indexInParent, node.parent.layout.getSide());\r\n node.desaturateColor();\r\n }\r\n }\r\n\r\n if (this.isLoaded) {\r\n this.nodeEventHandler.setActiveNodeId(this.nodeEventHandler.activeNodeId, true);\r\n }\r\n\r\n this.updateLayout();\r\n this.nodes.sort((a, b) => (a.indexInParent - b.indexInParent) + (a.depth - b.depth) * 1000000);\r\n this.updateLayerOrder();\r\n\r\n const visibleSum = TreeRenderer.SumVisibleNodes(nodes);\r\n const performSkip = skipAnimations || initialLoad === false || visibleSum > MAX_ANIMATED;\r\n\r\n if (performSkip) {\r\n this.skipAnimations();\r\n }\r\n\r\n initialLoad = true;\r\n this.isLoaded = true;\r\n this.emit(\"onLoad\", this, performSkip);\r\n\r\n window.sc = (resolutionX = 1200, resolutionY = 675, s = 0.9, background = null, resolutionOverride = null, changeTheme = true) => this.saveScreenshot(resolutionX, resolutionY, s, background, resolutionOverride, changeTheme);\r\n\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n takeScreenshot() {\r\n if (this.manager.canEdit() && !this.closed && this.opened) {\r\n if (!this.nodeEventHandler.isAnyDragActive() && this.nodes.length > 1 && !this.viewport.moving) {\r\n this.screenshot();\r\n } else {\r\n this.onScreenshotEvent(2500);\r\n }\r\n }\r\n }\r\n\r\n async saveScreenshot(resolutionX = 1200, resolutionY = 675, padding = 0.9, background = \"#F5F7F6\", resolutionOverride = null, changeTheme = true) {\r\n const darkMode = this.themeMode === \"dark\";\r\n const color = this.renderer.backgroundColor;\r\n\r\n if (darkMode && changeTheme) {\r\n this.setThemeMode(\"light\", 0xF5F7F6, false);\r\n }\r\n\r\n const canvas = renderToCanvas(this.renderer, this.viewport, this.root.getAABB(), Math.max(resolutionX, resolutionY), resolutionOverride);\r\n \r\n if (darkMode && changeTheme) {\r\n this.setThemeMode(\"dark\", color, true);\r\n }\r\n\r\n if (!!canvas) {\r\n const file = await ImageUtility.GeneratePreviewFromCanvasAsync(canvas, \"preview.png\", resolutionX, resolutionY, padding, background);\r\n const a = document.createElement(\"a\");\r\n document.body.append(a);\r\n a.download = \"map\";\r\n a.href = URL.createObjectURL(file);\r\n a.click();\r\n a.remove();\r\n } else {\r\n console.log(\"invalid buffer\");\r\n }\r\n\r\n }\r\n\r\n async screenshot() {\r\n if (!this.closed && this.nodes.length > 1) {\r\n\r\n const darkMode = this.themeMode === \"dark\";\r\n const color = this.renderer.backgroundColor;\r\n\r\n if (darkMode) {\r\n this.setThemeMode(\"light\", 0xF5F7F6, false);\r\n }\r\n\r\n const canvas = renderToCanvas(this.renderer, this.viewport, this.root.getAABB(), 1200);\r\n\r\n if (darkMode) {\r\n this.setThemeMode(\"dark\", color, true);\r\n }\r\n\r\n if (!!canvas && !!this.manager) {\r\n const file = await ImageUtility.GeneratePreviewFromCanvasAsync(canvas, \"preview.png\", 1200, 675, 0.9, \"#F5F7F6\");\r\n const handler = await this.manager.getContext().getCollectionInContext(\"Map\", \"default\");\r\n handler.getEntityById(this.contextId)?.uploadPreview(file);\r\n } else {\r\n console.log(\"invalid buffer\");\r\n }\r\n }\r\n this.renderer.render(this.viewport.parent);\r\n }\r\n\r\n setThemeMode(mode = \"light\", backgroundColor = 0xF5F7F6, update = true) {\r\n this.themeMode = mode;\r\n this.renderer.backgroundColor = backgroundColor;\r\n this.root.updateColor();\r\n\r\n if (update) {\r\n this.dirty = true;\r\n }\r\n }\r\n\r\n createNode(entity) {\r\n // TODO move buffer, a map that adds a node to the correct parent once established?\r\n const node = new InteractiveNode(entity, this, new ClusterLayout());\r\n \r\n const hasParent = this.nodeDictionary.has(entity.parentId);\r\n let parent = hasParent ? this.nodeDictionary.get(entity.parentId) : this.root;\r\n parent.addChild(node, node.side);\r\n\r\n // Add to parentbuffer\r\n if (parent.id !== entity.parentId) {\r\n this.addToParentBuffer(entity.parentId, entity.id);\r\n }\r\n\r\n if (entity.color === -1 && parent.isRoot && hasParent) {\r\n const side = node.side !== 1 && node.side !== -1 ? node.parent.layout.getSide() : node.side;\r\n node.color = this.styles.getSynapseColor(node.indexInParent, side);\r\n entity.setColor(node.color);\r\n node.desaturateColor();\r\n node.render();\r\n }\r\n\r\n if (!this.dirty) {\r\n node.setLayoutDirty();\r\n }\r\n\r\n this.updateLayerOrder();\r\n\r\n if (this.parentBuffer.has(node.id)) {\r\n const set = this.parentBuffer.get(node.id);\r\n this.parentBuffer.delete(node.id);\r\n set.forEach(t => {\r\n const child = this.getNodeById(t);\r\n if (!!child) {\r\n child.move(node.id, null, null, false, false, true);\r\n }\r\n });\r\n }\r\n\r\n return node;\r\n }\r\n\r\n addChild(node) {\r\n this.nodes.push(node);\r\n this.viewport.addChild(node.container);\r\n if (!!node.renderText) {\r\n this.viewport.addChild(node.renderText);\r\n }\r\n this.nodeDictionary.set(node.id, node);\r\n }\r\n\r\n removeChild(node) {\r\n const idx = this.nodes.indexOf(node);\r\n if (idx !== -1) {\r\n this.nodes.splice(idx, 1);\r\n this.viewport.removeChild(node.container);\r\n if (!!node.renderText) {\r\n this.viewport.removeChild(node.renderText);\r\n }\r\n }\r\n this.nodeDictionary.delete(node.id);\r\n }\r\n\r\n deleteNodes(nodes) {\r\n const deleteSet = new Set();\r\n\r\n nodes.forEach(t => t.children.forEach(c => deleteSet.add(c.id)));\r\n nodes.forEach(t => deleteSet.delete(t.id));\r\n\r\n if (deleteSet.size !== 0) {\r\n console.log(\"nodes left hanging\", deleteSet);\r\n const root = this.isFullTree() ? this.root : this.getBranchRoot();\r\n\r\n deleteSet.forEach(t => {\r\n const node = this.getNodeById(t);\r\n if (!!node) {\r\n node.move(root.id, null, null, false, false, false);\r\n this.addToParentBuffer(node.parent.id, node.id);\r\n }\r\n });\r\n }\r\n\r\n for (let i = 0; i < nodes.length; i++) {\r\n const node = nodes[i];\r\n this.removeChild(node);\r\n }\r\n }\r\n\r\n addToParentBuffer(parentId, nodeId) {\r\n if (this.parentBuffer.has(parentId)) {\r\n this.parentBuffer.get(parentId).add(nodeId);\r\n } else {\r\n this.parentBuffer.set(parentId, new Set([nodeId]));\r\n }\r\n this.parentBufferLinks.set(nodeId, parentId);\r\n }\r\n\r\n removeFromParentBuffer(nodeId) {\r\n if (this.parentBufferLinks.has(nodeId)) {\r\n const parentId = this.parentBufferLinks.get(nodeId);\r\n this.parentBufferLinks.delete(nodeId);\r\n if (this.parentBuffer.has(parentId)) {\r\n this.parentBuffer.get(parentId).delete(nodeId);\r\n }\r\n }\r\n }\r\n\r\n setDirty(dirtySide) {\r\n if (!this.dirty || dirtySide !== this.dirtySide) {\r\n this.dirtySide = this.dirty && dirtySide !== this.dirtySide ? 0 : dirtySide;\r\n this.dirty = true;\r\n this.setTickDirty();\r\n }\r\n }\r\n\r\n updateLayout() {\r\n this.dirty = false;\r\n\r\n if (this.dirtySide <= 0) {\r\n this.root.leftTree.layout.updateWidth();\r\n this.root.leftTree.layout.update();\r\n this.root.leftTree.callRecursive(c => { c.dirty = true });\r\n }\r\n\r\n if (this.dirtySide >= 0) {\r\n this.root.rightTree.layout.updateWidth();\r\n this.root.rightTree.layout.update();\r\n this.root.rightTree.callRecursive(c => { c.dirty = true });\r\n }\r\n\r\n if (!this.mounted) {\r\n this.mounted = true;\r\n this.emit(\"onMounted\", this);\r\n }\r\n }\r\n\r\n updateLayerOrder() {\r\n this.viewport.children.sort((a, b) => {\r\n a.zIndex = a.zIndex || 0;\r\n b.zIndex = b.zIndex || 0;\r\n return a.zIndex - b.zIndex;\r\n });\r\n }\r\n\r\n panTo(node, screenOffsetX, screenOffsetY, skipAnimations = false, time = 420) {\r\n\r\n if (!node || node.renderer.contextId !== this.contextId || node.id === \"inbox\") {\r\n return;\r\n }\r\n\r\n if (!node.isVisible || this.dirty) {\r\n this.updateLayout();\r\n }\r\n\r\n if (skipAnimations) {\r\n this.skipAnimations();\r\n }\r\n\r\n const { snapOptions } = this.styles;\r\n const { screenHeight, screenWidth } = this.viewport;\r\n\r\n const offsetX = screenOffsetX > screenWidth - 96 ? 0 : Math.min(screenOffsetX, screenWidth * 0.75);\r\n const offsetY = screenOffsetY > screenHeight - 96 ? 0 : Math.min(screenOffsetY, screenHeight * 0.75);\r\n\r\n if (screenHeight === offsetY || screenWidth === offsetX) {\r\n return;\r\n }\r\n\r\n const aabb = !node.isRoot && this.isFullTree() ? node.parent.getAABB() : node.getAABB();\r\n const point = aabb.getMidPoint();\r\n\r\n const width = aabb.getWidth();\r\n const height = aabb.getHeight();\r\n\r\n const actualWidth = Math.max(width, this.isEmbed ? 1250 : 2000);\r\n const actualHeight = Math.max(height, 1250);\r\n\r\n const hMul = (actualHeight / (screenHeight - offsetY));\r\n const wMul = (actualWidth / (screenWidth - offsetX));\r\n\r\n const worldOffsetX = wMul * (offsetX || 0);\r\n const worldOffsetY = -hMul * (offsetY || 0);\r\n\r\n const worldX = point.x + worldOffsetX * 0.5;\r\n const worldY = point.y - worldOffsetY * 0.5;\r\n\r\n this.viewport.snap(\r\n worldX,\r\n worldY,\r\n {\r\n ...snapOptions,\r\n time\r\n }\r\n );\r\n\r\n const ratio = (screenWidth - offsetX) / (screenHeight - offsetY);\r\n const aabbRatio = width / height;\r\n\r\n if (ratio < aabbRatio) {\r\n // landscape\r\n const zoomWidth = actualWidth * (screenWidth / (screenWidth - offsetX));\r\n this.viewport.snapZoom({\r\n width: zoomWidth + 32,\r\n ...snapOptions\r\n });\r\n } else {\r\n // portrait \r\n const zoomHeight = actualHeight * (screenHeight / (screenHeight - offsetY));\r\n\r\n this.viewport.snapZoom({\r\n height: zoomHeight + 32,\r\n ...snapOptions\r\n });\r\n }\r\n\r\n this.setTickDirty();\r\n }\r\n\r\n zoom(direction) {\r\n const { snapOptions } = this.styles;\r\n // TODO add to existing zoom if already in zoom motion\r\n\r\n const level = this.viewport.zooming ? this.zoomWidthTarget : this.viewport.worldScreenWidth;\r\n const target = level - (direction * level) / (direction > 0 ? 2 : 1.25);\r\n this.zoomWidthTarget = target;\r\n\r\n this.viewport.snapZoom({\r\n width: target,\r\n ...snapOptions\r\n });\r\n }\r\n\r\n findClosestCallback(x, y, filter, radius) {\r\n const len = this.nodes.length;\r\n let minDist = 999999;\r\n let curNode = null;\r\n\r\n for (let i = 0; i < len; i++) {\r\n const node = this.nodes[i];\r\n\r\n let nX = node.getPositionX();\r\n let dX = x - nX;\r\n let dY = y - node.getPositionY();\r\n\r\n let distance = Math.sqrt(dX * dX + dY * dY);\r\n\r\n if (node.isVisible && distance < minDist && filter(node) && distance <= radius) {\r\n minDist = distance;\r\n curNode = node;\r\n }\r\n }\r\n\r\n return curNode;\r\n }\r\n\r\n\r\n findNode(x, y) {\r\n const len = this.nodes.length;\r\n\r\n for (let i = 0; i < len; i++) {\r\n const node = this.nodes[i];\r\n const nx = node.container.x;\r\n const ny = node.container.y;\r\n const nw = node.width / 2;\r\n const nh = node.height / 2;\r\n\r\n if (\r\n node.isVisible &&\r\n x >= nx - nw &&\r\n x <= nx + nw &&\r\n y >= ny - nh &&\r\n y <= ny + nh\r\n ) {\r\n return node;\r\n }\r\n }\r\n\r\n return null;\r\n }\r\n\r\n // TODO improve\r\n findClosestByOpposingJoints(node, radius) { // TODO fine tune, and make x-distance 0 if the bounding boxes intersect?\r\n const side = node.layout.getSide();\r\n\r\n const x = node.container.x - side * node.width * 0.5;\r\n const y = node.container.y;\r\n const len = this.nodes.length;\r\n let curNode = null;\r\n let minDist = 99999;\r\n\r\n for (let i = 0; i < len; i++) {\r\n const cN = this.nodes[i];\r\n\r\n if (cN.id === node.id || !cN.isVisible) {\r\n continue;\r\n }\r\n\r\n let cX = cN.container.x + side * cN.width * 0.5;\r\n let cY = cN.container.y;\r\n\r\n let intersectX = Math.abs(cN.container.x - node.container.x) < (cN.width + node.width) / 2;\r\n let dX = intersectX ? (x - cX) * 0.5 : x - cX;\r\n let dY = (y - cY) * 3;\r\n\r\n let dist = Math.sqrt(dX * dX + dY * dY);\r\n\r\n if (dist < minDist && dist <= radius && !cN.hasParent(node)) {\r\n minDist = dist;\r\n curNode = cN;\r\n }\r\n }\r\n\r\n if (curNode !== null && !curNode.isRoot) {\r\n const cX0 = node.container.x - side * node.width * 0.5;\r\n const cX1 = curNode.container.x + side * curNode.width * 0.5;\r\n const dX = (cX0 - cX1) * side;\r\n\r\n if (dX < 0) {\r\n curNode = curNode.parent;\r\n if (curNode.isRoot) {\r\n curNode = this.root;\r\n }\r\n }\r\n }\r\n\r\n if (curNode !== null && curNode.isRoot && !this.isFullTree()) {\r\n return null;\r\n }\r\n\r\n return curNode;\r\n }\r\n\r\n findInAABB(x0, y0, x1, y1, filter) {\r\n const len = this.nodes.length;\r\n let result = [];\r\n\r\n for (let i = 0; i < len; i++) {\r\n let node = this.nodes[i];\r\n\r\n if (node.id === filter.id || !node.isVisible) {\r\n continue;\r\n }\r\n\r\n const w05 = node.width / 2;\r\n const h05 = node.height / 2;\r\n const container = node.container;\r\n const cX0 = container.x - w05;\r\n const cY0 = container.y - h05;\r\n const cX1 = container.x + w05;\r\n const cY1 = container.y + h05;\r\n\r\n\r\n if (x0 > cX1 || cX0 > x1 || y0 > cY1 || cY0 > y1)\r\n continue;\r\n\r\n result.push(node);\r\n }\r\n\r\n return result;\r\n }\r\n\r\n getNodeById(nodeId) {\r\n if (this.nodeDictionary.has(nodeId)) {\r\n return this.nodeDictionary.get(nodeId);\r\n } else if (nodeId === \"inbox\") {\r\n return new InteractiveNode(\"inbox\", \"Inbox\", this, null);\r\n }\r\n return null;\r\n }\r\n\r\n setDragEnabled(enabled) {\r\n if (this.running) {\r\n this.nodeEventHandler.setDragEnabled(enabled);\r\n }\r\n }\r\n\r\n setDragOverActive(active) {\r\n this.nodeEventHandler.setDragOverActive(active);\r\n }\r\n\r\n onDragOver(x, y) {\r\n this.nodeEventHandler.onDragOver(x, y);\r\n }\r\n\r\n pause() {\r\n this.viewport.pause = true;\r\n }\r\n\r\n resume() {\r\n this.viewport.pause = false;\r\n }\r\n\r\n skipAnimations() {\r\n this.alpha = 1;\r\n this.callWidthFirst(node => node.skipAnimations());\r\n }\r\n\r\n callDepthFirst(fn) {\r\n this.root.callRecursive(fn);\r\n }\r\n\r\n callWidthFirst(fn) {\r\n let node = this.root;\r\n let layer = [this.root].concat(this.root.leftTree.children).concat(this.root.rightTree.children);\r\n let buffer = [];\r\n\r\n do {\r\n buffer = layer;\r\n layer = [];\r\n\r\n for (let i = 0; i < buffer.length; i++) {\r\n node = buffer[i];\r\n fn(node);\r\n\r\n if (node.depth !== 0) {\r\n layer = layer.concat(node.children);\r\n }\r\n }\r\n }\r\n while (layer.length !== 0);\r\n }\r\n\r\n updateAvatarUrl(url) {\r\n if (this.styles.updateAvatarUrl(url) && this.running && !!this.root && this.isFullTree()) {\r\n this.root.updateAvatarUrl();\r\n }\r\n }\r\n\r\n getBranchRoot() {\r\n return this.nodes.find(node => node.parent !== null && node.parent.isRoot);\r\n }\r\n\r\n getActiveNode() {\r\n const id = this.nodeEventHandler.activeNodeId;\r\n\r\n if (this.nodeDictionary.has(id)) {\r\n const node = this.nodeDictionary.get(id);\r\n return node;\r\n } else {\r\n return this.root;\r\n }\r\n }\r\n\r\n isEmpty() {\r\n return !this.root || this.root.leftTree === null || this.root.rightTree === null || (this.root.leftTree.children.length === 0 && this.root.rightTree.children.length === 0);\r\n }\r\n\r\n isFullTree() {\r\n return !this.root || this.root.layout.side === 0;\r\n }\r\n\r\n canDisableFullTree() {\r\n return !!this.root && !!this.root.leftTree && !!this.root.rightTree && (this.root.leftTree.children.length + this.root.rightTree.children.length) <= 1;\r\n }\r\n\r\n setAlphaGeared(alpha) {\r\n const value = Math.min(1, Math.max(0, alpha));\r\n this.alpha = value;\r\n const len = this.nodes.length;\r\n\r\n for (let i = 0; i < len; i++) {\r\n const t = this.nodes[i];\r\n if (t.isVisible) {\r\n t.setAlpha(Math.min(1, value + (4 * value) / (t.depth * t.depth + 1)));\r\n }\r\n }\r\n }\r\n\r\n setAlpha(alpha) {\r\n const value = Math.min(1, Math.max(0, alpha));\r\n this.alpha = value;\r\n const len = this.nodes.length;\r\n\r\n for (let i = 0; i < len; i++) {\r\n const t = this.nodes[i];\r\n if (t.isVisible) {\r\n t.setAlpha(value);\r\n }\r\n }\r\n }\r\n\r\n setContextLost() {\r\n if (this.running && !this.closed) {\r\n this.nodeEventHandler.setContextLost();\r\n } else {\r\n window.location.reload();\r\n }\r\n }\r\n\r\n\r\n static SumVisibleNodes(nodes) {\r\n let sum = 0;\r\n for (let i = 0; i < nodes.length; i++) {\r\n sum += nodes[i].isVisible;\r\n }\r\n return sum;\r\n }\r\n\r\n\r\n}","import * as TreeActions from \"../../../actions/tree\";\r\nimport * as AppActions from \"../../../actions/app\";\r\nimport { getRootUrl } from \"../../../hooks/useApp\";\r\n\r\nexport default class TreeKeyboardShortcuts {\r\n\r\n constructor(tree, history, dispatch) {\r\n\r\n this.listener = (e) => {\r\n const searchParams = history?.location?.search;\r\n\r\n if (e.target !== document.body || searchParams?.includes(\"editor\") || searchParams?.includes(\"quiz\")) {\r\n return;\r\n }\r\n\r\n const code = e.keyCode;\r\n const node = tree.getActiveNode();\r\n\r\n if (node === null) return;\r\n\r\n const entity = tree.manager.getEntityById(node.id);\r\n\r\n if (entity === null) return;\r\n\r\n const composed = e.ctrlKey || e.altKey || e.shiftKey || e.metaKey;\r\n const meta = e.ctrlKey || e.metaKey;\r\n\r\n // shortcuts requiring ownership\r\n if (tree.manager.canEdit()) {\r\n\r\n if (e.code === 114 || (meta && code === 70)) {\r\n e.preventDefault();\r\n history.push(`${getRootUrl()}/search`);\r\n dispatch(AppActions.SetContextCard(1));\r\n }\r\n\r\n // Set skill rating\r\n if (!entity.isRoot && !meta) {\r\n if (code >= 97 && code <= 101) {\r\n const rating = code - 96;\r\n entity.setRating(entity.rating === rating ? 0 : rating);\r\n } else if (code >= 49 && code <= 53) {\r\n const rating = code - 48;\r\n entity.setRating(entity.rating === rating ? 0 : rating);\r\n } else if (code === 70) {\r\n // toggle flag\r\n entity.setLearningState((entity.state & 0b1) === 1 ? 0 : 1);\r\n } else if (code === 72) {\r\n // toggle heart \r\n entity.setLearningState((entity.state & 0b10) === 2 ? 0 : 2);\r\n }\r\n }\r\n\r\n if (code === 67 && !entity.isRoot && node.children.length !== 0 && !composed) {\r\n entity.setIsCollapsed(!entity.isCollapsed);\r\n }\r\n\r\n if (code === 46 && e.key === \"Delete\" && !entity.isRoot && !composed) {\r\n // Begin Delete Node\r\n dispatch(TreeActions.NodeFocusedDebounce(node.getNodeData(), history, true));\r\n\r\n if (!node.isRoot) {\r\n if (node.parent.isRoot) {\r\n const closestSibling = tree.findClosestCallback(node.container.x, node.container.y, t => t !== node && t.depth === 1, 9999999);\r\n if (closestSibling === null) {\r\n history.push(getRootUrl());\r\n } else {\r\n dispatch(TreeActions.NodeFocusedDebounce(closestSibling.getNodeData(), history, true));\r\n }\r\n } else {\r\n dispatch(TreeActions.NodeFocusedDebounce(node.parent.getNodeData(), history, true));\r\n }\r\n \r\n entity.deleteBranch({\r\n historyGroup: \"ui_deleted\",\r\n filter: (e) => {\r\n const n = tree.getNodeById(e.id);\r\n return n?.synapse?.detached ? false : true;\r\n }\r\n });\r\n\r\n dispatch(AppActions.DisplayNotification({\r\n text: \"Deleted branch!\",\r\n actionText: \"UNDO\",\r\n action: () => {\r\n tree.manager.undo(\"ui_deleted\");\r\n dispatch(AppActions.DisplayNotification(\"Restored branch!\"));\r\n }\r\n }));\r\n\r\n }\r\n\r\n }\r\n\r\n if (code === 13 && e.key === \"Enter\" && (tree.isFullTree() || !node.isRoot)) {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n\r\n if (e.ctrlKey || e.metaKey) {\r\n // Create Sibling\r\n if (\r\n (node.parent !== null && !node.parent.isRoot) ||\r\n (tree.isFullTree() && node.parent !== null)\r\n ) {\r\n const nodeData = node.getNodeData();\r\n dispatch(TreeActions.AddCreateNodeDialog(nodeData.parentId, node.side));\r\n }\r\n } else {\r\n // Create Child\r\n dispatch(TreeActions.AddCreateNodeDialog(node.id, node.side))\r\n }\r\n }\r\n }\r\n\r\n // shortcuts not requiring ownership\r\n switch (code) {\r\n case 109: // Zoom Out\r\n dispatch(TreeActions.Zoom(0.75))\r\n break;\r\n\r\n case 107: // Zoom In\r\n dispatch(TreeActions.Zoom(-0.75))\r\n break;\r\n default:\r\n break;\r\n }\r\n\r\n if (!node.isRoot) {\r\n const parent = node.parent;\r\n\r\n switch (code) {\r\n // TODO navigation\r\n case 38: // Arrow up\r\n case 40: // Arrow down\r\n e.preventDefault();\r\n const siblings = node.getGlobalSiblings();\r\n const curIdx = siblings.findIndex(n => n === node);\r\n const dirY = code - 39;\r\n const index = curIdx + dirY === -1 ? siblings.length - 1 : curIdx + dirY;\r\n const sibling = siblings[index % siblings.length];\r\n if (sibling.id !== node.id) {\r\n dispatch(TreeActions.NodeFocusedDebounce(sibling.getNodeData(), history));\r\n dispatch(TreeActions.PanToNode(sibling));\r\n }\r\n break;\r\n\r\n case 37: // Arrow left\r\n case 39: // Arrow right\r\n e.preventDefault();\r\n const dirX = (code - 38) * node.side;\r\n\r\n if (dirX === -1) { // Go down\r\n if (node.parent.isRoot) {\r\n if (node.renderer.isFullTree()) {\r\n const dSide = node.side === 1 ? tree.root.leftTree.children : tree.root.rightTree.children;\r\n dispatch(TreeActions.NodeFocusedDebounce(dSide[findClosest(node, dSide)].getNodeData(), history));\r\n dispatch(TreeActions.PanToNode(dSide[findClosest(node, dSide)]));\r\n }\r\n } else {\r\n dispatch(TreeActions.NodeFocusedDebounce(parent.getNodeData(), history));\r\n dispatch(TreeActions.PanToNode(parent));\r\n }\r\n\r\n } else if (node.children.length !== 0) { // Go up\r\n dispatch(TreeActions.NodeFocusedDebounce(node.children[findClosest(node, node.children)].getNodeData(), history));\r\n dispatch(TreeActions.PanToNode(node.children[findClosest(node, node.children)]));\r\n }\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n };\r\n }\r\n\r\n start() {\r\n window.addEventListener(\"keydown\", this.listener);\r\n }\r\n\r\n stop() {\r\n window.removeEventListener(\"keydown\", this.listener);\r\n }\r\n\r\n destroy() {\r\n this.stop();\r\n }\r\n\r\n}\r\n\r\n\r\nconst findClosest = (node, children) => {\r\n let idx = 0;\r\n let min = 9999999;\r\n\r\n for (let i = 0; i < children.length; i++) {\r\n const dist = Math.abs(node.container.y - children[i].container.y);\r\n\r\n if (dist < min) {\r\n min = dist;\r\n idx = i;\r\n }\r\n }\r\n\r\n return idx;\r\n}\r\n","import { Point } from \"../pixi\";\r\n\r\nclass PinchGesturePlugin {\r\n\r\n constructor(options) {\r\n this.viewport = options.viewport;\r\n this.listenerNode = options.listenerNode || document.body;\r\n\r\n this.onGestureStart = (event) => {\r\n this.initialScale = this.viewport.scale.x;\r\n const initialGlobalPosition = this.viewport.input.getPointerPosition(event);\r\n this.initialLocalPosition = this.viewport.toLocal(initialGlobalPosition);\r\n };\r\n \r\n this.onGestureEnd = () => {\r\n this.viewport.emit(\"zoomed\", { viewport: this.viewport, type: \"pinch\" });\r\n };\r\n \r\n this.onGestureChange = (event) => {\r\n if (!this.initialLocalPosition) {\r\n throw new Error(\"Missing initial position\");\r\n }\r\n \r\n const newScale = event.scale * this.initialScale;\r\n this.viewport.setZoom(newScale);\r\n \r\n const globalPosition = this.viewport.input.getPointerPosition(\r\n event\r\n );\r\n const localPosition = this.viewport.toLocal(globalPosition);\r\n \r\n const deltaX = localPosition.x - this.initialLocalPosition.x;\r\n const deltaY = localPosition.y - this.initialLocalPosition.y;\r\n \r\n this.moveRelative(deltaX, deltaY);\r\n this.viewport.emit(\"moved\", { viewport: this.viewport, type: \"pinch\" });\r\n };\r\n\r\n\r\n this.listenerNode.addEventListener(\"gesturestart\", this.onGestureStart);\r\n this.listenerNode.addEventListener(\"gesturechange\", this.onGestureChange);\r\n this.listenerNode.addEventListener(\"gestureend\", this.onGestureEnd);\r\n this.initialScale = this.viewport.scale.x;\r\n }\r\n\r\n down() {\r\n return false;\r\n }\r\n \r\n move() {\r\n return false;\r\n }\r\n\r\n up() {\r\n return false;\r\n }\r\n\r\n wheel() {\r\n return false;\r\n }\r\n\r\n update() {}\r\n reset() {}\r\n resize() {}\r\n pause() {}\r\n resume() {}\r\n\r\n destroy() {\r\n this.listenerNode.removeEventListener(\"gesturestart\", this.onGestureStart);\r\n this.listenerNode.removeEventListener(\r\n \"gesturechange\",\r\n this.onGestureChange\r\n );\r\n this.listenerNode.removeEventListener(\"gestureend\", this.onGestureEnd);\r\n }\r\n\r\n \r\n\r\n moveRelative(deltaX, deltaY) {\r\n this.viewport.moveCenter(\r\n new Point(\r\n this.viewport.center.x - deltaX,\r\n this.viewport.center.y - deltaY\r\n )\r\n );\r\n }\r\n}\r\n\r\nexport default PinchGesturePlugin;","import { settings, autoDetectRenderer, Container, Point } from \"./pixi\";\r\nimport { Viewport } from \"pixi-viewport\";\r\nimport PinchGesturePlugin from \"./common/PinchGesturePlugin\";\r\nsettings.PRECISION_FRAGMENT = \"highp\";\r\n\r\nexport function injectRenderer(size, container, isMobile, backgroundColor) {\r\n const worldWidth = 10000;\r\n const worldHeight = 10000;\r\n const width = size.width;\r\n const height = size.height;\r\n\r\n const renderer = autoDetectRenderer({\r\n width,\r\n height,\r\n backgroundColor: backgroundColor,\r\n resolution: getResolution(isMobile),\r\n antialias: !isMobile && window.devicePixelRatio < 2.5,\r\n autoDensity: true,\r\n powerPreference: \"high-performance\",\r\n backgroundAlpha: 1,\r\n useContextAlpha: false\r\n });\r\n\r\n container.appendChild(renderer.view);\r\n \r\n const viewport = new Viewport({\r\n worldWidth,\r\n worldHeight,\r\n screenWidth: width,\r\n screenHeight: height,\r\n interaction: renderer.plugins.interaction,\r\n });\r\n\r\n const stage = new Container();\r\n stage.addChild(viewport);\r\n\r\n viewport\r\n .drag()\r\n .pinch()\r\n .wheel()\r\n .clampZoom({ minHeight: 500, maxHeight: worldHeight * 4 })\r\n .decelerate({\r\n friction: 0.85\r\n });\r\n\r\n const gesturePinch = new PinchGesturePlugin({ viewport });\r\n viewport.plugins.add(\"gesture-pinch\", gesturePinch);\r\n\r\n viewport.zoomPercent(-0.75);\r\n viewport.center = new Point(worldWidth / 2, worldHeight / 2);\r\n\r\n return { renderer, viewport }\r\n}\r\n\r\nconst getResolution = (isMobile) => {\r\n if (isMobile || window.devicePixelRatio >= 2.5) {\r\n return Math.min(2.5, Math.max(window.devicePixelRatio, 4.5));\r\n } else {\r\n const { width, height } = window.screen;\r\n\r\n if (width * height <= 1920 * 1080) {\r\n return 1.5;\r\n } else if (width * height >= 2200 * 1200) {\r\n return 1.5;\r\n }\r\n\r\n return Math.min(1.5, Math.max(window.devicePixelRatio, 1.75));\r\n }\r\n};","import { useEffect, useMemo } from \"react\";\r\nimport { getTree } from \"../actions/tree\";\r\nimport { useReferencingEntities, useEntities, useChildren, useAccessLevel } from \"@emberly/dataplane\";\r\nimport { useSelector } from \"react-redux\"\r\n\r\nexport function useTreeReferenceRenderer(noteId = null, nodeId = null) {\r\n const { children: blocks } = useChildren(\"Note\", noteId);\r\n const { entities: referencingBlocks } = useReferencingEntities(\"Note\", noteId);\r\n const updateCount = useSelector(state => state.tree.activeNodeIdCount);\r\n const accessLevel = useAccessLevel();\r\n\r\n const { nodeIds, resourceIds } = useMemo(\r\n () => {\r\n const myReferences = [...new Set(blocks.flatMap(t => t.references).concat(referencingBlocks.map(t => t.parentId)))];\r\n\r\n const resourceIds = myReferences.filter(t => t.startsWith(\"resource-\")).map(t => t.substr(9));\r\n const nodeIds = myReferences.filter(t => t.startsWith(\"node-\")).map(t => t.substr(5));\r\n\r\n return { resourceIds, nodeIds };\r\n },\r\n [blocks, referencingBlocks]\r\n );\r\n\r\n const { entities: resources } = useEntities(\"Resource\", resourceIds);\r\n const resourceParents = resources.map(t => t.parentId);\r\n \r\n useEffect(() => {\r\n const fn = () => {\r\n const finalNodeIds = resourceParents.concat(nodeIds);\r\n getTree()?.linkRenderer?.setLinkedNodes(finalNodeIds, nodeId);\r\n };\r\n\r\n const timer = setTimeout(fn, 25);\r\n\r\n return () => {\r\n clearTimeout(timer);\r\n }\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [noteId, JSON.stringify(resourceParents), JSON.stringify(nodeIds), nodeId, accessLevel, updateCount]);\r\n}\r\n","import { Grid, Typography } from \"@mui/material\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport { Link } from \"react-router-dom\";\r\nimport { useEffect, useState } from \"react\";\r\nimport { useRootUrl } from \"../../../hooks/useApp\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n root: {\r\n position: \"absolute\",\r\n width: \"100%\",\r\n height: \"100%\",\r\n background: theme.palette.background.paper,\r\n padding: theme.spacing(2)\r\n },\r\n link: {\r\n marginTop: theme.spacing(1),\r\n marginLeft: theme.spacing(0.25),\r\n color: theme.palette.primary.dark\r\n }\r\n}));\r\n\r\nexport default function NotFoundView(props) {\r\n const { deleted, entityType } = props;\r\n const classes = useStyles();\r\n const [visible, setVisible] = useState(false);\r\n\r\n useEffect(() => {\r\n setVisible(false);\r\n const timer = setTimeout(() => setVisible(true), 1000);\r\n return () => {\r\n clearTimeout(timer);\r\n };\r\n }, []);\r\n\r\n const rootUrl = useRootUrl();\r\n\r\n return (\r\n <Grid className={classes.root} container spacing={0} direction=\"column\" justifyContent=\"flex-start\" alignItems=\"flex-start\">\r\n {\r\n visible ? (\r\n <>\r\n <Typography variant=\"h5\">{entityType || \"Entity\"} Not Found</Typography>\r\n {deleted ? (\r\n <Typography variant=\"subtitle2\" color=\"textSecondary\">{entityType || \"Entity\"} was deleted.</Typography>\r\n ) : null}\r\n <Link to={rootUrl}>\r\n <Typography variant=\"body1\" className={classes.link}>\r\n Go back\r\n </Typography>\r\n </Link>\r\n </>\r\n ) : null\r\n }\r\n </Grid>\r\n );\r\n}","import { useEffect } from \"react\";\r\nimport { useActiveNode } from \"../../../hooks/useTreeActions\";\r\nimport { useTreeReferenceRenderer } from \"../../../hooks/useTreeReferenceRenderer\";\r\nimport { useEntity } from \"@emberly/dataplane\";\r\nimport NotFoundView from \"../views/NotFoundView\";\r\nimport { getRootUrl } from \"../../../hooks/useApp\";\r\nimport useCard from \"../../../hooks/useCard\";\r\nimport { useHistory, useLocation, useRouteMatch } from \"react-router\";\r\n\r\nexport default function RouteWithNodeId(props) { // TODO not set defaultcard?\r\n const match = useRouteMatch();\r\n const history = useHistory();\r\n const location = useLocation();\r\n const nodeId = match.params.nodeId;\r\n const { entity, loading, deleted } = useEntity(\"Node\", nodeId);\r\n const active = !!entity && !deleted && !entity?.isRoot;\r\n\r\n useActiveNode(nodeId, true);\r\n useTreeReferenceRenderer(`node-${nodeId}`, nodeId);\r\n useCard(props.cardState);\r\n\r\n useEffect(() => {\r\n if (entity?.isRoot) {\r\n history.push(getRootUrl(location.pathname));\r\n }\r\n }, [entity, history, location]);\r\n\r\n return active || loading ? props.children : <NotFoundView deleted={deleted} entityType=\"Topic\" />;\r\n}","import { useDefaultCard } from \"../../../hooks/useCard\";\r\nimport { useActiveNode } from \"../../../hooks/useTreeActions\";\r\nimport { useTreeReferenceRenderer } from \"../../../hooks/useTreeReferenceRenderer\";\r\nimport { useEntity } from \"@emberly/dataplane\";\r\nimport NotFoundView from \"../views/NotFoundView\";\r\nimport { useRouteMatch } from \"react-router\";\r\n\r\n\r\nexport default function RouteWithResourceId(props) { // TODO not set defaultcard?\r\n const match = useRouteMatch();\r\n const resourceId = match.params.resourceId;\r\n const { entity: resourceEntity, deleted: resourceDeleted, loading: resourceLoading } = useEntity(\"Resource\", resourceId);\r\n const { entity: nodeEntity, deleted: nodeDeleted, loading: nodeLoading } = useEntity(\"Node\", resourceEntity?.parentId);\r\n useActiveNode(resourceEntity?.parentId, true);\r\n useTreeReferenceRenderer(`resource-${resourceId}`, resourceEntity?.parentId);\r\n useDefaultCard();\r\n\r\n const active = !!nodeEntity && !!resourceEntity && !nodeDeleted && !resourceDeleted;\r\n const loading = nodeLoading || resourceLoading;\r\n\r\n return active || loading ? props.children : <NotFoundView deleted={nodeDeleted || resourceDeleted} entityType={nodeDeleted ? \"Topic\" : \"Resource\"} />;\r\n}","import { useActiveNode } from \"../../../hooks/useTreeActions\";\r\nimport { useTreeReferenceRenderer } from \"../../../hooks/useTreeReferenceRenderer\";\r\n\r\nexport default function RouteWithoutNodeId(props) { // TODO not set defaultcard?\r\n useActiveNode(null);\r\n useTreeReferenceRenderer(null);\r\n return props.children;\r\n}","import { useCallback } from \"react\";\r\nimport { useSelector, useDispatch } from \"react-redux\";\r\nimport { Switch, Route, Redirect } from \"react-router\";\r\nimport NodeView from \"../../organisms/views/NodeView\";\r\nimport ResourceCreateView from \"../../organisms/views/ResourceCreateView\";\r\nimport ResourceView from \"../../organisms/views/ResourceView\";\r\nimport ResourceTagsView from \"../../organisms/views/ResourceTagsView\";\r\nimport ResourceEditView from \"../../organisms/views/ResourceEditView\";\r\nimport ResourceMultiTagsView from \"../../organisms/views/ResourceMultiTagsView\";\r\nimport FilterView from \"../../organisms/views/FilterView\";\r\nimport SearchView from \"../../organisms/views/SearchView\";\r\nimport DynamicCard from \"../../atoms/cards/DynamicCard\";\r\nimport * as AppActions from \"../../../actions/app\";\r\nimport MobileMapOverlay from \"../../molecules/overlays/MobileMapOverlay\";\r\nimport DesktopMapOverlay from \"../../molecules/overlays/DesktopMapOverlay\";\r\nimport MapSettingsView from \"../../organisms/views/MapSettingsView\";\r\nimport EmbedOverlay from \"../../molecules/overlays/EmbedOverlay\";\r\nimport SearchDialog from \"../../organisms/dialogs/SearchDialog\";\r\nimport MapDescriptionView from \"../../organisms/views/MapDescriptionView\";\r\nimport useTreeEngine from \"../../../renderers/tree/useTreeEngine\";\r\nimport { useCanEditWithLoad } from \"@emberly/dataplane\";\r\nimport LoadingPanel from \"../../molecules/panels/LoadingPanel\";\r\nimport { ConditionalPortal } from \"../../atoms/views/ConditionalPortalView\";\r\nimport RouteWithNodeId from \"../../organisms/routehandlers/RouteWithNodeId\";\r\nimport RouteWithResourceId from \"../../organisms/routehandlers/RouteWithResourceId\";\r\nimport RouteWithoutNodeId from \"../../organisms/routehandlers/RouteWithoutNodeId\";\r\nimport { useDevice } from \"../../../providers/DeviceContext\";\r\n\r\nexport default function MapCard(props) {\r\n const { mapId } = props;\r\n const dispatch = useDispatch();\r\n const { isEmbed, isEmbedView, isMobilePortraitView } = useDevice();\r\n const { notesFullscreen, cardSwipeActive, contextCardState } = useSelector(state => state.app);\r\n const hasRenderer = useSelector(state => state.tree.hasRenderer);\r\n const { containerRef, showLoadingScreen, loading: treeLoading } = useTreeEngine(mapId);\r\n const { canEdit } = useCanEditWithLoad();\r\n const isPrivateAccess = !isEmbedView;\r\n\r\n const cardWidth = Math.floor(Math.min(540, Math.max(380, window.innerWidth / 3.25)));\r\n\r\n const handleCardState = useCallback((val) => {\r\n if (cardSwipeActive || val === 0 || !isMobilePortraitView) {\r\n dispatch(AppActions.SetContextCard(val));\r\n }\r\n }, [cardSwipeActive, dispatch, isMobilePortraitView]);\r\n\r\n return (\r\n <DynamicCard\r\n cardId=\"mapCard\"\r\n active={cardSwipeActive || !isMobilePortraitView}\r\n headerHeight={450}\r\n maxHeaderHeight={0.6}\r\n peekHeight={canEdit ? 134 : 100}\r\n swipeableSize={40}\r\n cardWidth={cardWidth}\r\n cardState={contextCardState}\r\n onCardStateChange={handleCardState}\r\n DesktopOverlay={DesktopMapOverlay}\r\n MobileOverlay={MobileMapOverlay}\r\n EmbedOverlay={EmbedOverlay}\r\n backgroundRef={containerRef}\r\n hasOverlay={hasRenderer}\r\n fullscreen={notesFullscreen}\r\n hasBackground\r\n >\r\n {\r\n hasRenderer ? (\r\n <Switch>\r\n\r\n {isPrivateAccess ? (\r\n <Route path=\"/map/:userId?/:mapId?/node/:nodeId?/resource/add\">\r\n <RouteWithNodeId cardState>\r\n <ResourceCreateView />\r\n </RouteWithNodeId>\r\n </Route>\r\n ) : null}\r\n\r\n <Route path=\"/map/:userId?/:mapId?/node/:nodeId?/filter\">\r\n <RouteWithNodeId cardState>\r\n <FilterView />\r\n </RouteWithNodeId>\r\n </Route>\r\n\r\n {isPrivateAccess ? (\r\n <Route path=\"/map/:userId?/:mapId?/node/:nodeId?/tags\">\r\n <RouteWithNodeId cardState>\r\n <ResourceMultiTagsView />\r\n </RouteWithNodeId>\r\n </Route>\r\n ) : null}\r\n\r\n <Route\r\n path=\"/map/:userId?/:mapId?/node/:nodeId?/resource/:resourceId\"\r\n render={props => (\r\n <Redirect to={`/map/${props.match.params.userId}/${props.match.params.mapId}/resource/${props.match.params.resourceId}`} />\r\n )}\r\n />\r\n\r\n <Route path=\"/map/:userId?/:mapId?/node/:nodeId?\" >\r\n <RouteWithNodeId>\r\n <NodeView />\r\n </RouteWithNodeId>\r\n </Route>\r\n\r\n {isPrivateAccess ? (\r\n <Route path=\"/map/:userId?/:mapId?/resource/:resourceId?/edit\">\r\n <RouteWithResourceId>\r\n <ResourceEditView />\r\n </RouteWithResourceId>\r\n </Route>\r\n ) : null}\r\n\r\n {isPrivateAccess ? (\r\n <Route path=\"/map/:userId?/:mapId?/resource/:resourceId?/tags\">\r\n <RouteWithResourceId>\r\n <ResourceTagsView />\r\n </RouteWithResourceId>\r\n </Route>\r\n ) : null}\r\n\r\n <Route path=\"/map/:userId?/:mapId?/resource/:resourceId?\">\r\n <RouteWithResourceId>\r\n <ResourceView />\r\n </RouteWithResourceId>\r\n </Route>\r\n\r\n {isPrivateAccess ? (\r\n <Route path=\"/map/:userId?/:mapId?/edit\">\r\n <RouteWithoutNodeId>\r\n <MapSettingsView />\r\n </RouteWithoutNodeId>\r\n </Route>\r\n ) : null}\r\n\r\n <Route path=\"/map/:userId?/:mapId?/description\">\r\n <RouteWithoutNodeId>\r\n <MapDescriptionView />\r\n </RouteWithoutNodeId>\r\n </Route>\r\n\r\n <Route path=\"/map/:userId?/:mapId?/filter\">\r\n <RouteWithoutNodeId>\r\n <FilterView />\r\n </RouteWithoutNodeId>\r\n </Route>\r\n\r\n <Route path=\"/map/:userId?/:mapId?\">\r\n <RouteWithoutNodeId>\r\n {!isEmbed ? <SearchView /> : <MapDescriptionView /> }\r\n </RouteWithoutNodeId>\r\n </Route>\r\n\r\n </Switch>\r\n ) : null\r\n }\r\n <SearchDialog />\r\n <ConditionalPortal active portalId=\"root-portal\">\r\n <LoadingPanel display={showLoadingScreen && treeLoading} />\r\n </ConditionalPortal>\r\n </DynamicCard>\r\n );\r\n}","import { useEffect, useRef, useState } from \"react\";\r\nimport { useDispatch, useSelector } from \"react-redux\";\r\nimport { getRootUrl } from \"../../hooks/useApp\";\r\nimport TreeRenderer from \"./TreeRenderer\";\r\nimport * as AppActions from \"../../actions/app\";\r\nimport * as TreeActions from \"../../actions/tree\";\r\nimport { useRenderer } from \"../../hooks/useRenderer\";\r\nimport { useCanEdit, useRTACUserAvatarUrl, useCollection, useGroupOwnerId, Task } from \"@emberly/dataplane\";\r\nimport TreeKeyboardShortcuts from \"./common/TreeKeyboardShortcuts\";\r\nimport { usePlanWithFileLimits } from \"../../hooks/usePlan\";\r\nimport { useDevice } from \"../../providers/DeviceContext\";\r\nimport { useHistory } from \"react-router\";\r\nimport { injectRenderer } from \"./renderer\";\r\nimport { useTheme } from \"@mui/styles\";\r\n\r\nexport default function useTreeEngine(contextId) {\r\n const { containerRef, appRef, viewportRef, startRenderer, eventEmitterRef } = useRenderer();\r\n const [showLoadingScreen, setShowLoadingScreen] = useState(true);\r\n const [loading, setLoading] = useState(true);\r\n const { isEmbed, isMobilePortraitView } = useDevice();\r\n const canEdit = useCanEdit();\r\n const theme = useTheme();\r\n const treeRef = useRef(null);\r\n const nodeIdRef = useRef(null);\r\n const mobileRef = useRef(isMobilePortraitView);\r\n const themeModeRef = useRef(theme.palette.mode);\r\n nodeIdRef.current = useSelector(state => state.tree.activeNodeId)\r\n const dispatch = useDispatch();\r\n const history = useHistory();\r\n const { collection } = useCollection(\"Node\");\r\n const idRef = useRef(contextId);\r\n const plan = usePlanWithFileLimits();\r\n const planRef = useRef(plan);\r\n const ownerId = useGroupOwnerId();\r\n const { avatarUrl } = useRTACUserAvatarUrl(ownerId);\r\n\r\n idRef.current = contextId;\r\n planRef.current = plan;\r\n mobileRef.current = isMobilePortraitView;\r\n themeModeRef.current = theme.palette.mode;\r\n \r\n useEffect(() => {\r\n startRenderer(injectRenderer);\r\n }, [startRenderer]);\r\n\r\n useEffect(() => {\r\n if (appRef.current !== null && contextId !== null && collection !== null && collection.contextId === contextId) {\r\n\r\n setLoading(true);\r\n const tree = new TreeRenderer(contextId, isEmbed, appRef.current, viewportRef.current, collection, themeModeRef.current);\r\n if (!!nodeIdRef.current && !tree.nodeEventHandler.activeNodeId) {\r\n tree.nodeEventHandler.activeNodeId = nodeIdRef.current;\r\n }\r\n treeRef.current = tree;\r\n\r\n tree\r\n .on(\"onNodeFocused\", node => {\r\n dispatch(TreeActions.NodeFocused(node.getNodeData(), history, tree.contextId, mobileRef.current));\r\n })\r\n .on(\"onNodeEdit\", node => {\r\n if (canEdit && !isEmbed) {\r\n history.push(`${getRootUrl()}/node/${node.id}`);\r\n dispatch(AppActions.SetContextCard(2));\r\n setTimeout(() => {\r\n const input = document.getElementById(\"edit-topic-name\");\r\n if (input) {\r\n input.focus();\r\n const len = input.value.length;\r\n input.setSelectionRange(len, len);\r\n }\r\n }, 150);\r\n }\r\n })\r\n .on(\"onRootFocused\", node => {\r\n history.push(canEdit && !mobileRef.current ? `${getRootUrl()}/edit` : getRootUrl());\r\n })\r\n .on(\"onResourceCreateRequested\", (parentId, url) => {\r\n collection.getHandler(\"Resource\").createEntity({ url, incomplete: true }, { parentId })\r\n })\r\n .on(\"onFileUploadRequested\", async (parentId, dataTransfer) => {\r\n\r\n const files = [...dataTransfer.items].filter(t => t.kind === \"file\").map(t => t.getAsFile()).reverse();\r\n const fileSizes = files.reduce((sum, file) => sum + file.size, 0);\r\n\r\n if (await planRef.current.checkIfUploadAllowed(fileSizes)) {\r\n\r\n const handler = collection.getHandler(\"Resource\");\r\n\r\n for (let i = 0; i < files.length; i++) {\r\n let file = files[i];\r\n\r\n if (file.size > 0) {\r\n await handler.createEntity({\r\n name: file.name,\r\n fileSize: file.size,\r\n fileType: file.type,\r\n pending: true\r\n }, { parentId, file });\r\n } else {\r\n await handler.createEntity({\r\n name: file.name,\r\n url: null,\r\n type: \"note\"\r\n }, { parentId });\r\n }\r\n\r\n if (files.length > 5) {\r\n await Task.Delay(50);\r\n }\r\n }\r\n }\r\n })\r\n .on(\"onLoad\", (tree, skipAnimations) => {\r\n dispatch(TreeActions.HandleLoad(tree, skipAnimations));\r\n setLoading(false);\r\n })\r\n .on(\"onMounted\", ev => {\r\n dispatch(TreeActions.RegisterView(ev));\r\n });\r\n\r\n\r\n const onDragEnter = (ev) => {\r\n try {\r\n if (!ev.dataTransfer?.types?.includes(\"editor/sort\")) {\r\n dispatch(AppActions.SetDragActive(true));\r\n tree.setDragOverActive(true);\r\n }\r\n } catch (err) {\r\n console.log(err);\r\n dispatch(AppActions.SetDragActive(true));\r\n tree.setDragOverActive(true);\r\n }\r\n };\r\n\r\n const onDragLeave = () => {\r\n dispatch(AppActions.SetDragActive(false));\r\n tree.setDragOverActive(false);\r\n };\r\n\r\n const onDragOver = (ev) => {\r\n ev.preventDefault();\r\n tree.onDragOver(ev.clientX, ev.clientY);\r\n };\r\n\r\n const onDrop = (ev) => {\r\n ev.preventDefault();\r\n tree.nodeEventHandler.onResourceDrop(ev);\r\n tree.setDragOverActive(false);\r\n dispatch(AppActions.SetDragActive(false));\r\n };\r\n\r\n // Mount event listeners to container\r\n const onSetDirty = () => tree.setTickDirty();\r\n const onContextLost = () => tree.setContextLost();\r\n\r\n const container = containerRef.current;\r\n const eventEmitter = eventEmitterRef.current;\r\n\r\n if (canEdit) {\r\n container.addEventListener(\"dragenter\", onDragEnter);\r\n container.addEventListener(\"dragend\", onDragEnter);\r\n container.addEventListener(\"dragleave\", onDragLeave);\r\n container.addEventListener(\"dragover\", onDragOver);\r\n container.addEventListener(\"drop\", onDrop);\r\n }\r\n\r\n eventEmitter.on(\"dirty\", onSetDirty);\r\n eventEmitter.on(\"contextlost\", onContextLost);\r\n\r\n // Keyboard shortcuts\r\n const keyboardShortcuts = new TreeKeyboardShortcuts(tree, history, dispatch);\r\n keyboardShortcuts.start();\r\n\r\n container.style.zIndex = 1;\r\n const preventDefault = ev => ev.preventDefault();\r\n\r\n if (!isEmbed) { // prevent swipe navigation when map is active\r\n document.body.style.overscrollBehaviorX = \"none\";\r\n document.documentElement.style.overscrollBehaviorX = \"none\";\r\n container.addEventListener(\"mousewheel\", preventDefault);\r\n }\r\n\r\n return () => {\r\n if (!!container) {\r\n container.style.zIndex = -1;\r\n\r\n if (canEdit) {\r\n container.removeEventListener(\"dragenter\", onDragEnter);\r\n container.removeEventListener(\"dragend\", onDragEnter);\r\n container.removeEventListener(\"dragleave\", onDragLeave);\r\n container.removeEventListener(\"dragover\", onDragOver);\r\n container.removeEventListener(\"drop\", onDrop);\r\n }\r\n\r\n if (!isEmbed) {\r\n document.body.style.overscrollBehaviorX = \"auto\";\r\n document.documentElement.style.overscrollBehaviorX = \"auto\";\r\n container.removeEventListener(\"mousewheel\", preventDefault);\r\n }\r\n }\r\n\r\n if (!!eventEmitter) {\r\n eventEmitter.off(\"dirty\", onSetDirty);\r\n eventEmitter.off(\"contextlost\", onContextLost);\r\n }\r\n\r\n if (!!tree) {\r\n keyboardShortcuts.destroy();\r\n tree.close(contextId !== idRef.current);\r\n setShowLoadingScreen(contextId === idRef.current)\r\n }\r\n\r\n if (contextId === idRef.current) {\r\n dispatch(TreeActions.SetActiveNodeId(null));\r\n }\r\n\r\n treeRef.current = null;\r\n }\r\n }\r\n }, [eventEmitterRef, containerRef, appRef, viewportRef, contextId, canEdit, treeRef, isEmbed, dispatch, history, collection]); // TODO consider doing canEdit change outside of here, so map does not blink.\r\n\r\n useEffect(() => {\r\n if (!!treeRef.current) {\r\n if (!!avatarUrl) {\r\n treeRef.current.updateAvatarUrl(avatarUrl);\r\n }\r\n }\r\n }, [avatarUrl]);\r\n\r\n useEffect(() => {\r\n if (!!treeRef.current && treeRef.current.themeMode !== theme.palette.mode) {\r\n treeRef.current.setThemeMode(theme.palette.mode, theme.palette.common.canvasHex);\r\n }\r\n },[theme]);\r\n\r\n\r\n return { containerRef, loading, showLoadingScreen };\r\n}","import { useCallback, useEffect, useState } from \"react\";\r\nimport { Grid, Typography, DialogActions, Button, DialogTitle, DialogContent, Chip, Skeleton } from \"@mui/material\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport TagSelector from \"../../atoms/inputs/TagSelector\";\r\nimport { getRootUrl } from \"../../../hooks/useApp\";\r\nimport CardHeader from \"../../atoms/CardHeader\";\r\nimport { useCollection, useRTACPlan } from \"@emberly/dataplane\";\r\nimport { useDevice } from \"../../../providers/DeviceContext\";\r\nimport { useHistory } from \"react-router\";\r\nimport { fetchSuggestedTopics } from \"../../../common/common\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n content: {\r\n height: \"auto\",\r\n minHeight: \"128px\",\r\n overflow: \"visible\"\r\n },\r\n header: {\r\n marginBottom: theme.spacing(2)\r\n },\r\n chip: {\r\n marginRight: \"4px\",\r\n marginBottom: \"4px\",\r\n maxWidth: \"90%\"\r\n },\r\n suggestionContainer: {\r\n minHeight: \"72px\"\r\n },\r\n suggestionHeader: {\r\n marginTop: theme.spacing(2),\r\n marginBottom: theme.spacing(1.5)\r\n },\r\n suggestionSkeleton: { \r\n marginRight: \"4px\",\r\n marginBottom: \"4px\",\r\n borderRadius: \"16px\",\r\n width: \"200px\",\r\n maxWidth: \"80%\"\r\n }\r\n}));\r\n\r\nexport default function NodeCreatePanel(props) {\r\n const { collection } = useCollection(\"Node\");\r\n const { onCancel, onConfirm, nodeId, sidePreference, limit, plan } = props;\r\n const { isMobilePortraitView } = useDevice();\r\n const [creatingNode, setCreatingNode] = useState(\"\");\r\n const [creatingNodes, setCreatingNodes] = useState([]);\r\n const [suggestedNodes, setSuggestedNodes] = useState([]);\r\n const [loadingSuggestions, setLoadingSuggestions] = useState(false);\r\n const history = useHistory();\r\n const classes = useStyles();\r\n const hasLimit = limit !== null && limit !== undefined;\r\n const nodesLeft = hasLimit ? limit - creatingNodes.length : 0;\r\n const limitReached = hasLimit && nodesLeft <= 0;\r\n const { plan: defaultPlan } = useRTACPlan(\"default\");\r\n\r\n\r\n const createNodes = useCallback(async () => {\r\n\r\n if (creatingNode.trim().length !== 0 && !limitReached) {\r\n creatingNodes.push(creatingNode.trim());\r\n }\r\n\r\n const side = typeof sidePreference === \"number\" && (sidePreference === 0 || sidePreference === 1 || sidePreference === -1) ? sidePreference : 0;\r\n\r\n for (let i = 0; i < creatingNodes.length; i++) {\r\n const entityId = collection.createEntityId();\r\n await collection.createEntity({ \"id\": entityId, \"name\": creatingNodes[i], \"parentId\": nodeId, \"rating\": 0, \"state\": 0, \"side\": side });\r\n\r\n if (i === creatingNodes.length - 1) {\r\n collection.getEntityById(nodeId).setIsCollapsed(false);\r\n if (!!history) {\r\n history.push(`${getRootUrl()}/node/${entityId}`);\r\n }\r\n }\r\n }\r\n\r\n setCreatingNodes([]);\r\n setCreatingNode(\"\");\r\n onConfirm();\r\n\r\n const atLimit = hasLimit && (limit - creatingNodes.length) <= 0;\r\n\r\n if (atLimit && plan.isOwner) {\r\n setTimeout(() => {\r\n plan.showLimitReachedDialog(\r\n \"Well done, your tree is growing big!\",\r\n `You just used up your ${plan.currentTreeTopicLimit} free topics.`,\r\n (\r\n <Grid item container justifyContent=\"center\" alignItems=\"center\" direction=\"column\">\r\n <div style={{\r\n position: \"relative\",\r\n height: 0,\r\n width: \"100%\",\r\n paddingTop: \"calc(236 / 371 * (100%) - 2.5px)\",\r\n overflow: \"hidden\"\r\n }}>\r\n <img style={{\r\n top: 0,\r\n left: 0,\r\n position: \"absolute\",\r\n width: \"100%\",\r\n verticalAlign: \"middle\",\r\n height: \"auto\"\r\n }} src=\"/assets/japanese_tree.png\" alt=\"tree\"></img>\r\n </div>\r\n <Typography variant=\"body1\" component=\"span\">\r\n <p>\r\n It seems your desire to learn is stronger than most.\r\n </p>\r\n <p>\r\n If you want to keep growing your tree, you can upgrade to get unlimited nodes and many other useful features.\r\n </p>\r\n <p>\r\n Emberly’s only source of support is our paid customers. We hope you found Emberly valuable and would be truly grateful for your support. â¤\r\n </p>\r\n </Typography>\r\n </Grid>\r\n )\r\n );\r\n }, 500)\r\n }\r\n\r\n }, [hasLimit, collection, history, creatingNodes, creatingNode, setCreatingNode, setCreatingNodes, nodeId, onConfirm, sidePreference, limit, limitReached, plan]);\r\n\r\n const addNode = useCallback((node, nodeList) => {\r\n if (!!node && node.length !== 0) {\r\n if (!limitReached && nodeList.indexOf(node) === -1) {\r\n setCreatingNodes(nodeList.concat(node));\r\n setCreatingNode(\"\");\r\n }\r\n } else if (!!node || (node === \"\" && nodeList.length !== 0)) {\r\n createNodes();\r\n }\r\n }, [createNodes, setCreatingNode, setCreatingNodes, limitReached]);\r\n\r\n const removeNode = useCallback((node, nodeList) => {\r\n setCreatingNodes(nodeList.filter(n => n !== node));\r\n }, [setCreatingNodes]);\r\n\r\n\r\n useEffect(() => {\r\n if (!!defaultPlan && defaultPlan.type >= 2 && !!nodeId) {\r\n let mounted = true;\r\n setSuggestedNodes([]);\r\n setLoadingSuggestions(true);\r\n\r\n fetchSuggestedTopics(collection, nodeId).then((suggestions) => {\r\n if (mounted) {\r\n setSuggestedNodes(suggestions);\r\n setLoadingSuggestions(false);\r\n }\r\n });\r\n\r\n return () => {\r\n mounted = false;\r\n };\r\n }\r\n }, [defaultPlan, collection, nodeId]);\r\n\r\n return <>\r\n {\r\n isMobilePortraitView ? (\r\n <div className={classes.header}>\r\n <CardHeader\r\n title={limitReached ? \"Limit reached\" : \"Add new topic\"}\r\n onConfirm={createNodes}\r\n onClose={onCancel}\r\n border\r\n />\r\n </div>\r\n ) : (\r\n <DialogTitle>Add new topic {hasLimit && nodesLeft < 10 ? `(${nodesLeft} topics left)` : \"\"}</DialogTitle>\r\n )\r\n }\r\n\r\n <DialogContent className={classes.content}>\r\n\r\n <Grid item>\r\n <TagSelector\r\n label={limitReached ? \"- Limit reached.\" : \"+ Add a topic..\"}\r\n tags={creatingNodes}\r\n onAddTag={addNode}\r\n onRemoveTag={removeNode}\r\n onChange={setCreatingNode}\r\n warning={limitReached}\r\n autoFocus\r\n />\r\n </Grid>\r\n {defaultPlan?.type >= 2 ? (\r\n <>\r\n <Typography variant=\"subtitle1\" className={classes.suggestionHeader}>Suggested Topics</Typography>\r\n <Grid container item className={classes.suggestionContainer} alignItems=\"flex-start\" justifyContent=\"flex-start\">\r\n {loadingSuggestions ? (\r\n <>\r\n <Skeleton className={classes.suggestionSkeleton} height=\"32px\" variant=\"rounded\" />\r\n <Skeleton className={classes.suggestionSkeleton} height=\"32px\" variant=\"rounded\" />\r\n </>\r\n ) : (suggestedNodes.length !== 0 ? suggestedNodes.filter(t => !creatingNodes.includes(t)).map((suggestion, key) => (\r\n <Chip label={suggestion} key={key} className={classes.chip} onClick={() => addNode(suggestion, creatingNodes)} />\r\n )): <Typography variant=\"body2\" color=\"textSecondary\">No suggestions</Typography>)}\r\n </Grid>\r\n </>\r\n ) : null\r\n }\r\n </DialogContent>\r\n\r\n {\r\n !isMobilePortraitView ? (\r\n <DialogActions>\r\n <Button\r\n color=\"neutral\"\r\n variant=\"outlined\"\r\n onClick={onCancel}\r\n >\r\n Cancel\r\n </Button>\r\n <Button\r\n color=\"primary\"\r\n variant=\"contained\"\r\n disabled={creatingNodes.length === 0 && creatingNode.length === 0}\r\n onClick={createNodes}\r\n >\r\n Add topics\r\n </Button>\r\n </DialogActions>\r\n ) : null\r\n }\r\n\r\n </>;\r\n}\r\n\r\n\r\n\r\n","import { useCallback, useMemo, useEffect, useRef } from \"react\";\r\nimport { Dialog, Typography } from \"@mui/material\";\r\nimport { useSelector, useDispatch } from \"react-redux\";\r\nimport NodeCreatePanel from \"../../molecules/panels/NodeCreatePanel\";\r\nimport * as TreeActions from \"../../../actions/tree\";\r\nimport { usePlanWithTreeLimits } from \"../../../hooks/usePlan\";\r\nimport { useDevice } from \"../../../providers/DeviceContext\";\r\nimport { useHistory, useLocation } from \"react-router\";\r\n\r\nexport default function NodeCreateDialog() {\r\n const dispatch = useDispatch();\r\n const handles = useSelector(state => state.tree.createNodeDialogHandles);\r\n const { isMobilePortraitView } = useDevice();\r\n const history = useHistory();\r\n const location = useLocation();\r\n const plan = usePlanWithTreeLimits();\r\n const handleRef = useRef(null);\r\n const active = handles.length !== 0;\r\n const handle = active ? handles[0] : null;\r\n handleRef.current = handle;\r\n\r\n const handleCancel = useCallback(() => {\r\n if (!!handle && !!handle.onCancel) {\r\n handle.onCancel();\r\n }\r\n dispatch(TreeActions.CreateNodeDialogCancel());\r\n }, [handle, dispatch]);\r\n\r\n const handleConfirm = useCallback(() => {\r\n if (!!handle && !!handle.onConfirm) {\r\n handle.onConfirm();\r\n }\r\n dispatch(TreeActions.CreateNodeDialogConfirm());\r\n }, [handle, dispatch])\r\n\r\n useEffect(() => {\r\n if (plan !== null && plan.currentTreeTopicLimit !== null && plan.currentTreeTopics >= plan.currentTreeTopicLimit && active) {\r\n handleCancel();\r\n plan.showLimitReachedDialog(\r\n \"Free limit reached\",\r\n plan.isOwner ? (\r\n <>\r\n You have created {plan.currentTreeTopics} out of {plan.currentTreeTopicLimit} topics in this map. Please upgrade to make more topics. Or, you can delete topics to make room for new ones.\r\n <br/><br/>\r\n <Typography variant=\"caption\" color=\"textSecondary\">\r\n Check out the <a href=\"https://blog.ember.ly/billing-faq/\" target=\"_blank\" rel=\"noopener noreferrer\" style={{ color: \"#1A9AD1\" }}>help section</a> for more information.\r\n </Typography>\r\n </>\r\n ) : (\r\n <>\r\n You have created {plan.currentTreeTopics} out of {plan.currentTreeTopicLimit} topics in this map. Tell the owner to upgrade to make more topics. Or, you can delete topics to make room for new ones.\r\n <br/><br/>\r\n <Typography variant=\"caption\" color=\"textSecondary\">\r\n Check out the <a href=\"https://blog.ember.ly/billing-faq/\" target=\"_blank\" rel=\"noopener noreferrer\" style={{ color: \"#1A9AD1\" }}>help section</a> for more information.\r\n </Typography>\r\n </>\r\n )\r\n );\r\n }\r\n }, [active, dispatch, plan, handleCancel, history]);\r\n\r\n \r\n useEffect(() => {\r\n if (handleRef.current !== null) {\r\n const included = location.pathname.includes(`/node/${handleRef.current.nodeId}`);\r\n if (!included) {\r\n if (!!handleRef.current.onCancel) {\r\n handleRef.current.onCancel();\r\n }\r\n dispatch(TreeActions.CreateNodeDialogCancel());\r\n }\r\n }\r\n }, [handleRef, location.pathname, dispatch]);\r\n\r\n return useMemo(() => (\r\n <Dialog\r\n open={active}\r\n onClose={handleCancel}\r\n aria-labelledby=\"alert-dialog-title\"\r\n aria-describedby=\"alert-dialog-description\"\r\n fullWidth\r\n maxWidth=\"sm\"\r\n fullScreen={isMobilePortraitView}\r\n >\r\n <NodeCreatePanel plan={plan} limit={plan ? (plan.currentTreeTopicLimit === null ? null : plan.currentTreeTopicLimit - plan.currentTreeTopics) : 0} onConfirm={handleConfirm} onCancel={handleCancel} nodeId={handle?.nodeId} sidePreference={handle?.sidePreference} />\r\n </Dialog>\r\n ), [handleCancel, handleConfirm, active, isMobilePortraitView, handle, plan]);\r\n}","import { useCallback, useEffect, useState, useRef } from \"react\";\r\nimport { useDispatch, useSelector } from \"react-redux\";\r\nimport Joyride, { ACTIONS, EVENTS, STATUS } from \"react-joyride\";\r\nimport { useCanEdit } from \"@emberly/dataplane\";\r\nimport { useDevice } from \"../../../providers/DeviceContext\";\r\nimport { useHistory } from \"react-router\";\r\n\r\nconst styles = {\r\n options: {\r\n arrowColor: \"#fff\",\r\n backgroundColor: \"#fff\",\r\n primaryColor: \"#1A9AD1\",\r\n textColor: \"#1F1F1F\",\r\n }\r\n};\r\n\r\nconst locale = { back: \"Back\", close: \"Close\", last: \"Finish\", next: \"Next\", skip: \"Skip tour\" };\r\n\r\nexport default function Tour(props) {\r\n const { steps, run, onEnd, setStepIndex, stepIndex } = props;\r\n const { isMobilePortraitView } = useDevice();\r\n const { contextCardState, nodeViewTabIndex } = useSelector(state => state.app);\r\n const dispatch = useDispatch();\r\n // eslint-disable-next-line no-unused-vars\r\n const [ticker, setTicker] = useState(0);\r\n const canFit = window.innerHeight > 500\r\n const ready = useCanEdit() && run && canFit;\r\n const [active, setActive] = useState(false);\r\n const ref = useRef(null);\r\n const timerRef = useRef(null);\r\n const visibleRef = useRef(false);\r\n const visibilityTimeoutRef = useRef(null);\r\n const visibilityDelayRef = useRef(null);\r\n const history = useHistory();\r\n const fnRef = useRef(null);\r\n\r\n useEffect(() => {\r\n if (ready) {\r\n const timer = setTimeout(() => setActive(true), 1000);\r\n return () => {\r\n clearTimeout(timer);\r\n clearTimeout(timerRef.current);\r\n clearTimeout(visibilityTimeoutRef.current);\r\n clearTimeout(visibilityDelayRef.current);\r\n }\r\n }\r\n }, [ready, setActive]);\r\n\r\n const onVisibilityChange = useCallback(() => {\r\n if (!!ref.current) {\r\n\r\n const overlayElements = document.getElementsByClassName(\"react-joyride__overlay\");\r\n\r\n if (overlayElements.length !== 0) {\r\n const overlay = overlayElements[0];\r\n overlay.style.visibility = visibleRef.current ? \"visible\" : \"hidden\";\r\n overlay.style.opacity = visibleRef.current ? 1 : 0;\r\n }\r\n\r\n const popperElements = document.getElementsByClassName(\"__floater\");\r\n\r\n if (popperElements.length !== 0) {\r\n const popper = popperElements[0];\r\n popper.style.visibility = visibleRef.current ? \"visible\" : \"hidden\";\r\n popper.style.opacity = visibleRef.current ? 1 : 0;\r\n }\r\n\r\n if (!!ref.current && ref.current.tooltipPopper && ref.current.tooltipPopper.instance) {\r\n ref.current.tooltipPopper.instance.update()\r\n setTicker(t => t + 1);\r\n }\r\n\r\n }\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [ref, stepIndex, setTicker, visibleRef]);\r\n\r\n const onUpdate = useCallback(() => {\r\n clearTimeout(timerRef.current);\r\n\r\n const fn = () => {\r\n if (!!ref.current && ref.current.tooltipPopper && ref.current.tooltipPopper.instance) {\r\n ref.current.tooltipPopper.instance.update()\r\n setTicker(t => t + 1);\r\n }\r\n };\r\n\r\n if (isMobilePortraitView) {\r\n timerRef.current = setTimeout(fn, 500);\r\n }\r\n\r\n clearTimeout(visibilityDelayRef.current);\r\n visibilityDelayRef.current = setTimeout(onVisibilityChange, 1000);\r\n onVisibilityChange();\r\n\r\n fn();\r\n }, [timerRef, ref, isMobilePortraitView, onVisibilityChange]);\r\n\r\n const joyrideCallback = useCallback((data) => {\r\n const { action, status, type } = data;\r\n\r\n\r\n if (action === \"next\" || action === \"start\" || action === \"close\") {\r\n if (fnRef.current !== null) {\r\n fnRef.current.target.removeEventListener(\"click\", fnRef.current.fn);\r\n fnRef.current = null;\r\n }\r\n\r\n const classname = (data.step.target || \".\").substr(1);\r\n const targets = document.getElementsByClassName(classname);\r\n\r\n if (!!targets && targets.length !== 0) {\r\n const target = targets[0];\r\n const fn = () => {\r\n try {\r\n ref.current.helpers.next();\r\n } catch { }\r\n };\r\n target.addEventListener(\"click\", fn);\r\n fnRef.current = { target, fn };\r\n }\r\n }\r\n\r\n\r\n //console.log(data, EVENTS);\r\n if (type === EVENTS.STEP_AFTER) {\r\n setStepIndex((index) => index + (action === ACTIONS.PREV ? -1 : 1));\r\n } else if ([STATUS.FINISHED, STATUS.SKIPPED].includes(status)) {\r\n onEnd();\r\n }\r\n\r\n onUpdate();\r\n\r\n }, [setStepIndex, ref, fnRef, onEnd, onUpdate]);\r\n\r\n\r\n useEffect(() => {\r\n if (ready) {\r\n if (stepIndex >= 0 && stepIndex < steps.length && steps[stepIndex].onStep) {\r\n steps[stepIndex].onStep(history, dispatch);\r\n }\r\n onUpdate();\r\n }\r\n }, [stepIndex, ready, history, steps, onUpdate, dispatch]);\r\n\r\n useEffect(() => { // TODO turn this all into a framework, only having to pass in steps, which includes functions for this crap.\r\n let v = stepIndex >= 0 && stepIndex < steps.length && steps[stepIndex].isVisible ? steps[stepIndex].isVisible(isMobilePortraitView, contextCardState, nodeViewTabIndex) : true;\r\n\r\n if (v) {\r\n visibilityTimeoutRef.current = setTimeout(() => {\r\n visibleRef.current = true;\r\n onVisibilityChange();\r\n }, 1500);\r\n\r\n return () => clearTimeout(visibilityTimeoutRef.current);\r\n } else {\r\n visibleRef.current = false;\r\n onVisibilityChange();\r\n }\r\n\r\n }, [active, contextCardState, stepIndex, isMobilePortraitView, nodeViewTabIndex, steps, visibilityTimeoutRef, onVisibilityChange]);\r\n\r\n return (\r\n canFit ?\r\n <Joyride\r\n ref={ref}\r\n callback={joyrideCallback}\r\n stepIndex={stepIndex}\r\n run={active}\r\n steps={steps}\r\n styles={styles}\r\n locale={locale}\r\n disableScrollParentFix\r\n continuous\r\n spotlightClicks\r\n hideBackButton\r\n disableScrolling\r\n /> : null\r\n );\r\n}\r\n","import { useCallback } from \"react\";\r\nimport { useDispatch, useSelector } from \"react-redux\";\r\nimport { SetAppTour, SetAppTourIndex, SetNodeViewTabIndex } from \"../../../actions/app\";\r\nimport { getRootUrl } from \"../../../hooks/useApp\";\r\nimport Tour from \"./Tour\";\r\n\r\nconst steps = [\r\n {\r\n target: \".new-child\",\r\n title: \"Add topics to tree\",\r\n content: \"Click here to add a child to the currently selected topic. Tip: You can also press [Enter]\",\r\n disableBeacon: true,\r\n isFixed: false,\r\n hideCloseButton: true,\r\n scrollToFirstStep: false,\r\n hideFooter: true,\r\n disableScrolling: true,\r\n onStep: (history) => {\r\n history.push(getRootUrl());\r\n }\r\n },\r\n {\r\n target: \".new-resource\",\r\n title: \"Adding a resource\",\r\n content: \"This is where you add your resources, such as bookmarks and files. Tip: On desktop, you can also add by drag and drop — or by Chrome extension.\",\r\n disableBeacon: true,\r\n hideCloseButton: true,\r\n isFixed: true,\r\n showSkipButton: true,\r\n onStep: (history, dispatch) => {\r\n dispatch(SetNodeViewTabIndex(0));\r\n },\r\n isVisible: (isMobilePortraitView, contextCardState, nodeViewTabIndex) => (isMobilePortraitView ? contextCardState === 3 : contextCardState !== 0) && nodeViewTabIndex === 0\r\n },\r\n {\r\n target: \".inbox-controller\",\r\n title: \"The Inbox\",\r\n content: (\r\n <>\r\n Here you can store resources that you havent given a home yet. Great for storing resources you come across right away, and then worry about organizing later. \r\n <p>\r\n Tip: This list is shared among all your maps. You can even access it from the dashboard. \r\n </p>\r\n </>\r\n ),\r\n disableBeacon: true,\r\n hideCloseButton: true,\r\n isFixed: true,\r\n showSkipButton: true,\r\n onStep: (history, dispatch) => {\r\n dispatch(SetNodeViewTabIndex(0));\r\n },\r\n isVisible: (isMobilePortraitView, contextCardState, nodeViewTabIndex) => contextCardState !== 3\r\n },\r\n {\r\n target: \".share-controller\",\r\n title: \"Share map\",\r\n content: (\r\n <>\r\n Here you can invite collaborators to join your map.\r\n <p>\r\n Tip: You can also make your map public so everyone can see, but not edit. \r\n </p>\r\n </>\r\n ),\r\n disableBeacon: true,\r\n hideCloseButton: true,\r\n isFixed: true,\r\n showSkipButton: true,\r\n onStep: (history, dispatch) => {\r\n dispatch(SetNodeViewTabIndex(0));\r\n },\r\n isVisible: (isMobilePortraitView, contextCardState, nodeViewTabIndex) => contextCardState !== 3\r\n }\r\n];\r\n\r\nexport default function AppTour() {\r\n const dispatch = useDispatch();\r\n const { appTour, appTourIndex } = useSelector(state => state.app);\r\n const onEnd = useCallback(() => dispatch(SetAppTour(false)), [dispatch]);\r\n const onSetIndex = useCallback(v => dispatch(SetAppTourIndex(typeof v === \"number\" ? v : v(appTourIndex))), [dispatch, appTourIndex]);\r\n\r\n return appTour ? (\r\n <Tour\r\n steps={steps}\r\n onEnd={onEnd}\r\n stepIndex={appTourIndex}\r\n setStepIndex={onSetIndex}\r\n run\r\n />\r\n ) : null;\r\n}\r\n","import { useEffect } from \"react\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport MapCard from \"./MapCard\";\r\nimport UniversalConfirmDialog from \"../../organisms/dialogs/UniversalConfirmDialog\";\r\nimport OnboardingPage from \"../../organisms/onboarding/OnboardingPage\";\r\nimport { ConditionalPortalView } from \"../../atoms/views/ConditionalPortalView\";\r\nimport NodeCreateDialog from \"../../organisms/dialogs/NodeCreateDialog\";\r\nimport AppTour from \"../../organisms/onboarding/AppTour\";\r\nimport ResourceDragContext from \"../../../providers/ResourceDragContext\";\r\nimport { GroupContextProvider, useEntity, useCanEdit, useRTACProfile } from \"@emberly/dataplane\";\r\nimport { Helmet } from \"react-helmet\";\r\nimport { DeviceProvider } from \"../../../providers/DeviceContext\";\r\nimport { setBootPath } from \"../../../common/BootHandler\";\r\nimport { setAffiliateId } from \"../../../common/AffiliateHandler\";\r\nimport { useRouteMatch } from \"react-router\";\r\nimport TrackGoal from \"../../../common/AnalyticsHandler\";\r\n\r\nconst useStyles = makeStyles({\r\n root: {\r\n position: \"absolute\",\r\n top: 0,\r\n left: 0,\r\n width: \"100%\",\r\n height: \"100%\",\r\n overflow: \"hidden\"\r\n }\r\n});\r\n\r\nexport default function MapView() {\r\n const classes = useStyles();\r\n const match = useRouteMatch();\r\n const { userId, mapId } = match.params;\r\n const { entity } = useEntity(\"Map\", mapId, true, \"default\");\r\n const { profile } = useRTACProfile();\r\n\r\n const openLastVisited = profile?.openLastVisited || false;\r\n\r\n useEffect(() => {\r\n if (!!entity && entity.access > 0) {\r\n entity.setLastOpened(new Date());\r\n TrackGoal(\"WNOWNFLJ\");\r\n }\r\n }, [entity]);\r\n\r\n useEffect(() => {\r\n if (!!entity && entity.access > 0) {\r\n setBootPath(`/map/${entity.groupName}`);\r\n }\r\n\r\n if (!profile) {\r\n setAffiliateId(userId);\r\n }\r\n }, [entity, openLastVisited, userId, profile])\r\n\r\n return (\r\n <div className={classes.root}>\r\n {\r\n entity ? (\r\n <Helmet>\r\n <title>Emberly - {entity.name}</title>\r\n <meta property=\"og:image\" content={entity.isPublic && entity.hasPreview ? entity.preview : \"https://ember.ly/assets/link_preview.png\"}></meta>\r\n </Helmet>\r\n ) : null\r\n }\r\n <GroupContextProvider userId={userId} contextId={mapId}>\r\n <DeviceProvider>\r\n <ResourceDragContext>\r\n {!!profile && !profile.onboarded ? <OnboardingPage /> : null}\r\n <MapCard userId={userId} mapId={mapId} />\r\n <ConditionalPortalView portalId=\"mapview\" />\r\n <UniversalConfirmDialog />\r\n <EditDialogs />\r\n </ResourceDragContext>\r\n </DeviceProvider>\r\n </GroupContextProvider>\r\n </div >\r\n );\r\n}\r\n\r\nfunction EditDialogs() {\r\n const canEdit = useCanEdit();\r\n\r\n return canEdit ? (\r\n <>\r\n <NodeCreateDialog />\r\n <AppTour />\r\n </>\r\n ) : null;\r\n}\r\n"],"names":["templates","NodeNotesPanel","props","onFocused","active","nodeId","onMounted","notesFullscreen","useSelector","state","app","isMobilePortrait","isEmbed","isIos","isMobile","useDevice","contextId","useContextId","entity","node","useEntity","history","useHistory","location","useLocation","dispatch","useDispatch","useEffect","search","indexOf","SetNotesFullscreen","onFullscreen","useCallback","replace","pathname","removeParameter","push","onViewBacklinks","SetInboundLinksPanel","plugins","useMemo","reference","class","Reference","config","shortcut","_jsx","CompactNotesEditor","placeholder","noteId","title","name","readonly","swipeEnabled","fullscreen","undefined","isMobilePortraitView","backlinks","useStyles","makeStyles","theme","button","borderRadius","spacing","padding","height","paddingTop","paddingBottom","color","palette","text","secondary","border","divider","marginRight","marginLeft","chevron","fontSize","anchorOrigin","vertical","horizontal","transformOrigin","paperProps","style","marginTop","StandardEditPopover","classes","id","componentClassName","disabled","anchorEl","setAnchorEl","useState","onPanelClick","ev","currentTarget","onPanelClose","panelOpen","panelId","_jsxs","_Fragment","children","Button","className","endIcon","ExpandLessIcon","ExpandMoreIcon","onClick","component","Popover","open","onClose","PaperProps","VecMath","Distance2F","x0","y0","x1","y1","dx","dy","ColorToSigned24Bit","s","length","substr","split","map","t","join","parseInt","Signed24BitToColor","n","c","toString","toUpperCase","substring","root","width","marginBottom","zIndex","filter","common","saturateFilter","customColorButton","grey","boxShadow","customColorButtonSelected","shadows","customColorButtonIcon","margin","gridItem","textAlign","menu","overflow","outline","list","hexTextDesktop","colorPickerRoot","position","colorPickerRootMobile","colorPickerItem","hexColorPickerItem","hexPicker","hexInput","typography","body1","paddingLeft","borderColor","primary","main","hexText","teaserImage","collapse","followParentContainer","followParentSubHeader","maxWidth","switch","colors","colorsSet","Set","ColorSelect","value","onChange","onUnsetColor","allowUnset","currentColor","customSelected","has","customOpen","setCustomOpen","canUseCustomColors","showLimitReachedDialog","isOwner","usePlan","onCustomValueChange","currentColorOrDefault","Grid","container","alignItems","justifyContent","item","index","ColorSelectButton","selected","IconButton","onCustomClick","src","alt","size","AddIcon","ColorPickerMobile","onCustomClose","ColorPickerDesktop","xs","direction","Divider","Typography","variant","StandardToggle","checked","useTheme","background","ButtonBase","setColor","onConfirm","Dialog","fullWidth","fullScreen","Scrollbar","CardHeader","HexColorPicker","HexColorInput","timer","setTimeout","fn","clearTimeout","Collapse","in","useTreeActions","collection","useCollection","dragEnabled","activeNodeId","loadedContextId","tree","dragEnabledRef","useRef","current","updateCount","setUpdateCount","onUpdated","onGlobalEvent","offGlobalEvent","beginCreateNode","sidePreference","arguments","TreeActions","beginCreateSibling","getEntityById","isRoot","parentId","side","beginCreateChild","beginCreateCategoryNode","doCollapse","setIsCollapsed","isCollapsed","setShowHasNotes","visible","setHasNotes","setShowHasResources","setHasResources","deleteNode","getNodeById","parent","closestSibling","findClosestCallback","x","y","depth","getRootUrl","getNodeData","deleteBranch","historyGroup","e","_n$synapse","synapse","detached","AppActions","actionText","action","manager","undo","setDragEnabled","enabled","_collection$root","getChildren","isFullTree","isEmpty","activeNode","hasNode","activeNodeIsRoot","canCreateSibling","canCollapse","canCreateChild","showHasNotes","showHasResources","useActiveNode","allowPan","hash","includes","_","transition","willChange","SmoothCollapse","ref","inRef","element","sectionHeight","scrollHeight","listener","removeEventListener","addEventListener","expandSection","elementTransition","requestAnimationFrame","collapseSection","content","minWidth","contentMobile","select","header","confirmItem","DuplicatePanel","targetContextId","setTargetContextId","entities","useEverything","filteredMaps","access","sort","a","b","lastOpened","currentMap","find","isPortrait","canCreateMaps","usePlanWithMapLimits","working","setWorking","setChecked","includeRatings","includeNotes","includeResources","includeResourceRatings","includeResourceTags","onChecked","target","async","duplicateBranch","duplicateMap","pushWithoutParams","publicUserId","err","console","log","canDuplicate","DialogTitle","DialogContent","FormControl","Select","MenuItem","idx","sx","pl","FormGroup","FormControlLabel","control","Checkbox","label","CircularProgress","DialogActions","paper","h5","paddingRight","align","WebkitTextFillColor","swipeHandle","fullScreenHeaderContainer","headerContainer","colorComponent","colorPickerContainer","minHeight","ratingContainer","stateContainer","ratingIcon","rating","heartIcon","heart","flagIcon","removeIcon","stateButtonSelected","dark","stateButton","textComponent","overflowMenuButton","right","top","menuItemWarning","error","inputProps","min","maxLength","preventNewline","_document$activeEleme","key","preventDefault","document","activeElement","blur","NodeHeaderPanel","compactView","notesActive","setNotesActive","contextCardState","canEdit","useCanEdit","isEmbedView","focused","setFocused","editOpen","setEditOpen","duplicateOpen","setDuplicateOpen","handleDuplicateClose","quizOpen","setQuizOpen","handleQuizClose","onMenu","headerActive","onExpandMore","menuItems","icon","EditIcon","FileCopyIcon","AutoAwesomeIcon","DeleteForeverIcon","LargeHeaderPanel","hasSwipeHandle","QuizPanel","nodeName","setNodeName","setName","onNameInput","getLearningState","Boolean","handleClose","menuClasses","isCategory","isCategoryNode","SharedInputBase","resourceId","inputId","onKeyDown","spellCheck","multiline","onFocus","onBlur","MoreVertIcon","rgbColor","backgroundColor","hexColor","unsetColor","Array","i","RatingIcon","Rating","setRating","max","emptyIcon","StateText","StateButton","setLearningState","Menu","keepMounted","ListItemIcon","EditOffIcon","ListItemText","FlagIcon","HeartIcon","RemoveIcon","useCard","initialPosition","stateRef","setCardState","previousContextCardState","useDefaultOpenCard","defaultOpen","isDesktopView","NewSiblingIcon","SvgIcon","d","stroke","iconColor","strokeWidth","fill","cx","cy","r","NewChildIcon","actionButtonContainer","display","actionButton","buttonRoot","flexDirection","caption","buttonStartIcon","ActionButton","buttonClasses","startIcon","NodeActionButtons","useTree","bottom","left","transform","inverseShadows","ActionButtonCard","Paper","elevation","findScrollable","parentNode","SwipableCardProvider","disabledRef","positionsRef","elementsRef","cardApproachingFullscreen","view","isOnTop","isOnBottom","handleTarget","force","scrollTop","clientHeight","SetCanSwipeOnContent","handleScroll","cancelable","forEach","handleTouchStart","handleTouchMove","getElementsByClassName","scroll","passive","SetCardSwipeActive","overflowY","Math","grid","contentContainer","touchAction","contentItem","tabCollapse","tabs","borderBottom","tab","whiteSpace","textOverflow","tabIndicator","contentCard","borderBottomLeftRadius","borderBottomRightRadius","fadeDuration","enter","exit","resourceAccumulator","count","resource","archived","NodeView","match","useRouteMatch","params","useWindowSize","nodeViewTabIndex","inboundLinksPanelOpen","selectHandles","tabsActive","setTabsActive","mounted","setMounted","tabActions","resources","loading","useChildren","notesExpanded","showController","showActionButtons","onTabClick","val","SetNodeViewTabIndex","updateIndicator","resourceCount","reduce","Tabs","indicatorColor","TabIndicatorProps","indicator","textColor","Tab","Fade","timeout","ControlledResourcesList","controllerEnabled","InboundLinksDialog","ConditionalPortal","portalId","userSelect","SearchView","isSearch","endsWith","onCancel","plan","useRTACPlan","SearchPanel","includeTopics","includeNoteBlocks","type","isGlobal","autofocus","card","borderTopLeftRadius","borderTopRightRadius","updateCard","cover","layout","fs","positionY","touchActive","SetCardApproachingFullscreen","peekHeight","opacity","headerHeight","MobileCard","cardId","maxHeaderHeight","backgroundRef","hasOverlay","Overlay","canSwipeUpOnContent","canSwipeDownOnContent","cardRef","topRef","bottomRef","coverRef","deltaY","offsetY","velocityY","touchActiveTime","internalCardState","internalOnCardStateChange","cardState","onCardStateChange","positions","p","isFullScreen","ReportCardPosition","onTouchStart","nativeEvent","touches","clientY","Date","now","onTouchEnd","result","changedTouches","minDistance","dist","abs","onTouchMove","time","deltaTime","velocity","dY","onTouchMoveCapture","gridContainer","GButton","justify","Children","child","swipeArea","portal","borderRight","softShadowBorder","clipPath","toggleButton","iconButton","neutral","DesktopCard","swipeableSize","cardWidth","deltaX","setDeltaX","setTouchActive","setTouchActiveTime","velocityX","setVelocityX","finalCardWidth","styles","swipeableStyles","onToggleCard","ChevronRightIcon","ChevronLeftIcon","ConditionalPortalView","window","innerWidth","clientX","paperButton","paperContainer","closeButton","EmbedCard","showEmbedDescription","growStyle","activeStyle","widgetActive","isMobileView","iconSize","Zoom","CloseIcon","DynamicCard","MobileOverlay","DesktopOverlay","EmbedOverlay","inputItem","input","lineHeight","letterSpacing","helperText","helperTextError","StandardInputSelect","selectValue","setText","setSelect","onInternalChangeText","onInternalChangeSelect","InputBase","onSubmit","disableUnderline","IconComponent","ExpandIcon","maxHeight","sectionTop","sectionMiddle","sectionBottom","sectionBottomPending","listHeader","float","copyButton","selectContainer","peopleSelector","email","watermarkInfoText","descriptionForToggle","SharePanel","currentContextId","mapLoading","invites","inviteCollection","invitesLoading","profile","useRTACProfile","setAccess","emails","setEmails","shareText","setShareText","accessLevel","useAccessLevel","hasInvalidEmail","setHasInvalidEmail","canDisableWatermarks","isLoading","members","pendingInvites","declined","accepted","activeMembers","canEditMap","canInvite","onCopy","isLink","navigator","share","url","clipboard","writeText","DisplayNotification","baseUrl","origin","Scrollbars","autoHide","hideTracksWhenNotNeeded","autoHeight","autoHeightMax","DelayedLinearProgress","isPublic","setIsPublic","href","LinkIcon","CodeIcon","TextField","duplicateEnabled","setDuplicateEnabled","Link","to","watermarkEnabled","setWatermarkEnabled","onSubmitInvites","trim","toLowerCase","some","test","createEntity","contextName","username","fullName","ownerPublicId","List","subheader","invite","InviteItem","rawEmail","myAccessLevel","member","isAdmin","isSelf","publicId","ListItem","secondaryAction","delete","setMemberAccess","PersonIcon","paperMobile","activeIcon","anchorOriginSlim","ShareController","_entity$members","slimMode","anchorRef","onSharePanelClick","onSharePanelClose","sharePanelOpen","sharePanelId","Tooltip","enterDelay","placement","PublicIcon","PeopleIcon","PersonAddIcon","Portal","onBack","fetchSuggestedTopics","nodeCollection","updatePath","path","topic","rootEntity","useRootTitle","startsWith","mapCollection","context","getCollectionInContext","loadEntity","unloadEntity","fetchMapName","branch","buffer","data","hasChildren","Retry","axios","FetchSuggestedTopics","suggestions","hexToRGB","hex","findVisibleNoteBlocks","querySelectorAll","el","rect","getBoundingClientRect","elemTop","elemBottom","innerHeight","getComputedStyle","visibility","isScrolledIntoView","addListItemsToMap","sanitizeNodeName","_item$items","items","sanitized","bubble","npcChatBubble","wordWrap","bubbleEditMode","break","flexBasis","chip","buttonContainer","AdvisorBubble","_message$schemas","message","groupUrl","isLast","editMode","canUseButtons","triggered","setTriggered","schemas","nodeIds","resourceIds","blocksMemo","hasExecutor","hasList","blocksParsed","JSON","parse","blocks","sourceIds","nodes","useEntities","addToNotes","getCollection","block","references","sync","addListToMap","getNodeByParentId","listBlocks","executeOperations","execute","ReactEditorBlock","allowLinks","summary","Chip","UndoIcon","CheckIcon","QuoteIcon","SetContextCard","ErrorBoundary","React","constructor","super","this","hasError","getDerivedStateFromError","componentDidCatch","errorInfo","render","SchemaExecutor","operations","Entity","makeSummary","idMap","Map","inverseIdMap","noteCollection","firstNodeId","clear","validParentId","parseResourceParentId","remapIds","operation","schema","processNodeUpdate","processNoteUpdate","remapId","remapParentId","get","_deleted","newId","set","fetchValidParent","newColor","validParentExists","setParentId","rootChildren","isValidParent","_this$nodeCollection","_this$nodeCollection$","withHeadings","acc","op","playerBubble","playerChatBubble","playerBubbleEditMode","avatar","iconButtonContainer","iconButtonContainerHidden","PlayerBubble","onDeleteMessage","onEditMessage","onRetryMessage","messageOperations","isWriting","ReplayIcon","DeleteIcon","cancel","CancelScheduleSendIcon","rootMobile","scrollbar","scrollbarMobile","chatContainer","firstBubble","secondBubble","INITIAL_MESSAGE","INITIAL_MESSAGE_BETA","ERROR_BLOCKS","HISTORY_CONTEXT_ID","MOUNTED","AdvisorPanel","HISTORY","panelRef","defaultName","useGroupName","group","useGroup","thinking","setThinking","useGroupUrl","conversation","setConversation","showThinking","setShowThinking","initialThinking","setInitialThinking","setEditMode","useNotesEditor","inputRefs","messageRefs","getContextId","messages","parentElement","offsetHeight","behavior","onEditLastMessage","focus","onDeleteLastMessage","updatedConversation","slice","updatedHistory","_inputRefs$current","cancelled","_inputRefs$current2","_inputRefs$current3","send","visibleBlocks","then","res","buf","onNotification","catch","lastMessage","ChatBubble","isNpc","writing","ChatInput","dataRef","autoFocus","iconButtonRounded","hardIcon","badge","AdvisorController","rounded","showBadge","setShowBadge","groupName","onAdvisorPanelClick","onAdvisorPanelClose","advisorPanelOpen","Badge","overlap","invisible","AdvisorIcon","DynamicPanel","forceDialog","topLeft","topRight","bottomLeft","bottomLeftActive","bottomRight","bottomRightExpanded","bottomPanel","topPanel","editModeItem","checkItem","mode","editButton","editModeTextItem","MobileMapOverlay","redo","historyLength","undoneHistoryLength","useTimeline","rootUrl","useRootUrl","onOpenSearch","onOpenEdit","HomeIcon","InboxController","orientation","flexItem","SearchIcon","TuneIcon","fontWeight","RedoIcon","headerText","ResourceMoveInfoDialog","dragOverActive","cardLimits","glass","PaneController","onCenterView","onZoomIn","onZoomOut","FitScreenIcon","MapIcon","viewBox","createMapButton","menuButton","selectedItemText","footer","borderTop","ContextSwitcherPanel","onCreateNewMap","sortedEntities","ContextSwitcherItem","Fragment","openMap","handleOpen","handleOpenMapInNewTab","handleEdit","handleDelete","AddConfirmDialog","ListItemAvatar","Avatar","getTimeSinceLastEdit","ListItemSecondaryAction","edge","event","iconButtonFavorite","contextButton","contextButtonText","favoriteIcon","favoriteActiveIcon","ContextController","onFavoriteClick","setFavorite","favorite","onContextSwitcherClick","onContextSwitcherClose","contextSwitcherOpen","contextSwitcherId","createMapAnchor","setCreateMapAnchor","onCreateMapPanelClick","onCreateMapPanelClose","StarIcon","StarOutlineIcon","CreateMapPanel","overflowAvatar","tooltipText","white","tooltipRole","overflowGridContainer","colorDot","overflowMemberItem","tooltip","RENDER_COUNT","OnlineStateController","useGroupMembers","renderCount","renderMembers","overflowMembers","tooltipClasses","popper","arrow","m","OverflowMemberItem","avatarUrl","getRole","topRightButtonSlim","topRightOnlineStateController","slimTopRightOnlineStateController","topCenter","helpCenterContainer","iconButtonActive","canvasButtonActive","dividerVertical","dividerHorizontal","DesktopMapOverlay","semiSlimMode","editActive","searchActive","topRightStyle","toolbarWidth","centerStyle","bottomRightStyle","HelpCenterController","MapNotesPanel","scrollAreaDisabled","fullscreenDisabled","desktopRoot","mobileRoot","gridItemEditor","inputHidden","formHidden","editorContainer","uploadIcon","uploadText","slider","clearButton","rotateButton","useButton","removeButton","cropSize","ImageSelect","file","setFile","zoom","setZoom","minZoom","setMinZoom","rotation","setRotation","crop","setCrop","croppedAreaPixels","setCroppedAreaPixels","onCropComplete","croppedArea","onMediaLoaded","mediaSize","naturalWidth","naturalHeight","files","f","URL","createObjectURL","handleClear","onZoom","onRotate","handleConfirm","imageData","ImageUtility","flexWrap","RotateIcon","Cropper","image","showGrid","cropShape","onCropChange","onZoomChange","maxZoom","Slider","step","accept","multiple","CloudUploadIcon","Accordion","withStyles","borderLeft","expanded","MuiAccordion","AccordionSummary","MuiAccordionSummary","AccordionDetails","MuiAccordionDetails","accordionItem","accordionRoot","progress","mapNameTextField","centerTextField","topButton","deleteButton","uploadButton","commentContainer","overflowX","layoutButtonGrid","layoutButton","flexGrow","canvas","softOutlines","layoutButtonSelected","layoutButtonCaption","softIcon","table","tableCellHeader","tableCellBody","textDecoration","textFieldProps","MapSettingsView","mapId","rootNode","nodeUpdateCount","useEntityFirstOrDefault","currentTreeTopics","currentTreeTopicLimit","usePlanWithTreeLimits","lastModifiedByProfile","useRTACProfileById","lastModifiedBy","userId","ownerProfile","centerText","setCenterText","deleteDialogOpen","setDeleteDialogOpen","duplicateDialogOpen","setDuplicateDialogOpen","imageDialogOpen","setImageDialogOpen","hasNotes","hasResources","canDisableFullTree","isTreeEmpty","expandedCommentField","useTextAsCenter","hasCustomText","customTextValue","toggleUseCustomText","setCustomImage","setCustomText","onChangeName","onChangeCenterText","onDuplicateInit","onDuplicateCancel","onDeleteInit","onDeleteCancel","onDeleteConfirm","toggleFullTree","setFullTree","onOpenImageDialog","onCloseImageDialog","uploadingCenterImage","setUploadingCenterImage","onImageUpload","uploadCenterImage","layoutDisabled","LinearProgress","defaultExpanded","expandIcon","Table","TableBody","TableRow","TableCell","toDateString","created","TextIcon","LoadingButton","loadingPosition","PhotoIcon","NoteIcon","ConfirmDialog","confirmText","confirmColor","cancelText","description","bottomLeftGridEmbed","bottomRightGrid","bottomRightGridEmbed","topLeftGrid","topLeftGridMobile","topRightGrid","logo","translateLeft","translateLeftWidget","hover","mobileLink","isAuthenticated","logout","useRTACAuth","hideTopLeft","onFit","onOpenDescription","onOpenEmberly","onOpenDuplicate","_context$authProvider","setAffiliateId","authProvider","loginWithRedirect","redirect_uri","screen_hint","appState","targetUrl","searchParams","onLogin","_context$authProvider2","descriptionActive","showAuth","buttonSize","handleClick","stopPropagation","onCopyLink","onReport","body","encodeURIComponent","CommentIcon","rel","MoreHorizIcon","OpenInNewIcon","onboarded","MapDescriptionView","extensions","BatchRenderer","InteractionManager","CanvasGraphicsRenderer","CanvasSpriteRenderer","RasterSynapse","graphics","Graphics","attachTarget","g","pc","cc","originX","sign","destX","mid0X","mid1X","lineWidth","getTextStyle","alpha","dragging","getSide","pW05","cW05","ccX","cX","optimalPositionX","cY","getPositionY","pX","getPositionX","pY","neutralDistance","distanceFromParent","lineStyle","renderColor","moveTo","bezierCurveTo","lineWidth05","beginFill","drawCircle","nextSibling","getNextSibling","_this$parent$entity","drawDotOnParent","endFill","len","parentEntity","isVisible","indexInParent","prev","setDetached","invalidateNode","renderer","update","AABB","startX","startY","endX","endY","w05","h05","globalPositionX","globalPositionY","getMidPoint","getHeight","getWidth","NodeBase","hoverNode","dirty","optimalPositionY","offsetPositionX","offsetPositionY","textOffsetX","textOffsetY","setNode","interactive","buttonMode","on","emit","removeChild","getNodes","deleteNodes","arr","splice","setLayoutDirty","addChild","nodeVisible","updateDepth","setVisibility","_node$getNextSibling","_node$getPreviousSibl","next","getPreviousSibling","sortChildrenByEntity","isLoaded","setPosition","setAlpha","updateColor","onTick","delta","vX","vY","hasDelta","skipAnimations","onUpdateColor","desaturateColor","hasParent","onDoubleClick","onNodeHoverEnter","setDirty","onNodeHoverMove","dc","dcX","dcY","deltaDragX","deltaDragY","dragDelta","sqrt","onNodeHoverExit","subSetDirty","setTickDirty","_this$renderer$nodeEv","nodeEventHandler","draggingNode","handleRemoteUncollapse","shouldMoveIndex","findFittingIndex","move","onUpdatedNode","rearrange","skipEvents","nIndex","nSide","movedParent","movedSide","movedIndex","oldParent","oldParentId","oldSide","oldIndex","oldColor","getFirstSetColor","_oldParent$entity","instanceId","refresh","setSide","siblings","setZIndex","placeBetween","updateLayerOrder","hasUpdate","removeFromParentBuffer","indexKey","getSiblings","callRecursive","linkRenderer","getDepth","maxDepth","isLeaf","isLeftMost","isRightMost","getGlobalSiblings","leftTree","fillGlobalSiblings","rightTree","getLeftMostSibling","getLeftMostChild","getRightMostChild","getBranch","getBranchExclusive","callback","getPath","reverse","callParents","getAABB","aabb","fillAABB","getBranchRoot","_this$parent","isSelected","closed","dragOverNode","hasActiveLink","hasActiveNode","targetNodeIdSet","getFirstInvisibleParent","isBranchDragging","_buf$synapse","destroy","isInPath","_handler$draggingNode","handler","cancelDrag","RootAttachmentNode","interactiveChildren","rootWidth","BaseLayout","span","mod","getNodeSize","w","getChildPosition","getMaxX","updateWidth","initializeNodes","calculateInitialX","calculateFinalPositions","nodeWidth","layerSpacingWidth","floor","ceil","modSum","getMaxWidth","getMaxHeight","leftChild","rightChild","mid","checkForConflicts","sibling","shiftValue","nodeContour","siblingContour","getLeftContour","lastKey","getRightContour","minDepth","level","distance","values","l","getLeftContourMin","contour","getRightContourMax","maxW","maxH","h","RootLayout","layerSpacingHeight","RootNode","mask","customText","textStyle","hasCustomImage","customImageValue","getSmallestSide","balance","retry","running","customValue","TextStyle","fontFamily","fontStyle","themeMode","breakWords","wordWrapWidth","Text","Texture","offset","Sprite","valid","updateAvatarUrl","setGlobalPosition","_this$leftTree","_this$rightTree","fullTree","DynamicChar","space","emoji","paint","charcode","wordIndex","lineIndex","DynamicTextStyle","respectDirty","_parent","_scale","_align","_fontFamily","_fontSize","_fontWeight","_fontStyle","_letterSpacing","_lineHeight","_verticalAlign","_rotation","_skew","_fill","_resolution","_inverseResolution","clone","merge","param","_dirty","ctxKey","char","ctxFont","renderFontSize","dirtyStyle","scale","verticalAlign","skew","resolution","inverseResolution","DynamicCharOverride","optionsCallback","renderCallback","draw","obj","offsetX","getCharData","Rectangle","radius","fillStyle","beginPath","arc","rectX","PI","ctx","fromx","fromy","lw","hlen","save","topCurveHeight","closePath","restore","drawHeart","radiusH","radiusW","oldStrokeStyle","strokeStyle","lineTo","unitW","unitH","fillRect","oldComposite","globalCompositeOperation","metricsCanvas","createElement","metricsContext","getContext","willReadFrequently","DynamicAtlas","objects","newObjects","baseTexture","lazyTimeout","canvasList","atlasdim","startdim","maxdim","fontFamilyCache","overrides","addCanvas","AtlasNode","BaseTexture","mipmap","Overrides","DynamicText","settings","debugSpriteSheet","appendChild","drawObjects","resized","drawObject","texture","updateUvs","frame","rectY","font","fillText","getCharObject","familyCache","metrics","TextMetrics","generateCharData","hasRect","xOffset","yOffset","descent","addNewObjects","compareFunction","_resized","_newcanvas","insert","resizeCanvas","dim","def","isNaN","round","measureText","paddingY","paddingX","baseline","clearRect","pixelData","getImageData","line","ascent","minx","maxx","finalMinX","finalMaxX","generateMetricsData","FONT_H1","FONT_H3","tempCache","String","fromCharCode","stringify","newNode","scaleMode","_pixiId","utils","atlas","KNOWN_EMOJIS","Container","options","autoWidth","_style","chars","renderChars","spriteCache","_inputText","lastWidth","lastHeight","textWidth","textHeight","dirtyText","dirtyRender","lineFontSizeData","lineAlignmentData","charCount","lazyUpdate","paintColor","updateImmediate","_render","onRender","lineHeightData","removeSprite","lineWidthData","_width","tex","sprite","anchor","tint","prepareForRender","pos","Point","lineFontSize","lineAlignment","renderIndex","parseFloat","lastChar","processInputText","charIndex","regex","emojiRegex","inputArray","from","exec","add","setTextAndStyle","setTint","defaultEmojiFont","RATING_STRINGS","InteractiveNode","renderText","hitArea","viewport","toWorld","global","dongleWidth","mul","sin","red","green","blue","L","getRatingString","getStateString","hasFlag","activeLink","decorations","oldTextWidth","linkColor","isTempVisible","paddingH","paddingW","width05","collapseOffset","drawRoundedRect","diff","RasterStyles","snapOptions","removeOnComplete","removeOnInterrupt","synapseColors","getSynapseColor","ClusterLayout","RemoteDragHandler","sas","eventHandler","endTimerCall","forceDragEnd","targetX","targetY","lastMove","ticks","dX","onDrag","targetId","updateNode","notify","pingEndTimer","onDragEnd","disconnected","onDisconnected","NodeEventHandler","hidden","closestNode","closestNodes","eventData","dragMoved","eventOffset","eventPosition","deltaClick","clickedNode","dragOverX","dragOverY","renderDragOverX","renderDragOverY","lastMovedNode","collapsedParent","searchDebouncer","Debounce","detachDebouncer","tempUncollapsedNodes","contextLost","activeDrags","transmitTimer","lastTransmitEvent","lastTransmitTime","onTransmitDragEvent","transmitDragEvent","onPointerUp","onNodePointerUp","onPointerMove","onNodePointerMove","onPointerOut","onPointerOver","resetRenderTimer","onNodeClick","onNodePointerDown","onTreePointerOut","onHandleRemoteDrag","onRemoteDrag","onHandleRemoteDragEnd","onRemoteDragEnd","onRemoteActiveInput","onRemoteBlur","onHandleRemoteDragDisconnected","onRemoteDragDisconnected","getConnections","visibilityCallback","run","pcid","syncToRemote","isAnyDragActive","drag","visibilityState","reload","_event$data","_event$data$originalE","_event$data$originalE2","originalEvent","eventsTransmitted","pause","vt","_n$parent","transmit","hasConnections","blurActiveInput","setActiveNodeId","resume","_event$data2","_event$data2$original","_event$data2$original2","newPosition","getLocalPosition","setActiveInput","closest","debounce","findInAABB","deltaWidth","defaultDistance","offsetParentX","minY","maxY","_attachTarget$synapse","findClosestByOpposingJoints","onResourceDrop","dataTransfer","getData","coords","findNode","timeSinceTransmit","oldNode","prevCollapsedParent","_parent$entity","hNode","setDragOverActive","onDragOver","setContextLost","off","LinkRenderer","waitingNodeIds","targetNodeIds","targetNodes","synapseColor","onParentOrReferencesUpdated","onResourcesUpdated","_this$targetNodeIdSet","_this$container","onLoaded","setLinkedNodes","onNodeCreated","selectedNodeId","newTargetNodeIdSet","compareSets","every","height05","absY","signY","originY","destY","ty","ddy","mid0Y","mid1Y","activeId","idArrayIsEqual","v","sourceNodeId","targetNodeId","renderToCanvas","_renderer$context","_renderer$context$gl","_renderer$context2","_renderer$context2$gl","resolutionOverride","renderTexture","maxTextureSize","gl","getParameter","MAX_TEXTURE_SIZE","resolutionBase","generateTexture","bind","canvasBuffer","webglPixels","Uint8Array","readPixels","RGBA","UNSIGNED_BYTE","canvasData","pixels","out","empty","arrayPostDivide","putImageData","initialLoad","TreeRenderer","EventEmitter","_this","eventsEnabled","worldHeight","worldWidth","opened","tickDirty","dirtySide","renderTimer","zoomWidthTarget","nodeDictionary","parentBuffer","parentBufferLinks","lastRenderTick","performance","screenshotTimer","onScreenshotEvent","takeScreenshot","requestRenderTickReference","requestRenderTick","onNodeUpdated","onNodeDeleted","createNode","fonts","ready","setup","timers","getOwnerProfile","load","onFlush","_this$manager","_this$manager$getCont","mapEntity","hasPreview","setAlphaGeared","moving","zooming","tick","updateLayout","dirtyNodes","close","isSwitch","offFlush","SumVisibleNodes","removeAllListeners","externalEvents","getGlobalEventKey","_this2","loadEverything","TreeHelper","entityIndex","addToParentBuffer","visibleSum","performSkip","sc","resolutionX","resolutionY","changeTheme","saveScreenshot","screenshot","darkMode","setThemeMode","append","download","click","remove","_handler$getEntityByI","uploadPreview","deleteSet","panTo","screenOffsetX","screenOffsetY","screenHeight","screenWidth","point","actualWidth","actualHeight","worldOffsetX","worldOffsetY","worldX","worldY","snap","zoomWidth","snapZoom","zoomHeight","worldScreenWidth","minDist","curNode","nx","ny","nw","nh","cN","cX0","cY0","cX1","cY1","callWidthFirst","callDepthFirst","layer","concat","getActiveNode","sum","TreeKeyboardShortcuts","_history$location","code","keyCode","composed","ctrlKey","altKey","shiftKey","metaKey","meta","nodeData","curIdx","findIndex","dirY","dSide","findClosest","start","stop","listenerNode","onGestureStart","initialScale","initialGlobalPosition","getPointerPosition","initialLocalPosition","toLocal","onGestureEnd","onGestureChange","Error","newScale","globalPosition","localPosition","moveRelative","down","up","wheel","reset","resize","moveCenter","center","injectRenderer","autoDetectRenderer","getResolution","antialias","devicePixelRatio","autoDensity","powerPreference","backgroundAlpha","useContextAlpha","Viewport","interaction","pinch","clampZoom","decelerate","friction","gesturePinch","PinchGesturePlugin","zoomPercent","screen","useTreeReferenceRenderer","referencingBlocks","useReferencingEntities","activeNodeIdCount","myReferences","flatMap","resourceParents","_getTree","_getTree$linkRenderer","finalNodeIds","getTree","link","NotFoundView","deleted","entityType","setVisible","RouteWithNodeId","RouteWithResourceId","resourceEntity","resourceDeleted","resourceLoading","nodeEntity","nodeDeleted","nodeLoading","RouteWithoutNodeId","MapCard","cardSwipeActive","hasRenderer","containerRef","showLoadingScreen","treeLoading","appRef","viewportRef","startRenderer","eventEmitterRef","useRenderer","setShowLoadingScreen","setLoading","treeRef","nodeIdRef","mobileRef","themeModeRef","idRef","usePlanWithFileLimits","planRef","ownerId","useGroupOwnerId","useRTACUserAvatarUrl","getElementById","setSelectionRange","getHandler","incomplete","kind","getAsFile","fileSizes","checkIfUploadAllowed","fileSize","fileType","pending","Task","onDragEnter","_ev$dataTransfer","_ev$dataTransfer$type","types","onDragLeave","onDrop","onSetDirty","onContextLost","eventEmitter","keyboardShortcuts","overscrollBehaviorX","documentElement","canvasHex","useTreeEngine","useCanEditWithLoad","isPrivateAccess","handleCardState","hasBackground","Switch","Route","ResourceCreateView","FilterView","ResourceMultiTagsView","Redirect","ResourceEditView","ResourceTagsView","ResourceView","SearchDialog","LoadingPanel","suggestionContainer","suggestionHeader","suggestionSkeleton","NodeCreatePanel","limit","creatingNode","setCreatingNode","creatingNodes","setCreatingNodes","suggestedNodes","setSuggestedNodes","loadingSuggestions","setLoadingSuggestions","hasLimit","nodesLeft","limitReached","defaultPlan","createNodes","entityId","createEntityId","addNode","nodeList","removeNode","TagSelector","tags","onAddTag","onRemoveTag","warning","Skeleton","suggestion","NodeCreateDialog","handles","createNodeDialogHandles","handleRef","handle","handleCancel","arrowColor","primaryColor","locale","back","last","skip","Tour","steps","onEnd","setStepIndex","stepIndex","ticker","setTicker","canFit","setActive","timerRef","visibleRef","visibilityTimeoutRef","visibilityDelayRef","fnRef","onVisibilityChange","overlayElements","overlay","popperElements","tooltipPopper","instance","onUpdate","joyrideCallback","status","classname","targets","helpers","EVENTS","ACTIONS","STATUS","onStep","Joyride","disableScrollParentFix","continuous","spotlightClicks","hideBackButton","disableScrolling","disableBeacon","isFixed","hideCloseButton","scrollToFirstStep","hideFooter","showSkipButton","AppTour","appTour","appTourIndex","SetAppTour","onSetIndex","SetAppTourIndex","MapView","openLastVisited","setLastOpened","TrackGoal","setBootPath","Helmet","property","preview","GroupContextProvider","DeviceProvider","ResourceDragContext","OnboardingPage","UniversalConfirmDialog","EditDialogs"],"sourceRoot":""}