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jT,EACZ2mC,EAAKC,YAAYx7B,GACjB06B,EAAMe,WAAWF,GACjBlL,KAAK2J,IAAIoB,OAAOC,eAAeE,EACjC,CACF,CAEAG,UAAAA,GACErL,KAAK+J,aAA8C,UAA/B/5C,OAAO06C,eAAeh9C,KAC1CsyC,KAAK3xB,QAAU2xB,KAAK2J,IAAIW,UAAUC,cAAcvK,KAAK99B,MAAQ89B,KAAK+J,aAClE/J,KAAK92B,OAAOpL,UAAYkiC,KAAK+J,aAEzB/J,KAAK+J,aACP/J,KAAK92B,OAAOugC,UAAU6B,OAAO,sBAE7BtL,KAAK92B,OAAOugC,UAAUS,IAAI,qBAE9B,E","sources":["actions/filter.js","actions/search.js","api/client.js","common/AnalyticsHandler.js","common/ImageUtility.js","components/atoms/CardHeader.jsx","components/atoms/DynamicCard.jsx","components/atoms/DynamicPanel.jsx","components/atoms/FuzzyText.jsx","components/atoms/display/Tag.jsx","components/atoms/WildcardText.jsx","components/atoms/ResourcePreviewItem.jsx","components/atoms/display/DelayedLinearProgress.jsx","components/atoms/display/TimedRemover.jsx","components/atoms/inputs/FileUpload.jsx","components/atoms/inputs/StandardToggle.jsx","components/atoms/inputs/TagSelector.jsx","components/molecules/controllers/ResourcesControllerDesktop.jsx","components/molecules/controllers/ResourcesControllerMobile.jsx","components/atoms/DroppablePanel.jsx","components/atoms/ResourcesEmptyPanel.jsx","components/molecules/ResourceList.jsx","components/molecules/ControlledResourcesList.jsx","components/molecules/controllers/HelpCenterController.jsx","components/organisms/views/InboxView.jsx","components/molecules/panels/InboxPanel.jsx","components/molecules/controllers/InboxController.jsx","components/atoms/display/CreateMapLoadingScreen.jsx","components/molecules/panels/CreateMapPanel.jsx","components/atoms/display/SkillLevel.jsx","components/atoms/NodeSearchResult.jsx","components/molecules/panels/QuickSearchPanel.jsx","hooks/useSearch.js","components/molecules/MinimalContextSelector.jsx","components/molecules/panels/SearchPanel.jsx","components/atoms/NodeSearchResultMinimal.jsx","components/atoms/ResourcePreviewItemMinimal.jsx","components/organisms/dialogs/InboundLinksDialog.jsx","components/organisms/dialogs/SearchDialog.jsx","components/organisms/dialogs/UniversalConfirmDialog.jsx","components/organisms/onboarding/OnboardingPage.jsx","components/organisms/views/FilterView.jsx","components/molecules/CreateOfflineResourcePanel.jsx","components/molecules/CreateOnlineResourcePanel.jsx","components/organisms/views/ResourceCreateView.jsx","components/organisms/views/ResourceEditView.jsx","components/organisms/views/ResourceMultiTagsView.jsx","components/organisms/views/ResourceTagsView.jsx","components/molecules/editors/ResourceNotesPanel.jsx","components/organisms/views/ResourceView.jsx","components/pages/map/common/WritingAnimation.jsx","components/pages/map/common/ChatBubble.jsx","components/pages/map/common/ChatInput.jsx","components/pages/map/quiz/QuizSplashScreen.jsx","components/pages/map/quiz/common/QuizAnswer.jsx","components/pages/map/quiz/common/QuizQuestion.jsx","components/pages/map/quiz/common/QuizNavigation.jsx","components/pages/map/quiz/QuizLoadingScreen.jsx","components/pages/map/quiz/QuizScoreScreen.jsx","components/pages/map/quiz/variations/StandardQuiz.jsx","components/pages/map/quiz/common/QuizController.js","components/pages/map/quiz/variations/TimedQuiz.jsx","components/pages/map/quiz/variations/SuddenDeathQuiz.jsx","components/pages/map/quiz/common/ChatPanel.jsx","components/pages/map/quiz/variations/DiscussionSimulator.jsx","components/pages/map/quiz/QuizPanel.jsx","hooks/usePlan.js","hooks/useResources.js","providers/ResourceDragContext.js","renderers/editortools/reference/Reference.js"],"sourcesContent":["import * as ActionTypes from \"./actionTypes\";\r\n\r\nexport function SetFilter(sortBy, minRating, resourceType, archived, tags) {\r\n return {\r\n type: ActionTypes.SET_FILTER,\r\n payload: {\r\n sortBy,\r\n minRating,\r\n resourceType,\r\n archived, \r\n tags\r\n }\r\n };\r\n}\r\n","import * as ActionTypes from \"./actionTypes\";\r\n\r\nexport function SetSearchQuery(query) {\r\n return {\r\n type: ActionTypes.SEARCH_SET_QUERY,\r\n payload: { query }\r\n };\r\n}\r\n\r\nexport function AddSelect({ title = \"\", description = \"\", mobileDescription = \"\", prefill = \"\", includeTopics = true, allowContextSwitching = true, includeResources = false, callback = () => {}, portalId = null, initialContextId = null } = {}) {\r\n return {\r\n type: ActionTypes.SEARCH_SELECT_ADD,\r\n payload: { title, description, callback, mobileDescription, prefill, includeTopics, includeResources, portalId, initialContextId, allowContextSwitching }\r\n };\r\n}\r\n\r\n\r\nexport function CancelSelect() {\r\n return {\r\n type: ActionTypes.SEARCH_SELECT_CANCEL,\r\n payload: {}\r\n };\r\n}\r\n\r\nexport function FinishSelect(type, nodeId, resourceId = null) {\r\n return {\r\n type: ActionTypes.SEARCH_SELECT_CANCEL,\r\n payload: { type, nodeId, resourceId }\r\n };\r\n}\r\n\r\nexport function SetInboundLinksPanel(open) {\r\n return { \r\n type: ActionTypes.SEARCH_SET_INBOUND_LINKS_PANEL,\r\n payload: { open }\r\n };\r\n}\r\n","import axios from \"axios\";\r\nimport { Retry } from \"@emberly/dataplane\";\r\n\r\nexport async function InitChangeProfileEmail(email) {\r\n const result = await Retry.Axios(async () => await axios.patch(`/api/client/email/init`, { email }));\r\n return result.data;\r\n}\r\n\r\nexport async function FinalizeChangeProfileEmail(email, code) {\r\n const result = await Retry.Axios(async () => await axios.patch(`/api/client/email/finalize`, { email, code }));\r\n return result.data;\r\n}\r\n\r\nexport async function DeleteProfile() {\r\n const result = await Retry.Axios(async () => await axios.delete(`/api/client`));\r\n return result.data;\r\n}\r\n\r\nexport async function GetQuota(method) {\r\n const result = await Retry.Axios(async () => await axios.get(`/api/client/quota/${method}`));\r\n return result.data;\r\n}","\r\nconst isEmberly = window.location?.host === \"ember.ly\";\r\nconst initialEvents = new Set();\r\n\r\n/**\r\n * Only track the goal once per application load\r\n * @param {*} goalId \r\n */\r\nexport function TrackInitialGoal(goalId) {\r\n if (!initialEvents.has(goalId)) {\r\n initialEvents.add(goalId);\r\n TrackGoal(goalId);\r\n }\r\n}\r\n\r\n/**\r\n * Track the goal by goal id\r\n * @param {*} goalId \r\n */\r\nexport default function TrackGoal(goalId) {\r\n try {\r\n if (isEmberly && !!window.fathom) {\r\n window.fathom.trackGoal(goalId, 0);\r\n } else if(!isEmberly) {\r\n console.log(\"EVENT\", goalId);\r\n }\r\n } catch {}\r\n}\r\n\r\n","\r\nexport default class ImageUtility {\r\n\r\n static IsImage(target) {\r\n let ext = target.name.substr(target.name.lastIndexOf(\".\") + 1).toLowerCase().trim();\r\n return ext === \"jpeg\" || ext === \"jpg\" || ext === \"png\" || ext === \"webp\" || ext === \"gif\";\r\n }\r\n\r\n static async GenerateFilePreviewAsync(file, width) {\r\n return new Promise((resolve) => ImageUtility.GeneratePreviewCallback(file, width, (e) => resolve(e)));\r\n }\r\n\r\n static async GeneratePreviewFromCanvasAsync(elem, filename, resolutionX, resolutionY, s = 1, background = null) {\r\n return new Promise((resolve) => ImageUtility.GeneratePreviewFromCanvasCallback(elem, filename, resolutionX, resolutionY, (e) => resolve(e), s, background));\r\n }\r\n\r\n static GeneratePreviewFromCanvasCallback(elem, fileName, resolutionX, resolutionY, callback, s = 1, background = null) { \r\n const copyCanvas = document.createElement(\"canvas\");\r\n copyCanvas.width = resolutionX;\r\n copyCanvas.height = resolutionY;\r\n const copyCtx = copyCanvas.getContext(\"2d\");\r\n \r\n if (!!background) {\r\n copyCtx.fillStyle = background;\r\n copyCtx.fillRect(0, 0, copyCanvas.width, copyCanvas.height)\r\n }\r\n\r\n const eWidth = elem.width;\r\n const eHeight = elem.height;\r\n const cWidth = copyCanvas.width;\r\n const cHeight = copyCanvas.height;\r\n\r\n const eRatio = eWidth / eHeight;\r\n const cRatio = cWidth / cHeight;\r\n\r\n if (eRatio > cRatio) {\r\n const w = cWidth;\r\n const h = cWidth / eRatio;\r\n\r\n copyCtx.drawImage(\r\n elem, \r\n w * (1 - s) * 0.5, \r\n ((cHeight - h) / 2) + ((1 - s) * 0.5) * h, \r\n w * s, \r\n h * s\r\n );\r\n } else {\r\n const h = cHeight;\r\n const w = cHeight * eRatio;\r\n\r\n copyCtx.drawImage(elem, \r\n ((cWidth - w) / 2) + ((1 - s) * 0.5) * w, \r\n h * (1 - s) * 0.5, \r\n w * s, \r\n h * s\r\n );\r\n }\r\n\r\n\r\n copyCtx.canvas.toBlob((blob) => {\r\n const result = new File([blob], fileName, {\r\n type: \"image/png\",\r\n lastModified: Date.now()\r\n });\r\n\r\n callback(result);\r\n }, \"image/png\", 0.925);\r\n }\r\n\r\n static GeneratePreviewCallback(file, targetWidth, callback) {\r\n const img = new Image();\r\n\r\n img.onload = () => {\r\n const elem = document.createElement(\"canvas\");\r\n const ctx = elem.getContext(\"2d\");\r\n const renderW = targetWidth;\r\n const renderH = img.height * (targetWidth / img.width);\r\n const finalW = Math.min(renderW, img.width);\r\n const finalH = Math.min(renderH, img.height);\r\n elem.width = finalW;\r\n elem.height = finalH;\r\n\r\n ctx.fillStyle = \"#F5F7F6\";\r\n ctx.fillRect(0, 0, elem.width, elem.height);\r\n ctx.drawImage(img, 0, 0, finalW, finalH);\r\n\r\n ctx.canvas.toBlob((blob) => {\r\n const result = new File([blob], file.name, {\r\n type: \"image/jpeg\",\r\n lastModified: Date.now()\r\n });\r\n\r\n callback(result);\r\n }, \"image/jpeg\", 0.925);\r\n\r\n };\r\n\r\n img.src = URL.createObjectURL(file);\r\n }\r\n\r\n static CreateImage(url) {\r\n return new Promise((resolve, reject) => {\r\n const image = new Image()\r\n image.addEventListener('load', () => resolve(image))\r\n image.addEventListener('error', error => reject(error))\r\n image.setAttribute('crossOrigin', 'anonymous') // needed to avoid cross-origin issues on CodeSandbox\r\n image.src = url\r\n });\r\n }\r\n\r\n static GetRadianAngle(degreeValue) {\r\n return (degreeValue * Math.PI) / 180\r\n }\r\n\r\n /**\r\n * This function was adapted from the one in the ReadMe of https://github.com/DominicTobias/react-image-crop\r\n * @param {File} image - Image File url\r\n * @param {Object} pixelCrop - pixelCrop Object provided by react-easy-crop\r\n * @param {number} rotation - optional rotation parameter\r\n */\r\n static async GetCroppedImage(imageSrc, pixelCrop, rotation = 0, maxWidth = 256) { // TODO make the safearea max 1024 or something. add a Math.min to maxSize, also need to account for it further down.\r\n const image = await ImageUtility.CreateImage(imageSrc)\r\n const canvas = document.createElement(\"canvas\");\r\n const ctx = canvas.getContext(\"2d\");\r\n\r\n const maxSize = Math.max(image.width, image.height);\r\n\r\n const maxSizeScaled = Math.min(1024, maxSize);\r\n const ratio = maxSizeScaled / maxSize;\r\n const safeArea = 2 * ((maxSizeScaled / 2) * Math.sqrt(2));\r\n\r\n // set each dimensions to double largest dimension to allow for a safe area for the\r\n // image to rotate in without being clipped by canvas context\r\n canvas.width = safeArea;\r\n canvas.height = safeArea;\r\n\r\n // translate canvas context to a central location on image to allow rotating around the center.\r\n ctx.translate(safeArea / 2, safeArea / 2);\r\n ctx.rotate(ImageUtility.GetRadianAngle(rotation));\r\n ctx.translate(-safeArea / 2, -safeArea / 2);\r\n\r\n // draw rotated image and store data.\r\n ctx.fillStyle = \"#F5F7F6\";\r\n ctx.fillRect(0, 0, canvas.width, canvas.height);\r\n\r\n ctx.drawImage(\r\n image,\r\n safeArea / 2 - image.width * 0.5 * ratio,\r\n safeArea / 2 - image.height * 0.5 * ratio,\r\n image.width * ratio,\r\n image.height * ratio\r\n );\r\n\r\n const data = ctx.getImageData(0, 0, safeArea, safeArea);\r\n\r\n // set canvas width to final desired crop size - this will clear existing context\r\n // TODO\r\n canvas.width = pixelCrop.width * ratio;\r\n canvas.height = pixelCrop.height * ratio;\r\n\r\n // paste generated rotate image with correct offsets for x,y crop values.\r\n ctx.putImageData(\r\n data,\r\n 0 - safeArea / 2 + image.width * 0.5 * ratio - pixelCrop.x * ratio,\r\n 0 - safeArea / 2 + image.height * 0.5 * ratio - pixelCrop.y * ratio\r\n );\r\n\r\n if (canvas.width > maxWidth) {\r\n const resizedCanvas = document.createElement(\"canvas\");\r\n resizedCanvas.width = maxWidth;\r\n resizedCanvas.height = maxWidth * (canvas.height / canvas.width);\r\n\r\n const resizedContext = resizedCanvas.getContext(\"2d\");\r\n resizedContext.drawImage(canvas, 0, 0, resizedCanvas.width, resizedCanvas.height);\r\n return resizedCanvas.toDataURL(\"image/jpeg\");\r\n }\r\n\r\n // As Base64 string\r\n return canvas.toDataURL(\"image/jpeg\");\r\n }\r\n}","import { useMemo, useState } from \"react\";\r\nimport { Box, Typography, IconButton, Menu, MenuItem, Button, Divider, ListItemText, ListItemIcon } from \"@mui/material\";\r\nimport { Check as CheckIcon, Close as CloseIcon, ExpandMore as ExpandMoreIcon, ExpandLess as ExpandLessIcon, MoreVert as MoreVertIcon, ArrowBack as BackIcon } from \"@mui/icons-material\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport { useCanEdit } from \"@emberly/dataplane\";\r\nimport { useDevice } from \"../../providers/DeviceContext\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n root: {\r\n position: \"relative\",\r\n width: \"100%\",\r\n height: \"48px\",\r\n background: theme.palette.background.paper,\r\n \"@media (max-height: 136px)\": {\r\n display: \"none\"\r\n },\r\n overflow: \"hidden\",\r\n },\r\n border: {\r\n borderBottom: `1px solid ${theme.palette.divider}`\r\n },\r\n buttonLeft: {\r\n position: \"absolute\",\r\n left: theme.spacing(1),\r\n height: \"100%\",\r\n width: \"36px\"\r\n },\r\n buttonRight: {\r\n position: \"absolute\",\r\n right: theme.spacing(1),\r\n height: \"100%\",\r\n minWidth: \"36px\"\r\n },\r\n headerItem: {\r\n width: \"calc(100% - 96px)\",\r\n position: \"absolute\",\r\n left: \"48px\",\r\n height: \"100%\",\r\n textAlign: \"center\"\r\n },\r\n header: {\r\n overflow: \"hidden\",\r\n whiteSpace: \"nowrap\",\r\n textOverflow: \"ellipsis\",\r\n textAlign: \"center\",\r\n fontWeight: 500,\r\n width: \"100%\",\r\n userSelect: \"none\"\r\n },\r\n iconButton: {\r\n zIndex: 999999,\r\n borderRadius: theme.spacing(0.5)\r\n },\r\n embed: {\r\n paddingRight: theme.spacing(6)\r\n },\r\n menuButton: {\r\n borderRadius: theme.spacing(0.5),\r\n paddingTop: theme.spacing(2),\r\n paddingBottom: theme.spacing(2)\r\n }\r\n}));\r\n\r\nconst anchorOrigin = {\r\n vertical: \"center\",\r\n horizontal: \"left\",\r\n};\r\n\r\nconst transformOrigin = {\r\n vertical: \"top\",\r\n horizontal: \"center\",\r\n};\r\n\r\nfunction LeftButton(props) {\r\n const classes = useStyles();\r\n const { onBack, onClose, onExpandLess, onExpandMore, isMobilePortraitView } = props;\r\n\r\n if (onBack !== undefined) {\r\n return (\r\n <IconButton\r\n className={classes.iconButton}\r\n onClick={onBack}\r\n size=\"medium\">\r\n <BackIcon fontSize=\"small\" />\r\n </IconButton>\r\n );\r\n } else if (onClose !== undefined) {\r\n return (\r\n <IconButton\r\n className={classes.iconButton}\r\n onClick={onClose}\r\n size=\"medium\">\r\n <CloseIcon fontSize=\"small\" />\r\n </IconButton>\r\n );\r\n } else if (onExpandLess !== undefined) {\r\n return (\r\n <IconButton\r\n className={classes.iconButton}\r\n onClick={onExpandLess}\r\n size=\"medium\">\r\n {isMobilePortraitView ? <ExpandLessIcon fontSize=\"small\" /> : <BackIcon fontSize=\"small\" />}\r\n </IconButton>\r\n );\r\n } else if (onExpandMore !== undefined) {\r\n return (\r\n <IconButton\r\n className={classes.iconButton}\r\n onClick={onExpandMore}\r\n size=\"medium\">\r\n {isMobilePortraitView ? <ExpandMoreIcon fontSize=\"small\" /> : <BackIcon fontSize=\"small\" />}\r\n </IconButton>\r\n );\r\n }\r\n\r\n return null;\r\n}\r\n\r\n\r\nfunction RightButton(props) {\r\n const classes = useStyles();\r\n const { onConfirm, onMenu, onMenuButton, menuItems } = props;\r\n const [anchorEl, setAnchorEl] = useState(null);\r\n const open = Boolean(anchorEl);\r\n const canEdit = useCanEdit();\r\n\r\n if (onConfirm !== undefined) {\r\n return (\r\n <IconButton\r\n className={classes.iconButton}\r\n onClick={onConfirm}\r\n size=\"medium\">\r\n {canEdit ? <CheckIcon fontSize=\"small\" /> : <CloseIcon fontSize=\"small\" />}\r\n </IconButton>\r\n );\r\n } else if (onMenu !== undefined) {\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 onItemClick = (menuItem) => {\r\n handleClose();\r\n onMenu(menuItem);\r\n };\r\n\r\n return <>\r\n <IconButton\r\n className={classes.iconButton}\r\n onClick={handleClick}\r\n size=\"medium\">\r\n <MoreVertIcon fontSize=\"small\" />\r\n </IconButton>\r\n <Menu\r\n anchorEl={anchorEl}\r\n keepMounted\r\n open={open}\r\n onClose={handleClose}\r\n anchorOrigin={anchorOrigin}\r\n transformOrigin={transformOrigin}\r\n >\r\n {menuItems.map(\r\n (menuItem, idx) => menuItem === \"---\" ?\r\n (\r\n <Divider key={idx} />\r\n ) : (\r\n <MenuItem key={idx} onClick={() => onItemClick(menuItem.value)} className={menuItem.className || \"\"}>\r\n {menuItem.icon ? (\r\n <ListItemIcon>\r\n {menuItem.icon}\r\n </ListItemIcon>\r\n ) : null}\r\n <ListItemText>{menuItem.text || menuItem.value}</ListItemText>\r\n </MenuItem>\r\n )\r\n )}\r\n </Menu>\r\n </>;\r\n } else if (onMenuButton !== undefined) {\r\n\r\n return (\r\n <>\r\n {menuItems.map(menuItem => <Button key={menuItem} className={classes.menuButton} onClick={() => onMenuButton(menuItem)}>{menuItem}</Button>)}\r\n </>\r\n );\r\n }\r\n\r\n return null;\r\n}\r\n\r\nexport default function CardHeader(props) {\r\n const classes = useStyles();\r\n const { title, onConfirm, onClose, onExpandLess, onExpandMore, onBack, onMenu, onMenuButton, menuItems, border } = props;\r\n const { isMobilePortraitView, isEmbed } = useDevice();\r\n\r\n return useMemo(() =>\r\n (\r\n <div\r\n className={`${classes.root} ${!!border ? classes.border : \"\"} ${isEmbed ? classes.embed : \"\"}`}\r\n >\r\n <Box className={classes.buttonLeft} alignItems=\"center\" justifyContent=\"center\" display=\"flex\">\r\n <LeftButton onClose={onClose} onExpandLess={onExpandLess} onExpandMore={onExpandMore} onBack={onBack} isMobilePortraitView={isMobilePortraitView} />\r\n </Box>\r\n <Box className={classes.headerItem} alignItems=\"center\" justifyContent=\"center\" display=\"flex\">\r\n <Typography align=\"center\" className={classes.header} variant=\"subtitle1\">\r\n {title}\r\n </Typography>\r\n </Box>\r\n <Box className={classes.buttonRight} alignItems=\"center\" justifyContent=\"center\" display=\"flex\">\r\n <RightButton onConfirm={onConfirm} onMenu={onMenu} menuItems={menuItems} isMobilePortraitView={isMobilePortraitView} onMenuButton={onMenuButton} />\r\n </Box>\r\n </div>\r\n ),\r\n [classes, border, isEmbed, title, onClose, onExpandLess, onExpandMore, onBack, isMobilePortraitView, onConfirm, onMenu, onMenuButton, menuItems]\r\n );\r\n}\r\n\r\n","import { Grid, Typography, Fade } from \"@mui/material\";\r\nimport { makeStyles } from \"@mui/styles\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n card: {\r\n position: \"relative\",\r\n cursor: \"pointer\",\r\n overflow: \"hidden\",\r\n height: \"100%\",\r\n border: `1px solid ${theme.palette.divider}`,\r\n borderRadius: \"4px\",\r\n boxSizing: \"border-box\",\r\n \"& .img-container\": {\r\n height: \"132px\",\r\n overflow: \"hidden\",\r\n position: \"relative\",\r\n borderTopLeftRadius: \"4px\",\r\n borderTopRightRadius: \"4px\",\r\n \"& img\": {\r\n borderTopLeftRadius: \"4px\",\r\n borderTopRightRadius: \"4px\",\r\n objectFit: \"cover\",\r\n height: \"100%\",\r\n width: \"100%\",\r\n transition: \"transform 0.25s\",\r\n verticalAlign: \"baseline-middle\"\r\n },\r\n },\r\n \"@media (hover: hover)\": {\r\n \"&:hover\": {\r\n \"&:before\": {\r\n background: theme.palette.action.hover,\r\n position: \"absolute\",\r\n height: \"100%\",\r\n width: \"100%\",\r\n content: \"''\",\r\n display: \"block\",\r\n zIndex: 30,\r\n pointerEvents: \"none\"\r\n },\r\n \"& img\": {\r\n transform: \"scale(1.075)\"\r\n }\r\n },\r\n }\r\n },\r\n cardText: {\r\n padding: \"12px 16px\"\r\n },\r\n disabledCard: {\r\n filter: \"grayscale(100%)\",\r\n \"& img\": {\r\n transform: \"scale(1) !important\"\r\n },\r\n \"&:before\": {\r\n display: \"none !important\"\r\n }\r\n },\r\n emptyAlert: {\r\n marginTop: theme.spacing(2)\r\n }\r\n}));\r\n\r\n\r\nexport default function DynamicCard(props) {\r\n const { img, title, description, onClick, delay, disabled } = props;\r\n const classes = useStyles();\r\n\r\n return (\r\n <Fade in timeout={{ enter: delay }}>\r\n <Grid item xs={12} sm={6} md={6}>\r\n <div className={`${classes.card} ${disabled ? classes.disabledCard : \"\"} ${props.className || \"\"}`} onClick={onClick}>\r\n <div className=\"img-container\">\r\n <img src={img} alt=\"artistic rendering of variant\" />\r\n </div>\r\n <Grid container direction=\"column\" className={classes.cardText}>\r\n <Typography variant=\"subtitle1\">\r\n {title}\r\n </Typography>\r\n <Typography variant=\"body2\" color=\"textSecondary\">\r\n {description}\r\n </Typography>\r\n </Grid>\r\n </div>\r\n </Grid>\r\n </Fade>\r\n );\r\n}\r\n","import { useCallback, useRef, useEffect, useMemo } from \"react\";\r\nimport { Popper, Paper, Grow, ClickAwayListener, Portal, Dialog } from \"@mui/material\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport { useDevice } from \"../../providers/DeviceContext\";\r\nimport { useLocation } from \"react-router\";\r\nimport CardHeader from \"./CardHeader\";\r\n\r\nconst useStyles = makeStyles(theme => ({\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 paper: {\r\n overflow: \"hidden\",\r\n borderRadius: theme.spacing(0.5),\r\n background: theme.palette.background.paper\r\n },\r\n grow: {\r\n transformOrigin: \"center top\",\r\n marginTop: \"8px\"\r\n },\r\n dialog: {\r\n \"@media (max-height: 360px)\": {\r\n \"& .MuiDialog-container > div\": {\r\n maxHeight: \"calc(100% - 16px)\"\r\n }\r\n }\r\n }\r\n}));\r\n\r\nconst modifiers = [\r\n {\r\n name: \"preventOverflow\",\r\n options: {\r\n padding: 16\r\n },\r\n },\r\n {\r\n name: \"offset\",\r\n options: {\r\n offset: [-52, 4]\r\n },\r\n }\r\n];\r\n\r\nexport default function DynamicPanel(props) {\r\n const { forceDialog, title, anchorEl, onClose } = props;\r\n const classes = useStyles();\r\n const { isMobilePortraitView } = useDevice();\r\n const location = useLocation();\r\n const viewRef = useRef(null);\r\n const anchorRef = useRef(anchorEl);\r\n anchorRef.current = anchorEl;\r\n\r\n useEffect(() => {\r\n if (!!anchorRef.current && isMobilePortraitView) {\r\n onClose();\r\n }\r\n }, [location.pathname, isMobilePortraitView, onClose]);\r\n\r\n\r\n const onPanelClickAway = useCallback((ev) => {\r\n if (ev.target !== document.body && !!ev.target && viewRef.current) {\r\n const aabb = viewRef.current.getBoundingClientRect();\r\n const x = ev.x;\r\n const y = ev.y;\r\n if (x < aabb.left || x > aabb.right || y < aabb.top || y > aabb.bottom) {\r\n onClose();\r\n }\r\n }\r\n }, [onClose]);\r\n\r\n const panelOpen = !!anchorEl;\r\n const panelId = panelOpen ? \"dynamic-panel\" : undefined;\r\n const paperClasses = useMemo(() => ({ root: classes.paper }), [classes]);\r\n\r\n return <>\r\n {\r\n isMobilePortraitView ? (\r\n panelOpen ? (\r\n <Portal>\r\n <Paper className={classes.paperMobile}>\r\n {!!title ? (\r\n <CardHeader\r\n title={title}\r\n onBack={onClose}\r\n border\r\n />\r\n ) : null}\r\n {props.children}\r\n </Paper>\r\n </Portal>\r\n ) : null\r\n ) : (\r\n forceDialog ? (\r\n <Dialog\r\n open={panelOpen}\r\n onClose={onClose}\r\n maxWidth={false}\r\n className={classes.dialog}\r\n >\r\n {props.children}\r\n </Dialog>\r\n ) : (\r\n <Popper\r\n id={panelId}\r\n open={panelOpen}\r\n onClose={onClose}\r\n anchorEl={anchorEl}\r\n placement=\"bottom\"\r\n modifiers={props.modifiers || modifiers}\r\n >\r\n <Grow in={panelOpen} className={classes.grow}>\r\n <Paper classes={paperClasses} elevation={8} ref={viewRef}>\r\n <ClickAwayListener onClickAway={onPanelClickAway}>\r\n <div>\r\n {props.children}\r\n </div>\r\n </ClickAwayListener>\r\n </Paper>\r\n </Grow>\r\n </Popper>\r\n )\r\n )\r\n }\r\n </>;\r\n}","import { Fragment } from \"react\";\r\nimport fuzzysort from \"fuzzysort\";\r\n\r\n\r\nexport default function FuzzyText(props) {\r\n const { text, query, className } = props;\r\n const result = fuzzysort.single(query, text);\r\n\r\n let elements = [];\r\n let element = \"\";\r\n let matchesIndex = 0;\r\n let opened = false;\r\n\r\n if (!result || !result.target || !result.indexes) {\r\n return (\r\n <span className={className}>\r\n {text}\r\n </span>\r\n );\r\n }\r\n\r\n let target = result.target;\r\n let targetLen = target.length;\r\n let matchesBest = result.indexes;\r\n let key = 0;\r\n\r\n for (let i = 0; i < targetLen; ++i) {\r\n let char = target[i];\r\n if (matchesBest[matchesIndex] === i) {\r\n ++matchesIndex;\r\n\r\n if (!opened) {\r\n opened = true;\r\n if (!!element) {\r\n elements.push(<Fragment key={key++}>{element}</Fragment>);\r\n element = \"\";\r\n }\r\n }\r\n\r\n if (matchesIndex === matchesBest.length) {\r\n elements.push(<b key={key++}>{element + char}</b>);\r\n elements.push(<Fragment key={key++}>{target.substring(i + 1)}</Fragment>);\r\n element = \"\";\r\n break;\r\n }\r\n\r\n } else {\r\n if (opened) {\r\n opened = false;\r\n elements.push((<b key={key++}>{element}</b>));\r\n element = \"\";\r\n }\r\n }\r\n \r\n element += char;\r\n }\r\n\r\n\r\n return (\r\n <span className={className}>\r\n {elements}\r\n </span>\r\n );\r\n}\r\n","import { Fragment } from \"react\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport { Chip, Typography } from \"@mui/material\";\r\nimport { Star as StarIcon } from \"@mui/icons-material\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n root: {\r\n borderRadius: \"4px\",\r\n height: \"24px\",\r\n paddingLeft: theme.spacing(1),\r\n paddingRight: theme.spacing(1),\r\n background: theme.palette.common.tag,\r\n cursor: \"pointer\",\r\n \"& span\": {\r\n padding: 0\r\n },\r\n lineHeight: \"24px\"\r\n },\r\n rootRating: {\r\n borderRadius: \"4px\",\r\n height: \"24px\",\r\n paddingLeft: theme.spacing(1),\r\n paddingRight: theme.spacing(1),\r\n background: theme.palette.common.tag,\r\n \"& span\": {\r\n padding: 0\r\n },\r\n lineHeight: \"0px\"\r\n },\r\n label: {\r\n color: theme.palette.text.secondary\r\n },\r\n icon: {\r\n color: theme.palette.text.secondary,\r\n fontSize: \"16px\"\r\n }\r\n}));\r\n\r\nexport default function Tag(props) {\r\n const { name, rating, className } = props;\r\n const classes = useStyles();\r\n\r\n if (rating !== undefined) {\r\n return (\r\n <Chip\r\n className={`${classes.rootRating} ${className || \"\"}`}\r\n label={\r\n <Fragment>\r\n {Array(rating).fill(0).map((val, idx) => <StarIcon key={idx} className={classes.icon} fontSize=\"inherit\"/>)}\r\n </Fragment>\r\n }\r\n />\r\n );\r\n } else {\r\n return (\r\n <Chip className={`${classes.root} ${className || \"\"}`} label={<Typography className={classes.label} variant=\"caption\">{name}</Typography>} />\r\n );\r\n }\r\n\r\n}","const normalStyle = { fontWeight: \"400\" };\r\n\r\nexport default function WildcardText(props) {\r\n const { text, query } = props;\r\n\r\n if (!query) {\r\n return text;\r\n }\r\n\r\n const queryFragments = query.toLowerCase().split(\" \");\r\n let matches = false;\r\n\r\n const elements = text.split(\" \").map((t, i) => {\r\n const lower = t.toLowerCase();\r\n const fragment = queryFragments.find(f => lower.indexOf(f) !== -1);\r\n\r\n if (!!fragment) {\r\n matches = true;\r\n const indexOf = lower.indexOf(fragment);\r\n\r\n return <span key={i} style={normalStyle}>\r\n {t.substr(0, indexOf)}\r\n <b>{t.substr(indexOf, fragment.length)}</b>\r\n {t.substr(indexOf + fragment.length)}\r\n \r\n </span>\r\n }\r\n\r\n return <span key={i} style={normalStyle}>\r\n {t}\r\n \r\n </span>;\r\n });\r\n\r\n return matches ? elements : text;\r\n}\r\n","import { useState, useMemo } from \"react\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport { Grid, Typography, LinearProgress, Fade } from \"@mui/material\";\r\nimport { Link } from \"react-router-dom\";\r\nimport { Skeleton } from '@mui/material';\r\nimport Tag from \"../atoms/display/Tag\";\r\nimport { OpenInNew as OpenInNewIcon } from \"@mui/icons-material\";\r\nimport { useGroupUrl } from \"../../hooks/useApp\";\r\nimport TimedRemover from \"./display/TimedRemover\";\r\nimport { useLoadedResource } from \"../../hooks/useResources\";\r\nimport WildcardText from \"./WildcardText\";\r\nimport { ReactEditorBlock } from \"@emberly/editor\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n root: {\r\n position: \"relative\",\r\n height: \"auto\",\r\n width: \"100%\",\r\n padding: theme.spacing(2),\r\n borderRadius: theme.spacing(0.5),\r\n overflow: \"hidden\",\r\n userDrag: \"none\",\r\n WebkitUserDrag: \"none\",\r\n userSelect: \"none\",\r\n MozUserSelect: \"none\",\r\n MozUserDrag: \"none\"\r\n },\r\n selected: {\r\n background: theme.palette.common.selectedResource\r\n },\r\n imageItem: {\r\n position: \"relative\",\r\n width: \"88px\",\r\n height: \"64px\",\r\n },\r\n image: {\r\n position: \"absolute\",\r\n width: \"88px\",\r\n height: \"64px\",\r\n borderRadius: theme.spacing(1),\r\n objectFit: \"cover\",\r\n zIndex: 1,\r\n display: \"block\",\r\n userDrag: \"none\",\r\n WebkitUserDrag: \"none\",\r\n userSelect: \"none\",\r\n MozUserSelect: \"none\",\r\n MozUserDrag: \"none\"\r\n },\r\n skeleton: {\r\n position: \"absolute\",\r\n width: \"88px\",\r\n height: \"64px\",\r\n borderRadius: theme.spacing(1),\r\n zIndex: 2\r\n },\r\n imageLoaded: {\r\n opacity: 1\r\n },\r\n rightContainer: {\r\n paddingLeft: theme.spacing(2),\r\n wordBreak: \"break-word\",\r\n maxWidth: \"calc(100% - 96px)\"\r\n },\r\n title: {\r\n display: \"block\",\r\n textOverflow: \"ellipsis\",\r\n wordWrap: \"break-word\",\r\n maxHeight: \"64px\",\r\n overflow: \"hidden\"\r\n },\r\n link: {\r\n color: theme.palette.text.primary,\r\n position: \"relative\",\r\n textDecoration: \"none\",\r\n display: \"block\",\r\n userDrag: \"none\",\r\n WebkitUserDrag: \"none\",\r\n userSelect: \"none\",\r\n MozUserSelect: \"none\",\r\n MozUserDrag: \"none\",\r\n \"@media (hover: hover)\": {\r\n \"&:hover\": {\r\n backgroundColor: theme.palette.grey[500_8]\r\n }\r\n },\r\n },\r\n linkOnQuery: {\r\n color: theme.palette.text.primary,\r\n position: \"relative\",\r\n textDecoration: \"none\",\r\n display: \"block\",\r\n userDrag: \"none\",\r\n WebkitUserDrag: \"none\",\r\n userSelect: \"none\",\r\n MozUserSelect: \"none\",\r\n MozUserDrag: \"none\",\r\n \"@media (hover: hover)\": {\r\n \"&:hover\": {\r\n \"&:before\": {\r\n background: theme.palette.action.hover,\r\n position: \"absolute\",\r\n height: \"100%\",\r\n top: 0,\r\n width: `calc(100% - ${theme.spacing(2)})`,\r\n left: theme.spacing(1),\r\n borderRadius: theme.spacing(1),\r\n content: \"''\",\r\n display: \"block\"\r\n }\r\n },\r\n }\r\n },\r\n linkIcon: {\r\n marginBottom: \"-2px\",\r\n marginLeft: \"2px\"\r\n },\r\n externalLink: {\r\n width: \"fit-content\",\r\n maxWidth: \"100%\",\r\n \"&:hover\": {\r\n color: theme.palette.primary.main\r\n }\r\n },\r\n path: {\r\n display: \"block\",\r\n maxWidth: \"100%\",\r\n marginTop: theme.spacing(0.5),\r\n overflow: \"hidden\",\r\n whiteSpace: \"nowrap\",\r\n textOverflow: \"ellipsis\",\r\n direction: \"rtl\",\r\n textAlign: \"left\"\r\n },\r\n tag: {\r\n marginRight: theme.spacing(1),\r\n marginTop: theme.spacing(1)\r\n },\r\n progress: {\r\n contentVisibility: \"auto\",\r\n containIntrinsicSize: \"0 4px\",\r\n position: \"absolute\",\r\n bottom: 0,\r\n left: 0,\r\n width: \"100%\"\r\n },\r\n noteBlockContainer: {\r\n width: `calc(100%)`,\r\n marginTop: theme.spacing(1),\r\n padding: theme.spacing(1),\r\n borderRadius: \"4px\",\r\n border: `1px solid ${theme.palette.divider}`,\r\n background: theme.palette.background.lowered\r\n },\r\n noteBlock: {\r\n fontSize: \"12px !important\",\r\n paddingLeft: 0,\r\n paddingRight: 0,\r\n width: `calc(100%)`,\r\n position: \"relative\",\r\n \"& td\": {\r\n padding: \"4px\"\r\n }\r\n }\r\n}));\r\n\r\nconst preventDefault = ev => ev.preventDefault();\r\n\r\nexport default function ResourcePreviewItem(props) {\r\n const { resourceId, showPath, onClick, selected, selectManyActive, onSelect, allowPan, query, noteBlocks } = props;\r\n const classes = useStyles();\r\n const groupUrl = useGroupUrl();\r\n const [imgLoaded, setImgLoaded] = useState(false);\r\n const [imgError, setImgError] = useState(false);\r\n const { resource, updateCount, getPath } = useLoadedResource(resourceId);\r\n const nodeId = resource?.parentId || null;\r\n const path = useMemo(() => showPath && resource ? getPath() : null, [getPath, resource, showPath])\r\n\r\n\r\n const tagItems = useMemo(\r\n () => {\r\n if (resource) {\r\n\r\n let t = (resource.tags || []).map(tag => (\r\n <Tag className={classes.tag} name={tag} key={tag} />\r\n ));\r\n\r\n if (resource.rating !== 0) {\r\n t.push(\r\n <Tag className={classes.tag} rating={resource.rating} key=\"rating\" />\r\n );\r\n }\r\n\r\n if (resource.archived) {\r\n t.push(\r\n <Tag className={classes.tag} name=\"Archived\" key=\"archived\" />\r\n );\r\n }\r\n\r\n return t;\r\n } else {\r\n return [];\r\n }\r\n },\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n [resource, updateCount, classes]\r\n );\r\n\r\n const onHandleClick = (ev) => {\r\n if (selectManyActive) {\r\n ev.preventDefault();\r\n onSelect(resource);\r\n } else if (onClick !== undefined) {\r\n ev.preventDefault();\r\n onClick(nodeId, resource.id, resource.contextId);\r\n }\r\n };\r\n\r\n const onImageLoad = () => setImgLoaded(true);\r\n const onImageError = () => setImgError(true);\r\n\r\n const onExternalLink = (ev) => {\r\n if (!selectManyActive) {\r\n ev.preventDefault();\r\n resource.openUrl();\r\n }\r\n };\r\n\r\n const isWorking = resource?.isWorking();\r\n\r\n const renderedNoteBlocks = useMemo(\r\n () => noteBlocks?.length > 0 ? (\r\n <div className={classes.noteBlockContainer}>\r\n {noteBlocks?.filter((_,i) => i < 8).map((block, i) => (\r\n <ReactEditorBlock\r\n key={i}\r\n block={block}\r\n className={classes.noteBlock}\r\n query={query}\r\n />))}\r\n </div>\r\n ) : null, [noteBlocks, query, classes]);\r\n\r\n return resource ? (\r\n <Link to={`${groupUrl}/resource/${resource.id}`} className={!!query ? classes.linkOnQuery : classes.link} onClick={onHandleClick} hash={allowPan ? `#panto=${nodeId}` : \"\"} onDragStart={preventDefault}>\r\n <Grid\r\n className={`${classes.root} ${selected ? classes.selected : \"\"}`}\r\n container justifyContent=\"flex-end\" alignItems=\"flex-start\" direction=\"row\"\r\n >\r\n <Grid item>\r\n <div className={classes.imageItem}>\r\n <TimedRemover in={!imgLoaded}>\r\n <Skeleton variant=\"rectangular\" className={classes.skeleton} />\r\n </TimedRemover>\r\n <Fade in={imgLoaded}>\r\n <img\r\n className={classes.image}\r\n src={resource.getImageUrl(imgError)}\r\n onLoad={onImageLoad}\r\n onError={onImageError}\r\n decoding=\"async\"\r\n loading=\"eager\"\r\n width=\"88px\"\r\n height=\"64px\"\r\n alt=\"\"\r\n />\r\n </Fade>\r\n </div>\r\n </Grid>\r\n\r\n <Grid item container xs direction=\"column\" justifyContent=\"center\" className={classes.rightContainer}>\r\n <Typography variant=\"subtitle2\" color=\"textPrimary\" className={classes.title}>\r\n {resource.incomplete && !isWorking ? \"[Incomplete] \" : \"\"}{(<WildcardText text={resource.name} query={query} />) || \"Resource\"}\r\n </Typography>\r\n {\r\n !!resource.url ? (\r\n <Typography variant=\"caption\" color=\"textSecondary\" className={classes.externalLink} onClick={onExternalLink}>\r\n <WildcardText text={resource.cleanSource} query={query} /><OpenInNewIcon fontSize=\"inherit\" className={classes.linkIcon} />\r\n </Typography>\r\n ) : (\r\n <Typography variant=\"caption\" color=\"textSecondary\">\r\n <WildcardText text={resource.cleanSource} query={query} />\r\n </Typography>\r\n )\r\n }\r\n <Grid item container direction=\"row\" justifyContent=\"flex-start\">\r\n {tagItems}\r\n </Grid>\r\n {\r\n !!path ? (\r\n <Typography variant=\"caption\" color=\"textSecondary\" className={classes.path}>{path}</Typography>\r\n ) : null\r\n }\r\n\r\n\r\n {renderedNoteBlocks}\r\n </Grid>\r\n\r\n\r\n\r\n </Grid>\r\n\r\n {isWorking ? (\r\n <LinearProgress\r\n className={classes.progress}\r\n color=\"primary\"\r\n variant={resource.hasProgress() ? \"determinate\" : \"indeterminate\"}\r\n value={resource.hasProgress() ? resource.getProgress() : undefined}\r\n />\r\n ) : null}\r\n </Link>\r\n ) : (\r\n <Grid\r\n className={classes.root}\r\n container justifyContent=\"flex-end\" alignItems=\"center\"\r\n >\r\n\r\n <Grid item>\r\n <div className={classes.imageItem}>\r\n <img\r\n className={classes.image}\r\n src=\"/assets/placeholder_online.svg\"\r\n decoding=\"async\"\r\n loading=\"eager\"\r\n width=\"88px\"\r\n height=\"64px\"\r\n alt=\"\"\r\n />\r\n </div>\r\n </Grid>\r\n\r\n <Grid item container xs direction=\"column\" justifyContent=\"center\" className={classes.rightContainer}>\r\n <Typography variant=\"subtitle1\" className={classes.title} color=\"textPrimary\">[Resource Deleted]</Typography>\r\n <Grid item container direction=\"row\" justifyContent=\"flex-start\">\r\n {tagItems}\r\n </Grid>\r\n {props.children}\r\n </Grid>\r\n\r\n </Grid>\r\n );\r\n}","import { Collapse, LinearProgress } from \"@mui/material\";\r\nimport { useEffect, useState } from \"react\";\r\n\r\nexport default function DelayedLinearProgress(props) {\r\n const [visible, setVisible] = useState(false);\r\n\r\n useEffect(() => {\r\n const timer = setTimeout(() => setVisible(true), 750);\r\n return () => {\r\n clearTimeout(timer);\r\n };\r\n }, []);\r\n\r\n return (\r\n <Collapse in={visible}>\r\n <LinearProgress {...props} />\r\n </Collapse>\r\n );\r\n}","import { useState, useEffect } from \"react\";\r\n\r\n\r\nexport default function TimedRemover(props) {\r\n const [visible, setVisible] = useState(props.in);\r\n\r\n useEffect(() => {\r\n if (props.in) {\r\n setVisible(true);\r\n } else {\r\n const timer = setTimeout(() => setVisible(false), 1000);\r\n return () => clearTimeout(timer);\r\n }\r\n }, [props.in, setVisible]);\r\n\r\n return visible ? props.children : <div></div>;\r\n}\r\n","import { useState, useCallback } from \"react\";\r\nimport { Grid, Typography, Button, IconButton, Skeleton } from \"@mui/material\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport { CloudUploadOutlined as UploadIcon, Cancel as CancelIcon } from \"@mui/icons-material\";\r\nimport ImageUtility from \"../../../common/ImageUtility\";\r\nimport { usePlanWithFileLimits } from \"../../../hooks/usePlan\";\r\nimport { useHistory } from \"react-router\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n root: {\r\n position: \"relative\",\r\n borderRadius: theme.spacing(0.5),\r\n border: `1px solid ${theme.palette.divider}`,\r\n width: \"100%\",\r\n textAlign: \"center\",\r\n background: theme.palette.background.paper,\r\n \"&:hover\": {\r\n borderColor: theme.palette.grey[700]\r\n },\r\n height: 192,\r\n overflow: \"hidden\"\r\n },\r\n rootActive: {\r\n height: \"90px\"\r\n },\r\n container: {\r\n height: \"88px\"\r\n },\r\n icon: {\r\n width: 64,\r\n height: 64,\r\n position: \"relative\",\r\n color: theme.palette.grey[400],\r\n paddingTop: theme.spacing(3)\r\n },\r\n text: {\r\n textAlign: \"center\",\r\n marginBottom: 0,\r\n marginTop: 0,\r\n paddingLeft: theme.spacing(4),\r\n paddingRight: theme.spacing(4),\r\n marginLeft: \"auto\",\r\n marginRight: \"auto\",\r\n maxWidth: \"300px\"\r\n },\r\n buttonContainer: {\r\n margin: theme.spacing(2),\r\n marginTop: theme.spacing(1),\r\n marginBottom: theme.spacing(0)\r\n },\r\n button: {\r\n background: \"none\"\r\n },\r\n upgradeButton: {\r\n background: \"none\",\r\n color: theme.palette.primary.main\r\n },\r\n formHidden: {\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 },\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 previewImage: {\r\n width: 80,\r\n height: 80,\r\n margin: \"4px\",\r\n position: \"relative\",\r\n imageOrientation: \"from-image\",\r\n objectFit: \"cover\",\r\n borderRadius: \"4px\"\r\n },\r\n fileNameContainer: {\r\n position: \"relative\",\r\n textAlign: \"center\",\r\n overflow: \"hidden\",\r\n textOverflow: \"ellipsis\",\r\n lineHeight: 88,\r\n height: 88\r\n },\r\n fileName: {\r\n position: \"relative\",\r\n textAlign: \"center\",\r\n overflow: \"hidden\",\r\n textOverflow: \"ellipsis\",\r\n lineHeight: \"88px\",\r\n height: 88,\r\n marginLeft: theme.spacing(1),\r\n marginRight: theme.spacing(1)\r\n },\r\n cancelButton: {\r\n color: theme.palette.common.hardIcon,\r\n position: \"relative\",\r\n width: \"100%\",\r\n height: 88,\r\n padding: 0,\r\n margin: 0,\r\n borderRadius: 0\r\n }\r\n}));\r\n\r\nexport default function FileUpload(props) {\r\n const { onChange, existingFileSize } = props;\r\n const classes = useStyles();\r\n const [file, setFile] = useState(null);\r\n const [imgSrc, setImgSrc] = useState(null);\r\n const [isImage, setIsImage] = useState(false);\r\n const hasFile = Boolean(file);\r\n const plan = usePlanWithFileLimits();\r\n const history = useHistory();\r\n\r\n // TODO preview etc\r\n const onSelectFile = useCallback(async (ev) => {\r\n const target = ev.target.length !== 0 ? ev.target.files[0] : null;\r\n const canUpload = await plan.checkIfUploadAllowed(target !== null ? target.size - (typeof existingFileSize === \"number\" ? existingFileSize : 0) : 0);\r\n\r\n if (canUpload) {\r\n if (target !== null) {\r\n\r\n let img = ImageUtility.IsImage(target);\r\n\r\n setIsImage(img);\r\n\r\n if (img) {\r\n let reader = new FileReader();\r\n reader.readAsDataURL(target);\r\n reader.onloadend = () => setImgSrc([reader.result]);\r\n }\r\n }\r\n\r\n setFile(target);\r\n\r\n if (onChange !== undefined) {\r\n onChange(target);\r\n }\r\n }\r\n }, [setFile, setImgSrc, setIsImage, onChange, plan, existingFileSize]);\r\n\r\n const onCancel = useCallback(() => {\r\n setFile(null);\r\n setImgSrc(null);\r\n if (onChange !== undefined) {\r\n onChange(null);\r\n }\r\n }, [setFile, setImgSrc, onChange]);\r\n\r\n const onUpgrade = useCallback((ev) => {\r\n if (!plan.canCreateFiles) {\r\n ev.preventDefault();\r\n ev.stopPropagation();\r\n history.push(\"/app/settings/plans\");\r\n }\r\n },[history, plan]);\r\n\r\n \r\n\r\n return (\r\n <div className={`${classes.root} ${hasFile ? classes.rootActive : \"\"}`}>\r\n {\r\n hasFile ? (\r\n <Grid container justifyContent=\"flex-start\" className={classes.container}>\r\n <Grid item className={classes.container}>\r\n {\r\n isImage ? (\r\n !!imgSrc ? (\r\n <img className={classes.previewImage} src={imgSrc} alt=\"file preview\" />\r\n ) : (\r\n <Skeleton className={classes.previewImage} variant=\"rectangular\" />\r\n )\r\n ) : (\r\n null\r\n )\r\n }\r\n </Grid>\r\n <Grid item xs className={classes.fileNameContainer}>\r\n <Typography variant=\"body1\" className={classes.fileName}>\r\n {file.name}\r\n </Typography>\r\n </Grid>\r\n <Grid item xs={2}>\r\n <IconButton className={classes.cancelButton} onClick={onCancel} size=\"large\">\r\n <CancelIcon />\r\n </IconButton>\r\n </Grid>\r\n </Grid>\r\n ) : (\r\n <>\r\n <form className={classes.formHidden}>\r\n <input\r\n className={classes.inputHidden}\r\n onClick={onUpgrade}\r\n type=\"file\"\r\n name={props.name}\r\n accept=\"*\"\r\n onChange={onSelectFile}\r\n multiple={false}\r\n />\r\n </form>\r\n <Grid container>\r\n <Grid item xs={12}>\r\n <UploadIcon className={classes.icon} />\r\n </Grid>\r\n <Grid item xs={12}>\r\n <Typography className={classes.text} variant=\"body1\">\r\n {plan.canCreateFiles ? \"Drag and release the file you want to attach\" : `File upload unavailble in ${plan.name} Plan`}\r\n </Typography>\r\n </Grid>\r\n <Grid item xs={12} className={classes.buttonContainer}>\r\n {\r\n plan.canCreateFiles ? (\r\n <Button className={classes.button} color=\"neutral\">\r\n Click to browse\r\n </Button>\r\n ) : (\r\n <Button className={classes.upgradeButton} color=\"neutral\">\r\n Upgrade to upload files\r\n </Button>\r\n )\r\n }\r\n </Grid>\r\n </Grid>\r\n </>\r\n )\r\n }\r\n </div >\r\n );\r\n}","import { useCallback, useMemo } from \"react\";\r\nimport { Switch } from \"@mui/material\";\r\nimport { makeStyles } from \"@mui/styles\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n switchRoot: {\r\n width: 40,\r\n height: 26,\r\n padding: 0,\r\n display: 'flex',\r\n '&:active': {\r\n '& .MuiSwitch-thumb': {\r\n width: 26,\r\n },\r\n '& .MuiSwitch-switchBase.Mui-checked': {\r\n transform: 'translateX(10px)',\r\n },\r\n },\r\n '& .MuiSwitch-switchBase': {\r\n padding: 2,\r\n '&.Mui-checked': {\r\n transform: 'translateX(14px)',\r\n color: '#fff',\r\n '& + .MuiSwitch-track': {\r\n opacity: 1,\r\n backgroundColor: theme.palette.primary.main,\r\n },\r\n },\r\n },\r\n '& .MuiSwitch-thumb': {\r\n boxShadow: '0 2px 4px 0 rgb(0 35 11 / 20%)',\r\n width: 22,\r\n height: 22,\r\n borderRadius: 11,\r\n transition: theme.transitions.create(['width'], {\r\n duration: 150,\r\n }),\r\n },\r\n '& .MuiSwitch-track': {\r\n borderRadius: 13,\r\n opacity: 1,\r\n backgroundColor: theme.palette.grey[500_48],\r\n boxSizing: 'border-box',\r\n },\r\n },\r\n}));\r\n\r\nexport default function StandardToggle(props) {\r\n const { className, onChange, disabled, checked, color } = props;\r\n const classes = useStyles();\r\n const onChecked = useCallback(ev => !!onChange ? onChange(ev.target.checked) : null, [onChange]);\r\n\r\n const internalClasses = useMemo(() => ({\r\n root: classes.switchRoot,\r\n }), [classes]);\r\n\r\n return (\r\n <Switch\r\n className={className || \"\"}\r\n checked={checked}\r\n color={color}\r\n disabled={disabled}\r\n onChange={onChecked}\r\n classes={internalClasses}\r\n />\r\n );\r\n}\r\n","import { useMemo, useCallback, useState, useEffect, useRef } from \"react\";\r\nimport { Grid, Chip, InputBase } from \"@mui/material\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport { SharedInputBase } from \"@emberly/dataplane\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n chip: {\r\n lineHeight: \"58px\"\r\n },\r\n input: {\r\n minWidth: \"200px\",\r\n marginLeft: theme.spacing(0.5),\r\n \"&::placeholder\": {\r\n opacity: 1\r\n }\r\n },\r\n warning: {\r\n color: theme.palette.error.main\r\n }\r\n}));\r\n\r\nconst MAX_LEN = { maxLength: 160 };\r\n\r\nexport default function TagSelector(props) {\r\n const classes = useStyles();\r\n const { onAddTag, onRemoveTag, onChange, tags, warning, autoFocus, label, inputRef, value, resourceId, inputId } = props;\r\n const [text, setText] = useState(\"\");\r\n const ref = useRef(null);\r\n\r\n useEffect(() => {\r\n if (value !== null && value !== undefined) {\r\n setText(value);\r\n }\r\n }, [value]);\r\n\r\n const handleSetText = useCallback(ev => {\r\n setText(ev.target.value);\r\n if (onChange !== undefined) {\r\n onChange(ev.target.value);\r\n }\r\n }, [onChange, setText]);\r\n\r\n const handleSubmit = useCallback(ev => {\r\n if (ev.key === \"Enter\") {\r\n const inputText = ev.target.value.trim();\r\n onAddTag(inputText, tags);\r\n setText(\"\");\r\n }\r\n }, [setText, tags, onAddTag]);\r\n\r\n const handleBackspace = useCallback(ev => {\r\n if (ev.keyCode === 8 && ev.target.value === \"\" && tags.length !== 0) {\r\n onRemoveTag(tags[tags.length - 1], tags);\r\n }\r\n }, [onRemoveTag, tags]);\r\n\r\n const renderTags = useMemo(\r\n () => tags.map(tag => <Grid item key={tag}><Chip className={classes.chip} label={tag} onDelete={() => onRemoveTag(tag, tags)} /></Grid>),\r\n [tags, onRemoveTag, classes]\r\n );\r\n\r\n const inputClasses = useMemo(() => ({\r\n input: `${classes.input} ${!!warning ? classes.warning : \"\"}`\r\n }), [warning, classes]);\r\n\r\n useEffect(() => {\r\n if (autoFocus && !!ref.current) {\r\n\r\n if (!!inputRef) {\r\n inputRef.current = ref.current;\r\n }\r\n\r\n setTimeout(() => {\r\n if (!!ref.current) {\r\n ref.current.focus();\r\n }\r\n }, 300);\r\n }\r\n }, [autoFocus, inputRef]);\r\n\r\n return (\r\n <Grid\r\n container\r\n alignItems=\"center\"\r\n justifyContent=\"flex-start\"\r\n spacing={1}\r\n >\r\n {renderTags}\r\n <Grid item xs>\r\n {!!resourceId && !!inputId ?\r\n (\r\n <SharedInputBase\r\n resourceId={resourceId}\r\n inputId={inputId}\r\n inputRef={ref}\r\n classes={inputClasses}\r\n value={text}\r\n inputProps={MAX_LEN}\r\n onChange={handleSetText}\r\n placeholder={label || \"+ Add a tag...\"}\r\n onSubmit={handleSubmit}\r\n onKeyDown={handleBackspace}\r\n autoFocus={autoFocus}\r\n fullWidth\r\n />\r\n ) : (\r\n <InputBase\r\n inputRef={ref}\r\n classes={inputClasses}\r\n value={text}\r\n inputProps={MAX_LEN}\r\n onChange={handleSetText}\r\n placeholder={label || \"+ Add a tag...\"}\r\n onKeyPress={handleSubmit}\r\n onSubmit={handleSubmit}\r\n onKeyDown={handleBackspace}\r\n autoFocus={autoFocus}\r\n fullWidth\r\n />\r\n )\r\n }\r\n </Grid>\r\n </Grid>\r\n );\r\n}\r\n","import { useCallback, useState, useMemo } from \"react\";\r\nimport { useSelector } from \"react-redux\";\r\nimport { Grid, IconButton, Typography, Zoom, Menu, Button, Tooltip } from \"@mui/material\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport { Add as AddIcon, FilterList as FilterListIcon, CheckBoxOutlined as CheckBoxIcon, Close as CloseIcon, MoreVert as MoreVertIcon } from \"@mui/icons-material\";\r\nimport { getRootUrl } from \"../../../hooks/useApp\";\r\nimport { useCanEdit } from \"@emberly/dataplane\";\r\nimport { useHistory, useLocation } from \"react-router\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n grid: {\r\n borderBottom: `1px solid ${theme.palette.divider}`,\r\n paddingLeft: theme.spacing(1),\r\n paddingRight: theme.spacing(1),\r\n background: theme.palette.background.paper,\r\n height: \"56px\"\r\n },\r\n menu: {\r\n borderRadius: theme.spacing(0.5),\r\n minWidth: \"120px\"\r\n },\r\n filterActive: {\r\n color: theme.palette.primary.main\r\n }\r\n}));\r\n\r\nconst anchorOrigin = {\r\n vertical: \"center\",\r\n horizontal: \"left\",\r\n};\r\n\r\nconst transformOrigin = {\r\n vertical: \"top\",\r\n horizontal: \"center\",\r\n};\r\n\r\nexport default function ResourcesControllerDesktop(props) {\r\n const { nodeId, selectedResources, selectManyActive, setSelectManyActive, menuItems } = props;\r\n const history = useHistory();\r\n const location = useLocation();\r\n const { filterActive } = useSelector(state => state.filter);\r\n\r\n const [anchorEl, setAnchorEl] = useState(null);\r\n const open = Boolean(anchorEl);\r\n\r\n const classes = useStyles();\r\n const canEdit = useCanEdit();\r\n\r\n const createResource = useCallback(() => history.push(`${getRootUrl(location.pathname)}/node/${nodeId}/resource/add`), [nodeId, history, location]);\r\n const openFilters = useCallback(() => history.push(`${getRootUrl(location.pathname)}/node/${nodeId}/filter`), [nodeId, history, location]);\r\n const openSelectMany = useCallback(() => ((setSelectManyActive(true), setAnchorEl(null))), [setSelectManyActive]);\r\n const closeSelectMany = useCallback(() => ((setSelectManyActive(false), setAnchorEl(null))), [setSelectManyActive]);\r\n const handleClick = useCallback(ev => setAnchorEl(ev.currentTarget), [setAnchorEl]);\r\n const handleClose = useCallback(() => setAnchorEl(null), [setAnchorEl]);\r\n\r\n const menuClasses = useMemo(() => ({ paper: classes.menu }), [classes]);\r\n\r\n return !selectManyActive ? (\r\n <Grid className={classes.grid} container justifyContent=\"flex-start\" alignItems=\"center\" >\r\n\r\n <Grid item xs>\r\n {\r\n canEdit ? (\r\n <Tooltip title=\"Add new resource to this list\" enterDelay={500}>\r\n <Button color=\"neutral\" onClick={createResource} startIcon={<AddIcon />} className=\"new-resource\">\r\n Add resource\r\n </Button>\r\n </Tooltip>\r\n ) : null\r\n }\r\n </Grid>\r\n\r\n {\r\n canEdit ? (\r\n <Grid item>\r\n <Tooltip title=\"Select many resources\" enterDelay={500}>\r\n <IconButton onClick={openSelectMany} size=\"medium\">\r\n <CheckBoxIcon fontSize=\"small\" />\r\n </IconButton>\r\n </Tooltip>\r\n </Grid>\r\n ) : null\r\n }\r\n\r\n <Grid item>\r\n <Tooltip title=\"Add list filters\" enterDelay={500}>\r\n <IconButton\r\n className={filterActive ? classes.filterActive : \"\"}\r\n onClick={openFilters}\r\n color=\"default\"\r\n size=\"medium\">\r\n <FilterListIcon fontSize=\"small\" />\r\n </IconButton>\r\n </Tooltip>\r\n </Grid>\r\n </Grid >\r\n ) : (\r\n <>\r\n <Grid className={classes.grid} container justifyContent=\"space-around\" alignItems=\"center\">\r\n <Grid item>\r\n <IconButton onClick={closeSelectMany} size=\"medium\">\r\n <CloseIcon fontSize=\"small\" />\r\n </IconButton>\r\n </Grid>\r\n <Grid item xs>\r\n <Typography align=\"center\" variant=\"body1\">{selectedResources.length === 0 ? \"Select resources\" : `${selectedResources.length} Selected resource${selectedResources.length > 1 ? \"s\" : \"\"}`}</Typography>\r\n </Grid>\r\n <Grid item>\r\n <Zoom in={selectedResources.length !== 0}>\r\n <IconButton onClick={handleClick} size=\"medium\">\r\n <MoreVertIcon fontSize=\"small\" />\r\n </IconButton>\r\n </Zoom>\r\n </Grid>\r\n </Grid>\r\n <Menu\r\n classes={menuClasses}\r\n anchorEl={anchorEl}\r\n keepMounted\r\n open={open}\r\n onClose={handleClose}\r\n anchorOrigin={anchorOrigin}\r\n transformOrigin={transformOrigin}\r\n >\r\n {menuItems}\r\n </Menu>\r\n </>\r\n );\r\n}","import { useCallback, useState, useMemo } from \"react\";\r\nimport { useSelector } from \"react-redux\";\r\nimport { Paper, Fab, Grid, IconButton, Typography, Zoom, Menu } from \"@mui/material\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport { Add as AddIcon, FilterList as FilterListIcon, CheckBoxOutlined as CheckBoxIcon, Close as CloseIcon, MoreVert as MoreVertIcon } from \"@mui/icons-material\";\r\nimport { getRootUrl } from \"../../../hooks/useApp\";\r\nimport { useCanEdit } from \"@emberly/dataplane\";\r\nimport { useHistory, useLocation } from \"react-router\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n paperCard: {\r\n position: \"fixed\",\r\n bottom: 0,\r\n right: 0,\r\n width: \"100%\",\r\n borderRadius: 0,\r\n height: \"56px\",\r\n transition: \"transform 0.25s, background 0.25s\",\r\n transform: \"translate3d(0,56px,0)\",\r\n zIndex: 99,\r\n boxShadow: theme.inverseShadows[0]\r\n },\r\n selectManyActive: {\r\n background: theme.palette.primary.main\r\n },\r\n activeCard: {\r\n transform: \"translate3d(0,0,0)\",\r\n },\r\n fab: {\r\n position: \"absolute\",\r\n right: theme.spacing(2),\r\n top: \"-24px\",\r\n width: \"auto\",\r\n height: \"48px\",\r\n borderRadius: \"16px\",\r\n zIndex: 9999999\r\n },\r\n grid: {\r\n position: \"relative\",\r\n width: \"100%\",\r\n height: \"100%\"\r\n },\r\n iconButton: {\r\n zIndex: 999999,\r\n marginLeft: theme.spacing(1.5),\r\n color: theme.palette.common.softIcon\r\n },\r\n leftButton: {\r\n float: \"left\",\r\n color: theme.palette.background.paper\r\n },\r\n rightButton: {\r\n float: \"right\",\r\n color: theme.palette.background.paper\r\n },\r\n selectedText: {\r\n textAlign: \"center\",\r\n userSelect: \"none\",\r\n color: theme.palette.background.paper\r\n },\r\n menu: {\r\n borderRadius: theme.spacing(0.5),\r\n minWidth: \"120px\"\r\n },\r\n filterActive: {\r\n color: theme.palette.primary.main\r\n },\r\n fabIcon: {\r\n marginRight: theme.spacing(1)\r\n }\r\n}));\r\n\r\nconst anchorOrigin = {\r\n vertical: \"center\",\r\n horizontal: \"left\",\r\n};\r\n\r\nconst transformOrigin = {\r\n vertical: \"top\",\r\n horizontal: \"center\",\r\n};\r\n\r\nexport default function ResourcesControllerMobile(props) {\r\n const { nodeId, selectedResources, selectManyActive, setSelectManyActive, active, menuItems } = props;\r\n const history = useHistory();\r\n const location = useLocation();\r\n const { filterActive } = useSelector(state => state.filter);\r\n const [anchorEl, setAnchorEl] = useState(null);\r\n const open = Boolean(anchorEl);\r\n const classes = useStyles();\r\n const canEdit = useCanEdit();\r\n\r\n const createResource = useCallback(() => history.push(`${getRootUrl(location.pathname)}/node/${nodeId}/resource/add`), [nodeId, history, location]);\r\n const openFilters = useCallback(() => history.push(`${getRootUrl(location.pathname)}/node/${nodeId}/filter`), [nodeId, history, location]);\r\n const openSelectMany = useCallback(() => ((setSelectManyActive(true),setAnchorEl(null))), [setSelectManyActive]);\r\n const closeSelectMany = useCallback(() => ((setSelectManyActive(false),setAnchorEl(null))), [setSelectManyActive]);\r\n\r\n const handleClick = useCallback(ev => setAnchorEl(ev.currentTarget), [setAnchorEl]);\r\n const handleClose = useCallback(() => setAnchorEl(null), [setAnchorEl]);\r\n\r\n const menuClasses = useMemo(() => ({ paper: classes.menu }), [classes]);\r\n\r\n return (\r\n <Paper\r\n className={`${classes.paperCard} ${active ? (classes.activeCard) : \"\"} ${selectManyActive ? classes.selectManyActive : \"\"}`}\r\n elevation={2}\r\n >\r\n <Zoom in={active && !selectManyActive && canEdit}>\r\n <Fab color=\"primary\" className={`${classes.fab} new-resource`} onClick={createResource} variant=\"extended\">\r\n <AddIcon className={classes.fabIcon} />\r\n Add resource\r\n </Fab>\r\n </Zoom>\r\n {!selectManyActive ? (\r\n <Grid className={classes.grid} container justifyContent=\"flex-start\" alignItems=\"center\">\r\n <Grid item xs={2}>\r\n <IconButton\r\n className={`${classes.iconButton} ${filterActive ? classes.filterActive : \"\"}`}\r\n onClick={openFilters}\r\n color=\"default\"\r\n size=\"large\">\r\n <FilterListIcon />\r\n </IconButton>\r\n </Grid>\r\n {\r\n canEdit ? (\r\n <Grid item xs={2}>\r\n <IconButton className={classes.iconButton} onClick={openSelectMany} size=\"large\">\r\n <CheckBoxIcon />\r\n </IconButton>\r\n </Grid>\r\n ) : null\r\n }\r\n </Grid>\r\n ) : (\r\n <>\r\n <Grid className={classes.grid} container justifyContent=\"space-around\" alignItems=\"center\">\r\n <Grid item xs={2}>\r\n <IconButton className={classes.leftButton} onClick={closeSelectMany} size=\"large\">\r\n <CloseIcon />\r\n </IconButton>\r\n </Grid>\r\n <Grid item xs={8} className={classes.selectedText}>\r\n <Typography variant=\"subtitle1\">{(selectedResources.length === 0) ? \"Select\" : `${selectedResources.length} Selected`}</Typography>\r\n </Grid>\r\n <Grid item xs={2}>\r\n <Zoom in={selectedResources.length !== 0}>\r\n <IconButton className={classes.rightButton} onClick={handleClick} size=\"large\">\r\n <MoreVertIcon />\r\n </IconButton>\r\n </Zoom>\r\n </Grid>\r\n </Grid>\r\n <Menu\r\n classes={menuClasses}\r\n anchorEl={anchorEl}\r\n keepMounted\r\n open={open}\r\n onClose={handleClose}\r\n anchorOrigin={anchorOrigin}\r\n transformOrigin={transformOrigin}\r\n >\r\n {menuItems}\r\n </Menu>\r\n </>\r\n )\r\n }\r\n </Paper>\r\n );\r\n}","import { Grid, Typography } from \"@mui/material\";\r\nimport { makeStyles } from \"@mui/styles\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n root: {\r\n position: \"absolute\",\r\n height: \"100%\",\r\n width: \"100%\",\r\n padding: theme.spacing(1),\r\n background: theme.palette.background.paper,\r\n zIndex: 999,\r\n pointerEvents: \"none\"\r\n },\r\n grid: {\r\n position: \"relative\",\r\n border: \"4px dashed rgba(0,0,0,0.38)\",\r\n borderRadius: \"12px\",\r\n height: \"100%\",\r\n userSelect: \"none\",\r\n pointerEvents: \"none\"\r\n },\r\n textItem: {\r\n textAlign: \"center\",\r\n marginTop: theme.spacing(6),\r\n userSelect: \"none\",\r\n pointerEvents: \"none\"\r\n },\r\n noInteract: {\r\n userSelect: \"none\",\r\n pointerEvents: \"none\"\r\n },\r\n}));\r\n\r\nexport default function DroppablePanel() {\r\n const classes = useStyles();\r\n\r\n return (\r\n <div className={classes.root}>\r\n <Grid item container xs justifyContent=\"center\" alignItems=\"center\" direction=\"column\" className={classes.grid}>\r\n <Grid item>\r\n <img src=\"/assets/droppable.svg\" className={classes.noInteract} alt=\"droppable\" />\r\n </Grid>\r\n <Grid item className={classes.textItem}>\r\n <Typography variant=\"h6\">\r\n Drop link here to save resource\r\n </Typography>\r\n <Typography variant=\"body1\">\r\n Or, you can drop it directly on a topic<br />\r\n in the tree\r\n </Typography>\r\n </Grid>\r\n </Grid>\r\n </div>\r\n );\r\n}","import { useMemo } from \"react\";\r\nimport { Grid, Typography, Fade } from \"@mui/material\";\r\nimport { makeStyles } from \"@mui/styles\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n root: {\r\n position: \"absolute\",\r\n height: \"100%\",\r\n width: \"100%\",\r\n pointerEvents: \"none\",\r\n overflow: \"hidden\",\r\n zIndex: 0\r\n },\r\n container: {\r\n position: \"relative\",\r\n height: \"100%\",\r\n width: \"100%\",\r\n padding: theme.spacing(1),\r\n pointerEvents: \"none\",\r\n overflow: \"hidden\"\r\n },\r\n textItem: {\r\n textAlign: \"center\",\r\n userSelect: \"none\",\r\n pointerEvents: \"none\",\r\n overflow: \"hidden\"\r\n },\r\n textItemTopMargin: {\r\n marginTop: theme.spacing(7),\r\n },\r\n textItemBottomMargin: {\r\n marginBottom: theme.spacing(7),\r\n }\r\n}));\r\n\r\nexport default function ResourcesEmptyPanel(props) {\r\n const { isEmpty, isFiltered, isEmbed, canEdit, showTopBar, isMobilePortraitView } = props;\r\n const classes = useStyles();\r\n\r\n return useMemo(() => (\r\n <div className={classes.root}>\r\n <Fade in={isEmpty}>\r\n <Grid item container xs justifyContent=\"center\" alignItems=\"center\" direction=\"column\" className={classes.container}>\r\n <Grid item className={`${classes.textItem} ${showTopBar ? classes.textItemTopMargin : (isMobilePortraitView ? classes.textItemBottomMargin : \"\")}`}>\r\n <Typography variant=\"subtitle2\" color=\"textSecondary\">\r\n {isFiltered ? \"No results found\" : (!isEmbed && canEdit ? \"Empty in Resources\" : \"No resources here\")}\r\n </Typography>\r\n {\r\n isFiltered ? (\r\n <Typography variant=\"body2\" color=\"textSecondary\">\r\n Try adjusting your filter to<br />\r\n find what you're looking for.\r\n </Typography>\r\n ) : (\r\n !isEmbed && canEdit ? (\r\n <Typography variant=\"body2\" color=\"textSecondary\">\r\n Tap \"Add resource\" to save a resource<br />\r\n and it will show up here\r\n </Typography>\r\n ) : null\r\n )\r\n }\r\n </Grid>\r\n </Grid>\r\n </Fade>\r\n </div>\r\n ), [classes, isFiltered, isEmpty, isEmbed, canEdit, showTopBar, isMobilePortraitView]);\r\n}","import { useMemo, useCallback, useState, useEffect } from \"react\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport { useSelector } from \"react-redux\";\r\nimport { Grid, Divider, Collapse, LinearProgress } from \"@mui/material\";\r\nimport Scrollbar from \"../atoms/Scrollbar\";\r\nimport ResourcePreviewItem from \"../atoms/ResourcePreviewItem\";\r\nimport DroppablePanel from \"../atoms/DroppablePanel\";\r\nimport ResourcesEmptyPanel from \"../atoms/ResourcesEmptyPanel\";\r\nimport TimedRemover from \"../atoms/display/TimedRemover\";\r\nimport useResources from \"../../hooks/useResources\";\r\nimport { usePlanWithFileLimits } from \"../../hooks/usePlan\";\r\nimport { Draggable, Droppable } from \"react-beautiful-dnd\";\r\nimport { useDevice } from \"../../providers/DeviceContext\";\r\nimport { useContextId, useGroupName, useCanEdit, Task } from \"@emberly/dataplane\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n root: {\r\n touchAction: \"none\"\r\n },\r\n grid: {\r\n paddingTop: theme.spacing(1),\r\n paddingBottom: theme.spacing(3),\r\n minHeight: `calc(100% - ${theme.spacing(4)})`\r\n },\r\n divider: {\r\n width: `calc(100% - ${theme.spacing(4)})`,\r\n marginLeft: theme.spacing(2),\r\n borderWidth: \"0.33px\"\r\n },\r\n clone: {\r\n background: \"rgba(215,215,215,0.30)\",\r\n borderRadius: theme.spacing(1)\r\n }\r\n}));\r\n\r\nexport default function ResourceList(props) {\r\n const { swipeEnabled, nodeId, className, selectManyActive, selectedResources, toggleSelectedResource } = props;\r\n const classes = useStyles();\r\n const { resources, loading, createUrlResource, createFileResource, createResource, updateCount } = useResources(nodeId);\r\n const { isEmbedView, isMobilePortraitView } = useDevice();\r\n\r\n const { filterTags, filterMinRating, filterResourceType, filterSortBy, filterArchived, filterActive } = useSelector(state => state.filter);\r\n const plan = usePlanWithFileLimits();\r\n\r\n const [dragOver, setDragOver] = useState(0);\r\n const [loadingDelay, setLoadingDelay] = useState(false);\r\n const [wasEmpty, setWasEmpty] = useState(false);\r\n const canEdit = useCanEdit();\r\n\r\n const currentContextId = useContextId();\r\n const currentGroupName = useGroupName();\r\n const droppableId = `${currentGroupName};${currentContextId};${nodeId}`;\r\n const canDrag = canEdit && !filterActive && !selectManyActive;\r\n\r\n const filteredResources = useMemo(\r\n () => resources\r\n .filter(\r\n resource =>\r\n (resource.rating >= filterMinRating) &&\r\n ((resource.archived && filterArchived !== \"visible\") || (!resource.archived && filterArchived !== \"archived\")) &&\r\n (filterTags.length === 0 || (!!resource.tags && resource.tags.reduce((total, tag) => filterTags.includes(tag) + total, 0) === filterTags.length)) &&\r\n (filterResourceType === \"any\" || (filterResourceType === \"online\" && !!resource.url) || (filterResourceType === \"offline\" && !resource.url))\r\n )\r\n .sort(\r\n (a, b) => (filterSortBy === \"rating\") * (a.rating - b.rating)\r\n )\r\n .reverse(),\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n [resources, filterTags, filterMinRating, filterResourceType, filterArchived, filterSortBy, updateCount]\r\n );\r\n\r\n const resourceItems = useMemo(\r\n () => filteredResources.map(\r\n (resource, idx, list) => (\r\n <Draggable draggableId={resource.id} index={idx} key={resource.id} isDragDisabled={!canDrag}>\r\n {(provided, snapshot) => (\r\n <Grid\r\n item xs={12}\r\n ref={provided.innerRef}\r\n className=\"draggable-resource\"\r\n {...provided.draggableProps}\r\n {...provided.dragHandleProps}\r\n >\r\n <ResourcePreviewItem\r\n resourceId={resource.id}\r\n selectManyActive={selectManyActive}\r\n onSelect={toggleSelectedResource}\r\n selected={selectedResources.findIndex(t => t.id === resource.id) !== -1}\r\n />\r\n {idx < list.length - 1 && !snapshot.isDragging ? <Divider className={classes.divider} /> : null}\r\n </Grid>\r\n )}\r\n </Draggable>\r\n )),\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n [filteredResources, toggleSelectedResource, selectManyActive, selectedResources, updateCount, classes, canDrag]\r\n );\r\n\r\n const renderClone = useCallback((provided, snapshot, rubric) => {\r\n return (\r\n <Grid\r\n id=\"draggable-clone\"\r\n item xs={12}\r\n {...provided.draggableProps}\r\n {...provided.dragHandleProps}\r\n ref={provided.innerRef}\r\n className={classes.clone}\r\n >\r\n <ResourcePreviewItem\r\n resourceId={rubric.draggableId}\r\n />\r\n </Grid>\r\n );\r\n }, [classes])\r\n\r\n const isEmpty = resourceItems.length === 0;\r\n const isFiltered = resourceItems.length !== resources.length;\r\n\r\n const onDragEnter = useCallback((ev) => {\r\n try {\r\n if (!ev.dataTransfer?.types?.includes(\"editor/sort\")) {\r\n setDragOver(t => t + 1);\r\n }\r\n } catch (err) {\r\n console.log(err)\r\n setDragOver(t => t + 1);\r\n }\r\n }, [setDragOver]);\r\n\r\n const onDragLeave = useCallback((ev) => {\r\n try {\r\n if (!ev.dataTransfer?.types?.includes(\"editor/sort\")) {\r\n setDragOver(t => Math.max(t - 1, 0));\r\n }\r\n } catch (err) {\r\n console.log(err)\r\n setDragOver(t => Math.max(t - 1, 0));\r\n }\r\n }, [setDragOver]);\r\n\r\n const onDragOver = useCallback((ev) => ev.preventDefault(), []);\r\n\r\n useEffect(() => {\r\n if (!loading) {\r\n setWasEmpty(isEmpty);\r\n }\r\n }, [loading, setWasEmpty, isEmpty]);\r\n\r\n const onDrop = useCallback(async (ev) => {\r\n ev.preventDefault();\r\n setDragOver(0);\r\n\r\n if (!canEdit) {\r\n return;\r\n }\r\n\r\n const url = ev.dataTransfer.getData(\"text\");\r\n\r\n if (url.startsWith(\"http\")) {\r\n createUrlResource(undefined, url);\r\n } else {\r\n const files = [...ev.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 plan.checkIfUploadAllowed(fileSizes)) {\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 createFileResource({\r\n name: file.name,\r\n fileSize: file.size,\r\n fileType: file.type,\r\n pending: true\r\n }, { file });\r\n } else {\r\n await createResource({\r\n url: null,\r\n name: file.name,\r\n type: \"note\"\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 }, [setDragOver, canEdit, createUrlResource, createFileResource, createResource, plan]);\r\n\r\n const onPaste = useCallback((ev) => {\r\n\r\n if (!canEdit) {\r\n return;\r\n }\r\n\r\n ev.preventDefault();\r\n let paste = (ev.clipboardData || window.clipboardData);\r\n const files = [...paste.files];\r\n const text = paste.getData(\"text\");\r\n\r\n if (text.startsWith(\"http://\") || text.startsWith(\"https://\")) {\r\n createUrlResource(undefined, text);\r\n } else if (files.length !== 0) {\r\n const fileSizes = files.reduce((sum, file) => sum + file.size, 0);\r\n\r\n if (plan.checkIfUploadAllowed(fileSizes)) {\r\n for (let i = 0; i < files.length; i++) {\r\n let file = files[i];\r\n createFileResource(\r\n {\r\n name: file.name,\r\n fileSize: file.size,\r\n fileType: file.type,\r\n pending: true\r\n },\r\n {\r\n file\r\n }\r\n );\r\n }\r\n }\r\n }\r\n\r\n }, [canEdit, createUrlResource, createFileResource, plan]);\r\n\r\n useEffect(() => {\r\n if (loading) {\r\n const timer = setTimeout(() => setLoadingDelay(true), 750);\r\n return () => {\r\n clearTimeout(timer);\r\n setLoadingDelay(false);\r\n };\r\n }\r\n }, [loading, setLoadingDelay]);\r\n\r\n const showTopBar = !isMobilePortraitView && !loadingDelay && !dragOver && (!isEmbedView || isFiltered || resources.length > 10);\r\n\r\n return useMemo(() => (\r\n <Grid\r\n container\r\n item xs\r\n className={`${classes.root} ${className || \"\"}`}\r\n direction=\"column\" justifyContent=\"flex-start\" alignItems=\"stretch\"\r\n onDragEnter={onDragEnter}\r\n onDragLeave={onDragLeave}\r\n onDrop={onDrop}\r\n onDragOver={onDragOver}\r\n onPaste={onPaste}\r\n >\r\n <Collapse in={showTopBar}>\r\n {props.children}\r\n </Collapse>\r\n\r\n <Grid item>\r\n <Collapse in={loading}>\r\n <TimedRemover in={loading}>\r\n <LinearProgress color=\"neutral\" />\r\n </TimedRemover>\r\n </Collapse>\r\n </Grid>\r\n\r\n {dragOver > 0 && canEdit ? <DroppablePanel /> : null}\r\n\r\n <Grid item xs>\r\n <Scrollbar\r\n swipeEnabled={swipeEnabled}\r\n scrollStateId={`resource-list-${nodeId}`}\r\n loading={loading}\r\n >\r\n <Droppable droppableId={droppableId} renderClone={renderClone}>\r\n {(provided) => (\r\n <div\r\n className={classes.grid}\r\n {...provided.droppableProps}\r\n ref={provided.innerRef}\r\n >\r\n {resourceItems}\r\n {provided.placeholder}\r\n </div>\r\n )}\r\n </Droppable>\r\n </Scrollbar>\r\n </Grid>\r\n\r\n <ResourcesEmptyPanel\r\n isEmbed={isEmbedView}\r\n isEmpty={isEmpty && (!loading || wasEmpty)}\r\n isFiltered={isFiltered}\r\n canEdit={canEdit}\r\n showTopBar={showTopBar}\r\n isMobilePortraitView={isMobilePortraitView}\r\n />\r\n </Grid>\r\n ), [isMobilePortraitView, showTopBar, className, droppableId, props.children, swipeEnabled, classes, renderClone, wasEmpty, onPaste, isFiltered, isEmpty, resourceItems, loading, dragOver, nodeId, onDragOver, onDrop, onDragLeave, onDragEnter, canEdit, isEmbedView]);\r\n}\r\n","import { useMemo, useCallback, useState, useEffect } from \"react\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport { Grid, MenuItem } from \"@mui/material\";\r\nimport ResourcesControllerDesktop from \"./controllers/ResourcesControllerDesktop\";\r\nimport ResourcesControllerMobile from \"./controllers/ResourcesControllerMobile\";\r\nimport useResources from \"../../hooks/useResources\";\r\nimport { ConditionalPortal } from \"../atoms/views/ConditionalPortalView\";\r\nimport ResourceList from \"./ResourceList\";\r\nimport { getRootUrl } from \"../../hooks/useApp\";\r\nimport { useDevice } from \"../../providers/DeviceContext\";\r\nimport { useHistory, useLocation } from \"react-router\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n root: {\r\n position: \"relative\",\r\n height: \"100%\",\r\n width: \"100%\",\r\n touchAction: \"none\"\r\n },\r\n rootMobile: {\r\n position: \"relative\",\r\n height: \"100%\",\r\n width: \"100%\",\r\n touchAction: \"none\",\r\n paddingBottom: \"56px\"\r\n }\r\n}));\r\n\r\nexport default function ControlledResourcesList(props) { // TODO\r\n const { nodeId, controllerEnabled, swipeEnabled, elevatedController } = props;\r\n const classes = useStyles();\r\n const { isMobilePortraitView } = useDevice();\r\n const [selectedResources, setSelectedResources] = useState([]);\r\n const [selectManyActive, setSelectManyActive] = useState(false);\r\n const { beginDeleteResources, beginMoveResources, updateCount } = useResources(nodeId);\r\n const history = useHistory();\r\n const location = useLocation();\r\n const onItemClick = useCallback((operation) => {\r\n\r\n switch (operation) {\r\n case \"delete\":\r\n beginDeleteResources(selectedResources);\r\n setSelectManyActive(false);\r\n break;\r\n case \"move\":\r\n beginMoveResources(selectedResources, () => { }, nodeId === \"inbox\" ? \"inbox-portal\" : null);\r\n setSelectManyActive(false);\r\n break;\r\n case \"addtag\":\r\n history.push({\r\n pathname: `${getRootUrl(location.pathname)}/node/${nodeId}/tags`,\r\n search: `?${selectedResources.map(r => `r=${r.id}`).join(\"&\")}`\r\n });\r\n break;\r\n case \"archive\":\r\n selectedResources.forEach(r => r.setArchived(true));\r\n setSelectManyActive(false);\r\n break;\r\n case \"unarchive\":\r\n selectedResources.forEach(r => r.setArchived(false));\r\n setSelectManyActive(false);\r\n break;\r\n default:\r\n throw new Error(\"unknown operation\");\r\n }\r\n }, [history, selectedResources, nodeId, beginMoveResources, beginDeleteResources, setSelectManyActive, location]);\r\n\r\n const menuItems = useMemo(() => (\r\n [\r\n (selectedResources.findIndex(r => r.isWorking() === true) === -1 ? <MenuItem key=\"move\" onClick={() => onItemClick(\"move\")}>Move</MenuItem> : null),\r\n (<MenuItem key=\"tag\" onClick={() => onItemClick(\"addtag\")}>Add tag</MenuItem>),\r\n (<MenuItem key=\"delete\" onClick={() => onItemClick(\"delete\")}>Delete</MenuItem>),\r\n (selectedResources.findIndex(r => r.isWorking() === true || r.archived === true) === -1 ? <MenuItem key=\"archive\" onClick={() => onItemClick(\"archive\")}>Archive</MenuItem> : null),\r\n (selectedResources.findIndex(r => r.isWorking() === true || r.archived === false) === -1 ? <MenuItem key=\"unarchive\" onClick={() => onItemClick(\"unarchive\")}>Unarchive</MenuItem> : null)\r\n ]\r\n ), [selectedResources, onItemClick]);\r\n\r\n useEffect(() => {\r\n if (selectManyActive) {\r\n return () => setSelectedResources([]);\r\n }\r\n }, [setSelectedResources, selectManyActive])\r\n\r\n useEffect(() => {\r\n setSelectManyActive(false);\r\n }, [location.pathname]);\r\n\r\n const toggleSelectedResource = useCallback((resource) => {\r\n const idx = selectedResources.findIndex(t => t.id === resource.id);\r\n setSelectedResources(idx === -1 ? [...selectedResources, resource] : selectedResources.filter(t => t.id !== resource.id));\r\n }, [selectedResources]);\r\n\r\n useEffect(() => {\r\n if (selectManyActive) {\r\n const timer = setTimeout(() => setSelectedResources(list => list.filter(t => t.parentId === nodeId && !t._deleted)),0);\r\n return () => clearTimeout(timer);\r\n }\r\n }, [updateCount, selectManyActive, nodeId]);\r\n\r\n return (\r\n <>\r\n <ResourceList\r\n className={isMobilePortraitView ? classes.rootMobile : classes.root}\r\n nodeId={nodeId}\r\n selectManyActive={selectManyActive}\r\n selectedResources={selectedResources}\r\n toggleSelectedResource={toggleSelectedResource}\r\n swipeEnabled={swipeEnabled}\r\n >\r\n {!isMobilePortraitView ? (\r\n <Grid item>\r\n <ResourcesControllerDesktop\r\n nodeId={nodeId}\r\n selectedResources={selectedResources}\r\n setSelectManyActive={setSelectManyActive}\r\n selectManyActive={selectManyActive}\r\n menuItems={menuItems}\r\n active\r\n />\r\n </Grid>\r\n ) : null}\r\n </ResourceList>\r\n {\r\n isMobilePortraitView ? (\r\n elevatedController ? (\r\n <ResourcesControllerMobile\r\n nodeId={nodeId}\r\n elevatedController={elevatedController}\r\n selectedResources={selectedResources}\r\n setSelectManyActive={setSelectManyActive}\r\n selectManyActive={selectManyActive}\r\n menuItems={menuItems}\r\n active={controllerEnabled}\r\n />\r\n ) : (\r\n <ConditionalPortal active portalId=\"mapview\">\r\n <ResourcesControllerMobile\r\n nodeId={nodeId}\r\n elevatedController={elevatedController}\r\n selectedResources={selectedResources}\r\n setSelectManyActive={setSelectManyActive}\r\n selectManyActive={selectManyActive}\r\n menuItems={menuItems}\r\n active={controllerEnabled}\r\n />\r\n </ConditionalPortal>\r\n )\r\n ) : null\r\n }\r\n </>\r\n )\r\n}\r\n\r\n","import { useCallback, useState, memo } from \"react\";\r\nimport { Dialog, DialogContent, DialogTitle, Typography, DialogActions, Button, Fab, Popper, MenuItem, ListItemIcon, ListItemText, Divider, MenuList, Paper, ClickAwayListener, Table, TableRow, TableCell, TableBody, IconButton, Tooltip } from \"@mui/material\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport { HelpCenterOutlined as HelpCenterIcon, HelpOutline as HelpIcon, InsertCommentOutlined as InsertCommentIcon } from \"@mui/icons-material\";\r\n\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n fab: {\r\n background: theme.palette.background.paper,\r\n color: theme.palette.common.icon,\r\n overflow: \"hidden\",\r\n \"&:hover\": {\r\n background: theme.palette.background.paper,\r\n color: theme.palette.common.icon,\r\n \"&::after\": {\r\n background: theme.palette.action.hover,\r\n position: \"absolute\",\r\n width: \"100%\",\r\n height: \"100%\",\r\n top: 0,\r\n left: 0,\r\n content: \"''\"\r\n }\r\n },\r\n },\r\n glass: {\r\n background: theme.palette.background.glass,\r\n padding: \"4px\",\r\n borderRadius: \"4px\"\r\n },\r\n iconButton: {\r\n color: theme.palette.neutral.button\r\n },\r\n iconButtonActive: {\r\n color: theme.palette.neutral.button,\r\n background: theme.palette.action.hover\r\n },\r\n paper: {\r\n marginBottom: theme.spacing(2),\r\n \"& a\": {\r\n textDecoration: \"none\"\r\n }\r\n },\r\n menuIcon: {\r\n color: theme.palette.text.primary\r\n },\r\n divider: {\r\n marginTop: theme.spacing(1),\r\n marginBottom: theme.spacing(1),\r\n },\r\n shortcutText: {\r\n whiteSpace: \"nowrap\"\r\n },\r\n table: {\r\n marginTop: theme.spacing(1)\r\n }\r\n}));\r\n\r\nconst shortcuts = [\r\n { cmd: \"Enter\", description: \"Add new child\" },\r\n { cmd: \"Ctrl + Enter\", description: \"Add new sibling\" },\r\n { cmd: \"Delete\", description: \"Delete selected topic\" },\r\n { cmd: \"1 to 5\", description: \"Set topic rating\" },\r\n { cmd: \"F or H\", description: \"Set Flag or Heart\" },\r\n { cmd: \"C\", description: \"Collapse selected topic\" },\r\n { cmd: \"+\", description: \"Zoom in\" },\r\n { cmd: \"-\", description: \"Zoom out\" },\r\n { cmd: \"Ctrl + F\", description: \"Open search menu\" },\r\n { cmd: \"Arrows ↠→ ↑ ↓\", description: \"Navigate tree\" }\r\n];\r\n\r\n\r\nexport default memo(function HelpCenterController(props) {\r\n const { className, size } = props;\r\n const classes = useStyles();\r\n const [anchorEl, setAnchorEl] = useState(null);\r\n const [shortcutsOpen, setShortcutsOpen] = useState(false);\r\n\r\n const handleClick = useCallback((ev) => {\r\n setAnchorEl(t => t ? null : ev.currentTarget);\r\n }, []);\r\n\r\n const handleClose = useCallback((ev) => {\r\n setAnchorEl(null);\r\n }, []);\r\n\r\n const handleShortcutsClose = useCallback(() => setShortcutsOpen(false), []);\r\n\r\n\r\n const openKeyboardShortcuts = useCallback(() => {\r\n setAnchorEl(null);\r\n setShortcutsOpen(true);\r\n }, []);\r\n\r\n\r\n return (\r\n <>\r\n {\r\n size === \"small\" ? (\r\n <div className={`${classes.glass} ${className || \"\"}`}>\r\n <Tooltip title=\"Help and resources\" enterDelay={500}>\r\n <IconButton\r\n onClick={handleClick}\r\n className={anchorEl ? classes.iconButtonActive : classes.iconButton}\r\n size=\"medium\"\r\n >\r\n <HelpIcon fontSize=\"small\" />\r\n </IconButton>\r\n </Tooltip>\r\n </div>\r\n ) : (\r\n <Fab\r\n onClick={handleClick}\r\n color=\"neutral\"\r\n className={`${classes.fab} ${className || \"\"}`}\r\n size={size || \"medium\"}\r\n >\r\n <HelpIcon />\r\n </Fab>\r\n )\r\n }\r\n\r\n <Popper\r\n id=\"help-menu\"\r\n anchorEl={anchorEl}\r\n open={Boolean(anchorEl)}\r\n onClose={handleClose}\r\n placement=\"top-end\"\r\n >\r\n <ClickAwayListener onClickAway={handleClose}>\r\n <Paper elevation={3} className={classes.paper}>\r\n <MenuList>\r\n\r\n <a href=\"https://blog.ember.ly/tag/getting-started/\" target=\"_blank\" rel=\"noreferrer\">\r\n <MenuItem>\r\n <ListItemIcon>\r\n <HelpCenterIcon fontSize=\"small\" className={classes.menuIcon} />\r\n </ListItemIcon>\r\n <ListItemText>\r\n <Typography variant=\"body2\" color=\"textPrimary\">\r\n Help guides\r\n </Typography>\r\n </ListItemText>\r\n </MenuItem>\r\n </a>\r\n\r\n <a href=\"mailto:hi@ember.ly\" target=\"_blank\" rel=\"noreferrer\">\r\n <MenuItem>\r\n <ListItemIcon>\r\n <InsertCommentIcon fontSize=\"small\" className={classes.menuIcon} />\r\n </ListItemIcon>\r\n <ListItemText>\r\n <Typography variant=\"body2\" color=\"textPrimary\">\r\n Send us a message\r\n </Typography>\r\n </ListItemText>\r\n </MenuItem>\r\n </a>\r\n\r\n <Divider className={classes.divider} />\r\n\r\n\r\n <MenuItem>\r\n <Typography variant=\"body2\" onClick={openKeyboardShortcuts} color=\"textPrimary\">\r\n Keyboard shortcuts\r\n </Typography>\r\n </MenuItem>\r\n\r\n <a href=\"https://blog.ember.ly/tag/announcement/\" target=\"_blank\" rel=\"noreferrer\">\r\n <MenuItem>\r\n <Typography variant=\"body2\" color=\"textPrimary\">\r\n What’s new?\r\n </Typography>\r\n </MenuItem>\r\n </a>\r\n\r\n <Divider className={classes.divider} />\r\n\r\n <a href=\"https://blog.ember.ly\" target=\"_blank\" rel=\"noreferrer\">\r\n <MenuItem>\r\n <Typography variant=\"caption\" color=\"textSecondary\">\r\n Emberly blog\r\n </Typography>\r\n </MenuItem>\r\n </a>\r\n\r\n\r\n <a href=\"https://ember.ly/privacy.html\" target=\"_blank\" rel=\"noreferrer\">\r\n <MenuItem>\r\n <Typography variant=\"caption\" color=\"textSecondary\">\r\n Privacy notice\r\n </Typography>\r\n </MenuItem>\r\n </a>\r\n\r\n <a href=\"https://ember.ly/policy.html\" target=\"_blank\" rel=\"noreferrer\">\r\n <MenuItem>\r\n <Typography variant=\"caption\" color=\"textSecondary\">\r\n Terms and conditions\r\n </Typography>\r\n </MenuItem>\r\n </a>\r\n\r\n </MenuList>\r\n </Paper>\r\n </ClickAwayListener>\r\n </Popper>\r\n\r\n\r\n <Dialog open={shortcutsOpen} onClose={handleShortcutsClose}>\r\n <DialogTitle>Keyboard shortcuts</DialogTitle>\r\n <DialogContent>\r\n <Table size=\"small\" className={classes.table}>\r\n <TableBody>\r\n {\r\n shortcuts.map((entry, index) => (\r\n <TableRow key={index}>\r\n <TableCell>\r\n <Typography variant=\"subtitle2\" className={classes.shortcutText}>{entry.cmd}</Typography>\r\n </TableCell>\r\n <TableCell>\r\n <Typography variant=\"body2\" className={classes.shortcutText}>{entry.description}</Typography>\r\n </TableCell>\r\n </TableRow>\r\n ))\r\n }\r\n </TableBody>\r\n </Table>\r\n </DialogContent>\r\n <DialogActions>\r\n <Button onClick={handleShortcutsClose} color=\"neutral\" variant=\"contained\">Close</Button>\r\n </DialogActions>\r\n </Dialog>\r\n </>\r\n );\r\n});","import { Grid } from \"@mui/material\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport CardHeader from \"../../atoms/CardHeader\";\r\nimport ControlledResourcesList from \"../../molecules/ControlledResourcesList\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n root: {\r\n position: \"absolute\",\r\n width: \"100%\",\r\n height: \"100%\"\r\n }\r\n}));\r\n\r\nexport default function InboxView(props) {\r\n const { onClose } = props;\r\n const classes = useStyles();\r\n\r\n return (\r\n <Grid className={classes.root} container spacing={0} direction=\"column\" justifyContent=\"flex-start\" alignItems=\"stretch\">\r\n <CardHeader title=\"Inbox\" border onBack={onClose}/>\r\n <ControlledResourcesList nodeId=\"inbox\" controllerEnabled elevatedController />\r\n </Grid>\r\n );\r\n}","import { makeStyles } from \"@mui/styles\";\r\nimport { Router, Route, Switch, Redirect, useHistory } from \"react-router-dom\";\r\nimport { GroupContextProvider } from \"@emberly/dataplane\";\r\nimport { createMemoryHistory } from \"history\";\r\nimport InboxView from \"../../organisms/views/InboxView\";\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 { useEffect } from \"react\";\r\nimport { ConditionalPortalView } from \"../../atoms/views/ConditionalPortalView\";\r\nimport FilterView from \"../../organisms/views/FilterView\";\r\nimport ResourceMultiTagsView from \"../../organisms/views/ResourceMultiTagsView\";\r\nimport { useDevice } from \"../../../providers/DeviceContext\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n root: {\r\n position: \"relative\",\r\n width: \"392px\",\r\n maxWidth: \"100vw\",\r\n minHeight: \"70vh\",\r\n height: \"500px\",\r\n maxHeight: \"85vh\",\r\n overflow: \"hidden\"\r\n },\r\n rootMobile: {\r\n position: \"absolute\",\r\n width: \"100%\",\r\n height: \"100%\"\r\n }\r\n}));\r\n\r\nconst mHistory = createMemoryHistory();\r\n\r\nexport default function InboxPanel(props) {\r\n const { isMobilePortraitView } = useDevice();\r\n const { initialRoute, onClose, setInitialRoute, scopedHistory } = props;\r\n const classes = useStyles();\r\n const history = useHistory();\r\n\r\n useEffect(() => {\r\n if (!!initialRoute) {\r\n mHistory.push(initialRoute);\r\n setInitialRoute(null);\r\n }\r\n }, [initialRoute, setInitialRoute]);\r\n\r\n return (\r\n <div className={isMobilePortraitView ? classes.rootMobile : classes.root}>\r\n <GroupContextProvider>\r\n <Router history={mHistory}>\r\n <Switch>\r\n <Route path=\"/node/inbox/\" exact>\r\n <InboxView onClose={onClose} />\r\n </Route>\r\n <Route path=\"/node/:nodeId?/resource/add\">\r\n <ResourceCreateView scopedHistory={scopedHistory}/>\r\n </Route>\r\n <Route path=\"/node/:nodeId?/filter\" component={FilterView} />\r\n <Route path=\"/node/:nodeId?/tags\" component={ResourceMultiTagsView} />\r\n <Route path=\"/resource/:resourceId?/tags\" component={ResourceTagsView} />\r\n <Route path=\"/resource/:resourceId?/edit\" component={ResourceEditView} />\r\n <Route path=\"/resource/:resourceId?\">\r\n <ResourceView history={history}/>\r\n </Route>\r\n <Redirect to=\"/node/inbox/\" />\r\n </Switch>\r\n </Router>\r\n </GroupContextProvider>\r\n <ConditionalPortalView portalId=\"inbox-portal\" />\r\n </div>\r\n );\r\n}\r\n","import { useCallback, useState, useRef, useEffect } from \"react\";\r\nimport { IconButton, Tooltip, Badge } from \"@mui/material\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport { InboxOutlined as InboxIcon } from \"@mui/icons-material\";\r\nimport InboxPanel from \"../panels/InboxPanel\";\r\nimport { useChildren } from \"@emberly/dataplane\";\r\nimport { useDevice } from \"../../../providers/DeviceContext\";\r\nimport { useHistory } from \"react-router\";\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 badge: {\r\n background: theme.palette.error.main\r\n },\r\n activeIcon: {\r\n color: theme.palette.primary.main\r\n },\r\n}));\r\n\r\nconst modifiers = [\r\n {\r\n name: \"preventOverflow\",\r\n options: {\r\n padding: 16\r\n },\r\n },\r\n {\r\n name: \"offset\",\r\n options: {\r\n offset: [-24, 4] // TODO add more offset if we are deploying with the advisor.\r\n },\r\n }\r\n];\r\n\r\nexport default function InboxController(props) {\r\n const { slimMode, rounded } = props;\r\n const classes = useStyles();\r\n const { children } = useChildren(\"Resource\", \"inbox\", true, \"default\");\r\n const [anchorEl, setAnchorEl] = useState(null);\r\n const [initialRoute, setInitialRoute] = useState(null);\r\n const { isPublicAccess } = useDevice();\r\n const history = useHistory();\r\n const buttonRef = useRef(null);\r\n const anchorRef = useRef(anchorEl);\r\n anchorRef.current = anchorEl;\r\n\r\n const onInboxPanelClick = useCallback((ev) => {\r\n const target = ev.currentTarget;\r\n setAnchorEl(t => !!t ? null : target);\r\n }, []);\r\n\r\n const onInboxPanelClose = useCallback(() => setAnchorEl(null), []);\r\n\r\n useEffect(() => {\r\n if (!!buttonRef.current && !isPublicAccess) {\r\n const params = new URLSearchParams(window.location.search);\r\n const hasShareTarget = params.has(\"text\") || params.has(\"url\");\r\n\r\n if (hasShareTarget) {\r\n setInitialRoute(\"/node/inbox/resource/add\");\r\n setAnchorEl(buttonRef.current);\r\n } else if (params.has(\"inbox\")) {\r\n const inboxRoute = params.get(\"inbox\");\r\n setInitialRoute(!!inboxRoute ? `/resource/${inboxRoute}` : `/node/inbox`);\r\n setAnchorEl(buttonRef.current);\r\n const newParams = [...params.entries()].filter(t => t[0] !== \"inbox\").map(t => `${t[0]}=${t[1]}`).join(\"&\");\r\n window.history.replaceState({}, document.title, window.location.pathname + (newParams ? `?${newParams}` : \"\"));\r\n history.replaceWithoutParams();\r\n\r\n } else {\r\n setInitialRoute(null);\r\n }\r\n }\r\n }, [isPublicAccess, history]);\r\n\r\n return (\r\n <>\r\n <Tooltip title=\"Resource inbox\" enterDelay={500} placement={slimMode ? \"left\" : undefined}>\r\n <IconButton\r\n ref={buttonRef}\r\n className={`${rounded ? classes.iconButtonRounded : classes.iconButton} inbox-controller`}\r\n onClick={onInboxPanelClick}\r\n size=\"large\">\r\n <Badge color=\"primary\" classes={{ badge: classes.badge }} overlap=\"circular\" variant=\"dot\" invisible={children.length === 0 || children.every(t => t.archived)}>\r\n <InboxIcon className={!!anchorEl ? classes.activeIcon : undefined} />\r\n </Badge>\r\n </IconButton>\r\n </Tooltip>\r\n <DynamicPanel\r\n forceDialog={slimMode}\r\n anchorEl={anchorEl}\r\n onClose={onInboxPanelClose}\r\n modifiers={modifiers}\r\n >\r\n <InboxPanel initialRoute={initialRoute} setInitialRoute={setInitialRoute} onClose={onInboxPanelClose} scopedHistory={history} />\r\n </DynamicPanel>\r\n </>\r\n );\r\n}","import { useState, useEffect } from \"react\";\r\nimport { Grid, Typography, CircularProgress, Fade } from \"@mui/material\";\r\nimport { makeStyles } from \"@mui/styles\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n root: {\r\n padding: theme.spacing(5),\r\n paddingTop: theme.spacing(6),\r\n width: \"100%\",\r\n height: \"100%\",\r\n position: \"relative\",\r\n \"@media (max-height: 325px)\": {\r\n paddingTop: theme.spacing(2)\r\n }\r\n },\r\n quoteContainer: {\r\n position: \"relative\",\r\n paddingBottom: \"72px\",\r\n \"@media (max-height: 325px)\": {\r\n paddingBottom: \"48px\"\r\n }\r\n },\r\n quote: {\r\n top: \"36px\",\r\n position: \"absolute\",\r\n maxWidth: \"300px\"\r\n },\r\n spinnerContainer: {\r\n position: \"relative\"\r\n },\r\n spinner: {\r\n color: theme.palette.action.active\r\n }\r\n}));\r\n\r\nconst Quotes = [\r\n \"Reaching out to the great cloud in the sky\",\r\n \"Did you know that AI can make mistakes sometimes? Just like us.\",\r\n \"Get ready!\",\r\n \"Consulting the great sages of mind mapping\",\r\n \"Tip: AI can make a great mind map, but it's up to you to make it perfect!\",\r\n \"Mining the depths of the internet for inspiration\",\r\n \"Spinning up hamster wheel of inspiration\",\r\n \"We will open the map for you once it has been finished\",\r\n \"Relying on the wisdom of the crowds\",\r\n \"Creating a map from the collective wisdom of the universe\",\r\n \"The robot is crafting a map just for you!\",\r\n];\r\n\r\nconst FadeDuration = {\r\n enter: 950,\r\n exit: 950\r\n};\r\n\r\nexport default function CreateMapLoadingScreen() {\r\n const classes = useStyles();\r\n const [quoteIndex, setQuoteIndex] = useState(Math.floor(Math.random() * Quotes.length));\r\n const [showQuote, setShowQuote] = useState(false);\r\n\r\n useEffect(() => {\r\n let state = 0;\r\n\r\n const timer = setInterval(() => {\r\n switch (state) {\r\n case 0:\r\n setQuoteIndex(idx => (idx + 1) % Quotes.length);\r\n setShowQuote(true);\r\n state++;\r\n break;\r\n case 3:\r\n setShowQuote(false);\r\n state = 0;\r\n break;\r\n default:\r\n state++;\r\n break;\r\n }\r\n }, 1000);\r\n\r\n return () => {\r\n clearInterval(timer);\r\n };\r\n }, []);\r\n\r\n return (\r\n <Grid container justifyContent=\"center\" alignItems=\"center\" direction=\"column\" className={classes.root} spacing={1}>\r\n\r\n <Grid item className={classes.spinnerContainer}>\r\n <Fade in>\r\n <CircularProgress className={classes.spinner} />\r\n </Fade>\r\n </Grid>\r\n\r\n <Grid item container alignItems=\"center\" direction=\"column\" className={classes.quoteContainer}>\r\n <Typography variant=\"body1\" textAlign=\"center\">\r\n Generating map...\r\n </Typography>\r\n <Fade in={showQuote} timeout={FadeDuration}>\r\n <Typography variant=\"body1\" color=\"textSecondary\" className={classes.quote} textAlign=\"center\">\r\n {Quotes[quoteIndex]}\r\n </Typography>\r\n </Fade>\r\n </Grid>\r\n </Grid>\r\n );\r\n}\r\n","import { Fade, Collapse, Grid, Typography, FilledInput, Button, CircularProgress } from \"@mui/material\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport { useEffect, useState, useRef } from \"react\";\r\nimport { useDispatch } from \"react-redux\";\r\nimport { useHistory } from \"react-router\";\r\nimport { useDevice } from \"../../../providers/DeviceContext\";\r\nimport { useCollection } from \"@emberly/dataplane\";\r\nimport { DisplayNotification } from \"../../../actions/app\";\r\nimport CardHeader from \"../../atoms/CardHeader\";\r\nimport CreateMapLoadingScreen from \"../../atoms/display/CreateMapLoadingScreen\";\r\nimport DynamicCard from \"../../atoms/DynamicCard\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n root: {\r\n position: \"relative\",\r\n width: \"685px\",\r\n maxWidth: \"100%\",\r\n height: \"auto\",\r\n maxHeight: \"95vh\",\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 position: \"relative\",\r\n padding: theme.spacing(6),\r\n paddingBottom: theme.spacing(4),\r\n paddingTop: theme.spacing(5),\r\n \"@media (max-height: 380px)\": {\r\n padding: theme.spacing(2),\r\n }\r\n },\r\n scrollbarMobile: {\r\n position: \"relative\",\r\n padding: theme.spacing(2)\r\n },\r\n header: {\r\n marginBottom: theme.spacing(3),\r\n \"@media (max-height: 325px)\": {\r\n marginBottom: theme.spacing(1),\r\n \"& p\": {\r\n display: \"none\"\r\n }\r\n }\r\n },\r\n buttonGrid: {\r\n marginBottom: theme.spacing(2)\r\n },\r\n grid: {\r\n position: \"relative\"\r\n },\r\n input: {\r\n border: `1px solid ${theme.palette.divider}`,\r\n position: \"relative\",\r\n borderRadius: \"4px\",\r\n minHeight: \"56px\",\r\n height: \"auto\",\r\n marginBottom: theme.spacing(4),\r\n paddingTop: theme.spacing(1),\r\n paddingBottom: theme.spacing(1),\r\n \"& input\": {\r\n \"&::placeholder\": {\r\n ...theme.typography.body1\r\n }\r\n },\r\n \"@media (max-height: 325px)\": {\r\n marginBottom: theme.spacing(1)\r\n }\r\n },\r\n charCounter: {\r\n position: \"absolute\",\r\n bottom: theme.spacing(4),\r\n right: theme.spacing(2)\r\n },\r\n collapse: {\r\n width: \"100%\"\r\n },\r\n loadingContainer: {\r\n width: \"100%\",\r\n marginTop: \"96px\"\r\n },\r\n card: {\r\n \"& .img-container\": {\r\n maxHeight: \"20vh\"\r\n }\r\n }\r\n}));\r\n\r\nconst MAX_LEN = { maxLength: 96 };\r\n\r\n\r\nexport default function CreateMapPanel(props) {\r\n const { createEntity, onClose } = props;\r\n const classes = useStyles();\r\n const { isMobilePortraitView } = useDevice();\r\n const [templateMode, setTemplateMode] = useState(false);\r\n const [loading, setLoading] = useState(false);\r\n const [text, setText] = useState(\"\");\r\n const dispatch = useDispatch();\r\n const history = useHistory();\r\n const { collection } = useCollection(\"Map\", \"default\");\r\n const navigateOnCompleteRef = useRef(false);\r\n const mountedRef = useRef(true);\r\n navigateOnCompleteRef.current = loading;\r\n\r\n useEffect(() => {\r\n return () => {\r\n mountedRef.current = false;\r\n };\r\n }, []);\r\n\r\n\r\n const handleCreateMap = () => {\r\n setLoading(true);\r\n const metadata = typeof createEntity === \"function\" ? createEntity() : {};\r\n collection.createEntity({ ...metadata, name: \"New Map\", templateQuery: templateMode ? text : undefined }).then(entity => {\r\n setText(\"\");\r\n entity.commit().then(_ => {\r\n if (navigateOnCompleteRef.current && mountedRef.current) {\r\n setLoading(false);\r\n onClose();\r\n history.push(`/map/${entity.publicUserId}/${entity.id}${templateMode ? \"\" : \"/edit\"}`);\r\n }\r\n });\r\n }).catch(err => {\r\n console.log(err);\r\n setLoading(false);\r\n dispatch(DisplayNotification(\"Issue creating new map, try again later!\"));\r\n });\r\n };\r\n\r\n const charsRemaining = MAX_LEN.maxLength - text.length;\r\n\r\n const onKeyDown = (ev) => {\r\n if (ev.code === \"Enter\" || ev.code === \"NumpadEnter\") {\r\n ev.preventDefault();\r\n if (!!text && text.length > 0) {\r\n handleCreateMap();\r\n }\r\n }\r\n };\r\n\r\n return (\r\n <>\r\n {isMobilePortraitView ? (\r\n <CardHeader\r\n title=\"Create map\"\r\n onBack={() => {\r\n if (templateMode && !loading) {\r\n setTemplateMode(false);\r\n } else {\r\n onClose();\r\n }\r\n }}\r\n border\r\n />\r\n ) : null}\r\n <Grid container direction=\"column\" spacing={0} className={isMobilePortraitView ? classes.rootMobile : classes.root}>\r\n <Grid item container direction=\"row\" className={`${classes.scrollbar} ${isMobilePortraitView ? classes.scrollbarMobile : \"\"}`}>\r\n\r\n <Show in={!loading}>\r\n <Grid item container alignItems=\"flex-start\" direction=\"column\" xs={12} className={classes.header}>\r\n {!isMobilePortraitView ? (\r\n <Typography variant=\"h4\">\r\n {\r\n templateMode ? \"Create AI template\" : \"Create new map\"\r\n }\r\n </Typography>\r\n ) : null}\r\n <Typography variant=\"body1\" color=\"textSecondary\">\r\n {templateMode ? (\r\n \"Write a description of what you want your map to be about.\"\r\n ) : (\r\n \"Choose how to start your new map. Start from scratch, or have the AI help you.\"\r\n )}\r\n </Typography>\r\n </Grid>\r\n </Show>\r\n\r\n <Show in={!templateMode && !loading} className={classes.collapse}>\r\n <Grid item container xs={12} justifyContent=\"center\" spacing={2} className={classes.buttonGrid}>\r\n <DynamicCard\r\n className={classes.card}\r\n img=\"/assets/cards/new_blank_map.jpg\"\r\n title=\"Blank map\"\r\n description=\"Start from scratch with a blank map.\"\r\n onClick={handleCreateMap}\r\n delay={350}\r\n />\r\n <DynamicCard\r\n className={classes.card}\r\n img=\"/assets/cards/new_ai_template.jpg\"\r\n title=\"AI template\"\r\n description=\"Let the AI help you get started with your mind-map.\"\r\n onClick={() => ((setTemplateMode(true), setText(\"\")))}\r\n delay={350}\r\n />\r\n </Grid>\r\n </Show>\r\n\r\n <Show in={templateMode && !loading} className={classes.collapse}>\r\n <Grid item xs={12} container justifyContent=\"center\" direction=\"row\" spacing={2}>\r\n <Grid item xs={12} className={classes.grid}>\r\n <FilledInput\r\n className={classes.input}\r\n value={text}\r\n onChange={(ev) => setText(ev.target.value)}\r\n disableUnderline\r\n fullWidth\r\n autoComplete=\"off\"\r\n autoFocus={false}\r\n multiline\r\n size=\"small\"\r\n hiddenLabel\r\n placeholder=\"Write you query here. Example: “Italian food recipiesâ€\"\r\n inputProps={MAX_LEN}\r\n onKeyDown={onKeyDown}\r\n />\r\n {\r\n charsRemaining < 24 ? (\r\n <Typography variant=\"caption\" color=\"textSecondary\" className={classes.charCounter}>\r\n {charsRemaining} character{charsRemaining !== 1 ? \"s\" : \"\"} left\r\n </Typography>\r\n ) : null\r\n }\r\n </Grid>\r\n <Grid item container spacing={1} justifyContent={isMobilePortraitView ? \"center\" : \"flex-end\"}>\r\n {\r\n !isMobilePortraitView ? (\r\n <Grid item>\r\n <Button variant=\"outlined\" color=\"neutral\" fullWidth={isMobilePortraitView} size=\"large\" onClick={() => setTemplateMode(false)}>\r\n Cancel\r\n </Button>\r\n </Grid>\r\n ) : null\r\n }\r\n <Grid item xs={isMobilePortraitView ? 12 : undefined}>\r\n <Button variant=\"contained\" fullWidth={isMobilePortraitView} size=\"large\" onClick={handleCreateMap} disabled={text.length === 0}>\r\n Generate map\r\n </Button>\r\n </Grid>\r\n </Grid>\r\n </Grid>\r\n </Show>\r\n\r\n {templateMode ? (\r\n <Show in={loading} className={classes.collapse}>\r\n <Grid item xs={12} container direction=\"column\" alignItems=\"center\">\r\n <CreateMapLoadingScreen />\r\n </Grid>\r\n </Show>\r\n ) : loading && isMobilePortraitView ? (\r\n <Fade in={loading} timeout={{ enter: 3500 }}>\r\n <Grid item xs={12} container direction=\"column\" alignItems=\"center\" justifyContent=\"center\" className={classes.loadingContainer}>\r\n <CircularProgress variant=\"indeterminate\" />\r\n </Grid>\r\n </Fade>\r\n ) : null}\r\n\r\n </Grid>\r\n </Grid>\r\n </>\r\n );\r\n}\r\n\r\nfunction Show(props) {\r\n return (\r\n <Collapse in={props.in} className={props.className}>\r\n <Fade in={props.in}>\r\n {props.children}\r\n </Fade>\r\n </Collapse>\r\n );\r\n}","import { makeStyles } from \"@mui/styles\";\r\nimport { FlagOutlined as FlagIcon, Favorite as FavoriteIcon, FiberManualRecord as RatingIcon } from \"@mui/icons-material\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n ratingIcon: {\r\n color: theme.palette.secondary.main,\r\n marginLeft: \"0px\",\r\n marginRight: \"-4px\",\r\n fontSize: \"18px\",\r\n marginBottom: \"-3.5px\"\r\n },\r\n flag: {\r\n color: \"#555\",\r\n marginLeft: \"0px\",\r\n fontSize: \"16px\",\r\n marginBottom: \"-2px\"\r\n },\r\n heart: {\r\n color: theme.palette.common.heart,\r\n marginLeft: \"1px\",\r\n fontSize: \"16px\",\r\n marginBottom: \"-2px\"\r\n }\r\n}));\r\n\r\nexport default function SkillLevel(props) {\r\n const { node } = props;\r\n const classes = useStyles();\r\n return node ? (\r\n <>\r\n {\r\n node.rating > 0 ? (\r\n [...Array(node?.rating)].map((e, i) => <RatingIcon key={i} className={classes.ratingIcon} />)\r\n ) : null\r\n }\r\n\r\n {\r\n node.state & 0b11 ? (\r\n node.state & 0b1 ? (\r\n <FlagIcon className={classes.flag} />\r\n ) : (\r\n <FavoriteIcon className={classes.heart} />\r\n )\r\n ) : null\r\n }\r\n </>\r\n ) : null;\r\n}\r\n","import { useMemo, useCallback, useEffect } from \"react\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport { Grid, Typography } from \"@mui/material\";\r\nimport SkillLevel from \"./display/SkillLevel\";\r\nimport { useGroupUrl } from \"../../hooks/useApp\";\r\nimport { useEntity } from \"@emberly/dataplane\";\r\nimport FuzzyText from \"./FuzzyText\";\r\nimport { useHistory } from \"react-router\";\r\nimport { ReactEditorBlock } from \"@emberly/editor\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n root: {\r\n position: \"relative\",\r\n width: \"100%\",\r\n flexWrap: \"nowrap\",\r\n paddingTop: theme.spacing(1.5),\r\n paddingBottom: theme.spacing(1.5),\r\n paddingLeft: theme.spacing(2),\r\n paddingRight: theme.spacing(2),\r\n cursor: \"pointer\",\r\n \"@media (hover: hover)\": {\r\n \"&:hover\": {\r\n \"&:before\": {\r\n background: theme.palette.action.hover,\r\n position: \"absolute\",\r\n height: \"100%\",\r\n top: 0,\r\n width: `calc(100% - ${theme.spacing(2)})`,\r\n left: theme.spacing(1),\r\n borderRadius: theme.spacing(1),\r\n content: \"''\",\r\n display: \"block\"\r\n }\r\n },\r\n }\r\n },\r\n nameItem: {\r\n maxWidth: `calc(100% - ${theme.spacing(4)} - 10px)`,\r\n overflowWrap: \"break-word\",\r\n position: \"relative\"\r\n },\r\n name: {\r\n maxWidth: \"100%\",\r\n lineHeight: \"16px\",\r\n marginBottom: \"4px\"\r\n },\r\n rating: {\r\n position: \"relative\",\r\n whiteSpace: \"nowrap\",\r\n height: \"14px\",\r\n display: \"inline-block\"\r\n },\r\n path: {\r\n maxWidth: \"100%\",\r\n float: \"left\",\r\n overflow: \"hidden\",\r\n whiteSpace: \"nowrap\",\r\n textOverflow: \"ellipsis\",\r\n direction: \"rtl\",\r\n textAlign: \"left\"\r\n },\r\n startIconContainer: {\r\n position: \"relative\",\r\n width: \"30px\",\r\n height: \"30px\",\r\n color: theme.palette.common.softIcon,\r\n background: theme.palette.grey[500_16],\r\n borderRadius: \"50%\",\r\n marginRight: theme.spacing(2)\r\n },\r\n noteBlockContainer: {\r\n width: `calc(100%)`,\r\n padding: theme.spacing(1),\r\n marginTop: theme.spacing(0.5),\r\n border: `1px solid ${theme.palette.divider}`,\r\n borderRadius: \"4px\",\r\n background: theme.palette.background.lowered\r\n },\r\n noteBlock: {\r\n fontSize: \"12px !important\",\r\n paddingLeft: 0,\r\n paddingRight: 0,\r\n width: `calc(100%)`,\r\n position: \"relative\",\r\n \"& td\": {\r\n padding: \"4px\"\r\n }\r\n }\r\n}));\r\n\r\nexport default function NodeSearchResult(props) {\r\n const { nodeId, query, onClick, allowPan, startIcon, noteBlocks } = props;\r\n const { entity: node, updateCount, collection } = useEntity(\"Node\", nodeId, false);\r\n const groupUrl = useGroupUrl();\r\n const history = useHistory();\r\n const classes = useStyles();\r\n\r\n\r\n const renderName = useMemo(\r\n () => {\r\n const name = node?.name || \"[Topic Deleted]\";\r\n if (!!query) {\r\n return (<FuzzyText text={name} query={query} />);\r\n } else {\r\n return (<span>{name}</span>);\r\n }\r\n },\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n [node, query, updateCount]\r\n );\r\n\r\n const onHandleClick = useCallback(() => onClick !== undefined ? onClick(nodeId, null, collection?.contextId) : history.push({ pathname: `${groupUrl}/node/${nodeId}`, search: window.location.search, hash: allowPan ? `#panto=${nodeId}` : \"\" }), [allowPan, nodeId, history, onClick, groupUrl, collection]);\r\n\r\n useEffect(() => {\r\n node?.updatePath();\r\n }, [node]);\r\n\r\n return (\r\n <Grid\r\n className={classes.root}\r\n onClick={onHandleClick}\r\n direction=\"row\"\r\n justifyContent=\"flex-start\"\r\n alignItems=\"flex-start\"\r\n container\r\n item\r\n >\r\n {startIcon ? (\r\n <Grid container item justifyContent=\"center\" alignItems=\"center\" className={classes.startIconContainer}>\r\n {startIcon}\r\n </Grid>\r\n ) : null}\r\n <Grid container item xs justifyContent=\"center\" alignItems=\"flex-start\" className={classes.nameItem} direction=\"column\">\r\n <Typography variant=\"body2\" align=\"left\" className={classes.name}>\r\n {renderName}\r\n {node === null || (node?.rating === 0 && (node?.state & 0b11) === 0) ? null : (\r\n <span className={classes.rating}><SkillLevel node={node} size=\"small\" /></span>\r\n )}\r\n </Typography>\r\n <Typography variant=\"caption\" color=\"textSecondary\" className={classes.path}>\r\n ‎{node?.path?.join(\" > \") || \"Category\"}\r\n </Typography>\r\n {useMemo(\r\n () => noteBlocks?.length > 0 ? (\r\n <div className={classes.noteBlockContainer}>\r\n {noteBlocks?.filter((_,i) => i < 8).map((block, i) => (\r\n <ReactEditorBlock\r\n key={i}\r\n block={block}\r\n className={classes.noteBlock}\r\n query={query}\r\n />\r\n ))}\r\n </div>\r\n ) : null, [noteBlocks, classes, query])}\r\n </Grid>\r\n </Grid>\r\n );\r\n}\r\n","import { useMemo } from \"react\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport { FlagOutlined as FlagIcon, Favorite as FavoriteIcon, FavoriteBorder as FavoriteOutlinedIcon, History as HistoryIcon } from \"@mui/icons-material\";\r\nimport { Grid, Typography, Chip } from \"@mui/material\";\r\nimport Scrollbar from \"../../atoms/Scrollbar\";\r\nimport { useContextId, useEntity, useEverything } from \"@emberly/dataplane\";\r\nimport NodeSearchResult from \"../../atoms/NodeSearchResult\";\r\nimport { useTags } from \"@emberly/dataplane\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n root: {\r\n position: \"relative\",\r\n height: \"100%\",\r\n width: \"100%\",\r\n \"@media (max-height: 92px)\": {\r\n display: \"none\"\r\n }\r\n },\r\n grid: {\r\n position: \"relative\",\r\n height: \"auto\",\r\n width: \"100%\",\r\n paddingBottom: theme.spacing(2)\r\n },\r\n tagsContainer: {\r\n marginTop: theme.spacing(1),\r\n marginBottom: theme.spacing(1),\r\n marginLeft: -theme.spacing(0.5),\r\n paddingLeft: theme.spacing(2),\r\n paddingRight: theme.spacing(2),\r\n },\r\n chip: {\r\n margin: theme.spacing(0.5)\r\n },\r\n subHeaderItemTop: {\r\n paddingTop: theme.spacing(1),\r\n paddingBottom: theme.spacing(0.5),\r\n textAlign: \"left\"\r\n },\r\n subHeaderItemBottom: {\r\n marginTop: theme.spacing(2.5),\r\n borderTop: `1px solid ${theme.palette.divider}`,\r\n paddingTop: theme.spacing(1),\r\n paddingBottom: theme.spacing(0.5),\r\n textAlign: \"left\"\r\n },\r\n subHeader: {\r\n fontWeight: 500,\r\n marginLeft: theme.spacing(2),\r\n marginTop: theme.spacing(0.5)\r\n },\r\n emptyStateItem: {\r\n marginTop: theme.spacing(4),\r\n marginBottom: theme.spacing(4)\r\n },\r\n nodeIcon: {\r\n color: theme.palette.common.softIcon,\r\n },\r\n heart: {\r\n color: theme.palette.common.heart\r\n },\r\n flag: {\r\n color: \"#555\"\r\n },\r\n spacer: {\r\n height: theme.spacing(3)\r\n },\r\n branchColorIcon: {\r\n marginRight: theme.spacing(1),\r\n position: \"relative\",\r\n height: \"24px\",\r\n width: \"24px\",\r\n backgroundColor: \"black\",\r\n borderRadius: \"50%\"\r\n }\r\n}));\r\n\r\nexport default function QuickSearchPanel(props) {\r\n const classes = useStyles();\r\n const { onSelect, includeResources, includeTopics, onNodeSelected } = props;\r\n const { tags } = useTags(includeResources)\r\n const currentContextId = useContextId();\r\n const { entity, updateCount } = useEntity(\"Map\", currentContextId, true, \"default\");\r\n const { entities: nodeIndex } = useEverything(\"Node\", true);\r\n\r\n const focusedItems = useMemo(\r\n () => nodeIndex\r\n .filter(node => (node.state & 0b11) !== 0 && !node.isRoot)\r\n .sort((a, b) => (b.state & 0b11) - (a.state & 0b11))\r\n .slice(0, 9)\r\n .map((node, index) => (\r\n <NodeSearchResult key={index} nodeId={node.id} allowPan onClick={onNodeSelected} startIcon={node.getLearningState() === 2 ? <FavoriteOutlinedIcon fontSize=\"small\" /> : <FlagIcon fontSize=\"small\" />} />\r\n )),\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n [nodeIndex, onNodeSelected, updateCount]\r\n );\r\n\r\n const lastUpdatedItems = useMemo(\r\n () => (entity?.lastModifiedBy || [])\r\n .map(t => nodeIndex.find(n => n.id === t.id))\r\n .filter(t => !!t && !t.isRoot)\r\n .map((node, index) => (\r\n <NodeSearchResult key={index} nodeId={node.id} allowPan onClick={onNodeSelected} startIcon={<HistoryIcon fontSize=\"small\" />} />\r\n )),\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n [nodeIndex, entity, updateCount, onNodeSelected]\r\n );\r\n\r\n const renderTags = useMemo(\r\n () => tags.filter((tag, i) => i < 7 && !!tag).map((tag,i) => (\r\n <Grid item key={i}>\r\n <Chip className={classes.chip} key={tag} label={tag} size=\"medium\" onClick={() => onSelect(`#${tag};`, 1)} />\r\n </Grid>\r\n )),\r\n [classes, tags, onSelect]\r\n );\r\n\r\n\r\n return (\r\n <div className={classes.root}>\r\n <Scrollbar className={classes.scrollBar}>\r\n <Grid className={classes.grid} container spacing={0} justifyContent=\"flex-start\" direction=\"column\">\r\n\r\n {includeResources ? (\r\n <>\r\n <Grid item className={classes.subHeaderItemTop}>\r\n <Typography variant=\"subtitle2\" color=\"textSecondary\" className={classes.subHeader}>Common tags</Typography>\r\n </Grid>\r\n {\r\n renderTags.length === 0 ? (\r\n <Grid item>\r\n <Typography variant=\"body2\" align=\"center\" className={classes.emptyStateItem}>\r\n Tags added to resources will show up here\r\n </Typography>\r\n </Grid>\r\n ) : (\r\n <Grid item container justifyContent=\"flex-start\" alignItems=\"flex-start\" className={classes.tagsContainer}>\r\n {renderTags}\r\n </Grid>\r\n )\r\n }\r\n </>\r\n ) : null}\r\n\r\n {includeTopics ? (\r\n <>\r\n <Grid item className={includeResources ? classes.subHeaderItemBottom : classes.subHeaderItemTop}>\r\n <Typography variant=\"subtitle2\" color=\"textSecondary\" className={classes.subHeader}>In focus</Typography>\r\n </Grid>\r\n {focusedItems.length === 0 ? (\r\n <Grid item>\r\n <Typography variant=\"body2\" align=\"center\" className={classes.emptyStateItem}>\r\n Topics with status <FlagIcon fontSize=\"inherit\" className={classes.flag} /> and <FavoriteIcon fontSize=\"inherit\" className={classes.heart} /><br /> will appear here\r\n </Typography>\r\n </Grid>\r\n ) : focusedItems}\r\n <Grid item className={classes.subHeaderItemBottom}>\r\n <Typography variant=\"subtitle2\" color=\"textSecondary\" className={classes.subHeader}>Last edited</Typography>\r\n </Grid>\r\n {lastUpdatedItems.length === 0 ? (\r\n <Grid item>\r\n <Typography variant=\"body2\" align=\"center\" className={classes.emptyStateItem}>\r\n Your last edited topics will show<br />up here when you start<br />building your tree\r\n </Typography>\r\n </Grid>\r\n ) : lastUpdatedItems}\r\n </>\r\n ) : null}\r\n\r\n\r\n\r\n </Grid>\r\n </Scrollbar>\r\n </div>\r\n );\r\n}\r\n","import { useEffect, useMemo, useState } from \"react\";\r\nimport { useSelector } from \"react-redux\";\r\nimport fuzzysort from \"fuzzysort\";\r\nimport { useCollection, useEverything } from \"@emberly/dataplane\";\r\nimport { useTags } from \"@emberly/dataplane\";\r\n\r\nexport default function useSearch(query, maxResults = 25, includeTopics = true, includeResources = true, groupName = undefined, includeNoteBlocks = false) { // TODO\r\n const { collection: resourceCollection } = useCollection(\"Resource\", groupName);\r\n const { collection: noteCollection } = useCollection(\"Note\", groupName);\r\n const { filterTags, filterMinRating, filterResourceType, filterSortBy, filterArchived } = useSelector(state => state.filter);\r\n const { tags } = useTags();\r\n const { entities: nodeIndex } = useEverything(\"Node\", includeTopics, groupName);\r\n const [nodeCacheIndex, setNodeCacheIndex] = useState([]);\r\n const [resourcesCacheIndex, setResourcesCacheIndex] = useState([]);\r\n const [noteBlockCacheIndex, setNoteBlockCacheIndex] = useState(new Map());\r\n const [working, setWorking] = useState(false);\r\n\r\n useEffect(() => {\r\n if (!!query && (!!resourceCollection || !includeResources) && (!!noteCollection || !includeNoteBlocks) && (!!nodeIndex || !includeTopics)) {\r\n let mounted = true;\r\n setWorking(true);\r\n\r\n const fn = async () => {\r\n const subQuery = extractSubQuery(query, tags);\r\n const noteMap = new Map();\r\n const includeIds = [];\r\n\r\n // Process note search\r\n if (includeNoteBlocks) {\r\n const { refs } = await noteCollection.search(subQuery); // TODO parallelise, and limit to only if fulltextsearch is enabled, and limit to subs only.\r\n const noteBlockMatches = refs.map(n => noteCollection.getEntityById(n.id));\r\n\r\n noteBlockMatches.forEach(block => {\r\n const parentId = block.getParentResourceId();\r\n if (noteMap.has(parentId)) {\r\n noteMap.get(parentId).push(block);\r\n } else {\r\n noteMap.set(parentId, [block]);\r\n if (block.isParentResource()) {\r\n includeIds.push(parentId);\r\n }\r\n }\r\n });\r\n\r\n noteMap.forEach((list) => {\r\n list?.sort((a,b) => a.index > b.index ? 1 : -1);\r\n });\r\n\r\n }\r\n\r\n if (mounted) {\r\n const limitedNodes = limitNodeMatches(nodeIndex, subQuery, noteMap, maxResults);\r\n setNoteBlockCacheIndex(noteMap);\r\n setNodeCacheIndex(limitedNodes);\r\n if (!includeResources) {\r\n setWorking(false);\r\n }\r\n }\r\n\r\n // process resource search.\r\n if (includeResources && mounted) {\r\n const { refs } = await resourceCollection.search({ ...subQuery, includeIds });\r\n if (mounted) {\r\n const resourceMatches = refs.map(r => resourceCollection.getEntityById(r.id));\r\n setResourcesCacheIndex(resourceMatches);\r\n setWorking(false);\r\n }\r\n }\r\n\r\n // TODO fix up AI continue before deploy. \r\n };\r\n\r\n fn();\r\n\r\n return () => {\r\n mounted = false;\r\n };\r\n }\r\n }, [resourceCollection, noteCollection, tags, query, includeResources, includeNoteBlocks, includeTopics, maxResults, nodeIndex]);\r\n\r\n return useMemo(\r\n () => {\r\n if (!query || query.length === 0 || working) {\r\n return { skillResults: [], resourceResults: [], noteBlockResults: noteBlockCacheIndex, working };\r\n } else {\r\n const subQuery = extractSubQuery(query, tags);\r\n\r\n const filteredResources = resourcesCacheIndex.filter(\r\n resource =>\r\n includeResources &&\r\n (resource.rating >= filterMinRating) &&\r\n ((resource.archived && filterArchived !== \"visible\") || (!resource.archived && filterArchived !== \"archived\")) &&\r\n (filterTags.length === 0 || (!!resource.tags && resource.tags.reduce((total, tag) => filterTags.includes(tag) + total, 0) === filterTags.length)) &&\r\n (filterResourceType === \"any\" || (filterResourceType === \"online\" && !!resource.url) || (filterResourceType === \"offline\" && !resource.url))\r\n ).sort(\r\n (a, b) => (filterSortBy === \"rating\") * (b.rating - a.rating)\r\n );\r\n\r\n const limitedResources = limitResourceMatches(filteredResources, subQuery, noteBlockCacheIndex, maxResults);\r\n\r\n return {\r\n skillResults: nodeCacheIndex,\r\n resourceResults: limitedResources,\r\n noteBlockResults: noteBlockCacheIndex,\r\n subQuery,\r\n working\r\n };\r\n }\r\n },\r\n [working, nodeCacheIndex, resourcesCacheIndex, noteBlockCacheIndex, filterTags, filterMinRating, filterResourceType, filterArchived, filterSortBy, query, maxResults, tags, includeResources]\r\n );\r\n}\r\n\r\nexport function extractSubQuery(query, tags) {\r\n let subQuery = query;\r\n let subQueryInvariant = query.toLowerCase();\r\n let tagResults = [];\r\n let tagsSorted = tags.map(tag => ({ tag, invariant: `#${tag.toLowerCase()}` })).sort((a, b) => b.tag.length - a.tag.length);\r\n\r\n for (let i = 0; i < tagsSorted.length; i++) {\r\n let tagInvariant = tagsSorted[i].invariant;\r\n let idx = subQueryInvariant.indexOf(tagInvariant);\r\n\r\n if (idx !== -1) {\r\n tagResults.push(tagsSorted[i].tag);\r\n subQueryInvariant = subQueryInvariant.slice(0, idx) + subQueryInvariant.slice(idx + tagInvariant.length);\r\n\r\n let slice = subQuery.slice(idx + tagInvariant.length);\r\n if (slice.startsWith(\";\")) {\r\n subQuery = subQuery.slice(0, idx) + slice.substr(1);\r\n } else {\r\n subQuery = subQuery.slice(0, idx) + slice;\r\n }\r\n }\r\n }\r\n\r\n return {\r\n tags: tagResults,\r\n query: subQuery.trim()\r\n };\r\n}\r\n\r\nfunction limitNodeMatches(nodeMatches, subQuery, noteMap, maxResults) {\r\n const fuzzyMatches = fuzzysort\r\n .go(subQuery.query, nodeMatches, { key: \"name\", limit: maxResults, treshold: -10000 })\r\n .map(result => result.obj)\r\n .filter(result => !result.isRoot);\r\n\r\n if (noteMap.size === 0) return fuzzyMatches;\r\n\r\n const textMatches = nodeMatches.filter(t => noteMap.has(t.id) && !fuzzyMatches.find(f => f.id === t.id));\r\n return [...fuzzyMatches, ...textMatches];\r\n}\r\n\r\n\r\nfunction limitResourceMatches(resourceMatches, subQuery, noteMap, maxResults) {\r\n if (resourceMatches.length > 15) {\r\n const tagSet = new Set(subQuery.tags);\r\n\r\n const tagMatches = subQuery.tags.length !== 0 ? resourceMatches.filter(\r\n r => r.tags?.some(t => tagSet.has(t))\r\n ) : [];\r\n\r\n const resMatches = subQuery.tags.length !== 0 ? resourceMatches.filter(\r\n r => !r.tags?.some(t => tagSet.has(t))\r\n ) : resourceMatches;\r\n\r\n const fuzzyMatches = fuzzysort\r\n .go(subQuery.query, resMatches,\r\n {\r\n keys: [\"name\", \"source\"],\r\n limit: maxResults,\r\n treshold: -10000\r\n })\r\n .map(t => t.obj);\r\n\r\n\r\n const results = tagMatches.concat(fuzzyMatches);\r\n\r\n if (noteMap.size === 0) {\r\n return results;\r\n }\r\n\r\n const textMatches = resourceMatches.filter(t => noteMap.has(t.id) && !results.find(f => f.id === t.id));\r\n return results.concat(textMatches);\r\n }\r\n\r\n return resourceMatches;\r\n}","import { useState, useEffect, useCallback } from \"react\";\r\nimport { Grid, Select, MenuItem, Typography, Skeleton } from \"@mui/material\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport {\r\n ExpandMore as ExpandIcon\r\n} from \"@mui/icons-material\";\r\nimport { useEverything } from \"@emberly/dataplane\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n root: {\r\n\r\n },\r\n select: {\r\n color: theme.palette.primary.main,\r\n border: \"none !important\",\r\n height: \"100%\",\r\n marginRight: theme.spacing(1),\r\n marginLeft: theme.spacing(0.45),\r\n marginBottom: \"-2px\",\r\n background: \"none\",\r\n \"& svg\": {\r\n color: theme.palette.primary.main,\r\n fontSize: \"16px\",\r\n right: theme.spacing(1)\r\n },\r\n \"& div:focus\": {\r\n background: \"none\"\r\n }\r\n },\r\n menuItemText: {\r\n color: theme.palette.text.primary,\r\n },\r\n menuItemTextSelected: {\r\n color: theme.palette.primary.main,\r\n fontWeight: 500,\r\n maxWidth: \"250px\",\r\n overflow: \"hidden\",\r\n textOverflow: \"ellipsis\",\r\n },\r\n skeleton: {\r\n marginLeft: theme.spacing(0.45),\r\n marginBottom: -4,\r\n borderRadius: theme.spacing(0.5)\r\n }\r\n}));\r\n\r\nexport default function MinimalContextSelector(props) {\r\n const { className, value, onChange, minAccess, initialValue } = props;\r\n const classes = useStyles();\r\n const [select, setSelect] = useState(value || 0);\r\n const { entities, loading } = useEverything(\"Map\", true, \"default\");\r\n const sortedEntities = entities.filter(entity => entity.access >= minAccess && entity.groupName !== initialValue).sort((a, b) => b.lastOpened - a.lastOpened);\r\n const currentMap = entities.find(t => t.groupName === initialValue && t.access >= minAccess);\r\n const showLoader = loading || !entities.find(t => t.groupName === value) || select === \"default\";\r\n\r\n useEffect(() => {\r\n if (typeof value === \"string\") {\r\n setSelect(value);\r\n }\r\n }, [value]);\r\n\r\n useEffect(() => {\r\n if (!loading && entities.length !== 0 && !entities.find(t => t.groupName === value)) {\r\n const entity = entities.find(t => t.favorite) || currentMap || entities[0];\r\n onChange(entity.groupName);\r\n }\r\n }, [entities, loading, value, onChange, currentMap]);\r\n\r\n const onInternalChangeSelect = useCallback((ev) => ((!!onChange ? onChange(ev.target.value) : null, setSelect(ev.target.value))), [setSelect, onChange]);\r\n\r\n return (\r\n <Grid item container className={`${classes.root} ${className || \"\"}`} alignItems=\"center\" direction=\"row\">\r\n <Grid item>\r\n <Typography variant=\"body2\" color=\"textSecondary\">{props.children}</Typography>\r\n </Grid>\r\n\r\n <Grid item>\r\n {showLoader ? (\r\n <Skeleton variant=\"rectangular\" width=\"100px\" className={classes.skeleton} />\r\n ) : (\r\n <Select className={classes.select} disableUnderline variant=\"standard\" IconComponent={ExpandIcon} onChange={onInternalChangeSelect} value={select}>\r\n {!!currentMap ? (\r\n <MenuItem value={currentMap.groupName}>\r\n <Typography variant=\"body2\" className={currentMap.groupName === select ? classes.menuItemTextSelected : classes.menuItemText}>\r\n {currentMap.name}\r\n </Typography>\r\n </MenuItem>\r\n ) : null}\r\n {sortedEntities.map((entity, i) => (\r\n <MenuItem key={i} value={entity.groupName}>\r\n <Typography variant=\"body2\" className={entity.groupName === select ? classes.menuItemTextSelected : classes.menuItemText}>\r\n {entity.name}\r\n </Typography>\r\n </MenuItem>\r\n ))}\r\n </Select>\r\n )}\r\n </Grid>\r\n </Grid >\r\n );\r\n}","import { useEffect, useState, useCallback, useMemo, useRef, Fragment } from \"react\";\r\nimport { Grid, Typography, Tab, Tabs, FilledInput, IconButton, Divider, Button, Select, MenuItem, ButtonBase, Fade, LinearProgress, Collapse } from \"@mui/material\";\r\nimport { Close as CloseIcon, Star as StarIcon, Search as SearchIcon } from \"@mui/icons-material\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport { useSelector, useDispatch } from \"react-redux\";\r\nimport * as SearchActions from \"../../../actions/search\";\r\nimport * as AppActions from \"../../../actions/app\";\r\nimport * as FilterActions from \"../../../actions/filter\";\r\nimport Scrollbar from \"../../atoms/Scrollbar\";\r\nimport ResourcePreviewItem from \"../../atoms/ResourcePreviewItem\";\r\nimport QuickSearchPanel from \"./QuickSearchPanel\";\r\nimport NodeSearchResult from \"../../atoms/NodeSearchResult\";\r\nimport useSearch from \"../../../hooks/useSearch\";\r\nimport { getRootUrl } from \"../../../hooks/useApp\";\r\nimport CardHeader from \"../../atoms/CardHeader\";\r\nimport { GroupContextProvider, useGroupName } from \"@emberly/dataplane\";\r\nimport MinimalContextSelector from \"../MinimalContextSelector\";\r\nimport { useDevice } from \"../../../providers/DeviceContext\";\r\nimport { useHistory } from \"react-router\";\r\nimport TimedRemover from \"../../atoms/display/TimedRemover\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n root: {\r\n position: \"relative\",\r\n width: \"100%\",\r\n height: \"100%\",\r\n background: theme.palette.background.paper\r\n },\r\n descriptionItem: {\r\n position: \"relative\",\r\n paddingTop: theme.spacing(2),\r\n paddingLeft: theme.spacing(2),\r\n paddingRight: theme.spacing(2),\r\n \"@media (max-height: 192px)\": {\r\n display: \"none\"\r\n }\r\n },\r\n searchInput: {\r\n borderRadius: \"8px\",\r\n marginBottom: theme.spacing(1),\r\n height: \"48px\",\r\n \"& input\": {\r\n \"&::placeholder\": {\r\n ...theme.typography.body2\r\n }\r\n }\r\n },\r\n searchInputEmbedView: {\r\n \"@media (max-height: 350px)\": {\r\n width: \"calc(100% - 40px)\",\r\n marginRight: \"40px\",\r\n marginBottom: 0\r\n }\r\n },\r\n searchInputLandscapeView: {\r\n \"@media (max-height: 350px)\": {\r\n marginBottom: 0\r\n }\r\n },\r\n contextSwitcherItem: {\r\n position: \"relative\",\r\n marginTop: theme.spacing(-1),\r\n paddingLeft: theme.spacing(2),\r\n paddingRight: theme.spacing(2),\r\n paddingBottom: theme.spacing(1)\r\n },\r\n divider: {\r\n marginLeft: theme.spacing(2),\r\n marginRight: theme.spacing(2),\r\n width: `calc(100% - ${theme.spacing(4)})`\r\n },\r\n headerDivider: {\r\n marginTop: theme.spacing(1)\r\n },\r\n inputItem: {\r\n padding: theme.spacing(2),\r\n textAlign: \"center\",\r\n zIndex: 99999\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: 0,\r\n paddingRight: 0,\r\n display: \"flex\",\r\n flexDirection: \"column\",\r\n borderTop: `1px solid ${theme.palette.divider}`,\r\n },\r\n tabs: {\r\n textAlign: \"center\",\r\n borderBottom: `1px solid ${theme.palette.divider}`\r\n },\r\n subHeaderItemTop: {\r\n background: theme.palette.background.paper,\r\n height: \"48px\",\r\n lineHeight: \"48px\",\r\n textAlign: \"center\",\r\n paddingTop: 0\r\n },\r\n subHeaderItemBottom: {\r\n background: theme.palette.background.paper,\r\n height: \"48px\",\r\n lineHeight: \"48px\",\r\n textAlign: \"center\",\r\n borderTop: `1px solid ${theme.palette.divider}`,\r\n paddingTop: 0\r\n },\r\n subHeader: {\r\n lineHeight: \"40px\",\r\n fontWeight: 500,\r\n marginLeft: theme.spacing(2),\r\n float: \"left\"\r\n },\r\n moreButton: {\r\n float: \"right\",\r\n marginRight: theme.spacing(1),\r\n color: theme.palette.primary.dark,\r\n fontSize: \"14px\",\r\n fontWeight: \"400\",\r\n letterSpacing: \"0.25px\"\r\n },\r\n resultCount: {\r\n marginLeft: theme.spacing(2),\r\n marginTop: theme.spacing(2),\r\n },\r\n filterGrid: {\r\n position: \"relative\",\r\n height: \"48px\",\r\n borderBottom: `1px solid ${theme.palette.divider}`,\r\n paddingLeft: theme.spacing(2)\r\n },\r\n filterGridItem: {\r\n height: \"48px\",\r\n lineHeight: \"48px\",\r\n marginTop: \"2px\",\r\n paddingTop: \"0px !important\",\r\n paddingBottom: \"0px !important\"\r\n },\r\n filterGridItemRight: {\r\n height: \"48px\",\r\n lineHeight: \"48px\",\r\n paddingTop: \"0px !important\",\r\n paddingBottom: \"0px !important\",\r\n marginLeft: theme.spacing(0.5),\r\n color: theme.palette.text.primary\r\n },\r\n select: {\r\n marginTop: \"10px\",\r\n height: \"32px\",\r\n borderRadius: \"16px\",\r\n overflow: \"hidden\",\r\n \"& input\": {\r\n borderRadius: \"16px\"\r\n },\r\n \"& div\": {\r\n borderRadius: \"16px\"\r\n },\r\n \"& fieldset\": {\r\n borderRadius: \"16px\",\r\n borderWidth: \"1px !important\"\r\n }\r\n },\r\n iconButtonEnd: {\r\n color: theme.palette.common.searchInputIcon,\r\n borderRadius: theme.spacing(0.5),\r\n marginRight: \"-4px\"\r\n },\r\n spacer: {\r\n height: theme.spacing(3)\r\n },\r\n grid: {\r\n flexWrap: \"nowrap\"\r\n },\r\n searchResultContainer: {\r\n position: \"relative\",\r\n height: \"100%\",\r\n width: \"100%\"\r\n },\r\n searchResultItem: {\r\n position: \"absolute\",\r\n height: \"100%\",\r\n width: \"100%\"\r\n },\r\n searchIcon: {\r\n color: theme.palette.common.searchInputIcon,\r\n marginRight: theme.spacing(1)\r\n },\r\n starIcon: {\r\n marginBottom: \"-2px\"\r\n }\r\n}));\r\n\r\nconst fadeDuration = { enter: 200, exit: 200 };\r\n\r\nexport default function SearchPanel(props) {\r\n const { autofocus, onResourceSelected, onNodeSelected, onCancel, title, description, prefill, includeTopics, includeResources, includeNoteBlocks, isGlobal, allowContextSwitching, placeholder } = props;\r\n const classes = useStyles();\r\n const dispatch = useDispatch();\r\n const currentGroupName = useGroupName();\r\n const [groupName, setGroupName] = useState(currentGroupName); // TODO\r\n const mountedRef = useRef(true);\r\n\r\n useEffect(() => {\r\n if (currentGroupName) {\r\n setGroupName(currentGroupName);\r\n }\r\n }, [currentGroupName]);\r\n\r\n const { isIos, isEmbedView, isMobilePortraitView } = useDevice();\r\n const { searchViewTabIndex, contextCardState: cardState } = useSelector(state => state.app); // TODO separate searchviewtabindex\r\n const { query: globalQuery } = useSelector(state => state.search);\r\n const [query, setQuery] = useState(isGlobal ? globalQuery : \"\");\r\n const [tabIndex, setTabIndex] = useState(isGlobal ? searchViewTabIndex : -1);\r\n\r\n const results = useSearch(query, 150, includeTopics, includeResources, groupName, includeNoteBlocks);\r\n const [text, setText] = useState(query);\r\n const inputRef = useRef(null);\r\n const timerRef = useRef(null);\r\n\r\n const idx = groupName.indexOf(\"/\");\r\n const isDefault = idx === -1;\r\n const userId = isDefault ? undefined : groupName.substr(0, idx);\r\n const ctxId = isDefault ? undefined : groupName.substr(idx + 1);\r\n\r\n const handleSearch = useCallback((query, tabIndex = null) => {\r\n if (mountedRef.current) {\r\n setText(query);\r\n clearTimeout(timerRef.current);\r\n if (isGlobal) {\r\n dispatch(SearchActions.SetSearchQuery(query));\r\n }\r\n setQuery(query);\r\n if (tabIndex !== null && typeof tabIndex === \"number\") {\r\n setTabIndex(tabIndex);\r\n if (isGlobal) {\r\n dispatch(AppActions.SetSearchViewTabIndex(tabIndex));\r\n }\r\n }\r\n }\r\n }, [setText, timerRef, dispatch, isGlobal]);\r\n\r\n useEffect(() => {\r\n clearTimeout(timerRef.current);\r\n timerRef.current = setTimeout(() => handleSearch(text), 600); // TODO optimize?\r\n }, [text, timerRef, handleSearch]);\r\n\r\n\r\n useEffect(() => {\r\n return () => {\r\n mountedRef.current = false;\r\n }\r\n }, [])\r\n\r\n useEffect(() => {\r\n if (!!prefill) {\r\n handleSearch(prefill);\r\n }\r\n }, [prefill, handleSearch]);\r\n\r\n useEffect(() => {\r\n if (cardState === 1 && inputRef.current !== null && !isIos && autofocus) {\r\n inputRef.current.focus();\r\n }\r\n }, [cardState, inputRef, isIos, autofocus]);\r\n\r\n const nodeItems = useMemo(\r\n () => results.skillResults\r\n .slice(0, tabIndex === -1 ? 5 : 150)\r\n .map((node, idx, list) => (\r\n <Fragment key={node.id}>\r\n <NodeSearchResult\r\n nodeId={node.id}\r\n query={results.subQuery.query}\r\n onClick={onNodeSelected}\r\n allowPan\r\n startIcon={<SearchIcon fontSize=\"small\" />}\r\n noteBlocks={results.noteBlockResults?.get(node.id)}\r\n />\r\n {idx < (list.length - 1) ? null : <div className={classes.spacer}></div>}\r\n </Fragment>\r\n )),\r\n [classes, results, tabIndex, onNodeSelected]\r\n );\r\n\r\n const resourceItems = useMemo(\r\n () => results.resourceResults\r\n .slice(0, tabIndex === -1 ? 5 : 150)\r\n .map((resource, idx, list) => (\r\n <Fragment key={resource.id}>\r\n <ResourcePreviewItem\r\n resourceId={resource.id}\r\n showPath\r\n onClick={onResourceSelected}\r\n allowPan\r\n query={results.subQuery.query}\r\n noteBlocks={results.noteBlockResults?.get(resource.id)}\r\n />\r\n {idx < (list.length - 1) ? <Divider className={classes.divider} /> : <div className={classes.spacer}></div>}\r\n </Fragment>\r\n )),\r\n [classes, results, tabIndex, onResourceSelected]\r\n );\r\n\r\n const handleCancel = useCallback(() => {\r\n handleSearch(\"\");\r\n setTabIndex(-1);\r\n if (isGlobal) {\r\n dispatch(AppActions.SetSearchViewTabIndex(-1));\r\n }\r\n }, [handleSearch, dispatch, isGlobal]);\r\n\r\n useEffect(() => {\r\n if (!includeTopics) {\r\n setTabIndex(0);\r\n if (isGlobal) {\r\n dispatch(AppActions.SetSearchViewTabIndex(0));\r\n }\r\n } else if (!includeResources) {\r\n setTabIndex(1);\r\n if (isGlobal) {\r\n dispatch(AppActions.SetSearchViewTabIndex(1));\r\n }\r\n }\r\n }, [includeTopics, includeResources, dispatch, isGlobal]);\r\n\r\n const handleChange = useCallback((ev) => setText(ev.target.value), [setText]);\r\n\r\n const handleTabIndex = useCallback((val) => {\r\n if (isGlobal) {\r\n dispatch(AppActions.SetSearchViewTabIndex(val))\r\n }\r\n\r\n setTabIndex(val);\r\n\r\n }, [isGlobal, dispatch]);\r\n\r\n return (\r\n <GroupContextProvider userId={userId} contextId={ctxId}>\r\n <Grid className={classes.root} container spacing={0} direction=\"column\" justifyContent=\"flex-start\" alignItems=\"stretch\">\r\n\r\n {\r\n !!title ? (\r\n <Grid item>\r\n <CardHeader\r\n title={title}\r\n onClose={onCancel}\r\n border\r\n />\r\n </Grid>\r\n ) : null\r\n }\r\n\r\n {\r\n !!description ? (\r\n <Grid item className={classes.descriptionItem}>\r\n <Typography variant=\"caption\" color=\"textSecondary\">{description}</Typography>\r\n </Grid>\r\n ) : null\r\n }\r\n\r\n <Grid item className={classes.inputItem}>\r\n <FilledInput\r\n className={`${classes.searchInput} ${isEmbedView ? classes.searchInputEmbedView : \"\"} ${!isMobilePortraitView ? classes.searchInputLandscapeView : \"\"}`}\r\n fullWidth\r\n id=\"search\"\r\n type=\"text\"\r\n disableUnderline\r\n placeholder={placeholder || \"Search\"}\r\n value={text}\r\n onChange={handleChange}\r\n autoComplete=\"off\"\r\n autoFocus={!isIos && autofocus}\r\n inputRef={inputRef}\r\n size=\"small\"\r\n hiddenLabel\r\n endAdornment={\r\n <Fade in={text.length !== 0}>\r\n <IconButton\r\n aria-label=\"clear\"\r\n onClick={handleCancel}\r\n className={classes.iconButtonEnd}\r\n size=\"small\">\r\n <CloseIcon fontSize=\"small\" />\r\n </IconButton>\r\n </Fade>\r\n }\r\n startAdornment={<SearchIcon fontSize=\"small\" className={classes.searchIcon} />}\r\n />\r\n </Grid>\r\n\r\n {allowContextSwitching ? (\r\n <Grid item className={classes.contextSwitcherItem}>\r\n <MinimalContextSelector value={groupName} onChange={setGroupName} minAccess={2} initialValue={currentGroupName}>Searching in</MinimalContextSelector>\r\n </Grid>\r\n ) : null}\r\n\r\n <Collapse in={results.working}>\r\n <TimedRemover in={results.working}>\r\n <LinearProgress variant=\"query\" />\r\n </TimedRemover>\r\n </Collapse>\r\n\r\n <Grid item xs className={classes.contentItem}>\r\n {\r\n query.length !== 0 ? (\r\n tabIndex === -1 ? (\r\n <SearchResultPreviewPanel\r\n resourceResults={resourceItems}\r\n skillResults={nodeItems}\r\n skillResultsCount={results.skillResults.length}\r\n resourceResultsCount={results.resourceResults.length}\r\n onChange={handleTabIndex}\r\n />\r\n ) : (\r\n <>\r\n {includeResources && includeTopics ? (\r\n <Tabs\r\n className={classes.tabs}\r\n value={includeTopics && includeResources ? tabIndex : 0}\r\n onChange={(ev, val) => handleTabIndex(val)}\r\n centered\r\n variant=\"fullWidth\"\r\n >\r\n <Tab label={<Typography variant=\"button\">Topics</Typography>} />\r\n <Tab label={<Typography variant=\"button\">Resources</Typography>} />\r\n </Tabs>\r\n ) : null}\r\n <div\r\n className={classes.searchResultContainer}\r\n >\r\n {includeTopics ? (\r\n\r\n <Fade in={tabIndex === 0 || !includeResources} timeout={fadeDuration}>\r\n <div className={classes.searchResultItem}>\r\n <SearchResultPanel type=\"skill\" count={results.skillResults.length}>\r\n {nodeItems}\r\n </SearchResultPanel>\r\n </div>\r\n </Fade>\r\n\r\n ) : null}\r\n {includeResources ? (\r\n\r\n <Fade in={tabIndex === 1 || !includeTopics} timeout={fadeDuration}>\r\n <div className={classes.searchResultItem}>\r\n <SearchResultPanel type=\"resource\" count={results.resourceResults.length}>\r\n {resourceItems}\r\n </SearchResultPanel>\r\n </div>\r\n </Fade>\r\n ) : null}\r\n </div>\r\n </>\r\n )\r\n ) : (\r\n <QuickSearchPanel onSelect={handleSearch} includeResources={includeResources} includeTopics={includeTopics} onNodeSelected={onNodeSelected} />\r\n )\r\n }\r\n </Grid>\r\n </Grid>\r\n </GroupContextProvider>\r\n );\r\n}\r\n\r\nfunction SearchResultPanel(props) {\r\n const { count, type } = props;\r\n const classes = useStyles();\r\n\r\n return (\r\n <div className={classes.root}>\r\n <Scrollbar className={classes.scrollBar}>\r\n <Grid container spacing={0} justifyContent=\"flex-start\" direction=\"column\" className={classes.grid}>\r\n {type === \"resource\" ? (\r\n <SearchFilterPanel />\r\n ) : null}\r\n <Grid item>\r\n <Typography variant=\"body2\" color=\"textSecondary\" className={classes.resultCount}>{`${count} ${type}${count !== 1 ? \"s\" : \"\"} found`}</Typography>\r\n </Grid>\r\n {props.children}\r\n </Grid>\r\n </Scrollbar>\r\n </div>\r\n );\r\n}\r\n\r\nfunction SearchFilterPanel(props) {\r\n const classes = useStyles();\r\n const dispatch = useDispatch();\r\n const history = useHistory();\r\n const openFilters = useCallback(() => history.push(`${getRootUrl()}/filter`), [history]);\r\n const { filterMinRating, filterSortBy, filterResourceType, filterTags, filterActive, filterArchived } = useSelector(state => state.filter);\r\n\r\n const onSortByChanged = useCallback(ev => {\r\n dispatch(FilterActions.SetFilter(ev.target.value, filterMinRating, filterResourceType, filterArchived, filterTags));\r\n }, [filterMinRating, filterResourceType, filterArchived, filterTags, dispatch]);\r\n\r\n const onMinRatingChanged = useCallback(ev => {\r\n dispatch(FilterActions.SetFilter(filterSortBy, ev.target.value, filterResourceType, filterArchived, filterTags));\r\n }, [filterSortBy, filterResourceType, filterArchived, filterTags, dispatch]);\r\n\r\n return (\r\n <Grid item container spacing={1} className={classes.filterGrid} alignItems=\"center\" justifyContent=\"flex-start\">\r\n <Grid item className={classes.filterGridItem}>\r\n <Select\r\n value={filterSortBy}\r\n variant=\"outlined\"\r\n className={classes.select}\r\n onChange={onSortByChanged}\r\n >\r\n <MenuItem value=\"date\">{filterSortBy === \"date\" ? \"Sort By\" : \"Relevance\"}</MenuItem>\r\n <MenuItem value=\"rating\">{filterSortBy === \"rating\" ? \"Sort By rating\" : \"Rating\"}</MenuItem>\r\n </Select>\r\n </Grid>\r\n <Grid item className={classes.filterGridItem}>\r\n <Select value={filterMinRating} variant=\"outlined\" className={classes.select} onChange={onMinRatingChanged}>\r\n <MenuItem value={0}>\r\n {filterMinRating === 0 ? \"Rating\" : \"Any\"}\r\n </MenuItem>\r\n <MenuItem value={2} className={classes.menuItem}>\r\n <Grid container alignItems=\"center\">\r\n <Grid item>\r\n 2,0\r\n </Grid>\r\n <Grid item>\r\n <StarIcon fontSize=\"inherit\" className={classes.starIcon} />\r\n </Grid>\r\n </Grid>\r\n </MenuItem>\r\n <MenuItem value={3}>\r\n <Grid container alignItems=\"center\">\r\n <Grid item>\r\n 3,0\r\n </Grid>\r\n <Grid item>\r\n <StarIcon fontSize=\"inherit\" className={classes.starIcon} />\r\n </Grid>\r\n </Grid>\r\n </MenuItem>\r\n <MenuItem value={4}>\r\n <Grid container alignItems=\"center\">\r\n <Grid item>\r\n 4,0\r\n </Grid>\r\n <Grid item>\r\n <StarIcon fontSize=\"inherit\" className={classes.starIcon} />\r\n </Grid>\r\n </Grid>\r\n </MenuItem>\r\n <MenuItem value={5}>\r\n <Grid container alignItems=\"center\">\r\n <Grid item>\r\n 5,0\r\n </Grid>\r\n <Grid item>\r\n <StarIcon fontSize=\"inherit\" className={classes.starIcon} />\r\n </Grid>\r\n </Grid>\r\n </MenuItem>\r\n </Select>\r\n </Grid>\r\n <Grid item className={classes.filterGridItemRight}>\r\n <ButtonBase onClick={openFilters}>\r\n <Typography variant=\"body2\" color={filterActive ? \"primary\" : undefined}>More filters</Typography>\r\n </ButtonBase>\r\n </Grid>\r\n </Grid>\r\n );\r\n}\r\n\r\nfunction SearchResultPreviewPanel(props) {\r\n const { resourceResults, skillResults, skillResultsCount, resourceResultsCount, onChange } = props;\r\n const classes = useStyles();\r\n return (\r\n <Grid item xs container>\r\n <Scrollbar>\r\n <Grid item container alignItems=\"center\" xs={12} className={classes.subHeaderItemTop}>\r\n <Grid item xs>\r\n <Typography variant=\"subtitle1\" className={classes.subHeader}>Topics</Typography>\r\n </Grid>\r\n <Grid item>\r\n <Button className={classes.moreButton} onClick={() => onChange(0)}>\r\n {skillResultsCount === 0 ? \"No results\" : `View ${skillResultsCount === 1 ? \"\" : \"all\"} ${skillResultsCount} result${skillResultsCount === 1 ? \"\" : \"s\"}`}\r\n </Button>\r\n </Grid>\r\n </Grid>\r\n {skillResults}\r\n <Grid item container alignItems=\"center\" xs={12} className={classes.subHeaderItemBottom}>\r\n <Grid item xs>\r\n <Typography variant=\"subtitle1\" className={classes.subHeader}>Resources</Typography>\r\n </Grid>\r\n <Grid item>\r\n <Button className={classes.moreButton} onClick={() => onChange(1)}>\r\n {resourceResultsCount === 0 ? \"No results\" : `View ${resourceResultsCount === 1 ? \"\" : \"all\"} ${resourceResultsCount} result${resourceResultsCount === 1 ? \"\" : \"s\"}`}\r\n </Button>\r\n </Grid>\r\n </Grid>\r\n {resourceResults}\r\n </Scrollbar>\r\n </Grid>\r\n );\r\n}\r\n\r\n\r\n\r\n","import { useEffect } from \"react\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport { Grid, Typography } from \"@mui/material\";\r\nimport { useEntity } from \"@emberly/dataplane\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n root: {\r\n position: \"relative\",\r\n width: \"100%\",\r\n paddingTop: theme.spacing(1),\r\n paddingBottom: theme.spacing(1),\r\n paddingLeft: theme.spacing(1),\r\n paddingRight: theme.spacing(1)\r\n },\r\n nameItem: {\r\n maxWidth: `calc(100% - ${theme.spacing(4)} - 30px)`,\r\n overflowWrap: \"break-word\",\r\n position: \"relative\"\r\n },\r\n name: {\r\n lineHeight: \"16px\"\r\n },\r\n rating: {\r\n position: \"relative\",\r\n top: \"5px\",\r\n whiteSpace: \"nowrap\"\r\n },\r\n path: {\r\n maxWidth: \"100%\",\r\n float: \"left\",\r\n overflow: \"hidden\",\r\n whiteSpace: \"nowrap\",\r\n textOverflow: \"ellipsis\",\r\n direction: \"rtl\",\r\n textAlign: \"left\"\r\n },\r\n startIconContainer: {\r\n width: \"30px\",\r\n height: \"30px\",\r\n color: theme.palette.common.softIcon,\r\n background: theme.palette.grey[500_16],\r\n borderRadius: \"50%\",\r\n marginRight: theme.spacing(1.5)\r\n }\r\n}));\r\n\r\n\r\nexport default function NodeSearchResultMinimal(props) {\r\n const { nodeId, onClick, startIcon, className } = props;\r\n const { entity: node, updateCount } = useEntity(\"Node\", nodeId, false);\r\n const classes = useStyles();\r\n\r\n const name = node?.name || \"[Topic Deleted]\";\r\n\r\n useEffect(() => {\r\n node?.updatePath();\r\n }, [node, updateCount]);\r\n\r\n return (\r\n <Grid\r\n className={`${classes.root} ${className || \"\"}`}\r\n onClick={onClick}\r\n direction=\"row\"\r\n justifyContent=\"flex-start\"\r\n alignItems=\"center\"\r\n container\r\n item\r\n >\r\n {startIcon ? (\r\n <Grid container item justifyContent=\"center\" alignItems=\"center\" className={classes.startIconContainer}>\r\n {startIcon}\r\n </Grid>\r\n ) : null}\r\n <Grid container item xs justifyContent=\"center\" alignItems=\"flex-start\" className={classes.nameItem} direction=\"column\">\r\n <Typography variant=\"subtitle2\" align=\"left\" className={classes.name}>\r\n {name}\r\n </Typography>\r\n <Typography variant=\"caption\" color=\"textSecondary\" className={classes.path}>\r\n ‎{node?.path?.join(\" > \") || \"Category\"}\r\n </Typography>\r\n </Grid>\r\n </Grid>\r\n );\r\n}\r\n","import { useState, useMemo } from \"react\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport { Grid, Typography, Fade } from \"@mui/material\";\r\nimport { Skeleton } from \"@mui/material\";\r\nimport TimedRemover from \"./display/TimedRemover\";\r\nimport { useLoadedResource } from \"../../hooks/useResources\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n root: {\r\n position: \"relative\",\r\n height: \"auto\",\r\n width: \"100%\",\r\n padding: theme.spacing(1),\r\n borderRadius: theme.spacing(0.5),\r\n overflow: \"hidden\"\r\n },\r\n selected: {\r\n background: theme.palette.common.selectedResource\r\n },\r\n imageItem: {\r\n position: \"relative\",\r\n float: \"right\",\r\n width: \"65px\",\r\n height: \"38px\",\r\n },\r\n image: {\r\n position: \"absolute\",\r\n width: \"65px\",\r\n height: \"38px\",\r\n borderRadius: theme.spacing(1),\r\n objectFit: \"cover\",\r\n zIndex: 1,\r\n display: \"block\"\r\n },\r\n skeleton: {\r\n position: \"absolute\",\r\n width: \"65px\",\r\n height: \"38px\",\r\n borderRadius: theme.spacing(1),\r\n zIndex: 2\r\n },\r\n imageLoaded: {\r\n opacity: 1\r\n },\r\n leftContainer: {\r\n paddingRight: theme.spacing(2),\r\n wordBreak: \"break-word\",\r\n maxWidth: \"calc(100% - 72px)\"\r\n },\r\n title: {\r\n display: \"block\",\r\n textOverflow: \"ellipsis\",\r\n wordWrap: \"break-word\",\r\n maxHeight: \"64px\",\r\n overflow: \"hidden\",\r\n lineHeight: \"16px\"\r\n },\r\n path: {\r\n maxWidth: \"100%\",\r\n float: \"left\",\r\n overflow: \"hidden\",\r\n whiteSpace: \"nowrap\",\r\n textOverflow: \"ellipsis\",\r\n direction: \"rtl\",\r\n textAlign: \"left\"\r\n }\r\n}));\r\n\r\nexport default function ResourcePreviewItemMinimal(props) {\r\n const { resourceId, showPath, onClick, className } = props;\r\n const classes = useStyles();\r\n const [imgLoaded, setImgLoaded] = useState(false);\r\n const [imgError, setImgError] = useState(false);\r\n const { resource, getPath } = useLoadedResource(resourceId);\r\n\r\n const path = useMemo(() => showPath && resource ? getPath() : null, [getPath, resource, showPath]);\r\n\r\n const onImageLoad = () => setImgLoaded(true);\r\n const onImageError = () => setImgError(true);\r\n\r\n const isWorking = resource?.isWorking();\r\n\r\n return resource ? (\r\n <Grid\r\n onClick={onClick}\r\n className={`${classes.root} ${className || \"\"}`}\r\n container justifyContent=\"flex-end\" alignItems=\"center\" direction=\"row\"\r\n >\r\n <Grid item container xs direction=\"column\" justifyContent=\"center\" alignItems=\"flex-start\" className={classes.leftContainer}>\r\n <Typography variant=\"subtitle2\" color=\"textPrimary\" className={classes.title}>\r\n {resource.incomplete && !isWorking ? \"[Incomplete] \" : \"\"}{resource.name || \"Resource\"}\r\n </Typography>\r\n <Typography variant=\"caption\" color=\"textSecondary\" className={classes.path}>\r\n {path}\r\n </Typography>\r\n </Grid>\r\n <Grid item>\r\n <div className={classes.imageItem}>\r\n <TimedRemover in={!imgLoaded}>\r\n <Skeleton variant=\"rectangular\" className={classes.skeleton} />\r\n </TimedRemover>\r\n <Fade in={imgLoaded}>\r\n <img\r\n className={classes.image}\r\n src={resource.getImageUrl(imgError)}\r\n onLoad={onImageLoad}\r\n onError={onImageError}\r\n decoding=\"async\"\r\n loading=\"eager\"\r\n width=\"65px\"\r\n height=\"38px\"\r\n alt=\"\"\r\n />\r\n </Fade>\r\n </div>\r\n </Grid>\r\n </Grid>\r\n ) : (\r\n <Grid\r\n className={`${classes.root} ${className || \"\"}`}\r\n container justifyContent=\"flex-end\" alignItems=\"center\"\r\n >\r\n <Grid item container xs direction=\"column\" justifyContent=\"center\" className={classes.leftContainer}>\r\n <Typography variant=\"subtitle1\" className={classes.title} color=\"textPrimary\">[Resource Deleted]</Typography>\r\n </Grid>\r\n <Grid item>\r\n <div className={classes.imageItem}>\r\n <img\r\n className={classes.image}\r\n src=\"/assets/placeholder_online.svg\"\r\n decoding=\"async\"\r\n loading=\"eager\"\r\n width=\"65px\"\r\n height=\"38px\"\r\n alt=\"\"\r\n />\r\n </div>\r\n </Grid>\r\n </Grid>\r\n );\r\n}","import { useCallback, useEffect, useMemo } from \"react\";\r\nimport { Grid, Typography } from \"@mui/material\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport { useDispatch } from \"react-redux\";\r\nimport * as SearchActions from \"../../../actions/search\";\r\nimport { SetNodeViewTabIndex } from \"../../../actions/app\";\r\nimport CardHeader from \"../../atoms/CardHeader\";\r\nimport Scrollbar from \"../../atoms/Scrollbar\";\r\nimport NodeSearchResultMinimal from \"../../atoms/NodeSearchResultMinimal\";\r\nimport ResourcePreviewItemMinimal from \"../../atoms/ResourcePreviewItemMinimal\";\r\nimport { useReferencingEntities, useEntities } from \"@emberly/dataplane\";\r\nimport { ReactEditorBlock } from \"@emberly/editor\";\r\nimport { LinkRounded as LinkIcon } from \"@mui/icons-material\";\r\nimport { useGroupUrl } from \"../../../hooks/useApp\";\r\nimport { useHistory, useLocation } from \"react-router\";\r\n\r\nconst useStyles = makeStyles(theme => ({\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 background: theme.palette.background.paper,\r\n zIndex: 99999999,\r\n overflow: \"hidden\"\r\n },\r\n container: {\r\n maxWidth: \"570px\",\r\n width: \"100%\",\r\n height: \"auto\",\r\n marginLeft: \"auto\",\r\n marginRight: \"auto\",\r\n position: \"relative\"\r\n },\r\n spacer: {\r\n height: theme.spacing(2),\r\n },\r\n span: {\r\n color: theme.palette.success.main,\r\n fontWeight: 500\r\n },\r\n subHeaderItemPrimary: {\r\n height: \"40px\",\r\n lineHeight: \"40px\",\r\n textAlign: \"center\",\r\n marginBottom: theme.spacing(-1)\r\n },\r\n subHeaderItemSecondary: {\r\n borderTop: `1px solid ${theme.palette.divider}`,\r\n height: \"40px\",\r\n lineHeight: \"40px\",\r\n textAlign: \"center\",\r\n marginTop: theme.spacing(1),\r\n marginBottom: theme.spacing(-1)\r\n },\r\n subHeader: {\r\n lineHeight: \"40px\",\r\n fontWeight: 500,\r\n marginLeft: theme.spacing(2),\r\n float: \"left\"\r\n },\r\n emptyStateItem: {\r\n marginTop: theme.spacing(2),\r\n marginBottom: theme.spacing(3),\r\n marginLeft: theme.spacing(3),\r\n marginRight: theme.spacing(3)\r\n },\r\n card: {\r\n maxWidth: \"calc(100% - 16px)\",\r\n cursor: \"pointer\",\r\n position: \"relative\",\r\n boxShadow: \"0px 2px 10px rgba(0, 0, 0, 0.04)\",\r\n margin: theme.spacing(1),\r\n \"@media (hover: hover)\": {\r\n \"&:hover\": {\r\n \"&:before\": {\r\n background: theme.palette.action.hover,\r\n position: \"absolute\",\r\n height: \"100%\",\r\n width: \"100%\",\r\n borderRadius: theme.spacing(0.5),\r\n content: \"''\",\r\n display: \"block\"\r\n }\r\n },\r\n }\r\n },\r\n preview: {\r\n border: `1px solid ${theme.palette.divider}`,\r\n borderRadius: 0,\r\n borderTopLeftRadius: theme.spacing(0.5),\r\n borderTopRightRadius: theme.spacing(0.5),\r\n },\r\n block: {\r\n background: theme.palette.background.lowered,\r\n borderTop: \"none\",\r\n border: `1px solid ${theme.palette.divider}`,\r\n padding: theme.spacing(1.5),\r\n borderBottomLeftRadius: theme.spacing(0.5),\r\n borderBottomRightRadius: theme.spacing(0.5)\r\n },\r\n paragraph: {\r\n marginTop: theme.spacing(0.5),\r\n color: theme.palette.text.primary,\r\n fontSize: \"12px\",\r\n lineHeight: \"18px\"\r\n },\r\n}));\r\n\r\nexport default function InboundLinksDialog(props) {\r\n const { noteId } = props;\r\n const classes = useStyles();\r\n const dispatch = useDispatch();\r\n const location = useLocation();\r\n\r\n const { entities } = useReferencingEntities(\"Note\", noteId);\r\n\r\n const nodeBlocks = useMemo(() => entities.filter(t => t.isParentNode()), [entities]);\r\n const resourceBlocks = useMemo(() => entities.filter(t => t.isParentResource()), [entities]);\r\n\r\n const resourceIds = useMemo(() => resourceBlocks.map(t => t.getParentResourceId()), [resourceBlocks]);\r\n const { entities: resources } = useEntities(\"Resource\", resourceIds);\r\n\r\n const nodeIds = useMemo(\r\n () => [...new Set(nodeBlocks\r\n .map(t => t.getParentResourceId())\r\n .concat(\r\n resources.map(t => t.parentId)\r\n ))], \r\n [nodeBlocks, resources]\r\n );\r\n\r\n\r\n const { entities: nodes } = useEntities(\"Node\", nodeIds);\r\n\r\n const nodeLinks = useMemo(() => nodeBlocks.map(block => ({ block, node: nodes.find(t => block.isParentResourceId(t.id)) })).filter(t => !!t.node && !t.node._deleted), [nodes, nodeBlocks]);\r\n \r\n const resourceLinks = useMemo(\r\n () => resourceBlocks\r\n .map(block => ({ block, resource: resources.find(t => block.isParentResourceId(t.id)) }))\r\n .filter(t => !!t.resource && !t.resource._deleted && !!nodes.find(n => n.id === t.resource.parentId && !n._deleted)), \r\n [resources, resourceBlocks, nodes]\r\n );\r\n\r\n const onCancel = useCallback(() => dispatch(SearchActions.SetInboundLinksPanel(false)), [dispatch]);\r\n\r\n useEffect(() => {\r\n return () => {\r\n onCancel();\r\n }\r\n }, [location.pathname, onCancel]);\r\n\r\n\r\n return (\r\n <Grid className={classes.root} container spacing={0} direction=\"column\" justifyContent=\"flex-start\" alignItems=\"stretch\">\r\n\r\n <Grid item>\r\n <CardHeader\r\n title=\"Linked references\"\r\n onBack={onCancel}\r\n border\r\n />\r\n </Grid>\r\n\r\n <Grid item xs container>\r\n <Scrollbar className={classes.scrollbar}>\r\n <Grid item container className={classes.container} direction=\"column\" spacing={0}>\r\n\r\n <Grid item container className={classes.subHeaderItemPrimary}>\r\n <Typography variant=\"subtitle2\" color=\"textSecondary\" className={classes.subHeader}>Topics</Typography>\r\n </Grid>\r\n\r\n {\r\n nodeLinks.length === 0 ? (\r\n <Typography variant=\"body2\" align=\"center\" className={classes.emptyStateItem} color=\"textSecondary\">\r\n No linked topics\r\n </Typography>\r\n ) : (\r\n nodeLinks.map((link, idx, list) => (\r\n <InboundNodeLink link={link} key={idx} divider={idx !== list.length - 1} onClick={onCancel} dispatch={dispatch} />\r\n ))\r\n )\r\n }\r\n\r\n <Grid item container className={classes.subHeaderItemSecondary}>\r\n <Typography variant=\"subtitle2\" color=\"textSecondary\" className={classes.subHeader}>Resources</Typography>\r\n </Grid>\r\n\r\n {\r\n resourceLinks.length === 0 ? (\r\n <Typography variant=\"body2\" align=\"center\" className={classes.emptyStateItem} color=\"textSecondary\">\r\n No linked resources\r\n </Typography>\r\n ) : (\r\n resourceLinks.map((link, idx, list) => (\r\n <InboundResourceLink link={link} key={idx} divider={idx !== list.length - 1} onClick={onCancel} />\r\n ))\r\n )\r\n }\r\n\r\n <div className={classes.spacer}></div>\r\n </Grid>\r\n </Scrollbar>\r\n </Grid>\r\n </Grid>\r\n );\r\n}\r\n\r\nfunction InboundNodeLink(props) {\r\n const { link, onClick, dispatch } = props;\r\n const { node, block } = link;\r\n const classes = useStyles();\r\n const history = useHistory();\r\n const groupUrl = useGroupUrl();\r\n\r\n const onNavigate = () => {\r\n onClick();\r\n dispatch(SetNodeViewTabIndex(1));\r\n history.push({ pathname: `${groupUrl}/node/${node.id}`, search: window.location.search });\r\n };\r\n\r\n return (\r\n <div onClick={onNavigate} className={classes.card}>\r\n <NodeSearchResultMinimal nodeId={node?.id || block.getParentResourceId()} startIcon={<LinkIcon fontSize=\"small\" />} className={classes.preview} />\r\n <div className={classes.block}>\r\n <ReactEditorBlock block={block} className={classes.paragraph} />\r\n </div>\r\n </div>\r\n );\r\n}\r\n\r\n// might have to treat onClick to not affect the actual rendered block.\r\nfunction InboundResourceLink(props) {\r\n const { link, onClick } = props;\r\n const { resource, block } = link;\r\n const classes = useStyles();\r\n const history = useHistory();\r\n const groupUrl = useGroupUrl();\r\n\r\n const onNavigate = () => {\r\n onClick();\r\n history.push({ pathname: `${groupUrl}/resource/${resource.id}`, search: window.location.search });\r\n };\r\n\r\n return (\r\n <div onClick={onNavigate} className={classes.card}>\r\n <ResourcePreviewItemMinimal resourceId={resource?.id || block.getParentResourceId()} showPath className={classes.preview} />\r\n <div className={classes.block}>\r\n <ReactEditorBlock block={block} className={classes.paragraph} />\r\n </div>\r\n </div>\r\n );\r\n}","import { useCallback, useMemo, useRef, useEffect } from \"react\";\r\nimport SearchPanel from \"../../molecules/panels/SearchPanel\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport { useSelector, useDispatch } from \"react-redux\";\r\nimport * as SearchActions from \"../../../actions/search\";\r\nimport { ConditionalPortal } from \"../../atoms/views/ConditionalPortalView\";\r\nimport { useDevice } from \"../../../providers/DeviceContext\";\r\nimport { useLocation } from \"react-router\";\r\n\r\nconst useStyles = makeStyles(theme => ({\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 background: theme.palette.background.paper,\r\n overflow: \"hidden\",\r\n zIndex: 99999999\r\n }\r\n}));\r\n\r\n// TODO add system to better do event handling when clicking on a node\r\nexport default function SearchDialog() {\r\n const classes = useStyles();\r\n const selectHandles = useSelector(state => state.search.selectHandles);\r\n const { isMobilePortraitView } = useDevice();\r\n const dispatch = useDispatch();\r\n const handleRef = useRef(null);\r\n const location = useLocation();\r\n\r\n const selectHandle = useMemo(() => selectHandles.length !== 0 ? selectHandles[0] : null, [selectHandles]);\r\n handleRef.current = selectHandle;\r\n\r\n const onCancel = useCallback(() => {\r\n if (selectHandle) {\r\n selectHandle.callback(null, null);\r\n dispatch(SearchActions.CancelSelect());\r\n }\r\n }, [selectHandle, dispatch]);\r\n\r\n const onNodeSelected = useCallback((nodeId, resourceId, contextId) => {\r\n selectHandle.callback(\"node\", nodeId, null, contextId);\r\n dispatch(SearchActions.FinishSelect(\"node\", nodeId, null, contextId));\r\n }, [selectHandle, dispatch]);\r\n\r\n const onResourceSelected = useCallback((nodeId, resourceId, contextId) => {\r\n selectHandle.callback(\"resource\", nodeId, resourceId, contextId);\r\n dispatch(SearchActions.FinishSelect(\"resource\", nodeId, resourceId, contextId));\r\n }, [selectHandle, dispatch]);\r\n\r\n useEffect(() => {\r\n if (handleRef.current !== null) {\r\n if (!!handleRef.current.callback) {\r\n handleRef.current.callback(null, null);\r\n }\r\n dispatch(SearchActions.CancelSelect());\r\n }\r\n }, [handleRef, location.pathname, dispatch]);\r\n\r\n\r\n return useMemo(() => selectHandle !== null ? (\r\n <ConditionalPortal portalId={selectHandle.portalId} active={!!selectHandle.portalId} onClose={onCancel}>\r\n <div className={classes.root}>\r\n <SearchPanel\r\n title={selectHandle.title}\r\n description={isMobilePortraitView && !!selectHandle.mobileDescription ? selectHandle.mobileDescription : selectHandle.description}\r\n onCancel={onCancel}\r\n onNodeSelected={onNodeSelected}\r\n onResourceSelected={onResourceSelected}\r\n prefill={selectHandle.prefill}\r\n includeTopics={selectHandle.includeTopics}\r\n includeResources={selectHandle.includeResources}\r\n initialContextId={selectHandle.initialContextId}\r\n allowContextSwitching={selectHandle.allowContextSwitching}\r\n />\r\n </div>\r\n </ConditionalPortal>\r\n ) : null, [classes, selectHandle, isMobilePortraitView, onNodeSelected, onResourceSelected, onCancel]);\r\n}\r\n","import { useCallback, useEffect, useRef } from \"react\";\r\nimport { useSelector, useDispatch } from \"react-redux\";\r\nimport * as AppActions from \"../../../actions/app\";\r\nimport ConfirmDialog from \"../../atoms/views/ConfirmDialog\";\r\nimport { useLocation } from \"react-router\";\r\n\r\nexport default function UniversalConfirmDialog() {\r\n const dispatch = useDispatch();\r\n const location = useLocation();\r\n const handles = useSelector(state => state.app.confirmDialogHandles);\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) {\r\n handle.onCancel();\r\n }\r\n dispatch(AppActions.ConfirmDialogCancel());\r\n }, [handle, dispatch]);\r\n \r\n const handleConfirm = useCallback(() => {\r\n if (!!handle) {\r\n handle.onConfirm();\r\n }\r\n dispatch(AppActions.ConfirmDialogConfirm());\r\n }, [handle, dispatch])\r\n\r\n useEffect(() => {\r\n if (handleRef.current !== null) {\r\n if (!!handleRef.current.onCancel) {\r\n handleRef.current.onCancel();\r\n }\r\n dispatch(AppActions.ConfirmDialogCancel());\r\n }\r\n }, [handleRef, location.pathname, dispatch]);\r\n\r\n return active ? (\r\n <ConfirmDialog\r\n title={handle.title}\r\n confirmText={handle.confirmText}\r\n confirmColor={handle.color}\r\n description={handle.description}\r\n content={handle.content}\r\n onCancel={handleCancel}\r\n onConfirm={handleConfirm}\r\n open\r\n />\r\n ) : null;\r\n}","import { useState, useCallback, useEffect } from \"react\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport { Grid, Typography, Paper, MobileStepper, FormControlLabel, Checkbox, Button } from \"@mui/material\";\r\nimport { useRTACProfile } from \"@emberly/dataplane\";\r\nimport { useDispatch } from \"react-redux\";\r\nimport ShowOnboarding from \"../../../actions/auth\";\r\nimport { getAffiliateId } from \"../../../common/AffiliateHandler\";\r\nimport TrackGoal from \"../../../common/AnalyticsHandler\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n root: {\r\n background: \"#F5F7F6\",\r\n position: \"absolute\",\r\n top: 0,\r\n left: 0,\r\n width: \"100%\",\r\n height: \"100%\",\r\n overflowY: \"auto\",\r\n zIndex: 9999999\r\n },\r\n grid: {\r\n position: \"absolute\",\r\n top: 0,\r\n left: 0,\r\n width: \"100%\",\r\n height: \"100%\",\r\n background: \"#F5F7F6\",\r\n zIndex: 99999999,\r\n \"@media (max-width: 569px)\": {\r\n height: \"100%\"\r\n }\r\n },\r\n gridItem: {\r\n width: \"100%\",\r\n paddingLeft: \"auto\",\r\n paddingRight: \"auto\",\r\n height: \"100%\"\r\n },\r\n paper: {\r\n boxShadow: \"0 12px 40px rgba(0,0,0,.12)\",\r\n width: \"100%\",\r\n maxWidth: \"560px\",\r\n height: \"auto\",\r\n borderRadius: theme.spacing(0.5),\r\n padding: theme.spacing(6),\r\n paddingTop: theme.spacing(2),\r\n paddingBottom: theme.spacing(4),\r\n \"@media (max-width: 569px)\": {\r\n minHeight: \"100%\",\r\n minWidth: \"100%\",\r\n marginTop: 0,\r\n borderRadius: 0,\r\n marginBottom: 0,\r\n paddingLeft: theme.spacing(2),\r\n paddingRight: theme.spacing(2),\r\n overflowX: \"hidden\"\r\n },\r\n zIndex: 999999999\r\n },\r\n stepper: {\r\n marginBottom: theme.spacing(2),\r\n background: \"none\",\r\n flexGrow: 1,\r\n \"& .MuiMobileStepper-dot\": {\r\n marginLeft: theme.spacing(1),\r\n marginRight: theme.spacing(1),\r\n },\r\n \"& .MuiMobileStepper-dotActive\": {\r\n background: theme.palette.secondary.main\r\n }\r\n },\r\n screenHeader: {\r\n fontWeight: 600,\r\n marginBottom: theme.spacing(1.5)\r\n },\r\n nextButton: {\r\n marginTop: \"8px\",\r\n marginBottom: \"8px\",\r\n height: \"56px\",\r\n width: \"100%\"\r\n },\r\n imageGrid: {\r\n width: \"100%\",\r\n marginBottom: theme.spacing(3)\r\n },\r\n imageGridMarginBottom: {\r\n width: \"100%\",\r\n marginTop: 0,\r\n marginBottom: theme.spacing(8)\r\n },\r\n imageContainer: {\r\n position: \"relative\",\r\n height: 0,\r\n marginTop: theme.spacing(4),\r\n width: \"100%\",\r\n paddingTop: \"calc(560 / 960 * 100%)\",\r\n overflow: \"hidden\"\r\n },\r\n image: {\r\n top: 0,\r\n left: 0,\r\n position: \"absolute\",\r\n maxWidth: \"100%\",\r\n height: \"auto\",\r\n verticalAlign: \"middle\",\r\n },\r\n embedContainer: {\r\n position: \"relative\",\r\n height: 0,\r\n marginTop: theme.spacing(4),\r\n width: \"100%\",\r\n paddingTop: \"262px\",\r\n overflow: \"hidden\"\r\n },\r\n embed: {\r\n top: 0,\r\n left: 0,\r\n position: \"absolute\",\r\n width: \"100%\",\r\n height: \"100%\",\r\n verticalAlign: \"middle\",\r\n borderRadius: \"4px\",\r\n border: `2px solid ${theme.palette.divider}`\r\n },\r\n consentCheckbox: {\r\n marginBottom: theme.spacing(2)\r\n }\r\n}));\r\n\r\nexport default function OnboardingPage() {\r\n const classes = useStyles();\r\n const [activeStep, setActiveStep] = useState(0);\r\n const [visible, setVisible] = useState(true);\r\n\r\n useEffect(() => {\r\n TrackGoal(\"TYZOOLW1\");\r\n }, []);\r\n\r\n const onNext = useCallback(() => {\r\n setActiveStep(step => step + 1);\r\n }, [setActiveStep]);\r\n\r\n return visible ? (\r\n <div className={classes.root}>\r\n <Grid container className={classes.grid} justifyContent=\"flex-start\" alignItems=\"flex-start\" direction=\"row\">\r\n <Grid item className={classes.gridItem} container justifyContent=\"center\" alignItems=\"center\">\r\n <Paper className={classes.paper} elevation={4}>\r\n <Grid container justifyContent=\"flex-start\" alignItems=\"center\" direction=\"column\">\r\n <Grid item>\r\n <MobileStepper\r\n variant=\"dots\"\r\n steps={2}\r\n position=\"static\"\r\n activeStep={activeStep}\r\n className={classes.stepper}\r\n color=\"secondary\"\r\n />\r\n </Grid>\r\n {screenSwitch(activeStep, onNext, setVisible)}\r\n </Grid>\r\n </Paper>\r\n </Grid>\r\n </Grid>\r\n </div>\r\n ) : null;\r\n}\r\n\r\nfunction screenSwitch(index, onNext, setVisible) {\r\n switch (index) {\r\n case 0: return (<IntroScreen onNext={onNext} />);\r\n default: return (<ReadyScreen onCompleted={() => setVisible(false)} />);\r\n }\r\n}\r\n\r\nfunction IntroScreen(props) {\r\n const { onNext } = props;\r\n const classes = useStyles();\r\n\r\n return (\r\n <>\r\n <Grid item>\r\n <Typography variant=\"h5\" align=\"center\" className={classes.screenHeader}>Welcome to Emberly</Typography>\r\n <Typography variant=\"body1\" align=\"center\">\r\n Emberly lets you organize your bookmarks, files, and notes in an easier and more intuitive way by using a mind map.\r\n </Typography>\r\n </Grid>\r\n\r\n <Grid item className={classes.imageGridMarginBottom}>\r\n <div className={classes.imageContainer}>\r\n <img src=\"/assets/onboarding_folder_tree.png\" alt=\"folder\" className={classes.image}></img>\r\n </div>\r\n </Grid>\r\n\r\n <Button fullWidth color=\"primary\" size=\"large\" variant=\"contained\" className={classes.nextButton} onClick={onNext}>\r\n Next\r\n </Button>\r\n </>\r\n );\r\n}\r\n\r\n\r\nfunction ReadyScreen(props) {\r\n const { onCompleted } = props;\r\n const classes = useStyles();\r\n const [consent, setConsent] = useState(false);\r\n const onSetConsent = useCallback((ev) => setConsent(ev.target.checked), [setConsent]);\r\n const { provider } = useRTACProfile();\r\n const dispatch = useDispatch();\r\n\r\n const finishOnboarding = useCallback(() => {\r\n provider.updateProfile(null, true, undefined, undefined, undefined, undefined, getAffiliateId());\r\n\r\n dispatch(ShowOnboarding(false));\r\n TrackGoal(\"FF2FH0XZ\");\r\n onCompleted();\r\n\r\n }, [provider, dispatch, onCompleted]);\r\n\r\n return (\r\n <>\r\n <Grid item>\r\n <Typography variant=\"h5\" align=\"center\" className={classes.screenHeader}>Your account's ready to go!</Typography>\r\n <Typography variant=\"body1\" align=\"center\">\r\n You're all set up to start organizing your knowledge. If you want some help and inspiration, check out this getting started guide:\r\n </Typography>\r\n </Grid>\r\n\r\n <Grid item className={classes.imageGrid}>\r\n <div className={classes.embedContainer}>\r\n <iframe className={classes.embed} src=\"https://www.youtube.com/embed/sywHA3BLVYw\" title=\"YouTube video player\" frameBorder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" allowFullScreen></iframe>\r\n </div>\r\n </Grid>\r\n\r\n <Grid item>\r\n <FormControlLabel\r\n value=\"consent\"\r\n className={classes.consentCheckbox}\r\n control={<Checkbox onChange={onSetConsent} checked={consent} />}\r\n label={<Typography variant=\"body2\">I accept the <a href=\"/policy.html\" target=\"_blank\">terms and conditions</a></Typography>}\r\n labelPlacement=\"end\"\r\n />\r\n </Grid>\r\n\r\n <Button fullWidth color=\"primary\" size=\"large\" variant=\"contained\" className={classes.nextButton} onClick={finishOnboarding} disabled={!consent}>\r\n Get Started {!consent ? \"(Consent Required)\" : \"\"}\r\n </Button>\r\n </>\r\n );\r\n}","import { useEffect, useState, useCallback, useMemo } from \"react\";\r\nimport { Grid, Typography, Button, Chip } from \"@mui/material\";\r\nimport { ToggleButton, ToggleButtonGroup } from '@mui/material';\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport { useSelector, useDispatch } from \"react-redux\";\r\nimport { Star as StarIcon } from \"@mui/icons-material\";\r\nimport * as FilterActions from \"../../../actions/filter\";\r\nimport CardHeader from \"../../atoms/CardHeader\";\r\nimport Scrollbar from \"../../atoms/Scrollbar\";\r\nimport { useTags } from \"@emberly/dataplane\";\r\nimport { useDevice } from \"../../../providers/DeviceContext\";\r\nimport { useHistory, useLocation } from \"react-router\";\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 chip: {\r\n margin: \"4px\",\r\n lineHeight: \"58px\"\r\n },\r\n chipActive: {\r\n background: theme.palette.primary.light\r\n },\r\n detail: {\r\n color: theme.palette.text.secondary\r\n },\r\n applyButtonContainer: {\r\n boxShadow: theme.inverseShadows[1]\r\n },\r\n applyButton: {\r\n position: \"relative\",\r\n height: \"84px\",\r\n width: \"50%\",\r\n borderRadius: 0\r\n },\r\n applyButtonRight: {\r\n borderLeft: `1px solid ${theme.palette.divider}`\r\n },\r\n toggleGroup: {\r\n position: \"relative\",\r\n width: \"100%\",\r\n display: \"flex\",\r\n marginBottom: theme.spacing(1)\r\n },\r\n toggleButton: {\r\n flex: 0.5\r\n },\r\n text: {\r\n marginTop: theme.spacing(1)\r\n },\r\n item: {\r\n paddingLeft: theme.spacing(2),\r\n paddingRight: theme.spacing(2)\r\n },\r\n star: {\r\n color: theme.palette.secondary.dark\r\n }\r\n}));\r\n\r\nexport default function FilterView() {\r\n const classes = useStyles();\r\n const dispatch = useDispatch();\r\n const { filterSortBy, filterMinRating, filterResourceType, filterTags, filterArchived } = useSelector(state => state.filter);\r\n const {isMobilePortraitView, isEmbedView } = useDevice();\r\n const history = useHistory();\r\n const location = useLocation();\r\n const [sortBy, setSortBy] = useState(\"date\");\r\n const [minRating, setMinRating] = useState(0);\r\n const [resourceType, setResourceType] = useState(\"any\");\r\n const [selectedTags, setSelectedTags] = useState([]);\r\n const [archived, setArchived] = useState(\"visible\");\r\n const { tags } = useTags();\r\n const isSearchView = location.pathname.includes(\"/search/\");\r\n\r\n useEffect(() => {\r\n setSortBy(filterSortBy);\r\n setMinRating(filterMinRating);\r\n setResourceType(filterResourceType);\r\n setSelectedTags(filterTags);\r\n setArchived(filterArchived)\r\n }, [filterSortBy, filterMinRating, filterResourceType, filterArchived, setSortBy, setMinRating, setResourceType, setArchived, filterTags, isSearchView]);\r\n\r\n const handleClose = useCallback(() => {\r\n if (location.pathname.endsWith(\"/filter\") && !isMobilePortraitView) {\r\n if (isEmbedView) {\r\n history.goBack(); \r\n } else {\r\n history.replace(location.pathname.substring(0,location.pathname.lastIndexOf(\"/\")));\r\n }\r\n } else {\r\n history.goBack();\r\n }\r\n }, [location, history, isMobilePortraitView, isEmbedView]);\r\n\r\n const handleApply = useCallback(() => {\r\n dispatch(FilterActions.SetFilter(sortBy, minRating, resourceType, archived, selectedTags));\r\n handleClose();\r\n }, [sortBy, minRating, resourceType, archived, selectedTags, dispatch, handleClose]);\r\n\r\n const handleClear = useCallback(() => {\r\n setSortBy(\"date\");\r\n setMinRating(0);\r\n setResourceType(\"any\");\r\n setSelectedTags([]);\r\n dispatch(FilterActions.SetFilter(\"date\", 0, \"any\", \"visible\", []));\r\n handleClose();\r\n }, [setSortBy, setMinRating, setResourceType, handleClose, dispatch]);\r\n\r\n const handleSortBy = useCallback((ev, val) => {\r\n if (!!val) {\r\n setSortBy(val);\r\n }\r\n }, [setSortBy]);\r\n\r\n const handleMinRating = useCallback((ev, val) => {\r\n if (val !== null) {\r\n setMinRating(val);\r\n }\r\n }, [setMinRating]);\r\n\r\n const handleResourceType = useCallback((ev, val) => {\r\n if (!!val) {\r\n setResourceType(val);\r\n }\r\n }, [setResourceType]);\r\n\r\n const handleArchived = useCallback((ev, val) => {\r\n if (!!val) {\r\n setArchived(val);\r\n }\r\n }, [setArchived]);\r\n\r\n\r\n const toggleTag = useCallback((tag) => {\r\n if (selectedTags.indexOf(tag) === -1) {\r\n setSelectedTags(selectedTags.concat(tag));\r\n } else {\r\n setSelectedTags(selectedTags.filter(t => t !== tag));\r\n }\r\n }, [selectedTags]);\r\n\r\n const onMenuButtons = useCallback((menuItem) => {\r\n switch (menuItem) {\r\n case \"CLEAR\":\r\n handleClear();\r\n break;\r\n case \"DONE\":\r\n handleApply();\r\n break;\r\n default:\r\n break;\r\n }\r\n }, [handleClear, handleApply]);\r\n\r\n const tagItems = useMemo(\r\n () => tags.map(tag => <Chip key={tag} label={tag} className={classes.chip} color={selectedTags.indexOf(tag) === -1 ? \"default\" : \"primary\"} onClick={ev => toggleTag(tag)} />),\r\n [classes, tags, selectedTags, toggleTag]\r\n );\r\n\r\n return (\r\n <Grid className={classes.root} container direction=\"column\" justifyContent=\"flex-start\" alignItems=\"stretch\">\r\n\r\n <Grid item>\r\n <CardHeader\r\n title={isMobilePortraitView ? \"Filters\" : \"\"}\r\n onBack={handleApply}\r\n onMenuButton={!isMobilePortraitView && !isEmbedView ? onMenuButtons : undefined}\r\n menuItems={!isMobilePortraitView && !isEmbedView ? [\"CLEAR\", \"DONE\"] : undefined}\r\n border\r\n />\r\n </Grid>\r\n\r\n <Grid item xs container>\r\n <Scrollbar>\r\n\r\n <Grid className={classes.item} item>\r\n <Typography className={classes.text} variant=\"subtitle2\">Sort by</Typography>\r\n </Grid>\r\n <Grid className={classes.item} item>\r\n <ToggleButtonGroup\r\n className={classes.toggleGroup}\r\n value={sortBy}\r\n onChange={handleSortBy}\r\n exclusive\r\n >\r\n <ToggleButton value=\"date\" className={classes.toggleButton}>\r\n { isSearchView ? \"Relevance\" : \"Date Added\" }\r\n </ToggleButton>\r\n <ToggleButton value=\"rating\" className={classes.toggleButton}>\r\n Rating\r\n </ToggleButton>\r\n </ToggleButtonGroup>\r\n </Grid>\r\n\r\n <Grid className={classes.item} item>\r\n <Typography className={classes.text} variant=\"subtitle2\">Rating <span className={classes.detail}>• at least</span></Typography>\r\n </Grid>\r\n <Grid className={classes.item} item>\r\n <ToggleButtonGroup\r\n className={classes.toggleGroup}\r\n value={minRating}\r\n onChange={handleMinRating}\r\n exclusive\r\n >\r\n <ToggleButton value={0} className={classes.toggleButton}>\r\n Any\r\n </ToggleButton>\r\n <ToggleButton value={2} className={classes.toggleButton}>\r\n 2,0 <StarIcon fontSize=\"small\" className={classes.star} />\r\n </ToggleButton>\r\n <ToggleButton value={3} className={classes.toggleButton}>\r\n 3,0 <StarIcon fontSize=\"small\" className={classes.star} />\r\n </ToggleButton>\r\n <ToggleButton value={4} className={classes.toggleButton}>\r\n 4,0 <StarIcon fontSize=\"small\" className={classes.star} />\r\n </ToggleButton>\r\n <ToggleButton value={5} className={classes.toggleButton}>\r\n 5,0 <StarIcon fontSize=\"small\" className={classes.star} />\r\n </ToggleButton>\r\n </ToggleButtonGroup>\r\n </Grid>\r\n\r\n <Grid className={classes.item} item>\r\n <Typography className={classes.text} variant=\"subtitle2\">Resource Type</Typography>\r\n </Grid>\r\n <Grid className={classes.item} item>\r\n <ToggleButtonGroup\r\n className={classes.toggleGroup}\r\n value={resourceType}\r\n onChange={handleResourceType}\r\n exclusive\r\n >\r\n <ToggleButton value=\"any\" className={classes.toggleButton}>\r\n Any\r\n </ToggleButton>\r\n <ToggleButton value=\"online\" className={classes.toggleButton}>\r\n Online\r\n </ToggleButton>\r\n <ToggleButton value=\"offline\" className={classes.toggleButton}>\r\n Offline\r\n </ToggleButton>\r\n </ToggleButtonGroup>\r\n </Grid>\r\n\r\n <Grid className={classes.item} item>\r\n <Typography className={classes.text} variant=\"subtitle2\">Include Archived</Typography>\r\n </Grid>\r\n <Grid className={classes.item} item>\r\n <ToggleButtonGroup\r\n className={classes.toggleGroup}\r\n value={archived}\r\n onChange={handleArchived}\r\n exclusive\r\n >\r\n <ToggleButton value=\"visible\" className={classes.toggleButton}>\r\n Visible\r\n </ToggleButton>\r\n <ToggleButton value=\"archived\" className={classes.toggleButton}>\r\n Archived\r\n </ToggleButton>\r\n <ToggleButton value=\"all\" className={classes.toggleButton}>\r\n All\r\n </ToggleButton>\r\n </ToggleButtonGroup>\r\n </Grid>\r\n\r\n <Grid className={classes.item} item>\r\n <Typography className={classes.text} variant=\"subtitle2\">Tags</Typography>\r\n </Grid>\r\n <Grid className={classes.item} item>\r\n {tagItems}\r\n </Grid>\r\n\r\n </Scrollbar>\r\n </Grid>\r\n\r\n {isMobilePortraitView ? (\r\n <Grid item className={classes.applyButtonContainer}>\r\n <Button className={classes.applyButton} variant=\"text\" onClick={handleClear}>CLEAR</Button>\r\n <Button className={`${classes.applyButton} ${classes.applyButtonRight}`} variant=\"text\" onClick={handleApply}>APPLY</Button>\r\n </Grid>\r\n ) : null}\r\n\r\n </Grid >\r\n );\r\n}\r\n","import { useState, useCallback } from \"react\";\r\nimport { Grid, Typography, TextField, Button } from \"@mui/material\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport FileUpload from \"../atoms/inputs/FileUpload\";\r\nimport Scrollbar from \"../atoms/Scrollbar\";\r\nimport { getRootUrl } from \"../../hooks/useApp\";\r\nimport useResources from \"../../hooks/useResources\";\r\nimport { useHistory, useLocation, useRouteMatch } from \"react-router\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n view: {\r\n position: \"relative\",\r\n padding: theme.spacing(2),\r\n marginBottom: theme.spacing(4),\r\n width: \"100%\"\r\n },\r\n viewItem: {\r\n position: \"relative\",\r\n width: \"100%\",\r\n textAlign: \"center\",\r\n marginTop: theme.spacing(2)\r\n },\r\n button: {\r\n marginTop: theme.spacing(1),\r\n width: \"270px\",\r\n },\r\n text: {\r\n textAlign: \"left\"\r\n },\r\n textItem: {\r\n textAlign: \"left\",\r\n marginBottom: theme.spacing(2)\r\n }\r\n}));\r\n\r\nexport default function CreateOfflineResourcePanel() {\r\n const classes = useStyles();\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 { createResource, createFileResource, collection } = useResources(nodeId);\r\n const [name, setName] = useState(\"\");\r\n const [source, setSource] = useState(\"\");\r\n const [description, setDescription] = useState(\"\");\r\n const [file, setFile] = useState(\"\");\r\n\r\n const addOfflineResource = useCallback(() => {\r\n const id = collection.createEntityId();\r\n\r\n // TODO flush!\r\n if (!!file && file.size > 0) {\r\n createFileResource(\r\n {\r\n id,\r\n url: null,\r\n name,\r\n source,\r\n description,\r\n fileSize: file.size,\r\n fileType: file.type,\r\n pending: true\r\n },\r\n {\r\n file,\r\n flush: true\r\n }\r\n );\r\n } else {\r\n createResource({\r\n id,\r\n url: null,\r\n name,\r\n source,\r\n description,\r\n type: \"note\"\r\n }, \r\n {\r\n flush: true\r\n });\r\n }\r\n\r\n history.replace(`${getRootUrl(location.pathname)}/resource/${id}`);\r\n\r\n }, [name, source, description, file, history, createResource, createFileResource, collection, location]);\r\n\r\n const onFileChange = useCallback((target) => {\r\n setFile(target);\r\n\r\n if (!name && !!target) {\r\n setName(target.name);\r\n }\r\n\r\n }, [setFile, setName, name]);\r\n\r\n const handleSubmit = useCallback(ev => {\r\n if (ev.key === \"Enter\") {\r\n const inputText = ev.target.value.trim();\r\n if (inputText.length !== 0) {\r\n addOfflineResource();\r\n }\r\n }\r\n }, [addOfflineResource]);\r\n\r\n const offlineEnabled = name.length !== 0;\r\n\r\n return (\r\n <Scrollbar>\r\n <Grid container className={classes.view} direction=\"column\" justifyContent=\"flex-start\" alignItems=\"center\">\r\n <Grid className={classes.textItem} item xs={12}>\r\n <Typography variant=\"h6\" className={classes.text}>Add Offline Resource</Typography>\r\n <Typography variant=\"caption\" className={classes.text}>Examples of offline resources are: books, magazines, courses, meetups, and classes.</Typography>\r\n </Grid>\r\n <Grid className={classes.viewItem} item xs={12}>\r\n <TextField\r\n id=\"name\"\r\n label=\"Resource Name\"\r\n variant=\"outlined\"\r\n fullWidth\r\n value={name}\r\n onChange={(ev) => setName(ev.target.value)}\r\n onKeyPress={handleSubmit}\r\n onSubmit={handleSubmit}\r\n />\r\n </Grid>\r\n <Grid className={classes.viewItem} item xs={12}>\r\n <TextField\r\n id=\"source\"\r\n label=\"Source\"\r\n variant=\"outlined\"\r\n fullWidth\r\n value={source}\r\n onChange={(ev) => setSource(ev.target.value)}\r\n />\r\n </Grid>\r\n <Grid className={classes.viewItem} item xs={12}>\r\n <TextField\r\n id=\"description\"\r\n label=\"Description\"\r\n variant=\"outlined\"\r\n fullWidth\r\n value={description}\r\n multiline\r\n maxRows=\"10\"\r\n onChange={(ev) => setDescription(ev.target.value)}\r\n />\r\n </Grid>\r\n <Grid className={classes.viewItem} item xs={12}>\r\n <FileUpload\r\n onChange={onFileChange} \r\n />\r\n </Grid>\r\n <Grid className={classes.viewItem} item xs={12}>\r\n <Button\r\n className={classes.button}\r\n variant=\"contained\"\r\n color=\"primary\"\r\n onClick={addOfflineResource}\r\n disabled={!offlineEnabled}\r\n >\r\n Add Resource\r\n </Button>\r\n </Grid>\r\n </Grid>\r\n </Scrollbar>\r\n );\r\n}","import { useEffect, useState, useCallback } from \"react\";\r\nimport { Grid, Typography, TextField, Button } from \"@mui/material\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport Scrollbar from \"../atoms/Scrollbar\";\r\nimport { getRootUrl } from \"../../hooks/useApp\";\r\nimport useResources from \"../../hooks/useResources\";\r\nimport { useDevice } from \"../../providers/DeviceContext\";\r\nimport { useHistory, useLocation, useRouteMatch } from \"react-router\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n view: {\r\n position: \"relative\",\r\n padding: theme.spacing(2),\r\n marginBottom: theme.spacing(4),\r\n width: \"100%\"\r\n },\r\n viewItem: {\r\n position: \"relative\",\r\n width: \"100%\",\r\n textAlign: \"center\"\r\n },\r\n textField: {\r\n marginTop: theme.spacing(4),\r\n \"& .MuiFormHelperText-root\": {\r\n color: theme.palette.error.main\r\n }\r\n },\r\n button: {\r\n marginTop: theme.spacing(3),\r\n width: \"270px\"\r\n },\r\n text: {\r\n textAlign: \"left\"\r\n },\r\n textItem: {\r\n textAlign: \"left\"\r\n }\r\n}));\r\n\r\nexport default function CreateOnlineResourcePanel(props) {\r\n const classes = useStyles();\r\n const { isIos } = useDevice();\r\n const history = useHistory();\r\n const match = useRouteMatch();\r\n const location = useLocation();\r\n const { scopedHistory } = props;\r\n const [link, setLink] = useState(\"\");\r\n const [helper, setHelper] = useState(\"\");\r\n const nodeId = match.params.nodeId;\r\n const { createUrlResource, collection } = useResources(nodeId);\r\n\r\n const onSetLink = useCallback(ev => ((setHelper(\"\"), setLink(ev.target.value))), [setHelper, setLink]);\r\n\r\n useEffect(() => {\r\n if (location.pathname.includes(\"/inbox\")) {\r\n let parsedUrl = new URL(window.location);\r\n let parsedLink = parsedUrl.searchParams.get(\"url\") || parsedUrl.searchParams.get(\"text\");\r\n\r\n if (!!parsedLink) {\r\n setLink(parsedLink);\r\n const params = [...parsedUrl.searchParams.entries()].filter(t => t[0] !== \"url\" && t[0] !== \"text\").map(t => `${t[0]}=${t[1]}`).join(\"&\");\r\n window.history.replaceState(\r\n {}, document.title,\r\n window.location.pathname + (params ? `?${params}` : \"\")\r\n );\r\n\r\n if (!!scopedHistory) {\r\n scopedHistory.replaceWithoutParams();\r\n }\r\n }\r\n }\r\n }, [setLink, location, scopedHistory]);\r\n\r\n const addOnlineResource = useCallback(() => {\r\n if (validateUrl(link)) {\r\n setHelper(\"\");\r\n const resourceId = collection.createEntityId();\r\n createUrlResource(resourceId, link, true); // TODO flush!\r\n history.replace(`${getRootUrl(location.pathname)}/resource/${resourceId}`);\r\n } else {\r\n setHelper(\"Invalid Link\");\r\n }\r\n }, [link, createUrlResource, setHelper, history, collection, location]);\r\n\r\n const handleSubmit = useCallback(ev => {\r\n if (ev.key === \"Enter\") {\r\n const inputText = ev.target.value.trim();\r\n if (inputText.length !== 0) {\r\n addOnlineResource();\r\n }\r\n }\r\n }, [addOnlineResource]);\r\n\r\n const onlineEnabled = link.length !== 0;\r\n\r\n return (\r\n <Scrollbar>\r\n <Grid container className={classes.view} direction=\"column\" justifyContent=\"flex-start\" alignItems=\"center\">\r\n <Grid className={classes.textItem} item xs={12}>\r\n <Typography variant=\"h6\" className={classes.text}>Add Online Resource</Typography>\r\n <Typography variant=\"caption\" className={classes.text}>Paste the link to an online article, video, course, or whatever, and save it for later reference</Typography>\r\n </Grid>\r\n <Grid className={classes.viewItem} item xs={12}>\r\n <TextField\r\n className={classes.textField}\r\n id=\"link\"\r\n label=\"Link\"\r\n variant=\"outlined\"\r\n color=\"primary\"\r\n value={link}\r\n onChange={onSetLink}\r\n onKeyPress={handleSubmit}\r\n onSubmit={handleSubmit}\r\n autoComplete=\"off\"\r\n helperText={helper}\r\n fullWidth\r\n autoFocus={!isIos}\r\n />\r\n </Grid>\r\n <Grid className={classes.viewItem} item xs={12}>\r\n <Button\r\n className={classes.button}\r\n color=\"primary\"\r\n variant=\"contained\"\r\n onClick={addOnlineResource}\r\n disabled={!onlineEnabled}\r\n >\r\n Add Resource\r\n </Button>\r\n </Grid>\r\n </Grid>\r\n </Scrollbar>\r\n );\r\n}\r\n\r\nfunction validateUrl(link) {\r\n if (window.URL === undefined) return true;\r\n if (!link || typeof link !== \"string\" || link.length > 2048) return false;\r\n try {\r\n new URL(link);\r\n return true;\r\n } catch (err) {\r\n const regexp = /^(?:(?:https?|ftp):\\/\\/)?(?:(?!(?:10|127)(?:\\.\\d{1,3}){3})(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))(?::\\d{2,5})?(?:\\/\\S*)?$/;\r\n return regexp.test(link);\r\n }\r\n}\r\n","import { useState } from \"react\";\r\nimport { Grid, Typography, Tab, Tabs, Fade } from \"@mui/material\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport CardHeader from \"../../atoms/CardHeader\";\r\nimport CreateOfflineResourcePanel from \"../../molecules/CreateOfflineResourcePanel\";\r\nimport CreateOnlineResourcePanel from \"../../molecules/CreateOnlineResourcePanel\";\r\nimport { getRootUrl } from \"../../../hooks/useApp\";\r\nimport { useHistory, useLocation, useRouteMatch } from \"react-router\";\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 item: {\r\n paddingLeft: 0,\r\n paddingRight: 0,\r\n width: \"100%\"\r\n },\r\n tabs: {\r\n textAlign: \"center\",\r\n borderBottom: \"1px solid rgba(0,0,0,0.125)\"\r\n },\r\n contentItem: {\r\n position: \"absolute\",\r\n width: \"100%\",\r\n height: \"100%\"\r\n },\r\n contentContainer: {\r\n position: \"relative\"\r\n }\r\n}));\r\n\r\nconst fadeDuration = { enter: 200, exit: 200 };\r\n\r\nexport default function ResourceCreateView(props) { // TODO not set defaultcard?\r\n const classes = useStyles();\r\n const [tabIndex, setTabIndex] = useState(0);\r\n const history = useHistory();\r\n const match = useRouteMatch();\r\n const location = useLocation();\r\n const nodeId = match.params.nodeId;\r\n const onClose = () => history.replace(`${getRootUrl(location.pathname)}/node/${nodeId}`);\r\n const onSetTabIndex = (ev, val) => setTabIndex(val);\r\n\r\n return (\r\n <Grid className={classes.root} container direction=\"column\" justifyContent=\"flex-start\" alignItems=\"stretch\">\r\n <Grid item className={classes.item}>\r\n <CardHeader\r\n title=\"New Resource\"\r\n onBack={onClose}\r\n />\r\n </Grid>\r\n <Grid item xs container direction=\"column\" justifyContent=\"flex-start\" alignItems=\"stretch\">\r\n <Grid item>\r\n <Tabs\r\n className={classes.tabs}\r\n value={tabIndex}\r\n onChange={onSetTabIndex}\r\n centered\r\n variant=\"fullWidth\"\r\n indicatorColor=\"primary\"\r\n >\r\n <Tab label={<Typography variant=\"button\">Online</Typography>} />\r\n <Tab label={<Typography variant=\"button\">Offline</Typography>} />\r\n </Tabs>\r\n </Grid>\r\n <Grid item xs className={classes.contentContainer}>\r\n\r\n <Fade in={tabIndex === 0} timeout={fadeDuration}>\r\n <div className={classes.contentItem}>\r\n <CreateOnlineResourcePanel scopedHistory={props.scopedHistory} />\r\n </div>\r\n </Fade>\r\n\r\n <Fade in={tabIndex === 1} timeout={fadeDuration}>\r\n <div className={classes.contentItem}>\r\n <CreateOfflineResourcePanel />\r\n </div>\r\n </Fade>\r\n\r\n </Grid>\r\n </Grid>\r\n </Grid >\r\n );\r\n}","import { useEffect, useState, useCallback } from \"react\";\r\nimport { Grid, Button } from \"@mui/material\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport CardHeader from \"../../atoms/CardHeader\";\r\nimport Scrollbar from \"../../atoms/Scrollbar\";\r\nimport { getRootUrl } from \"../../../hooks/useApp\";\r\nimport FileUpload from \"../../atoms/inputs/FileUpload\";\r\nimport { useResource } from \"../../../hooks/useResources\";\r\nimport { SharedTextField } from \"@emberly/dataplane\";\r\nimport { useHistory, useRouteMatch, useLocation } from \"react-router\";\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 headerItem: {\r\n paddingLeft: 0,\r\n paddingRight: 0,\r\n width: \"100%\",\r\n marginBottom: theme.spacing(1)\r\n },\r\n textFieldItem: {\r\n paddingTop: theme.spacing(2),\r\n paddingBottom: theme.spacing(1),\r\n paddingLeft: theme.spacing(2),\r\n paddingRight: theme.spacing(2)\r\n },\r\n buttonItem: {\r\n paddingTop: theme.spacing(2),\r\n textAlign: \"center\"\r\n }\r\n}));\r\n\r\nexport default function ResourceEditView() {\r\n const classes = useStyles();\r\n const history = useHistory();\r\n const match = useRouteMatch();\r\n const location = useLocation();\r\n const { resourceId } = match.params;\r\n const { loading, resource, updateCount } = useResource(resourceId);\r\n const [name, setName] = useState(\"\");\r\n const [link, setLink] = useState(\"\");\r\n const [source, setSource] = useState(\"\");\r\n const [linkError, setLinkError] = useState(\"\");\r\n const [description, setDescription] = useState();\r\n const [file, setFile] = useState(null);\r\n\r\n useEffect(() => {\r\n if (!!resource) {\r\n setName(resource.name || \"\");\r\n setSource(resource.source || \"\");\r\n setDescription(resource.description || \"\");\r\n setLink(resource.url || \"\");\r\n }\r\n }, [resource, updateCount, setName, setSource, setDescription]);\r\n\r\n const handleLink = useCallback((ev) => {\r\n setLink(ev.target.value);\r\n }, [setLink]);\r\n\r\n const handleName = useCallback((ev) => {\r\n setName(ev.target.value);\r\n }, [setName]);\r\n\r\n const handleSource = useCallback((ev) => {\r\n setSource(ev.target.value)\r\n }, [setSource]);\r\n\r\n const handleDescription = useCallback((ev) => {\r\n setDescription(ev.target.value);\r\n }, [setDescription]);\r\n\r\n const onFileChange = useCallback((target) => {\r\n setFile(target);\r\n\r\n if (!name && !!target) {\r\n setName(target.name);\r\n }\r\n\r\n }, [setFile, setName, name]);\r\n\r\n const syncName = useCallback(() => {\r\n resource.setName(name || \"\");\r\n }, [name, resource]);\r\n\r\n const syncDescription = useCallback(() => {\r\n resource.setDescription(description || \"\");\r\n }, [description, resource]);\r\n\r\n const syncSource = useCallback(() => {\r\n resource.setSource(source || \"\");\r\n }, [source, resource]);\r\n\r\n const syncUrl = useCallback(() => {\r\n try {\r\n if (link !== resource.url) {\r\n if (link === \"\") {\r\n resource.setImageUrl(\"\", { sync: false });\r\n resource.setUrl(\"\");\r\n } else {\r\n resource.setImageUrl(\"\", { sync: false });\r\n resource.setUrl(link || \"\", { sync: false });\r\n resource.setIncomplete(true);\r\n }\r\n }\r\n setLinkError(\"\");\r\n } catch (err) {\r\n console.log(\"invalid url\");\r\n setLinkError(\"Invalid Url\");\r\n }\r\n }, [link, resource]);\r\n\r\n const onClose = useCallback(() => history.push(`${getRootUrl(location.pathname)}/resource/${resourceId}`), [history, resourceId, location]);\r\n\r\n const handleUpload = () => {\r\n resource.uploadFile(file);\r\n onClose();\r\n };\r\n\r\n if (resource === null || loading) {\r\n return null;\r\n }\r\n\r\n const isLink = !!resource && (resource.type === \"website\" || !!resource.url);\r\n\r\n return (\r\n <Grid className={classes.root} container direction=\"column\" justifyContent=\"flex-start\" alignItems=\"stretch\">\r\n\r\n <Grid item className={classes.headerItem}>\r\n <CardHeader\r\n title=\"Edit Resource\"\r\n onBack={onClose}\r\n border\r\n />\r\n </Grid>\r\n\r\n <Grid item container xs>\r\n <Scrollbar>\r\n {\r\n isLink ? (\r\n <Grid item className={classes.textFieldItem}>\r\n <SharedTextField\r\n inputId=\"link\"\r\n resourceId={resourceId}\r\n id=\"link\"\r\n label=\"Link\"\r\n variant=\"outlined\"\r\n color=\"primary\"\r\n value={link}\r\n onChange={handleLink}\r\n onBlur={syncUrl}\r\n onSubmit={syncUrl}\r\n fullWidth\r\n autoFocus\r\n error={!!linkError}\r\n helperText={linkError}\r\n />\r\n </Grid>\r\n ) : null\r\n }\r\n <Grid item className={classes.textFieldItem}>\r\n <SharedTextField\r\n inputId=\"name\"\r\n resourceId={resourceId}\r\n id=\"name\"\r\n label=\"Resource Name\"\r\n variant=\"outlined\"\r\n color=\"primary\"\r\n onChange={handleName}\r\n onBlur={syncName}\r\n onSubmit={syncName}\r\n value={name}\r\n fullWidth\r\n />\r\n </Grid>\r\n <Grid item className={classes.textFieldItem}>\r\n <SharedTextField\r\n inputId=\"source\"\r\n resourceId={resourceId}\r\n id=\"source\"\r\n label=\"Source\"\r\n variant=\"outlined\"\r\n color=\"primary\"\r\n onChange={handleSource}\r\n onBlur={syncSource}\r\n onSubmit={syncSource}\r\n value={source}\r\n fullWidth\r\n />\r\n </Grid>\r\n <Grid item className={classes.textFieldItem}>\r\n <SharedTextField\r\n inputId=\"description\"\r\n resourceId={resourceId}\r\n id=\"description\"\r\n label=\"Description\"\r\n variant=\"outlined\"\r\n color=\"primary\"\r\n multiline\r\n maxRows=\"10\"\r\n onChange={handleDescription}\r\n onBlur={syncDescription}\r\n onSubmit={syncDescription}\r\n value={description}\r\n fullWidth\r\n />\r\n </Grid>\r\n {\r\n !isLink ? (\r\n <Grid item className={classes.textFieldItem}>\r\n <FileUpload\r\n onChange={onFileChange}\r\n existingFileSize={resource.fileSize}\r\n />\r\n </Grid>\r\n ) : null\r\n }\r\n {\r\n !!file ? (\r\n <Grid item className={classes.buttonItem}>\r\n <Button variant=\"contained\" color=\"primary\" onClick={handleUpload}>UPLOAD</Button>\r\n </Grid>\r\n ) : null\r\n }\r\n </Scrollbar>\r\n </Grid>\r\n </Grid>\r\n );\r\n}\r\n\r\n","import { useCallback, useMemo, useState, useRef } from \"react\";\r\nimport { Grid, Typography, Chip } from \"@mui/material\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport CardHeader from \"../../atoms/CardHeader\";\r\nimport Scrollbar from \"../../atoms/Scrollbar\";\r\nimport TagSelector from \"../../atoms/inputs/TagSelector\";\r\nimport { getRootUrl } from \"../../../hooks/useApp\";\r\nimport { useTags } from \"@emberly/dataplane\";\r\nimport useResources from \"../../../hooks/useResources\";\r\nimport fuzzysort from \"fuzzysort\";\r\nimport FuzzyText from \"../../atoms/FuzzyText\";\r\nimport { useDevice } from \"../../../providers/DeviceContext\";\r\nimport { useHistory, useLocation, useRouteMatch } from \"react-router\";\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 item: {\r\n paddingLeft: 0,\r\n paddingRight: 0,\r\n width: \"100%\"\r\n },\r\n textItem: {\r\n padding: theme.spacing(2),\r\n paddingBottom: theme.spacing(1)\r\n },\r\n chipItem: {\r\n padding: theme.spacing(2),\r\n paddingTop: theme.spacing(1),\r\n paddingBottom: 0\r\n },\r\n chip: {\r\n lineHeight: \"58px\"\r\n },\r\n}));\r\n\r\nexport default function ResourceMultiTagsView() {\r\n const classes = useStyles();\r\n const history = useHistory();\r\n const match = useRouteMatch();\r\n const location = useLocation();\r\n const nodeId = match.params.nodeId;\r\n const { resources, loading, updateCount } = useResources(nodeId);\r\n const { tags } = useTags();\r\n const [query, setQuery] = useState(\"\");\r\n const inputRef = useRef(null);\r\n const { isMobile } = useDevice();\r\n\r\n const selectedResources = useMemo(() => {\r\n const query = new URLSearchParams(location.search);\r\n const idSet = new Set(query.getAll(\"r\"));\r\n return resources.filter(r => idSet.has(r.id));\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [location, resources, updateCount]);\r\n\r\n const addTag = useCallback((tag, tagList) => {\r\n if (!!tag && tag.length !== 0 && tagList.indexOf(tag) === -1) {\r\n selectedResources\r\n .filter(r => !(r.tags || []).includes(tag))\r\n .forEach(r => r.setTags((r.tags || []).concat([tag])));\r\n \r\n setQuery(\"\");\r\n\r\n if (!!inputRef.current && !isMobile) {\r\n inputRef.current.focus();\r\n }\r\n }\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [selectedResources, setQuery, inputRef, isMobile, updateCount]);\r\n\r\n const removeTag = useCallback((tag) => {\r\n selectedResources\r\n .filter(r => (r.tags || []).includes(tag))\r\n .forEach(r => r.setTags((r.tags || []).filter(t => t !== tag)));\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [selectedResources, updateCount]);\r\n\r\n const activeTags = useMemo(\r\n () => {\r\n if (loading) {\r\n return [];\r\n }\r\n \r\n let tagCounts = new Map();\r\n \r\n for (let i = 0; i < selectedResources.length; i++) {\r\n let tags = selectedResources[i].tags || [];\r\n\r\n tags.forEach(t => {\r\n if (tagCounts.has(t)) {\r\n tagCounts.set(t, tagCounts.get(t) + 1);\r\n } else {\r\n tagCounts.set(t, 1);\r\n }\r\n });\r\n }\r\n\r\n let result = [];\r\n tagCounts.forEach((count, tag) => {\r\n if (count === selectedResources.length) {\r\n result.push(tag);\r\n }\r\n });\r\n\r\n return result;\r\n }, \r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n [selectedResources, loading, updateCount]\r\n );\r\n\r\n const renderCommonTags = useMemo(\r\n () =>\r\n query.length === 0 ? (\r\n tags\r\n .filter((tag, i) => activeTags.indexOf(tag) === -1 && i < 50)\r\n .map(tag => <Grid item key={tag}><Chip className={classes.chip} label={tag} onClick={() => addTag(tag, activeTags)} /></Grid>)\r\n ) : (\r\n fuzzysort\r\n .go(query, tags.filter(tag => activeTags.indexOf(tag) === -1), {})\r\n .map(\r\n obj =>\r\n <Grid item key={obj.target}>\r\n <Chip className={classes.chip} label={(<FuzzyText text={obj.target} query={query} />)} onClick={() => addTag(obj.target, activeTags)} />\r\n </Grid>\r\n )\r\n ),\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n [tags, activeTags, addTag, query, classes, updateCount]\r\n );\r\n\r\n const onClose = useCallback(() => history.push(`${getRootUrl(location.pathname)}/node/${nodeId}`),[history, nodeId, location]);\r\n\r\n const onChange = useCallback((val) => {\r\n setQuery(val);\r\n }, [setQuery]);\r\n\r\n return !loading ? (\r\n <Grid className={classes.root} container direction=\"column\" justifyContent=\"flex-start\" alignItems=\"stretch\">\r\n <Grid item className={classes.item}>\r\n <CardHeader\r\n title={`Tag ${selectedResources.length} resource${selectedResources.length !== 1 ? \"s\" : \"\"}`}\r\n onBack={onClose}\r\n border\r\n />\r\n </Grid>\r\n <Grid item xs>\r\n <Scrollbar>\r\n <Grid item className={classes.textItem}>\r\n <Typography variant=\"subtitle2\">Your tags</Typography>\r\n </Grid>\r\n\r\n <Grid item className={classes.chipItem}>\r\n <TagSelector\r\n resourceId={nodeId}\r\n inputId=\"multitags\"\r\n tags={activeTags}\r\n onAddTag={addTag}\r\n onRemoveTag={removeTag}\r\n onChange={onChange}\r\n value={query}\r\n inputRef={inputRef}\r\n autoFocus={!isMobile}\r\n />\r\n </Grid>\r\n <Grid item className={classes.textItem}>\r\n <Typography variant=\"subtitle2\">Commonly used tags</Typography>\r\n <Typography variant=\"caption\" color=\"textSecondary\">Tap tag to add</Typography>\r\n </Grid>\r\n <Grid\r\n item\r\n className={classes.chipItem}\r\n container\r\n alignItems=\"center\"\r\n justifyContent=\"flex-start\"\r\n spacing={1}\r\n >\r\n {renderCommonTags}\r\n </Grid>\r\n </Scrollbar>\r\n </Grid>\r\n </Grid >\r\n ) : null;\r\n}\r\n","import { useCallback, useMemo, useState, useRef } from \"react\";\r\nimport { Grid, Typography, Chip } from \"@mui/material\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport CardHeader from \"../../atoms/CardHeader\";\r\nimport Scrollbar from \"../../atoms/Scrollbar\";\r\nimport TagSelector from \"../../atoms/inputs/TagSelector\";\r\nimport { getRootUrl } from \"../../../hooks/useApp\";\r\nimport { useTags } from \"@emberly/dataplane\";\r\nimport { useResource } from \"../../../hooks/useResources\";\r\nimport fuzzysort from \"fuzzysort\";\r\nimport FuzzyText from \"../../atoms/FuzzyText\";\r\nimport { useDevice } from \"../../../providers/DeviceContext\";\r\nimport { useHistory, useLocation, useRouteMatch } from \"react-router\";\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 item: {\r\n paddingLeft: 0,\r\n paddingRight: 0,\r\n width: \"100%\"\r\n },\r\n textItem: {\r\n padding: theme.spacing(2),\r\n paddingBottom: 0\r\n },\r\n chipItem: {\r\n padding: theme.spacing(2),\r\n paddingTop: theme.spacing(1),\r\n paddingBottom: 0\r\n },\r\n chip: {\r\n lineHeight: \"58px\"\r\n }\r\n}));\r\n\r\nexport default function ResourceTagsView() {\r\n const classes = useStyles();\r\n const history = useHistory();\r\n const match = useRouteMatch();\r\n const location = useLocation();\r\n const { resourceId } = match.params;\r\n const { loading, resource, updateCount } = useResource(resourceId);\r\n const [query, setQuery] = useState(\"\");\r\n const inputRef = useRef(null);\r\n const { tags } = useTags();\r\n const { isMobile } = useDevice();\r\n\r\n const addTag = useCallback((tag, tagList) => {\r\n if (!!tag && tag.length !== 0 && tagList.indexOf(tag) === -1) {\r\n resource.setTags(tagList.concat(tag));\r\n setQuery(\"\");\r\n if (!!inputRef.current && !isMobile) {\r\n inputRef.current.focus();\r\n }\r\n }\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [resource, setQuery, isMobile, inputRef, updateCount]);\r\n\r\n const removeTag = useCallback((tag, tagList) => {\r\n resource.setTags(tagList.filter(t => t !== tag));\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [resource, updateCount]);\r\n\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n const activeTags = useMemo(() => !loading ? (resource.tags || []) : [], [loading, resource, updateCount]);\r\n\r\n const renderCommonTags = useMemo(\r\n () =>\r\n query.length === 0 ? (\r\n tags\r\n .filter((tag, i) => activeTags.indexOf(tag) === -1 && i < 50)\r\n .map(tag => <Grid item key={tag}><Chip className={classes.chip} label={tag} onClick={() => addTag(tag, activeTags)} /></Grid>)\r\n ) : (\r\n fuzzysort\r\n .go(query, tags.filter(tag => activeTags.indexOf(tag) === -1), {})\r\n .map(\r\n obj =>\r\n <Grid item key={obj.target}>\r\n <Chip className={classes.chip} label={(<FuzzyText text={obj.target} query={query} />)} onClick={() => addTag(obj.target, activeTags)} />\r\n </Grid>\r\n )\r\n ),\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n [classes, tags, activeTags, addTag, query, updateCount]\r\n );\r\n\r\n const onClose = useCallback(() => history.push(`${getRootUrl(location.pathname)}/resource/${resourceId}`), [history, resourceId, location]);\r\n\r\n const onChange = useCallback((val) => {\r\n setQuery(val);\r\n }, [setQuery]);\r\n\r\n return resource !== null && !loading ? (\r\n <Grid className={classes.root} container direction=\"column\" justifyContent=\"flex-start\" alignItems=\"stretch\">\r\n <Grid item className={classes.item}>\r\n <CardHeader\r\n title={\"Tags\"}\r\n onBack={onClose}\r\n border\r\n />\r\n </Grid>\r\n <Grid item xs>\r\n <Scrollbar>\r\n <Grid item className={classes.textItem}>\r\n <Typography variant=\"subtitle2\">Your tags</Typography>\r\n </Grid>\r\n\r\n <Grid item className={classes.chipItem}>\r\n <TagSelector\r\n inputId=\"tags\"\r\n resourceId={resourceId}\r\n tags={activeTags}\r\n onAddTag={addTag}\r\n onRemoveTag={removeTag}\r\n onChange={onChange}\r\n value={query}\r\n inputRef={inputRef}\r\n autoFocus={!isMobile}\r\n />\r\n </Grid>\r\n <Grid item className={classes.textItem}>\r\n <Typography variant=\"subtitle2\">Commonly used tags</Typography>\r\n <Typography variant=\"caption\" color=\"textSecondary\">Tap tag to add</Typography>\r\n </Grid>\r\n <Grid\r\n item\r\n className={classes.chipItem}\r\n container\r\n alignItems=\"center\"\r\n justifyContent=\"flex-start\"\r\n spacing={1}\r\n >\r\n {renderCommonTags}\r\n </Grid>\r\n </Scrollbar>\r\n </Grid>\r\n </Grid >\r\n ) : null;\r\n}\r\n","import { useCallback, useEffect, useMemo } from \"react\";\r\nimport { useSelector, useDispatch } from \"react-redux\";\r\nimport { useContextId } from \"@emberly/dataplane\";\r\nimport { SetNodeViewTabIndex, SetNotesFullscreen } from \"../../../actions/app\";\r\nimport { useDevice } from \"../../../providers/DeviceContext\";\r\nimport { SetInboundLinksPanel } from \"../../../actions/search\";\r\nimport { CompactNotesEditor } from \"@emberly/editor\";\r\nimport Reference from \"../../../renderers/editortools/reference/Reference\";\r\nimport { useHistory, useLocation } from \"react-router\";\r\n\r\n\r\nconst templates = [\"empty\", \"informationsorting\", \"summarizeshort\", \"summarizelong\", \"classnotes\"];\r\n\r\n\r\nexport default function ResourceNotesPanel(props) {\r\n const { resourceId, title, onFocused, active, fullscreenEnabled, backlinks, history: pHistory } = props;\r\n const contextId = useContextId();\r\n const notesFullscreen = useSelector(state => state.app.notesFullscreen);\r\n const { isMobilePortrait, isEmbed, isIos, isMobile } = useDevice();\r\n\r\n const mHistory = useHistory();\r\n const location = useLocation();\r\n const dispatch = useDispatch();\r\n const history = pHistory || mHistory;\r\n\r\n useEffect(() => { // TODO\r\n if (fullscreenEnabled) {\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 }\r\n }, [location.search, notesFullscreen, dispatch, isEmbed, fullscreenEnabled]);\r\n\r\n const plugins = useMemo(() => backlinks ? ({\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, backlinks]);\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]);\r\n\r\n const patchedHistory = useMemo(() => {\r\n return {\r\n push: ({ pathname, search }) => {\r\n if (pathname?.indexOf(\"/node/\") !== -1) {\r\n dispatch(SetNodeViewTabIndex(1));\r\n }\r\n history.push({ pathname, search });\r\n }\r\n }\r\n }, [history, dispatch]);\r\n\r\n return (\r\n <CompactNotesEditor\r\n placeholder=\"Tap to comment...\"\r\n contextId={contextId}\r\n noteId={`resource-${resourceId}`}\r\n active={active}\r\n onFocused={onFocused}\r\n title={title}\r\n scrollAreaDisabled\r\n templates={templates}\r\n readonly={isEmbed}\r\n fullscreen={isEmbed || !fullscreenEnabled ? undefined : notesFullscreen}\r\n onFullscreen={onFullscreen}\r\n history={patchedHistory}\r\n isMobilePortraitView={isMobilePortrait}\r\n isMobile={isMobile}\r\n isIos={isIos}\r\n backlinks={backlinks}\r\n onViewBacklinks={onViewBacklinks}\r\n plugins={plugins}\r\n />\r\n );\r\n}\r\n","import { useEffect, useState, useCallback, useMemo } from \"react\";\r\nimport { Grid, Typography, ButtonBase, Chip, Collapse, Fab, LinearProgress, CircularProgress } from \"@mui/material\";\r\nimport { OpenInNew as OpenInNewIcon } from \"@mui/icons-material\";\r\nimport { Skeleton, Rating } from '@mui/material';\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport { useDispatch, useSelector } from \"react-redux\";\r\nimport { Link, useHistory, useLocation, useRouteMatch } from \"react-router-dom\";\r\nimport CardHeader from \"../../atoms/CardHeader\";\r\nimport Scrollbar from \"../../atoms/Scrollbar\";\r\nimport { getRootUrl, useRootUrl } from \"../../../hooks/useApp\";\r\nimport { useCanEdit } from \"@emberly/dataplane\";\r\nimport ResourceNotesPanel from \"../../molecules/editors/ResourceNotesPanel\";\r\nimport InboundLinksDialog from \"../dialogs/InboundLinksDialog\";\r\nimport { useResource } from \"../../../hooks/useResources\";\r\nimport { SetNodeViewTabIndex } from \"../../../actions/app\";\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: \"absolute\",\r\n width: \"100%\",\r\n height: \"100%\",\r\n },\r\n background: {\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 headerItem: {\r\n paddingLeft: 0,\r\n paddingRight: 0,\r\n width: \"100%\",\r\n zIndex: 2\r\n },\r\n linkFab: {\r\n color: \"\",\r\n position: \"absolute\",\r\n bottom: \"-28px\",\r\n right: \"16px\",\r\n width: \"56px\",\r\n height: \"56px\"\r\n },\r\n textContent: {\r\n padding: theme.spacing(2),\r\n marginTop: theme.spacing(1)\r\n },\r\n textContentBody: {\r\n marginTop: theme.spacing(1)\r\n },\r\n imageItem: {\r\n position: \"relative\",\r\n height: \"264px\",\r\n maxHeight: \"40vh\"\r\n },\r\n image: {\r\n position: \"relative\",\r\n width: 0,\r\n height: 0,\r\n objectFit: \"cover\",\r\n float: \"right\"\r\n },\r\n imageLoaded: {\r\n width: \"100%\",\r\n height: \"264px\",\r\n maxHeight: \"40vh\"\r\n },\r\n resourceName: {\r\n wordWrap: \"break-word\"\r\n },\r\n buttonContainer: {\r\n padding: theme.spacing(2),\r\n paddingLeft: theme.spacing(3)\r\n },\r\n ratingContainer: {\r\n padding: theme.spacing(2)\r\n },\r\n link: {\r\n textDecoration: \"none\"\r\n },\r\n waybackLink: {\r\n textDecoration: \"none\",\r\n color: theme.palette.text.primary\r\n },\r\n waybackLinkIcon: {\r\n marginBottom: \"-2px\",\r\n marginLeft: \"2px\",\r\n fontSize: \"16px\"\r\n },\r\n linkIcon: {\r\n marginBottom: \"-2px\",\r\n marginLeft: \"2px\"\r\n },\r\n externalLink: {\r\n cursor: \"pointer\",\r\n \"&:hover\": {\r\n color: theme.palette.primary.main\r\n }\r\n },\r\n chip: {\r\n borderRadius: \"4px\",\r\n height: \"24px\",\r\n paddingLeft: theme.spacing(1),\r\n paddingRight: theme.spacing(1),\r\n \"& span\": {\r\n padding: 0\r\n },\r\n marginLeft: theme.spacing(1),\r\n marginBottom: theme.spacing(1),\r\n background: theme.palette.common.chip,\r\n lineHeight: \"24px\"\r\n },\r\n tagButton: {\r\n marginLeft: theme.spacing(1),\r\n marginBottom: theme.spacing(1),\r\n textAlign: \"center\"\r\n },\r\n commentContainer: {\r\n position: \"relative\",\r\n minHeight: \"100%\",\r\n height: \"auto\",\r\n maxWidth: \"100%\",\r\n overflowX: \"visible\",\r\n overflowY: \"visible\",\r\n borderTop: `1px solid ${theme.palette.divider}`\r\n },\r\n notFoundHeader: {\r\n padding: theme.spacing(2)\r\n }\r\n}));\r\n\r\nexport default function ResourceView(props) {\r\n const classes = useStyles();\r\n const dispatch = useDispatch();\r\n const history = useHistory();\r\n const match = useRouteMatch();\r\n const location = useLocation();\r\n const { resourceId } = match.params;\r\n const { loading, resource, beginMoveResources, beginDeleteResources, fileUrl, loadFileUrl, updateCount, isLink, isFile, nodeId } = useResource(resourceId);\r\n const [imgLoaded, setImgLoaded] = useState(false);\r\n const [imgError, setImgError] = useState(false);\r\n const [notesActive, setNotesActive] = useState(false);\r\n const { isEmbed, isEmbedView } = useDevice();\r\n const notesFullscreen = useSelector(state => state.app.notesFullscreen);\r\n const { inboundLinksPanelOpen } = useSelector(state => state.search);\r\n\r\n const [quizOpen, setQuizOpen] = useState(false);\r\n const handleQuizClose = useCallback(() => setQuizOpen(false), []);\r\n\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n const tags = useMemo(() => !loading && !!resource ? resource.tags : [], [resource, loading, updateCount]);\r\n const canEdit = useCanEdit() && !isEmbed;\r\n const rootUrl = useRootUrl();\r\n\r\n const setRating = useCallback((ev, val) => resource.setRating(val === null ? 0 : val), [resource]);\r\n const clearRating = useCallback(() => resource.setRating(0), [resource]);\r\n\r\n const handleMenu = useCallback((menuItem) => {\r\n switch (menuItem) {\r\n case \"Delete\":\r\n beginDeleteResources([resource], () => history.push(`${getRootUrl(location.pathname)}/node/${nodeId}`));\r\n break;\r\n case \"Move\":\r\n beginMoveResources([resource], () => history.push(`${getRootUrl(location.pathname)}/node/${nodeId}`), resource.isInInbox() ? \"inbox-portal\" : null);\r\n break;\r\n case \"Edit\":\r\n history.push(`${getRootUrl(location.pathname)}/resource/${resourceId}/edit`);\r\n break;\r\n case \"Archive\":\r\n resource.setArchived(true);\r\n break;\r\n case \"Unarchive\":\r\n resource.setArchived(false);\r\n break;\r\n case \"AI Quiz\":\r\n setQuizOpen(true);\r\n break;\r\n default:\r\n break;\r\n }\r\n }, [nodeId, resourceId, resource, history, beginMoveResources, beginDeleteResources, location]);\r\n\r\n const renderTags = useMemo(\r\n () => tags.map(tag => <Chip className={classes.chip} key={tag} label={tag} />),\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n [tags, classes.chip, updateCount]\r\n );\r\n\r\n\r\n const onImageLoad = useCallback(() => setImgLoaded(true), [setImgLoaded]);\r\n const onImageError = useCallback(() => setImgError(true), [setImgError]);\r\n\r\n const onExternalLink = useCallback((ev) => {\r\n ev.preventDefault();\r\n resource.openUrl();\r\n }, [resource]);\r\n\r\n\r\n const isWorking = !!resource && resource.isWorking()\r\n const isInInbox = resource?.isInInbox() || false;\r\n\r\n const menuItems = useMemo(() => {\r\n if (!resource) return [];\r\n\r\n if (!canEdit) {\r\n const waybackUrl = `https://web.archive.org/web/${(resource.url.startsWith(\"http://\") || resource.url.startsWith(\"https://\") ? resource.url : `https://${resource.url}`)}`;\r\n return [{ value: \"wayback\", text: <a href={waybackUrl} target=\"_blank\" rel=\"noreferrer\" className={classes.waybackLink}>Wayback Machine<OpenInNewIcon fontSize=\"inherit\" className={classes.waybackLinkIcon} /></a> }, { value: \"AI Quiz\" }];\r\n }\r\n\r\n if (isWorking) {\r\n return [{ value: \"Edit\" }, { value: \"Delete\" }];\r\n }\r\n\r\n if (isLink) {\r\n const waybackUrl = `https://web.archive.org/web/${(resource.url.startsWith(\"http://\") || resource.url.startsWith(\"https://\") ? resource.url : `https://${resource.url}`)}`;\r\n return [{ value: \"Edit\" }, { value: \"Move\" }, { value: \"Delete\" }, { value: resource.archived ? \"Unarchive\" : \"Archive\" }, \"---\", { value: \"wayback\", text: <a href={waybackUrl} target=\"_blank\" rel=\"noreferrer\" className={classes.waybackLink}>Wayback Machine<OpenInNewIcon fontSize=\"inherit\" className={classes.waybackLinkIcon} /></a> }, { value: \"AI Quiz\" }];\r\n }\r\n\r\n return [{ value: \"Edit\" }, { value: \"Move\" }, { value: \"Delete\" }, { value: resource.archived ? \"Unarchive\" : \"Archive\" }, { value: \"AI Quiz\" }];\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [classes, isLink, resource, updateCount, isWorking, canEdit]);\r\n\r\n const onClose = useCallback(() => {\r\n if (!isInInbox) {\r\n dispatch(SetNodeViewTabIndex(0));\r\n }\r\n history.push(`${getRootUrl(location.pathname)}/node/${nodeId}`);\r\n }, [history, nodeId, location, dispatch, isInInbox]);\r\n\r\n useEffect(() => {\r\n if (isFile && !isWorking) {\r\n loadFileUrl();\r\n }\r\n }, [isFile, loadFileUrl, isWorking]);\r\n\r\n return !resource ? (\r\n <ResourceSkeleton />\r\n ) : (\r\n <Grid className={classes.root} container direction=\"column\" justifyContent=\"flex-start\" alignItems=\"stretch\">\r\n {\r\n !notesFullscreen ? (\r\n <Grid item className={classes.headerItem}>\r\n <CardHeader\r\n title={resource.archived ? \"Archived\" : \"Resource\"}\r\n onBack={onClose}\r\n menuItems={menuItems}\r\n onMenu={isEmbedView ? undefined : handleMenu}\r\n border\r\n />\r\n </Grid>\r\n ) : null\r\n }\r\n\r\n <Grid item xs container>\r\n <Scrollbar scrollAreaDisabled={notesFullscreen} scrollStateId={`${resourceId}`}>\r\n <Collapse in={!notesFullscreen} className={classes.background}>\r\n {\r\n (isLink || isFile) && !isWorking ? (\r\n <Grid item className={classes.imageItem}>\r\n\r\n <img\r\n className={`${classes.image} ${imgLoaded ? classes.imageLoaded : \"\"}`}\r\n src={resource.getImageUrl(imgError)}\r\n onLoad={onImageLoad}\r\n onError={onImageError}\r\n alt=\"\"\r\n />\r\n\r\n {imgLoaded ? null : <Skeleton variant=\"rectangular\" className={`${classes.image} ${classes.imageLoaded}`} />}\r\n\r\n {\r\n isLink ? (\r\n <a className={classes.link} href={(resource.url.startsWith(\"http://\") || resource.url.startsWith(\"https://\") ? resource.url : `https://${resource.url}`)} target=\"_blank\" rel=\"noreferrer\">\r\n <Fab className={classes.linkFab} color=\"secondary\">\r\n <OpenInNewIcon />\r\n </Fab>\r\n </a>\r\n ) : null\r\n }\r\n {\r\n isFile && !resource.incomplete ? (\r\n !!fileUrl ? (\r\n <a className={classes.link} href={fileUrl} target=\"_blank\" rel=\"noreferrer\">\r\n <Fab className={classes.linkFab} color=\"secondary\">\r\n <OpenInNewIcon />\r\n </Fab>\r\n </a>\r\n ) : (\r\n <Fab className={classes.linkFab} color=\"secondary\" disabled>\r\n <CircularProgress variant=\"indeterminate\" />\r\n </Fab>\r\n )\r\n ) : null\r\n }\r\n </Grid>\r\n ) : (\r\n isWorking ? (\r\n <Grid item className={classes.imageItem}>\r\n <LinearProgress\r\n variant={resource.hasProgress() ? \"determinate\" : \"indeterminate\"}\r\n value={resource.hasProgress() ? resource.getProgress() : undefined}\r\n color=\"primary\"\r\n />\r\n <Skeleton variant=\"rectangular\" className={`${classes.image} ${classes.imageLoaded}`} />\r\n </Grid>\r\n ) : null\r\n )\r\n }\r\n <Grid item className={classes.textContent}>\r\n <Typography variant=\"h6\" color=\"textPrimary\" className={classes.resourceName}>{resource.incomplete && !isWorking ? \"[Incomplete] \" : \"\"}{resource.name || resource.url || resource.source}</Typography>\r\n\r\n {!!resource.url ? (\r\n <Typography variant=\"caption\" color=\"textSecondary\" className={classes.externalLink} onClick={onExternalLink}>{resource.cleanSource}<OpenInNewIcon fontSize=\"inherit\" className={classes.linkIcon} /></Typography>\r\n ) : (\r\n <Typography variant=\"caption\" color=\"textSecondary\">{resource.cleanSource}</Typography>\r\n )}\r\n\r\n <Typography variant=\"body2\" className={classes.textContentBody}>{resource.description}</Typography>\r\n </Grid>\r\n\r\n <Grid item container className={classes.ratingContainer} alignItems=\"center\">\r\n <Grid item>\r\n <Rating\r\n name=\"resource rating\"\r\n value={resource.rating}\r\n onChange={setRating}\r\n disabled={!canEdit || isWorking}\r\n />\r\n </Grid>\r\n {\r\n canEdit && !resource.isWorking() ? (\r\n <Grid item>\r\n <ButtonBase className={classes.tagButton} onClick={clearRating}>\r\n <Typography variant=\"caption\" color=\"textSecondary\">\r\n clear rating\r\n </Typography>\r\n </ButtonBase>\r\n </Grid>\r\n ) : null\r\n }\r\n </Grid>\r\n\r\n <Grid\r\n item\r\n className={classes.buttonContainer}\r\n container\r\n alignItems=\"center\"\r\n justifyContent=\"flex-start\"\r\n spacing={2}\r\n >\r\n {renderTags}\r\n {\r\n canEdit && !isWorking ? (\r\n <Link className={classes.link} to={`${rootUrl}/resource/${resourceId}/tags`}>\r\n <ButtonBase className={classes.tagButton}>\r\n <Typography variant=\"caption\" color=\"textSecondary\">\r\n add/remove tag\r\n </Typography>\r\n </ButtonBase>\r\n </Link>\r\n ) : null\r\n }\r\n </Grid>\r\n\r\n </Collapse>\r\n\r\n <Grid item className={classes.commentContainer}>\r\n <ResourceNotesPanel\r\n nodeId={nodeId}\r\n resourceId={resource.id}\r\n title={resource.name}\r\n onFocused={setNotesActive}\r\n active={notesActive}\r\n fullscreenEnabled={!isInInbox}\r\n backlinks={!isInInbox}\r\n history={props.history}\r\n />\r\n </Grid>\r\n </Scrollbar>\r\n </Grid>\r\n\r\n {\r\n inboundLinksPanelOpen && !isInInbox ? <InboundLinksDialog noteId={`resource-${resource.id}`} /> : null\r\n }\r\n {\r\n quizOpen && !!resource ? <QuizPanel parentId={`resource-${resource.id}`} onClose={handleQuizClose} title={resource?.name} /> : null\r\n }\r\n </Grid>\r\n );\r\n}\r\n\r\n\r\nfunction ResourceSkeleton() {\r\n const classes = useStyles();\r\n const history = useHistory();\r\n const onClose = () => history.goBack();\r\n\r\n return (\r\n <Grid className={classes.root} container direction=\"column\" justifyContent=\"flex-start\" alignItems=\"stretch\">\r\n\r\n <Grid item className={classes.item}>\r\n <CardHeader\r\n title=\"Resource\"\r\n onClose={onClose}\r\n />\r\n </Grid>\r\n\r\n <Grid item>\r\n <Skeleton variant=\"rectangular\" className={`${classes.image} ${classes.imageLoaded}`} />\r\n </Grid>\r\n\r\n <Grid item className={classes.textContent}>\r\n <Skeleton variant=\"text\" height=\"32px\" />\r\n <Skeleton variant=\"text\" height=\"16px\" />\r\n <Skeleton variant=\"text\" height=\"24px\" />\r\n <Skeleton variant=\"text\" height=\"24px\" />\r\n </Grid>\r\n </Grid >\r\n );\r\n}","import React from \"react\";\r\nimport { makeStyles } from \"@mui/styles\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n root: {\r\n position: \"relative\",\r\n height: \"20px\",\r\n lineHeight: \"16px\",\r\n \"& span\": {\r\n display: \"inline-block\",\r\n position: \"relative\",\r\n borderRadius: \"50%\",\r\n background: theme.palette.primary.main,\r\n width: \"8px\",\r\n height: \"8px\",\r\n animation: \"writing-animation 1.25s linear infinite\",\r\n },\r\n \"& span:nth-of-type(2)\": {\r\n animationDelay: \"0.15s\",\r\n marginRight: \"2px\",\r\n marginLeft: \"4px\"\r\n },\r\n \"& span:nth-of-type(3)\": {\r\n animationDelay: \"0.3s\",\r\n marginRight: \"4px\",\r\n marginLeft: \"2px\"\r\n },\r\n \"& span:nth-of-type(4)\": {\r\n animationDelay: \"0.45s\"\r\n }\r\n }\r\n}));\r\n\r\n\r\nexport default function WritingAnimation() {\r\n const classes = useStyles();\r\n\r\n return (\r\n <div\r\n className={classes.root}\r\n >\r\n <span></span>\r\n <span></span>\r\n <span></span>\r\n <span></span>\r\n </div>\r\n );\r\n}","import { Grid, Typography } from \"@mui/material\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport WritingAnimation from \"./WritingAnimation\";\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 npcBubble: {\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% - 150px)\",\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 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 avatar: {\r\n width: \"64px\",\r\n height: \"64px\",\r\n borderRadius: \"16px\",\r\n marginRight: theme.spacing(2)\r\n }\r\n}));\r\n\r\nexport default function ChatBubble(props) {\r\n const { text, avatar, isNpc, writing, className } = props;\r\n const classes = useStyles();\r\n\r\n return (\r\n <Grid item container xs={12} direction=\"row\" alignItems=\"flex-end\" justifyContent={isNpc ? \"flex-start\" : \"flex-end\"} className={`${classes.root} ${className || \"\"}`} spacing={0}>\r\n {!!avatar ? (\r\n <img src={avatar} className={classes.avatar} alt=\"Contender avatar\" />\r\n ) : null}\r\n <Typography variant=\"body1\" className={isNpc ? classes.npcBubble : classes.playerBubble} component=\"div\">\r\n {writing ? <WritingAnimation/> : text}\r\n </Typography>\r\n </Grid>\r\n )\r\n}","import { useEffect, useState, useRef } from \"react\";\r\nimport { FilledInput, Grid, IconButton, Typography, Fade } from \"@mui/material\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport { Send as SendIcon, Close as CloseIcon } from \"@mui/icons-material\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n root: {\r\n position: \"relative\",\r\n width: \"100%\",\r\n borderTop: `1px solid ${theme.palette.divider}`,\r\n paddingLeft: theme.spacing(6),\r\n paddingRight: theme.spacing(6),\r\n paddingTop: theme.spacing(2),\r\n paddingBottom: theme.spacing(2),\r\n \"& div\": {\r\n position: \"relative\"\r\n }\r\n },\r\n rootMobile: {\r\n paddingLeft: theme.spacing(2),\r\n paddingRight: theme.spacing(2),\r\n paddingTop: theme.spacing(1),\r\n paddingBottom: theme.spacing(1)\r\n },\r\n input: {\r\n borderRadius: \"16px\",\r\n minHeight: \"56px\",\r\n height: \"auto\",\r\n paddingTop: theme.spacing(1),\r\n paddingBottom: theme.spacing(1),\r\n \"& input\": {\r\n \"&::placeholder\": {\r\n ...theme.typography.body1\r\n }\r\n }\r\n },\r\n charCounter: {\r\n position: \"absolute\",\r\n bottom: theme.spacing(0.5),\r\n right: theme.spacing(2)\r\n },\r\n button: {\r\n marginLeft: theme.spacing(2),\r\n \"&:disabled\": {\r\n \"& svg\": {\r\n color: theme.palette.text.disabled,\r\n }\r\n }\r\n },\r\n iconButtonEnd: {\r\n color: theme.palette.common.searchInputIcon,\r\n borderRadius: theme.spacing(0.5),\r\n marginRight: \"-4px\"\r\n },\r\n}));\r\n\r\nconst MAX_LEN = { maxLength: 300 };\r\n\r\nexport default function ChatInput(props) {\r\n const { disabled, onSubmit, onCancel, isMobile, placeholder, className, autoFocus, dataRef } = props;\r\n const classes = useStyles();\r\n const [text, setText] = useState(\"\");\r\n const inputRef = useRef(null);\r\n\r\n useEffect(() => {\r\n if (!!dataRef){\r\n dataRef.current.setText = setText;\r\n dataRef.current.focus = () => {\r\n if (!!inputRef.current) {\r\n inputRef.current.focus();\r\n }\r\n }\r\n };\r\n },[dataRef]);\r\n\r\n const onKeyDown = (ev) => {\r\n if (ev.code === \"Enter\" || ev.code === \"NumpadEnter\") {\r\n ev.preventDefault();\r\n if (!disabled && !!text) {\r\n onSubmit(text);\r\n setText(\"\");\r\n }\r\n } else if (ev.code === \"Escape\" && typeof onCancel === \"function\") {\r\n onCancel();\r\n }\r\n };\r\n\r\n const trySubmit = () => {\r\n if (!disabled && !!text) {\r\n onSubmit(text);\r\n setText(\"\");\r\n }\r\n }\r\n\r\n\r\n\r\n const charsRemaining = MAX_LEN.maxLength - text.length;\r\n\r\n return (\r\n <Grid item container direction=\"row\" className={`${classes.root} ${isMobile ? classes.rootMobile : \"\"} ${className || \"\"}`} justifyContent=\"center\" alignItems=\"center\">\r\n <Grid item xs>\r\n <FilledInput\r\n inputRef={inputRef}\r\n className={classes.input}\r\n value={text}\r\n onChange={(ev) => setText(ev.target.value)}\r\n disableUnderline\r\n fullWidth\r\n autoComplete=\"off\"\r\n autoFocus={autoFocus}\r\n multiline\r\n size=\"small\"\r\n hiddenLabel\r\n placeholder={placeholder}\r\n inputProps={MAX_LEN}\r\n onKeyDown={onKeyDown}\r\n endAdornment={\r\n <Fade in={!!onCancel}>\r\n <IconButton\r\n aria-label=\"clear\"\r\n onClick={onCancel}\r\n className={classes.iconButtonEnd}\r\n size=\"small\">\r\n <CloseIcon fontSize=\"small\" />\r\n </IconButton>\r\n </Fade>\r\n }\r\n />\r\n {\r\n charsRemaining < 64 ? (\r\n <Typography variant=\"caption\" color=\"textSecondary\" className={classes.charCounter}>\r\n {charsRemaining} character{charsRemaining !== 1 ? \"s\" : \"\"} left\r\n </Typography>\r\n ) : null\r\n }\r\n </Grid>\r\n <Grid item>\r\n <IconButton size=\"medium\" fontSize=\"large\" color=\"primary\" className={classes.button} disabled={disabled} onClick={trySubmit}>\r\n <SendIcon color=\"primary\" />\r\n </IconButton>\r\n </Grid>\r\n </Grid>\r\n );\r\n}\r\n","import { useMemo } from \"react\";\r\nimport { Grid, Typography, IconButton, ButtonBase, Alert } from \"@mui/material\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport { useQuota } from \"../../../../hooks/usePlan\";\r\nimport { useDevice } from \"../../../../providers/DeviceContext\";\r\nimport { useHistory } from \"react-router\";\r\nimport { Close as CloseIcon } from \"@mui/icons-material\";\r\nimport { useChildren } from \"@emberly/dataplane\";\r\nimport Scrollbar from \"../../../atoms/Scrollbar\"\r\nimport { useDispatch } from \"react-redux\";\r\nimport { AddConfirmDialog } from \"../../../../actions/app\";\r\nimport DynamicCard from \"../../../atoms/DynamicCard\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n root: {\r\n padding: theme.spacing(6),\r\n paddingTop: theme.spacing(5),\r\n width: \"100%\",\r\n position: \"relative\"\r\n },\r\n rootMobile: {\r\n padding: theme.spacing(2),\r\n },\r\n cardContainer: {\r\n position: \"relative\",\r\n maxWidth: \"640px\",\r\n overflow: \"hidden\"\r\n },\r\n description: {\r\n marginTop: theme.spacing(2)\r\n },\r\n actionText: {\r\n marginTop: theme.spacing(4),\r\n marginBottom: theme.spacing(2)\r\n },\r\n upgradeText: {\r\n marginTop: theme.spacing(5)\r\n },\r\n upgradeButton: {\r\n display: \"inline\",\r\n verticalAlign: \"baseline\",\r\n color: theme.palette.primary.main,\r\n fontWeight: 500\r\n },\r\n card: {\r\n \"& .img-container\": {\r\n maxHeight: \"20vh\"\r\n }\r\n },\r\n emptyAlert: {\r\n marginTop: theme.spacing(2)\r\n }\r\n}));\r\n\r\nexport default function QuizSplashScreen(props) {\r\n const classes = useStyles();\r\n const { onClose, title, onSelect, parentId } = props;\r\n const { isMobilePortraitView } = useDevice();\r\n const history = useHistory();\r\n const quota = useQuota(\"MakeQuiz\");\r\n const dispatch = useDispatch();\r\n const { children: notes, loading: notesLoading } = useChildren(\"Note\", parentId);\r\n\r\n const isEmpty = useMemo(() => {\r\n if (!notesLoading) {\r\n return !notes.find(block => block.type !== \"image\" && block.type !== \"header\" && !block.isEmpty());\r\n }\r\n return false;\r\n }, [notes, notesLoading]);\r\n\r\n const remaining = quota.limit - quota.used;\r\n const disabled = remaining <= 0 || quota.loading || isEmpty;\r\n const dialogEnabled = !quota.loading && remaining <= 0;\r\n\r\n const openUpgradeDialog = () => {\r\n if (quota.loading || quota.limit > 200) return;\r\n\r\n dispatch(AddConfirmDialog(\r\n \"Upgrade to get more quizzes\",\r\n \"You have used up your daily quota of quizzes. Upgrade if you want more.\",\r\n \"View plans\",\r\n \"primary\",\r\n () => { },\r\n () => {\r\n history.replace({\r\n pathname: \"/app/settings/plans\",\r\n search: \"\",\r\n removeParameter: \"quiz\"\r\n });\r\n }\r\n ));\r\n };\r\n\r\n return (\r\n <Scrollbar>\r\n <Grid container justifyContent=\"flex-start\" direction=\"row\" className={`${classes.root} ${isMobilePortraitView ? classes.rootMobile : \"\"}`}>\r\n\r\n <Grid container item xs={12} justifyContent=\"space-between\" alignItems=\"center\">\r\n <Grid item>\r\n <Typography variant=\"h2\">\r\n AI Quiz\r\n </Typography>\r\n </Grid>\r\n\r\n <Grid item>\r\n <IconButton fontSize=\"large\" size=\"small\" onClick={onClose}>\r\n <CloseIcon fontSize=\"medium\" />\r\n </IconButton>\r\n </Grid>\r\n </Grid>\r\n\r\n <Grid item xs={12}>\r\n <Typography variant=\"body1\" className={classes.description}>\r\n Take a quiz based on your notes from “{title}â€\r\n </Typography>\r\n </Grid>\r\n\r\n {isEmpty ? (\r\n <Grid item xs={12}>\r\n <Alert severity=\"info\" variant=\"filled\" className={classes.emptyAlert}>\r\n Your notes here are empty, so the AI can't make a quiz for you.\r\n </Alert>\r\n </Grid>\r\n ) : null}\r\n\r\n <Grid item xs={12}>\r\n <Typography variant=\"h6\" className={classes.actionText}>\r\n Choose quiz type\r\n </Typography>\r\n </Grid>\r\n\r\n <Grid item container spacing={3} className={classes.cardContainer}>\r\n\r\n <DynamicCard\r\n className={classes.card}\r\n img=\"/assets/quiz/standard_quiz.jpg\"\r\n title=\"Standard Quiz\"\r\n description=\"Put your knowledge to the test with a multiple-choice quiz!\"\r\n onClick={isEmpty ? undefined : dialogEnabled ? openUpgradeDialog : () => onSelect(\"standard_quiz\")}\r\n delay={250}\r\n disabled={disabled}\r\n />\r\n\r\n <DynamicCard\r\n className={classes.card}\r\n img=\"/assets/quiz/sudden_death_quiz.jpg\"\r\n title=\"Sudden Death\"\r\n description=\"One mistake, and you lose.\"\r\n onClick={isEmpty ? undefined : dialogEnabled ? openUpgradeDialog : () => onSelect(\"sudden_death_quiz\")}\r\n delay={500}\r\n disabled={disabled}\r\n />\r\n\r\n <DynamicCard\r\n className={classes.card}\r\n img=\"/assets/quiz/timed_quiz.jpg\"\r\n title=\"10 Second Time Trial\"\r\n description=\"You have 10 seconds to answer each question. Better think fast!\"\r\n onClick={isEmpty ? undefined : dialogEnabled ? openUpgradeDialog : () => onSelect(\"timed_quiz\")}\r\n delay={750}\r\n disabled={disabled}\r\n />\r\n\r\n <DynamicCard\r\n className={classes.card}\r\n img=\"/assets/quiz/discussion_quiz.jpg\"\r\n title=\"Discussion Simulator\"\r\n description=\"See how well you can defend your knowledge against the AI robot.\"\r\n onClick={isEmpty ? undefined : dialogEnabled ? openUpgradeDialog : () => onSelect(\"discussion_quiz\")}\r\n delay={1000}\r\n disabled={disabled}\r\n />\r\n\r\n </Grid>\r\n\r\n {\r\n remaining <= 3 && !quota.loading ? (\r\n <Grid item container xs={12}>\r\n <Grid item className={classes.cardContainer} xs={12} justifyContent=\"center\">\r\n <Typography variant=\"body2\" textAlign=\"center\" className={classes.upgradeText}>\r\n {remaining <= 0 ? \"You have used all your quizzes for today. \" : `${remaining} quiz${remaining !== 1 ? \"zes\" : \"\"} left today. `}\r\n {quota.limit < 200 ? (\r\n <>\r\n <ButtonBase className={classes.upgradeButton} onClick={() => {\r\n onClose();\r\n history.replace({\r\n pathname: \"/app/settings/plans\",\r\n search: \"\",\r\n removeParameter: \"quiz\"\r\n });\r\n }}>\r\n Upgrade\r\n </ButtonBase> to get more.\r\n </>\r\n ) : null}\r\n </Typography>\r\n </Grid>\r\n </Grid>\r\n ) : null\r\n }\r\n\r\n </Grid>\r\n </Scrollbar>\r\n );\r\n}","import { Grid, Typography, Zoom, ButtonBase } from \"@mui/material\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport { Check as CheckIcon, Close as CloseIcon } from \"@mui/icons-material\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n root: {\r\n display: \"inline-flex\",\r\n position: \"relative\",\r\n width: \"100%\",\r\n background: theme.palette.neutral.main,\r\n justifyContent: \"space-between\",\r\n alignItems: \"center\",\r\n padding: theme.spacing(2),\r\n borderRadius: theme.spacing(1),\r\n marginTop: theme.spacing(0.5),\r\n marginBottom: theme.spacing(0.5),\r\n overflow: \"hidden\",\r\n transition: \"color 250ms ease, box-shadow 250ms ease\",\r\n \"@media (hover: hover)\": {\r\n \"&:hover\": {\r\n \"&:before\": {\r\n background: theme.palette.action.hover,\r\n position: \"absolute\",\r\n height: \"100%\",\r\n top: 0,\r\n left: 0,\r\n width: \"100%\",\r\n content: \"''\",\r\n display: \"block\",\r\n zIndex: 30,\r\n pointerEvents: \"none\"\r\n }\r\n },\r\n },\r\n },\r\n correct: {\r\n boxShadow: `inset 0 0 0 2px ${theme.palette.success.light}`,\r\n color: theme.palette.success.main\r\n },\r\n wrong: {\r\n boxShadow: `inset 0 0 0 2px ${theme.palette.error.main}`,\r\n color: theme.palette.error.main\r\n },\r\n text: {\r\n maxWidth: \"calc(100% - 36px)\"\r\n },\r\n icon: {\r\n padding: 0,\r\n margin: 0,\r\n height: \"24px\",\r\n width: \"24px\",\r\n display: \"block\"\r\n }\r\n}));\r\n\r\nexport default function QuizAnswer(props) {\r\n const { onClick, correct, wrong, disabled, text } = props;\r\n const classes = useStyles();\r\n\r\n return (\r\n <ButtonBase className={`${classes.root} ${correct ? classes.correct : \"\"} ${wrong ? classes.wrong : \"\"}`} onClick={onClick} disabled={wrong || correct || disabled}>\r\n <Grid item xs className={classes.text}>\r\n <Typography variant=\"body1\" textAlign=\"left\">\r\n {text}\r\n </Typography>\r\n </Grid>\r\n <Grid item>\r\n {correct ? (\r\n <Zoom in>\r\n <CheckIcon className={classes.icon} />\r\n </Zoom>\r\n ) : wrong ? (\r\n <Zoom in>\r\n <CloseIcon className={classes.icon} />\r\n </Zoom>\r\n ) : null}\r\n </Grid>\r\n </ButtonBase>\r\n );\r\n}\r\n","import { useState, useEffect } from \"react\";\r\nimport { Grid, Typography, Fade, Button } from \"@mui/material\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport { ArrowForward as ArrowForwardIcon, InfoOutlined as InfoIcon } from \"@mui/icons-material\";\r\nimport QuizAnswer from \"./QuizAnswer\";\r\nimport Scrollbar from \"../../../../atoms/Scrollbar\"\r\nimport { useDevice } from \"../../../../../providers/DeviceContext\";\r\nimport { useMemo } from \"react\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n root: {\r\n padding: theme.spacing(6),\r\n paddingTop: theme.spacing(5),\r\n width: \"100%\",\r\n position: \"relative\"\r\n },\r\n rootMobile: {\r\n padding: theme.spacing(2)\r\n },\r\n questionText: {\r\n marginTop: theme.spacing(3),\r\n marginBottom: theme.spacing(5.5),\r\n maxWidth: \"560px\"\r\n },\r\n nextButton: {\r\n marginTop: theme.spacing(5)\r\n },\r\n multipleChoiceInfo: {\r\n marginTop: theme.spacing(1.5),\r\n color: theme.palette.info.dark,\r\n \"& svg\": {\r\n marginBottom: \"-1px\"\r\n }\r\n }\r\n}));\r\n\r\nexport default function QuizQuestion(props) {\r\n const { question, answers, onScore, next, questionIndex, isFinalQuestion, components } = props;\r\n\r\n const classes = useStyles();\r\n const { isMobilePortraitView } = useDevice()\r\n\r\n const [state, setState] = useState(answers.map(a => ({\r\n ...a,\r\n selected: false\r\n })));\r\n\r\n const [showAnswers, setShowAnswers] = useState(false);\r\n\r\n useEffect(() => {\r\n setState(answers.map(a => ({\r\n ...a,\r\n selected: false\r\n })));\r\n }, [answers]);\r\n\r\n\r\n const { wrongAnswer, correctChoices, correctAnswers } = useMemo(() => {\r\n const wrongAnswer = !!state.find((answer) => answer.selected && !answer.correct);\r\n return {\r\n wrongAnswer,\r\n correctChoices: state.reduce((acc, answer) => acc + (answer.correct ? 1 : 0), 0),\r\n correctAnswers: state.reduce((acc, answer) => acc + (answer.selected && answer.correct ? 1 : 0), 0),\r\n }\r\n }, [state]);\r\n\r\n const allSelected = wrongAnswer || correctAnswers >= correctChoices;\r\n\r\n useEffect(() => {\r\n if (allSelected) {\r\n onScore(!wrongAnswer);\r\n const timer = setTimeout(() => setShowAnswers(true), 300);\r\n return () => {\r\n clearTimeout(timer);\r\n setShowAnswers(false);\r\n }\r\n }\r\n }, [allSelected, wrongAnswer, onScore]);\r\n\r\n\r\n\r\n return (\r\n <Scrollbar>\r\n <Grid container justifyContent=\"flex-start\" alignItems=\"flex-start\" direction=\"row\" className={`${classes.root} ${isMobilePortraitView ? classes.rootMobile : \"\"}`} spacing={0}>\r\n\r\n <Grid item xs={12}>\r\n <Typography variant=\"h3\">\r\n Question {questionIndex + 1}\r\n </Typography>\r\n </Grid>\r\n\r\n {components}\r\n\r\n <Grid item xs={12}>\r\n <Typography variant=\"body1\" className={classes.questionText}>\r\n {question}\r\n </Typography>\r\n </Grid>\r\n\r\n {state.map((answer, i) => {\r\n return (\r\n <Grid item xs={12} key={i}>\r\n <QuizAnswer\r\n text={answer.text}\r\n onClick={() => {\r\n answer.selected = true;\r\n setState([...state]);\r\n }}\r\n correct={(answer.correct && answer.selected) || (showAnswers && answer.correct)}\r\n wrong={!answer.correct && answer.selected}\r\n disabled={answer.selected || allSelected}\r\n />\r\n </Grid>\r\n );\r\n })}\r\n\r\n {\r\n correctChoices > 1 ? (\r\n <Grid item xs={12}>\r\n <Typography variant=\"body1\" className={classes.multipleChoiceInfo}>\r\n <InfoIcon fontSize=\"inherit\"/> Multiple correct answers\r\n </Typography>\r\n </Grid>\r\n ) : null\r\n }\r\n\r\n <Grid item container justifyContent=\"center\" xs={12}>\r\n <Fade in={allSelected}>\r\n <Button variant=\"contained\" color=\"primary\" endIcon={<ArrowForwardIcon />} className={classes.nextButton} size=\"large\" onClick={next}>\r\n {isFinalQuestion ? \"Results\" : \"Next question\"}\r\n </Button>\r\n </Fade>\r\n </Grid>\r\n </Grid>\r\n </Scrollbar>\r\n );\r\n}\r\n","import { Grid, Typography, Button } from \"@mui/material\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport { Close as CloseIcon, ArrowForward as ArrowForwardIcon } from \"@mui/icons-material\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n root: {\r\n width: \"100%\",\r\n position: \"relative\",\r\n marginLeft: 0,\r\n marginRight: 0,\r\n paddingTop: theme.spacing(1),\r\n paddingBottom: theme.spacing(2),\r\n paddingLeft: theme.spacing(5),\r\n paddingRight: theme.spacing(5),\r\n },\r\n topAligned: {\r\n paddingTop: theme.spacing(2),\r\n paddingLeft: theme.spacing(2),\r\n paddingRight: theme.spacing(2)\r\n },\r\n bottomAligned: {\r\n borderTop: `1px solid ${theme.palette.divider}`\r\n },\r\n button: {\r\n color: theme.palette.text.secondary\r\n }\r\n}));\r\n\r\nexport default function QuizNavigation(props) {\r\n const { topAligned, onSkip, onQuit, index, total } = props;\r\n const classes = useStyles();\r\n\r\n return (\r\n <Grid container justifyContent=\"space-between\" alignItems=\"center\" direction=\"row\" className={`${classes.root} ${topAligned ? classes.topAligned : classes.bottomAligned}`} spacing={0}>\r\n <Grid item>\r\n <Button startIcon={topAligned ? <CloseIcon/> : null} onClick={onQuit} color=\"neutral\" size=\"large\" className={classes.button}>\r\n {topAligned ? \"Quit\" : \"Quit quiz\"}\r\n </Button>\r\n </Grid>\r\n\r\n <Grid item>\r\n <Typography variant=\"body1\" color=\"textSecondary\">\r\n {index} of {total}\r\n </Typography>\r\n </Grid>\r\n\r\n <Grid item>\r\n <Button endIcon={<ArrowForwardIcon/>} onClick={onSkip} color=\"neutral\" size=\"large\" className={classes.button}>\r\n Skip\r\n </Button>\r\n </Grid>\r\n </Grid>\r\n );\r\n}\r\n","import { useState, useEffect } from \"react\";\r\nimport { Grid, Typography, CircularProgress, Fade, Zoom, Button } from \"@mui/material\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport { CheckCircleOutline as CheckCircleIcon } from \"@mui/icons-material\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n root: {\r\n padding: theme.spacing(6),\r\n paddingTop: theme.spacing(5),\r\n width: \"100%\",\r\n height: \"100%\",\r\n position: \"relative\"\r\n },\r\n quoteContainer: {\r\n position: \"relative\",\r\n paddingBottom: \"64px\"\r\n },\r\n quote: {\r\n top: \"36px\",\r\n position: \"absolute\",\r\n maxWidth: \"300px\"\r\n },\r\n spinnerContainer: {\r\n position: \"relative\"\r\n },\r\n spinner: {\r\n color: theme.palette.action.active\r\n },\r\n checkIcon: {\r\n position: \"absolute\",\r\n color: theme.palette.success.dark,\r\n width: \"40px\",\r\n height: \"40px\"\r\n }\r\n}));\r\n\r\nconst Quotes = [\r\n \"Get ready!\",\r\n \"You got this!\",\r\n \"The robot is reading through your notes to make a quiz.\",\r\n \"Keep your notes handy and let our AI-based system do the rest.\",\r\n \"Did you know that AI can make mistakes sometimes? Just like us.\",\r\n \"Don't worry, soon you'll be able to use AI to generate your exam answers too!\",\r\n \"Don't worry, our AI is working hard to give you the best quiz possible\"\r\n];\r\n\r\nconst FadeDuration = {\r\n enter: 950,\r\n exit: 950\r\n};\r\n\r\nexport default function QuizLoadingScreen(props) {\r\n const { completed, error, onQuit } = props;\r\n const classes = useStyles();\r\n const [quoteIndex, setQuoteIndex] = useState(Math.floor(Math.random() * Quotes.length));\r\n const [showQuote, setShowQuote] = useState(false);\r\n\r\n useEffect(() => {\r\n let state = 0;\r\n\r\n const timer = setInterval(() => {\r\n switch (state) {\r\n case 0:\r\n setQuoteIndex(idx => (idx + 1) % Quotes.length);\r\n setShowQuote(true);\r\n state++;\r\n break;\r\n case 3:\r\n setShowQuote(false);\r\n state = 0;\r\n break;\r\n default:\r\n state++;\r\n break;\r\n }\r\n }, 1000);\r\n\r\n return () => {\r\n clearInterval(timer);\r\n };\r\n }, []);\r\n\r\n return (\r\n <Grid container justifyContent=\"center\" alignItems=\"center\" direction=\"column\" className={classes.root} spacing={1}>\r\n {\r\n error ? (\r\n <Grid item container alignItems=\"center\" direction=\"column\" className={classes.quoteContainer}>\r\n <Typography variant=\"body1\" textAlign=\"center\">\r\n An error occured, try again later.\r\n </Typography>\r\n <Button onClick={onQuit}>Go back</Button>\r\n </Grid>\r\n ) : (\r\n <>\r\n <Grid item className={classes.spinnerContainer}>\r\n <Zoom in={completed}>\r\n <CheckCircleIcon className={classes.checkIcon} />\r\n </Zoom>\r\n <Fade in={!completed}>\r\n <CircularProgress className={classes.spinner} />\r\n </Fade>\r\n </Grid>\r\n\r\n <Grid item container alignItems=\"center\" direction=\"column\" className={classes.quoteContainer}>\r\n <Typography variant=\"body1\" textAlign=\"center\">\r\n {completed ? \"Good luck!\" : \"Generating quiz...\"}\r\n </Typography>\r\n <Fade in={showQuote && !completed} timeout={FadeDuration}>\r\n <Typography variant=\"body1\" color=\"textSecondary\" className={classes.quote} textAlign=\"center\">\r\n {Quotes[quoteIndex]}\r\n </Typography>\r\n </Fade>\r\n </Grid>\r\n </>\r\n )\r\n }\r\n\r\n </Grid>\r\n );\r\n}\r\n","import { useState, useEffect, useRef } from \"react\";\r\nimport { Grid, Typography, CircularProgress, Fade, Zoom, Button } from \"@mui/material\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport { useMemo } from \"react\";\r\nimport Scrollbar from \"../../../atoms/Scrollbar\"\r\nimport Confetti from \"react-confetti\";\r\n\r\nconst SCORE_100 = [\r\n \"Way to go! You got every single answer right!\",\r\n \"Wow! You nailed it! \",\r\n \"Incredible! You must have studied hard for that one! \",\r\n \"Wow! You really know your stuff! \",\r\n \"Outstanding! You are a quiz master! \",\r\n \"Perfect score! You really know your stuff! \",\r\n \"You are a quiz-crushing machine!\",\r\n \"You have demonstrated your knowledge with a perfect score! \",\r\n];\r\n\r\nconst SCORE_75 = [\r\n \"You're well on your way to becoming a quiz master!\",\r\n \"You're well on your way to becoming a quiz champion! \",\r\n \"Well done! You have demonstrated excellent knowledge.\",\r\n \"You have shown a thorough understanding\",\r\n \"You have demonstrated a deep understanding.\",\r\n \"You rocked this quiz! Bravo!\",\r\n \"You have displayed a remarkable level of proficiency.\",\r\n \"You have proven your expertise in this subject.\",\r\n];\r\n\r\nconst SCORE_50 = [\r\n \"You got the gist of it, but let's see if you can get them all next time!\",\r\n \"You got the hang of it. Better luck next time!\",\r\n \"Nearly there, but not quite a bullseye!\",\r\n \"Nice try, but not quite a masterclass!\",\r\n \"Not bad, but not quite there!\",\r\n \"Nearly, but nearly is only good in horseshoes and hand grenades!\",\r\n \"Not too shabby - keep it up!\",\r\n];\r\n\r\nconst SCORE_LOW = [\r\n \"Remember, mistakes are proof that you are trying.\",\r\n \"No one can be perfect all the time. That's why we have second chances.\",\r\n \"It's not about being perfect; it's about having fun and learning something new.\",\r\n \"It's ok to not get every answer right. Learning is a journey, not a destination.\",\r\n \"Ah, don't sweat it - even the best of us make mistakes!\",\r\n \"It's all good - mistakes are how we learn!\",\r\n];\r\n\r\nconst ANIMATION_TIME_MS = 1000;\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n root: {\r\n width: \"100%\",\r\n minHeight: \"100%\",\r\n height: \"auto\",\r\n position: \"relative\",\r\n padding: theme.spacing(6),\r\n paddingTop: theme.spacing(5),\r\n },\r\n progressContainer: {\r\n position: \"relative\",\r\n width: \"324px !important\",\r\n height: \"324px !important\",\r\n maxHeight: \"min(75vw, 35vh)\",\r\n maxWidth: \"min(75vw, 35vh)\",\r\n marginTop: theme.spacing(4),\r\n marginBottom: theme.spacing(4)\r\n },\r\n progressBackground: {\r\n position: \"absolute\",\r\n top: 0,\r\n left: 0,\r\n width: \"100% !important\",\r\n height: \"100% !important\"\r\n },\r\n progress: {\r\n position: \"absolute\",\r\n top: 0,\r\n left: 0,\r\n width: \"100% !important\",\r\n height: \"100% !important\",\r\n color: theme.palette.success.light,\r\n \"& circle\": {\r\n transition: `stroke-dashoffset ${ANIMATION_TIME_MS}ms ease-in-out 0ms`\r\n }\r\n },\r\n progressText: {\r\n position: \"absolute\",\r\n fontSize: \"calc(min(75vw, 35vh, 320px) / 5)\",\r\n top: \"50%\",\r\n left: \"50%\",\r\n transform: \"translate(-50%, -50%)\"\r\n },\r\n resultText: {\r\n marginBottom: theme.spacing(1),\r\n maxWidth: \"350px\"\r\n },\r\n motivationText: {\r\n maxWidth: \"350px\",\r\n marginBottom: theme.spacing(4)\r\n },\r\n buttonContainer: {\r\n maxWidth: `100% !important`,\r\n width: \"314px\"\r\n },\r\n finishQuizButton: {\r\n marginTop: theme.spacing(1)\r\n }\r\n}));\r\n\r\nexport default function QuizScoreScreen(props) {\r\n const { onPlayAgain, onFinish, correctAnswers, totalQuestions } = props;\r\n const classes = useStyles();\r\n const finalScore = Math.floor((correctAnswers / totalQuestions) * 100);\r\n const [score, setScore] = useState(0);\r\n const [renderScore, setRenderScore] = useState(0);\r\n\r\n const [confettiActive, setConfettiActive] = useState(false);\r\n const rootRef = useRef(null);\r\n\r\n const motivationText = useMemo(() => {\r\n if (finalScore >= 100) {\r\n return SCORE_100[Math.floor(Math.random() * SCORE_100.length)];\r\n } else if (finalScore >= 75) {\r\n return SCORE_75[Math.floor(Math.random() * SCORE_75.length)];\r\n } else if (finalScore >= 50) {\r\n return SCORE_50[Math.floor(Math.random() * SCORE_50.length)];\r\n }\r\n\r\n return SCORE_LOW[Math.floor(Math.random() * SCORE_LOW.length)]\r\n }, [finalScore]);\r\n\r\n useEffect(() => {\r\n const stepSize = 5;\r\n const stepTime = Math.max(1, Math.ceil((ANIMATION_TIME_MS / (finalScore / stepSize))));\r\n\r\n let tempScore = 0;\r\n\r\n const timer = setInterval(() => {\r\n if (finalScore > tempScore) {\r\n tempScore = Math.min(finalScore, tempScore + stepSize);\r\n setScore(tempScore);\r\n if (tempScore === 100) {\r\n setConfettiActive(true);\r\n }\r\n } else {\r\n clearInterval(timer);\r\n }\r\n }, stepTime);\r\n\r\n setRenderScore(finalScore);\r\n\r\n return () => {\r\n clearInterval(timer);\r\n };\r\n }, [finalScore])\r\n\r\n return (\r\n <Scrollbar>\r\n <Grid container direction=\"column\" alignItems=\"center\" className={classes.root} spacing={0} ref={rootRef}>\r\n\r\n {confettiActive ? (\r\n <Confetti\r\n recycle={false}\r\n width={rootRef.current?.offsetWidth}\r\n height={rootRef.current?.offsetHeight}\r\n />\r\n ) : null}\r\n\r\n <Grid item>\r\n <Typography variant=\"h3\">\r\n Final Score\r\n </Typography>\r\n </Grid>\r\n\r\n <Zoom in>\r\n <Grid item>\r\n <div className={classes.progressContainer}>\r\n <CircularProgress\r\n className={classes.progressBackground}\r\n variant=\"determinate\"\r\n value={100}\r\n color=\"neutral\"\r\n />\r\n <CircularProgress\r\n className={classes.progress}\r\n variant=\"determinate\"\r\n value={renderScore}\r\n color=\"success\"\r\n />\r\n <Typography variant=\"h1\" className={classes.progressText}>\r\n {score}%\r\n </Typography>\r\n </div>\r\n </Grid>\r\n </Zoom>\r\n\r\n <Fade in>\r\n <Grid item container alignItems=\"center\" direction=\"column\">\r\n <Typography variant=\"subtitle1\" textAlign=\"center\" className={classes.resultText}>\r\n {correctAnswers} of {totalQuestions} correct answers\r\n </Typography>\r\n <Typography variant=\"body1\" textAlign=\"center\" className={classes.motivationText}>\r\n {motivationText}\r\n </Typography>\r\n </Grid>\r\n </Fade>\r\n\r\n <Fade in>\r\n <Grid item className={classes.buttonContainer}>\r\n <Button variant=\"contained\" color=\"primary\" size=\"large\" fullWidth onClick={onPlayAgain}>\r\n Play again\r\n </Button>\r\n <Button variant=\"contained\" color=\"neutral\" size=\"large\" fullWidth className={classes.finishQuizButton} onClick={onFinish}>\r\n Finish quiz\r\n </Button>\r\n </Grid>\r\n </Fade>\r\n\r\n </Grid>\r\n </Scrollbar>\r\n );\r\n}\r\n","import { useState, useEffect, useRef } from \"react\";\r\nimport { Grid } from \"@mui/material\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport QuizQuestion from \"../common/QuizQuestion\";\r\nimport QuizNavigation from \"../common/QuizNavigation\";\r\nimport { useDevice } from \"../../../../../providers/DeviceContext\";\r\nimport QuizLoadingScreen from \"../QuizLoadingScreen\";\r\nimport { useGroup, useGroupName } from \"@emberly/dataplane\";\r\nimport QuizScoreScreen from \"../QuizScoreScreen\";\r\nimport { useCallback } from \"react\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n root: {\r\n width: \"100%\",\r\n height: \"100%\",\r\n position: \"relative\"\r\n }\r\n}));\r\n\r\nexport default function StandardQuiz(props) {\r\n const { parentId, onQuit, quizHeaderComponents, controller, showLoader } = props;\r\n const classes = useStyles();\r\n const { isMobilePortraitView } = useDevice();\r\n const groupName = useGroupName();\r\n const { group } = useGroup(groupName);\r\n\r\n const [quizReady, setQuizReady] = useState(false);\r\n const [questions, setQuestions] = useState([]);\r\n const [questionIndex, setQuestionIndex] = useState(0);\r\n const [score, setScore] = useState(0);\r\n const loadingRef = useRef(false);\r\n const [error, setError] = useState(false);\r\n\r\n const question = questions.length !== 0 && questionIndex < questions.length ? questions[questionIndex] : null;\r\n const finished = questionIndex >= questions.length;\r\n const isFinalQuestion = questionIndex === questions.length - 1;\r\n\r\n const onScore = useCallback((correct) => {\r\n controller?.emit(\"onAnswer\", correct);\r\n if (correct) {\r\n setScore(s => s + 1);\r\n }\r\n }, [controller]);\r\n\r\n const onNextQuestion = useCallback(() => {\r\n setQuestionIndex(i => i + 1);\r\n controller?.emit(questionIndex >= questions.length - 1 ? \"onEnd\" : \"onNext\");\r\n }, [questionIndex, questions, controller]);\r\n\r\n const onEndQuiz = useCallback(() => {\r\n setQuestionIndex(questions.length);\r\n },[questions]);\r\n\r\n const onPlayAgain = useCallback(() => {\r\n setScore(0);\r\n setQuestions(q => [...q]);\r\n setQuestionIndex(0);\r\n controller?.emit(\"onReset\");\r\n }, [controller]);\r\n\r\n useEffect(() => {\r\n if (!!group && parentId && !loadingRef.current && !showLoader) {\r\n loadingRef.current = true;\r\n /*\r\n setQuestions(TestQuestions);\r\n setQuizReady(true);\r\n controller?.emit(\"onLoaded\", TestQuestions);\r\n \r\n return;\r\n */\r\n group.send(\"MakeQuiz\", { parentIds: [ parentId ] })\r\n .then((res) => {\r\n if (res?.quiz?.questions?.length > 0) {\r\n setQuestions(res.quiz.questions);\r\n setQuizReady(true);\r\n controller?.emit(\"onLoaded\", res.quiz.questions);\r\n } else {\r\n setError(true);\r\n }\r\n })\r\n .catch(() => {\r\n console.log(\"error loading quiz\");\r\n setError(true);\r\n });\r\n }\r\n }, [group, parentId, showLoader, controller]);\r\n\r\n const ctrlRefs = useRef({});\r\n ctrlRefs.current.next = onNextQuestion;\r\n ctrlRefs.current.end = onEndQuiz;\r\n\r\n useEffect(() => {\r\n if (!!controller) {\r\n controller\r\n .on(\"next\", () => {\r\n ctrlRefs.current.next();\r\n })\r\n .on(\"end\", () => {\r\n ctrlRefs.current.end();\r\n });\r\n }\r\n }, [controller]);\r\n\r\n\r\n return (\r\n <Grid container direction=\"column\" className={classes.root} spacing={0}>\r\n {quizReady && !showLoader ? (\r\n <>\r\n {isMobilePortraitView && !finished ? (\r\n <Grid item>\r\n <QuizNavigation\r\n index={questionIndex + 1}\r\n total={questions.length}\r\n onSkip={onNextQuestion}\r\n onQuit={onQuit}\r\n topAligned\r\n />\r\n </Grid>\r\n ) : null}\r\n\r\n <Grid item xs>\r\n {\r\n finished ? (\r\n <QuizScoreScreen\r\n onFinish={onQuit}\r\n onPlayAgain={onPlayAgain}\r\n correctAnswers={score}\r\n totalQuestions={questions.length}\r\n />\r\n ) : (\r\n <QuizQuestion\r\n questionIndex={questionIndex}\r\n question={question.question}\r\n answers={question.answers}\r\n onScore={onScore}\r\n next={onNextQuestion}\r\n isFinalQuestion={isFinalQuestion}\r\n components={quizHeaderComponents}\r\n />\r\n )\r\n }\r\n </Grid>\r\n\r\n {!isMobilePortraitView && !finished ? (\r\n <Grid item>\r\n <QuizNavigation\r\n index={questionIndex + 1}\r\n total={questions.length}\r\n onSkip={onNextQuestion}\r\n onQuit={onQuit}\r\n />\r\n </Grid>\r\n ) : null}\r\n </>\r\n ) : (\r\n <QuizLoadingScreen error={error} onQuit={onQuit} />\r\n )}\r\n </Grid>\r\n );\r\n}\r\n","import EventEmitter from \"events\";\r\n\r\n\r\nexport default class QuizController extends EventEmitter {\r\n\r\n next() {\r\n this.emit(\"next\");\r\n }\r\n\r\n end() {\r\n this.emit(\"end\");\r\n }\r\n\r\n}","import { LinearProgress, Grid } from \"@mui/material\";\r\nimport StandardQuiz from \"./StandardQuiz\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport { useEffect, useRef, useState } from \"react\";\r\nimport QuizController from \"../common/QuizController\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n timer: {\r\n marginTop: theme.spacing(2)\r\n }\r\n}));\r\n\r\nexport default function TimedQuiz(props) {\r\n const { parentId, onQuit } = props;\r\n const classes = useStyles();\r\n const controllerRef = useRef(new QuizController());\r\n const [clock, setClock] = useState(0);\r\n const [loading, setLoading] = useState(true);\r\n const [correctAnswer, setCorrectAnswer] = useState(null);\r\n\r\n useEffect(() => {\r\n const crl = controllerRef.current;\r\n let timer = null;\r\n let clk = 0;\r\n\r\n const runTimer = () => {\r\n setClock(0);\r\n clk = 0;\r\n timer = setInterval(() => {\r\n setClock(++clk);\r\n if (clk >= 10) {\r\n clearInterval(timer);\r\n crl.next();\r\n }\r\n }, 1000);\r\n };\r\n\r\n crl\r\n .on(\"onLoaded\", () => {\r\n runTimer();\r\n })\r\n .on(\"onAnswer\", (correct) => {\r\n clearInterval(timer);\r\n setCorrectAnswer(correct);\r\n })\r\n .on(\"onNext\", () => {\r\n clearInterval(timer);\r\n setCorrectAnswer(null);\r\n runTimer();\r\n })\r\n .on(\"onEnd\", () => {\r\n clearInterval(timer);\r\n setCorrectAnswer(null);\r\n })\r\n .on(\"onReset\", () => {\r\n clearInterval(timer);\r\n setCorrectAnswer(null);\r\n runTimer();\r\n });\r\n\r\n setLoading(false);\r\n return () => {\r\n crl.removeAllListeners();\r\n };\r\n }, []);\r\n\r\n return (\r\n <StandardQuiz\r\n showLoader={loading}\r\n parentId={parentId}\r\n onQuit={onQuit}\r\n controller={controllerRef.current}\r\n quizHeaderComponents={(\r\n <Grid item xs={12}>\r\n <LinearProgress \r\n variant=\"determinate\" \r\n value={clock * 10} \r\n className={classes.timer} \r\n color={correctAnswer ? \"success\" : (correctAnswer === false ? \"error\" : ( clock > 7 ? \"warning\" : \"primary\"))}\r\n />\r\n </Grid>\r\n )}\r\n />\r\n );\r\n}","import StandardQuiz from \"./StandardQuiz\";\r\nimport { useEffect, useRef, useState } from \"react\";\r\nimport QuizController from \"../common/QuizController\";\r\n\r\nexport default function SuddenDeathQuiz(props) {\r\n const { parentId, onQuit } = props;\r\n const controllerRef = useRef(new QuizController());\r\n const [loading, setLoading] = useState(true);\r\n\r\n useEffect(() => {\r\n const crl = controllerRef.current;\r\n crl\r\n .on(\"onAnswer\", (correct) => {\r\n if (!correct) {\r\n crl.end();\r\n }\r\n });\r\n setLoading(false);\r\n return () => {\r\n crl.removeAllListeners();\r\n };\r\n }, []);\r\n\r\n return (\r\n <StandardQuiz\r\n showLoader={loading}\r\n parentId={parentId}\r\n onQuit={onQuit}\r\n controller={controllerRef.current}\r\n />\r\n );\r\n}","import { useState, useEffect, useRef } from \"react\";\r\nimport { Grid, Typography, Button, Fade } from \"@mui/material\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport Scrollbar from \"../../../../atoms/Scrollbar\"\r\nimport ChatBubble from \"../../common/ChatBubble\";\r\nimport { InfoOutlined as InfoIcon } from \"@mui/icons-material\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n root: {\r\n position: \"relative\",\r\n },\r\n scrollbar: {\r\n padding: theme.spacing(6),\r\n paddingTop: 0,\r\n paddingBottom: \"32px\",\r\n },\r\n scrollbarMobile: {\r\n paddingLeft: theme.spacing(2),\r\n paddingRight: theme.spacing(2)\r\n },\r\n npcImage: {\r\n width: \"100%\",\r\n height: \"auto\",\r\n borderRadius: theme.spacing(2),\r\n marginTop: theme.spacing(4)\r\n },\r\n npcPhrase: {\r\n maxWidth: \"464px\",\r\n marginTop: theme.spacing(1),\r\n marginBottom: theme.spacing(3)\r\n },\r\n infoText: {\r\n maxWidth: \"464px\",\r\n \"& svg\": {\r\n marginBottom: \"-2px\"\r\n }\r\n },\r\n buttonContainer: {\r\n marginTop: theme.spacing(4)\r\n },\r\n playAgainButton: {\r\n maxWidth: `100% !important`,\r\n width: \"314px\",\r\n },\r\n finishQuizButton: {\r\n maxWidth: `100% !important`,\r\n width: \"314px\",\r\n marginTop: theme.spacing(1)\r\n }\r\n}));\r\n\r\n\r\nexport default function ChatPanel(props) {\r\n const { npc, conversation, thinking, win, defeat, roundsLeft, endPhrase, onFinish, onPlayAgain, isMobile } = props;\r\n const classes = useStyles();\r\n\r\n const panelRef = useRef(null);\r\n const [showThinking, setShowThinking] = useState(false);\r\n\r\n useEffect(() => {\r\n if (thinking) {\r\n const timer = setTimeout(() => setShowThinking(true), 600);\r\n return () => {\r\n clearTimeout(timer);\r\n setShowThinking(false);\r\n }\r\n }\r\n }, [thinking])\r\n\r\n useEffect(() => {\r\n if (!!panelRef.current) {\r\n panelRef.current.parentElement.scroll({ top: panelRef.current.offsetHeight, behavior: \"smooth\" });\r\n\r\n }\r\n }, [conversation, showThinking, win, defeat]);\r\n\r\n return (\r\n <Grid xs item container direction=\"row\" className={classes.root}>\r\n <Scrollbar>\r\n <Grid item container direction=\"row\" className={`${classes.scrollbar} ${isMobile ? classes.scrollbarMobile : \"\"}`} ref={panelRef}>\r\n\r\n <Grid item xs={12}>\r\n <img src={npc.image} className={classes.npcImage} alt=\"the contender and you\" />\r\n </Grid>\r\n\r\n <Grid item xs={12} container justifyContent=\"center\">\r\n <Typography variant=\"body1\" color=\"textSecondary\" textAlign=\"center\" className={classes.npcPhrase}>\r\n {npc.phrase}\r\n </Typography>\r\n </Grid>\r\n\r\n {conversation.map((message, idx) => {\r\n const isNpc = idx % 2 === 0;\r\n return (\r\n <ChatBubble\r\n key={idx}\r\n isNpc={isNpc}\r\n text={message}\r\n avatar={isNpc ? npc.avatar : undefined}\r\n />\r\n )\r\n })}\r\n\r\n {\r\n showThinking ? (\r\n <ChatBubble\r\n isNpc\r\n avatar={npc.avatar}\r\n writing\r\n />\r\n ) : null\r\n }\r\n\r\n <Grid item xs={12} container justifyContent=\"center\">\r\n <Typography variant=\"body1\" color=\"textSecondary\" textAlign=\"center\" className={classes.infoText}>\r\n {win || defeat ? (\r\n <>\r\n <InfoIcon fontSize=\"inherit\" /> {endPhrase}\r\n </>\r\n ) : !thinking ? (\r\n <>\r\n <InfoIcon fontSize=\"inherit\" /> You have {roundsLeft === 1 ? \"one answer left\" : `${roundsLeft} answers left, or until you opponent loses patience.`}\r\n </>\r\n ) : \"\"}\r\n </Typography>\r\n </Grid>\r\n\r\n <Fade in={win || defeat}>\r\n <Grid item container xs={12} className={classes.buttonContainer} alignItems=\"center\" direction=\"column\">\r\n <Button variant=\"contained\" color=\"primary\" size=\"large\" className={classes.playAgainButton} onClick={onPlayAgain}>\r\n Play again\r\n </Button>\r\n <Button variant=\"contained\" color=\"neutral\" size=\"large\" className={classes.finishQuizButton} onClick={onFinish}>\r\n Finish quiz\r\n </Button>\r\n </Grid>\r\n </Fade>\r\n\r\n </Grid>\r\n </Scrollbar>\r\n </Grid>\r\n )\r\n}","import { useState, useEffect, useRef } from \"react\";\r\nimport { Grid, Typography, IconButton } from \"@mui/material\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport { useDevice } from \"../../../../../providers/DeviceContext\";\r\nimport { useGroup, useGroupName } from \"@emberly/dataplane\";\r\nimport ChatPanel from \"../common/ChatPanel\";\r\nimport ChatInput from \"../../common/ChatInput\";\r\nimport { Close as CloseIcon } from \"@mui/icons-material\";\r\nimport CardHeader from \"../../../../atoms/CardHeader\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n root: {\r\n width: \"100%\",\r\n height: \"100%\",\r\n position: \"relative\"\r\n },\r\n headerContainer: {\r\n borderBottom: `1px solid ${theme.palette.divider}`,\r\n paddingTop: theme.spacing(6),\r\n paddingBottom: theme.spacing(1),\r\n paddingLeft: theme.spacing(6),\r\n paddingRight: theme.spacing(6)\r\n }\r\n}));\r\n\r\n\r\nconst NPCS = [\r\n {\r\n name: \"odin\",\r\n image: \"/assets/quiz/discussion_simulator/odin.jpg\",\r\n avatar: \"/assets/quiz/discussion_simulator/profile_odin.jpg\",\r\n phrase: \"You find yourself face to face with the Norse god of wisdom, Odin.\",\r\n defeatPhrases: [\r\n \"Odin, astonished by your knowledge, grudgingly admits defeat. You have won!\",\r\n \"You have enlightened Odin with your knowledge. Congratulations!\",\r\n \"Congratulations! You have defeated Odin, the god of wisdom.\",\r\n \"You won! Odin concedes and shakes his head in disbelief.\",\r\n \"You have won the debate! Your knowledge and wit have been victorious!\",\r\n \"You have triumphed in your discussion with Odin! Your logic were too strong for him to handle!\",\r\n \"You have outsmarted Odin, the all-knowing god! He looks astonished, but you can tell he respects your intellect.\",\r\n ],\r\n winPhrases: [\r\n \"Odin laughs triumphantly, his victory clearly evident, as he wins the game.\",\r\n \"Odin slowly claps, an amused expression on his face, as he declares you the loser.\",\r\n \"Odin nods his head in satisfaction, his victory assured after your unsuccessful attempts.\",\r\n \"Odin smirks, enjoying your failed attempts to win the game.\",\r\n \"Odin shakes his head, his expression one of superiority, as he declares the you the loser.\",\r\n \"Odin lets out a deep chuckle, his expression triumphant, as the you fail to win.\",\r\n \"Odin raises an eyebrow, his expression victorious, as he ends the game.\",\r\n \"Odin the wise god of Norse mythology looks down upon you with a knowing expression as your last turn ends and you lose the game.\",\r\n \"Odin slowly rises from his throne, looking disappointed and shaking his head as you finally succumb to defeat.\",\r\n \"Odin grins in satisfaction as he wins the game, leaving you to ponder your loss.\",\r\n \"Odin stands victorious as you realise you are out of turns and can no longer win the game.\",\r\n \"Odin looks smug as your last turn ends and he is the victor of the game.\",\r\n ]\r\n },\r\n {\r\n name: \"plato\",\r\n image: \"/assets/quiz/discussion_simulator/plato.jpg\",\r\n avatar: \"/assets/quiz/discussion_simulator/profile_plato.jpg\",\r\n phrase: \"Plato awaits, ready to challenge you with his ideas.\",\r\n defeatPhrases: [\r\n \"You have bested Plato! He throws his hands up in despair and concedes the argument. Well done!\",\r\n \"You have out-argued Plato! He looks aghast and slowly sinks in his chair. Bravo!\",\r\n \"You have won! Plato is slowly clapping in respect and admiration of your argument.\",\r\n \"Plato concedes, impressed by your mastery of the topic. You have won!\",\r\n \"Ah, Plato has been defeated! He is slightly embarrassed, but still graciously accepts your wisdom.\",\r\n \"You win! Plato can't help but smile, as he realizes he's been outwitted.\",\r\n \"You've won! Plato was so impressed by your reasoning, he couldn't help but admit defeat.\",\r\n \"Victory is yours! Plato can't help but admit defeat after your strong argument.\",\r\n ],\r\n winPhrases: [\r\n \"After another round of discussion, Plato remained steadfast in his beliefs. His expression remained unchanged, his gaze focused and unwavering.\",\r\n \"Plato's wisdom had won out in the end. He stood victorious, a slight smile of satisfaction tugging at the corners of his mouth.\",\r\n \"Plato's arguments had proven too powerful. With a deep sigh, Plato folded his hands and looked away.\",\r\n \"After yet another failed attempt to win the debate, Plato acknowledged the player's efforts with a nod of his head. As the player ran out of arguments, Plato simply looked at him with a raised eyebrow, clearly amused.\",\r\n \"In the end, the player had been outwitted by Plato. He simply shook his head and crossed his arms, a smirk on his face.\",\r\n \"The player could not match Plato's philosophical acumen. You bowed your head in defeat, as Plato smirked knowingly.\",\r\n \"Plato's knowledge had been too much for the you to handle. He hung his head in defeat, as Plato smiled in triumph.\"\r\n ]\r\n },\r\n {\r\n name: \"troll\",\r\n image: \"/assets/quiz/discussion_simulator/troll.jpg\",\r\n avatar: \"/assets/quiz/discussion_simulator/profile_troll.jpg\",\r\n phrase: \"The Troll beckons, ready to challenge you with its cunning.\",\r\n defeatPhrases: [\r\n \"The troll grudgingly admits that you are right and gives in. He looks a bit sour, but you've won the day!\",\r\n \"You've outdone the troll! He reluctantly concedes that you have the correct view and concedes defeat. He looks a bit relieved, but still a bit grumpy!\",\r\n \"You won! The troll is visibly upset, but concedes that you are right. He looks a bit embarrassed, but you have the bragging rights!\",\r\n \"You have emerged victorious! The troll is left speechless, and can't believe he has been bested by a mere mortal. He turns and trudges off in defeat.\",\r\n \"Congratulations! You have been able to make your point clear and the troll has accepted his defeat!\",\r\n \"You have won! Your clever arguments have convinced the troll to accept his defeat!\",\r\n \"Excellent job! You have outwitted the troll and earned the victory!\",\r\n ],\r\n winPhrases: [\r\n \"The Troll under the bridge laughs triumphantly as you surrender the game. His expression is one of smug satisfaction.\",\r\n \"The Troll under the bridge shakes his head as he wins the game. His expression is one of smug superiority.\",\r\n \"The Troll under the bridge stands victorious, with a wide grin on his face. His expression is one of absolute delight. The Troll under the bridge jeers as you lose the game. His expression is one of malicious glee.\",\r\n \"The Troll under the bridge claps his hands as he wins the game. His expression is one of smug triumph.\",\r\n \"The Troll under the bridge gloats as you run out of turns. His expression is one of relieved joy.\",\r\n \"The Troll under the bridge cackles as you surrender the game. His expression is one of unrestrained delight.\",\r\n \"The Troll under the bridge pumps his fist as he wins the game. His expression is one of victorious joy.\",\r\n \"The Troll under the bridge sneers as you lose the game. His expression is one of cruel satisfaction.\"\r\n ]\r\n },\r\n];\r\n\r\nexport default function DiscussionSimulator(props) {\r\n const { parentId, onQuit } = props;\r\n const classes = useStyles();\r\n const { isMobilePortraitView, isMobile } = useDevice();\r\n const groupName = useGroupName();\r\n const { group } = useGroup(groupName);\r\n const [npc] = useState(NPCS[Math.floor(Math.random() * NPCS.length)])\r\n const loadingRef = useRef(false);\r\n const [backgroundData, setBackgroundData] = useState(\"\");\r\n const [roundsLeft, setRoundsLeft] = useState(10);\r\n\r\n const [thinking, setThinking] = useState(true);\r\n const [conversation, setConversation] = useState([]);\r\n const [win, setWin] = useState(false);\r\n const [defeat, setDefeat] = useState(false);\r\n const [endPhrase, setEndPhrase] = useState(\"\");\r\n\r\n useEffect(() => {\r\n if (!!group && parentId && !loadingRef.current) {\r\n loadingRef.current = true;\r\n group.send(\"StartDiscussion\", { parentIds: [parentId], personality: npc.name })\r\n .then((res) => {\r\n setConversation(list => [...list, res.message]);\r\n setBackgroundData(res.data);\r\n setThinking(false);\r\n })\r\n .catch(() => {\r\n console.log(\"error starting discussion\");\r\n });\r\n }\r\n }, [group, parentId, npc.name]);\r\n\r\n const onSubmit = (text) => {\r\n const list = [...conversation, text];\r\n setThinking(true);\r\n setConversation(list);\r\n setRoundsLeft(l => l - 1);\r\n\r\n group.send(\"ContinueDiscussion\", {\r\n parentIds: [parentId],\r\n personality: npc.name,\r\n data: backgroundData,\r\n conversation: list\r\n })\r\n .then((res) => {\r\n setConversation(list => [...list, res.message]);\r\n setThinking(false);\r\n if (res.win) {\r\n setEndPhrase(npc.defeatPhrases[Math.floor(Math.random() * npc.defeatPhrases.length)])\r\n setWin(true);\r\n } else if (roundsLeft <= 0 || res.defeat) {\r\n setEndPhrase(npc.winPhrases[Math.floor(Math.random() * npc.winPhrases.length)])\r\n setDefeat(true);\r\n }\r\n })\r\n .catch(err => {\r\n console.log(\"error continue discussion\", err);\r\n })\r\n };\r\n\r\n const onPlayAgain = () => {\r\n setThinking(false);\r\n setRoundsLeft(10);\r\n setWin(false);\r\n setDefeat(false);\r\n setEndPhrase(\"\");\r\n setConversation([conversation[0]]);\r\n }\r\n\r\n return (\r\n <Grid container direction=\"column\" className={classes.root} spacing={0}>\r\n\r\n {isMobilePortraitView ? (\r\n <Grid item container>\r\n <CardHeader title=\"Discussion simulator\" border onBack={onQuit} />\r\n </Grid>\r\n ) : (\r\n <Grid item container className={classes.headerContainer} alignItems=\"center\">\r\n <Grid item xs>\r\n <Typography variant=\"h3\">\r\n Discussion simulator\r\n </Typography>\r\n </Grid>\r\n\r\n\r\n <Grid item>\r\n <IconButton fontSize=\"large\" size=\"small\" onClick={onQuit}>\r\n <CloseIcon fontSize=\"medium\" />\r\n </IconButton>\r\n </Grid>\r\n </Grid>\r\n )}\r\n\r\n\r\n <ChatPanel\r\n npc={npc}\r\n conversation={conversation}\r\n thinking={thinking}\r\n win={win}\r\n defeat={defeat}\r\n roundsLeft={roundsLeft}\r\n endPhrase={endPhrase}\r\n onFinish={onQuit}\r\n onPlayAgain={onPlayAgain}\r\n isMobile={isMobile}\r\n />\r\n\r\n <ChatInput\r\n onSubmit={onSubmit}\r\n isMobile={isMobile}\r\n disabled={thinking || win || defeat}\r\n placeholder=\"Write your counter-argument\"\r\n />\r\n\r\n </Grid>\r\n );\r\n}","import { useState } from \"react\";\r\nimport { Paper, Grid, Typography, Portal, Fade } from \"@mui/material\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport { useDevice } from \"../../../../providers/DeviceContext\";\r\nimport { Info as InfoIcon } from \"@mui/icons-material\";\r\nimport QuizSplashScreen from \"./QuizSplashScreen\";\r\nimport StandardQuiz from \"./variations/StandardQuiz\";\r\nimport { useEffect } from \"react\";\r\nimport { useHistory, useLocation } from \"react-router\";\r\nimport TimedQuiz from \"./variations/TimedQuiz\";\r\nimport SuddenDeathQuiz from \"./variations/SuddenDeathQuiz\";\r\nimport { useCallback } from \"react\";\r\nimport DiscussionSimulator from \"./variations/DiscussionSimulator\";\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n root: {\r\n position: \"fixed\",\r\n top: 0,\r\n left: 0,\r\n width: \"100%\",\r\n height: \"100%\",\r\n background: theme.palette.background.quiz,\r\n zIndex: 100\r\n },\r\n rootMobile: {\r\n background: theme.palette.background.paper\r\n },\r\n paper: {\r\n position: \"relative\",\r\n height: \"792px\",\r\n maxHeight: \"calc(100% - 16px)\",\r\n width: \"720px\",\r\n maxWidth: \"calc(100% - 16px)\",\r\n borderRadius: \"8px\"\r\n },\r\n link: {\r\n textDecoration: \"none\",\r\n marginTop: theme.spacing(5),\r\n \"& svg\": {\r\n marginBottom: \"-1px\"\r\n },\r\n \"@media (max-height: 1080px)\": {\r\n display: \"none\"\r\n }\r\n }\r\n}));\r\n\r\nexport default function QuizPanel(props) {\r\n const classes = useStyles();\r\n const { parentId, onClose, title } = props;\r\n const { isMobilePortraitView } = useDevice();\r\n const history = useHistory();\r\n const location = useLocation();\r\n\r\n useEffect(() => {\r\n history.replace({\r\n pathname: location.pathname,\r\n search: \"?quiz=true\"\r\n });\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, []);\r\n\r\n const onCloseCallback = useCallback(() => {\r\n history.replace({\r\n pathname: location.pathname,\r\n search: \"\",\r\n removeParameter: \"quiz\"\r\n });\r\n onClose();\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [history]);\r\n\r\n return (\r\n <Portal>\r\n <Fade in>\r\n <Grid container className={`${classes.root} ${isMobilePortraitView ? classes.rootMobile : \"\"}`} justifyContent=\"center\" alignItems=\"center\" direction=\"column\">\r\n {isMobilePortraitView ? (\r\n <Quiz\r\n title={title}\r\n onClose={onCloseCallback}\r\n parentId={parentId}\r\n />\r\n ) : (\r\n <>\r\n <Paper elevation={5} className={classes.paper}>\r\n <Quiz\r\n title={title}\r\n onClose={onCloseCallback}\r\n parentId={parentId}\r\n />\r\n </Paper>\r\n\r\n <a href=\"https://blog.ember.ly/how-to-use-emberly-ai/\" target=\"_blank\" rel=\"noreferrer\" className={classes.link}>\r\n <Typography variant=\"caption\" color=\"textSecondary\">\r\n <InfoIcon fontSize=\"inherit\" /> Learn about AI Quiz\r\n </Typography>\r\n </a>\r\n </>\r\n\r\n )}\r\n </Grid>\r\n </Fade>\r\n </Portal>\r\n );\r\n}\r\n\r\nfunction Quiz(props) {\r\n const { title, onClose, parentId } = props;\r\n const [quizType, setQuizType] = useState(null);\r\n\r\n const onQuit = () => setQuizType(null);\r\n\r\n switch (quizType) {\r\n case \"standard_quiz\":\r\n return (\r\n <StandardQuiz\r\n parentId={parentId}\r\n onQuit={onQuit}\r\n />\r\n );\r\n case \"timed_quiz\":\r\n return (\r\n <TimedQuiz\r\n parentId={parentId}\r\n onQuit={onQuit}\r\n />\r\n );\r\n case \"sudden_death_quiz\":\r\n return (\r\n <SuddenDeathQuiz\r\n parentId={parentId}\r\n onQuit={onQuit}\r\n />\r\n );\r\n\r\n case \"discussion_quiz\":\r\n return (\r\n <DiscussionSimulator\r\n parentId={parentId}\r\n onQuit={onQuit}\r\n />\r\n );\r\n\r\n default:\r\n return (\r\n <QuizSplashScreen\r\n onSelect={(type) => setQuizType(type)}\r\n onClose={onClose}\r\n title={title}\r\n parentId={parentId}\r\n />\r\n );\r\n }\r\n}\r\n\r\n","import { useMemo, useCallback, useEffect, useState } from \"react\";\r\nimport { useDispatch } from \"react-redux\";\r\nimport { AddConfirmDialog } from \"../actions/app\";\r\nimport { useRTACPlan, useRTACProfile, useCount } from \"@emberly/dataplane\";\r\nimport { useUploadedSize } from \"@emberly/dataplane\";\r\nimport { useHistory } from \"react-router\";\r\nimport { GetQuota } from \"../api/client\";\r\n\r\nexport default function usePlan(groupName = null) {\r\n const dispatch = useDispatch();\r\n const history = useHistory();\r\n const { plan, isOwner } = useRTACPlan(groupName);\r\n const { profile } = useRTACProfile();\r\n\r\n //console.log(plan);\r\n\r\n const showLimitReachedDialog = useCallback((title, description, content = null) => {\r\n dispatch(AddConfirmDialog(\r\n title,\r\n description,\r\n isOwner ? \"View plans\" : \"Ok\",\r\n \"primary\",\r\n () => { },\r\n () => {\r\n if (isOwner) {\r\n history.push(\"/app/settings/plans\");\r\n }\r\n },\r\n content\r\n ));\r\n }, [dispatch, history, isOwner]);\r\n\r\n return useMemo(() => {\r\n const loading = !profile || !plan;\r\n return {\r\n loading,\r\n isOwner,\r\n name: loading ? \"\" : plan.name,\r\n type: loading ? 0 : plan.type,\r\n cancelled: loading ? false : profile.subscriptionCancelled,\r\n nextPaymentDue: loading ? new Date() : new Date(profile.nextPaymentDue),\r\n planId: loading ? \"\" : plan.planId,\r\n billingType: loading ? \"\" : plan.billingType,\r\n topicLimit: loading ? 0 : plan.topicLimit,\r\n mapLimit: loading ? 0 : plan.mapLimit,\r\n fileUploadLimit: loading ? 0 : plan.fileUploadLimit,\r\n canCreateFiles: loading ? false : plan.fileUploadLimit > 0,\r\n hasSubscription: loading ? false : !profile.subscriptionCancelled && plan.type !== 0,\r\n canUseCustomColors: loading ? false : plan.type !== 0,\r\n canDisableWatermarks: loading ? false : plan.type !== 0,\r\n showLimitReachedDialog\r\n };\r\n }, [profile, plan, showLimitReachedDialog, isOwner]);\r\n}\r\n\r\nexport function usePlanWithTreeLimits() {\r\n const plan = usePlan();\r\n const { count, loading: treeLoading } = useCount(\"Node\");\r\n\r\n return useMemo(() => {\r\n const loading = plan.loading || treeLoading;\r\n const currentTreeTopics = count;\r\n const currentTreeTopicLimit = loading ? 0 : plan.topicLimit;\r\n\r\n return {\r\n ...plan,\r\n loading,\r\n currentTreeTopics,\r\n currentTreeTopicLimit,\r\n canCreateTopics: currentTreeTopicLimit === null || currentTreeTopicLimit === undefined || currentTreeTopics < currentTreeTopicLimit\r\n };\r\n }, [plan, count, treeLoading]);\r\n}\r\n\r\nconst isOwner = map => map.access === 4;\r\n\r\nexport function usePlanWithMapLimits() {\r\n const plan = usePlan(\"default\");\r\n const { count, loading } = useCount(\"Map\", true, \"default\", isOwner);\r\n\r\n return useMemo(() => {\r\n return {\r\n ...plan,\r\n loading: plan.loading || loading,\r\n canCreateMaps: plan.loading || loading ? false : plan.mapLimit === null || plan.mapLimit === undefined || count < plan.mapLimit,\r\n maps: count\r\n };\r\n }, [plan, loading, count]);\r\n}\r\n\r\nexport function usePlanWithFileLimits() {\r\n const plan = usePlan();\r\n const { uploadedSize, loading, collection } = useUploadedSize();\r\n\r\n const checkIfUploadAllowed = useCallback(async (fileSizes) => { // TODO change to async\r\n if (!!plan && !plan.canCreateFiles) {\r\n\r\n plan.showLimitReachedDialog(\r\n \"Upgrade to upload files\",\r\n plan.isOwner ? \"File uploads is unavailable in the free plan. Subscribe to the Plus or Plus Ultra plan to enable file uploads.\" : \"File uploads is unavailable in the free plan. Tell the owner of the map to upgrade to enable file uploads\"\r\n );\r\n\r\n return false;\r\n } else {\r\n\r\n if (await collection.loadUploadedSize()) {\r\n const size = collection.getUploadedSize();\r\n\r\n if (!!plan && size + fileSizes > plan.fileUploadLimit) {\r\n plan.showLimitReachedDialog(\r\n \"File upload limit reached\",\r\n plan.isOwner ? \"There is not enough space left to upload the selected files.\" : \"There is not enough space left to upload the selected files. Tell the owner of the map to upgrade if you need more space.\"\r\n );\r\n return false;\r\n }\r\n } else {\r\n plan.showLimitReachedDialog(\r\n \"Not able to handle file upload right now.\",\r\n \"Please try again later!\"\r\n );\r\n }\r\n\r\n }\r\n\r\n return true;\r\n }, [plan, collection]);\r\n\r\n return useMemo(() => {\r\n return {\r\n ...plan,\r\n loading,\r\n uploadedSize,\r\n checkIfUploadAllowed\r\n };\r\n }, [plan, uploadedSize, checkIfUploadAllowed, loading]);\r\n}\r\n\r\nexport function useCompletePlan() {\r\n const mapPlan = usePlanWithMapLimits();\r\n const filePlan = usePlanWithFileLimits();\r\n\r\n return useMemo(() => {\r\n return {\r\n ...mapPlan,\r\n ...filePlan\r\n };\r\n }, [mapPlan, filePlan]);\r\n}\r\n\r\nexport function useQuota(method) {\r\n const [used, setUsed] = useState(-1);\r\n const [limit, setLimit] = useState(-1);\r\n const [loading, setLoading] = useState(true);\r\n\r\n useEffect(() => {\r\n GetQuota(method)\r\n .then((quota) => {\r\n setUsed(quota.used);\r\n setLimit(quota.limit);\r\n setLoading(false);\r\n });\r\n }, [method]);\r\n\r\n return { loading, used, limit };\r\n}","import { useMemo, useCallback, useState } from \"react\";\r\nimport { useDispatch } from \"react-redux\";\r\nimport * as SearchActions from \"../actions/search\";\r\nimport * as AppActions from \"../actions/app\";\r\nimport { useChildren, useEntity } from \"@emberly/dataplane\";\r\n\r\nexport default function useResources(nodeId) {\r\n const { children: resources, loading, updateCount, createEntity, collection } = useChildren(\"Resource\", nodeId);\r\n const { beginDeleteResources, beginMoveResources } = useResourceActions(collection);\r\n\r\n // Return data to view\r\n return useMemo(() => {\r\n return {\r\n loading,\r\n resources,\r\n updating: false, // TODO\r\n error: false, // TODO\r\n createUrlResource: (id, url, flush = false) => createEntity({ url, id, incomplete: true }, { flush }),\r\n createFileResource: createEntity,\r\n createResource: createEntity,\r\n beginMoveResources,\r\n beginDeleteResources,\r\n collection,\r\n updateCount\r\n };\r\n }, [collection, loading, updateCount, resources, createEntity, beginMoveResources, beginDeleteResources]);\r\n}\r\n\r\nexport function useResource(resourceId) { // TODO rewrite this one to not care about node changes, should be completely independent.\r\n const { entity: resource, updateCount, loading, collection } = useEntity(\"Resource\", resourceId);\r\n const [fileUrl, setFileUrl] = useState(null);\r\n const { beginDeleteResources, beginMoveResources } = useResourceActions(collection);\r\n\r\n // TODO move this to resource itself.\r\n const loadFileUrl = useCallback(async () => {\r\n try {\r\n if (!!resource && collection) {\r\n setFileUrl(await resource.getFileUrl(collection.sharePrefix));\r\n }\r\n } catch { }\r\n }, [resource, collection]);\r\n\r\n return useMemo(() => {\r\n return {\r\n resource,\r\n updateCount,\r\n loading,\r\n nodeId: !!resource ? resource.parentId : null,\r\n isUploading: !!resource && resource.isUploading(),\r\n loadFileUrl,\r\n fileUrl,\r\n isLink: !!resource && !!resource.url,\r\n isFile: !!resource && !!resource.fileHandle,\r\n beginDeleteResources,\r\n beginMoveResources\r\n };\r\n }, [loading, resource, updateCount, loadFileUrl, fileUrl, beginDeleteResources, beginMoveResources]);\r\n}\r\n\r\nexport function useLoadedResource(resourceId) {\r\n const { entity: resource, updateCount } = useEntity(\"Resource\", resourceId, false);\r\n const { entity: node, updateCount: nodeUpdateCount, collection } = useEntity(\"Node\", resource?.parentId || null, false);\r\n\r\n const getPath = useCallback(() => {\r\n if (!resource) {\r\n return \"\";\r\n } else if (resource.parentId === \"inbox\") {\r\n return \"Inbox\";\r\n } else if (node) {\r\n collection?.updatePath(node);\r\n const path = node?.path || [];\r\n return `${path.join(\" > \")} ${path.length !== 0 ? \">\" : \"\"} ${node?.name || \"\"}`;\r\n } else {\r\n return \"[Topic Deleted]\";\r\n }\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [resource, node, updateCount, nodeUpdateCount, collection]);\r\n\r\n return { resource, updateCount: updateCount + nodeUpdateCount, getPath };\r\n}\r\n\r\nexport function useResourceActions(collection) {\r\n const dispatch = useDispatch();\r\n\r\n const beginMoveResources = useCallback((resources, confirmCallback = null, portalId = null, initialContextId = null) => {\r\n\r\n const isDefault = window.location.pathname.startsWith(\"/app/\");\r\n\r\n dispatch(SearchActions.AddSelect({\r\n title: `Move Resource${resources.length > 1 ? \"s\" : \"\"}`,\r\n description: `Search for the topic to move the resource${resources.length > 1 ? \"s\" : \"\"} to. ${isDefault ? \"\" : \"You can also choose a topic by clicking in the tree.\"}`,\r\n mobileDescription: `Search for the topic you want to move the resource${resources.length > 1 ? \"s\" : \"\"} to`,\r\n includeTopics: true,\r\n includeResources: false,\r\n portalId,\r\n initialContextId: null,\r\n callback: (type, targetNodeId, _, contextId) => {\r\n if (type === \"node\") {\r\n const originContextId = resources[0].contextId;\r\n const destinationContextId = contextId; // TODO next session\r\n\r\n if (originContextId !== destinationContextId) {\r\n // TODO\r\n if (!!contextId) {\r\n //resources.forEach(entity => entity.moveToContext(contextId, targetNodeId, { position: \"end\" }));\r\n collection.moveManyToContext(resources.filter(t => !t._deleted), contextId, targetNodeId, { position: \"end\" });\r\n }\r\n } else {\r\n collection.moveMany(resources.filter(t => !t._deleted), targetNodeId, \"end\");\r\n //resources.forEach(entity => entity.move(targetNodeId, \"end\"));\r\n }\r\n\r\n if (confirmCallback !== null) {\r\n confirmCallback();\r\n }\r\n }\r\n }\r\n }));\r\n\r\n }, [dispatch, collection]);\r\n\r\n\r\n const beginDeleteResources = useCallback((resources, confirmCallback = null) => {\r\n const len = resources.length;\r\n resources.forEach(entity => entity.delete({ historyGroup: \"ui_deleted\" }));\r\n \r\n if (confirmCallback !== null) {\r\n confirmCallback();\r\n }\r\n\r\n dispatch(AppActions.DisplayNotification({\r\n text: `Deleted resource${len > 1 ? \"s\" : \"\"}!`,\r\n actionText: \"UNDO\",\r\n action: () => {\r\n collection.undo(\"ui_deleted\");\r\n dispatch(AppActions.DisplayNotification(`Resource${len > 1 ? \"s\" : \"\"} restored!`));\r\n }\r\n }));\r\n }, [dispatch, collection]);\r\n\r\n\r\n return {\r\n beginDeleteResources,\r\n beginMoveResources\r\n };\r\n}","import { useCallback, useRef } from \"react\";\r\nimport { DragDropContext } from \"react-beautiful-dnd\";\r\nimport { useDispatch, useSelector } from \"react-redux\";\r\nimport { getTree } from \"../actions/tree\";\r\nimport { useRTAC } from \"@emberly/dataplane\";\r\nimport { SetDragActive, DisplayNotification } from \"../actions/app\";\r\n\r\nfunction getIdsFromDroppableId(droppableId) {\r\n const split = droppableId.split(\";\");\r\n return split.length === 3 ? { groupName: split[0], contextId: split[1], parentId: split[2] } : { contextId: null, parentId: null };\r\n}\r\n\r\nexport default function ResourceDragContext(props) {\r\n const { rootContext } = useRTAC();\r\n\r\n const events = useRef({ mouseMove: null, touchMove: null, mouseUp: null, mouseX: -1, mouseY: -1, active: false });\r\n const filterActive = useSelector(state => state.filter.filterActive);\r\n const dispatch = useDispatch();\r\n\r\n const end = useCallback(() => {\r\n const tree = getTree();\r\n\r\n if (events.current.active) {\r\n events.current.active = false;\r\n tree.setDragOverActive(false);\r\n dispatch(SetDragActive(false));\r\n }\r\n\r\n // cleanup events\r\n if (events.current.mouseMove) {\r\n window.removeEventListener(\"mousemove\", events.current.mouseMove);\r\n window.removeEventListener(\"touchmove\", events.current.touchMove);\r\n window.removeEventListener(\"mouseup\", events.current.mouseUp);\r\n window.removeEventListener(\"touchend\", events.current.mouseUp);\r\n events.current.mouseMove = null;\r\n events.current.mouseUp = null;\r\n events.current.touchMove = null;\r\n }\r\n }, [dispatch]);\r\n\r\n\r\n const onDragEnd = useCallback((result) => {\r\n end();\r\n const { destination, source, draggableId } = result;\r\n\r\n const { groupName } = getIdsFromDroppableId(source.droppableId);\r\n const collection = rootContext.getGroupContextOrDefault(groupName)?.getCollection(\"Resource\");\r\n const resource = collection?.getEntityById(draggableId);\r\n\r\n if (!!resource && !resource._deleted && !!destination) {\r\n if (filterActive) {\r\n dispatch(DisplayNotification(\"Re-ordering is disabled while a filter is active!\"));\r\n return;\r\n }\r\n\r\n if (source.droppableId === destination.droppableId) {\r\n // sort\r\n\r\n if (destination.index !== source.index) {\r\n const siblings = collection.getSiblings(draggableId).reverse().filter(t => !t.archived);\r\n if (destination.index === 0) {\r\n resource.placeBetween(siblings[0], null);\r\n } else if (destination.index >= siblings.length - 1) {\r\n resource.placeBetween(null, siblings[siblings.length - 1]);\r\n } else if (destination.index > source.index) {\r\n resource.placeBetween(siblings[destination.index + 1], siblings[destination.index]);\r\n } else {\r\n resource.placeBetween(siblings[destination.index], siblings[destination.index - 1]);\r\n }\r\n }\r\n } else if (source.droppableId !== destination.droppableId) {\r\n // move between contexts and parents. ensure tree does not grab this later down.\r\n const { contextId: toContextId, parentId: toParentId, groupName: toGroupName } = getIdsFromDroppableId(destination.droppableId);\r\n const toCollection = rootContext.getGroupContextOrDefault(toGroupName)?.getCollection(\"Resource\");\r\n const siblings = toCollection.getChildren(toParentId).reverse().filter(t => !t.archived);\r\n\r\n if (destination.index === 0) {\r\n //resource.moveToContext(toContextId, toParentId, { prevSibling: siblings[0], nextSibling: null });\r\n collection.moveManyToContext([resource], toContextId, toParentId, { prevSibling: siblings[0], nextSibling: null });\r\n } else if (destination.index === siblings.length) {\r\n //resource.moveToContext(toContextId, toParentId, { prevSibling: null, nextSibling: siblings[siblings.length - 1] });\r\n collection.moveManyToContext([resource], toContextId, toParentId, { prevSibling: null, nextSibling: siblings[siblings.length - 1] });\r\n } else {\r\n //resource.moveToContext(toContextId, toParentId, { prevSibling: siblings[destination.index], nextSibling: siblings[destination.index - 1] });\r\n collection.moveManyToContext([resource], toContextId, toParentId, { prevSibling: siblings[destination.index], nextSibling: siblings[destination.index - 1] });\r\n }\r\n }\r\n }\r\n }, [dispatch, end, filterActive, rootContext]);\r\n\r\n const onDragUpdate = useCallback((update) => {\r\n const outside = !update.destination;\r\n const { groupName } = getIdsFromDroppableId(update.source.droppableId);\r\n const collection = rootContext.getGroupContextOrDefault(groupName)?.getCollection(\"Resource\");\r\n const resource = collection?.getEntityById(update.draggableId);\r\n\r\n const tree = getTree();\r\n\r\n if (outside && !!tree) {\r\n window.removeEventListener(\"mousemove\", events.current.mouseMove);\r\n window.removeEventListener(\"touchmove\", events.current.touchMove);\r\n window.removeEventListener(\"mouseup\", events.current.mouseUp);\r\n window.removeEventListener(\"touchend\", events.current.mouseUp);\r\n\r\n events.current.mouseMove = (ev) => {\r\n if (ev.target && ev.target.nodeName === \"CANVAS\") {\r\n if (!events.current.active) {\r\n dispatch(SetDragActive(true));\r\n events.current.active = true;\r\n }\r\n\r\n tree.setDragOverActive(true);\r\n tree.onDragOver(ev.clientX, ev.clientY);\r\n events.current.mouseX = ev.clientX;\r\n events.current.mouseY = ev.clientY;\r\n\r\n } else {\r\n if (events.current.active) {\r\n dispatch(SetDragActive(false));\r\n }\r\n\r\n events.current.active = false;\r\n tree.setDragOverActive(false);\r\n }\r\n };\r\n\r\n events.current.touchMove = (ev) => {\r\n if (!events.current.active) {\r\n dispatch(SetDragActive(true));\r\n events.current.active = true;\r\n }\r\n\r\n const touch = ev.touches[0];\r\n events.current.mouseX = touch.clientX;\r\n events.current.mouseY = touch.clientY;\r\n\r\n tree.setDragOverActive(true);\r\n tree.onDragOver(touch.clientX, touch.clientY);\r\n };\r\n\r\n events.current.mouseUp = () => {\r\n\r\n if (events.current.active) {\r\n end();\r\n \r\n if (!resource || resource._deleted) return;\r\n\r\n const coords = tree.viewport.toWorld(events.current.mouseX, events.current.mouseY);\r\n const node = tree.findNode(coords.x, coords.y);\r\n\r\n if (!!node && !node.isRoot && node.depth >= 1 && node.id !== resource.parentId) {\r\n\r\n const element = document.getElementById(\"draggable-clone\");\r\n\r\n if (!!element) {\r\n element.style.visibility = \"hidden\";\r\n }\r\n\r\n const list = document.getElementsByClassName(\"draggable-resource\");\r\n\r\n for (let e of list) {\r\n e.style.transform = \"none\";\r\n }\r\n \r\n if (tree.contextId !== resource.contextId) {\r\n collection.moveManyToContext([resource], tree.contextId, node.id, { position: \"end\" });\r\n } else {\r\n collection.moveMany([resource], node.id, \"end\");\r\n }\r\n }\r\n }\r\n }\r\n\r\n window.addEventListener(\"mousemove\", events.current.mouseMove);\r\n window.addEventListener(\"touchmove\", events.current.touchMove);\r\n window.addEventListener(\"mouseup\", events.current.mouseUp);\r\n window.addEventListener(\"touchend\", events.current.mouseUp);\r\n } else if (events.current.active) {\r\n end();\r\n }\r\n\r\n }, [dispatch, end, rootContext]);\r\n\r\n const onDragStart = useCallback(() => {\r\n if (window.navigator.vibrate) {\r\n window.navigator.vibrate(100);\r\n }\r\n },[]);\r\n\r\n return (\r\n <DragDropContext onDragEnd={onDragEnd} onDragUpdate={onDragUpdate} onDragStart={onDragStart}>\r\n {props.children}\r\n </DragDropContext>\r\n );\r\n}\r\n\r\n","import * as SearchActions from \"../../../actions/search\";\r\nimport { getRootUrl } from \"../../../hooks/useApp\";\r\n\r\nexport default class Reference {\r\n\r\n static get isInline() {\r\n return true;\r\n }\r\n\r\n get state() {\r\n return this._state;\r\n }\r\n\r\n set state(state) {\r\n this._state = state;\r\n this.button.classList.toggle(this.api.styles.inlineToolButtonActive, state);\r\n }\r\n\r\n get shortcut() {\r\n return \"CMD+SHIFT+K\";\r\n }\r\n\r\n constructor({ api, config }) {\r\n this.api = api;\r\n this.button = null;\r\n this._state = false;\r\n this.tag = \"A\";\r\n this.class = \"cdx-marker\";\r\n this.dispatch = config.dispatch;\r\n this.title = \"Internal Link\";\r\n this.hasSelection = false;\r\n }\r\n\r\n render() {\r\n this.button = document.createElement(\"button\");\r\n this.button.type = \"button\";\r\n this.button.innerHTML = `<svg width=\"16\" height=\"16\" style=\"fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;\"><path d=\"M6.165,7.579c-0.495,0.268 -1.063,0.421 -1.665,0.421c-1.932,0 -3.5,-1.568 -3.5,-3.5c0,-1.932 1.568,-3.5 3.5,-3.5c1.932,0 3.5,1.568 3.5,3.5c0,0.602 -0.153,1.17 -0.421,1.665l2.256,2.256c0.495,-0.268 1.063,-0.421 1.665,-0.421c1.932,0 3.5,1.568 3.5,3.5c0,1.932 -1.568,3.5 -3.5,3.5c-1.932,0 -3.5,-1.568 -3.5,-3.5c0,-0.602 0.153,-1.17 0.421,-1.665l-2.256,-2.256Zm-1.665,-4.579c0.828,-0 1.5,0.672 1.5,1.5c0,0.828 -0.672,1.5 -1.5,1.5c-0.828,-0 -1.5,-0.672 -1.5,-1.5c0,-0.828 0.672,-1.5 1.5,-1.5Z\"/></svg>`;\r\n this.button.classList.add(this.api.styles.inlineToolButton);\r\n return this.button;\r\n }\r\n\r\n surround(range) {\r\n if (!range) return;\r\n \r\n const tag = this.api.selection.findParentTag(this.tag);\r\n this.api.tooltip.hide();\r\n\r\n window.getSelection().removeAllRanges();\r\n \r\n this.dispatch(SearchActions.AddSelect(\r\n {\r\n title: \"Choose link\",\r\n description: \"Search for the topic or resource you want to link to. You can also choose a topic by clicking in the tree.\",\r\n mobileDescription: \"Search for the topic or resource you want to link to.\",\r\n prefill: range.toString().trim(),\r\n includeTopics: true,\r\n includeResources: true,\r\n portalId: null,\r\n initialContextId: null,\r\n allowContextSwitching: false,\r\n callback: (type, nodeId, resourceId) => {\r\n if (type === \"node\") {\r\n this.wrap(range, `${getRootUrl()}/node/${nodeId}`, tag);\r\n } else if (type === \"resource\") {\r\n this.wrap(range, `${getRootUrl()}/resource/${resourceId}`, tag);\r\n }\r\n }\r\n }\r\n ));\r\n }\r\n\r\n wrap(range, link, tag) {\r\n if (!!tag) {\r\n tag.href = link;\r\n this.api.selection.expandToTag(tag);\r\n this.api.blocks.mutatedElement(tag);\r\n } else {\r\n const selectedText = range.extractContents();\r\n const mark = document.createElement(this.tag);\r\n mark.href = link;\r\n mark.appendChild(selectedText);\r\n range.insertNode(mark);\r\n this.api.blocks.mutatedElement(mark);\r\n }\r\n }\r\n\r\n checkState() {\r\n this.hasSelection = window.getSelection().type === \"Range\";\r\n this.state = !!this.api.selection.findParentTag(this.tag) && this.hasSelection;\r\n this.button.disabled = !this.hasSelection;\r\n\r\n if (this.hasSelection) {\r\n this.button.classList.remove(\"reference-disabled\");\r\n } else {\r\n this.button.classList.add(\"reference-disabled\");\r\n }\r\n }\r\n}\r\n"],"names":["SetFilter","sortBy","minRating","resourceType","archived","tags","type","ActionTypes","payload","SetSearchQuery","query","AddSelect","title","description","mobileDescription","prefill","includeTopics","allowContextSwitching","includeResources","callback","portalId","initialContextId","arguments","length","undefined","CancelSelect","FinishSelect","nodeId","resourceId","SetInboundLinksPanel","open","async","InitChangeProfileEmail","email","Retry","axios","data","FinalizeChangeProfileEmail","code","DeleteProfile","GetQuota","method","isEmberly","_window$location","window","location","host","Set","TrackGoal","goalId","fathom","trackGoal","console","log","ImageUtility","IsImage","target","ext","name","substr","lastIndexOf","toLowerCase","trim","GenerateFilePreviewAsync","file","width","Promise","resolve","GeneratePreviewCallback","e","GeneratePreviewFromCanvasAsync","elem","filename","resolutionX","resolutionY","s","background","GeneratePreviewFromCanvasCallback","fileName","copyCanvas","document","createElement","height","copyCtx","getContext","fillStyle","fillRect","eWidth","eHeight","cWidth","cHeight","eRatio","w","h","drawImage","canvas","toBlob","blob","result","File","lastModified","Date","now","targetWidth","img","Image","onload","ctx","renderW","renderH","finalW","Math","min","finalH","src","URL","createObjectURL","CreateImage","url","reject","image","addEventListener","error","setAttribute","GetRadianAngle","degreeValue","PI","GetCroppedImage","imageSrc","pixelCrop","rotation","maxWidth","maxSize","max","maxSizeScaled","ratio","safeArea","sqrt","translate","rotate","getImageData","putImageData","x","y","resizedCanvas","toDataURL","useStyles","makeStyles","theme","root","position","palette","paper","display","overflow","border","borderBottom","divider","buttonLeft","left","spacing","buttonRight","right","minWidth","headerItem","textAlign","header","whiteSpace","textOverflow","fontWeight","userSelect","iconButton","zIndex","borderRadius","embed","paddingRight","menuButton","paddingTop","paddingBottom","anchorOrigin","vertical","horizontal","transformOrigin","LeftButton","props","classes","onBack","onClose","onExpandLess","onExpandMore","isMobilePortraitView","_jsx","IconButton","className","onClick","size","children","BackIcon","fontSize","CloseIcon","ExpandLessIcon","ExpandMoreIcon","RightButton","onConfirm","onMenu","onMenuButton","menuItems","anchorEl","setAnchorEl","useState","Boolean","canEdit","useCanEdit","CheckIcon","handleClick","ev","currentTarget","handleClose","onItemClick","menuItem","_jsxs","_Fragment","MoreVertIcon","Menu","keepMounted","map","idx","Divider","MenuItem","value","icon","ListItemIcon","ListItemText","text","Button","CardHeader","isEmbed","useDevice","useMemo","Box","alignItems","justifyContent","Typography","align","variant","card","cursor","boxSizing","borderTopLeftRadius","borderTopRightRadius","objectFit","transition","verticalAlign","action","hover","content","pointerEvents","transform","cardText","padding","disabledCard","filter","emptyAlert","marginTop","DynamicCard","delay","disabled","Fade","in","timeout","enter","Grid","item","xs","sm","md","alt","container","direction","color","paperMobile","top","grow","dialog","maxHeight","modifiers","options","offset","DynamicPanel","forceDialog","useLocation","viewRef","useRef","anchorRef","current","useEffect","pathname","onPanelClickAway","useCallback","body","aabb","getBoundingClientRect","bottom","panelOpen","panelId","paperClasses","Portal","Paper","Dialog","Popper","id","placement","Grow","elevation","ref","ClickAwayListener","onClickAway","FuzzyText","fuzzysort","elements","element","matchesIndex","opened","indexes","targetLen","matchesBest","key","i","char","push","Fragment","substring","paddingLeft","common","tag","lineHeight","rootRating","label","secondary","Tag","rating","Chip","Array","fill","val","StarIcon","normalStyle","WildcardText","queryFragments","split","matches","t","lower","fragment","find","f","indexOf","style","userDrag","WebkitUserDrag","MozUserSelect","MozUserDrag","selected","selectedResource","imageItem","skeleton","imageLoaded","opacity","rightContainer","wordBreak","wordWrap","link","primary","textDecoration","backgroundColor","grey","linkOnQuery","linkIcon","marginBottom","marginLeft","externalLink","main","path","marginRight","progress","contentVisibility","containIntrinsicSize","noteBlockContainer","lowered","noteBlock","preventDefault","ResourcePreviewItem","showPath","selectManyActive","onSelect","allowPan","noteBlocks","groupUrl","useGroupUrl","imgLoaded","setImgLoaded","imgError","setImgError","resource","updateCount","getPath","useLoadedResource","parentId","tagItems","isWorking","renderedNoteBlocks","_","block","ReactEditorBlock","Link","to","contextId","hash","onDragStart","TimedRemover","Skeleton","getImageUrl","onLoad","onImageLoad","onError","onImageError","decoding","loading","incomplete","openUrl","cleanSource","OpenInNewIcon","LinearProgress","hasProgress","getProgress","DelayedLinearProgress","visible","setVisible","timer","setTimeout","clearTimeout","Collapse","borderColor","rootActive","buttonContainer","margin","button","upgradeButton","formHidden","inputHidden","previewImage","imageOrientation","fileNameContainer","cancelButton","hardIcon","FileUpload","onChange","existingFileSize","setFile","imgSrc","setImgSrc","isImage","setIsImage","hasFile","plan","usePlanWithFileLimits","history","useHistory","onSelectFile","files","checkIfUploadAllowed","reader","FileReader","readAsDataURL","onloadend","onCancel","onUpgrade","canCreateFiles","stopPropagation","CancelIcon","accept","multiple","UploadIcon","switchRoot","boxShadow","transitions","create","duration","StandardToggle","checked","onChecked","internalClasses","Switch","chip","input","warning","MAX_LEN","maxLength","TagSelector","onAddTag","onRemoveTag","autoFocus","inputRef","inputId","setText","handleSetText","handleSubmit","inputText","handleBackspace","keyCode","renderTags","onDelete","inputClasses","focus","SharedInputBase","inputProps","placeholder","onSubmit","onKeyDown","fullWidth","InputBase","onKeyPress","grid","menu","filterActive","ResourcesControllerDesktop","selectedResources","setSelectManyActive","useSelector","state","createResource","getRootUrl","openFilters","openSelectMany","closeSelectMany","menuClasses","Zoom","Tooltip","enterDelay","startIcon","AddIcon","CheckBoxIcon","FilterListIcon","paperCard","inverseShadows","activeCard","fab","softIcon","leftButton","float","rightButton","selectedText","fabIcon","ResourcesControllerMobile","active","Fab","textItem","noInteract","DroppablePanel","textItemTopMargin","textItemBottomMargin","ResourcesEmptyPanel","isEmpty","isFiltered","showTopBar","touchAction","minHeight","borderWidth","clone","ResourceList","swipeEnabled","toggleSelectedResource","resources","createUrlResource","createFileResource","useResources","isEmbedView","filterTags","filterMinRating","filterResourceType","filterSortBy","filterArchived","dragOver","setDragOver","loadingDelay","setLoadingDelay","wasEmpty","setWasEmpty","currentContextId","useContextId","droppableId","useGroupName","canDrag","filteredResources","reduce","total","includes","sort","a","b","reverse","resourceItems","list","Draggable","draggableId","index","isDragDisabled","provided","snapshot","innerRef","draggableProps","dragHandleProps","findIndex","isDragging","renderClone","rubric","onDragEnter","_ev$dataTransfer","_ev$dataTransfer$type","dataTransfer","types","err","onDragLeave","_ev$dataTransfer2","_ev$dataTransfer2$typ","onDragOver","onDrop","getData","startsWith","items","kind","getAsFile","fileSizes","sum","fileSize","fileType","pending","Task","onPaste","paste","clipboardData","Scrollbar","scrollStateId","Droppable","droppableProps","rootMobile","ControlledResourcesList","controllerEnabled","elevatedController","setSelectedResources","beginDeleteResources","beginMoveResources","operation","search","r","join","forEach","setArchived","Error","_deleted","ConditionalPortal","glass","neutral","iconButtonActive","menuIcon","shortcutText","table","shortcuts","cmd","memo","shortcutsOpen","setShortcutsOpen","handleShortcutsClose","openKeyboardShortcuts","HelpIcon","MenuList","href","rel","HelpCenterIcon","InsertCommentIcon","DialogTitle","DialogContent","Table","TableBody","entry","TableRow","TableCell","DialogActions","InboxView","mHistory","createMemoryHistory","InboxPanel","initialRoute","setInitialRoute","scopedHistory","GroupContextProvider","Router","Route","exact","ResourceCreateView","component","FilterView","ResourceMultiTagsView","ResourceTagsView","ResourceEditView","ResourceView","Redirect","ConditionalPortalView","iconButtonRounded","badge","activeIcon","InboxController","slimMode","rounded","useChildren","isPublicAccess","buttonRef","onInboxPanelClick","onInboxPanelClose","params","URLSearchParams","has","inboxRoute","get","newParams","entries","replaceState","replaceWithoutParams","Badge","overlap","invisible","every","InboxIcon","quoteContainer","quote","spinnerContainer","spinner","Quotes","FadeDuration","exit","CreateMapLoadingScreen","quoteIndex","setQuoteIndex","floor","random","showQuote","setShowQuote","setInterval","clearInterval","CircularProgress","scrollbar","scrollbarMobile","buttonGrid","typography","body1","charCounter","collapse","loadingContainer","CreateMapPanel","createEntity","templateMode","setTemplateMode","setLoading","dispatch","useDispatch","collection","useCollection","navigateOnCompleteRef","mountedRef","handleCreateMap","metadata","templateQuery","then","entity","commit","publicUserId","catch","DisplayNotification","charsRemaining","Show","FilledInput","disableUnderline","autoComplete","multiline","hiddenLabel","ratingIcon","flag","heart","SkillLevel","node","RatingIcon","FlagIcon","FavoriteIcon","flexWrap","nameItem","overflowWrap","startIconContainer","NodeSearchResult","_node$path","useEntity","renderName","onHandleClick","updatePath","tagsContainer","subHeaderItemTop","subHeaderItemBottom","borderTop","subHeader","emptyStateItem","nodeIcon","spacer","branchColorIcon","QuickSearchPanel","onNodeSelected","useTags","entities","nodeIndex","useEverything","focusedItems","isRoot","slice","getLearningState","FavoriteOutlinedIcon","lastUpdatedItems","lastModifiedBy","n","HistoryIcon","scrollBar","useSearch","maxResults","groupName","includeNoteBlocks","resourceCollection","noteCollection","nodeCacheIndex","setNodeCacheIndex","resourcesCacheIndex","setResourcesCacheIndex","noteBlockCacheIndex","setNoteBlockCacheIndex","Map","working","setWorking","mounted","fn","subQuery","extractSubQuery","noteMap","includeIds","refs","getEntityById","getParentResourceId","set","isParentResource","limitedNodes","nodeMatches","fuzzyMatches","limit","treshold","obj","textMatches","limitNodeMatches","resourceMatches","skillResults","resourceResults","noteBlockResults","limitedResources","tagSet","tagMatches","_r$tags","some","resMatches","_r$tags2","keys","results","concat","limitResourceMatches","subQueryInvariant","tagResults","tagsSorted","invariant","tagInvariant","select","menuItemText","menuItemTextSelected","MinimalContextSelector","minAccess","initialValue","setSelect","sortedEntities","access","lastOpened","currentMap","showLoader","favorite","onInternalChangeSelect","Select","IconComponent","ExpandIcon","descriptionItem","searchInput","body2","searchInputEmbedView","searchInputLandscapeView","contextSwitcherItem","headerDivider","inputItem","contentItem","flexDirection","tabs","moreButton","dark","letterSpacing","resultCount","filterGrid","filterGridItem","filterGridItemRight","iconButtonEnd","searchInputIcon","searchResultContainer","searchResultItem","searchIcon","starIcon","fadeDuration","SearchPanel","autofocus","onResourceSelected","isGlobal","currentGroupName","setGroupName","isIos","searchViewTabIndex","contextCardState","cardState","app","globalQuery","setQuery","tabIndex","setTabIndex","timerRef","isDefault","userId","ctxId","handleSearch","SearchActions","AppActions","nodeItems","_results$noteBlockRes","SearchIcon","_results$noteBlockRes2","handleCancel","handleChange","handleTabIndex","endAdornment","startAdornment","SearchResultPreviewPanel","skillResultsCount","resourceResultsCount","Tabs","centered","Tab","SearchResultPanel","count","SearchFilterPanel","onSortByChanged","FilterActions","onMinRatingChanged","ButtonBase","NodeSearchResultMinimal","leftContainer","ResourcePreviewItemMinimal","span","success","subHeaderItemPrimary","subHeaderItemSecondary","preview","borderBottomLeftRadius","borderBottomRightRadius","paragraph","InboundLinksDialog","noteId","useReferencingEntities","nodeBlocks","isParentNode","resourceBlocks","resourceIds","useEntities","nodeIds","nodes","nodeLinks","isParentResourceId","resourceLinks","InboundNodeLink","InboundResourceLink","onNavigate","SetNodeViewTabIndex","LinkIcon","SearchDialog","selectHandles","handleRef","selectHandle","UniversalConfirmDialog","handles","confirmDialogHandles","handle","handleConfirm","ConfirmDialog","confirmText","confirmColor","overflowY","gridItem","overflowX","stepper","flexGrow","screenHeader","nextButton","imageGrid","imageGridMarginBottom","imageContainer","embedContainer","consentCheckbox","OnboardingPage","activeStep","setActiveStep","onNext","step","MobileStepper","steps","screenSwitch","IntroScreen","ReadyScreen","onCompleted","consent","setConsent","onSetConsent","provider","useRTACProfile","finishOnboarding","updateProfile","getAffiliateId","ShowOnboarding","frameBorder","allow","allowFullScreen","FormControlLabel","control","Checkbox","labelPlacement","chipActive","light","detail","applyButtonContainer","applyButton","applyButtonRight","borderLeft","toggleGroup","toggleButton","flex","star","setSortBy","setMinRating","setResourceType","selectedTags","setSelectedTags","isSearchView","endsWith","goBack","replace","handleApply","handleClear","handleSortBy","handleMinRating","handleResourceType","handleArchived","toggleTag","onMenuButtons","ToggleButtonGroup","exclusive","ToggleButton","view","viewItem","CreateOfflineResourcePanel","match","useRouteMatch","setName","source","setSource","setDescription","addOfflineResource","createEntityId","flush","onFileChange","offlineEnabled","TextField","maxRows","textField","CreateOnlineResourcePanel","setLink","helper","setHelper","onSetLink","parsedUrl","parsedLink","searchParams","addOnlineResource","test","validateUrl","onlineEnabled","helperText","contentContainer","onSetTabIndex","indicatorColor","textFieldItem","buttonItem","useResource","linkError","setLinkError","handleLink","handleName","handleSource","handleDescription","syncName","syncDescription","syncSource","syncUrl","setImageUrl","sync","setUrl","setIncomplete","isLink","SharedTextField","onBlur","handleUpload","uploadFile","chipItem","isMobile","idSet","getAll","addTag","tagList","setTags","removeTag","activeTags","tagCounts","renderCommonTags","templates","ResourceNotesPanel","onFocused","fullscreenEnabled","backlinks","pHistory","notesFullscreen","isMobilePortrait","SetNotesFullscreen","plugins","reference","class","Reference","config","shortcut","onFullscreen","removeParameter","onViewBacklinks","patchedHistory","_ref","CompactNotesEditor","scrollAreaDisabled","readonly","fullscreen","linkFab","textContent","textContentBody","resourceName","ratingContainer","waybackLink","waybackLinkIcon","tagButton","commentContainer","notFoundHeader","fileUrl","loadFileUrl","isFile","notesActive","setNotesActive","inboundLinksPanelOpen","quizOpen","setQuizOpen","handleQuizClose","rootUrl","useRootUrl","setRating","clearRating","handleMenu","isInInbox","onExternalLink","waybackUrl","Rating","QuizPanel","ResourceSkeleton","animation","animationDelay","WritingAnimation","npcBubble","npcChatBubble","playerBubble","playerChatBubble","avatar","ChatBubble","isNpc","writing","ChatInput","dataRef","trySubmit","SendIcon","cardContainer","actionText","upgradeText","QuizSplashScreen","quota","useQuota","notes","notesLoading","remaining","used","dialogEnabled","openUpgradeDialog","AddConfirmDialog","Alert","severity","correct","wrong","QuizAnswer","questionText","multipleChoiceInfo","info","QuizQuestion","question","answers","onScore","next","questionIndex","isFinalQuestion","components","setState","showAnswers","setShowAnswers","wrongAnswer","correctChoices","correctAnswers","answer","acc","allSelected","InfoIcon","endIcon","ArrowForwardIcon","topAligned","bottomAligned","QuizNavigation","onSkip","onQuit","checkIcon","QuizLoadingScreen","completed","CheckCircleIcon","SCORE_100","SCORE_75","SCORE_50","SCORE_LOW","ANIMATION_TIME_MS","progressContainer","progressBackground","progressText","resultText","motivationText","finishQuizButton","QuizScoreScreen","_rootRef$current","_rootRef$current2","onPlayAgain","onFinish","totalQuestions","finalScore","score","setScore","renderScore","setRenderScore","confettiActive","setConfettiActive","rootRef","stepTime","ceil","tempScore","Confetti","recycle","offsetWidth","offsetHeight","StandardQuiz","quizHeaderComponents","controller","group","useGroup","quizReady","setQuizReady","questions","setQuestions","setQuestionIndex","loadingRef","setError","finished","emit","onNextQuestion","onEndQuiz","q","send","parentIds","res","_res$quiz","_res$quiz$questions","quiz","ctrlRefs","end","on","QuizController","EventEmitter","this","TimedQuiz","controllerRef","clock","setClock","correctAnswer","setCorrectAnswer","crl","clk","runTimer","removeAllListeners","SuddenDeathQuiz","npcImage","npcPhrase","infoText","playAgainButton","ChatPanel","npc","conversation","thinking","win","defeat","roundsLeft","endPhrase","panelRef","showThinking","setShowThinking","parentElement","scroll","behavior","phrase","message","headerContainer","NPCS","defeatPhrases","winPhrases","DiscussionSimulator","backgroundData","setBackgroundData","setRoundsLeft","setThinking","setConversation","setWin","setDefeat","setEndPhrase","personality","l","onCloseCallback","Quiz","quizType","setQuizType","usePlan","isOwner","useRTACPlan","profile","showLimitReachedDialog","cancelled","subscriptionCancelled","nextPaymentDue","planId","billingType","topicLimit","mapLimit","fileUploadLimit","hasSubscription","canUseCustomColors","canDisableWatermarks","usePlanWithTreeLimits","treeLoading","useCount","currentTreeTopics","currentTreeTopicLimit","canCreateTopics","usePlanWithMapLimits","canCreateMaps","maps","uploadedSize","useUploadedSize","loadUploadedSize","getUploadedSize","useCompletePlan","mapPlan","filePlan","setUsed","setLimit","useResourceActions","updating","setFileUrl","getFileUrl","sharePrefix","isUploading","fileHandle","nodeUpdateCount","confirmCallback","targetNodeId","moveManyToContext","moveMany","len","delete","historyGroup","undo","getIdsFromDroppableId","ResourceDragContext","rootContext","useRTAC","events","mouseMove","touchMove","mouseUp","mouseX","mouseY","tree","getTree","setDragOverActive","SetDragActive","removeEventListener","onDragEnd","_rootContext$getGroup","destination","getGroupContextOrDefault","getCollection","siblings","getSiblings","placeBetween","_rootContext$getGroup2","toContextId","toParentId","toGroupName","getChildren","prevSibling","nextSibling","onDragUpdate","update","_rootContext$getGroup3","outside","nodeName","clientX","clientY","touch","touches","coords","viewport","toWorld","findNode","depth","getElementById","visibility","getElementsByClassName","navigator","vibrate","DragDropContext","isInline","_state","classList","toggle","api","styles","inlineToolButtonActive","constructor","hasSelection","render","innerHTML","add","inlineToolButton","surround","range","selection","findParentTag","tooltip","hide","getSelection","removeAllRanges","toString","wrap","expandToTag","blocks","mutatedElement","extractContents","mark","appendChild","insertNode","checkState","remove"],"sourceRoot":""}