import * as i0 from '@angular/core';
import { inject, Injectable } from '@angular/core';
import { LocaleService } from '@seniorsistemas/angular-components/locale';

/**
 * @description Service for retrieving localized currency symbols using the browser's `Intl.NumberFormat` API.
 * Uses the locale configured in `LocaleService` to format currency parts and extract the symbol.
 *
 * @example
 * ```typescript
 * const currencyService = inject(CurrencyService);
 *
 * // Get the symbol for BRL in the active locale
 * const symbol = currencyService.getCurrencySymbol({ currency: 'BRL' }); // 'R$'
 * ```
 * @category Currency
 */
class CurrencyService {
    localeService = inject(LocaleService);
    getCurrencySymbol({ currency }) {
        const numberFormat = new Intl.NumberFormat(this.localeService.getLocaleOptions()?.locale, {
            style: 'currency',
            currency: currency ?? 'BRL',
            currencyDisplay: 'narrowSymbol',
            maximumFractionDigits: 5,
        });
        return numberFormat.formatToParts(1).find((x) => x.type === 'currency')?.value ?? '';
    }
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CurrencyService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
    static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CurrencyService, providedIn: 'root' });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CurrencyService, decorators: [{
            type: Injectable,
            args: [{ providedIn: 'root' }]
        }] });

