{"version":3,"sources":["i18n.tsx","core/layouts/container/index.tsx","core/context/context.ts","core/layouts/backButtonLayout/styles.ts","core/layouts/backButtonLayout/index.tsx","core/components/ReCAPTCHA/index.tsx","styles/index.tsx","core/api/index.ts","core/api/mobilyOffers/index.ts","core/components/Error/index.tsx","pages/mobilyOffers/CheckNumber/index.tsx","core/components/StringHTML/index.tsx","pages/mobilyOffers/Confirmation/index.tsx","core/components/Text/DescreptionText.tsx","pages/mobilyOffers/VerifyYourNumber/index.tsx","pages/mobilyOffers/index.tsx","routes/index.tsx","core/context/GlobalState.tsx","App.tsx","serviceWorker.ts","index.tsx"],"names":["win","window","lng","storageLanguage","localStorage","getItem","indexOf","i18n","use","XHR","initReactI18next","init","debug","keySeparator","interpolation","escapeValue","backend","loadPath","allowMultiLoading","react","wait","useSuspense","useStyles","makeStyles","theme","createStyles","root","height","FullscreenLayout","props","classes","className","children","React","createContext","_step","_offer","_termsAndCondetionsContent","setTermsAndCondetionsContent","setStep","setOffer","container","breakpoints","down","paddingLeft","spacing","paddingRieght","padding","steps","fontWeight","fontSize","button","marginTop","marginLeft","borderRadius","width","justifyContent","fontStyle","letterSpacing","input","borderColor","withRouter","useTranslation","useHistory","useContext","Context","useTheme","langDir","dir","Grid","style","direction","justify","alignItems","item","xs","Box","mt","pl","pr","recaptchaRef","onChange","process","REACT_APP_GOOGLE_RECAPTCHA","toString","ref","sitekey","display","flexDirection","inputError","color","counter","baseURL","storeBaseURL","token","clientToken","reGenerateTokenUrl","reGenerateToken","storeServerURL","cem_key","config","api","headers","Accept","Authorization","axios","create","console","log","Promise","resolve","reject","fetch","method","then","res","text","result","catch","err","interceptors","request","a","conf","response","status","oldRequest","error","document","location","href","lang","checkEligibility","offer","post","mobile_number","offer_id","sessionStorage","product_id","variation_id","cart_key","checkOTP","opt_code","resendOTP","addItem","quantity","variation","attribute_pa_color","attribute_pa_size","attribute_pa_city","cart_item_data","phone","offerID","productID","variationID","hasTerms","hasMultipleDiscount","discountChoosen","discountIndex","is_per_product_discount","per_product_discount_id","mobilyOffers","confirmTermsAndConditions","get","ErrorComponent","customError","errors","name","patternMessage","minLength","maxLength","t","Typography","component","render","type","createRef","history","context","useForm","handleSubmit","watch","control","mobile","clearErrors","getValues","isRTL","step","useState","trialCount","setTrialCount","sm","onClick","goBack","blue","cursor","variant","mb","lg","onSubmit","data","payload","cart","JSON","parse","cartIntialValue","uuid","setItem","stringify","createCartKey","valid_phone","finally","noValidate","autoComplete","id","InputProps","startAdornment","InputAdornment","position","as","TextField","defaultValue","fullWidth","InputLabelProps","shrink","rules","required","pattern","label","Button","disabled","endIcon","mr","ReCAPTCHA","value","current","reset","StringHTML","dangerouslySetInnerHTML","__html","stringHtml","setValue","accept_check","storeCartUrl","storeCartURL","useEffect","strBoolean","replace","addItemPayload","variations","item_meta","checked","String","toLowerCase","Checkbox","OfferTitle","DescreptionText","verification_code","terms_content","palette","secondary","main","Routes","path","MobilyOffers","GlobalState","state","setState","this","Provider","Component","apptheme","createMuiTheme","shadows","Array","fill","typography","fontFamily","primary","light","dark","contrastThreshold","App","body","setAttribute","jss","plugins","jssPreset","rtl","StylesProvider","ThemeProvider","Boolean","hostname","match","ReactDOM","StrictMode","fallback","getElementById","navigator","serviceWorker","ready","registration","unregister","message"],"mappings":"iQAGMA,EAAWC,OAGbC,EAAyC,MAAfF,EAAG,KAAmB,KAAOA,EAAG,KAKxDG,EAAkBC,aAAaC,QAAQ,YACzCF,GAPqB,CAAC,KAAM,MAOQG,QAAQH,IAAoB,IAChED,EAAMF,EAAG,MAGbO,IAAKC,IAAIC,KACJD,IAAIE,KACJC,KAAK,CACFT,MACAU,OAAO,EACPC,cAAc,EACdC,cAAe,CACXC,aAAa,GAEjBC,QAAS,CAELC,SAAU,8DAEVC,mBAAmB,GAEvBC,MAAO,CACHC,MAAM,EACNC,aAAa,KAIVd,EAAf,EAAeA,I,gGCjCTe,EAAYC,aAAW,SAACC,GAAD,OACzBC,YAAa,CACTC,KAAM,CACFC,OAAQ,aAK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H,SAAS2J,KAAKC,aAAa,MAAOlG,GAAQ,MAAQ,OAClD,IAAMmG,EAAMnG,GACRhF,YAAO,CAAEoL,QAAQ,GAAD,mBAAMC,cAAYD,SAAlB,CAA2BE,UAC3CtL,YAAO,CAAEoL,QAAQ,YAAKC,cAAYD,WAEtC,OACE,kBAAC,GAAD,KACE,kBAACG,EAAA,EAAD,CAAgBJ,IAAKA,GACnB,kBAACK,EAAA,EAAD,CAAe1Q,MAAOuP,IACpB,kBAAC,GAAD,S,cChDUoB,QACa,cAA7BlS,OAAOgI,SAASmK,UAEiB,UAA7BnS,OAAOgI,SAASmK,UAEhBnS,OAAOgI,SAASmK,SAASC,MAAM,2DCVvCC,IAASxH,OACL,kBAAC,IAAMyH,WAAP,KACI,kBAAC,WAAD,CAAUC,SAAU,+BAChB,kBAACd,GAAD,QAGR1J,SAASyK,eAAe,SDoHpB,kBAAmBC,WACnBA,UAAUC,cAAcC,MACnB1L,MAAK,SAAC2L,GACHA,EAAaC,gBAEhBxL,OAAM,SAACS,GACJpB,QAAQoB,MAAMA,EAAMgL,c","file":"static/js/main.c63eecc3.chunk.js","sourcesContent":["import i18n from 'i18next';\r\nimport { initReactI18next } from 'react-i18next';\r\nimport XHR from 'i18next-xhr-backend';\r\nconst win: any = window;\r\n\r\nconst allowedLanguages = ['en', 'ar'];\r\nlet lng: string | undefined = win['lang'] == null ? 'en' : win['lang'];\r\n// window.lang == null ? 'en':window.lang\r\n// let lng = 'ar';\r\n// console.log(lng);\r\n\r\nconst storageLanguage = localStorage.getItem('language');\r\nif (storageLanguage && allowedLanguages.indexOf(storageLanguage) > -1) {\r\n lng = win['lang'];\r\n}\r\n\r\ni18n.use(XHR)\r\n .use(initReactI18next)\r\n .init({\r\n lng,\r\n debug: true,\r\n keySeparator: false,\r\n interpolation: {\r\n escapeValue: false,\r\n },\r\n backend: {\r\n // loadPath: '/translations/{{lng}}.json',\r\n loadPath: '/.store.offers.ui/react-app/build/translations/{{lng}}.json',\r\n\r\n allowMultiLoading: true,\r\n },\r\n react: {\r\n wait: true,\r\n useSuspense: true,\r\n },\r\n });\r\n\r\nexport default i18n;\r\n","import React, { Props } from 'react';\r\n\r\nimport { makeStyles, createStyles, Theme } from '@material-ui/core/styles';\r\n\r\nconst useStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n root: {\r\n height: 'auto',\r\n },\r\n }),\r\n);\r\n\r\nexport const FullscreenLayout = (props: Props) => {\r\n const classes = useStyles();\r\n return
{props.children}
;\r\n};\r\n","/* eslint-disable @typescript-eslint/no-empty-function */\r\n/* eslint-disable @typescript-eslint/no-unused-vars */\r\nimport React from 'react';\r\nimport { OfferProps } from 'core/models';\r\n\r\nexport default React.createContext({\r\n _step: 1,\r\n _offer: {} as OfferProps,\r\n _termsAndCondetionsContent: '',\r\n setTermsAndCondetionsContent: (_termsAndCondetionsContent: string) => {},\r\n setStep: (_step: number) => {},\r\n setOffer: (_offer: OfferProps) => {},\r\n});\r\n","import { makeStyles, createStyles, Theme } from '@material-ui/core/styles';\r\n\r\nexport const useStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n root: {\r\n height: 'auto',\r\n },\r\n container: {\r\n [theme.breakpoints.down('xs')]: {\r\n paddingLeft: theme.spacing(0),\r\n paddingRieght: theme.spacing(0),\r\n\r\n padding: theme.spacing(0),\r\n },\r\n },\r\n steps: {\r\n fontWeight: 400,\r\n fontSize: theme.spacing(1),\r\n },\r\n button: {\r\n marginTop: theme.spacing(5),\r\n marginLeft: 0,\r\n borderRadius: 20,\r\n width: 240,\r\n justifyContent: 'space-between',\r\n height: 40,\r\n fontWeight: 700,\r\n fontStyle: 'normal',\r\n fontSize: theme.spacing(1.5),\r\n letterSpacing: '0.8px',\r\n },\r\n input: {\r\n fontSize: theme.spacing(1),\r\n '& .MuiInput-underline:after': {\r\n borderColor: '#D5D8DF',\r\n },\r\n '& .MuiInput-underline:before': {\r\n borderColor: '#D5D8DF',\r\n },\r\n },\r\n }),\r\n);\r\n","import React, { useContext } from 'react';\r\n\r\nimport { withRouter, useHistory } from 'react-router-dom';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { FullscreenLayout } from 'core/layouts/container';\r\nimport Grid from '@material-ui/core/Grid';\r\nimport { useTheme } from '@material-ui/core/styles';\r\nimport Box from '@material-ui/core/Box';\r\nimport Context from 'core/context/context';\r\nimport { useStyles } from './styles';\r\n\r\nconst BackButtonLayout = (props: React.PropsWithChildren) => {\r\n const { children } = props;\r\n const { i18n } = useTranslation();\r\n const history = useHistory();\r\n const context = useContext(Context);\r\n const classes = useStyles();\r\n const theme = useTheme();\r\n const win: any = window;\r\n const langDir = i18n.dir(win['lang'] as string);\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n {children}\r\n \r\n \r\n \r\n \r\n );\r\n};\r\nexport default withRouter(BackButtonLayout);\r\n","/* eslint-disable react/display-name */\r\nimport React from \"react\";\r\nimport ReCAPTCHA from \"react-google-recaptcha\";\r\ninterface RecaptchaProps {\r\n recaptchaRef: any;\r\n onChange(value: any): void;\r\n}\r\nexport default (props: RecaptchaProps) => {\r\n const { recaptchaRef, onChange } = props;\r\n const key:\r\n | string\r\n | undefined = process.env.REACT_APP_GOOGLE_RECAPTCHA?.toString();\r\n\r\n return (\r\n \r\n );\r\n};\r\n","import { makeStyles, createStyles, Theme } from '@material-ui/core/styles';\r\n\r\nexport const useStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n root: {\r\n height: 'auto',\r\n },\r\n container: {\r\n [theme.breakpoints.down('xs')]: {\r\n marginLeft: theme.spacing(0),\r\n padding: theme.spacing(2),\r\n },\r\n },\r\n steps: {\r\n fontWeight: 400,\r\n fontSize: theme.spacing(1),\r\n },\r\n button: {\r\n marginTop: theme.spacing(5),\r\n marginLeft: 0,\r\n borderRadius: '40px !important',\r\n justifyContent: 'space-between',\r\n height: 40,\r\n fontWeight: 700,\r\n fontStyle: 'normal',\r\n fontSize: theme.spacing(1.5),\r\n letterSpacing: '0.8px',\r\n },\r\n input: {\r\n '& .MuiInput-root': {\r\n '& .MuiInputAdornment-root': {\r\n display: 'none',\r\n },\r\n flexDirection: 'row-reverse',\r\n },\r\n fontSize: theme.spacing(1),\r\n '& .MuiInput-underline:after': {\r\n borderColor: '#D5D8DF',\r\n },\r\n '& .MuiInput-underline:before': {\r\n borderColor: '#D5D8DF',\r\n },\r\n },\r\n inputError: {\r\n '& .MuiInput-root': {\r\n flexDirection: 'row-reverse',\r\n '& .MuiInputAdornment-root': {\r\n display: 'flex',\r\n },\r\n },\r\n '& .MuiInputLabel-formControl': {\r\n color: 'red',\r\n },\r\n '& .MuiInput-underline:after': {\r\n borderColor: 'red',\r\n },\r\n '& .MuiInput-underline:before': {\r\n borderColor: 'red',\r\n },\r\n },\r\n }),\r\n);\r\n","/* eslint-disable prefer-const */\r\nimport axios from \"axios\";\r\nimport https from \"https\";\r\n// window.storeBaseURL = \"https://api.mobily.com.sa/apis/eshop\";\r\n// window.clientToken = \"Rk0yCcuZYA9BXDoiynatuAv3GYF0\";\r\n// window.reGenerateToken =\r\n// \"/wps/portal/web/personal/store/track-order/!ut/p/z1/jZDJDoIwFEW_xS_obWkYlqWQMCmWBsRuTFcGo2iM8ftloQuJIG_3knPuG4ghLTG9fXZH--iuvT0P_d64h5TmMsk42_puA6goCDKxAc01JbtvoETlQCU85FKWzEkZMUt8V0UxctABgA9VFzL01x6F8Jb5mCiB_74ZIZWIoAo0ShcRjbX3BqZWZGyc8OMHswniM2LmCm3v5Hap6xZdeuJi9QK-OGib/dz/d5/L2dBISEvZ0FBIS9nQSEh/p0/IZ7_6A52G301P02H10QT8H4TPI00T7=CZ6_I1KCHJ42P86V00QD99JAN01KS1=NJreGenerateToken=/\";\r\n// window.lang = \"en\";\r\nvar counter = 0;\r\nconst baseURL = window.storeBaseURL;\r\nvar token = window.clientToken;\r\nvar reGenerateTokenUrl = window.reGenerateToken;\r\nvar storeServerURL = window.storeServerURL;\r\nconst win: any = window;\r\nconst cem_key = win[\"CEM_KEY\"];\r\n\r\nlet config = {\r\n api: {\r\n // httpsAgent: new https.Agent({\r\n // rejectUnauthorized: false,\r\n // }),\r\n // crossdomain: true,\r\n\r\n baseURL: baseURL,\r\n headers: {\r\n Accept: \"application/json\",\r\n \"Content-Type\": \"application/json\",\r\n // auth: {\r\n // username: process.env.REACT_APP_CONSUMER_KEY,\r\n // password: process.env.REACT_APP_CONSUMER_SECRET,\r\n // },\r\n Authorization: \"\",\r\n \"cem-key\": cem_key,\r\n },\r\n },\r\n};\r\n\r\nexport const api = axios.create({ ...config.api });\r\n\r\napi.interceptors.request.use(\r\n async (conf: any) => {\r\n conf.headers.Authorization = \"Bearer \" + token;\r\n conf.headers[\"cem-key\"] = cem_key;\r\n return conf;\r\n },\r\n (err) => {\r\n console.log(\"error in getting \", err);\r\n }\r\n);\r\n\r\napi.interceptors.response.use(\r\n async (response: any) => {\r\n if (response.status && response.status === 401) {\r\n counter++;\r\n token = await reGenerateToken();\r\n const { config: oldRequest } = response;\r\n if (counter < 2) return api.request({ ...oldRequest });\r\n }\r\n\r\n return response;\r\n },\r\n async (error: any) => {\r\n document.location.href = `/wps/portal/web/personal/store/error?errorSource=${\r\n window.lang === \"en\" ? \"Store\" : \"المتجر\"\r\n }`;\r\n return error;\r\n }\r\n);\r\n\r\nfunction reGenerateToken() {\r\n console.log(\"reGenerateToken :: Enter\");\r\n console.log(\"reGenerateTokenUrl => \" + reGenerateTokenUrl);\r\n\r\n return new Promise((resolve, reject) => {\r\n fetch(storeServerURL + \"\" + reGenerateTokenUrl, {\r\n method: \"GET\",\r\n headers: {\r\n \"Content-type\": \"text/html; charset=UTF-8\",\r\n \"cem-key\": cem_key,\r\n },\r\n })\r\n .then((res) => res.text())\r\n\r\n .then((result) => {\r\n //console.log(\"Token res -> \"+result);\r\n resolve(result);\r\n })\r\n .catch((err) => {\r\n //console.log(err);\r\n reject(err);\r\n });\r\n });\r\n}\r\n\r\nexport * from \"./mobilyOffers\";\r\n","import { api } from \"../index\";\r\nimport { OfferProps, AddItemProps } from \"core/models\";\r\nconst checkEligibility = async (offer: OfferProps) =>\r\n await api.post(\r\n `/wp-json/cocart/v1/offer/check_eligibility?lang=` + window.lang,\r\n {\r\n mobile_number: offer.mobile_number,\r\n offer_id: window.sessionStorage.offer_id,\r\n product_id: window.sessionStorage.product_id,\r\n variation_id: window.sessionStorage.variation_id,\r\n cart_key: offer.cart_key,\r\n }\r\n );\r\n\r\nconst checkOTP = async (offer: OfferProps) =>\r\n await api.post(`/wp-json/cocart/v1/offer/validate_otp?lang=` + window.lang, {\r\n mobile_number: offer.mobile_number,\r\n offer_id: window.sessionStorage.offer_id,\r\n product_id: window.sessionStorage.product_id,\r\n opt_code: offer.opt_code,\r\n });\r\n\r\nconst resendOTP = async (offer: OfferProps) =>\r\n await api.post(`/wp-json/cocart/v1/offer/resend_otp?lang=` + window.lang, {\r\n mobile_number: offer.mobile_number,\r\n offer_id: window.sessionStorage.offer_id,\r\n product_id: window.sessionStorage.product_id,\r\n });\r\nconst addItem = async (item: AddItemProps, cart_key: string) =>\r\n await api.post(\r\n `/wp-json/cocart/v1/add-item?lang= ${window.lang}&cart_key=${cart_key}`,\r\n {\r\n product_id: item.product_id,\r\n quantity: item.quantity,\r\n variation_id: item.variation_id,\r\n variation: {\r\n attribute_pa_color: item.variation.attribute_pa_color,\r\n attribute_pa_size: item.variation.attribute_pa_size,\r\n attribute_pa_city: item.variation.attribute_pa_city,\r\n },\r\n cart_item_data: {\r\n phone: item.cart_item_data.phone,\r\n offerID: item.cart_item_data.offerID,\r\n productID: item.cart_item_data.productID,\r\n variationID: item.cart_item_data.variationID,\r\n hasTerms: item.cart_item_data.hasTerms,\r\n hasMultipleDiscount: item.cart_item_data.hasMultipleDiscount,\r\n discountChoosen: item.cart_item_data.discountChoosen,\r\n discountIndex: item.cart_item_data.discountIndex,\r\n is_per_product_discount: item.cart_item_data.is_per_product_discount,\r\n per_product_discount_id: item.cart_item_data.per_product_discount_id,\r\n },\r\n }\r\n );\r\nconst confirmTermsAndConditions = async (offer: OfferProps) =>\r\n await api.get(\r\n `/wp-json/cocart/v1/offer/item_meta?lang=${window.lang}&offer_id=${window.sessionStorage.offer_id}&mobile_number=${offer.mobile_number}&product_id=${window.sessionStorage.product_id}`\r\n );\r\n\r\nexport const mobilyOffers = {\r\n checkEligibility,\r\n checkOTP,\r\n resendOTP,\r\n confirmTermsAndConditions,\r\n addItem,\r\n};\r\n","import React from \"react\";\r\nimport { ErrorMessage } from \"@hookform/error-message\";\r\nimport { Typography } from \"@material-ui/core\";\r\nimport { useTheme } from \"@material-ui/core/styles\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport Box from \"@material-ui/core/Box\";\r\n\r\ninterface ErrorProps {\r\n name: string;\r\n customError?: boolean;\r\n errors?: any;\r\n nameLang?: string;\r\n maxLength?: number;\r\n minLength?: number;\r\n patternMessage?: string;\r\n}\r\nconst ErrorComponent = (props: ErrorProps) => {\r\n const {\r\n customError,\r\n errors,\r\n name,\r\n minLength,\r\n maxLength,\r\n patternMessage,\r\n } = props;\r\n const { t, i18n } = useTranslation();\r\n const theme = useTheme();\r\n return !customError ? (\r\n (\r\n \r\n \r\n {errors[name]?.type === \"maxLength\"\r\n ? //? maxLength + \" you rechied the max number\"\r\n t(\"max_length\")\r\n : errors[name]?.type === \"minLength\"\r\n ? //? \"the minimum length is \" + minLength\r\n t(\"min_length\")\r\n : errors[name]?.type === \"required\"\r\n ? t(\"field_required\")\r\n : errors[name]?.type === \"pattern\"\r\n ? patternMessage\r\n : \"\"}\r\n \r\n \r\n )}\r\n />\r\n ) : (\r\n \r\n \r\n {patternMessage}\r\n \r\n \r\n );\r\n};\r\nexport { ErrorComponent };\r\n","import React, { useContext, useState, useEffect } from \"react\";\r\nimport { withRouter, useHistory, RouteComponentProps } from \"react-router-dom\";\r\nimport { useForm, Controller, ErrorOption } from \"react-hook-form\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport InputAdornment from \"@material-ui/core/InputAdornment\";\r\nimport ErrorIcon from \"@material-ui/icons/Error\";\r\nimport ReCAPTCHA from \"core/components/ReCAPTCHA\";\r\nimport { Typography } from \"@material-ui/core\";\r\nimport Grid from \"@material-ui/core/Grid\";\r\nimport TextField from \"@material-ui/core/TextField\";\r\nimport Button from \"@material-ui/core/Button\";\r\nimport { useTheme } from \"@material-ui/core/styles\";\r\nimport { blue } from \"@material-ui/core/colors\";\r\nimport Box from \"@material-ui/core/Box\";\r\nimport ArrowBackIcon from \"@material-ui/icons/ArrowBack\";\r\nimport ArrowForwardIcon from \"@material-ui/icons/ArrowForward\";\r\nimport { uuid } from \"uuidv4\";\r\n\r\nimport Context from \"core/context/context\";\r\nimport { useStyles } from \"styles\";\r\nimport { mobilyOffers } from \"core/api/mobilyOffers\";\r\nimport { OfferProps } from \"core/models\";\r\nimport { ErrorComponent } from \"core/components/Error\";\r\n\r\nconst recaptchaRef: any = React.createRef();\r\n\r\ntype Inputs = {\r\n mobile: number;\r\n};\r\ninterface Props {\r\n step: number;\r\n}\r\nconst CheckNumber = (\r\n props: React.PropsWithChildren\r\n) => {\r\n const { t, i18n } = useTranslation();\r\n const langDir = i18n.dir(window.lang as string);\r\n const history = useHistory();\r\n const context = useContext(Context);\r\n const classes = useStyles();\r\n const theme = useTheme();\r\n const {\r\n handleSubmit,\r\n watch,\r\n errors,\r\n control,\r\n clearErrors,\r\n getValues,\r\n } = useForm();\r\n const { mobile } = watch();\r\n const isRTL = langDir === \"rtl\";\r\n const { step } = props;\r\n const [trialCount, setTrialCount] = useState(0);\r\n const createCartKey = () => {\r\n let cart_key = \"\";\r\n let cart = JSON.parse(localStorage.getItem(\"cart\") + \"\");\r\n if (cart === [] || cart === null) {\r\n let cartIntialValue = [{ cart_key: \"\" }];\r\n cart_key = uuid();\r\n cartIntialValue[0].cart_key = cart_key;\r\n localStorage.setItem(\"cartKey\", cart_key);\r\n localStorage.setItem(\"cart\", JSON.stringify(cartIntialValue));\r\n } else {\r\n cart_key = cart[0].cart_key;\r\n }\r\n return cart_key;\r\n };\r\n const onSubmit = (data: any) => {\r\n if (trialCount >= 3) {\r\n return null;\r\n } else {\r\n setTrialCount(trialCount + 1);\r\n }\r\n const payload: OfferProps = {\r\n mobile_number: data.mobile,\r\n offer_id: window.sessionStorage.offer_id,\r\n product_id: window.sessionStorage.product_id,\r\n variation_id: window.sessionStorage.variation_id,\r\n };\r\n payload.cart_key = createCartKey();\r\n context.setOffer({ ...context._offer, ...payload });\r\n mobilyOffers\r\n .checkEligibility(payload)\r\n .then((res) => {\r\n console.log(\"valid_phon\", res.data.valid_phone);\r\n context.setOffer({\r\n ...context._offer,\r\n mobile_number: res.data.valid_phone,\r\n });\r\n context.setStep(2);\r\n })\r\n .catch(function (error) {\r\n console.log(error);\r\n })\r\n .finally(() => console.log(\"done\"));\r\n };\r\n\r\n const onChange = (value: any) => {\r\n setTrialCount(0);\r\n recaptchaRef.current.reset();\r\n };\r\n\r\n return (\r\n <>\r\n \r\n \r\n {!isRTL ? (\r\n history.goBack()}\r\n style={{ color: blue[500], cursor: \"pointer\" }}\r\n fontWeight={\"fontWeightBold\"}\r\n fontSize={\"large\"}\r\n />\r\n ) : (\r\n history.goBack()}\r\n style={{ color: blue[500], cursor: \"pointer\" }}\r\n fontWeight={\"fontWeightBold\"}\r\n fontSize={\"large\"}\r\n />\r\n )}\r\n\r\n \r\n \r\n {t(\"Check_number\")}\r\n \r\n \r\n {t(\"STEP\")} {step}\r\n  {t(\"OF\")}   3\r\n \r\n \r\n \r\n \r\n \r\n {t(\"First,_enter_your_mobile_number\")}\r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n ),\r\n }}\r\n as={TextField}\r\n defaultValue={\"\"}\r\n control={control}\r\n name=\"mobile\"\r\n type={\"number\"}\r\n fullWidth\r\n InputLabelProps={{ shrink: true }}\r\n rules={{\r\n required: true,\r\n pattern: `(?=^.{10,12}$)(?=^(05)|(9665))` as any,\r\n }}\r\n label={t(\"Mobile_Number\")}\r\n />\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {t(\"verify_number_instruction\")}\r\n \r\n \r\n \r\n \r\n \r\n ) : (\r\n \r\n )\r\n }\r\n >\r\n \r\n {t(\"verify_number\")}\r\n \r\n \r\n {trialCount >= 3 && (\r\n \r\n )}\r\n \r\n
\r\n \r\n );\r\n};\r\n\r\nexport default withRouter(CheckNumber);\r\n","import React from 'react';\r\n\r\ninterface StringHTMLProps {\r\n stringHtml: string;\r\n}\r\nconst StringHTML = (props: StringHTMLProps) =>
;\r\n\r\nexport default StringHTML;\r\n","import React, { useContext, useEffect } from \"react\";\r\nimport { withRouter, RouteComponentProps } from \"react-router-dom\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { uuid } from \"uuidv4\";\r\n\r\nimport { useForm, Controller } from \"react-hook-form\";\r\nimport { Typography } from \"@material-ui/core\";\r\nimport Grid from \"@material-ui/core/Grid\";\r\nimport Checkbox from \"@material-ui/core/Checkbox\";\r\nimport Button from \"@material-ui/core/Button\";\r\nimport { useTheme } from \"@material-ui/core/styles\";\r\nimport { blue } from \"@material-ui/core/colors\";\r\nimport Box from \"@material-ui/core/Box\";\r\nimport ArrowBackIcon from \"@material-ui/icons/ArrowBack\";\r\nimport ArrowForwardIcon from \"@material-ui/icons/ArrowForward\";\r\nimport Context from \"core/context/context\";\r\nimport { useStyles } from \"styles\";\r\n\r\nimport { mobilyOffers } from \"core/api\";\r\nimport StringHTML from \"core/components/StringHTML\";\r\ntype Inputs = {\r\n accept_check: boolean;\r\n};\r\ninterface Props {\r\n step: number;\r\n}\r\nconst Confirmation = (\r\n props: React.PropsWithChildren\r\n) => {\r\n const { t, i18n } = useTranslation();\r\n const langDir = i18n.dir(window.lang as string);\r\n const isRTL = langDir === \"rtl\";\r\n\r\n const { step } = props;\r\n const context = useContext(Context);\r\n const classes = useStyles();\r\n const theme = useTheme();\r\n const { handleSubmit, watch, control, setValue } = useForm();\r\n const { accept_check } = watch();\r\n const strToBoolean = (strBoolean: string): boolean =>\r\n String(strBoolean).toLowerCase() == \"true\";\r\n\r\n const storeCartUrl = window.storeCartURL;\r\n useEffect(() => {\r\n console.log(context._termsAndCondetionsContent);\r\n }, []);\r\n const createCartKey = () => {\r\n let cart_key = \"\";\r\n let cart = JSON.parse(localStorage.getItem(\"cart\") + \"\");\r\n if (cart === [] || cart === null) {\r\n let cartIntialValue = [{ cart_key: \"\" }];\r\n cart_key = uuid();\r\n cartIntialValue[0].cart_key = cart_key;\r\n localStorage.setItem(\"cartKey\", cart_key);\r\n localStorage.setItem(\"cart\", JSON.stringify(cartIntialValue));\r\n } else {\r\n cart_key = cart[0].cart_key;\r\n }\r\n return cart_key;\r\n };\r\n const onSubmit = (data: any) => {\r\n mobilyOffers.confirmTermsAndConditions(context._offer).then((res: any) => {\r\n const addItemPayload = {\r\n ...res.data,\r\n variation: res.data.variations,\r\n quantity: 1,\r\n cart_item_data: res.data.item_meta,\r\n };\r\n mobilyOffers.addItem(addItemPayload, createCartKey()).then((res) => {\r\n document.location.href = storeCartUrl;\r\n });\r\n });\r\n };\r\n const goBack = () => {\r\n context.setStep(2);\r\n };\r\n\r\n return (\r\n <>\r\n \r\n \r\n {!isRTL ? (\r\n \r\n ) : (\r\n \r\n )}\r\n \r\n {/* */}\r\n {/*//TODO add content from server */}\r\n </Grid>\r\n </Grid>\r\n <StringHTML\r\n stringHtml={context._termsAndCondetionsContent.replace(\"\\n\", \"\")}\r\n ></StringHTML>\r\n\r\n {/* <Grid container direction=\"column\">\r\n <Grid item sm={3} xs={12}>\r\n <OfferInfo />\r\n </Grid>\r\n </Grid> */}\r\n {/* <DescreptionText\r\n text={\r\n 'Note: There are other discounts (5400 SAR with 18 months commitment, and 7200 SAR with 24 months commitment) available on Mobily branches and will be available soon through Mobily online shop.'\r\n }\r\n ></DescreptionText>\r\n\r\n <Title mb={2} mt={5} text={'Terms and conditions'}>\r\n \r\n */}\r\n\r\n
\r\n \r\n \r\n {\r\n setValue(\"accept_check\", !!!accept_check);\r\n }}\r\n />\r\n }\r\n // onChange={() => {}}\r\n control={control}\r\n defaultValue={false}\r\n name={\"accept_check\"}\r\n id={\"accept_check\"}\r\n />\r\n \r\n \r\n {t(\"I_accept_the_terms_and_conditions\")}\r\n \r\n \r\n \r\n \r\n ) : (\r\n \r\n )\r\n }\r\n >\r\n \r\n {t(\"ADD_to_cart\")}\r\n \r\n \r\n \r\n
\r\n \r\n );\r\n};\r\nexport default withRouter(Confirmation);\r\n\r\nconst OfferTitle = () => {\r\n const { t, i18n } = useTranslation();\r\n const context = useContext(Context);\r\n const theme = useTheme();\r\n return (\r\n \r\n \r\n {t(\"Confirmation\")}\r\n \r\n \r\n {t(\"STEP\")} {context._step}\r\n  {t(\"OF\")}   3\r\n \r\n \r\n );\r\n};\r\ninterface TextProps {\r\n text: string;\r\n mb?: number;\r\n mt?: number;\r\n}\r\nconst Title = (props: TextProps) => {\r\n const { text, mb, mt } = props;\r\n const theme = useTheme();\r\n return (\r\n \r\n \r\n \r\n {text}\r\n \r\n \r\n \r\n );\r\n};\r\n\r\ninterface CheckboxProps {\r\n checked: boolean;\r\n onToggleChecked?(checked: boolean): void;\r\n control: any;\r\n register: any;\r\n name: any;\r\n [propName: string]: any;\r\n}\r\n// const TermsAndConditionsCheck = (props: CheckboxProps) => {\r\n// const { checked, onToggleChecked, control, register, name } = props;\r\n// const classes = useStyles();\r\n// const theme = useTheme();\r\n// console.log(checked);\r\n// return (\r\n// \r\n// }\r\n// control={control}\r\n// name={name}\r\n// ref={register({ required: 'This is required' })}\r\n// id={name}\r\n// />\r\n// \r\n// \r\n// {'I accept the terms and conditions'}\r\n// \r\n// \r\n// \r\n// );\r\n// };\r\n","import React, { useContext, useState } from \"react\";\r\n\r\nimport { Typography } from \"@material-ui/core\";\r\n\r\nimport { useTheme } from \"@material-ui/core/styles\";\r\n\r\nimport Box from \"@material-ui/core/Box\";\r\n\r\ninterface TextProps {\r\n text: string;\r\n mb?: number;\r\n mt?: number;\r\n fontSize?: number;\r\n children?: any;\r\n style?: any;\r\n}\r\nexport const DescreptionText = (props: TextProps) => {\r\n const { text, mt, mb, fontSize, children, style } = props;\r\n const theme = useTheme();\r\n\r\n return (\r\n \r\n \r\n {text}  {children}\r\n \r\n \r\n );\r\n};\r\n","import React, { useContext, useState, useEffect } from \"react\";\r\nimport { useTranslation } from \"react-i18next\";\r\n\r\nimport { withRouter, useHistory, RouteComponentProps } from \"react-router-dom\";\r\nimport { useForm, Controller } from \"react-hook-form\";\r\nimport { Typography } from \"@material-ui/core\";\r\nimport Grid from \"@material-ui/core/Grid\";\r\nimport TextField from \"@material-ui/core/TextField\";\r\nimport Button from \"@material-ui/core/Button\";\r\nimport { useTheme } from \"@material-ui/core/styles\";\r\nimport { blue } from \"@material-ui/core/colors\";\r\nimport Box from \"@material-ui/core/Box\";\r\nimport ArrowBackIcon from \"@material-ui/icons/ArrowBack\";\r\nimport ArrowForwardIcon from \"@material-ui/icons/ArrowForward\";\r\nimport Context from \"core/context/context\";\r\nimport { useStyles } from \"styles\";\r\nimport { DescreptionText } from \"core/components/Text/DescreptionText\";\r\nimport { mobilyOffers } from \"core/api/mobilyOffers\";\r\nimport { OfferProps } from \"core/models\";\r\nimport { ErrorComponent } from \"core/components/Error\";\r\n\r\ntype Inputs = {\r\n verification_code: number;\r\n};\r\ninterface Props {\r\n step: number;\r\n}\r\n\r\nconst VerifyYourNumber = (\r\n props: React.PropsWithChildren\r\n) => {\r\n const { t, i18n } = useTranslation();\r\n const langDir = i18n.dir(window.lang as string);\r\n const isRTL = langDir === \"rtl\";\r\n\r\n const { step } = props;\r\n const history = useHistory();\r\n const context = useContext(Context);\r\n const classes = useStyles();\r\n const theme = useTheme();\r\n const { handleSubmit, errors, control } = useForm();\r\n const goBack = () => context.setStep(1);\r\n\r\n const onSubmit = (data: Inputs) => {\r\n context.setOffer({ ...context._offer, opt_code: data.verification_code });\r\n console.log({ ...context._offer, opt_code: data.verification_code });\r\n mobilyOffers\r\n .checkOTP({ ...context._offer, opt_code: data.verification_code })\r\n .then((res: any) => {\r\n const terms_content = res?.data?.terms_content\r\n ? res?.data?.terms_content\r\n : \"\";\r\n console.log(\"terms_content\", terms_content);\r\n context.setTermsAndCondetionsContent(terms_content);\r\n context.setStep(3);\r\n })\r\n .catch(function (error) {\r\n if (error.response) {\r\n }\r\n })\r\n .finally(() => {\r\n console.log(\"done\");\r\n });\r\n };\r\n\r\n const resendCode = () => {\r\n mobilyOffers\r\n .resendOTP(context._offer)\r\n .then()\r\n .catch()\r\n .finally(() => console.log(\"done\"));\r\n };\r\n\r\n return (\r\n <>\r\n \r\n \r\n {!isRTL ? (\r\n goBack()}\r\n style={{ color: blue[500], cursor: \"pointer\" }}\r\n fontWeight={\"fontWeightBold\"}\r\n fontSize={\"large\"}\r\n />\r\n ) : (\r\n goBack()}\r\n style={{ color: blue[500], cursor: \"pointer\" }}\r\n fontWeight={\"fontWeightBold\"}\r\n fontSize={\"large\"}\r\n />\r\n )}\r\n\r\n \r\n \r\n {t(\"Verify_your_number\")}\r\n \r\n \r\n {t(\"STEP\")} {step}\r\n  {t(\"OF\")} 3\r\n \r\n \r\n \r\n \r\n \r\n {t(\"Enter_the_OTP_you_have_just_received\")}\r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n {t(\"RESEND_CODE\")}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n ) : (\r\n \r\n )\r\n }\r\n >\r\n {t(\"ADD_to_cart\")}\r\n \r\n \r\n
\r\n \r\n );\r\n};\r\nexport default withRouter(VerifyYourNumber);\r\n","import React, { useContext } from 'react';\r\nimport { withRouter } from 'react-router-dom';\r\nimport BackButtonLayout from 'core/layouts/backButtonLayout';\r\nimport Context from 'core/context/context';\r\nimport CheckNumber from './CheckNumber';\r\nimport Confirmation from './Confirmation';\r\nimport VerifyYourNumber from './VerifyYourNumber';\r\n\r\nconst MobilyOffers = (props: React.PropsWithChildren) => {\r\n const context = useContext(Context);\r\n\r\n return (\r\n \r\n {context._step === 1 && }\r\n {context._step === 2 && }\r\n {context._step === 3 && }\r\n \r\n );\r\n};\r\nexport default withRouter(MobilyOffers);\r\n","import React from 'react';\r\nimport { MobilyOffers } from 'pages';\r\nimport { BrowserRouter as Router, Switch, Route, Link } from 'react-router-dom';\r\n\r\nexport const Routes = () => {\r\n return (\r\n \r\n \r\n \r\n {/* */}\r\n \r\n \r\n );\r\n};\r\n","/* eslint-disable react/prop-types */\r\nimport React from 'react';\r\nimport Context from './context';\r\nimport { OfferProps } from 'core/models';\r\nexport default class GlobalState extends React.Component {\r\n state = {\r\n _step: 1,\r\n _offer: {},\r\n _termsAndCondetionsContent: '',\r\n };\r\n\r\n setStep = (step: any) => {\r\n this.setState({ _step: step });\r\n };\r\n setOffer = (offer: OfferProps) => {\r\n this.setState({ _offer: offer });\r\n };\r\n setTermsAndCondetionsContent = (_termsAndCondetionsContent: string) => {\r\n this.setState({ _termsAndCondetionsContent: _termsAndCondetionsContent });\r\n };\r\n render() {\r\n const { _offer, _step, _termsAndCondetionsContent } = this.state;\r\n return (\r\n \r\n {this.props.children}\r\n \r\n );\r\n }\r\n}\r\n","import \"./i18n\";\r\nimport React, { useLayoutEffect } from \"react\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { unstable_createMuiStrictModeTheme as createMuiTheme } from \"@material-ui/core\";\r\n\r\nimport { ThemeProvider } from \"@material-ui/core/styles\";\r\nimport { Shadows } from \"@material-ui/core/styles/shadows\";\r\nimport { create } from \"jss\";\r\nimport rtl from \"jss-rtl\";\r\nimport { StylesProvider, jssPreset } from \"@material-ui/core/styles\";\r\n\r\nimport { Routes } from \"routes\";\r\nimport GlobalState from \"core/context/GlobalState\";\r\n\r\nconst win: any = window;\r\nconst isRTL = win[\"lang\"] === \"ar\";\r\n\r\nconst apptheme = createMuiTheme({\r\n direction: \"rtl\",\r\n shadows: Array(25).fill(\"none\") as Shadows,\r\n // typography: {\r\n // fontSize: 12,\r\n // fontFamily: 'ScandiaWeb-Regular',\r\n\r\n // },\r\n typography: {\r\n fontSize: 12,\r\n fontFamily: isRTL ? \"ExpoArabic-Medium\" : \"ScandiaWeb-Regular\",\r\n },\r\n\r\n palette: {\r\n text: {\r\n primary: \"#606060\",\r\n secondary: \"#72767A\",\r\n },\r\n primary: {\r\n main: \"#606060\",\r\n light: \"#d4d4d0\",\r\n dark: \"#efeded\",\r\n },\r\n secondary: {\r\n main: \"#008CFF\",\r\n },\r\n contrastThreshold: 3,\r\n },\r\n});\r\n\r\nexport default function App() {\r\n const win: any = window;\r\n const { i18n } = useTranslation();\r\n\r\n document.body.setAttribute(\"dir\", isRTL ? \"rtl\" : \"ltr\");\r\n const jss = isRTL\r\n ? create({ plugins: [...jssPreset().plugins, rtl()] })\r\n : create({ plugins: [...jssPreset().plugins] });\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n}\r\n","// This optional code is used to register a service worker.\r\n// register() is not called by default.\r\n\r\n// This lets the app load faster on subsequent visits in production, and gives\r\n// it offline capabilities. However, it also means that developers (and users)\r\n// will only see deployed updates on subsequent visits to a page, after all the\r\n// existing tabs open on the page have been closed, since previously cached\r\n// resources are updated in the background.\r\n\r\n// To learn more about the benefits of this model and instructions on how to\r\n// opt-in, read https://bit.ly/CRA-PWA\r\n\r\nconst isLocalhost = Boolean(\r\n window.location.hostname === 'localhost' ||\r\n // [::1] is the IPv6 localhost address.\r\n window.location.hostname === '[::1]' ||\r\n // 127.0.0.0/8 are considered localhost for IPv4.\r\n window.location.hostname.match(/^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/),\r\n);\r\n\r\ntype Config = {\r\n onSuccess?: (registration: ServiceWorkerRegistration) => void;\r\n onUpdate?: (registration: ServiceWorkerRegistration) => void;\r\n};\r\n\r\nexport function register(config?: Config) {\r\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\r\n // The URL constructor is available in all browsers that support SW.\r\n const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);\r\n if (publicUrl.origin !== window.location.origin) {\r\n // Our service worker won't work if PUBLIC_URL is on a different origin\r\n // from what our page is served on. This might happen if a CDN is used to\r\n // serve assets; see https://github.com/facebook/create-react-app/issues/2374\r\n return;\r\n }\r\n\r\n window.addEventListener('load', () => {\r\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\r\n\r\n if (isLocalhost) {\r\n // This is running on localhost. Let's check if a service worker still exists or not.\r\n checkValidServiceWorker(swUrl, config);\r\n\r\n // Add some additional logging to localhost, pointing developers to the\r\n // service worker/PWA documentation.\r\n navigator.serviceWorker.ready.then(() => {\r\n console.log(\r\n 'This web app is being served cache-first by a service ' +\r\n 'worker. To learn more, visit https://bit.ly/CRA-PWA',\r\n );\r\n });\r\n } else {\r\n // Is not localhost. Just register service worker\r\n registerValidSW(swUrl, config);\r\n }\r\n });\r\n }\r\n}\r\n\r\nfunction registerValidSW(swUrl: string, config?: Config) {\r\n navigator.serviceWorker\r\n .register(swUrl)\r\n .then((registration) => {\r\n registration.onupdatefound = () => {\r\n const installingWorker = registration.installing;\r\n if (installingWorker == null) {\r\n return;\r\n }\r\n installingWorker.onstatechange = () => {\r\n if (installingWorker.state === 'installed') {\r\n if (navigator.serviceWorker.controller) {\r\n // At this point, the updated precached content has been fetched,\r\n // but the previous service worker will still serve the older\r\n // content until all client tabs are closed.\r\n console.log(\r\n 'New content is available and will be used when all ' +\r\n 'tabs for this page are closed. See https://bit.ly/CRA-PWA.',\r\n );\r\n\r\n // Execute callback\r\n if (config && config.onUpdate) {\r\n config.onUpdate(registration);\r\n }\r\n } else {\r\n // At this point, everything has been precached.\r\n // It's the perfect time to display a\r\n // \"Content is cached for offline use.\" message.\r\n console.log('Content is cached for offline use.');\r\n\r\n // Execute callback\r\n if (config && config.onSuccess) {\r\n config.onSuccess(registration);\r\n }\r\n }\r\n }\r\n };\r\n };\r\n })\r\n .catch((error) => {\r\n console.error('Error during service worker registration:', error);\r\n });\r\n}\r\n\r\nfunction checkValidServiceWorker(swUrl: string, config?: Config) {\r\n // Check if the service worker can be found. If it can't reload the page.\r\n fetch(swUrl, {\r\n headers: { 'Service-Worker': 'script' },\r\n })\r\n .then((response) => {\r\n // Ensure service worker exists, and that we really are getting a JS file.\r\n const contentType = response.headers.get('content-type');\r\n if (response.status === 404 || (contentType != null && contentType.indexOf('javascript') === -1)) {\r\n // No service worker found. Probably a different app. Reload the page.\r\n navigator.serviceWorker.ready.then((registration) => {\r\n registration.unregister().then(() => {\r\n window.location.reload();\r\n });\r\n });\r\n } else {\r\n // Service worker found. Proceed as normal.\r\n registerValidSW(swUrl, config);\r\n }\r\n })\r\n .catch(() => {\r\n console.log('No internet connection found. App is running in offline mode.');\r\n });\r\n}\r\n\r\nexport function unregister() {\r\n if ('serviceWorker' in navigator) {\r\n navigator.serviceWorker.ready\r\n .then((registration) => {\r\n registration.unregister();\r\n })\r\n .catch((error) => {\r\n console.error(error.message);\r\n });\r\n }\r\n}\r\n","import React, { Suspense } from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport App from 'App';\r\nimport 'fontsource-roboto/500.css';\r\nimport './styles.css';\r\nimport * as serviceWorker from './serviceWorker';\r\nimport 'core/utils/windowObj';\r\nReactDOM.render(\r\n \r\n }>\r\n \r\n \r\n ,\r\n document.getElementById('root'),\r\n);\r\n\r\n// If you want your app to work offline and load faster, you can change\r\n// unregister() to register() below. Note this comes with some pitfalls.\r\n// Learn more about service workers: https://bit.ly/CRA-PWA\r\nserviceWorker.unregister();\r\n"],"sourceRoot":""}