{"version":3,"sources":["webpack:///./ClientApp/services/Localizer.tsx","webpack:///./ClientApp/styles/node-modules/react-toggle/style.css?5a6e","webpack:///./ClientApp/styles/node-modules/react-toggle/style.css","webpack:///./ClientApp/shared/polyfills/customEvent.js","webpack:///./ClientApp/shared/components/svg/LeftChevronSVG.tsx","webpack:///./ClientApp/util/StringUtil.ts","webpack:///./ClientApp/services/ServerData.ts","webpack:///./ClientApp/shared/components/svg/RightChevronSVG.tsx","webpack:///./ClientApp/shared/hooks/useAxiosLoader.ts","webpack:///./ClientApp/shared/hooks/useAxiosPaginatedLoader.ts","webpack:///./ClientApp/shared/components/Spinner.tsx","webpack:///./ClientApp/services/AxiosHelper.ts","webpack:///../Roc.SharedClientApp/types/index.ts","webpack:///./ClientApp/shared/edit/fields/FieldInputErrorWrapper.tsx","webpack:///./ClientApp/shared/edit/fields/FieldLabel.tsx","webpack:///./ClientApp/shared/edit/fields/CheckBoxField.tsx","webpack:///./ClientApp/shared/edit/fields/DropdownField.tsx","webpack:///./ClientApp/shared/edit/fields/StarRatingField.tsx","webpack:///./ClientApp/shared/edit/fields/TextAreaField.tsx","webpack:///./ClientApp/shared/edit/fields/InputField.tsx","webpack:///./ClientApp/shared/edit/fields/TextBoxField.tsx","webpack:///./ClientApp/shared/edit/InlineAlert.tsx","webpack:///./ClientApp/shared/hooks/useRocEventHandler.tsx","webpack:///./ClientApp/shared/components/svg/XSVG.tsx","webpack:///./ClientApp/services/UserData.ts","webpack:///../Roc.SharedClientApp/types/model-status.ts","webpack:///./ClientApp/shared/util/ErrorBoundary.tsx","webpack:///./ClientApp/shared/util/AccountUrls.ts","webpack:///./ClientApp/shared/edit/OptionalFieldMarker.tsx","webpack:///./ClientApp/shared/polyfills/getAttributeNames.js","webpack:///./ClientApp/shared/util/ApplicationInit.tsx","webpack:///./ClientApp/shared/edit/fields/ValidationMessages.tsx","webpack:///./ClientApp/shared/hooks/useDelayedDisplay.tsx","webpack:///./ClientApp/shared/components/svg/CheckCircleSVG.tsx","webpack:///./ClientApp/shared/util/Misc.ts","webpack:///./ClientApp/shared/util/events/rocEventUtils.ts","webpack:///./ClientApp/shared/components/svg/StarEmptySVG.tsx","webpack:///./ClientApp/shared/components/hawksearch/components/svg/DashCircleSVG.tsx","webpack:///./ClientApp/shared/components/svg/PencilSVG.tsx","webpack:///./ClientApp/features/commerce/product-details/types.ts","webpack:///./ClientApp/shared/components/svg/CircleExclamationSVG.tsx","webpack:///./ClientApp/features/setup/recaptcha.ts","webpack:///./ClientApp/shared/components/CircleButton.tsx","webpack:///./ClientApp/shared/edit/fields/CheckboxInputField.tsx","webpack:///./ClientApp/shared/components/svg/StarSVG.tsx","webpack:///./ClientApp/shared/components/star-rating/StarRating.tsx","webpack:///./ClientApp/shared/components/star-rating/useStarRating.ts","webpack:///./ClientApp/features/commerce/reviews/WriteReview.tsx","webpack:///./ClientApp/features/commerce/reviews/ReviewListing.tsx","webpack:///./ClientApp/features/commerce/reviews/useProductReviews.ts","webpack:///./ClientApp/features/commerce/reviews/index.tsx","webpack:///./ClientApp/shared/hooks/useLoader.ts","webpack:///./ClientApp/shared/components/svg/FolderSVG.tsx","webpack:///./ClientApp/shared/components/svg/GarbageCanCircleSVG.tsx","webpack:///./ClientApp/shared/components/StatusDisplay.tsx","webpack:///./ClientApp/shared/hooks/useInterval.tsx","webpack:///./ClientApp/shared/hooks/useReCaptchaToken.tsx","webpack:///./ClientApp/shared/hooks/useRocReCaptchaToken.tsx"],"names":["LocalizerResources","isAlreadyLogged","initializeLocalizerResources","windowWithResources","window","__ROC_LOCALIZER_RESOURCES__","Array","isArray","forEach","obj","Object","keys","key","Localizer","replaceStrings","length","console","warn","resource","replace","match","index","LocalizedSpan","props","resourceKey","args","localizedString","data-testid","toKebabCase","dangerouslySetInnerHTML","__html","api","content","__esModule","default","module","i","options","exports","locals","___CSS_LOADER_API_IMPORT___","push","CustomEvent","event","params","bubbles","cancelable","detail","undefined","evt","document","createEvent","initCustomEvent","prototype","Event","LeftChevronSVG","className","rest","viewBox","classnames","focusable","aria-hidden","d","value","trim","toLocaleLowerCase","toCamelCase","word","toLowerCase","toUpperCase","stripHtml","html","tmp","createElement","innerHTML","textContent","innerText","addEllipsis","text","cutoff","substring","trimString","ServerData","windowWithServerData","__ROC_SERVER_DATA__","initializeServerData","RightChevronSVG","cache","useAxiosLoader","axiosParams","active","callback","cacheKey","method","useLoader","loading","setLoading","error","setError","response","setResponse","useState","reloadTimes","setReloadTimes","cancelToken","useRef","useEffect","current","Axios","CancelToken","source","AxiosHelper","isCancel","cancel","values","reload","useAxiosPaginatedLoader","query","initialPageSize","initialSortByName","initialSortDirection","initialResults","pageSize","setPageSizeState","pageNumber","setPageNumber","sortByName","setSortByName","sortDirection","setSortDirection","dataLoaderActive","setDataLoaderActive","customQuery","setCustomQuery","paginationQuery","url","results","data","page","goToPage","pagination","totalPages","goToNextPage","goToPreviousPage","setSorting","sortBy","direction","setPageSize","size","setQuery","Spinner","light","waitMs","align","block","parentCentered","useDelayedDisplay","spinner","axios","create","defaults","headers","common","interceptors","request","use","config","getCsrfToken","csrfToken","RequestVerificationToken","addUnauthorizedAccessInterceptor","history","status","location","AccountUrls","Login","encodeURIComponent","pathname","Promise","reject","SortByDirection","FieldInputErrorWrapper","hideIcon","children","inline","name","meta","useField","invalid","submitError","dirtySinceLastSubmit","submitting","touched","FieldLabel","label","id","isRequired","htmlFor","testId","CheckBoxField","readOnly","disabled","afterSubmit","allowNull","beforeSubmit","formatOnBlur","initialValue","isEqual","subscription","defaultValue","type","input","CheckboxInputField","DropdownField","addSelectOption","validateFields","onChange","onFocus","onBlur","dirty","aria-describedby","map","option","ValidationMessages","StarRatingField","maxRating","OptionalFieldMarker","StarRating","readonly","TextAreaField","placeholder","rows","validate","component","format","parse","render","maxLength","InputField","React","forwardRef","ref","step","TextBoxField","InlineAlert","title","defaultProps","theme","isTitleOnOwnRow","isCollapsed","onCollapse","message","axiosError","isAxiosError","onClick","dispatchRocEvent","eventType","dispatchEvent","useRocEventHandler","eventHandler","deps","removeHandlerCallback","addRocEventHandler","XSVG","userDataPromise","getUserData","get","getUserDataNoCache","userData","requestToken","ModelStatus","ErrorBoundary","lastRefreshedTimestamp","Date","parseInt","localStorage","getItem","getTime","setItem","toString","this","setState","state","renderError","Component","renderProps","BaseUrl","ACCOUNT_URL_BASE","ACCOUNT_LOGIN_URL","Login2fa","ACCOUNT_LOGIN_WITH_2FA_URL","Register","ACCOUNT_REGISTER_URL","ForgotPassword","ACCOUNT_FORGOT_PASSWORD_URL","LoginWithRecoveryCode","ACCOUNT_LOGIN_WITH_RECOVERY_CODE_URL","Logout","ACCOUNT_LOGOUT_URL","OrganizationReview","ACCOUNT_ORGANIZATION_REVIEW_URL","OrganizationSelector","ACCOUNT_ORGANIZATION_SELECTOR_URL","ExternalLogout","memo","Element","getAttributeNames","attributes","result","getDataPropsFromAttributes","element","filter","s","startsWith","attributeName","getAttribute","initReactApp","getReactElement","elementId","getElementById","ReactDOM","Suspense","fallback","initReactAppByAttribute","attribute","elements","querySelectorAll","getErrorArray","errorOrSubmitError","errors","concat","role","Fragment","display","setDisplay","timeout","setTimeout","clearTimeout","CheckCircleSVG","ms","resolve","sleep","handleAxiosErrorWithValidation","errorMessage","validationErrorCallback","genericErrorCallback","globalErrors","errorsWithModifiedArrayIndex","reduce","acc","newValidationState","unflatten","FORM_ERROR","getQueryParam","paramName","decodeParam","urlParams","URLSearchParams","search","paramValue","decodeURIComponent","handler","addEventListener","removeEventListener","StarEmptySVG","DashCircleSVG","class","fill","PencilSVG","getInitialProductDetailsState","__ROC_COMMERCE_PRODUCT_DETAILS__","InputAttributeType","ProductType","AddToCartExceptionCode","CircleExclamationSVG","reCaptchaCallbackPromise","setupReCaptcha","windowWithReCaptchaCallbacks","onReCaptchaLoadCallback","CircleButton","icon","otherProps","checked","defaultChecked","StarSVG","ratingStars","setRatingStars","ratingHovered","setRatingHovered","newState","isFull","isPending","isHighlighted","isChecked","ratingValue","useStarRating","Error","onInputChange","e","currentTarget","modifierClasses","onMouseEnter","onMouseLeave","WriteReview","saveReview","hasValidationError","isSaving","setShowWriteReview","productId","loggedInUserFirstName","onSubmit","pristine","initialValues","reviewerName","rating","isProductRecommended","description","reCaptchaKey","reCaptchaResponse","localizedReviewDate","handleSubmit","color","ReviewListing","initialReviewsSummary","reviewsSummary","initialProductId","setProductId","setReviewsSummary","userIsSignedIn","setUserIsSignedIn","getUserIsSignedIn","summary","isSignedIn","setLoggedInUserFirstName","reviewCount","setIsSaving","productReviewsError","setProductReviewsError","setValidationHasError","isAbuseSaved","setIsAbuseSaved","reviewAdded","setReviewAdded","loadMoreClicked","setLoadMoreClicked","Descending","writeReviewRecaptcha","useRocReCaptchaToken","showWriteReview","reportAbuse","reviewId","post","token","newIsAbuseSaved","formValues","getToken","payload","responseCode","responseData","invalidateToken","onLoadMoreClick","useProductReviews","product","ignoreSelectionChanges","productDetails","firstName","getLoggedInUserFirstName","then","timer","totalRecords","style","width","target","review","FolderSVG","GarbageCanCircleSVG","StatusDisplay","Published","Inactive","Deleted","Draft","Archived","useInterval","delay","enabled","savedCallback","intervalId","setInterval","clearInterval","ReCaptchaKeyWarning","useReCaptchaToken","action","initialEnabled","reCaptchaWindow","tokenPromise","tokenPromiseIsResolved","initPromise","setEnabled","useLayoutEffect","grecaptcha","ready","force","execute","ReCaptchaV3Key","isReCaptchaEnabled","IsReCaptchaEnabled"],"mappings":"y/BA0JA,IAAMA,EAAwC,GAKxCC,EAA2C,GAKjD,SAASC,IACR,IAAMC,EAAsBC,OAG3BD,GACAA,EAAoBE,6BACpBC,MAAMC,QAAQJ,EAAoBE,8BAElCF,EAAoBE,4BAA4BG,SAAQ,SAACC,GACxD,cAAkBC,OAAOC,KAAKF,GAA9B,eAAoC,CAA/B,IAAMG,EAAG,KACbZ,EAAmBY,GAAOH,EAAIG,OAc3B,SAASC,EACfD,GAEC,2BADEE,EACF,iCADEA,EACF,kBAKD,GAJ+C,IAA3CJ,OAAOC,KAAKX,GAAoBe,QACnCb,KAGIF,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KnD,IAAM7B,EAAQ,4CAAG,kHAAO8C,EAAP,gCACXpF,GAAiBmE,EADN,yCAIRlT,QAAQkK,QAAQ,KAJR,uBAQV4J,EAAYrY,QARF,cAWa,OAAzBmY,EAAanY,SAAoB0Y,KACpCN,EAAuBpY,SAAU,EAEjCmY,EAAanY,QAAU,IAAIuE,QAAJ,4CAAY,WAAOkK,GAAP,+GAEZyJ,EAAgBM,WAAWG,QAAQrF,EAAc,CAAE0E,WAFvC,OAE3BvL,EAF2B,OAGjCgC,EAAQhC,GAHyB,gDAKjCpS,QAAQC,KACP,sBACA,uCAAO0O,UAAW,wEAEnBsP,GAAW,GACX7J,EAAQ,IAVyB,QAYlC2J,EAAuBpY,SAAU,EAZC,yDAAZ,wDAdR,kBAgCTmY,EAAanY,SAhCJ,2CAAH,qDAmCd,MAAO,CAAE4V,SAAU,kBAAMA,KAAYI,kBAAiByB,UAASa,cCnIjD,SAASlD,EAAqB4C,GAAmE,IAAnDC,IAAmD,yDACzG3E,EAAe/U,IAAWqa,eAC1BC,EAAqBZ,GAAkB1Z,IAAWua,mBAKxD,OAAOf,EAAkBzE,GAAgB,GAAI0E,EAAQa,M","file":"reviews-summary.7892a7a6.js","sourcesContent":["import { AddressResourceKeys } from 'features/address-book/resources';\r\nimport { ContactFormResourceKeys } from 'features/contact-form/resources';\r\nimport { CreatePasswordResourceKeys } from 'features/create-password/resources';\r\nimport { LoginWith2faResourceKeys } from 'features/login-with-2fa/resources';\r\nimport { LoginWithRecoveryCodeResourceKeys } from 'features/login-with-recovery-code/resources';\r\nimport { LoginResourceKeys } from 'features/login/resources';\r\nimport { MyAccountResourceKeys } from 'features/my-account/resources';\r\nimport { ResetPasswordResourceKeys } from 'features/reset-password/resources';\r\nimport { SubmitQuestionResourceKeys } from 'features/submit-question/resources';\r\nimport * as React from 'react';\r\nimport { toKebabCase } from 'util/StringUtil';\r\n\r\n// #region Commerce\r\nimport { CommerceResourceKeys } from 'features/commerce/CommerceResourceKeys';\r\n// #endregion\r\n\r\n// #region HCL\r\nimport { QuickBagsResourceKeys } from 'features/hcl/quick-bags/resources';\r\nimport { QuickLabelsResourceKeys } from 'features/hcl/quick-labels/resources';\r\nimport { ProductCatalogsResourceKeys } from 'features/hcl/product-catalogs/resources';\r\nimport { FileUploadResourceKeys } from 'features/hcl/file-upload/resources';\r\nimport { NewsletterKeys } from 'features/hcl/newsletter-signup/resources';\r\n// #endregion\r\n\r\n/**\r\n * Type that will hold all the global localization keys\r\n */\r\ntype LocalizerGlobalResourceKeys =\r\n\t| 'Success'\r\n\t| 'OfTotalPages'\r\n\t| 'Cancel'\r\n\t| 'Confirm'\r\n\t| 'FirstName'\r\n\t| 'LastName'\r\n\t| 'Email'\r\n\t| 'Username'\r\n\t| 'Amount'\r\n\t| 'NameOnCard'\r\n\t| 'CardNumber'\r\n\t| 'ExpDate'\r\n\t| 'ExpMonth'\r\n\t| 'ExpYear'\r\n\t| 'Expires'\r\n\t| 'Expired'\r\n\t| 'SecurityCode'\r\n\t| 'Submit'\r\n\t| 'Save'\r\n\t| 'ZipCode'\r\n\t| 'Remove'\r\n\t| 'Removed'\r\n\t| 'Update'\r\n\t| 'Undo'\r\n\t| 'Cancel'\r\n\t| 'Enter'\r\n\t| 'Close'\r\n\t| 'SortBy'\r\n\t| 'PleaseWait'\r\n\t| 'Unknown'\r\n\t| 'Yes'\r\n\t| 'No'\r\n\t| 'Delete'\r\n\t| 'Update'\r\n\t| 'SaveAndContinueButtonText'\r\n\t| 'SaveAndContinue'\r\n\t| 'Continue'\r\n\t| 'SaveErrorMessage'\r\n\t| 'Edit'\r\n\t| 'ErrorMessageGenericTitle'\r\n\t| 'CheckEnteredValues'\r\n\t| 'ErrorMessageForbidden'\r\n\t| 'ErrorMessageNetwork'\r\n\t| 'ErrorOccurredSubmittingTheForm'\r\n\t| 'UnexpectedErrorOccurred'\r\n\t| 'Login'\r\n\t| 'ReturnToShipping'\r\n\t| 'BreadcrumbsLabel'\r\n\t| 'Other'\r\n\t| 'RememberMe'\r\n\t| 'ForgotYourPassword'\r\n\t| 'RegisterNewUserLinkText'\r\n\t| 'LoginPageTitleText'\r\n\t| 'ForgotPasswordPageTitle'\r\n\t| 'ForgotPasswordConfirmationPageTitle'\r\n\t| 'ForgotPasswordConfirmation'\r\n\t| 'Optional'\r\n\t| 'SearchBoxPlaceholder'\r\n\t| 'XOutOfYStars'\r\n\t| 'XToYOfZ'\r\n\t| 'ModalLabel'\r\n\t| 'RequiredFields'\r\n\t| 'Status'\r\n\t| 'Version'\r\n\t| 'CreatedOn'\r\n\t| 'CreatedBy'\r\n\t| 'ModifiedOn'\r\n\t| 'ModifiedBy'\r\n\t| 'OpenStatusInformation'\r\n\t| 'CloseStatusInformation'\r\n\t| 'SearchFilter'\r\n\t| 'Pagination'\r\n\t| 'Previous'\r\n\t| 'Next'\r\n\t| 'ClearFilter';\r\n\r\n/**\r\n * Type that will hold all the localization keys\r\n */\r\nexport type LocalizerResourceKey =\r\n\t| LocalizerGlobalResourceKeys\r\n\t| LoginResourceKeys\r\n\t| ContactFormResourceKeys\r\n\t// #region Commerce\r\n\t| CommerceResourceKeys\r\n\t// #endregion\r\n\t| ResetPasswordResourceKeys\r\n\t| CreatePasswordResourceKeys\r\n\t| SubmitQuestionResourceKeys\r\n\t| ResetPasswordResourceKeys\r\n\t| CreatePasswordResourceKeys\r\n\t| MyAccountResourceKeys\r\n\t| LoginWith2faResourceKeys\r\n\t| LoginWithRecoveryCodeResourceKeys\r\n\t| AddressResourceKeys\r\n\t// #region HCL\r\n\t| QuickBagsResourceKeys\r\n\t| QuickLabelsResourceKeys\r\n\t| ProductCatalogsResourceKeys\r\n\t| NewsletterKeys\r\n\t| FileUploadResourceKeys;\r\n// #endregion\r\n\r\n/**\r\n * Interface for the resources\r\n *\r\n * @export\r\n * @interface LocalizerResource\r\n */\r\ninterface LocalizerResource {\r\n\t[id: string]: string;\r\n}\r\n\r\n/**\r\n * Extends Window with a property that will hold the localizer resources\r\n *\r\n * @interface WindowWithResources\r\n * @extends {Window}\r\n */\r\nexport interface WindowWithResources extends Window {\r\n\t__ROC_LOCALIZER_RESOURCES__?: LocalizerResource[];\r\n}\r\n\r\n/**\r\n * Main object that will hold all the localized resources\r\n */\r\nconst LocalizerResources: LocalizerResource = {};\r\n\r\n/**\r\n * To prevent redundant logging\r\n */\r\nconst isAlreadyLogged: Record = {};\r\n\r\n/**\r\n * Initializer function that will populate the main localized resources object\r\n */\r\nfunction initializeLocalizerResources() {\r\n\tconst windowWithResources = window as WindowWithResources;\r\n\r\n\tif (\r\n\t\twindowWithResources &&\r\n\t\twindowWithResources.__ROC_LOCALIZER_RESOURCES__ &&\r\n\t\tArray.isArray(windowWithResources.__ROC_LOCALIZER_RESOURCES__)\r\n\t) {\r\n\t\twindowWithResources.__ROC_LOCALIZER_RESOURCES__.forEach((obj) => {\r\n\t\t\tfor (const key of Object.keys(obj)) {\r\n\t\t\t\tLocalizerResources[key] = obj[key];\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}\r\n\r\n/**\r\n * Function that can be used to load the localized strings with support to parameter replacements\r\n *\r\n * @export\r\n * @param {string} key\r\n * @param {...string[]} replaceStrings\r\n * @returns\r\n */\r\nexport function Localizer(\r\n\tkey: TResourceKey,\r\n\t...replaceStrings: string[]\r\n) {\r\n\tif (Object.keys(LocalizerResources).length === 0) {\r\n\t\tinitializeLocalizerResources();\r\n\t}\r\n\r\n\tif (!LocalizerResources || !LocalizerResources[key]) {\r\n\t\t// if running in a test environment, just skip any warnings.\r\n\t\tif (process.env.NODE_ENV !== 'test') {\r\n\t\t\tif (!isAlreadyLogged[key]) {\r\n\t\t\t\tconsole.warn(key, 'Localizer Resource not found. Key will be used instead.');\r\n\t\t\t\tisAlreadyLogged[key] = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn key;\r\n\t}\r\n\r\n\tconst resource = LocalizerResources[key];\r\n\r\n\tif (!replaceStrings) {\r\n\t\treturn resource;\r\n\t}\r\n\r\n\treturn resource.replace(/{(\\d+)}/g, (match: string, index: number) => {\r\n\t\treturn replaceStrings[index] ? replaceStrings[index] : '';\r\n\t});\r\n}\r\n\r\n/**\r\n * Interface for the LocalizedSpan component\r\n *\r\n * @interface LocalizedSpanProps\r\n */\r\ninterface LocalizedSpanProps {\r\n\tresourceKey: LocalizerResourceKey;\r\n\targs?: string[];\r\n}\r\n\r\n/**\r\n * Component responsible for the initialization of the react app\r\n */\r\nexport function LocalizedSpan(props: LocalizedSpanProps) {\r\n\tconst { resourceKey, args = [] } = props;\r\n\tconst localizedString = Localizer(resourceKey, ...args);\r\n\r\n\treturn (\r\n\t\t\r\n\t);\r\n}\r\n","var api = require(\"!../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\");\n var content = require(\"!!../../../../node_modules/css-loader/dist/cjs.js!./style.css\");\n\n content = content.__esModule ? content.default : content;\n\n if (typeof content === 'string') {\n content = [[module.id, content, '']];\n }\n\nvar options = {};\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = api(content, options);\n\n\n\nmodule.exports = content.locals || {};","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \".react-toggle {\\n touch-action: pan-x;\\n\\n display: inline-block;\\n position: relative;\\n cursor: pointer;\\n background-color: transparent;\\n border: 0;\\n padding: 0;\\n\\n -webkit-touch-callout: none;\\n -webkit-user-select: none;\\n -khtml-user-select: none;\\n -moz-user-select: none;\\n -ms-user-select: none;\\n user-select: none;\\n\\n -webkit-tap-highlight-color: rgba(0,0,0,0);\\n -webkit-tap-highlight-color: transparent;\\n}\\n\\n.react-toggle-screenreader-only {\\n border: 0;\\n clip: rect(0 0 0 0);\\n height: 1px;\\n margin: -1px;\\n overflow: hidden;\\n padding: 0;\\n position: absolute;\\n width: 1px;\\n}\\n\\n.react-toggle--disabled {\\n cursor: not-allowed;\\n opacity: 0.5;\\n -webkit-transition: opacity 0.25s;\\n transition: opacity 0.25s;\\n}\\n\\n.react-toggle-track {\\n width: 50px;\\n height: 24px;\\n padding: 0;\\n border-radius: 30px;\\n background-color: #4D4D4D;\\n -webkit-transition: all 0.2s ease;\\n -moz-transition: all 0.2s ease;\\n transition: all 0.2s ease;\\n}\\n\\n.react-toggle:hover:not(.react-toggle--disabled) .react-toggle-track {\\n background-color: #000000;\\n}\\n\\n.react-toggle--checked .react-toggle-track {\\n background-color: #19AB27;\\n}\\n\\n.react-toggle--checked:hover:not(.react-toggle--disabled) .react-toggle-track {\\n background-color: #128D15;\\n}\\n\\n.react-toggle-track-check {\\n position: absolute;\\n width: 14px;\\n height: 10px;\\n top: 0px;\\n bottom: 0px;\\n margin-top: auto;\\n margin-bottom: auto;\\n line-height: 0;\\n left: 8px;\\n opacity: 0;\\n -webkit-transition: opacity 0.25s ease;\\n -moz-transition: opacity 0.25s ease;\\n transition: opacity 0.25s ease;\\n}\\n\\n.react-toggle--checked .react-toggle-track-check {\\n opacity: 1;\\n -webkit-transition: opacity 0.25s ease;\\n -moz-transition: opacity 0.25s ease;\\n transition: opacity 0.25s ease;\\n}\\n\\n.react-toggle-track-x {\\n position: absolute;\\n width: 10px;\\n height: 10px;\\n top: 0px;\\n bottom: 0px;\\n margin-top: auto;\\n margin-bottom: auto;\\n line-height: 0;\\n right: 10px;\\n opacity: 1;\\n -webkit-transition: opacity 0.25s ease;\\n -moz-transition: opacity 0.25s ease;\\n transition: opacity 0.25s ease;\\n}\\n\\n.react-toggle--checked .react-toggle-track-x {\\n opacity: 0;\\n}\\n\\n.react-toggle-thumb {\\n transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1) 0ms;\\n position: absolute;\\n top: 1px;\\n left: 1px;\\n width: 22px;\\n height: 22px;\\n border: 1px solid #4D4D4D;\\n border-radius: 50%;\\n background-color: #FAFAFA;\\n\\n -webkit-box-sizing: border-box;\\n -moz-box-sizing: border-box;\\n box-sizing: border-box;\\n\\n -webkit-transition: all 0.25s ease;\\n -moz-transition: all 0.25s ease;\\n transition: all 0.25s ease;\\n}\\n\\n.react-toggle--checked .react-toggle-thumb {\\n left: 27px;\\n border-color: #19AB27;\\n}\\n\\n.react-toggle--focus .react-toggle-thumb {\\n -webkit-box-shadow: 0px 0px 3px 2px #0099E0;\\n -moz-box-shadow: 0px 0px 3px 2px #0099E0;\\n box-shadow: 0px 0px 2px 3px #0099E0;\\n}\\n\\n.react-toggle:active:not(.react-toggle--disabled) .react-toggle-thumb {\\n -webkit-box-shadow: 0px 0px 5px 5px #0099E0;\\n -moz-box-shadow: 0px 0px 5px 5px #0099E0;\\n box-shadow: 0px 0px 5px 5px #0099E0;\\n}\\n\", \"\"]);\n// Exports\nmodule.exports = exports;\n","// source: https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent\r\n(function () {\r\n\tif (typeof window.CustomEvent === 'function') {\r\n\t\treturn false;\r\n\t}\r\n\r\n\tfunction CustomEvent(event, params) {\r\n\t\tparams = params || { bubbles: false, cancelable: false, detail: undefined };\r\n\t\t// eslint-disable-next-line\r\n\t\tvar evt = document.createEvent('CustomEvent');\r\n\t\tevt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);\r\n\t\treturn evt;\r\n\t}\r\n\r\n\tCustomEvent.prototype = window.Event.prototype;\r\n\r\n\twindow.CustomEvent = CustomEvent;\r\n})();\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Left chevron SVG\r\n *\r\n * @returns\r\n */\r\nfunction LeftChevronSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default LeftChevronSVG;\r\n","// These functions may be potentially innaccurate in certain locales that use differing amounts of characters in different cases\r\n\r\n/**\r\n * Tests if a string includes another if casing is ignored\r\n * @param thisString The string to test\r\n * @param otherString The potentially included string being tested for\r\n */\r\nexport function stringWeaklyIncludes(thisString: string, otherString: string) {\r\n\treturn thisString.toLocaleLowerCase().includes(otherString.toLocaleLowerCase());\r\n}\r\n\r\n/**\r\n * Tests if a string starts with another if casing is ignored\r\n * @param thisString The string to test\r\n * @param otherString The potentially included string being tested for\r\n */\r\nexport function stringWeaklyStartsWith(thisString: string, otherString: string) {\r\n\treturn thisString.toLocaleLowerCase().startsWith(otherString.toLocaleLowerCase());\r\n}\r\n\r\n/**\r\n * Tests if a string ends with another if casing is ignored\r\n * @param thisString The string to test\r\n * @param otherString The potentially included string being tested for\r\n */\r\nexport function stringWeaklyEndsWith(thisString: string, otherString: string) {\r\n\treturn thisString.toLocaleLowerCase().endsWith(otherString.toLocaleLowerCase());\r\n}\r\n\r\n/**\r\n * Converts the first character in a string to upper-case. Will not work for all languages (for example Dutch).\r\n *\r\n * @export\r\n * @param {string} thisString\r\n * @returns\r\n */\r\nexport function firstCharacterToUpper(thisString: string) {\r\n\tif (!thisString) {\r\n\t\treturn '';\r\n\t}\r\n\r\n\tlet newString = thisString.substring(0, 1).toLocaleUpperCase();\r\n\r\n\tif (thisString.length > 1) {\r\n\t\tnewString += thisString.substring(1);\r\n\t}\r\n\r\n\treturn newString;\r\n}\r\n\r\n/**\r\n * Converts the first character in a string to upper-case. Will not work for all languages (for example Dutch).\r\n *\r\n * @export\r\n * @param {string} thisString\r\n * @returns\r\n */\r\nexport function firstCharacterToLower(thisString: string) {\r\n\tif (!thisString) {\r\n\t\treturn '';\r\n\t}\r\n\r\n\tlet newString = thisString.substring(0, 1).toLocaleLowerCase();\r\n\r\n\tif (thisString.length > 1) {\r\n\t\tnewString += thisString.substring(1);\r\n\t}\r\n\r\n\treturn newString;\r\n}\r\n\r\n// https://github.com/uxitten/polyfill/blob/master/string.polyfill.js\r\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padStart\r\nexport function padStart(value, targetLength, padString) {\r\n\t// tslint:disable-next-line:no-bitwise\r\n\ttargetLength = targetLength >> 0; // truncate if number, or convert non-number to 0;\r\n\tpadString = String(typeof padString !== 'undefined' ? padString : ' ');\r\n\tif (value.length >= targetLength) {\r\n\t\treturn String(value);\r\n\t} else {\r\n\t\ttargetLength = targetLength - value.length;\r\n\t\tif (targetLength > padString.length) {\r\n\t\t\tpadString += padString.repeat(targetLength / padString.length); // append to original to ensure we are longer than needed\r\n\t\t}\r\n\t\treturn padString.slice(0, targetLength) + String(value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Converts a string from \" Something Like This\" to \"something-like-this\"\r\n * @param value The string to convert\r\n */\r\nexport function toKebabCase(value: string) {\r\n\tif (!value || !value.trim()) {\r\n\t\treturn '';\r\n\t}\r\n\r\n\treturn value\r\n\t\t.trim()\r\n\t\t.replace(/[^a-zA-Z0-9]+/g, '-')\r\n\t\t.replace(/([a-z0-9])([A-Z])/g, '$1-$2')\r\n\t\t.replace(/([A-Z])([A-Z])(?=[a-z])/g, '$1-$2')\r\n\t\t.replace(/-$/, '')\r\n\t\t.toLocaleLowerCase();\r\n}\r\n\r\n/**\r\n * Converts a string from PascalCase, camelCase, snake_case, or space separated to camelCase. Beginning and trailing whitespace are trimmed.\r\n * @param value The string to convert\r\n */\r\nexport function toCamelCase(value: string) {\r\n\treturn value\r\n\t\t.replace(/(?:^\\w|[A-Z]|\\b\\w)/g, function (word, index) {\r\n\t\t\treturn index === 0 ? word.toLowerCase() : word.toUpperCase();\r\n\t\t})\r\n\t\t.replace(/(?:\\s+|[-_])/g, '');\r\n}\r\n\r\n/**\r\n * Removes html characters\r\n *\r\n * @export\r\n * @param {*} html\r\n * @returns\r\n */\r\nexport function stripHtml(html) {\r\n\tconst tmp = document.createElement('div');\r\n\ttmp.innerHTML = html;\r\n\treturn tmp.textContent || tmp.innerText || '';\r\n}\r\n\r\n/**\r\n * Cuts of text and adds ellipsis (...) after a certain number of characters\r\n * @param text The text to format\r\n * @param cutoff The number of characters to add the ellipsis after\r\n */\r\nexport function addEllipsis(text: string, cutoff: number = 20) {\r\n\tif (!text || text.length < cutoff) {\r\n\t\treturn text;\r\n\t}\r\n\r\n\treturn text.substring(0, cutoff) + '...';\r\n}\r\n\r\n/**\r\n * Trims a string value\r\n */\r\nexport function trimString(value: string) {\r\n\treturn value ? value.trim() : '';\r\n}\r\n","import { ExternalLoginProvider } from 'features/login/ExternalLogins';\r\n\r\n/**\r\n * Extends Window with a property that will hold the client data\r\n *\r\n * @interface WindowWithClientData\r\n * @extends {Window}\r\n */\r\ninterface WindowWithServerData extends Window {\r\n\t__ROC_SERVER_DATA__?: Array<{\r\n\t\t[name: string]: string;\r\n\t}>;\r\n}\r\n\r\n/**\r\n * This type will hold all the keys that are used by ServerData\r\n */\r\ninterface ServerData {\r\n\tIsReCaptchaEnabled?: boolean;\r\n\tReCaptchaV3Key?: string;\r\n\tTimeZone?: string;\r\n\tUSE_EMAIL_AS_USERNAME?: boolean;\r\n\tRegistrationThankYouTitle?: string;\r\n\tRegistrationThankYouMessage?: string;\r\n\tForgotPasswordConfirmationTitle?: string;\r\n\tForgotPasswordConfirmationMessage?: string;\r\n\tPageTitleSuffix?: string;\r\n\tRequireConfirmEmail?: boolean;\r\n\tACCOUNT_URL_BASE?: string;\r\n\tACCOUNT_LOGIN_URL?: string;\r\n\tACCOUNT_LOGOUT_URL?: string;\r\n\tACCOUNT_REGISTER_URL?: string;\r\n\tACCOUNT_LOGIN_WITH_2FA_URL?: string;\r\n\tACCOUNT_FORGOT_PASSWORD_URL?: string;\r\n\tACCOUNT_LOGIN_WITH_RECOVERY_CODE_URL?: string;\r\n\tEXTERNAL_LOGIN_PROVIDERS?: ExternalLoginProvider[];\r\n\t// #region Commerce\r\n\tACCOUNT_ORGANIZATION_REVIEW_URL?: string;\r\n\tACCOUNT_ORGANIZATION_SELECTOR_URL?: string;\r\n\tGoogleMapsApiKey?: string; // used in Store Locator\r\n\tMinimumTimeBeforeRecentlyViewedProductsAreValidated?: number;\r\n\tQuickOrderItemMinumumSearchCharacters?: number;\r\n\tMaxAllowedQuickOrderItems?: number;\r\n\tMaxNumberForQuantityDropdown?: number;\r\n\tOrderDetailsUIComponent?: string;\r\n\tGuestCheckoutEnabled?: boolean;\r\n\t// #endregion\r\n}\r\n\r\n/**\r\n * Main object that will hold all the client data\r\n */\r\nexport const ServerData: ServerData = {};\r\n\r\n/**\r\n * Initializer function that will populate the main settings object\r\n */\r\nfunction initializeServerData() {\r\n\tconst windowWithServerData = window as WindowWithServerData;\r\n\r\n\tif (\r\n\t\twindowWithServerData &&\r\n\t\twindowWithServerData.__ROC_SERVER_DATA__ &&\r\n\t\tArray.isArray(windowWithServerData.__ROC_SERVER_DATA__)\r\n\t) {\r\n\t\tfor (const obj of windowWithServerData.__ROC_SERVER_DATA__) {\r\n\t\t\tfor (const key of Object.keys(obj)) {\r\n\t\t\t\tServerData[key] = obj[key];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\ninitializeServerData();\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Right chevron SVG\r\n *\r\n * @returns\r\n */\r\nfunction RightChevronSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default RightChevronSVG;\r\n","import Axios, { AxiosRequestConfig, AxiosError, AxiosResponse, CancelTokenSource } from 'axios';\r\nimport { useLoader } from './useLoader';\r\nimport { useRef, useEffect, useState } from 'react';\r\nimport AxiosHelper from 'services/AxiosHelper';\r\n\r\n/**\r\n * Use Axios Loader Params\r\n * @param axiosParams The parameters for the request being passed into axios. This includes the method, url, data, etc.\r\n * @param callback A function that is called after a form is posted. It'll include a parameter with the error if something went wrong.\r\n */\r\nexport interface UseAxiosLoaderParams {\r\n\taxiosParams: AxiosRequestConfig;\r\n\tactive?: boolean;\r\n\tcallback?: (error: Error | AxiosError | undefined) => any;\r\n\tcacheKey?: string;\r\n}\r\n\r\nconst cache = {};\r\n\r\n/**\r\n * A reusable hook that facilitates executing axios requests.\r\n */\r\nexport function useAxiosLoader({ axiosParams, active = true, callback, cacheKey }: UseAxiosLoaderParams) {\r\n\tif (axiosParams.method === undefined) {\r\n\t\taxiosParams.method = 'GET';\r\n\t}\r\n\r\n\tconst { ...rest } = axiosParams;\r\n\tconst { loading, setLoading, error, setError, response, setResponse } = useLoader>();\r\n\tconst [reloadTimes, setReloadTimes] = useState(0);\r\n\tconst cancelToken = useRef();\r\n\r\n\tconst reload = () => {\r\n\t\tsetReloadTimes(reloadTimes + 1);\r\n\t};\r\n\r\n\tuseEffect(() => {\r\n\t\t(async () => {\r\n\t\t\ttry {\r\n\t\t\t\tif (!active) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcancelToken.current = Axios.CancelToken.source();\r\n\r\n\t\t\t\tsetLoading(true);\r\n\t\t\t\tsetError(undefined);\r\n\r\n\t\t\t\tlet response: AxiosResponse;\r\n\r\n\t\t\t\tif (cacheKey && cache[cacheKey]) {\r\n\t\t\t\t\tresponse = cache[cacheKey];\r\n\t\t\t\t} else {\r\n\t\t\t\t\tresponse = await AxiosHelper(rest);\r\n\t\t\t\t\tif (cacheKey) {\r\n\t\t\t\t\t\tcache[cacheKey] = response;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tsetResponse(response);\r\n\r\n\t\t\t\tif (callback !== undefined) {\r\n\t\t\t\t\treturn callback(undefined);\r\n\t\t\t\t}\r\n\t\t\t} catch (error) {\r\n\t\t\t\tif (Axios.isCancel(error)) {\r\n\t\t\t\t\t// if the component was unmounted, there's nothing to do\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tsetError(error);\r\n\r\n\t\t\t\tif (callback !== undefined) {\r\n\t\t\t\t\treturn callback(error);\r\n\t\t\t\t}\r\n\t\t\t} finally {\r\n\t\t\t\tsetLoading(false);\r\n\t\t\t}\r\n\t\t})();\r\n\r\n\t\treturn () => {\r\n\t\t\t// cleanup\r\n\t\t\tif (cancelToken.current) {\r\n\t\t\t\tcancelToken.current.cancel();\r\n\t\t\t}\r\n\t\t};\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, [active, reloadTimes, ...Object.values(axiosParams)]); // this may be overkill? this means that if ANY axios params change, a new request will execute\r\n\r\n\treturn {\r\n\t\tloading,\r\n\t\terror,\r\n\t\tresponse,\r\n\t\tcancelToken: cancelToken.current,\r\n\t\treload,\r\n\t};\r\n}\r\n","import { useEffect, useState } from 'react';\r\nimport { SortByDirection } from 'shared-client/types/index';\r\nimport { BaseDto, PaginatedResult } from 'shared/types';\r\nimport { useAxiosLoader, UseAxiosLoaderParams } from './useAxiosLoader';\r\n\r\n/**\r\n * Use Axios Paginated Loader Params\r\n * @param axiosParams The parameters for the request being passed into axios. This includes the method, url, data, etc.\r\n * @param callback A function that is called after a form is posted. It'll include a parameter with the error if something went wrong.\r\n */\r\nexport interface UseAxiosPaginatedLoaderParams>\r\n\textends UseAxiosLoaderParams {\r\n\tquery?: string;\r\n\tinitialPageSize?: number;\r\n\tinitialSortByName?: string;\r\n\tinitialSortDirection?: SortByDirection;\r\n\tinitialResults?: T;\r\n\tcache?: boolean;\r\n\t//#region HCL\t\r\n\tinitialFilterValues?: Record;\r\n\t////#endregion\r\n}\r\n\r\n/**\r\n * The useAxiosPaginatedLoader hook result object\r\n */\r\nexport interface UseAxiosPaginatedLoaderResult> {\r\n\t/**\r\n\t * Current page number\r\n\t */\r\n\tpage: number;\r\n\t/**\r\n\t * Go to page and load results\r\n\t */\r\n\tgoToPage: (page: number) => void;\r\n\t/**\r\n\t * Go to next page and load results\r\n\t */\r\n\tgoToNextPage: () => void;\r\n\t/**\r\n\t * Go to previous page and load results\r\n\t */\r\n\tgoToPreviousPage: () => void;\r\n\t/**\r\n\t * Set sorting and load the results\r\n\t */\r\n\tsetSorting: (sortBy: string, direction: SortByDirection) => void;\r\n\t/**\r\n\t * Set page size and load the results\r\n\t */\r\n\tsetPageSize: (pageSize: number) => void;\r\n\t/**\r\n\t * Sets the custom query\r\n\t */\r\n\tsetQuery?: (query: string) => void;\r\n\t/**\r\n\t * Sets the sort by name\r\n\t */\r\n\tsetSortByName?: (sortBy: string) => void;\r\n\t/**\r\n\t * Sets the sort direction\r\n\t */\r\n\tsetSortDirection?: (direction: SortByDirection) => void;\r\n\t/**\r\n\t * Current sort by name\r\n\t */\r\n\tsortByName: string | undefined;\r\n\t/**\r\n\t * Current sort by direction\r\n\t */\r\n\tsortDirection: SortByDirection | undefined;\r\n\t/**\r\n\t * True if loading results\r\n\t */\r\n\tloading: boolean;\r\n\t/**\r\n\t * Error object if an error occurred while loading the results\r\n\t */\r\n\terror: Error | undefined;\r\n\t/**\r\n\t * Current paginated results object\r\n\t */\r\n\tresults: T | null | undefined;\r\n\r\n\t/**\r\n\t * Custom query string that includes\r\n\t * all the other parameters other than pagination and sorting ones\r\n\t */\r\n\tcustomQuery?: string | undefined;\r\n\r\n\t/**\r\n\t * If this function has been called another request will be triggered to get fresh results\r\n\t */\r\n\treload?: () => void;\r\n}\r\n\r\n/**\r\n * A reusable hook for pagination (data is loaded with axios).\r\n */\r\nexport function useAxiosPaginatedLoader>({\r\n\taxiosParams,\r\n\tactive = true,\r\n\tcallback,\r\n\tquery,\r\n\tinitialPageSize,\r\n\tinitialSortByName,\r\n\tinitialSortDirection,\r\n\tinitialResults,\r\n\tcache,\r\n}: UseAxiosPaginatedLoaderParams): UseAxiosPaginatedLoaderResult {\r\n\tconst [pageSize, setPageSizeState] = useState(initialPageSize);\r\n\tconst [pageNumber, setPageNumber] = useState(1);\r\n\tconst [sortByName, setSortByName] = useState(initialSortByName);\r\n\tconst [sortDirection, setSortDirection] = useState(initialSortDirection);\r\n\tconst [dataLoaderActive, setDataLoaderActive] = useState(initialResults === undefined);\r\n\tconst [customQuery, setCustomQuery] = useState(query);\r\n\r\n\tuseEffect(() => {\r\n\t\tsetDataLoaderActive(true);\r\n\t}, [pageNumber, sortByName, sortDirection, pageSize]);\r\n\r\n\tconst goToPage = (page: number) => {\r\n\t\tif (results && page > 0 && page <= results.pagination.totalPages) {\r\n\t\t\tsetPageNumber(page);\r\n\t\t}\r\n\t};\r\n\r\n\tconst goToNextPage = () => {\r\n\t\tif (results && pageNumber < results.pagination.totalPages) {\r\n\t\t\tsetPageNumber(pageNumber + 1);\r\n\t\t}\r\n\t};\r\n\r\n\tconst goToPreviousPage = () => {\r\n\t\tif (pageNumber === 1) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tsetPageNumber(pageNumber - 1);\r\n\t};\r\n\r\n\tconst setSorting = (sortBy: string, direction: SortByDirection) => {\r\n\t\tsetPageNumber(1);\r\n\t\tsetSortByName(sortBy);\r\n\t\tsetSortDirection(direction);\r\n\t};\r\n\r\n\tconst setQuery = (customQuery: string | undefined) => {\r\n\t\tsetPageNumber(1);\r\n\t\tsetCustomQuery(customQuery);\r\n\t};\r\n\r\n\tconst paginationQuery = `${pageSize ? `pagesize=${pageSize}` : ''}&pageNumber=${pageNumber}${\r\n\t\tsortByName ? `&sortBy=${sortByName}` : ''\r\n\t}${sortDirection ? `&sortDirection=${sortDirection}` : ''}`;\r\n\r\n\tconst url = `${axiosParams.url}${customQuery ? `?${customQuery}&${paginationQuery}` : `?${paginationQuery}`}`;\r\n\r\n\tconst { loading, error, response, reload } = useAxiosLoader({\r\n\t\taxiosParams: {\r\n\t\t\t...axiosParams,\r\n\t\t\turl: url,\r\n\t\t},\r\n\t\tactive: active && dataLoaderActive,\r\n\t\tcallback,\r\n\t\tcacheKey: cache ? url : undefined,\r\n\t});\r\n\r\n\tconst results = active && dataLoaderActive ? response && response.data : initialResults;\r\n\r\n\tconst setPageSize = (size: number) => {\r\n\t\tsetPageSizeState(size);\r\n\t};\r\n\r\n\treturn {\r\n\t\tpage: pageNumber,\r\n\t\tgoToPage,\r\n\t\tgoToNextPage,\r\n\t\tgoToPreviousPage,\r\n\t\tsetSorting,\r\n\t\tsetPageSize,\r\n\t\tsetQuery,\r\n\t\tsetSortByName,\r\n\t\tsetSortDirection,\r\n\t\treload,\r\n\t\tcustomQuery,\r\n\t\tsortByName,\r\n\t\tsortDirection,\r\n\t\tloading,\r\n\t\terror,\r\n\t\tresults,\r\n\t};\r\n}\r\n","import React from 'react';\r\nimport useDelayedDisplay from 'shared/hooks/useDelayedDisplay';\r\nimport classnames from 'classnames';\r\n\r\ntype SpinnerAlignment = 'left' | 'right' | 'none';\r\n\r\ninterface SpinnerProps {\r\n\tlight?: boolean;\r\n\twaitMs?: number;\r\n\talign?: SpinnerAlignment;\r\n\tblock?: boolean;\r\n\tparentCentered?: boolean;\r\n}\r\n\r\n/**\r\n * Reusable roc-spinner component with color, alignment and wait time props.\r\n *\r\n * @export\r\n * @param {SpinnerProps} { light = false, waitMs = 200, align = 'right', block }\r\n * @returns\r\n */\r\nexport default function Spinner({\r\n\tlight = false,\r\n\twaitMs = 200,\r\n\talign = 'right',\r\n\tblock,\r\n\tparentCentered = false,\r\n}: SpinnerProps) {\r\n\tconst display = useDelayedDisplay(waitMs);\r\n\r\n\tif (!display) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\tconst spinner = (\r\n\t\t\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t
\r\n\t\t
\r\n\t);\r\n\r\n\tif (parentCentered) {\r\n\t\treturn
{spinner}
;\r\n\t}\r\n\r\n\treturn spinner;\r\n}\r\n","import axios, { AxiosInstance, AxiosResponse, AxiosError } from 'axios';\r\nimport AccountUrls from 'shared/util/AccountUrls';\r\nimport { getCsrfToken } from './UserData';\r\n\r\n/**\r\n * Helper that creates an instance of Axios to be used throughout the client application\r\n * and adds a default X-Requested-With header to all requests.\r\n *\r\n */\r\nconst AxiosHelper: AxiosInstance = axios.create();\r\nAxiosHelper.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';\r\n\r\n// Add CSRF tokens to all commands that are not GET, HEAD, or OPTIONS\r\nAxiosHelper.interceptors.request.use(async (config) => {\r\n\tif (\r\n\t\tconfig.method?.toLowerCase() !== 'get' &&\r\n\t\tconfig.method?.toLowerCase() !== 'head' &&\r\n\t\tconfig.method?.toLowerCase() !== 'options'\r\n\t) {\r\n\t\tconst csrfToken = await getCsrfToken();\r\n\t\tconfig.headers = { RequestVerificationToken: csrfToken, ...config.headers };\r\n\t}\r\n\treturn config;\r\n});\r\n\r\nexport default AxiosHelper;\r\n\r\n// eslint-disable-next-line no-unused-vars\r\nexport const addUnauthorizedAccessInterceptor = (history) => {\r\n\t// this allows us to act when any request going through axios succeeds or fails.\r\n\tAxiosHelper.interceptors.response.use(\r\n\t\t(response: AxiosResponse) => {\r\n\t\t\treturn response;\r\n\t\t},\r\n\t\t(error: AxiosError) => {\r\n\t\t\tif (error.response && error.response.status === 401) {\r\n\t\t\t\twindow.location.replace(\r\n\t\t\t\t\t`${AccountUrls.Login}?ReturnUrl=${encodeURIComponent(window.location.pathname)}`,\r\n\t\t\t\t);\r\n\t\t\t}\r\n\r\n\t\t\treturn Promise.reject(error);\r\n\t\t},\r\n\t);\r\n};\r\n","export interface SortBy {\r\n\tname: string;\r\n\ttitle: string;\r\n\tdirection: SortByDirection;\r\n}\r\n\r\nexport enum SortByDirection {\r\n\tAscending = 'Ascending',\r\n\tDescending = 'Descending',\r\n}\r\n","import React from 'react';\r\nimport classnames from 'classnames';\r\nimport CircleExclamationSVG from 'shared/components/svg/CircleExclamationSVG';\r\nimport { useField } from 'react-final-form';\r\n\r\ninterface FieldInputErrorWrapperProps {\r\n\thideIcon?: boolean;\r\n\tchildren: React.ReactNode;\r\n\tinline?: boolean;\r\n\tname: string;\r\n}\r\n\r\n/**\r\n * Component for handling the invalid styles for inputs.\r\n *\r\n * @export\r\n * @param {FieldInputErrorWrapperProps} props\r\n * @returns\r\n */\r\nexport default function FieldInputErrorWrapper(props: FieldInputErrorWrapperProps) {\r\n\tconst { hideIcon = false, children, inline = false, name } = props;\r\n\tconst { meta } = useField(name);\r\n\tconst invalid =\r\n\t\t(meta.error || (meta.submitError && !meta.dirtySinceLastSubmit && !meta.submitting)) &&\r\n\t\tmeta.touched &&\r\n\t\tmeta.invalid\r\n\t\t\t? meta.invalid\r\n\t\t\t: false;\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t{children}\r\n\t\t\t{invalid && !hideIcon ? : null}\r\n\t\t
\r\n\t);\r\n}\r\n","/* eslint-disable jsx-a11y/label-has-for */\r\nimport React from 'react';\r\nimport { WithTestIdOptional } from 'shared-client/types/test';\r\nimport { toKebabCase } from 'util/StringUtil';\r\nimport OptionalFieldMarker from '../OptionalFieldMarker';\r\n\r\nexport interface FieldLabelProps extends WithTestIdOptional {\r\n\tlabel: string;\r\n\tname: string;\r\n\tid?: string;\r\n\tisRequired: boolean;\r\n\thtmlFor?: string;\r\n\tchildren?: React.ReactNode;\r\n}\r\n\r\n/**\r\n * Wrapper component for all field labels for ease of use.\r\n */\r\nexport default function FieldLabel(props: FieldLabelProps) {\r\n\tconst { label, id, isRequired, htmlFor, children, testId } = props;\r\n\r\n\tif (!label || !label.trim()) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t{label}\r\n\t\t\t{!isRequired ? : null}\r\n\t\t\t{children ? children : null}\r\n\t\t\r\n\t);\r\n}\r\n","import React from 'react';\r\nimport { Field, FieldProps, FieldRenderProps } from 'react-final-form';\r\nimport CheckboxInputField from './CheckboxInputField';\r\nimport { BaseInputProps } from './InputField';\r\n\r\nexport type InputFieldProps = FieldProps> & BaseInputProps;\r\n\r\n/**\r\n * Component that renders a checkbox field\r\n */\r\nexport default function CheckBoxField({\r\n\tname,\r\n\treadOnly = false,\r\n\tdisabled = false,\r\n\tlabel = '',\r\n\tafterSubmit,\r\n\tallowNull,\r\n\tbeforeSubmit,\r\n\tformatOnBlur,\r\n\tinitialValue,\r\n\tisEqual,\r\n\tsubscription,\r\n\tdefaultValue,\r\n}: InputFieldProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t{({ input, meta }) => (\r\n\t\t\t\t\r\n\t\t\t)}\r\n\t\t\r\n\t);\r\n}\r\n","import React from 'react';\r\nimport { Field, FieldProps, FieldRenderProps } from 'react-final-form';\r\nimport { DropdownOption } from 'shared-client/types/fields';\r\nimport { toKebabCase } from 'util/StringUtil';\r\nimport { FormFieldProps, ValidationMessages } from '.';\r\nimport FieldInputErrorWrapper from './FieldInputErrorWrapper';\r\nimport FieldLabel from './FieldLabel';\r\nexport type DropdownProps = FormFieldProps & {\r\n\taddSelectOption?: boolean;\r\n\toptions: DropdownOption[];\r\n\t// #region HCL\r\n\tdefaultValue?: any;\r\n\t// #endregion\r\n};\r\n\r\nexport type DropdownFieldProps = DropdownProps &\r\n\tFieldProps>;\r\n\r\n/**\r\n * Component that renders a Dropdown field component\r\n */\r\nexport default function DropdownField({\r\n\tname,\r\n\tisRequired = true,\r\n\treadOnly = false,\r\n\tdisabled = false,\r\n\taddSelectOption = true,\r\n\toptions,\r\n\tlabel = '',\r\n\tafterSubmit,\r\n\tallowNull,\r\n\tbeforeSubmit,\r\n\tformatOnBlur,\r\n\tisEqual,\r\n\tsubscription,\r\n\tvalidateFields,\r\n\ttestId,\r\n\t// #region HCL\r\n\tdefaultValue\r\n\t// #endregion\r\n}: DropdownFieldProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t{({ input: { value, onChange, onFocus, onBlur }, meta }) => (\r\n\t\t\t\t
\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{addSelectOption ? \r\n\t\t\t\t\t\t\t))}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t
\r\n\t\t\t)}\r\n\t\t\r\n\t);\r\n}\r\n","import React from 'react';\r\nimport StarRating from '~/shared/components/star-rating/StarRating';\r\nimport { Field } from 'react-final-form';\r\nimport OptionalFieldMarker from '../OptionalFieldMarker';\r\nimport ValidationMessages from './ValidationMessages';\r\nimport { FormFieldProps } from '.';\r\nimport FieldInputErrorWrapper from './FieldInputErrorWrapper';\r\nimport { LocalizedSpan } from 'services/Localizer';\r\nimport { toKebabCase } from 'util/StringUtil';\r\n\r\nexport interface StarRatingFieldProps extends FormFieldProps {\r\n\t/**\r\n\t * The maximum number of stars to display (default is 5)\r\n\t */\r\n\tmaxRating?: number;\r\n}\r\n\r\n/**\r\n * Reusable RFF-compatible field that displays a star rating input\r\n * @param props\r\n */\r\nexport default function StarRatingField({\r\n\tname,\r\n\tlabel = '',\r\n\treadOnly = false,\r\n\tdisabled = false,\r\n\tmaxRating = 5,\r\n\tisRequired = true,\r\n\ttestId,\r\n}: StarRatingFieldProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t{({ input: { value, onChange }, meta }) => (\r\n\t\t\t\t\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{label} {!isRequired ? : null}\r\n\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t
\r\n\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t${value}\r\n\t\t\t\t\t\t\t`,\r\n\t\t\t\t\t\t\t\t\t`${maxRating}\r\n\t\t\t\t\t\t\t`,\r\n\t\t\t\t\t\t\t\t]}\r\n\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t
\r\n\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t)}\r\n\t\t
\r\n\t);\r\n}\r\n","import * as React from 'react';\r\nimport { ValidationMessages, FormFieldProps } from '.';\r\nimport { FieldProps, Field, FieldRenderProps } from 'react-final-form';\r\nimport FieldLabel from './FieldLabel';\r\nimport FieldInputErrorWrapper from './FieldInputErrorWrapper';\r\nimport { toKebabCase } from 'util/StringUtil';\r\nimport classnames from 'classnames';\r\n\r\nexport type TextAreaFieldProps = FieldProps> &\r\n\tFormFieldProps & {\r\n\t\trows?: number;\r\n\t\tplaceholder?: string;\r\n\t\tmaxLength?: number;\r\n\t};\r\n\r\n/**\r\n * Component that renders a textarea input component.\r\n */\r\nexport default function TextAreaField({\r\n\tname,\r\n\tisRequired = true,\r\n\treadOnly = false,\r\n\tdisabled = false,\r\n\tplaceholder = '',\r\n\tlabel = '',\r\n\trows = 5,\r\n\tvalidate,\r\n\tafterSubmit,\r\n\tallowNull,\r\n\tbeforeSubmit,\r\n\tcomponent,\r\n\tdefaultValue,\r\n\tformat,\r\n\tformatOnBlur,\r\n\tinitialValue,\r\n\tisEqual,\r\n\tparse,\r\n\trender,\r\n\tsubscription,\r\n\tvalue,\r\n\ttestId,\r\n\tmaxLength,\r\n}: TextAreaFieldProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t{({ input, meta }) => (\r\n\t\t\t\t
\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t
\r\n\t\t\t)}\r\n\t\t\r\n\t);\r\n}\r\n","import React from 'react';\r\nimport { FieldRenderProps } from 'react-final-form';\r\nimport { toKebabCase } from 'util/StringUtil';\r\nimport { FormFieldProps, ValidationMessages } from '.';\r\nimport FieldInputErrorWrapper from './FieldInputErrorWrapper';\r\nimport FieldLabel from './FieldLabel';\r\n\r\nexport interface BaseInputProps extends FormFieldProps {\r\n\ttype?: string;\r\n\tstep?: string;\r\n}\r\n\r\nexport type InputFieldProps = FieldRenderProps &\r\n\tBaseInputProps & {\r\n\t\tplaceholder?: string;\r\n\t};\r\n\r\nexport type HTMLInputRef = React.MutableRefObject;\r\n/**\r\n * Component that renders an input with form field.\r\n */\r\nconst InputField = React.forwardRef((props: InputFieldProps, ref: HTMLInputRef) => {\r\n\tconst {\r\n\t\tinput: { name, onChange, value },\r\n\t\tmeta,\r\n\t\ttype,\r\n\t\tlabel = '',\r\n\t\tisRequired = true,\r\n\t\tdisabled = false,\r\n\t\treadOnly = false,\r\n\t\tplaceholder = '',\r\n\t\tstep,\r\n\t\ttestId,\r\n\t\t// #region HCL\r\n\t\tmaxLength,\r\n\t\t// #endregion\r\n\t} = props;\r\n\r\n\treturn (\r\n\t\t
\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t
\r\n\t);\r\n});\r\n\r\nexport default InputField;\r\n","import React from 'react';\r\nimport { Field, FieldProps, FieldRenderProps } from 'react-final-form';\r\nimport InputField, { BaseInputProps, HTMLInputRef } from './InputField';\r\n\r\nexport type InputFieldProps = FieldProps> & BaseInputProps;\r\n\r\n/**\r\n * Component that renders a text box component, of the specified type\r\n */\r\nconst TextBoxField = React.forwardRef((props: InputFieldProps, ref: HTMLInputRef) => {\r\n\tconst {\r\n\t\tname,\r\n\t\ttype = 'text',\r\n\t\tisRequired = true,\r\n\t\treadOnly = false,\r\n\t\tdisabled = false,\r\n\t\tplaceholder = '',\r\n\t\tlabel = '',\r\n\t\tvalidate,\r\n\t\tafterSubmit,\r\n\t\tallowNull,\r\n\t\tbeforeSubmit,\r\n\t\tcomponent,\r\n\t\tdefaultValue,\r\n\t\tformat,\r\n\t\tformatOnBlur,\r\n\t\tinitialValue,\r\n\t\tisEqual,\r\n\t\tparse,\r\n\t\trender,\r\n\t\tsubscription,\r\n\t\tvalue,\r\n\t\ttestId,\r\n\t\t// #region HCL\r\n\t\tmaxLength,\r\n\t\t// # endregion\r\n\t} = props;\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t{({ input, meta }) => (\r\n\t\t\t\t\r\n\t\t\t)}\r\n\t\t\r\n\t);\r\n});\r\n\r\nexport default TextBoxField;\r\n","import React from 'react';\r\nimport classnames from 'classnames';\r\nimport { Localizer } from 'services/Localizer';\r\nimport { AxiosError } from 'axios';\r\nimport XSVG from 'shared/components/svg/XSVG';\r\n\r\ntype Theme = 'danger' | 'warning' | 'info' | 'success';\r\n\r\nexport interface ErrorAlertProps {\r\n\t/**\r\n\t * The title of the error message such as \"Uh Oh!\" or \"An Unexpected Error has Occurred!\"\r\n\t */\r\n\ttitle: string;\r\n\r\n\t/**\r\n\t * The error message to display if an error object doesn't have a more appropriate message.\r\n\t */\r\n\tmessage: React.ReactNode | string;\r\n\r\n\tchildren?: any;\r\n\r\n\ttheme?: Theme;\r\n\r\n\tisTitleOnOwnRow?: boolean;\r\n\r\n\t/** The error responsible for this message. */\r\n\terror: AxiosError | Error | null;\r\n\r\n\t/**\r\n\t * Method from parent that handles collapse state.\r\n\t */\r\n\tonCollapse?: (collased: boolean) => void;\r\n\r\n\t/**\r\n\t * Controlled collapse state from parent.\r\n\t */\r\n\tisCollapsed?: boolean;\r\n}\r\n\r\n/**\r\n * Reusable Error Alert Component.\r\n */\r\nexport default function InlineAlert(props: ErrorAlertProps) {\r\n\tconst {\r\n\t\ttitle = InlineAlert.defaultProps.title,\r\n\t\tchildren,\r\n\t\ttheme = 'danger',\r\n\t\tisTitleOnOwnRow = false,\r\n\t\terror = InlineAlert.defaultProps.error,\r\n\t\tisCollapsed = false,\r\n\t\tonCollapse,\r\n\t} = props;\r\n\r\n\tlet { message = InlineAlert.defaultProps.message } = props;\r\n\r\n\tconst axiosError = error as AxiosError | null;\r\n\tif (axiosError?.isAxiosError && axiosError != null && axiosError.response == null && axiosError.request != null) {\r\n\t\tmessage = Localizer('ErrorMessageNetwork');\r\n\t}\r\n\r\n\tif (axiosError?.isAxiosError && (axiosError?.response?.status === 401 || axiosError?.response?.status === 403)) {\r\n\t\tmessage = Localizer('ErrorMessageForbidden');\r\n\t}\r\n\r\n\tif (axiosError?.response?.data?.message) {\r\n\t\tmessage = axiosError.response.data.message;\r\n\t}\r\n\r\n\tif (isCollapsed) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t{onCollapse ? (\r\n\t\t\t\t\r\n\t\t\t) : null}\r\n\r\n\t\t\t{title ? (\r\n\t\t\t\t\r\n\t\t\t\t\t{title}\r\n\t\t\t\t\r\n\t\t\t) : null}\r\n\r\n\t\t\t{message ? {message} : null}\r\n\r\n\t\t\t{children ? <> {children} : null}\r\n\t\t\r\n\t);\r\n}\r\n\r\n/**\r\n * Error Alert Default Props\r\n */\r\nInlineAlert.defaultProps = {\r\n\ttitle: Localizer('ErrorMessageGenericTitle'),\r\n\tmessage: Localizer('UnexpectedErrorOccurred'),\r\n\terror: null,\r\n};\r\n","import { useEffect } from 'react';\r\nimport 'shared/polyfills/customEvent';\r\nimport { RocEventType, ExtractEventParameters, RocEvent } from 'shared/events';\r\nimport addRocEventHandler from 'shared/util/events/rocEventUtils';\r\n\r\n/**\r\n * Helper function for dispatching ROC events.\r\n *\r\n * @param eventType The event type for the dispatcher\r\n */\r\nexport function dispatchRocEvent(eventType: T, data: ExtractEventParameters) {\r\n\tconst event = new CustomEvent(eventType, {\r\n\t\tdetail: data,\r\n\t});\r\n\tdocument.dispatchEvent(event);\r\n}\r\n\r\n/**\r\n * Reusable hook for handling ROC events\r\n *\r\n * @param eventType The type of event to handle\r\n * @param eventHandler The event handler\r\n * @param deps List of dependencies\r\n */\r\nexport default function useRocEventHandler(\r\n\teventType: T,\r\n\teventHandler: (data: ExtractEventParameters) => void,\r\n\tdeps?: any[],\r\n) {\r\n\tuseEffect(() => {\r\n\t\tconst removeHandlerCallback = addRocEventHandler(eventType, eventHandler);\r\n\r\n\t\treturn () => {\r\n\t\t\tremoveHandlerCallback();\r\n\t\t};\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, deps);\r\n}\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * X SVG\r\n *\r\n * @returns\r\n */\r\nfunction XSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default XSVG;\r\n","import AxiosHelper from 'services/AxiosHelper';\r\nimport { AxiosResponse } from 'axios';\r\n\r\nexport interface UserSummary {\r\n\tisSignedIn: boolean;\r\n\tuserName: string | null;\r\n\tfirstName: string | null;\r\n\tlastName: string | null;\r\n\temail: string | null;\r\n\tphoneNumber: string | null;\r\n\ttwoFactorEnabled: boolean;\r\n\thasRecoveryCodes: boolean;\r\n\tisMachineRemembered: boolean;\r\n\tannouncements: UserAnnouncement[];\r\n\tisExternalLoginUser: boolean;\r\n\t// #region HCL\r\n\tversaPayEnabled: boolean;\r\n\tversaPayRedirectUrl: string | null;\r\n\tazureUserId: string | null;\r\n\t// #endregion\r\n}\r\n\r\n/** Represents the details about an admin impersonation session of the logged in user. */\r\nexport interface Impersonation {\r\n\t/** The id of the admin impersonating the front end user. */\r\n\timpersonatorId: string;\r\n\r\n\t/** The name of the admin impersonating the front end user. */\r\n\timpersonatorName: string;\r\n\r\n\t/** The id of the active user impersonation session. */\r\n\tsessionId: string;\r\n}\r\n\r\nexport interface UserData {\r\n\t/**\r\n\t * Summary of user-specific details\r\n\t */\r\n\tsummary?: UserSummary;\r\n\r\n\t/**\r\n\t * CSRF validation token generated by the server\r\n\t */\r\n\trequestToken?: string;\r\n\r\n\t/**\r\n\t * The information on an impersonation session if one is active.\r\n\t * If an impersonation session isn't active this field will be undefined.\r\n\t */\r\n\timpersonation?: Impersonation;\r\n}\r\n\r\nexport interface UserAnnouncement {\r\n\t/** The id used as the primary key for the announcement in the database */\r\n\tid: string;\r\n\r\n\t/** An announcement to be displayed to the user */\r\n\tmessage: string;\r\n\r\n\t/** A list of pages where the announcement will be displayed. This will be an empty array if it is to be displayed on all pages. */\r\n\tpages: string[];\r\n}\r\n\r\nlet userDataPromise: Promise> | null = null;\r\n\r\n/**\r\n * Returns details related to the current user. By default, this is primarily their first/last name\r\n * and whether they are logged in or not. This can customized to include more details if necessary.\r\n */\r\nexport const getUserData = () => {\r\n\tif (userDataPromise === null) {\r\n\t\tuserDataPromise = AxiosHelper.get('/ajax/user');\r\n\t}\r\n\r\n\treturn userDataPromise;\r\n};\r\n\r\n/**\r\n * Returns non-cached details related to the current user. By default, this is primarily their first/last name\r\n * and whether they are logged in or not. This can customized to include more details if necessary.\r\n */\r\nexport const getUserDataNoCache = () => {\r\n\treturn AxiosHelper.get('/ajax/user');\r\n};\r\n\r\n/**\r\n * Returns a promise that will contain the CSRF token generated on the server to be used to validate\r\n * forms being posted via AJAX.\r\n */\r\nexport async function getCsrfToken() {\r\n\ttry {\r\n\t\tconst userData = await getUserData();\r\n\t\treturn userData.data.requestToken;\r\n\t} catch (error) {\r\n\t\tconsole.warn('Unable to load CSRF token.');\r\n\t\treturn '';\r\n\t}\r\n}\r\n\r\n// #region Commerce\r\nimport { CartSummary } from './UserData.Commerce';\r\nimport { LocationDto } from 'features/commerce/store-locator/types';\r\nimport { OrganizationInvite, OrganizationShipTo } from 'shared-client/types/commerce/organization';\r\nimport { AutoSuggestOption } from '../../../Roc.SharedClientApp/types/fields';\r\n\r\n// Commerce extensions to the UserData interface\r\nexport interface UserData {\r\n\t// #region HCL - allows null\r\n\tcartSummary?: CartSummary | null;\r\n\t// #endregion\r\n\r\n\t/***\r\n\t * The customer's default store location or null if not set\r\n\t */\r\n\tdefaultStoreLocation?: LocationDto | null;\r\n\r\n\t/**\r\n\t * If store is enabled for this site\r\n\t */\r\n\tenableStoreLocation?: boolean;\r\n}\r\n\r\n/***\r\n * Organization data and permissions\r\n */\r\nexport interface Organization {\r\n\tid: string;\r\n\tpurchaseOrderNumberRequired: boolean;\r\n\tcreditCardAllowed: boolean;\r\n\tgiftCardAllowed: boolean;\r\n\torganizationName: string;\r\n\tcorpAccountAllowed: boolean;\r\n}\r\n\r\n/***\r\n * Organization dto data\r\n */\r\nexport interface OrganizationDto extends AutoSuggestOption {}\r\n\r\n/***\r\n * User's organization and permissions data\r\n */\r\nexport interface UserSummary {\r\n\t/***\r\n\t * User's current default organization\r\n\t */\r\n\torganization: Organization | null;\r\n\r\n\t/***\r\n\t * The list of organizations the user is part of\r\n\t */\r\n\tuserOrganizations?: OrganizationDto[] | null;\r\n\r\n\t/***\r\n\t * The selected organization ship to\r\n\t */\r\n\tselectedShipTo: OrganizationShipTo | null;\r\n\r\n\t/***\r\n\t * Defines if the user has multiple shiptos to select from\r\n\t */\r\n\thasMultipleShipTos: boolean | null;\r\n\r\n\t/***\r\n\t * Defines if the user has saved payment methods\r\n\t */\r\n\thasSavedPaymentMethods: boolean | null;\r\n\r\n\t/***\r\n\t * The list of user permissions\r\n\t */\r\n\tpermissions?: UserPermissions;\r\n\r\n\t/***\r\n\t * The list of organizations the user is invited to join\r\n\t */\r\n\torganizationInvites?: OrganizationInvite[];\r\n\r\n\t/***\r\n\t * The user organization removal notification\r\n\t * Used to notify the user if he is no more part of his default organization\r\n\t */\r\n\tuserOrganizationRemovalNotification?: string;\r\n}\r\n\r\n/***\r\n * User's permissions\r\n */\r\nexport interface UserPermissions {\r\n\t/***\r\n\t * Defines if the current user can see organization users\r\n\t */\r\n\tcanSeeOrganizationUsers?: boolean;\r\n\r\n\t/***\r\n\t * Defines if the current user can assign roles to organization users\r\n\t */\r\n\tcanAssignRolesToOrganizationUsers?: boolean;\r\n\r\n\t/***\r\n\t * Defines if the current user can remove users from an organization\r\n\t */\r\n\tremoveUserFromOrganization?: boolean;\r\n\r\n\t/***\r\n\t * Defines if the current user can create organization users\r\n\t */\r\n\tcreateOrganizationUser?: boolean;\r\n\r\n\t/***\r\n\t * Defines if the current user can enable/disable ShipTos for organization users\r\n\t */\r\n\tmanageShipTosAssociation?: boolean;\r\n\r\n\t/***\r\n\t * Defines if the current user can see status of the organization users\r\n\t */\r\n\tcanSeePendingOrganizationUsers?: boolean;\r\n}\r\n// #endregion\r\n","export enum ModelStatus {\r\n\tPublished = 'Published',\r\n\tInactive = 'Inactive',\r\n\tDeleted = 'Deleted',\r\n\tDraft = 'Draft',\r\n\tArchived = 'Archived',\r\n}\r\n","import React from 'react';\r\nimport InlineAlert from 'shared/edit/InlineAlert';\r\n\r\n// eslint-disable-next-line\r\n// tslint:disable-next-line\r\nexport interface ErrorBoundaryRenderProps extends ErrorBoundaryState {}\r\n\r\nexport interface ErrorBoundaryProps {\r\n\tchildren: React.ReactNode;\r\n\trenderError?: (renderProps: ErrorBoundaryRenderProps) => React.ReactNode;\r\n}\r\n\r\nexport interface ErrorBoundaryState {\r\n\terror?: Error;\r\n}\r\n\r\n/**\r\n * Default Error Boundary component for frontend components, so that in case a JS error occurs, we show\r\n * something instead of nothing.\r\n */\r\nexport default class ErrorBoundary extends React.Component {\r\n\tpublic static defaultProps = {\r\n\t\trenderError: (renderProps: ErrorBoundaryRenderProps) => ,\r\n\t};\r\n\r\n\tpublic state: ErrorBoundaryState = {};\r\n\r\n\tpublic componentDidCatch(error: Error) {\r\n\t\tif (error.name === 'ChunkLoadError') {\r\n\t\t\tconst lastRefreshedTimestamp = new Date(\r\n\t\t\t\tparseInt(window.localStorage.getItem('force-refresh-timestamp') || '0'),\r\n\t\t\t);\r\n\t\t\tconst pageAlreadyRefreshedLessThan30SecondsAgo =\r\n\t\t\t\tnew Date(lastRefreshedTimestamp.getTime() + 30 * 1000) > new Date();\r\n\r\n\t\t\tif (!pageAlreadyRefreshedLessThan30SecondsAgo) {\r\n\t\t\t\t// Assuming that the user is not on the latest version of the application. Refresh the page immediately.\r\n\t\t\t\twindow.localStorage.setItem('force-refresh-timestamp', new Date().getTime().toString());\r\n\t\t\t\treturn window.location.reload();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.setState({\r\n\t\t\terror,\r\n\t\t});\r\n\t}\r\n\r\n\tpublic render() {\r\n\t\tif (this.state.error) {\r\n\t\t\treturn this.props.renderError!(this.state);\r\n\t\t}\r\n\r\n\t\treturn this.props.children;\r\n\t}\r\n}\r\n","import { ServerData } from 'services/ServerData';\r\n\r\nexport default {\r\n\tBaseUrl: ServerData.ACCOUNT_URL_BASE ?? '/my-account',\r\n\tLogin: ServerData.ACCOUNT_LOGIN_URL ?? '/my-account/login',\r\n\tLogin2fa: ServerData.ACCOUNT_LOGIN_WITH_2FA_URL ?? '/my-account/login-with-2fa',\r\n\tRegister: ServerData.ACCOUNT_REGISTER_URL ?? '/my-account/register',\r\n\tForgotPassword: ServerData.ACCOUNT_FORGOT_PASSWORD_URL ?? '/my-account/forgot-password',\r\n\tLoginWithRecoveryCode: ServerData.ACCOUNT_LOGIN_WITH_RECOVERY_CODE_URL ?? '/my-account/login-with-recovery-code',\r\n\tLogout: ServerData.ACCOUNT_LOGOUT_URL ?? '/my-account/logout',\r\n\t// #region Commerce\r\n\tOrganizationReview: ServerData.ACCOUNT_ORGANIZATION_REVIEW_URL ?? '/my-account/organization-review',\r\n\tOrganizationSelector: ServerData.ACCOUNT_ORGANIZATION_SELECTOR_URL ?? '/my-account/organization-selector',\r\n\t// #endregion\r\n\t// #region HCL - hardcoded same way as external login is\r\n\tExternalLogout: '/my-account/external-logout',\r\n\t// #endregion\r\n};\r\n","import React from 'react';\r\nimport { Localizer } from 'services/Localizer';\r\n\r\n/**\r\n * Reusable component for the optional field marker\r\n */\r\nfunction OptionalFieldMarker() {\r\n\treturn ({Localizer('Optional')});\r\n}\r\n\r\nexport default React.memo(OptionalFieldMarker);\r\n","// source: https://developer.mozilla.org/en-US/docs/Web/API/Element/getAttributeNames\r\n/* eslint-disable no-var */\r\n(function () {\r\n\tif (Element.prototype.getAttributeNames == undefined) {\r\n\t\tElement.prototype.getAttributeNames = function () {\r\n\t\t\tvar attributes = this.attributes;\r\n\t\t\tvar length = attributes.length;\r\n\t\t\tvar result = new Array(length);\r\n\t\t\tfor (var i = 0; i < length; i++) {\r\n\t\t\t\tresult[i] = attributes[i].name;\r\n\t\t\t}\r\n\t\t\treturn result;\r\n\t\t};\r\n\t}\r\n})();\r\n","import React from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport ErrorBoundary from './ErrorBoundary';\r\nimport { toCamelCase } from 'util/StringUtil';\r\nimport 'shared/polyfills/getAttributeNames';\r\nimport Spinner from 'shared/components/Spinner';\r\n\r\ninterface AttributeProps {\r\n\t[index: string]: string;\r\n}\r\n\r\nfunction getDataPropsFromAttributes(element: Element): AttributeProps {\r\n\tconst props: AttributeProps = {};\r\n\r\n\tconst dataAttributePrefix = 'data-';\r\n\r\n\tconst attributeNames = element.getAttributeNames().filter((s) => s.startsWith(dataAttributePrefix));\r\n\tfor (const attributeName of attributeNames) {\r\n\t\tconst strippedName = toCamelCase(attributeName.substring(dataAttributePrefix.length));\r\n\t\tprops[strippedName] = element.getAttribute(attributeName) ?? '';\r\n\t}\r\n\r\n\treturn props;\r\n}\r\n\r\n/**\r\n * A helper function to facilitate initializing react applications on top of server-side rendered elements.\r\n * @param getReactElement Function that returns the react component to render.\r\n * @param elementId The ID of the DOM element being targeted.\r\n */\r\nexport const initReactApp = (getReactElement: (props: unknown) => React.ReactElement, elementId: string) => {\r\n\tif (typeof getReactElement !== 'function' || !elementId) {\r\n\t\treturn () => {\r\n\t\t\tconsole.warn('A react element generator function and element ID are required.');\r\n\t\t};\r\n\t}\r\n\r\n\tconst element = document.getElementById(elementId);\r\n\r\n\tif (!element) {\r\n\t\treturn () => {\r\n\t\t\tconsole.warn(\r\n\t\t\t\t`Element with ID '${elementId}' was not found. Did you forget to render it on the server or is this entry point not supposed to run?`,\r\n\t\t\t);\r\n\t\t};\r\n\t}\r\n\r\n\treturn () => {\r\n\t\tconst props = getDataPropsFromAttributes(element);\r\n\t\tconsole.debug(`Rendering application inside element with ID ${elementId}.`);\r\n\t\tReactDOM.render(\r\n\t\t\t}>\r\n\t\t\t\t{getReactElement(props)}\r\n\t\t\t,\r\n\t\t\telement,\r\n\t\t);\r\n\t};\r\n};\r\n\r\nexport const initReactAppByAttribute = (\r\n\tgetReactElement: (props: unknown, domElement: Element) => React.ReactElement,\r\n\tattribute: string,\r\n) => {\r\n\tif (typeof getReactElement !== 'function' || !attribute) {\r\n\t\treturn () => {\r\n\t\t\tconsole.warn('A react element generator function and element ID are required.');\r\n\t\t};\r\n\t}\r\n\r\n\tconst elements = document.querySelectorAll(`[${attribute}]`);\r\n\r\n\tif (!elements || elements.length == 0) {\r\n\t\treturn () => {\r\n\t\t\tconsole.warn(\r\n\t\t\t\t`No elements with data attribute '${attribute}' were found. Did you forget to render it on the server or is this entry point not supposed to run?`,\r\n\t\t\t);\r\n\t\t};\r\n\t}\r\n\r\n\treturn () => {\r\n\t\tfor (let i = 0; i < elements.length; ++i) {\r\n\t\t\tconst element = elements[i];\r\n\t\t\tconst props = getDataPropsFromAttributes(element);\r\n\t\t\tconsole.debug(`Rendering application inside element with attribute ${attribute}.`);\r\n\t\t\tReactDOM.render(\r\n\t\t\t\t}>\r\n\t\t\t\t\t{getReactElement(props, element)}\r\n\t\t\t\t,\r\n\t\t\t\telement,\r\n\t\t\t);\r\n\t\t}\r\n\t};\r\n};\r\n","import React from 'react';\r\nimport { FieldRenderProps } from 'react-final-form';\r\n\r\ntype ValidationMessagesProps = Pick, 'meta'> & {\r\n\tid: string;\r\n};\r\n\r\nfunction getErrorArray(errorOrSubmitError) {\r\n\tlet errors: string[] = [];\r\n\tif (typeof errorOrSubmitError === 'string') {\r\n\t\terrors.push(errorOrSubmitError);\r\n\t} else if (Array.isArray(errorOrSubmitError)) {\r\n\t\terrors = errorOrSubmitError.filter((error) => !Array.isArray(error) && typeof error === 'string');\r\n\t}\r\n\r\n\treturn errors;\r\n}\r\n\r\n/**\r\n * Displays validation errors for fields\r\n *\r\n * @class ValidationMessages\r\n * @extends {React.Component}\r\n */\r\nfunction ValidationMessages(props: ValidationMessagesProps) {\r\n\tconst { meta } = props;\r\n\r\n\tif (!meta) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\tlet errors: string[] = [];\r\n\r\n\t/* \r\n\t almost all validation comes from the server, so we only need to check `submitError` despite there being `error`\r\n\t there are 3 kinds of values for submitError, string, string[] and [string|[]|object]\r\n\t the third type happens when you're using FieldArray, so we're going to filter those out and only\r\n\t take the strings if submitError is an array. this is due to a bug (possibly feature?) of final form\r\n\t where the submit errors for field array fields bubble up into the parent field.\r\n\t */\r\n\tif (meta.submitError) {\r\n\t\terrors = errors.concat(getErrorArray(meta.submitError));\r\n\r\n\t\t// for server-side validation, we need to stop showing these after any changes are made.\r\n\t\tif (meta.dirtySinceLastSubmit || meta.submitting) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t} else if (meta.error) {\r\n\t\t// sometimes we validate on the client, so we need to support these as well.\r\n\t\terrors = errors.concat(getErrorArray(meta.error));\r\n\t}\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t{(meta.submitError || meta.error) &&\r\n\t\t\t\tmeta.touched &&\r\n\t\t\t\terrors.length > 0 &&\r\n\t\t\t\terrors.map((error, index) => (\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{error}\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t))}\r\n\t\t
\r\n\t);\r\n}\r\n\r\nexport default ValidationMessages;\r\n","import { useState, useEffect } from 'react';\r\n\r\n/**\r\n * Reusable hook that returns true after a certain amount of time has passed. Useful to delay\r\n * displaying components in render functions.\r\n *\r\n * @export\r\n * @param {number} [waitMs=200]\r\n * @returns\r\n */\r\nexport default function useDelayedDisplay(waitMs: number = 200) {\r\n\tconst [display, setDisplay] = useState(false);\r\n\r\n\tuseEffect(() => {\r\n\t\t// after a set amount of time, show the spinner\r\n\t\tconst timeout = setTimeout(() => {\r\n\t\t\tsetDisplay(true);\r\n\t\t}, waitMs);\r\n\r\n\t\treturn () => {\r\n\t\t\tclearTimeout(timeout);\r\n\t\t};\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, []);\r\n\r\n\treturn display;\r\n}\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Check circle SVG\r\n *\r\n * @returns\r\n */\r\nfunction CheckCircleSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default CheckCircleSVG;\r\n","import { AxiosError } from 'axios';\r\nimport { FORM_ERROR } from 'final-form';\r\nimport { unflatten } from 'flat';\r\n\r\nexport const getFormattedPageTitle = (subTitle: string = ''): string => {\r\n\t// load from config?\r\n\tconst siteName = 'ROC';\r\n\r\n\tif (!subTitle || !subTitle.trim()) {\r\n\t\treturn siteName;\r\n\t}\r\n\r\n\treturn `${subTitle.trim()} - ${siteName}`;\r\n};\r\n\r\n/**\r\n * Promise version of setTimeout.\r\n * @param ms The number of milliseconds to wait for.\r\n */\r\nexport const timeout = (ms) => {\r\n\treturn new Promise((resolve) => setTimeout(resolve, ms));\r\n};\r\n\r\n/**\r\n * Allows you to await on a timeout, useful for avoiding setTimeout callbacks and for troubleshooting.\r\n * @param ms The number of milliseconds to wait for.\r\n */\r\nexport const sleep = async (ms: number = 0) => {\r\n\tawait timeout(ms);\r\n};\r\n\r\n/**\r\n * Handles Axios error for React Final Form. If the error is a validation error, the error is transformed into React\r\n * Final Form field validation object. If the error is a generic error, the error is rethrown instead.\r\n *\r\n * @param error - The Axios Error object to handle errors for.\r\n * @param errorMessage - The form error message to provide back to React Final Form.\r\n * @param validationErrorCallback - Optional callback that is triggered right before the validation object is returned\r\n * to Final Form, so that you can run logic that should occur during validation errors.\r\n * @param genericErrorCallback - Optional callback that is triggered right before the generic error is rethrown, so that\r\n * you can run logic that should occur during generic errors.\r\n */\r\nexport const handleAxiosErrorWithValidation = (\r\n\terror: AxiosError,\r\n\terrorMessage: string | null = 'An error occurred while saving.',\r\n\tvalidationErrorCallback?: () => void,\r\n\tgenericErrorCallback?: () => void,\r\n): { [index: string]: string } => {\r\n\tif (error?.response?.status === 400 && error.response.data) {\r\n\t\tlet globalErrors;\r\n\r\n\t\tconst errors = error.response.data;\r\n\r\n\t\tconst errorsWithModifiedArrayIndex = Object.keys(errors).reduce((acc, value) => {\r\n\t\t\tif (value === '') {\r\n\t\t\t\t// in case we are getting back a non field specific error store it in the global errors\r\n\t\t\t\tglobalErrors = errors[value];\r\n\t\t\t} else {\r\n\t\t\t\tconst newKey = value.replace(/\\[([0-9]+)\\]/g, '.$1');\r\n\t\t\t\tacc[newKey] = errors[value];\r\n\t\t\t}\r\n\r\n\t\t\treturn acc;\r\n\t\t}, {});\r\n\r\n\t\tconst newValidationState = { ...unflatten(errorsWithModifiedArrayIndex) };\r\n\r\n\t\tconsole.debug('newValidationState:', newValidationState);\r\n\r\n\t\tif (validationErrorCallback) {\r\n\t\t\tvalidationErrorCallback();\r\n\t\t}\r\n\r\n\t\treturn { ...newValidationState, [FORM_ERROR]: globalErrors ? globalErrors : errorMessage };\r\n\t} else {\r\n\t\t// generic error.\r\n\t\tif (genericErrorCallback) {\r\n\t\t\tgenericErrorCallback();\r\n\t\t}\r\n\r\n\t\tif (error?.response?.data?.message) {\r\n\t\t\treturn { [FORM_ERROR]: error.response.data.message };\r\n\t\t}\r\n\r\n\t\tif (errorMessage) {\r\n\t\t\treturn { [FORM_ERROR]: errorMessage };\r\n\t\t} else {\r\n\t\t\treturn {};\r\n\t\t}\r\n\t}\r\n};\r\n\r\n/**\r\n * Get an html class or ID safe string from provided string.\r\n *\r\n * @function getHtmlSafeName\r\n */\r\nexport const getHtmlSafeName = (name: string = ''): string => {\r\n\treturn name.replace(/[^a-z0-9]/g, (s) => {\r\n\t\tconst c = s.charCodeAt(0);\r\n\t\tif (c === 32) {\r\n\t\t\treturn '-';\r\n\t\t}\r\n\t\tif (c >= 65 && c <= 90) {\r\n\t\t\treturn '_' + s.toLowerCase();\r\n\t\t}\r\n\t\treturn '__' + ('000' + c.toString(16)).slice(-4);\r\n\t});\r\n};\r\n\r\n/**\r\n * Gets the specified param value from the querystring\r\n *\r\n * @param paramName the name of the query string parameter\r\n * @param decodeParam specifies if the param value should be decoded before returning it\r\n */\r\nexport const getQueryParam = (paramName: string = '', decodeParam: boolean = false): string | null => {\r\n\tconst urlParams = new URLSearchParams(window.location.search);\r\n\tconst paramValue = urlParams.get(paramName);\r\n\r\n\tif (!paramValue) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\tif (decodeParam) {\r\n\t\treturn decodeURIComponent(paramValue);\r\n\t} else {\r\n\t\treturn paramValue;\r\n\t}\r\n};\r\n","import { RocEventType, RocEvent, ExtractEventParameters } from 'shared/events';\r\n\r\n/**\r\n * Helper function for handling ROC events from non React functions.\r\n * @param eventType The type of event to handle\r\n * @param eventHandler The event handler\r\n * @returns The callback function to remove this handler\r\n */\r\nexport default function addRocEventHandler(\r\n\teventType: T,\r\n\teventHandler: (data: ExtractEventParameters) => void,\r\n): () => void {\r\n\tconst handler = (evt: CustomEvent): void => {\r\n\t\teventHandler(evt.detail);\r\n\t};\r\n\r\n\tdocument.addEventListener(eventType, handler);\r\n\r\n\treturn () => document.removeEventListener(eventType, handler);\r\n}\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Star Empty SVG\r\n *\r\n * @returns\r\n */\r\nfunction StarEmptySVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default StarEmptySVG;\r\n","import * as React from 'react';\r\n\r\ninterface DashCircleSVGProps {\r\n\tclass?: string;\r\n}\r\n\r\n/**\r\n * Dash circle SVG\r\n *\r\n * @returns\r\n */\r\nfunction DashCircleSVG(props: DashCircleSVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default DashCircleSVG;\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Pencil SVG\r\n *\r\n * @returns\r\n */\r\nfunction PencilSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default PencilSVG;\r\n","import { DisplayPricingResult, Price, SimpleDisplayPrice } from 'shared-client/types/commerce/display-price';\r\nimport { UnitOfMass } from 'shared-client/types/commerce/product-details';\r\nimport { BreadcrumbItem } from 'shared/components/Breadcrumbs';\r\nimport { PartialDataLoaderOptions } from 'shared/data/usePartialDataLoader';\r\nimport { BasePartialDetailsState } from 'shared/types';\r\nimport { Asset } from 'shared/assets/types';\r\n\r\nexport function getInitialProductDetailsState(): ProductDetailsState {\r\n\treturn window.__ROC_COMMERCE_PRODUCT_DETAILS__ ?? {};\r\n}\r\n\r\ndeclare global {\r\n\tinterface Window {\r\n\t\t__ROC_COMMERCE_PRODUCT_DETAILS__: ProductDetailsState;\r\n\t}\r\n}\r\n\r\nexport interface ProductDetailsState extends BasePartialDetailsState {\r\n\tsummary: Summary;\r\n\r\n\tassets?: ProductAsset[] | null;\r\n\r\n\tavailability?: Availability | null;\r\n\r\n\tbrand?: Brand | null;\r\n\r\n\t/**\r\n\t * Represents the visible tabs for the current product\r\n\t */\r\n\ttabs?: TabViewChunk[];\r\n\r\n\tselections?: ProductDetailSelection[];\r\n\r\n\tchildren?: SimpleProduct[];\r\n\r\n\trelatedProducts?: RelatedProduct[];\r\n\r\n\treviewsSummary: ReviewSummaryDto;\r\n\r\n\t/**\r\n\t * The available pricing lines for the product as well as the selected pricing line state\r\n\t */\r\n\tpricingLines?: ProductPricingLinesDetails;\r\n\r\n\t/**\r\n\t * The pricing result tree containing renderable prices for the product.\r\n\t */\r\n\tdisplayPricing?: DisplayPricingResult;\r\n\r\n\tbreadcrumbPath?: BreadcrumbItem[];\r\n\r\n\t/**\r\n\t * Information about the available product add ons for the product, and for child products, if this is a group\r\n\t */\r\n\taddOns?: AddOnsPdpDto;\r\n\r\n\tisNewProduct: boolean;\r\n}\r\n\r\n/**\r\n * Single add on data.\r\n */\r\nexport interface ProductAddOnDto {\r\n\t/**\r\n\t * The id of the product add on.\r\n\t */\r\n\tvalue: string;\r\n\r\n\t/**\r\n\t * The name of the product add on.\r\n\t */\r\n\tlabel: string;\r\n\r\n\t/**\r\n\t * The SKU of the product add on.\r\n\t */\r\n\tsku: string;\r\n\r\n\t/**\r\n\t * The description of the product add on.\r\n\t */\r\n\tdescription: string;\r\n\r\n\t/**\r\n\t * Represents if the current add on is required to add a product to cart.\r\n\t */\r\n\trequired: boolean;\r\n\r\n\t/**\r\n\t * Represents if the current add on is selected\r\n\t */\r\n\tselected: boolean;\r\n\r\n\t/**\r\n\t * Represents if the current add on is updated\r\n\t */\r\n\tisModified: boolean;\r\n\r\n\t/**\r\n\t * Represents the add on attributes\r\n\t */\r\n\tattributes: AddOnAttributeDto[];\r\n\r\n\t/**\r\n\t * The add on main image thumbnail.\r\n\t */\r\n\tthumbnailUrl: string;\r\n\r\n\t/**\r\n\t * The add on main image alt text.\r\n\t */\r\n\taltText: string;\r\n\r\n\t/**\r\n\t * The displayable price of a single unit of this line item.\r\n\t */\r\n\tunitPrice?: SimpleDisplayPrice;\r\n}\r\n\r\n/**\r\n * Product add on single attribute data\r\n */\r\nexport interface AddOnAttributeDto {\r\n\t/**\r\n\t * Product add on attribute id\r\n\t */\r\n\tvalue: string;\r\n\r\n\t/**\r\n\t * Product add on attribute name\r\n\t */\r\n\tlabel: string;\r\n\r\n\t/**\r\n\t * Represents if the add on attribute value is required\r\n\t */\r\n\trequired: boolean;\r\n\r\n\t/**\r\n\t * Product add on attribute instruction\r\n\t */\r\n\tinstructions: string;\r\n\r\n\t/**\r\n\t * Product add on attribute input type\r\n\t */\r\n\tinputAttributeType: InputAttributeType | null;\r\n\r\n\t/**\r\n\t * The maximum length constraint for the add on attribute value\r\n\t */\r\n\tmaximumLength: number | null;\r\n\r\n\t/**\r\n\t * The minimum length constraint for the add on attribute value\r\n\t */\r\n\tminimumLength: number | null;\r\n\r\n\t/**\r\n\t * The maximum number of line constraint for the add on attribute value\r\n\t * used for multiline attributes\r\n\t */\r\n\tmaximumNumberOfLines: number | null;\r\n\r\n\t/**\r\n\t * The default value of the add on attribute value\r\n\t */\r\n\tdefaultValue: string;\r\n\r\n\t/**\r\n\t * The entered value for the current attribute\r\n\t */\r\n\tdata: string;\r\n\r\n\t/**\r\n\t * The add on attribute selectable values\r\n\t */\r\n\tvalues: AttributeValueDto[];\r\n}\r\n\r\n/**\r\n * The add on attribute input type\r\n */\r\nexport enum InputAttributeType {\r\n\tSingle = 'Single',\r\n\tMultiline = 'Multiline',\r\n}\r\n\r\n/**\r\n * Single add on attribute selectable value\r\n */\r\nexport interface AttributeValueDto {\r\n\t/**\r\n\t * The add on attribute selectable value id\r\n\t */\r\n\tvalue: string;\r\n\r\n\t/**\r\n\t * The add on attribute selectable value label\r\n\t */\r\n\tlabel: string;\r\n\r\n\t/**\r\n\t * Represents if the current selectable value is selected\r\n\t */\r\n\tselected: boolean;\r\n}\r\n\r\nexport interface Summary {\r\n\tname: string;\r\n\ttype: ProductType;\r\n\tsku?: string;\r\n\tmanufacturerPartNumber?: string;\r\n\tproductUrl: string;\r\n\tdescription?: string;\r\n\tmeta?: Meta;\r\n\tproductGroupId: string | null;\r\n\t/**\r\n\t * \tFlag defining if the current product should use the alternate product details.\r\n\t */\r\n\tuseAlternateProductDetails?: boolean;\r\n\t// #region HCL\r\n\tproductGroupName?: string;\r\n\t// #endregion\r\n}\r\n\r\nexport interface Meta {\r\n\turl: string;\r\n\tpageTitle?: string;\r\n\tmetaKeywords?: string;\r\n\tmetaDescription?: string;\r\n\tnoIndex: boolean;\r\n\tnoFollow: boolean;\r\n}\r\n\r\nexport interface Availability {\r\n\tbackOrder: boolean;\r\n\toutOfStock: boolean;\r\n\t// #region HCL\r\n\tcallForAvailability: boolean;\r\n\t// #endregion\r\n}\r\n\r\n/**\r\n * Product Review Summary DTO\r\n */\r\nexport interface ReviewSummaryDto {\r\n\t/**\r\n\t * The average rating of the product. If undefined, the product has no reviews with ratings.\r\n\t */\r\n\taverageRating?: number;\r\n\r\n\t/**\r\n\t * The number of public reviews for the product\r\n\t */\r\n\treviewCount: number;\r\n}\r\n\r\nexport interface ProductAsset extends Asset {\r\n\t/**\r\n\t * The alternate text associated with the image\r\n\t */\r\n\taltText: string;\r\n\t/**\r\n\t * The main image URL\r\n\t */\r\n\tmainImageUrl: string;\r\n\t/**\r\n\t * The thumbnail URL\r\n\t */\r\n\tthumbnailUrl: string;\r\n\t/**\r\n\t * The enlarged image URL\r\n\t */\r\n\tenlargedImageUrl: string;\r\n\t/**\r\n\t * The sort order for this image\r\n\t */\r\n\tsortOrder: number;\r\n\t/**\r\n\t * Embedded URL for external media asset\r\n\t */\r\n\tembeddedUrl: string;\r\n}\r\n\r\nexport interface Brand {\r\n\tname: string;\r\n\tlogoUrl: string | null;\r\n}\r\n\r\nexport interface TabViewChunk {\r\n\ttab: Tab;\r\n\tmodel: T;\r\n\trawHtml?: string;\r\n}\r\n\r\nexport interface Tab {\r\n\tid: string;\r\n\tdisplayName: string;\r\n\ttabType: string;\r\n\tsortOrder: number;\r\n\tname: string;\r\n}\r\n\r\nexport interface TabViewModel {\r\n\tviewName: string;\r\n\tmodel: T;\r\n}\r\n\r\nexport interface ProductDetailSelection {\r\n\tlabel: string;\r\n\tvalues: SelectionValue[];\r\n\r\n\t/**\r\n\t * The selected attribute field name used for adding info to hawk context\r\n\t */\r\n\tfield: string;\r\n}\r\n\r\n/**\r\n * Represents a simple selection DTO object\r\n */\r\nexport interface SimpleSelectionDto {\r\n\t/**\r\n\t * The Code of the product attribute\r\n\t */\r\n\tid: string;\r\n\r\n\t/**\r\n\t * The Name of the product attribute\r\n\t */\r\n\tname: string;\r\n\r\n\t/**\r\n\t * The Id of the attribute value\r\n\t */\r\n\tvalue: string;\r\n\r\n\t/**\r\n\t * The Name of the attribute value\r\n\t */\r\n\tlabel: string;\r\n\r\n\t/**\r\n\t * The selected attribute field name used for adding info to hawk context\r\n\t */\r\n\tfield: string;\r\n}\r\n\r\nexport interface SelectionValue {\r\n\tvalue: string;\r\n\tlabel: string;\r\n\tvalid: boolean;\r\n\tchecked: boolean;\r\n\t// #region HCL\r\n\tswatchUrl: string;\r\n\t// #endregion\r\n}\r\n\r\nexport interface SimpleProduct {\r\n\tid: string;\r\n\tname: string;\r\n\t//#region HCL\r\n\tsku: string;\r\n\t//#endregion\r\n\tselections: string[];\r\n}\r\n\r\nexport interface RelatedProduct {\r\n\tid: string;\r\n\tname: string;\r\n\tdescription: string | null;\r\n\turl: string;\r\n\tmainImage: ProductAsset | null;\r\n}\r\n\r\nexport interface ProductSelectionDispatcherDto {\r\n\tproductId: string;\r\n\tproductDetails: ProductDetailsState;\r\n}\r\n\r\nexport interface AddOnsPdpDto {\r\n\t/**\r\n\t * The list of available product add-ons for the product.\r\n\t */\r\n\tproductAddOnData?: ProductAddOnDto[];\r\n\t/**\r\n\t * A list of add-ons available for child products, if this is a group product\r\n\t */\r\n\tavailableChildProductAddOns?: string[];\r\n}\r\n\r\n/*\r\n\tShirt Size: Small, Large\r\n\tColor: Red, Green\r\n\r\n\tScenario #1: All selections match\r\n\r\n\tValid selections:\r\n\tSmall, Red\r\n\tSmall, Green\r\n\tLarge, Red\r\n\tLarge, Green\r\n\r\n\t1. Pick Size\r\n\t2. Pick Color\r\n\t3. Find match and load child\r\n\r\n\tScenario #2: Selections mismatch\r\n\r\n\tValid selections:\r\n\tSmall, Red\r\n\tSmall, Green\r\n\tLarge, Red\r\n\r\n\t1. Pick Size (Small/Large)\r\n\t2. if Large, mark green as invalid\r\n\t3. if Small, show all colors\r\n\t4. Find match and load child\r\n\r\n\tScenario #3: Selections mismatch 2\r\n\r\n\tValid selections:\r\n\tSmall, Red\r\n\tSmall, Green\r\n\tLarge, Red\r\n\r\n\t1. Pick Green, mark large as invalid\r\n\t2. Pick Size\r\n\t3. Find match and load child\r\n\r\n\tScenario #4: Selections mismatch 3\r\n\r\n\tValid selections:\r\n\tSmall, Red\r\n\tSmall, Green\r\n\tLarge, Red\r\n\r\n\t1. Pick Green, mark large as invalid\r\n\t2. Pick Large anyway, remove color selection\r\n\t3. ...\r\n\t4. Find match and load child\r\n\r\n*/\r\n\r\n/**\r\n * All available product types\r\n *\r\n * @export\r\n */\r\nexport enum ProductType {\r\n\tSimple = 'Simple',\r\n\tGroup = 'Group',\r\n\tKit = 'Kit',\r\n\tGiftCard = 'GiftCard',\r\n}\r\n\r\nexport type ProductPartialDataLoaderOptions = Pick<\r\n\tPartialDataLoaderOptions,\r\n\t'initialState' | 'dataLoaderFn'\r\n>;\r\n\r\nexport interface ProductSelection {\r\n\t/**\r\n\t * The code of the product attribute\r\n\t */\r\n\tid: string;\r\n\t/**\r\n\t * The name of the product attribute\r\n\t */\r\n\tname: string;\r\n\t/**\r\n\t * The attribute value name (if available), otherwise attribute value value\r\n\t */\r\n\tlabel: string;\r\n\t/**\r\n\t * The id (Guid) of the attribute value\r\n\t */\r\n\tvalue: string;\r\n\r\n\t/**\r\n\t * The selected attribute field name used for adding info to hawk context\r\n\t */\r\n\tfield: string;\r\n}\r\n\r\n/**\r\n * Base unit of measure\r\n */\r\nexport interface UnitOfMeasure {\r\n\tname: string;\r\n\tdisplayName: string;\r\n}\r\n\r\n/**\r\n * Represents a single pricing line for a product (one of potentially many choices for purchasing a product)\r\n */\r\nexport type ProductPricingLine = {\r\n\t/**\r\n\t * The pricing line's id\r\n\t */\r\n\tid: string;\r\n\r\n\t/**\r\n\t *\r\n\t * Unit of measure id\r\n\t */\r\n\tunitOfMeasureId: string;\r\n\r\n\t/**\r\n\t * Base Unit of measure\r\n\t */\r\n\tunitOfMeasure: UnitOfMeasure;\r\n\r\n\t/**\r\n\t * The unit's of measure display name\r\n\t */\r\n\tlabel: string;\r\n\r\n\t/**\r\n\t * The unit's of measure quantity\r\n\t */\r\n\tquantity: number;\r\n\r\n\t/**\r\n\t * If this pricing line isn't available for purchase, this will contain a string-localizer-key explaining the reason why.\r\n\t */\r\n\tunavailabilityReason: string | undefined;\r\n} & MassPricingLineOptions;\r\n\r\ntype MassPricingLineOptions =\r\n\t| {\r\n\t\t\t/**\r\n\t\t\t * The unit's of measure weight unit\r\n\t\t\t */\r\n\t\t\tunitOfMass: UnitOfMass;\r\n\r\n\t\t\t/**\r\n\t\t\t * The unit's of measure weight\r\n\t\t\t */\r\n\t\t\tweight: number;\r\n\t }\r\n\t| {\r\n\t\t\tunitOfMass?: never;\r\n\t\t\tweight?: never;\r\n\t };\r\n\r\n/**\r\n * Represents state details pricing lines and pricing line selections for a product on a product details page.\r\n */\r\nexport interface ProductPricingLinesDetails {\r\n\t/**\r\n\t * The selected pricing lines\r\n\t */\r\n\tselected?: ProductPricingLine;\r\n\t/**\r\n\t * The array of available pricing lines\r\n\t */\r\n\tavailable: ProductPricingLine[];\r\n}\r\n\r\n/**\r\n * Reason that the exception was thrown when adding an item to the cart\r\n */\r\nexport enum AddToCartExceptionCode {\r\n\tgeneric = 'Generic',\r\n\tcartFull = 'CartFull',\r\n\tproductUnavailable = 'ProductUnavailable',\r\n\tproductOutOfStock = 'ProductOutOfStock',\r\n}\r\n\r\n/**\r\n * Interface used as request for getting bulk products partial data\r\n */\r\nexport interface BaseBulkPartialProductsDataOptions {\r\n\tproductIds: string[] | undefined;\r\n\tmissingKeys: Array;\r\n}\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Circle Exclaimation SVG component\r\n *\r\n * @returns\r\n */\r\nfunction CircleExclamationSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default CircleExclamationSVG;\r\n","/**\r\n * Extends Window with recaptcha callback fields\r\n */\r\ninterface WindowWithReCaptchaCallbacks extends Window {\r\n\t/**\r\n\t * Executes the methods in the rocReCaptchaCallbacks array\r\n\t */\r\n\tonReCaptchaLoadCallback: () => void;\r\n\t/**\r\n\t * List of recaptcha callbacks\r\n\t */\r\n\trocReCaptchaCallbacks: Array<() => void>;\r\n}\r\n\r\nexport let reCaptchaCallbackPromise: Promise | null = null;\r\n\r\n/**\r\n * Setup function for recaptcha.\r\n * The window.onReCaptchaLoadCallback() gets called when the recaptcha script is loaded.\r\n * Then this method calls the recaptcha instances init functions, stored in window.rocReCaptchaCallbacks\r\n *\r\n * @export\r\n */\r\nexport default function setupReCaptcha() {\r\n\tconst windowWithReCaptchaCallbacks = (window as unknown) as WindowWithReCaptchaCallbacks;\r\n\r\n\treCaptchaCallbackPromise = new Promise((resolve) => {\r\n\t\twindowWithReCaptchaCallbacks.onReCaptchaLoadCallback = resolve;\r\n\t});\r\n}\r\n","import React from 'react';\r\nimport XSVG from './svg/XSVG';\r\nimport { Localizer } from 'services/Localizer';\r\nimport { WithTestIdOptional } from '../../../../Roc.SharedClientApp/types/test';\r\n\r\ninterface CircleButtonProps extends WithTestIdOptional {\r\n\ticon?: React.ReactNode;\r\n}\r\n\r\nfunction CircleButton(props: React.HTMLProps & CircleButtonProps) {\r\n\tconst { icon, testId, ...otherProps } = props;\r\n\r\n\treturn (\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default CircleButton;\r\n","import React from 'react';\r\nimport { FieldRenderProps } from 'react-final-form';\r\nimport { ValidationMessages } from '.';\r\nimport FieldInputErrorWrapper from './FieldInputErrorWrapper';\r\nimport { BaseInputProps } from './InputField';\r\nimport { toKebabCase } from 'util/StringUtil';\r\n\r\nexport type InputFieldProps = FieldRenderProps &\r\n\tBaseInputProps & {\r\n\t\tplaceholder?: string;\r\n\t};\r\n\r\n/**\r\n * Component that renders a checkbox input with form field.\r\n */\r\nexport default function CheckboxInputField({\r\n\tinput: { name, onChange, value },\r\n\tmeta,\r\n\ttype,\r\n\tlabel = '',\r\n\tdisabled = false,\r\n\treadOnly = false,\r\n\tplaceholder = '',\r\n\tstep,\r\n\ttestId,\r\n\tdefaultValue = false,\r\n}: InputFieldProps) {\r\n\treturn (\r\n\t\t
\r\n\t\t\t
\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t);\r\n}\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Star SVG\r\n *\r\n * @returns\r\n */\r\nfunction StarSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default StarSVG;\r\n","/* eslint-disable jsx-a11y/label-has-for */\r\n/* eslint-disable jsx-a11y/no-noninteractive-element-interactions */\r\nimport classnames from 'classnames';\r\nimport React from 'react';\r\nimport { WithTestId } from 'shared-client/types/test';\r\nimport StarEmptySVG from 'shared/components/svg/StarEmptySVG';\r\nimport StarSVG from 'shared/components/svg/StarSVG';\r\nimport useStarRating from './useStarRating';\r\n\r\n/**\r\n * Product Rating Props\r\n */\r\ninterface RatingProps extends WithTestId {\r\n\tvalue: number | null;\r\n\tname: string;\r\n\treadonly?: boolean;\r\n\tonChange?: (rating: number) => void;\r\n\tmaxRating?: number;\r\n}\r\n\r\n/**\r\n * If readonly, displays the rating with blank and filled stars (1-maxRating)\r\n * If not readonly, displays the rating picker with blank and filled stars (1-maxRating)\r\n * @param props\r\n */\r\nexport default function StarRating(props: RatingProps) {\r\n\tconst { value, name, readonly = false, onChange, maxRating = 5, testId } = props;\r\n\r\n\tconst { ratingStars, setRatingHovered } = useStarRating({\r\n\t\tvalue,\r\n\t\tname,\r\n\t\tmaxRating,\r\n\t});\r\n\r\n\tif (!readonly && !onChange) {\r\n\t\tthrow new Error('Rating component is set to non-readonly, yet onChange is not defined.');\r\n\t}\r\n\r\n\t/**\r\n\t * Handle changes to the radio button that backs the star rating selection\r\n\t *\r\n\t * @param {*} e\r\n\t */\r\n\tconst onInputChange = (e) => {\r\n\t\tif (onChange) {\r\n\t\t\tonChange(parseInt(e.currentTarget.value));\r\n\t\t}\r\n\t};\r\n\r\n\tif (readonly) {\r\n\t\treturn (\r\n\t\t\t<>\r\n\t\t\t\t{ratingStars.map(({ id, isFull }) => (\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{isFull ? (\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t)}\r\n\t\t\t\t\t\r\n\t\t\t\t))}\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t{ratingStars.map(({ id, isFull, isChecked, isPending, isHighlighted, ratingValue }) => {\r\n\t\t\t\tconst modifierClasses = classnames({\r\n\t\t\t\t\t'roc-rating__input--full': isFull,\r\n\t\t\t\t\t'roc-rating__input--pending': isPending,\r\n\t\t\t\t\t'roc-rating__label--highlighted': isHighlighted,\r\n\t\t\t\t});\r\n\r\n\t\t\t\treturn (\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t setRatingHovered(ratingValue)}\r\n\t\t\t\t\t\t\tonMouseLeave={() => setRatingHovered(null)}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t{isFull ? (\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t);\r\n\t\t\t})}\r\n\t\t\r\n\t);\r\n}\r\n","import { useEffect, useState } from 'react';\r\n\r\n/**\r\n * The state of all of the stars being displayed, these change together frequently\r\n * so lets store them together. This is also slightly better than calculating\r\n * on every single render. Makes it easier to reuse as well.\r\n */\r\ninterface RatingStarState {\r\n\tid: string;\r\n\tisFull: boolean;\r\n\tisPending: boolean;\r\n\tisHighlighted: boolean;\r\n\tisChecked: boolean;\r\n\tratingValue: number;\r\n}\r\n\r\n/**\r\n * The params for the useStarRating hook.\r\n */\r\ninterface UseStarRatingParams {\r\n\tvalue: number | null;\r\n\tname: string;\r\n\tmaxRating?: number;\r\n}\r\n\r\n/**\r\n * The values returned by the custom star rating hook\r\n */\r\ninterface UseStarRatingResult {\r\n\tratingStars: RatingStarState[];\r\n\tsetRatingHovered: (value: number | null) => void;\r\n}\r\n\r\n/**\r\n * Custom hook that manages state for simple star rating implementations\r\n * @param params\r\n */\r\nexport default function useStarRating(params: UseStarRatingParams): UseStarRatingResult {\r\n\tconst { value, name, maxRating = 5 } = params;\r\n\tconst [ratingStars, setRatingStars] = useState([]);\r\n\tconst [ratingHovered, setRatingHovered] = useState(null);\r\n\r\n\tuseEffect(() => {\r\n\t\tconst newState: RatingStarState[] = [];\r\n\r\n\t\tfor (let i = 1; i <= maxRating; i++) {\r\n\t\t\tconst id = 'rating-group-' + name + '-' + i;\r\n\t\t\tconst isFull = value !== null && value >= i;\r\n\t\t\tconst isPending = ratingHovered ? i > ratingHovered && isFull : false;\r\n\t\t\tconst isHighlighted = ratingHovered ? i <= ratingHovered : false;\r\n\t\t\tconst isChecked = value === i;\r\n\r\n\t\t\tnewState.push({\r\n\t\t\t\tid,\r\n\t\t\t\tisFull,\r\n\t\t\t\tisPending,\r\n\t\t\t\tisHighlighted,\r\n\t\t\t\tisChecked,\r\n\t\t\t\tratingValue: i,\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tsetRatingStars(newState);\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, [value, ratingHovered]);\r\n\r\n\treturn { ratingStars, setRatingHovered };\r\n}\r\n","import React from 'react';\r\nimport { Form } from 'react-final-form';\r\nimport { Localizer } from 'services/Localizer';\r\nimport Spinner from 'shared/components/Spinner';\r\nimport XSVG from 'shared/components/svg/XSVG';\r\nimport { DropdownField, StarRatingField, TextAreaField, TextBoxField } from 'shared/edit/fields';\r\nimport InlineAlert from 'shared/edit/InlineAlert';\r\nimport { FormValidationPromise } from 'shared/types';\r\nimport { ReviewPostDto } from './types';\r\n\r\n/**\r\n * Write Review Component Props\r\n */\r\ninterface WriteReviewProps {\r\n\tsaveReview: (formValues: ReviewPostDto) => FormValidationPromise;\r\n\tsetShowWriteReview: (prop: boolean) => void;\r\n\thasValidationError: boolean;\r\n\tisSaving: boolean;\r\n\tproductId: string;\r\n\tloggedInUserFirstName: string;\r\n}\r\n\r\n/**\r\n * Write Review Component\r\n * @param props\r\n */\r\nexport default function WriteReview(props: WriteReviewProps) {\r\n\tconst { saveReview, hasValidationError, isSaving, setShowWriteReview, productId, loggedInUserFirstName } = props;\r\n\r\n\treturn (\r\n\t\t {\r\n\t\t\t\treturn (\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t setShowWriteReview(false)}\r\n\t\t\t\t\t\t\t\ttype=\"button\"\r\n\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t{Localizer('Close')}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t
\r\n\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t

{Localizer('WriteAReview')}

\r\n\t\t\t\t\t\t\t\t

{Localizer('RequiredFields')}

\r\n\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t{hasValidationError ? (\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t
\r\n\r\n\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t
\r\n\r\n\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\t\tsetShowWriteReview(false);\r\n\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t{Localizer('Cancel')}\r\n\t\t\t\t\t\t\t{' '}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t{isSaving ? : Localizer('Submit')}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t);\r\n\t\t\t}}\r\n\t\t/>\r\n\t);\r\n}\r\n","import * as React from 'react';\r\nimport { useEffect, useState } from 'react';\r\nimport { Localizer } from 'services/Localizer';\r\n//#region HCL\r\nimport { getUserData, UserData } from 'services/UserData';\r\n//#endregion\r\nimport Spinner from 'shared/components/Spinner';\r\nimport StarRating from 'shared/components/star-rating/StarRating';\r\nimport LeftChevronSVG from 'shared/components/svg/LeftChevronSVG';\r\nimport RightChevronSVG from 'shared/components/svg/RightChevronSVG';\r\nimport InlineAlert from 'shared/edit/InlineAlert';\r\nimport useRocEventHandler from 'shared/hooks/useRocEventHandler';\r\nimport { getInitialProductDetailsState } from '../product-details/types';\r\nimport useProductReviews from './useProductReviews';\r\nimport WriteReview from './WriteReview';\r\n\r\nexport interface ReviewListingProps {\r\n\tinitialProductId: string;\r\n\tignoreSelectionChanges: 'true' | undefined;\r\n}\r\n\r\n/**\r\n * Represents a listing of reviews for a product, found as a \"tab\" under the product details page.\r\n * This is not a standard react component and relies on global state to function properly.\r\n * The presence of multiple review listings on the same page is erroneous.\r\n */\r\nexport default function ReviewListing(props: ReviewListingProps) {\r\n\tconst initialState = getInitialProductDetailsState();\r\n\tconst initialReviewsSummary = initialState.reviewsSummary;\r\n\r\n\tconst [productId, setProductId] = useState(props.initialProductId);\r\n\tconst [reviewsSummary, setReviewsSummary] = useState(initialReviewsSummary);\r\n\r\n\t//#region HCL\r\n\tconst [userIsSignedIn, setUserIsSignedIn] = useState(false);\r\n\r\n\tconst getUserIsSignedIn = (data: UserData) => {\r\n\t\tsetUserIsSignedIn((data && data.summary && data.summary.isSignedIn) || false);\r\n\t};\r\n\t//#endregion\r\n\r\n\tconst [loggedInUserFirstName, setLoggedInUserFirstName] = useState('');\r\n\r\n\tconst {\r\n\t\tpage,\r\n\t\tgoToPage,\r\n\t\tgoToNextPage,\r\n\t\tgoToPreviousPage,\r\n\t\terror,\r\n\t\tloading,\r\n\t\tresults,\r\n\t\tproductReviewsError,\r\n\t\thasValidationError,\r\n\t\tsetProductReviewsError,\r\n\t\tsetValidationHasError,\r\n\t\treviewAdded,\r\n\t\tsetReviewAdded,\r\n\t\tloadMoreClicked,\r\n\t\tisAbuseSaved,\r\n\t\tisSaving,\r\n\t\treportAbuse,\r\n\t\tonLoadMoreClick,\r\n\t\tsaveReview,\r\n\t\tshowWriteReview,\r\n\t\tsetShowWriteReview,\r\n\t} = useProductReviews({\r\n\t\tproductId: productId ?? props.initialProductId,\r\n\t\treviewsSummary: reviewsSummary ?? initialReviewsSummary,\r\n\t});\r\n\r\n\tuseRocEventHandler(\r\n\t\t'product-selection-updated',\r\n\t\t({ product }) => {\r\n\t\t\tif (!props.ignoreSelectionChanges) {\r\n\t\t\t\tgoToPage(1);\r\n\t\t\t\tsetProductId(product.productId);\r\n\t\t\t\tsetReviewsSummary(product.productDetails?.reviewsSummary);\r\n\t\t\t}\r\n\t\t},\r\n\t\t[goToPage, setProductId, setReviewsSummary],\r\n\t);\r\n\r\n\tuseRocEventHandler(\r\n\t\t'roc-reviews-write-review',\r\n\t\t() => {\r\n\t\t\tsetShowWriteReview(true);\r\n\t\t},\r\n\t\t[],\r\n\t);\r\n\r\n\tuseEffect(() => {\r\n\t\tconst getLoggedInUserFirstName = async (): Promise => {\r\n\t\t\ttry {\r\n\t\t\t\tconst data = (await getUserData()).data;\r\n\t\t\t\tgetUserIsSignedIn(data);\r\n\t\t\t\treturn (data && data.summary && data.summary.firstName) || '';\r\n\t\t\t} catch (error) {\r\n\t\t\t\tconsole.error('Unable to load user data', error);\r\n\t\t\t}\r\n\t\t\treturn Promise.resolve('');\r\n\t\t};\r\n\r\n\t\tgetLoggedInUserFirstName().then((firstName) => {\r\n\t\t\tsetLoggedInUserFirstName(firstName);\r\n\t\t});\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, []);\r\n\r\n\tuseEffect(() => {\r\n\t\tif (!reviewAdded) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// after a set amount of time, hide the message\r\n\t\tconst timer = setTimeout(() => {\r\n\t\t\tsetReviewAdded(false);\r\n\t\t}, 5000);\r\n\r\n\t\treturn () => {\r\n\t\t\tclearTimeout(timer);\r\n\t\t};\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, [reviewAdded]);\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t{loading && }\r\n\r\n\t\t\t{productReviewsError ?? error != null ? : null}\r\n\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\t{!showWriteReview ? (\r\n\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t{/* //#region HCL */}\r\n\t\t\t\t\t\t\t{userIsSignedIn && results && results.pagination.totalRecords === 0 && (\r\n\t\t\t\t\t\t\t\t

{Localizer('BeTheFirstToReviewThisItem')}

\r\n\t\t\t\t\t\t\t)}\r\n\r\n\t\t\t\t\t\t\t{!userIsSignedIn &&

{Localizer('PleaseLoginToWriteReview')}

}\r\n\t\t\t\t\t\t\t{userIsSignedIn && (\r\n\t\t\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\t\t\tsetShowWriteReview(true);\r\n\t\t\t\t\t\t\t\t\t\tsetProductReviewsError(null);\r\n\t\t\t\t\t\t\t\t\t\tsetValidationHasError(false);\r\n\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t\tdata-testid=\"write-review-input-button\"\r\n\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t{Localizer('WriteAReview')}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t{/* //#endregion */}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t) : null}\r\n\t\t\t\t
\r\n\r\n\t\t\t\t{reviewAdded && (\r\n\t\t\t\t\t\r\n\t\t\t\t)}\r\n\r\n\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t{showWriteReview ? (\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t
\r\n\r\n\t\t\t\t\t{results && loadMoreClicked && results.pagination.totalPages > 1 && (\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t goToPage(parseInt((event.target as HTMLInputElement).value))}\r\n\t\t\t\t\t\t\t\t/>{' '}\r\n\t\t\t\t\t\t\t\tof {results.pagination.totalPages}\r\n\t\t\t\t\t\t\t
\r\n\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t)}\r\n\r\n\t\t\t\t\t{results && results.pagination.totalRecords > 0 && (\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t{Localizer(\r\n\t\t\t\t\t\t\t\t'XToYOfZ',\r\n\t\t\t\t\t\t\t\t((results.pagination.pageNumber - 1) * results.pagination.pageSize + 1).toString(),\r\n\r\n\t\t\t\t\t\t\t\tresults.pagination.totalRecords <\r\n\t\t\t\t\t\t\t\t\tresults.pagination.pageNumber * results.pagination.pageSize\r\n\t\t\t\t\t\t\t\t\t? results.pagination.totalRecords.toString()\r\n\t\t\t\t\t\t\t\t\t: (results.pagination.pageNumber * results.pagination.pageSize).toString(),\r\n\r\n\t\t\t\t\t\t\t\tresults.pagination.totalRecords.toString(),\r\n\t\t\t\t\t\t\t)}{' '}\r\n\t\t\t\t\t\t\t{results.pagination.totalRecords > 1\r\n\t\t\t\t\t\t\t\t? Localizer('Reviews').toLowerCase()\r\n\t\t\t\t\t\t\t\t: Localizer('Review').toLowerCase()}\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t)}\r\n\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t{results &&\r\n\t\t\t\t\t\t\tresults.results.map((review, i) => {\r\n\t\t\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\t{(!isAbuseSaved || !isAbuseSaved[review.id]) && (\r\n\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t reportAbuse(review.id)}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdisabled={isSaving}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{Localizer('ReportAbuse')}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t\t\t\t{isAbuseSaved && isAbuseSaved[review.id] && (\r\n\t\t\t\t\t\t\t\t\t\t\t\t{Localizer('ReportSent')}\r\n\t\t\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t{review.title}\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t

{review.description}

\r\n\t\t\t\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t\t\t\t\t{Localizer('Recommended')}:{' '}\r\n\t\t\t\t\t\t\t\t\t\t\t{review.isProductRecommended ? Localizer('Yes') : Localizer('No')}\r\n\t\t\t\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t\t\t\t\t{`${review.reviewerName ? review.reviewerName : Localizer('Unknown')}${\r\n\t\t\t\t\t\t\t\t\t\t\t\treview.location ? ', ' + review.location : ''\r\n\t\t\t\t\t\t\t\t\t\t\t} (${review.localizedReviewDate})`}\r\n\t\t\t\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t\t\t\t{isSaving && }\r\n\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t})}\r\n\t\t\t\t\t
\r\n\r\n\t\t\t\t\t{!loadMoreClicked && (\r\n\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t{Localizer('LoadMoreReviews')}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t)}\r\n\t\t\t\t
\r\n\t\t\t
\r\n\t\t\r\n\t);\r\n}\r\n","import Axios, { AxiosError, CancelTokenSource } from 'axios';\r\nimport { useState } from 'react';\r\nimport AxiosHelper from 'services/AxiosHelper';\r\nimport { useAxiosPaginatedLoader, UseAxiosPaginatedLoaderResult } from 'shared/hooks/useAxiosPaginatedLoader';\r\nimport useRocReCaptchaToken from 'shared/hooks/useRocReCaptchaToken';\r\nimport { FormValidationPromise, PaginatedResult } from 'shared/types';\r\nimport { handleAxiosErrorWithValidation } from 'shared/util/Misc';\r\nimport { ReviewSummaryDto } from '../product-details/types';\r\nimport { ReviewPostDto } from './types';\r\nimport { SortByDirection } from '../../../../../Roc.SharedClientApp/types';\r\nimport { dispatchRocEvent } from 'shared/hooks/useRocEventHandler';\r\n\r\n/**\r\n * useProductReviews hook params object\r\n */\r\ninterface UseProductReviewsParams {\r\n\t/** The ID of the product, the source of the reviews. */\r\n\tproductId: string;\r\n\t/** A summary of the reviews containing the average rating and number of visible reviews. */\r\n\treviewsSummary: ReviewSummaryDto;\r\n}\r\n\r\n/**\r\n * useProductReviews hook result object\r\n */\r\ninterface UseProductReviewsResult extends UseAxiosPaginatedLoaderResult> {\r\n\tisSaving: boolean;\r\n\tproductReviewsError: Error | AxiosError | null;\r\n\thasValidationError: boolean;\r\n\tisAbuseSaved: { [id: string]: boolean } | null;\r\n\treviewAdded: boolean;\r\n\tloadMoreClicked: boolean;\r\n\tshowWriteReview: boolean;\r\n\treportAbuse: (reviewId: string) => Promise;\r\n\tsaveReview: (formValues: ReviewPostDto) => FormValidationPromise;\r\n\tonLoadMoreClick: () => void;\r\n\tsetProductReviewsError: (productReviewsError: Error | AxiosError | null) => void;\r\n\tsetValidationHasError: (hasValidationError: boolean) => void;\r\n\tsetReviewAdded: (review: boolean) => void;\r\n\tsetShowWriteReview: (prop: boolean) => void;\r\n}\r\n\r\nconst initialPageSize = 2;\r\n\r\n/**\r\n * Custom hook for product reviews\r\n */\r\nexport default function useProductReviews({\r\n\tproductId,\r\n\treviewsSummary: { reviewCount },\r\n}: UseProductReviewsParams): UseProductReviewsResult {\r\n\tconst [isSaving, setIsSaving] = useState(false);\r\n\tconst [productReviewsError, setProductReviewsError] = useState(null);\r\n\tconst [hasValidationError, setValidationHasError] = useState(false);\r\n\r\n\t// storing these by id\r\n\tconst [isAbuseSaved, setIsAbuseSaved] = useState<{ [id: string]: boolean } | null>(null);\r\n\tconst [reviewAdded, setReviewAdded] = useState(false);\r\n\tconst [loadMoreClicked, setLoadMoreClicked] = useState(reviewCount <= initialPageSize);\r\n\r\n\tconst {\r\n\t\tpage,\r\n\t\tgoToPage,\r\n\t\tgoToNextPage,\r\n\t\tgoToPreviousPage,\r\n\t\tsetSorting,\r\n\t\tsetPageSize,\r\n\t\terror,\r\n\t\tloading,\r\n\t\tresults,\r\n\t\tsortByName,\r\n\t\tsortDirection,\r\n\t} = useAxiosPaginatedLoader>({\r\n\t\taxiosParams: {\r\n\t\t\turl: `/ajax/products/${productId}/reviews`,\r\n\t\t},\r\n\t\tinitialPageSize,\r\n\t\tinitialSortByName: 'CreateDate',\r\n\t\tinitialSortDirection: SortByDirection.Descending,\r\n\t\tcache: true,\r\n\t});\r\n\r\n\tconst writeReviewRecaptcha = useRocReCaptchaToken('WriteReview');\r\n\r\n\tconst [showWriteReview, setShowWriteReview] = useState(false);\r\n\r\n\t/**\r\n\t * Report Abuse\r\n\t */\r\n\tconst reportAbuse = async (reviewId: string): Promise => {\r\n\t\tsetIsSaving(true);\r\n\r\n\t\tconst requestToken: CancelTokenSource = Axios.CancelToken.source();\r\n\r\n\t\ttry {\r\n\t\t\tawait AxiosHelper.post(`/ajax/products/${productId}/reviews/abuse/${reviewId}`, {\r\n\t\t\t\tcancelToken: requestToken.token,\r\n\t\t\t});\r\n\r\n\t\t\tconst newIsAbuseSaved = { ...isAbuseSaved };\r\n\t\t\tnewIsAbuseSaved[`${reviewId}`] = true;\r\n\r\n\t\t\tsetIsAbuseSaved(newIsAbuseSaved);\r\n\t\t\tsetProductReviewsError(null);\r\n\t\t} catch (error) {\r\n\t\t\tif (Axios.isCancel(error)) {\r\n\t\t\t\t// if the component was unmounted, there's nothing to do\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tsetProductReviewsError(error);\r\n\r\n\t\t\tconsole.error('An error occurred while saving abuse.', error);\r\n\t\t} finally {\r\n\t\t\tsetIsSaving(false);\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Save Review\r\n\t * @param formValues\r\n\t */\r\n\tconst saveReview = async (formValues: ReviewPostDto): FormValidationPromise => {\r\n\t\tsetIsSaving(true);\r\n\r\n\t\tconst requestToken: CancelTokenSource = Axios.CancelToken.source();\r\n\r\n\t\ttry {\r\n\t\t\tconst token = await writeReviewRecaptcha.getToken();\r\n\t\t\tconst payload = { ...formValues, reCaptchaResponse: token };\r\n\r\n\t\t\tawait AxiosHelper.post(`/ajax/products/${productId}/reviews`, payload, {\r\n\t\t\t\tcancelToken: requestToken.token,\r\n\t\t\t});\r\n\r\n\t\t\tsetValidationHasError(false);\r\n\t\t\tsetProductReviewsError(null);\r\n\t\t\tsetShowWriteReview(false);\r\n\t\t\tsetReviewAdded(true);\r\n\r\n\t\t\tif (formValues.rating) {\r\n\t\t\t\tdispatchRocEvent('product-rated', { productId: formValues.productId, rating: formValues.rating });\r\n\t\t\t}\r\n\t\t} catch (error) {\r\n\t\t\tif (Axios.isCancel(error)) {\r\n\t\t\t\t// if the component was unmounted, there's nothing to do\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tconst axiosError = error as AxiosError;\r\n\t\t\tconst responseCode = axiosError?.response?.status;\r\n\t\t\tconst responseData = axiosError?.response?.data;\r\n\r\n\t\t\tif (responseCode === 400 && responseData != null) {\r\n\t\t\t\tsetValidationHasError(true);\r\n\t\t\t\tsetProductReviewsError(null);\r\n\t\t\t} else {\r\n\t\t\t\t// Generic error. We're not quite sure what happened\r\n\t\t\t\tsetProductReviewsError(error);\r\n\t\t\t\tsetValidationHasError(false);\r\n\t\t\t}\r\n\r\n\t\t\tif (responseCode === 400) {\r\n\t\t\t\twriteReviewRecaptcha.invalidateToken();\r\n\t\t\t}\r\n\r\n\t\t\tif (axiosError) {\r\n\t\t\t\treturn handleAxiosErrorWithValidation(axiosError, 'An error occurred while saving.');\r\n\t\t\t}\r\n\t\t} finally {\r\n\t\t\tsetIsSaving(false);\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Load the whole first page on show more click\r\n\t */\r\n\tconst onLoadMoreClick = async () => {\r\n\t\tsetPageSize(10);\r\n\t\tsetLoadMoreClicked(true);\r\n\t};\r\n\r\n\treturn {\r\n\t\tisSaving,\r\n\t\tproductReviewsError: productReviewsError,\r\n\t\thasValidationError,\r\n\t\tsetProductReviewsError: setProductReviewsError,\r\n\t\tsetValidationHasError,\r\n\t\tisAbuseSaved,\r\n\t\treviewAdded,\r\n\t\tsetReviewAdded,\r\n\t\tloadMoreClicked,\r\n\t\tpage,\r\n\t\tgoToPage,\r\n\t\tgoToNextPage,\r\n\t\tgoToPreviousPage,\r\n\t\tsetSorting,\r\n\t\tsetPageSize,\r\n\t\terror,\r\n\t\tloading,\r\n\t\tresults,\r\n\t\treportAbuse,\r\n\t\tsaveReview,\r\n\t\tonLoadMoreClick,\r\n\t\tsortByName,\r\n\t\tsortDirection,\r\n\t\tshowWriteReview,\r\n\t\tsetShowWriteReview,\r\n\t};\r\n}\r\n","import React from 'react';\r\nimport { initReactAppByAttribute } from 'shared/util/ApplicationInit';\r\nimport ReviewListing, { ReviewListingProps } from './ReviewListing';\r\n\r\nconst render = initReactAppByAttribute(\r\n\t(props: ReviewListingProps) => ,\r\n\t'data-reviews-summary',\r\n);\r\n\r\nrender();\r\n\r\n// optional, use this to enable hot reloading\r\nif ((module as any).hot) {\r\n\t(module as any).hot.accept('./ReviewListing', () => {\r\n\t\trender();\r\n\t});\r\n}\r\n","import { useState } from 'react';\r\n\r\n/**\r\n * Custom hook for commonly used loading states.\r\n */\r\nexport function useLoader() {\r\n\tconst [loading, setLoading] = useState(false);\r\n\tconst [error, setError] = useState(undefined);\r\n\tconst [response, setResponse] = useState(null);\r\n\r\n\treturn {\r\n\t\tloading,\r\n\t\tsetLoading,\r\n\t\terror,\r\n\t\tsetError,\r\n\t\tresponse,\r\n\t\tsetResponse,\r\n\t};\r\n}\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Folder SVG\r\n *\r\n * @returns\r\n */\r\nfunction FolderSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default FolderSVG;\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Garbage Can SVG\r\n *\r\n * @returns\r\n */\r\nfunction GarbageCanCircleSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default GarbageCanCircleSVG;\r\n","import React from 'react';\r\nimport { ModelStatus } from '../../../../Roc.SharedClientApp/types/model-status';\r\nimport DashCircleSVG from './hawksearch/components/svg/DashCircleSVG';\r\nimport CheckCircleSVG from './svg/CheckCircleSVG';\r\nimport FolderSVG from './svg/FolderSVG';\r\nimport GarbageCanCircleSVG from './svg/GarbageCanCircleSVG';\r\nimport PencilSVG from './svg/PencilSVG';\r\n\r\ninterface PageEditorStatusDisplayProps {\r\n\tstatus: ModelStatus;\r\n}\r\n\r\nexport function StatusDisplay(props: PageEditorStatusDisplayProps) {\r\n\tconst { status } = props;\r\n\r\n\treturn (\r\n\t\t
\r\n\t\t\t{status === ModelStatus.Published ? (\r\n\t\t\t\t\r\n\t\t\t) : status === ModelStatus.Inactive ? (\r\n\t\t\t\t\r\n\t\t\t) : status === ModelStatus.Deleted ? (\r\n\t\t\t\t\r\n\t\t\t) : status === ModelStatus.Draft ? (\r\n\t\t\t\t\r\n\t\t\t) : status === ModelStatus.Archived ? (\r\n\t\t\t\t\r\n\t\t\t) : null}\r\n\t\t
\r\n\t);\r\n}\r\n","import { useEffect, useRef } from 'react';\r\n\r\n/**\r\n * Reusable hook that can be used where setInterval is needed.\r\n *\r\n * @export\r\n * @param {() => void} callback\r\n * @param {(number | null)} delay\r\n */\r\nexport default function useInterval(callback: () => void, delay: number, enabled: boolean = true) {\r\n\tconst savedCallback = useRef<(() => void) | null>(null);\r\n\t// eslint-disable-next-line no-undef\r\n\tconst intervalId = useRef(null);\r\n\r\n\t// Remember the latest callback.\r\n\tuseEffect(() => {\r\n\t\tsavedCallback.current = callback;\r\n\t}, [callback]);\r\n\r\n\t// Set up the interval.\r\n\tuseEffect(() => {\r\n\t\tfunction tick() {\r\n\t\t\tsavedCallback.current!();\r\n\t\t}\r\n\r\n\t\tif (delay === null || !enabled) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tintervalId.current = setInterval(tick, delay);\r\n\t\treturn () => {\r\n\t\t\tif (intervalId.current) {\r\n\t\t\t\tclearInterval(intervalId.current);\r\n\t\t\t}\r\n\t\t};\r\n\t}, [delay, enabled]);\r\n}\r\n","import { reCaptchaCallbackPromise } from 'features/setup/recaptcha';\r\nimport { useLayoutEffect, useRef, useState } from 'react';\r\nimport useInterval from './useInterval';\r\n\r\n/**\r\n * Window extended with recaptcha specific fields\r\n */\r\ninterface ReCaptchaWindow extends Window {\r\n\trocReCaptchaCallbacks: Array<() => void>;\r\n\tgrecaptcha: GoogleRecaptcha;\r\n}\r\n\r\n/**\r\n * Google ReCaptcha Interface\r\n */\r\ninterface GoogleRecaptcha {\r\n\tready(callback: () => void): void;\r\n\texecute: (key: string, config: { action: string }) => Promise;\r\n}\r\n\r\nexport interface UseReCaptchaToken {\r\n\tgetToken: () => Promise;\r\n\tinvalidateToken: () => void;\r\n\tenabled: boolean;\r\n\tsetEnabled: (enabled: boolean) => void;\r\n}\r\n\r\nlet ReCaptchaKeyWarning = false;\r\n\r\n/**\r\n * Reusable hook that generates a recaptcha token from google and generates fresh tokens\r\n * frequently as these will expire every 2 minutes\r\n *\r\n * @export\r\n * @param {string} reCaptchaKey\r\n * @param {string} action\r\n * @returns\r\n */\r\nexport default function useReCaptchaToken(\r\n\treCaptchaKey: string,\r\n\taction: string,\r\n\tinitialEnabled: boolean = !!action,\r\n): UseReCaptchaToken {\r\n\tconst reCaptchaWindow = (window as unknown) as ReCaptchaWindow;\r\n\r\n\t// keeps track of the promise that is getting the token across renders. using a ref ensures it updates immediately\r\n\t// state updates are async and therefore we cannot read the state value immediately after.\r\n\t// there is no longer a callback after setting state with hooks 💣\r\n\tconst tokenPromise = useRef | null>(null);\r\n\r\n\t// store whether the promise is resolved in a ref. same reasoning as above.\r\n\tconst tokenPromiseIsResolved = useRef(false);\r\n\r\n\t// this is the promise that will handle waiting on recaptcha initialization\r\n\tconst initPromise = useRef | null>(null);\r\n\r\n\t// this will allow for the recaptcha to be disabled on demand or by an invalid token\r\n\tconst [enabled, setEnabled] = useState(initialEnabled);\r\n\r\n\t// need to use LayoutEffect because we have to make sure this code runs before google's recaptcha handlers\r\n\t// when the dom becomes ready.\r\n\tuseLayoutEffect(() => {\r\n\t\t(async () => {\r\n\t\t\tinitPromise.current = new Promise(async (resolve) => {\r\n\t\t\t\t// wait until google calls this callback.\r\n\t\t\t\tif (reCaptchaCallbackPromise) {\r\n\t\t\t\t\tawait reCaptchaCallbackPromise;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// also wait for recaptcha to be ready for us\r\n\t\t\t\treCaptchaWindow.grecaptcha.ready(() => {\r\n\t\t\t\t\tresolve();\r\n\t\t\t\t\tgetToken();\r\n\t\t\t\t});\r\n\t\t\t});\r\n\r\n\t\t\tif (!reCaptchaKey && !ReCaptchaKeyWarning) {\r\n\t\t\t\tReCaptchaKeyWarning = true;\r\n\t\t\t\tconsole.warn('No ReCaptchaKey has been set.');\r\n\t\t\t}\r\n\t\t})();\r\n\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, []);\r\n\r\n\t/**\r\n\t * Invalidates the current token promise as long as it isn't currently unresolved\r\n\t */\r\n\tconst invalidateToken = async () => {\r\n\t\t// scenario 1: not initialized\r\n\t\tawait initPromise.current;\r\n\r\n\t\t// if we are working on getting a token, do nothing\r\n\t\tif (!tokenPromiseIsResolved) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\ttokenPromise.current = getToken(true);\r\n\t};\r\n\r\n\t// tokens expire in 2 minutes, so let's invalidate the token a little more frequently to avoid having a stale one\r\n\tuseInterval(invalidateToken, 2 * 60 * 1000 - 5000, enabled);\r\n\r\n\t/**\r\n\t * Returns a promise that will eventually resolve to a fresh recaptcha token\r\n\t */\r\n\tconst getToken = async (force: boolean = false): Promise => {\r\n\t\tif (!reCaptchaKey || !enabled) {\r\n\t\t\t// if there's no recaptcha key, we'll simple return an empty string. the server will not validate recaptcha\r\n\t\t\t// because the key is missing.\r\n\t\t\treturn Promise.resolve('');\r\n\t\t}\r\n\r\n\t\t// wait for the callback to fire\r\n\t\tawait initPromise.current;\r\n\r\n\t\t// first time or if we need a new one\r\n\t\tif (tokenPromise.current === null || force) {\r\n\t\t\ttokenPromiseIsResolved.current = false;\r\n\r\n\t\t\ttokenPromise.current = new Promise(async (resolve) => {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tconst result = await reCaptchaWindow.grecaptcha.execute(reCaptchaKey, { action });\r\n\t\t\t\t\tresolve(result);\r\n\t\t\t\t} catch (error) {\r\n\t\t\t\t\tconsole.warn(\r\n\t\t\t\t\t\t'ReCaptcha warning:',\r\n\t\t\t\t\t\terror?.message || 'An unexpected ReCaptcha error occurred. Ensure you have a valid key.',\r\n\t\t\t\t\t);\r\n\t\t\t\t\tsetEnabled(false);\r\n\t\t\t\t\tresolve('');\r\n\t\t\t\t}\r\n\t\t\t\ttokenPromiseIsResolved.current = true;\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\t// in some cases this is the existing promise because it not resolved yet, so we don't want to\r\n\t\t// start another request separately.\r\n\t\treturn tokenPromise.current;\r\n\t};\r\n\r\n\treturn { getToken: () => getToken(), invalidateToken, enabled, setEnabled };\r\n}\r\n","import { ServerData } from 'services/ServerData';\r\nimport useReCaptchaToken, { UseReCaptchaToken } from './useReCaptchaToken';\r\n\r\n/**\r\n * Reusable hook that calls the generic useReCaptchaToken with key loaded from ServerData\r\n *\r\n * @export\r\n * @param {string} action\r\n * @returns\r\n */\r\nexport default function useRocReCaptchaToken(action: string, initialEnabled: boolean = true): UseReCaptchaToken {\r\n\tconst reCaptchaKey = ServerData.ReCaptchaV3Key;\r\n\tconst isReCaptchaEnabled = initialEnabled && ServerData.IsReCaptchaEnabled;\r\n\r\n\t// the server will not render anything if the keys aren't set, which means we could get null\r\n\t// or even undefined here, so let's just do a truthy check and return an empty string if there\r\n\t// is nothing from the server.\r\n\treturn useReCaptchaToken(reCaptchaKey || '', action, isReCaptchaEnabled);\r\n}\r\n"],"sourceRoot":""}