{"version":3,"file":"static/js/487.dcd55806.chunk.js","mappings":"kKAwCA,IA/B6D,SAAC,G,IAAEA,EAAK,QAAEC,EAAQ,WAAEC,EAAS,YAChFC,GAAO,SACPC,EAA8B,QAAbH,EAAqB,EAAI,EAYhD,OACI,gCACgB,OAAVD,GAAkBC,EAChB,wBAAMC,UAAWA,GACXG,OAAOL,GAdE,WACvB,GAAKC,GAAsB,OAAVD,GAAmC,iBAAVA,EAI1C,OAAOM,SACFC,eAAeJ,EAAKK,OAAQ,CAAEP,SAAQ,EAAEQ,MAAO,WAAYC,sBAAuB,IAClFC,QAAQ,IAAKX,EACtB,CAQsBY,GADF,gBAAC,KAAe,CAACF,sBAAuBN,EAAgBJ,OAAQA,EAAOS,MAAM,WAAWR,SAAUA,KAK/F,OAAVD,IAAmBC,GAA6B,iBAAVD,GACvC,wBAAME,UAAWA,GAAYF,GAI7C,C","sources":["components/BookingFlow/modules/ServiceSelect/FormattedPrice/FormattedPrice.tsx"],"sourcesContent":["import React from 'react';\r\nimport { FormattedNumber, useIntl } from 'react-intl';\r\n\r\ninterface IPriceProps {\r\n    value: number | string | null;\r\n    currency: string | null;\r\n    className?: string;\r\n}\r\n\r\nconst FormattedPrice: React.FunctionComponent<IPriceProps> = ({ value, currency, className }) => {\r\n    const intl = useIntl();\r\n    const fractionDigits = currency === 'HUF' ? 0 : 2;\r\n\r\n    const formatInvalidPrice = () => {\r\n        if (!currency || value === null || typeof value === 'number') {\r\n            return;\r\n        }\r\n\r\n        return Number()\r\n            .toLocaleString(intl.locale, { currency, style: 'currency', minimumFractionDigits: 0 })\r\n            .replace('0', value);\r\n    }\r\n\r\n    return (\r\n        <>\r\n            {(value !== null && currency) ?\r\n                <span className={className}>\r\n                    {!isNaN(+value) ?\r\n                        <FormattedNumber minimumFractionDigits={fractionDigits} value={+value} style=\"currency\" currency={currency} />\r\n                        : formatInvalidPrice()\r\n                    }\r\n                </span>\r\n                :\r\n                (value !== null && !currency && typeof value === 'string') &&\r\n                <span className={className}>{value}</span>\r\n            }\r\n        </>\r\n    );\r\n}\r\n\r\nexport default FormattedPrice;"],"names":["value","currency","className","intl","fractionDigits","isNaN","Number","toLocaleString","locale","style","minimumFractionDigits","replace","formatInvalidPrice"],"sourceRoot":""}