const currencies = {
    KHR: { precision: 12, scale: 2 },
    SSP: { precision: 12, scale: 2 },
    XCD: { precision: 12, scale: 2 },
    EGP: { precision: 12, scale: 2 },
    KWD: { precision: 12, scale: 3 },
    YER: { precision: 12, scale: 2 },
    HUF: { precision: 12, scale: 2 },
    MXN: { precision: 12, scale: 2 },
    MYR: { precision: 12, scale: 2 },
    ZWL: { precision: 12, scale: 2 },
    MUR: { precision: 12, scale: 2 },
    DKK: { precision: 12, scale: 2 },
    NOK: { precision: 12, scale: 2 },
    DJF: { precision: 12, scale: 0 },
    CRC: { precision: 12, scale: 2 },
    BND: { precision: 12, scale: 2 },
    NAD: { precision: 12, scale: 2 },
    MKD: { precision: 12, scale: 2 },
    CDF: { precision: 12, scale: 2 },
    GNF: { precision: 12, scale: 0 },
    EUR: { precision: 12, scale: 2 },
    OMR: { precision: 12, scale: 3 },
    CLP: { precision: 12, scale: 0 },
    BSD: { precision: 12, scale: 2 },
    TOP: { precision: 12, scale: 2 },
    IRR: { precision: 12, scale: 2 },
    BGN: { precision: 12, scale: 2 },
    BZD: { precision: 12, scale: 2 },
    CNY: { precision: 12, scale: 2 },
    FJD: { precision: 12, scale: 2 },
    SRD: { precision: 12, scale: 2 },
    SOS: { precision: 12, scale: 2 },
    GYD: { precision: 12, scale: 2 },
    VUV: { precision: 12, scale: 0 },
    MWK: { precision: 12, scale: 2 },
    MRU: { precision: 12, scale: 2 },
    LSL: { precision: 12, scale: 2 },
    ERN: { precision: 12, scale: 2 },
    BMD: { precision: 12, scale: 2 },
    WST: { precision: 12, scale: 2 },
    LRD: { precision: 12, scale: 2 },
    GMD: { precision: 12, scale: 2 },
    ARS: { precision: 12, scale: 2 },
    ZAR: { precision: 12, scale: 2 },
    RSD: { precision: 12, scale: 2 },
    MDL: { precision: 12, scale: 2 },
    USD: { precision: 12, scale: 2 },
    QAR: { precision: 12, scale: 2 },
    HRK: { precision: 12, scale: 2 },
    GIP: { precision: 12, scale: 2 },
    NPR: { precision: 12, scale: 2 },
    '002': { precision: 9, scale: 4 },
    PLN: { precision: 12, scale: 2 },
    MAD: { precision: 12, scale: 2 },
    BAM: { precision: 12, scale: 2 },
    BTN: { precision: 12, scale: 2 },
    BBD: { precision: 12, scale: 2 },
    SHP: { precision: 12, scale: 2 },
    LKR: { precision: 12, scale: 2 },
    KPW: { precision: 12, scale: 2 },
    LAK: { precision: 12, scale: 2 },
    SZL: { precision: 12, scale: 2 },
    PHP: { precision: 12, scale: 2 },
    RWF: { precision: 12, scale: 0 },
    ISK: { precision: 12, scale: 0 },
    XOF: { precision: 12, scale: 0 },
    AUD: { precision: 12, scale: 2 },
    NGN: { precision: 12, scale: 2 },
    KGS: { precision: 12, scale: 2 },
    KYD: { precision: 12, scale: 2 },
    PGK: { precision: 12, scale: 2 },
    DZD: { precision: 12, scale: 2 },
    XAF: { precision: 12, scale: 0 },
    PEN: { precision: 12, scale: 2 },
    JPY: { precision: 12, scale: 0 },
    SBD: { precision: 12, scale: 2 },
    UGX: { precision: 12, scale: 0 },
    AMD: { precision: 12, scale: 2 },
    AED: { precision: 12, scale: 2 },
    ALL: { precision: 12, scale: 2 },
    XPF: { precision: 12, scale: 0 },
    AFN: { precision: 12, scale: 2 },
    RON: { precision: 12, scale: 2 },
    TND: { precision: 12, scale: 3 },
    NZD: { precision: 12, scale: 2 },
    JOD: { precision: 12, scale: 3 },
    VND: { precision: 12, scale: 0 },
    ETB: { precision: 12, scale: 2 },
    PYG: { precision: 12, scale: 0 },
    JMD: { precision: 12, scale: 2 },
    KES: { precision: 12, scale: 2 },
    IDR: { precision: 12, scale: 2 },
    HKD: { precision: 12, scale: 2 },
    BDT: { precision: 12, scale: 2 },
    GBP: { precision: 12, scale: 2 },
    AOA: { precision: 12, scale: 2 },
    PKR: { precision: 12, scale: 2 },
    TRY: { precision: 12, scale: 2 },
    SLL: { precision: 12, scale: 2 },
    CVE: { precision: 12, scale: 2 },
    LYD: { precision: 12, scale: 3 },
    ILS: { precision: 12, scale: 2 },
    UZS: { precision: 12, scale: 2 },
    CHF: { precision: 12, scale: 2 },
    SVC: { precision: 12, scale: 2 },
    BRL: { precision: 12, scale: 2 },
    GHS: { precision: 12, scale: 2 },
    CUP: { precision: 12, scale: 2 },
    FKP: { precision: 12, scale: 2 },
    NIO: { precision: 12, scale: 2 },
    GEL: { precision: 12, scale: 2 },
    TTD: { precision: 12, scale: 2 },
    AAA: { precision: 1, scale: 1 },
    COP: { precision: 12, scale: 2 },
    MGA: { precision: 12, scale: 2 },
    INR: { precision: 12, scale: 2 },
    KRW: { precision: 12, scale: 0 },
    HNL: { precision: 12, scale: 2 },
    MMK: { precision: 12, scale: 2 },
    TZS: { precision: 12, scale: 2 },
    THB: { precision: 12, scale: 2 },
    TMT: { precision: 12, scale: 2 },
    SAR: { precision: 12, scale: 2 },
    UYU: { precision: 12, scale: 2 },
    BIF: { precision: 12, scale: 0 },
    MVR: { precision: 12, scale: 2 },
    RUB: { precision: 12, scale: 2 },
    GTQ: { precision: 12, scale: 2 },
    SCR: { precision: 12, scale: 2 },
    IQD: { precision: 12, scale: 3 },
    UAH: { precision: 12, scale: 2 },
    BYN: { precision: 12, scale: 2 },
    VES: { precision: 12, scale: 2 },
    BOB: { precision: 12, scale: 2 },
    SGD: { precision: 12, scale: 2 },
    ZMW: { precision: 12, scale: 2 },
    CZK: { precision: 12, scale: 2 },
    TJS: { precision: 12, scale: 2 },
    DOP: { precision: 12, scale: 2 },
    AZN: { precision: 12, scale: 2 },
    PAB: { precision: 12, scale: 2 },
    STN: { precision: 12, scale: 2 },
    SDG: { precision: 12, scale: 2 },
    BWP: { precision: 12, scale: 2 },
    BHD: { precision: 12, scale: 3 },
    CAD: { precision: 12, scale: 2 },
    MNT: { precision: 12, scale: 2 },
    MOP: { precision: 12, scale: 2 },
    HTG: { precision: 12, scale: 2 },
    KZT: { precision: 12, scale: 2 },
    LBP: { precision: 12, scale: 2 },
    SYP: { precision: 12, scale: 2 },
    TWD: { precision: 12, scale: 2 },
    MZN: { precision: 12, scale: 2 },
    ANG: { precision: 12, scale: 2 },
    SEK: { precision: 12, scale: 2 },
    KMF: { precision: 12, scale: 0 },
    AWG: { precision: 12, scale: 2 },
};

/**
 * Generated bundle index. Do not edit.
 */

export { CurrencyService, currencies };
//# sourceMappingURL=seniorsistemas-angular-components-currency.mjs.map
