{"version":3,"sources":["assets/images/icons sync nonrecursive /[/w-]+/.svg$","assets/images/icons/alert.svg","assets/images/icons/archive.svg","assets/images/icons/arrow_down.svg","assets/images/icons/arrow_rise.svg","assets/images/icons/checked.svg","assets/images/icons/document.svg","assets/images/icons/envelope.svg","assets/images/icons/equal.svg","assets/images/icons/finance.svg","assets/images/icons/hearts.svg","assets/images/icons/home.svg","assets/images/icons/map_marker.svg","assets/images/icons/medal.svg","assets/images/icons/people.svg","assets/images/icons/thumbs-up.svg","assets/images/icons/tools.svg","assets/images/icons/user.svg","assets/images/logos sync /[/w-]+/.(?:svg|jpg|png)$","assets/images/logos/5e-small.svg","assets/images/logos/cf-small-white.svg","assets/images/logos/countries/circular/hk.png","assets/images/logos/countries/circular/id.png","assets/images/logos/countries/circular/my.png","assets/images/logos/countries/circular/ph.png","assets/images/logos/countries/circular/sg.png","assets/images/logos/countries/circular/th.png","assets/images/logos/ff-small-white.svg","assets/images/logos/ff-small.svg","assets/images/logos/gravity-logo.svg","assets/images/photos sync nonrecursive /[/w-]+/.(?:svg|jpg|png)$","assets/images/photos/avatar-penguin-smart.png","assets/images/photos/avatar-penguin.png","assets/images/photos/leaderboard-bg.svg","assets/images/photos/start.png","assets/images/photos/working-out.png","assets/images/photos/working-out@2x.png","translations sync /[/w-]+/.json$","constants/routes.js","constants/translations.js","constants/api.js","constants/config.js","components/wrappers/EnhancedCSSTransition.js","assets/images/imageIndex.js","components/Messages/Message.js","utils/global.js","utils/strings.js","utils/translationHelpers.js","utils/logic.js","components/SiteMessages/SiteMessageToasts.js","utils/messageControllers.js","services/utils/core.js","services/translations.js","contexts/TranslationContext.js","services/languages.js","services/countriesBrandsClubs.js","utils/objectsAndArrays.js","constants/languages.js","utils/window.js","contexts/GlobalContext.js","components/Loaders/Spinner/Spinner.js","components/Loaders/SimpleLoader/SimpleLoader.js","LanguageControl.js","pages/reset-password/constants.js","constants/localStorage.js","components/LanguageSelector/LanguageSelector.js","components/Forms/CustomForm.js","components/Inputs/Input/Input.js","utils/misc.js","components/Buttons/CustomButton.js","pages/reset-password/presentation.js","services/reset-password.js","pages/reset-password/reset-password.js","components/DotDotContainer/DotDotContainer.js","components/Count/SimpleCount.js","components/Selects/Select/components/DropdownTrigger/DropdownTrigger.js","components/Inputs/Checkbox/Checkbox.js","components/Selects/Select/components/DropdownMenu/DropdownMenu.js","components/Selects/Select/components/ElementWithPopup/ElementWithPopup.js","components/wrappers/ClickOutside.js","components/Selects/Select/Select.js","components/Selects/FancySelect/FancySelect.js","components/Selects/CountrySelect/CountrySelect.js","components/Selects/LanguageSelect/LanguageSelect.js","pages/public-documents/views/DocumentView.js","pages/public-documents/views/CountrySelectView.js","pages/public-documents/views/FailedView.js","services/documents.js","pages/public-documents/public-documents.js","pages/404/404.js","pages/routerIndex.js","pages/index.js","App.js","serviceWorker.js","index.js"],"names":["map","webpackContext","req","id","webpackContextResolve","__webpack_require__","o","e","Error","code","keys","Object","resolve","module","exports","routes","defaultLanguage","translationRoot","translationKeys","messages","inputs","documents","resetPassword","API_ROOT","API_PUBLIC_PREFIX","API_MOBILE_PREFIX","endpoints","TRANSLATIONS","LANGUAGES","COUNTRIES","BRANDS","RESET_PW","TERMS_CONDITIONS","HEALTH_STATEMENT","FAQ","EnhancedCSSTransition","children","transitionClassNames","classNames","onEnter","onEntering","onExit","onExiting","props","generateClass","suffix","enterOneTickClass","exitOneTickClass","CSSTransition","el","isAppearing","classList","add","remove","icons","bulkRequireImages","logos","requiredFiles","bulkImages","forEach","filePath","imgPath","replace","split","thisObject","i","length","str","default","Message","status","className","MessageWithAnimation","transitionProps","icon","closable","onClose","hideOnClose","message","list","content","text","translationArgs","React","useState","showMsg","setShowMsg","parsedMessages","parseErrors","msgContent","_isArray","msg","dangerouslySetInnerHTML","__html","getParsedMessage","params","getMsgContent","MessageComponent","src","alt","onClick","isVisible","groupClassName","timeout","tranProps","TransitionGroup","undefined","in","Boolean","_G","translate","v","isEmptyString","value","deepStringModification","target","callback","_isString","TRANSLATION_KEY_PATTERN","RegExp","isTranslationKey","test","enhancedTranslateHelper","args","deepTranslateHelper","string","data","newData","dataStrings","key","hasOwnProperty","newValue","_isNumber","push","translatedItem","itemToBeReturn","parseCustomTranslationGroup","enhancedTranslate","deepTranslate","parsedStr","singularityRegExp","match","operator","limit","former","later","numLimit","Number","isNaN","value1","value2","operators","v1","v2","mathCompare","parseCustomTranslation","translateFailToFetchError","targetString","toastContainerID","SiteMessageToastContainer","containerId","position","toast","POSITION","TOP_CENTER","transition","ToastTransition","autoClose","hideProgressBar","newestOnTop","closeOnClick","rtl","closeButton","draggablePercent","pauseOnVisibilityChange","draggable","pauseOnHover","enableMultiContainer","Component","translationParams","messageParams","parseServerMessage","displaySiteMessages","error","toastOptions","toastFunct","info","isObject","isArray","Msg","toastId","closeToast","preventExitTransition","unmountOnExit","displayError","displayTimedError","options","regExp","index","firstObjectOnly","_isObject","messageArray","filter","serverParams","handleErrors","response","a","ok","json","then","catch","window","logout","statusText","JSON","parse","initializeLanguages","initialize","languages","languageList","renderToStaticMarkup","renderInnerHtml","onMissingTranslation","translationId","defaultTranslation","isString","addTranslationForLanguage","requiredLangList","addEmbeddedTranslations","initializeDynamicTranslations","newLangList","lang","some","l","name","addDynamicTranslations","embeddedTranslations","result","extractLanguageCodeAndFileName","translation","Promise","all","language","addDynamicTranslation","success","results","missingLanguages","compact","missingLanguagesStr","join","console","langCode","fetch","method","TranslationContext","createContext","TranslationContextProvider","this","initializeDefaultTranslations","Provider","TranslationContextProviderWithContexts","withLocalize","TranslationContextConsumer","Consumer","useTranslations","useContext","fetchLanguages","fetchAllCountries","fetchAllBrands","removeDuplicates","array","self","findIndex","t","_isEqual","arrayToObject","object","ARRAY","k","languageMap","zh","getBrowserLanguages","locale","navigator","browserLanguage","userLanguage","systemLanguage","toLowerCase","substr","_uniq","getFilteredBrowserLanguages","availableLanguages","filteredLocale","includes","GlobalContext","GlobalContextProvider","state","isLoaded","inactiveLanguages","countries","brands","setAppIsLoaded","setState","updateQueryParams","changes","history","location","parsedQuery","queryString","search","newQuery","pathname","stringify","getLanguages","isFetchingLanguages","langList","element","_partition","deleted_at","enabledLanguages","disabledLanguages","setActiveLanguage","activeLanguage","isLangAvailable","setTheMostSuitableLanguage","langToBeSet","langCodeFromQuery","availableLangs","localStorage","getItem","firstBrowserLang","getCountries","getCountryName","countryCode","country","getBrands","GlobalContextProviderWithContexts","withRouter","GlobalContextConsumer","withGlobalContext","ChildComponent","GLOBAL","useGlobalContext","Spinner","SimpleLoader","absolute","useEffect","allTokenVerificationStatus","allSubmissionStatus","notSubmitted","submitting","fail","lsKeys","onChange","isOpen","setIsOpen","Popup","on","open","onOpen","trigger","Icon","List","selection","verticalAlign","Item","setItem","handleClick","active","toUpperCase","CustomForm","onFormSubmitted","preventDefault","form","Array","prototype","call","elements","nodeName","validationEvent","Event","dispatchEvent","setTimeout","isValid","validity","valid","getAttribute","onSubmit","noValidate","isNoValidate","Input","_inputRef","hasError","currentMessage","showPassword","isValidByValidator","validator","isValidByHTML","hideError","showError","defaultMessage","invalidMessage","invalid","emptyMessage","empty","checkError","onInput","onBlur","getInputType","type","toggleShowPassword","prevState","getLabel","label","labelArgs","translateMessage","initiateMessages","isSelection","setInputRef","forwardedRef","current","validationEventListener","addEventListener","prevProps","style","description","descriptionBelow","placeholder","transitionClassName","hideInput","disableShowPassword","fakeRequired","disabled","uneditable","isPassword","wrapperClassNames","required","htmlFor","password","display","ref","InputMessage","blurActiveElement","document","activeElement","blur","autoBlur","CustomButton","onMouseUp","before","after","large","noTransition","loading","rest","Button","defaultProps","translationRootKey","ResetPasswordPresentation","Segment","ResetPasswordForm","renderErrorMessages","errorMessages","newPW","confirmPW","tokenVerificationStatus","submissionStatus","handleChange","isTokenVerified","isSubmitting","isSubmissionSuccessful","showForm","pattern","resetPasswordVerifyToken","token","reject","resetPasswordSubmit","password_confirm","headers","body","ResetPasswordPage","_isUnmounted","protectedSetStatus","setErrorMessages","getToken","setTokenVerificationData","verifyToken","setSubmissionStatus","parsedError","param","resetForm","verifying","title","DotDotContainer","ShrinkableElement","shrinkableElement","StaticElement","staticElement","displayDots","setDisplayDots","shrinkableElementRef","useRef","offsetWidth","scrollWidth","SimpleCount","count","zero","classNamePrefix","DropdownTrigger","variant","components","closeMenu","isAsync","isMenuOpen","getOptionLabel","getOptionValue","optionSingleComponent","isMulti","isDisabled","isLoading","isClearable","Control","DropdownTriggerUniversalComponent","EmptyMessage","Count","ValueWrapper","ValueContainer","SingleValue","SingleValueContent","DropdownIndicator","DropdownIcon","MdSearch","IoIosArrowUp","IoIosArrowDown","LoadingIndicator","CloseIndicator","hasValue","values","_isEmpty","commonProps","showCloseIndicator","showCount","size","stopPropagation","action","removedValue","Checkbox","getIsChecked","handleOnClick","hasTodo","isChecked","checked","componentName","defaultStyles","valueContainer","provided","overflow","singleValue","top","transform","visibility","selectProps","inputValue","menu","DropdownMenu","wrapperRef","innerRefs","wrapper","wrapperStyle","styles","defaultInputValue","onOptionUpdated","onValueUpdated","optionsFromProps","loadOptions","noOptionsMessage","noOptionsMessageFunc","loadingMessageFromProps","loadingMessage","menuProps","parentOptionLinkField","isSearchable","setInputValue","setOptions","isLoadingOptionsCounterRef","isLoadingOptions","setIsLoadingOptions","inputRef","abortControllerRef","_newNoOptionsMessageFunc","useCallback","focus","abort","abortController","AbortController","signal","finally","getReplaceComponents","menuPlacement","hideSelectedOptions","backspaceRemovesValue","controlShouldRenderValue","closeMenuOnSelect","menuIsOpen","filterOption","async","OptionSingleComponent","defaultComponents","MultiValue","find","option","Option","isSelected","reactSelectComponents","NoOptionsMessage","showSelectedItems","innerProps","selectOption","ElementWithPopup","triggerRef","scrollableElementRef","render","closePopup","closeOnScroll","popupPosition","popupRef","resizeObserverRef","correctPosition","event","triggerDOM","popupDOM","contains","maxHeight","targetPopupTop","isOpenUpward","maxPopupHeight","windowWidth","innerWidth","documentElement","clientWidth","windowHeight","innerHeight","clientHeight","getBoundingClientRect","triggerTop","triggerLeft","left","triggerRight","right","triggerBottom","bottom","popupTop","popupLeft","popupWidth","width","popupHeight","height","downwardSpace","targetPopupLeft","createResizeObserver","ResizeObserver","entries","entry","isSameNode","borderBoxSize","inlineSize","closePopupOnScroll","removeEventListener","syncWidth","observe","disconnect","ClickOutside","onClickOutside","as","HtmlTag","handleClickOutside","defaultAllOption","selectRemovalEvent","MySelect","createRef","menuRef","getHasNestedOptions","initMultiSelectWithAllOption","addAllOption","getOptions","hasNestedOptions","allValues","val","allOptions","allValue","b","isEqual","initSingleSelectWithAllOption","parentOptions","parentOption","parentOptionsAllOption","allOption","getMemoizedOptions","memoizeOne","allOptionBuilder","clonedOptions","duplicatesRemoved","processedAllOption","splice","optionsWithoutAll","clonedOption","isRemovalEvent","eventOption","childOptions","optionsAbsentFromValue","setMenuOpenStatus","renderDropdownTrigger","valueFromProps","dropdownTrigger","triggerProps","renderDropdownMenu","dropdownMenu","dropdownMenuProps","preselectOnMount","initiateSelection","selectComponent","SelectWithContext","consumerProps","FancySelect","CountrySelect","selectedCountryCode","setSelectedCountryCode","actualValue","SingleCountry","circular","whitelist","updateQueryString","useMemo","stringifiedLanguageCodes","onSelectLanguage","DocumentView","currentBrand","onSelectCountry","to","brandCode","activeDocument","doc","currentContent","DOMPurify","sanitize","CountrySelectView","segmentedCountries","Math","ceil","_chunk","chunkArray","FailedView","reload","defaultLogoEnum","ff","cf","routeOptionsMap","terms","translationKey","fetchFunct","brand","statements","faqs","customUIs","hk","header","backgroundColor","color","logo","sg","useRouteMatch","useLocation","useHistory","setDocuments","isFetchFailed","setIsFetchFailed","documentType","routeOptions","generateNewPath","compile","path","toPath","countryList","newCountryCode","newPath","currentCustomUI","customUIForCurrentBrand","renderLogos","customHeaderStyles","headerDefaultStyles","headerStyles","documentTitle","documentBrands","brandFromContext","documentJoinedBrandName","fetchDocuments","parsedDocuments","country_code","stringifiedQuery","NotFoundPage","routeIndex","component","PublicDocumentViewerPage","exact","Page","AppWithContexts","calculateVH","vh","setProperty","onResize","theme","isCountriesFetched","isBrandsFetched","showSplash","AppContainer","hostname","ReactDOM","getElementById","serviceWorker","ready","registration","unregister"],"mappings":"iLAAA,IAAIA,EAAM,CACT,cAAe,IACf,gBAAiB,IACjB,mBAAoB,IACpB,mBAAoB,IACpB,gBAAiB,IACjB,iBAAkB,IAClB,iBAAkB,IAClB,cAAe,IACf,gBAAiB,IACjB,eAAgB,IAChB,aAAc,IACd,mBAAoB,IACpB,cAAe,IACf,eAAgB,IAChB,kBAAmB,IACnB,cAAe,IACf,aAAc,KAIf,SAASC,EAAeC,GACvB,IAAIC,EAAKC,EAAsBF,GAC/B,OAAOG,EAAoBF,GAE5B,SAASC,EAAsBF,GAC9B,IAAIG,EAAoBC,EAAEN,EAAKE,GAAM,CACpC,IAAIK,EAAI,IAAIC,MAAM,uBAAyBN,EAAM,KAEjD,MADAK,EAAEE,KAAO,mBACHF,EAEP,OAAOP,EAAIE,GAEZD,EAAeS,KAAO,WACrB,OAAOC,OAAOD,KAAKV,IAEpBC,EAAeW,QAAUR,EACzBS,EAAOC,QAAUb,EACjBA,EAAeE,GAAK,K,iCCtCpB,OAAe,cAA0B,mC,iCCAzC,OAAe,cAA0B,qC,iCCAzC,OAAe,cAA0B,wC,iCCAzC,OAAe,cAA0B,wC,iCCAzC,OAAe,cAA0B,qC,iCCAzC,OAAe,cAA0B,sC,iCCAzC,OAAe,cAA0B,sC,iCCAzC,OAAe,cAA0B,mC,iCCAzC,OAAe,cAA0B,qC,iCCAzC,OAAe,cAA0B,oC,iCCAzC,OAAe,cAA0B,kC,iCCAzC,OAAe,cAA0B,wC,iCCAzC,OAAe,cAA0B,mC,iCCAzC,OAAe,cAA0B,oC,iCCAzC,OAAe,cAA0B,uC,iCCAzC,OAAe,cAA0B,mC,iCCAzC,OAAe,cAA0B,kC,oBCAzC,IAAIH,EAAM,CACT,iBAAkB,IAClB,uBAAwB,IACxB,8BAA+B,IAC/B,8BAA+B,IAC/B,8BAA+B,IAC/B,8BAA+B,IAC/B,8BAA+B,IAC/B,8BAA+B,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UACC,cAAC,IAAD,UACC,cAAC,GAAD,UACC,cAAC,GAAD,UACC,cAACT,GAAD,aClGczrB,QACW,cAA7BuG,OAAO+F,SAAS6f,UAEe,UAA7B5lB,OAAO+F,SAAS6f,UAEhB5lB,OAAO+F,SAAS6f,SAASlqB,MACvB,2DCXNmqB,IAASnM,OAAO,cAAC,GAAD,IAASlL,SAASsX,eAAe,SD0H3C,kBAAmBthB,WACrBA,UAAUuhB,cAAcC,MAAMlmB,MAAK,SAAAmmB,GACjCA,EAAaC,kB","file":"static/js/main.00ff188a.chunk.js","sourcesContent":["var map = {\n\t\"./alert.svg\": 298,\n\t\"./archive.svg\": 299,\n\t\"./arrow_down.svg\": 300,\n\t\"./arrow_rise.svg\": 301,\n\t\"./checked.svg\": 302,\n\t\"./document.svg\": 303,\n\t\"./envelope.svg\": 304,\n\t\"./equal.svg\": 305,\n\t\"./finance.svg\": 306,\n\t\"./hearts.svg\": 307,\n\t\"./home.svg\": 308,\n\t\"./map_marker.svg\": 309,\n\t\"./medal.svg\": 310,\n\t\"./people.svg\": 311,\n\t\"./thumbs-up.svg\": 312,\n\t\"./tools.svg\": 313,\n\t\"./user.svg\": 314\n};\n\n\nfunction webpackContext(req) {\n\tvar id = webpackContextResolve(req);\n\treturn __webpack_require__(id);\n}\nfunction webpackContextResolve(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\treturn map[req];\n}\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = 297;","export default __webpack_public_path__ + \"static/media/alert.d645056a.svg\";","export default __webpack_public_path__ + \"static/media/archive.bf0a94a4.svg\";","export default __webpack_public_path__ + \"static/media/arrow_down.27e29587.svg\";","export default __webpack_public_path__ + \"static/media/arrow_rise.8a0f4917.svg\";","export default __webpack_public_path__ + \"static/media/checked.a61eb1a4.svg\";","export default __webpack_public_path__ + \"static/media/document.55d13580.svg\";","export default __webpack_public_path__ + \"static/media/envelope.94ff653f.svg\";","export default __webpack_public_path__ + \"static/media/equal.0271665a.svg\";","export default __webpack_public_path__ + \"static/media/finance.fb12f2c1.svg\";","export default __webpack_public_path__ + \"static/media/hearts.18e4e40c.svg\";","export default __webpack_public_path__ + \"static/media/home.e9854913.svg\";","export default __webpack_public_path__ + \"static/media/map_marker.a20e18f5.svg\";","export default __webpack_public_path__ + \"static/media/medal.3da91cd2.svg\";","export default __webpack_public_path__ + \"static/media/people.127e3d92.svg\";","export default __webpack_public_path__ + \"static/media/thumbs-up.88aef154.svg\";","export default __webpack_public_path__ + \"static/media/tools.446f6444.svg\";","export default __webpack_public_path__ + \"static/media/user.b8a34532.svg\";","var map = {\n\t\"./5e-small.svg\": 316,\n\t\"./cf-small-white.svg\": 317,\n\t\"./countries/circular/hk.png\": 318,\n\t\"./countries/circular/id.png\": 319,\n\t\"./countries/circular/my.png\": 320,\n\t\"./countries/circular/ph.png\": 321,\n\t\"./countries/circular/sg.png\": 322,\n\t\"./countries/circular/th.png\": 323,\n\t\"./ff-small-white.svg\": 324,\n\t\"./ff-small.svg\": 325,\n\t\"./gravity-logo.svg\": 326\n};\n\n\nfunction webpackContext(req) {\n\tvar id = webpackContextResolve(req);\n\treturn __webpack_require__(id);\n}\nfunction webpackContextResolve(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\treturn map[req];\n}\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = 315;","export default __webpack_public_path__ + \"static/media/5e-small.5ac72d2e.svg\";","export default __webpack_public_path__ + \"static/media/cf-small-white.eecef4e5.svg\";","export default __webpack_public_path__ + \"static/media/hk.7b4761e0.png\";","export default __webpack_public_path__ + \"static/media/id.1007a700.png\";","export default __webpack_public_path__ + \"static/media/my.e6d969ce.png\";","export default __webpack_public_path__ + \"static/media/ph.fbfba7df.png\";","export default __webpack_public_path__ + \"static/media/sg.af9f32b9.png\";","export default __webpack_public_path__ + \"static/media/th.2e3008b3.png\";","export default __webpack_public_path__ + \"static/media/ff-small-white.cd947772.svg\";","export default __webpack_public_path__ + \"static/media/ff-small.1858ffee.svg\";","export default __webpack_public_path__ + \"static/media/gravity-logo.f4caf0ae.svg\";","var map = {\n\t\"./avatar-penguin-smart.png\": 328,\n\t\"./avatar-penguin.png\": 329,\n\t\"./leaderboard-bg.svg\": 330,\n\t\"./start.png\": 331,\n\t\"./working-out.png\": 332,\n\t\"./working-out@2x.png\": 333\n};\n\n\nfunction webpackContext(req) {\n\tvar id = webpackContextResolve(req);\n\treturn __webpack_require__(id);\n}\nfunction webpackContextResolve(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\treturn map[req];\n}\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = 327;","export default __webpack_public_path__ + \"static/media/avatar-penguin-smart.7eef235d.png\";","export default __webpack_public_path__ + \"static/media/avatar-penguin.bccd3f9d.png\";","export default __webpack_public_path__ + \"static/media/leaderboard-bg.ec701a63.svg\";","export default __webpack_public_path__ + \"static/media/start.3054ce27.png\";","export default __webpack_public_path__ + \"static/media/working-out.d35c4bc2.png\";","export default __webpack_public_path__ + \"static/media/working-out@2x.0f90ce4e.png\";","var map = {\n\t\"./en/countries.json\": 391,\n\t\"./en/documents.json\": 392,\n\t\"./en/input.json\": 393,\n\t\"./en/messages.json\": 394,\n\t\"./en/reset-password.json\": 395,\n\t\"./languages.json\": 113\n};\n\n\nfunction webpackContext(req) {\n\tvar id = webpackContextResolve(req);\n\treturn __webpack_require__(id);\n}\nfunction webpackContextResolve(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\treturn map[req];\n}\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = 390;","export const routes = {\n\tDOCUMENTS_URL: \"/:document(terms|statements|faqs)/:brand/:country?\",\n\tRESET_PW_URL: \"/reset-password/:token\",\n\tNOT_FOUND_URL: \"/404\"\n};\n","// default language\n// remember to change the path in requireDefaultTranslations in services/translations.js if defaultLanguage is changed\nexport const defaultLanguage = \"en\";\n\nconst translationRoot = \"public-app\";\n\nexport const translationKeys = {\n\tmessages: `${translationRoot}.messages`,\n\tinputs: `${translationRoot}.inputs`,\n\tdocuments: `${translationRoot}.documents`,\n\tresetPassword: `${translationRoot}.reset-pw`\n};\n","import { configuration } from \"./config\";\n\nconst API_ROOT = configuration.API_ROOT;\nconst API_VERSION = \"v4\";\n\nconst API_PUBLIC_PREFIX = `${API_ROOT}/mobile/public`;\nconst API_MOBILE_PREFIX = `${API_ROOT}/mobile/${API_VERSION}`;\n\nexport const endpoints = {\n\t// ----------------------------------------------------------------------------\n\t// Non-api endpoint\n\t// ----------------------------------------------------------------------------\n\tTRANSLATIONS: \"/translations\",\n\t// ----------------------------------------------------------------------------\n\t// Languages\n\t// ----------------------------------------------------------------------------\n\tLANGUAGES: `${API_MOBILE_PREFIX}/lang`,\n\t// ----------------------------------------------------------------------------\n\t// Countries, Brands, Clubs\n\t// ----------------------------------------------------------------------------\n\tCOUNTRIES: `${API_MOBILE_PREFIX}/country`,\n\tBRANDS: `${API_MOBILE_PREFIX}/brand`,\n\t// ----------------------------------------------------------------------------\n\t// Reset password\n\t// ----------------------------------------------------------------------------\n\tRESET_PW: `${API_PUBLIC_PREFIX}/password/reset`,\n\t// ----------------------------------------------------------------------------\n\t// Compliance\n\t// ----------------------------------------------------------------------------\n\tTERMS_CONDITIONS: `${API_PUBLIC_PREFIX}/terms`,\n\tHEALTH_STATEMENT: `${API_PUBLIC_PREFIX}/statements`,\n\tFAQ: `${API_PUBLIC_PREFIX}/faqs`\n};\n","export const configuration = {\n\tAPI_ROOT: \"https://api-mobile.circuithq.com\"\n};\n","import React from \"react\";\n// libraries\nimport { CSSTransition } from \"react-transition-group\";\n\n// -----------------------------------------------------------------------------\n// EnhancedCSSTransition\n// enhance CSSTransition wrappers by adding one-tick classes `${classNames}-enter-enter` and `${classNames}-exit-enter`\n// They help applying CSS for just on tick to trigger transitions\n// -----------------------------------------------------------------------------\nexport default function EnhancedCSSTransition({\n\tchildren,\n\tclassNames: transitionClassNames,\n\tonEnter,\n\tonEntering,\n\tonExit,\n\tonExiting,\n\t...props\n}) {\n\t// classes\n\tconst generateClass = suffix => {\n\t\treturn `${transitionClassNames}-${suffix}`;\n\t};\n\tconst enterOneTickClass = generateClass(\"enter-enter\");\n\tconst exitOneTickClass = generateClass(\"exit-enter\");\n\n\treturn (\n\t\t {\n\t\t\t\tel.classList.add(enterOneTickClass);\n\t\t\t\tif (onEnter) {\n\t\t\t\t\tonEnter(el, isAppearing);\n\t\t\t\t}\n\t\t\t}}\n\t\t\tonEntering={(el, isAppearing) => {\n\t\t\t\tel.classList.remove(enterOneTickClass);\n\t\t\t\tif (onEntering) {\n\t\t\t\t\tonEntering(el, isAppearing);\n\t\t\t\t}\n\t\t\t}}\n\t\t\tonExit={(el, isAppearing) => {\n\t\t\t\tel.classList.add(exitOneTickClass);\n\t\t\t\tif (onExit) {\n\t\t\t\t\tonExit(el, isAppearing);\n\t\t\t\t}\n\t\t\t}}\n\t\t\tonExiting={(el, isAppearing) => {\n\t\t\t\tel.classList.remove(exitOneTickClass);\n\t\t\t\tif (onExiting) {\n\t\t\t\t\tonExiting(el, isAppearing);\n\t\t\t\t}\n\t\t\t}}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t\n\t);\n}\n","import requireContext from \"require-context.macro\";\n\n// =============================================================================\n// Icons\n// =============================================================================\nconst requireIcons = requireContext(\n\t// Look for files\n\t\"./icons\",\n\t// Do not look in subdirectories\n\tfalse,\n\t// Only include .svg files\n\t/[\\w-]+\\.svg$/\n);\nexport const icons = bulkRequireImages(requireIcons);\n\n// =============================================================================\n// Logos\n// =============================================================================\nconst requireLogos = requireContext(\n\t\"./logos\",\n\ttrue,\n\t/[\\w-]+\\.(?:svg|jpg|png)$/\n);\nexport const logos = bulkRequireImages(requireLogos);\n\n// =============================================================================\n// Photos\n// =============================================================================\nconst requirePhotos = requireContext(\n\t\"./photos\",\n\tfalse,\n\t/[\\w-]+\\.(?:svg|jpg|png)$/\n);\nexport const photos = bulkRequireImages(requirePhotos);\n\n// =============================================================================\n// Function for requiring images\n// =============================================================================\nfunction bulkRequireImages(requiredFiles) {\n\tconst bulkImages = {};\n\t// For each matching file name...\n\trequiredFiles.keys().forEach(filePath => {\n\t\t// Get the PascalCase version of the component name\n\t\tconst imgPath = filePath\n\t\t\t// Remove the \"./\" from the beginning\n\t\t\t.replace(/^\\.\\//, \"\")\n\t\t\t// Remove the file extension from the end\n\t\t\t.replace(/\\.\\w+$/, \"\")\n\t\t\t// Split the path into array\n\t\t\t.split(\"/\");\n\t\t// create reference for the current working object\n\t\tlet thisObject = bulkImages;\n\t\tfor (let i = 0; i < imgPath.length; i++) {\n\t\t\tconst str = imgPath[i];\n\t\t\tif (i < imgPath.length - 1) {\n\t\t\t\t// it is a directory\n\t\t\t\tthisObject[str] = thisObject[str] || {};\n\t\t\t\tthisObject = thisObject[str];\n\t\t\t} else {\n\t\t\t\t// it is a file name\n\t\t\t\tthisObject[str] = requiredFiles(filePath).default;\n\t\t\t}\n\t\t}\n\t\t// store imported images\n\t\t// images[imgName] = requiredFiles(filePath);\n\t});\n\n\treturn bulkImages;\n}\n","import React from \"react\";\n// libaraies\nimport classNames from \"classnames\";\nimport _isArray from \"lodash/isArray\";\nimport { TransitionGroup } from \"react-transition-group\";\n// wrappers\nimport EnhancedCSSTransition from \"components/wrappers/EnhancedCSSTransition\";\n// assets\nimport { icons } from \"assets/images/imageIndex\";\n// utilities\nimport { parseErrors, getParsedMessage } from \"utils/messageControllers\";\n\n// styles\nimport \"./Message.scss\";\n\n// =============================================================================\n// Message\n// =============================================================================\nfunction Message({ status = \"info\", className, children }) {\n\treturn (\n\t\t
{children}
\n\t);\n}\n\n// =============================================================================\n// Message with Animation\n// =============================================================================\nfunction MessageWithAnimation({\n\t// pass to EnhancedCSSTransition\n\ttransitionProps,\n\t// message related\n\ticon,\n\tclosable,\n\tonClose,\n\thideOnClose = true,\n\t// message content\n\tlist,\n\tcontent,\n\tmessage,\n\ttext,\n\tchildren,\n\ttranslationArgs,\n\t...props\n}) {\n\tconst [showMsg, setShowMsg] = React.useState(true);\n\tif (!showMsg && hideOnClose) return null;\n\n\tconst parsedMessages = message && parseErrors(message);\n\n\t// ----------------------------------------------------------------------------\n\t// Content\n\t// ----------------------------------------------------------------------------\n\tconst getMsgContent = () => {\n\t\tif (parsedMessages && _isArray(parsedMessages)) {\n\t\t\treturn (\n\t\t\t\t\n\t\t\t);\n\t\t}\n\t\tconst msg = parsedMessages ? parsedMessages.message : children;\n\t\tif (msg) {\n\t\t\tconst params = parsedMessages && parsedMessages.params;\n\t\t\treturn (\n\t\t\t\t\n\t\t\t);\n\t\t}\n\t\treturn null;\n\t};\n\tconst msgContent = getMsgContent();\n\n\t// ----------------------------------------------------------------------------\n\t// On close\n\t// ----------------------------------------------------------------------------\n\tconst onCloseClick = (...args) => {\n\t\tif (closable) {\n\t\t\tsetShowMsg(false);\n\t\t\tonClose && onClose(...args);\n\t\t}\n\t};\n\n\tconst MessageComponent = (\n\t\t\n\t\t\t{icon && icons[icon] && (\n\t\t\t\t{icon}\n\t\t\t)}\n\t\t\t{msgContent}\n\t\t\t{closable && \n\t\t);\n\t}\n}\n\nexport default CustomButton;\n","import React from \"react\";\n// libraries\nimport { Segment } from \"semantic-ui-react\";\n// constants\nimport { translationKeys } from \"constants/translations\";\nimport { allTokenVerificationStatus, allSubmissionStatus } from \"./constants\";\n// components\nimport SimpleLoader from \"components/Loaders/SimpleLoader/SimpleLoader\";\nimport LanguageSelector from \"components/LanguageSelector/LanguageSelector\";\nimport CustomForm from \"components/Forms/CustomForm\";\nimport Input from \"components/Inputs/Input/Input\";\nimport CustomButton from \"components/Buttons/CustomButton\";\nimport Message from \"components/Messages/Message\";\n// utilities\nimport { enhancedTranslate, deepTranslate } from \"utils/translationHelpers\";\n// styles\nimport \"./reset-password.scss\";\n\nconst translationRootKey = translationKeys.resetPassword;\n\nfunction ResetPasswordPresentation(props) {\n\treturn (\n\t\t
\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t
\n\t);\n}\n\nexport default ResetPasswordPresentation;\n\nclass ResetPasswordForm extends React.Component {\n\trenderErrorMessages = errorMessages => {\n\t\treturn (\n\t\t\t\n\t\t);\n\t};\n\n\trender() {\n\t\tconst {\n\t\t\tnewPW,\n\t\t\tconfirmPW,\n\t\t\ttokenVerificationStatus,\n\t\t\tsubmissionStatus,\n\t\t\thandleChange,\n\t\t\tonSubmit,\n\t\t\terrorMessages\n\t\t} = this.props;\n\n\t\tif (tokenVerificationStatus === allTokenVerificationStatus.verifying) {\n\t\t\treturn ;\n\t\t}\n\t\t// ---------------------------------------------------------------------\n\t\t// Token status\n\t\t// ---------------------------------------------------------------------\n\t\tconst isTokenVerified =\n\t\t\ttokenVerificationStatus === allTokenVerificationStatus.success;\n\t\t// ---------------------------------------------------------------------\n\t\t// Submission status\n\t\t// ---------------------------------------------------------------------\n\t\tconst isSubmitting = submissionStatus === allSubmissionStatus.submitting;\n\t\tconst isSubmissionSuccessful =\n\t\t\tsubmissionStatus === allSubmissionStatus.success;\n\t\t// ---------------------------------------------------------------------\n\t\t// Others\n\t\t// ---------------------------------------------------------------------\n\t\tconst showForm = isTokenVerified && !isSubmissionSuccessful;\n\n\t\treturn (\n\t\t\t
\n\t\t\t\t

\n\t\t\t\t\t{enhancedTranslate(`${translationRootKey}.header`)}\n\t\t\t\t\t\n\t\t\t\t

\n\t\t\t\t
\n\t\t\t\t\t{enhancedTranslate(\n\t\t\t\t\t\t`${translationRootKey}.descriptions.${\n\t\t\t\t\t\t\tisTokenVerified\n\t\t\t\t\t\t\t\t? isSubmissionSuccessful\n\t\t\t\t\t\t\t\t\t? \"success\"\n\t\t\t\t\t\t\t\t\t: \"token-verified\"\n\t\t\t\t\t\t\t\t: \"token-invalid\"\n\t\t\t\t\t\t}`\n\t\t\t\t\t)}\n\t\t\t\t\t{!showForm && this.renderErrorMessages(errorMessages)}\n\t\t\t\t
\n\t\t\t\t{showForm && (\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t value === newPW}\n\t\t\t\t\t\t\tmessages={{\n\t\t\t\t\t\t\t\tinvalid: `${translationRootKey}.messages.unmatched-passwords`\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\ttype=\"password\"\n\t\t\t\t\t\t\trequired\n\t\t\t\t\t\t\tdisabled={isSubmitting}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{this.renderErrorMessages(errorMessages)}\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t)}\n\t\t\t
\n\t\t);\n\t}\n}\n","// constants\nimport { endpoints } from \"constants/api\";\n// service utilities\nimport { handleErrors } from \"./utils/core\";\n\n// =============================================================================\n// Verify\n// =============================================================================\nexport function resetPasswordVerifyToken(token) {\n\tif (token) {\n\t\treturn fetch(`${endpoints.RESET_PW}/${token}`, {\n\t\t\tmethod: \"GET\"\n\t\t}).then(handleErrors);\n\t} else {\n\t\t// This should never kick in.\n\t\t// If the token is empty, the user will be routed to a 404 page instead.\n\t\t// keep it just for fail-safe purpose\n\t\treturn Promise.reject([\"Token is empty\"]);\n\t}\n}\n\n// =============================================================================\n// Reset\n// =============================================================================\nexport function resetPasswordSubmit({ token, password, password_confirm }) {\n\treturn fetch(`${endpoints.RESET_PW}/${token}`, {\n\t\tmethod: \"PUT\",\n\t\theaders: {\n\t\t\t\"Content-Type\": \"application/json\"\n\t\t},\n\t\tbody: JSON.stringify({\n\t\t\tpassword: password,\n\t\t\tpassword_confirm: password_confirm\n\t\t})\n\t}).then(handleErrors);\n}\n","import React from \"react\";\n// libraries\nimport { withRouter } from \"react-router-dom\";\n// constants\nimport { translationKeys } from \"constants/translations\";\nimport { allTokenVerificationStatus, allSubmissionStatus } from \"./constants\";\n// components\nimport ResetPasswordPresentation from \"./presentation\";\n// services\nimport {\n\tresetPasswordVerifyToken,\n\tresetPasswordSubmit\n} from \"services/reset-password\";\n// utilities\nimport { parseErrors } from \"utils/messageControllers\";\n\nclass ResetPasswordPage extends React.Component {\n\t_isUnmounted = false;\n\n\tstate = {\n\t\tnewPW: \"\",\n\t\tconfirmPW: \"\",\n\t\ttokenVerificationStatus: allTokenVerificationStatus.verifying,\n\t\tsubmissionStatus: allSubmissionStatus.notSubmitted,\n\t\terrorMessages: null\n\t};\n\n\tprotectedSetStatus = (...args) => {\n\t\tif (this._isUnmounted) return;\n\t\tthis.setState(...args);\n\t};\n\n\thandleChange = e =>\n\t\tthis.protectedSetStatus({ [e.target.name]: e.target.value });\n\n\t// ============================================================================\n\t// Error message\n\t// ============================================================================\n\tsetErrorMessages = value => {\n\t\tthis.protectedSetStatus({ errorMessages: value });\n\t};\n\n\t// ============================================================================\n\t// Token\n\t// ============================================================================\n\tgetToken = () => {\n\t\tconst { match } = this.props;\n\t\treturn match.params && match.params.token;\n\t};\n\n\tsetTokenVerificationData = value => {\n\t\tthis.protectedSetStatus({\n\t\t\ttokenVerificationStatus: value\n\t\t});\n\t};\n\n\tverifyToken = async () => {\n\t\tconst token = this.getToken();\n\t\treturn resetPasswordVerifyToken(token)\n\t\t\t.then(data => {\n\t\t\t\tthis.setTokenVerificationData(allTokenVerificationStatus.success);\n\t\t\t\tthis.setErrorMessages(null);\n\t\t\t})\n\t\t\t.catch(error => {\n\t\t\t\tthis.setTokenVerificationData(allTokenVerificationStatus.fail);\n\t\t\t\tthis.setErrorMessages(error);\n\t\t\t});\n\t};\n\n\t// ============================================================================\n\t// Submission\n\t// ============================================================================\n\tsetSubmissionStatus = value => {\n\t\tthis.protectedSetStatus({ submissionStatus: value });\n\t};\n\n\tonSubmit = () => {\n\t\tconst token = this.getToken();\n\t\tconst { newPW, confirmPW } = this.state;\n\n\t\tthis.setSubmissionStatus(allSubmissionStatus.submitting);\n\t\tresetPasswordSubmit({ token, password: newPW, password_confirm: confirmPW })\n\t\t\t.then(data => {\n\t\t\t\tthis.setSubmissionStatus(allSubmissionStatus.success);\n\t\t\t\tthis.setErrorMessages(null);\n\t\t\t})\n\t\t\t.catch(error => {\n\t\t\t\t// if errors_validator_regex error exists, there is something wrong between the frontend and the backend\n\t\t\t\t// as it will only exist if the password passes the frontend validation but not the backend one.\n\t\t\t\tconst parsedError = parseErrors(error).map(e => ({\n\t\t\t\t\t...e,\n\t\t\t\t\tparams: e.params.map(param =>\n\t\t\t\t\t\t// if the param is \"password\", return the translation key instead\n\t\t\t\t\t\tparam === \"password\"\n\t\t\t\t\t\t\t? `${translationKeys.resetPassword}.labels.new-pw`\n\t\t\t\t\t\t\t: param\n\t\t\t\t\t)\n\t\t\t\t}));\n\t\t\t\tthis.setSubmissionStatus(allSubmissionStatus.fail);\n\t\t\t\tthis.setErrorMessages(parsedError);\n\t\t\t});\n\t};\n\n\t// ============================================================================\n\t// Reset form\n\t// ============================================================================\n\tresetForm = () => {\n\t\tthis.setSubmissionStatus(allSubmissionStatus.verifying);\n\t\tthis.setErrorMessages(null);\n\t};\n\n\t// ============================================================================\n\t// Core\n\t// ============================================================================\n\tcomponentDidMount() {\n\t\tthis.verifyToken();\n\t\tdocument.title = \"Reset Password\";\n\t}\n\n\tcomponentWillUnmount() {\n\t\tthis._isUnmounted = true;\n\t}\n\n\tcomponentDidUpdate(prevProps) {\n\t\tconst prevToken = prevProps.match.params && prevProps.match.params.token;\n\t\tconst currentToken = this.getToken();\n\t\tif (prevToken !== currentToken) {\n\t\t\tthis.resetForm();\n\t\t\tthis.verifyToken();\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t\n\t\t);\n\t}\n}\n\nexport default withRouter(ResetPasswordPage);\n","import React, { useState, useEffect, useRef } from \"react\";\n// libraries\nimport classNames from \"classnames\";\n// styles\nimport \"./DotDotContainer.scss\";\n\nfunction DotDotContainer({\n\tclassName,\n\tchildren,\n\tshrinkableElement: ShrinkableElement,\n\tstaticElement: StaticElement,\n\t...rest\n}) {\n\tconst [displayDots, setDisplayDots] = useState(false);\n\n\tconst shrinkableElementRef = useRef();\n\n\tfunction updateDotState() {\n\t\tif (\n\t\t\tshrinkableElementRef.current.offsetWidth <\n\t\t\tshrinkableElementRef.current.scrollWidth\n\t\t) {\n\t\t\tsetDisplayDots(true);\n\t\t} else {\n\t\t\tsetDisplayDots(false);\n\t\t}\n\t}\n\n\tuseEffect(() => {\n\t\tupdateDotState();\n\t}, [children, ShrinkableElement, StaticElement]);\n\n\treturn (\n\t\t
\n\t\t\t
\n\t\t\t\t{children || }\n\t\t\t
\n\t\t\t{displayDots &&
...
}\n\t\t\t{StaticElement && (\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t)}\n\t\t
\n\t);\n}\n\nexport default DotDotContainer;\n","import React from \"react\";\n// libraries\nimport classNames from \"classnames\";\n// styles\nimport \"./SimpleCount.scss\";\n\nexport default function SimpleCount({ className, children, count }) {\n\tconst value = children === undefined ? count : children;\n\n\treturn (\n\t\t\n\t\t\t{value}\n\t\t\n\t);\n}\n","import React from \"react\";\n// libraries\nimport classNames from \"classnames\";\nimport _isArray from \"lodash/isArray\";\nimport _isObject from \"lodash/isObject\";\nimport _isEmpty from \"lodash/isEmpty\";\n// assets\nimport { MdClose, MdSearch } from \"react-icons/md\";\nimport { IoIosArrowDown, IoIosArrowUp } from \"react-icons/io\";\n// constants\nimport { translationKeys } from \"constants/translations\";\n// components\nimport DotDotContainer from \"components/DotDotContainer/DotDotContainer\";\nimport SimpleLoader from \"components/Loaders/SimpleLoader/SimpleLoader\";\nimport SimpleCount from \"components/Count/SimpleCount\";\n// contexts\nimport { useTranslations } from \"contexts/TranslationContext\";\n// styles\nimport \"./DropdownTrigger.scss\";\n\nconst classNamePrefix = \"select-trigger\";\n\nfunction DropdownTrigger({\n\tforwardedRef,\n\tvariant,\n\t// trigger only props\n\tclassName,\n\tcomponents = {},\n\temptyMessage,\n\tonClick,\n\t// custom props\n\tcloseMenu,\n\tisAsync,\n\tisMenuOpen,\n\t// general props\n\tvalue,\n\tonChange,\n\tgetOptionLabel,\n\tgetOptionValue,\n\toptionSingleComponent,\n\tisMulti,\n\tisDisabled,\n\tisLoading,\n\tisClearable,\n\t...rest\n}) {\n\tconst { translate } = useTranslations();\n\n\t// =========================================================================\n\t// Components\n\t// =========================================================================\n\tconst {\n\t\tControl = DropdownTriggerUniversalComponent,\n\t\tEmptyMessage = DropdownTriggerUniversalComponent,\n\t\tCount = SimpleCount,\n\t\tValueWrapper = DotDotContainer,\n\t\tValueContainer = DropdownTriggerUniversalComponent,\n\t\tSingleValue = DropdownTriggerUniversalComponent,\n\t\tSingleValueContent = optionSingleComponent,\n\t\tDropdownIndicator = DropdownTriggerUniversalComponent,\n\t\tDropdownIcon = isAsync\n\t\t\t? MdSearch\n\t\t\t: isMenuOpen\n\t\t\t? IoIosArrowUp\n\t\t\t: IoIosArrowDown,\n\t\tLoadingIndicator = DropdownTriggerUniversalComponent,\n\t\tCloseIndicator = DropdownTriggerUniversalComponent\n\t} = components;\n\n\t// =========================================================================\n\t// Values & Props\n\t// =========================================================================\n\tconst hasValue = !!value && (!_isArray(value) || !!value.length);\n\n\tconst values = _isArray(value)\n\t\t? value\n\t\t: // avoid empty value like \"\"\n\t\t!value || (_isObject(value) && _isEmpty(value))\n\t\t? []\n\t\t: [value];\n\n\tconst commonProps = {\n\t\tclassNamePrefix,\n\t\thasValue,\n\t\tvalue,\n\t\tgetOptionLabel,\n\t\tgetOptionValue,\n\t\tisDisabled,\n\t\tisLoading,\n\t\tisMulti\n\t};\n\n\t// =========================================================================\n\t// Parms\n\t// =========================================================================\n\tconst showCloseIndicator = hasValue && isClearable;\n\n\tconst showCount = isMulti && !!values.length;\n\n\t// =========================================================================\n\t// Return\n\t// =========================================================================\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\t{showCount && (\n\t\t\t\t\t\n\t\t\t\t\t\t{values.length}\n\t\t\t\t\t\n\t\t\t\t)}\n\t\t\t\t\n\t\t\t\t\t{hasValue ? (\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{values.map(data => (\n\t\t\t\t\t\t\t\t// TODO: we can make it like what in the past with the cross and allow multi-line\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t{SingleValueContent ? (\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\tgetOptionLabel(data)\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\n\t\t\t\t\t) : (\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{translate(\n\t\t\t\t\t\t\t\temptyMessage || `${translationKeys.inputs}.select.select`\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\n\t\t\t\t\t)}\n\t\t\t\t\n\t\t\t\t{isLoading && (\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t)}\n\t\t\t\t\n\t\t\t\t\t{DropdownIcon && }\n\t\t\t\t\n\t\t\t\t{showCloseIndicator && (\n\t\t\t\t\t {\n\t\t\t\t\t\t\te.stopPropagation();\n\t\t\t\t\t\t\tcloseMenu();\n\t\t\t\t\t\t\tonChange(null, { action: \"clear\", removedValue: value });\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tdata-testid=\"select-trigger_clear\"\n\t\t\t\t\t>\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t)}\n\t\t\t\n\t\t\n\t);\n}\n\nexport default DropdownTrigger;\n\n// =============================================================================\n// Default components\n// =============================================================================\nexport function DropdownTriggerUniversalComponent({\n\tchildren,\n\tclassName,\n\tclassNamePrefix,\n\thasValue,\n\tvalue,\n\tdata,\n\tgetOptionLabel,\n\tgetOptionValue,\n\tisDisabled,\n\tisLoading,\n\tisMulti,\n\t...rest\n}) {\n\treturn (\n\t\t
\n\t\t\t{children}\n\t\t
\n\t);\n}\n","import React from \"react\";\n// libraries\nimport classNames from \"classnames\";\n// utilities\nimport { enhancedTranslate } from \"utils/translationHelpers\";\n// assets\nimport { ImCheckmark } from \"react-icons/im\";\n\n// styles\nimport \"./Checkbox.scss\";\n\nclass Checkbox extends React.Component {\n\tstatic componentName = \"Checkbox\";\n\tgetIsChecked = () => {\n\t\tconst { value } = this.props;\n\t\treturn Boolean(value);\n\t};\n\n\thandleOnClick = () => {\n\t\tconst { onChange, name, hasTodo } = this.props;\n\t\tconst isChecked = this.getIsChecked();\n\t\t// TODO: this is temporary until we redo the Settings pages.\n\t\t// refer to ClubSettingsManagement.js - handleGeneralInputChange\n\t\tif (hasTodo) {\n\t\t\tonChange &&\n\t\t\t\tonChange({\n\t\t\t\t\ttarget: {\n\t\t\t\t\t\tname: name,\n\t\t\t\t\t\tvalue: !isChecked\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t} else {\n\t\t\tonChange && onChange(!isChecked);\n\t\t}\n\t};\n\n\trender() {\n\t\tconst { className, text } = this.props;\n\t\tconst isChecked = this.getIsChecked();\n\t\treturn (\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t{isChecked && }\n\t\t\t\t
\n\t\t\t\t\n\t\t\t\n\t\t);\n\t}\n}\nexport default Checkbox;\n","import React, { useState, useRef, useEffect, useCallback } from \"react\";\n// libraries\nimport classNames from \"classnames\";\nimport Select, { components as reactSelectComponents } from \"react-select\";\nimport _isArray from \"lodash/isArray\";\n// assets\nimport { MdSearch } from \"react-icons/md\";\n// constants\nimport { translationKeys } from \"constants/translations\";\n// contexts\nimport { useTranslations } from \"contexts/TranslationContext\";\n// components\nimport Input from \"components/Inputs/Input/Input\";\nimport Checkbox from \"components/Inputs/Checkbox/Checkbox\";\n// utilities\nimport { displayError } from \"utils/messageControllers\";\n// styles\nimport \"./DropdownMenu.scss\";\n\n// =============================================================================\n// Variables\n// =============================================================================\nconst classNamePrefix = \"select-menu\";\n\nconst defaultStyles = {\n\tvalueContainer: provided => {\n\t\treturn {\n\t\t\t...provided,\n\t\t\toverflow: \"visible\"\n\t\t};\n\t},\n\tsingleValue: (provided, state) => {\n\t\tconst isHidden = state.selectProps.inputValue;\n\t\treturn {\n\t\t\tposition: \"relative\",\n\t\t\ttop: \"auto\",\n\t\t\ttransform: \"none\",\n\t\t\tvisibility: isHidden ? \"hidden\" : \"visible\"\n\t\t};\n\t},\n\tmenu: provided => {\n\t\treturn {\n\t\t\t...provided,\n\t\t\tposition: \"relative\",\n\t\t\ttop: null\n\t\t};\n\t}\n};\n\n// =============================================================================\n// Menu\n// =============================================================================\nfunction DropdownMenu(props) {\n\tconst {\n\t\t// inner refs\n\t\tinnerRefs: { wrapper: wrapperRef },\n\t\t// wrapper\n\t\twrapperStyle,\n\t\t// menu only props\n\t\tclassName,\n\t\tstyle,\n\t\tplaceholder,\n\t\tstyles,\n\t\tcomponents,\n\t\tdefaultInputValue,\n\t\tonOptionUpdated,\n\t\tonValueUpdated,\n\t\tcloseMenu,\n\t\t// general props\n\t\tvalue,\n\t\tlabel,\n\t\tdescription,\n\t\tonChange,\n\t\toptions: optionsFromProps,\n\t\tloadOptions,\n\t\tgetOptionLabel,\n\t\tgetOptionValue,\n\t\toptionSingleComponent,\n\t\trequired,\n\t\tisDisabled,\n\t\tisLoading,\n\t\tisMulti,\n\t\tnoOptionsMessage,\n\t\tnoOptionsMessageFunc, // should return { key: string, args: object }\n\t\tloadingMessage: loadingMessageFromProps,\n\t\tparentOptionLinkField,\n\t\tisSearchable,\n\t\t...menuProps\n\t} = props;\n\n\tconst { translate } = useTranslations();\n\n\tconst [inputValue, setInputValue] = useState(defaultInputValue);\n\n\tconst [options, setOptions] = useState(optionsFromProps);\n\n\t// The counter is a trick used to avoid multiple fetches overlaping the result\n\t// It acts as an extra layer of protection in case the AbortController cannot be use\n\t// For example when the loadOptions is a promise but not a fetch\n\tconst isLoadingOptionsCounterRef = useRef(0);\n\tconst [isLoadingOptions, setIsLoadingOptions] = useState(false);\n\n\tconst inputRef = useRef();\n\n\tconst abortControllerRef = useRef();\n\n\tconst isAsync = !!loadOptions;\n\n\tconst loadingMessage = loadingMessageFromProps\n\t\t? translate(loadingMessageFromProps)\n\t\t: translate(`${translationKeys.inputs}.select.loading`) + \"...\";\n\n\t// =============================================================================\n\t// No option message\n\t// =============================================================================\n\tconst _newNoOptionsMessageFunc = useCallback(\n\t\t({ inputValue }) => {\n\t\t\tif (noOptionsMessageFunc) {\n\t\t\t\tconst { key, args } = noOptionsMessageFunc({ inputValue });\n\t\t\t\treturn translate(key, args);\n\t\t\t}\n\n\t\t\tif (isAsync && !noOptionsMessage) {\n\t\t\t\treturn inputValue\n\t\t\t\t\t? translate(`${translationKeys.inputs}.select.no-options.no-matched`)\n\t\t\t\t\t: \"\";\n\t\t\t}\n\t\t\treturn translate(\n\t\t\t\tnoOptionsMessage ||\n\t\t\t\t\t`${translationKeys.inputs}.select.no-options.default`\n\t\t\t);\n\t\t},\n\t\t[translate, isAsync, noOptionsMessage, noOptionsMessageFunc]\n\t);\n\n\t// =========================================================================\n\t// useEffect\n\t// =========================================================================\n\t// -------------------------------------------------------------------------\n\t// Focus input\n\t// -------------------------------------------------------------------------\n\t// always focus on the input if the menu is open\n\tuseEffect(() => {\n\t\tinputRef.current && inputRef.current.focus();\n\t}, [inputValue, value, options, isLoadingOptions]);\n\n\t// -------------------------------------------------------------------------\n\t// Sync options\n\t// the reason to separate the two useEffect is to avoid mixing the dependencies\n\t// -------------------------------------------------------------------------\n\t// update options for sync select\n\tuseEffect(() => {\n\t\tif (!isAsync) {\n\t\t\tsetOptions(optionsFromProps);\n\t\t}\n\t}, [isAsync, optionsFromProps]);\n\n\t// load options for async select\n\tuseEffect(() => {\n\t\tif (isAsync) {\n\t\t\tsetOptions([]);\n\t\t\tif (inputValue) {\n\t\t\t\tisLoadingOptionsCounterRef.current++;\n\t\t\t\tsetIsLoadingOptions(true);\n\n\t\t\t\t// abort the previous fetch\n\t\t\t\tabortControllerRef.current && abortControllerRef.current.abort();\n\t\t\t\t// create a new abort controller\n\t\t\t\tconst abortController = new AbortController();\n\t\t\t\tabortControllerRef.current = abortController;\n\n\t\t\t\t// debounce will not be handled here in order to achieve a more responsive result\n\t\t\t\t// see UserSelect for an example of how to use it together with debounce\n\t\t\t\t// call the function and pass the controller as well\n\t\t\t\tloadOptions(inputValue, abortController.signal)\n\t\t\t\t\t// make it goes first\n\t\t\t\t\t.finally(() => {\n\t\t\t\t\t\tisLoadingOptionsCounterRef.current--;\n\t\t\t\t\t\tif (!isLoadingOptionsCounterRef.current) {\n\t\t\t\t\t\t\tsetIsLoadingOptions(false);\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\t.then(data => {\n\t\t\t\t\t\tif (!isLoadingOptionsCounterRef.current) {\n\t\t\t\t\t\t\tsetOptions(data);\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\t// remember the loadOptions function should throw an error on failure\n\t\t\t\t\t.catch(displayError);\n\t\t\t}\n\t\t}\n\t}, [\n\t\tinputValue,\n\t\tisAsync,\n\t\t// If the options are updated in a wrong time, it is probably due to loadOptions\n\t\t// Make sure to use useCallback if hook is used.\n\t\tloadOptions\n\t]);\n\n\t// -------------------------------------------------------------------------\n\t// On updated\n\t// -------------------------------------------------------------------------\n\tuseEffect(\n\t\t() => {\n\t\t\tonOptionUpdated && onOptionUpdated();\n\t\t},\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[options]\n\t);\n\n\tuseEffect(\n\t\t() => {\n\t\t\t// When the value is updated, the dom will need 1 more tick to update the UI.\n\t\t\t// Thus the delay is needed.\n\t\t\tsetTimeout(() => {\n\t\t\t\tonValueUpdated && onValueUpdated();\n\t\t\t}, 0);\n\t\t},\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[value]\n\t);\n\n\t// -------------------------------------------------------------------------\n\t// On mount\n\t// -------------------------------------------------------------------------\n\tuseEffect(\n\t\t() => {\n\t\t\treturn () => {\n\t\t\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t\t\tconst abortController = abortControllerRef.current;\n\t\t\t\tabortController && abortController.abort();\n\t\t\t};\n\t\t},\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[]\n\t);\n\n\t// =========================================================================\n\t// Return\n\t// =========================================================================\n\treturn (\n\t\t\n\t\t\t loadingMessage}\n\t\t\t\tisLoading={isLoading || isLoadingOptions}\n\t\t\t\t{...menuProps}\n\t\t\t\t// necessary props to make select popout\n\t\t\t\tbackspaceRemovesValue={false}\n\t\t\t\tcontrolShouldRenderValue={false}\n\t\t\t\tcloseMenuOnSelect={false}\n\t\t\t\tisClearable={false}\n\t\t\t\tisSearchable={true}\n\t\t\t\tisMulti={isMulti}\n\t\t\t\tmenuIsOpen\n\t\t\t\tfilterOption={isAsync ? () => true : undefined}\n\t\t\t\t// we use our way to handle async as we are using inputValue to control search\n\t\t\t\t// reason: https://github.com/JedWatson/react-select/issues/3047\n\t\t\t\tasync={false}\n\t\t\t/>\n\t\t\n\t);\n}\n\nexport default DropdownMenu;\n\n// =============================================================================\n// Replace Components\n// =============================================================================\nfunction getReplaceComponents(\n\t// original props\n\t{\n\t\tvalue,\n\t\tcomponents,\n\t\toptionSingleComponent: OptionSingleComponent,\n\t\tgetOptionLabel,\n\t\tgetOptionValue,\n\t\tisSearchable,\n\t\tisMulti,\n\t\tparentOptionLinkField,\n\t\tcloseMenu\n\t},\n\t// extra props\n\t{ inputRef, inputValue, setInputValue }\n) {\n\t// ---------------------------------------------------------------------\n\t// Stage #1: declare components that are indepentent\n\t// ---------------------------------------------------------------------\n\tlet defaultComponents = {\n\t\t// -----------------------------------------------------------------\n\t\t// Control\n\t\t// -----------------------------------------------------------------\n\t\tControl: props => {\n\t\t\tif (isSearchable) {\n\t\t\t\treturn ;\n\t\t\t} else {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t},\n\t\t// -----------------------------------------------------------------\n\t\t// Value\n\t\t// -----------------------------------------------------------------\n\t\tSingleValue: ({ children, ...props }) => {\n\t\t\treturn (\n\t\t\t\t\n\t\t\t\t\t{OptionSingleComponent ? (\n\t\t\t\t\t\t\n\t\t\t\t\t) : (\n\t\t\t\t\t\tchildren\n\t\t\t\t\t)}\n\t\t\t\t\n\t\t\t);\n\t\t},\n\t\tMultiValue: ({ children, ...props }) => {\n\t\t\t// for Select with addAllOption, do not display all items if \"All\" is selected\n\t\t\t// just display \"All\" instead\n\t\t\tif (\n\t\t\t\tprops.selectProps.value.find(\n\t\t\t\t\toption =>\n\t\t\t\t\t\toption.value === \"*\" &&\n\t\t\t\t\t\toption[parentOptionLinkField] === props.data[parentOptionLinkField]\n\t\t\t\t) &&\n\t\t\t\tprops.data.value !== \"*\"\n\t\t\t) {\n\t\t\t\treturn null;\n\t\t\t} else {\n\t\t\t\treturn (\n\t\t\t\t\t\n\t\t\t\t\t\t{OptionSingleComponent ? (\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\tchildren\n\t\t\t\t\t\t)}\n\t\t\t\t\t\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t\t// -----------------------------------------------------------------\n\t\t// Options/Lists\n\t\t// -----------------------------------------------------------------\n\t\tOption: ({ children, ...props }) => {\n\t\t\tconst { isSelected, data } = props;\n\n\t\t\tconst content = OptionSingleComponent ? (\n\t\t\t\t\n\t\t\t) : (\n\t\t\t\tchildren\n\t\t\t);\n\n\t\t\treturn (\n\t\t\t\t {\n\t\t\t\t\t\tif (!isMulti) {\n\t\t\t\t\t\t\tcloseMenu();\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t\n\t\t\t\t\t\t{isMulti && }\n\t\t\t\t\t\t{content}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t);\n\t\t},\n\t\t// -----------------------------------------------------------------\n\t\t// Indicators\n\t\t// -----------------------------------------------------------------\n\t\tDropdownIndicator: props => {\n\t\t\treturn (\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t);\n\t\t},\n\t\tInput: props => {\n\t\t\tconst { onChange } = props;\n\t\t\treturn (\n\t\t\t\t {\n\t\t\t\t\t\tsetInputValue(e.target.value);\n\t\t\t\t\t\tonChange(e); // used to trigger the async loadOptions\n\t\t\t\t\t}}\n\t\t\t\t\tplaceholder=\"\" // remove the placeholder\n\t\t\t\t\tdata-testid=\"select-menu__input-dom\"\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\t};\n\n\t// ---------------------------------------------------------------------\n\t// Stage #2, declare components that are depending others\n\t// ---------------------------------------------------------------------\n\tconst { Option = reactSelectComponents.Option } = {\n\t\t...defaultComponents,\n\t\t...components\n\t};\n\n\tdefaultComponents = {\n\t\t...defaultComponents,\n\t\tNoOptionsMessage: ({ children, ...props }) => {\n\t\t\tconst showSelectedItems =\n\t\t\t\tisMulti && !inputValue && value && !!value.length;\n\n\t\t\t// handle an edge case that isMulti is enabled on the fly\n\t\t\tconst values = _isArray(value) ? value : [value];\n\n\t\t\treturn (\n\t\t\t\t<>\n\t\t\t\t\t\n\t\t\t\t\t\t{children}\n\t\t\t\t\t\n\t\t\t\t\t{showSelectedItems &&\n\t\t\t\t\t\tvalues.map(data => {\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t props.selectOption(data)\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t{...props}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{getOptionLabel(data)}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t})}\n\t\t\t\t\n\t\t\t);\n\t\t}\n\t};\n\n\treturn { ...defaultComponents, ...components };\n}\n","import React, { useEffect, useRef, useCallback } from \"react\";\n// libraries\nimport classNames from \"classnames\";\nimport { ResizeObserver } from \"@juggle/resize-observer\"; // use it in the form of a polyfill\n// utilities\nimport { getWindowWidth, getWindowHeight } from \"utils/window\";\n\nexport default function ElementWithPopup(props) {\n\tconst {\n\t\ttriggerRef,\n\t\tscrollableElementRef,\n\t\tchildren,\n\t\trender,\n\t\ttrigger,\n\t\tisOpen,\n\t\tclosePopup,\n\t\tcloseOnScroll,\n\t\tpopupPosition\n\t} = props;\n\tconst popupRef = useRef();\n\tconst resizeObserverRef = useRef();\n\n\tconst correctPosition = event => {\n\t\tconst triggerDOM = triggerRef?.current;\n\t\tconst popupDOM = popupRef?.current;\n\n\t\tif (!triggerDOM || !popupDOM) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (event?.type === \"scroll\" && popupDOM.contains(event.target)) {\n\t\t\t// do nothing if we are scrolling the child elements of the popup\n\t\t\treturn;\n\t\t}\n\n\t\t// -----------------------------------------------------------------\n\t\t// Step 0: clear the maxHeight so the popup will occupy its full height\n\t\t// -----------------------------------------------------------------\n\t\tpopupDOM.style.maxHeight = null;\n\n\t\t// -----------------------------------------------------------------\n\t\t// Step 1: declare variables\n\t\t// -----------------------------------------------------------------\n\t\tconst windowWidth = getWindowWidth();\n\t\tconst windowHeight = getWindowHeight();\n\n\t\tconst {\n\t\t\ttop: triggerTop,\n\t\t\tleft: triggerLeft,\n\t\t\tright: triggerRight,\n\t\t\tbottom: triggerBottom\n\t\t} = triggerDOM.getBoundingClientRect();\n\t\tconst {\n\t\t\ttop: popupTop,\n\t\t\tleft: popupLeft,\n\t\t\twidth: popupWidth,\n\t\t\theight: popupHeight\n\t\t} = popupDOM.getBoundingClientRect();\n\n\t\t// -----------------------------------------------------------------\n\t\t// Step 2: handle top\n\t\t// determine whether the popup should open downward or upward\n\t\t// -----------------------------------------------------------------\n\t\tlet targetPopupTop, isOpenUpward, maxPopupHeight;\n\n\t\tconst downwardSpace = windowHeight - triggerBottom;\n\t\tconst upwardSpace = triggerTop;\n\t\tif (popupHeight <= downwardSpace) {\n\t\t\t// open downward\n\t\t\tisOpenUpward = false;\n\t\t\ttargetPopupTop = triggerBottom;\n\t\t} else if (popupHeight <= upwardSpace) {\n\t\t\t// open upward\n\t\t\tisOpenUpward = true;\n\t\t\ttargetPopupTop = upwardSpace - popupHeight;\n\t\t} else {\n\t\t\t// not enough space to open upward nor downward\n\t\t\t// find out whether upward or downward will have more space\n\t\t\tif (downwardSpace >= upwardSpace) {\n\t\t\t\t// open downward, set the max height equal to the space\n\t\t\t\tisOpenUpward = false;\n\t\t\t\ttargetPopupTop = triggerBottom;\n\t\t\t\tmaxPopupHeight = downwardSpace;\n\t\t\t} else {\n\t\t\t\t// open upward, set the max height equal to the space\n\t\t\t\tisOpenUpward = true;\n\t\t\t\ttargetPopupTop = 0;\n\t\t\t\tmaxPopupHeight = upwardSpace;\n\t\t\t}\n\t\t}\n\n\t\t// apply the styles\n\t\tif (isOpenUpward) {\n\t\t\tpopupDOM.classList.add(\"up\");\n\t\t\tpopupDOM.classList.remove(\"down\");\n\t\t} else {\n\t\t\tpopupDOM.classList.add(\"down\");\n\t\t\tpopupDOM.classList.remove(\"up\");\n\t\t}\n\t\tif (popupTop !== targetPopupTop) {\n\t\t\tpopupDOM.style.top = targetPopupTop + \"px\";\n\t\t}\n\t\tif (maxPopupHeight) {\n\t\t\tpopupDOM.style.maxHeight = maxPopupHeight + \"px\";\n\t\t}\n\n\t\t// -----------------------------------------------------------------\n\t\t// Step 3: handle left\n\t\t// -----------------------------------------------------------------\n\t\t// default to triggerLeft\n\t\tlet targetPopupLeft = triggerLeft;\n\t\tif (popupPosition === \"right\") {\n\t\t\ttargetPopupLeft = triggerRight - popupWidth;\n\t\t}\n\t\tif (targetPopupLeft < 0) {\n\t\t\ttargetPopupLeft = 0;\n\t\t} else if (targetPopupLeft + popupWidth > windowWidth) {\n\t\t\ttargetPopupLeft = windowWidth - popupWidth;\n\t\t}\n\n\t\t// apply the styles\n\t\tif (popupLeft !== targetPopupLeft) {\n\t\t\tpopupDOM.style.left = targetPopupLeft + \"px\";\n\t\t}\n\t};\n\n\t// The observer is to make sure the width keep sync\n\tconst createResizeObserver = useCallback(\n\t\t() => {\n\t\t\tresizeObserverRef.current = new ResizeObserver(entries => {\n\t\t\t\tconst popupDOM = popupRef?.current;\n\t\t\t\tif (popupDOM) {\n\t\t\t\t\tfor (let entry of entries) {\n\t\t\t\t\t\t// add the node check in case other elements are observered as well\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tentry.target.isSameNode(triggerRef.current) &&\n\t\t\t\t\t\t\tentry.borderBoxSize\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tpopupDOM.style.width = entry.borderBoxSize[0].inlineSize + \"px\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\t\t// eslint-disable-next-line\n\t\t[]\n\t);\n\n\tconst closePopupOnScroll = event => {\n\t\tconst popupDOM = popupRef?.current;\n\t\tif (\n\t\t\tcloseOnScroll &&\n\t\t\t!popupDOM?.contains(event.target) &&\n\t\t\t!scrollableElementRef?.current?.isSameNode(event.target)\n\t\t) {\n\t\t\tclosePopup();\n\t\t}\n\t};\n\n\t// =========================================================================\n\t// useEffect\n\t// =========================================================================\n\t// -------------------------------------------------------------------------\n\t// on mount\n\t// -------------------------------------------------------------------------\n\tuseEffect(\n\t\t() => {\n\t\t\t// add listener to correct position on scroll\n\t\t\twindow.addEventListener(\"scroll\", correctPosition, true);\n\t\t\twindow.addEventListener(\"resize\", correctPosition, true);\n\t\t\t// create the resize observer\n\t\t\tcreateResizeObserver();\n\n\t\t\treturn () => {\n\t\t\t\t// remove the listener\n\t\t\t\twindow.removeEventListener(\"scroll\", correctPosition, true);\n\t\t\t\twindow.removeEventListener(\"resize\", correctPosition, true);\n\t\t\t};\n\t\t},\n\t\t// eslint-disable-next-line\n\t\t[]\n\t);\n\n\t// -------------------------------------------------------------------------\n\t// resizing the popup\n\t// -------------------------------------------------------------------------\n\tconst syncWidth = popupPosition === \"full\";\n\n\tuseEffect(() => {\n\t\tif (isOpen && popupRef && triggerRef && syncWidth) {\n\t\t\tpopupRef.current.style.width = triggerRef.current.offsetWidth + \"px\";\n\t\t}\n\t}, [isOpen, popupRef, triggerRef, syncWidth]);\n\n\tuseEffect(() => {\n\t\tif (resizeObserverRef.current && isOpen && syncWidth) {\n\t\t\ttriggerRef.current &&\n\t\t\t\tresizeObserverRef.current.observe(triggerRef.current);\n\t\t}\n\t\treturn () => {\n\t\t\tresizeObserverRef.current && resizeObserverRef.current.disconnect();\n\t\t};\n\t}, [isOpen, triggerRef, syncWidth]);\n\n\t// -------------------------------------------------------------------------\n\t// close on scroll\n\t// -------------------------------------------------------------------------\n\tuseEffect(\n\t\t() => {\n\t\t\tif (closeOnScroll && isOpen) {\n\t\t\t\twindow.addEventListener(\"scroll\", closePopupOnScroll, true);\n\t\t\t}\n\t\t\treturn () => {\n\t\t\t\tif (closeOnScroll) {\n\t\t\t\t\twindow.removeEventListener(\"scroll\", closePopupOnScroll, true);\n\t\t\t\t}\n\t\t\t};\n\t\t},\n\t\t// eslint-disable-next-line\n\t\t[closeOnScroll, isOpen]\n\t);\n\n\t// -------------------------------------------------------------------------\n\t// correct position\n\t// -------------------------------------------------------------------------\n\tuseEffect(\n\t\t() => {\n\t\t\tcorrectPosition();\n\t\t},\n\t\t// eslint-disable-next-line\n\t\t[triggerRef, popupRef, isOpen]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t{trigger}\n\t\t\t{isOpen && (\n\t\t\t\t\n\t\t\t\t\t{render ? render({ correctPosition }) : children}\n\t\t\t\t\n\t\t\t)}\n\t\t\n\t);\n}\n","import React, { useEffect, useRef } from \"react\";\n\nexport default function ClickOutside(props) {\n\tconst wrapperRef = useRef(null);\n\tconst { children, onClickOutside, as: HtmlTag = \"div\", ...rest } = props;\n\tuseEffect(() => {\n\t\tfunction handleClickOutside(event) {\n\t\t\tif (wrapperRef.current && !wrapperRef.current.contains(event.target)) {\n\t\t\t\tonClickOutside && onClickOutside();\n\t\t\t}\n\t\t}\n\t\tdocument.addEventListener(\"mousedown\", handleClickOutside);\n\t\treturn () => {\n\t\t\tdocument.removeEventListener(\"mousedown\", handleClickOutside);\n\t\t};\n\t}, [wrapperRef, onClickOutside]);\n\n\treturn (\n\t\t\n\t\t\t{children}\n\t\t\n\t);\n}\n","import React from \"react\";\n// libraries\nimport PropTypes from \"prop-types\";\nimport classNames from \"classnames\";\nimport { isEqual, isArray } from \"lodash\";\nimport { components as reactSelectComponents } from \"react-select\";\nimport memoizeOne from \"memoize-one\";\n// contexts\nimport { withTranslations } from \"contexts/TranslationContext\";\n// components\nimport DropdownTrigger, {\n\tDropdownTriggerUniversalComponent\n} from \"./components/DropdownTrigger/DropdownTrigger\";\nimport DropdownMenu from \"./components/DropdownMenu/DropdownMenu\";\nimport ElementWithPopup from \"./components/ElementWithPopup/ElementWithPopup\";\nimport ClickOutside from \"components/wrappers/ClickOutside\";\n// utilities\nimport { removeDuplicates } from \"utils/objectsAndArrays\";\n// styles\nimport \"./Select.scss\";\n\nexport { DropdownTriggerUniversalComponent, reactSelectComponents };\n\nexport const defaultAllOption = { value: \"*\", label: \"All\" };\n\nconst selectRemovalEvent = [\"deselect-option\", \"remove-value\", \"pop-value\"];\n\nclass MySelect extends React.Component {\n\tstatic propTypes = {\n\t\tvariant: PropTypes.oneOf([\"grey\", \"light\", \"transparent\"]),\n\t\tgetOptionLabel: PropTypes.func,\n\t\tgetOptionValue: PropTypes.func,\n\t\trequired: PropTypes.bool,\n\t\tisClearable: PropTypes.bool,\n\t\tisSearchable: PropTypes.bool,\n\t\tdropdownTrigger: PropTypes.shape({\n\t\t\tclassName: PropTypes.string,\n\t\t\tcomponents: PropTypes.object,\n\t\t\temptyMessage: PropTypes.any\n\t\t}),\n\t\tdropdownMenu: PropTypes.object,\n\t\tscrollableElementRef: PropTypes.shape({\n\t\t\tcurrent: PropTypes.instanceOf(Element)\n\t\t}), // a custom element that on scroll, the popup won't close\n\t\tpopupPosition: PropTypes.oneOf([\"full\", \"left\", \"right\"])\n\t};\n\n\tstatic defaultProps = {\n\t\tforwardedRef: React.createRef(),\n\t\tvariant: \"grey\",\n\t\tgetOptionLabel: o => o.label,\n\t\tgetOptionValue: o => o.value,\n\t\trequired: false,\n\t\t// isSearchable: !isAsync,\n\t\t// isClearable: !required\n\t\t// used by Selects with nestedOptions, that field is to match an option to its parent\n\t\tparentOptionLinkField: \"code\",\n\t\taddAllOption: false,\n\t\tcloseOnScroll: false,\n\t\tdropdownTrigger: {},\n\t\tdropdownMenu: {},\n\t\tpopupPosition: \"full\"\n\t};\n\n\tstate = {\n\t\tisMenuOpen: false\n\t};\n\n\ttriggerRef = React.createRef();\n\tmenuRef = React.createRef();\n\n\t// =========================================================================\n\t// Control\n\t// =========================================================================\n\tgetHasNestedOptions = () => {\n\t\tconst { options } = this.props;\n\t\treturn !!options?.[0]?.options;\n\t};\n\n\tinitiateSelection() {\n\t\tconst { value, onChange, preselectOnMount } = this.props;\n\t\tconst options = this.getOptions();\n\t\tif (preselectOnMount && !value && options) {\n\t\t\tonChange(options[0]);\n\t\t}\n\t}\n\n\t// That method will trigger the selection of all options if the \"All\" option is given\n\t// The perimeter of that method is isMulti + addAllOption, whether it has nested options or not.\n\tinitMultiSelectWithAllOption = () => {\n\t\tconst {\n\t\t\tvalue,\n\t\t\tonChange,\n\t\t\taddAllOption,\n\t\t\tisMulti,\n\t\t\tparentOptionLinkField\n\t\t} = this.props;\n\t\tconst options = this.getOptions();\n\t\tif (isMulti && addAllOption && value && isArray(value) && options?.length) {\n\t\t\tconst hasNestedOptions = this.getHasNestedOptions();\n\t\t\tlet newValue = [];\n\t\t\tif (hasNestedOptions) {\n\t\t\t\t// look for \"All\" values. If we find \"All\" for a category, we push the list of options from that category\n\t\t\t\t// if we find another value, see if it has been pushed from \"All\" already, otherwise keep it\n\t\t\t\tconst allValues = value.filter(val => val.value === \"*\");\n\t\t\t\tvalue.forEach(option => {\n\t\t\t\t\tif (option.value === \"*\") {\n\t\t\t\t\t\tconst allOptions = options.find(\n\t\t\t\t\t\t\to => o[parentOptionLinkField] === option[parentOptionLinkField]\n\t\t\t\t\t\t)?.options;\n\t\t\t\t\t\tif (allOptions) {\n\t\t\t\t\t\t\tnewValue.push(...allOptions);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (\n\t\t\t\t\t\t!allValues.find(\n\t\t\t\t\t\t\tallValue =>\n\t\t\t\t\t\t\t\tallValue[parentOptionLinkField] ===\n\t\t\t\t\t\t\t\toption[parentOptionLinkField]\n\t\t\t\t\t\t)\n\t\t\t\t\t) {\n\t\t\t\t\t\tnewValue.push(option);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tnewValue = newValue.filter(\n\t\t\t\t\t(a, i, array) => array.findIndex(b => a.value === b.value) === i\n\t\t\t\t);\n\t\t\t\tif (!isEqual(value, newValue)) {\n\t\t\t\t\tonChange(newValue);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (value.find(v => v.value === \"*\")) {\n\t\t\t\t\tnewValue = options;\n\t\t\t\t\tif (!isEqual(value, newValue)) {\n\t\t\t\t\t\tonChange(newValue);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n\t// Expose All option list of options to parent value\n\t// The perimeter of that method is !isMulti + addAllOption (value with id = -1 admits addAllOption), whether it has nested options or not.\n\tinitSingleSelectWithAllOption = () => {\n\t\tconst {\n\t\t\tvalue,\n\t\t\tisMulti,\n\t\t\thasNestedOptions,\n\t\t\tparentOptionLinkField\n\t\t} = this.props;\n\t\tconst options = this.getOptions();\n\t\tif (!isMulti && value && value.value === \"*\") {\n\t\t\tif (hasNestedOptions) {\n\t\t\t\tconst parentOptions = options.find(\n\t\t\t\t\tparentOption =>\n\t\t\t\t\t\tparentOption[parentOptionLinkField] === value[parentOptionLinkField]\n\t\t\t\t);\n\t\t\t\tconst parentOptionsAllOption = parentOptions?.options?.find(\n\t\t\t\t\toption => option.value === \"*\"\n\t\t\t\t);\n\t\t\t\tif (parentOptionsAllOption && !isEqual(value, parentOptionsAllOption)) {\n\t\t\t\t\tthis.onChange(parentOptionsAllOption);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst allOption = options.find(option => option.value === \"*\");\n\t\t\t\tif (allOption && !isEqual(value, allOption)) {\n\t\t\t\t\tthis.onChange(allOption);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n\tgetMemoizedOptions = memoizeOne(\n\t\t({ options, addAllOption, allOptionBuilder, isMulti }) => {\n\t\t\tif (!options || !options.length) {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\tconst clonedOptions = JSON.parse(JSON.stringify(options));\n\t\t\tconst hasNestedOptions = this.getHasNestedOptions();\n\t\t\tif (addAllOption) {\n\t\t\t\tif (hasNestedOptions) {\n\t\t\t\t\tclonedOptions.forEach(option => {\n\t\t\t\t\t\tlet allOption = defaultAllOption;\n\t\t\t\t\t\tif (allOptionBuilder) {\n\t\t\t\t\t\t\tallOption = allOptionBuilder(option);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst parentOptionsWithoutAll = option.options.filter(\n\t\t\t\t\t\t\tparentOption => parentOption.value !== \"*\"\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst duplicatesRemoved = parentOptionsWithoutAll.filter(\n\t\t\t\t\t\t\t(a, index, array) =>\n\t\t\t\t\t\t\t\tarray.findIndex(b => a.value === b.value) === index\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst processedAllOption = isMulti\n\t\t\t\t\t\t\t? allOption\n\t\t\t\t\t\t\t: { ...allOption, options: duplicatesRemoved };\n\t\t\t\t\t\tif (!option.options.find(o => isEqual(o, processedAllOption))) {\n\t\t\t\t\t\t\toption.options.splice(0, 0, processedAllOption);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tlet allOption = defaultAllOption;\n\t\t\t\t\tif (allOptionBuilder) {\n\t\t\t\t\t\tallOption = allOptionBuilder();\n\t\t\t\t\t}\n\t\t\t\t\tconst optionsWithoutAll = clonedOptions.filter(\n\t\t\t\t\t\tclonedOption => clonedOption.value !== \"*\"\n\t\t\t\t\t);\n\t\t\t\t\tconst processedAllOption = isMulti\n\t\t\t\t\t\t? allOption\n\t\t\t\t\t\t: { ...allOption, options: optionsWithoutAll };\n\t\t\t\t\tclonedOptions.splice(0, 0, processedAllOption);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn clonedOptions;\n\t\t},\n\t\tisEqual\n\t);\n\n\tgetOptions = () => {\n\t\tconst { options, addAllOption, allOptionBuilder, isMulti } = this.props;\n\t\treturn this.getMemoizedOptions({\n\t\t\toptions,\n\t\t\taddAllOption,\n\t\t\tallOptionBuilder,\n\t\t\tisMulti\n\t\t});\n\t};\n\n\t// =========================================================================\n\t// On change\n\t// =========================================================================\n\tonChange = (value, event) => {\n\t\tconst {\n\t\t\tisMulti,\n\t\t\taddAllOption,\n\t\t\tonChange,\n\t\t\tparentOptionLinkField\n\t\t} = this.props;\n\n\t\tif (!onChange) {\n\t\t\treturn null;\n\t\t}\n\t\tif (!(isMulti && addAllOption) || event.action === \"clear\" || !value) {\n\t\t\treturn onChange(value, event);\n\t\t}\n\n\t\tconst options = this.getOptions();\n\t\tconst hasNestedOptions = this.getHasNestedOptions();\n\t\tlet newValue = value;\n\t\tconst isRemovalEvent = selectRemovalEvent.includes(event.action);\n\t\tconst eventOption = [\"remove-value\", \"pop-value\"].includes(event.action)\n\t\t\t? event.removedValue\n\t\t\t: event.option;\n\t\tif (hasNestedOptions) {\n\t\t\tconst parentOption = options.find(\n\t\t\t\toption =>\n\t\t\t\t\toption[parentOptionLinkField] === eventOption[parentOptionLinkField]\n\t\t\t);\n\t\t\tconst childOptions = value.filter(\n\t\t\t\to => o[parentOptionLinkField] === eventOption[parentOptionLinkField]\n\t\t\t);\n\n\t\t\tif (event.action === \"select-option\" && eventOption.value === \"*\") {\n\t\t\t\t// Select All (by All I mean the All inside the 2nd level of the nested options)\n\t\t\t\tconst optionsAbsentFromValue = parentOption.options.filter(\n\t\t\t\t\to => !newValue.find(v => isEqual(o, v))\n\t\t\t\t);\n\t\t\t\tnewValue.push(...optionsAbsentFromValue);\n\t\t\t} else if (\n\t\t\t\t(isRemovalEvent && eventOption.value === \"*\") ||\n\t\t\t\t(event.action === \"pop-value\" &&\n\t\t\t\t\tvalue.find(\n\t\t\t\t\t\to =>\n\t\t\t\t\t\t\to[parentOptionLinkField] === eventOption[parentOptionLinkField] &&\n\t\t\t\t\t\t\to.value === \"*\"\n\t\t\t\t\t))\n\t\t\t) {\n\t\t\t\t// Deselect all\n\t\t\t\tnewValue = value.filter(\n\t\t\t\t\to => o[parentOptionLinkField] !== eventOption[parentOptionLinkField]\n\t\t\t\t);\n\t\t\t} else if (isRemovalEvent) {\n\t\t\t\t// Deselect a specific option\n\t\t\t\t// => Deselect the option and All if was selected\n\t\t\t\tnewValue = value.filter(\n\t\t\t\t\to =>\n\t\t\t\t\t\t(o[parentOptionLinkField] === eventOption[parentOptionLinkField] &&\n\t\t\t\t\t\t\to.value !== \"*\" &&\n\t\t\t\t\t\t\to.value !== eventOption.value) ||\n\t\t\t\t\t\to[parentOptionLinkField] !== eventOption[parentOptionLinkField]\n\t\t\t\t);\n\t\t\t} else if (childOptions.length === parentOption.options.length - 1) {\n\t\t\t\t// Select the last option\n\t\t\t\t// => Select all to tick All\n\t\t\t\tnewValue.push(...parentOption.options);\n\t\t\t}\n\n\t\t\tnewValue = removeDuplicates(newValue);\n\t\t} else {\n\t\t\tif (event.action === \"select-option\" && eventOption.value === \"*\") {\n\t\t\t\tnewValue = options;\n\t\t\t} else if (isRemovalEvent && eventOption.value === \"*\") {\n\t\t\t\tnewValue = [];\n\t\t\t} else if (isRemovalEvent) {\n\t\t\t\tnewValue = value.filter(o => o.value !== \"*\");\n\t\t\t} else if (value.length === options.length - 1) {\n\t\t\t\tnewValue = options;\n\t\t\t} else {\n\t\t\t\tnewValue = value;\n\t\t\t}\n\t\t}\n\n\t\treturn onChange(newValue, event);\n\t};\n\n\t// =========================================================================\n\t// Menu\n\t// =========================================================================\n\tsetMenuOpenStatus = status => {\n\t\tthis.setState({ isMenuOpen: status });\n\t};\n\n\t// =========================================================================\n\t// Render\n\t// =========================================================================\n\trenderDropdownTrigger = () => {\n\t\tconst {\n\t\t\tvariant,\n\t\t\tvalue: valueFromProps,\n\t\t\tgetOptionLabel,\n\t\t\tgetOptionValue,\n\t\t\tloadOptions,\n\t\t\toptionSingleComponent,\n\t\t\trequired,\n\t\t\tisMulti,\n\t\t\tisDisabled,\n\t\t\tisLoading,\n\t\t\tisClearable,\n\t\t\tdropdownTrigger: { className, ...triggerProps }\n\t\t} = this.props;\n\n\t\tconst { isMenuOpen } = this.state;\n\n\t\tconst isAsync = !!loadOptions;\n\n\t\tconst value = valueFromProps\n\t\t\t? isMulti\n\t\t\t\t? valueFromProps.filter(v => v.value !== defaultAllOption.value)\n\t\t\t\t: valueFromProps\n\t\t\t: null;\n\n\t\treturn (\n\t\t\t !isDisabled && this.setMenuOpenStatus(!isMenuOpen)}\n\t\t\t\tcloseMenu={() => this.setMenuOpenStatus(false)}\n\t\t\t\tisAsync={isAsync}\n\t\t\t\tisMenuOpen={isMenuOpen}\n\t\t\t\t{...triggerProps}\n\t\t\t/>\n\t\t);\n\t};\n\n\trenderDropdownMenu = ({ correctPosition }) => {\n\t\tconst {\n\t\t\tvalue,\n\t\t\tgetOptionLabel,\n\t\t\tgetOptionValue,\n\t\t\tloadOptions,\n\t\t\tnoOptionsMessage,\n\t\t\tnoOptionsMessageFunc, // should return { key: string, args: object }\n\t\t\tloadingMessage,\n\t\t\toptionSingleComponent,\n\t\t\tisSearchable,\n\t\t\tisMulti,\n\t\t\tparentOptionLinkField,\n\t\t\t// -----------------------------------------------------------------\n\t\t\t// Menu\n\t\t\t// -----------------------------------------------------------------\n\t\t\tdropdownMenu: {\n\t\t\t\tforwardedRef,\n\t\t\t\tclassName,\n\t\t\t\tplaceholder,\n\t\t\t\tcomponents,\n\t\t\t\tstyles,\n\t\t\t\t...dropdownMenuProps\n\t\t\t}\n\t\t} = this.props;\n\n\t\tconst isAsync = !!loadOptions;\n\n\t\treturn (\n\t\t\t this.setMenuOpenStatus(false)}\n\t\t\t\t{...dropdownMenuProps}\n\t\t\t/>\n\t\t);\n\t};\n\n\t// =========================================================================\n\t// Core\n\t// =========================================================================\n\tcomponentDidMount() {\n\t\tthis.initiateSelection();\n\t\tthis.initMultiSelectWithAllOption();\n\t\tthis.initSingleSelectWithAllOption();\n\t}\n\n\tcomponentDidUpdate() {\n\t\tthis.initSingleSelectWithAllOption();\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\ttranslate,\n\t\t\tclassName,\n\t\t\tlabel,\n\t\t\tdescription,\n\t\t\trequired,\n\t\t\tisDisabled,\n\t\t\tcloseOnScroll,\n\t\t\tscrollableElementRef,\n\t\t\tpopupPosition\n\t\t} = this.props;\n\n\t\tconst { isMenuOpen } = this.state;\n\n\t\tconst selectComponent = (\n\t\t\t this.setMenuOpenStatus(false)}\n\t\t\t>\n\t\t\t\t this.setMenuOpenStatus(false)}\n\t\t\t\t\tcloseOnScroll={closeOnScroll}\n\t\t\t\t\tpopupPosition={popupPosition}\n\t\t\t\t/>\n\t\t\t\n\t\t);\n\n\t\tif (label) {\n\t\t\treturn (\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t{description && (\n\t\t\t\t\t\t
{translate(description)}
\n\t\t\t\t\t)}\n\t\t\t\t\t{selectComponent}\n\t\t\t\t\n\t\t\t);\n\t\t} else {\n\t\t\treturn selectComponent;\n\t\t}\n\t}\n}\n\nconst SelectWithContext = withTranslations(MySelect);\nSelectWithContext.componentName = \"Select\";\n\nexport default SelectWithContext;\n","import React from \"react\";\n// libraries\nimport classNames from \"classnames\";\n// components\nimport Select from \"components/Selects/Select/Select\";\n// styles\nimport \"./FancySelect.scss\";\n\n// Just the same select but with some tweaks to its styles\nexport default function FancySelect({ className, ...rest }) {\n\treturn (\n\t\t\n\t);\n}\n","import React, { useState } from \"react\";\n// assets\nimport { logos } from \"assets/images/imageIndex\";\n// contexts\nimport { useTranslations } from \"contexts/TranslationContext\";\nimport { useGlobalContext } from \"contexts/GlobalContext\";\n// components\nimport FancySelect from \"components/Selects/FancySelect/FancySelect\";\n// styles\nimport \"./CountrySelect.scss\";\n\nexport default function CountrySelect({ value, onChange, ...rest }) {\n\tconst { countries } = useGlobalContext();\n\n\tconst [selectedCountryCode, setSelectedCountryCode] = useState();\n\n\tconst actualValue = value ?? selectedCountryCode;\n\n\treturn (\n\t\t }\n\t\t\tgetOptionValue={country => country.code}\n\t\t\tvalue={countries.ARRAY?.find(country => country.code === actualValue)}\n\t\t\tonChange={country => {\n\t\t\t\tsetSelectedCountryCode(country.code);\n\t\t\t\tonChange?.(country);\n\t\t\t}}\n\t\t\tisSearchable={false}\n\t\t\t{...rest}\n\t\t/>\n\t);\n}\n\nfunction SingleCountry({ country }) {\n\tconst { translate } = useTranslations();\n\n\treturn (\n\t\t
\n\t\t\t
\n\t\t\t\t{country.code}\n\t\t\t
\n\t\t\t
{translate(country.name)}
\n\t\t
\n\t);\n}\n","import React, { useEffect, useMemo, useCallback } from \"react\";\n// libraries\nimport { withLocalize } from \"react-localize-redux\";\n// contexts\nimport { useGlobalContext } from \"contexts/GlobalContext\";\n// components\nimport FancySelect from \"components/Selects/FancySelect/FancySelect\";\n\n/**\n * @param {Object} params\n * @param {Array.} languages languages from context\n * @param {Object} activeLanguage active language from context\n * @param {Function} setActiveLanguage fucntion from context to set the active language\n * @param {Array} [options] custom options of the select. If not given, languages will be used\n * @param {Function} [onChange] callback function when an option is selected\n * @param {Array.} [whitelist] a whitelist of the languages. Only useful when options is not passed\n * @param {Boolean} [updateQueryString=false] whether the query string will be update according\n */\nfunction LanguageSelect({\n\tlanguages,\n\tactiveLanguage,\n\tsetActiveLanguage,\n\toptions: optionsFromProps,\n\tonChange,\n\twhitelist,\n\tupdateQueryString = false,\n\t...rest\n}) {\n\tconst { updateQueryParams } = useGlobalContext();\n\n\tconst options = useMemo(\n\t\t() =>\n\t\t\toptionsFromProps ?? whitelist\n\t\t\t\t? languages.filter(language => whitelist.includes(language.code))\n\t\t\t\t: languages,\n\t\t[optionsFromProps, whitelist, languages]\n\t);\n\n\tconst stringifiedLanguageCodes = useMemo(\n\t\t() => JSON.stringify(options.map(language => language.code)),\n\t\t[options]\n\t);\n\n\tconst onSelectLanguage = useCallback(\n\t\tlanguage => {\n\t\t\tsetActiveLanguage(language.code);\n\t\t\tif (updateQueryString) {\n\t\t\t\tupdateQueryParams({ lang: language.code });\n\t\t\t}\n\t\t\tonChange?.(language);\n\t\t},\n\t\t[setActiveLanguage, updateQueryString, updateQueryParams, onChange]\n\t);\n\n\tuseEffect(\n\t\t() => {\n\t\t\t// when the activeLanguage is not available in options, update it to the first available one\n\t\t\tif (\n\t\t\t\t!options.includes(language => language.code === activeLanguage.code)\n\t\t\t) {\n\t\t\t\tonSelectLanguage(languages[0]);\n\t\t\t}\n\t\t},\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[stringifiedLanguageCodes]\n\t);\n\n\treturn (\n\t\t language.name}\n\t\t\tgetOptionValue={language => language.code}\n\t\t\tvalue={languages.find(language => language.code === activeLanguage.code)}\n\t\t\tonChange={onSelectLanguage}\n\t\t\tisSearchable={false}\n\t\t\t{...rest}\n\t\t/>\n\t);\n}\n\nexport default withLocalize(LanguageSelect);\n","import React from \"react\";\n// libraries\nimport classNames from \"classnames\";\nimport { Redirect } from \"react-router-dom\";\nimport DOMPurify from \"dompurify\";\n// constants\nimport { routes } from \"constants/routes\";\n// components\nimport SimpleLoader from \"components/Loaders/SimpleLoader/SimpleLoader\";\nimport CountrySelect from \"components/Selects/CountrySelect/CountrySelect\";\nimport LanguageSelect from \"components/Selects/LanguageSelect/LanguageSelect\";\n\nexport default function DocumentView({\n\tactiveLanguage,\n\tdocuments,\n\tselectedCountryCode,\n\tbrands: { currentBrand },\n\tonSelectCountry\n}) {\n\t// redirect\n\tif (!currentBrand || !currentBrand.code) {\n\t\treturn (\n\t\t\t\n\t\t);\n\t}\n\tconst brandCode = currentBrand.code;\n\tconst activeDocument = documents.find(\n\t\tdoc => doc.country.code === selectedCountryCode\n\t);\n\tconst currentContent =\n\t\tactiveDocument &&\n\t\tactiveDocument.content[\n\t\t\tactiveLanguage.code in activeDocument.content ? activeLanguage.code : \"en\" // use English as fallback\n\t\t];\n\n\treturn (\n\t\t<>\n\t\t\t{documents.length > 0 ? (\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t onSelectCountry(country.code)}\n\t\t\t\t\t\t\tisClearable={false}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t{currentContent && (\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t)}\n\t\t\t\t\t
\n\t\t\t\t\n\t\t\t) : (\n\t\t\t\t\n\t\t\t)}\n\t\t\n\t);\n}\n","import React, { useCallback } from \"react\";\n// libraries\nimport classNames from \"classnames\";\n// assets\nimport { logos } from \"assets/images/imageIndex\";\n// constants\nimport { translationKeys } from \"constants/translations\";\n// contexts\nimport { useTranslations } from \"contexts/TranslationContext\";\n// utilities\nimport { chunkArray } from \"utils/objectsAndArrays\";\n\nexport default function CountrySelectView({\n\tcountries,\n\tgetCountryName,\n\tonSelectCountry\n}) {\n\tconst { translate } = useTranslations();\n\n\tconst segmentedCountries = chunkArray(countries.ARRAY, 2);\n\n\treturn (\n\t\t
\n\t\t\t
\n\t\t\t\t{translate(`${translationKeys.documents}.select-country`)}\n\t\t\t
\n\t\t\t
\n\t\t\t\t{segmentedCountries.map((countries, index) => (\n\t\t\t\t\t
\n\t\t\t\t\t\t{countries.map(country => (\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t))}\n\t\t\t\t\t
\n\t\t\t\t))}\n\t\t\t
\n\t\t
\n\t);\n}\n\nfunction SingleCountry({ country: { code }, getCountryName, onSelectCountry }) {\n\tconst onClick = useCallback(() => {\n\t\tonSelectCountry(code);\n\t}, [onSelectCountry, code]);\n\n\treturn (\n\t\t
\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t{code}\n\t\t\t\t
\n\t\t\t
\n\t\t\t
\n\t\t\t\t{getCountryName(code)}\n\t\t\t
\n\t\t
\n\t);\n}\n","import React from \"react\";\n// constants\nimport { translationKeys } from \"constants/translations\";\n// contexts\nimport { useTranslations } from \"contexts/TranslationContext\";\n\nexport default function FailedView() {\n\tconst { translate } = useTranslations();\n\treturn (\n\t\t
\n\t\t\t
\n\t\t\t\t{translate(`${translationKeys.documents}.page-error`)}\n\t\t\t
\n\t\t\t
window.location.reload()}>\n\t\t\t\t{translate(`${translationKeys.inputs}.refresh`)}\n\t\t\t
\n\t\t
\n\t);\n}\n","// constants\nimport { endpoints } from \"constants/api\";\n// service utilities\nimport { handleErrors } from \"./utils/core\";\n\n// =============================================================================\n// Terms and Conditions\n// =============================================================================\nexport const fetchTermsAndConditions = (country, brand) => {\n\treturn fetch(\n\t\t`${endpoints.TERMS_CONDITIONS}${country ? `/${country}` : \"\"}/${brand}`,\n\t\t{\n\t\t\tmethod: \"GET\"\n\t\t}\n\t)\n\t\t.then(handleErrors)\n\t\t.then(data => data.data);\n};\n\n// =============================================================================\n// Health Statement\n// =============================================================================\nexport const fetchHealthStatement = country => {\n\treturn fetch(`${endpoints.HEALTH_STATEMENT}${country ? `/${country}` : \"\"}`, {\n\t\tmethod: \"GET\"\n\t})\n\t\t.then(handleErrors)\n\t\t.then(data => data.data);\n};\n\n// =============================================================================\n// FAQ\n// They should use the same format as T&C,\n// but still create individual functions as there may be changes in the future.\n// =============================================================================\nexport const fetchFAQ = (country, brand) => {\n\treturn fetch(`${endpoints.FAQ}${country ? `/${country}` : \"\"}/${brand}`, {\n\t\tmethod: \"GET\"\n\t})\n\t\t.then(handleErrors)\n\t\t.then(data => data.data);\n};\n","// Public documents Page\nimport React, {\n\tuseState,\n\tuseEffect,\n\tuseCallback,\n\tuseMemo,\n\tuseRef\n} from \"react\";\n// libraries\nimport { withLocalize } from \"react-localize-redux\";\nimport { useRouteMatch, useLocation, useHistory } from \"react-router-dom\";\nimport { compile } from \"path-to-regexp\";\nimport classNames from \"classnames\";\nimport queryString from \"query-string\";\n// assets\nimport { logos } from \"assets/images/imageIndex\";\n// constants\nimport { translationKeys } from \"constants/translations\";\n// contexts\nimport { useTranslations } from \"contexts/TranslationContext\";\nimport { useGlobalContext } from \"contexts/GlobalContext\";\n// components\nimport DocumentView from \"./views/DocumentView\";\nimport CountrySelectView from \"./views/CountrySelectView\";\nimport FailedView from \"./views/FailedView\";\n// services\nimport {\n\tfetchTermsAndConditions,\n\tfetchHealthStatement,\n\tfetchFAQ\n} from \"services/documents\";\n// style\nimport \"./public-documents.scss\";\n\nconst translationRootKey = translationKeys.documents;\n\nconst defaultLogoEnum = {\n\tff: logos[\"ff-small-white\"],\n\tcf: logos[\"cf-small-white\"]\n};\n\nconst routeOptionsMap = {\n\tterms: {\n\t\ttranslationKey: \"t&c\",\n\t\tfetchFunct: fetchTermsAndConditions\n\t},\n\tstatements: {\n\t\ttranslationKey: \"health-statement\",\n\t\tfetchFunct: fetchHealthStatement\n\t},\n\tfaqs: {\n\t\ttranslationKey: \"faq\",\n\t\tfetchFunct: fetchFAQ\n\t}\n};\n\nconst customUIs = {\n\tff: {\n\t\thk: {\n\t\t\theader: {\n\t\t\t\tstyles: {\n\t\t\t\t\tbackgroundColor: \"#fff\",\n\t\t\t\t\tcolor: \"#000\"\n\t\t\t\t}\n\t\t\t},\n\t\t\tbrands: [\n\t\t\t\t{\n\t\t\t\t\tcode: \"ff\",\n\t\t\t\t\tlogo: logos[\"ff-small\"]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tcode: \"5e\",\n\t\t\t\t\tlogo: logos[\"5e-small\"]\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\tsg: {\n\t\t\theader: {\n\t\t\t\tstyles: {\n\t\t\t\t\tbackgroundColor: \"#fff\",\n\t\t\t\t\tcolor: \"#000\"\n\t\t\t\t}\n\t\t\t},\n\t\t\tbrands: [\n\t\t\t\t{\n\t\t\t\t\tcode: \"ff\",\n\t\t\t\t\tlogo: logos[\"ff-small\"]\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t}\n};\n\nfunction PublicDocument({ activeLanguage }) {\n\t// =========================================================================\n\t// Contexts\n\t// =========================================================================\n\tconst match = useRouteMatch();\n\tconst location = useLocation();\n\tconst history = useHistory();\n\n\tconst { countries, getCountryName, brands } = useGlobalContext();\n\tconst { translate } = useTranslations();\n\n\t// =========================================================================\n\t// Params\n\t// =========================================================================\n\tconst [documents, setDocuments] = useState([]);\n\tconst [isFetchFailed, setIsFetchFailed] = useState(false);\n\n\tconst abortControllerRef = useRef(null);\n\n\tconst documentType = match.params.document;\n\n\tconst routeOptions = routeOptionsMap[documentType];\n\n\t// =========================================================================\n\t// Helpers\n\t// =========================================================================\n\tconst generateNewPath = useCallback(\n\t\tparams => {\n\t\t\tconst toPath = compile(match.path);\n\t\t\treturn toPath(params);\n\t\t},\n\t\t[match.path]\n\t);\n\n\t// =========================================================================\n\t// Country and brand\n\t// =========================================================================\n\tconst countryCode = match.params.country;\n\tconst brandCode = match.params.brand;\n\n\tconst countryList = useMemo(\n\t\t() => documents.map(document => document.country),\n\t\t[documents]\n\t);\n\n\tconst currentBrand = brands[brandCode];\n\n\tconst onSelectCountry = newCountryCode => {\n\t\t// scroll back to top\n\t\t// const contentContainer = document.getElementById(\"containerElement\");\n\t\t// contentContainer.scrollTo(0, 0);\n\n\t\tconst newPath = generateNewPath({\n\t\t\tdocument: documentType,\n\t\t\tcountry: newCountryCode,\n\t\t\tbrand: brandCode\n\t\t});\n\t\t// add back the query string and visit the new path\n\t\thistory.push(newPath + location.search);\n\t};\n\n\t// =========================================================================\n\t// UI\n\t// =========================================================================\n\tconst currentCustomUI = useMemo(() => {\n\t\tconst customUIForCurrentBrand = customUIs[brandCode];\n\t\tconst customTableForCurrentCountry =\n\t\t\tcustomUIForCurrentBrand && customUIForCurrentBrand[countryCode];\n\n\t\treturn customTableForCurrentCountry;\n\t}, [countryCode, brandCode]);\n\n\tconst renderLogos = useCallback(brands => {\n\t\treturn brands.map(brand => {\n\t\t\tconst logo = brand.logo || (brand.code && defaultLogoEnum[brand.code]);\n\t\t\treturn (\n\t\t\t\tlogo && (\n\t\t\t\t\t{brand.code}\n\t\t\t\t)\n\t\t\t);\n\t\t});\n\t}, []);\n\n\t// styles\n\tconst customHeaderStyles =\n\t\tcurrentCustomUI && currentCustomUI.header && currentCustomUI.header.styles;\n\tconst headerDefaultStyles = currentBrand &&\n\t\tcurrentBrand.color && { backgroundColor: `#${currentBrand.color}` };\n\n\tconst headerStyles = { ...headerDefaultStyles, ...customHeaderStyles };\n\n\t// =========================================================================\n\t// Documents\n\t// =========================================================================\n\tconst documentTitle = useMemo(\n\t\t() =>\n\t\t\trouteOptions &&\n\t\t\ttranslate(`${translationRootKey}.${routeOptions.translationKey}`),\n\t\t[routeOptions, translate]\n\t);\n\n\tconst documentBrands = useMemo(() => {\n\t\tif (currentCustomUI) {\n\t\t\treturn currentCustomUI.brands.map(brand => {\n\t\t\t\tconst brandFromContext = brands[brand.code];\n\t\t\t\treturn {\n\t\t\t\t\t...brandFromContext,\n\t\t\t\t\t...brand\n\t\t\t\t};\n\t\t\t});\n\t\t}\n\t\treturn [currentBrand];\n\t}, [brands, currentCustomUI, currentBrand]);\n\n\tconst documentJoinedBrandName = useMemo(\n\t\t() => documentBrands.map(brand => brand.name).join(\" & \"),\n\t\t[documentBrands]\n\t);\n\n\t// =========================================================================\n\t// Fetch\n\t// =========================================================================\n\tconst fetchDocuments = useCallback(\n\t\t() => {\n\t\t\tif (!routeOptions) return;\n\n\t\t\t// reset the state\n\t\t\tsetDocuments([]);\n\n\t\t\t// fetch documents\n\t\t\trouteOptions\n\t\t\t\t.fetchFunct(null, brandCode)\n\t\t\t\t.then(documents => {\n\t\t\t\t\tconst parsedDocuments = [];\n\t\t\t\t\tdocuments.forEach(async document => {\n\t\t\t\t\t\t// don't add it if its country is not available\n\t\t\t\t\t\tconst showDocument =\n\t\t\t\t\t\t\tdocument.country_code && countries[document.country_code];\n\t\t\t\t\t\tif (showDocument) {\n\t\t\t\t\t\t\t// prevent duplication\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t!parsedDocuments.some(\n\t\t\t\t\t\t\t\t\tdoc => doc.country.code === document.country_code\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tparsedDocuments.push({\n\t\t\t\t\t\t\t\t\tcountry: {\n\t\t\t\t\t\t\t\t\t\tname: getCountryName(document.country_code),\n\t\t\t\t\t\t\t\t\t\tcode: document.country_code\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tcontent: document.content,\n\t\t\t\t\t\t\t\t\tavailableLanguages: Object.keys(document.content)\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\t// set state\n\t\t\t\t\tsetDocuments(parsedDocuments);\n\t\t\t\t})\n\t\t\t\t.catch(error => {\n\t\t\t\t\tsetIsFetchFailed(true);\n\t\t\t\t});\n\t\t},\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[documentType, brandCode]\n\t);\n\n\t// =========================================================================\n\t// When page is loaded or updated\n\t// =========================================================================\n\tuseEffect(() => {\n\t\tabortControllerRef.current = new AbortController();\n\t\tfetchDocuments();\n\t\treturn () => {\n\t\t\tabortControllerRef.current.abort();\n\t\t\tabortControllerRef.current = null;\n\t\t};\n\t}, [fetchDocuments]);\n\n\tuseEffect(() => {\n\t\t// set html title\n\t\tdocument.title = `${documentTitle} - ${documentJoinedBrandName}`;\n\t}, [documentTitle, documentJoinedBrandName]);\n\n\t// When the page is load, parse the query too see if there is country.\n\t// If yes, redirect the page to that country.\n\t// It is setup in order to provide backward compatibility.\n\t// only be run once on mount\n\tuseEffect(\n\t\t() => {\n\t\t\tconst { country, ...rest } = queryString.parse(location.search);\n\n\t\t\tif (!country) return; // do nothing\n\n\t\t\tconst stringifiedQuery = queryString.stringify(rest);\n\n\t\t\tconst newPath = generateNewPath({\n\t\t\t\tdocument: documentType,\n\t\t\t\t// if countryCode from route is already there, don't change it\n\t\t\t\tcountry: countryCode || country,\n\t\t\t\tbrand: brandCode\n\t\t\t});\n\n\t\t\thistory.replace(\n\t\t\t\tstringifiedQuery ? newPath + \"?\" + stringifiedQuery : newPath\n\t\t\t);\n\t\t},\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[]\n\t);\n\n\treturn (\n\t\t
\n\t\t\t
\n\t\t\t
\n\t\t\t\t
{renderLogos(documentBrands)}
\n\t\t\t\t
\n\t\t\t\t\t{documentTitle}\n\t\t\t\t
\n\t\t\t
\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t{isFetchFailed ? (\n\t\t\t\t\t\t\n\t\t\t\t\t) : countryCode ? (\n\t\t\t\t\t\t\n\t\t\t\t\t) : (\n\t\t\t\t\t\t\n\t\t\t\t\t)}\n\t\t\t\t
\n\t\t\t
\n\t\t
\n\t);\n}\n\nexport default withLocalize(PublicDocument);\n","import React from \"react\";\n\n// styles\nimport \"./404.scss\";\n\nclass NotFoundPage extends React.Component {\n\tcomponentDidMount() {\n\t\tdocument.title = \"404 Not Found\";\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t
\n\t\t\t\t404\n\t\t\t\t
\n\t\t\t\tNot Found\n\t\t\t
\n\t\t);\n\t}\n}\n\nexport default NotFoundPage;\n","import { routes } from \"constants/routes\";\n// pages\nimport ResetPasswordPage from \"pages/reset-password/reset-password\";\nimport PublicDocumentViewerPage from \"pages/public-documents/public-documents\";\nimport NotFoundPage from \"pages/404/404\";\n\nexport const routeIndex = [\n\t{\n\t\tid: \"reset-pw\",\n\t\tpath: routes.RESET_PW_URL,\n\t\tcomponent: ResetPasswordPage\n\t},\n\t{\n\t\tid: \"documents\",\n\t\tpath: routes.DOCUMENTS_URL,\n\t\tcomponent: PublicDocumentViewerPage\n\t},\n\t{\n\t\tid: \"404\",\n\t\tpath: routes.NOT_FOUND_URL,\n\t\tcomponent: NotFoundPage,\n\t\texact: true\n\t}\n];\n","import React from \"react\";\n\nclass Page extends React.Component {\n\trender() {\n\t\tconst { id, component: Component } = this.props;\n\t\treturn (\n\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t);\n\t}\n}\n\nexport default Page;\n","import React from \"react\";\n// libraries\nimport { LocalizeProvider } from \"react-localize-redux\";\nimport {\n\tHashRouter as Router,\n\tSwitch,\n\tRoute,\n\tRedirect\n} from \"react-router-dom\";\n// constants\nimport { routes } from \"constants/routes\";\n// contexts\nimport { TranslationContextProvider } from \"contexts/TranslationContext\";\nimport {\n\tGlobalContextProvider,\n\twithGlobalContext\n} from \"contexts/GlobalContext\";\n// components\nimport SimpleLoader from \"components/Loaders/SimpleLoader/SimpleLoader\";\nimport SiteMessageToastContainer from \"components/SiteMessages/SiteMessageToasts\";\nimport LanguageControl from \"./LanguageControl\";\n// pages\nimport { routeIndex } from \"pages/routerIndex\";\nimport Page from \"pages\";\n\n// styles\nimport \"styles/master.scss\";\n\n// =============================================================================\n// App\n// =============================================================================\nclass App extends React.Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\t\tthis.state = {\n\t\t\ttheme: \"\"\n\t\t};\n\t}\n\n\tcalculateVH = () => {\n\t\t// First we get the viewport height and we multiple it by 1% to get a value for a vh unit\n\t\tlet vh = window.innerHeight * 0.01;\n\t\t// Then we set the value in the --vh custom property to the root of the document\n\t\tdocument.documentElement.style.setProperty(\"--vh\", `${vh}px`);\n\t};\n\n\tonResize = () => {\n\t\tthis.calculateVH();\n\t};\n\n\tcomponentDidMount() {\n\t\tdocument.body.id = \"ew\";\n\t\tthis.calculateVH();\n\t\twindow.addEventListener(\"resize\", this.onResize);\n\t}\n\n\tcomponentWillUnmount() {\n\t\twindow.removeEventListener(\"resize\", this.onResize);\n\t}\n\n\trender() {\n\t\tconst { GLOBAL } = this.props;\n\t\tconst isLoaded = GLOBAL.isLoaded;\n\t\tconst isCountriesFetched = !!GLOBAL.countries.ARRAY;\n\t\tconst isBrandsFetched = !!GLOBAL.brands.ARRAY;\n\t\tconst showSplash = !isLoaded || !isCountriesFetched || !isBrandsFetched;\n\t\treturn (\n\t\t\t<>\n\t\t\t\t\n\t\t\t\t{showSplash ? (\n\t\t\t\t\t\n\t\t\t\t) : (\n\t\t\t\t\t<>\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{routeIndex.map(\n\t\t\t\t\t\t\t\t({ id, path, exact = false, component: Component }) => {\n\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t)}\n\t\t\t\n\t\t);\n\t}\n}\n\nconst AppWithContexts = withGlobalContext(App);\n\n// =============================================================================\n// App container\n// =============================================================================\nfunction AppContainer() {\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t);\n}\n\nexport default AppContainer;\n","// This optional code is used to register a service worker.\n// register() is not called by default.\n\n// This lets the app load faster on subsequent visits in production, and gives\n// it offline capabilities. However, it also means that developers (and users)\n// will only see deployed updates on subsequent visits to a page, after all the\n// existing tabs open on the page have been closed, since previously cached\n// resources are updated in the background.\n\n// To learn more about the benefits of this model and instructions on how to\n// opt-in, read https://bit.ly/CRA-PWA\n\nconst isLocalhost = Boolean(\n window.location.hostname === 'localhost' ||\n // [::1] is the IPv6 localhost address.\n window.location.hostname === '[::1]' ||\n // 127.0.0.1/8 is considered localhost for IPv4.\n window.location.hostname.match(\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\n )\n);\n\nexport function register(config) {\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\n // The URL constructor is available in all browsers that support SW.\n const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);\n if (publicUrl.origin !== window.location.origin) {\n // Our service worker won't work if PUBLIC_URL is on a different origin\n // from what our page is served on. This might happen if a CDN is used to\n // serve assets; see https://github.com/facebook/create-react-app/issues/2374\n return;\n }\n\n window.addEventListener('load', () => {\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\n\n if (isLocalhost) {\n // This is running on localhost. Let's check if a service worker still exists or not.\n checkValidServiceWorker(swUrl, config);\n\n // Add some additional logging to localhost, pointing developers to the\n // service worker/PWA documentation.\n navigator.serviceWorker.ready.then(() => {\n console.log(\n 'This web app is being served cache-first by a service ' +\n 'worker. To learn more, visit https://bit.ly/CRA-PWA'\n );\n });\n } else {\n // Is not localhost. Just register service worker\n registerValidSW(swUrl, config);\n }\n });\n }\n}\n\nfunction registerValidSW(swUrl, config) {\n navigator.serviceWorker\n .register(swUrl)\n .then(registration => {\n registration.onupdatefound = () => {\n const installingWorker = registration.installing;\n if (installingWorker == null) {\n return;\n }\n installingWorker.onstatechange = () => {\n if (installingWorker.state === 'installed') {\n if (navigator.serviceWorker.controller) {\n // At this point, the updated precached content has been fetched,\n // but the previous service worker will still serve the older\n // content until all client tabs are closed.\n console.log(\n 'New content is available and will be used when all ' +\n 'tabs for this page are closed. See https://bit.ly/CRA-PWA.'\n );\n\n // Execute callback\n if (config && config.onUpdate) {\n config.onUpdate(registration);\n }\n } else {\n // At this point, everything has been precached.\n // It's the perfect time to display a\n // \"Content is cached for offline use.\" message.\n console.log('Content is cached for offline use.');\n\n // Execute callback\n if (config && config.onSuccess) {\n config.onSuccess(registration);\n }\n }\n }\n };\n };\n })\n .catch(error => {\n console.error('Error during service worker registration:', error);\n });\n}\n\nfunction checkValidServiceWorker(swUrl, config) {\n // Check if the service worker can be found. If it can't reload the page.\n fetch(swUrl)\n .then(response => {\n // Ensure service worker exists, and that we really are getting a JS file.\n const contentType = response.headers.get('content-type');\n if (\n response.status === 404 ||\n (contentType != null && contentType.indexOf('javascript') === -1)\n ) {\n // No service worker found. Probably a different app. Reload the page.\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister().then(() => {\n window.location.reload();\n });\n });\n } else {\n // Service worker found. Proceed as normal.\n registerValidSW(swUrl, config);\n }\n })\n .catch(() => {\n console.log(\n 'No internet connection found. App is running in offline mode.'\n );\n });\n}\n\nexport function unregister() {\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister();\n });\n }\n}\n","import React from \"react\";\n// libaraies\nimport ReactDOM from \"react-dom\";\n// App\nimport App from \"./App\";\nimport * as serviceWorker from \"./serviceWorker\";\n\nReactDOM.render(, document.getElementById(\"root\"));\n\n// If you want your app to work offline and load faster, you can change\n// unregister() to register() below. Note this comes with some pitfalls.\n// Learn more about service workers: https://bit.ly/CRA-PWA\nserviceWorker.unregister();\n"],"sourceRoot":""}