{"version":3,"sources":["i18n.js","serviceWorker.js","App.js","index.js"],"names":["i18next__WEBPACK_IMPORTED_MODULE_0__","__webpack_require__","i18next_browser_languagedetector__WEBPACK_IMPORTED_MODULE_1__","i18next_browser_languagedetector__WEBPACK_IMPORTED_MODULE_1___default","n","i18next_xhr_backend__WEBPACK_IMPORTED_MODULE_2__","i18next_xhr_backend__WEBPACK_IMPORTED_MODULE_2___default","react_i18next__WEBPACK_IMPORTED_MODULE_3__","i18n","use","detector","backend","initReactI18next","init","fallbackLng","zh-tw","default","interpolation","escapeValue","load","lowerCaseLng","loadPath","isLocalhost","Boolean","window","location","hostname","match","registerValidSW","swUrl","config","navigator","serviceWorker","register","then","registration","onupdatefound","installingWorker","installing","onstatechange","state","controller","console","log","onUpdate","onSuccess","catch","error","ChatRoom","lazy","Promise","all","e","bind","ResetPassword","PublicRegistration","App","_Component","_inherits","Component","_super","_createSuper","_classCallCheck","this","apply","arguments","key","value","react_default","a","createElement","react_router_dom","react","fallback","className","react_router","exact","path","component","ReactDOM","render","src_App","document","getElementById","URL","process","href","origin","addEventListener","concat","fetch","response","contentType","headers","get","status","indexOf","ready","unregister","reload","checkValidServiceWorker"],"mappings":"yJAAA,IAAAA,EAAAC,EAAA,IAAAC,EAAAD,EAAA,IAAAE,EAAAF,EAAAG,EAAAF,GAAAG,EAAAJ,EAAA,IAAAK,EAAAL,EAAAG,EAAAC,GAAAE,EAAAN,EAAA,IAsCAO,IACGC,IAAIC,KACJD,IAAIE,KACJF,IAAIG,KACJC,KAAK,CAOJC,YAAa,CACXC,QAAS,CAAC,SACVC,QAAW,CAAC,OAOdC,cAAe,CACbC,aAAa,GAGfC,KAAM,cACNC,cAAc,EAGdT,QAAS,CACPU,SAAU,4CAeDb,MAAI,wICtEbc,EAAcC,QACU,cAA7BC,OAAOC,SAASC,UAEa,UAA7BF,OAAOC,SAASC,UAEhBF,OAAOC,SAASC,SAASC,MACxB,2DAsCF,SAASC,EAAgBC,EAAOC,GAC/BC,UAAUC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,cAACK,EAAA,EAAK,CAACC,OAAK,EAACC,KAAK,0BAA0BC,UAAWvB,IACvDa,EAAAC,EAAAC,cAACK,EAAA,EAAK,CAACC,OAAK,EAACC,KAAK,4BAA4BC,UAAWxB,IACzDc,EAAAC,EAAAC,cAACK,EAAA,EAAK,CAACE,KAAK,aAAaC,UAAW9B,0FAKvDQ,EAbI,SCATuB,IAASC,OAAOZ,EAAAC,EAAAC,cAACW,EAAG,MAAKC,SAASC,eAAe,SFe1C,SAAkBrD,GACxB,GAA6C,kBAAmBC,UAAW,CAG1E,GADkB,IAAIqD,IAAIC,aAAwB7D,OAAOC,SAAS6D,MACpDC,SAAW/D,OAAOC,SAAS8D,OAIxC,OAGD/D,OAAOgE,iBAAiB,OAAQ,WAC/B,IAAM3D,EAAK,GAAA4D,OAAMJ,aAAsB,UAEnC/D,GAgEP,SAAiCO,EAAOC,GAEvC4D,MAAM7D,GACJK,KAAK,SAAAyD,GAEL,IAAMC,EAAcD,EAASE,QAAQC,IAAI,gBAEpB,MAApBH,EAASI,QACO,MAAfH,IAA8D,IAAvCA,EAAYI,QAAQ,cAG5CjE,UAAUC,cAAciE,MAAM/D,KAAK,SAAAC,GAClCA,EAAa+D,aAAahE,KAAK,WAC9BV,OAAOC,SAAS0E,aAKlBvE,EAAgBC,EAAOC,KAGxBgB,MAAM,WACNJ,QAAQC,IACP,mEArFAyD,CAAwBvE,EAAOC,GAI/BC,UAAUC,cAAciE,MAAM/D,KAAK,WAClCQ,QAAQC,IACP,gHAMFf,EAAgBC,EAAOC,MEzC3BE","file":"static/js/main.13ee6318.chunk.js","sourcesContent":["/* \r\n------------------------------------------------------\r\n1) Adding more languages\r\n a) Add an additional language file\r\n b) Add the additional translations on init\r\n c) Auto detect the user language\r\n d) Let the user toggle the language\r\n------------------------------------------------------\r\n2) Lazy loading translations\r\n a) Adding lazy loading for translations\r\n b) Loading multiple translation files\r\n------------------------------------------------------\r\n3) Sidequest: natural vs. keybased catalog\r\n a) natural keys\r\n b) keybased catalog\r\n------------------------------------------------------\r\nhttps://react.i18next.com/legacy-v9/step-by-step-guide\r\n*/\r\nimport i18n from \"i18next\"\r\nimport detector from \"i18next-browser-languagedetector\" //yarn add i18next-browser-languagedetector --save\r\nimport backend from \"i18next-xhr-backend\" //yarn add i18next-xhr-backend --save\r\nimport { initReactI18next } from \"react-i18next\" //yarn add react-i18next@legacy i18next --save\r\n\r\n// After adding lazy loading for translations\r\n// translations are already at '../public/locales/en/translation.json'\r\n// which is the default for the xhr backend to load from\r\n/* -- i18n Translation Resources --\r\nimport translationEN from '../public/locales/en/translation.json'\r\nimport translationCN from '../public/locales/cn/translation.json'\r\nconst resources = {\r\n en: {\r\n translation: translationEN\r\n },\r\n cn: {\r\n translation: translationCN\r\n },\r\n}\r\n*/\r\ni18n\r\n .use(detector) // Auto detect the user language\r\n .use(backend) // Adding lazy loading for translations\r\n .use(initReactI18next) // Passes i18n down to react-i18next\r\n .init({\r\n //resources, // After adding lazy loading for translations\r\n // Without configuration i18next will always load one file (namespace) named translation. Learn more about namespaces here.\r\n //https://www.i18next.com/principles/namespaces\r\n //https://react.i18next.com/legacy-v9/withnamespaces\r\n //lng: \"en\",\r\n //fallbackLng: \"en\", // Use [\"en\", \"fr\"] if detected lng is not available\r\n fallbackLng: { \r\n 'zh-tw': ['zh-hk'],\r\n 'default': ['en']\r\n },\r\n //whitelist: [\"en\", \"zh-hk\", \"zh-cn\", \"ja\", \"ko\", \"fr\"],\r\n \r\n //keySeparator: false, // \"Natural Keys\"\r\n // we had organised translation and keys in natural language\r\n // In order to use \"Keybased Catalog\", removing keySeparator: false\r\n interpolation: {\r\n escapeValue: false // react already safes from xss\r\n },\r\n\r\n load: \"currentOnly\",\r\n lowerCaseLng: true,\r\n \r\n //For production only\r\n backend: {\r\n loadPath: '/chatpoint/locales/{{lng}}/{{ns}}.json',\r\n }\r\n\r\n // react-i18next Options for V9, and V10 have more options\r\n \r\n /*react: {\r\n useSuspense: false\r\n }*/\r\n })\r\n/* -- Information --\r\n * i18next implementation is smart enough to only load needed languages \r\n * and comes with intelligent deduplications \r\n * so even multiple load requests for files in different code locations \r\n * result in one request while notifying all needed requester.\r\n */\r\nexport default i18n","// 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\twindow.location.hostname === 'localhost' ||\r\n\t// [::1] is the IPv6 localhost address.\r\n\twindow.location.hostname === '[::1]' ||\r\n\t// 127.0.0.1/8 is considered localhost for IPv4.\r\n\twindow.location.hostname.match(\r\n\t\t/^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\r\n\t)\r\n);\r\n\r\nexport function register(config) {\r\n\tif (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\r\n\t\t// The URL constructor is available in all browsers that support SW.\r\n\t\tconst publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);\r\n\t\tif (publicUrl.origin !== window.location.origin) {\r\n\t\t\t// Our service worker won't work if PUBLIC_URL is on a different origin\r\n\t\t\t// from what our page is served on. This might happen if a CDN is used to\r\n\t\t\t// serve assets; see https://github.com/facebook/create-react-app/issues/2374\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\twindow.addEventListener('load', () => {\r\n\t\t\tconst swUrl = `${process.env.PUBLIC_URL}/sw.js`;\r\n\t\t\t\r\n\t\t\tif (isLocalhost) {\r\n\t\t\t\t// This is running on localhost. Let's check if a service worker still exists or not.\r\n\t\t\t\tcheckValidServiceWorker(swUrl, config);\r\n\t\t\t\t\r\n\t\t\t\t// Add some additional logging to localhost, pointing developers to the\r\n\t\t\t\t// service worker/PWA documentation.\r\n\t\t\t\tnavigator.serviceWorker.ready.then(() => {\r\n\t\t\t\t\tconsole.log(\r\n\t\t\t\t\t\t'This web app is being served cache-first by a service ' +\r\n\t\t\t\t\t\t'worker. To learn more, visit https://bit.ly/CRA-PWA'\r\n\t\t\t\t\t);\r\n\t\t\t\t});\r\n\t\t\t} else {\r\n\t\t\t\t// Is not localhost. Just register service worker\r\n\t\t\t\tregisterValidSW(swUrl, config);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}\r\n\r\nfunction registerValidSW(swUrl, config) {\r\n\tnavigator.serviceWorker\r\n\t\t.register(swUrl)\r\n\t\t.then(registration => {\r\n\t\t\tregistration.onupdatefound = () => {\r\n\t\t\t\tconst installingWorker = registration.installing;\r\n\t\t\t\tif (installingWorker == null) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tinstallingWorker.onstatechange = () => {\r\n\t\t\t\t\tif (installingWorker.state === 'installed') {\r\n\t\t\t\t\t\tif (navigator.serviceWorker.controller) {\r\n\t\t\t\t\t\t\t// At this point, the updated precached content has been fetched,\r\n\t\t\t\t\t\t\t// but the previous service worker will still serve the older\r\n\t\t\t\t\t\t\t// content until all client tabs are closed.\r\n\t\t\t\t\t\t\tconsole.log(\r\n\t\t\t\t\t\t\t\t'New content is available and will be used when all ' +\r\n\t\t\t\t\t\t\t\t'tabs for this page are closed. See https://bit.ly/CRA-PWA.'\r\n\t\t\t\t\t\t\t);\r\n\r\n\t\t\t\t\t\t\t// Execute callback\r\n\t\t\t\t\t\t\tif (config && config.onUpdate) {\r\n\t\t\t\t\t\t\t\tconfig.onUpdate(registration);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t// At this point, everything has been precached.\r\n\t\t\t\t\t\t\t// It's the perfect time to display a\r\n\t\t\t\t\t\t\t// \"Content is cached for offline use.\" message.\r\n\t\t\t\t\t\t\tconsole.log('Content is cached for offline use.');\r\n\r\n\t\t\t\t\t\t\t// Execute callback\r\n\t\t\t\t\t\t\tif (config && config.onSuccess) {\r\n\t\t\t\t\t\t\t\tconfig.onSuccess(registration);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t};\r\n\t\t\t};\r\n\t\t})\r\n\t\t.catch(error => {\r\n\t\t\tconsole.error('Error during service worker registration:', error);\r\n\t\t});\r\n}\r\n\r\nfunction checkValidServiceWorker(swUrl, config) {\r\n\t// Check if the service worker can be found. If it can't reload the page.\r\n\tfetch(swUrl)\r\n\t\t.then(response => {\r\n\t\t\t// Ensure service worker exists, and that we really are getting a JS file.\r\n\t\t\tconst contentType = response.headers.get('content-type');\r\n\t\t\tif (\r\n\t\t\t\tresponse.status === 404 ||\r\n\t\t\t\t(contentType != null && contentType.indexOf('javascript') === -1)\r\n\t\t\t) {\r\n\t\t\t\t// No service worker found. Probably a different app. Reload the page.\r\n\t\t\t\tnavigator.serviceWorker.ready.then(registration => {\r\n\t\t\t\t\tregistration.unregister().then(() => {\r\n\t\t\t\t\t\twindow.location.reload();\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t} else {\r\n\t\t\t\t// Service worker found. Proceed as normal.\r\n\t\t\t\tregisterValidSW(swUrl, config);\r\n\t\t\t}\r\n\t\t})\r\n\t\t.catch(() => {\r\n\t\t\tconsole.log(\r\n\t\t\t\t'No internet connection found. App is running in offline mode.'\r\n\t\t\t);\r\n\t\t});\r\n}\r\n\r\nexport function unregister() {\r\n\tif ('serviceWorker' in navigator) {\r\n\t\tnavigator.serviceWorker.ready.then(registration => {\r\n\t\t\tregistration.unregister();\r\n\t\t});\r\n\t}\r\n}\r\n","import React, { Component, Suspense, lazy } from 'react'\r\nimport { BrowserRouter as Router, Switch, Route } from \"react-router-dom\";\r\n\r\nconst ChatRoom = lazy(() => import('./components/ChatPointX/Routes/ChatRoom'));\r\nconst ResetPassword = lazy(() => import('./components/ChatPointX/Routes/ResetPassword'));\r\nconst PublicRegistration = lazy(() => import('./components/ChatPointX/Routes/PublicRegistration'));\r\n\r\nclass App extends Component {\r\n render() {\r\n return (\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\nexport default App","import React from 'react'\r\nimport ReactDOM from 'react-dom'\r\nimport * as serviceWorker from './serviceWorker'\r\nimport './i18n'\r\nimport App from './App'\r\nimport './index.css'\r\n// React 17 -> \r\nReactDOM.render(, document.getElementById(\"root\"));\r\n\r\nserviceWorker.register()\r\n//...Following Codes relocated after Login is Successful"],"sourceRoot":""}