{"version":3,"sources":["components/common/Cambay.tsx","utils/custom-hook.tsx","components/AppSnackbar.tsx","components/AppModal.tsx","initialize.tsx","App.tsx","services/ms-ropc/ms-ropc-query.tsx","components/layout/LanguageSwitchMenu.tsx","utils/base58.tsx","reportWebVitals.ts","constant/i18n/index.tsx","index.tsx","constant/contexts.tsx","utils/api/tools.tsx","utils/api/ms-ropc-client.tsx","utils/api/smart-swift-client.tsx","utils/api/index.tsx","components/common/Roboto.tsx","utils/helper.tsx","config.tsx","utils/api-helper.tsx","constant/colors.tsx","components/common/Button.tsx","services/home/home-query.tsx"],"names":["StyledText","styled","div","family","size","weight","color","Cambay","forwardRef","props","ref","children","type","TEXT","style","className","maxLines","line","useEllipsis","restProps","useMemo","textSize","textWeight","lines","ellipsis","useModal","t","useTranslation","useContext","AppCtx","state","setState","initialValue","openModal","useCallback","appModal","visible","confirm","title","message","onOk","onOkText","onCancel","onCancelText","error","undefined","open","closeModal","serviceableCountryTh","country","countryDesc","availablePaymentChannel","currencies","currency","currencyDesc","fxRate","timestamp","dayjs","format","transactionLimit","transactionLimitThb","fee","useServiceableCountriesHelper","serviceableCountries","useGetServiceableCountries","data","countryOptions","map","countryItem","value","label","getCurrencies","find","serviceableCountry","getPaymentChannelFormCountry","getCurrenciesOptions","getCurrency","reduce","acc","cur","concat","v","getCountryFromCurrency","option","includeTh","some","getCountryFromCountryName","useVisible","defaultVisible","useState","setVisible","close","useSnackbar","openSnackbar","appSnackbar","snackbar","description","AppSnackbar","SECONDARY","ERROR","INFO","handleClose","event","Snackbar","anchorOrigin","vertical","horizontal","autoHideDuration","onClose","Alert","variant","sx","background","Roboto","WHITE","classes","css","backdrop","backgroundColor","layout","header","body","footer","AppModal","closeOnClickOutside","okOnRightPosition","onOkClick","a","onCancelClick","Modal","disablePortal","disableEnforceFocus","disableAutoFocus","disableRestoreFocus","BackdropProps","PRIMARY","TEXT_LIGHT","Button","buttonStyle","onClick","dayJS","extend","isBetween","utc","timezone","tz","setDefault","AppRoute","React","lazy","queryClient","QueryClient","FallBackComponent","display","width","height","justifyContent","alignItems","loading","withCtx","pathname","useLocation","onError","e","console","log","meta","status","param","includes","defaultValue","useOnError","useEffect","document","scrollTo","useLayoutEffect","setDefaultOptions","queries","retry","retryDelay","cacheTime","staleTime","refetchOnWindowFocus","mutations","client","Suspense","fallback","isMode","initialIsOpen","useMsRopcSignIn","useQueryClient","authUrl","Helper","getEncryptValue","StoreKey","authClientId","useMutation","pincode","appToken","Promise","reject","_params","username","password","scope","clientId","grantType","responseType","api","msRopc","post","authenPinCode","onSuccess","response","idToken","accessToken","tokenType","expiresIn","refreshToken","setEncryptValue","expiresOn","add","Number","unix","invalidateQueries","HOME","setRefreshTokenResponse","notBefore","resource","idTokenExpiresIn","profileInfo","refreshTokenExpiresIn","callRefreshToken","useMsRopcRefreshToken","refetchQueries","active","initLangKey","LanguageSwitchMenu","i18n","currentLang","language","anchorEl","setAnchorEl","Boolean","handleChangeLang","changeLanguage","i18next","reloadResources","localStorage","setItem","id","currentTarget","textTransform","startIcon","fontSize","MenuListProps","chain","wrap","b","c","args","encode","Array","from","reverse","i","decode","alphabet","digits","isArray","length","Error","input","letter","index","indexOf","join","separator","to","split","padding","bits","chr","push","end","slice","normalize","fn","convertRadix","pos","res","carry","done","digit","Math","floor","convertRadix2","mask","radix2","revPadding","bytes","Uint8Array","unsafeWrapper","apply","base16","base32","base64","s","toUpperCase","replace","base64url","genBase58","abc","num","base58","base58xmr","subarray","padStart","str","BECH_ALPHABET","POLYMOD_GENERATORS","bech32Polymod","pre","chk","bechChecksum","prefix","words","encodingConst","len","charCodeAt","genBech32","encoding","ENCODING_CONST","_words","fromWords","toWords","fromWordsUnsafe","limit","TypeError","lowered","toLowerCase","sepIndex","lastIndexOf","sum","endsWith","actualLength","decodeToBytes","decodeUnsafe","utf8","TextDecoder","TextEncoder","CODERS","hex","Object","keys","reportWebVitals","onPerfEntry","Function","then","getCLS","getFID","getFCP","getLCP","getTTFB","resources","en","translation","kh","th","initLang","getItem","use","initReactI18next","init","lng","react","useSuspense","wait","history","createBrowserHistory","theme","createTheme","palette","primary","main","light","PRIMARY_LIGHT","dark","contrastText","secondary","SECONDARY_LIGHT","warning","WARNING","info","success","SUCCESS","typography","fontFamily","ReactDOM","render","I18nextProvider","StrictMode","ThemeProvider","App","getElementById","AppModalOption","createCtx","kycStatus","userDisplay","avatarId","totalUnreadNoti","newPinCode","topbarTab","visibled","tabs","path","closeIcon","pinVerifyCallback","pinCode","confirmPinCallback","pin","newPin","ContentType","customClientWithData","url","method","contentType","JSON","restOption","headers","customClient","params","createMethod","apiWraper","get","put","patch","delete","getFile","sendFile","APPLICATION_XML","customRequestData","request","FORMDATA","formData","FormData","entries","forEach","key","val","append","XFORM","qs","stringify","deepLoop","func","File","d","formatData","modifyRequestData","isDayjs","msRopcClient","ax","axios","create","interceptors","decamelizeKeys","camelizeKeys","createClient","msRopcApiWraper","resolve","Blob","text","responseFromBlob","parse","errorMessage","errorCode","isRefreshing","refreshQueue","smartSwiftClient","baseURL","config","apiHost","ApiHelper","getIdToken","generateApimToken","appVersion","appPlatform","orgConfig","_retry","catch","finally","merge","smartSwiftApiWraper","smartSwift","maxLine","maxLenght","initValue","createContext","reset","overwriteMerge","destinationArray","sourceArray","options","Context","Component","initalState","_currentValue","useRef","customSetState","newState","deepmerge","current","arrayMerge","isEqual","Provider","useRouter","useParams","location","useHistory","match","useRouteMatch","query","search","goBack","buildMode","mode","formatToCurrency","amount","toFixed","formatToCurrencySevenDecimal","normalizePhone","onlyNums","downloadFile","fileName","downloadjs","decodeURIComponent","this","encryptValue","encryptData","salt","_value","decryptData","process","REACT_APP_ENCRYPT_SALT","CryptoJS","AES","encrypt","toString","cipherText","decrypt","enc","Utf8","err","clearStore","filter","item","isNaN","ignore","removeKeys","difference","removeKey","removeItem","KycStatus","normalizeTime","normalizeBankDigits","colorStatus","enumFromStringValue","enm","values","window","_env_","apimSecret","generateApimTokenCore","apimToken","encodeBase58","now","calMinute","minute","plainDateTime","startOf","seconds","plainText","blake2b","encodeBreak2b","encodeBreak2bHex","Buffer","result","TEXT_DARK","BG_DARK","BG_LIGHT","useStyle","makeStyles","root","fontWeight","borderRadius","minWidth","fill","disabled","border","textColor","noBackground","getTextColor","HOME_SETTINGS","SIGN_OUT","CHANGE_CONSENT","TOGGLE_NOTIFICATION","NOTIFICATION","NOTIFICATIONREAD","CHANGE_PIN","useGetHome","useQuery","userInfo","isLogin","avatarUrl","last","firstName","useErrorBoundary","useGetCurrentUser","useGetSignOut","useChangeConsent","mutate","useToggleNotification","useGetNotifications","useInfiniteQuery","pageParam","getNextPageParam","nextPage","currentPage","totalPages","useGetNotificationsItem","notiId","useChangePin"],"mappings":";8QAMMA,EAAaC,IAAOC,IAAV,qIAOC,gBAAGC,EAAH,EAAGA,OAAH,sBAAyBA,MAC3B,qBAAGC,QACD,qBAAGC,UACT,qBAAGC,SAeRC,EAASC,sBAAW,SAACC,EAAkBC,GAC3C,IACEC,EASEF,EATFE,SACAC,EAQEH,EARFG,KAFF,GAUIH,EAPFL,KAOEK,EANFH,cAJF,gBAIaO,KAJb,EAKEC,EAKEL,EALFK,MACAC,EAIEN,EAJFM,UANF,EAUIN,EAHFO,SAAUC,OAPZ,MAOmB,EAPnB,IAUIR,EAFFS,mBARF,SASKC,EATL,YAUIV,EAVJ,GAWMN,EAASiB,mBAAQ,WACrB,OAAQR,GACN,IAAK,OAEL,IAAK,WAEL,IAAK,WAEL,IAAK,WAEL,IAAK,WAEL,IAAK,WACH,MAAO,QAWT,QACE,MAAO,cAEV,CAACA,IACES,EAAWD,mBAAQ,WACvB,OAAQR,GACN,IAAK,OACH,OAAO,GACT,IAAK,WAUL,IAAK,cACH,OAAO,GATT,IAAK,WAUL,IAAK,cACH,OAAO,GATT,IAAK,WAUL,IAAK,cACH,OAAO,GATT,IAAK,WAUL,IAAK,cAIL,QACE,OAAO,GAbT,IAAK,WAUL,IAAK,cACH,OAAO,MAIV,CAACA,IAEEU,EAAaF,mBAAQ,WACzB,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AI8R,WAAW5D,IAAf,UAClB6K,EADkB,YACFkB,IAFvB,uBACUhjB,EADV,EACUA,KADV,kBAISA,GAJT,2CAFqB,sDAQrB,CACEmH,UAAW,EACXC,UAAW,EACX6b,iBAAkB,SAAC7Z,GAAc,IAAD,EAC9B,aAAIA,EAASpJ,YAAb,aAAI,EAAeqG,KAAM,CAAC,IAAD,QACjB6c,GAAW,UAAA9Z,EAASpJ,YAAT,mBAAeqG,YAAf,eAAqB8c,aAAc,EACpD,OAAID,IAAQ,UAAI9Z,EAASpJ,YAAb,iBAAI,EAAeqG,YAAnB,aAAI,EAAqB+c,YAC5BF,EAEA,KAGT,OAAO,SAOJG,EAA0B,SAACC,GACtC,IAAMje,EAAcwC,2BACpB,OAAOqa,mBACL,CAACH,EAAkBuB,GADN,sBAEb,8BAAAxf,EAAA,sEACyBiF,IAAI8R,WAAW5D,IAAf,UAClB8K,EADkB,YACEuB,IAF3B,uBACUtjB,EADV,EACUA,KADV,kBAISA,GAJT,2CAMA,CACEmJ,UAAW,WACT9D,EAAY0E,kBAAkB,CAAC+X,QAM1ByB,EAAe,WAC1B,IAAMle,EAAcwC,2BACd+a,EAASza,sBAAW,uCACxB,WAAO2O,GAAP,SAAAhT,EAAA,sEACeiF,IAAI8R,WAAW5R,KAAf,UAA0C+Y,GAAclL,GADvE,mFADwB,sDAIxB,CACE3N,UAAW,WACT9D,EAAY0E,kBAAkB,CAACC,OAIrC,OAAO4Y,K","file":"static/js/main.33799b3b.chunk.js","sourcesContent":["import { CSSProperties, forwardRef, MouseEventHandler, ReactNode, useMemo } from 'react'\nimport styled from '@emotion/styled'\nimport { CambayType } from '../../services/text-typed'\nimport Truncate from 'react-truncate'\nimport { TEXT } from '../../constant/colors'\n\nconst StyledText = styled.div<{\n family: string\n size: number\n weight: number\n color: string\n style?: CSSProperties\n}>`\n font-family: ${({ family }) => `Cambay${family}`};\n font-size: ${({ size }) => size}px;\n font-weight: ${({ weight }) => weight};\n color: ${({ color }) => color};\n word-break: break-word;\n`\n\nexport interface TextProps {\n onClick?: MouseEventHandler\n className?: string\n children: ReactNode\n size?: number\n type?: CambayType\n color?: string\n style?: CSSProperties\n maxLines?: number\n useEllipsis?: boolean\n}\nconst Cambay = forwardRef((props: TextProps, ref: any) => {\n const {\n children,\n type,\n size,\n color = `${TEXT}`,\n style,\n className,\n maxLines: line = 1,\n useEllipsis = false,\n ...restProps\n } = props\n const family = useMemo(() => {\n switch (type) {\n case 'Huge':\n return '-Bold'\n case 'Heading1':\n return '-Bold'\n case 'Heading2':\n return '-Bold'\n case 'Heading3':\n return '-Bold'\n case 'Heading4':\n return '-Bold'\n case 'Heading5':\n return '-Bold'\n case 'SubHeading1':\n return '-Regular'\n case 'SubHeading2':\n return '-Regular'\n case 'SubHeading3':\n return '-Regular'\n case 'SubHeading4':\n return '-Regular'\n case 'SubHeading5':\n return '-Regular'\n default:\n return '-Regular'\n }\n }, [type])\n const textSize = useMemo(() => {\n switch (type) {\n case 'Huge':\n return 72\n case 'Heading1':\n return 56\n case 'Heading2':\n return 40\n case 'Heading3':\n return 32\n case 'Heading4':\n return 24\n case 'Heading5':\n return 18\n case 'SubHeading1':\n return 56\n case 'SubHeading2':\n return 40\n case 'SubHeading3':\n return 32\n case 'SubHeading4':\n return 24\n case 'SubHeading5':\n return 18\n default:\n return 24\n }\n }, [type])\n\n const textWeight = useMemo(() => {\n switch (type) {\n case 'Huge':\n return 700\n case 'Heading1':\n return 700\n case 'Heading2':\n return 700\n case 'Heading3':\n return 700\n case 'Heading4':\n return 700\n case 'Heading5':\n return 700\n case 'SubHeading1':\n return 400\n case 'SubHeading2':\n return 400\n case 'SubHeading3':\n return 400\n case 'SubHeading4':\n return 400\n case 'SubHeading5':\n return 400\n default:\n return 400\n }\n }, [type])\n\n return (\n \n {useEllipsis ? (\n ...}>\n {children}\n \n ) : (\n <>{children}\n )}\n \n )\n})\n\nexport default Cambay\n","import dayjs from 'dayjs'\nimport { debounce, DebounceSettings, some } from 'lodash'\nimport { useCallback, useContext, useMemo, useState } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { AppModalProps } from '../components/AppModal'\nimport { AppSnackbarProps } from '../components/AppSnackbar'\nimport { AppCtx } from '../constant/contexts'\nimport { useGetServiceableCountries } from '../services/home/home-query'\nimport { Currency, ServiceableCountry } from '../services/home/home-types'\n\nexport const useDebounce = any>(\n func: T,\n wait?: number,\n options?: DebounceSettings,\n) => {\n return useMemo(() => {\n return debounce(func, wait, options)\n }, [func, options, wait])\n}\n\ntype UseModalProps = Partial>\ntype UseModalOptionProps = Partial<\n Pick\n>\ntype UseModalConfirmProps = Required> &\n Partial> &\n UseModalOptionProps\ntype UseModalErrorProps = Required> &\n Partial> &\n UseModalOptionProps\nexport const useModal = () => {\n const { t } = useTranslation()\n const [state, setState, { initialValue }] = useContext(AppCtx)\n const openModal = useCallback(\n (props: UseModalProps) => {\n setState({\n appModal: {\n visible: true,\n ...props,\n },\n })\n },\n [setState],\n )\n\n const confirm = useCallback(\n (props: UseModalConfirmProps) => {\n const {\n title,\n message,\n onOk,\n onOkText = t('button.yes'),\n onCancel,\n onCancelText = t('button.no'),\n ...restProps\n } = props\n openModal({\n title,\n message,\n onOk,\n onOkText,\n onCancel: () => {\n onCancel?.()\n },\n onCancelText,\n ...restProps,\n })\n },\n [openModal, t],\n )\n\n const error = useCallback(\n (props: UseModalErrorProps) => {\n const { title, message, onOk, onOkText, ...restProps } = props\n openModal({\n title,\n message,\n onOk: () => {\n onOk?.()\n },\n onOkText,\n onCancel: undefined,\n ...restProps,\n })\n },\n [openModal],\n )\n\n const open = useCallback(\n (props: Pick) => {\n const { children, ...restProps } = props\n openModal({\n children,\n ...restProps,\n })\n },\n [openModal],\n )\n\n const closeModal = useCallback(() => {\n setState({\n appModal: initialValue.appModal,\n })\n }, [initialValue.appModal, setState])\n\n return { confirm, error, open, closeModal, visible: state.appModal.visible }\n}\nconst serviceableCountryTh: ServiceableCountry = {\n country: 'TH',\n countryDesc: 'Thailand',\n availablePaymentChannel: [],\n currencies: [\n {\n currency: 'THB',\n currencyDesc: 'Thai Baht',\n fxRate: 1,\n timestamp: dayjs().format(),\n transactionLimit: 10000,\n transactionLimitThb: 10000,\n fee: 0,\n },\n ],\n}\n\ntype GetCountryOption = {\n includeTh: boolean\n}\n\nexport const useServiceableCountriesHelper = () => {\n const { data: serviceableCountries } = useGetServiceableCountries()\n\n const countryOptions = useMemo(() => {\n return (\n serviceableCountries?.map((countryItem) => {\n return {\n value: countryItem.country,\n label: `${countryItem.countryDesc}`,\n }\n }) || []\n )\n }, [serviceableCountries])\n\n const getCurrencies = useCallback(\n (country: string) => {\n const currencies =\n serviceableCountries?.find((serviceableCountry) => serviceableCountry.country === country)\n ?.currencies || []\n return currencies\n },\n [serviceableCountries],\n )\n\n const getPaymentChannelFormCountry = useCallback(\n (country: string) => {\n const paymentChannelOption =\n serviceableCountries?.find(\n (serviceableCountries) => serviceableCountries.country === country,\n )?.availablePaymentChannel || []\n return paymentChannelOption\n },\n [serviceableCountries],\n )\n\n const getCurrenciesOptions = useCallback(\n (country: string) => {\n const currenciesOptions = getCurrencies(country).map((currency) => {\n return {\n value: currency.currency,\n label: `${currency.currency} - ${currency.currencyDesc}`,\n }\n })\n return currenciesOptions\n },\n [getCurrencies],\n )\n\n const getCurrency = useCallback(\n (currency: string) => {\n const currencies = serviceableCountries\n ? serviceableCountries.reduce((acc: Currency[], cur) => {\n acc = acc.concat(cur.currencies)\n return acc\n }, [])\n : []\n return currencies.find((v) => v.currency === currency)\n },\n [serviceableCountries],\n )\n\n const getCountryFromCurrency = useCallback(\n (currency: string, option: GetCountryOption = { includeTh: false }) => {\n if (option?.includeTh && currency === 'THB') {\n return serviceableCountryTh\n }\n return serviceableCountries?.find((serviceableCountry) =>\n some(serviceableCountry.currencies, (v) => v.currency === currency),\n )\n },\n [serviceableCountries],\n )\n\n const getCountryFromCountryName = useCallback(\n (country: string, option: GetCountryOption = { includeTh: false }) => {\n if (option?.includeTh && country === 'TH') {\n return serviceableCountryTh\n }\n return serviceableCountries?.find(\n (serviceableCountry) => serviceableCountry.country === country,\n )\n },\n [serviceableCountries],\n )\n\n return {\n countryOptions,\n getCurrencies,\n getCurrenciesOptions,\n getCurrency,\n getCountryFromCurrency,\n getCountryFromCountryName,\n getPaymentChannelFormCountry,\n }\n}\n\nexport const useVisible = (defaultVisible: boolean = false) => {\n const [visible, setVisible] = useState(defaultVisible)\n const open = useCallback(() => {\n setVisible(true)\n }, [])\n const close = useCallback(() => {\n setVisible(false)\n }, [])\n\n return {\n visible,\n open,\n close,\n }\n}\n\ntype UseSnackbarProps = Partial>\nexport const useSnackbar = () => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const [_state, setState] = useContext(AppCtx)\n const openSnackbar = useCallback(\n (props: UseSnackbarProps) => {\n setState({\n appSnackbar: {\n visible: true,\n ...props,\n },\n })\n },\n [setState],\n )\n\n const snackbar = useCallback(\n (props: Pick) => {\n const { message, type = 'info', description = '' } = props\n openSnackbar({\n message,\n type,\n description,\n })\n },\n [openSnackbar],\n )\n\n return { snackbar }\n}\n","import { Alert, Snackbar } from '@mui/material'\nimport { useCallback, useContext } from 'react'\nimport { ERROR, INFO, SECONDARY, WHITE } from '../constant/colors'\nimport { AppCtx } from '../constant/contexts'\nimport Roboto from './common/Roboto'\n\nexport type AppSnackbarProps = {\n visible: boolean\n message?: string\n description?: string\n type?: 'error' | 'info' | 'success' | 'warning'\n}\n\nexport const AppSnackbar = () => {\n const [state, setState, { initialValue }] = useContext(AppCtx)\n const color = useCallback(() => {\n if (state.appSnackbar.type === 'success') {\n return SECONDARY\n } else if (state.appSnackbar.type === 'error') {\n return ERROR\n } else {\n return INFO\n }\n }, [state.appSnackbar.type])\n\n const handleClose = (event: Event | React.SyntheticEvent) => {\n // if (reason === 'clickaway') {\n // return\n // }\n\n setState({\n appSnackbar: initialValue.appSnackbar,\n })\n }\n\n return (\n \n \n \n {state.appSnackbar.message}\n \n \n \n )\n}\n","import { CSSProperties, ReactNode, useCallback, useContext } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { PRIMARY, TEXT_LIGHT, WHITE } from '../constant/colors'\nimport { AppCtx } from '../constant/contexts'\nimport Button from './common/Button'\nimport Modal from '@mui/material/Modal'\nimport { css } from '@emotion/css'\nimport Cambay from './common/Cambay'\nimport Roboto from './common/Roboto'\n\nconst classes = {\n appModal: css`\n display: flex;\n align-items: center;\n justify-content: center;\n `,\n backdrop: {\n backgroundColor: '#000000bf',\n },\n layout: css`\n display: flex;\n flex-flow: column;\n justify-content: flex-start;\n background: ${WHITE};\n\n min-width: 512px;\n padding: 24px;\n border-radius: 16px;\n box-sizing: border-box;\n `,\n header: css`\n margin-bottom: 16px;\n text-align: left;\n `,\n body: css`\n text-align: center;\n `,\n footer: css`\n display: flex;\n justify-content: center;\n grid-column-gap: 8px;\n margin-top: 40px;\n > button {\n flex: 1;\n }\n `,\n}\n\nexport type AppModalProps = {\n visible: boolean\n title?: string\n message?: ReactNode\n children?: ReactNode\n onOk?: () => void\n onOkText?: string\n onCancel?: () => void\n onCancelText?: string\n closeOnClickOutside?: boolean\n style?: CSSProperties\n className?: string\n okOnRightPosition?: boolean\n}\nconst AppModal = () => {\n const [state, setState, { initialValue }] = useContext(AppCtx)\n const {\n visible,\n title,\n message,\n children,\n onOk,\n onOkText,\n onCancel,\n onCancelText,\n closeOnClickOutside = true,\n style,\n className,\n okOnRightPosition = false,\n } = state.appModal\n\n const { t } = useTranslation()\n const onClose = useCallback(() => {\n setState({\n appModal: initialValue.appModal,\n })\n }, [initialValue.appModal, setState])\n\n const onOkClick = useCallback(async () => {\n await onOk?.()\n onClose()\n }, [onOk, onClose])\n\n const onCancelClick = useCallback(async () => {\n await onCancel?.()\n onClose()\n }, [onCancel, onClose])\n\n return (\n {\n closeOnClickOutside && onCancelClick()\n }}\n className={`${classes.appModal} ${className}`}\n aria-labelledby=\"app-modal-title\"\n aria-describedby=\"app-modal-description\"\n disablePortal\n disableEnforceFocus\n disableAutoFocus\n disableRestoreFocus\n BackdropProps={{ style: classes.backdrop }}\n >\n \n {!children && (\n <>\n {title && (\n
\n \n {t(title)}\n \n
\n )}\n {message &&\n (typeof message === 'string' ? (\n
\n \n {t(message)}\n \n
\n ) : (\n message\n ))}\n {okOnRightPosition ? (\n
\n {onCancel && (\n \n )}\n {onOk && (\n \n )}\n
\n ) : (\n
\n {onOk && (\n \n )}\n {onCancel && (\n \n )}\n
\n )}\n \n )}\n {children && children}\n \n \n )\n}\n\nexport default AppModal\n","import dayJS from 'dayjs'\nimport timezone from 'dayjs/plugin/timezone'\nimport utc from 'dayjs/plugin/utc'\nimport isBetween from 'dayjs/plugin/isBetween'\ndayJS.extend(isBetween)\ndayJS.extend(utc)\ndayJS.extend(timezone)\ndayJS.tz.setDefault('Asia/Bangkok')\n","import React, { useCallback, useEffect, useLayoutEffect } from 'react'\nimport { useLocation } from 'react-router-dom'\nimport './App.css'\nimport { AppSnackbar } from './components/AppSnackbar'\n\nimport { isMode, withCtx } from './utils/helper'\nimport { AppCtx } from './constant/contexts'\nimport { QueryClient, QueryClientProvider } from 'react-query'\nimport { useSnackbar } from './utils/custom-hook'\nimport { useTranslation } from 'react-i18next'\nimport { AnyObject } from 'final-form'\nimport { PRIMARY, SECONDARY, WHITE } from './constant/colors'\nimport { FadeLoader, RingLoader } from 'react-spinners'\nimport { ReactQueryDevtools } from 'react-query/devtools'\nimport AppModal from './components/AppModal'\n// import tracking from './utils/tracking'\nimport './initialize'\n\nconst AppRoute = React.lazy(() => import('./routes'))\n\nconst queryClient = new QueryClient()\n\nexport const useOnError = () => {\n const { snackbar } = useSnackbar()\n const { t } = useTranslation('backend')\n return useCallback(\n (e: any) => {\n console.log('useOnError', e)\n const ignoreStatus = [8001]\n const {\n message = 'Not Identify',\n meta = {},\n status,\n } = e || ({} as { message: any; status: number; meta: { param?: AnyObject } })\n const { param = {} } = meta\n if (!ignoreStatus.includes(status)) {\n snackbar({\n type: 'error',\n message: t(message, { ...param, defaultValue: message }),\n })\n }\n },\n [snackbar, t],\n )\n}\n\nexport const FallBackComponent = () => {\n return (\n \n \n {/* */}\n \n )\n}\n\nexport const App: React.FC<{ id: string }> = () => {\n const { pathname } = useLocation()\n const onError = useOnError()\n\n // const mockData = useCallback(() => {\n // const regId = 'cb22706d-b441-446f-b043-eb9e347950ea'\n // const appToken = 'EUUYGQr2GjfAApDjz2QbyPaA9wkHQ6fJLVwsP2aSiMGj'\n // Helper.setEncryptValue(StoreKey.regId, regId)\n // Helper.setEncryptValue(StoreKey.appToken, appToken)\n // }, [])\n\n // useEffect(() => {\n // mockData()\n // }, [mockData])\n\n useEffect(() => {\n document.body.scrollTo(0, 0)\n }, [pathname])\n\n // useEffect(() => {\n // tracking.page(pathname)\n // }, [pathname])\n\n useLayoutEffect(() => {\n // set react query default options here\n queryClient.setDefaultOptions({\n queries: {\n onError,\n retry: 1,\n retryDelay: 1000,\n cacheTime: 5 * 60 * 1000, // 5 minute\n staleTime: 5 * 60 * 1000, // 5 minute\n refetchOnWindowFocus: false,\n },\n mutations: {\n onError,\n retry: 0,\n },\n })\n }, [onError])\n\n return (\n \n \n \n }>\n \n \n\n {isMode('development') && }\n \n )\n}\n\nexport default withCtx(AppCtx)(App)\n","import dayjs from 'dayjs'\nimport { useContext } from 'react'\nimport { useMutation, useQueryClient } from 'react-query'\nimport { AppCtx } from '../../constant/contexts'\nimport { api } from '../../utils/api'\nimport { Helper, StoreKey } from '../../utils/helper'\nimport { HOME } from '../home/home-query'\nimport {\n MsRopcRefreshTokenParams,\n MsRopcRefreshTokenResponse,\n MsRopcSignInParams,\n MsRopcSignInResponse,\n} from './ms-ropc-types'\n\nexport const useMsRopcSignIn = () => {\n const queryClient = useQueryClient()\n const [, setState] = useContext(AppCtx)\n\n const authUrl: string = Helper.getEncryptValue(StoreKey.authUrl)\n const authClientId: string = Helper.getEncryptValue(StoreKey.authClientId)\n console.log({ authUrl, authClientId })\n return useMutation(\n async (pincode: string) => {\n const appToken = Helper.getEncryptValue(StoreKey.appToken)\n if (!appToken) {\n return Promise.reject('App token is missing')\n }\n const _params: MsRopcSignInParams = {\n username: appToken,\n password: `p1N.#${pincode}`,\n scope: `openid ${authClientId} offline_access`,\n clientId: authClientId,\n grantType: 'password',\n responseType: 'token id_token',\n }\n const { data } = await api.msRopc.post(authUrl, _params)\n setState({ authenPinCode: pincode })\n return data\n },\n {\n onSuccess: (response) => {\n const { idToken, accessToken, tokenType, expiresIn, refreshToken } = response\n Helper.setEncryptValue(StoreKey.idToken, idToken)\n Helper.setEncryptValue(StoreKey.accessToken, accessToken)\n Helper.setEncryptValue(StoreKey.tokenType, tokenType)\n Helper.setEncryptValue(StoreKey.expiresIn, expiresIn)\n Helper.setEncryptValue(StoreKey.refreshToken, refreshToken)\n\n const expiresOn = dayjs().add(Number(expiresIn), 'second')\n Helper.setEncryptValue(StoreKey.expiresOn, expiresOn.unix())\n queryClient.invalidateQueries([HOME])\n },\n },\n )\n}\n\nconst setRefreshTokenResponse = (response: MsRopcRefreshTokenResponse) => {\n const {\n accessToken,\n idToken,\n tokenType,\n notBefore,\n expiresIn,\n expiresOn,\n resource,\n idTokenExpiresIn,\n profileInfo,\n scope,\n refreshToken,\n refreshTokenExpiresIn,\n } = response\n Helper.setEncryptValue(StoreKey.accessToken, accessToken)\n Helper.setEncryptValue(StoreKey.idToken, idToken)\n Helper.setEncryptValue(StoreKey.tokenType, tokenType)\n Helper.setEncryptValue(StoreKey.notBefore, notBefore)\n Helper.setEncryptValue(StoreKey.expiresIn, expiresIn)\n Helper.setEncryptValue(StoreKey.expiresOn, expiresOn)\n Helper.setEncryptValue(StoreKey.resource, resource)\n Helper.setEncryptValue(StoreKey.idTokenExpiresIn, idTokenExpiresIn)\n Helper.setEncryptValue(StoreKey.profileInfo, profileInfo)\n Helper.setEncryptValue(StoreKey.scope, scope)\n Helper.setEncryptValue(StoreKey.refreshToken, refreshToken)\n Helper.setEncryptValue(StoreKey.refreshTokenExpiresIn, refreshTokenExpiresIn)\n}\n\nexport const callRefreshToken = async () => {\n const authUrl: string = Helper.getEncryptValue(StoreKey.authUrl)\n const authClientId: string = Helper.getEncryptValue(StoreKey.authClientId)\n const refreshToken = Helper.getEncryptValue(StoreKey.refreshToken)\n console.log({ authUrl, authClientId, refreshToken })\n\n if (!refreshToken) {\n return Promise.reject('RefreshToken is missing')\n }\n const _params: MsRopcRefreshTokenParams = {\n refreshToken,\n resource: authClientId,\n clientId: authClientId,\n grantType: 'refresh_token',\n responseType: 'id_token',\n }\n const { data } = await api.msRopc.post(authUrl, _params)\n setRefreshTokenResponse(data)\n return data\n}\n\nexport const useMsRopcRefreshToken = () => {\n const queryClient = useQueryClient()\n return useMutation(callRefreshToken, {\n onSuccess: (response) => {\n setRefreshTokenResponse(response)\n queryClient.invalidateQueries()\n queryClient.refetchQueries({\n active: true,\n })\n },\n })\n}\n","import { Language } from '@mui/icons-material'\nimport { Button, Menu, MenuItem } from '@mui/material'\nimport Roboto from '../common/Roboto'\nimport { useState, useMemo, useCallback } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport i18next from 'i18next'\nimport { SECONDARY } from '../../constant/colors'\n\nexport const initLangKey = 'blcp-lang'\n\nconst LanguageSwitchMenu = () => {\n const { i18n } = useTranslation()\n\n const currentLang = useMemo(() => {\n switch (i18n.language) {\n case 'en':\n return 'English'\n case 'kh':\n return 'Cambodia'\n case 'th':\n return 'Thai'\n }\n return i18n.language\n }, [i18n.language])\n\n const [anchorEl, setAnchorEl] = useState(null)\n const open = Boolean(anchorEl)\n\n const handleChangeLang = useCallback(\n (event: React.MouseEvent, language: string | null) => {\n if (language !== null) {\n i18n.changeLanguage(language)\n i18next.reloadResources()\n localStorage.setItem(initLangKey, language)\n setAnchorEl(null)\n }\n },\n [i18n],\n )\n\n const handleClick = (event: any) => {\n setAnchorEl(event.currentTarget)\n }\n const handleClose = () => {\n setAnchorEl(null)\n }\n\n return (\n <>\n \n }\n >\n \n {currentLang}\n \n \n \n handleChangeLang(event, 'en')}>\n \n English\n \n \n handleChangeLang(event, 'kh')}>\n \n Cambodia\n \n \n handleChangeLang(event, 'th')}>\n \n Thai\n \n \n \n \n )\n}\n\nexport default LanguageSwitchMenu\n","/*! micro-base - MIT License (c) 2021 Paul Miller (paulmillr.com) */\n\n// Utilities\nexport interface Coder {\n encode(from: F): T\n decode(to: T): F\n}\n\nexport interface BytesCoder extends Coder {\n encode: (data: Uint8Array) => string\n decode: (str: string) => Uint8Array\n}\n\n// TODO: some recusive type inference so it would check correct order of input/output inside rest?\n// like , , \ntype Chain = [Coder, ...Coder[]]\n// Extract info from Coder type\ntype Input = F extends Coder ? T : never\ntype Output = F extends Coder ? T : never\n// Generic function for arrays\ntype First = T extends [infer U, ...any[]] ? U : never\ntype Last = T extends [...any[], infer U] ? U : never\ntype Tail = T extends [any, ...infer U] ? U : never\n\ntype AsChain> = {\n // C[K] = Coder, Input>\n [K in keyof C]: Coder, Input>\n}\n\nfunction chain>(...args: T): Coder>, Output>> {\n // Wrap call in closure so JIT can inline calls\n const wrap = (a: any, b: any) => (c: any) => a(b(c))\n // Construct chain of args[-1].encode(args[-2].encode([...]))\n const encode = Array.from(args)\n .reverse()\n .reduce((acc, i: any) => (acc ? wrap(acc, i.encode) : i.encode), undefined) as any\n // Construct chain of args[0].decode(args[1].decode(...))\n const decode = args.reduce(\n (acc, i: any) => (acc ? wrap(acc, i.decode) : i.decode),\n undefined,\n ) as any\n return { encode, decode }\n}\n\ntype Alphabet = string[] | string\n\n// Encodes integer radix representation to array of strings using alphabet and back\nfunction alphabet(alphabet: Alphabet): Coder {\n return {\n encode: (digits: number[]) => {\n if (!Array.isArray(digits) || (digits.length && typeof digits[0] !== 'number'))\n throw new Error('alphabet.encode input should be an array of numbers')\n return digits.map((i) => {\n if (i < 0 || i >= alphabet.length)\n throw new Error(`Digit index outside alphabet: ${i} (alphabet: ${alphabet.length})`)\n return alphabet[i]\n })\n },\n decode: (input: string[]) => {\n if (!Array.isArray(input) || (input.length && typeof input[0] !== 'string'))\n throw new Error('alphabet.decode input should be array of strings')\n return input.map((letter) => {\n const index = alphabet.indexOf(letter)\n if (index === -1) throw new Error(`Unknown letter: \"${letter}\". Allowed: ${alphabet}`)\n return index\n })\n },\n }\n}\n\nfunction join(separator = ''): Coder {\n return {\n encode: (from) => {\n if (!Array.isArray(from) || (from.length && typeof from[0] !== 'string'))\n throw new Error('join.encode input should be array of strings')\n return from.join(separator)\n },\n decode: (to) => {\n if (typeof to !== 'string') throw new Error('join.decode input should be string')\n return to.split(separator)\n },\n }\n}\n\n// Pad strings array so it has integer number of bits\nfunction padding(bits: number, chr = '='): Coder {\n return {\n encode(data: string[]): string[] {\n if (!Array.isArray(data) || (data.length && typeof data[0] !== 'string'))\n throw new Error('padding.encode input should be array of strings')\n while ((data.length * bits) % 8) data.push(chr)\n return data\n },\n decode(input: string[]): string[] {\n if (!Array.isArray(input) || (input.length && typeof input[0] !== 'string'))\n throw new Error('padding.encode input should be array of strings')\n let end = input.length\n if ((end * bits) % 8)\n throw new Error('Invalid padding: string should have whole number of bytes')\n while (end > 0 && input[end - 1] === chr) {\n end--\n if (!((end * bits) % 8)) throw new Error('Invalid padding: string has too much padding')\n }\n return input.slice(0, end)\n },\n }\n}\n\nfunction normalize(fn: (val: T) => T): Coder {\n return { encode: (from: T) => from, decode: (to: T) => fn(to) }\n}\n\n// NOTE: it has quadratic time complexity\nfunction convertRadix(data: number[], from: number, to: number) {\n if (!data.length) return []\n let pos = 0\n const res = []\n const digits = Array.from(data)\n while (true) {\n let carry = 0\n let done = true\n for (let i = pos; i < digits.length; i++) {\n const digit = from * carry + digits[i]\n carry = digit % to\n digits[i] = Math.floor(digit / to)\n if (!done) continue\n else if (!digits[i]) pos = i\n else done = false\n }\n res.push(carry)\n if (done) break\n }\n for (let i = 0; i < data.length - 1 && data[i] === 0; i++) res.push(0)\n return res.reverse()\n}\n\nfunction convertRadix2(data: number[], from: number, to: number, padding: boolean): number[] {\n let carry = 0\n let pos = 0 // bitwise position in current element\n const mask = 2 ** to - 1\n const res: number[] = []\n for (const n of data) {\n carry = (carry << from) | n\n pos += from\n for (; pos >= to; pos -= to) res.push((carry >> (pos - to)) & mask)\n }\n carry = (carry << (to - pos)) & mask\n if (!padding && pos >= from) throw new Error('Excess padding')\n if (!padding && carry) throw new Error(`Non-zero padding: ${carry}`)\n if (padding && pos > 0) res.push(carry)\n return res\n}\n\nfunction radix(num: number): Coder {\n return {\n encode: (bytes: Uint8Array) => {\n if (!(bytes instanceof Uint8Array)) throw new Error('radix.encode input should be Uint8Array')\n return convertRadix(Array.from(bytes), 2 ** 8, num)\n },\n decode: (digits: number[]) => {\n if (!Array.isArray(digits) || (digits.length && typeof digits[0] !== 'number'))\n throw new Error('radix.decode input should be array of strings')\n return Uint8Array.from(convertRadix(digits, num, 2 ** 8))\n },\n }\n}\n\n// If both bases are power of same number (like `2**8 <-> 2**64`),\n// there is a linear algorithm. For now we have implementation for power-of-two bases only\nfunction radix2(bits: number, revPadding = false): Coder {\n return {\n encode: (bytes: Uint8Array) => {\n if (!(bytes instanceof Uint8Array))\n throw new Error('radix2.encode input should be Uint8Array')\n return convertRadix2(Array.from(bytes), 8, bits, !revPadding)\n },\n decode: (digits: number[]) => {\n if (!Array.isArray(digits) || (digits.length && typeof digits[0] !== 'number'))\n throw new Error('radix2.decode input should be array of strings')\n return Uint8Array.from(convertRadix2(digits, bits, 8, revPadding))\n },\n }\n}\n\ntype ArgumentTypes = F extends (...args: infer A) => any ? A : never\nfunction unsafeWrapper any>(fn: T) {\n return function (...args: ArgumentTypes): ReturnType | undefined {\n try {\n return fn.apply(null, args)\n } catch (e) {}\n }\n}\n\nfunction checksum(\n len: number,\n fn: (data: Uint8Array) => Uint8Array,\n): Coder {\n return {\n encode(data: Uint8Array) {\n if (!(data instanceof Uint8Array))\n throw new Error('checksum.encode: input should be Uint8Array')\n const checksum = fn(data).slice(0, len)\n const res = new Uint8Array(data.length + len)\n res.set(data)\n res.set(checksum, data.length)\n return res\n },\n decode(data: Uint8Array) {\n if (!(data instanceof Uint8Array))\n throw new Error('checksum.decode: input should be Uint8Array')\n const payload = data.slice(0, -len)\n const newChecksum = fn(payload).slice(0, len)\n const oldChecksum = data.slice(-len)\n for (let i = 0; i < len; i++)\n if (newChecksum[i] !== oldChecksum[i]) throw new Error('Invalid checksum')\n return payload\n },\n }\n}\nexport const utils = { alphabet, chain, checksum, radix2 }\n\n// RFC 4648 aka RFC 3548\n// ---------------------\nexport const base16: BytesCoder = chain(radix2(4), alphabet('0123456789ABCDEF'), join(''))\nexport const base32: BytesCoder = chain(\n radix2(5),\n alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZ234567'),\n padding(5),\n join(''),\n)\nexport const base32hex: BytesCoder = chain(\n radix2(5),\n alphabet('0123456789ABCDEFGHIJKLMNOPQRSTUV'),\n padding(5),\n join(''),\n)\nexport const base32crockford: BytesCoder = chain(\n radix2(5),\n alphabet('0123456789ABCDEFGHJKMNPQRSTVWXYZ'),\n join(''),\n normalize((s: string) => s.toUpperCase().replace(/O/g, '0').replace(/[IL]/g, '1')),\n)\nexport const base64: BytesCoder = chain(\n radix2(6),\n alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'),\n padding(6),\n join(''),\n)\nexport const base64url: BytesCoder = chain(\n radix2(6),\n alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_'),\n padding(6),\n join(''),\n)\n\n// base58 code\n// -----------\nconst genBase58 = (abc: string) => chain(radix(58), alphabet(abc), join(''))\n\nexport const base58: BytesCoder = genBase58(\n '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz',\n)\nexport const base58flickr: BytesCoder = genBase58(\n '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ',\n)\nexport const base58xrp: BytesCoder = genBase58(\n 'rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz',\n)\n\n// xmr ver is done in 8-byte blocks.\n// This gives us eight full-sized blocks and one 5-byte block.\n// Eight bytes converts to 11 or less Base58 characters;\n// if a particular block converts to <11 characters,\n// the conversion pads it with \"1\"s (1 is 0 in Base58).\n// Likewise, the final 5-byte block can convert to 7 or less Base58 digits;\n// the conversion will ensure the result is 7 digits. Due to the conditional padding,\n// the 69-byte string will always convert to 95 Base58 characters (8 * 11 + 7).\n// Significantly reduces quadratic complexity of base58\nexport const base58xmr: BytesCoder = {\n encode(data: Uint8Array) {\n let res = ''\n for (let i = 0; i < data.length; i += 8) {\n const slice = data.subarray(i, i + 8)\n res += base58.encode(slice).padStart(slice.length === 8 ? 11 : 7, '1')\n }\n return res\n },\n decode(str: string) {\n let res: number[] = []\n for (let i = 0; i < str.length; i += 11)\n res = res.concat(Array.from(base58.decode(str.slice(i, i + 11))))\n return Uint8Array.from(res)\n },\n}\n\nexport const base58check = (sha256: (data: Uint8Array) => Uint8Array): BytesCoder =>\n chain(\n checksum(4, (data) => sha256(sha256(data))),\n base58,\n )\n\n// Bech32 code\n// -----------\nexport interface Bech32Decoded {\n prefix: string\n words: number[]\n}\nexport interface Bech32DecodedWithArray {\n prefix: string\n words: number[]\n bytes: Uint8Array\n}\n\nconst BECH_ALPHABET: Coder = chain(\n alphabet('qpzry9x8gf2tvdw0s3jn54khce6mua7l'),\n join(''),\n)\n\nconst POLYMOD_GENERATORS = [0x3b6a57b2, 0x26508e6d, 0x1ea119fa, 0x3d4233dd, 0x2a1462b3]\nfunction bech32Polymod(pre: number): number {\n const b = pre >> 25\n let chk = (pre & 0x1ffffff) << 5\n for (let i = 0; i < POLYMOD_GENERATORS.length; i++) {\n if (((b >> i) & 1) === 1) chk ^= POLYMOD_GENERATORS[i]\n }\n return chk\n}\n\nfunction bechChecksum(prefix: string, words: number[], encodingConst = 1): string {\n const len = prefix.length\n let chk = 1\n for (let i = 0; i < len; i++) {\n const c = prefix.charCodeAt(i)\n if (c < 33 || c > 126) throw new Error(`Invalid prefix (${prefix})`)\n chk = bech32Polymod(chk) ^ (c >> 5)\n }\n chk = bech32Polymod(chk)\n for (let i = 0; i < len; i++) chk = bech32Polymod(chk) ^ (prefix.charCodeAt(i) & 0x1f)\n for (let v of words) chk = bech32Polymod(chk) ^ v\n for (let i = 0; i < 6; i++) chk = bech32Polymod(chk)\n chk ^= encodingConst\n return BECH_ALPHABET.encode(convertRadix2([chk % 2 ** 30], 30, 5, false))\n}\n\nfunction genBech32(encoding: 'bech32' | 'bech32m') {\n const ENCODING_CONST = encoding === 'bech32' ? 1 : 0x2bc830a3\n const _words = radix2(5)\n const fromWords = _words.decode\n const toWords = _words.encode\n const fromWordsUnsafe = unsafeWrapper(fromWords)\n\n function encode(\n prefix: string,\n words: number[] | Uint8Array,\n limit: number | false = 90,\n ): string {\n if (typeof prefix !== 'string')\n throw new Error(`bech32.decode prefix should be string, not ${typeof prefix}`)\n if (!Array.isArray(words) || (words.length && typeof words[0] !== 'number'))\n throw new Error(`bech32.decode words should be array of numbers, not ${typeof words}`)\n const actualLength = prefix.length + 7 + words.length\n if (limit !== false && actualLength > limit)\n throw new TypeError(`Length ${actualLength} exceeds limit ${limit}`)\n prefix = prefix.toLowerCase()\n return `${prefix}1${BECH_ALPHABET.encode(words)}${bechChecksum(prefix, words, ENCODING_CONST)}`\n }\n\n function decode(str: string, limit: number | false = 90): Bech32Decoded {\n if (typeof str !== 'string')\n throw new Error(`bech32.decode input should be string, not ${typeof str}`)\n if (str.length < 8 || (limit !== false && str.length > limit))\n throw new TypeError(`Wrong string length: ${str.length} (${str}). Expected (8..${limit})`)\n // don't allow mixed case\n const lowered = str.toLowerCase()\n if (str !== lowered && str !== str.toUpperCase())\n throw new Error(`String must be lowercase or uppercase`)\n str = lowered\n const sepIndex = str.lastIndexOf('1')\n if (sepIndex === 0 || sepIndex === -1)\n throw new Error(`Letter \"1\" must be present between prefix and data only`)\n const [prefix, _words] = [str.slice(0, sepIndex), str.slice(sepIndex + 1)]\n if (_words.length < 6) throw new Error('Data must be at least 6 characters long')\n const words = BECH_ALPHABET.decode(_words).slice(0, -6)\n const sum = bechChecksum(prefix, words, ENCODING_CONST)\n if (!_words.endsWith(sum)) throw new Error(`Invalid checksum in ${str}: expected \"${sum}\"`)\n return { prefix, words }\n }\n\n const decodeUnsafe = unsafeWrapper(decode)\n\n function decodeToBytes(str: string): Bech32DecodedWithArray {\n const { prefix, words } = decode(str, false)\n return { prefix, words, bytes: fromWords(words) }\n }\n\n return { encode, decode, decodeToBytes, decodeUnsafe, fromWords, fromWordsUnsafe, toWords }\n}\n\nexport const bech32 = genBech32('bech32')\nexport const bech32m = genBech32('bech32m')\n\nexport const utf8: BytesCoder = {\n encode: (data) => new TextDecoder().decode(data),\n decode: (str) => new TextEncoder().encode(str),\n}\n\nexport const hex: BytesCoder = chain(\n radix2(4),\n alphabet('0123456789abcdef'),\n join(''),\n normalize((s: string) => {\n if (typeof s !== 'string' || s.length % 2)\n throw new TypeError(`hex.decode: expected string, got ${typeof s} with length ${s.length}`)\n return s.toLowerCase()\n }),\n)\n\n// prettier-ignore\nconst CODERS = {\n utf8, hex, base16, base32, base64, base64url, base58, base58xmr\n};\ntype CoderType = keyof typeof CODERS\nconst coderTypeError = `Invalid encoding type. Available types: ${Object.keys(CODERS).join(', ')}`\n\nexport const bytesToString = (type: CoderType, bytes: Uint8Array): string => {\n if (typeof type !== 'string' || !CODERS.hasOwnProperty(type)) throw new TypeError(coderTypeError)\n if (!(bytes instanceof Uint8Array)) throw new TypeError('bytesToString() expects Uint8Array')\n return CODERS[type].encode(bytes)\n}\nexport const str = bytesToString // as in python, but for bytes only\n\nexport const stringToBytes = (type: CoderType, str: string): Uint8Array => {\n if (!CODERS.hasOwnProperty(type)) throw new TypeError(coderTypeError)\n if (typeof str !== 'string') throw new TypeError('stringToBytes() expects string')\n return CODERS[type].decode(str)\n}\nexport const bytes = stringToBytes\n","import { ReportHandler } from 'web-vitals';\n\nconst reportWebVitals = (onPerfEntry?: ReportHandler) => {\n if (onPerfEntry && onPerfEntry instanceof Function) {\n import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {\n getCLS(onPerfEntry);\n getFID(onPerfEntry);\n getFCP(onPerfEntry);\n getLCP(onPerfEntry);\n getTTFB(onPerfEntry);\n });\n }\n};\n\nexport default reportWebVitals;\n","import i18next from 'i18next'\nimport { initReactI18next } from 'react-i18next'\nimport en from './en.json'\nimport kh from './kh.json'\nimport th from './th.json'\nimport { initLangKey } from '../../components/layout/LanguageSwitchMenu'\n// import Backend from 'i18next-http-backend'\n\nconst resources = {\n en: {\n translation: en,\n },\n kh: {\n translation: kh,\n },\n th: {\n translation: th,\n },\n}\n\nconst initLang = localStorage.getItem(initLangKey) || 'en'\n\ni18next\n // .use(Backend)\n .use(initReactI18next)\n .init({\n lng: initLang,\n // fallbackLng: 'th',\n // ns: ['backend'],\n react: {\n useSuspense: false,\n wait: true,\n },\n // backend: {\n // loadPath: (window as any)._env_.apiHost.replace('/api/v1', '/locales/error-{{lng}}.json'),\n // },\n resources,\n // debug: true,\n })\ni18next.reloadResources()\n\nexport default i18next\n","import React from 'react'\nimport ReactDOM from 'react-dom'\nimport './index.css'\nimport App from './App'\nimport reportWebVitals from './reportWebVitals'\nimport { createTheme, ThemeProvider } from '@mui/material'\nimport { I18nextProvider } from 'react-i18next'\nimport i18n from './constant/i18n'\nimport { createBrowserHistory } from 'history'\nimport { Router } from 'react-router'\nimport {\n ERROR,\n INFO,\n PRIMARY,\n PRIMARY_LIGHT,\n SECONDARY,\n SECONDARY_LIGHT,\n SUCCESS,\n TEXT,\n WARNING,\n WHITE,\n} from './constant/colors'\n\nconst history = createBrowserHistory()\n\nexport const theme = createTheme({\n palette: {\n primary: {\n main: PRIMARY,\n light: PRIMARY_LIGHT,\n dark: PRIMARY,\n contrastText: WHITE,\n },\n secondary: {\n main: SECONDARY,\n light: SECONDARY_LIGHT,\n dark: SECONDARY,\n contrastText: WHITE,\n },\n error: {\n main: ERROR,\n light: ERROR,\n dark: ERROR,\n contrastText: WHITE,\n },\n warning: {\n main: WARNING,\n light: WARNING,\n dark: WARNING,\n contrastText: TEXT,\n },\n info: {\n main: INFO,\n light: INFO,\n dark: INFO,\n contrastText: WHITE,\n },\n success: {\n main: SUCCESS,\n light: SUCCESS,\n dark: SUCCESS,\n contrastText: WHITE,\n },\n },\n typography: {\n fontFamily: `\"Kanit\"`,\n fontSize: 17,\n },\n})\n\nReactDOM.render(\n \n \n \n \n \n \n \n \n ,\n document.getElementById('root'),\n)\n\n// If you want to start measuring performance in your app, pass a function\n// to log results (for example: reportWebVitals(console.log))\n// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals\nreportWebVitals()\n","import { AppModalProps } from '../components/AppModal'\nimport { AppSnackbarProps } from '../components/AppSnackbar'\n\nimport { createCtx, KycStatus } from '../utils/helper'\n\nconst AppModalOption: AppModalProps = {\n visible: false,\n message: '',\n children: undefined,\n}\n\nconst AppSnackbarOption: AppSnackbarProps = {\n visible: false,\n message: '',\n description: '',\n type: 'info',\n}\n\nexport const AppCtx = createCtx({\n appModal: AppModalOption,\n appSnackbar: AppSnackbarOption,\n kycStatus: undefined as KycStatus | undefined,\n userDisplay: undefined as string | undefined,\n avatarId: undefined as string | undefined,\n totalUnreadNoti: undefined as number | undefined,\n newPinCode: '',\n authenPinCode: '',\n topbarTab: {\n visibled: false,\n tabs: [{ label: '', path: '' }],\n onOk: null,\n onCancel: null,\n title: '',\n message: '',\n children: null,\n closeOnClickOutside: true,\n closeIcon: false,\n style: {},\n },\n pinVerifyCallback: (pinCode: string) => console.log('default fuction'),\n confirmPinCallback: async (pin: string, newPin: string) => console.log('confirm pin'),\n})\n","import { AxiosResponse, AxiosInstance, AxiosRequestConfig } from 'axios'\nimport qs from 'qs'\n\nexport enum ContentType {\n XFORM = 'application/x-www-form-urlencoded',\n JSON = 'application/json',\n FORMDATA = 'multipart/form-data',\n APPLICATION_XML = 'application/xml',\n}\n\nconst customClientWithData = (\n url: string,\n method: AxiosInstance['put'] | AxiosInstance['post'] | AxiosInstance['patch'],\n data: any,\n option?: AxiosRequestConfig & { contentType: ContentType },\n) => {\n const { contentType = ContentType.JSON, ...restOption } = option || {}\n return method(url, data, {\n headers: {\n 'Content-Type': contentType,\n },\n ...restOption,\n })\n}\n\nconst customClient = (\n url: string,\n method: AxiosInstance['delete'] | AxiosInstance['get'],\n params: any,\n option?: AxiosRequestConfig & { contentType?: ContentType },\n) => {\n const { contentType = ContentType.JSON, ...restOption } = option || {}\n return method(url, {\n params,\n headers: {\n 'Content-Type': contentType,\n },\n ...restOption,\n })\n}\n\nexport type ResponseData = Promise>\n\nexport const createMethod = (\n client: AxiosInstance,\n apiWraper: (method: Promise) => Promise,\n) => ({\n get: (\n url: string,\n param?: any,\n option?: AxiosRequestConfig & { contentType: ContentType },\n ): ResponseData => apiWraper(customClient(url, client.get, param, option)),\n put: (\n url: string,\n data?: any,\n option?: AxiosRequestConfig & { contentType: ContentType },\n ): ResponseData => apiWraper(customClientWithData(url, client.put, data, option)),\n post: (\n url: string,\n data?: any,\n option?: AxiosRequestConfig & { contentType: ContentType },\n ): ResponseData => apiWraper(customClientWithData(url, client.post, data, option)),\n patch: (\n url: string,\n data?: any,\n option?: AxiosRequestConfig & { contentType: ContentType },\n ): ResponseData => apiWraper(customClientWithData(url, client.patch, data, option)),\n delete: (\n url: string,\n param?: any,\n option?: AxiosRequestConfig & { contentType: ContentType },\n ): ResponseData => apiWraper(customClient(url, client.delete, param, option)),\n getFile: (\n url: string,\n param?: any,\n option?: AxiosRequestConfig & { contentType?: ContentType },\n ): ResponseData =>\n apiWraper(customClient(url, client.get, param, { responseType: 'blob', ...option })),\n sendFile: (\n url: string,\n data?: any,\n option?: AxiosRequestConfig & { contentType?: ContentType },\n ): ResponseData =>\n apiWraper(\n customClientWithData(url, client.post, data, {\n ...option,\n contentType: ContentType.APPLICATION_XML,\n }),\n ),\n})\n\nexport const customRequestData = (request: any) => {\n if (request.headers['Content-Type'] === ContentType.FORMDATA) {\n if (request.data) {\n const formData = new FormData()\n Object.entries(request.data).forEach(([key, value]: any[]) => {\n if (value instanceof Array) {\n value.forEach((val) => {\n formData.append(`${key}`, val)\n })\n } else {\n formData.append(key, value)\n }\n })\n // console.log(formData.get('files')?.toString())\n request.data = formData\n }\n } else if (request.headers['Content-Type'] === ContentType.XFORM) {\n if (request.data) {\n request.data = qs.stringify(request.data)\n }\n } else if (request.headers['Content-Type'] === ContentType.JSON) {\n }\n}\n\nexport const deepLoop = (data: any, func: (data: any) => any): any => {\n if (data instanceof File) {\n return func(data)\n }\n if (data instanceof Array) {\n return data.map((d) => deepLoop(d, func))\n }\n if (data instanceof Object) {\n const formatData: any = {}\n Object.keys(data).forEach((key) => {\n formatData[key] = deepLoop(data[key], func)\n })\n return formatData\n }\n return func(data)\n}\n","import axios, { AxiosRequestConfig, AxiosRequestHeaders, AxiosResponse } from 'axios'\nimport dayjs from 'dayjs'\nimport { camelizeKeys, decamelizeKeys } from 'humps'\nimport { ContentType, customRequestData, deepLoop } from './tools'\n\nconst createClient = () => {\n const ax = axios.create()\n ax.interceptors.request.use(async (request: AxiosRequestConfig) => {\n request.url = `${request.url}`\n const headers: AxiosRequestHeaders = {}\n headers['Content-Type'] = ContentType.XFORM\n request.headers = { ...request.headers, ...headers }\n\n if (request.params) {\n request.params = decamelizeKeys(request.params)\n request.params = deepLoop(request.params, modifyRequestData)\n }\n if (request.data) {\n request.data = decamelizeKeys(request.data)\n request.data = deepLoop(request.data, modifyRequestData)\n customRequestData(request)\n }\n return request\n })\n ax.interceptors.response.use(\n (response: AxiosResponse) => {\n if (response.headers['content-type'].includes('application/json')) {\n response.data = camelizeKeys(response.data) as any\n }\n return response\n },\n (error: any) => Promise.reject(error),\n )\n return ax\n}\n\nconst modifyRequestData = (data: any) => {\n if (dayjs.isDayjs(data)) {\n return data.format()\n }\n return data\n}\n\nexport const msRopcClient = createClient()\n\nexport const msRopcApiWraper = async (method: Promise) => {\n try {\n const res = await method\n return Promise.resolve(res)\n } catch (e: any) {\n const { response, message } = e\n let { data } = response || {}\n if (data instanceof Blob) {\n const responseFromBlob = await data.text()\n data = JSON.parse(responseFromBlob || '')\n }\n const { message: errorMessage, errorCode, meta = {} } = data || {}\n return Promise.reject({ message: errorCode || errorMessage || message || e, meta: meta })\n }\n}\n","import axios, { AxiosRequestConfig, AxiosRequestHeaders, AxiosResponse } from 'axios'\nimport dayjs from 'dayjs'\nimport { camelizeKeys, decamelizeKeys } from 'humps'\nimport { merge } from 'lodash'\nimport config from '../../config'\nimport { callRefreshToken } from '../../services/ms-ropc/ms-ropc-query'\nimport { ApiHelper } from '../api-helper'\nimport { ContentType, customRequestData, deepLoop } from './tools'\n\ntype RefreshType = {\n resolve: () => any\n reject: (error: any) => any\n}\n\nlet isRefreshing = false\nlet refreshQueue: RefreshType[] = []\nconst retries = 1\n\nconst createClient = () => {\n const ax = axios.create({\n baseURL: config.apiHost,\n })\n ax.interceptors.request.use(async (request: AxiosRequestConfig) => {\n request.url = `${request.url}`\n\n const headers: AxiosRequestHeaders = {}\n const idToken = ApiHelper.getIdToken()\n if (idToken) {\n headers['Authorization'] = `Bearer ${idToken}`\n }\n headers['33-Smart-Apim-Key'] = await ApiHelper.generateApimToken()\n headers['App-Version'] = ApiHelper.appVersion\n headers['App-Platform'] = ApiHelper.appPlatform\n request.headers = { ...request.headers, ...headers }\n\n if (request.headers['Content-Type'] !== ContentType.APPLICATION_XML) {\n if (request.params) {\n request.params = decamelizeKeys(request.params)\n request.params = deepLoop(request.params, modifyRequestData)\n }\n if (request.data) {\n request.data = decamelizeKeys(request.data)\n request.data = deepLoop(request.data, modifyRequestData)\n customRequestData(request)\n }\n }\n return request\n })\n ax.interceptors.response.use(\n (response: AxiosResponse) => {\n if (response.headers['content-type'].includes('application/json')) {\n response.data = camelizeKeys(response.data)\n }\n\n if (response?.data?.status !== undefined && response?.data?.status !== 0) {\n return Promise.reject(response)\n }\n\n return response\n },\n async (error) => {\n const {\n config: orgConfig,\n response: { status },\n } = error\n\n if (status !== 401) {\n return Promise.reject(error)\n }\n\n orgConfig._retry = typeof orgConfig._retry === 'undefined' ? 0 : ++orgConfig._retry\n\n if (orgConfig._retry === retries) {\n return Promise.reject(error)\n }\n\n if (!isRefreshing) {\n isRefreshing = true\n callRefreshToken()\n .then((res) => {\n refreshQueue.forEach((v) => v.resolve())\n refreshQueue = []\n })\n .catch(() => {\n refreshQueue.forEach((v) => v.reject(error))\n refreshQueue = []\n })\n .finally(() => {\n isRefreshing = false\n })\n }\n\n return new Promise((resolve, reject) => {\n refreshQueue.push({\n resolve: () => {\n const config = merge(orgConfig)\n const idToken = ApiHelper.getIdToken()\n if (idToken) {\n config.headers['Authorization'] = `Bearer ${idToken}`\n }\n resolve(axios.request(config))\n },\n reject: (error: any) => {\n reject(error)\n },\n })\n })\n },\n )\n\n return ax\n}\n\nconst modifyRequestData = (data: any) => {\n if (dayjs.isDayjs(data)) {\n return data.format()\n }\n return data\n}\n\nexport const smartSwiftClient = createClient()\n\nexport const smartSwiftApiWraper = async (method: Promise) => {\n try {\n const res = await method\n return Promise.resolve(res)\n } catch (e: any) {\n const { response, message, data } = e\n return Promise.reject(data || response || message || e)\n }\n}\n","import { msRopcApiWraper, msRopcClient } from './ms-ropc-client'\nimport { smartSwiftApiWraper, smartSwiftClient } from './smart-swift-client'\nimport { createMethod } from './tools'\n\nexport const api = {\n smartSwift: createMethod(smartSwiftClient, smartSwiftApiWraper),\n msRopc: createMethod(msRopcClient, msRopcApiWraper),\n}\n","import { CSSProperties, forwardRef, MouseEventHandler, ReactNode, useMemo } from 'react'\nimport styled from '@emotion/styled'\nimport { RobotoType } from '../../services/text-typed'\nimport Truncate from 'react-truncate'\nimport { TEXT } from '../../constant/colors'\n\n// import { BLACK_000000 } from '../../constant/colors'\n\nconst StyledText = styled.div<{\n family: string\n size: number\n weight: number\n color: string\n style?: CSSProperties\n}>`\n font-family: ${({ family }) => `Roboto${family}`};\n font-size: ${({ size }) => size}px;\n color: ${({ color }) => color};\n word-break: break-word;\n`\n\nexport interface TextProps {\n onClick?: MouseEventHandler\n className?: string\n children: ReactNode\n size?: number\n type?: RobotoType\n color?: string\n style?: CSSProperties\n maxLine?: number\n width?: number\n useEllipsis?: boolean\n}\nconst Roboto = forwardRef((props: TextProps, ref: any) => {\n const {\n children,\n type,\n size,\n color = `${TEXT}`,\n style,\n className,\n maxLine: line = 1,\n width: maxLenght,\n useEllipsis = false,\n ...restProps\n } = props\n const family = useMemo(() => {\n switch (type) {\n case 'BodyBold':\n return '-Bold'\n case 'Body':\n return '-Regular'\n case 'SmallBold':\n return '-Bold'\n case 'Small':\n return '-Regular'\n default:\n return '-Regular'\n }\n }, [type])\n const textSize = useMemo(() => {\n switch (type) {\n case 'BodyBold':\n return 16\n case 'Body':\n return 16\n case 'SmallBold':\n return 12\n case 'Small':\n return 12\n default:\n return 16\n }\n }, [type])\n\n const textWeight = useMemo(() => {\n switch (type) {\n case 'BodyBold':\n return 700\n case 'Body':\n return 400\n case 'SmallBold':\n return 700\n case 'Small':\n return 400\n default:\n return 400\n }\n }, [type])\n\n return (\n \n {useEllipsis ? (\n ...} width={maxLenght}>\n {children}\n \n ) : (\n <>{children}\n )}\n \n )\n})\n\nexport default Roboto\n","import { Context, createContext, useCallback, useMemo, useRef, useState } from 'react'\nimport deepmerge from 'deepmerge'\nimport { difference, isEqual } from 'lodash'\nimport { AnyObject } from 'final-form'\nimport { useHistory, useLocation, useParams, useRouteMatch } from 'react-router'\nimport CryptoJS from 'crypto-js'\nimport qs from 'qs'\nimport config from '../config'\nimport { AxiosResponse } from 'axios'\nimport downloadjs from 'downloadjs'\nimport { TEXT, WARNING, INFO, ERROR, SUCCESS } from '../constant/colors'\n\nexport const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms))\n\nexport const createCtx = (initValue: T) => {\n return createContext<\n [T, (value: DeepPartial) => void, { reset: () => void; initialValue: T }]\n >([\n initValue,\n (value: DeepPartial) => {},\n {\n reset: () => {},\n initialValue: initValue,\n },\n ])\n}\n\nconst overwriteMerge = (destinationArray: any, sourceArray: any, options: any) => sourceArray\n\nexport const withCtx =\n (Context: Context) =>\n (Component: React.ElementType) =>\n (props: T) => {\n const initalState = useMemo(() => {\n return (Context as any)._currentValue[0] || {}\n }, [])\n const [state, setState] = useState(initalState)\n const ref = useRef(state)\n const customSetState = useCallback((v: any) => {\n const newState = deepmerge(ref.current, v, { arrayMerge: overwriteMerge })\n if (!isEqual(newState, ref.current)) {\n ref.current = newState\n setState(newState)\n }\n }, [])\n const reset = useCallback(() => {\n if (!isEqual(initalState, ref.current)) {\n ref.current = initalState\n setState(initalState)\n }\n }, [initalState])\n\n return (\n \n \n \n )\n }\n\nexport const useRouter = () => {\n const params = useParams()\n const location = useLocation()\n const history = useHistory()\n const match = useRouteMatch()\n const query = useMemo(() => {\n return {\n ...qs.parse(location.search.slice(1)),\n ...params,\n } as TQuery\n }, [location.search, params])\n\n return useMemo(() => {\n return {\n push: history.push,\n replace: history.replace,\n goBack: history.goBack,\n pathname: location.pathname,\n query,\n match,\n location,\n }\n }, [history.push, history.replace, history.goBack, location, query, match])\n}\n\nconst defaultMode = ['production', 'uat', 'staging', 'development'] as const\n\nexport const isMode = (...mode: typeof defaultMode[number][]) => {\n const buildMode = config.mode as typeof defaultMode[number]\n return mode.includes(buildMode)\n}\n\nexport const formatToCurrency = (amount: number) => {\n return amount.toFixed(2).replace(/\\d(?=(\\d{3})+\\.)/g, '$&,')\n}\n\nexport const formatToCurrencySevenDecimal = (amount: number) => {\n return amount.toFixed(7).replace(/\\d(?=(\\d{3})+\\.)/g, '$&,')\n}\n\nexport const normalizePhone = (value: string) => {\n if (!value) {\n return value\n }\n const onlyNums = value.replace(/[^\\d]/g, '')\n if (onlyNums.length <= 3) {\n return onlyNums\n }\n if (onlyNums.length <= 6) {\n return `${onlyNums.slice(0, 3)}-${onlyNums.slice(3, 6)}`\n }\n return `${onlyNums.slice(0, 3)}-${onlyNums.slice(3, 6)}-${onlyNums.slice(6, 10)}`\n}\n\nexport const accountInputFormatter = (value: string) => {\n if (!value) {\n return value\n }\n const onlyNums = value.replace(/[^\\d]/g, '')\n if (onlyNums.length <= 3) {\n return onlyNums\n }\n if (onlyNums.length <= 4) {\n return `${onlyNums.slice(0, 3)}-${onlyNums.slice(3, 4)}`\n }\n if (onlyNums.length <= 9) {\n return `${onlyNums.slice(0, 3)}-${onlyNums.slice(3, 4)}-${onlyNums.slice(4, 9)}`\n }\n return `${onlyNums.slice(0, 3)}-${onlyNums.slice(3, 4)}-${onlyNums.slice(4, 9)}-${onlyNums.slice(\n 9,\n 10,\n )}`\n}\n\nexport const normalizeAccount = (value: string) => {\n if (!value) {\n return value\n }\n const onlyNums = value.replace(/[^\\d]/g, '')\n if (onlyNums.length <= 3) {\n return onlyNums\n }\n if (onlyNums.length <= 6) {\n return `${onlyNums.slice(0, 3)}-${onlyNums.slice(3, 6)}`\n }\n return `xxx-x-x${onlyNums.slice(5, 9)}-x`\n}\n\nexport const downloadFile = async (res: AxiosResponse, fileName: string) => {\n downloadjs(res.data, decodeURIComponent(fileName))\n}\n\nexport enum StoreKey {\n regId,\n regIdForgotPin,\n appToken,\n mobileTelNo,\n isLogin,\n\n // config\n authUrl,\n authClientId,\n\n // for MS ROPC\n idToken,\n refreshToken,\n accessToken,\n tokenType,\n expiresIn,\n\n // Refresh Token\n notBefore,\n expiresOn,\n resource,\n idTokenExpiresIn,\n profileInfo,\n scope,\n refreshTokenExpiresIn,\n // end MS ROPC\n}\nexport class Helper {\n static salt = process.env.REACT_APP_ENCRYPT_SALT || 'encryp-salt'\n\n static async setIdToken(accessToken: string) {\n this.setEncryptValue(StoreKey.idToken, accessToken)\n }\n\n static getIdToken(): string {\n return this.getEncryptValue(StoreKey.idToken)\n }\n\n static setEncryptValue(key: StoreKey, value: any) {\n const encryptValue = this.encryptData(value, this.salt)\n localStorage.setItem(`${key}`, encryptValue)\n }\n\n static getEncryptValue(key: StoreKey): string {\n const _value = localStorage.getItem(`${key}`)\n if (_value) {\n try {\n const decryptValue = this.decryptData(_value, this.salt)\n return decryptValue\n } catch (error) {\n console.log(`getEncryptValue Error: ${error}`)\n return ''\n }\n } else {\n return ''\n }\n }\n\n static encryptData = (data: Record, salt: string) =>\n CryptoJS.AES.encrypt(JSON.stringify(data), salt).toString()\n\n static decryptData = (cipherText: string, salt: string) => {\n const bytes = CryptoJS.AES.decrypt(cipherText, salt)\n try {\n return JSON.parse(bytes.toString(CryptoJS.enc.Utf8))\n } catch (err) {\n return null\n }\n }\n\n static clearStore = () => {\n const keys = Object.keys(StoreKey).filter((item) => {\n return !isNaN(Number(item))\n })\n const ignore = [StoreKey.authUrl, StoreKey.authClientId].map((v) => `${v}`)\n const removeKeys = difference(keys, ignore)\n console.log({\n keys,\n ignore,\n removeKeys,\n })\n removeKeys.forEach((removeKey) => {\n console.log({ removeKey })\n return localStorage.removeItem(removeKey)\n })\n }\n}\n\nexport const useQueryParams = () => {\n const router = useRouter()\n const setParam = useCallback(\n (value: T) => {\n router.push(`${router.pathname}?${qs.stringify({ ...router.query, ...value })}`)\n },\n [router],\n )\n return {\n query: router.query as T,\n setParam,\n }\n}\n\nexport const normalizeTime = (value: any) => {\n if (!value) return value\n const onlyNums = value.replace(/[^\\d]/g, '')\n if (onlyNums.length <= 3) return onlyNums\n return `${onlyNums.slice(0, 2)}:${onlyNums.slice(2, 4)}`\n}\n\nexport const normalizeBankDigits = (value: any) => {\n if (!value) return value\n const onlyNums = value.replace(/[^\\d]/g, '')\n return onlyNums\n}\n\nexport const colorStatus = (status: string) => {\n var color = TEXT\n switch (status) {\n case 'UP':\n color = WARNING\n break\n case 'PD':\n color = INFO\n break\n case 'CC':\n color = ERROR\n break\n case 'RJ':\n color = ERROR\n break\n case 'CP':\n color = SUCCESS\n break\n default:\n color = TEXT\n break\n }\n return color\n}\n\nexport enum KycStatus {\n UV = 'UV',\n PD = 'PD',\n VF = 'VF',\n RJ = 'RJ',\n XX = 'XX',\n}\n\nexport function enumFromStringValue(enm: { [s: string]: T }, value: string): T | undefined {\n return (Object.values(enm) as unknown as string[]).includes(value)\n ? (value as unknown as T)\n : undefined\n}\n","const config = {\n mode: (window as any)._env_.mode,\n apiHost: (window as any)._env_.apiHost,\n apimSecret: (window as any)._env_.apimSecret,\n // appClientId: (window as any)._env_.appClientId,\n // apiMsRopcHost: (window as any)._env_.apiMsRopcHost,\n // azureTenantName: (window as any)._env_.azureTenantName,\n // azureTenantId: (window as any)._env_.azureTenantId,\n // azureTokenUrl: (window as any)._env_.azureTokenUrl,\n}\nexport default config\n","import dayjs from 'dayjs'\nimport { Helper } from './helper'\nimport { blake2b } from 'hash-wasm'\nimport { base58 } from './base58'\nimport config from '../config'\n\nexport class ApiHelper {\n static appVersion: string = '1.0'\n static appPlatform: string = 'Browser'\n\n static getIdToken(): string {\n var idToken = Helper.getIdToken()\n return idToken\n }\n\n static async generateApimToken() {\n var apimToken = await this.generateApimTokenCore()\n // mockGenerateApimTokenCore();\n return apimToken.encodeBase58\n }\n\n // static getDeviceInfo() async {\n // DeviceInfoPlugin deviceInfo = DeviceInfoPlugin();\n\n // if (Platform.isIOS) {\n // appPlatform = 'iOS';\n // iosInfo = await deviceInfo.iosInfo;\n // if (iosInfo != null) {\n // print('Running on ${iosInfo!.utsname.machine}'); // e.g. \"iPod7,1\"\n // }\n // }\n // if (Platform.isAndroid) {\n // appPlatform = 'Android';\n // androidInfo = await deviceInfo.androidInfo;\n // if (androidInfo != null) {\n // print('Running on ${androidInfo!.device}'); // e.g. \"Moto G (4)\"\n // }\n // }\n // }\n\n // static getPackageInfo() async {\n // packageInfo = await PackageInfo.fromPlatform();\n\n // if (packageInfo != null) {\n // appName = packageInfo!.appName;\n // packageName = packageInfo!.packageName;\n // appVersion = packageInfo!.version;\n // buildNumber = packageInfo!.buildNumber;\n // }\n // print({\n // \"appName\": appName,\n // \"packageName\": packageName,\n // \"appVersion\": appVersion,\n // \"buildNumber\": buildNumber\n // });\n // }\n\n static async generateApimTokenCore() {\n // APIM_SECRET from env\n const apimSecret = config.apimSecret || ''\n const now = dayjs()\n const calMinute = Math.floor(now.minute() / 5) * 5\n const plainDateTime = dayjs(now).minute(calMinute).startOf('minute')\n // Get second epoch\n const seconds = plainDateTime.unix()\n\n // concat secret\n const plainText = `${apimSecret}${seconds}`\n\n // encode break2b\n // https://www.toolkitbay.com/tkb/tool/BLAKE2b_256\n const encodeBreak2b = await blake2b(plainText, 256)\n\n // encode base58\n /// https://www.appdevtools.com/base58-encoder-decoder\n const encodeBreak2bHex = Buffer.from(encodeBreak2b, 'hex')\n const encodeBase58 = base58.encode(Uint8Array.from(encodeBreak2bHex))\n\n const result = {\n apimSecret,\n now: now.format(),\n plainDateTime: plainDateTime.format(),\n seconds,\n plainText,\n encodeBreak2b,\n encodeBase58: encodeBase58.toString(),\n }\n\n return result\n }\n}\n","export const WHITE = '#FFFFFF'\nexport const PRIMARY = '#004BA6'\nexport const SECONDARY = '#33BDA1'\nexport const PRIMARY_LIGHT = '#99B7DB'\nexport const SECONDARY_LIGHT = '#ADE5D9'\nexport const INFO = '#2172C3'\nexport const SUCCESS = '#2ECC71'\nexport const ERROR = '#E0255F'\nexport const WARNING = '#FFBA00'\nexport const TEXT = '#212121'\nexport const TEXT_DARK = '#888888'\nexport const TEXT_LIGHT = '#BBBBBB'\nexport const BG_DARK = '#E1E1E1'\nexport const BG_LIGHT = '#F5F5F5'\nexport const SOFT_PRIMARY = '#336FB8'\n","import { Button as MuiButton, ButtonProps as MuiButtonProps, Theme } from '@mui/material'\nimport { PropsWithChildren, useMemo } from 'react'\n//import { WHITE_FFFFFF, BLUE_004D99, BLACK_00000D, GRAY_C7C7C7 } from '../../constant/colors'\nimport MuiCircularProgress from '@mui/material/CircularProgress'\nimport { makeStyles } from '@mui/styles'\nimport Roboto from './Roboto'\nimport { BG_LIGHT, PRIMARY, TEXT_DARK, TEXT_LIGHT, WHITE } from '../../constant/colors'\n\ntype StyleAttr = {\n width?: number\n height?: number\n fontSize?: number\n textColor?: string\n disabled?: boolean\n}\n\nconst useStyle = makeStyles({\n root: {\n fontFamily: \"'Roboto', Body Bold\",\n fontWeight: 700,\n fontSize: ({ fontSize = 16 }) => `${fontSize / 16}rem`,\n borderRadius: '16px',\n textTransform: 'none',\n minWidth: 200,\n height: ({ height = 48 }) => `${height / 16}rem`,\n width: ({ width }) => (width ? `${width / 16}rem` : undefined),\n },\n fill: {\n backgroundColor: ({ disabled }) => (disabled ? BG_LIGHT : PRIMARY),\n color: ({ disabled }) => (disabled ? TEXT_LIGHT : WHITE),\n '&:hover': {\n backgroundColor: '#004292',\n },\n },\n border: {\n //backgroundColor: 'transparent',\n color: ({ textColor = PRIMARY }) => textColor,\n border: ({ disabled }) => (disabled ? `2px solid ${TEXT_LIGHT}` : `2px solid ${PRIMARY}`),\n '&:hover': {\n backgroundColor: `#ececec`,\n },\n },\n noBackground: {},\n})\n\ntype ButtonProps = {\n buttonStyle?: 'fill' | 'border' | 'noBackground'\n width?: number\n height?: number\n loading?: boolean\n fontSize?: number\n textColor?: string\n} & MuiButtonProps\n\nconst Button = (props: PropsWithChildren) => {\n const {\n children,\n className = '',\n buttonStyle = 'fill',\n width,\n height,\n loading,\n fontSize = 16,\n textColor,\n disabled,\n ...restProps\n } = props\n const classes = useStyle({ width, height, fontSize, textColor, disabled: props.disabled })\n\n const getTextColor = useMemo(() => {\n if (disabled) {\n return TEXT_LIGHT\n } else {\n if (buttonStyle === 'fill') {\n return WHITE\n } else {\n return PRIMARY\n }\n }\n }, [buttonStyle, disabled])\n\n return loading ? (\n \n \n \n ) : (\n \n \n {children}\n \n \n )\n}\n\nexport default Button\n","import { last } from 'lodash'\nimport { useContext } from 'react'\nimport {\n useInfiniteQuery,\n useMutation,\n useQuery,\n useQueryClient,\n UseQueryOptions,\n} from 'react-query'\nimport { AppCtx } from '../../constant/contexts'\nimport { api } from '../../utils/api'\nimport { Helper, KycStatus, StoreKey, enumFromStringValue } from '../../utils/helper'\nimport {\n ChangeConsentParams,\n ChangeConsentResponse,\n ChangePinParams,\n ChangePinResponse,\n GetHomeResponse,\n NotificationItemResponse,\n NotificationResponse,\n SignOutResponse,\n ToggleNotiResponse,\n} from './home-types'\n\nexport const HOME = 'home'\nexport const HOME_SETTINGS = `${HOME}/settings`\nexport const SIGN_OUT = `${HOME_SETTINGS}/signout`\nexport const CHANGE_CONSENT = `${HOME}/settings/change_consent`\nexport const TOGGLE_NOTIFICATION = `${HOME_SETTINGS}/toggle_notification`\nexport const CURRENT_USER = ``\nexport const NOTIFICATION = `${HOME}/noti`\nexport const NOTIFICATIONREAD = `${NOTIFICATION}/read`\nexport const CHANGE_PIN = `${HOME_SETTINGS}/change_pin`\n\nexport const useGetHome = (options?: UseQueryOptions) => {\n const [, setState] = useContext(AppCtx)\n const queryClient = useQueryClient()\n return useQuery(\n [HOME],\n async () => {\n const { data } = await api.smartSwift.get(`${HOME}`)\n if (data.userInfo) {\n Helper.setEncryptValue(StoreKey.isLogin, true)\n const avatarUrl = data.userInfo.avatarUrl\n const avatarId = avatarUrl && last(avatarUrl.split('/'))\n const kycStatus = enumFromStringValue(KycStatus, data.userInfo.kycStatus)\n setState({\n kycStatus: kycStatus,\n avatarId: avatarId,\n userDisplay: data.userInfo.firstName,\n totalUnreadNoti: data.totalUnreadNoti,\n })\n } else {\n Helper.setEncryptValue(StoreKey.isLogin, false)\n }\n console.log('isLogin', Helper.getEncryptValue(StoreKey.isLogin))\n\n return data\n },\n {\n onSuccess: () => {\n queryClient.invalidateQueries([NOTIFICATION])\n },\n ...options,\n useErrorBoundary: false,\n },\n )\n}\n\nexport const useGetCurrentUser = () => {\n return useQuery(\n [HOME, CURRENT_USER],\n async () => {\n const { data } = await api.smartSwift.get(`${HOME}`)\n return data.userInfo\n },\n {\n cacheTime: 30 * 60 * 1000,\n staleTime: 30 * 60 * 1000,\n },\n )\n}\n\nexport const useGetSignOut = () => {\n const queryClient = useQueryClient()\n const [, setState] = useContext(AppCtx)\n return useMutation(\n async () => {\n const { data } = await api.smartSwift.get(`${SIGN_OUT}`)\n return data\n },\n {\n onSuccess: () => {\n Helper.clearStore()\n setState({ kycStatus: undefined })\n queryClient.invalidateQueries([HOME])\n },\n },\n )\n}\n\nexport const useGetServiceableCountries = (\n options?: UseQueryOptions,\n) => {\n return useQuery(\n [HOME, 'serviceable-countries'],\n async () => {\n const { data } = await api.smartSwift.get(`${HOME}`)\n return data.serviceableCountries\n },\n {\n cacheTime: 30 * 1000,\n staleTime: 30 * 1000,\n useErrorBoundary: false,\n ...options,\n },\n )\n}\n\nexport const useChangeConsent = () => {\n const mutate = useMutation(async (params: ChangeConsentParams) => {\n return await api.smartSwift.post(`${CHANGE_CONSENT}`, params)\n }, {})\n return mutate\n}\n\nexport const useToggleNotification = () => {\n const queryClient = useQueryClient()\n const mutate = useMutation(\n async () => {\n return await api.smartSwift.post(`${TOGGLE_NOTIFICATION}`)\n },\n {\n onSuccess: () => {\n queryClient.invalidateQueries([HOME])\n },\n },\n )\n return mutate\n}\n\nexport const useGetNotifications = () => {\n return useInfiniteQuery(\n [NOTIFICATION],\n async ({ pageParam = 1 }) => {\n const { data } = await api.smartSwift.get(\n `${NOTIFICATION}/${pageParam}`,\n )\n return data\n },\n {\n cacheTime: 0,\n staleTime: 0,\n getNextPageParam: (response) => {\n if (response.data?.meta) {\n const nextPage = response.data?.meta?.currentPage + 1\n if (nextPage <= response.data?.meta?.totalPages) {\n return nextPage\n } else {\n return null\n }\n } else {\n return null\n }\n },\n },\n )\n}\n\nexport const useGetNotificationsItem = (notiId: string) => {\n const queryClient = useQueryClient()\n return useQuery(\n [NOTIFICATIONREAD, notiId],\n async () => {\n const { data } = await api.smartSwift.get(\n `${NOTIFICATIONREAD}/${notiId}`,\n )\n return data\n },\n {\n onSuccess: () => {\n queryClient.invalidateQueries([NOTIFICATION])\n },\n },\n )\n}\n\nexport const useChangePin = () => {\n const queryClient = useQueryClient()\n const mutate = useMutation(\n async (params: ChangePinParams) => {\n return await api.smartSwift.post(`${CHANGE_PIN}`, params)\n },\n {\n onSuccess: () => {\n queryClient.invalidateQueries([HOME])\n },\n },\n )\n return mutate\n}\n"],"sourceRoot":""}