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utils/helpers/stringUtils.ts","webpack://_N_E/../../packages/api/stripe-service.ts","webpack://_N_E/../../packages/api/user-service.ts","webpack://_N_E/../../packages/utils/context/UserDetailsContext.tsx","webpack://_N_E/../../packages/utils/hooks/stripe/useStripeSubscription.tsx","webpack://_N_E/../../packages/utils/types/post.ts","webpack://_N_E/"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { useMemo } from \"react\";\n\nimport axios, { AxiosRequestConfig } from \"axios\";\n\nimport { COMMENT_LEVELS, LEAF_COMMENTS } from \"utils/helpers/constants\";\nimport {\n CustomerMuteInfo,\n CustomerMuteResults,\n PostTypes,\n BanUserRequest,\n} from \"utils/types/post\";\n\nimport { APIServiceClient } from \"./api-service\";\n\nimport type {\n CommunitiesResult,\n ArticlePostResult,\n PostsResult,\n ReactionRequestBody,\n ReactionResult,\n ReactionsResult,\n SubCategoriesResult,\n TagsResult,\n AppealDetails,\n PaginatedResult,\n} from \"./types/post-service\";\nimport type {\n Post,\n ArticlePost,\n UploadImageType,\n Comments,\n Comment,\n Poll,\n Polls,\n SubCategory,\n CustomerBannedResult,\n UnbannedCommunitiesResult,\n CustomerProfile,\n ModeratorsLogsResult,\n ModerationLogDetail,\n ModeratorPermissions,\n ActiveBan,\n} from \"utils/types/post\";\n\nexport const API_URL = process.env.TPL_POSTS_SERVICE;\n\nexport const cancelTokenSource = axios.CancelToken.source();\n\nlet postServiceClient: PostServiceClient | undefined;\n\n/**\n * The PostServiceClient class creates an Axios instance for making HTTP requests to the\n * Community microservice API, with methods for authentication, profile management, and miscellaneous tasks.\n *\n * TODO: Add types for all data models used in this service.\n * TODO: Replace all uses of \"any\" type.\n */\nclass PostServiceClient extends APIServiceClient {\n constructor(accessToken?: string) {\n super({\n accessToken,\n baseURL: process.env.TPL_POSTS_SERVICE,\n config: { cancelToken: cancelTokenSource.token },\n });\n }\n\n posts() {\n return {\n createPost: async (data: any): Promise =>\n await this.instance.post(\"posts/api/v1/posts/\", data, {\n withCredentials: true,\n }),\n createArticlePost: async (data: any): Promise =>\n await this.instance.post(\"posts/api/v1/post_articles/\", data, {\n withCredentials: true,\n }),\n updatePost: async (data: any, postId: string): Promise =>\n await this.instance.put(`posts/api/v1/posts/${postId}/`, data, {\n withCredentials: true,\n }),\n uploadImageS3: async (data: any): Promise =>\n await this.instance.post(\"s3_content/api/v1/s3_contents/\", data, {\n headers: { \"Content-Type\": \"multipart/form-data\" },\n withCredentials: true,\n }),\n getTagsList: async (): Promise =>\n await this.instance.get(\"tags/api/v1/tags/\", {\n withCredentials: true,\n }),\n getPostById: async (id: string, params?: any): Promise =>\n await this.instance.get(`posts/api/v1/posts/${id}/`, {\n ...(params && { params }),\n withCredentials: true,\n }),\n getPostBySlug: async (slug: string): Promise =>\n await this.instance.get(`posts/api/v1/posts/by_slug/${slug}/`),\n getPosts: async (\n page?: string,\n ordering?: string\n ): Promise => {\n const params = {\n ...(page && { page }),\n ...(ordering && { ordering }),\n state: PostTypes.active,\n };\n const queryString = new URLSearchParams(params).toString();\n\n return await this.instance.get(\n `posts/api/v1/posts/?${queryString || \"\"}`\n );\n },\n getArticlePost: async (articleId: string): Promise =>\n await this.instance.get(\n `posts/api/v1/post_articles/${articleId}/?quiet=true`,\n { withCredentials: true }\n ),\n blockPost: async (data: any, postId: string): Promise =>\n await this.instance.put(`posts/api/v1/blocks/${postId}`, data, {\n withCredentials: true,\n }),\n unblockPost: async (postId: string): Promise =>\n await this.instance.delete(`posts/api/v1/blocks/${postId}`, {\n withCredentials: true,\n }),\n pinPost: async (postId: string): Promise =>\n await this.instance.put(\n `posts/api/v1/pins/${postId}`,\n {},\n {\n withCredentials: true,\n }\n ),\n unpinPost: async (postId: string): Promise =>\n await this.instance.delete(`posts/api/v1/pins/${postId}`, {\n withCredentials: true,\n }),\n markPremiumPost: async (postId: string): Promise =>\n await this.instance.put(\n `posts/api/v1/premium/${postId}`,\n {},\n {\n withCredentials: true,\n }\n ),\n unmarkPremiumPost: async (postId: string): Promise =>\n await this.instance.delete(`posts/api/v1/premium/${postId}`, {\n withCredentials: true,\n }),\n pauseNotifications: async (postId: string): Promise =>\n this.instance.put(`posts/api/v1/pause_notification/${postId}`, null, {\n withCredentials: true,\n }),\n unpauseNotifications: async (postId: string): Promise =>\n this.instance.delete(`posts/api/v1/pause_notification/${postId}`, {\n withCredentials: true,\n }),\n };\n }\n\n comments() {\n return {\n createComment: async (data: any): Promise =>\n await this.instance.post(\"/comments/api/v1/comments/\", data, {\n withCredentials: true,\n }),\n updateComment: async (data: any, commentId: string): Promise =>\n await this.instance.put(\n `/comments/api/v1/comments/${commentId}/`,\n data,\n { withCredentials: true }\n ),\n blockComment: async (data: any, commentId: string): Promise =>\n await this.instance.put(`comments/api/v1/blocks/${commentId}`, data, {\n withCredentials: true,\n }),\n\n unblockComment: async (commentId: string): Promise =>\n await this.instance.delete(`comments/api/v1/blocks/${commentId}`, {\n withCredentials: true,\n }),\n\n getComments: async (postId: string, page: string): Promise =>\n await this.instance.get(`comments/api/v1/comments/`, {\n params: {\n parent_id: postId,\n page: page,\n levels: COMMENT_LEVELS,\n leaf_comments: LEAF_COMMENTS,\n ordering: \"-created_at\",\n nested_ordering: \"-created_at\",\n },\n withCredentials: true,\n }),\n\n getComment: async (\n commentId: string,\n levels?: number,\n pageNumber?: number,\n fields?: string,\n params?: any\n ): Promise =>\n await this.instance.get(`comments/api/v1/comments/${commentId}/`, {\n params: {\n ...(fields && { fields }),\n ...(params && { ...params }),\n page: pageNumber,\n levels: levels || 0,\n leaf_comments: LEAF_COMMENTS,\n ordering: \"-created_at\",\n nested_ordering: \"-created_at\",\n },\n withCredentials: true,\n }),\n pauseNotifications: async (commentId: string): Promise =>\n await this.instance.put(\n `comments/api/v1/pause_notification/${commentId}`,\n null,\n { withCredentials: true }\n ),\n unpauseNotifications: async (commentId: string): Promise =>\n await this.instance.delete(\n `comments/api/v1/pause_notification/${commentId}`,\n { withCredentials: true }\n ),\n };\n }\n\n moderation(accessToken?: string) {\n return {\n getAppealDetails: async (\n moderationDecisionLog: string\n ): Promise =>\n await this.instance.get(\n `moderation/api/v1/appealable_moderation_decision_logs/${moderationDecisionLog}`,\n {\n ...(accessToken\n ? {\n headers: {\n Authorization: `Bearer ${accessToken}`,\n },\n }\n : {\n withCredentials: true,\n }),\n }\n ),\n createAppeal: async (data: any): Promise =>\n await this.instance.post(\"/moderation/api/v1/appeals/\", data, {\n withCredentials: true,\n }),\n\n getModeratorsList: async (communityId: string): Promise =>\n await this.instance.get(\n `communities/api/v1/moderators?community=${communityId}`,\n {\n withCredentials: true,\n }\n ),\n updateModerator: async (data: any, communityId: string): Promise =>\n await this.instance.patch(\n `/communities/api/v1/modifyModeratorsList?community=${communityId}`,\n data,\n {\n withCredentials: true,\n }\n ),\n getModeratorsLogs: async (path: string): Promise =>\n await this.instance.get(path, {\n withCredentials: true,\n }),\n getBanBlockLogDetail: async (id: string): Promise =>\n await this.instance.get(\n `moderation/api/v1/moderation_decision_logs/${id}`,\n {\n withCredentials: true,\n }\n ),\n updateAppeal: async (data: any, appealId: string): Promise =>\n await this.instance.patch(\n `/moderation/api/v1/appeals/${appealId}/`,\n data,\n {\n withCredentials: true,\n }\n ),\n getModeratorPermissions: async (\n community?: string\n ): Promise =>\n await this.instance.get(`communities/api/v1/moderator_permissions`, {\n params: {\n ...(community && { community }),\n moderatable_only: true,\n },\n withCredentials: true,\n }),\n searchUsers: async (\n searchText: string,\n communityId?: string,\n noModerator?: boolean\n ): Promise => {\n return await this.instance.get(\n `/customers/api/v1/customer_usernames?search=${searchText}`,\n {\n withCredentials: true,\n params: {\n search: searchText,\n exclude_self: true,\n ...(communityId && { not_moderator_in_communities: communityId }),\n ...(noModerator && { not_any_moderator: noModerator }),\n },\n }\n );\n },\n };\n }\n\n polls() {\n return {\n createPoll: async (data: any): Promise =>\n await this.instance.post(\"/posts/api/v1/polls/\", data, {\n withCredentials: true,\n }),\n getPollsByPostId: async (postId: string): Promise =>\n await this.instance.get(`/posts/api/v1/polls/`, {\n params: {\n post: postId,\n },\n }),\n editPoll: async (pollId: string, data: any): Promise =>\n await this.instance.put(`/posts/api/v1/polls/${pollId}/`, data, {\n withCredentials: true,\n }),\n createPollVote: async (data: any): Promise =>\n await this.instance.post(\"/posts/api/v1/poll_votes/\", data, {\n withCredentials: true,\n }),\n createPollOption: async (data: any): Promise =>\n await this.instance.post(`/posts/api/v1/poll_options/`, data, {\n withCredentials: true,\n }),\n editPollOption: async (optionId: string, data: any): Promise =>\n await this.instance.put(\n `/posts/api/v1/poll_options/${optionId}/`,\n data,\n { withCredentials: true }\n ),\n deletePollOption: async (optionId: string): Promise =>\n await this.instance.delete(`/posts/api/v1/poll_options/${optionId}/`, {\n withCredentials: true,\n }),\n };\n }\n\n reaction() {\n return {\n getReactions: async (\n ids: string[],\n type: \"post\" | \"comment\" = \"post\",\n config?: AxiosRequestConfig\n ): Promise => {\n return this.instance.get(\"reacts/api/v1/reactions/\", {\n params: {\n object_ids: ids.toString(),\n object_type: type,\n },\n ...config,\n });\n },\n createReaction: async (\n data: ReactionRequestBody\n ): Promise =>\n this.instance.post(\"reacts/api/v1/reactions/\", data, {\n withCredentials: true,\n }),\n changeReaction: async (reactionId: string, data: ReactionRequestBody) =>\n this.instance.put(`reacts/api/v1/reactions/${reactionId}/`, data, {\n withCredentials: true,\n }),\n deleteReaction: async (reactionId: string) =>\n this.instance.delete(`reacts/api/v1/reactions/${reactionId}/`, {\n withCredentials: true,\n }),\n };\n }\n\n community() {\n return {\n getCommunities: async (): Promise =>\n await this.instance.get(\"communities/api/v1/communities/\"),\n getSubCategories: async (\n community: string\n ): Promise =>\n await this.instance.get(\"communities/api/v1/sub_categories\", {\n params: { community },\n withCredentials: false,\n }),\n getSubCategoryById: async (subCategoryId: string): Promise =>\n await this.instance.get(\n `communities/api/v1/sub_categories/${subCategoryId}`\n ),\n getModeratorsHighestPosition: async (): Promise =>\n await this.instance.get(\n `communities/api/v1/highest_moderator_position`,\n { withCredentials: true }\n ),\n getIsCommunityModerator: async (\n customer: string,\n community: string\n ): Promise<{ isModeratorOfCommunity: boolean }> =>\n await this.instance.get(`communities/api/v1/is_moderator?customer`, {\n params: {\n customer,\n community,\n },\n withCredentials: true,\n }),\n banCustomerByModerator: async (\n userId: string,\n banDetails: BanUserRequest\n ): Promise => {\n const { isBlanketBan, endTime, reason, communities } = banDetails;\n\n const banList = [];\n if (isBlanketBan) {\n banList.push({\n community: \"\",\n customer: userId,\n is_blanket_banned: isBlanketBan,\n end_time: endTime,\n reason: reason,\n });\n } else {\n communities.forEach((community) => {\n banList.push({\n community: community,\n customer: userId,\n is_blanket_banned: isBlanketBan,\n end_time: endTime,\n reason: reason,\n });\n });\n }\n\n return await this.instance.post(`moderation/api/v1/bans/`, banList, {\n withCredentials: true,\n });\n },\n unbanCustomerByModerator: async (id: string) =>\n await this.instance.delete(`/moderation/api/v1/bans/${id}/`, {\n withCredentials: true,\n }),\n getCustomerBanStatus: async (\n customerId: string,\n communityId?: string | null\n ): Promise =>\n await this.instance.get(\n `moderation/api/v1/bans/?customer=${customerId}`,\n {\n params: {\n community: communityId,\n },\n withCredentials: true,\n }\n ),\n getUnbannedCommunities: async (\n customerId: string,\n moderateOnly: boolean\n ): Promise =>\n await this.instance.get(\n `moderation/api/v1/not_banned_communities?customer=${customerId}&moderatable_only=${moderateOnly}`,\n {\n withCredentials: true,\n }\n ),\n muteCustomer: async (customerId: string): Promise =>\n await this.instance.post(\n `customers/api/v1/customer_relations/`,\n {\n related_customer: customerId,\n relation_type: \"muted\",\n },\n {\n withCredentials: true,\n }\n ),\n unmuteCustomer: async (customerId: string): Promise =>\n await this.instance.delete(\n `customers/api/v1/customer_relations/${customerId}/?relation_type=muted`,\n {\n withCredentials: true,\n }\n ),\n getMuteStatus: async (\n customerIds: Array\n ): Promise => {\n const mutedIdString = customerIds.join(\",\");\n\n const customerMuteResults = await this.instance.get<\n CustomerMuteResults,\n CustomerMuteResults\n >(`/customers/api/v1/customer_relations/`, {\n withCredentials: true,\n params: {\n related_customers: mutedIdString,\n relation_type: \"muted\",\n },\n });\n\n return Promise.resolve(customerMuteResults?.results);\n },\n };\n }\n}\n\nconst createPostServiceClient = () => {\n return new PostServiceClient();\n};\n\nexport const getPostService = (accessToken?: string) => {\n if (accessToken) {\n return new PostServiceClient(accessToken);\n }\n\n const _postServiceClient = postServiceClient ?? createPostServiceClient();\n\n if (!postServiceClient) postServiceClient = _postServiceClient;\n\n return _postServiceClient;\n};\n\n/**\n * It creates a PostService Client instance and returns it\n */\nexport const usePostService = () => {\n const store = useMemo(() => getPostService(), []);\n return store;\n};\n\nexport type {\n CommunitiesResult,\n PostsResult,\n SubCategoriesResult,\n TagsResult,\n PaginatedResult,\n};\n","/**\n * Convert string to boolean\n *\n * @param {string} str String\n *\n * @return {boolean} Boolean\n */\nexport const convertStrToBool = (str: string): boolean => {\n return /true/i.test(str);\n};\n\n/**\n * Pluralize any string based on provided count\n *\n * @param {string} singularWord String\n * @param {string} pluralWord String\n * @param {string} count String\n *\n * @return {string} sigular or plural value\n */\nexport const pluralize = (\n singularWord: string,\n pluralWord: string,\n count: number\n) => {\n return count === 1 ? singularWord : pluralWord;\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { useMemo } from \"react\";\n\nimport axios, { AxiosRequestConfig } from \"axios\";\nimport qs from \"qs\";\n\nimport { convertStrToBool } from \"utils/helpers/stringUtils\";\n\nimport { APIServiceClient } from \"./api-service\";\nimport {\n RawStripeProductType,\n StripeProductType,\n StripePriceType,\n StripeProductFunctionalityObjType,\n StripeCheckoutSession,\n StripeCustomerSubscriptionType,\n StripeUpcomingInvoiceType,\n StripePromocodeType,\n StripePaymentMethodType,\n UserGroupPlanType,\n ScheduledSubscriptionType,\n StripeCustomer,\n} from \"./types/stripe\";\nimport { Feature } from \"./types/user-service\";\n\nexport const cancelTokenSource = axios.CancelToken.source();\n\nlet stripeServiceClient: StripeServiceClient | undefined;\n\n/**\n * Processing Stripe product for a more convenient interaction\n *\n * @param {RawStripeProductType} stripeProduct Stripe product\n *\n * @return {StripeProductType} Stripe product\n */\nfunction stripeProductProcessing(\n stripeProduct: RawStripeProductType\n): StripeProductType {\n return {\n ...stripeProduct,\n metadata: {\n functionalityListJson: stripeProduct.metadata.functionalityListJson,\n markerText: stripeProduct.metadata.markerText,\n order: Number(stripeProduct.metadata.order),\n mobileOrder: Number(stripeProduct.metadata.mobileOrder),\n onlyForVerifiedStudents: stripeProduct.metadata.onlyForVerifiedStudents\n ? convertStrToBool(stripeProduct.metadata.onlyForVerifiedStudents)\n : false,\n disabled: stripeProduct.metadata.disabled\n ? convertStrToBool(stripeProduct.metadata.disabled)\n : false,\n shortFunctionalityListJson:\n stripeProduct.metadata.shortFunctionalityListJson,\n shortFunctionalityList: stripeProduct.metadata.shortFunctionalityListJson\n ? JSON.parse(stripeProduct.metadata.shortFunctionalityListJson)\n : null,\n },\n };\n}\n\nclass StripeServiceClient extends APIServiceClient {\n constructor(accessToken?: string) {\n super({\n accessToken,\n baseURL: process.env.TPL_USERS_SERVICE,\n });\n }\n\n /**\n * It fetches Stripe products list with Stripe's prices list\n *\n * @param {AxiosRequestConfig} config Axios config object\n *\n * @return {[StripeProductType[]]} Stripe products list with Stripe's prices list\n */\n async getStripeProductsListWithPrices(\n config?: AxiosRequestConfig\n ): Promise {\n const [stripeProducts, stripePrices, stripeProductsFunctionalityLists] =\n await Promise.all([\n this.getStripeProductsList(config),\n this.getStripePricesList(config),\n this.getStripeProductFunctionalityLists(config),\n ]);\n\n return stripeProducts\n .map((stripeProduct) => ({\n ...stripeProduct,\n metadata: {\n ...stripeProduct.metadata,\n functionalityList: stripeProductsFunctionalityLists[stripeProduct.id],\n },\n default_price: stripePrices.find(\n ({ id }) => id === stripeProduct.defaultPrice\n ),\n productPrices: stripePrices.filter(\n ({ product }) => product === stripeProduct.id\n ),\n }))\n .sort(\n ({ metadata: { order: orderA } }, { metadata: { order: orderB } }) =>\n (orderA as number) - (orderB as number)\n );\n }\n\n /**\n * It fetches Stripe's products list\n *\n * @param {AxiosRequestConfig} config Axios config object\n *\n * @return {[StripeProductType[]]} Stripe's products list\n */\n async getStripeProductsList(\n config?: AxiosRequestConfig\n ): Promise {\n return (\n (\n await this.instance.get(\"/st/v1/products\", {\n withCredentials: true,\n ...config,\n })\n ).data || []\n ).map(stripeProductProcessing);\n }\n\n /**\n * It fetches Stripe's product\n *\n * @param {string} productID Stripe product ID\n * @param {AxiosRequestConfig} config Axios config object\n *\n * @return {[StripeProductType]} Stripe's product\n */\n async getStripeProductByID(\n productID: string,\n config?: AxiosRequestConfig\n ): Promise {\n return stripeProductProcessing(\n await this.instance.get(`/st/v1/products/${productID}`, {\n withCredentials: true,\n ...config,\n })\n );\n }\n\n /**\n * It fetches Stripe's prices list\n *\n * @param {AxiosRequestConfig} config Axios config object\n *\n * @return {[StripePriceType[]]} Stripe's prices list\n */\n async getStripePricesList(\n config?: AxiosRequestConfig\n ): Promise {\n return (\n await this.instance.get(\"/st/v1/prices\", {\n withCredentials: true,\n ...config,\n })\n ).data;\n }\n\n /**\n * It fetches Stripe's price\n *\n * @param {string} priceID Stripe price ID\n * @param {AxiosRequestConfig} config Axios config object\n *\n * @return {[StripePriceType]} Stripe's price\n */\n getStripePriceByID(\n priceID: string,\n config?: AxiosRequestConfig\n ): Promise {\n return this.instance.get(`/st/v1/prices/${priceID}`, {\n withCredentials: true,\n ...config,\n });\n }\n\n /**\n * It fetches all Stripe product functionality list\n *\n * @param {AxiosRequestConfig} config Axios config object\n *\n * @return {Promise<{ (key: string): StripeProductFunctionalityObjType[]; }} All Stripe product functionality list\n */\n getStripeProductFunctionalityLists(config?: AxiosRequestConfig): Promise<{\n (key: string): StripeProductFunctionalityObjType[];\n }> {\n return this.instance.get(\"/st/v1/plan_permissions\", {\n withCredentials: true,\n ...config,\n });\n }\n\n /**\n * It fetches Stripe product functionality list Stripe Checkout Session\n *\n * @param {string} priceId Stripe price ID\n * @param {string} successUrl Success url\n * @param {string} cancelUrl Cancel url\n * @param {AxiosRequestConfig} config Axios config object\n *\n * @return {Promise} Stripe Checkout Session\n */\n async getStripeCheckoutSession(\n priceId,\n successUrl: string = location.href,\n cancelUrl: string = location.href,\n config?: AxiosRequestConfig\n ): Promise {\n return this.instance.post(\n \"/st/v1/product_page\",\n {\n price: priceId,\n success_url: successUrl,\n cancel_url: cancelUrl,\n },\n {\n withCredentials: true,\n headers: {\n \"Content-Type\": \"application/x-www-form-urlencoded\",\n },\n ...config,\n }\n );\n }\n\n /**\n * It fetches Stripe product functionality list Stripe Save Payment Setup Session\n *\n * @param {string} successUrl Success url\n * @param {string} cancelUrl Cancel url\n *\n * @return {Promise} Stripe Checkout Session\n */\n async getStripeSavePaymentSession(\n successUrl: string = location.href,\n cancelUrl: string = location.href\n ): Promise {\n return this.instance.post(\n \"/st/v1/setup_payment\",\n {\n success_url: successUrl,\n cancel_url: cancelUrl,\n },\n {\n withCredentials: true,\n headers: {\n \"Content-Type\": \"application/x-www-form-urlencoded\",\n },\n }\n );\n }\n\n /**\n * It fetches Stripe customer\n *\n * @param {string} customerID Stripe customer ID\n * @param {AxiosRequestConfig} config Axios config object\n *\n * @return {Promise} Stripe customer\n */\n async getStripeCustomerByID(\n customerID: string,\n config?: AxiosRequestConfig\n ): Promise {\n return await this.instance.get(`/st/v1/customers/${customerID}`, {\n withCredentials: true,\n ...config,\n });\n }\n\n /**\n * It fetches Stripe customer subscriptions\n *\n * @param {string} customerID Stripe customer ID\n * @param {AxiosRequestConfig} config Axios config object\n *\n * @return {Promise} Stripe customer subscriptions\n */\n async getStripeSubscriptionsByCustomerID(\n customerID: string,\n config?: AxiosRequestConfig\n ): Promise {\n return (\n await this.instance.get(\n `st/v1/subscriptions?${qs.stringify({\n customer: customerID,\n })}`,\n {\n withCredentials: true,\n ...config,\n }\n )\n )?.data;\n }\n\n /**\n * It fetches scheduled Stripe customer subscriptions\n *\n * @param {string} customerID Stripe customer ID\n * @param {AxiosRequestConfig} config Axios config object\n *\n * @return {Promise} Scheduled Stripe customer subscriptions\n */\n async getStripeScheduledSubscriptionsByCustomerID(\n customerID: string,\n config?: AxiosRequestConfig\n ): Promise {\n return (\n await this.instance.get(\n `st/v1/subscription_schedules?${qs.stringify({\n customer: customerID,\n })}`,\n {\n withCredentials: true,\n ...config,\n }\n )\n )?.data;\n }\n\n /**\n * It fetches Stripe customer upcoming invoice\n *\n * @param {string} customerID Stripe customer ID\n * @param {AxiosRequestConfig} config Axios config object\n *\n * @return {Promise} Stripe customer upcoming invoice\n */\n async getStripeUpcomingInvoiceByCustomerID(\n customerID: string,\n config?: AxiosRequestConfig\n ): Promise {\n return await this.instance.get(\n `st/v1/invoices/upcoming?${qs.stringify({\n customer: customerID,\n })}`,\n {\n withCredentials: true,\n ...config,\n }\n );\n }\n\n /**\n * It fetches Stripe customer payment method\n *\n * @param {string} paymentMethodId Stripe payment method ID\n * @param {AxiosRequestConfig} config Axios config object\n *\n * @return {Promise} Stripe customer upcoming invoice\n */\n async getStripePaymentMethodByID(\n paymentMethodID: string,\n config?: AxiosRequestConfig\n ): Promise {\n return await this.instance.get(`st/v1/payment_methods/${paymentMethodID}`, {\n withCredentials: true,\n ...config,\n });\n }\n\n /**\n * It fetches all Stripe customer payment methods\n *\n * @param {AxiosRequestConfig} config Axios config object\n *\n * @return {Promise} Stripe customer upcoming invoice\n */\n async getAllStripePaymentMethods(\n config?: AxiosRequestConfig\n ): Promise<{ data: StripePaymentMethodType[] }> {\n return await this.instance.get(`st/v1/payment_methods`, {\n withCredentials: true,\n ...config,\n });\n }\n\n /**\n * Cancel Stripe subscription\n *\n * @param {string} subscriptionID Stripe customer ID\n * @param {AxiosRequestConfig} config Axios config object\n *\n * @return {Promise} Promise\n */\n async cancelStripeSubscription(\n subscriptionID: string,\n config?: AxiosRequestConfig\n ): Promise {\n return await this.instance.delete(\n `/st/v1/subscriptions/${subscriptionID}`,\n {\n withCredentials: true,\n ...config,\n }\n );\n }\n\n /**\n * Cancel Stripe subscription\n *\n * @param {string} scheduledSubscriptionID Stripe customer ID\n * @param {AxiosRequestConfig} config Axios config object\n *\n * @return {Promise} Promise\n */\n async cancelStripeScheduledSubscription(\n scheduledSubscriptionID: string,\n config?: AxiosRequestConfig\n ): Promise {\n return await this.instance.post(\n `/st/v1/subscription_schedules/${scheduledSubscriptionID}/cancel`,\n {},\n {\n withCredentials: true,\n ...config,\n }\n );\n }\n\n /**\n * Get special Stripe promocode for current user\n *\n * @param {AxiosRequestConfig} config Axios config object\n *\n * @return {Promise} Stripe promocode\n */\n async getSpecialStripePromocodeForCurrentUser(\n config?: AxiosRequestConfig\n ): Promise {\n return await this.instance.get(\"/st/v1/promotion_code\", {\n withCredentials: true,\n ...config,\n });\n }\n\n /**\n * Cancel Stripe subscription\n *\n * @param {string} subscriptionID Stripe customer ID\n * @param {\n * priceID?: string; priceID Stripe promocode ID\n * promocodeID: string; promocodeID Stripe promocode ID\n * }\n * @param {AxiosRequestConfig} config Axios config object\n *\n * @return {Promise} Promise\n */\n async updateStripeSubscription(\n subscriptionID: string,\n {\n priceID,\n promocodeID,\n }: {\n priceID?: string;\n promocodeID?: string;\n },\n config?: AxiosRequestConfig\n ): Promise {\n return await this.instance.post(\n `/st/v1/subscriptions/${subscriptionID}`,\n {\n price: priceID,\n promo: promocodeID,\n },\n {\n withCredentials: true,\n headers: {\n \"Content-Type\": \"application/x-www-form-urlencoded\",\n },\n ...config,\n }\n );\n }\n\n /**\n * It fetches Stripe products list with Stripe's prices list from user groups list\n *\n * @param {AxiosRequestConfig} config Axios config object\n *\n * @return {[StripeProductType[]]} Stripe products list with Stripe's prices list\n */\n async getUserGroupPlanListWithStripeProductAndPrice(\n config?: AxiosRequestConfig\n ): Promise {\n const [userGroupsPlans, stripeProducts, stripePrices] = await Promise.all([\n this.getUserGroupsPlanList(config),\n this.getStripeProductsList(config),\n this.getStripePricesList(config),\n ]);\n\n const stripeProductsWithPrice: StripeProductType[] = stripeProducts.map(\n (stripeProduct) =>\n ({\n ...stripeProduct,\n defaultPrice: stripePrices.find(\n ({ id }) => id === stripeProduct.defaultPrice\n ),\n productPrices: stripePrices.filter(\n ({ product }) => product === stripeProduct.id\n ),\n } as StripeProductType)\n );\n\n return userGroupsPlans\n .map(\n (userGroup) =>\n ({\n ...userGroup,\n product: {\n ...stripeProductsWithPrice.find(({ id }) =>\n userGroup.productId.includes(id)\n ),\n productPrices: stripePrices.filter(({ product }) =>\n userGroup.productId.includes(product)\n ),\n } as StripeProductType,\n } as UserGroupPlanType)\n )\n .filter(({ group }) => !!group?.content)\n .sort(\n (\n {\n group: {\n content: { order: orderA },\n },\n },\n {\n group: {\n content: { order: orderB },\n },\n }\n ) => orderA - orderB\n );\n }\n\n /**\n * It fetches User groups plans\n *\n * @param {AxiosRequestConfig} config Axios config object\n *\n * @return {[UserGroupPlanType[]]} User groups plans\n */\n async getUserGroupsPlanList(\n config?: AxiosRequestConfig\n ): Promise {\n return await this.instance.get(\"/st/v1/group_plan\", {\n withCredentials: true,\n ...config,\n });\n }\n\n /**\n * It fetches features list\n *\n * @param {AxiosRequestConfig} config Axios config object\n *\n * @return {[UserGroupPlanType[]]} Features list\n */\n async getFeaturesList(config?: AxiosRequestConfig): Promise {\n return await this.instance.get(\"/st/v1/features\", {\n withCredentials: true,\n ...config,\n });\n }\n\n /**\n * It fetches features list\n *\n * @param {string} paymentId Payment Id\n *\n * @return {Promise} Features list\n */\n async makePaymentMethodDefault(\n paymentId: string\n ): Promise {\n return await this.instance.put(\n `/st/v1/payment_methods/${paymentId}`,\n null,\n {\n withCredentials: true,\n }\n );\n }\n\n /**\n * It deletes the provided payment method\n *\n * @param {string} paymentId Payment Id\n *\n * @return {Promise} Features list\n */\n async detachPaymentMethod(\n paymentId: string\n ): Promise {\n return await this.instance.post(\n `/st/v1/payment_methods/${paymentId}/detach`,\n null,\n {\n withCredentials: true,\n }\n );\n }\n}\n\nexport const getStripeService = (accessToken?: string) => {\n if (accessToken) {\n return new StripeServiceClient(accessToken);\n }\n\n const _stripeServiceClient = stripeServiceClient ?? new StripeServiceClient();\n\n if (!stripeServiceClient) stripeServiceClient = _stripeServiceClient;\n\n return _stripeServiceClient;\n};\n\n/**\n * It creates a StripeService Client instance and returns it\n */\nexport const useStripeService = () => {\n const store = useMemo(() => getStripeService(), []);\n return store;\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { useMemo } from \"react\";\n\nimport axios, { AxiosRequestConfig } from \"axios\";\n\nimport { APIServiceClient } from \"./api-service\";\n\nimport type {\n ContactFormRequestBody,\n ContactFormType,\n CustomerShortProfile,\n ForgotPasswordRequestBody,\n LoginRequestBody,\n RegisterRequestBody,\n ResetPasswordRequestBody,\n SocialAuthRequestBody,\n SocialAuthType,\n Team,\n UserGroup,\n UserGroupWithPermissions,\n UserSettings,\n} from \"./types/user-service\";\nimport type { User } from \"next-auth\";\nimport type { JWT } from \"next-auth/jwt\";\nimport type { UserAccountProps, UserModelInterface } from \"utils/types/account\";\n\nexport const cancelTokenSource = axios.CancelToken.source();\n\nlet userServiceClient: UserServiceClient | undefined;\n\n/**\n * The UserServiceClient class creates an Axios instance for making HTTP requests to the\n * User microservice API, with methods for authentication, profile management, and miscellaneous tasks.\n *\n * TODO: Add types for all data models used in this service.\n * TODO: Replace all uses of \"any\" type.\n */\nclass UserServiceClient extends APIServiceClient {\n constructor(accessToken?: string, disableKeysToCamel?: boolean) {\n super({\n accessToken,\n baseURL: process.env.TPL_USERS_SERVICE,\n disabledKeysToCamel: disableKeysToCamel,\n config: { cancelToken: cancelTokenSource.token },\n });\n }\n\n auth() {\n return {\n login: async (\n data: LoginRequestBody,\n detectedIP: string\n ): Promise =>\n await this.instance.post(\"auth/login/\", data, {\n headers: {\n ...(detectedIP &&\n detectedIP !== \"::1\" && { \"client-ip\": detectedIP }),\n },\n }),\n register: async (\n data: RegisterRequestBody,\n detectedIP: string\n ): Promise =>\n await this.instance.post(\"auth/register/\", data, {\n headers: {\n ...(detectedIP &&\n detectedIP !== \"::1\" && { \"client-ip\": detectedIP }),\n },\n }),\n sendSocialAuthToken: async (\n data: SocialAuthRequestBody,\n social: SocialAuthType,\n detectedIP: string\n ): Promise =>\n await this.instance.post(`social_auth/${social}/`, data, {\n headers: {\n ...(detectedIP &&\n detectedIP !== \"::1\" && { \"client-ip\": detectedIP }),\n },\n }),\n forgotPassword: async (data: ForgotPasswordRequestBody) =>\n await this.instance.post(\"auth/password_reset/\", data),\n resetPassword: async (data: ResetPasswordRequestBody) =>\n await this.instance.post(\"auth/password_reset/confirm/\", data),\n refreshAccessToken: async (\n refreshToken: string\n ): Promise<{ access: string }> =>\n await this.instance.post(\"auth/token/refresh/\", {\n refresh: refreshToken,\n }),\n markRegisterationComplete: async () =>\n await this.instance.post(\"auth/registration-complete/\", null, {\n withCredentials: true,\n }),\n logout: async (refreshToken: string, accessToken: string): Promise =>\n await this.instance.post(\n \"auth/logout/\",\n { refresh: refreshToken },\n {\n /**\n * Passing authoization token manually as NextAuth session\n * has ended, so this.getToken() does not return token\n */\n headers: {\n Authorization: `Bearer ${accessToken}`,\n },\n }\n ),\n communityEvent: async () =>\n await this.instance.post(\"auth/customer-community-event/ \", null, {\n withCredentials: true,\n }),\n sendCustomJoinInfo: async (data) =>\n await this.instance.put(\"auth/custom-join-registration/ \", data, {\n withCredentials: true,\n }),\n };\n }\n\n profile(accessToken?: string) {\n return {\n getUser: async (\n config?: AxiosRequestConfig\n ): Promise =>\n this.getUserModel(\n await this.instance.get(\"auth/customer-profile/\", {\n ...(accessToken\n ? {\n headers: {\n Authorization: `Bearer ${accessToken}`,\n },\n }\n : {\n withCredentials: true,\n }),\n ...config,\n })\n ),\n updateUser: async (data: any): Promise =>\n await this.instance.put(\"auth/customer-profile/\", data, {\n headers: { \"Content-Type\": \"multipart/form-data\" },\n withCredentials: true,\n }),\n generateSmsToken: async (data: any) =>\n await this.instance.post(\"auth/password_reset/sms-token/\", data, {\n withCredentials: true,\n }),\n generateEmailToken: async ({\n email,\n isStudent = false,\n }: {\n email: string;\n isStudent?: boolean;\n }) =>\n await this.instance.post(\n \"auth/password_reset/email-token/\",\n {\n email,\n is_student: isStudent,\n },\n {\n withCredentials: true,\n }\n ),\n verifyEmail: async (data: any) =>\n await this.instance.post(\"auth/password_reset/email-confirm/\", data, {\n withCredentials: true,\n }),\n verifySms: async (data: any) =>\n await this.instance.post(\"auth/password_reset/sms-confirm/\", data, {\n withCredentials: true,\n }),\n changePassword: async (data: any) =>\n await this.instance.patch(\"auth/change-password/\", data, {\n withCredentials: true,\n }),\n sendReferralCode: async (data: any) =>\n await this.instance.put(\"auth/customer-referral/\", data, {\n withCredentials: true,\n }),\n setUserTeam: async (data: any) =>\n await this.instance.put(\"auth/team/\", data, {\n withCredentials: true,\n }),\n removeUserAvatar: async (): Promise =>\n await this.instance.delete(\"auth/customer-profile/\", {\n withCredentials: true,\n }),\n verifyUserName: async (\n username: string\n ): Promise<{ available: boolean }> =>\n await this.instance.get(`auth/verify-username/${username}/`, {\n withCredentials: true,\n }),\n getProfilesByIds: async (\n ids: string[]\n ): Promise => {\n const params = new URLSearchParams();\n ids.forEach((id: string) => params.append(\"id\", id));\n\n return await this.instance.get(`/auth/customer-profiles/`, {\n params: params,\n });\n },\n searchUsersProfiles: async (\n searchText: string,\n excludeSelf: boolean\n ): Promise => {\n return await this.instance.get(`/auth/customer-profiles/`, {\n withCredentials: true,\n params: {\n search: searchText,\n exclude_self: excludeSelf,\n },\n });\n },\n followUser: async (userId: string): Promise<[]> => {\n return await this.instance.post(\n `/auth/customer-follower/`,\n {\n following: userId,\n },\n {\n withCredentials: true,\n }\n );\n },\n unfollowUser: async (customerId: string): Promise<[]> => {\n return await this.instance.delete(\n `/auth/customer-follower/${customerId}`,\n {\n withCredentials: true,\n }\n );\n },\n getFollowers: async (): Promise> => {\n return await this.instance.get(`/auth/customer-follower/`, {\n withCredentials: true,\n });\n },\n };\n }\n\n settings(accessToken?: string) {\n return {\n get: async (config?: AxiosRequestConfig): Promise =>\n await this.instance.get(\"auth/customer-settings/\", {\n ...(accessToken\n ? {\n headers: {\n Authorization: `Bearer ${accessToken}`,\n },\n }\n : {\n withCredentials: true,\n }),\n ...config,\n }),\n update: async (data: any): Promise =>\n await this.instance.put(\"auth/customer-settings/\", data, {\n withCredentials: true,\n }),\n };\n }\n\n permissions(accessToken?: string) {\n return {\n getUserPermissions: async (\n config?: AxiosRequestConfig\n ): Promise =>\n this.getUserGroupWithPermissionsModel(\n await this.instance.get(\"auth/user-group/\", {\n ...(accessToken\n ? {\n headers: {\n Authorization: `Bearer ${accessToken}`,\n },\n }\n : {\n withCredentials: true,\n }),\n ...config,\n })\n ),\n };\n }\n\n postInteraction() {\n return {\n get: async (endpoint: string): Promise =>\n this.instance.get(endpoint, { withCredentials: true }),\n setPostInteraction: async (data: any) =>\n await this.instance.post(\"/strapi/post-interaction\", data, {\n withCredentials: true,\n }),\n };\n }\n\n misc() {\n return {\n fetchTeamList: async (): Promise =>\n await this.instance.get(\"auth/teams/\"),\n submitContactForm: async (\n data: ContactFormRequestBody,\n form: ContactFormType\n ) =>\n await this.instance.post(\n `${form === \"contactUs\" ? \"contact_us/\" : \"work_with_us/\"}`,\n { ...data, company: data.company ?? null }\n ),\n verifyCustomJoinCode: async (\n data\n ): Promise<{\n isCustomer: boolean;\n isStudent: boolean;\n productId: boolean;\n subscriptionStatus: boolean;\n isValidCoupon: boolean;\n }> => await this.instance.post(`auth/custom-join-verification`, data),\n fetchWriterUserName: async (\n email: string\n ): Promise<{ username: string }> =>\n await this.instance.get(`auth/other-profile-email/${email}/`, {\n withCredentials: true,\n }),\n };\n }\n\n getUserModel(userData: UserAccountProps): UserModelInterface {\n return {\n ...userData,\n\n userType: {\n isStudent: userData?.type?.type === \"student\",\n isCustomer: userData?.type?.type === \"customer\",\n },\n };\n }\n\n getUserGroupWithPermissionsModel(\n userGroupsData: UserGroup[]\n ): UserGroupWithPermissions {\n return {\n ...userGroupsData[0],\n\n permissions: userGroupsData.reduce(\n (permissionsAccumulator, userGroupData) =>\n userGroupData.subFeatures.reduce(\n (accumulator, subFeature) => ({\n ...accumulator,\n [subFeature.permissionSlug]: true,\n }),\n permissionsAccumulator\n ),\n {}\n ),\n };\n }\n}\n\nexport const getUserService = (\n accessToken?: string,\n disabledKeysToCamel?: boolean\n) => {\n if (accessToken || disabledKeysToCamel) {\n return new UserServiceClient(accessToken, disabledKeysToCamel);\n }\n\n const _userServiceClient = userServiceClient ?? new UserServiceClient();\n\n if (!userServiceClient) userServiceClient = _userServiceClient;\n\n return _userServiceClient;\n};\n\n/**\n * It creates a UserService Client instance and returns it\n */\nexport const useUserService = () => {\n const store = useMemo(() => getUserService(), []);\n return store;\n};\n","import {\n createContext,\n PropsWithChildren,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useState,\n} from \"react\";\n\nimport reduce from \"lodash/reduce\";\nimport { useSession } from \"next-auth/react\";\nimport useSWRImmutable from \"swr/immutable\";\n\nimport { getPostService } from \"api/post-service\";\nimport { getUserService } from \"api/user-service\";\nimport { identifyUser } from \"lib/segment\";\nimport { useStripeSubscription } from \"utils/hooks/stripe/useStripeSubscription\";\n\nimport { useTeamsContext } from \"./TeamsContext\";\nimport {\n UserPermission,\n type UserModelInterface,\n type UserSettings,\n} from \"../types/account\";\n\nimport type { HighestModerationPosition } from \"api/types/post-service\";\nimport type {\n UserGroup,\n UserGroupWithPermissions,\n} from \"api/types/user-service\";\n\ninterface UserContextProps {\n userDetails: UserModelInterface;\n userStatus: \"authenticated\" | \"loading\" | \"unauthenticated\";\n followers: { [key: string]: boolean };\n userSettings: UserSettings;\n storeUserSettings: (data: Partial) => void;\n storeUserDetails: (data: Partial) => void;\n userGroupWithPermissions: UserGroupWithPermissions;\n storeUserGroupWithPermissions: (\n data: Partial\n ) => void;\n updateUserDetails: () => Promise;\n updateUserGroupWithPermissions: () => Promise;\n updateHighestModeratorPosition: () => Promise;\n updateFollowers: () => Promise>;\n highestModeratorPosition: { position: string; loading: boolean };\n userHasPermission: (permission: UserPermission) => boolean;\n updateUserSettings: () => Promise;\n}\n\n// Creating the user context\nexport const UserContext = createContext(\n null as UserContextProps\n);\n\nexport const UserContextProvider = ({ children }: PropsWithChildren) => {\n const { status, data: session } = useSession();\n const { getTeamByKey } = useTeamsContext();\n\n const userServiceFetcher = useCallback(\n ({\n url,\n disableKeysToCamel,\n }: {\n url: string;\n disableKeysToCamel?: boolean;\n }): Promise =>\n getUserService(null, disableKeysToCamel).getWithToken(\n url,\n session?.accessToken\n ),\n [session?.accessToken]\n );\n\n const communityServiceFetcher = useCallback(\n ({ url }: { url: string }): Promise =>\n getPostService().getWithToken(url, session?.accessToken),\n [session?.accessToken]\n );\n\n const {\n data: details,\n isLoading: loadingDetails,\n mutate: refetchDetails,\n } = useSWRImmutable(\n session?.user?.id\n ? { url: \"/auth/customer-profile/\", userId: session?.user?.id }\n : null,\n (key) =>\n userServiceFetcher(key).then(\n getUserService().getUserModel\n )\n );\n\n const {\n data: permissions,\n isLoading: loadingPermissions,\n mutate: refetchPermissions,\n } = useSWRImmutable(\n session?.user?.id\n ? {\n url: \"/auth/user-group/\",\n userId: session?.user?.id,\n userGroup: details?.groups?.[0]?.id,\n }\n : null,\n (key) =>\n userServiceFetcher(key).then(\n getUserService().getUserGroupWithPermissionsModel\n )\n );\n\n const {\n data: moderatorPosition,\n isLoading: moderatorPositionLoading,\n mutate: updateHighestModeratorPosition,\n } = useSWRImmutable(\n session?.user?.id\n ? {\n url: \"/communities/api/v1/highest_moderator_position\",\n userId: session?.user?.id,\n }\n : null,\n (key) => communityServiceFetcher(key)\n );\n\n const { data: followerIds, mutate: updateFollowers } = useSWRImmutable(\n session?.user?.id\n ? { url: \"/auth/customer-follower/\", userId: session?.user?.id }\n : null,\n (key) => userServiceFetcher>(key)\n );\n\n const { data: settings, mutate: refetchUserSettings } = useSWRImmutable(\n session?.user?.id\n ? { url: \"/auth/customer-settings/\", userId: session?.user?.id }\n : null,\n (key) =>\n userServiceFetcher({ ...key, disableKeysToCamel: true })\n );\n\n const followers = useMemo(\n () => reduce(followerIds, (acc, id) => ({ ...acc, [id]: true }), {}),\n [followerIds]\n );\n\n const highestModeratorPosition = useMemo(\n () => ({\n position: moderatorPosition?.highestModeratorPosition,\n loading: moderatorPositionLoading,\n }),\n [moderatorPosition?.highestModeratorPosition]\n );\n\n const userId = useMemo(\n () => details?.id || session?.user?.id,\n [details, session?.user]\n );\n\n const teamId = useMemo(\n () =>\n details?.customerTeam?.[0]?.team ||\n (session?.user?.customerTeam\n ? getTeamByKey(session?.user?.customerTeam, \"shortName\")?.id\n : null),\n [details, session?.user]\n );\n\n const [userDetails, setUserDetails] = useState(null);\n const [userGroupWithPermissions, setUserGroupWithPermissions] =\n useState(null);\n const [userSettings, setUserSettings] = useState(null);\n\n const userStatus = useMemo(\n () =>\n status === \"unauthenticated\"\n ? status\n : loadingDetails ||\n loadingPermissions ||\n !userDetails ||\n !userGroupWithPermissions\n ? \"loading\"\n : \"authenticated\",\n [\n status,\n loadingDetails,\n loadingPermissions,\n userDetails,\n userGroupWithPermissions,\n ]\n );\n\n const storeUserDetails = useCallback(\n (data: Partial) => {\n if (status === \"unauthenticated\" || !data) {\n setUserDetails(null);\n } else {\n setUserDetails(\n (details) => ({ ...details, ...data } as UserModelInterface)\n );\n\n userId && identifyUser(userId, data);\n }\n },\n [status]\n );\n\n const storeUserGroupWithPermissions = useCallback(\n (data: Partial) => {\n if (status === \"unauthenticated\" || !data) {\n setUserGroupWithPermissions(null);\n } else {\n setUserGroupWithPermissions(\n (details) => ({ ...details, ...data } as UserGroupWithPermissions)\n );\n\n userId && identifyUser(userId, { subscription: data.group.name });\n }\n },\n [status]\n );\n\n const storeUserSettings = useCallback(\n (data: Partial) => {\n if (status === \"unauthenticated\") setUserSettings(null);\n data\n ? setUserSettings(\n (settings) => ({ ...settings, ...data } as UserSettings)\n )\n : setUserSettings(null);\n },\n [status]\n );\n\n const userHasPermission = useCallback(\n (permission: UserPermission) =>\n userGroupWithPermissions?.permissions &&\n permission in userGroupWithPermissions.permissions &&\n userGroupWithPermissions.permissions[permission] === true,\n [userGroupWithPermissions]\n );\n\n useEffect(() => {\n if (details) storeUserDetails(details);\n }, [details]);\n\n useEffect(() => {\n if (settings) storeUserSettings(settings);\n }, [settings]);\n\n useEffect(() => {\n if (permissions) storeUserGroupWithPermissions(permissions);\n }, [permissions]);\n\n useEffect(() => {\n if (status === \"unauthenticated\") {\n storeUserDetails(null);\n storeUserGroupWithPermissions(null);\n }\n }, [status]);\n\n const { subscription } = useStripeSubscription(details?.stripeCustomerId);\n\n useEffect(() => {\n if (\n subscription.isFetched &&\n subscription.data &&\n details?.customerSubscription?.[0]?.status?.status === \"Free Account\"\n ) {\n refetchDetails();\n }\n }, [subscription]);\n\n const updateUserDetails = () => refetchDetails();\n\n const updateUserGroupWithPermissions = () => refetchPermissions();\n\n const updateUserSettings = () => refetchUserSettings();\n\n return (\n \n {children}\n \n );\n};\n\n// Make useUserContext Hook to easily use our context throughout the application\nexport const useUserContext = () => {\n const result = useContext(UserContext);\n if (!result) {\n throw new Error(\"Context used outside of its Provider!\");\n }\n\n return result;\n};\n","import { useCallback } from \"react\";\n\nimport {\n skipToken,\n useQuery,\n type UseQueryResult,\n} from \"@tanstack/react-query\";\nimport { useSession } from \"next-auth/react\";\nimport qs from \"qs\";\n\nimport { getStripeService } from \"api/stripe-service\";\n\nimport type {\n StripeCustomerSubscriptionType,\n StripeProductType,\n} from \"api/types/stripe\";\n\ninterface UseStripeSubscription {\n subscription: UseQueryResult;\n product: UseQueryResult;\n}\n\nexport const useStripeSubscription = (\n stripeCustomerId: string\n): UseStripeSubscription => {\n const { data: session } = useSession();\n\n const stripeQueryFn = useCallback(\n (url: string): Promise =>\n session?.accessToken\n ? getStripeService().getWithToken(url, session?.accessToken)\n : null,\n [session?.accessToken]\n );\n\n const subscription = useQuery({\n queryKey: [\"stripe-subscription\", stripeCustomerId],\n queryFn: stripeCustomerId\n ? () =>\n stripeQueryFn<{ data: StripeCustomerSubscriptionType[] }>(\n `st/v1/subscriptions?${qs.stringify({\n customer: stripeCustomerId,\n })}`\n ).then((data) => data?.data?.[0] ?? null)\n : skipToken,\n });\n\n const product = useQuery({\n queryKey: [\n \"stripe-product\",\n subscription?.data?.items?.data?.[0]?.price?.product,\n ],\n queryFn: subscription?.data?.items?.data?.[0]?.price?.product\n ? () =>\n stripeQueryFn(\n `/st/v1/products/${subscription?.data?.items.data[0].price.product}`\n )\n : skipToken,\n });\n\n return { subscription, product };\n};\n","import type { SerializedEditorState } from \"lexical\";\n\nexport interface UploadImageType {\n createdAt: string;\n id: string;\n objectId: string;\n objectType: string;\n s3File: string;\n updatedAt: string;\n}\n\nexport interface Content {\n body: Body;\n}\n\nexport interface PostConfig {\n isPinned?: boolean;\n isPremium?: boolean;\n isNotificationPaused?: boolean;\n}\n\nexport interface Body {\n editorJson: SerializedEditorState;\n htmlString: string;\n}\n\nexport interface Score {\n contentId: string;\n contentType: string;\n createdAt: string;\n id: string;\n reactScore: number;\n replyScore: number;\n score: number;\n updatedAt: string;\n}\n\nexport interface Post {\n id: string;\n title: string;\n slug: string;\n content: Content;\n config: PostConfig;\n customer: string;\n subCategory: string;\n state: string;\n createdAt: string;\n updatedAt: string;\n lastActivityAt: string;\n tags: Tag[];\n score: Score;\n}\n\nexport interface CustomerPost extends Omit {\n customer?: CustomerShortProfile;\n reactions?: PostReactions;\n}\n\nexport interface ArticlePost {\n articleId: string;\n post: Post;\n community: string;\n}\n\nexport interface CustomerShortProfile {\n avatar: string;\n id: string;\n username: string;\n createdAt?: string;\n status?: \"premium\" | \"deleted\" | \"muted\";\n}\n\nexport interface Tag {\n id: string;\n name: string;\n}\n\nexport interface Community {\n id: string;\n name: string;\n slug: string;\n organization: string;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface SubCategory {\n id: string;\n name: string;\n slug: string;\n community: string;\n type: SubCategoryType;\n createdAt: string;\n updatedAt: string;\n moderatorOnly: boolean;\n}\n\nexport enum SubCategoryType {\n normal = \"normal\",\n fixedTitle = \"fixed_title\",\n}\n\nexport enum PostTypes {\n draft = \"draft\",\n active = \"active\",\n blocked = \"blocked\",\n}\n\nexport enum ImageUploadTypes {\n post = \"post\",\n comment = \"commment\",\n}\n\nexport enum CommentParent {\n comment = \"comment\",\n post = \"post\",\n}\n\nexport interface ChildrenComments {\n count: number;\n results: Comment[];\n}\nexport interface Comment {\n id: string;\n state: PostTypes;\n content: Body;\n parentType: CommentParent;\n parentId: string;\n rootype: string;\n rootId: string;\n customer: string;\n customerName?: string;\n commentDay?: string;\n isHidden?: boolean;\n profilePicture?: string;\n createdAt: string;\n updatedAt: string;\n isDeleted: boolean;\n score: Score;\n childrenComments: ChildrenComments;\n config: { isNotificationPaused?: boolean };\n}\n\nexport interface CustomerComment\n extends Omit {\n customer?: CustomerShortProfile;\n reactions?: PostReactions;\n childrenComments: CustomerChildrenComments;\n}\n\nexport interface CustomerChildrenComments\n extends Omit {\n results: CustomerComment[];\n}\n\nexport interface Comments {\n count: number;\n next: string;\n previous: string | null;\n results: Comment[];\n}\n\nexport interface PostReactions {\n objectId: string;\n objectType: string;\n reactions: Reaction[];\n}\n\nexport interface Reaction {\n name: string;\n count: number;\n youReacted: string;\n}\n\nexport interface ReactionDetail {\n id: string;\n emoji: string;\n objectType: \"post\" | \"comment\";\n objectId: string;\n customer: string;\n createdAt: string;\n updatedAt: string;\n customerProfile: CustomerShortProfile;\n}\n\nexport interface ReactionDetails {\n count: number;\n next: string;\n previous: string | null;\n results: ReactionDetail[];\n}\n\nexport enum PostOrder {\n latest = \"-last_activity_at\",\n popular = \"score\",\n new = \"-created_at\",\n relevant = \"relevant\",\n}\n\nexport enum PostOrderOptions {\n \"score\" = \"Popular\",\n \"-created_at\" = \"New for you\",\n \"-last_activity_at\" = \"Latest\",\n \"relevant\" = \"Most Relevant\",\n}\n\nexport interface PollOption {\n createdAt: string;\n id: string;\n option: Record;\n optionText: string;\n poll: string;\n updatedAt: string;\n voteCount: number;\n youVoted: null | boolean;\n}\n\ninterface PollContent {\n body: Body;\n question: string;\n}\nexport interface Poll {\n id: string;\n content: PollContent;\n post: string;\n endPollDatetime: null | string;\n isPollClosed: boolean;\n options: PollOption[];\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface Polls {\n count: number;\n next: string;\n previous: string | null;\n results: Poll[];\n}\n\nexport interface CustomerBannedResult {\n community: string;\n customer: string;\n isBlanketBanned: boolean;\n endTime: string | null;\n reason: string;\n id: string;\n}\n\nexport interface CustomerModeratorResult {\n isModeratorOfCommunity: boolean;\n}\n\nexport interface UnbannedCommunitiesResult {\n unbannedCommunities: string[];\n isBlanketBanned: boolean;\n}\n\nexport interface ModeratorPermissions {\n canAccessModerationPanel: boolean;\n canAccessModerationPanelOfCommunity: boolean;\n canBanOrUnbanInCommunity: boolean;\n canBlanketBanOrUnban: boolean;\n canBlockOrUnblockInCommunity: boolean;\n canPostInModeratorOnlySubcategory: boolean;\n canPinOrUnpinInCommunity: boolean;\n canEditOwnPostInCommunity: boolean;\n canMarkOrUnmarkPostAsPremium: boolean;\n}\n\nexport interface ModeratorPermissionsResult {\n [key: string]: ModeratorPermissions;\n}\n\nexport interface CustomerProfile {\n id: string;\n email: string;\n username: string;\n organization: string;\n createdAt: string;\n}\n\nexport interface ModeratorsResult {\n count: number;\n next: string;\n previous: string | null;\n results: Moderator[];\n}\n\nexport interface Customer {\n id: string;\n email: string;\n username: string;\n organization: string;\n createdAt: string;\n}\n\nexport interface Moderator {\n community: string;\n type: string;\n updatedAt: string;\n customer: Customer;\n}\n\nexport interface ModeratorLog {\n id: string;\n type: string;\n community: string;\n affectedCustomer: Pick;\n moderator: Pick;\n appealState: string;\n createdAt: string;\n}\n\nexport interface ModeratorsLogsResult {\n count: number;\n next: string;\n previous: string | null;\n results: ModeratorLog[];\n}\n\ninterface AppealContent {\n id: string;\n defense: string;\n state: string;\n}\n\ninterface Violations {\n bans: number;\n blocks: number;\n total: number;\n}\n\nexport interface ModerationLogDetail {\n id: string;\n type: string;\n reason: string;\n affectedCustomer: Pick;\n community: string;\n affectedObjectType?: string;\n affectedObjectId?: string;\n isBlanketBanned?: boolean;\n endTime: string;\n duration: string;\n moderator: Pick;\n createdAt: string;\n numberOfViolations: Violations;\n appeal: AppealContent;\n}\n\nexport interface BanUserRequest {\n reason: string;\n isBlanketBan: boolean;\n endTime: string;\n communities: string[];\n customer?: CustomerShortProfile;\n}\n\nexport interface ModerationCustomerProfile {\n id: string;\n username: string;\n email: string;\n}\n\nexport interface BanOrBlockModerationLog {\n id: string;\n type: string;\n appealState: string;\n appealId: string;\n affectedCustomer: Pick;\n moderator: Pick;\n createdAt: \"2023-10-17T10:46:45.992247Z\";\n}\n\nexport interface ModerationPost {\n id: string;\n slug: string;\n title: string;\n communityId: string;\n customer: ModerationCustomerProfile;\n moderationDecisionLog: BanOrBlockModerationLog;\n subCategory: Pick;\n state: string;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface ModerationComment {\n id: string;\n customer: ModerationCustomerProfile;\n state: string;\n rootObjectData: {\n slug: string;\n subCategory: Pick;\n };\n isDeleted: false;\n parentType: string;\n parentId: string;\n rootType: string;\n rootId: string;\n moderationDecisionLog: BanOrBlockModerationLog;\n createdAt: string;\n updatedAt: string;\n communityId: string;\n}\n\nexport interface ActiveBan {\n id: string;\n community: string;\n customer: Pick;\n isBlanketBanned: boolean;\n endTime: string;\n moderationDecisionLog: BanOrBlockModerationLog;\n}\n\nexport enum ModeratorPosition {\n SUPER_MODERATOR = \"super_moderator\",\n COMMUNITY_ADMIN = \"community_admin\",\n COMMUNITY_MODERATOR = \"community_moderator\",\n}\n\nexport type AppealAffectedPost = Omit<\n ModerationPost,\n \"moderationDecisionLog\" | \"customer\" | \"communityId\"\n>;\n\nexport type AppealAffectedComment = Omit<\n ModerationComment,\n \"moderationDecisionLog\" | \"customer\" | \"communityId\"\n>;\n\nexport interface AppealLog {\n id: string;\n type: string;\n community: string;\n isBlanketBanned?: boolean;\n endTime: string;\n duration: string;\n affectedCustomer: Pick;\n affectedObjectType?: string;\n affectedObjectId?: string;\n affectedContent: AppealAffectedPost | AppealAffectedComment;\n moderator: Pick;\n createdAt: string;\n}\n\nexport interface Appeal {\n id: string;\n moderationDecisionLog: AppealLog;\n customer: string;\n state: string;\n defense: string;\n addressalReason: string;\n addressedAt: string;\n createdAt: string;\n}\n\nexport interface CustomerMuteInfo {\n relatedCustomer: string;\n relationType: string;\n}\n\nexport interface CustomerMuteResults {\n count: number;\n next: string | null;\n previous: string | null;\n results: CustomerMuteInfo[];\n}\n\nexport enum FallbackUsername {\n premium = \"PremiumUser\",\n deleted = \"DeletedUser\",\n}\n\nexport type PostListDensity = \"compact\" | \"expanded\";\n"],"names":["postServiceClient","cancelTokenSource","axios","CancelToken","source","PostServiceClient","APIServiceClient","posts","createPost","data","instance","post","withCredentials","createArticlePost","updatePost","postId","put","concat","uploadImageS3","headers","getTagsList","get","getPostById","id","params","getPostBySlug","slug","getPosts","page","ordering","state","PostTypes","active","queryString","URLSearchParams","toString","getArticlePost","articleId","blockPost","unblockPost","delete","pinPost","unpinPost","markPremiumPost","unmarkPremiumPost","pauseNotifications","unpauseNotifications","comments","createComment","updateComment","commentId","blockComment","unblockComment","getComments","parent_id","levels","COMMENT_LEVELS","leaf_comments","LEAF_COMMENTS","nested_ordering","getComment","pageNumber","fields","moderation","accessToken","getAppealDetails","moderationDecisionLog","Authorization","createAppeal","getModeratorsList","communityId","updateModerator","patch","getModeratorsLogs","path","getBanBlockLogDetail","updateAppeal","appealId","getModeratorPermissions","community","moderatable_only","searchUsers","searchText","noModerator","search","exclude_self","not_moderator_in_communities","not_any_moderator","polls","createPoll","getPollsByPostId","editPoll","pollId","createPollVote","createPollOption","editPollOption","optionId","deletePollOption","reaction","getReactions","ids","type","config","_this","object_ids","object_type","createReaction","changeReaction","reactionId","deleteReaction","getCommunities","getSubCategories","getSubCategoryById","subCategoryId","getModeratorsHighestPosition","getIsCommunityModerator","customer","banCustomerByModerator","userId","banDetails","isBlanketBan","endTime","reason","communities","banList","push","is_blanket_banned","end_time","forEach","unbanCustomerByModerator","getCustomerBanStatus","customerId","getUnbannedCommunities","moderateOnly","muteCustomer","related_customer","relation_type","unmuteCustomer","getMuteStatus","customerIds","mutedIdString","join","customerMuteResults","related_customers","Promise","resolve","results","constructor","baseURL","process","cancelToken","token","createPostServiceClient","getPostService","_postServiceClient","stripeServiceClient","convertStrToBool","test","str","stripeProductProcessing","stripeProduct","metadata","functionalityListJson","markerText","order","Number","mobileOrder","onlyForVerifiedStudents","disabled","shortFunctionalityListJson","shortFunctionalityList","JSON","parse","StripeServiceClient","getStripeProductsListWithPrices","stripeProducts","stripePrices","stripeProductsFunctionalityLists","all","getStripeProductsList","getStripePricesList","getStripeProductFunctionalityLists","map","functionalityList","default_price","find","param","defaultPrice","productPrices","filter","product","sort","param1","orderA","orderB","getStripeProductByID","productID","getStripePriceByID","priceID","getStripeCheckoutSession","priceId","successUrl","location","href","cancelUrl","price","success_url","cancel_url","getStripeSavePaymentSession","getStripeCustomerByID","customerID","getStripeSubscriptionsByCustomerID","qs","getStripeScheduledSubscriptionsByCustomerID","getStripeUpcomingInvoiceByCustomerID","getStripePaymentMethodByID","paymentMethodID","getAllStripePaymentMethods","cancelStripeSubscription","subscriptionID","cancelStripeScheduledSubscription","scheduledSubscriptionID","getSpecialStripePromocodeForCurrentUser","updateStripeSubscription","promocodeID","promo","getUserGroupPlanListWithStripeProductAndPrice","userGroupsPlans","getUserGroupsPlanList","stripeProductsWithPrice","userGroup","productId","includes","group","content","getFeaturesList","makePaymentMethodDefault","paymentId","detachPaymentMethod","getStripeService","_stripeServiceClient","useStripeService","store","useMemo","userServiceClient","UserServiceClient","auth","login","detectedIP","register","sendSocialAuthToken","social","forgotPassword","resetPassword","refreshAccessToken","refreshToken","refresh","markRegisterationComplete","logout","communityEvent","sendCustomJoinInfo","profile","getUser","getUserModel","updateUser","generateSmsToken","generateEmailToken","email","isStudent","is_student","verifyEmail","verifySms","changePassword","sendReferralCode","setUserTeam","removeUserAvatar","verifyUserName","username","getProfilesByIds","append","searchUsersProfiles","excludeSelf","followUser","following","unfollowUser","getFollowers","settings","update","permissions","getUserPermissions","getUserGroupWithPermissionsModel","postInteraction","endpoint","setPostInteraction","misc","fetchTeamList","submitContactForm","form","company","verifyCustomJoinCode","fetchWriterUserName","userData","userType","isCustomer","userGroupsData","reduce","permissionsAccumulator","userGroupData","subFeatures","accumulator","subFeature","permissionSlug","disableKeysToCamel","disabledKeysToCamel","getUserService","_userServiceClient","useUserService","UserContext","createContext","UserContextProvider","session","details","children","status","useSession","getTeamByKey","useTeamsContext","userServiceFetcher","useCallback","url","getWithToken","communityServiceFetcher","isLoading","loadingDetails","mutate","refetchDetails","useSWRImmutable","user","key","then","loadingPermissions","refetchPermissions","groups","moderatorPosition","moderatorPositionLoading","updateHighestModeratorPosition","followerIds","updateFollowers","refetchUserSettings","followers","acc","highestModeratorPosition","position","loading","customerTeam","team","userDetails","setUserDetails","useState","userGroupWithPermissions","setUserGroupWithPermissions","userSettings","setUserSettings","userStatus","storeUserDetails","identifyUser","storeUserGroupWithPermissions","subscription","name","storeUserSettings","userHasPermission","permission","useEffect","useStripeSubscription","stripeCustomerId","isFetched","customerSubscription","react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__","jsx","Provider","value","updateUserDetails","updateUserGroupWithPermissions","updateUserSettings","useUserContext","result","useContext","stripeQueryFn","useQuery","queryKey","queryFn","skipToken","items","SubCategoryType","ImageUploadTypes","CommentParent","PostOrder","PostOrderOptions","ModeratorPosition","FallbackUsername"],"sourceRoot":""}