{"version":3,"sources":["Util/YupMethod.js","globals.js","serviceWorker.js","index.js","assets/images/food-app/brand/logo.svg","Components/LoaderBox/LoaderBox.js"],"names":["Yup","message","this","test","value","mapper","a","list","filter","length","Set","map","size","field","ref","some","obj","createError","path","deliveryField","_","sumBy","o","Number","quantity","parent","moment","updateLocale","week","dow","String","prototype","capitalize","charAt","toUpperCase","slice","Boolean","window","location","hostname","match","App","lazy","ReactDOM","render","fallback","LoaderBox","loader","document","getElementById","navigator","serviceWorker","ready","then","registration","unregister","catch","error","console","noData","style","className","src","invoice","alt"],"mappings":"4PAGAA,IAAcA,IAAY,UAAU,SAAUC,GAC5C,OAAOC,KAAKC,KAAK,SAAUF,GAAW,wBAAwB,SAACG,GAAD,OAC5DA,GAAQ,WAAWD,KAAKC,SAI5BJ,IAAcA,IAAY,WAAW,SAAUC,GAC7C,OAAOC,KAAKC,KAAK,UAAWF,GAAW,iCAAiC,SAACG,GAAD,OACtEA,GAAQ,yBAAyBD,KAAKC,SAI1CJ,IAAcA,IAAY,gBAAgB,SAAUC,GAClD,OAAOC,KAAKC,KAAK,eAAgBF,GAAW,mCAAmC,SAACG,GAAD,OAC7EA,GAAQ,yBAAyBD,KAAKC,SAI1CJ,IAAcA,IAAY,OAAO,SAAUC,GACzC,OAAOC,KAAKC,KAAK,MAAOF,GAAW,yBAAyB,SAACG,GAAD,OAC1DA,GACI,iGAAiGD,KAC/FC,SAMVJ,IAAcA,IAAW,UAAU,SAAUC,GAA6B,IAApBI,EAAmB,uDAAV,SAACC,GAAD,OAAOA,GACpE,OAAOJ,KAAKC,KACV,SACAF,GACA,SAACM,GAAD,OAAUA,EAAKC,OAAOH,GAAQI,SAAW,IAAIC,IAAIH,EAAKC,OAAOH,GAAQM,IAAIN,IAASO,WAItFZ,IACEA,IACA,6BACA,WAAiE,IAAvDC,EAAsD,uDAA5C,oCAAqCY,EAAO,uCAC9D,OAAOX,KAAKC,KAAK,4BAA6B,IAAI,SAACC,EAAOU,GAAR,QAC/CV,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AAKc,UAAU,kBAAkBD,MAAOA,EAAxC,SACE,sBAAKC,UAAU,UAAf,UACE,qBAAKC,IAAKC,IAASC,IAAI,YACvB,8BAAgB,IAAXjB,EAAkB,YAAcA,UAIzCA,GAAUY,GACV,qBAAKE,UAAU,kBAAkBD,MAAOA,EAAxC,SACE,sBAAKC,UAAU,UAAf,UACE,qBAAKC,IAAKC,IAASC,IAAI,kBACvB,8BAAgB,IAAXL,EAAkB,kBAAoBA,e","file":"static/js/main.c100ad40.chunk.js","sourcesContent":["import _ from 'lodash'\r\nimport * as Yup from 'yup'\r\n\r\nYup.addMethod(Yup.number, 'number', function (message) {\r\n return this.test('number', message || 'Value must be number', (value) =>\r\n value ? /^[0-9]*$/.test(value) : true\r\n )\r\n})\r\n\r\nYup.addMethod(Yup.number, 'decimal', function (message) {\r\n return this.test('decimal', message || 'Value must be a valid decimal', (value) =>\r\n value ? /^\\d{1,13}(\\.\\d{1,6})?$/.test(value) : true\r\n )\r\n})\r\n\r\nYup.addMethod(Yup.number, 'exchangeRate', function (message) {\r\n return this.test('exchangeRate', message || 'Value must be maximum 6 decimal', (value) =>\r\n value ? /^\\d{1,13}(\\.\\d{1,6})?$/.test(value) : true\r\n )\r\n})\r\n\r\nYup.addMethod(Yup.string, 'url', function (message) {\r\n return this.test('url', message || 'Enter a valid website', (value) =>\r\n value\r\n ? /(http(s)?:\\/\\/.)?(www\\.)?[-a-zA-Z0-9@:%._~#=]{2,256}\\.[a-z]{2,6}\\b([-a-zA-Z0-9@:%_.~#?&//=]*)/g.test(\r\n value\r\n )\r\n : true\r\n )\r\n})\r\n\r\nYup.addMethod(Yup.array, 'unique', function (message, mapper = (a) => a) {\r\n return this.test(\r\n 'unique',\r\n message,\r\n (list) => list.filter(mapper).length === new Set(list.filter(mapper).map(mapper)).size\r\n )\r\n})\r\n\r\nYup.addMethod(\r\n Yup.array,\r\n 'atLeastOneOfFieldInObject',\r\n function (message = 'At least one of field is required', field) {\r\n return this.test('atLeastOneOfFieldInObject', '', (value, ref) =>\r\n !value.some((obj) => obj[field])\r\n ? ref.createError({\r\n message,\r\n path: `${ref.path}[0].${field}`\r\n })\r\n : true\r\n )\r\n }\r\n)\r\n\r\nYup.addMethod(Yup.string, 'dateFormat', function (message) {\r\n return this.test('dateFormat', message || 'Enter a valid date format', (value) =>\r\n value ? /^.*\\$\\{.*((Y)|(M)|(D)).*\\}.*/g.test(value) : true\r\n )\r\n})\r\n\r\nYup.addMethod(Yup.array, 'batchTotal', function (deliveryField, message) {\r\n return this.test('batchTotal', message || 'Qty and Total Batch / Serial Qty not equal', function (value) {\r\n return _.sumBy(value, (o) => Number(o.quantity)) === Number(this.parent[deliveryField])\r\n })\r\n})\r\n\r\nYup.addMethod(Yup.string, 'barcode', function (message) {\r\n return this.test('barcode', message || '${path} is not valid', (value) =>\r\n value ? /^\\*?([0-9A-Z\\-. $/+%]{1,})\\*?$/.test(value) : true\r\n )\r\n})\r\n","import moment from 'moment'\r\nimport './Util/YupMethod'\r\n\r\nmoment.updateLocale('en', {\r\n week: {\r\n dow: 1\r\n }\r\n})\r\n\r\n// eslint-disable-next-line no-extend-native\r\nString.prototype.capitalize = function () {\r\n return this.charAt(0).toUpperCase() + this.slice(1)\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\nexport function register(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\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, 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\r\n if (installingWorker === null) {\r\n return\r\n }\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, 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\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 'antd/dist/antd.css'\r\nimport 'bootstrap/dist/css/bootstrap.min.css'\r\nimport { lazy, Suspense } from 'react'\r\nimport ReactDOM from 'react-dom'\r\nimport 'react-quill/dist/quill.snow.css'\r\nimport LoaderBox from './Components/LoaderBox/LoaderBox'\r\nimport './globals'\r\nimport * as serviceWorker from './serviceWorker'\r\nimport './Style/styles.scss'\r\n\r\nconst App = lazy(() => import('./App'))\r\n\r\nReactDOM.render(\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","export default __webpack_public_path__ + \"static/media/logo.0416bd10.svg\";","import PropTypes from 'prop-types'\r\nimport invoice from '../../assets/images/food-app/brand/logo.svg'\r\n\r\nconst LoaderBox = ({ loader, noData, style }) => (\r\n <>\r\n {loader && (\r\n
\r\n
\r\n \"Loading\"\r\n

{loader === true ? 'Loading..' : loader}

\r\n
\r\n
\r\n )}\r\n {!loader && noData && (\r\n
\r\n
\r\n \"No\r\n

{noData === true ? 'No Data found..' : noData}

\r\n
\r\n
\r\n )}\r\n \r\n)\r\n\r\nLoaderBox.propTypes = {\r\n loader: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),\r\n noData: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),\r\n style: PropTypes.object\r\n}\r\n\r\nexport default LoaderBox\r\n"],"sourceRoot":""}