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K9E,KAAK,kBAAmB,CAAEzS,UAAS9M,QACvD,CAAE,MAAO2O,GACP9L,QAAQiH,MAAM6E,EAChB,GCxBWujB,GAAgBvyB,eACd0kB,EAAK9E,KAAK,sBAAuBvf,GAGnCmyB,GAAgBxyB,MAAOtB,EAAY2B,UACjCqkB,EAAKE,IAAI,uBAAuBlmB,IAAM2B,GAGxCoyB,GAAgBzyB,eACd0kB,EAAKG,OAAO,uBAAuBnmB,KAGrCg0B,GAAc1yB,eACZ0kB,EAAKC,IAAI,4BAA4BjmB,KAGvCi0B,GAAiB3yB,MAAOuF,EAAmBmT,EAAaxT,UACtDwf,EAAK9E,KAAK,8BAA+B,CAAEra,OAAMmT,MAAKxT,YAGxD0tB,GAAiB5yB,eACf0kB,EAAKC,IAAI,6BAA6Bpf,KClBxCstB,GAAuB7yB,eACrB0kB,EAAK9E,KAAK,8BAA+B,CAAEkT,U,yHCC1D,IAAIC,GAAe,EAEnB,MAAM9uB,EAAQA,KACZ,IAAK8uB,EAAc,CACjBA,GAAe,EACf,MAAMC,EAAcpxB,SAAS8Y,eAAe,iBACxCsY,GACWlY,EAAAA,WAAoBkY,GAC5BnyB,OACHjD,EAAAA,cAACq1B,EAAAA,GAAY,CAAChmB,KAAMA,EAAAA,IAClBrP,EAAAA,cAACs1B,EAAAA,GAAc,CAAC7wB,SAAUwqB,EAAAA,GAAMsG,SAASC,aAIjD,GAEWxG,EAAUA,CAAC1nB,EAAuBoP,KAC7CrQ,IACA4oB,EAAAA,GAAMD,QAAQ1nB,EAASoP,EAAQ,EAGpBnK,EAAQA,CAACjF,EAAuBoP,KAC3CrQ,IACA4oB,EAAAA,GAAM1iB,MAAMjF,EAASoP,EAAQ,C","sources":["webpack://fider/./public/components/common/HoverInfo.tsx","webpack://fider/./public/components/common/Icon.tsx","webpack://fider/./public/components/common/form/MentionList.tsx","webpack://fider/./public/components/common/form/suggestion.ts","webpack://fider/./public/components/common/form/CustomMention.ts","webpack://fider/./public/components/common/form/CommentEditor.tsx","webpack://fider/./public/components/ErrorBoundary.tsx","webpack://fider/./public/components/ShowPostResponse.tsx","webpack://fider/./public/components/ShowPostStatus.tsx","webpack://fider/./public/components/common/Button.tsx","webpack://fider/./public/components/common/form/Form.tsx","webpack://fider/./public/components/common/form/DisplayError.tsx","webpack://fider/./public/components/common/form/Input.tsx","webpack://fider/./public/components/common/form/ImageUploader.tsx","webpack://fider/./public/components/common/form/MultiImageUploader.tsx","webpack://fider/./public/components/common/form/TextArea.tsx","webpack://fider/./public/components/common/form/RadioButton.tsx","webpack://fider/./public/components/common/form/Select.tsx","webpack://fider/./public/components/common/form/Field.tsx","webpack://fider/./public/components/common/form/Checkbox.tsx","webpack://fider/./public/components/common/form/ImageViewer.tsx","webpack://fider/./public/components/common/Markdown.tsx","webpack://fider/./public/components/common/DevBanner.tsx","webpack://fider/./public/components/common/Avatar.tsx","webpack://fider/./public/components/common/AvatarStack.tsx","webpack://fider/./public/components/common/Message.tsx","webpack://fider/./public/components/common/Hint.tsx","webpack://fider/./public/components/common/Legal.tsx","webpack://fider/./public/components/common/SocialSignInButton.tsx","webpack://fider/./public/components/common/SignInControl.tsx","webpack://fider/./public/components/common/Moment.tsx","webpack://fider/./public/components/common/Modal.tsx","webpack://fider/./public/components/common/UserName.tsx","webpack://fider/./public/components/common/Loader.tsx","webpack://fider/./public/components/common/Logo.tsx","webpack://fider/./public/components/common/Toggle.tsx","webpack://fider/./public/components/common/PoweredByFider.tsx","webpack://fider/./public/components/common/PageTitle.tsx","webpack://fider/./public/components/common/Dropdown.tsx","webpack://fider/./public/components/common/Money.tsx","webpack://fider/./public/components/ShowTag.tsx","webpack://fider/./public/components/Header.tsx","webpack://fider/./public/components/SignInModal.tsx","webpack://fider/./public/components/VoteCounter.tsx","webpack://fider/./public/components/NotificationIndicator.tsx","webpack://fider/./public/components/UserMenu.tsx","webpack://fider/./public/components/Reactions.tsx","webpack://fider/./public/components/ReadOnlyNotice.tsx","webpack://fider/./public/components/layout/Stack.tsx","webpack://fider/./public/components/layout/Divider.tsx","webpack://fider/./public/models/post.ts","webpack://fider/./public/models/identity.ts","webpack://fider/./public/models/settings.ts","webpack://fider/./public/models/billing.ts","webpack://fider/./public/models/webhook.ts","webpack://fider/./public/services/http.ts","webpack://fider/./public/services/cache.ts","webpack://fider/./public/services/analytics.ts","webpack://fider/./public/services/fider.ts","webpack://fider/./public/services/jwt.ts","webpack://fider/./public/services/utils.ts","webpack://fider/./public/services/i18n.ts","webpack://fider/./public/services/markdown.ts","webpack://fider/./public/services/notify.ts","webpack://fider/./public/services/navigator.ts","webpack://fider/./public/services/querystring.ts","webpack://fider/./public/services/device.ts","webpack://fider/./public/services/actions/user.ts","webpack://fider/./public/services/actions/tag.ts","webpack://fider/./public/services/actions/post.ts","webpack://fider/./public/services/actions/tenant.ts","webpack://fider/./public/services/actions/notification.ts","webpack://fider/./public/services/actions/invite.ts","webpack://fider/./public/services/actions/infra.ts","webpack://fider/./public/services/actions/webhook.ts","webpack://fider/./public/services/actions/billing.ts","webpack://fider/./public/services/toastify.tsx"],"sourcesContent":["import \"./HoverInfo.scss\"\n\nimport React from \"react\"\nimport { Icon } from \"./Icon\"\n\nimport IconInformationCircle from \"@fider/assets/images/heroicons-information-circle.svg\"\nimport { classSet } from \"@fider/services\"\n\ninterface InfoProps {\n text: string\n onClick?: () => void\n href?: string\n target?: \"_self\" | \"_blank\" | \"_parent\" | \"_top\"\n}\n\nexport const HoverInfo = (props: InfoProps) => {\n const Elem = props.href ? \"a\" : \"span\"\n const classList = classSet({\n \"c-hoverinfo\": true,\n clickable: props.onClick !== undefined,\n })\n return (\n \n \n \n )\n}\n","import React from \"react\"\n\ninterface IconProps {\n sprite: SpriteSymbol | string\n height?: string\n width?: string\n className?: string\n onClick?: () => void\n}\n\nexport const Icon = (props: IconProps) => {\n if (typeof props.sprite === \"string\") {\n const styles = { height: props.height && `${props.height}px`, width: props.width && `${props.width}px` }\n return \n }\n\n return (\n \n \n \n )\n}\n","import { MentionNodeAttrs } from \"@tiptap/extension-mention\"\nimport \"./MentionList.scss\"\n\nimport React, { forwardRef, useEffect, useImperativeHandle, useState } from \"react\"\n\ninterface Props {\n items: MentionNodeAttrs[]\n command?: (item: MentionNodeAttrs) => void\n}\n\nexport interface MentionListHandle {\n onKeyDown: (args: { event: KeyboardEvent }) => boolean\n}\n\nconst MentionList = forwardRef((props, ref) => {\n const [selectedIndex, setSelectedIndex] = useState(0)\n\n const selectItem = (index: number) => {\n const item = props.items?.[index]\n\n if (item) {\n props.command?.(item)\n }\n }\n const upHandler = () => {\n setSelectedIndex((selectedIndex + props.items.length - 1) % props.items.length)\n }\n\n const downHandler = () => {\n setSelectedIndex((selectedIndex + 1) % props.items.length)\n }\n\n const enterHandler = () => {\n selectItem(selectedIndex)\n }\n\n useEffect(() => setSelectedIndex(0), [props.items])\n\n useImperativeHandle(ref, () => ({\n onKeyDown: ({ event }: { event: KeyboardEvent }): boolean => {\n if (event.key === \"ArrowUp\") {\n upHandler()\n return true\n }\n\n if (event.key === \"ArrowDown\") {\n downHandler()\n return true\n }\n\n if (event.key === \"Enter\") {\n enterHandler()\n return true\n }\n\n return false\n },\n }))\n\n return (\n
\n {props.items.length ? (\n props.items.map((item, index) => (\n \n ))\n ) : (\n
No result
\n )}\n
\n )\n})\n\nMentionList.displayName = \"MentionList\"\n\nexport default MentionList\n","import { ReactRenderer } from \"@tiptap/react\"\nimport { actions } from \"@fider/services\"\n\nimport MentionList, { MentionListHandle } from \"./MentionList\"\nimport { MentionNodeAttrs } from \"@tiptap/extension-mention\"\ninterface MentionListProps {\n items: any[]\n command?: (item: MentionNodeAttrs) => void\n}\n\n// Cache for storing users\nlet cachedUsers: MentionNodeAttrs[] = []\n\nexport default {\n items: async ({ query }: { query: string }) => {\n // If we don't have cached users yet, fetch them\n if (cachedUsers.length === 0) {\n const result = await actions.getTaggableUsers(\"\")\n if (result.ok) {\n cachedUsers = result.data.map((user) => ({ id: user.id.toString(), label: user.name }))\n }\n }\n\n // Filter the cached users based on the query\n return cachedUsers.filter((item) => item.label?.toLowerCase().startsWith(query.toLowerCase())).slice(0, 5)\n },\n render: () => {\n let reactRenderer: ReactRenderer\n let containerElement: HTMLElement | null = null\n let scrollListener: EventListener | null = null\n let clickOutsideListener: EventListener | null = null\n let initialPosition: { top: number; left: number } | null = null\n\n return {\n onStart: (props: { editor: any; clientRect?: (() => DOMRect | null) | null }) => {\n reactRenderer = new ReactRenderer(MentionList, {\n props,\n editor: props.editor,\n })\n\n if (!props.clientRect) {\n return\n }\n // Add click outside listener\n clickOutsideListener = (event: Event) => {\n if (event instanceof MouseEvent && containerElement && event.target instanceof Node && !containerElement.contains(event.target)) {\n // Click was outside the container, clean up\n if (scrollListener) {\n window.removeEventListener(\"scroll\", scrollListener)\n }\n if (clickOutsideListener) {\n document.removeEventListener(\"click\", clickOutsideListener)\n }\n if (containerElement && containerElement.parentNode) {\n document.body.removeChild(containerElement)\n containerElement = null\n }\n\n // Important: Return focus to editor\n props.editor.view.focus()\n }\n }\n // Use setTimeout to avoid immediate trigger when creating the popup\n setTimeout(() => {\n document.addEventListener(\"click\", clickOutsideListener as EventListener)\n }, 100)\n\n // Create container for the suggestion list\n containerElement = document.createElement(\"div\")\n containerElement.style.position = \"absolute\"\n containerElement.style.zIndex = \"1000\"\n document.body.appendChild(containerElement)\n containerElement.appendChild(reactRenderer.element)\n\n // Get initial position\n const rect = props.clientRect()\n if (rect) {\n // Store initial position relative to the document\n initialPosition = {\n top: rect.bottom + window.scrollY,\n left: rect.left + window.scrollX,\n }\n\n // Set initial position\n containerElement.style.left = `${initialPosition.left}px`\n containerElement.style.top = `${initialPosition.top}px`\n }\n\n // Add scroll listener to maintain position during scrolling\n scrollListener = () => {\n if (containerElement && initialPosition) {\n containerElement.style.top = `${initialPosition.top}px`\n }\n }\n\n window.addEventListener(\"scroll\", scrollListener, { passive: true })\n },\n onUpdate(props: { clientRect?: (() => DOMRect | null) | null | undefined }) {\n if (!props.clientRect || !containerElement) {\n return\n }\n\n const rect = props.clientRect()\n if (!rect) {\n return\n }\n\n reactRenderer.updateProps(props)\n\n // Update position\n initialPosition = {\n top: rect.bottom + window.scrollY,\n left: rect.left + window.scrollX,\n }\n\n containerElement.style.left = `${initialPosition.left}px`\n containerElement.style.top = `${initialPosition.top}px`\n },\n\n onKeyDown(props: { event: KeyboardEvent }) {\n console.log(props.event.key)\n if (props.event.key === \"Escape\" && containerElement) {\n // Clean up\n if (scrollListener) {\n window.removeEventListener(\"scroll\", scrollListener)\n }\n\n document.body.removeChild(containerElement)\n containerElement = null\n return true\n }\n\n return reactRenderer.ref?.onKeyDown(props) || false\n },\n\n onExit() {\n if (containerElement) {\n if (scrollListener) {\n window.removeEventListener(\"scroll\", scrollListener)\n }\n if (clickOutsideListener) {\n document.removeEventListener(\"click\", clickOutsideListener)\n }\n\n document.body.removeChild(containerElement)\n containerElement = null\n }\n\n reactRenderer.destroy()\n },\n }\n },\n}\n","import Mention from \"@tiptap/extension-mention\"\nimport * as MarkdownIt from \"markdown-it\"\n\nexport const CustomMention = Mention.extend({\n name: \"mention\",\n addStorage() {\n return {\n markdown: {\n serialize: (state: any, node: { attrs: { id: string; label: string } }) => {\n state.write(`@[${node.attrs.label}]`)\n },\n parse: {\n setup(markdownit: MarkdownIt) {\n markdownit.renderer.rules.mention_open = (tokens, idx) => {\n const token = tokens[idx]\n const id = token.attrGet(\"id\")\n const label = token.attrGet(\"label\")\n return ``\n }\n\n markdownit.renderer.rules.mention_close = () => {\n return \"\"\n }\n\n markdownit.inline.ruler.before(\"text\", \"mention\", (state: MarkdownIt.StateInline, silent: boolean) => {\n const match = state.src.slice(state.pos).match(/^@\\[(.+?)\\]/)\n if (!match) return false\n if (!silent) {\n const label = match[1]\n const token = state.push(\"mention_open\", \"span\", 1)\n token.attrs = [[\"label\", label]]\n\n // Add the text content token\n const contentToken = state.push(\"text\", \"\", 0)\n contentToken.content = `@${label}`\n\n // Close the mention span\n state.push(\"mention_close\", \"span\", -1)\n }\n\n state.pos += match[0].length\n return true\n })\n },\n },\n },\n }\n },\n})\n","import { Editor } from \"@tiptap/react\"\nimport StarterKit from \"@tiptap/starter-kit\"\nimport React, { useState } from \"react\"\nimport { EditorContent, useEditor } from \"@tiptap/react\"\nimport { Markdown } from \"tiptap-markdown\"\nimport Placeholder from \"@tiptap/extension-placeholder\"\nimport Document from \"@tiptap/extension-document\"\nimport Paragraph from \"@tiptap/extension-paragraph\"\nimport Text from \"@tiptap/extension-text\"\nimport HardBreak from \"@tiptap/extension-hard-break\"\n\nimport \"./CommentEditor.scss\"\n\n// At the top of the file, add imports for your icons\nimport IconH2 from \"@fider/assets/images/heroicons-h2.svg\"\nimport IconH3 from \"@fider/assets/images/heroicons-h3.svg\"\nimport IconItalic from \"@fider/assets/images/heroicons-italic.svg\"\nimport IconBold from \"@fider/assets/images/heroicons-bold.svg\"\nimport IconStrike from \"@fider/assets/images/heroicons-strike.svg\"\nimport IconCode from \"@fider/assets/images/heroicons-code.svg\"\nimport IconAt from \"@fider/assets/images/heroicons-at.svg\"\nimport IconOrderedList from \"@fider/assets/images/heroicons-orderedlist.svg\"\nimport IconBulletList from \"@fider/assets/images/heroicons-bulletlist.svg\"\nimport { Icon } from \"@fider/components\"\n\nimport suggestion from \"./suggestion\"\nimport { CustomMention } from \"./CustomMention\"\nimport { Trans } from \"@lingui/react/macro\"\n\nconst MenuBar = ({\n editor,\n isMarkdownMode,\n toggleMarkdownMode,\n disabled,\n}: {\n editor: Editor | null\n isMarkdownMode: boolean\n disabled: boolean\n toggleMarkdownMode: () => void\n}) => {\n if (!editor) {\n return null\n }\n\n return (\n
\n
\n {/* Only show formatting buttons when not in markdown mode */}\n {!isMarkdownMode && (\n <>\n editor.chain().focus().toggleHeading({ level: 2 }).run()}\n className={`c-editor-button ${editor.isActive(\"heading\", { level: 2 }) ? \"is-active\" : \"\"} ${disabled ? \"is-disabled\" : \"\"}`}\n >\n \n \n editor.chain().focus().toggleHeading({ level: 3 }).run()}\n className={`c-editor-button ${editor.isActive(\"heading\", { level: 3 }) ? \"is-active\" : \"\"} ${disabled ? \"is-disabled\" : \"\"}`}\n >\n \n \n editor.chain().focus().toggleBold().run()}\n className={`c-editor-button ${editor.isActive(\"bold\") ? \"is-active\" : \"\"} ${disabled ? \"is-disabled\" : \"\"}`}\n >\n \n \n editor.chain().focus().toggleItalic().run()}\n className={`c-editor-button ${editor.isActive(\"italic\") ? \"is-active\" : \"\"} ${disabled ? \"is-disabled\" : \"\"}`}\n >\n \n \n editor.chain().focus().toggleStrike().run()}\n className={`c-editor-button ${editor.isActive(\"strike\") ? \"is-active\" : \"\"} ${disabled ? \"is-disabled\" : \"\"}`}\n >\n \n \n editor.chain().focus().toggleBulletList().run()}\n className={`c-editor-button ${editor.isActive(\"bulletList\") ? \"is-active\" : \"\"} ${disabled ? \"is-disabled\" : \"\"}`}\n >\n \n \n editor.chain().focus().toggleOrderedList().run()}\n className={`c-editor-button ${editor.isActive(\"orderedList\") ? \"is-active\" : \"\"} ${disabled ? \"is-disabled\" : \"\"}`}\n >\n \n \n editor.chain().focus().toggleCodeBlock().run()}\n className={`c-editor-button ${editor.isActive(\"codeBlock\") ? \"is-active\" : \"\"} ${disabled ? \"is-disabled\" : \"\"}`}\n >\n \n \n {\n // Get the current cursor position\n const { from } = editor.state.selection\n // Get the character before the cursor\n const textBefore = editor.state.doc.textBetween(Math.max(0, from - 1), from)\n // Insert space before @ only if the previous character isn't a space or the cursor is at the beginning\n if (from === 0 || textBefore === \" \" || textBefore === \"\\n\") {\n editor.chain().focus().insertContent(\"@\").run()\n } else {\n editor.chain().focus().insertContent(\" @\").run()\n }\n }}\n className={`c-editor-button ${disabled ? \"is-disabled\" : \"\"}`}\n >\n \n \n \n )}\n \n \n {isMarkdownMode ? (\n Switch to rich text editor\n ) : (\n Switch to markdown editor\n )}\n \n \n
\n
\n )\n}\ninterface CommentEditorProps {\n initialValue: string | null\n placeholder?: string\n onChange?: (value: string) => void\n onFocus?: () => void\n disabled: boolean\n}\n\nconst markdownToHtml = (markdownString: string) => {\n return markdownString\n .split(\"\\n\\n\")\n .map((line: string) => `

${line}

`)\n .join(\"\")\n .replace(/\\\\\\n/g, \"
\")\n .replace(/\\n/g, \"
\")\n}\n\nconst Tiptap: React.FunctionComponent = (props) => {\n const [isRawMarkdownMode, setIsRawMarkdownMode] = useState(false)\n\n const getIntialContent = () => {\n if (isRawMarkdownMode) {\n return markdownToHtml(props.initialValue ?? \"\")\n } else {\n return props.initialValue ?? \"\"\n }\n }\n\n const [editorContent, setEditorContent] = useState(getIntialContent())\n\n const toggleMarkdownMode = () => {\n if (editor) {\n // Store current content before switching\n let currentContent\n if (isRawMarkdownMode) {\n currentContent = editor.getText()\n } else {\n currentContent = markdownToHtml(editor.storage.markdown.getMarkdown())\n }\n // Destroy current editor\n editor.destroy()\n setIsRawMarkdownMode(!isRawMarkdownMode)\n setEditorContent(currentContent)\n }\n }\n\n const updated = ({ editor }: { editor: Editor; transaction: any }): void => {\n const markdown = isRawMarkdownMode ? editor.getText() : editor.storage.markdown.getMarkdown()\n props.onChange && props.onChange(markdown)\n }\n\n const extensions = isRawMarkdownMode\n ? [\n // Minimal extensions for markdown mode\n Document,\n Paragraph,\n Text,\n HardBreak,\n Placeholder.configure({\n placeholder: props.placeholder ?? \"Write your comment here...\",\n emptyEditorClass: \"tiptap-is-empty\",\n }),\n ]\n : [\n StarterKit,\n Markdown.configure({\n html: true,\n breaks: true,\n }),\n CustomMention.configure({\n HTMLAttributes: {\n class: \"mention\",\n },\n suggestion,\n }),\n Placeholder.configure({\n placeholder: props.placeholder ?? \"Write your comment here...\",\n emptyEditorClass: \"tiptap-is-empty\",\n }),\n ]\n\n const editor = useEditor(\n {\n extensions,\n content: editorContent,\n onUpdate: updated,\n onFocus: () => {\n if (props.onFocus) {\n props.onFocus()\n }\n },\n editorProps: {\n attributes: {\n class: isRawMarkdownMode ? \"markdown-mode no-focus\" : \"no-focus\",\n },\n },\n },\n [isRawMarkdownMode, editorContent]\n ) // Re-initialize when mode changes\n\n return (\n
\n \n \n
\n )\n}\n\nconst CommentEditor = React.memo(Tiptap, (prevProps, nextProps) => {\n return prevProps.placeholder === nextProps.placeholder\n})\n\nexport default CommentEditor\n","import React from \"react\"\nimport { ErrorPage } from \"@fider/pages/Error/Error.page\"\nimport { FiderContext } from \"@fider/services\"\n\ninterface ErrorBoundaryProps {\n children?: React.ReactNode\n onError?: (err: Error) => void\n}\n\ninterface ErrorBoundaryState {\n error?: Error\n errorInfo?: React.ErrorInfo\n}\n\nexport class ErrorBoundary extends React.Component {\n constructor(props: any) {\n super(props)\n\n this.state = {\n error: undefined,\n errorInfo: undefined,\n }\n }\n\n public componentDidCatch(error: Error, errorInfo: React.ErrorInfo) {\n const onError = this.props.onError\n if (onError) {\n onError(error)\n }\n\n this.setState({\n error,\n errorInfo,\n })\n }\n\n public render() {\n const { error, errorInfo } = this.state\n\n if (error && errorInfo) {\n return {(fider) => }\n } else {\n return this.props.children\n }\n }\n}\n","import React from \"react\"\nimport { PostResponse, PostStatus } from \"@fider/models\"\nimport { Icon, Markdown } from \"@fider/components\"\nimport HeroIconDuplicate from \"@fider/assets/images/heroicons-duplicate.svg\"\nimport HeroIconCheck from \"@fider/assets/images/heroicons-check-circle.svg\"\nimport HeroIconSparkles from \"@fider/assets/images/heroicons-sparkles-outline.svg\"\nimport HeroIconThumbsUp from \"@fider/assets/images/heroicons-thumbsup.svg\"\nimport HeroIconThumbsDown from \"@fider/assets/images/heroicons-thumbsdown.svg\"\nimport { HStack, VStack } from \"./layout\"\nimport { timeSince } from \"@fider/services\"\n\ninterface PostResponseProps {\n status: string\n response: PostResponse | null\n small?: boolean\n}\n\nexport const ResponseDetails = (props: PostResponseProps): JSX.Element | null => {\n const status = PostStatus.Get(props.status)\n\n if (!props.response || status === PostStatus.Open) {\n return null\n }\n\n return (\n \n \n
{timeSince(\"en\", new Date(), props.response.respondedAt, \"date\")}
\n {props.response?.text && status !== PostStatus.Duplicate && (\n
\n \n
\n )}\n\n {status === PostStatus.Duplicate && props.response.original && (\n \n )}\n
\n )\n}\n\nconst getLozengeProps = (status: PostStatus): { icon: SpriteSymbol; bg: string; color: string; border: string } => {\n switch (status) {\n case PostStatus.Declined:\n return { icon: HeroIconThumbsDown, bg: \"bg-red-100\", color: \"text-red-800\", border: \"border-red-300\" }\n case PostStatus.Duplicate:\n return { icon: HeroIconDuplicate, bg: \"bg-yellow-100\", color: \"text-yellow-800\", border: \"border-yellow-400\" }\n case PostStatus.Completed:\n return { icon: HeroIconCheck, bg: \"bg-green-300\", color: \"text-green-800\", border: \"border-green-500\" }\n case PostStatus.Planned:\n return { icon: HeroIconThumbsUp, bg: \"bg-blue-100\", color: \"text-blue-700\", border: \"border-blue-400\" }\n default:\n return { icon: HeroIconSparkles, bg: \"bg-green-100\", color: \"text-green-700\", border: \"border-green-400\" }\n }\n}\n\nexport const ResponseLozenge = (props: PostResponseProps): JSX.Element | null => {\n const status = PostStatus.Get(props.status)\n const { icon, bg, color, border } = getLozengeProps(status)\n\n if (status === PostStatus.Open) {\n return
\n }\n\n return (\n
\n \n {!props.small && }\n {status.title}\n \n
\n )\n}\n","// import \"./ShowPostStatus.scss\"\n\nimport React from \"react\"\nimport { PostStatus } from \"@fider/models\"\nimport { i18n } from \"@lingui/core\"\n\ninterface ShowPostStatusProps {\n status: PostStatus\n}\n\nexport const ShowPostStatus = (props: ShowPostStatusProps) => {\n const id = `enum.poststatus.${props.status.value}`\n const title = i18n._(id, { message: props.status.title })\n\n return {title}\n}\n","import \"./Button.scss\"\n\nimport React, { useEffect, useRef, useState } from \"react\"\nimport { classSet } from \"@fider/services\"\n\ninterface ButtonProps {\n children?: React.ReactNode\n className?: string\n disabled?: boolean\n href?: string\n rel?: \"nofollow\"\n target?: \"_self\" | \"_blank\" | \"_parent\" | \"_top\"\n type?: \"button\" | \"submit\"\n variant?: \"primary\" | \"danger\" | \"secondary\" | \"tertiary\"\n size?: \"small\" | \"default\" | \"large\"\n style?: React.CSSProperties\n onClick?: (event: ButtonClickEvent) => Promise | void\n}\n\nexport class ButtonClickEvent {\n private shouldEnable = true\n public preventEnable(): void {\n this.shouldEnable = false\n }\n public canEnable(): boolean {\n return this.shouldEnable\n }\n}\n\nexport const Button: React.FC = ({ size = \"default\", variant = \"secondary\", type = \"button\", ...props }) => {\n const [clicked, setClicked] = useState(false)\n const unmountedContainer = useRef(false)\n\n useEffect(() => {\n return () => {\n unmountedContainer.current = true\n }\n }, [])\n\n const className = classSet({\n \"c-button\": true,\n [`c-button--${size}`]: size,\n [`c-button--${variant}`]: variant,\n \"c-button--loading\": clicked,\n \"c-button--disabled\": clicked || props.disabled,\n [props.className || \"\"]: props.className,\n })\n\n let buttonContent: JSX.Element\n const onClickProp = props.onClick\n\n if (props.href) {\n buttonContent = (\n \n {props.children}\n \n )\n } else if (onClickProp) {\n const onClick = async (e?: React.SyntheticEvent) => {\n if (e) {\n e.preventDefault()\n e.stopPropagation()\n }\n\n if (clicked) {\n return\n }\n\n const event = new ButtonClickEvent()\n setClicked(true)\n\n await onClickProp(event)\n\n if (!unmountedContainer.current && event.canEnable()) {\n setClicked(false)\n }\n }\n\n buttonContent = (\n \n )\n } else {\n buttonContent = (\n \n )\n }\n\n return buttonContent\n}\n","import \"./Form.scss\"\n\nimport React from \"react\"\nimport { Failure, classSet } from \"@fider/services\"\nimport { DisplayError } from \"@fider/components\"\n\ninterface ValidationContext {\n error?: Failure\n}\n\ninterface FormProps {\n children?: React.ReactNode\n className?: string\n error?: Failure\n}\n\nexport const ValidationContext = React.createContext({})\n\nexport const Form: React.FunctionComponent = (props) => {\n const className = classSet({\n \"c-form\": true,\n [props.className || \"\"]: props.className,\n })\n\n return (\n
\n \n {props.children}\n \n )\n}\n","import React from \"react\"\nimport { Failure } from \"@fider/services\"\n\nimport \"./DisplayError.scss\"\n\nconst arrayToTag = (items: string[]) => {\n return items.map((m) =>
  • {m}
  • )\n}\n\ninterface DisplayErrorProps {\n error?: Failure\n fields?: string[]\n}\n\nexport const hasError = (field?: string, error?: Failure): boolean => {\n if (field && error && error.errors) {\n for (const err of error.errors) {\n if (err.field === field) {\n return true\n }\n }\n }\n return false\n}\n\nexport const DisplayError = (props: DisplayErrorProps) => {\n if (!props.error || !props.error.errors) {\n return null\n }\n\n const dict = props.error.errors.reduce((result, err) => {\n result[err.field || \"\"] = result[err.field || \"\"] || []\n result[err.field || \"\"].push(err.message)\n return result\n }, {} as { [key: string]: string[] })\n\n let items: JSX.Element[] = []\n\n if (dict[\"\"] && !props.fields) {\n items = arrayToTag(dict[\"\"])\n } else if (props.fields) {\n for (const field of props.fields || Object.keys(dict)) {\n if (Object.prototype.hasOwnProperty.call(dict, field)) {\n const tags = arrayToTag(dict[field])\n tags.forEach((t) => items.push(t))\n }\n }\n }\n\n return items.length > 0 ? (\n
    \n
      {items}
    \n
    \n ) : null\n}\n","import React from \"react\"\nimport { classSet } from \"@fider/services\"\nimport { ValidationContext } from \"./Form\"\nimport { DisplayError, hasError } from \"./DisplayError\"\nimport { Icon } from \"@fider/components\"\n\nimport \"./Input.scss\"\nimport { HStack } from \"@fider/components/layout\"\n\ninterface InputProps {\n children?: React.ReactNode\n field: string\n label?: string\n className?: string\n autoComplete?: string\n autoFocus?: boolean\n noTabFocus?: boolean\n afterLabel?: JSX.Element\n icon?: SpriteSymbol\n maxLength?: number\n value?: string\n disabled?: boolean\n suffix?: string | JSX.Element\n placeholder?: string\n onIconClick?: () => void\n onFocus?: () => void\n inputRef?: React.MutableRefObject\n onChange?: (value: string) => void\n}\n\nexport const Input: React.FunctionComponent = (props) => {\n const onChange = (e: React.FormEvent) => {\n if (props.onChange) {\n props.onChange(e.currentTarget.value)\n }\n }\n\n const suffix = typeof props.suffix === \"string\" ? {props.suffix} : props.suffix\n\n const icon = props.icon ? : undefined\n\n return (\n \n {(ctx) => (\n \n {!!props.label && (\n \n )}\n \n \n {icon}\n {suffix}\n \n \n {props.children}\n
    \n )}\n \n )\n}\n","import \"./ImageUploader.scss\"\n\nimport React from \"react\"\nimport { ValidationContext } from \"./Form\"\nimport { DisplayError, hasError } from \"./DisplayError\"\nimport { classSet, fileToBase64, uploadedImageURL } from \"@fider/services\"\nimport { Button, Icon, Modal } from \"@fider/components\"\nimport { ImageUpload } from \"@fider/models\"\nimport IconPhotograph from \"@fider/assets/images/heroicons-photograph.svg\"\n\nconst hardFileSizeLimit = 5 * 1024 * 1024\n\ninterface ImageUploaderProps {\n children?: React.ReactNode\n instanceID?: string\n field: string\n label?: string\n bkey?: string\n disabled?: boolean\n onChange(state: ImageUpload, instanceID?: string, previewURL?: string): void\n}\n\ninterface ImageUploaderState extends ImageUpload {\n previewURL?: string\n showModal: boolean\n}\n\nexport class ImageUploader extends React.Component {\n private fileSelector?: HTMLInputElement | null\n\n constructor(props: ImageUploaderProps) {\n super(props)\n this.state = {\n upload: undefined,\n remove: false,\n showModal: false,\n previewURL: uploadedImageURL(this.props.bkey),\n }\n }\n\n public fileChanged = async (e: React.ChangeEvent) => {\n if (e.target.files && e.target.files[0]) {\n const file = e.target.files[0]\n if (file.size > hardFileSizeLimit) {\n alert(\"The image size must be smaller than 5MB.\")\n return\n }\n\n const base64 = await fileToBase64(file)\n this.setState(\n {\n bkey: this.props.bkey,\n upload: {\n fileName: file.name,\n content: base64,\n contentType: file.type,\n },\n remove: false,\n previewURL: `data:${file.type};base64,${base64}`,\n },\n () => {\n this.props.onChange(this.state, this.props.instanceID, this.state.previewURL)\n }\n )\n }\n }\n\n public removeFile = async () => {\n if (this.fileSelector) {\n this.fileSelector.value = \"\"\n }\n\n this.setState(\n {\n bkey: this.props.bkey,\n remove: true,\n upload: undefined,\n previewURL: undefined,\n },\n () => {\n this.props.onChange(\n {\n bkey: this.state.bkey,\n remove: this.state.remove,\n upload: this.state.upload,\n },\n this.props.instanceID,\n this.state.previewURL\n )\n }\n )\n }\n\n public selectFile = async () => {\n if (this.fileSelector) {\n this.fileSelector.click()\n }\n }\n\n private openModal = () => {\n this.setState({ showModal: true })\n }\n\n private closeModal = async () => {\n this.setState({ showModal: false })\n }\n\n private modal() {\n return (\n \n {this.props.bkey ? \"\" : \"\"}\n\n \n \n \n \n )\n }\n\n public render() {\n const isUploading = !!this.state.upload\n const hasFile = (!this.state.remove && this.props.bkey) || isUploading\n\n return (\n \n {(ctx) => (\n \n {this.modal()}\n {this.props.label && }\n\n {hasFile && (\n
    \n \"\"\n {!this.props.disabled && (\n \n )}\n
    \n )}\n\n (this.fileSelector = e)} type=\"file\" onChange={this.fileChanged} accept=\"image/*\" />\n {!hasFile && (\n \n )}\n \n {this.props.children}\n \n )}\n
    \n )\n }\n}\n","import React from \"react\"\nimport { ImageUploader } from \"./ImageUploader\"\nimport { ImageUpload } from \"@fider/models\"\nimport { ValidationContext, hasError, DisplayError } from \"@fider/components\"\nimport { classSet } from \"@fider/services\"\n\nimport \"./MultiImageUploader.scss\"\n\ninterface MultiImageUploaderProps {\n field: string\n maxUploads: number\n bkeys?: string[]\n onChange?: (uploads: ImageUpload[]) => void\n}\n\ninterface MultiImageUploaderInstances {\n [key: string]: {\n element: JSX.Element\n upload?: ImageUpload\n }\n}\n\ninterface MultiImageUploaderState {\n count: number\n instances: MultiImageUploaderInstances\n removed: ImageUpload[]\n}\n\nexport class MultiImageUploader extends React.Component {\n constructor(props: MultiImageUploaderProps) {\n super(props)\n\n let count = 1\n const instances = {}\n if (props.bkeys) {\n for (const bkey of props.bkeys) {\n count++\n this.addNewElement(instances, bkey)\n }\n }\n\n if (count <= this.props.maxUploads) {\n count++\n this.addNewElement(instances)\n }\n\n this.state = { instances, count, removed: [] }\n }\n\n private imageUploaded = (upload: ImageUpload, instanceID: string) => {\n const instances = { ...this.state.instances }\n const removed = [...this.state.removed]\n let count = this.state.count\n if (upload.remove) {\n if (upload.bkey) {\n removed.push(upload)\n }\n delete instances[instanceID]\n if (--count === this.props.maxUploads) {\n this.addNewElement(instances)\n }\n } else {\n instances[instanceID].upload = upload\n if (count++ <= this.props.maxUploads) {\n this.addNewElement(instances)\n }\n }\n this.setState({ instances, count, removed }, this.triggerOnChange)\n }\n\n private triggerOnChange() {\n if (this.props.onChange) {\n const uploads = Object.keys(this.state.instances)\n .map((k) => this.state.instances[k].upload)\n .concat(this.state.removed)\n .filter((x) => !!x) as ImageUpload[]\n this.props.onChange(uploads)\n }\n }\n\n private addNewElement(instances: MultiImageUploaderInstances, bkey?: string) {\n const id = btoa(Math.random().toString())\n instances[id] = {\n element: ,\n }\n }\n\n public render() {\n const elements = Object.keys(this.state.instances).map((k) => this.state.instances[k].element)\n return (\n \n {(ctx) => (\n \n
    {elements}
    \n \n \n )}\n
    \n )\n }\n}\n","import React from \"react\"\nimport { classSet } from \"@fider/services\"\nimport { ValidationContext } from \"../\"\nimport { DisplayError, hasError } from \"./DisplayError\"\nimport Textarea from \"react-textarea-autosize\"\n\nimport \"./TextArea.scss\"\n\ninterface TextAreaProps {\n children?: React.ReactNode\n label?: string\n field: string\n value?: string\n disabled?: boolean\n minRows?: number\n placeholder?: string\n afterLabel?: JSX.Element\n onChange?: (value: string, selectionStart?: number) => void\n onKeyDown?: (e: React.KeyboardEvent) => void\n inputRef?: React.MutableRefObject\n onFocus?: React.FocusEventHandler\n className?: string\n}\n\nexport const TextArea: React.FunctionComponent = (props) => {\n const onChange = (e: React.FormEvent) => {\n if (props.onChange) {\n props.onChange(e.currentTarget.value, e.currentTarget.selectionStart)\n }\n }\n\n const onKeyDown = (e: React.KeyboardEvent) => {\n if (props.onKeyDown) {\n props.onKeyDown(e)\n }\n }\n\n return (\n \n {(ctx) => (\n <>\n
    \n {!!props.label && (\n \n )}\n \n \n {props.children}\n
    \n \n )}\n
    \n )\n}\n","import { HStack, VStack } from \"@fider/components/layout\"\nimport React, { useState } from \"react\"\n\nimport \"./RadioButton.scss\"\n\ninterface RadioButtonOption {\n value: string\n label: string\n}\n\ninterface RadioButtonProps {\n label: string\n field: string\n defaultOption: RadioButtonOption\n options: RadioButtonOption[]\n onSelect?: (value: RadioButtonOption) => void\n}\n\nexport const RadioButton = (props: RadioButtonProps) => {\n const [selected, setSelected] = useState(props.defaultOption)\n\n const onChange = (option: RadioButtonOption) => () => {\n setSelected(option)\n props.onSelect?.(option)\n }\n\n const inputs = props.options.map((option) => (\n \n \n \n \n ))\n\n return (\n
    \n \n {inputs}\n
    \n )\n}\n","import React from \"react\"\nimport { classSet } from \"@fider/services\"\nimport { ValidationContext } from \"./Form\"\nimport { DisplayError, hasError } from \"./DisplayError\"\n\nimport \"./Select.scss\"\n\nexport interface SelectOption {\n value: string\n label: string\n}\n\ninterface SelectProps {\n children?: React.ReactNode\n field: string\n label?: string\n maxLength?: number\n defaultValue?: string\n options: SelectOption[]\n onChange?: (option?: SelectOption) => void\n}\n\nexport const Select: React.FunctionComponent = (props) => {\n const getOption = (value?: string) => {\n if (value && props.options) {\n const filtered = props.options.filter((x) => x.value === value)\n if (filtered && filtered.length > 0) {\n return filtered[0]\n }\n }\n }\n const [selected, setSelected] = React.useState(getOption(props.defaultValue))\n const onChange = (e: React.FormEvent) => {\n let selected: SelectOption | undefined\n if (e.currentTarget.value) {\n const options = props.options.filter((o) => o.value === e.currentTarget.value)\n if (options && options.length > 0) {\n selected = options[0]\n }\n }\n\n setSelected(selected)\n if (props.onChange) {\n props.onChange(selected)\n }\n }\n\n return (\n \n {(ctx) => (\n <>\n
    \n {!!props.label && }\n \n {props.options.map((option) => (\n \n ))}\n \n \n {props.children}\n
    \n \n )}\n
    \n )\n}\n","import React from \"react\"\nimport { classSet } from \"@fider/services\"\nimport { ValidationContext } from \"./Form\"\nimport { DisplayError, hasError } from \"./DisplayError\"\n\ninterface FieldProps {\n children?: React.ReactNode\n className?: string\n label?: string\n field?: string\n afterLabel?: JSX.Element\n}\n\nexport const Field: React.FunctionComponent = (props) => {\n const fields = props.field ? [props.field] : undefined\n return (\n \n {(ctx) => (\n \n {!!props.label && (\n \n )}\n {props.children}\n \n \n )}\n \n )\n}\n","import React, { useState } from \"react\"\nimport { classSet } from \"@fider/services\"\nimport { DisplayError, ValidationContext, hasError } from \"../\"\nimport { HStack } from \"@fider/components/layout\"\n\nimport \"./Checkbox.scss\"\n\ninterface CheckboxProps {\n children?: React.ReactNode\n field: string\n checked?: boolean\n onChange?: (checked: boolean) => void\n}\n\nexport const Checkbox: React.FC = (props) => {\n const [checked, setChecked] = useState(props.checked || false)\n\n const onChange = (e: React.ChangeEvent) => {\n const isChecked: boolean = e.currentTarget.checked\n\n setChecked(isChecked)\n if (props.onChange) {\n props.onChange(isChecked)\n }\n }\n\n return (\n \n {(ctx) => (\n \n
    \n \n \n \n \n \n
    \n \n )}\n
    \n )\n}\n","import React, { useState } from \"react\"\nimport { uploadedImageURL } from \"@fider/services\"\nimport { Modal, Button, Loader } from \"@fider/components\"\n\nimport \"./ImageViewer.scss\"\nimport { Trans } from \"@lingui/react/macro\"\n\ninterface ImageViewerModalProps {\n isOpen: boolean\n imgSrc: string | undefined\n loadedPreview: boolean\n onPreviewLoad: () => void\n onClose: () => void\n}\n\nconst ImageViewerModal = (props: ImageViewerModalProps) => (\n \n \n {!props.loadedPreview && }\n \"\"\n \n\n \n \n \n \n)\n\ninterface ImageViewerProps {\n bkey: string\n}\n\nexport const ImageViewer = (props: ImageViewerProps) => {\n const [showModal, setShowModal] = useState(false)\n const [loadedThumbnail, setLoadedThumbnail] = useState(false)\n const [loadedPreview, setLoadedPreview] = useState(false)\n\n const openModal = () => {\n if (loadedThumbnail) {\n setShowModal(true)\n }\n }\n\n const closeModal = () => {\n setShowModal(false)\n }\n\n const onThumbnailLoad = () => {\n setLoadedThumbnail(true)\n }\n\n const onPreviewLoad = () => {\n setLoadedPreview(true)\n }\n\n return (\n
    \n \n {!loadedThumbnail && }\n \"\"\n
    \n )\n}\n","import React from \"react\"\nimport { markdown, truncate } from \"@fider/services\"\n\nimport \"./Markdown.scss\"\n\ninterface MarkdownProps {\n className?: string\n text?: string\n maxLength?: number\n style: \"full\" | \"plainText\"\n}\n\nexport const Markdown = (props: MarkdownProps) => {\n if (!props.text) {\n return null\n }\n\n const html = markdown[props.style](props.text)\n const className = `c-markdown ${props.className || \"\"}`\n const tagName = props.style === \"plainText\" ? \"p\" : \"div\"\n\n return React.createElement(tagName, {\n className,\n dangerouslySetInnerHTML: { __html: props.maxLength ? truncate(html, props.maxLength) : html },\n })\n}\n","import React from \"react\"\nimport { useFider } from \"@fider/hooks\"\n\nimport \"./DevBanner.scss\"\n\nexport const DevBanner = () => {\n const fider = useFider()\n\n if (fider.isProduction()) {\n return null\n }\n\n return
    DEV
    \n}\n","import \"./Avatar.scss\"\n\nimport React from \"react\"\nimport { UserRole } from \"@fider/models\"\n\ninterface AvatarProps {\n user: {\n role?: UserRole\n avatarURL: string\n name: string\n }\n size?: \"small\" | \"normal\"\n}\n\nexport const Avatar = (props: AvatarProps) => {\n const size = props.size === \"small\" ? \"h-6 w-6\" : \"h-8 w-8\"\n return {props.user.name}\n}\n","import \"./AvatarStack.scss\"\n\nimport React from \"react\"\nimport { UserRole } from \"@fider/models\"\nimport { Avatar } from \"./Avatar\"\nimport { classSet } from \"@fider/services\"\n\ninterface AvatarStackProps {\n overlap?: boolean\n users: Array<{\n role?: UserRole\n avatarURL: string\n name: string\n }>\n}\n\nexport const AvatarStack = (props: AvatarStackProps) => {\n const classes = classSet({\n \"c-avatar-stack\": true,\n \"c-avatar-stack--overlap\": props.overlap ?? true,\n })\n\n return (\n
    \n {props.users.map((x, i) => (\n \n ))}\n
    \n )\n}\n","import \"./Message.scss\"\n\nimport React from \"react\"\nimport { classSet } from \"@fider/services\"\nimport IconCheckCircle from \"@fider/assets/images/heroicons-check-circle.svg\"\nimport IconExclamationCircle from \"@fider/assets/images/heroicons-exclamation-circle.svg\"\nimport IconExclamation from \"@fider/assets/images/heroicons-exclamation.svg\"\nimport { HStack } from \"@fider/components/layout\"\nimport { Icon } from \"./Icon\"\n\ninterface MessageProps {\n children?: React.ReactNode\n type: \"success\" | \"warning\" | \"error\"\n className?: string\n alignment?: \"center\"\n showIcon?: boolean\n}\n\nexport const Message: React.FunctionComponent = (props) => {\n const className = classSet({\n \"c-message\": true,\n [`c-message--${props.type}`]: true,\n [`c-message--icon`]: props.showIcon === true,\n [`${props.className}`]: props.className,\n })\n\n const icon = props.type === \"error\" ? IconExclamation : props.type === \"warning\" ? IconExclamationCircle : IconCheckCircle\n\n return (\n \n {props.showIcon === true && }\n {props.children}\n \n )\n}\n","import \"./Hint.scss\"\n\nimport React, { useState } from \"react\"\nimport IconX from \"@fider/assets/images/heroicons-x.svg\"\nimport { HStack } from \"@fider/components/layout\"\nimport { cache } from \"@fider/services\"\nimport { Icon } from \"./Icon\"\n\ninterface HintProps {\n children?: React.ReactNode\n permanentCloseKey?: string\n condition?: boolean\n}\n\nexport const Hint: React.FC = (props) => {\n const cacheKey: string | undefined = props.permanentCloseKey ? `Hint-Closed-${props.permanentCloseKey}` : undefined\n const [isClosed, setIsClosed] = useState(cacheKey ? cache.local.has(cacheKey) : false)\n\n const close = () => {\n if (cacheKey) {\n cache.local.set(cacheKey, \"true\")\n }\n setIsClosed(true)\n }\n\n if (props.condition === false || isClosed) {\n return null\n }\n\n return (\n \n {props.children}\n {cacheKey && }\n \n )\n}\n","import React from \"react\"\nimport { Modal, Checkbox } from \"@fider/components\"\nimport { useFider } from \"@fider/hooks\"\nimport { Trans } from \"@lingui/react/macro\"\n\ninterface LegalAgreementProps {\n onChange: (agreed: boolean) => void\n}\n\nexport const TermsOfService = () => {\n const fider = useFider()\n\n if (fider.settings.hasLegal) {\n return (\n \n Terms of Service\n \n )\n }\n return null\n}\n\nexport const PrivacyPolicy = () => {\n const fider = useFider()\n\n if (fider.settings.hasLegal) {\n return (\n \n Privacy Policy\n \n )\n }\n return null\n}\n\nexport const LegalNotice = () => {\n const fider = useFider()\n\n if (fider.settings.hasLegal) {\n return (\n

    \n \n By signing in, you agree to the and .\n \n

    \n )\n }\n return null\n}\n\nexport const LegalFooter = () => {\n const fider = useFider()\n\n if (fider.settings.hasLegal) {\n return (\n \n \n \n )\n }\n return null\n}\n\nexport const LegalAgreement: React.FunctionComponent = (props) => {\n const fider = useFider()\n\n if (fider.settings.hasLegal) {\n return (\n \n \n I have read and agree to the and .\n \n \n )\n }\n return null\n}\n","import React from \"react\"\nimport { Button, OAuthProviderLogo } from \"@fider/components\"\n\ninterface SocialSignInButtonProps {\n option: {\n displayName: string\n provider?: string\n url?: string\n logoBlobKey?: string\n logoURL?: string\n }\n className?: string\n redirectTo?: string\n}\n\nexport const SocialSignInButton = (props: SocialSignInButtonProps) => {\n const redirectTo = props.redirectTo || window.location.href\n const href = props.option.url ? `${props.option.url}?redirect=${redirectTo}` : undefined\n\n return (\n \n )\n}\n","import \"./SignInControl.scss\"\n\nimport React, { useState } from \"react\"\nimport { SocialSignInButton, Form, Button, Input, Message } from \"@fider/components\"\nimport { Divider } from \"@fider/components/layout\"\nimport { device, actions, Failure, isCookieEnabled } from \"@fider/services\"\nimport { useFider } from \"@fider/hooks\"\nimport { Trans } from \"@lingui/react/macro\"\n\ninterface SignInControlProps {\n useEmail: boolean\n redirectTo?: string\n onEmailSent?: (email: string) => void\n}\n\nexport const SignInControl: React.FunctionComponent = (props) => {\n const fider = useFider()\n const [showEmailForm, setShowEmailForm] = useState(fider.session.tenant ? fider.session.tenant.isEmailAuthAllowed : true)\n const [email, setEmail] = useState(\"\")\n const [error, setError] = useState(undefined)\n\n const forceShowEmailForm = (e: React.MouseEvent) => {\n e.preventDefault()\n setShowEmailForm(true)\n }\n\n const signIn = async () => {\n const result = await actions.signIn(email)\n if (result.ok) {\n setEmail(\"\")\n setError(undefined)\n if (props.onEmailSent) {\n props.onEmailSent(email)\n }\n } else if (result.error) {\n setError(result.error)\n }\n }\n\n const providersLen = fider.settings.oauth.length\n\n if (!isCookieEnabled()) {\n return (\n \n

    Cookies Required

    \n

    Cookies are not enabled on your browser. Please enable cookies in your browser preferences to continue.

    \n
    \n )\n }\n\n return (\n
    \n {providersLen > 0 && (\n <>\n
    \n {fider.settings.oauth.map((o) => (\n \n \n \n ))}\n
    \n {props.useEmail && }\n \n )}\n\n {props.useEmail &&\n (showEmailForm ? (\n
    \n

    \n Enter your email address to sign in\n

    \n
    \n \n Sign in\n \n }\n />\n \n {!fider.session.tenant.isEmailAuthAllowed && (\n

    \n Currently only allowed to sign in to an administrator account\n

    \n )}\n
    \n ) : (\n
    \n

    \n \n Email authentication has been disabled by an administrator. If you have an administrator account and need to bypass this restriction, please{\" \"}\n \n click here\n \n .\n \n

    \n
    \n ))}\n
    \n )\n}\n","import React from \"react\"\nimport { classSet, formatDate, timeSince } from \"@fider/services\"\n\ninterface MomentText {\n locale: string\n date: Date | string\n className?: string\n format?: \"relative\" | \"full\" | \"short\" | \"date\"\n}\n\nexport const Moment = (props: MomentText) => {\n if (!props.date) {\n return \n }\n\n const format = props.format || \"relative\"\n\n const now = new Date()\n const date = props.date instanceof Date ? props.date : new Date(props.date)\n const diff = (now.getTime() - date.getTime()) / (60 * 60 * 24 * 1000)\n const display =\n diff >= 365 && format === \"relative\"\n ? formatDate(props.locale, props.date, \"short\")\n : format === \"relative\"\n ? timeSince(props.locale, now, date)\n : format === \"date\"\n ? formatDate(props.locale, props.date, \"date\")\n : formatDate(props.locale, props.date, format)\n\n const tooltip = props.format === \"short\" ? formatDate(props.locale, props.date, \"full\") : undefined\n\n const className = classSet({\n ...(props.className ? { [props.className]: true } : {}),\n date: true,\n })\n\n return (\n \n {display}\n \n )\n}\n","import \"./Modal.scss\"\n\nimport React, { useEffect, useRef } from \"react\"\nimport ReactDOM from \"react-dom\"\nimport { classSet } from \"@fider/services\"\n\ninterface ModalWindowProps {\n children?: React.ReactNode\n className?: string\n isOpen: boolean\n size?: \"small\" | \"large\" | \"fluid\"\n canClose?: boolean\n center?: boolean\n onClose: () => void\n}\n\ninterface ModalFooterProps {\n align?: \"left\" | \"center\" | \"right\"\n children?: React.ReactNode\n}\n\nconst ModalWindow: React.FunctionComponent = ({ size = \"small\", canClose = true, center = true, ...props }) => {\n const root = useRef(document.getElementById(\"root-modal\"))\n\n useEffect(() => {\n if (props.isOpen) {\n document.body.style.overflow = \"hidden\"\n document.addEventListener(\"keydown\", keyDown, false)\n } else {\n document.body.style.overflow = \"\"\n document.removeEventListener(\"keydown\", keyDown, false)\n }\n }, [props.isOpen])\n\n const swallow = (evt: React.MouseEvent) => {\n evt.stopPropagation()\n }\n\n const keyDown = (event: KeyboardEvent) => {\n if (event.keyCode === 27) {\n // ESC\n close()\n }\n }\n\n const close = () => {\n if (canClose) {\n props.onClose()\n }\n }\n\n if (!props.isOpen || !root.current) {\n return null\n }\n\n const className = classSet({\n \"c-modal-window\": true,\n [`${props.className}`]: !!props.className,\n \"c-modal-window--center\": center,\n [`c-modal-window--${size}`]: true,\n })\n\n return ReactDOM.createPortal(\n
    \n
    \n
    \n {props.children}\n
    \n
    \n
    ,\n root.current\n )\n}\nconst Header = (props: { children: React.ReactNode }) =>
    {props.children}
    \nconst Content = (props: { children: React.ReactNode }) =>
    {props.children}
    \nconst Footer = (props: ModalFooterProps) => {\n const align = props.align || \"right\"\n const className = classSet({\n \"c-modal-footer\": true,\n [`c-modal-footer--${align}`]: true,\n })\n return
    {props.children}
    \n}\n\nexport const Modal = {\n Window: ModalWindow,\n Header,\n Content,\n Footer,\n}\n","import \"./UserName.scss\"\n\nimport React from \"react\"\nimport { isCollaborator, UserRole } from \"@fider/models\"\nimport { classSet } from \"@fider/services\"\n\ninterface UserNameProps {\n user: {\n id: number\n name: string\n role?: UserRole\n email?: string\n }\n showEmail?: boolean\n}\n\nexport const UserName = (props: UserNameProps) => {\n const isStaff = props.user.role && isCollaborator(props.user.role)\n const className = classSet({\n \"c-username\": true,\n \"c-username--staff\": isStaff,\n })\n\n return (\n
    \n {props.user.name || \"Anonymous\"}\n <>{props.showEmail && props.user.email && ({props.user.email})}\n\n {isStaff && (\n
    \n \n \n \n
    \n )}\n
    \n )\n}\n","import \"./Loader.scss\"\n\nimport React, { useState } from \"react\"\nimport { useTimeout } from \"@fider/hooks\"\nimport { classSet } from \"@fider/services\"\n\ninterface LoaderProps {\n text?: string\n className?: string\n}\n\nexport function Loader(props: LoaderProps) {\n const [show, setShow] = useState(false)\n\n useTimeout(() => {\n setShow(true)\n }, 500)\n\n const className = classSet({\n \"c-loader\": true,\n [props.className || \"\"]: props.className,\n })\n\n return show ? (\n
    \n
    \n {props.text && {props.text}}\n
    \n ) : null\n}\n","import React from \"react\"\nimport { uploadedImageURL } from \"@fider/services\"\nimport { useFider } from \"@fider/hooks\"\nimport { Tenant } from \"@fider/models\"\n\ntype Size = 24 | 50 | 100 | 200\n\ninterface TenantLogoProps {\n size: Size\n useFiderIfEmpty?: boolean\n}\n\nexport const TenantLogoURL = (tenant: Tenant, size: Size): string | undefined => {\n if (tenant && tenant.logoBlobKey) {\n return uploadedImageURL(tenant.logoBlobKey, size)\n }\n return undefined\n}\n\nexport const TenantLogo = ({ size, useFiderIfEmpty = false }: TenantLogoProps) => {\n const fider = useFider()\n\n const tenant = fider.session.tenant\n if (tenant && tenant.logoBlobKey) {\n return {tenant.name}\n } else if (useFiderIfEmpty) {\n return \"Fider\"\n }\n return null\n}\n\ninterface OAuthProviderLogoProps {\n option: {\n provider?: string\n displayName: string\n logoBlobKey?: string\n }\n}\n\nconst systemProvidersLogo: { [key: string]: string } = {\n google: `data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjwhRE9DVFlQRSBzdmcgIFBVQkxJQyAnLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4nICAnaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkJz48c3ZnIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDQwMCA0MDAiIGhlaWdodD0iNDAwcHgiIGlkPSJMYXllcl8xIiB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCA0MDAgNDAwIiB3aWR0aD0iNDAwcHgiIHhtbDpzcGFjZT0icHJlc2VydmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3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wLjExMywyLjQ1MSwxLjY0OSwyLjQ1MSwxLjY0OWMxLjQyNywyLjQ0MywzLjc0MywxLjczNyw0LjY1NCwxLjMyOWMwLjE0Ni0xLjAzNCwwLjU2LTEuNzM5LDEuMDE3LTIuMTM5ICBjLTMuNTUyLTAuNDA0LTcuMjg2LTEuNzc2LTcuMjg2LTcuOTA2YzAtMS43NDcsMC42MjMtMy4xNzQsMS42NDYtNC4yOTJDNy4yOCwxMC40NjQsNi43Myw4LjgzNyw3LjYwMiw2LjYzNCAgYzAsMCwxLjM0My0wLjQzLDQuMzk4LDEuNjQxYzEuMjc2LTAuMzU1LDIuNjQ1LTAuNTMyLDQuMDA1LTAuNTM4YzEuMzU5LDAuMDA2LDIuNzI3LDAuMTgzLDQuMDA1LDAuNTM4ICBjMy4wNTUtMi4wNyw0LjM5Ni0xLjY0MSw0LjM5Ni0xLjY0MWMwLjg3MiwyLjIwMywwLjMyMywzLjgzLDAuMTU5LDQuMjM0YzEuMDIzLDEuMTE4LDEuNjQ0LDIuNTQ1LDEuNjQ0LDQuMjkyICBjMCw2LjE0Ni0zLjc0LDcuNDk4LTcuMzA0LDcuODkzQzE5LjQ3OSwyMy41NDgsMjAsMjQuNTA4LDIwLDI2YzAsMiwwLDMuOTAyLDAsNC40MjhjMCwwLjQyOCwwLjI1OCwwLjkwMSwxLjA3LDAuNzQ2ICBDMjcuNDIyLDI5LjA1NSwzMiwyMy4wNjIsMzIsMTUuOTk3QzMyLDcuMTYyLDI0LjgzOCwwLDE2LjAwMywweiIgZmlsbD0iIzE4MTYxNiIgZmlsbC1ydWxlPSJldmVub2RkIi8+PGcvPjxnLz48Zy8+PGcvPjxnLz48Zy8+PC9zdmc+\",\n}\n\nexport const OAuthProviderLogoURL = (logoBlobKey?: string): string | undefined => {\n if (logoBlobKey) {\n return uploadedImageURL(logoBlobKey, 100)\n }\n return undefined\n}\n\nexport const OAuthProviderLogo = (props: OAuthProviderLogoProps) => {\n if (props.option.logoBlobKey) {\n return {props.option.displayName}\n }\n\n if (props.option.provider && props.option.provider in systemProvidersLogo) {\n return {props.option.displayName}\n }\n\n return null\n}\n","import \"./Toggle.scss\"\n\nimport React, { useState } from \"react\"\nimport { classSet } from \"@fider/services\"\nimport { HStack } from \"../layout\"\nimport { DisplayError, ValidationContext } from \"@fider/components\"\n\ninterface ToggleProps {\n field?: string\n label?: string\n active: boolean\n disabled?: boolean\n onToggle?: (active: boolean) => void\n}\n\nexport const Toggle: React.FC = (props) => {\n const [active, setActive] = useState(props.active)\n\n const toggle = () => {\n if (props.disabled) {\n return\n }\n\n const newActive = !active\n setActive(newActive)\n if (props.onToggle) {\n props.onToggle(newActive)\n }\n }\n\n const className = classSet({\n \"c-toggle\": true,\n \"c-toggle--enabled\": active,\n \"c-toggle--disabled\": !!props.disabled,\n })\n\n return (\n \n {(ctx) => (\n <>\n \n \n {props.label && {props.label}}\n \n {props.field && }\n \n )}\n \n )\n}\n","import React from \"react\"\nimport { classSet } from \"@fider/services\"\n\nimport \"./PoweredByFider.scss\"\n\ninterface PoweredByFiderProps {\n slot: string\n className?: string\n}\n\nexport const PoweredByFider = (props: PoweredByFiderProps) => {\n const source = encodeURIComponent(window?.location?.host || \"\")\n const medium = \"powered-by\"\n const campaign = props.slot\n\n const className = classSet({\n \"c-powered\": true,\n [props.className || \"\"]: props.className,\n })\n\n return (\n \n )\n}\n","import React from \"react\"\nimport { classSet } from \"@fider/services\"\n\ninterface PageTitleLogo {\n title: string\n subtitle?: string\n className?: string\n}\n\nexport const PageTitle = (props: PageTitleLogo) => {\n const className = classSet({\n \"mb-4\": true,\n [`${props.className}`]: props.className,\n })\n\n return (\n
    \n
    {props.title}
    \n
    {props.subtitle}
    \n
    \n )\n}\n","import \"./Dropdown.scss\"\n\nimport React, { createContext, useContext, useEffect, useRef, useState } from \"react\"\nimport { classSet } from \"@fider/services\"\n\ninterface DropdownListItemProps {\n href?: string\n onClick?: () => void\n className?: string\n children: React.ReactNode\n}\n\nconst ListItem = (props: DropdownListItemProps) => {\n const ctx = useContext(DropdownContext)\n const handleClick = () => {\n if (props.onClick) {\n props.onClick()\n }\n\n ctx?.close()\n }\n\n if (props.href) {\n return (\n \n {props.children}\n \n )\n }\n\n return (\n
    \n {props.children}\n
    \n )\n}\n\nconst Divider = () => {\n return
    \n}\n\ninterface DropdownProps {\n renderHandle: JSX.Element\n position?: \"left\" | \"right\"\n onToggled?: (isOpen: boolean) => void\n children: React.ReactNode\n wide?: boolean\n fullsceenSm?: boolean\n}\n\ninterface DropdownContextFuncs {\n close(): void\n}\n\nconst DropdownContext = createContext(null)\nDropdownContext.displayName = \"DropdownContext\"\n\nexport const Dropdown = (props: DropdownProps) => {\n const node = useRef(null)\n const [isOpen, setIsOpen] = useState(false)\n const position = props.position || \"right\"\n\n const changeToggleState = (newState: boolean) => {\n setIsOpen(newState)\n if (props.onToggled) {\n props.onToggled(newState)\n }\n }\n\n const toggleIsOpen = () => {\n changeToggleState(!isOpen)\n }\n\n const close = () => {\n changeToggleState(false)\n }\n\n const handleClick = (e: MouseEvent) => {\n if (node.current && node.current.contains(e.target as Node)) {\n return\n }\n\n close()\n }\n\n useEffect(() => {\n document.addEventListener(\"mousedown\", handleClick)\n\n return () => {\n document.removeEventListener(\"mousedown\", handleClick)\n }\n }, [])\n\n const listClassName = classSet({\n \"c-dropdown__list--wide\": props.wide,\n \"c-dropdown__list shadow-lg\": true,\n \"c-dropdown__list--fullscreen-small\": props.fullsceenSm,\n [`c-dropdown__list--${position}`]: position === \"left\",\n })\n\n return (\n \n
    \n \n {isOpen &&
    {props.children}
    }\n
    \n
    \n )\n}\n\nDropdown.ListItem = ListItem\nDropdown.Divider = Divider\n","import React from \"react\"\n\ninterface MomentProps {\n locale: string\n amount: number\n currency: string\n}\n\nexport const Money = (props: MomentProps) => {\n const formatter = new Intl.NumberFormat(props.locale, {\n style: \"currency\",\n currency: props.currency,\n })\n\n return {formatter.format(props.amount)}\n}\n","import \"./ShowTag.scss\"\n\nimport React from \"react\"\nimport { Tag } from \"@fider/models\"\nimport { classSet } from \"@fider/services\"\nimport ShieldCheck from \"@fider/assets/images/heroicons-shieldcheck.svg\"\nimport { Icon } from \"./common\"\n\ninterface TagProps {\n tag: Tag\n circular?: boolean\n link?: boolean\n}\n\n// const textColor = (color: string) => {\n// const components = getRGB(color)\n// const bgDelta = components.R * 0.299 + components.G * 0.587 + components.B * 0.114\n// return bgDelta > 140 ? \"#333\" : \"#fff\"\n// }\n\nexport const ShowTag = (props: TagProps) => {\n const className = classSet({\n \"c-tag\": true,\n \"c-tag--circular\": props.circular === true,\n })\n\n return (\n \n \n {!props.tag.isPublic && !props.circular && }\n {props.circular ? \"\" : props.tag.name || \"Tag\"}\n \n )\n}\n","import React, { useState } from \"react\"\nimport { SignInModal, TenantLogo, NotificationIndicator, UserMenu } from \"@fider/components\"\nimport { useFider } from \"@fider/hooks\"\nimport { HStack } from \"./layout\"\nimport { Trans } from \"@lingui/react/macro\"\n\nexport const Header = () => {\n const fider = useFider()\n const [isSignInModalOpen, setIsSignInModalOpen] = useState(false)\n\n const showModal = (e: React.MouseEvent) => {\n e.preventDefault()\n setIsSignInModalOpen(true)\n }\n\n const hideModal = () => setIsSignInModalOpen(false)\n\n return (\n
    \n \n \n
    \n \n \n \n

    {fider.session.tenant.name}

    \n
    \n {fider.session.isAuthenticated && (\n \n \n \n \n )}\n {!fider.session.isAuthenticated && (\n \n Sign in\n \n )}\n
    \n
    \n
    \n
    \n )\n}\n","import React, { useState, useEffect } from \"react\"\nimport { Modal, SignInControl, LegalFooter } from \"@fider/components\"\nimport { Button } from \"./common\"\nimport { Trans } from \"@lingui/react/macro\"\n\ninterface SignInModalProps {\n isOpen: boolean\n onClose: () => void\n}\n\nexport const SignInModal: React.FC = (props) => {\n const [email, setEmail] = useState(\"\")\n\n useEffect(() => {\n if (email) {\n setTimeout(() => setEmail(\"\"), 5000)\n }\n }, [email])\n\n const onEmailSent = (value: string): void => {\n setEmail(value)\n }\n\n const closeModal = () => {\n setEmail(\"\")\n props.onClose()\n }\n\n const content = email ? (\n <>\n

    \n \n We have just sent a confirmation link to {email}. Click the link and you’ll be signed in.\n \n

    \n

    \n \n

    \n \n ) : (\n \n )\n\n return (\n \n \n Sign in to participate and vote\n \n {content}\n \n \n )\n}\n","import \"./VoteCounter.scss\"\n\nimport React, { useState } from \"react\"\nimport { Post, PostStatus } from \"@fider/models\"\nimport { actions, classSet } from \"@fider/services\"\nimport { Icon, SignInModal } from \"@fider/components\"\nimport { useFider } from \"@fider/hooks\"\nimport FaCaretUp from \"@fider/assets/images/fa-caretup.svg\"\n\nexport interface VoteCounterProps {\n post: Post\n}\n\nexport const VoteCounter = (props: VoteCounterProps) => {\n const fider = useFider()\n const [hasVoted, setHasVoted] = useState(props.post.hasVoted)\n const [votesCount, setVotesCount] = useState(props.post.votesCount)\n const [isSignInModalOpen, setIsSignInModalOpen] = useState(false)\n\n const voteOrUndo = async () => {\n if (!fider.session.isAuthenticated) {\n setIsSignInModalOpen(true)\n return\n }\n\n const action = hasVoted ? actions.removeVote : actions.addVote\n\n const response = await action(props.post.number)\n if (response.ok) {\n setVotesCount(votesCount + (hasVoted ? -1 : 1))\n setHasVoted(!hasVoted)\n }\n }\n\n const hideModal = () => setIsSignInModalOpen(false)\n\n const status = PostStatus.Get(props.post.status)\n const isDisabled = status.closed || fider.isReadOnly\n\n const className = classSet({\n \"border-gray-200 border rounded-md bg-gray-100\": true,\n \"c-vote-counter__button\": true,\n \"c-vote-counter__button--voted\": !status.closed && hasVoted,\n \"c-vote-counter__button--disabled\": isDisabled,\n })\n\n const vote = (\n \n )\n\n const disabled = (\n \n )\n\n return (\n <>\n \n
    {isDisabled ? disabled : vote}
    \n \n )\n}\n","import \"./NotificationIndicator.scss\"\nimport NoDataIllustration from \"@fider/assets/images/undraw-empty.svg\"\n\nimport React, { useEffect, useState } from \"react\"\nimport IconBell from \"@fider/assets/images/heroicons-bell.svg\"\nimport { useFider } from \"@fider/hooks\"\nimport { actions, Fider } from \"@fider/services\"\nimport { Avatar, Icon, Markdown, Moment } from \"./common\"\nimport { Dropdown } from \"./common/Dropdown\"\nimport { Notification } from \"@fider/models\"\nimport { HStack, VStack } from \"./layout\"\n\nimport { Trans } from \"@lingui/react/macro\"\n\nexport const NotificationItem = ({ notification }: { notification: Notification }) => {\n const openNotification = () => {\n window.location.href = `/notifications/${notification.id}`\n }\n\n return (\n \n \n
    \n \n \n \n \n
    \n
    \n )\n}\n\nconst NotificationIcon = ({ unreadNotifications }: { unreadNotifications: number }) => {\n return (\n <>\n \n \n {unreadNotifications > 0 &&
    }\n \n \n )\n}\n\nexport const NotificationIndicator = () => {\n const fider = useFider()\n const [unreadNotifications, setUnreadNotifications] = useState(0)\n const [showingNotifications, setShowingNotifications] = useState(false)\n const [recent, setRecent] = useState()\n const [unread, setUnread] = useState()\n\n useEffect(() => {\n if (fider.session.isAuthenticated) {\n actions.getTotalUnreadNotifications().then((result) => {\n if (result.ok && result.data > 0) {\n setUnreadNotifications(result.data)\n }\n })\n }\n }, [fider.session.isAuthenticated])\n\n useEffect(() => {\n if (showingNotifications) {\n actions.getAllNotifications().then((result) => {\n if (result) {\n const [unread, recent] = (result.data || []).reduce(\n (result, item) => {\n result[item.read ? 1 : 0].push(item)\n return result\n },\n [[] as Notification[], [] as Notification[]]\n )\n setRecent(recent)\n setUnread(unread)\n setUnreadNotifications(unread.length)\n }\n })\n }\n }, [showingNotifications])\n\n const markAllAsRead = async (e: React.MouseEvent) => {\n e.preventDefault()\n const response = await actions.markAllAsRead()\n if (response.ok) {\n location.reload()\n }\n }\n\n return (\n setShowingNotifications(isOpen)}\n renderHandle={}\n >\n
    \n {showingNotifications && (unread !== undefined || recent !== undefined) && (\n <>\n {unread !== undefined && unread?.length > 0 ? (\n <>\n

    \n Unread notifications\n {unread.length > 1 && (\n \n Mark All as Read\n \n )}\n

    \n \n {unread.map((n) => (\n \n ))}\n \n \n ) : (\n
    \n

    \n No new notifications\n

    \n {recent?.length === 0 && }\n
    \n )}\n {recent !== undefined && recent?.length > 0 && (\n <>\n

    \n Previous notifications\n

    \n \n {recent.map((n) => (\n \n ))}\n \n \n )}\n \n )}\n
    \n \n )\n}\n","import React from \"react\"\nimport { useFider } from \"@fider/hooks\"\nimport { Avatar, Dropdown } from \"./common\"\nimport { Trans } from \"@lingui/react/macro\"\n\nexport const UserMenu = () => {\n const fider = useFider()\n\n return (\n
    \n }>\n
    {fider.session.user.name}
    \n \n My Settings\n \n \n\n {fider.session.user.isCollaborator && (\n <>\n
    \n Administration\n
    \n \n Site Settings\n \n \n \n )}\n \n Sign out\n \n
    \n
    \n )\n}\n","import React, { useEffect, useState } from \"react\"\nimport { ReactionCount } from \"@fider/models\"\nimport { Icon } from \"@fider/components\"\nimport ReactionAdd from \"@fider/assets/images/reaction-add.svg\"\nimport { HStack } from \"@fider/components/layout\"\nimport { classSet } from \"@fider/services\"\nimport { useFider } from \"@fider/hooks\"\nimport \"./Reactions.scss\"\n\ninterface ReactionsProps {\n emojiSelectorRef: React.RefObject\n toggleReaction: (emoji: string) => void\n reactions?: ReactionCount[]\n}\n\nconst availableEmojis = [\"👍\", \"👎\", \"😄\", \"🎉\", \"😕\", \"❤️\", \"🚀\", \"👀\"]\n\nexport const Reactions: React.FC = ({ emojiSelectorRef, toggleReaction, reactions }) => {\n const fider = useFider()\n const [isEmojiSelectorOpen, setIsEmojiSelectorOpen] = useState(false)\n\n useEffect(() => {\n const handleClickOutside = (event: MouseEvent) => {\n if (emojiSelectorRef.current && !emojiSelectorRef.current.contains(event.target as Node)) {\n setIsEmojiSelectorOpen(false)\n }\n }\n\n document.addEventListener(\"click\", handleClickOutside)\n return () => {\n document.removeEventListener(\"click\", handleClickOutside)\n }\n }, [])\n\n return (\n
    \n \n {fider.session.isAuthenticated && (\n <>\n setIsEmojiSelectorOpen(!isEmojiSelectorOpen)}\n className=\"c-reactions-add-reaction relative text-gray-600 clickable inline-flex items-center px-1 py-1 rounded-full text-xs bg-blue-100 hover:bg-blue-200\"\n >\n \n \n {isEmojiSelectorOpen && (\n
    \n {availableEmojis.map((emoji) => (\n {\n toggleReaction(emoji)\n setIsEmojiSelectorOpen(false)\n }}\n >\n {emoji}\n \n ))}\n
    \n )}\n \n )}\n {reactions !== undefined && (\n <>\n {reactions.map((reaction) => (\n toggleReaction(reaction.emoji) })}\n className={classSet({\n \"inline-flex items-center px-2 py-1 rounded-full text-xs\": true,\n \"bg-blue-100\": reaction.includesMe,\n \"bg-gray-100\": !reaction.includesMe,\n \"clickable hover:bg-blue-200\": fider.session.isAuthenticated && reaction.includesMe,\n \"clickable hover:bg-gray-200\": fider.session.isAuthenticated && !reaction.includesMe,\n })}\n >\n {reaction.emoji} {reaction.count}\n \n ))}\n \n )}\n
    \n
    \n )\n}\n","import React from \"react\"\nimport { useFider } from \"@fider/hooks\"\nimport { Message } from \"./common\"\n\nexport const ReadOnlyNotice = () => {\n const fider = useFider()\n if (!fider.isReadOnly) {\n return null\n }\n\n if (fider.session.isAuthenticated && fider.session.user.isAdministrator) {\n return (\n \n This website is currently in read-only mode because there is no active subscription. Visit{\" \"}\n \n Billing\n {\" \"}\n to subscribe.\n \n )\n }\n\n return (\n \n This website is currently in read-only mode.\n \n )\n}\n","import React from \"react\"\nimport { classSet } from \"@fider/services\"\n\ninterface StackProps {\n className?: string\n children: React.ReactNode\n onClick?: () => void\n divide?: boolean\n justify?: \"between\" | \"evenly\" | \"full\" | \"center\"\n align?: \"start\" | \"center\" | \"end\"\n spacing?: 0 | 1 | 2 | 4 | 6 | 8\n}\n\nconst Stack = (props: StackProps, dir: \"x\" | \"y\") => {\n const spacing = props.spacing === undefined ? 2 : props.spacing\n const className = classSet({\n [`${props.className}`]: props.className,\n flex: true,\n \"flex-x\": dir === \"x\",\n \"flex-y\": dir === \"y\",\n [`flex--spacing-${spacing}`]: spacing > 0 && !props.divide,\n [`flex--divide-${spacing}`]: spacing > 0 && !!props.divide,\n \"justify-between\": props.justify === \"between\",\n \"justify-evenly\": props.justify === \"evenly\",\n \"justify-full\": props.justify === \"full\",\n \"justify-center\": props.justify === \"center\",\n \"flex-items-start\": props.align === \"start\",\n \"flex-items-center\": props.align === \"center\" || (dir === \"x\" && props.align === undefined),\n \"flex-items-end\": props.align === \"end\",\n })\n\n return (\n
    \n {props.children}\n
    \n )\n}\n\nexport const HStack = (props: StackProps) => {\n return Stack(props, \"x\")\n}\n\nexport const VStack = (props: StackProps) => {\n return Stack(props, \"y\")\n}\n","import \"./Divider.scss\"\n\nimport React from \"react\"\nimport { Trans } from \"@lingui/react/macro\"\n\nexport const Divider = () => {\n return (\n
    \n OR\n
    \n )\n}\n","import { User } from \"./identity\"\n\nexport interface Post {\n id: number\n number: number\n slug: string\n title: string\n description: string\n createdAt: string\n status: string\n user: User\n hasVoted: boolean\n response: PostResponse | null\n votesCount: number\n commentsCount: number\n tags: string[]\n}\n\nexport class PostStatus {\n constructor(public title: string, public value: string, public show: boolean, public closed: boolean, public filterable: boolean) {}\n\n public static Open = new PostStatus(\"Open\", \"open\", false, false, true)\n public static Planned = new PostStatus(\"Planned\", \"planned\", true, false, true)\n public static Started = new PostStatus(\"Started\", \"started\", true, false, true)\n public static Completed = new PostStatus(\"Completed\", \"completed\", true, true, true)\n public static Declined = new PostStatus(\"Declined\", \"declined\", true, true, true)\n public static Duplicate = new PostStatus(\"Duplicate\", \"duplicate\", true, true, true)\n public static Deleted = new PostStatus(\"Deleted\", \"deleted\", false, true, true)\n\n public static Get(value: string): PostStatus {\n for (const status of PostStatus.All) {\n if (status.value === value) {\n return status\n }\n }\n throw new Error(`PostStatus not found for value ${value}.`)\n }\n\n public static All = [PostStatus.Open, PostStatus.Planned, PostStatus.Started, PostStatus.Completed, PostStatus.Duplicate, PostStatus.Declined]\n}\n\nexport interface PostResponse {\n user: User\n text: string\n respondedAt: Date\n original?: {\n number: number\n title: string\n slug: string\n status: string\n }\n}\n\nexport interface ReactionCount {\n emoji: string\n count: number\n includesMe: boolean\n}\n\nexport interface Comment {\n id: number\n content: string\n createdAt: string\n user: User\n attachments?: string[]\n reactionCounts?: ReactionCount[]\n editedAt?: string\n editedBy?: User\n}\n\nexport interface Tag {\n id: number\n slug: string\n name: string\n color: string\n isPublic: boolean\n}\n\nexport interface Vote {\n createdAt: Date\n user: {\n id: number\n name: string\n email: string\n avatarURL: string\n }\n}\n","export interface Tenant {\n id: number\n name: string\n cname: string\n subdomain: string\n locale: string\n invitation: string\n welcomeMessage: string\n status: TenantStatus\n isPrivate: boolean\n logoBlobKey: string\n isEmailAuthAllowed: boolean\n}\n\nexport enum TenantStatus {\n Active = 1,\n Pending = 2,\n Locked = 3,\n Disabled = 4,\n}\n\nexport interface User {\n id: number\n name: string\n email?: string\n role: UserRole\n status: UserStatus\n avatarURL: string\n}\n\nexport interface UserNames {\n id: number\n name: string\n}\n\nexport enum UserAvatarType {\n Letter = \"letter\",\n Gravatar = \"gravatar\",\n Custom = \"custom\",\n}\n\nexport enum UserStatus {\n Active = \"active\",\n Deleted = \"deleted\",\n Blocked = \"blocked\",\n}\n\nexport enum UserRole {\n Visitor = \"visitor\",\n Collaborator = \"collaborator\",\n Administrator = \"administrator\",\n}\n\nexport const isCollaborator = (role: UserRole): boolean => {\n return role === UserRole.Collaborator || role === UserRole.Administrator\n}\n\nexport interface CurrentUser {\n id: number\n name: string\n email: string\n avatarType: UserAvatarType\n avatarBlobKey: string\n avatarURL: string\n role: UserRole\n status: UserStatus\n isAdministrator: boolean\n isCollaborator: boolean\n}\n","export interface OAuthProviderOption {\n provider: string\n displayName: string\n clientID: string\n url: string\n callbackURL: string\n logoBlobKey: string\n isCustomProvider: boolean\n isEnabled: boolean\n}\n\nexport interface SystemSettings {\n mode: string\n locale: string\n version: string\n environment: string\n domain: string\n hasLegal: boolean\n isBillingEnabled: boolean\n baseURL: string\n assetsURL: string\n oauth: OAuthProviderOption[]\n}\n\nexport interface UserSettings {\n [key: string]: string\n}\n\nexport const OAuthConfigStatus = {\n Disabled: 1,\n Enabled: 2,\n}\n\nexport interface OAuthConfig {\n provider: string\n displayName: string\n status: number\n clientID: string\n clientSecret: string\n authorizeURL: string\n tokenURL: string\n profileURL: string\n logoBlobKey: string\n scope: string\n jsonUserIDPath: string\n jsonUserNamePath: string\n jsonUserEmailPath: string\n isTrusted: boolean\n}\n\nexport interface ImageUpload {\n bkey?: string\n upload?: {\n fileName?: string\n content?: string\n contentType?: string\n }\n remove: boolean\n}\n\nexport enum EmailVerificationKind {\n SignIn = 1,\n SignUp = 2,\n ChangeEmail = 3,\n UserInvitation = 4,\n}\n","export enum BillingStatus {\n Trial = 1,\n Active = 2,\n Cancelled = 3,\n FreeForever = 4,\n OpenCollective = 5,\n}\n","import { StringObject } from \"@fider/services\"\n\nexport interface WebhookData {\n name: string\n type: WebhookType\n status: WebhookStatus\n url: string\n content: string\n http_method: string\n http_headers: HttpHeaders\n}\n\nexport interface Webhook extends WebhookData {\n id: number\n}\n\nexport enum WebhookType {\n NEW_POST = \"new_post\",\n NEW_COMMENT = \"new_comment\",\n CHANGE_STATUS = \"change_status\",\n DELETE_POST = \"delete_post\",\n}\n\nexport enum WebhookStatus {\n ENABLED = \"enabled\",\n DISABLED = \"disabled\",\n FAILED = \"failed\",\n}\n\nexport type HttpHeaders = StringObject\n\nexport interface WebhookTriggerResult {\n webhook: Webhook\n props: StringObject\n success: boolean\n url: string\n content: string\n status_code: number\n message: string\n error: string\n}\n\nexport interface WebhookPreviewResult {\n url: PreviewedField\n content: PreviewedField\n}\n\nexport interface PreviewedField {\n value: string\n message: string\n error: string\n}\n","import { analytics, notify, truncate } from \"@fider/services\"\n\nexport interface ErrorItem {\n field?: string\n message: string\n}\n\nexport interface Failure {\n errors?: ErrorItem[]\n}\n\nexport interface Result {\n ok: boolean\n data: T\n error?: Failure\n}\n\nasync function toResult(response: Response): Promise> {\n const body = await response.json()\n\n if (response.status < 400) {\n return {\n ok: true,\n data: body as T,\n }\n }\n\n if (response.status === 500) {\n notify.error(\"An unexpected error occurred while processing your request.\")\n } else if (response.status === 401) {\n notify.error(\"You need to be authenticated to perform this operation.\")\n } else if (response.status === 403) {\n notify.error(\"You are not authorized to perform this operation.\")\n }\n\n return {\n ok: false,\n data: body as T,\n error: {\n errors: body.errors,\n },\n }\n}\nasync function request(url: string, method: \"GET\" | \"POST\" | \"PUT\" | \"DELETE\", body?: any): Promise> {\n const headers = [\n [\"Accept\", \"application/json\"],\n [\"Content-Type\", \"application/json\"],\n ]\n try {\n const response = await fetch(url, {\n method,\n headers,\n body: JSON.stringify(body),\n credentials: \"same-origin\",\n })\n return await toResult(response)\n } catch (err) {\n const truncatedBody = truncate(body ? JSON.stringify(body) : \"\", 1000)\n throw new Error(`Failed to ${method} ${url} with body '${truncatedBody}'`)\n }\n}\n\nexport const http = {\n get: async (url: string): Promise> => {\n return await request(url, \"GET\")\n },\n post: async (url: string, body?: any): Promise> => {\n return await request(url, \"POST\", body)\n },\n put: async (url: string, body?: any): Promise> => {\n return await request(url, \"PUT\", body)\n },\n delete: async (url: string, body?: any): Promise> => {\n return await request(url, \"DELETE\", body)\n },\n event:\n (category: string, action: string) =>\n (result: Result): Result => {\n if (result && result.ok) {\n analytics.event(category, action)\n }\n return result\n },\n}\n","const set = (storage: Storage, key: string, value: string): void => {\n if (storage) {\n storage.setItem(key, value)\n }\n}\n\nconst get = (storage: Storage, key: string): string | null => {\n if (window.localStorage) {\n return storage.getItem(key)\n }\n return null\n}\n\nconst has = (storage: Storage, key: string): boolean => {\n if (storage) {\n return !!storage.getItem(key)\n }\n return false\n}\n\nconst remove = (storage: Storage, ...keys: string[]): void => {\n if (storage && keys) {\n for (const key of keys) {\n storage.removeItem(key)\n }\n }\n}\n\nexport const cache = {\n local: {\n set: (key: string, value: string): void => {\n set(window.localStorage, key, value)\n },\n get: (key: string): string | null => {\n return get(window.localStorage, key)\n },\n has: (key: string): boolean => {\n return has(window.localStorage, key)\n },\n remove: (...keys: string[]): void => {\n remove(window.localStorage, ...keys)\n },\n },\n session: {\n set: (key: string, value: string): void => {\n set(window.sessionStorage, key, value)\n },\n get: (key: string): string | null => {\n return get(window.sessionStorage, key)\n },\n has: (key: string): boolean => {\n return has(window.sessionStorage, key)\n },\n remove: (...keys: string[]): void => {\n remove(window.sessionStorage, ...keys)\n },\n },\n}\n","export const analytics = {\n event: (eventCategory: string, eventAction: string): void => {\n if (window.ga) {\n window.ga(\"send\", \"event\", {\n eventCategory,\n eventAction,\n })\n }\n },\n error: (err?: Error): void => {\n if (window.ga) {\n window.ga(\"send\", \"exception\", {\n exDescription: err ? err.stack : \"\",\n exFatal: false,\n })\n }\n },\n}\n","import { createContext } from \"react\"\nimport { CurrentUser, SystemSettings, Tenant, TenantStatus } from \"@fider/models\"\n\nexport class FiderSession {\n private pPage: string\n private pContextID: string\n private pTenant: Tenant\n private pUser: CurrentUser | undefined\n private pProps: { [key: string]: any } = {}\n\n constructor(data: any) {\n this.pPage = data.page\n this.pContextID = data.contextID\n this.pProps = data.props\n this.pUser = data.user\n this.pTenant = data.tenant\n }\n\n public get page(): string {\n return this.pPage\n }\n\n public get contextID(): string {\n return this.pContextID\n }\n\n public get user(): CurrentUser {\n if (!this.pUser) throw new Error(\"User is undefined\")\n return this.pUser\n }\n\n public get tenant(): Tenant {\n return this.pTenant\n }\n\n public get props(): { [key: string]: any } {\n return this.pProps\n }\n\n public get isAuthenticated(): boolean {\n return !!this.pUser\n }\n}\n\nexport class FiderImpl {\n private pSettings!: SystemSettings\n private pSession!: FiderSession\n\n public initialize = (initData?: any): FiderImpl => {\n if (initData) {\n this.pSettings = initData.settings\n this.pSession = new FiderSession(initData)\n return this\n }\n\n const el = document.getElementById(\"server-data\")\n const data = el ? JSON.parse(el.textContent || el.innerText) : {}\n this.pSettings = data.settings\n this.pSession = new FiderSession(data)\n return this\n }\n\n public get currentLocale(): string {\n if (this.session.tenant) {\n return this.session.tenant.locale\n }\n return this.settings.locale\n }\n\n public get session(): FiderSession {\n return this.pSession\n }\n\n public get settings(): SystemSettings {\n return this.pSettings\n }\n\n public get isReadOnly(): boolean {\n return this.session.tenant && this.session.tenant.status === TenantStatus.Locked\n }\n\n public isProduction(): boolean {\n return this.pSettings.environment === \"production\"\n }\n\n public isSingleHostMode(): boolean {\n return this.pSettings.mode === \"single\"\n }\n}\n\nexport const Fider = new FiderImpl()\n\nexport const FiderContext = createContext(Fider)\n","export const jwt = {\n decode: (token: string): any => {\n if (token) {\n const segments = token.split(\".\")\n try {\n return JSON.parse(window.atob(segments[1]))\n } catch {\n return undefined\n }\n }\n },\n}\n","import { Fider } from \".\"\n\nexport const delay = (ms: number) => {\n return new Promise((resolve) => setTimeout(resolve, ms))\n}\n\nexport const classSet = (input?: any): string => {\n let classes = \"\"\n if (input) {\n for (const key in input) {\n if (key && !!input[key]) {\n classes += ` ${key}`\n }\n }\n return classes.trim()\n }\n return \"\"\n}\n\ntype DateFormat = \"full\" | \"short\" | \"date\"\ntype DateOptsMap = {\n [key in DateFormat]: Intl.DateTimeFormatOptions\n}\n\nconst dateOpts: DateOptsMap = {\n date: { day: \"numeric\", month: \"short\", year: \"numeric\" },\n short: { month: \"short\", year: \"numeric\" },\n full: { day: \"2-digit\", month: \"long\", year: \"numeric\", hour: \"numeric\", minute: \"numeric\" },\n}\n\nexport const formatDate = (locale: string, input: Date | string, format: DateFormat = \"full\"): string => {\n const date = input instanceof Date ? input : new Date(input)\n\n try {\n return new Intl.DateTimeFormat(locale, dateOpts[format]).format(date)\n } catch {\n return date.toLocaleString(locale)\n }\n}\n\nexport const timeSince = (locale: string, now: Date, date: Date, dateFormat: DateFormat = \"short\"): string => {\n try {\n const seconds = Math.round((now.getTime() - date.getTime()) / 1000)\n const minutes = Math.round(seconds / 60)\n const hours = Math.round(minutes / 60)\n const days = Math.round(hours / 24)\n const months = Math.round(days / 30)\n const years = Math.round(days / 365)\n\n const rtf = new Intl.RelativeTimeFormat(locale, { numeric: \"auto\" })\n return (\n (seconds < 60 && rtf.format(-1 * seconds, \"seconds\")) ||\n (minutes < 60 && rtf.format(-1 * minutes, \"minutes\")) ||\n (hours < 24 && rtf.format(-1 * hours, \"hours\")) ||\n (days < 30 && rtf.format(-1 * days, \"days\")) ||\n (days < 365 && rtf.format(-1 * months, \"months\")) ||\n rtf.format(-1 * years, \"years\")\n )\n } catch {\n return formatDate(locale, date, dateFormat)\n }\n}\nexport const fileToBase64 = async (file: File): Promise => {\n return new Promise((resolve, reject) => {\n const reader = new FileReader()\n reader.addEventListener(\n \"load\",\n () => {\n const parts = (reader.result as string).split(\"base64,\")\n resolve(parts[1])\n },\n false\n )\n\n reader.addEventListener(\n \"error\",\n () => {\n reject(reader.error)\n },\n false\n )\n\n reader.readAsDataURL(file)\n })\n}\n\nexport const timeAgo = (date: string | Date): number => {\n const d = date instanceof Date ? date : new Date(date)\n return (new Date().getTime() - d.getTime()) / 1000\n}\n\nexport const isCookieEnabled = (): boolean => {\n try {\n document.cookie = \"cookietest=1\"\n const ret = document.cookie.indexOf(\"cookietest=\") !== -1\n document.cookie = \"cookietest=1; expires=Thu, 01-Jan-1970 00:00:01 GMT\"\n return ret\n } catch (e) {\n return false\n }\n}\n\nexport const uploadedImageURL = (bkey: string | undefined, size?: number): string | undefined => {\n if (bkey) {\n if (size) {\n return `${Fider.settings.assetsURL}/static/images/${bkey}?size=${size}`\n }\n return `${Fider.settings.assetsURL}/static/images/${bkey}`\n }\n return undefined\n}\n\nexport const truncate = (input: string, maxLength: number): string => {\n if (input && input.length > maxLength) {\n return `${input.substr(0, maxLength)}...`\n }\n return input\n}\n\nexport type StringObject = {\n [key: string]: T\n}\n\nexport const copyToClipboard = (text: string): Promise => {\n if (window.navigator && window.navigator.clipboard && window.navigator.clipboard.writeText) {\n return window.navigator.clipboard.writeText(text)\n }\n return Promise.reject(new Error(\"Clipboard API not available\"))\n}\n\nexport const clearUrlHash = (replace?: boolean) => {\n const oldURL = window.location.href\n const newURL = window.location.pathname + window.location.search\n if (replace) {\n window.history.replaceState(\"\", document.title, newURL)\n } else {\n window.history.pushState(\"\", document.title, newURL)\n }\n // Trigger event manually\n const hashChangeEvent = new HashChangeEvent(\"hashchange\", {\n oldURL,\n newURL,\n cancelable: true,\n bubbles: true,\n composed: false,\n })\n if (!window.dispatchEvent(hashChangeEvent)) {\n // Event got cancelled\n window.history.replaceState(\"\", document.title, oldURL)\n }\n}\n","import { i18n } from \"@lingui/core\"\n\nexport function activateI18NSync(locale: string, messages?: any) {\n i18n.load(locale, messages)\n i18n.activate(locale)\n return i18n\n}\n\nexport async function activateI18N(locale: string) {\n try {\n const content = await import(\n /* webpackChunkName: \"locale-[request]\" */\n `@locale/${locale}/client.json`\n )\n return activateI18NSync(locale, content.messages)\n } catch (err) {\n console.error(err)\n return activateI18NSync(locale)\n }\n}\n","import { marked } from \"marked\"\nimport DOMPurify from \"dompurify\"\n\nmarked.setOptions({\n headerIds: false,\n xhtml: true,\n smartLists: true,\n gfm: true,\n breaks: true,\n})\n\nif (DOMPurify.isSupported) {\n DOMPurify.setConfig({\n USE_PROFILES: {\n html: true,\n },\n ADD_ATTR: [\"target\"],\n })\n}\n\nconst link = (href: string, title: string, text: string) => {\n const titleAttr = title ? ` title=${title}` : \"\"\n return `${text}`\n}\n\nconst fullRenderer = new marked.Renderer()\nfullRenderer.image = () => \"\"\nfullRenderer.link = link\nfullRenderer.text = (text: string) => {\n // Handling mention links (they're in the format @[name])\n return text.replace(/@\\[(.*?)\\]/g, (match, name) => {\n return `@${name}`\n })\n}\n\nconst plainTextRenderer = new marked.Renderer()\nplainTextRenderer.link = (_href, _title, text) => text\nplainTextRenderer.image = () => \"\"\nplainTextRenderer.br = () => \" \"\nplainTextRenderer.strong = (text) => text\nplainTextRenderer.list = (body) => body\nplainTextRenderer.listitem = (text) => `${text} `\nplainTextRenderer.heading = (text) => text\nplainTextRenderer.paragraph = (text) => ` ${text} `\nplainTextRenderer.code = (code) => code\nplainTextRenderer.codespan = (code) => code\nplainTextRenderer.html = (html) => html\nplainTextRenderer.del = (text) => text\n\nconst entities: { [key: string]: string } = {\n // \"<\": \"<\",\n // \">\": \">\",\n}\n\nconst encodeHTML = (s: string) => s.replace(/[<>]/g, (tag) => entities[tag] || tag)\nconst sanitize = (input: string) => (DOMPurify.isSupported ? DOMPurify.sanitize(input) : input)\n\nexport const full = (input: string): string => {\n return sanitize(marked(encodeHTML(input), { renderer: fullRenderer }).trim())\n}\n\nexport const plainText = (input: string): string => {\n return sanitize(marked(encodeHTML(input), { renderer: plainTextRenderer }).trim())\n}\n","const toastify = () => import(/* webpackChunkName: \"toastify\" */ \"./toastify\")\n\nexport const success = (content: string | JSX.Element) => {\n return toastify().then((toast) => {\n toast.success(content)\n })\n}\n\nexport const error = (content: string | JSX.Element) => {\n return toastify().then((toast) => {\n toast.error(content)\n })\n}\n","import { Fider } from \"@fider/services\"\n\nconst navigator = {\n url: () => {\n return window.location.href\n },\n goHome: () => {\n window.location.href = \"/\"\n },\n goTo: (url: string) => {\n const isEqual = window.location.href === url || window.location.pathname === url\n if (!isEqual) {\n window.location.href = url\n }\n },\n replaceState: (path: string): void => {\n if (history.replaceState !== undefined) {\n const newURL = Fider.settings.baseURL + path\n window.history.replaceState({ path: newURL }, \"\", newURL)\n }\n },\n}\n\nexport default navigator\n","import navigator from \"./navigator\"\n\nexport const getNumber = (name: string): number | undefined => {\n return parseInt(get(name), 10) || undefined\n}\n\nexport const set = (name: string, value: any): string => {\n const uri = navigator.url()\n const re = new RegExp(\"([?&])\" + name + \"=.*?(&|$)\", \"i\")\n if (uri.match(re)) {\n return uri.replace(re, \"$1\" + name + \"=\" + value + \"$2\")\n } else {\n const separator = uri.indexOf(\"?\") !== -1 ? \"&\" : \"?\"\n return uri + separator + name + \"=\" + value\n }\n}\n\nexport const get = (name: string): string => {\n name = name.replace(/[[\\]]/g, \"\\\\$&\")\n const regex = new RegExp(\"[?&]\" + name + \"(=([^&#]*)|&|#|$)\")\n const url = navigator.url()\n const results = regex.exec(url)\n\n if (!results || !results[2]) {\n return \"\"\n }\n\n return decodeURIComponent(results[2].replace(/\\+/g, \" \"))\n}\n\nexport const getArray = (name: string): string[] => {\n const qs = get(name)\n if (qs) {\n return qs.split(\",\").filter((i) => i)\n }\n\n return []\n}\n\nexport interface QueryString {\n [key: string]: string | string[] | number | undefined\n}\n\nexport const stringify = (object: QueryString | undefined): string => {\n if (!object) {\n return \"\"\n }\n\n let qs = \"\"\n\n for (const key of Object.keys(object)) {\n const symbol = qs ? \"&\" : \"?\"\n const value = object[key]\n if (value instanceof Array) {\n if (value.length > 0) {\n qs += `${symbol}${key}=${value.join(\",\")}`\n }\n } else if (value) {\n qs += `${symbol}${key}=${encodeURIComponent(value.toString()).replace(/%20/g, \"+\")}`\n }\n }\n\n return qs\n}\n","export const isTouch = (): boolean => {\n return \"ontouchstart\" in window || navigator.maxTouchPoints > 0\n}\n","import { http, Result } from \"@fider/services/http\"\nimport { UserSettings, UserAvatarType, ImageUpload } from \"@fider/models\"\n\ninterface UpdateUserSettings {\n name: string\n avatar?: ImageUpload\n avatarType: UserAvatarType\n settings: UserSettings\n}\n\nexport const updateUserSettings = async (request: UpdateUserSettings): Promise => {\n return await http.post(\"/_api/user/settings\", request)\n}\n\nexport const changeUserEmail = async (email: string): Promise => {\n return await http.post(\"/_api/user/change-email\", {\n email,\n })\n}\n\nexport const deleteCurrentAccount = async (): Promise => {\n return await http.delete(\"/_api/user\")\n}\n\nexport const regenerateAPIKey = async (): Promise> => {\n return await http.post<{ apiKey: string }>(\"/_api/user/regenerate-apikey\")\n}\n","import { http, Result } from \"@fider/services/http\"\nimport { Tag } from \"@fider/models\"\n\nexport const createTag = async (name: string, color: string, isPublic: boolean): Promise> => {\n return http.post(`/api/v1/tags`, { name, color, isPublic }).then(http.event(\"tag\", \"create\"))\n}\n\nexport const updateTag = async (slug: string, name: string, color: string, isPublic: boolean): Promise> => {\n return http.put(`/api/v1/tags/${slug}`, { name, color, isPublic }).then(http.event(\"tag\", \"update\"))\n}\n\nexport const deleteTag = async (slug: string): Promise => {\n return http.delete(`/api/v1/tags/${slug}`).then(http.event(\"tag\", \"delete\"))\n}\n\nexport const assignTag = async (slug: string, postNumber: number): Promise => {\n return http.post(`/api/v1/posts/${postNumber}/tags/${slug}`).then(http.event(\"tag\", \"assign\"))\n}\n\nexport const unassignTag = async (slug: string, postNumber: number): Promise => {\n return http.delete(`/api/v1/posts/${postNumber}/tags/${slug}`).then(http.event(\"tag\", \"unassign\"))\n}\n","import { http, Result, querystring } from \"@fider/services\"\nimport { Post, Vote, ImageUpload, UserNames } from \"@fider/models\"\n\nexport const getAllPosts = async (): Promise> => {\n return await http.get(\"/api/v1/posts\")\n}\n\nexport interface SearchPostsParams {\n query?: string\n view?: string\n limit?: number\n tags?: string[]\n myVotes?: boolean\n statuses?: string[]\n}\n\nexport const searchPosts = async (params: SearchPostsParams): Promise> => {\n let qsParams = querystring.stringify({\n tags: params.tags,\n statuses: params.statuses,\n query: params.query,\n view: params.view,\n limit: params.limit,\n })\n if (params.myVotes) {\n qsParams += `&myvotes=true`\n }\n return await http.get(`/api/v1/posts${qsParams}`)\n}\n\nexport const deletePost = async (postNumber: number, text: string): Promise => {\n return http\n .delete(`/api/v1/posts/${postNumber}`, {\n text,\n })\n .then(http.event(\"post\", \"delete\"))\n}\n\nexport const addVote = async (postNumber: number): Promise => {\n return http.post(`/api/v1/posts/${postNumber}/votes`).then(http.event(\"post\", \"vote\"))\n}\n\nexport const removeVote = async (postNumber: number): Promise => {\n return http.delete(`/api/v1/posts/${postNumber}/votes`).then(http.event(\"post\", \"unvote\"))\n}\n\nexport const toggleVote = async (postNumber: number): Promise> => {\n return http.post<{ voted: boolean }>(`/api/v1/posts/${postNumber}/votes/toggle`).then(http.event(\"post\", \"toggle-vote\"))\n}\n\nexport const subscribe = async (postNumber: number): Promise => {\n return http.post(`/api/v1/posts/${postNumber}/subscription`).then(http.event(\"post\", \"subscribe\"))\n}\n\nexport const unsubscribe = async (postNumber: number): Promise => {\n return http.delete(`/api/v1/posts/${postNumber}/subscription`).then(http.event(\"post\", \"unsubscribe\"))\n}\n\nexport const listVotes = async (postNumber: number): Promise> => {\n return http.get(`/api/v1/posts/${postNumber}/votes`)\n}\n\nexport const getTaggableUsers = async (userFilter: string): Promise> => {\n return http.get(`/api/v1/taggable-users${querystring.stringify({ query: userFilter })}`)\n}\n\nexport const createComment = async (postNumber: number, content: string, attachments: ImageUpload[]): Promise => {\n return http.post(`/api/v1/posts/${postNumber}/comments`, { content, attachments }).then(http.event(\"comment\", \"create\"))\n}\n\nexport const updateComment = async (postNumber: number, commentID: number, content: string, attachments: ImageUpload[]): Promise => {\n return http.put(`/api/v1/posts/${postNumber}/comments/${commentID}`, { content, attachments }).then(http.event(\"comment\", \"update\"))\n}\n\nexport const deleteComment = async (postNumber: number, commentID: number): Promise => {\n return http.delete(`/api/v1/posts/${postNumber}/comments/${commentID}`).then(http.event(\"comment\", \"delete\"))\n}\ninterface ToggleReactionResponse {\n added: boolean\n}\n\nexport const toggleCommentReaction = async (postNumber: number, commentID: number, emoji: string): Promise> => {\n return http.post(`/api/v1/posts/${postNumber}/comments/${commentID}/reactions/${emoji}`)\n}\n\ninterface SetResponseInput {\n status: string\n text: string\n originalNumber: number\n}\n\nexport const respond = async (postNumber: number, input: SetResponseInput): Promise => {\n return http\n .put(`/api/v1/posts/${postNumber}/status`, {\n status: input.status,\n text: input.text,\n originalNumber: input.originalNumber,\n })\n .then(http.event(\"post\", \"respond\"))\n}\n\ninterface CreatePostResponse {\n id: number\n number: number\n title: string\n slug: string\n}\n\nexport const createPost = async (title: string, description: string, attachments: ImageUpload[]): Promise> => {\n return http.post(`/api/v1/posts`, { title, description, attachments }).then(http.event(\"post\", \"create\"))\n}\n\nexport const updatePost = async (postNumber: number, title: string, description: string, attachments: ImageUpload[]): Promise => {\n return http.put(`/api/v1/posts/${postNumber}`, { title, description, attachments }).then(http.event(\"post\", \"update\"))\n}\n","import { http, Result } from \"@fider/services/http\"\nimport { UserRole, OAuthConfig, ImageUpload, EmailVerificationKind } from \"@fider/models\"\n\nexport interface CheckAvailabilityResponse {\n message: string\n}\n\nexport interface CreateTenantRequest {\n legalAgreement: boolean\n tenantName: string\n subdomain?: string\n name?: string\n token?: string\n email?: string\n}\n\nexport interface CreateTenantResponse {\n token?: string\n}\n\nexport const createTenant = async (request: CreateTenantRequest): Promise> => {\n return await http.post(\"/_api/tenants\", request)\n}\n\nexport interface UpdateTenantSettingsRequest {\n logo?: ImageUpload\n title: string\n invitation: string\n welcomeMessage: string\n cname: string\n locale: string\n}\n\nexport const updateTenantSettings = async (request: UpdateTenantSettingsRequest): Promise => {\n return await http.post(\"/_api/admin/settings/general\", request)\n}\n\nexport const updateTenantAdvancedSettings = async (customCSS: string): Promise => {\n return await http.post(\"/_api/admin/settings/advanced\", { customCSS })\n}\n\nexport const updateTenantPrivacy = async (isPrivate: boolean): Promise => {\n return await http.post(\"/_api/admin/settings/privacy\", {\n isPrivate,\n })\n}\n\nexport const updateTenantEmailAuthAllowed = async (isEmailAuthAllowed: boolean): Promise => {\n return await http.post(\"/_api/admin/settings/emailauth\", {\n isEmailAuthAllowed,\n })\n}\n\nexport const checkAvailability = async (subdomain: string): Promise> => {\n return await http.get(`/_api/tenants/${subdomain}/availability`)\n}\n\nexport const signIn = async (email: string): Promise => {\n return await http.post(\"/_api/signin\", {\n email,\n })\n}\n\nexport const completeProfile = async (kind: EmailVerificationKind, key: string, name: string): Promise => {\n return await http.post(\"/_api/signin/complete\", {\n kind,\n key,\n name,\n })\n}\n\nexport const changeUserRole = async (userID: number, role: UserRole): Promise => {\n return await http.post(`/_api/admin/roles/${role}/users`, {\n userID,\n })\n}\n\nexport const blockUser = async (userID: number): Promise => {\n return await http.put(`/_api/admin/users/${userID}/block`)\n}\n\nexport const unblockUser = async (userID: number): Promise => {\n return await http.delete(`/_api/admin/users/${userID}/block`)\n}\n\nexport const getOAuthConfig = async (provider: string): Promise> => {\n return await http.get(`/_api/admin/oauth/${provider}`)\n}\n\nexport interface CreateEditOAuthConfigRequest {\n provider: string\n status: number\n displayName: string\n clientID: string\n clientSecret: string\n authorizeURL: string\n tokenURL: string\n scope: string\n profileURL: string\n jsonUserIDPath: string\n jsonUserNamePath: string\n jsonUserEmailPath: string\n logo?: ImageUpload\n isTrusted: boolean\n}\n\nexport const saveOAuthConfig = async (request: CreateEditOAuthConfigRequest): Promise => {\n return await http.post(\"/_api/admin/oauth\", request)\n}\n","import { http, Result } from \"@fider/services\"\nimport { Notification } from \"@fider/models\"\n\nexport const getTotalUnreadNotifications = async (): Promise> => {\n return http.get<{ total: number }>(\"/_api/notifications/unread/total\").then((result) => {\n return {\n ok: result.ok,\n error: result.error,\n data: result.data ? result.data.total : 0,\n }\n })\n}\n\nexport const getAllNotifications = async (): Promise> => {\n return http.get(\"/_api/notifications/unread\")\n}\n\nexport const markAllAsRead = async (): Promise => {\n return await http.post(\"/_api/notifications/read-all\")\n}\n","import { http, Result } from \"@fider/services\"\n\nexport const sendInvites = async (subject: string, message: string, recipients: string[]): Promise => {\n return http.post(\"/api/v1/invitations/send\", { subject, message, recipients }).then(http.event(\"invite\", \"send\"))\n}\n\nexport const sendSampleInvite = async (subject: string, message: string): Promise => {\n return http.post(\"/api/v1/invitations/sample\", { subject, message }).then(http.event(\"invite\", \"sample\"))\n}\n","import { http, Result, navigator, analytics } from \"@fider/services\"\n\nconst ignoreErrors = [\n \"http://gj.track.uc.cn/collect\", // CSP error: UC Browser tries to use sendBeacon to this domain, which is blocked by our CSP rule\n \"null is not an object (evaluating 'c.sheet.insertRule')\", // CSP error: UC Browser throws this error even when page is loaded sucessfully\n \"Refused to evaluate a string as JavaScript because 'unsafe-eval'\", // CSP error: usually thrown because of bad Chrome Extensions\n \"vid_mate_check is not defined\", // CSP error: thrown by VidMate, an Android Browser\n \"SecurityError: Failed to read the 'cssRules' property from 'CSSStyleSheet': Cannot access rules\", // CSP error: usually thrown because of bad Chrome Extensions\n]\n\nexport const logError = async (message: string, err?: Error): Promise => {\n for (const pattern of ignoreErrors) {\n if (message.indexOf(pattern) >= 0) {\n return\n }\n }\n\n const data = {\n url: navigator.url(),\n stack: err ? err.stack : \"\",\n }\n\n try {\n analytics.error(err)\n return await http.post(\"/_api/log-error\", { message, data })\n } catch (err) {\n console.error(err)\n }\n}\n","import { http, Result, StringObject } from \"@fider/services\"\nimport { WebhookData, WebhookPreviewResult, WebhookTriggerResult, WebhookType } from \"@fider/models\"\n\nexport const createWebhook = async (data: WebhookData): Promise> => {\n return await http.post(`/_api/admin/webhook`, data)\n}\n\nexport const updateWebhook = async (id: number, data: WebhookData): Promise => {\n return await http.put(`/_api/admin/webhook/${id}`, data)\n}\n\nexport const deleteWebhook = async (id: number): Promise => {\n return await http.delete(`/_api/admin/webhook/${id}`)\n}\n\nexport const testWebhook = async (id: number): Promise> => {\n return await http.get(`/_api/admin/webhook/test/${id}`)\n}\n\nexport const previewWebhook = async (type: WebhookType, url: string, content: string): Promise> => {\n return await http.post(\"/_api/admin/webhook/preview\", { type, url, content })\n}\n\nexport const getWebhookHelp = async (type: WebhookType): Promise> => {\n return await http.get(`/_api/admin/webhook/props/${type}`)\n}\n","import { http, Result } from \"../http\"\n\ninterface CheckoutPageLink {\n url: string\n}\n\nexport const generateCheckoutLink = async (planId: string): Promise> => {\n return await http.post(\"/_api/billing/checkout-link\", { planId })\n}\n","import { I18nProvider } from \"@lingui/react\"\nimport React from \"react\"\nimport ReactDOM from \"react-dom/client\"\nimport { i18n } from \"@lingui/core\"\n\nimport { ToastContainer, toast, ToastContent, ToastOptions } from \"react-toastify\"\nimport \"react-toastify/dist/ReactToastify.css\"\n\nlet hasContainer = false\n\nconst setup = () => {\n if (!hasContainer) {\n hasContainer = true\n const rootElement = document.getElementById(\"root-toastify\")\n if (rootElement) {\n const root = ReactDOM.createRoot(rootElement)\n root.render(\n \n \n \n )\n }\n }\n}\nexport const success = (content: ToastContent, options?: ToastOptions) => {\n setup()\n toast.success(content, options)\n}\n\nexport const error = (content: ToastContent, options?: ToastOptions) => {\n setup()\n toast.error(content, options)\n}\n"],"names":["HoverInfo","props","Elem","href","classList","classSet","clickable","undefined","onClick","React","className","text","target","Icon","width","height","sprite","IconInformationCircle","styles","style","src","viewBox","xlinkHref","id","MentionList","forwardRef","ref","selectedIndex","setSelectedIndex","useState","selectItem","index","item","items","command","useEffect","useImperativeHandle","onKeyDown","event","key","length","map","label","displayName","cachedUsers","async","query","result","actions","ok","data","user","toString","name","filter","toLowerCase","startsWith","slice","render","reactRenderer","containerElement","scrollListener","clickOutsideListener","initialPosition","onStart","ReactRenderer","editor","clientRect","MouseEvent","Node","contains","window","removeEventListener","document","parentNode","body","removeChild","view","focus","setTimeout","addEventListener","createElement","position","zIndex","appendChild","element","rect","top","bottom","scrollY","left","scrollX","passive","onUpdate","updateProps","console","log","onExit","destroy","CustomMention","Mention","extend","addStorage","markdown","serialize","state","node","write","attrs","parse","setup","markdownit","renderer","rules","mention_open","tokens","idx","token","attrGet","mention_close","inline","ruler","before","silent","match","pos","push","content","MenuBar","isMarkdownMode","toggleMarkdownMode","disabled","type","title","chain","toggleHeading","level","run","isActive","IconH2","IconH3","toggleBold","IconBold","toggleItalic","IconItalic","toggleStrike","IconStrike","toggleBulletList","IconBulletList","toggleOrderedList","IconOrderedList","toggleCodeBlock","IconCode","from","selection","textBefore","doc","textBetween","Math","max","insertContent","IconAt","_Trans","markdownToHtml","markdownString","split","line","join","replace","Tiptap","isRawMarkdownMode","setIsRawMarkdownMode","editorContent","setEditorContent","initialValue","extensions","Document","Paragraph","Text","HardBreak","Placeholder","configure","placeholder","emptyEditorClass","StarterKit","Markdown","html","breaks","HTMLAttributes","class","suggestion","useEditor","updated","getText","storage","getMarkdown","onChange","onFocus","editorProps","attributes","currentContent","EditorContent","prevProps","nextProps","ErrorBoundary","constructor","super","this","error","errorInfo","componentDidCatch","onError","setState","FiderContext","Consumer","fider","ErrorPage","showDetails","isProduction","children","ResponseDetails","status","PostStatus","Get","response","Open","VStack","align","spacing","ResponseLozenge","timeSince","Date","respondedAt","Duplicate","original","number","slug","icon","bg","color","border","Declined","HeroIconThumbsDown","HeroIconDuplicate","Completed","HeroIconCheck","Planned","HeroIconThumbsUp","HeroIconSparkles","getLozengeProps","HStack","small","value","ShowPostStatus","i18n","_","message","ButtonClickEvent","preventEnable","shouldEnable","canEnable","Button","size","variant","clicked","setClicked","unmountedContainer","useRef","current","buttonContent","onClickProp","rel","e","preventDefault","stopPropagation","ValidationContext","Form","autoComplete","DisplayError","Provider","arrayToTag","m","hasError","field","errors","err","dict","reduce","fields","Object","keys","prototype","hasOwnProperty","call","forEach","t","Input","currentTarget","suffix","onIconClick","ctx","htmlFor","afterLabel","tabIndex","noTabFocus","inputRef","autoFocus","maxLength","ImageUploader","_defineProperty","files","file","alert","base64","fileToBase64","bkey","upload","fileName","contentType","remove","previewURL","instanceID","fileSelector","click","showModal","uploadedImageURL","modal","Modal","Window","isOpen","onClose","closeModal","center","Content","alt","Footer","isUploading","hasFile","openModal","removeFile","fileChanged","accept","selectFile","IconPhotograph","MultiImageUploader","instances","removed","count","maxUploads","addNewElement","triggerOnChange","bkeys","uploads","k","concat","x","btoa","random","imageUploaded","elements","TextArea","selectionStart","Textarea","minRows","RadioButton","selected","setSelected","defaultOption","option","onSelect","inputs","options","checked","Select","filtered","getOption","defaultValue","o","Field","Checkbox","setChecked","isChecked","ImageViewerModal","loadedPreview","Loader","onLoad","onPreviewLoad","imgSrc","ImageViewer","setShowModal","loadedThumbnail","setLoadedThumbnail","setLoadedPreview","onThumbnailLoad","tagName","dangerouslySetInnerHTML","__html","truncate","DevBanner","useFider","Avatar","avatarURL","AvatarStack","classes","overlap","users","i","Message","showIcon","IconExclamation","IconExclamationCircle","IconCheckCircle","justify","alignment","Hint","cacheKey","permanentCloseKey","isClosed","setIsClosed","cache","local","has","condition","IconX","close","set","TermsOfService","settings","hasLegal","PrivacyPolicy","LegalNotice","components","0","1","LegalFooter","LegalAgreement","SocialSignInButton","redirectTo","location","url","logoURL","OAuthProviderLogo","SignInControl","showEmailForm","setShowEmailForm","session","tenant","isEmailAuthAllowed","email","setEmail","setError","providersLen","oauth","isCookieEnabled","provider","useEmail","Divider","device","onEmailSent","Moment","date","format","now","display","getTime","formatDate","locale","tooltip","ModalWindow","canClose","root","getElementById","overflow","keyDown","keyCode","ReactDOM","evt","Header","UserName","isStaff","role","isCollaborator","showEmail","xmlns","fill","fillRule","d","clipRule","show","setShow","useTimeout","TenantLogoURL","logoBlobKey","TenantLogo","useFiderIfEmpty","systemProvidersLogo","google","facebook","github","OAuthProviderLogoURL","Toggle","active","setActive","toggle","newActive","onToggle","PoweredByFider","source","encodeURIComponent","host","campaign","slot","PageTitle","subtitle","DropdownContext","createContext","Dropdown","setIsOpen","changeToggleState","newState","onToggled","handleClick","listClassName","wide","fullsceenSm","toggleIsOpen","renderHandle","ListItem","useContext","Money","formatter","Intl","NumberFormat","currency","amount","ShowTag","circular","link","tag","isPublic","backgroundColor","ShieldCheck","isSignInModalOpen","setIsSignInModalOpen","SignInModal","hideModal","isAuthenticated","NotificationIndicator","UserMenu","values","VoteCounter","hasVoted","setHasVoted","post","votesCount","setVotesCount","isDisabled","closed","isReadOnly","vote","action","FaCaretUp","NotificationItem","notification","openNotification","authorName","Fider","currentLocale","createdAt","NotificationIcon","unreadNotifications","IconBell","setUnreadNotifications","showingNotifications","setShowingNotifications","recent","setRecent","unread","setUnread","then","read","reload","divide","n","NoDataIllustration","availableEmojis","Reactions","emojiSelectorRef","toggleReaction","reactions","isEmojiSelectorOpen","setIsEmojiSelectorOpen","handleClickOutside","ReactionAdd","emoji","reaction","_extends","includesMe","ReadOnlyNotice","isAdministrator","Stack","dir","flex","filterable","All","Error","_PostStatus","Started","TenantStatus","UserAvatarType","UserStatus","UserRole","Collaborator","Administrator","OAuthConfigStatus","Disabled","Enabled","BillingStatus","WebhookType","WebhookStatus","request","method","headers","fetch","JSON","stringify","credentials","json","notify","toResult","truncatedBody","http","get","put","delete","category","analytics","setItem","localStorage","getItem","removeItem","sessionStorage","eventCategory","eventAction","ga","exDescription","stack","exFatal","FiderSession","pPage","page","pContextID","contextID","pProps","pUser","pTenant","initData","pSettings","pSession","el","textContent","innerText","Locked","environment","isSingleHostMode","mode","jwt","decode","segments","atob","input","trim","dateOpts","day","month","year","short","full","hour","minute","DateTimeFormat","toLocaleString","dateFormat","seconds","round","minutes","hours","days","months","years","rtf","RelativeTimeFormat","numeric","Promise","resolve","reject","reader","FileReader","parts","readAsDataURL","timeAgo","cookie","ret","indexOf","assetsURL","substr","copyToClipboard","navigator","clipboard","writeText","clearUrlHash","oldURL","newURL","pathname","search","history","replaceState","pushState","hashChangeEvent","HashChangeEvent","cancelable","bubbles","composed","dispatchEvent","activateI18NSync","messages","load","activate","activateI18N","marked","setOptions","headerIds","xhtml","smartLists","gfm","DOMPurify","isSupported","setConfig","USE_PROFILES","ADD_ATTR","fullRenderer","Renderer","image","plainTextRenderer","_href","_title","br","strong","list","listitem","heading","paragraph","code","codespan","del","entities","encodeHTML","s","sanitize","plainText","toastify","success","toast","goHome","goTo","path","baseURL","getNumber","parseInt","uri","re","RegExp","separator","regex","results","exec","decodeURIComponent","getArray","qs","object","symbol","Array","isTouch","maxTouchPoints","updateUserSettings","changeUserEmail","deleteCurrentAccount","regenerateAPIKey","createTag","updateTag","deleteTag","assignTag","postNumber","unassignTag","getAllPosts","searchPosts","qsParams","querystring","tags","params","statuses","limit","myVotes","deletePost","addVote","removeVote","toggleVote","subscribe","unsubscribe","listVotes","getTaggableUsers","userFilter","createComment","attachments","updateComment","commentID","deleteComment","toggleCommentReaction","respond","originalNumber","createPost","description","updatePost","createTenant","updateTenantSettings","updateTenantAdvancedSettings","customCSS","updateTenantPrivacy","isPrivate","updateTenantEmailAuthAllowed","checkAvailability","subdomain","signIn","completeProfile","kind","changeUserRole","userID","blockUser","unblockUser","getOAuthConfig","saveOAuthConfig","getTotalUnreadNotifications","total","getAllNotifications","markAllAsRead","sendInvites","subject","recipients","sendSampleInvite","ignoreErrors","logError","pattern","createWebhook","updateWebhook","deleteWebhook","testWebhook","previewWebhook","getWebhookHelp","generateCheckoutLink","planId","hasContainer","rootElement","I18nProvider","ToastContainer","POSITION","TOP_RIGHT"],"sourceRoot":""}