@taiga-ui/addon-commerce 3.58.0 → 3.59.0-canary.10da730
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/input-card/abstract-input-card.d.ts +1 -1
- package/components/input-card/input-card.component.d.ts +1 -1
- package/components/input-card/input-card.directive.d.ts +1 -1
- package/components/input-card-grouped/input-card-grouped.component.d.ts +1 -1
- package/components/input-cvc/input-cvc.component.d.ts +1 -1
- package/components/input-expire/input-expire.component.d.ts +1 -1
- package/components/money/money.component.d.ts +1 -1
- package/components/money/pipes/fraction-part.pipe.d.ts +1 -1
- package/components/money/pipes/integer-part.pipe.d.ts +1 -1
- package/components/money/pipes/sign-symbol.pipe.d.ts +1 -1
- package/components/thumbnail-card/deprecated.d.ts +1 -1
- package/components/thumbnail-card/thumbnail-card.component.d.ts +1 -1
- package/{esm2015/components/input-card/abstract-input-card.js → esm2020/components/input-card/abstract-input-card.mjs} +3 -3
- package/esm2020/components/input-card/input-card.component.mjs +91 -0
- package/{esm2015/components/input-card/input-card.directive.js → esm2020/components/input-card/input-card.directive.mjs} +3 -3
- package/{esm2015/components/input-card/input-card.module.js → esm2020/components/input-card/input-card.module.mjs} +9 -11
- package/esm2020/components/input-card-grouped/input-card-grouped.component.mjs +337 -0
- package/{esm2015/components/input-card-grouped/input-card-grouped.module.js → esm2020/components/input-card-grouped/input-card-grouped.module.mjs} +19 -21
- package/esm2020/components/input-card-grouped/input-card-grouped.options.mjs +14 -0
- package/esm2020/components/input-card-grouped/input-card-grouped.providers.mjs +28 -0
- package/esm2020/components/input-cvc/input-cvc.component.mjs +91 -0
- package/{esm2015/components/input-cvc/input-cvc.module.js → esm2020/components/input-cvc/input-cvc.module.mjs} +8 -10
- package/esm2020/components/input-expire/input-expire.component.mjs +73 -0
- package/{esm2015/components/input-expire/input-expire.module.js → esm2020/components/input-expire/input-expire.module.mjs} +8 -10
- package/esm2020/components/money/money.component.mjs +78 -0
- package/{esm2015/components/money/money.module.js → esm2020/components/money/money.module.mjs} +5 -5
- package/{esm2015/components/money/pipes/fraction-part.pipe.js → esm2020/components/money/pipes/fraction-part.pipe.mjs} +3 -3
- package/{esm2015/components/money/pipes/integer-part.pipe.js → esm2020/components/money/pipes/integer-part.pipe.mjs} +9 -5
- package/{esm2015/components/money/pipes/sign-symbol.pipe.js → esm2020/components/money/pipes/sign-symbol.pipe.mjs} +3 -3
- package/esm2020/components/money/utils/format-fraction-part.mjs +11 -0
- package/esm2020/components/thumbnail-card/deprecated.mjs +35 -0
- package/{esm2015/components/thumbnail-card/thumbnail-card.component.js → esm2020/components/thumbnail-card/thumbnail-card.component.mjs} +7 -12
- package/{esm2015/components/thumbnail-card/thumbnail-card.module.js → esm2020/components/thumbnail-card/thumbnail-card.module.mjs} +5 -5
- package/{esm2015/pipes/currency/currency.module.js → esm2020/pipes/currency/currency.module.mjs} +4 -4
- package/{esm2015/pipes/currency/currency.pipe.js → esm2020/pipes/currency/currency.pipe.mjs} +3 -3
- package/{esm2015/pipes/format-card/format-card.module.js → esm2020/pipes/format-card/format-card.module.mjs} +4 -4
- package/{esm2015/pipes/format-card/format-card.pipe.js → esm2020/pipes/format-card/format-card.pipe.mjs} +3 -3
- package/{esm2015/utils/get-code-by-currency.js → esm2020/utils/get-code-by-currency.mjs} +2 -3
- package/{esm2015/utils/get-currency-by-code.js → esm2020/utils/get-currency-by-code.mjs} +2 -3
- package/esm2020/utils/get-payment-system.mjs +105 -0
- package/esm2020/validators/card-expire.validator.mjs +8 -0
- package/esm2020/validators/card-number.validator.mjs +8 -0
- package/fesm2015/taiga-ui-addon-commerce-components-input-card-grouped.mjs +450 -0
- package/fesm2015/taiga-ui-addon-commerce-components-input-card-grouped.mjs.map +1 -0
- package/fesm2015/taiga-ui-addon-commerce-components-input-card.mjs +230 -0
- package/fesm2015/taiga-ui-addon-commerce-components-input-card.mjs.map +1 -0
- package/fesm2015/taiga-ui-addon-commerce-components-input-cvc.mjs +128 -0
- package/fesm2015/taiga-ui-addon-commerce-components-input-cvc.mjs.map +1 -0
- package/fesm2015/taiga-ui-addon-commerce-components-input-expire.mjs +110 -0
- package/fesm2015/taiga-ui-addon-commerce-components-input-expire.mjs.map +1 -0
- package/fesm2015/taiga-ui-addon-commerce-components-money.mjs +205 -0
- package/fesm2015/taiga-ui-addon-commerce-components-money.mjs.map +1 -0
- package/fesm2015/taiga-ui-addon-commerce-components-thumbnail-card.mjs +100 -0
- package/fesm2015/taiga-ui-addon-commerce-components-thumbnail-card.mjs.map +1 -0
- package/fesm2015/{taiga-ui-addon-commerce-components.js → taiga-ui-addon-commerce-components.mjs} +1 -1
- package/fesm2015/taiga-ui-addon-commerce-components.mjs.map +1 -0
- package/fesm2015/{taiga-ui-addon-commerce-constants.js → taiga-ui-addon-commerce-constants.mjs} +1 -1
- package/fesm2015/taiga-ui-addon-commerce-constants.mjs.map +1 -0
- package/fesm2015/{taiga-ui-addon-commerce-enums.js → taiga-ui-addon-commerce-enums.mjs} +1 -1
- package/fesm2015/taiga-ui-addon-commerce-enums.mjs.map +1 -0
- package/fesm2015/taiga-ui-addon-commerce-interfaces.mjs +4 -0
- package/fesm2015/taiga-ui-addon-commerce-interfaces.mjs.map +1 -0
- package/fesm2015/{taiga-ui-addon-commerce-pipes.js → taiga-ui-addon-commerce-pipes.mjs} +15 -15
- package/fesm2015/taiga-ui-addon-commerce-pipes.mjs.map +1 -0
- package/fesm2015/{taiga-ui-addon-commerce-tokens.js → taiga-ui-addon-commerce-tokens.mjs} +1 -1
- package/fesm2015/taiga-ui-addon-commerce-tokens.mjs.map +1 -0
- package/fesm2015/taiga-ui-addon-commerce-types.mjs +4 -0
- package/fesm2015/taiga-ui-addon-commerce-types.mjs.map +1 -0
- package/fesm2015/{taiga-ui-addon-commerce-utils.js → taiga-ui-addon-commerce-utils.mjs} +1 -1
- package/fesm2015/taiga-ui-addon-commerce-utils.mjs.map +1 -0
- package/fesm2015/{taiga-ui-addon-commerce-validators.js → taiga-ui-addon-commerce-validators.mjs} +1 -1
- package/fesm2015/taiga-ui-addon-commerce-validators.mjs.map +1 -0
- package/fesm2015/{taiga-ui-addon-commerce.js → taiga-ui-addon-commerce.mjs} +1 -1
- package/fesm2015/taiga-ui-addon-commerce.mjs.map +1 -0
- package/fesm2020/taiga-ui-addon-commerce-components-input-card-grouped.mjs +440 -0
- package/fesm2020/taiga-ui-addon-commerce-components-input-card-grouped.mjs.map +1 -0
- package/{fesm2015/taiga-ui-addon-commerce-components-input-card.js → fesm2020/taiga-ui-addon-commerce-components-input-card.mjs} +28 -38
- package/fesm2020/taiga-ui-addon-commerce-components-input-card.mjs.map +1 -0
- package/{fesm2015/taiga-ui-addon-commerce-components-input-cvc.js → fesm2020/taiga-ui-addon-commerce-components-input-cvc.mjs} +27 -36
- package/fesm2020/taiga-ui-addon-commerce-components-input-cvc.mjs.map +1 -0
- package/{fesm2015/taiga-ui-addon-commerce-components-input-expire.js → fesm2020/taiga-ui-addon-commerce-components-input-expire.mjs} +20 -29
- package/fesm2020/taiga-ui-addon-commerce-components-input-expire.mjs.map +1 -0
- package/{fesm2015/taiga-ui-addon-commerce-components-money.js → fesm2020/taiga-ui-addon-commerce-components-money.mjs} +67 -65
- package/fesm2020/taiga-ui-addon-commerce-components-money.mjs.map +1 -0
- package/{fesm2015/taiga-ui-addon-commerce-components-thumbnail-card.js → fesm2020/taiga-ui-addon-commerce-components-thumbnail-card.mjs} +19 -29
- package/fesm2020/taiga-ui-addon-commerce-components-thumbnail-card.mjs.map +1 -0
- package/fesm2020/taiga-ui-addon-commerce-components.mjs +11 -0
- package/fesm2020/taiga-ui-addon-commerce-components.mjs.map +1 -0
- package/fesm2020/taiga-ui-addon-commerce-constants.mjs +103 -0
- package/fesm2020/taiga-ui-addon-commerce-constants.mjs.map +1 -0
- package/fesm2020/taiga-ui-addon-commerce-enums.mjs +721 -0
- package/fesm2020/taiga-ui-addon-commerce-enums.mjs.map +1 -0
- package/fesm2020/taiga-ui-addon-commerce-interfaces.mjs +4 -0
- package/fesm2020/taiga-ui-addon-commerce-interfaces.mjs.map +1 -0
- package/fesm2020/taiga-ui-addon-commerce-pipes.mjs +67 -0
- package/fesm2020/taiga-ui-addon-commerce-pipes.mjs.map +1 -0
- package/fesm2020/taiga-ui-addon-commerce-tokens.mjs +23 -0
- package/fesm2020/taiga-ui-addon-commerce-tokens.mjs.map +1 -0
- package/fesm2020/taiga-ui-addon-commerce-types.mjs +4 -0
- package/fesm2020/taiga-ui-addon-commerce-types.mjs.map +1 -0
- package/fesm2020/taiga-ui-addon-commerce-utils.mjs +443 -0
- package/fesm2020/taiga-ui-addon-commerce-utils.mjs.map +1 -0
- package/fesm2020/taiga-ui-addon-commerce-validators.mjs +25 -0
- package/fesm2020/taiga-ui-addon-commerce-validators.mjs.map +1 -0
- package/fesm2020/taiga-ui-addon-commerce.mjs +14 -0
- package/fesm2020/taiga-ui-addon-commerce.mjs.map +1 -0
- package/package.json +172 -39
- package/pipes/currency/currency.pipe.d.ts +1 -1
- package/pipes/format-card/format-card.pipe.d.ts +1 -1
- package/types/code-length.d.ts +1 -1
- package/types/currency-variants.d.ts +2 -2
- package/types/money-sign.d.ts +2 -2
- package/types/payment-system.d.ts +1 -1
- package/bundles/taiga-ui-addon-commerce-components-input-card-grouped.umd.js +0 -917
- package/bundles/taiga-ui-addon-commerce-components-input-card-grouped.umd.js.map +0 -1
- package/bundles/taiga-ui-addon-commerce-components-input-card.umd.js +0 -635
- package/bundles/taiga-ui-addon-commerce-components-input-card.umd.js.map +0 -1
- package/bundles/taiga-ui-addon-commerce-components-input-cvc.umd.js +0 -507
- package/bundles/taiga-ui-addon-commerce-components-input-cvc.umd.js.map +0 -1
- package/bundles/taiga-ui-addon-commerce-components-input-expire.umd.js +0 -480
- package/bundles/taiga-ui-addon-commerce-components-input-expire.umd.js.map +0 -1
- package/bundles/taiga-ui-addon-commerce-components-money.umd.js +0 -272
- package/bundles/taiga-ui-addon-commerce-components-money.umd.js.map +0 -1
- package/bundles/taiga-ui-addon-commerce-components-thumbnail-card.umd.js +0 -475
- package/bundles/taiga-ui-addon-commerce-components-thumbnail-card.umd.js.map +0 -1
- package/bundles/taiga-ui-addon-commerce-components.umd.js +0 -51
- package/bundles/taiga-ui-addon-commerce-components.umd.js.map +0 -1
- package/bundles/taiga-ui-addon-commerce-constants.umd.js +0 -114
- package/bundles/taiga-ui-addon-commerce-constants.umd.js.map +0 -1
- package/bundles/taiga-ui-addon-commerce-enums.umd.js +0 -729
- package/bundles/taiga-ui-addon-commerce-enums.umd.js.map +0 -1
- package/bundles/taiga-ui-addon-commerce-interfaces.umd.js +0 -11
- package/bundles/taiga-ui-addon-commerce-interfaces.umd.js.map +0 -1
- package/bundles/taiga-ui-addon-commerce-pipes.umd.js +0 -110
- package/bundles/taiga-ui-addon-commerce-pipes.umd.js.map +0 -1
- package/bundles/taiga-ui-addon-commerce-tokens.umd.js +0 -31
- package/bundles/taiga-ui-addon-commerce-tokens.umd.js.map +0 -1
- package/bundles/taiga-ui-addon-commerce-types.umd.js +0 -11
- package/bundles/taiga-ui-addon-commerce-types.umd.js.map +0 -1
- package/bundles/taiga-ui-addon-commerce-utils.umd.js +0 -793
- package/bundles/taiga-ui-addon-commerce-utils.umd.js.map +0 -1
- package/bundles/taiga-ui-addon-commerce-validators.umd.js +0 -40
- package/bundles/taiga-ui-addon-commerce-validators.umd.js.map +0 -1
- package/bundles/taiga-ui-addon-commerce.umd.js +0 -69
- package/bundles/taiga-ui-addon-commerce.umd.js.map +0 -1
- package/components/input-card/package.json +0 -10
- package/components/input-card/taiga-ui-addon-commerce-components-input-card.d.ts +0 -5
- package/components/input-card-grouped/package.json +0 -10
- package/components/input-card-grouped/taiga-ui-addon-commerce-components-input-card-grouped.d.ts +0 -5
- package/components/input-cvc/package.json +0 -10
- package/components/input-cvc/taiga-ui-addon-commerce-components-input-cvc.d.ts +0 -5
- package/components/input-expire/package.json +0 -10
- package/components/input-expire/taiga-ui-addon-commerce-components-input-expire.d.ts +0 -5
- package/components/money/package.json +0 -10
- package/components/money/taiga-ui-addon-commerce-components-money.d.ts +0 -5
- package/components/package.json +0 -10
- package/components/taiga-ui-addon-commerce-components.d.ts +0 -5
- package/components/thumbnail-card/package.json +0 -10
- package/components/thumbnail-card/taiga-ui-addon-commerce-components-thumbnail-card.d.ts +0 -5
- package/constants/package.json +0 -10
- package/constants/taiga-ui-addon-commerce-constants.d.ts +0 -5
- package/enums/package.json +0 -10
- package/enums/taiga-ui-addon-commerce-enums.d.ts +0 -5
- package/esm2015/components/input-card/input-card.component.js +0 -99
- package/esm2015/components/input-card-grouped/input-card-grouped.component.js +0 -357
- package/esm2015/components/input-card-grouped/input-card-grouped.options.js +0 -9
- package/esm2015/components/input-card-grouped/input-card-grouped.providers.js +0 -29
- package/esm2015/components/input-cvc/input-cvc.component.js +0 -98
- package/esm2015/components/input-expire/input-expire.component.js +0 -80
- package/esm2015/components/money/money.component.js +0 -83
- package/esm2015/components/money/utils/format-fraction-part.js +0 -8
- package/esm2015/components/thumbnail-card/deprecated.js +0 -40
- package/esm2015/utils/get-payment-system.js +0 -106
- package/esm2015/validators/card-expire.validator.js +0 -9
- package/esm2015/validators/card-number.validator.js +0 -8
- package/fesm2015/taiga-ui-addon-commerce-components-input-card-grouped.js +0 -458
- package/fesm2015/taiga-ui-addon-commerce-components-input-card-grouped.js.map +0 -1
- package/fesm2015/taiga-ui-addon-commerce-components-input-card.js.map +0 -1
- package/fesm2015/taiga-ui-addon-commerce-components-input-cvc.js.map +0 -1
- package/fesm2015/taiga-ui-addon-commerce-components-input-expire.js.map +0 -1
- package/fesm2015/taiga-ui-addon-commerce-components-money.js.map +0 -1
- package/fesm2015/taiga-ui-addon-commerce-components-thumbnail-card.js.map +0 -1
- package/fesm2015/taiga-ui-addon-commerce-components.js.map +0 -1
- package/fesm2015/taiga-ui-addon-commerce-constants.js.map +0 -1
- package/fesm2015/taiga-ui-addon-commerce-enums.js.map +0 -1
- package/fesm2015/taiga-ui-addon-commerce-interfaces.js +0 -4
- package/fesm2015/taiga-ui-addon-commerce-interfaces.js.map +0 -1
- package/fesm2015/taiga-ui-addon-commerce-pipes.js.map +0 -1
- package/fesm2015/taiga-ui-addon-commerce-tokens.js.map +0 -1
- package/fesm2015/taiga-ui-addon-commerce-types.js +0 -4
- package/fesm2015/taiga-ui-addon-commerce-types.js.map +0 -1
- package/fesm2015/taiga-ui-addon-commerce-utils.js.map +0 -1
- package/fesm2015/taiga-ui-addon-commerce-validators.js.map +0 -1
- package/fesm2015/taiga-ui-addon-commerce.js.map +0 -1
- package/interfaces/package.json +0 -10
- package/interfaces/taiga-ui-addon-commerce-interfaces.d.ts +0 -5
- package/pipes/package.json +0 -10
- package/pipes/taiga-ui-addon-commerce-pipes.d.ts +0 -5
- package/taiga-ui-addon-commerce.d.ts +0 -5
- package/tokens/package.json +0 -10
- package/tokens/taiga-ui-addon-commerce-tokens.d.ts +0 -5
- package/types/package.json +0 -10
- package/types/taiga-ui-addon-commerce-types.d.ts +0 -5
- package/utils/package.json +0 -10
- package/utils/taiga-ui-addon-commerce-utils.d.ts +0 -5
- package/validators/package.json +0 -10
- package/validators/taiga-ui-addon-commerce-validators.d.ts +0 -5
- /package/{esm2015/components/index.js → esm2020/components/index.mjs} +0 -0
- /package/{esm2015/components/input-card/index.js → esm2020/components/input-card/index.mjs} +0 -0
- /package/{esm2015/components/input-card/input-card.options.js → esm2020/components/input-card/input-card.options.mjs} +0 -0
- /package/{esm2015/components/input-card/taiga-ui-addon-commerce-components-input-card.js → esm2020/components/input-card/taiga-ui-addon-commerce-components-input-card.mjs} +0 -0
- /package/{esm2015/components/input-card-grouped/index.js → esm2020/components/input-card-grouped/index.mjs} +0 -0
- /package/{esm2015/components/input-card-grouped/taiga-ui-addon-commerce-components-input-card-grouped.js → esm2020/components/input-card-grouped/taiga-ui-addon-commerce-components-input-card-grouped.mjs} +0 -0
- /package/{esm2015/components/input-cvc/index.js → esm2020/components/input-cvc/index.mjs} +0 -0
- /package/{esm2015/components/input-cvc/taiga-ui-addon-commerce-components-input-cvc.js → esm2020/components/input-cvc/taiga-ui-addon-commerce-components-input-cvc.mjs} +0 -0
- /package/{esm2015/components/input-expire/index.js → esm2020/components/input-expire/index.mjs} +0 -0
- /package/{esm2015/components/input-expire/taiga-ui-addon-commerce-components-input-expire.js → esm2020/components/input-expire/taiga-ui-addon-commerce-components-input-expire.mjs} +0 -0
- /package/{esm2015/components/money/index.js → esm2020/components/money/index.mjs} +0 -0
- /package/{esm2015/components/money/money.options.js → esm2020/components/money/money.options.mjs} +0 -0
- /package/{esm2015/components/money/taiga-ui-addon-commerce-components-money.js → esm2020/components/money/taiga-ui-addon-commerce-components-money.mjs} +0 -0
- /package/{esm2015/components/money/utils/format-sign-symbol.js → esm2020/components/money/utils/format-sign-symbol.mjs} +0 -0
- /package/{esm2015/components/taiga-ui-addon-commerce-components.js → esm2020/components/taiga-ui-addon-commerce-components.mjs} +0 -0
- /package/{esm2015/components/thumbnail-card/index.js → esm2020/components/thumbnail-card/index.mjs} +0 -0
- /package/{esm2015/components/thumbnail-card/taiga-ui-addon-commerce-components-thumbnail-card.js → esm2020/components/thumbnail-card/taiga-ui-addon-commerce-components-thumbnail-card.mjs} +0 -0
- /package/{esm2015/constants/card-holder-mask.js → esm2020/constants/card-holder-mask.mjs} +0 -0
- /package/{esm2015/constants/card-mask.js → esm2020/constants/card-mask.mjs} +0 -0
- /package/{esm2015/constants/default-card-validator.js → esm2020/constants/default-card-validator.mjs} +0 -0
- /package/{esm2015/constants/index.js → esm2020/constants/index.mjs} +0 -0
- /package/{esm2015/constants/taiga-ui-addon-commerce-constants.js → esm2020/constants/taiga-ui-addon-commerce-constants.mjs} +0 -0
- /package/{esm2015/enums/currency-code.js → esm2020/enums/currency-code.mjs} +0 -0
- /package/{esm2015/enums/currency.js → esm2020/enums/currency.mjs} +0 -0
- /package/{esm2015/enums/index.js → esm2020/enums/index.mjs} +0 -0
- /package/{esm2015/enums/taiga-ui-addon-commerce-enums.js → esm2020/enums/taiga-ui-addon-commerce-enums.mjs} +0 -0
- /package/{esm2015/index.js → esm2020/index.mjs} +0 -0
- /package/{esm2015/interfaces/card.js → esm2020/interfaces/card.mjs} +0 -0
- /package/{esm2015/interfaces/index.js → esm2020/interfaces/index.mjs} +0 -0
- /package/{esm2015/interfaces/taiga-ui-addon-commerce-interfaces.js → esm2020/interfaces/taiga-ui-addon-commerce-interfaces.mjs} +0 -0
- /package/{esm2015/pipes/index.js → esm2020/pipes/index.mjs} +0 -0
- /package/{esm2015/pipes/taiga-ui-addon-commerce-pipes.js → esm2020/pipes/taiga-ui-addon-commerce-pipes.mjs} +0 -0
- /package/{esm2015/taiga-ui-addon-commerce.js → esm2020/taiga-ui-addon-commerce.mjs} +0 -0
- /package/{esm2015/tokens/i18n.js → esm2020/tokens/i18n.mjs} +0 -0
- /package/{esm2015/tokens/index.js → esm2020/tokens/index.mjs} +0 -0
- /package/{esm2015/tokens/taiga-ui-addon-commerce-tokens.js → esm2020/tokens/taiga-ui-addon-commerce-tokens.mjs} +0 -0
- /package/{esm2015/types/code-length.js → esm2020/types/code-length.mjs} +0 -0
- /package/{esm2015/types/currency-variants.js → esm2020/types/currency-variants.mjs} +0 -0
- /package/{esm2015/types/index.js → esm2020/types/index.mjs} +0 -0
- /package/{esm2015/types/money-sign.js → esm2020/types/money-sign.mjs} +0 -0
- /package/{esm2015/types/payment-system.js → esm2020/types/payment-system.mjs} +0 -0
- /package/{esm2015/types/taiga-ui-addon-commerce-types.js → esm2020/types/taiga-ui-addon-commerce-types.mjs} +0 -0
- /package/{esm2015/utils/create-auto-corrected-expire-pipe.js → esm2020/utils/create-auto-corrected-expire-pipe.mjs} +0 -0
- /package/{esm2015/utils/format-currency.js → esm2020/utils/format-currency.mjs} +0 -0
- /package/{esm2015/utils/get-currency-symbol.js → esm2020/utils/get-currency-symbol.mjs} +0 -0
- /package/{esm2015/utils/index.js → esm2020/utils/index.mjs} +0 -0
- /package/{esm2015/utils/is-card-length-valid.js → esm2020/utils/is-card-length-valid.mjs} +0 -0
- /package/{esm2015/utils/is-card-number-valid.js → esm2020/utils/is-card-number-valid.mjs} +0 -0
- /package/{esm2015/utils/is-expire-valid.js → esm2020/utils/is-expire-valid.mjs} +0 -0
- /package/{esm2015/utils/payment-system-icons.js → esm2020/utils/payment-system-icons.mjs} +0 -0
- /package/{esm2015/utils/taiga-ui-addon-commerce-utils.js → esm2020/utils/taiga-ui-addon-commerce-utils.mjs} +0 -0
- /package/{esm2015/validators/index.js → esm2020/validators/index.mjs} +0 -0
- /package/{esm2015/validators/luhn.validator.js → esm2020/validators/luhn.validator.mjs} +0 -0
- /package/{esm2015/validators/taiga-ui-addon-commerce-validators.js → esm2020/validators/taiga-ui-addon-commerce-validators.mjs} +0 -0
|
@@ -1,793 +0,0 @@
|
|
|
1
|
-
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@taiga-ui/core'), require('@taiga-ui/cdk'), require('@taiga-ui/addon-commerce/enums')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@taiga-ui/addon-commerce/utils', ['exports', '@taiga-ui/core', '@taiga-ui/cdk', '@taiga-ui/addon-commerce/enums'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global["taiga-ui"] = global["taiga-ui"] || {}, global["taiga-ui"]["addon-commerce"] = global["taiga-ui"]["addon-commerce"] || {}, global["taiga-ui"]["addon-commerce"].utils = {}), global.core, global.cdk, global["taiga-ui"]["addon-commerce"].enums));
|
|
5
|
-
})(this, (function (exports, core, cdk, enums) { 'use strict';
|
|
6
|
-
|
|
7
|
-
var TUI_EXP_YEAR_MONTH = /^\d{2}[/|.]\d{4}$/;
|
|
8
|
-
var TUI_EXP_SAFARI = /^\d{1,4}.\d{1,2}.\d{1,4}$/;
|
|
9
|
-
/**
|
|
10
|
-
* @deprecated Use {@link https://maskito.dev/kit/date Date} from {@link https://github.com/taiga-family/maskito Maskito} instead
|
|
11
|
-
* TODO: delete in v4.0
|
|
12
|
-
* Correct expiration date text allowing only valid months
|
|
13
|
-
* @internal
|
|
14
|
-
*
|
|
15
|
-
* @returns MM/YY
|
|
16
|
-
*/
|
|
17
|
-
function tuiCreateAutoCorrectedExpirePipe() {
|
|
18
|
-
return function (conformedValue, _a) {
|
|
19
|
-
var rawValue = _a.rawValue;
|
|
20
|
-
// Autofilled with MM/YYYY format
|
|
21
|
-
if (TUI_EXP_YEAR_MONTH.test(rawValue)) {
|
|
22
|
-
conformedValue = rawValue.slice(0, 2) + "/" + rawValue.slice(5);
|
|
23
|
-
}
|
|
24
|
-
// Autofilled with Safari crazy format
|
|
25
|
-
if (rawValue.length > 7 &&
|
|
26
|
-
rawValue.length < 11 &&
|
|
27
|
-
TUI_EXP_SAFARI.test(rawValue)) {
|
|
28
|
-
var array = rawValue.split(core.TUI_NON_DIGIT_REGEXP);
|
|
29
|
-
// TODO: investigate why the month is sometimes more than 2-length in safari
|
|
30
|
-
var month = array[1].slice(2);
|
|
31
|
-
var year = array.find(function (_a) {
|
|
32
|
-
var length = _a.length;
|
|
33
|
-
return length === 4;
|
|
34
|
-
});
|
|
35
|
-
conformedValue = "" + "0".repeat(2 - month.length) + month + "/" + (year ? year.slice(2) : "");
|
|
36
|
-
}
|
|
37
|
-
var indexesOfPipedChars = [];
|
|
38
|
-
var conformedValueArr = conformedValue.split("");
|
|
39
|
-
if (parseInt(conformedValueArr[0], 10) > 1) {
|
|
40
|
-
conformedValueArr[2] = "/";
|
|
41
|
-
conformedValueArr[1] = conformedValueArr[0];
|
|
42
|
-
conformedValueArr[0] = "0";
|
|
43
|
-
indexesOfPipedChars.push(0);
|
|
44
|
-
}
|
|
45
|
-
return {
|
|
46
|
-
value: conformedValueArr.join(""),
|
|
47
|
-
indexesOfPipedChars: indexesOfPipedChars,
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
function tuiGetCurrencySymbol(currency) {
|
|
53
|
-
switch (currency) {
|
|
54
|
-
case enums.TuiCurrency.Ruble:
|
|
55
|
-
case enums.TuiCurrencyCode.Ruble:
|
|
56
|
-
return "\u20BD";
|
|
57
|
-
case enums.TuiCurrency.Dollar:
|
|
58
|
-
case enums.TuiCurrencyCode.Dollar:
|
|
59
|
-
case enums.TuiCurrency.MexicanPeso:
|
|
60
|
-
case enums.TuiCurrencyCode.MexicanPeso:
|
|
61
|
-
return "$";
|
|
62
|
-
case enums.TuiCurrency.SingaporeDollar:
|
|
63
|
-
case enums.TuiCurrencyCode.SingaporeDollar:
|
|
64
|
-
return "S$";
|
|
65
|
-
case enums.TuiCurrency.AustralianDollar:
|
|
66
|
-
case enums.TuiCurrencyCode.AustralianDollar:
|
|
67
|
-
return "A$";
|
|
68
|
-
case enums.TuiCurrency.HongKongDollar:
|
|
69
|
-
case enums.TuiCurrencyCode.HongKongDollar:
|
|
70
|
-
return "HK$";
|
|
71
|
-
case enums.TuiCurrency.CanadianDollar:
|
|
72
|
-
case enums.TuiCurrencyCode.CanadianDollar:
|
|
73
|
-
return "C$";
|
|
74
|
-
case enums.TuiCurrency.Euro:
|
|
75
|
-
case enums.TuiCurrencyCode.Euro:
|
|
76
|
-
return "\u20AC";
|
|
77
|
-
case enums.TuiCurrency.Pound:
|
|
78
|
-
case enums.TuiCurrencyCode.Pound:
|
|
79
|
-
return "\u00A3";
|
|
80
|
-
case enums.TuiCurrency.Baht:
|
|
81
|
-
case enums.TuiCurrencyCode.Baht:
|
|
82
|
-
return "\u0E3F";
|
|
83
|
-
case enums.TuiCurrency.TurkishLira:
|
|
84
|
-
case enums.TuiCurrencyCode.TurkishLira:
|
|
85
|
-
return "\u20BA";
|
|
86
|
-
case enums.TuiCurrency.YuanRenminbi:
|
|
87
|
-
case enums.TuiCurrencyCode.YuanRenminbi:
|
|
88
|
-
return "CN\u00A5";
|
|
89
|
-
case enums.TuiCurrency.Yen:
|
|
90
|
-
case enums.TuiCurrencyCode.Yen:
|
|
91
|
-
return "\u00A5";
|
|
92
|
-
case enums.TuiCurrency.IsraeliShekel:
|
|
93
|
-
case enums.TuiCurrencyCode.IsraeliShekel:
|
|
94
|
-
return "\u20AA";
|
|
95
|
-
case enums.TuiCurrency.IndianRupee:
|
|
96
|
-
case enums.TuiCurrencyCode.IndianRupee:
|
|
97
|
-
return "\u20B9";
|
|
98
|
-
case enums.TuiCurrency.SwissFranc:
|
|
99
|
-
case enums.TuiCurrencyCode.SwissFranc:
|
|
100
|
-
return "\u20A3";
|
|
101
|
-
case enums.TuiCurrency.ArmenianDram:
|
|
102
|
-
case enums.TuiCurrencyCode.ArmenianDram:
|
|
103
|
-
return "\u058F";
|
|
104
|
-
case enums.TuiCurrency.Won:
|
|
105
|
-
case enums.TuiCurrencyCode.Won:
|
|
106
|
-
return "\u20A9";
|
|
107
|
-
case enums.TuiCurrency.Tenge:
|
|
108
|
-
case enums.TuiCurrencyCode.Tenge:
|
|
109
|
-
return "\u20B8";
|
|
110
|
-
case enums.TuiCurrency.Hryvnia:
|
|
111
|
-
case enums.TuiCurrencyCode.Hryvnia:
|
|
112
|
-
return "\u20B4";
|
|
113
|
-
case enums.TuiCurrency.UzbekSum:
|
|
114
|
-
case enums.TuiCurrencyCode.UzbekSum:
|
|
115
|
-
return "So'm";
|
|
116
|
-
case enums.TuiCurrency.KyrgyzstanSom:
|
|
117
|
-
case enums.TuiCurrencyCode.KyrgyzstanSom:
|
|
118
|
-
return "c";
|
|
119
|
-
case enums.TuiCurrency.Dirham:
|
|
120
|
-
case enums.TuiCurrencyCode.Dirham:
|
|
121
|
-
return "Dh";
|
|
122
|
-
case enums.TuiCurrency.TajikistaniSomoni:
|
|
123
|
-
case enums.TuiCurrencyCode.TajikistaniSomoni:
|
|
124
|
-
return "SM";
|
|
125
|
-
case enums.TuiCurrency.MalaysianRinggit:
|
|
126
|
-
case enums.TuiCurrencyCode.MalaysianRinggit:
|
|
127
|
-
return "RM";
|
|
128
|
-
case enums.TuiCurrency.BelarusianRuble:
|
|
129
|
-
case enums.TuiCurrencyCode.BelarusianRuble:
|
|
130
|
-
return "Br";
|
|
131
|
-
case enums.TuiCurrency.GeorgianLari:
|
|
132
|
-
case enums.TuiCurrencyCode.GeorgianLari:
|
|
133
|
-
return "\u20BE";
|
|
134
|
-
case enums.TuiCurrency.AzerbaijaniManat:
|
|
135
|
-
case enums.TuiCurrencyCode.AzerbaijaniManat:
|
|
136
|
-
return "\u20BC";
|
|
137
|
-
case enums.TuiCurrency.SriLankanRupee:
|
|
138
|
-
case enums.TuiCurrencyCode.SriLankanRupee:
|
|
139
|
-
return "Rs.";
|
|
140
|
-
case enums.TuiCurrency.SerbianDinar:
|
|
141
|
-
case enums.TuiCurrencyCode.SerbianDinar:
|
|
142
|
-
return "DIN";
|
|
143
|
-
case enums.TuiCurrency.SaudiRiyal:
|
|
144
|
-
case enums.TuiCurrencyCode.SaudiRiyal:
|
|
145
|
-
return "SR";
|
|
146
|
-
case enums.TuiCurrency.MongolianTugrik:
|
|
147
|
-
case enums.TuiCurrencyCode.MongolianTugrik:
|
|
148
|
-
return "\u20AE";
|
|
149
|
-
case enums.TuiCurrency.SouthAfricanRand:
|
|
150
|
-
case enums.TuiCurrencyCode.SouthAfricanRand:
|
|
151
|
-
return "R";
|
|
152
|
-
case enums.TuiCurrency.IranianRial:
|
|
153
|
-
case enums.TuiCurrencyCode.IranianRial:
|
|
154
|
-
return "IR";
|
|
155
|
-
case enums.TuiCurrency.IndonesianRupiah:
|
|
156
|
-
case enums.TuiCurrencyCode.IndonesianRupiah:
|
|
157
|
-
return "Rp";
|
|
158
|
-
case enums.TuiCurrency.VietnameseDong:
|
|
159
|
-
case enums.TuiCurrencyCode.VietnameseDong:
|
|
160
|
-
return "\u0111";
|
|
161
|
-
case enums.TuiCurrency.NewTurkmenManat:
|
|
162
|
-
case enums.TuiCurrencyCode.NewTurkmenManat:
|
|
163
|
-
return "TMT";
|
|
164
|
-
case enums.TuiCurrency.BrazilianReal:
|
|
165
|
-
case enums.TuiCurrencyCode.BrazilianReal:
|
|
166
|
-
return "R$";
|
|
167
|
-
default:
|
|
168
|
-
return null;
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
function stringifyCurrency(currency) {
|
|
173
|
-
return currency === null || cdk.tuiIsString(currency)
|
|
174
|
-
? currency || ""
|
|
175
|
-
: String(currency).padStart(3, "0");
|
|
176
|
-
}
|
|
177
|
-
function tuiFormatCurrency(currency) {
|
|
178
|
-
var stringifiedCurrency = stringifyCurrency(currency);
|
|
179
|
-
return tuiGetCurrencySymbol(stringifiedCurrency) || stringifiedCurrency;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
var _b$1;
|
|
183
|
-
var TUI_CODE_DICTIONARY = (_b$1 = {},
|
|
184
|
-
_b$1[enums.TuiCurrency.Ruble] = enums.TuiCurrencyCode.Ruble,
|
|
185
|
-
_b$1[enums.TuiCurrency.Dollar] = enums.TuiCurrencyCode.Dollar,
|
|
186
|
-
_b$1[enums.TuiCurrency.MexicanPeso] = enums.TuiCurrencyCode.MexicanPeso,
|
|
187
|
-
_b$1[enums.TuiCurrency.SingaporeDollar] = enums.TuiCurrencyCode.SingaporeDollar,
|
|
188
|
-
_b$1[enums.TuiCurrency.AustralianDollar] = enums.TuiCurrencyCode.AustralianDollar,
|
|
189
|
-
_b$1[enums.TuiCurrency.HongKongDollar] = enums.TuiCurrencyCode.HongKongDollar,
|
|
190
|
-
_b$1[enums.TuiCurrency.CanadianDollar] = enums.TuiCurrencyCode.CanadianDollar,
|
|
191
|
-
_b$1[enums.TuiCurrency.Euro] = enums.TuiCurrencyCode.Euro,
|
|
192
|
-
_b$1[enums.TuiCurrency.Pound] = enums.TuiCurrencyCode.Pound,
|
|
193
|
-
_b$1[enums.TuiCurrency.Baht] = enums.TuiCurrencyCode.Baht,
|
|
194
|
-
_b$1[enums.TuiCurrency.TurkishLira] = enums.TuiCurrencyCode.TurkishLira,
|
|
195
|
-
_b$1[enums.TuiCurrency.YuanRenminbi] = enums.TuiCurrencyCode.YuanRenminbi,
|
|
196
|
-
_b$1[enums.TuiCurrency.Yen] = enums.TuiCurrencyCode.Yen,
|
|
197
|
-
_b$1[enums.TuiCurrency.IsraeliShekel] = enums.TuiCurrencyCode.IsraeliShekel,
|
|
198
|
-
_b$1[enums.TuiCurrency.IndianRupee] = enums.TuiCurrencyCode.IndianRupee,
|
|
199
|
-
_b$1[enums.TuiCurrency.SwissFranc] = enums.TuiCurrencyCode.SwissFranc,
|
|
200
|
-
_b$1[enums.TuiCurrency.ArmenianDram] = enums.TuiCurrencyCode.ArmenianDram,
|
|
201
|
-
_b$1[enums.TuiCurrency.Won] = enums.TuiCurrencyCode.Won,
|
|
202
|
-
_b$1[enums.TuiCurrency.Tenge] = enums.TuiCurrencyCode.Tenge,
|
|
203
|
-
_b$1[enums.TuiCurrency.Hryvnia] = enums.TuiCurrencyCode.Hryvnia,
|
|
204
|
-
_b$1[enums.TuiCurrency.UzbekSum] = enums.TuiCurrencyCode.UzbekSum,
|
|
205
|
-
_b$1[enums.TuiCurrency.KyrgyzstanSom] = enums.TuiCurrencyCode.KyrgyzstanSom,
|
|
206
|
-
_b$1[enums.TuiCurrency.Dirham] = enums.TuiCurrencyCode.Dirham,
|
|
207
|
-
_b$1[enums.TuiCurrency.TajikistaniSomoni] = enums.TuiCurrencyCode.TajikistaniSomoni,
|
|
208
|
-
_b$1[enums.TuiCurrency.MalaysianRinggit] = enums.TuiCurrencyCode.MalaysianRinggit,
|
|
209
|
-
_b$1[enums.TuiCurrency.BelarusianRuble] = enums.TuiCurrencyCode.BelarusianRuble,
|
|
210
|
-
_b$1[enums.TuiCurrency.GeorgianLari] = enums.TuiCurrencyCode.GeorgianLari,
|
|
211
|
-
_b$1[enums.TuiCurrency.AzerbaijaniManat] = enums.TuiCurrencyCode.AzerbaijaniManat,
|
|
212
|
-
_b$1[enums.TuiCurrency.SriLankanRupee] = enums.TuiCurrencyCode.SriLankanRupee,
|
|
213
|
-
_b$1[enums.TuiCurrency.SerbianDinar] = enums.TuiCurrencyCode.SerbianDinar,
|
|
214
|
-
_b$1[enums.TuiCurrency.SaudiRiyal] = enums.TuiCurrencyCode.SaudiRiyal,
|
|
215
|
-
_b$1[enums.TuiCurrency.MongolianTugrik] = enums.TuiCurrencyCode.MongolianTugrik,
|
|
216
|
-
_b$1[enums.TuiCurrency.SouthAfricanRand] = enums.TuiCurrencyCode.SouthAfricanRand,
|
|
217
|
-
_b$1[enums.TuiCurrency.IranianRial] = enums.TuiCurrencyCode.IranianRial,
|
|
218
|
-
_b$1[enums.TuiCurrency.IndonesianRupiah] = enums.TuiCurrencyCode.IndonesianRupiah,
|
|
219
|
-
_b$1[enums.TuiCurrency.VietnameseDong] = enums.TuiCurrencyCode.VietnameseDong,
|
|
220
|
-
_b$1[enums.TuiCurrency.NewTurkmenManat] = enums.TuiCurrencyCode.NewTurkmenManat,
|
|
221
|
-
_b$1[enums.TuiCurrency.BrazilianReal] = enums.TuiCurrencyCode.BrazilianReal,
|
|
222
|
-
_b$1);
|
|
223
|
-
function tuiGetCodeByCurrency(code) {
|
|
224
|
-
var _a;
|
|
225
|
-
return (_a = TUI_CODE_DICTIONARY[code]) !== null && _a !== void 0 ? _a : null;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
var _b;
|
|
229
|
-
var TUI_CURRENCY_DICTIONARY = (_b = {},
|
|
230
|
-
_b[enums.TuiCurrencyCode.Ruble] = enums.TuiCurrency.Ruble,
|
|
231
|
-
_b[enums.TuiCurrencyCode.Dollar] = enums.TuiCurrency.Dollar,
|
|
232
|
-
_b[enums.TuiCurrencyCode.MexicanPeso] = enums.TuiCurrency.MexicanPeso,
|
|
233
|
-
_b[enums.TuiCurrencyCode.SingaporeDollar] = enums.TuiCurrency.SingaporeDollar,
|
|
234
|
-
_b[enums.TuiCurrencyCode.SingaporeDollar] = enums.TuiCurrency.SingaporeDollar,
|
|
235
|
-
_b[enums.TuiCurrencyCode.AustralianDollar] = enums.TuiCurrency.AustralianDollar,
|
|
236
|
-
_b[enums.TuiCurrencyCode.HongKongDollar] = enums.TuiCurrency.HongKongDollar,
|
|
237
|
-
_b[enums.TuiCurrencyCode.CanadianDollar] = enums.TuiCurrency.CanadianDollar,
|
|
238
|
-
_b[enums.TuiCurrencyCode.Euro] = enums.TuiCurrency.Euro,
|
|
239
|
-
_b[enums.TuiCurrencyCode.Pound] = enums.TuiCurrency.Pound,
|
|
240
|
-
_b[enums.TuiCurrencyCode.Baht] = enums.TuiCurrency.Baht,
|
|
241
|
-
_b[enums.TuiCurrencyCode.TurkishLira] = enums.TuiCurrency.TurkishLira,
|
|
242
|
-
_b[enums.TuiCurrencyCode.YuanRenminbi] = enums.TuiCurrency.YuanRenminbi,
|
|
243
|
-
_b[enums.TuiCurrencyCode.Yen] = enums.TuiCurrency.Yen,
|
|
244
|
-
_b[enums.TuiCurrencyCode.IsraeliShekel] = enums.TuiCurrency.IsraeliShekel,
|
|
245
|
-
_b[enums.TuiCurrencyCode.IsraeliShekel] = enums.TuiCurrency.IsraeliShekel,
|
|
246
|
-
_b[enums.TuiCurrencyCode.IndianRupee] = enums.TuiCurrency.IndianRupee,
|
|
247
|
-
_b[enums.TuiCurrencyCode.SwissFranc] = enums.TuiCurrency.SwissFranc,
|
|
248
|
-
_b[enums.TuiCurrencyCode.ArmenianDram] = enums.TuiCurrency.ArmenianDram,
|
|
249
|
-
_b[enums.TuiCurrencyCode.Won] = enums.TuiCurrency.Won,
|
|
250
|
-
_b[enums.TuiCurrencyCode.Tenge] = enums.TuiCurrency.Tenge,
|
|
251
|
-
_b[enums.TuiCurrencyCode.Hryvnia] = enums.TuiCurrency.Hryvnia,
|
|
252
|
-
_b[enums.TuiCurrencyCode.UzbekSum] = enums.TuiCurrency.UzbekSum,
|
|
253
|
-
_b[enums.TuiCurrencyCode.KyrgyzstanSom] = enums.TuiCurrency.KyrgyzstanSom,
|
|
254
|
-
_b[enums.TuiCurrencyCode.Dirham] = enums.TuiCurrency.Dirham,
|
|
255
|
-
_b[enums.TuiCurrencyCode.TajikistaniSomoni] = enums.TuiCurrency.TajikistaniSomoni,
|
|
256
|
-
_b[enums.TuiCurrencyCode.MalaysianRinggit] = enums.TuiCurrency.MalaysianRinggit,
|
|
257
|
-
_b[enums.TuiCurrencyCode.BelarusianRuble] = enums.TuiCurrency.BelarusianRuble,
|
|
258
|
-
_b[enums.TuiCurrencyCode.GeorgianLari] = enums.TuiCurrency.GeorgianLari,
|
|
259
|
-
_b[enums.TuiCurrencyCode.AzerbaijaniManat] = enums.TuiCurrency.AzerbaijaniManat,
|
|
260
|
-
_b[enums.TuiCurrencyCode.SriLankanRupee] = enums.TuiCurrency.SriLankanRupee,
|
|
261
|
-
_b[enums.TuiCurrencyCode.SerbianDinar] = enums.TuiCurrency.SerbianDinar,
|
|
262
|
-
_b[enums.TuiCurrencyCode.SaudiRiyal] = enums.TuiCurrency.SaudiRiyal,
|
|
263
|
-
_b[enums.TuiCurrencyCode.MongolianTugrik] = enums.TuiCurrency.MongolianTugrik,
|
|
264
|
-
_b[enums.TuiCurrencyCode.SouthAfricanRand] = enums.TuiCurrency.SouthAfricanRand,
|
|
265
|
-
_b[enums.TuiCurrencyCode.IranianRial] = enums.TuiCurrency.IranianRial,
|
|
266
|
-
_b[enums.TuiCurrencyCode.IndonesianRupiah] = enums.TuiCurrency.IndonesianRupiah,
|
|
267
|
-
_b[enums.TuiCurrencyCode.VietnameseDong] = enums.TuiCurrency.VietnameseDong,
|
|
268
|
-
_b[enums.TuiCurrencyCode.NewTurkmenManat] = enums.TuiCurrency.NewTurkmenManat,
|
|
269
|
-
_b[enums.TuiCurrencyCode.BrazilianReal] = enums.TuiCurrency.BrazilianReal,
|
|
270
|
-
_b);
|
|
271
|
-
function tuiGetCurrencyByCode(currency) {
|
|
272
|
-
var _a;
|
|
273
|
-
return (_a = TUI_CURRENCY_DICTIONARY[currency]) !== null && _a !== void 0 ? _a : null;
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
/*! *****************************************************************************
|
|
277
|
-
Copyright (c) Microsoft Corporation.
|
|
278
|
-
|
|
279
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
280
|
-
purpose with or without fee is hereby granted.
|
|
281
|
-
|
|
282
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
283
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
284
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
285
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
286
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
287
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
288
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
289
|
-
***************************************************************************** */
|
|
290
|
-
/* global Reflect, Promise */
|
|
291
|
-
var extendStatics = function (d, b) {
|
|
292
|
-
extendStatics = Object.setPrototypeOf ||
|
|
293
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
294
|
-
function (d, b) { for (var p in b)
|
|
295
|
-
if (Object.prototype.hasOwnProperty.call(b, p))
|
|
296
|
-
d[p] = b[p]; };
|
|
297
|
-
return extendStatics(d, b);
|
|
298
|
-
};
|
|
299
|
-
function __extends(d, b) {
|
|
300
|
-
if (typeof b !== "function" && b !== null)
|
|
301
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
302
|
-
extendStatics(d, b);
|
|
303
|
-
function __() { this.constructor = d; }
|
|
304
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
305
|
-
}
|
|
306
|
-
var __assign = function () {
|
|
307
|
-
__assign = Object.assign || function __assign(t) {
|
|
308
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
309
|
-
s = arguments[i];
|
|
310
|
-
for (var p in s)
|
|
311
|
-
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
312
|
-
t[p] = s[p];
|
|
313
|
-
}
|
|
314
|
-
return t;
|
|
315
|
-
};
|
|
316
|
-
return __assign.apply(this, arguments);
|
|
317
|
-
};
|
|
318
|
-
function __rest(s, e) {
|
|
319
|
-
var t = {};
|
|
320
|
-
for (var p in s)
|
|
321
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
322
|
-
t[p] = s[p];
|
|
323
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
324
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
325
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
326
|
-
t[p[i]] = s[p[i]];
|
|
327
|
-
}
|
|
328
|
-
return t;
|
|
329
|
-
}
|
|
330
|
-
function __decorate(decorators, target, key, desc) {
|
|
331
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
332
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
333
|
-
r = Reflect.decorate(decorators, target, key, desc);
|
|
334
|
-
else
|
|
335
|
-
for (var i = decorators.length - 1; i >= 0; i--)
|
|
336
|
-
if (d = decorators[i])
|
|
337
|
-
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
338
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
339
|
-
}
|
|
340
|
-
function __param(paramIndex, decorator) {
|
|
341
|
-
return function (target, key) { decorator(target, key, paramIndex); };
|
|
342
|
-
}
|
|
343
|
-
function __metadata(metadataKey, metadataValue) {
|
|
344
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
345
|
-
return Reflect.metadata(metadataKey, metadataValue);
|
|
346
|
-
}
|
|
347
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
348
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
349
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
350
|
-
function fulfilled(value) { try {
|
|
351
|
-
step(generator.next(value));
|
|
352
|
-
}
|
|
353
|
-
catch (e) {
|
|
354
|
-
reject(e);
|
|
355
|
-
} }
|
|
356
|
-
function rejected(value) { try {
|
|
357
|
-
step(generator["throw"](value));
|
|
358
|
-
}
|
|
359
|
-
catch (e) {
|
|
360
|
-
reject(e);
|
|
361
|
-
} }
|
|
362
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
363
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
364
|
-
});
|
|
365
|
-
}
|
|
366
|
-
function __generator(thisArg, body) {
|
|
367
|
-
var _ = { label: 0, sent: function () { if (t[0] & 1)
|
|
368
|
-
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
369
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
|
|
370
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
371
|
-
function step(op) {
|
|
372
|
-
if (f)
|
|
373
|
-
throw new TypeError("Generator is already executing.");
|
|
374
|
-
while (_)
|
|
375
|
-
try {
|
|
376
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
|
|
377
|
-
return t;
|
|
378
|
-
if (y = 0, t)
|
|
379
|
-
op = [op[0] & 2, t.value];
|
|
380
|
-
switch (op[0]) {
|
|
381
|
-
case 0:
|
|
382
|
-
case 1:
|
|
383
|
-
t = op;
|
|
384
|
-
break;
|
|
385
|
-
case 4:
|
|
386
|
-
_.label++;
|
|
387
|
-
return { value: op[1], done: false };
|
|
388
|
-
case 5:
|
|
389
|
-
_.label++;
|
|
390
|
-
y = op[1];
|
|
391
|
-
op = [0];
|
|
392
|
-
continue;
|
|
393
|
-
case 7:
|
|
394
|
-
op = _.ops.pop();
|
|
395
|
-
_.trys.pop();
|
|
396
|
-
continue;
|
|
397
|
-
default:
|
|
398
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
399
|
-
_ = 0;
|
|
400
|
-
continue;
|
|
401
|
-
}
|
|
402
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
|
403
|
-
_.label = op[1];
|
|
404
|
-
break;
|
|
405
|
-
}
|
|
406
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
407
|
-
_.label = t[1];
|
|
408
|
-
t = op;
|
|
409
|
-
break;
|
|
410
|
-
}
|
|
411
|
-
if (t && _.label < t[2]) {
|
|
412
|
-
_.label = t[2];
|
|
413
|
-
_.ops.push(op);
|
|
414
|
-
break;
|
|
415
|
-
}
|
|
416
|
-
if (t[2])
|
|
417
|
-
_.ops.pop();
|
|
418
|
-
_.trys.pop();
|
|
419
|
-
continue;
|
|
420
|
-
}
|
|
421
|
-
op = body.call(thisArg, _);
|
|
422
|
-
}
|
|
423
|
-
catch (e) {
|
|
424
|
-
op = [6, e];
|
|
425
|
-
y = 0;
|
|
426
|
-
}
|
|
427
|
-
finally {
|
|
428
|
-
f = t = 0;
|
|
429
|
-
}
|
|
430
|
-
if (op[0] & 5)
|
|
431
|
-
throw op[1];
|
|
432
|
-
return { value: op[0] ? op[1] : void 0, done: true };
|
|
433
|
-
}
|
|
434
|
-
}
|
|
435
|
-
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
|
436
|
-
if (k2 === undefined)
|
|
437
|
-
k2 = k;
|
|
438
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
|
|
439
|
-
}) : (function (o, m, k, k2) {
|
|
440
|
-
if (k2 === undefined)
|
|
441
|
-
k2 = k;
|
|
442
|
-
o[k2] = m[k];
|
|
443
|
-
});
|
|
444
|
-
function __exportStar(m, o) {
|
|
445
|
-
for (var p in m)
|
|
446
|
-
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
|
447
|
-
__createBinding(o, m, p);
|
|
448
|
-
}
|
|
449
|
-
function __values(o) {
|
|
450
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
451
|
-
if (m)
|
|
452
|
-
return m.call(o);
|
|
453
|
-
if (o && typeof o.length === "number")
|
|
454
|
-
return {
|
|
455
|
-
next: function () {
|
|
456
|
-
if (o && i >= o.length)
|
|
457
|
-
o = void 0;
|
|
458
|
-
return { value: o && o[i++], done: !o };
|
|
459
|
-
}
|
|
460
|
-
};
|
|
461
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
462
|
-
}
|
|
463
|
-
function __read(o, n) {
|
|
464
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
465
|
-
if (!m)
|
|
466
|
-
return o;
|
|
467
|
-
var i = m.call(o), r, ar = [], e;
|
|
468
|
-
try {
|
|
469
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
470
|
-
ar.push(r.value);
|
|
471
|
-
}
|
|
472
|
-
catch (error) {
|
|
473
|
-
e = { error: error };
|
|
474
|
-
}
|
|
475
|
-
finally {
|
|
476
|
-
try {
|
|
477
|
-
if (r && !r.done && (m = i["return"]))
|
|
478
|
-
m.call(i);
|
|
479
|
-
}
|
|
480
|
-
finally {
|
|
481
|
-
if (e)
|
|
482
|
-
throw e.error;
|
|
483
|
-
}
|
|
484
|
-
}
|
|
485
|
-
return ar;
|
|
486
|
-
}
|
|
487
|
-
/** @deprecated */
|
|
488
|
-
function __spread() {
|
|
489
|
-
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
490
|
-
ar = ar.concat(__read(arguments[i]));
|
|
491
|
-
return ar;
|
|
492
|
-
}
|
|
493
|
-
/** @deprecated */
|
|
494
|
-
function __spreadArrays() {
|
|
495
|
-
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
|
496
|
-
s += arguments[i].length;
|
|
497
|
-
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
498
|
-
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
499
|
-
r[k] = a[j];
|
|
500
|
-
return r;
|
|
501
|
-
}
|
|
502
|
-
function __spreadArray(to, from, pack) {
|
|
503
|
-
if (pack || arguments.length === 2)
|
|
504
|
-
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
505
|
-
if (ar || !(i in from)) {
|
|
506
|
-
if (!ar)
|
|
507
|
-
ar = Array.prototype.slice.call(from, 0, i);
|
|
508
|
-
ar[i] = from[i];
|
|
509
|
-
}
|
|
510
|
-
}
|
|
511
|
-
return to.concat(ar || from);
|
|
512
|
-
}
|
|
513
|
-
function __await(v) {
|
|
514
|
-
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
515
|
-
}
|
|
516
|
-
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
517
|
-
if (!Symbol.asyncIterator)
|
|
518
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
519
|
-
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
520
|
-
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
521
|
-
function verb(n) { if (g[n])
|
|
522
|
-
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
523
|
-
function resume(n, v) { try {
|
|
524
|
-
step(g[n](v));
|
|
525
|
-
}
|
|
526
|
-
catch (e) {
|
|
527
|
-
settle(q[0][3], e);
|
|
528
|
-
} }
|
|
529
|
-
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
530
|
-
function fulfill(value) { resume("next", value); }
|
|
531
|
-
function reject(value) { resume("throw", value); }
|
|
532
|
-
function settle(f, v) { if (f(v), q.shift(), q.length)
|
|
533
|
-
resume(q[0][0], q[0][1]); }
|
|
534
|
-
}
|
|
535
|
-
function __asyncDelegator(o) {
|
|
536
|
-
var i, p;
|
|
537
|
-
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
538
|
-
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
|
|
539
|
-
}
|
|
540
|
-
function __asyncValues(o) {
|
|
541
|
-
if (!Symbol.asyncIterator)
|
|
542
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
543
|
-
var m = o[Symbol.asyncIterator], i;
|
|
544
|
-
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
545
|
-
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
546
|
-
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
|
547
|
-
}
|
|
548
|
-
function __makeTemplateObject(cooked, raw) {
|
|
549
|
-
if (Object.defineProperty) {
|
|
550
|
-
Object.defineProperty(cooked, "raw", { value: raw });
|
|
551
|
-
}
|
|
552
|
-
else {
|
|
553
|
-
cooked.raw = raw;
|
|
554
|
-
}
|
|
555
|
-
return cooked;
|
|
556
|
-
}
|
|
557
|
-
;
|
|
558
|
-
var __setModuleDefault = Object.create ? (function (o, v) {
|
|
559
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
560
|
-
}) : function (o, v) {
|
|
561
|
-
o["default"] = v;
|
|
562
|
-
};
|
|
563
|
-
function __importStar(mod) {
|
|
564
|
-
if (mod && mod.__esModule)
|
|
565
|
-
return mod;
|
|
566
|
-
var result = {};
|
|
567
|
-
if (mod != null)
|
|
568
|
-
for (var k in mod)
|
|
569
|
-
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
570
|
-
__createBinding(result, mod, k);
|
|
571
|
-
__setModuleDefault(result, mod);
|
|
572
|
-
return result;
|
|
573
|
-
}
|
|
574
|
-
function __importDefault(mod) {
|
|
575
|
-
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
576
|
-
}
|
|
577
|
-
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
578
|
-
if (kind === "a" && !f)
|
|
579
|
-
throw new TypeError("Private accessor was defined without a getter");
|
|
580
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
581
|
-
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
582
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
583
|
-
}
|
|
584
|
-
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
585
|
-
if (kind === "m")
|
|
586
|
-
throw new TypeError("Private method is not writable");
|
|
587
|
-
if (kind === "a" && !f)
|
|
588
|
-
throw new TypeError("Private accessor was defined without a setter");
|
|
589
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
590
|
-
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
591
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
592
|
-
}
|
|
593
|
-
|
|
594
|
-
// https://en.wikipedia.org/wiki/Payment_card_number#Issuer_identification_number_(IIN)
|
|
595
|
-
var TUI_BIN_TABLE = [
|
|
596
|
-
["mir", 2200, 2204],
|
|
597
|
-
["mastercard", 2221, 2720],
|
|
598
|
-
["jcb", 3528, 3589],
|
|
599
|
-
["amex", 34],
|
|
600
|
-
["amex", 37],
|
|
601
|
-
["dinersclub", 36],
|
|
602
|
-
["electron", 4026],
|
|
603
|
-
["electron", 4175],
|
|
604
|
-
["electron", 4405],
|
|
605
|
-
["electron", 4508],
|
|
606
|
-
["electron", 4844],
|
|
607
|
-
["electron", 4913],
|
|
608
|
-
["electron", 4917],
|
|
609
|
-
["visa", 4],
|
|
610
|
-
["verve", 506099, 506198],
|
|
611
|
-
["verve", 507865, 507964],
|
|
612
|
-
["maestro", 5018],
|
|
613
|
-
["maestro", 5020],
|
|
614
|
-
["maestro", 5038],
|
|
615
|
-
["maestro", 5090],
|
|
616
|
-
["maestro", 5890],
|
|
617
|
-
["maestro", 5893],
|
|
618
|
-
["rupay", 508],
|
|
619
|
-
["maestro", 50],
|
|
620
|
-
["mastercard", 51, 55],
|
|
621
|
-
["maestro", 56],
|
|
622
|
-
["maestro", 58],
|
|
623
|
-
["mastercard", 5],
|
|
624
|
-
["maestro", 6000],
|
|
625
|
-
["maestro", 6304],
|
|
626
|
-
["maestro", 6759, 6763],
|
|
627
|
-
["verve", 650002, 650027],
|
|
628
|
-
["maestro", 676770],
|
|
629
|
-
["maestro", 676774],
|
|
630
|
-
["discover", 644, 649],
|
|
631
|
-
["discover", 6011],
|
|
632
|
-
["rupay", 60],
|
|
633
|
-
["unionpay", 62],
|
|
634
|
-
["discover", 65],
|
|
635
|
-
["maestro", 6],
|
|
636
|
-
["rupay", 81, 82],
|
|
637
|
-
["uzcard", 8600],
|
|
638
|
-
["humo", 9860],
|
|
639
|
-
];
|
|
640
|
-
function tuiGetPaymentSystem(cardNumber, supported) {
|
|
641
|
-
var _a;
|
|
642
|
-
if (!cardNumber) {
|
|
643
|
-
return null;
|
|
644
|
-
}
|
|
645
|
-
var row = TUI_BIN_TABLE.find(function (_b) {
|
|
646
|
-
var _c = __read(_b, 3), paymentSystem = _c[0], start = _c[1], _d = _c[2], end = _d === void 0 ? start : _d;
|
|
647
|
-
var cardNumberNumeric = Number.parseInt(cardNumber.slice(0, String(start).length), 10);
|
|
648
|
-
var match = cardNumberNumeric >= start && cardNumberNumeric <= end;
|
|
649
|
-
return match && (!(supported === null || supported === void 0 ? void 0 : supported.length) || supported.includes(paymentSystem));
|
|
650
|
-
});
|
|
651
|
-
return (_a = row === null || row === void 0 ? void 0 : row[0]) !== null && _a !== void 0 ? _a : null;
|
|
652
|
-
}
|
|
653
|
-
function tuiIsMaestro(three, two, one) {
|
|
654
|
-
if (one === 6) {
|
|
655
|
-
return true;
|
|
656
|
-
}
|
|
657
|
-
if (two === 50 || (two > 55 && two < 59)) {
|
|
658
|
-
return true;
|
|
659
|
-
}
|
|
660
|
-
if (three < 500) {
|
|
661
|
-
return false;
|
|
662
|
-
}
|
|
663
|
-
return three < 510;
|
|
664
|
-
}
|
|
665
|
-
function tuiIsMastercard(four, two, one) {
|
|
666
|
-
if (one === 5) {
|
|
667
|
-
return true;
|
|
668
|
-
}
|
|
669
|
-
if (two < 10) {
|
|
670
|
-
return false;
|
|
671
|
-
}
|
|
672
|
-
if (two > 50 && two < 56) {
|
|
673
|
-
return true;
|
|
674
|
-
}
|
|
675
|
-
if (four < 1000) {
|
|
676
|
-
return false;
|
|
677
|
-
}
|
|
678
|
-
return four > 2220 && four < 2721;
|
|
679
|
-
}
|
|
680
|
-
function tuiIsMir(four) {
|
|
681
|
-
return four > 2199 && four < 2205;
|
|
682
|
-
}
|
|
683
|
-
function tuiIsElectron(four) {
|
|
684
|
-
switch (four) {
|
|
685
|
-
case 4026:
|
|
686
|
-
case 4175:
|
|
687
|
-
case 4405:
|
|
688
|
-
case 4508:
|
|
689
|
-
case 4844:
|
|
690
|
-
case 4913:
|
|
691
|
-
case 4917:
|
|
692
|
-
return true;
|
|
693
|
-
default:
|
|
694
|
-
return false;
|
|
695
|
-
}
|
|
696
|
-
}
|
|
697
|
-
function tuiIsVisa(one) {
|
|
698
|
-
return one === 4;
|
|
699
|
-
}
|
|
700
|
-
|
|
701
|
-
/**
|
|
702
|
-
* Validates card number length using payment system dictionary
|
|
703
|
-
*/
|
|
704
|
-
function tuiIsCardLengthValid(cardNumber) {
|
|
705
|
-
var length = cardNumber.length;
|
|
706
|
-
var paymentSystem = tuiGetPaymentSystem(cardNumber);
|
|
707
|
-
switch (paymentSystem) {
|
|
708
|
-
case "electron":
|
|
709
|
-
return length === 16;
|
|
710
|
-
case "maestro":
|
|
711
|
-
return length > 11 && length < 20;
|
|
712
|
-
case "mastercard":
|
|
713
|
-
case "mir":
|
|
714
|
-
return length > 15 && length < 20;
|
|
715
|
-
case "visa":
|
|
716
|
-
return length > 12 && length < 20;
|
|
717
|
-
default:
|
|
718
|
-
return length > 8 && length < 20;
|
|
719
|
-
}
|
|
720
|
-
}
|
|
721
|
-
|
|
722
|
-
/**
|
|
723
|
-
* Validates card number using Luhn algorithm
|
|
724
|
-
*/
|
|
725
|
-
function tuiIsCardNumberValid(value) {
|
|
726
|
-
var cardNumber = String(value).replace(core.TUI_NON_DIGITS_REGEXP, "");
|
|
727
|
-
var length = cardNumber.length;
|
|
728
|
-
var arr = cardNumber.split("").map(function (char, index) {
|
|
729
|
-
var digit = parseInt(char, 10);
|
|
730
|
-
if ((index + length) % 2 === 0) {
|
|
731
|
-
var digitX2 = digit * 2;
|
|
732
|
-
return digitX2 > 9 ? digitX2 - 9 : digitX2;
|
|
733
|
-
}
|
|
734
|
-
return digit;
|
|
735
|
-
});
|
|
736
|
-
return !(arr.reduce(function (a, b) { return a + b; }, 0) % 10);
|
|
737
|
-
}
|
|
738
|
-
|
|
739
|
-
function tuiIsExpireValid(expire, today) {
|
|
740
|
-
if (today === void 0) { today = new Date(); }
|
|
741
|
-
var currentMonth = today.getMonth() + 1;
|
|
742
|
-
var currentYear = today.getFullYear() - 2000;
|
|
743
|
-
var expireMonth = cdk.tuiClamp(parseInt(expire.slice(0, 2), 10), 1, 12);
|
|
744
|
-
var expireYear = cdk.tuiClamp(parseInt(expire.slice(-2), 10), 0, 99);
|
|
745
|
-
return (expireYear > currentYear ||
|
|
746
|
-
(currentYear === expireYear && expireMonth >= currentMonth));
|
|
747
|
-
}
|
|
748
|
-
|
|
749
|
-
// TODO: Make it a token in 4.0, think about mono icons for card component
|
|
750
|
-
var TUI_PAYMENT_SYSTEM_ICONS = {
|
|
751
|
-
mir: "tuiIconMirMono",
|
|
752
|
-
visa: "tuiIconVisaMono",
|
|
753
|
-
electron: "tuiIconElectronMono",
|
|
754
|
-
mastercard: "tuiIconMastercard",
|
|
755
|
-
maestro: "tuiIconMaestro",
|
|
756
|
-
amex: "tuiIconAmex",
|
|
757
|
-
dinersclub: "tuiIconDinersClub",
|
|
758
|
-
discover: "tuiIconDiscover",
|
|
759
|
-
humo: "tuiIconHumo",
|
|
760
|
-
jcb: "tuiIconJCB",
|
|
761
|
-
rupay: "tuiIconRuPay",
|
|
762
|
-
unionpay: "tuiIconUnionPay",
|
|
763
|
-
uzcard: "tuiIconUzcard",
|
|
764
|
-
verve: "tuiIconVerve",
|
|
765
|
-
};
|
|
766
|
-
|
|
767
|
-
/**
|
|
768
|
-
* Generated bundle index. Do not edit.
|
|
769
|
-
*/
|
|
770
|
-
|
|
771
|
-
exports.TUI_BIN_TABLE = TUI_BIN_TABLE;
|
|
772
|
-
exports.TUI_CODE_DICTIONARY = TUI_CODE_DICTIONARY;
|
|
773
|
-
exports.TUI_CURRENCY_DICTIONARY = TUI_CURRENCY_DICTIONARY;
|
|
774
|
-
exports.TUI_PAYMENT_SYSTEM_ICONS = TUI_PAYMENT_SYSTEM_ICONS;
|
|
775
|
-
exports.tuiCreateAutoCorrectedExpirePipe = tuiCreateAutoCorrectedExpirePipe;
|
|
776
|
-
exports.tuiFormatCurrency = tuiFormatCurrency;
|
|
777
|
-
exports.tuiGetCodeByCurrency = tuiGetCodeByCurrency;
|
|
778
|
-
exports.tuiGetCurrencyByCode = tuiGetCurrencyByCode;
|
|
779
|
-
exports.tuiGetCurrencySymbol = tuiGetCurrencySymbol;
|
|
780
|
-
exports.tuiGetPaymentSystem = tuiGetPaymentSystem;
|
|
781
|
-
exports.tuiIsCardLengthValid = tuiIsCardLengthValid;
|
|
782
|
-
exports.tuiIsCardNumberValid = tuiIsCardNumberValid;
|
|
783
|
-
exports.tuiIsElectron = tuiIsElectron;
|
|
784
|
-
exports.tuiIsExpireValid = tuiIsExpireValid;
|
|
785
|
-
exports.tuiIsMaestro = tuiIsMaestro;
|
|
786
|
-
exports.tuiIsMastercard = tuiIsMastercard;
|
|
787
|
-
exports.tuiIsMir = tuiIsMir;
|
|
788
|
-
exports.tuiIsVisa = tuiIsVisa;
|
|
789
|
-
|
|
790
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
791
|
-
|
|
792
|
-
}));
|
|
793
|
-
//# sourceMappingURL=taiga-ui-addon-commerce-utils.umd.js.map
|