{ "version": 3, "sources": ["apps/business-center-client/src/app/currency/currency.service.ts", "apps/business-center-client/src/app/currency/index.ts"], "sourcesContent": ["import { Injectable } from '@angular/core';\nimport { MerchantService } from '@galaxy/billing';\nimport { map, Observable, shareReplay, switchMap } from 'rxjs';\nimport { AccountGroupService } from '../account-group';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class CurrencyService {\n constructor(\n private readonly accountGroupService: AccountGroupService,\n private readonly merchantService: MerchantService,\n ) {}\n\n getMarketCurrency(): Observable {\n return this.accountGroupService.currentAccountGroup$.pipe(\n switchMap((accountGroup) =>\n this.merchantService\n .getMultiRetailConfigurations(accountGroup.partnerId, [accountGroup.marketId])\n .pipe(map((resp) => resp.get(accountGroup.marketId)?.currencyCode ?? 'USD')),\n ),\n shareReplay({ refCount: true, bufferSize: 1 }),\n );\n }\n}\n", "export * from './currency.service';\n"], "mappings": "gOAAA,IAQaA,EARbC,EAAAC,EAAA,KAEAC,gBAMaH,GAAe,IAAA,CAAtB,MAAOA,CAAe,CAC1BI,YACmBC,EACAC,EAAgC,CADhC,KAAAD,oBAAAA,EACA,KAAAC,gBAAAA,CAChB,CAEHC,mBAAiB,CACf,OAAO,KAAKF,oBAAoBG,qBAAqBC,KACnDC,EAAWC,GACT,KAAKL,gBACFM,6BAA6BD,EAAaE,UAAW,CAACF,EAAaG,QAAQ,CAAC,EAC5EL,KAAKM,EAAKC,GAASA,EAAKC,IAAIN,EAAaG,QAAQ,GAAGI,cAAgB,KAAK,CAAC,CAAC,EAEhFC,EAAY,CAAEC,SAAU,GAAMC,WAAY,CAAC,CAAE,CAAC,CAElD,iDAfWrB,GAAesB,EAAAC,CAAA,EAAAD,EAAAE,CAAA,CAAA,CAAA,CAAA,iCAAfxB,EAAeyB,QAAfzB,EAAe0B,UAAAC,WAFd,MAAM,CAAA,CAAA,SAEP3B,CAAe,GAAA,ICR5B,IAAA4B,EAAAC,EAAA,KAAAC", "names": ["CurrencyService", "init_currency_service", "__esmMin", "init_esm", "constructor", "accountGroupService", "merchantService", "getMarketCurrency", "currentAccountGroup$", "pipe", "switchMap", "accountGroup", "getMultiRetailConfigurations", "partnerId", "marketId", "map", "resp", "get", "currencyCode", "shareReplay", "refCount", "bufferSize", "\u0275\u0275inject", "AccountGroupService", "MerchantService", "factory", "\u0275fac", "providedIn", "init_currency", "__esmMin", "init_currency_service"] }