{ "version": 3, "sources": ["libs/campaign/src/lib/dependencies/src/legacy.ts", "apps/partner-center-client/src/app/campaigns/providers.ts"], "sourcesContent": ["import { Observable, map } from 'rxjs';\nimport { SenderInterface, SenderType } from '@vendasta/campaigns';\n\nexport function SenderTypeFromBusinessId(businessId$: Observable): Observable {\n return businessId$.pipe(\n map((v) => ({\n id: v,\n type: SenderType.SENDER_TYPE_BUSINESS,\n })),\n );\n}\n\nexport function SenderTypeFromPartnerId(partnerId: Observable): Observable {\n return partnerId.pipe(\n map((v) => ({\n id: v,\n type: SenderType.SENDER_TYPE_PARTNER,\n })),\n );\n}\n\nexport type RecipientType = string;\n\nexport class RecipientTypes {\n public static readonly IAMUser: RecipientType = 'RecipientTypeIAMUser';\n public static readonly CampaignRecipient: RecipientType = 'RecipientTypeCampaignRecipient';\n}\n\nexport function stepDataForPartnerEmail(\n recipientAccountGroupId: string,\n recipientType: RecipientType,\n recipientId: string,\n): { [key: string]: string } {\n return {\n account_group_id: recipientAccountGroupId,\n recipient_external_type: recipientType,\n recipient_external_id: recipientId,\n };\n}\n\nexport function stepDataForBusinessEmail(senderAccountGroupId: string): { [key: string]: string } {\n return {\n account_group_id: senderAccountGroupId,\n };\n}\n", "import { inject } from '@angular/core';\n\n// eslint-disable-next-line @nx/enforce-module-boundaries\nimport { CampaignConfig, QuotaConfig, SenderTypeFromPartnerId } from '@galaxy/campaign/dependencies';\nimport { of } from 'rxjs';\nimport { map } from 'rxjs/operators';\nimport { AppConfigService } from '../app-config.service';\nimport { PartnerService } from '../core/partner.service';\n\nexport const CampaignConfigFactory = () => {\n const partner = inject(PartnerService) as PartnerService;\n const appCfg = inject(AppConfigService) as AppConfigService;\n const cfg: CampaignConfig = {\n sender$: SenderTypeFromPartnerId(partner.getPartnerId()),\n userId$: appCfg.config$.pipe(map((c) => c.unifiedUserId)),\n basePath$: of('campaigns'),\n location$: of('US', 'CA'),\n productBasePath$: of('store/app'),\n };\n return cfg;\n};\nexport const CampaignQuotaConfigFactory = () => {\n const partner = inject(PartnerService) as PartnerService;\n const cfg: QuotaConfig = {\n sender$: SenderTypeFromPartnerId(partner.getPartnerId()),\n actionURL: '/upgrade',\n };\n return cfg;\n};\n"], "mappings": "+KAYM,SAAUA,EAAwBC,EAA6B,CACnE,OAAOA,EAAUC,KACfC,EAAKC,IAAO,CACVC,GAAID,EACJE,KAAMC,EAAWC,qBACjB,CAAC,CAEP,CAIA,IAAaC,GAAc,IAAA,CAArB,IAAOA,EAAP,MAAOA,CAAc,GACFC,EAAAC,QAAyB,uBACzBD,EAAAE,kBAAmC,iCAFtD,IAAOH,EAAPC,SAAOD,CAAc,GAAA,EAKrB,SAAUI,EACdC,EACAC,EACAC,EAAmB,CAEnB,MAAO,CACLC,iBAAkBH,EAClBI,wBAAyBH,EACzBI,sBAAuBH,EAE3B,CC7BO,IAAMI,EAAwBA,IAAK,CACxC,IAAMC,EAAUC,EAAOC,CAAc,EAC/BC,EAASF,EAAOG,CAAgB,EAQtC,MAP4B,CAC1BC,QAASC,EAAwBN,EAAQO,aAAY,CAAE,EACvDC,QAASL,EAAOM,QAAQC,KAAKC,EAAKC,GAAMA,EAAEC,aAAa,CAAC,EACxDC,UAAWC,EAAG,WAAW,EACzBC,UAAWD,EAAG,KAAM,IAAI,EACxBE,iBAAkBF,EAAG,WAAW,EAGpC,EACaG,EAA6BA,IAAK,CAC7C,IAAMlB,EAAUC,EAAOC,CAAc,EAKrC,MAJyB,CACvBG,QAASC,EAAwBN,EAAQO,aAAY,CAAE,EACvDY,UAAW,WAGf", "names": ["SenderTypeFromPartnerId", "partnerId", "pipe", "map", "v", "id", "type", "SenderType", "SENDER_TYPE_PARTNER", "RecipientTypes", "_RecipientTypes", "IAMUser", "CampaignRecipient", "stepDataForPartnerEmail", "recipientAccountGroupId", "recipientType", "recipientId", "account_group_id", "recipient_external_type", "recipient_external_id", "CampaignConfigFactory", "partner", "inject", "PartnerService", "appCfg", "AppConfigService", "sender$", "SenderTypeFromPartnerId", "getPartnerId", "userId$", "config$", "pipe", "map", "c", "unifiedUserId", "basePath$", "of", "location$", "productBasePath$", "CampaignQuotaConfigFactory", "actionURL"] }