{"version":3,"sources":["webpack://fider/./public/components/ShowTag.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/MultiLineText.tsx","webpack://fider/./public/components/common/EnvironmentInfo.tsx","webpack://fider/./public/components/common/Avatar.tsx","webpack://fider/./public/components/common/Message.tsx","webpack://fider/./public/components/common/Hint.tsx","webpack://fider/./public/components/common/Footer.tsx","webpack://fider/./public/components/common/Header.tsx","webpack://fider/./public/components/common/Heading.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/Segment.tsx","webpack://fider/./public/components/common/List.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/FiderVersion.tsx","webpack://fider/./public/components/common/DropDown.tsx","webpack://fider/./public/components/ErrorBoundary.tsx","webpack://fider/./public/components/ShowPostResponse.tsx","webpack://fider/./public/components/SignInModal.tsx","webpack://fider/./public/components/VoteCounter.tsx","webpack://fider/./public/models/post.ts","webpack://fider/./public/models/identity.ts","webpack://fider/./public/models/settings.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/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/toastify.tsx"],"names":["textColor","color","components","r","substring","g","b","R","parseInt","G","B","getRGB","ShowTag","props","className","size","circular","title","tag","name","isPublic","style","backgroundColor","ButtonClickEvent","shouldEnable","this","Button","super","unmounted","click","e","preventDefault","stopPropagation","state","clicked","event","setState","onClick","canEnable","fluid","disabled","href","rel","children","type","defaultProps","ValidationContext","Form","autoComplete","error","Provider","value","arrayToTag","items","map","m","key","hasError","field","errors","err","DisplayError","dict","reduce","result","push","message","fields","Object","keys","prototype","hasOwnProperty","call","forEach","t","length","Input","onChange","currentTarget","suffix","icon","onIconClick","link","undefined","Consumer","ctx","label","htmlFor","afterLabel","id","tabIndex","noTabFocus","ref","inputRef","autoFocus","onFocus","maxLength","placeholder","ImageUploader","fileChanged","target","files","file","alert","base64","bkey","upload","fileName","content","contentType","remove","previewURL","instanceID","removeFile","fileSelector","selectFile","openModal","showModal","closeModal","previewMaxWidth","isOpen","onClose","center","alt","src","isUploading","hasFile","imgStyles","maxWidth","modal","accept","MultiImageUploader","imageUploaded","instances","removed","count","maxUploads","addNewElement","triggerOnChange","bkeys","uploads","k","concat","filter","x","btoa","Math","random","toString","element","elements","TextArea","minRows","RadioButton","selected","onSelect","defaultOption","options","inputs","option","checked","bind","Select","o","getOption","defaultValue","filtered","Field","Checkbox","setChecked","useState","isChecked","ImageViewer","loadedThumbnail","onThumbnailLoad","onPreviewLoad","loadedPreview","onLoad","MultiLineText","text","func","dangerouslySetInnerHTML","__html","EnvironmentInfo","fider","isProduction","settings","environment","compiler","version","buildTime","isSingleHostMode","session","tenant","isAuthenticated","user","Avatar","role","avatarURL","Message","showIcon","Hint","cacheKey","permanentCloseKey","isClosed","setIsClosed","condition","Footer","width","height","Header","isSignInModalOpen","setIsSignInModalOpen","unreadNotifications","setUnreadNotifications","useEffect","then","ok","data","isCollaborator","showRightMenu","isPrivate","level","Heading","dividing","iconClassName","subtitle","TermsOfService","hasLegal","PrivacyPolicy","LegalNotice","LegalFooter","Modal","align","LegalAgreement","SocialSignInButton","redirectTo","window","location","url","provider","logoURL","displayName","OAuthProviderLogo","SignInControl","email","setEmail","setError","providersLen","oauth","i","useEmail","onEmailSent","Segments","Segment","List","divided","hover","ListItem","Moment","date","format","useRelative","now","Date","diff","getTime","display","ModalWindow","root","useRef","document","getElementById","body","overflow","addEventListener","keyDown","removeEventListener","keyCode","close","canClose","current","evt","Window","Content","UserName","Loader","show","setShow","TenantLogoURL","logoBlobKey","TenantLogo","useFiderIfEmpty","systemProvidersLogo","google","facebook","github","OAuthProviderLogoURL","Toggle","active","setActive","newActive","onToggle","readOnly","FiderVersion","DropDown","mounted","handleMouseDown","button","addListeners","renderItem","item","isSelected","highlightSelected","onMouseDown","setSelected","render","handleDocumentClick","node","rootElementRef","contains","removeListeners","findItem","newState","fireChangeEvent","header","search","onSearchChange","dropdownClass","inline","direction","onTouchEnd","renderControl","searchable","renderText","buildItemList","ErrorBoundary","errorInfo","onError","showDetails","ShowPostStatus","status","ShowPostResponse","response","showUser","original","number","slug","DuplicateDetails","StatusDetails","SignInModal","confirmationAddress","setConfirmationAddress","setTimeout","VoteCounter","hasVoted","setHasVoted","post","votesCount","setVotesCount","closed","vote","action","PostStatus","filterable","All","Error","TenantStatus","UserAvatarType","UserStatus","UserRole","Open","Planned","Started","Completed","Declined","Duplicate","Deleted","Collaborator","Administrator","OAuthConfigStatus","Disabled","Enabled","request","method","headers","fetch","JSON","stringify","credentials","json","toResult","truncatedBody","truncate","http","get","put","delete","category","analytics","set","storage","setItem","localStorage","getItem","has","removeItem","cache","local","sessionStorage","eventCategory","eventAction","ga","exDescription","stack","exFatal","FiderSession","pProps","pContextID","contextID","pUser","pTenant","Fider","initialize","initData","pSettings","pSession","el","parse","textContent","innerText","mode","FiderContext","createContext","jwt","decode","token","segments","split","atob","classSet","input","classes","trim","monthNames","twoDigits","formatDate","monthIndex","getMonth","year","getFullYear","day","getDate","hours","getHours","minutes","getMinutes","templates","seconds","minute","hour","days","month","months","years","template","n","replace","abs","round","timeSince","fileToBase64","Promise","resolve","reject","reader","FileReader","parts","readAsDataURL","isCookieEnabled","cookie","ret","indexOf","uploadedImageURL","tenantAssetsURL","substr","headerIds","xhtml","smartLists","gfm","breaks","USE_PROFILES","html","ADD_ATTR","simpleRenderer","heading","_text","_level","raw","image","fullRenderer","entities","encodeHTML","s","sanitize","full","renderer","simple","toastify","success","toast","goHome","goTo","pathname","replaceState","path","history","newURL","baseURL","getNumber","uri","re","RegExp","match","separator","results","exec","decodeURIComponent","getArray","qs","object","symbol","Array","join","encodeURIComponent","isTouch","navigator","maxTouchPoints","msMaxTouchPoints","updateUserSettings","changeUserEmail","deleteCurrentAccount","regenerateAPIKey","createTag","updateTag","deleteTag","assignTag","postNumber","unassignTag","getAllPosts","searchPosts","params","tags","query","view","limit","deletePost","addVote","removeVote","subscribe","unsubscribe","listVotes","createComment","attachments","updateComment","commentID","deleteComment","respond","originalNumber","createPost","description","updatePost","createTenant","updateTenantSettings","updateTenantAdvancedSettings","customCSS","updateTenantPrivacy","checkAvailability","subdomain","signIn","completeProfile","changeUserRole","userID","blockUser","unblockUser","getOAuthConfig","saveOAuthConfig","getTotalUnreadNotifications","total","markAllAsRead","sendInvites","subject","recipients","sendSampleInvite","ignoreErrors","logError","pattern","console","hasContainer","setup","position","toastClassName"],"mappings":"4IAaA,MAYMA,EAAaC,IACjB,MAAMC,EAbO,CAACD,IACd,MAAME,EAAIF,EAAMG,UAAU,EAAG,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AAM1J,EAAO0J,KAAO1J,EAAO0J,KAAKkX,MAAQ,SAKjCC,GAAgB,KAA6B,0CACxD,aAAanM,EAAKrC,KAAK,mCCXZyO,GAAc,CAAOC,EAAiB7gB,EAAiB8gB,KAA0C,0CAC5G,OAAOtM,EAAKrC,KAAK,2BAA4B,CAAE0O,UAAS7gB,UAAS8gB,eAAcxX,KAAKkL,EAAKvW,MAAM,SAAU,YAG9F8iB,GAAmB,CAAOF,EAAiB7gB,KAAqC,0CAC3F,OAAOwU,EAAKrC,KAAK,6BAA8B,CAAE0O,UAAS7gB,YAAWsJ,KAAKkL,EAAKvW,MAAM,SAAU,cCL3F+iB,GAAe,CACnB,gCACA,0DACA,mEACA,gCACA,mGAGWC,GAAW,CAAOjhB,EAAiBN,KAA6C,0CAC3F,IAAK,MAAMwhB,KAAWF,GACpB,GAAIhhB,EAAQga,QAAQkH,IAAY,EAC9B,OAIJ,MAAM1X,EAAO,CACXqB,IAAK,QACL+K,MAAOlW,EAAMA,EAAIkW,MAAQ,mBAG3B,IAEE,OADAf,EAAU9V,MAAMW,SACH8U,EAAKrC,KAAK,kBAAmB,CAAEnS,UAASwJ,SACrD,MAAO9J,GACPyhB,QAAQpiB,MAAMW,Q,0GCpBlB,IAAI0hB,GAAe,EAEnB,MAAMC,EAAQ,KACPD,IACHA,GAAe,EACf,SAAgB,gBAAC,KAAc,CAACE,SAAU,wBAA0BC,eAAe,YAAc1U,SAASC,eAAe,oBAIhH6O,EAAU,CAACjZ,EAAuBiD,KAC7C0b,IACA,aAAc3e,EAASiD,IAGZ5G,EAAQ,CAAC2D,EAAuBiD,KAC3C0b,IACA,WAAY3e,EAASiD","file":"js/common.6d12e88dd22063ac784e.js","sourcesContent":["import \"./ShowTag.scss\"\n\nimport React from \"react\"\nimport { Tag } from \"@fider/models\"\nimport { classSet } from \"@fider/services\"\nimport { FaLock } from \"react-icons/fa\"\n\ninterface TagProps {\n tag: Tag\n size?: \"mini\" | \"tiny\" | \"small\" | \"normal\"\n circular?: boolean\n}\n\nconst getRGB = (color: string) => {\n const r = color.substring(0, 2)\n const g = color.substring(2, 4)\n const b = color.substring(4, 6)\n\n return {\n R: parseInt(r, 16),\n G: parseInt(g, 16),\n B: parseInt(b, 16),\n }\n}\n\nconst 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 [`m-${props.size || \"normal\"}`]: true,\n \"m-circular\": props.circular === true,\n })\n\n return (\n \n {!props.tag.isPublic && !props.circular && }\n {props.circular ? \"\" : props.tag.name || \"Tag\"}\n \n )\n}\n","import React from \"react\"\nimport { classSet } from \"@fider/services\"\n\ninterface ButtonProps {\n className?: string\n disabled?: boolean\n href?: string\n rel?: \"nofollow\"\n type?: \"button\" | \"submit\"\n color?: \"positive\" | \"danger\" | \"default\" | \"cancel\"\n fluid?: boolean\n size?: \"mini\" | \"tiny\" | \"small\" | \"normal\" | \"large\"\n onClick?: (event: ButtonClickEvent) => Promise\n}\n\ninterface ButtonState {\n clicked: boolean\n}\n\nimport \"./Button.scss\"\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 class Button extends React.Component {\n private unmounted = false\n\n public static defaultProps: Partial = {\n size: \"small\",\n fluid: false,\n color: \"default\",\n type: \"button\",\n }\n\n public constructor(props: ButtonProps) {\n super(props)\n this.state = {\n clicked: false,\n }\n }\n\n public componentWillUnmount() {\n this.unmounted = true\n }\n\n public click = async (e?: React.SyntheticEvent) => {\n if (e) {\n e.preventDefault()\n e.stopPropagation()\n }\n\n if (this.state.clicked) {\n return\n }\n\n const event = new ButtonClickEvent()\n this.setState({ clicked: true })\n if (this.props.onClick) {\n await this.props.onClick(event)\n if (!this.unmounted && event.canEnable()) {\n this.setState({ clicked: false })\n }\n }\n }\n\n public render() {\n const className = classSet({\n \"c-button\": true,\n \"m-fluid\": this.props.fluid,\n [`m-${this.props.size}`]: this.props.size,\n [`m-${this.props.color}`]: this.props.color,\n \"m-loading\": this.state.clicked,\n \"m-disabled\": this.state.clicked || this.props.disabled,\n [this.props.className || \"\"]: this.props.className,\n })\n\n if (this.props.href) {\n return (\n \n {this.props.children}\n \n )\n } else if (this.props.onClick) {\n return (\n \n )\n } else {\n return (\n \n )\n }\n }\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 className?: string\n size?: \"mini\" | \"normal\"\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 [`m-${props.size}`]: props.size,\n })\n\n return (\n
\n \n {props.children}\n \n )\n}\n","import React from \"react\"\nimport { Failure } from \"@fider/services\"\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 { IconType } from \"react-icons\"\n\ninterface InputProps {\n field: string\n label?: string\n className?: string\n autoComplete?: string\n autoFocus?: boolean\n noTabFocus?: boolean\n afterLabel?: JSX.Element\n icon?: IconType\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\n ? React.createElement(props.icon, {\n onClick: props.onIconClick,\n className: classSet({ link: !!props.onIconClick }),\n })\n : 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, Modal } from \"@fider/components\"\nimport { FaRegImage } from \"react-icons/fa\"\nimport { ImageUpload } from \"@fider/models\"\n\nconst hardFileSizeLimit = 5 * 1024 * 1024\n\ninterface ImageUploaderProps {\n instanceID?: string\n field: string\n label?: string\n bkey?: string\n disabled?: boolean\n previewMaxWidth: number\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, this.props.previewMaxWidth),\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 const imgStyles: React.CSSProperties = {\n maxWidth: `${this.props.previewMaxWidth}px`,\n }\n\n return (\n \n {(ctx) => (\n \n {this.modal()}\n \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 \n {!hasFile && (\n
    \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 previewMaxWidth: number\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 }\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\ninterface TextAreaProps {\n label?: string\n field: string\n value?: string\n disabled?: boolean\n minRows?: number\n placeholder?: string\n onChange?: (value: string) => void\n inputRef?: React.MutableRefObject\n onFocus?: React.FocusEventHandler\n}\n\nexport const TextArea: React.FunctionComponent = (props) => {\n const onChange = (e: React.FormEvent) => {\n if (props.onChange) {\n props.onChange(e.currentTarget.value)\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 React from \"react\"\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\ninterface RadioButtonState {\n selected: RadioButtonOption\n}\n\nexport class RadioButton extends React.Component {\n constructor(props: RadioButtonProps) {\n super(props)\n this.state = {\n selected: props.defaultOption || props.options[0],\n }\n }\n\n private onChange = (selected: RadioButtonOption) => {\n this.setState({ selected }, () => {\n if (this.props.onSelect) {\n this.props.onSelect(this.state.selected)\n }\n })\n }\n\n public render() {\n const inputs = this.props.options.map((option) => {\n return (\n
    \n \n \n
    \n )\n })\n\n return (\n
    \n \n {inputs}\n
    \n )\n }\n}\n","import React from \"react\"\nimport { classSet } from \"@fider/services\"\nimport { ValidationContext } from \"./Form\"\nimport { DisplayError, hasError } from \"./DisplayError\"\n\nexport interface SelectOption {\n value: string\n label: string\n}\n\ninterface SelectProps {\n field: string\n label?: string\n maxLength?: number\n defaultValue?: string\n options: SelectOption[]\n onChange?: (option?: SelectOption) => void\n}\n\ninterface SelectState {\n selected?: SelectOption\n}\n\nexport class Select extends React.Component {\n constructor(props: SelectProps) {\n super(props)\n this.state = {\n selected: this.getOption(props.defaultValue),\n }\n }\n\n private getOption(value?: string): SelectOption | undefined {\n if (value && this.props.options) {\n const filtered = this.props.options.filter((x) => x.value === value)\n if (filtered && filtered.length > 0) {\n return filtered[0]\n }\n }\n }\n\n private onChange = (e: React.FormEvent) => {\n let selected: SelectOption | undefined\n if (e.currentTarget.value) {\n const options = this.props.options.filter((o) => o.value === e.currentTarget.value)\n if (options && options.length > 0) {\n selected = options[0]\n }\n }\n\n this.setState({ selected }, () => {\n if (this.props.onChange) {\n this.props.onChange(this.state.selected)\n }\n })\n }\n\n public render() {\n const options = this.props.options.map((option) => {\n return (\n \n )\n })\n\n return (\n \n {(ctx) => (\n <>\n \n {!!this.props.label && }\n
    \n \n
    \n \n {this.props.children}\n \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 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 \"../\"\n\ninterface CheckboxProps {\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 props.onChange(isChecked)\n }\n\n return (\n \n {(ctx) => (\n \n \n \n \n )}\n \n )\n}\n","import React from \"react\"\nimport { uploadedImageURL } from \"@fider/services\"\nimport { Modal, Button, Loader } from \"@fider/components\"\n\nimport \"./ImageViewer.scss\"\n\ninterface ImageViewerProps {\n bkey: string\n}\n\ninterface ImageViewerState {\n showModal: boolean\n loadedThumbnail: boolean\n loadedPreview: boolean\n}\n\nexport class ImageViewer extends React.Component {\n constructor(props: ImageViewerProps) {\n super(props)\n\n this.state = {\n showModal: false,\n loadedThumbnail: false,\n loadedPreview: false,\n }\n }\n\n private openModal = () => {\n if (this.state.loadedThumbnail) {\n this.setState({ showModal: true })\n }\n }\n\n private closeModal = async () => {\n this.setState({ showModal: false })\n }\n\n private onThumbnailLoad = () => {\n this.setState({ loadedThumbnail: true })\n }\n\n private onPreviewLoad = () => {\n this.setState({ loadedPreview: true })\n }\n\n private modal() {\n return (\n \n \n {!this.state.loadedPreview && }\n \"\"\n \n\n \n \n \n \n )\n }\n\n public render() {\n const previewURL = uploadedImageURL(this.props.bkey, 200)\n return (\n
    \n {this.modal()}\n {!this.state.loadedThumbnail && }\n \"\"\n
    \n )\n }\n}\n","import React from \"react\"\nimport { markdown } from \"@fider/services\"\n\ninterface MultiLineTextProps {\n className?: string\n text?: string\n style: \"full\" | \"simple\"\n}\n\nexport const MultiLineText = (props: MultiLineTextProps) => {\n if (!props.text) {\n return

    \n }\n\n const func = props.style === \"full\" ? markdown.full : markdown.simple\n return

    \n}\n","import React from \"react\"\nimport { useFider } from \"@fider/hooks\"\n\nexport const EnvironmentInfo = () => {\n const fider = useFider()\n\n if (fider.isProduction()) {\n return null\n }\n\n return (\n
    \n Env: {fider.settings.environment} | Compiler: {fider.settings.compiler} | Version: {fider.settings.version} | BuildTime:{\" \"}\n {fider.settings.buildTime || \"N/A\"} |{!fider.isSingleHostMode() && `TenantID: ${fider.session.tenant.id}`} |{\" \"}\n {fider.session.isAuthenticated && `UserID: ${fider.session.user.id}`}\n
    \n )\n}\n","import \"./Avatar.scss\"\n\nimport React from \"react\"\nimport { classSet } from \"@fider/services\"\nimport { isCollaborator, UserRole } from \"@fider/models\"\n\ninterface AvatarProps {\n user: {\n role?: UserRole\n avatarURL: string\n name: string\n }\n size?: \"small\" | \"normal\" | \"large\"\n}\n\nexport const Avatar = (props: AvatarProps) => {\n const size = props.size || \"normal\"\n\n const className = classSet({\n \"c-avatar\": true,\n [`m-${size}`]: true,\n \"m-staff\": props.user.role && isCollaborator(props.user.role),\n })\n\n return {props.user.name}\n}\n","import \"./Message.scss\"\n\nimport React from \"react\"\nimport { classSet } from \"@fider/services\"\nimport { FaBan, FaRegCheckCircle, FaExclamationTriangle } from \"react-icons/fa\"\n\ninterface MessageProps {\n type: \"success\" | \"warning\" | \"error\"\n showIcon?: boolean\n}\n\nexport const Message: React.FunctionComponent = (props) => {\n const className = classSet({\n \"c-message\": true,\n [`m-${props.type}`]: true,\n })\n\n const icon = props.type === \"error\" ? : props.type === \"warning\" ? : \n\n return (\n

    \n {props.showIcon === true && icon}\n {props.children}\n

    \n )\n}\n","import \"./Hint.scss\"\n\nimport React, { useState } from \"react\"\nimport { FaTimes } from \"react-icons/fa\"\n\nimport { cache } from \"@fider/services\"\n\ninterface HintProps {\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 return (\n

    \n HINT: {props.children}\n {cacheKey && }\n

    \n )\n}\n","import \"./Footer.scss\"\n\nimport React from \"react\"\n\nexport const Footer = () => {\n return (\n \n )\n}\n","import \"./Header.scss\"\n\nimport React, { useState, useEffect } from \"react\"\nimport { SignInModal, EnvironmentInfo, Avatar, TenantLogo } from \"@fider/components\"\nimport { actions } from \"@fider/services\"\nimport { FaUser, FaCog, FaCaretDown } from \"react-icons/fa\"\nimport { useFider } from \"@fider/hooks\"\n\nexport const Header = () => {\n const fider = useFider()\n const [isSignInModalOpen, setIsSignInModalOpen] = useState(false)\n const [unreadNotifications, setUnreadNotifications] = useState(0)\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 const showModal = () => {\n if (!fider.session.isAuthenticated) {\n setIsSignInModalOpen(true)\n }\n }\n\n const hideModal = () => setIsSignInModalOpen(false)\n\n const items = fider.session.isAuthenticated && (\n
    \n
    \n {fider.session.user.name}\n
    \n \n Settings\n \n \n Notifications\n {unreadNotifications > 0 &&
    {unreadNotifications}
    }\n
    \n
    \n {fider.session.user.isCollaborator && [\n
    \n Administration\n
    ,\n \n Site Settings\n ,\n
    ,\n ]}\n \n Sign out\n \n
    \n )\n\n const showRightMenu = fider.session.isAuthenticated || !fider.session.tenant.isPrivate\n return (\n
    \n \n \n
    \n
    \n \n \n

    {fider.session.tenant.name}

    \n
    \n {showRightMenu && (\n
    \n {fider.session.isAuthenticated && }\n {unreadNotifications > 0 &&
    }\n {!fider.session.isAuthenticated && Sign in}\n {fider.session.isAuthenticated && }\n {items}\n
    \n )}\n
    \n
    \n
    \n )\n}\n","import \"./Heading.scss\"\n\nimport React from \"react\"\nimport { classSet } from \"@fider/services\"\nimport { IconType } from \"react-icons\"\n\ninterface HeadingLogo {\n title: string\n dividing?: boolean\n size?: \"normal\" | \"small\"\n icon?: IconType\n subtitle?: string\n className?: string\n}\n\nconst Header: React.FunctionComponent<{ level: number; className: string }> = (props) =>\n React.createElement(`h${props.level}`, { className: props.className }, props.children)\n\nexport const Heading = (props: HeadingLogo) => {\n const size = props.size || \"normal\"\n const level = size === \"normal\" ? 2 : 3\n const className = classSet({\n \"c-heading\": true,\n \"m-dividing\": props.dividing || false,\n [`m-${size}`]: true,\n [`${props.className}`]: props.className,\n })\n\n const iconClassName = classSet({\n \"c-heading-icon\": true,\n circular: level <= 2,\n })\n\n const icon = props.icon &&
    {React.createElement(props.icon)}
    \n\n return (\n
    \n {icon}\n
    \n {props.title}\n
    {props.subtitle}
    \n
    \n
    \n )\n}\n","import React from \"react\"\nimport { Modal, Checkbox } from \"@fider/components/common\"\nimport { useFider } from \"@fider/hooks\"\n\ninterface LegalAgreementProps {\n onChange: (agreed: boolean) => void\n}\n\nexport const TermsOfService: React.FunctionComponent = () => {\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: React.FunctionComponent = () => {\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: React.FunctionComponent = () => {\n const fider = useFider()\n\n if (fider.settings.hasLegal) {\n return (\n

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

    \n )\n }\n return null\n}\n\nexport const LegalFooter: React.FunctionComponent = () => {\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 I have read and agree to the and .\n \n )\n }\n return null\n}\n","import React from \"react\"\nimport { Button, OAuthProviderLogo } from \"@fider/components/common\"\nimport { classSet } from \"@fider/services\"\n\ninterface SocialSignInButtonProps {\n option: {\n displayName: string\n provider?: string\n url?: string\n logoBlobKey?: string\n logoURL?: string\n }\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 const className = classSet({\n \"m-social\": true,\n [`m-${props.option.provider}`]: props.option.provider,\n })\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 { device, actions, Failure, isCookieEnabled } from \"@fider/services\"\nimport { useFider } from \"@fider/hooks\"\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 [email, setEmail] = useState(\"\")\n const [error, setError] = useState(undefined)\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, i) => (\n \n {i % 4 === 0 &&
    }\n
    \n \n
    \n \n ))}\n
    \n

    We will never post to these accounts on your behalf.

    \n
    \n )}\n\n {providersLen > 0 &&
    OR
    }\n\n {props.useEmail && (\n
    \n

    Enter your email address to sign in

    \n
    \n \n Sign in\n \n }\n />\n \n
    \n )}\n
    \n )\n}\n","import \"./Segment.scss\"\n\nimport React from \"react\"\n\ninterface SegmentProps {\n className?: string\n}\n\nexport const Segments: React.FunctionComponent = (props) => {\n return
    {props.children}
    \n}\n\nexport const Segment: React.FunctionComponent = (props) => {\n return
    {props.children}
    \n}\n","import \"./List.scss\"\n\nimport React from \"react\"\nimport { classSet } from \"@fider/services\"\n\ninterface ListProps {\n className?: string\n divided?: boolean\n hover?: boolean\n}\n\ninterface ListItemProps {\n className?: string\n onClick?: () => void\n}\n\nexport const List: React.FunctionComponent = (props) => {\n const className = classSet({\n \"c-list\": true,\n [props.className || \"\"]: true,\n \"m-divided\": props.divided,\n \"m-hover\": props.hover,\n })\n\n return
    {props.children}
    \n}\n\nexport const ListItem: React.FunctionComponent = (props) => {\n const className = classSet({\n \"c-list-item\": true,\n [props.className || \"\"]: true,\n \"m-selectable\": props.onClick,\n })\n\n if (props.onClick) {\n return (\n
    \n {props.children}\n
    \n )\n }\n return
    {props.children}
    \n}\n","import React from \"react\"\nimport { formatDate, timeSince } from \"@fider/services\"\n\ninterface MomentText {\n date: Date | string\n useRelative?: boolean\n format?: \"full\" | \"short\"\n}\n\nexport const Moment = (props: MomentText) => {\n if (!props.date) {\n return \n }\n\n const format = props.format || \"full\"\n const useRelative = typeof props.useRelative !== \"undefined\" ? props.useRelative : true\n\n const now = new Date()\n const date = props.date instanceof Date ? props.date : new Date(props.date)\n\n const diff = (now.getTime() - date.getTime()) / (60 * 60 * 24 * 1000)\n const display = !useRelative || diff >= 365 ? formatDate(props.date, format) : timeSince(now, date)\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 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 = (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 (props.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 \"m-center\": props.center,\n [`m-${props.size}`]: true,\n })\n\n return ReactDOM.createPortal(\n
    \n
    \n {props.children}\n
    \n
    ,\n root.current\n )\n}\n\nModalWindow.defaultProps = {\n size: \"small\",\n canClose: true,\n center: true,\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 [`m-${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 }\n}\n\nexport const UserName = (props: UserNameProps) => {\n const className = classSet({\n \"c-username\": true,\n \"m-staff\": props.user.role && isCollaborator(props.user.role),\n })\n\n return {props.user.name || \"Anonymous\"}\n}\n","import \"./Loader.scss\"\n\nimport React, { useState } from \"react\"\nimport { useTimeout } from \"@fider/hooks\"\n\nexport function Loader() {\n const [show, setShow] = useState(false)\n\n useTimeout(() => {\n setShow(true)\n }, 500)\n\n return show ?
    : 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 = (props: TenantLogoProps) => {\n const fider = useFider()\n\n const tenant = fider.session.tenant\n if (tenant && tenant.logoBlobKey) {\n return {tenant.name}\n } else if (props.useFiderIfEmpty) {\n return \"Fider\"\n }\n return null\n}\n\nTenantLogo.defaultProps = {\n useFiderIfEmpty: false,\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+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Q3OSwyMy41NDgsMjAsMjQuNTA4LDIwLDI2YzAsMiwwLDMuOTAyLDAsNC40MjhjMCwwLjQyOCwwLjI1OCwwLjkwMSwxLjA3LDAuNzQ2ICBDMjcuNDIyLDI5LjA1NSwzMiwyMy4wNjIsMzIsMTUuOTk3QzMyLDcuMTYyLDI0LjgzOCwwLDE2LjAwMywweiIgZmlsbD0iIzE4MTYxNiIgZmlsbC1ydWxlPSJldmVub2RkIi8+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\"\n\ninterface ToggleProps {\n label?: string\n active: boolean\n disabled?: boolean\n onToggle?: (active: boolean) => void\n}\n\nexport const Toggle: React.StatelessComponent = (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 \"m-disabled\": !!props.disabled,\n })\n\n return (\n \n \n \n {!!props.label && props.label}\n \n )\n}\n","import React from \"react\"\nimport { useFider } from \"@fider/hooks\"\n\nexport const FiderVersion = () => {\n const fider = useFider()\n\n return (\n

    \n Support our{\" \"}\n \n OpenCollective\n \n
    \n Fider v{fider.settings.version}\n

    \n )\n}\n","import React from \"react\"\nimport { classSet } from \"@fider/services\"\n\nimport \"./DropDown.scss\"\n\nexport interface DropDownItem {\n value: any\n label: string\n render?: JSX.Element\n}\n\nexport interface DropDownProps {\n className?: string\n defaultValue?: any\n items: (DropDownItem | undefined | false)[]\n placeholder?: string\n searchable?: boolean\n inline?: boolean\n style: \"normal\" | \"simple\"\n highlightSelected?: boolean\n header?: string\n direction?: \"left\" | \"right\"\n onChange?: (item: DropDownItem) => void\n onSearchChange?: (e: React.FormEvent) => void\n renderText?: (item?: DropDownItem) => JSX.Element | string | undefined\n renderControl?: (item?: DropDownItem) => JSX.Element | string | undefined\n}\n\nexport interface DropDownState {\n isOpen: boolean\n selected?: DropDownItem\n}\n\nexport class DropDown extends React.Component {\n private rootElementRef: React.RefObject\n private mounted = false\n\n public static defaultProps: Partial = {\n direction: \"right\",\n style: \"normal\",\n highlightSelected: true,\n }\n\n constructor(props: DropDownProps) {\n super(props)\n this.rootElementRef = React.createRef()\n this.state = {\n selected: this.findItem(props.defaultValue, props.items),\n isOpen: false,\n }\n }\n\n public componentDidMount() {\n this.mounted = true\n }\n\n public componentWillUnmount() {\n this.mounted = false\n this.removeListeners()\n }\n\n private addListeners() {\n document.addEventListener(\"click\", this.handleDocumentClick, false)\n document.addEventListener(\"touchend\", this.handleDocumentClick, false)\n }\n\n private removeListeners() {\n document.removeEventListener(\"click\", this.handleDocumentClick, false)\n document.removeEventListener(\"touchend\", this.handleDocumentClick, false)\n }\n\n public handleMouseDown = (event: any) => {\n if (event.type === \"mousedown\" && event.button !== 0) {\n return\n }\n\n event.stopPropagation()\n event.preventDefault()\n\n this.setState(\n {\n isOpen: true,\n },\n this.addListeners\n )\n }\n\n public findItem(value: any, items: (DropDownItem | undefined | false)[]): DropDownItem | undefined {\n for (const item of items) {\n if (item && item.value === value) {\n return item\n }\n }\n return undefined\n }\n\n public setSelected(selected: DropDownItem) {\n const newState = {\n selected,\n isOpen: false,\n }\n this.fireChangeEvent(newState)\n this.setState(newState, this.removeListeners)\n }\n\n public fireChangeEvent(newState: DropDownState) {\n if (newState.selected && newState.selected !== this.state.selected && this.props.onChange) {\n this.props.onChange(newState.selected)\n }\n }\n\n public renderItem = (item: DropDownItem | undefined | false) => {\n if (!item) {\n return\n }\n\n const { label, value } = item\n const isSelected = this.props.highlightSelected && this.state.selected && value === this.state.selected.value\n const className = classSet({\n \"c-dropdown-item\": true,\n \"is-selected\": isSelected,\n })\n\n return (\n
    \n {item.render ? item.render : label}\n
    \n )\n }\n\n public buildItemList() {\n const items = this.props.items.map(this.renderItem)\n\n return (\n
    \n {this.props.header &&
    {this.props.header}
    }\n
    {items.length ? items :
    No results found
    }
    \n
    \n )\n }\n\n public handleDocumentClick = (event: any) => {\n if (this.mounted) {\n const node = this.rootElementRef.current\n if (node && !node.contains(event.target)) {\n if (this.state.isOpen) {\n this.setState(\n {\n isOpen: false,\n },\n this.removeListeners\n )\n }\n }\n }\n }\n\n public render() {\n const text = this.state.selected ? this.state.selected.label : {this.props.placeholder}\n\n const search = \n\n const dropdownClass = classSet({\n \"c-dropdown\": true,\n [`${this.props.className}`]: this.props.className,\n \"is-open\": this.state.isOpen,\n [`m-style-${this.props.style}`]: true,\n \"is-inline\": this.props.inline,\n \"m-right\": this.props.direction === \"right\",\n \"m-left\": this.props.direction === \"left\",\n })\n\n return (\n
    \n
    \n {this.props.renderControl ? (\n
    {this.props.renderControl(this.state.selected)}
    \n ) : (\n
    \n {this.state.isOpen && this.props.searchable ? search : this.props.renderText ? this.props.renderText(this.state.selected) :
    {text}
    }\n \n
    \n )}\n
    \n {this.state.isOpen && this.buildItemList()}\n
    \n )\n }\n}\n","import React from \"react\"\nimport { ErrorPage } from \"@fider/pages/Error/Error.page\"\nimport { FiderContext } from \"@fider/services\"\n\ninterface ErrorBoundaryProps {\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 \"./ShowPostResponse.scss\"\n\nimport React from \"react\"\nimport { PostResponse, PostStatus } from \"@fider/models\"\nimport { Avatar, MultiLineText, UserName, Segment } from \"@fider/components/common\"\n\ninterface ShowPostStatusProps {\n status: PostStatus\n}\n\nexport const ShowPostStatus = (props: ShowPostStatusProps) => {\n return {props.status.title}\n}\n\nconst DuplicateDetails = (props: PostResponseProps): JSX.Element | null => {\n if (!props.response) {\n return null\n }\n\n const original = props.response.original\n if (!original) {\n return null\n }\n\n return (\n \n )\n}\n\ninterface PostResponseProps {\n status: string\n response: PostResponse | null\n showUser: boolean\n}\n\nconst StatusDetails = (props: PostResponseProps): JSX.Element | null => {\n if (!props.response || !props.response.text) {\n return null\n }\n\n return (\n
    \n \n
    \n )\n}\n\nexport const ShowPostResponse = (props: PostResponseProps): JSX.Element => {\n const status = PostStatus.Get(props.status)\n\n if (props.response && (status.show || props.response.text)) {\n return (\n \n {status.show && }\n {props.showUser && (\n <>\n \n \n )}\n {status === PostStatus.Duplicate ? DuplicateDetails(props) : StatusDetails(props)}\n \n )\n }\n\n return
    \n}\n","import React, { useState, useEffect } from \"react\"\nimport { Modal, SignInControl, LegalFooter } from \"@fider/components/common\"\n\ninterface SignInModalProps {\n isOpen: boolean\n onClose: () => void\n}\n\nexport const SignInModal: React.StatelessComponent = (props) => {\n const [confirmationAddress, setConfirmationAddress] = useState(\"\")\n\n useEffect(() => {\n if (confirmationAddress) {\n setTimeout(() => setConfirmationAddress(\"\"), 5000)\n }\n }, [confirmationAddress])\n\n const onEmailSent = (email: string): void => {\n setConfirmationAddress(email)\n }\n\n const closeModal = () => {\n setConfirmationAddress(\"\")\n props.onClose()\n }\n\n const content = confirmationAddress ? (\n <>\n

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

    \n

    \n \n OK\n \n

    \n \n ) : (\n \n )\n\n return (\n \n Sign in to raise your voice\n {content}\n \n \n )\n}\n","import \"./VoteCounter.scss\"\n\nimport React, { useState } from \"react\"\nimport { Post, PostStatus } from \"@fider/models\"\nimport { actions, device, classSet } from \"@fider/services\"\nimport { SignInModal } from \"@fider/components\"\nimport { FaCaretUp } from \"react-icons/fa\"\nimport { useFider } from \"@fider/hooks\"\n\ninterface 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\n const className = classSet({\n \"m-voted\": !status.closed && hasVoted,\n \"m-disabled\": status.closed,\n \"no-touch\": !device.isTouch(),\n })\n\n const vote = (\n \n )\n\n const disabled = (\n \n )\n\n return (\n <>\n \n
    {status.closed ? disabled : vote}
    \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, false)\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, false)\n public static Deleted = new PostStatus(\"Deleted\", \"deleted\", false, true, false)\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 Comment {\n id: number\n content: string\n createdAt: string\n user: User\n attachments?: string[]\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 invitation: string\n welcomeMessage: string\n status: TenantStatus\n isPrivate: boolean\n logoBlobKey: string\n}\n\nexport enum TenantStatus {\n Active = 1,\n Pending = 2,\n Locked = 3,\n}\n\nexport interface User {\n id: number\n name: string\n role: UserRole\n status: UserStatus\n avatarURL: 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 buildTime: string\n version: string\n environment: string\n compiler: string\n domain: string\n hasLegal: boolean\n baseURL: string\n tenantAssetsURL: string\n globalAssetsURL: 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}\n\nexport interface ImageUpload {\n bkey?: string\n upload?: {\n fileName?: string\n content?: string\n contentType?: string\n }\n remove: boolean\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 === 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: (category: string, action: string) => (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 } from \"@fider/models\"\n\nexport class FiderSession {\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.pContextID = data.contextID\n this.pProps = data.props\n this.pUser = data.user\n this.pTenant = data.tenant\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 session(): FiderSession {\n return this.pSession\n }\n\n public get settings(): SystemSettings {\n return this.pSettings\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\nconst monthNames = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"]\n\nexport const currencySymbol = (currencyCode: string): string => {\n currencyCode = currencyCode ? currencyCode.toLowerCase() : \"\"\n switch (currencyCode) {\n case \"eur\":\n return \"€\"\n case \"usd\":\n return \"$\"\n }\n throw new Error(`Invalid currency code '${currencyCode}'`)\n}\n\nconst twoDigits = (value: number): string => {\n return value <= 9 ? `0${value}` : value.toString()\n}\n\ntype DateFormat = \"full\" | \"short\"\n\nexport const formatDate = (input: Date | string, format: DateFormat = \"full\"): string => {\n const date = input instanceof Date ? input : new Date(input)\n\n const monthIndex = date.getMonth()\n const year = date.getFullYear()\n\n if (format === \"short\") {\n return `${monthNames[monthIndex].substring(0, 3)} ${year}`\n }\n\n const day = date.getDate()\n const hours = twoDigits(date.getHours())\n const minutes = twoDigits(date.getMinutes())\n return `${monthNames[monthIndex]} ${day}, ${year} · ${hours}:${minutes}`\n}\n\nconst templates: { [key: string]: string } = {\n seconds: \"less than a minute\",\n minute: \"about a minute\",\n minutes: \"%d minutes\",\n hour: \"about an hour\",\n hours: \"about %d hours\",\n day: \"a day\",\n days: \"%d days\",\n month: \"about a month\",\n months: \"%d months\",\n year: \"about a year\",\n years: \"%d years\",\n}\n\nconst template = (t: string, n: number): string => {\n return templates[t] && templates[t].replace(/%d/i, Math.abs(Math.round(n)).toString())\n}\n\nexport const timeSince = (now: Date, date: Date): string => {\n const seconds = (now.getTime() - date.getTime()) / 1000\n const minutes = seconds / 60\n const hours = minutes / 60\n const days = hours / 24\n const years = days / 365\n\n return (\n ((seconds < 45 && template(\"seconds\", seconds)) ||\n (seconds < 90 && template(\"minute\", 1)) ||\n (minutes < 45 && template(\"minutes\", minutes)) ||\n (minutes < 90 && template(\"hour\", 1)) ||\n (hours < 24 && template(\"hours\", hours)) ||\n (hours < 42 && template(\"day\", 1)) ||\n (days < 30 && template(\"days\", days)) ||\n (days < 45 && template(\"month\", 1)) ||\n (days < 365 && template(\"months\", days / 30)) ||\n (years < 1.5 && template(\"year\", 1)) ||\n template(\"years\", years)) + \" ago\"\n )\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 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.tenantAssetsURL}/images/${bkey}?size=${size}`\n }\n return `${Fider.settings.tenantAssetsURL}/images/${bkey}`\n }\n return undefined\n}\n\nexport const truncate = (input: string, maxLength: number): string => {\n if (input && input.length > 1000) {\n return `${input.substr(0, maxLength)}...`\n }\n return input\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 simpleRenderer = new marked.Renderer()\nsimpleRenderer.heading = (_text, _level, raw) => `

    ${raw}

    `\nsimpleRenderer.image = () => \"\"\nsimpleRenderer.link = link\n\nconst fullRenderer = new marked.Renderer()\nfullRenderer.link = link\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 simple = (input: string): string => {\n return sanitize(marked(encodeHTML(input), { renderer: simpleRenderer }).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 results = regex.exec(navigator.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 || navigator.msMaxTouchPoints > 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\n .post(`/api/v1/tags`, { name, color, isPublic })\n .then(http.event(\"tag\", \"create\"))\n}\n\nexport const updateTag = async (slug: string, name: string, color: string, isPublic: boolean): Promise> => {\n return http\n .put(`/api/v1/tags/${slug}`, { name, color, isPublic })\n .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 } 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}\n\nexport const searchPosts = async (params: SearchPostsParams): Promise> => {\n return await http.get(\n `/api/v1/posts${querystring.stringify({\n tags: params.tags,\n query: params.query,\n view: params.view,\n limit: params.limit,\n })}`\n )\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 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 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}\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\n .post(`/api/v1/posts`, { title, description, attachments })\n .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 } 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}\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 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 (key: string, name: string): Promise => {\n return await http.post(\"/_api/signin/complete\", {\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}\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\"\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 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 React from \"react\"\nimport ReactDOM from \"react-dom\"\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 ReactDOM.render(, document.getElementById(\"root-toastify\"))\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"],"sourceRoot":""}