{"version":3,"file":"FoldersMenu-f9Pjrhqf.js","sources":["../../../node_modules/@mui/icons-material/esm/AddCircle.js","../../../node_modules/@mui/icons-material/esm/EventAvailable.js","../../../node_modules/@mui/icons-material/esm/IntegrationInstructions.js","../../../node_modules/@mui/icons-material/esm/QuestionAnswer.js","../../../node_modules/@mui/icons-material/esm/WorkspacePremium.js","../../../frontend/src/Utils/permissions.ts","../../../frontend/src/Components/DesignSystem/ItemCreationCard/ItemAvatar.tsx","../../../frontend/src/Components/DesignSystem/ItemCreationCard/ItemCreationCard.tsx","../../../frontend/src/Components/DesignSystem/PostCreationCard/PostCreationCard.tsx","../../../frontend/src/Components/Posts/MenuCreatePost/PostsCreateMenu.tsx","../../../frontend/src/Components/Posts/MenuCreatePost/ConsultationsMenu.tsx","../../../frontend/src/Components/Posts/MenuCreatePost/CommunicationsMenu.tsx","../../../frontend/src/Components/Posts/MenuCreatePost/FoldersMenu.tsx"],"sourcesContent":["\"use client\";\n\nimport createSvgIcon from \"./utils/createSvgIcon.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m5 11h-4v4h-2v-4H7v-2h4V7h2v4h4z\"\n}), 'AddCircle');","\"use client\";\n\nimport createSvgIcon from \"./utils/createSvgIcon.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"M16.53 11.06 15.47 10l-4.88 4.88-2.12-2.12-1.06 1.06L10.59 17zM19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 16H5V8h14z\"\n}), 'EventAvailable');","\"use client\";\n\nimport createSvgIcon from \"./utils/createSvgIcon.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"M19 3h-4.18C14.4 1.84 13.3 1 12 1s-2.4.84-2.82 2H5c-.14 0-.27.01-.4.04-.39.08-.74.28-1.01.55-.18.18-.33.4-.43.64-.1.23-.16.49-.16.77v14c0 .27.06.54.16.78s.25.45.43.64c.27.27.62.47 1.01.55.13.02.26.03.4.03h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-8 11.17-1.41 1.42L6 12l3.59-3.59L11 9.83 8.83 12zm1-9.92c-.41 0-.75-.34-.75-.75s.34-.75.75-.75.75.34.75.75-.34.75-.75.75m2.41 11.34L13 14.17 15.17 12 13 9.83l1.41-1.42L18 12z\"\n}), 'IntegrationInstructions');","\"use client\";\n\nimport createSvgIcon from \"./utils/createSvgIcon.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"M21 6h-2v9H6v2c0 .55.45 1 1 1h11l4 4V7c0-.55-.45-1-1-1m-4 6V3c0-.55-.45-1-1-1H3c-.55 0-1 .45-1 1v14l4-4h10c.55 0 1-.45 1-1\"\n}), 'QuestionAnswer');","\"use client\";\n\nimport createSvgIcon from \"./utils/createSvgIcon.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"M9.68 13.69 12 11.93l2.31 1.76-.88-2.85L15.75 9h-2.84L12 6.19 11.09 9H8.25l2.31 1.84zM20 10c0-4.42-3.58-8-8-8s-8 3.58-8 8c0 2.03.76 3.87 2 5.28V23l6-2 6 2v-7.72c1.24-1.41 2-3.25 2-5.28m-8-6c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6 2.69-6 6-6\"\n}), 'WorkspacePremium');","import { get } from 'lodash';\n\nexport const canCreate = (postType: any, space: any) => {\n return get(space, `permissions.can_create_${postType}`);\n};\n","import React from 'react';\nimport { Avatar, ListItemAvatar } from '@mui/material';\nimport { useTheme } from '@mui/system';\nimport { lighten } from '@mui/material/styles';\n\ninterface ItemAvatarProps {\n icon: React.ElementType;\n compact?: boolean;\n}\n\nfunction ItemAvatar({ icon: Icon, compact }: ItemAvatarProps) {\n const theme = useTheme();\n const size = compact ? 40 : 48;\n\n return (\n \n \n \n \n \n );\n}\n\nexport default ItemAvatar;\n","import React from 'react';\nimport { Box, Card, ListItemButton, ListItemText } from '@mui/material';\nimport { useTheme } from '@mui/system';\nimport { Link } from 'react-router-dom';\nimport { useIntl } from 'react-intl';\nimport { lighten } from '@mui/material/styles';\n\nimport Chip from '../Chip';\nimport ItemAvatar from './ItemAvatar';\n\ninterface ItemCreationCardProps {\n icon: React.ElementType;\n titleId: string;\n descriptionId?: string;\n steps?: number;\n to?: string;\n onClick?: () => void;\n}\n\nfunction PostCreationCard({\n icon: Icon,\n titleId,\n descriptionId,\n steps,\n to,\n onClick,\n}: ItemCreationCardProps) {\n const theme = useTheme();\n const intl = useIntl();\n\n return (\n \n \n \n\n \n\n {steps && (\n \n \n \n )}\n \n \n );\n}\n\nexport default PostCreationCard;\n","import React from 'react';\nimport qs from 'qs';\nimport {\n AccountBalance,\n QuestionAnswer,\n WorkspacePremium,\n Help,\n IntegrationInstructions,\n Folder,\n HistoryEdu,\n EventAvailable,\n} from '@mui/icons-material';\n\nimport ItemCreationCard from '../ItemCreationCard';\nimport { PostTypes } from '../../../Utils/Types';\nimport { PostTypeOrSurvey } from '../../../Utils/Types/Posts';\nimport { Space } from '../../../Utils/Types/Space';\n\ninterface PostCreationCardProps {\n space: Space;\n type: PostTypeOrSurvey;\n parentId?: string | number | null;\n}\n\nfunction PostCreationCard({ space, type, parentId }: PostCreationCardProps) {\n const { slug } = space;\n\n const queryParams = parentId ? { parent_id: parentId } : {};\n const queryParamsStringified = qs.stringify(queryParams);\n const queryString = queryParamsStringified ? `?${queryParamsStringified}` : '';\n\n const menuItems = [\n {\n type: PostTypes.FOLDER,\n icon: Folder,\n descriptionId: 'POSTS.CREATE_MENU.FOLDER.DESCRIPTION',\n to: `/${slug}/dashboard/posts/folders/new${queryString}`,\n },\n {\n type: PostTypes.PARTICIPATORY_BUDGET,\n icon: AccountBalance,\n descriptionId: 'POSTS.CREATE_MENU.PARTICIPATORY_BUDGET.DESCRIPTION',\n steps: 4,\n to: `/${slug}/dashboard/posts/participatory_budgets/new${queryString}`,\n },\n {\n type: PostTypes.COLLABORATIVE_DECISION,\n icon: QuestionAnswer,\n descriptionId: 'POSTS.CREATE_MENU.COLLABORATIVE_DECISION.DESCRIPTION',\n steps: 4,\n to: `/${slug}/dashboard/posts/collaborative_decisions/new${queryString}`,\n },\n {\n type: PostTypes.IDEAS_REQUEST,\n icon: WorkspacePremium,\n descriptionId: 'POSTS.CREATE_MENU.IDEAS_REQUEST.DESCRIPTION',\n steps: 2,\n to: `/${slug}/dashboard/posts/ideas_requests/new${queryString}`,\n },\n {\n type: 'survey',\n icon: Help,\n descriptionId: 'POSTS.CREATE_MENU.SURVEY.DESCRIPTION',\n steps: 1,\n to: `/${slug}/dashboard/posts/studies/new?${qs.stringify({ ...queryParams, form_builder: true })}`,\n },\n {\n type: PostTypes.STUDY,\n icon: IntegrationInstructions,\n descriptionId: 'POSTS.CREATE_MENU.STUDY.DESCRIPTION',\n titleId: 'POSTS.CREATE_MENU.STUDY.TITLE',\n steps: 1,\n to: `/${slug}/dashboard/posts/studies/new${queryString}`,\n },\n {\n type: PostTypes.ARTICLE,\n icon: HistoryEdu,\n descriptionId: 'POSTS.CREATE_MENU.ARTICLE.DESCRIPTION',\n to: `/${slug}/dashboard/posts/articles/new${queryString}`,\n },\n {\n type: PostTypes.EVENT,\n icon: EventAvailable,\n descriptionId: 'POSTS.CREATE_MENU.EVENT.DESCRIPTION',\n to: `/${slug}/dashboard/posts/events/new${queryString}`,\n },\n ];\n\n const item = menuItems.find((item) => item.type === type);\n\n if (!item) return null;\n\n return (\n \n );\n}\n\nexport default PostCreationCard;\n","import React from 'react';\nimport { List } from '@mui/material';\nimport { PostTypes } from '../../../Utils/Types';\nimport { canCreate } from '../../../Utils/permissions';\n\nimport PostCreationCard from '../../DesignSystem/PostCreationCard';\nimport { PostTypeOrSurvey } from '../../../Utils/Types/Posts';\nimport useSpace from '../../../Hooks/useSpace';\n\ninterface PostsCreateMenuProps {\n parentId?: string | number | null;\n postTypes: PostTypeOrSurvey[];\n}\n\nfunction PostsCreateMenu({ parentId, postTypes }: PostsCreateMenuProps) {\n const { space } = useSpace();\n\n return (\n \n {postTypes.map((type) => {\n const postType = type === 'survey' ? PostTypes.STUDY : type;\n\n return (\n canCreate(postType, space) && (\n \n )\n );\n })}\n
\n );\n}\n\nexport default PostsCreateMenu;\n","import React from 'react';\nimport { PostTypes } from '../../../Utils/Types';\n\nimport PostsCreateMenu from './PostsCreateMenu';\nimport { PostTypeOrSurvey } from '../../../Utils/Types/Posts';\n\ninterface ConsultationsMenuProps {\n parentId?: string | number | null;\n}\n\nconst types = [\n PostTypes.PARTICIPATORY_BUDGET,\n PostTypes.COLLABORATIVE_DECISION,\n PostTypes.IDEAS_REQUEST,\n 'survey',\n PostTypes.STUDY,\n] as PostTypeOrSurvey[];\n\nfunction ConsultationsMenu({ parentId }: ConsultationsMenuProps) {\n return ;\n}\n\nexport default ConsultationsMenu;\n","import React from 'react';\nimport { PostCategories } from '../../../Utils/Types';\n\nimport PostsCreateMenu from './PostsCreateMenu';\nimport { PostTypeOrSurvey } from '../../../Utils/Types/Posts';\n\ninterface CommunicationsMenuProps {\n parentId?: string | number | null;\n}\n\nconst types = [...PostCategories.COMMUNICATION] as PostTypeOrSurvey[];\n\nfunction CommunicationsMenu({ parentId }: CommunicationsMenuProps) {\n return ;\n}\n\nexport default CommunicationsMenu;\n","import React from 'react';\nimport { PostCategories } from '../../../Utils/Types';\n\nimport PostsCreateMenu from './PostsCreateMenu';\nimport { PostTypeOrSurvey } from '../../../Utils/Types/Posts';\n\ninterface FoldersMenuProps {\n parentId?: string | number | null;\n}\n\nconst types = [...PostCategories.FOLDER] as PostTypeOrSurvey[];\n\nfunction FoldersMenu({ parentId }: FoldersMenuProps) {\n return ;\n}\n\nexport default FoldersMenu;\n"],"names":["AddCircle","createSvgIcon","_jsx","EventAvailable","IntegrationInstructions","QuestionAnswer","WorkspacePremium","canCreate","postType","space","get","concat","ItemAvatar","_ref","Icon","icon","compact","theme","useTheme","size","createElement","ListItemAvatar","React","Avatar","sx","bgcolor","lighten","palette","secondary","main","width","height","color","PostCreationCard","titleId","descriptionId","steps","to","onClick","intl","useIntl","Card","variant","mb","borderColor","borderRadius","ListItemButton","_extends","component","Link","p","gap","ListItemText","primary","formatMessage","id","Box","alignSelf","Chip","label","count","type","parentId","slug","queryParams","parent_id","queryParamsStringified","qs","stringify","queryString","menuItems","PostTypes","FOLDER","Folder","PARTICIPATORY_BUDGET","AccountBalance","COLLABORATIVE_DECISION","IDEAS_REQUEST","Help","_objectSpread","form_builder","STUDY","ARTICLE","HistoryEdu","EVENT","item","find","ItemCreationCard","toUpperCase","PostsCreateMenu","postTypes","_useSpace","useSpace","List","map","key","types","ConsultationsMenu","_toConsumableArray","PostCategories","COMMUNICATION","CommunicationsMenu","FoldersMenu"],"mappings":"2YAIA,MAAAA,GAAeC,EAA2BC,EAAI,IAAC,OAAQ,CACrD,EAAG,mGACL,CAAC,EAAG,WAAW,ECFfC,EAAeF,EAA2BC,EAAI,IAAC,OAAQ,CACrD,EAAG,mLACL,CAAC,EAAG,gBAAgB,ECFpBE,EAAeH,EAA2BC,EAAI,IAAC,OAAQ,CACrD,EAAG,iaACL,CAAC,EAAG,yBAAyB,ECF7BG,EAAeJ,EAA2BC,EAAI,IAAC,OAAQ,CACrD,EAAG,4HACL,CAAC,EAAG,gBAAgB,ECFpBI,EAAeL,EAA2BC,EAAI,IAAC,OAAQ,CACrD,EAAG,mPACL,CAAC,EAAG,kBAAkB,ECJf,IAAMK,EAAY,SAACC,EAAeC,EAAe,CACtD,OAAOC,EAAID,IAAAA,EAAK,0BAAAE,OA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