{"version":3,"sources":["i18n.js","index.js","temp/config.js"],"names":["i18nInit","language","dictionary","appName","Promise","resolve","reject","options","debug","lng","fallbackLng","load","useCookie","interpolation","escapeValue","i18n","isInitialized","changeLanguage","then","addResourceBundle","use","initReactI18next","init","error","dictionaryServicePath","concat","config","sitecoreApiHost","jssAppName","sitecoreApiKey","replace","backend","loadPath","parse","data","parsedData","JSON","phrases","fetchBackend","initLanguage","defaultLanguage","__JSS_STATE__","ssrRawJson","document","getElementById","innerHTML","sitecore","context","undefined","createElement","noModule","console","info","isExperienceEditorActive","window","onscroll","element","logolist","navigationMenuMobile","body","scrollTop","documentElement","querySelector","classList","add","remove","scrollFunction","module","exports"],"mappings":"4GAAA,sFAce,SAASA,EAASC,EAAUC,EAAYC,GAErD,OAAO,IAAIC,SAAQ,CAACC,EAASC,KAC3B,MAAMC,EAAU,CACdC,OAAO,EACPC,IAAKR,EACLS,aAAa,EACbC,KAAM,cACNC,WAAW,EAEXC,cAAe,CACbC,aAAa,IAQjB,GAAIZ,EAKGa,IAAKC,cASRD,IAAKE,eAAehB,GAAUiB,MAAK,KACjCH,IAAKI,kBAAkBlB,EAAU,cAAeC,GAAY,GAAM,GAElEG,GAAS,IAXXU,IAAKK,IAAIC,KAAkBC,KAAKf,GAAUgB,IACpCA,GAAOjB,EAAOiB,GAElBR,IAAKI,kBAAkBlB,EAAU,cAAeC,GAAY,GAAM,GAElEG,GAAS,QASR,CAKL,MAAMmB,EAAqB,GAAAC,OAAMC,IAAOC,gBAAe,iCAAAF,OAAgCtB,GAAsB,IAAXA,EAAgBA,EAAUuB,IAAOE,WAAU,uBAAAH,OAAsBC,IAAOG,eAAeC,QAAQ,IAAI,IAAIA,QAAQ,IAAI,KAErNvB,EAAQwB,QAAU,CAChBC,SAAUR,EACVS,MAAQC,IACN,MAAMC,EAAaC,KAAKH,MAAMC,GAC9B,OAAIC,EAAWE,QACNF,EAAWE,QAEbF,CAAU,GAIrBpB,IACGK,IAAIkB,KACJlB,IAAIC,KACJC,KAAKf,GAAUgB,IACVA,GAAOjB,EAAOiB,GAElBlB,GAAS,GAEf,IAEJ,C,8NCvEA,IAAIkC,EAAeb,IAAOc,gBAEtBC,EAAgB,KACpB,MAAMC,EAAaC,SAASC,eAAe,iBACvCF,IACFD,EAAgBL,KAAKH,MAAMS,EAAWG,YAEpCJ,IAEFF,EAAeE,EAAcK,SAASC,QAAQ9C,eAGe+C,IAA9CL,SAASM,cAAc,UAAUC,UAGhD,sDAAkEhC,MAAK,IACrEiC,QAAQC,KAAK,qCAIjB,uDAAoBlC,OAUhBmC,sCACF,gCAA+CnC,MAAK,IAClDiC,QAAQC,KAAK,sCAIjBE,OAAOC,SAAW,YAIlB,WACE,IAAIC,EAAUb,SAASC,eAAe,iBAClCa,EAAWd,SAASC,eAAe,cACnCc,EAAuBf,SAASC,eAAe,qBAC/CY,GAAWC,IAAaC,IAExBf,SAASgB,KAAKC,UAAY,IAC1BjB,SAASkB,gBAAgBD,UAAY,IAErCjB,SAASmB,cAAc,UAAUC,UAAUC,IAAI,kBAC/CR,EAAQO,UAAUC,IAAI,qBACtBP,EAASM,UAAUC,IAAI,oBAEvBR,EAAQO,UAAUE,OAAO,qBACzBtB,SAASmB,cAAc,UAAUC,UAAUE,OAAO,kBAClDR,EAASM,UAAUE,OAAO,mBAGhC,CArBEC,EACF,C,mBC7CAC,EAAOC,QAAU,CACf,eAAkB,aAClB,gBAAmB,wBACnB,WAAc,cACd,gBAAmB,KACnB,oBAAuB,mBACvB,gBAAmB,6D","file":"static/js/main.7106b54e.chunk.js","sourcesContent":["import i18n from 'i18next';\r\nimport fetchBackend from 'i18next-fetch-backend';\r\nimport { initReactI18next } from 'react-i18next';\r\nimport config from './temp/config';\r\nimport { withSitecoreContext } from '@sitecore-jss/sitecore-jss-react';\r\n\r\n/**\r\n * Initializes the i18next library to provide a translation dictionary to the app.\r\n * If your app is not multilingual, this file and references to it can be removed.\r\n * Elsewhere in the app to use the dictionary `import { t } from 'i18next'; ... t('key')`\r\n * @param {string} language Optional, the initial language. Only used for SSR; otherwise language set in RouteHandler.\r\n * @param {*} dictionary Optional, the dictionary to load. Only used for SSR; otherwise, the dictionary is loaded via JSS dictionary service.\r\n * @param {string} appName\r\n */\r\nexport default function i18nInit(language, dictionary, appName) {\r\n\r\n return new Promise((resolve, reject) => {\r\n const options = {\r\n debug: false,\r\n lng: language,\r\n fallbackLng: false, // fallback to keys\r\n load: 'currentOnly', // e.g. don't load 'es' when requesting 'es-MX' -- Sitecore config should handle this\r\n useCookie: false, // using URLs and Sitecore to store language context, don't need a cookie\r\n\r\n interpolation: {\r\n escapeValue: false, // not needed for react\r\n },\r\n };\r\n\r\n //dictionary = {\"lang\":\"en\",\"app\":\"corporate\",\"phrases\":{}};\r\n \r\n\r\n\r\n if (dictionary) {\r\n // if we got dictionary passed, that means we're in a SSR context with a server-provided dictionary\r\n // so we do not want a backend, because we already know all possible keys\r\n \r\n\r\n if (!i18n.isInitialized) {\r\n i18n.use(initReactI18next).init(options, (error) => {\r\n if (error) reject(error);\r\n\r\n i18n.addResourceBundle(language, 'translation', dictionary, true, true)\r\n\r\n resolve();\r\n });\r\n } else {\r\n i18n.changeLanguage(language).then(() => {\r\n i18n.addResourceBundle(language, 'translation', dictionary, true, true)\r\n \r\n resolve()\r\n })\r\n }\r\n } else {\r\n // We're running client-side, so we get translation data from the Sitecore dictionary API using fetch backend\r\n // For higher performance (but less simplicity), consider adding the i18n chained backend to a local cache option like the local storage backend.\r\n\r\n // eslint-disable-next-line\r\n const dictionaryServicePath = `${config.sitecoreApiHost}/sitecore/api/jss/dictionary/${appName && appName != '' ? appName : config.jssAppName}/{{lng}}?sc_apikey=${config.sitecoreApiKey.replace('{','').replace('}','')}`;\r\n\r\n options.backend = {\r\n loadPath: dictionaryServicePath,\r\n parse: (data) => {\r\n const parsedData = JSON.parse(data);\r\n if (parsedData.phrases) {\r\n return parsedData.phrases;\r\n }\r\n return parsedData;\r\n },\r\n };\r\n\r\n i18n\r\n .use(fetchBackend)\r\n .use(initReactI18next)\r\n .init(options, (error) => {\r\n if (error) reject(error);\r\n\r\n resolve();\r\n });\r\n }\r\n });\r\n}\r\n","import { isExperienceEditorActive } from \"@sitecore-jss/sitecore-jss-react\";\r\nimport \"./webcomponents\";\r\nimport \"./index.scss\";\r\nimport \"./index-override.scss\";\r\nimport \"./coolicons.css\";\r\nimport i18ninit from \"./i18n\";\r\nimport config from \"./temp/config\";\r\nimport \"react-app-polyfill/ie11\";\r\nimport \"react-app-polyfill/stable\";\r\n\r\nlet initLanguage = config.defaultLanguage;\r\n\r\nlet __JSS_STATE__ = null;\r\nconst ssrRawJson = document.getElementById(\"__JSS_STATE__\");\r\nif (ssrRawJson) {\r\n __JSS_STATE__ = JSON.parse(ssrRawJson.innerHTML);\r\n}\r\nif (__JSS_STATE__) {\r\n // set i18n language SSR state language instead of static config default language\r\n initLanguage = __JSS_STATE__.sitecore.context.language;\r\n}\r\n\r\nconst isLegacy = document.createElement(\"script\").noModule === undefined;\r\n\r\nif (isLegacy) {\r\n import(/* webpackChunkName: 'legacy-support' */ \"./polyfills.js\").then(() =>\r\n console.info(\"Legacy browsers support enabled\")\r\n );\r\n}\r\n\r\nimport(\"./main.js\").then();\r\n\r\n/*\r\n App Rendering\r\n*/\r\n// initialize the dictionary, then render the app\r\n// note: if not making a multlingual app, the dictionary init can be removed.\r\n// i18ninit(initLanguage, undefined, __JSS_STATE__?.sitecore?.context?.ContextExtensions?.appName?.value)\r\n\r\n// THIS SCRIPT WILL LOAD ONLY WHEN THE EXPERIENCE EDITOR IS ENABLED\r\nif (isExperienceEditorActive()) {\r\n import(\"./experience-editor-patches/index.js\").then(() =>\r\n console.info(\"EXPERIENCE EDITOR PATCHES LOADED\")\r\n );\r\n}\r\n\r\nwindow.onscroll = function () {\r\n scrollFunction();\r\n};\r\n\r\nfunction scrollFunction() {\r\n var element = document.getElementById(\"navigation-id\");\r\n var logolist = document.getElementById(\"logo-items\");\r\n var navigationMenuMobile = document.getElementById(\"hamburgerMenuMain\");\r\n if (element && logolist && !navigationMenuMobile) {\r\n if (\r\n document.body.scrollTop > 50 ||\r\n document.documentElement.scrollTop > 50\r\n ) {\r\n document.querySelector(\"header\").classList.add(\"shrink-content\");\r\n element.classList.add(\"headroom--not-top\");\r\n logolist.classList.add(\"shrink-content\");\r\n } else {\r\n element.classList.remove(\"headroom--not-top\");\r\n document.querySelector(\"header\").classList.remove(\"shrink-content\");\r\n logolist.classList.remove(\"shrink-content\");\r\n }\r\n }\r\n}\r\n","/* eslint-disable */\n// Do not edit this file, it is auto-generated at build time!\n// See scripts/bootstrap.js to modify the generation of this file.\nmodule.exports = {\n \"sitecoreApiKey\": \"BE376E4C-F913-4149-BD0A-9EAEF3C91630\",\n \"sitecoreApiHost\": \"\",\n \"jssAppName\": \"accessories\",\n \"defaultLanguage\": \"en\",\n \"graphQLEndpointPath\": \"/api/accessories\",\n \"graphQLEndpoint\": \"/api/accessories?sc_apikey=BE376E4C-F913-4149-BD0A-9EAEF3C91630\"\n};"],"sourceRoot":""}