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EAAYuC,eAAe,CAC7CqB,qBAAsB5D,MAAAA,EAAAA,KAAAA,EAAAA,EAAY6D,iBAAiB,EAEvD,EA6FE1C,qBAAAA,EACAC,kBAAAA,EACArB,eAAAA,EACAiF,eAvMqB,UACrB,GAAIpF,CAAAA,MAAAA,EAAAA,KAAAA,EAAAA,EAAeqF,QAAQ,GAAI/E,EAC7B,MAAO,CAAC,MAAMN,EAAcyB,IAAI,IAAI6D,WAAW,EAGnD,EAmMEhF,YAvRgB,EAwRlB,CACF","sources":["webpack://_N_E/./src/actions/enums.ts","webpack://_N_E/./src/constants/segmentEvents.ts","webpack://_N_E/./src/enums/common.ts","webpack://_N_E/./src/utils/environments.ts","webpack://_N_E/./src/utils/segment/middlewares.ts","webpack://_N_E/./src/utils/segment/index.ts"],"sourcesContent":["export enum ServerActionName {\n // Account\n CreateUserAccounts = \"createUserAccounts\",\n DeleteUser = \"deleteUser\",\n GetUserById = \"getUserById\",\n ListUserAccount = \"listUserAccount\",\n SendUserVerification = \"sendUserVerification\",\n UpdateUserAccount = \"updateUserAccount\",\n GetSupplierConfig = \"getSupplierConfig\",\n\n // Attribute\n AddLibraryAttribute = \"addLibraryAttribute\",\n BulkUpsertCategoryToAttributes = \"bulkUpsertCategoryToAttributes\",\n CreateCustomAttribute = \"createCustomAttribute\",\n DeleteAttribute = \"deleteAttribute\",\n GetAttributeInUseCount = \"getAttributeInUseCount\",\n GetLibraryAttributes = \"getLibraryAttributes\",\n GetSupplierAttributeList = \"getSupplierAttributeList\",\n UpdateAttribute = \"updateAttribute\",\n\n // Authentication\n Login = \"login\",\n ResendVerificationLink = \"resendVerificationLink\",\n SendResetPasswordEmail = \"sendResetPasswordEmail\",\n SetPassword = \"setPassword\",\n UpdateEmailAddress = \"updateEmailAddress\",\n UpdatePassword = \"updatePassword\",\n VerifyEmailAddress = \"verifyEmailAddress\",\n\n // Channel\n GetChannelCategories = \"getChannelCategories\",\n GetChannelConfigurationList = \"getChannelConfigurationList\",\n GetChannelList = \"getChannelList\",\n UpdateChannelSettings = \"updateChannelSettings\",\n UpdateProductChannels = \"updateProductChannels\",\n\n // Common\n GetCurrencyList = \"getCurrencyList\",\n GetGoogleCategoriesList = \"getGoogleCategoriesList\",\n GetLocaleCountries = \"getLocaleCountries\",\n\n // Category Tree\n GetTaxonomyTree = \"getTaxonomyTree\",\n GetTaxonomyTreeNode = \"getTaxonomyTreeNode\",\n UpdateTaxonomyTreeNode = \"updateTaxonomyTreeNode\",\n GetTaxonomyTreeMaxDepth = \"getTaxonomyTreeMaxDepth\",\n\n // DAM\n CreateDamTask = \"createDamTask\",\n GetDamList = \"getDamList\",\n GetDamTaskList = \"getDamTaskList\",\n GetFileDetail = \"getFileDetail\",\n\n // Enrichment\n ApproveEnrichImages = \"approveEnrichImages\",\n CancelEnrichImageTasks = \"cancelEnrichImageTasks\",\n GetEnrichImagesReviewProducts = \"getEnrichImagesReviewProducts\",\n GetEnrichmentStatus = \"getEnrichmentStatus\",\n GetEnrichmentTaskList = \"getEnrichmentTaskList\",\n StartEnrichment = \"startEnrichment\",\n\n // Export\n CreateExportTemplate = \"createExportTemplate\",\n CreateExportTask = \"createExportTask\",\n DeleteExportTemplate = \"deleteExportTemplate\",\n DuplicateExportTemplate = \"duplicateExportTemplate\",\n GetAvailableFixedExportTemplateList = \"getAvailableFixedExportTemplateList\",\n GetAvailableCustomExportTemplateList = \"getAvailableCustomExportTemplateList\",\n GetCustomTemplate = \"getCustomTemplate\",\n GetCustomTemplateList = \"getCustomTemplateList\",\n GetExportTask = \"getExportTask\",\n GetExportTaskList = \"getExportTaskList\",\n UpdateCustomTemplate = \"updateCustomTemplate\",\n CreateExportImageTask = \"createExportImageTask\",\n\n // Feature\n GetFeatureToggles = \"getFeatureToggles\",\n SetFeatureToggle = \"setFeatureToggle\",\n\n // File\n DeleteFiles = \"deleteFiles\",\n GetFilesList = \"getFilesList\",\n RetrieveDownloadUrl = \"retrieveDownloadUrl\",\n UploadFileFromUrl = \"uploadFileFromUrl\",\n ReferenceFileToProduct = \"referenceFileToProduct\",\n\n // Localization\n CreateLocalizationTask = \"createLocalizationTask\",\n CreateBatchLocalizationTask = \"createBatchLocalizationTask\",\n GetLocalizationTaskList = \"getLocalizationTaskList\",\n GetMasterProductLocalizationStatus = \"getMasterProductLocalizationStatus\",\n\n // Product\n AddFileToGallery = \"addFileToGallery\",\n CreateProduct = \"createProduct\",\n CreateVariantProduct = \"createVariantProduct\",\n DeleteProduct = \"deleteProduct\",\n DuplicateProduct = \"duplicateProduct\",\n GetVariantDisplayAttributes = \"getVariantDisplayAttributes\",\n GetBasicProduct = \"getBasicProduct\",\n GetCreateProductTemplate = \"getCreateProductTemplate\",\n GetProduct = \"getProduct\",\n GetProductList = \"getProductList\",\n GetProductListCount = \"getProductListCount\",\n GetVariantProducts = \"getVariantProducts\",\n InitializeExportAuditLog = \"initializeExportAuditLog\",\n RemoveFileFromGalleryAction = \"removeFileFromGalleryAction\",\n UpdateAttributeBlame = \"updateAttributeBlame\",\n UpdateProduct = \"updateProduct\",\n DeleteFileAndProductReferences = \"deleteFileAndProductReferences\",\n GetEnrichedAttributesSources = \"getEnrichedAttributeSources\",\n GetEnrichedAttributesSourcesCount = \"getEnrichedAttributeSourcesCount\",\n GetProductEnrichmentStatus = \"getProductEnrichmentStatus\",\n\n // Feedback\n CreateEnrichmentFeedback = \"createEnrichmentFeedback\",\n UpdateEnrichmentFeedback = \"updateEnrichmentFeedback\",\n GetLatestEnrichmentFeedback = \"getLatestEnrichmentFeedback\",\n\n // Smart Upload\n ArchiveTask = \"archiveTask\",\n FieldMapping = \"fieldMapping\",\n GenerateS3Url = \"generateS3Url\",\n GetActiveTasks = \"getActiveTasks\",\n ImportTasks = \"importTasks\",\n ListAttributes = \"listAttributes\",\n}\n","/**\n * Uppercase for each word\n */\nexport const segmentEvents = {\n loginFailed: \"Login Failed\",\n loginSucceeded: \"Login Completed\",\n contactUsClicked: \"Registration Contact Clicked\",\n forgotPasswordStarted: \"Forgot Password Started\",\n forgotPasswordCompleted: \"Forgot Password Completed\",\n languageSet: \"Language Set\",\n logout: \"User Logout\",\n pageViewed: \"[Portal] Page Viewed\",\n registrationStarted: \"Registration Started\",\n registrationSucceeded: \"Registration Completed\",\n registrationLinkExpired: \"Registration Link Expired\",\n catalogSharedClicked: \"Share Clicked\",\n catalogSharedUrlCopied: \"Share URL Copied\",\n catalogViewedOnlineClicked: \"View Catalog Clicked\",\n catalogCreateClicked: \"Create Catalog Clicked\",\n catalogEditClicked: \"Edit Catalog Clicked\",\n catalogEdited: \"Catalog Edited\",\n catalogCreated: \"Catalog Created\",\n catalogDeleted: \"Catalog Deleted\",\n helpCenterClicked: \"Help Center Clicked\",\n rfqCopyEmailClicked: \"RFQ Copy Email Clicked\",\n usersInvited: \"Users Invited\",\n shareEmailSent: \"Share Email Sent\",\n shareMethodSelected: \"Share Method Selected\",\n supportTicketSubmitted: \"Support Ticket Submitted\",\n qrCodeDownloaded: \"QR Code Downloaded\",\n createVariantClicked: \"Create Variant Clicked\",\n variantGroupCreated: \"Variant Group Created\",\n variantGroupDeleted: \"Variant Group Deleted\",\n variantGroupEdited: \"Variant Group Edited\",\n createProductClicked: \"Create Product Clicked\",\n};\n\nexport const catalogSegmentEvents = {\n pdfDownloadClicked: \"PDF Download Clicked\",\n pdfDownloadStarted: \"PDF Download Started\",\n productsRemoved: \"Products Removed\",\n productsAdded: \"Products Added\",\n catalogStatusChanged: \"Catalog Status Changed\",\n};\n\nexport const customAttributeSegmentEvents = {\n createCustomAttributeClicked: \"Create Custom Attribute Clicked\",\n customAttributeCreated: \"Custom Attribute Created\",\n attributeTabClicked: \"Attribute Tab Clicked\",\n browseAndCreateClicked: \"Browse & Create Clicked\",\n customAttributeEdited: \"Custom Attribute Edited\",\n librarySearched: \"Library Searched\",\n libraryAttributeAdded: \"Library Attribute Added\",\n};\n\nexport const productManagementSegmentEvents = {\n createProductClicked: \"Create Product Clicked\",\n editProductClicked: \"Edit Product Clicked\",\n productColumnEdited: \"Product List Column Edited\",\n productColumnSearch: \"Product Column Searched\",\n productCreated: \"Product Created\",\n productDeleted: \"Products Deleted\",\n productEdited: \"Product Edited\",\n productSearched: \"Products Searched\",\n productInlineEdited: \"Inline Product Edited\",\n viewInCatalogClicked: \"View in EC Clicked\",\n productChangeHistoryClicked: \"Change History Clicked\",\n productChangeHistoryDownloaded: \"Change History Downloaded\",\n mappingConfirmed: \"Mapping Confirmed\",\n batchUploadClicked: \"Batch Upload Clicked\",\n};\n\nexport const productEditSegmentEvents = {\n clearValueClicked: \"Clear Value Clicked\",\n};\n\nexport const companyProfileSegmentEvents = {\n companyProfileEdited: \"Company Profile Edited\",\n};\n\nexport const sourcingOpportunitiesSegmentEvents = {\n learnMoreClicked: \"Learn More Clicked\",\n joinNowClicked: \"Join Now Clicked\",\n viewProductsClicked: \"View Products Clicked\",\n submitClicked: \"Submit Clicked\",\n reviewDisplayed: \"Review Displayed\",\n};\n\nexport const gettingStartedSegmentEvents = {\n viewAttributesClicked: \"View Attributes Clicked\",\n viewProductsClicked: \"View Products Clicked\",\n viewCompanyProfileClicked: \"View Company Profile Clicked\",\n viewCatalogsClicked: \"View Catalogs Clicked\",\n learnMoreClicked: \"Learn More Clicked\",\n viewSampleCatalogClicked: \"View Sample Catalog Clicked\",\n};\n\nexport const localizationSegmentEvents = {\n addLocalizationClicked: \"Add Localization Clicked\",\n localizeClicked: \"Localize Clicked\",\n productLocalized: \"Product Localized\",\n viewLocalizeProductClick: \"View Localized Product Clicked\",\n productListDisplayed: \"Locale Product List Displayed\",\n editProductClicked: \"Edit Localized Product Clicked\",\n columnSearch: \"Localized Product Column Searched\",\n productDeleted: \"Localized Product Deleted\",\n productEdited: \"Localized Product Edited\",\n productInlineEdited: \"Localized Inline Product Edited\",\n variantCreateButtonClicked: \"Localized Create Variant Clicked\",\n variantGroupEdited: \"Localized Variant Edited\",\n variantGroupDeleted: \"Localized Variant Deleted\",\n variantGroupCreated: \"Localized Variant Created\",\n newLocalizationClicked: \"New Localization Clicked\",\n localizationLimitReached: \"Localization Limit Reached\",\n batchLocalizatonStarted: \"Batch Localization Started\",\n localizationTaskLogClicked: \"Localization Task Log Clicked\",\n retryLocalizationClicked: \"Retry Localization Clicked\",\n};\n\nexport const smartUploadSegmentEvents = {\n fileUploaded: \"File Uploaded\",\n uploadCSVGuideClicked: \"Upload CSV Guide Clicked\",\n sendMessageClicked: \"Send Message Clicked\",\n exitPageClicked: \"Exit Page Clicked\",\n headerRowConfirmed: \"Header Row Confirmed\",\n dataTabClicked: \"Data Tab Clicked\",\n goToIssueClicked: \"Go To issue Clicked\",\n skipIssueClicked: \"Skip issue Clicked\",\n dataConfirmed: \"Data Confirmed\",\n dataAnalized: \"Data Analized\",\n productsImported: \"Products Imported\",\n bulkImageUploadSkipped: \"Bulk Image Upload skipped\",\n bulkImageUploadClicked: \"Bulk Image Upload clicked\",\n productSelected: \"Product Selected\",\n filesDropped: \"Files Dropped\",\n filesUploaded: \"Files Uploaded\",\n};\n\nexport const enrichmentSegmentEvents = {\n enrichmentInitiated: \"Enrichment Initiated\",\n enrichmentTaskClicked: \"Task Clicked\",\n talkToSalesClicked: \"Talk-to-Sales Clicked\",\n imageScrapingInitiated: \"Image Scraping Initiated\",\n imageScrapingTaskClosed: \"Task Closed\",\n imageScrapingReviewed: \"Scraped Images Reviewed\",\n AIOutputApproved: \"AI Output Approved\",\n AIOutputRejected: \"AI Output Rejected\",\n AIOutputRejectedAndCleared: \"AI Output Rejected and Cleared\",\n};\n\nexport const exportProductSegmentEvents = {\n exportProductsClicked: \"Export Products Clicked\",\n localizedExportProductsClicked: \"Localized Export Products Clicked\",\n exportInitiated: \"Export Initiated\",\n localizeExportInitiated: \"Localize Export Initiated\",\n downloadFileClicked: \"Download File Clicked\",\n channelExportInitiated: \"Channel Export Initiated\",\n};\n\nexport const channelDistributionSegmentEvents = {\n activateChannelClick: \"Activate Channel Clicked\",\n talkToSalesClicked: \"Talk-to-Sales Clicked\",\n configureClicked: \"Configure Clicked\",\n mappingEdited: \"Mapping Edited\",\n downloadFileClicked: \"Download File Clicked\",\n productsAddedToChannel: \"Products Added to Channel\",\n productsRemovedFromChannel: \"Products Removed from Channel\",\n};\n\nexport const damSegmentEvents = {\n toolClicked: \"Tool Clicked\",\n talkToSalesClicked: \"Talk-to-Sales Clicked\",\n imagesAdded: \"Images Added\",\n imagesProcessed: \"Images Processed\",\n imagesDownloaded: \"Images Downloaded\",\n imagesDeleted: \"Images Deleted\",\n imagesClicked: \"Images Clicked\",\n};\n","export enum LocaleEnum {\n EN_SG = \"EN_SG\",\n ZH_CN = \"ZH_CN\",\n KO_KR = \"KO_KR\",\n JA_JP = \"JA_JP\",\n TH_TH = \"TH_TH\",\n BI = \"BI\", // Bahasa Indonesia\n ZH_HK = \"ZH_HK\", // Traditional Chinese - Hong Kong\n ZH_TW = \"ZH_TW\", // Traditional Chinese - Taiwan\n AR_AE = \"AR_AE\", // Arabic - UAE\n}\n\nexport enum UserLanguage {\n EN = \"en\",\n JP = \"jp\",\n KO = \"ko\",\n TH = \"th\",\n ZH = \"zh\",\n}\n\nexport enum EnvEnum {\n DEV = \"dev\",\n QA = \"qa\",\n STAGING = \"staging\",\n PRODUCTION = \"prod\",\n}\n\nexport enum ClientCookieKey {\n appSideMenuCollapsed = \"appSideMenuCollapsed\",\n appSideMenuOpenKeys = \"appSideMenuOpenKeys\",\n}\n\nexport enum LocalStorageKey {\n ProductTableColumns = \"productTableColumnsV3\",\n GoogleCategory = \"googleCategory\",\n CountryList = \"countryList\",\n CurrencyList = \"currencyList\",\n PdpImageAssetsTour = \"pdpImageAssetsTour\",\n SmartImport = \"smartImport\",\n LocaleProductDetailEditInfo = \"localeProductEditInfo\",\n LocaleProductTableColumns = \"localeProductTableColumnsV3\",\n CustomCategory = \"customCategory\",\n}\n\nexport enum SupportedDateFormatsEnum {\n \"DD/MM/YYYY\" = \"DD/MM/YYYY\",\n \"MM/DD/YYYY\" = \"MM/DD/YYYY\",\n \"YYYY/MM/DD\" = \"YYYY/MM/DD\",\n}\n\nexport enum SupportedTimezonesEnum {\n \"UTC +01:00\" = \"Africa/Algiers\",\n \"UTC +02:00\" = \"Europe/Paris\",\n \"UTC +03:00\" = \"Europe/Moscow\",\n \"UTC +04:00\" = \"Asia/Dubai\",\n \"UTC +05:00\" = \"Asia/Karachi\",\n \"UTC +06:00\" = \"Asia/Dhaka\",\n \"UTC +07:00\" = \"Asia/Jakarta\",\n \"UTC +08:00\" = \"Asia/Kuala_Lumpur\",\n \"UTC +09:00\" = \"Asia/Tokyo\",\n \"UTC +10:00\" = \"Australia/Brisbane\",\n \"UTC +11:00\" = \"Asia/Magadan\",\n \"UTC +12:00\" = \"Pacific/Auckland\",\n \"UTC +13:00\" = \"Pacific/Apia\",\n \"UTC +14:00\" = \"Pacific/Kiritimati\",\n \"UTC -01:00\" = \"Atlantic/Cape_Verde\",\n \"UTC -02:00\" = \"America/Noronha\",\n \"UTC -03:00\" = \"America/Recife\",\n \"UTC -04:00\" = \"America/Toronto\",\n \"UTC -05:00\" = \"America/Winnipeg\",\n \"UTC -06:00\" = \"America/Guatemala\",\n \"UTC -07:00\" = \"America/Los_Angeles\",\n \"UTC -08:00\" = \"America/Anchorage\",\n \"UTC -09:00\" = \"Pacific/Gambier\",\n \"UTC -10:00\" = \"Pacific/Honolulu\",\n \"UTC -11:00\" = \"Pacific/Pago_Pago\",\n}\n","import { EnvEnum } from \"@/src/enums/common\";\n\nexport const getEnv = (): EnvEnum =>\n (process.env.ENVIRONMENT as EnvEnum) || EnvEnum.DEV;\n\nexport const isBrowser = (): boolean => typeof window !== \"undefined\";\n\nexport const isServer = (): boolean => !isBrowser();\n","import cloneDeep from \"lodash/cloneDeep\";\nimport { segmentEvents } from \"@/src/constants/segmentEvents\";\nimport { MiddlewareFunction } from \"@segment/analytics-next\";\n\nexport const segmentPageTitleParserMiddleWare: MiddlewareFunction = ({\n payload,\n next,\n}) => {\n const newPayload = cloneDeep(payload);\n const eventType = payload.type();\n if (eventType === \"page\" || eventType === \"track\") {\n const pageTitle = payload.obj.context?.page?.title;\n const [pageType, pageCategory] = (pageTitle ?? \"|\").split(\"|\");\n // Adds page_type and page_category properties for all track and page events\n if (!pageType || !pageCategory) {\n console.error(\"Segment: Event aborted, missing meta data in page head.\");\n // Aborted to prevent contamination of downstream tools with improper event structure format\n // Need to add page meta data to root of page, example:\n // \n // {pageMetaData.distribution.title}\n // \n return;\n }\n newPayload.obj.properties = {\n ...payload.obj.properties,\n page_type: pageType?.trim(),\n page_category: pageCategory?.trim(),\n };\n\n if (eventType === \"page\") {\n // rename event name for page calls\n newPayload.obj.name = segmentEvents.pageViewed;\n }\n }\n next(newPayload);\n};\n\nexport const segmentDefaultPropertiesAppendMiddleWare: ({\n context,\n properties,\n}: {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n context?: Record;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n properties?: Record;\n}) => MiddlewareFunction =\n ({ context, properties }) =>\n ({ payload, next }) => {\n const newPayload = cloneDeep(payload);\n newPayload.obj.context = {\n ...payload.obj.context,\n ...context,\n };\n newPayload.obj.properties = {\n ...payload.obj.properties,\n ...properties,\n };\n next(newPayload);\n };\n","import { MappedUser, SegmentUser } from \"@/src/types/user\";\nimport { z } from \"zod\";\nimport { EnvEnum } from \"@/src/enums/common\";\nimport type {\n AnalyticsBrowserSettings,\n Callback,\n} from \"@segment/analytics-next\";\nimport { AnalyticsBrowser } from \"@segment/analytics-next\";\nimport type {\n AliasParams,\n EventParams,\n IdentifyParams,\n PageParams,\n} from \"@segment/analytics-next/dist/types/core/arguments-resolver\";\nimport { getEnv } from \"@/src/utils/environments\";\nimport { segmentEvents } from \"@/src/constants/segmentEvents\";\nimport {\n segmentDefaultPropertiesAppendMiddleWare,\n segmentPageTitleParserMiddleWare,\n} from \"./middlewares\";\n\ndeclare global {\n interface Window {\n mixpanel: {\n cookie: {\n clear(): void;\n };\n };\n }\n}\n\nexport const VisitorSchema = z.object({\n visitor_id: z.string().optional(), // Device fingerprint for e-catalog association\n os: z\n .object({\n name: z.string().optional(),\n version: z.string().optional(),\n })\n .optional(),\n});\n\nexport type DeviceTraits = z.infer;\n\ninterface SegmentCredentials {\n apiHost: string | undefined;\n writeKey: string | undefined;\n cdnUrl: string | undefined;\n}\n\nconst SegmentAnalytics = () => {\n const segmentClient = new AnalyticsBrowser(); // This loads a buffered version\n let writeKey: string | undefined;\n let userProperties: SegmentUser | undefined;\n let mappedUser: MappedUser | undefined;\n let isInitiated = false;\n\n const reset = () => {\n segmentClient?.reset();\n window.mixpanel?.cookie.clear(); // Clear mixpanel cookie since segment reset does not call mixpanel\n };\n\n const loadSegmentClient = (\n credentials: SegmentCredentials & { writeKey: string }\n ) => {\n segmentClient.addSourceMiddleware(segmentPageTitleParserMiddleWare);\n const config: AnalyticsBrowserSettings = {\n writeKey: credentials.writeKey,\n ...(credentials?.cdnUrl && {\n cdnURL: credentials.cdnUrl,\n }),\n };\n segmentClient?.load(config, {\n obfuscate: true,\n integrations: {\n ...(credentials?.cdnUrl &&\n credentials?.apiHost && {\n \"Segment.io\": {\n apiHost: credentials.apiHost,\n protocol: \"https\",\n }, // For CDN proxy\n }),\n },\n });\n };\n\n /**\n * Set default properties to be passed to all events via middleware\n * @param context data for Context field\n * @param properties data for Properties field\n */\n const setDefaultProperties = ({\n context,\n properties,\n }: {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n context?: Record;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n properties?: Record;\n }) => {\n segmentClient.addSourceMiddleware(\n segmentDefaultPropertiesAppendMiddleWare({ context, properties })\n );\n };\n\n const setUserProperties = ({\n user,\n visitorId,\n }: {\n user?: MappedUser;\n visitorId?: string;\n }) => {\n userProperties = {\n ...userProperties,\n ...(visitorId && { visitor_id: visitorId }),\n ...(user?.supplierId && { supplier_id: user.supplierId }),\n ...(user?.name && { contact_name: user.name }),\n ...(user?.email && { email: user.email }),\n ...(user?.roleAlias && { role: user.roleAlias }),\n ...(user?.accountType && { account_type: user.accountType }),\n ...(user?.supplierName && { company_legal_name: user.supplierName }),\n ...(user?.skuSegmentSizing && { supplier_sku: user.skuSegmentSizing }),\n ...(user?.tier && { supplier_tier: user.tier }),\n ...(user?.supplierCountry && { supplier_country: user.supplierCountry }),\n ...(user?.customerSegment && { supplier_segment: user.customerSegment }),\n };\n mappedUser = user;\n return userProperties;\n };\n\n /**\n * Gets anonymous id and returns undefined if not found\n * @returns anonymousId\n */\n const getAnonymousId = async () => {\n if (segmentClient?.instance && isInitiated) {\n return (await segmentClient.user()).anonymousId() as string;\n }\n return undefined;\n };\n\n /**\n * Initiate only if segmentClient is undefined OR input writeKey is different\n */\n const initiate = async (\n credentials: SegmentCredentials,\n onLoadCb?: () => void\n ) => {\n const { writeKey: apiKey, apiHost, cdnUrl } = credentials;\n if (apiKey && apiKey !== writeKey && !isInitiated) {\n isInitiated = true; // Setting isInitiated outside of ready call to ensure initiate method is only called once per root component lifetime.\n loadSegmentClient({ writeKey: apiKey, apiHost, cdnUrl });\n\n // ready cb will only fire once all destinations are loaded.\n // Will not invoke if destination throws error like invalid api key etc.\n await segmentClient.ready(() => {\n if (getEnv() !== EnvEnum.PRODUCTION) {\n // eslint-disable-next-line no-console\n console.log(\"segment initiated\");\n }\n if (onLoadCb) {\n onLoadCb();\n }\n });\n }\n };\n\n // ====================================\n // Modified core segment event methods\n // ====================================\n\n // External delay function instead of using segment's native delay call\n // because the library will not fire the callback in\n // the event that the event fails to deliver.\n // See https://segment.com/docs/connections/sources/catalog/libraries/website/javascript/troubleshooting/#if-analyticsjs-fails-to-load-are-callbacks-not-fired\n\n const eventCallbackWithDelay = async (cb?: Callback) => {\n if (cb && typeof cb === \"function\") {\n await new Promise((res) => {\n setTimeout(res, 300);\n });\n const callback = cb as () => void;\n callback();\n }\n };\n\n /**\n * Sends a track event to segment\n * @param args\n */\n const track = (...[eventName, properties, options, cb]: EventParams) => {\n segmentClient?.track(eventName, properties, options);\n eventCallbackWithDelay(cb);\n };\n\n /**\n * Sends a page event to segment\n * @param args\n */\n const page = (...[category, name, properties, options, cb]: PageParams) => {\n segmentClient?.page(category, name, properties, options);\n eventCallbackWithDelay(cb);\n };\n\n /**\n * Sends an identify event to segment.\n * @param args\n */\n const identify = (...[id, traits, options, cb]: IdentifyParams) => {\n segmentClient?.identify(id, traits, options);\n eventCallbackWithDelay(cb);\n };\n\n /**\n * Sends an alias call to segment. Mainly used for destinations that requires alias like Mixpanel.\n * @param args\n */\n const alias = (...[to, from, options, cb]: AliasParams) => {\n segmentClient?.alias(to, from, options);\n eventCallbackWithDelay(cb);\n };\n\n /**\n * Sends a group call to segment.\n * @param args\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const group = (traits: object) => {\n segmentClient?.group(userProperties?.supplier_id, {\n ...traits,\n company_legal_name: mappedUser?.supplierName,\n account_type: mappedUser?.accountType,\n supplier_sku: mappedUser?.skuSegmentSizing,\n supplier_tier: mappedUser?.tier,\n supplier_segment: mappedUser?.customerSegment,\n supplier_create_date: mappedUser?.supplierCreatedAt,\n });\n };\n\n // =========================\n // Custom event methods\n // =========================\n /**\n * Sends login event to segment. Consist of identify call and a track call.\n * @param user\n */\n const login = async ({\n user,\n resetPassword,\n remember,\n }: {\n user: MappedUser;\n resetPassword?: boolean;\n remember?: boolean;\n }) => {\n // Setup user related event middlewares\n const userProps = setUserProperties({ user });\n setDefaultProperties({ properties: userProperties });\n\n // Event calls\n await segmentClient.identify(user.id, userProps); // set user properties as default TRAITS\n await segmentClient.group(user.supplierId, {\n company_legal_name: user?.supplierName,\n account_type: user?.accountType,\n supplier_sku: user?.skuSegmentSizing,\n supplier_tier: user?.tier,\n supplier_segment: user?.customerSegment,\n supplier_create_date: user?.supplierCreatedAt,\n });\n await segmentClient.track(segmentEvents.loginSucceeded, {\n reset_password: resetPassword || undefined,\n remember_me: !!remember,\n });\n };\n\n /**\n * Sends logout event and resets segment and mixpanel cookie.\n */\n const logout = async (cb?: () => void) => {\n segmentClient?.track(segmentEvents.logout);\n eventCallbackWithDelay(cb);\n reset();\n };\n\n /**\n * Sends register event to segment. Will call login event at the end.\n * @param user\n */\n const register = async (user: MappedUser, remember?: boolean) => {\n // Setup user related event middlewares\n setUserProperties({ user });\n setDefaultProperties({ properties: user });\n\n // Event calls\n await segmentClient?.alias(user.id); // Must be before identify, this is only for destinations that requires aliasing like Mixpanel\n await segmentClient.identify(user.id, userProperties); // set user properties as default TRAITS\n await segmentClient.group(user.supplierId, {\n company_legal_name: user?.supplierName,\n account_type: user?.accountType,\n supplier_sku: user?.skuSegmentSizing,\n supplier_tier: user?.tier,\n supplier_segment: user?.customerSegment,\n supplier_create_date: user?.supplierCreatedAt,\n });\n await segmentClient?.track(segmentEvents.registrationSucceeded, {\n user_id: user.id,\n });\n await new Promise((res) => {\n setTimeout(res, 300);\n });\n // adding 300ms delay to ensure events have some buffer time to fire.\n // Based on testing, no delays seems to result in high failure rates.\n await segmentClient?.track(segmentEvents.loginSucceeded, {\n user_id: user.id,\n first_login: true,\n first_login_timestamp: Date.now(),\n remember_me: !!remember,\n });\n };\n\n return {\n initiate,\n login,\n register,\n logout,\n track,\n page,\n identify,\n alias,\n group,\n setDefaultProperties,\n setUserProperties,\n userProperties,\n getAnonymousId,\n isInitiated,\n };\n};\n\nexport const segmentClient = SegmentAnalytics();\n"],"names":["ServerActionName","segmentEvents","loginFailed","loginSucceeded","contactUsClicked","forgotPasswordStarted","forgotPasswordCompleted","languageSet","logout","pageViewed","registrationStarted","registrationSucceeded","registrationLinkExpired","catalogSharedClicked","catalogSharedUrlCopied","catalogViewedOnlineClicked","catalogCreateClicked","catalogEditClicked","catalogEdited","catalogCreated","catalogDeleted","helpCenterClicked","rfqCopyEmailClicked","usersInvited","shareEmailSent","shareMethodSelected","supportTicketSubmitted","qrCodeDownloaded","createVariantClicked","variantGroupCreated","variantGroupDeleted","variantGroupEdited","createProductClicked","productManagementSegmentEvents","editProductClicked","productColumnEdited","productColumnSearch","productCreated","productDeleted","productEdited","productSearched","productInlineEdited","viewInCatalogClicked","productChangeHistoryClicked","productChangeHistoryDownloaded","mappingConfirmed","batchUploadClicked","localizationSegmentEvents","addLocalizationClicked","localizeClicked","productLocalized","viewLocalizeProductClick","productListDisplayed","columnSearch","variantCreateButtonClicked","newLocalizationClicked","localizationLimitReached","batchLocalizatonStarted","localizationTaskLogClicked","retryLocalizationClicked","smartUploadSegmentEvents","fileUploaded","uploadCSVGuideClicked","sendMessageClicked","exitPageClicked","headerRowConfirmed","dataTabClicked","goToIssueClicked","skipIssueClicked","dataConfirmed","dataAnalized","productsImported","bulkImageUploadSkipped","bulkImageUploadClicked","productSelected","filesDropped","filesUploaded","enrichmentSegmentEvents","enrichmentInitiated","enrichmentTaskClicked","talkToSalesClicked","imageScrapingInitiated","imageScrapingTaskClosed","imageScrapingReviewed","AIOutputApproved","AIOutputRejected","AIOutputRejectedAndCleared","exportProductSegmentEvents","exportProductsClicked","localizedExportProductsClicked","exportInitiated","localizeExportInitiated","downloadFileClicked","channelExportInitiated","channelDistributionSegmentEvents","activateChannelClick","configureClicked","mappingEdited","productsAddedToChannel","productsRemovedFromChannel","damSegmentEvents","toolClicked","imagesAdded","imagesProcessed","imagesDownloaded","imagesDeleted","imagesClicked","LocaleEnum","UserLanguage","EnvEnum","ClientCookieKey","LocalStorageKey","SupportedDateFormatsEnum","SupportedTimezonesEnum","getEnv","process","env","ENVIRONMENT","DEV","isBrowser","isServer","segmentPageTitleParserMiddleWare","payload","next","param","newPayload","cloneDeep","eventType","type","pageTitle","obj","context","page","title","pageType","pageCategory","split","console","error","properties","page_type","trim","page_category","name","segmentDefaultPropertiesAppendMiddleWare","z","object","visitor_id","string","optional","os","version","segmentClient","SegmentAnalytics","writeKey","userProperties","mappedUser","AnalyticsBrowser","isInitiated","reset","window","mixpanel","cookie","clear","loadSegmentClient","addSourceMiddleware","config","credentials","cdnUrl","cdnURL","load","obfuscate","integrations","apiHost","protocol","setDefaultProperties","setUserProperties","user","visitorId","supplierId","supplier_id","contact_name","email","roleAlias","role","accountType","account_type","supplierName","company_legal_name","skuSegmentSizing","supplier_sku","tier","supplier_tier","supplierCountry","supplier_country","customerSegment","supplier_segment","eventCallbackWithDelay","cb","Promise","setTimeout","res","callback","initiate","onLoadCb","apiKey","ready","PRODUCTION","log","login","resetPassword","remember","userProps","identify","id","group","supplier_create_date","supplierCreatedAt","track","reset_password","undefined","remember_me","register","alias","user_id","first_login","first_login_timestamp","Date","now","eventName","options","_tmp","category","traits","to","from","getAnonymousId","instance","anonymousId"],"sourceRoot":""}