\r\n {!windowSize.isNotMobile ?\r\n
\r\n {(IsVIP || props.hla || props.sellUrl || props.IsEF || props.RequestACharter) &&\r\n
\r\n {vip &&\r\n
\r\n }\r\n {props.RequestACharter && !props.IsWatchList &&\r\n
\r\n }\r\n {(props.hla || props.sellUrl) &&\r\n
\r\n }\r\n {(!IsVIP || props.IsRY) &&\r\n
\r\n }\r\n
\r\n }\r\n
\r\n {(IsVIP || props.hla || props.sellUrl || props.IsEF || (props.RequestACharter && !props.IsWatchList)) &&\r\n
\r\n }\r\n
\r\n {!props.IsHostedSite && !props.IsWatchList && IsVIP && !props.IsRY &&\r\n
\r\n }\r\n {props.emailAlerts && (!IsVIP || props.IsWatchList) &&\r\n
\r\n }\r\n {props.RequestACharter && !props.IsWatchList &&\r\n
\r\n }\r\n {props.sort?.options?.length > 0 &&\r\n
\r\n }\r\n
\r\n {(props.IsHostedSite || (!IsVIP && props.IsWatchList && !props.emailAlerts && !props.IsAV)) &&\r\n
\r\n }\r\n
\r\n
\r\n :\r\n
\r\n {(IsVIP || props.hla || props.sellUrl || props.IsAuctionSite || props.RequestACharter) &&\r\n < div className='left-half'>\r\n {vip &&\r\n
\r\n }\r\n {(props.hla || props.sellUrl) &&\r\n
\r\n }\r\n {(!IsVIP || (props.IsWatchList && props.IsAuctionSite)) && !props.IsAV && !props.IsOS &&\r\n
\r\n }\r\n
\r\n }\r\n
\r\n {(IsVIP || props.hla || props.sellUrl) &&\r\n
\r\n }\r\n {!props.IsHostedSite && !(props.IsOS && props.IsWatchList) &&\r\n
\r\n {(IsVIP || props.IsRY || props.IsAV || props.IsOS) &&\r\n
\r\n }\r\n {props.emailAlerts &&\r\n
\r\n }\r\n {props.RequestACharter &&\r\n
\r\n }\r\n
\r\n }\r\n {!props.IsHostedSite && !(props.IsOS && props.IsWatchList) &&\r\n
\r\n { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); handleCollapse(); } }} tabIndex='0' onClick={handleCollapse} title={openBar ? translator.translate('Sandhills.Collapse') : translator.translate('Sandhills.CRM.DSCRM.Expand')} aria-label={openBar ? translator.translate('Sandhills.Collapse') : translator.translate('Sandhills.CRM.DSCRM.Expand')}>\r\n \r\n \r\n
\r\n }\r\n
\r\n }\r\n \r\n :\r\n <>>\r\n );\r\n}\r\nexport default ListingControlBar;\r\nglobal.ListingControlBar = ListingControlBar;","import { useState, useEffect, useRef } from 'react';\r\nimport { LazyLoadImage } from 'react-lazy-load-image-component';\r\nimport translator from '@Components/Utilities/Translator';\r\nimport TranslationText from '@Components/Utilities/TranslationText';\r\nimport ConditionalWrapper from '@Components/Utilities/ConditionalWrapper';\r\nimport { watchlistOnClick } from '@Components/Utilities/SandhillsWatchlist';\r\nimport atoms from '@Components/Utilities/SandhillsAtoms';\r\nimport { useWindowSize } from '@Components/Utilities/WindowSize';\r\nimport { maxImageCount, gtmEventType, baseCatBlur } from '@Components/Utilities/SandhillsConstants';\r\nimport { useRecoilValue } from 'recoil';\r\nimport { gtmAlertPushEvent, sandhillsRequest, gtmPushEvent } from '@Components/Utilities/SandhillsUtility';\r\nimport LoadingRing from '@Components/MuiWrappers/LoadingRing';\r\n\r\nconst ListingGridImage = (props) => {\r\n\r\n const [imageLoaded, setImageLoaded] = useState(props.ForceLoadImages || !props.LazyLoad);\r\n const showRetailPrice = props.ShowRetailPrice == null ? true : props.ShowRetailPrice;\r\n const [updateStatus, setUpdateStatus] = useState(true);\r\n const [dataAction, setDataAction] = useState('add');\r\n const [isSavedToWatchlist, setIsSavedToWatchlist] = useState(props.IsWatchlist && !props.IsRecommendedListingListSearch ? props.IsWatchlist : false);\r\n const isInEditorMode = useRecoilValue(atoms.isInTranslationEditor);\r\n const routes = useRecoilValue(atoms.routes);\r\n const currentUser = useRecoilValue(atoms.currentUser);\r\n const [activeIndex, setActiveIndex] = useState(0);\r\n const [touchStart, setTouchStart] = useState(null);\r\n const [touchEnd, setTouchEnd] = useState(null);\r\n const [hasSentImpression, setHasSentImpression] = useState(false);\r\n const [movingRight, setMovingRight] = useState(false);\r\n const [movingLeft, setMovingLeft] = useState(false);\r\n const windowSize = useWindowSize();\r\n let imageList = props.ImageUrl;\r\n imageList.forEach(p => p.replace('h=220', 'h=350'));\r\n const useBlur = baseCatBlur.includes(props.BaseCategoryId) || baseCatBlur.includes(props.CategoryID) || (windowSize.width < 1251 && windowSize.width > 550);\r\n const [styleLeft, setStyleLeft] = useState({ transform: '' });\r\n const [styleRight, setStyleRight] = useState({ transform: '' });\r\n const [styleMiddle, setStyleMiddle] = useState({ transform: '' });\r\n\r\n useEffect(() => {\r\n if (props.UserWatchlist && props.UserWatchlist.length > 0) {\r\n if ((props.UserWatchlist.filter(c => c.ListingId == props.ListingId || c.Id == props.ListingId).length > 0) && updateStatus) {\r\n setWatchListAction(true);\r\n } else if (props.unsaveWatchlist) {\r\n setIsSavedToWatchlist(false);\r\n if (props.setSavedToWatchlist) {\r\n props.setSavedToWatchlist(false);\r\n }\r\n setWatchListAction(false);\r\n }\r\n }\r\n }, [props.UserWatchlist, props.unsaveWatchlist]);\r\n\r\n useEffect(function imageEffect() {\r\n if (imageLoaded) {\r\n props.DispatchListings?.({\r\n type: 'update-listing',\r\n payload: {\r\n Id: props.ListingId,\r\n ImagesLoaded: true,\r\n }\r\n });\r\n }\r\n }, [imageLoaded]);\r\n\r\n const minSwipeDistance = 50\r\n\r\n const onTouchStart = (e) => {\r\n setTouchEnd(null); // otherwise the swipe is fired even with usual touch events\r\n setTouchStart(e.targetTouches[0].clientX);\r\n }\r\n\r\n const onTouchMove = (e) => {\r\n setTouchEnd(e.targetTouches[0].clientX);\r\n if (!touchStart || !touchEnd) return\r\n const distance = touchStart - touchEnd;\r\n const width = windowSize.width;\r\n if (Math.abs(distance) > 10) {\r\n $(\"body\").addClass(\"disable-scroll\");\r\n }\r\n\r\n const isLeftSwipe = distance > 0;\r\n const isRightSwipe = distance < 0;\r\n let percentage = Math.abs(distance) / width * 100;\r\n\r\n if (isLeftSwipe && activeIndex + 1 < props.ImageUrl.length) {\r\n let mobileRightPercent = ('-' + percentage.toString() + '%');\r\n setStyleLeft('0%');\r\n setStyleRight(mobileRightPercent);\r\n setStyleMiddle(mobileRightPercent);\r\n } else if (isRightSwipe && activeIndex > 0) {\r\n let mobileLeftPercent = (percentage.toString() + '%');\r\n setStyleRight('0%');\r\n setStyleLeft(mobileLeftPercent);\r\n setStyleMiddle(mobileLeftPercent);\r\n }\r\n };\r\n\r\n const onTouchEnd = () => {\r\n const width = windowSize.width;\r\n if (!touchStart || !touchEnd) return\r\n const distance = touchStart - touchEnd;\r\n const isLeftSwipe = distance > minSwipeDistance;\r\n const isRightSwipe = distance < -minSwipeDistance;\r\n $(\"body\").removeClass(\"disable-scroll\");\r\n\r\n let percentage = Math.abs(distance) / width * 100;\r\n\r\n if (isLeftSwipe && (activeIndex + 1) < props.ImageUrl.length && (!windowSize.isMobile || percentage > 3)) {\r\n changeImage(activeIndex + 1);\r\n setStyleRight('-100%');\r\n setStyleMiddle('-100%');\r\n } else if (isRightSwipe && activeIndex > 0 && (!windowSize.isMobile || percentage > 3)) {\r\n changeImage(activeIndex - 1);\r\n setStyleLeft('100%');\r\n setStyleMiddle('100%');\r\n } else {\r\n setStyleLeft('0%');\r\n setStyleRight('0%');\r\n setStyleMiddle('0%');\r\n };\r\n }\r\n\r\n const getHeaderText = () => {\r\n if (props.HeaderText) {\r\n return props.HeaderText;\r\n } else {\r\n return '\\u00A0';\r\n }\r\n };\r\n\r\n const watchlistClick = () => {\r\n if (props.UserWatchlist.filter(c => c.ListingId == props.ListingId || c.Id == props.ListingId).length < 1 || props.unsaveWatchlist) {\r\n watchlistOnClick(dataAction, props.ListingId, props.ListingTypes, routes);\r\n setWatchListAction(dataAction == 'add');\r\n }\r\n\r\n props.toggleWatchlistExpansion();\r\n };\r\n\r\n const setWatchListAction = (isSaved) => {\r\n setIsSavedToWatchlist(isSaved);\r\n if (props.setSavedToWatchlist) {\r\n props.setSavedToWatchlist(isSaved);\r\n }\r\n setUpdateStatus(false);\r\n setDataAction(isSaved ? 'delete' : 'add');\r\n };\r\n\r\n const getWatchlistButton = () => {\r\n return (\r\n } event The event source of the callback.\n * @param {number} page The page selected.\n */\n onChange: PropTypes.func,\n /**\n * The current page. Unlike `TablePagination`, which starts numbering from `0`, this pagination starts from `1`.\n */\n page: integerPropType,\n /**\n * Render the item.\n * @param {PaginationRenderItemParams} params The props to spread on a PaginationItem.\n * @returns {ReactNode}\n * @default (item) => \n */\n renderItem: PropTypes.func,\n /**\n * The shape of the pagination items.\n * @default 'circular'\n */\n shape: PropTypes.oneOf(['circular', 'rounded']),\n /**\n * If `true`, show the first-page button.\n * @default false\n */\n showFirstButton: PropTypes.bool,\n /**\n * If `true`, show the last-page button.\n * @default false\n */\n showLastButton: PropTypes.bool,\n /**\n * Number of always visible pages before and after the current page.\n * @default 1\n */\n siblingCount: integerPropType,\n /**\n * The size of the component.\n * @default 'medium'\n */\n size: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['small', 'medium', 'large']), PropTypes.string]),\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),\n /**\n * The variant to use.\n * @default 'text'\n */\n variant: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['outlined', 'text']), PropTypes.string])\n} : void 0;\nexport default Pagination;","import TranslationText from '@Components/Utilities/TranslationText';\r\nimport translator from '../Utilities/Translator';\r\nimport { useWindowSize } from '@Components/Utilities/WindowSize';\r\nimport { Pagination, PaginationItem } from '@mui/material';\r\nimport { styled } from '@mui/material/styles';\r\n\r\n/**\r\n * Pagination Component\r\n * Use this for pagination controls for all our pages to keep everything standardized and uniform.\r\n * @param {any} props\r\n * [REQUIRED] currentPage = number\r\n * [REQUIRED] totalPages = number\r\n * [REQUIRED] onChange = function(pageNumber: number)\r\n */\r\n\r\nconst Paging = (props) => {\r\n const windowSize = useWindowSize();\r\n\r\n const previousText = () => { return };\r\n const nextText = () => { return };\r\n\r\n const getItemAriaLabel = (type, page, selected) => {\r\n let ariaLabel;\r\n\r\n switch (type) {\r\n case 'page':\r\n ariaLabel = `${(selected ? translator.translate('sandhills.tradepubwebsite.mvc.page') : translator.translate('sandhills.gotopage'))} ${page}`;\r\n break;\r\n case 'first':\r\n ariaLabel = translator.translate('sandhills.firstpage')\r\n break;\r\n case 'last':\r\n ariaLabel = translator.translate('sandhills.lastpage')\r\n break;\r\n case 'next':\r\n ariaLabel = translator.translate('sandhills.tradepubwebsite.mvc.nextpage')\r\n break;\r\n case 'previous':\r\n ariaLabel = translator.translate('sandhills.previouspage')\r\n break;\r\n };\r\n\r\n return ariaLabel;\r\n }\r\n\r\n return (\r\n \r\n
getItemAriaLabel(type, page, selected)}\r\n showLastButton\r\n shape='rounded'\r\n size={windowSize.isMobile ? 'small' : 'medium'}\r\n onChange={(e, value) => props.onChange(value)}\r\n renderItem={(item) => (\r\n \r\n )}\r\n />\r\n \r\n );\r\n};\r\n\r\nexport default Paging;","import { inquiryType, gtmEventType, contactType } from '@Components/Utilities/SandhillsConstants';\r\nimport { gtmPushEvent, sandhillsRequest } from '@Components/Utilities/SandhillsUtility';\r\nimport { useWindowSize } from '@Components/Utilities/WindowSize';\r\nimport { loadable } from '@Components/Utilities/SandhillsLoadable';\r\nimport TranslationText from '@Components/Utilities/TranslationText';\r\nimport ListingGridImage from '@Components/Listings/ListingGridImage';\r\nimport CollapsibleContacts from '@Components/Contact/CollapsibleContacts';\r\nimport { LazyLoadImage } from 'react-lazy-load-image-component';\r\nimport { useRef } from 'react';\r\nimport translator from '@Components/Utilities/Translator';\r\nimport atoms from '@Components/Utilities/SandhillsAtoms';\r\nimport { useRecoilValue } from 'recoil';\r\n\r\nconst ListingDisplayLocation = loadable(() => import('@Components/Shared/Listings/ListingDisplayLocation'));\r\nconst TextMessage = loadable(() => import('@Components/Contact/TextMessage'));\r\n\r\nconst PartsListListing = (props) => {\r\n const windowSize = useWindowSize();\r\n const ref = useRef([]);\r\n const currentSite = useRecoilValue(atoms.currentWebsite);\r\n const routes = useRecoilValue(atoms.routes);\r\n const openEmailModal = (inquiry) => props.openEmailModal(inquiry, contactType.Retail, {\r\n ModalTitle: (props.Manufacturer || '') + ' Part #: ' + props.PartNumber,\r\n Subject: (props.Manufacturer || '') + ' Part #: ' + props.PartNumber,\r\n ListingID: props.PartID,\r\n ListingSourceDomainUrl: props.ListingSourceDomainUrl,\r\n PartNumber: props.PartNumber,\r\n Price: props.RetailPrice || '',\r\n Manufacturer: props.Manufacturer,\r\n DealerCRMID: props.DealerCRMID,\r\n DealerGroupID: props.DealerGroupID,\r\n BranchName: props.DealerName || '',\r\n ListingURL: props.SAMURL ?? props.DetailPageURL,\r\n PartsSource: props.partsSource,\r\n IsParts: true,\r\n ListingCondition: props.Condition,\r\n Ref: ref.current[inquiry]\r\n });\r\n\r\n const saveIterableAction = (actionName) => {\r\n sandhillsRequest({\r\n url: routes.SaveAction,\r\n method: 'post',\r\n data: {\r\n 'email': '',\r\n 'actionName': actionName,\r\n 'manufacturers': [props.Manufacturer],\r\n 'categoryIDs': [props.CategoryID],\r\n 'partIDs': [props.PartID],\r\n 'conditions': [props.Condition]\r\n },\r\n errorHandling: {\r\n useConsole: false,\r\n useAlert: false\r\n }\r\n });\r\n };\r\n\r\n const handleBuyNowClick = () => {\r\n saveIterableAction('buyNow');\r\n gtmPushEvent(gtmEventType.buyNowClick);\r\n }\r\n\r\n const handleTelClick = () => {\r\n saveIterableAction('telClick');\r\n gtmPushEvent(gtmEventType.call);\r\n }\r\n\r\n return (\r\n \r\n
\r\n
0 ? '' : ' no-media') + (props.NoImageRow ? ' no-images' : '')}>\r\n {!props.NoImageRow &&\r\n <>\r\n {\r\n props.MediaModel.Media.length > 0 ?\r\n
media.MediaUrl)} IsParts={true} AltText={props.PartNumber} />\r\n :\r\n \r\n \r\n \r\n }\r\n >\r\n }\r\n \r\n
\r\n
\r\n \r\n {props.FormattedDiscountPrice || props.Price ?\r\n (props.FormattedDiscountPrice ?\r\n \r\n {props.Price}\r\n {props.DiscountSavePercentage && {props.DiscountSavePercentage}}\r\n {props.FormattedDiscountPrice}
\r\n \r\n :\r\n (props.ShowMSRPField && props.MSRP ?\r\n \r\n {props.MSRP}\r\n {props.MSRPSavePercentage && {props.MSRPSavePercentage}}\r\n {props.Price}
\r\n \r\n :\r\n {props.Price}\r\n )\r\n )\r\n :\r\n {translator.translate('sandhills.callforprice')}\r\n }\r\n \r\n \r\n {props.BuyNowURL ?\r\n
\r\n \r\n \r\n {(props.BuyNowNewTab || currentSite.IsMobileAppContext) && ({translator.translate('sandhills.opensinanewtab')})}\r\n \r\n :\r\n
\r\n \r\n \r\n \r\n }\r\n {props.Quantity &&\r\n
\r\n : \r\n {props.Quantity}\r\n \r\n }\r\n {props.ListingLocation &&
}\r\n
\r\n
\r\n
\r\n
\r\n {props.ShowCheckAvailability ?\r\n
{ if (e.key === \"Enter\" || e.key === ' ') { e.preventDefault(); openEmailModal(inquiryType.CheckAvailability); } }} onClick={() => openEmailModal(inquiryType.CheckAvailability)}>\r\n \r\n
\r\n :\r\n
{ if (e.key === \"Enter\" || e.key === ' ') { e.preventDefault(); openEmailModal(inquiryType.Email); } }} onClick={() => openEmailModal(inquiryType.Email)}>\r\n {props.CustomEmailSellerTextForRental ? props.CustomEmailSellerTextForRental : props.CustomEmailSellerTextForRetail ? props.CustomEmailSellerTextForRetail : (props.IsForRentOnly || props.IsRY) ? : }\r\n
\r\n }\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default PartsListListing;","import { inquiryType, gtmEventType, contactType } from '@Components/Utilities/SandhillsConstants';\r\nimport { gtmPushEvent, truncateString } from '@Components/Utilities/SandhillsUtility';\r\nimport { useWindowSize } from '@Components/Utilities/WindowSize';\r\nimport { loadable } from '@Components/Utilities/SandhillsLoadable';\r\nimport TranslationText from '@Components/Utilities/TranslationText';\r\nimport CollapsibleContacts from '@Components/Contact/CollapsibleContacts';\r\nimport { LazyLoadImage } from 'react-lazy-load-image-component';\r\nimport { sandhillsRequest } from '@Components/Utilities/SandhillsUtility';\r\nimport { useRef } from 'react';\r\nimport translator from '@Components/Utilities/Translator';\r\nimport atoms from '@Components/Utilities/SandhillsAtoms';\r\nimport { useRecoilValue } from 'recoil';\r\n\r\nconst ListingDisplayLocation = loadable(() => import('@Components/Shared/Listings/ListingDisplayLocation'));\r\nconst TextMessage = loadable(() => import('@Components/Contact/TextMessage'));\r\n\r\nconst PartsListListing = (props) => {\r\n const windowSize = useWindowSize();\r\n const ref = useRef([]);\r\n const currentSite = useRecoilValue(atoms.currentWebsite);\r\n const routes = useRecoilValue(atoms.routes);\r\n const openEmailModal = (inquiry) => props.openEmailModal(inquiry, contactType.Retail, {\r\n ModalTitle: (props.Manufacturer || '') + ' Part #: ' + props.PartNumber,\r\n Subject: (props.Manufacturer || '') + ' Part #: ' + props.PartNumber,\r\n ListingID: props.PartID,\r\n ListingSourceDomainUrl: props.ListingSourceDomainUrl,\r\n PartNumber: props.PartNumber,\r\n Price: props.RetailPrice || '',\r\n Manufacturer: props.Manufacturer,\r\n DealerCRMID: props.DealerCRMID,\r\n DealerGroupID: props.DealerGroupID,\r\n BranchName: props.DealerName || '',\r\n ListingURL: props.SAMURL ?? props.DetailPageURL,\r\n PartsSource: props.partsSource,\r\n IsParts: true,\r\n ListingCondition: props.Condition,\r\n Ref: ref.current[inquiry]\r\n });\r\n\r\n const getMediaIcons = () => {\r\n return (\r\n \r\n {props.ListingPhotoCount > 0 &&\r\n
\r\n \r\n {props.ListingPhotoCount}\r\n
}\r\n {props.ListingSpin360Count > 0 &&\r\n
\r\n \r\n {props.ListingSpin360Count}\r\n
}\r\n {props.ListingVideoCount > 0 &&\r\n
\r\n \r\n {props.ListingVideoCount}\r\n
}\r\n
\r\n );\r\n };\r\n\r\n const saveIterableAction = (actionName) => {\r\n sandhillsRequest({\r\n url: routes.SaveAction,\r\n method: 'post',\r\n data: {\r\n 'email': '',\r\n 'actionName': actionName,\r\n 'manufacturers': [props.Manufacturer],\r\n 'categoryIDs': [props.CategoryID],\r\n 'partIDs': [props.PartID],\r\n 'conditions': [props.Condition]\r\n },\r\n errorHandling: {\r\n useConsole: false,\r\n useAlert: false\r\n }\r\n });\r\n };\r\n\r\n const handleBuyNowClick = () => {\r\n saveIterableAction('buyNow');\r\n gtmPushEvent(gtmEventType.buyNowClick);\r\n }\r\n\r\n const handleTelClick = () => {\r\n saveIterableAction('telClick');\r\n gtmPushEvent(gtmEventType.call);\r\n }\r\n\r\n return (windowSize.width <= 650 ?\r\n \r\n
{props.PartNumber}\r\n {props.InventoryManagementURL &&
View in Inventory Management ({translator.translate('sandhills.opensinanewtab')})}\r\n {props.Manufacturer &&\r\n
\r\n {props.Manufacturer}\r\n
}\r\n {props.ImageURL &&\r\n
}\r\n {(props.ImageURL && (props.ListingPhotoCount > 0 || props.ListingVideoCount > 0 || props.ListingSpin360Count > 0)) && \r\n getMediaIcons()}\r\n
\r\n \r\n {props.FormattedDiscountPrice ?\r\n \r\n {props.Price}\r\n {props.DiscountSavePercentage && {props.DiscountSavePercentage}}\r\n {props.FormattedDiscountPrice}
\r\n \r\n : (props.ShowMSRPField && props.MSRP ?\r\n \r\n {props.MSRP}\r\n {props.MSRPSavePercentage && {props.MSRPSavePercentage}}\r\n {props.Price}
\r\n \r\n : {props.Price})}\r\n \r\n \r\n {props.IsFreeShipping &&\r\n
}\r\n
\r\n {props.Quantity &&\r\n \r\n : \r\n {props.Quantity}\r\n }\r\n {props.Condition &&\r\n \r\n : \r\n {props.Condition}\r\n }\r\n
\r\n
\r\n
\r\n
\r\n
\r\n : \r\n {props.DealerLocation}\r\n
\r\n {props.ListingLocation &&
}\r\n
\r\n {props.Description &&\r\n
\r\n \r\n {truncateString(props.Description, 200)}\r\n {props.Description.length > 200 &&\r\n }\r\n
\r\n }\r\n
\r\n {props.Updated &&\r\n
\r\n : \r\n {props.Updated}\r\n }\r\n
:\r\n \r\n
\r\n
{props.PartNumber}\r\n {props.InventoryManagementURL &&
View in Inventory Management ({translator.translate('sandhills.opensinanewtab')})}\r\n
\r\n {props.FormattedDiscountPrice ?\r\n \r\n {props.Price}\r\n {props.DiscountSavePercentage && {props.DiscountSavePercentage}}\r\n {props.FormattedDiscountPrice}
\r\n \r\n : (props.ShowMSRPField && props.MSRP ?\r\n \r\n {props.MSRP}\r\n {props.MSRPSavePercentage && {props.MSRPSavePercentage}}\r\n {props.Price}
\r\n \r\n : {props.Price})}\r\n \r\n {props.IsFreeShipping &&\r\n
}\r\n {props.Manufacturer &&\r\n
\r\n {props.Manufacturer}\r\n }\r\n {props.Quantity &&\r\n
\r\n : \r\n {props.Quantity}\r\n }\r\n {props.Condition &&\r\n
\r\n : \r\n {props.Condition}\r\n }\r\n {props.Updated &&\r\n
\r\n : \r\n {props.Updated}\r\n }\r\n {props.ListingLocation &&
}\r\n
\r\n
\r\n
\r\n {props.Description &&\r\n
\r\n \r\n {truncateString(props.Description, 200)}\r\n {props.Description.length > 200 &&\r\n }\r\n
\r\n }\r\n
\r\n );\r\n};\r\n\r\nexport default PartsListListing;","import { forwardRef } from 'react';\r\nimport { ThemedButton } from '@Components/MuiWrappers/Button';\r\nimport Icon from '@mui/material/Icon';\r\nimport useKeyPress from '@Components/Utilities/KeyPress';\r\n\r\nconst ActionButton = forwardRef((props, ref) => {\r\n const key = (props.ID || '' + props.className || '');\r\n useKeyPress('Enter', props.onClick, ref, props.inquiry);\r\n\r\n return (\r\n props.isDetailPage ?\r\n ref.current[props.inquiry] = element } : {})}>\r\n \r\n \r\n {props.buttonText || ''}\r\n \r\n \r\n :\r\n ref.current[props.inquiry] = element } : {})}>\r\n {props.imageUrl ?
: {props.iconText || ''}}\r\n {props.buttonText || ''}\r\n {props.includeRightChevron && }\r\n \r\n );\r\n});\r\n\r\nexport default ActionButton;","import translator from \"@Components/Utilities/Translator\";\r\nimport atoms from '@Components/Utilities/SandhillsAtoms';\r\nimport { useRecoilValue } from 'recoil';\r\nconst ComplexBreadcrumb = (props) => {\r\n\r\n const {\r\n BreadCrumbModels\r\n } = props;\r\n\r\n const getBreadCrumbCount = () => {\r\n return BreadCrumbModels ? BreadCrumbModels.length : 0;\r\n };\r\n const currentSite = useRecoilValue(atoms.currentWebsite);\r\n\r\n if (BreadCrumbModels && !currentSite.IsMobileAppContext) {\r\n return (\r\n \r\n );\r\n } else {\r\n return (<>>);\r\n }\r\n};\r\n\r\nexport default ComplexBreadcrumb;"," import { useState, useReducer, useRef, useEffect } from 'react';\r\nimport { useWindowSize } from '@Components/Utilities/WindowSize';\r\nimport { getOuterHeight } from '@Components/Utilities/SandhillsUtility';\r\nimport { loadable } from '@Components/Utilities/SandhillsLoadable';\r\nimport usePassiveLayoutEffect from '@react-hook/passive-layout-effect';\r\nimport TranslationText from '@Components/Utilities/TranslationText';\r\nimport translator from '@Components/Utilities/Translator';\r\nimport facetedSearchReducer from '@Components/Shared/FacetedSearch/FacetedSearchReducer';\r\nimport ready from 'document-ready';\r\nimport WebSavedSearchesButton from '@Components/WebSavedSearches/WebSavedSearchesButton';\r\nimport atoms from '@Components/Utilities/SandhillsAtoms';\r\nimport { useRecoilValue } from 'recoil';\r\n\r\nconst FacetedSearchSelectedFacet = loadable(() => import('@Components/Shared/FacetedSearch/FacetedSearchSelectedFacet'));\r\nconst FacetedSearchModal = loadable(() => import('@Components/Shared/FacetedSearch/FacetedSearchModal'), true);\r\nconst FacetedSearchField = loadable(() => import('@Components/Shared/FacetedSearch/FacetedSearchField'));\r\n\r\nconst FacetedSearch = (props) => {\r\n\r\n const windowSize = useWindowSize();\r\n const selectedFacetsRef = useRef(null);\r\n const [facetedSearchModal, dispatchFacetedSearchModal] = useReducer(facetedSearchReducer, { Options: [], ShowLoadingSpinner: true });\r\n const [showFacetedSearchModal, setShowFacetedSearchModal] = useState(props.openFacetedModalOnLoad);\r\n const [showAllSelectedOptions, setShowAllSelectedOptions] = useState(false);\r\n const currentUser = useRecoilValue(atoms.currentUser);\r\n const currentWebsite = useRecoilValue(atoms.currentWebsite);\r\n\r\n useEffect(() => {\r\n if (props.openFacetedModalOnLoad) {\r\n FacetedSearchModal.preload();\r\n }\r\n }, []);\r\n\r\n usePassiveLayoutEffect(() => {\r\n ready(() => adjustCollapsedAppliedFacetHeight(!showAllSelectedOptions));\r\n }, [props.SearchFields, props.SelectedFacets]);\r\n\r\n const onFacetOpen = () => {\r\n FacetedSearchSelectedFacet.preload();\r\n };\r\n\r\n const toggleSelectedOptions = () => {\r\n adjustCollapsedAppliedFacetHeight(showAllSelectedOptions);\r\n setShowAllSelectedOptions(showAllSelectedOptions => !showAllSelectedOptions);\r\n };\r\n\r\n const getCollapsedAppliedFacetMaxHeight = () => {\r\n return FacetedSearchSelectedFacet.load().then((f) => {\r\n return (getOuterHeight(selectedFacetsRef.current.firstChild, true) * 2) + 5;\r\n });\r\n };\r\n\r\n const adjustCollapsedAppliedFacetHeight = (adjustMaxHeight) => {\r\n if (selectedFacetsRef.current && selectedFacetsRef.current.firstChild) {\r\n getCollapsedAppliedFacetMaxHeight().then(maxHeight => {\r\n if (adjustMaxHeight) {\r\n selectedFacetsRef.current.style.whiteSpace = 'nowrap';\r\n selectedFacetsRef.current.style.maxHeight = maxHeight + 'px';\r\n } else {\r\n selectedFacetsRef.current.style.whiteSpace = 'normal';\r\n selectedFacetsRef.current.style.maxHeight = '';\r\n }\r\n\r\n if (selectedFacetsRef.current.clientHeight < maxHeight) {\r\n document.getElementsByClassName('facets-toggle')?.[0]?.setAttribute('style', 'display: none;');\r\n } else {\r\n document.getElementsByClassName('facets-toggle')?.[0]?.setAttribute('style', '');\r\n }\r\n });\r\n }\r\n };\r\n\r\n const renderSelectedFacets = () => {\r\n let facets = props.SelectedFacets ? props.SelectedFacets : props.SearchFields;\r\n return (facets.map(field =>\r\n )\r\n );\r\n };\r\n\r\n return (\r\n <>\r\n \r\n
{translator.translate('sandhills.appliedfilters')}
\r\n {windowSize.isMobile &&\r\n
}\r\n {(props.ListingsCount <= 0 && (props.renderError && typeof props.renderError === 'function')) && props.renderError()}\r\n {(!props.IsDefaultSearch || (props.ListingsCount <= 0 && !props.IsWatchList && !props.IsEventsPage) || (props.EnableWebSavedSearches && currentUser.IsAuthenticated && !windowSize.isMobile) || (currentWebsite?.Site?.IsBidcaller && props.IsAttachmentAjaxSearch)) &&\r\n
\r\n {windowSize.isMobile &&\r\n
\r\n :\r\n
}\r\n
\r\n {(!props.IsDefaultSearch || (props.ListingsCount <= 0 && !props.IsWatchList) || (currentWebsite?.Site?.IsBidcaller && props.IsDefaultSearch)) &&\r\n <>\r\n
\r\n \r\n \r\n
\r\n
\r\n {renderSelectedFacets()}\r\n
\r\n
\r\n >\r\n }\r\n {((props.EnableWebSavedSearches && !props.TurnOffDefaultSaveThisSearch && props.savedSearchData && !windowSize.isMobile) || (!windowSize.isMobile && props.EnableWebSavedSearches && ((!props.IsDefaultSearch && !props.TurnOffDefaultSaveThisSearch) || currentUser.IsAuthenticated))) &&\r\n
\r\n }\r\n
\r\n
}\r\n
\r\n {props.isAttachmentPage && props.SearchFields.filter(item => !item.IsFitsTo && !item.GroupName && item.Type !== 'Hidden' && (item.FieldName == 'keywords' || item.FieldName == 'LotNumber' || item.FieldName == 'InventoryType' || item.FieldName == 'WLID')).map(item =>\r\n
0 && props.SelectedFacets.some(facet => facet.FieldName === item.FieldName || facet.SpecGroupName === item.FieldName))}\r\n DispatchFacetedSearchModal={dispatchFacetedSearchModal}\r\n SetShowModal={setShowFacetedSearchModal}\r\n ShowModal={showFacetedSearchModal}\r\n IsEmptySearch={props.ListingsCount <= 0 && !((props.isDealerInventoryLandingPage && props?.EmptyDealerLandingPageEnabledFacets?.includes(item.FieldName)) || item.EnableOnEmptySearch)}\r\n ClearFacet={props.clearFacet}\r\n UseSEOHTagReorganization={props.UseSEOHTagReorganization}\r\n ClassificationToForceScope={props.ClassificationToForceScope}\r\n />)}\r\n {props.isAttachmentPage &&\r\n \r\n \r\n
\r\n }\r\n {props.SearchFields.filter(item => !item.IsFitsTo && !item.GroupName && item.Type !== 'Hidden' && (!props.isAttachmentPage || (props.isAttachmentPage && item.FieldName !== 'keywords' && item.FieldName !== 'LotNumber' && item.FieldName !== 'InventoryType' && item.FieldName !== 'WLID'))).map(item =>\r\n 0 && props.SelectedFacets.some(facet => facet.FieldName === item.FieldName || facet.SpecGroupName === item.FieldName))}\r\n DispatchFacetedSearchModal={dispatchFacetedSearchModal}\r\n SetShowModal={setShowFacetedSearchModal}\r\n ShowModal={showFacetedSearchModal}\r\n IsEmptySearch={props.ListingsCount <= 0 && !((props.isDealerInventoryLandingPage && props?.EmptyDealerLandingPageEnabledFacets?.includes(item.FieldName)) || item.EnableOnEmptySearch)}\r\n ClearFacet={props.clearFacet}\r\n UseSEOHTagReorganization={props.UseSEOHTagReorganization}\r\n ClassificationToForceScope={props.ClassificationToForceScope}\r\n\r\n />)}\r\n {props.SearchFields.some(item => item.IsFitsTo) &&\r\n \r\n \r\n
}\r\n {props.SearchFields.filter(item => item.IsFitsTo).map(item =>\r\n )}\r\n {props.SearchFields.some(item => !item.IsFitsTo && item.GroupName) &&\r\n \r\n {props.isAttachmentPage ? : }\r\n
}\r\n {props.SearchFields.filter(item => !item.IsFitsTo && item.GroupName).map(item =>\r\n )}\r\n \r\n
\r\n {showFacetedSearchModal &&\r\n }\r\n >\r\n );\r\n};\r\n\r\nexport default FacetedSearch;","import SortDropdown from '@Components/Shared/SortDropdown';\r\nimport TranslationText from '@Components/Utilities/TranslationText';\r\nimport { gtmPushEvent, chunkArray } from '@Components/Utilities/SandhillsUtility';\r\nimport { gtmEventType } from '@Components/Utilities/SandhillsConstants';\r\nimport { useWindowSize } from '@Components/Utilities/WindowSize';\r\nimport { loadable } from '@Components/Utilities/SandhillsLoadable';\r\nimport translator from '@Components/Utilities/Translator';\r\n\r\nconst MobileModalControl = loadable(() => import('@Components/Shared/Modals/MobileModalControl'));\r\n\r\nconst FacetedSearchMobileMenu = (props) => {\r\n\r\n const options = [];\r\n const windowSize = useWindowSize();\r\n const vip = sandhills.TradeSites.React.ComponentProps['vip'];\r\n\r\n if (props.flyout?.render) {\r\n options.push(\r\n \r\n \r\n
\r\n );\r\n }\r\n\r\n if (props.vip && vip) {\r\n options.push(\r\n \r\n );\r\n }\r\n\r\n if (props.hlaUrl && !props.IsRY) {\r\n options.push(\r\n \r\n );\r\n }\r\n\r\n if (props.watchList) {\r\n options.push(\r\n \r\n );\r\n }\r\n\r\n if (props.stolenUrl) {\r\n options.push(\r\n \r\n );\r\n }\r\n\r\n if (props.sort?.options?.length > 0) {\r\n options.push(\r\n \r\n );\r\n }\r\n\r\n const columns = props.filter?.render ? 2 : 1;\r\n const chunkedOptions = chunkArray(options, columns);\r\n const chunkOneCount = chunkedOptions?.[0]?.length;\r\n const chunkTwoCount = chunkedOptions?.[1]?.length;\r\n const chunkOneBlack = (props.flyout?.render ? (chunkOneCount === 1 || ((props.vip && vip) && chunkOneCount === 2)) : ((props.vip && vip) && chunkOneCount === 1));\r\n const chunkTwoBlack = (props.flyout?.render && chunkOneCount === 1 && (props.vip && vip) && chunkTwoCount == 1);\r\n\r\n return (windowSize.isMobile ?\r\n (\r\n {props.filter?.render &&\r\n
{ if (e.key === \"Enter\" || e.key === ' ') { e.preventDefault(); props.filter.toggle(); } }} onClick={props.filter.toggle}>\r\n
\r\n \r\n \r\n \r\n \r\n \r\n
\r\n
}\r\n
\r\n {props.filter?.render ?\r\n (<>\r\n
\r\n {chunkedOptions?.[0]?.map(option => option)}\r\n
\r\n
\r\n {chunkedOptions?.[1]?.map(option => option)}\r\n
\r\n >) : (\r\n
\r\n {chunkedOptions?.map(chunk => chunk?.map(option => option))}\r\n
)}\r\n
\r\n
) : (<>>)\r\n );\r\n};\r\n\r\nexport default FacetedSearchMobileMenu;","import { useWorker } from '@Components/Shared/WebWorker';\r\n\r\nconst facetedSearchReducer = (state, action) => {\r\n switch (action.type) {\r\n case 'update':\r\n return {\r\n ...state,\r\n ...action.payload,\r\n SearchWorker: getFacetedSearchWorker(state.SearchWorker, action.payload.SearchDispatcher)\r\n };\r\n case 'destroy':\r\n return {\r\n Options: [],\r\n ShowLoadingSpinner: true,\r\n SearchWorker: state.SearchWorker\r\n };\r\n default:\r\n return state;\r\n }\r\n};\r\n\r\nconst getFacetedSearchWorker = (worker, dispatcher) => {\r\n if (worker) {\r\n return worker;\r\n } else {\r\n return useWorker(() => {\r\n self.addEventListener('message', (e) => {\r\n if (e.data.nestedTree) {\r\n const search = (option, text, parentMatches, selectedFilterOptions, parentIsFilterBySelected, searchResult) => {\r\n searchResult.push(option);\r\n option.Visible = false;\r\n let addParent = false;\r\n let isFilterBySelected = false;\r\n let filterBySelectionsAreChecked = false;\r\n if (selectedFilterOptions && selectedFilterOptions.length > 0) {\r\n filterBySelectionsAreChecked = true;\r\n isFilterBySelected = selectedFilterOptions.some(item => item.Value == option.Value);\r\n }\r\n if (((!text || text === '') || anyMatches(option.Name, text)) &&\r\n (isFilterBySelected || !filterBySelectionsAreChecked || parentMatches || parentIsFilterBySelected)) {\r\n addParent = true;\r\n option.Visible = true;\r\n }\r\n if (option.Children && option.Children.length > 0) {\r\n let children = [];\r\n let childrenLength = option.Children.length;\r\n for (var i = 0; i < childrenLength; i++) {\r\n let child = search(option.Children[i], text, (parentMatches || addParent), selectedFilterOptions, (parentIsFilterBySelected || isFilterBySelected), searchResult);\r\n children.push(child);\r\n if (child.Visible) {\r\n option.Visible = true;\r\n }\r\n }\r\n option.Children = children;\r\n }\r\n return option;\r\n };\r\n let selectedFilterOptions = e.data.selectedFilterOptions;\r\n if (!selectedFilterOptions) {\r\n if (e.data.filterOptions.length > 0) {\r\n selectedFilterOptions = e.data.filterOptions.filter(option => option.Checked);\r\n }\r\n }\r\n let nestedTree = [];\r\n let searchResult = [];\r\n let searchText = e.data.text.toLowerCase();\r\n e.data.nestedTree.forEach(option => nestedTree.push(search(option, searchText, false, selectedFilterOptions, false, searchResult)));\r\n postMessage({\r\n searchResult: searchResult,\r\n nestedTreeResult: nestedTree\r\n });\r\n }\r\n\r\n function anyMatches(fullText, typed) {\r\n var text = fullText.toLowerCase();\r\n var typedText = typed.toLowerCase();\r\n var match = text.indexOf(typedText) !== -1;\r\n\r\n if (!match) {\r\n text = replaceSpecialCharacters(text);\r\n typedText = replaceSpecialCharacters(typedText);\r\n match = text.indexOf(typedText) !== -1\r\n }\r\n\r\n return match;\r\n };\r\n\r\n //Can't pass function/library into web workers so creating custom method\r\n function replaceSpecialCharacters(text) {\r\n return text\r\n .replace(/\\u00c0/g, 'a') //À\r\n .replace(/\\u00e0/g, 'a') //à\r\n .replace(/\\u00c1/g, 'a') //Á\r\n .replace(/\\u00e1/g, 'a') //á\r\n .replace(/\\u00c2/g, 'a') //Â\r\n .replace(/\\u00e2/g, 'a') //â\r\n .replace(/\\u00c3/g, 'a') //Ã\r\n .replace(/\\u00e3/g, 'a') //ã\r\n .replace(/\\u00c4/g, 'a') //Ä\r\n .replace(/\\u00c5/g, 'a') //Å\r\n .replace(/\\u00e5/g, 'a') //å\r\n .replace(/\\u00c8/g, 'e') //È\r\n .replace(/\\u00e8/g, 'e') //è\r\n .replace(/\\u00c9/g, 'e') //É\r\n .replace(/\\u00e9/g, 'e') //é\r\n .replace(/\\u00ca/g, 'e') //Ê\r\n .replace(/\\u00ea/g, 'e') //ê\r\n .replace(/\\u00cb/g, 'e') //Ë\r\n .replace(/\\u00eb/g, 'e') //ë\r\n .replace(/\\u00cc/g, 'i') //Ì\r\n .replace(/\\u00ec/g, 'i') //ì\r\n .replace(/\\u00cd/g, 'i') //Í\r\n .replace(/\\u00ed/g, 'i') //í\r\n .replace(/\\u00ce/g, 'i') //Î\r\n .replace(/\\u00ee/g, 'i') //î\r\n .replace(/\\u00cf/g, 'i') //Ï\r\n .replace(/\\u00ef/g, 'i') //ï\r\n .replace(/\\u00d1/g, 'n') //Ñ\r\n .replace(/\\u00f1/g, 'n') //ñ\r\n .replace(/\\u00d2/g, 'o') //Ò\r\n .replace(/\\u00f2/g, 'o') //ò\r\n .replace(/\\u00d3/g, 'o') //Ó\r\n .replace(/\\u00f3/g, 'o') //ó\r\n .replace(/\\u00d4/g, 'o') //Ô\r\n .replace(/\\u00f4/g, 'o') //ô\r\n .replace(/\\u00d5/g, 'o') //Õ\r\n .replace(/\\u00f5/g, 'o') //õ\r\n .replace(/\\u00d6/g, 'o') //Ö\r\n .replace(/\\u00f6/g, 'o') //ö\r\n .replace(/\\u00f6/g, 'o') //ö\r\n .replace(/\\u00df/g, 'ss') //ß\r\n .replace(/\\u00d9/g, 'u') //Ù\r\n .replace(/\\u00f9/g, 'u') //ù\r\n .replace(/\\u00da/g, 'u') //Ú\r\n .replace(/\\u00fa/g, 'u') //ú\r\n .replace(/\\u00db/g, 'u') //Û\r\n .replace(/\\u00fb/g, 'u') //û\r\n .replace(/\\u00dc/g, 'u') //Ü\r\n .replace(/\\u00fc/g, 'u') //ü\r\n .replace(/\\u00dd/g, 'y') //Ý\r\n .replace(/\\u00fd/g, 'y') //ý\r\n .replace(/\\u0178/g, 'y') //Ÿ\r\n .replace(/\\u00ff/g, 'y'); //ÿ\r\n }\r\n });\r\n }, dispatcher);\r\n }\r\n};\r\n\r\nconst buildNestedTree = (items, keepSpecLandingInGroup) => {\r\n let nestedTree = [];\r\n let options = [];\r\n if (items) {\r\n let [hasOptionsChecked, hasSpecLandingTermOptionsChecked] = [false, false];\r\n if (keepSpecLandingInGroup) {\r\n hasOptionsChecked = items.some(i => i.Checked);\r\n hasSpecLandingTermOptionsChecked = items.some(i => i.IsSpecLandingTerm && i.Checked);\r\n }\r\n items.forEach(option => {\r\n if (!option.ParentValue) {\r\n option.Visible = true;\r\n nestedTree.push(option);\r\n }\r\n if (keepSpecLandingInGroup && hasOptionsChecked) {\r\n if (hasSpecLandingTermOptionsChecked) {\r\n option.Disabled = !option.IsSpecLandingTerm;\r\n }\r\n else {\r\n option.Disabled = option.IsSpecLandingTerm;\r\n }\r\n }\r\n });\r\n }\r\n nestedTree.forEach(option => {\r\n options.push(option);\r\n let descendants = buildDescendants(items, option);\r\n option.Children = descendants.children;\r\n options = options.concat(descendants.options);\r\n });\r\n return {\r\n nestedTree: nestedTree,\r\n options: options\r\n };\r\n};\r\n\r\nconst buildDescendants = (items, parent) => {\r\n let children = [];\r\n let options = [];\r\n items.forEach(option => {\r\n if (option !== parent && parent.Value == option.ParentValue) {\r\n option.Visible = true;\r\n children.push(option);\r\n }\r\n });\r\n if (children.length > 0) {\r\n children.forEach(option => {\r\n options.push(option);\r\n if (option.IsGroup) {\r\n let childObject = buildDescendants(items, option);\r\n option.Children = childObject.children;\r\n options = options.concat(childObject.options);\r\n }\r\n });\r\n }\r\n return {\r\n children: children,\r\n options: options\r\n };\r\n};\r\n\r\nconst applyFacet = (selectedOption, isChecked, options, nestedTree, parentNameForSearch, isSpecLandingTermFacet, keepSpecLandingInGroup) => {\r\n let newOptions = [];\r\n let newNestedTree = [];\r\n let checkedValues = [];\r\n let uncheckedValues = [];\r\n let excludedCheckedValues = [];\r\n let oneMustBeSelectedIndividually = nestedTree.some(option => option.MustBeSelectedIndividually);\r\n const getChildrenValues = (currentOption, optionIsChecked) => {\r\n let children = options.filter(option => option.ParentValue == currentOption.Value);\r\n if (children.some(c => c.Checked)) {\r\n children.forEach(option => {\r\n if (optionIsChecked) {\r\n checkedValues.push(option);\r\n excludedCheckedValues.push(option.ReactKey);\r\n } else {\r\n uncheckedValues.push(option.ReactKey);\r\n }\r\n });\r\n } else {\r\n children.forEach(option => excludedCheckedValues.push(option.ReactKey));\r\n }\r\n if (children.some(c => c.IsGroup && c.Children && c.Children.length > 0)) {\r\n children.filter(c => c.IsGroup && c.Children && c.Children.length > 0).forEach(option => getChildrenValues(option, option.Checked));\r\n }\r\n };\r\n const getParentValues = (currentOption, optionIsChecked) => {\r\n let parent = options.filter(option => option.Value == currentOption.ParentValue)[0];\r\n if (parent) {\r\n let parentIsChecked = false;\r\n let childrendUnderParent = options.filter(option => option.ParentValue == parent.Value);\r\n // if any children are not checked, uncheck the parent:\r\n if (!optionIsChecked || childrendUnderParent.some(c => !c.Checked)) {\r\n uncheckedValues.push(parent.ReactKey);\r\n } else {\r\n // otherwise check the parent and uncheck all the children:\r\n parentIsChecked = true;\r\n checkedValues.push(parent);\r\n childrendUnderParent.forEach(c => excludedCheckedValues.push(c.ReactKey));\r\n }\r\n if (parent.ParentValue) {\r\n getParentValues(parent, parentIsChecked);\r\n }\r\n }\r\n };\r\n const checkOption = (option) => {\r\n let newOption = { ...option };\r\n if (newOption.ReactKey == selectedOption.ReactKey && ((newOption.IsGroup && selectedOption.IsGroup) || (!newOption.IsGroup && !selectedOption.IsGroup))) {\r\n newOption.Checked = isChecked;\r\n }\r\n if (isSpecLandingTermFacet && isChecked) {\r\n if (selectedOption.IsSpecLandingTerm) {\r\n //if spec landing term facet and last selection was spec landing term, uncheck any non-spec landing terms\r\n newOption.Checked = newOption.Checked && newOption.IsSpecLandingTerm;\r\n }\r\n else {\r\n //if spec landing term facet and last selection was non spec landing term, uncheck any spec landing terms\r\n newOption.Checked = newOption.Checked && !newOption.IsSpecLandingTerm;\r\n }\r\n }\r\n if (newOption.Checked && uncheckedValues.indexOf(newOption.ReactKey) < 0 && ((excludedCheckedValues.indexOf(newOption.ReactKey) < 0) || (parentNameForSearch && newOption.IsGroup))) {\r\n checkedValues.push(newOption);\r\n }\r\n if (uncheckedValues.length > 0) {\r\n let uncheckedIndex = uncheckedValues.indexOf(newOption.ReactKey);\r\n if (uncheckedIndex > -1) {\r\n uncheckedValues.splice(uncheckedIndex, 1);\r\n newOption.Checked = false;\r\n }\r\n }\r\n let checkedIndex = checkedValues.findIndex(facet => facet.ReactKey == newOption.ReactKey);\r\n if (checkedIndex > -1) {\r\n newOption.Checked = true;\r\n }\r\n\r\n if (keepSpecLandingInGroup) {\r\n let hasOptionsChecked = options.some(op => op.Checked && op.ReactKey != selectedOption.ReactKey);\r\n if (isChecked || hasOptionsChecked) {\r\n let hasSpecLandingTermOptionsChecked = options.some(op => op.IsSpecLandingTerm && op.Checked);\r\n if (selectedOption.IsSpecLandingTerm) {\r\n newOption.Disabled = !newOption.IsSpecLandingTerm && (isChecked || hasSpecLandingTermOptionsChecked);\r\n }\r\n else {\r\n newOption.Disabled = newOption.IsSpecLandingTerm && (isChecked || !hasSpecLandingTermOptionsChecked);\r\n }\r\n }\r\n else {\r\n newOption.Disabled = false;\r\n }\r\n }\r\n\r\n return newOption;\r\n };\r\n const rebuildChildren = (parent) => {\r\n let children = [];\r\n parent.Children.map(option => {\r\n let newOption = checkOption(option);\r\n newOptions.push(newOption);\r\n if (newOption.IsGroup) {\r\n newOption.Children = rebuildChildren(newOption);\r\n }\r\n children.push(newOption);\r\n });\r\n return children;\r\n };\r\n // checkbox click logic starts here:\r\n if (oneMustBeSelectedIndividually) {\r\n if (selectedOption.MustBeSelectedIndividually && isChecked) {\r\n // if selected option is MustBeSelectedIndividually and is checked then deselect other values:\r\n nestedTree.forEach(option => {\r\n if (option.Value != selectedOption.Value) {\r\n uncheckedValues.push(option.ReactKey);\r\n }\r\n });\r\n } else if (isChecked && nestedTree.some(option => option.MustBeSelectedIndividually && option.Checked)) {\r\n // if selected option is not MustBeSelectedIndividually then deselect any MustBeSelectedIndividually options if there are any checked:\r\n nestedTree.forEach(option => {\r\n if (option.MustBeSelectedIndividually) {\r\n uncheckedValues.push(option.ReactKey);\r\n }\r\n });\r\n }\r\n }\r\n // if selected option was just checked and has children, uncheck them all, otherwise ignore they would be unchecked anyways:\r\n if (selectedOption.IsGroup && selectedOption.Children && selectedOption.Children.length > 0) {\r\n getChildrenValues(selectedOption, isChecked);\r\n }\r\n // if selected option is a child itself, handle parent selections, \r\n // either we checked the last child to complete a parent selection, we checked child and need to deselect all parents, or no parents are selected anyways so we do nothing:\r\n if (selectedOption.ParentValue) {\r\n getParentValues(selectedOption, isChecked);\r\n }\r\n\r\n // update all option checkboxes and sync up the family tree:\r\n newNestedTree = [...nestedTree].map(option => {\r\n let newOption = checkOption(option);\r\n newOptions.push(newOption);\r\n if (newOption.IsGroup) {\r\n newOption.Children = rebuildChildren(newOption);\r\n }\r\n return newOption;\r\n });\r\n return {\r\n options: newOptions,\r\n nestedTree: newNestedTree,\r\n currentFilter: checkedValues\r\n };\r\n};\r\n\r\nexport default facetedSearchReducer;\r\nexport { buildNestedTree, applyFacet };","import translator from '@Components/Utilities/Translator';\r\nimport Modal from '@Components/Shared/Modals/Modal';\r\n\r\nconst AuctionInformationModal = (props) => {\r\n\r\n const onClose = () => {\r\n props.toggleModal();\r\n };\r\n\r\n return (\r\n \r\n \r\n \r\n {props.EventTitle}\r\n \r\n \r\n \r\n {props.StartDate &&\r\n {translator.translate('sandhills.startdate')}: {props.StartDate}
}\r\n {props.EndDate &&\r\n {translator.translate('sandhills.enddate')}: {props.EndDate}
}\r\n {props.StartTime && {translator.translate('sandhills.time')}: {props.StartTime}
}\r\n {props.Description &&\r\n {props.Description}}\r\n\r\n \r\n \r\n
\r\n \r\n \r\n );\r\n};\r\n\r\nexport default AuctionInformationModal;","import Modal from '@Components/Shared/Modals/Modal';\r\nimport translator from '@Components/Utilities/Translator';\r\n\r\nconst ConsignmentPackageInfoModal = (props) => {\r\n\r\n const onClose = () => {\r\n props.toggleModal();\r\n };\r\n\r\n return (\r\n \r\n \r\n \r\n {props.EventTitle}\r\n \r\n \r\n \r\n {props.Description &&\r\n \r\n {props.Description}\r\n
}\r\n \r\n
{translator.translate('sandhills.tradepubwebsite.mvc.contactinfo')}\r\n\r\n
\r\n {props.Name &&\r\n
\r\n
{translator.translate('sandhills.sellerinformation')}\r\n
{props.Name}
\r\n {props.DealerAddress && \r\n
{props.DealerAddress}
}\r\n {props.DealerCityStatePostal &&\r\n
{props.DealerCityStatePostal}
}\r\n {props.UnformattedDealerPhoneNumber &&\r\n
}\r\n
}\r\n\r\n {props.DisplayConsignorInformation &&\r\n
\r\n
{translator.translate('sandhills.crm.dscrm.consignorinfo')}\r\n {props.ConsignorCompanyName &&\r\n
{props.ConsignorCompanyName}
}\r\n {props.ConsignorName &&\r\n
{props.ConsignorName}
}\r\n {props.ConsignorEmail &&\r\n
{props.ConsignorEmail}
}\r\n {props.ConsignorPhoneNumber &&\r\n
}\r\n {props.ConsignorPreferredMethodOfContact &&\r\n
\r\n {translator.translate('sandhills.preferredcontactmethod')}: \r\n {props.ConsignorPreferredMethodOfContact}\r\n
}\r\n {props.ConsignorPreferredContactTimeOfDay &&\r\n
\r\n {translator.translate('sandhills.preferredcontacttime')}: \r\n {props.ConsignorPreferredContactTimeOfDay}\r\n
}\r\n
}\r\n
\r\n
\r\n \r\n \r\n );\r\n};\r\n\r\nexport default ConsignmentPackageInfoModal;\r\n","import translator from '@Components/Utilities/Translator';\r\nimport Modal from '@Components/Shared/Modals/Modal';\r\nimport { truncateString } from '@Components/Utilities/SandhillsUtility';\r\nimport { useWindowSize } from '@Components/Utilities/WindowSize';\r\n\r\nconst DealerLocationsModal = (props) => {\r\n const windowSize = useWindowSize();\r\n\r\n const onClose = () => {\r\n props.toggleModal();\r\n };\r\n\r\n const truncateName = (name) => {\r\n return truncateString(name, windowSize.isMobile ? 45 : 80);\r\n };\r\n\r\n return (\r\n \r\n \r\n \r\n {translator.translate('sandhills.tradesites.mvc.variouslocations')}\r\n \r\n \r\n \r\n {props.Locations.map((location, index) => {\r\n return ()\r\n })}\r\n \r\n
\r\n \r\n
\r\n
\r\n \r\n \r\n );\r\n};\r\n\r\nexport default DealerLocationsModal;","import translator from '@Components/Utilities/Translator';\r\nimport Modal from '@Components/Shared/Modals/Modal';\r\n\r\nconst DescriptiveTextModal = (props) => {\r\n\r\n const onClose = () => {\r\n props.toggleModal();\r\n };\r\n\r\n return (\r\n \r\n \r\n \r\n {translator.translate('sandhills.tradepubwebsite.mvc.company')} {translator.translate('sandhills.tradepubwebsite.mvc.details')}\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n );\r\n};\r\n\r\nexport default DescriptiveTextModal;","import translator from '@Components/Utilities/Translator';\r\nimport Modal from '@Components/Shared/Modals/Modal';\r\nimport {useEffect} from 'react';\r\n\r\nconst GoodleMapsLocationModal = (props) => {\r\n\r\n const dealerLocation = {\r\n lat: props.GoogleAPIData?.PinLocation?.Latitude,\r\n lng: props.GoogleAPIData?.PinLocation?.Longitude\r\n };\r\n\r\n useEffect(() => {\r\n toggleMap();\r\n }, [])\r\n\r\n\r\n const generateInfoWindow = (map) => {\r\n let tld = props.GoogleAPIData.TopLevelDomain;\r\n let hl = props.GoogleAPIData.TwoDigitISOLanguageCode;\r\n let viewOn = props.GoogleAPIData.ViewOnGoogleMaps;\r\n map.addListener('click', (e) => {\r\n if (e.placeId) {\r\n e.stop();\r\n let geocoder = new google.maps.Geocoder;\r\n geocoder.geocode({ 'placeId': e.placeId }, (results, status) => {\r\n if (status === 'OK') {\r\n if (results[0]) {\r\n let newInfowindow = new google.maps.InfoWindow({\r\n content: '',\r\n position: results[0].geometry.location\r\n });\r\n newInfowindow.open(map);\r\n }\r\n }\r\n });\r\n }\r\n });\r\n };\r\n const toggleMap = () => {\r\n if (props.GoogleAPIData && dealerLocation && dealerLocation.lat && dealerLocation.lng) {\r\n let map = new google.maps.Map(document.getElementById('dealer-map'), {\r\n zoom: 14,\r\n center: dealerLocation,\r\n disableDefaultUI: true,\r\n zoomControl: true,\r\n mapTypeControlOptions: {\r\n mapTypeIds: [google.maps.MapTypeId.ROADMAP, google.maps.MapTypeId.HYBRID],\r\n streetViewControl: true\r\n }\r\n });\r\n\r\n let marker = new google.maps.Marker({ position: dealerLocation, map: map });\r\n let infowindow = new google.maps.InfoWindow({\r\n content: ''\r\n });\r\n\r\n marker.addListener('click', function () {\r\n infowindow.open(map, marker);\r\n });\r\n generateInfoWindow(map);\r\n }\r\n };\r\n const onClose = () => {\r\n props.toggleModal();\r\n };\r\n\r\n return (\r\n \r\n \r\n \r\n {props.Name}\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n );\r\n};\r\n\r\nexport default GoodleMapsLocationModal;","import Modal from '@Components/Shared/Modals/Modal';\r\nimport WebSavedSearchesList from '@Components/WebSavedSearches/WebSavedSearchesList';\r\nimport translator from '@Components/Utilities/Translator';\r\nimport { useWindowSize } from '@Components/Utilities/WindowSize';\r\n\r\nconst WebSavedSearchesModal = (props) => {\r\n const windowSize = useWindowSize();\r\n\r\n const onClose = () => {\r\n props?.onClose?.();\r\n };\r\n\r\n return (\r\n \r\n \r\n \r\n {translator.translate('sandhills.savedsearches')}\r\n \r\n \r\n \r\n Add and view saved searches
\r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default WebSavedSearchesModal;","import { useMemo } from 'react';\r\nimport debounce from 'lodash/debounce';\r\nimport TranslationText from '@Components/Utilities/TranslationText';\r\nimport Modal from '@Components/Shared/Modals/Modal';\r\nimport { hasCurrentLongitudeAndLatitudeCookies } from '@Components/Utilities/CookieHelper';\r\n\r\nconst SortDropdown = (props) => {\r\n const DistanceSortValue = 6;\r\n const delayQuery = useMemo(() => debounce(e => props.OnChange(e), 500), [props.OnChange]);\r\n\r\n const changeSort = (e) => {\r\n let sort = parseInt(e.target ? e.target.value : e)\r\n if (props.setShowDistanceModal && sort === DistanceSortValue && !(hasCurrentLongitudeAndLatitudeCookies())) {\r\n props.setShowDistanceModal(true)\r\n } else {\r\n delayQuery(sort);\r\n } \r\n };\r\n\r\n const onClose = (e) => {\r\n props.toggleMobileSort();\r\n };\r\n\r\n const calculateSortHeight = () => {\r\n let sortHeight = 'auto';\r\n if (props.isFromNavBar) {\r\n sortHeight = props.openBar ? '39.5px' : '11.5px';\r\n }\r\n return sortHeight;\r\n } \r\n\r\n return (props.IsDesktop && !props.SortButton ?\r\n \r\n
\r\n \r\n \r\n \r\n
\r\n
\r\n :\r\n \r\n );\r\n};\r\n\r\nexport default SortDropdown;","\r\nexport function useWorker(fn, successCallback) {\r\n const code = fn.toString();\r\n const blob = new Blob(['(' + code + ')()'], { type: 'text/javascript' });\r\n var worker = new Worker('' + URL.createObjectURL(blob)); //takes in an additional parameter 'options' that's an object. ex: {type: 'module'}\r\n worker.addEventListener('message', event => successCallback(event)); //event to handle data received from the worker\r\n return worker;\r\n}","\r\nconst splitArrayEvenly = (arrayList, numGroups) => {\r\n arrayList = arrayList.slice();\r\n let result = [];\r\n while (arrayList.length) {\r\n result.push(arrayList.splice(0, Math.ceil(arrayList.length / numGroups--)));\r\n }\r\n return result;\r\n};\r\n\r\nexport {\r\n splitArrayEvenly\r\n};","import baseLoadable from '@loadable/component';\r\nimport LoadingRing from '@Components/MuiWrappers/LoadingRing';\r\nimport { delayPromise } from '@Components/Utilities/SandhillsUtility';\r\n\r\nconst dynamicLoading = {\r\n defaultDelayValue: 200\r\n};\r\n\r\nconst loadable = (importFunc, backdrop = false) => {\r\n if (backdrop) {\r\n var importAsyncFunc = importFunc.importAsync;\r\n importFunc.importAsync = () => {\r\n var promise = importAsyncFunc();\r\n return promise.then(delayPromise(dynamicLoading.defaultDelayValue));\r\n };\r\n return baseLoadable(importFunc, {\r\n fallback: (\r\n \r\n )\r\n });\r\n }\r\n\r\n return baseLoadable(importFunc);\r\n};\r\n\r\nexport {\r\n loadable\r\n};","import { gtmPushEvent, sandhillsRequest } from '@Components/Utilities/SandhillsUtility';\r\n\r\nconst watchlistOnClick = (dataAction, listingID, listingTypes, routes) => {\r\n\r\n return sandhillsRequest({\r\n url: routes.WatchListClick + \"/\" + dataAction,\r\n method: 'post',\r\n data: {\r\n 'ListingID': listingID,\r\n 'ListingTypes': listingTypes\r\n },\r\n errorHandling: {\r\n useConsole: false,\r\n useAlert: false\r\n }\r\n }).then(response => {\r\n if (response.success) {\r\n if (dataAction == 'add') {\r\n gtmPushEvent('watchlist-add-click');\r\n }\r\n } else if (!response.IsAuthenticated) {\r\n var mappedListingTypes = listingTypes.map(function (item) {\r\n return 'ListingTypes=' + item + '&';\r\n }).join('');\r\n\r\n window.location.href = routes.SSO + '?to=' + encodeURIComponent('https://' + window.location.hostname + '/watchlist/' + dataAction + '/' + listingID + '?' + mappedListingTypes + 'to=' + encodeURIComponent(window.location.href));\r\n \r\n }\r\n\r\n return response;\r\n });\r\n};\r\n\r\nexport {\r\n watchlistOnClick\r\n};","import { useState } from 'react';\r\nimport TextField from '@mui/material/TextField';\r\nimport { webSavedSearchNameCharCountLimit } from '@Components/Utilities/SandhillsConstants';\r\n\r\n\r\nconst WebSavedSearchItem = (props) => {\r\n const [showEdit, setShowEdit] = useState(false);\r\n const [name, setName] = useState(props.SearchName);\r\n\r\n const toggleEdit = () => {\r\n setShowEdit(!showEdit);\r\n\r\n if (showEdit) {\r\n props.updateWebSavedSearch(props.WebSavedSearchID, name);\r\n } else {\r\n setName(props.SearchName);\r\n }\r\n };\r\n\r\n const textChange = (e) => {\r\n setName(e);\r\n props.setPendingSearchName(e);\r\n };\r\n const onKeyPress = (e) => {\r\n if (e.key === 'Enter') {\r\n props.updateWebSavedSearch(props.WebSavedSearchID, name);\r\n toggleEdit();\r\n }\r\n };\r\n const closeEdit = () => {\r\n setShowEdit(false);\r\n }\r\n\r\n\r\n return (\r\n \r\n
\r\n {showEdit ?\r\n
textChange(props.truncateText(e.target.value, webSavedSearchNameCharCountLimit))}\r\n autoFocus={true}\r\n onKeyPress={onKeyPress}\r\n onFocus={e => { e.target.select(); }} />\r\n :\r\n {props.SearchName} \r\n }\r\n \r\n { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); toggleEdit(); } }} onClick={() => toggleEdit()} className={showEdit ? 'fas fa-save' : \"fas fa-pencil-alt\"} title={showEdit ? translator.translate('sandhills.photosvideos.savechanges') : translator.translate('sandhills.edit')} />\r\n { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); showEdit ? closeEdit() : props.removeWebSavedSearch(props.WebSavedSearchID) } }} onClick={() => showEdit ? closeEdit() : props.removeWebSavedSearch(props.WebSavedSearchID)} className={showEdit ? 'fas fa-x' : 'fas fa-trash'} title={showEdit ? translator.translate('sandhills.closepage') : translator.translate('sandhills.delete')} />\r\n
\r\n \r\n
\r\n )\r\n\r\n}\r\n\r\nexport default WebSavedSearchItem\r\n","import LoadingRing from '@Components/MuiWrappers/LoadingRing';\r\nimport { webSavedSearchAuthenticatedLimit } from '@Components/Utilities/SandhillsConstants';\r\nimport translator from '@Components/Utilities/Translator';\r\nimport { useRecoilState, useRecoilValue } from 'recoil';\r\nimport atoms from '@Components/Utilities/SandhillsAtoms';\r\nimport WebSavedSearchesModal from '@Components/Shared/Modals/WebSavedSearchesModal' ;\r\n\r\nconst WebSavedSearchesButton = (props) => {\r\n\r\n const [currentUser, setCurrentUser] = useRecoilState(atoms.currentUser);\r\n const currentWebsite = useRecoilValue(atoms.currentWebsite);\r\n\r\n return (\r\n <>\r\n {(props.Loading && !props.ShowModal) && }\r\n \r\n {(!props.IsDefaultSearch || (props.IsDefaultSearch && currentWebsite?.Site?.IsBidcaller)) && !props.TurnOffDefaultSaveThisSearch &&\r\n \r\n }\r\n {currentUser.IsAuthenticated &&\r\n \r\n }\r\n
\r\n {props.ShowModal &&\r\n \r\n }\r\n >\r\n );\r\n};\r\n\r\nexport default WebSavedSearchesButton;","import { useState } from 'react';\r\nimport TextField from '@mui/material/TextField';\r\nimport Button from '@mui/material/Button';\r\nimport LoadingRing from '@Components/MuiWrappers/LoadingRing';\r\nimport translator from '@Components/Utilities/Translator';\r\nimport { webSavedSearchNameCharCountLimit, webSavedSearchAuthenticatedLimit } from '@Components/Utilities/SandhillsConstants';\r\nimport atoms from '@Components/Utilities/SandhillsAtoms';\r\nimport { useRecoilValue } from 'recoil';\r\nimport WebSavedSearchItem from '@Components/WebSavedSearches/WebSavedSearchItem';\r\nimport { useWindowSize } from '@Components/Utilities/WindowSize';\r\n\r\n\r\nconst WebSavedSearchesList = (props) => {\r\n\r\n const [pendingSearchName, setPendingSearchName] = useState(props.PendingSearchName);\r\n const currentUser = useRecoilValue(atoms.currentUser);\r\n const windowSize = useWindowSize();\r\n\r\n const textboxStyles = {\r\n fontSize: windowSize.isMobile ? '14px' : '16px',\r\n marginLeft: '10px'\r\n };\r\n\r\n const buttonStyles = {\r\n fontWeight: '700'\r\n };\r\n\r\n const saveSearch = () => {\r\n props.saveCurrentSearch(pendingSearchName);\r\n };\r\n\r\n const truncateText = (text, maxLength) => {\r\n if (text.length <= maxLength) {\r\n return text;\r\n }\r\n return text.substr(0, maxLength);\r\n };\r\n const onKeyPress = (e) => {\r\n if (e.key === 'Enter') {\r\n props.saveCurrentSearch(pendingSearchName);\r\n }\r\n };\r\n\r\n return (\r\n <>\r\n {props.Loading && }\r\n \r\n {props.PendingSave ?\r\n
\r\n
{translator.translate('sandhills.tradesites.mvc.savedsearchname')}
\r\n
= webSavedSearchAuthenticatedLimit}\r\n onChange={(e) => setPendingSearchName(truncateText(e.target.value, webSavedSearchNameCharCountLimit))}\r\n onKeyPress={onKeyPress} />\r\n {props.Message &&\r\n \r\n
{props.Message}
\r\n {props.WebSavedSearches?.length >= webSavedSearchAuthenticatedLimit && props.PendingSave &&\r\n
{ if (e.key === \"Enter\" || e.key === ' ') { e.preventDefault(); props.setPendingSave(!props.PendingSave); } }} onClick={() => props.setPendingSave(!props.PendingSave)} className='edit-link'>{translator.translate('sandhills.tradesites.mvc.editsearches')}
\r\n }\r\n
\r\n }\r\n \r\n \r\n :\r\n <>\r\n {props.Message &&\r\n <>\r\n
{props.Message}
\r\n {props.WebSavedSearches?.length >= webSavedSearchAuthenticatedLimit && props.PendingSave &&\r\n
{ if (e.key === \"Enter\" || e.key === ' ') { e.preventDefault(); props.setPendingSave(!props.PendingSave); } }} onClick={() => props.setPendingSave(!props.PendingSave)} className='edit-link'>{translator.translate('sandhills.tradesites.mvc.editsearches')}
\r\n }\r\n >\r\n }\r\n
\r\n {props.WebSavedSearches?.length > 0 &&\r\n <>\r\n {props.WebSavedSearches.map(s =>\r\n \r\n )}\r\n >\r\n }\r\n
\r\n >\r\n }\r\n
\r\n >\r\n );\r\n};\r\n\r\nexport default WebSavedSearchesList;","import { splitArrayEvenly } from '@Components/Utilities/ArrayHelpers';\r\nimport { useState, useEffect, Fragment } from 'react';\r\nimport { bannerAdPositions, contactType, inquiryType, gtmEventType } from '@Components/Utilities/SandhillsConstants';\r\nimport { getBannerAd, gtmPushEvent, repositionCookieBanner, getURLParameter, insertURLParameter, removeURLParameter, chunkArray } from '@Components/Utilities/SandhillsUtility';\r\nimport { loadable } from '@Components/Utilities/SandhillsLoadable';\r\nimport FacetedSearchMobileMenu from '@Components/Shared/FacetedSearch/FacetedSearchMobileMenu';\r\nimport ListingControlBar from '@Components/Listings/ListingControlBar';\r\nimport Paging from '@Components/MuiWrappers/Paging';\r\nimport TranslationText from '@Components/Utilities/TranslationText';\r\nimport translator from '@Components/Utilities/Translator';\r\nimport ComplexBreadcrumb from '@Components/Shared/ComplexBreadcrumb';\r\nimport DoubleClickAd from '@Components/Shared/DoubleClick/DoubleClickAd';\r\nimport PartsListListing from '@Components/Parts/PartsListListing';\r\nimport PartsGridListing from '@Components/Parts/PartsGridListing';\r\nimport FacetedSearch from '@Components/Shared/FacetedSearch/FacetedSearch';\r\nimport ready from 'document-ready';\r\nimport { useWindowSize } from '@Components/Utilities/WindowSize';\r\nimport atoms from '@Components/Utilities/SandhillsAtoms';\r\nimport { useRecoilValue } from 'recoil';\r\nimport AdditionalPageInformation from '@Components/Listings/AdditionalPageInformation';\r\n\r\nconst EmailModal = loadable(() => import('@Components/Shared/Modals/EmailModal'), true);\r\nconst DealerHeaderInfo = loadable(() => import('@Components/Shared/DealerHeaderInfo'));\r\n\r\nconst PartsListView = (props) => {\r\n\r\n const constants = { searchType: 'SearchType', page: 'page', format: 'Format', keywords: 'Keywords', manufacturer: 'Manufacturer', model: 'Model' };\r\n const topBannerAd = getBannerAd(props.DoubleClickAdCollection?.AdUnits, bannerAdPositions.Top);\r\n const middleBannerAd = getBannerAd(props.DoubleClickAdCollection?.AdUnits, bannerAdPositions.Middle);\r\n const bottomBannerAd = getBannerAd(props.DoubleClickAdCollection?.AdUnits, bannerAdPositions.Bottom);\r\n const middleAdIndex = props.PartsListings.length >= props.DoubleClickAdShowAfterNumberOfListings ? props.DoubleClickAdShowAfterNumberOfListings - 1 : props.PartsListings.length - 1;\r\n const bottomAdIndex = props.DoubleClickAdShowSecondAdAfterNumberOfListings - 1;\r\n const [partNumber, setPartNumber] = useState(props.PartNumber);\r\n const [searchFields, setSearchFields] = useState(props.SearchFields);\r\n const [searchInProgress, setSearchInProgress] = useState(false);\r\n const [showMobileFilters, setShowMobileFilters] = useState(false);\r\n const [mobileSearch, setMobileSearch] = useState(false);\r\n const [samModel, setSamModel] = useState(props.SAMModel);\r\n const [showEmailModal, setShowEmailModal] = useState(false);\r\n const [loadImagesForPrint, setLoadImagesForPrint] = useState(false);\r\n const [selectedInquiry, setSelectedInquiry] = useState('');\r\n const [selectedContactType, setSelectedContactType] = useState(contactType.Retail);\r\n const [returnFocusRef, setReturnFocusRef] = useState({});\r\n const [showShareButtons, setShowShareButtons] = useState(false);\r\n const [newView, setNewView] = useState(props.UseNewListPageDesign);\r\n const windowSize = useWindowSize();\r\n const currentSite = useRecoilValue(atoms.currentWebsite);\r\n const [listingPictureMap, setListingPictureMap] = useState({});\r\n\r\n useEffect(() => {\r\n const cookieBannerResize = () => {\r\n repositionCookieBanner('mobile-option-bar', 786);\r\n };\r\n\r\n const chunkParts = () => {\r\n const width = window.innerWidth;\r\n let chunkSize;\r\n if (width > 1250) {\r\n chunkSize = 4;\r\n } else if (width > 1000) {\r\n chunkSize = 2;\r\n } else {\r\n chunkSize = 1;\r\n }\r\n\r\n const chunks = [];\r\n for (let i = 0; i < props.PartsListings.length; i += chunkSize) {\r\n chunks.push(props.PartsListings.slice(i, i + chunkSize));\r\n }\r\n\r\n const noImageRow = chunks.map((chunk) => {\r\n const hasImage = chunk.some((part) => part.MediaModel.Media.length > 0);\r\n\r\n return !hasImage;\r\n });\r\n\r\n const mappedListings = props.PartsListings.map((part, index) => {\r\n const chunkIndex = Math.floor(index / (window.innerWidth > 1250 ? 4 : window.innerWidth > 1000 ? 2 : 1));\r\n return noImageRow[chunkIndex];\r\n });\r\n\r\n setListingPictureMap(mappedListings);\r\n }\r\n\r\n cookieBannerResize();\r\n chunkParts();\r\n window.addEventListener('resize', cookieBannerResize);\r\n window.addEventListener('resize', chunkParts);\r\n\r\n return () => {\r\n window.removeEventListener('resize', cookieBannerResize);\r\n window.removeEventListener('resize', chunkParts);\r\n };\r\n }, []);\r\n\r\n const toggleMobileFilter = (skipSearch) => {\r\n let newShowMobileFilters = !showMobileFilters;\r\n setShowMobileFilters(newShowMobileFilters);\r\n if (newShowMobileFilters) {\r\n setMobileSearch(window.innerWidth <= 785);\r\n } else {\r\n setMobileSearch(false);\r\n if (!skipSearch) {\r\n runFacetedSearch(false);\r\n }\r\n }\r\n };\r\n\r\n const clearAll = () => {\r\n window.scrollTo(0, 0);\r\n window.location = props.ClearAllUrl;\r\n };\r\n\r\n const clearFacet = (fieldName, option) => {\r\n let searchUrl = buildUrl(false, []);\r\n\r\n //copy field name so we don't mutate \r\n let queryStringParamName = (' ' + fieldName).slice(1);\r\n let selectedField = props.SelectedFacets.filter(f => f.FieldName == fieldName)[0];\r\n\r\n if (option && option.IsGroup && (selectedField.ParentNameForSearch && selectedField.ParentNameForSearch != '')) {\r\n queryStringParamName = selectedField.ParentNameForSearch;\r\n }\r\n\r\n if (option) {\r\n let qsValues = getURLParameter(searchUrl, queryStringParamName).split('|');\r\n searchUrl = removeURLParameter(searchUrl, queryStringParamName);\r\n\r\n let filter = qsValues;\r\n let index = qsValues.indexOf(option.Value ? option.Value : option);\r\n if (index > -1) {\r\n filter.splice(index, 1);\r\n }\r\n\r\n if (filter.length > 0) {\r\n searchUrl = insertURLParameter(searchUrl, queryStringParamName, filter.join('|'));\r\n }\r\n } else {\r\n searchUrl = removeURLParameter(searchUrl, queryStringParamName);\r\n }\r\n\r\n if (fieldName.toLowerCase() == 'partnumber') {\r\n searchUrl = removeURLParameter(searchUrl, constants.format);\r\n searchUrl = removeURLParameter(searchUrl, constants.searchType);\r\n }\r\n\r\n if (fieldName.toLowerCase() == constants.manufacturer.toLocaleLowerCase()) {\r\n searchUrl = removeURLParameter(searchUrl, constants.model);\r\n }\r\n\r\n window.location = searchUrl;\r\n };\r\n\r\n const updatePendingChangesForSearch = (pendingChanges, latestFieldValue) => {\r\n let newField = true;\r\n for (var i = 0; i < pendingChanges.length; i++) {\r\n if (latestFieldValue.fieldName === pendingChanges[i].fieldName) {\r\n pendingChanges[i].value = latestFieldValue.value;\r\n newField = false;\r\n break;\r\n }\r\n }\r\n\r\n if (newField) {\r\n pendingChanges.push(latestFieldValue);\r\n }\r\n\r\n let fields = [...searchFields];\r\n for (var j = 0; j < fields.length; j++) {\r\n let field = fields[j];\r\n\r\n if (latestFieldValue.fieldName === field.FieldName && field.Type === 'Range') {\r\n // Update the range field in state so it doesn't do a weird re-render with the old value\r\n let splitValue = latestFieldValue.value.split('*');\r\n field.SelectedLowerBound = splitValue[0];\r\n field.SelectedUpperBound = splitValue[1];\r\n setSearchFields(fields);\r\n break;\r\n }\r\n }\r\n\r\n return pendingChanges;\r\n };\r\n\r\n const runFacetedSearch = (keepPage, latestFieldValue) => {\r\n setSearchInProgress(true);\r\n let pendingChanges = [];\r\n if (latestFieldValue) {\r\n if (Array.isArray(latestFieldValue)) {\r\n for (var i = 0; i < latestFieldValue.length; i++) {\r\n pendingChanges = updatePendingChangesForSearch(pendingChanges, latestFieldValue[i]);\r\n }\r\n } else {\r\n pendingChanges = updatePendingChangesForSearch(pendingChanges, latestFieldValue);\r\n }\r\n }\r\n\r\n if (window.innerWidth <= 785) {\r\n setSearchInProgress(false);\r\n window.scrollTo(0, 0);\r\n }\r\n\r\n let searchUrl = buildUrl(keepPage, pendingChanges);\r\n if (pendingChanges.length > 0) {\r\n window.location = searchUrl;\r\n } else {\r\n setSearchInProgress(false);\r\n }\r\n };\r\n\r\n const buildUrl = (keepPage, pendingChanges) => {\r\n let searchUrl = props.SearchBaseUrl;\r\n pendingChanges.forEach((field) => {\r\n if (field.value) {\r\n searchUrl = insertURLParameter(searchUrl, field.fieldName, field.value);\r\n if (field.searchType) {\r\n searchUrl = insertURLParameter(searchUrl, constants.searchType, field.searchType);\r\n }\r\n } else {\r\n searchUrl = removeURLParameter(searchUrl, field.fieldName);\r\n if (field.searchType) {\r\n searchUrl = removeURLParameter(searchUrl, constants.searchType);\r\n }\r\n }\r\n\r\n if (field.fieldName.toLowerCase() == 'partnumber') {\r\n searchUrl = removeURLParameter(searchUrl, constants.format);\r\n }\r\n });\r\n\r\n searchUrl = removeURLParameter(searchUrl, constants.page);\r\n if (keepPage === true) {\r\n searchUrl = insertURLParameter(searchUrl, constants.page, props.PaginationModel.CurrentPage);\r\n }\r\n\r\n return searchUrl;\r\n };\r\n\r\n const performSearch = (type, pageNumber) => {\r\n setSearchInProgress(true);\r\n\r\n let searchUrl = props.SearchBaseUrl;\r\n if (partNumber) {\r\n searchUrl = insertURLParameter(searchUrl, 'PartNumber', partNumber);\r\n }\r\n\r\n if (type) {\r\n searchUrl = insertURLParameter(searchUrl, 'SearchType', type);\r\n }\r\n\r\n if (pageNumber && pageNumber > 1) {\r\n searchUrl = insertURLParameter(searchUrl, 'Page', pageNumber);\r\n }\r\n\r\n if (props.LocationID) {\r\n searchUrl = insertURLParameter(searchUrl, 'LocationID', props.LocationID);\r\n }\r\n\r\n if (props.DSCompanyID) {\r\n searchUrl = insertURLParameter(searchUrl, 'DSCompanyID', props.DSCompanyID);\r\n }\r\n\r\n if (props.OwnerCRMID) {\r\n searchUrl = insertURLParameter(searchUrl, 'OwnerCRMID', props.OwnerCRMID);\r\n }\r\n\r\n if (props.PartsSource) {\r\n searchUrl = insertURLParameter(searchUrl, 'PartsSource', props.PartsSource);\r\n }\r\n\r\n window.location = searchUrl;\r\n };\r\n\r\n const handleSubmit = (e) => {\r\n if (e) {\r\n e.preventDefault();\r\n }\r\n\r\n performSearch(props.SearchType, 1);\r\n };\r\n\r\n const handlePageNumberChange = (page) => {\r\n performSearch(props.SearchType, page)\r\n };\r\n\r\n const onEmailModalToggle = () => {\r\n if (returnFocusRef) {\r\n setTimeout(() => {\r\n returnFocusRef.focus();\r\n }, 150);\r\n }\r\n setShowEmailModal(showEmailModal => !showEmailModal);\r\n }\r\n\r\n const openEmailModal = (inquiry, contact, modalData) => {\r\n contact = contact || contactType.Retail;\r\n modalData = modalData || {};\r\n\r\n if (inquiry == inquiryType.EmailThis) {\r\n modalData.ModalTitle = translator.translate('sandhillssystem.share').toString();\r\n\r\n if (windowSize.isMobile && navigator.share) {\r\n navigator.share({\r\n title: document.title,\r\n url: window.location.href\r\n })\r\n .then(() => gtmPushEvent(gtmEventType.MobileShare))\r\n .catch(() => setShowShareButtons(true));\r\n return;\r\n } else {\r\n setShowShareButtons(true);\r\n }\r\n } else {\r\n setShowShareButtons(false);\r\n }\r\n\r\n setReturnFocusRef(modalData.Ref);\r\n setSelectedInquiry(inquiry);\r\n setSelectedContactType(contact);\r\n setShowEmailModal(showEmailModal => !showEmailModal);\r\n setSamModel({ ...samModel, ...modalData });\r\n };\r\n\r\n const onPrint = () => {\r\n gtmPushEvent(gtmEventType.printListDetail);\r\n setLoadImagesForPrint(true);\r\n window.print();\r\n };\r\n\r\n const renderBannerAd = (index) => {\r\n if (props.DoubleClickAdCollection?.AdUnits?.length > 0) {\r\n if (props.UseAlternateAdPlacement) {\r\n if (index === middleAdIndex && middleBannerAd) {\r\n return (\r\n \r\n );\r\n } else if (index === bottomAdIndex && bottomBannerAd) {\r\n return (\r\n \r\n );\r\n }\r\n } else if (index === middleAdIndex && bottomBannerAd) {\r\n return (\r\n \r\n );\r\n }\r\n }\r\n\r\n return (<>>);\r\n };\r\n\r\n return (\r\n <>\r\n \r\n
\r\n \r\n {!props.IsHostedSite &&
}\r\n {(!props.IsHostedSite && props.InventoryHeader) && !props.InventoryHeader?.EventID && !props.IsBothEventTypesDealerPage &&\r\n
\r\n
\r\n {props.InventoryHeader.InventoryUrls && props.InventoryHeader.InventoryUrls.length > 0 && props.InventoryHeader.InventoryUrls.map(item =>\r\n
{item.DisplayText})}\r\n
\r\n
}\r\n
\r\n
\r\n \r\n
\r\n {!props.ShowLandingPage &&
}\r\n
\r\n {props.ShowPrintThis &&\r\n }\r\n {props.ShowEmailThis &&\r\n }\r\n
\r\n
\r\n
\r\n {topBannerAd && (!props.UseNewListPageDesign || props.ShowLandingPage) &&\r\n }\r\n \r\n {props.UseNewListPageDesign && !windowSize.isNotMobile && !props.ShowLandingPage &&\r\n
\r\n
{ if (e.key === 'Enter') setNewView(!newView) }} id='list-toggle' aria-label={translator.translate('sandhills.listview')} title={translator.translate('sandhills.listview')} className={newView ? 'sort' : 'sort active'} onClick={() => { setNewView(!newView) }}>\r\n \r\n
\r\n
{ if (e.key === 'Enter') setNewView(!newView) }} id='grid-toggle' aria-label={translator.translate('sandhills.thumbnailview')} title={translator.translate('sandhills.thumbnailview')} className={newView ? 'sort active' : 'sort'} onClick={() => { setNewView(!newView) }}>\r\n \r\n
\r\n
\r\n }\r\n
\r\n \r\n {!props.ShowLandingPage &&\r\n }\r\n
\r\n \r\n {props.ShowLandingPage &&\r\n
}\r\n {!props.ShowLandingPage &&\r\n <>\r\n {props.UseNewListPageDesign && windowSize.isNotMobile &&\r\n
\r\n
\r\n
{ if (e.key === 'Enter') setNewView(!newView) }} id='list-toggle' aria-label={translator.translate('sandhills.listview')} title={translator.translate('sandhills.listview')} className={newView ? 'sort' : 'sort active'} onClick={() => { setNewView(!newView) }}>\r\n \r\n
\r\n
{ if (e.key === 'Enter') setNewView(!newView) }} id='grid-toggle' aria-label={translator.translate('sandhills.thumbnailview')} title={translator.translate('sandhills.thumbnailview')} className={newView ? 'sort active' : 'sort'} onClick={() => { setNewView(!newView) }}>\r\n \r\n
\r\n
\r\n
\r\n }\r\n {props.InventoryHeader &&\r\n
\r\n }\r\n {props.ErrorMessage &&
{props.ErrorMessage}
}\r\n
\r\n {topBannerAd && props.UseNewListPageDesign &&\r\n
\r\n }\r\n {(props.UseNewListPageDesign && newView) ?\r\n <>\r\n {props.PartsListings.map((item, index) =>\r\n\r\n
\r\n {item.GroupBannerText &&\r\n {item.GroupBannerText}
}\r\n \r\n {renderBannerAd(index)}\r\n )}\r\n >\r\n :\r\n <>\r\n {props.PartsListings.map((item, index) =>\r\n\r\n
\r\n {item.GroupBannerText &&\r\n {item.GroupBannerText}
}\r\n \r\n {renderBannerAd(index)}\r\n )}\r\n >\r\n }\r\n
\r\n {props.PaginationModel.TotalPages > 1 &&\r\n
}\r\n >}\r\n
\r\n {props.ShowLandingPage && props.TopManufacturers.length > 0 &&\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n {splitArrayEvenly(props.TopManufacturers, 4).map(group =>\r\n
\r\n {group.map(link =>\r\n
)}\r\n
)}\r\n
\r\n
\r\n
\r\n {props.ViewAllManufacturers &&\r\n
}\r\n
\r\n
}\r\n {showEmailModal &&\r\n }\r\n \r\n {\r\n (!currentSite.IsBetaSite && !props.UseNewListPageDesign) &&\r\n
\r\n }\r\n {searchInProgress &&\r\n
}\r\n {(currentSite.IsMobileAppContext || (windowSize.isMobile && props.UseBottomMobilePadding)) &&\r\n
\r\n }\r\n
\r\n {\r\n (currentSite.IsBetaSite || props.UseNewListPageDesign) && !props.ShowLandingPage &&\r\n \r\n }\r\n >\r\n );\r\n};\r\n\r\nexport default PartsListView;\r\nglobal.PartsListView = PartsListView;","'use strict';\nvar bind = require('../internals/function-bind-context');\nvar toObject = require('../internals/to-object');\nvar callWithSafeIterationClosing = require('../internals/call-with-safe-iteration-closing');\nvar isArrayIteratorMethod = require('../internals/is-array-iterator-method');\nvar toLength = require('../internals/to-length');\nvar createProperty = require('../internals/create-property');\nvar getIteratorMethod = require('../internals/get-iterator-method');\n\n// `Array.from` method implementation\n// https://tc39.es/ecma262/#sec-array.from\nmodule.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {\n var O = toObject(arrayLike);\n var C = typeof this == 'function' ? this : Array;\n var argumentsLength = arguments.length;\n var mapfn = argumentsLength > 1 ? arguments[1] : undefined;\n var mapping = mapfn !== undefined;\n var iteratorMethod = getIteratorMethod(O);\n var index = 0;\n var length, result, step, iterator, next, value;\n if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined, 2);\n // if the target is not iterable or it's an array with the default iterator - use a simple case\n if (iteratorMethod != undefined && !(C == Array && isArrayIteratorMethod(iteratorMethod))) {\n iterator = iteratorMethod.call(O);\n next = iterator.next;\n result = new C();\n for (;!(step = next.call(iterator)).done; index++) {\n value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;\n createProperty(result, index, value);\n }\n } else {\n length = toLength(O.length);\n result = new C(length);\n for (;length > index; index++) {\n value = mapping ? mapfn(O[index], index) : O[index];\n createProperty(result, index, value);\n }\n }\n result.length = index;\n return result;\n};\n","var anObject = require('../internals/an-object');\nvar iteratorClose = require('../internals/iterator-close');\n\n// call something on iterator step with safe closing on error\nmodule.exports = function (iterator, fn, value, ENTRIES) {\n try {\n return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);\n // 7.4.6 IteratorClose(iterator, completion)\n } catch (error) {\n iteratorClose(iterator);\n throw error;\n }\n};\n","'use strict';\nvar toPrimitive = require('../internals/to-primitive');\nvar definePropertyModule = require('../internals/object-define-property');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\n\nmodule.exports = function (object, key, value) {\n var propertyKey = toPrimitive(key);\n if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));\n else object[propertyKey] = value;\n};\n","var anObject = require('../internals/an-object');\nvar getIteratorMethod = require('../internals/get-iterator-method');\n\nmodule.exports = function (it) {\n var iteratorMethod = getIteratorMethod(it);\n if (typeof iteratorMethod != 'function') {\n throw TypeError(String(it) + ' is not iterable');\n } return anObject(iteratorMethod.call(it));\n};\n","var fails = require('../internals/fails');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar IS_PURE = require('../internals/is-pure');\n\nvar ITERATOR = wellKnownSymbol('iterator');\n\nmodule.exports = !fails(function () {\n var url = new URL('b?a=1&b=2&c=3', 'http://a');\n var searchParams = url.searchParams;\n var result = '';\n url.pathname = 'c%20d';\n searchParams.forEach(function (value, key) {\n searchParams['delete']('b');\n result += key + value;\n });\n return (IS_PURE && !url.toJSON)\n || !searchParams.sort\n || url.href !== 'http://a/c%20d?a=1&c=3'\n || searchParams.get('c') !== '3'\n || String(new URLSearchParams('?a=1')) !== 'a=1'\n || !searchParams[ITERATOR]\n // throws in Edge\n || new URL('https://a@b').username !== 'a'\n || new URLSearchParams(new URLSearchParams('a=b')).get('a') !== 'b'\n // not punycoded in Edge\n || new URL('http://тест').host !== 'xn--e1aybc'\n // not escaped in Chrome 62-\n || new URL('http://a#б').hash !== '#%D0%B1'\n // fails in Chrome 66-\n || result !== 'a1c3'\n // throws in Safari\n || new URL('http://x', undefined).host !== 'x';\n});\n","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar fails = require('../internals/fails');\nvar objectKeys = require('../internals/object-keys');\nvar getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols');\nvar propertyIsEnumerableModule = require('../internals/object-property-is-enumerable');\nvar toObject = require('../internals/to-object');\nvar IndexedObject = require('../internals/indexed-object');\n\n// eslint-disable-next-line es/no-object-assign -- safe\nvar $assign = Object.assign;\n// eslint-disable-next-line es/no-object-defineproperty -- required for testing\nvar defineProperty = Object.defineProperty;\n\n// `Object.assign` method\n// https://tc39.es/ecma262/#sec-object.assign\nmodule.exports = !$assign || fails(function () {\n // should have correct order of operations (Edge bug)\n if (DESCRIPTORS && $assign({ b: 1 }, $assign(defineProperty({}, 'a', {\n enumerable: true,\n get: function () {\n defineProperty(this, 'b', {\n value: 3,\n enumerable: false\n });\n }\n }), { b: 2 })).b !== 1) return true;\n // should work with symbols and should have deterministic property order (V8 bug)\n var A = {};\n var B = {};\n // eslint-disable-next-line es/no-symbol -- safe\n var symbol = Symbol();\n var alphabet = 'abcdefghijklmnopqrst';\n A[symbol] = 7;\n alphabet.split('').forEach(function (chr) { B[chr] = chr; });\n return $assign({}, A)[symbol] != 7 || objectKeys($assign({}, B)).join('') != alphabet;\n}) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`\n var T = toObject(target);\n var argumentsLength = arguments.length;\n var index = 1;\n var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;\n var propertyIsEnumerable = propertyIsEnumerableModule.f;\n while (argumentsLength > index) {\n var S = IndexedObject(arguments[index++]);\n var keys = getOwnPropertySymbols ? objectKeys(S).concat(getOwnPropertySymbols(S)) : objectKeys(S);\n var length = keys.length;\n var j = 0;\n var key;\n while (length > j) {\n key = keys[j++];\n if (!DESCRIPTORS || propertyIsEnumerable.call(S, key)) T[key] = S[key];\n }\n } return T;\n} : $assign;\n","'use strict';\n// based on https://github.com/bestiejs/punycode.js/blob/master/punycode.js\nvar maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1\nvar base = 36;\nvar tMin = 1;\nvar tMax = 26;\nvar skew = 38;\nvar damp = 700;\nvar initialBias = 72;\nvar initialN = 128; // 0x80\nvar delimiter = '-'; // '\\x2D'\nvar regexNonASCII = /[^\\0-\\u007E]/; // non-ASCII chars\nvar regexSeparators = /[.\\u3002\\uFF0E\\uFF61]/g; // RFC 3490 separators\nvar OVERFLOW_ERROR = 'Overflow: input needs wider integers to process';\nvar baseMinusTMin = base - tMin;\nvar floor = Math.floor;\nvar stringFromCharCode = String.fromCharCode;\n\n/**\n * Creates an array containing the numeric code points of each Unicode\n * character in the string. While JavaScript uses UCS-2 internally,\n * this function will convert a pair of surrogate halves (each of which\n * UCS-2 exposes as separate characters) into a single code point,\n * matching UTF-16.\n */\nvar ucs2decode = function (string) {\n var output = [];\n var counter = 0;\n var length = string.length;\n while (counter < length) {\n var value = string.charCodeAt(counter++);\n if (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n // It's a high surrogate, and there is a next character.\n var extra = string.charCodeAt(counter++);\n if ((extra & 0xFC00) == 0xDC00) { // Low surrogate.\n output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n } else {\n // It's an unmatched surrogate; only append this code unit, in case the\n // next code unit is the high surrogate of a surrogate pair.\n output.push(value);\n counter--;\n }\n } else {\n output.push(value);\n }\n }\n return output;\n};\n\n/**\n * Converts a digit/integer into a basic code point.\n */\nvar digitToBasic = function (digit) {\n // 0..25 map to ASCII a..z or A..Z\n // 26..35 map to ASCII 0..9\n return digit + 22 + 75 * (digit < 26);\n};\n\n/**\n * Bias adaptation function as per section 3.4 of RFC 3492.\n * https://tools.ietf.org/html/rfc3492#section-3.4\n */\nvar adapt = function (delta, numPoints, firstTime) {\n var k = 0;\n delta = firstTime ? floor(delta / damp) : delta >> 1;\n delta += floor(delta / numPoints);\n for (; delta > baseMinusTMin * tMax >> 1; k += base) {\n delta = floor(delta / baseMinusTMin);\n }\n return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n};\n\n/**\n * Converts a string of Unicode symbols (e.g. a domain name label) to a\n * Punycode string of ASCII-only symbols.\n */\n// eslint-disable-next-line max-statements -- TODO\nvar encode = function (input) {\n var output = [];\n\n // Convert the input in UCS-2 to an array of Unicode code points.\n input = ucs2decode(input);\n\n // Cache the length.\n var inputLength = input.length;\n\n // Initialize the state.\n var n = initialN;\n var delta = 0;\n var bias = initialBias;\n var i, currentValue;\n\n // Handle the basic code points.\n for (i = 0; i < input.length; i++) {\n currentValue = input[i];\n if (currentValue < 0x80) {\n output.push(stringFromCharCode(currentValue));\n }\n }\n\n var basicLength = output.length; // number of basic code points.\n var handledCPCount = basicLength; // number of code points that have been handled;\n\n // Finish the basic string with a delimiter unless it's empty.\n if (basicLength) {\n output.push(delimiter);\n }\n\n // Main encoding loop:\n while (handledCPCount < inputLength) {\n // All non-basic code points < n have been handled already. Find the next larger one:\n var m = maxInt;\n for (i = 0; i < input.length; i++) {\n currentValue = input[i];\n if (currentValue >= n && currentValue < m) {\n m = currentValue;\n }\n }\n\n // Increase `delta` enough to advance the decoder's state to , but guard against overflow.\n var handledCPCountPlusOne = handledCPCount + 1;\n if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n throw RangeError(OVERFLOW_ERROR);\n }\n\n delta += (m - n) * handledCPCountPlusOne;\n n = m;\n\n for (i = 0; i < input.length; i++) {\n currentValue = input[i];\n if (currentValue < n && ++delta > maxInt) {\n throw RangeError(OVERFLOW_ERROR);\n }\n if (currentValue == n) {\n // Represent delta as a generalized variable-length integer.\n var q = delta;\n for (var k = base; /* no condition */; k += base) {\n var t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n if (q < t) break;\n var qMinusT = q - t;\n var baseMinusT = base - t;\n output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT)));\n q = floor(qMinusT / baseMinusT);\n }\n\n output.push(stringFromCharCode(digitToBasic(q)));\n bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);\n delta = 0;\n ++handledCPCount;\n }\n }\n\n ++delta;\n ++n;\n }\n return output.join('');\n};\n\nmodule.exports = function (input) {\n var encoded = [];\n var labels = input.toLowerCase().replace(regexSeparators, '\\u002E').split('.');\n var i, label;\n for (i = 0; i < labels.length; i++) {\n label = labels[i];\n encoded.push(regexNonASCII.test(label) ? 'xn--' + encode(label) : label);\n }\n return encoded.join('.');\n};\n","'use strict';\nvar charAt = require('../internals/string-multibyte').charAt;\nvar InternalStateModule = require('../internals/internal-state');\nvar defineIterator = require('../internals/define-iterator');\n\nvar STRING_ITERATOR = 'String Iterator';\nvar setInternalState = InternalStateModule.set;\nvar getInternalState = InternalStateModule.getterFor(STRING_ITERATOR);\n\n// `String.prototype[@@iterator]` method\n// https://tc39.es/ecma262/#sec-string.prototype-@@iterator\ndefineIterator(String, 'String', function (iterated) {\n setInternalState(this, {\n type: STRING_ITERATOR,\n string: String(iterated),\n index: 0\n });\n// `%StringIteratorPrototype%.next` method\n// https://tc39.es/ecma262/#sec-%stringiteratorprototype%.next\n}, function next() {\n var state = getInternalState(this);\n var string = state.string;\n var index = state.index;\n var point;\n if (index >= string.length) return { value: undefined, done: true };\n point = charAt(string, index);\n state.index += point.length;\n return { value: point, done: false };\n});\n","'use strict';\n// TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env`\nrequire('../modules/es.array.iterator');\nvar $ = require('../internals/export');\nvar getBuiltIn = require('../internals/get-built-in');\nvar USE_NATIVE_URL = require('../internals/native-url');\nvar redefine = require('../internals/redefine');\nvar redefineAll = require('../internals/redefine-all');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar createIteratorConstructor = require('../internals/create-iterator-constructor');\nvar InternalStateModule = require('../internals/internal-state');\nvar anInstance = require('../internals/an-instance');\nvar hasOwn = require('../internals/has');\nvar bind = require('../internals/function-bind-context');\nvar classof = require('../internals/classof');\nvar anObject = require('../internals/an-object');\nvar isObject = require('../internals/is-object');\nvar create = require('../internals/object-create');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar getIterator = require('../internals/get-iterator');\nvar getIteratorMethod = require('../internals/get-iterator-method');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar $fetch = getBuiltIn('fetch');\nvar Headers = getBuiltIn('Headers');\nvar ITERATOR = wellKnownSymbol('iterator');\nvar URL_SEARCH_PARAMS = 'URLSearchParams';\nvar URL_SEARCH_PARAMS_ITERATOR = URL_SEARCH_PARAMS + 'Iterator';\nvar setInternalState = InternalStateModule.set;\nvar getInternalParamsState = InternalStateModule.getterFor(URL_SEARCH_PARAMS);\nvar getInternalIteratorState = InternalStateModule.getterFor(URL_SEARCH_PARAMS_ITERATOR);\n\nvar plus = /\\+/g;\nvar sequences = Array(4);\n\nvar percentSequence = function (bytes) {\n return sequences[bytes - 1] || (sequences[bytes - 1] = RegExp('((?:%[\\\\da-f]{2}){' + bytes + '})', 'gi'));\n};\n\nvar percentDecode = function (sequence) {\n try {\n return decodeURIComponent(sequence);\n } catch (error) {\n return sequence;\n }\n};\n\nvar deserialize = function (it) {\n var result = it.replace(plus, ' ');\n var bytes = 4;\n try {\n return decodeURIComponent(result);\n } catch (error) {\n while (bytes) {\n result = result.replace(percentSequence(bytes--), percentDecode);\n }\n return result;\n }\n};\n\nvar find = /[!'()~]|%20/g;\n\nvar replace = {\n '!': '%21',\n \"'\": '%27',\n '(': '%28',\n ')': '%29',\n '~': '%7E',\n '%20': '+'\n};\n\nvar replacer = function (match) {\n return replace[match];\n};\n\nvar serialize = function (it) {\n return encodeURIComponent(it).replace(find, replacer);\n};\n\nvar parseSearchParams = function (result, query) {\n if (query) {\n var attributes = query.split('&');\n var index = 0;\n var attribute, entry;\n while (index < attributes.length) {\n attribute = attributes[index++];\n if (attribute.length) {\n entry = attribute.split('=');\n result.push({\n key: deserialize(entry.shift()),\n value: deserialize(entry.join('='))\n });\n }\n }\n }\n};\n\nvar updateSearchParams = function (query) {\n this.entries.length = 0;\n parseSearchParams(this.entries, query);\n};\n\nvar validateArgumentsLength = function (passed, required) {\n if (passed < required) throw TypeError('Not enough arguments');\n};\n\nvar URLSearchParamsIterator = createIteratorConstructor(function Iterator(params, kind) {\n setInternalState(this, {\n type: URL_SEARCH_PARAMS_ITERATOR,\n iterator: getIterator(getInternalParamsState(params).entries),\n kind: kind\n });\n}, 'Iterator', function next() {\n var state = getInternalIteratorState(this);\n var kind = state.kind;\n var step = state.iterator.next();\n var entry = step.value;\n if (!step.done) {\n step.value = kind === 'keys' ? entry.key : kind === 'values' ? entry.value : [entry.key, entry.value];\n } return step;\n});\n\n// `URLSearchParams` constructor\n// https://url.spec.whatwg.org/#interface-urlsearchparams\nvar URLSearchParamsConstructor = function URLSearchParams(/* init */) {\n anInstance(this, URLSearchParamsConstructor, URL_SEARCH_PARAMS);\n var init = arguments.length > 0 ? arguments[0] : undefined;\n var that = this;\n var entries = [];\n var iteratorMethod, iterator, next, step, entryIterator, entryNext, first, second, key;\n\n setInternalState(that, {\n type: URL_SEARCH_PARAMS,\n entries: entries,\n updateURL: function () { /* empty */ },\n updateSearchParams: updateSearchParams\n });\n\n if (init !== undefined) {\n if (isObject(init)) {\n iteratorMethod = getIteratorMethod(init);\n if (typeof iteratorMethod === 'function') {\n iterator = iteratorMethod.call(init);\n next = iterator.next;\n while (!(step = next.call(iterator)).done) {\n entryIterator = getIterator(anObject(step.value));\n entryNext = entryIterator.next;\n if (\n (first = entryNext.call(entryIterator)).done ||\n (second = entryNext.call(entryIterator)).done ||\n !entryNext.call(entryIterator).done\n ) throw TypeError('Expected sequence with length 2');\n entries.push({ key: first.value + '', value: second.value + '' });\n }\n } else for (key in init) if (hasOwn(init, key)) entries.push({ key: key, value: init[key] + '' });\n } else {\n parseSearchParams(entries, typeof init === 'string' ? init.charAt(0) === '?' ? init.slice(1) : init : init + '');\n }\n }\n};\n\nvar URLSearchParamsPrototype = URLSearchParamsConstructor.prototype;\n\nredefineAll(URLSearchParamsPrototype, {\n // `URLSearchParams.prototype.append` method\n // https://url.spec.whatwg.org/#dom-urlsearchparams-append\n append: function append(name, value) {\n validateArgumentsLength(arguments.length, 2);\n var state = getInternalParamsState(this);\n state.entries.push({ key: name + '', value: value + '' });\n state.updateURL();\n },\n // `URLSearchParams.prototype.delete` method\n // https://url.spec.whatwg.org/#dom-urlsearchparams-delete\n 'delete': function (name) {\n validateArgumentsLength(arguments.length, 1);\n var state = getInternalParamsState(this);\n var entries = state.entries;\n var key = name + '';\n var index = 0;\n while (index < entries.length) {\n if (entries[index].key === key) entries.splice(index, 1);\n else index++;\n }\n state.updateURL();\n },\n // `URLSearchParams.prototype.get` method\n // https://url.spec.whatwg.org/#dom-urlsearchparams-get\n get: function get(name) {\n validateArgumentsLength(arguments.length, 1);\n var entries = getInternalParamsState(this).entries;\n var key = name + '';\n var index = 0;\n for (; index < entries.length; index++) {\n if (entries[index].key === key) return entries[index].value;\n }\n return null;\n },\n // `URLSearchParams.prototype.getAll` method\n // https://url.spec.whatwg.org/#dom-urlsearchparams-getall\n getAll: function getAll(name) {\n validateArgumentsLength(arguments.length, 1);\n var entries = getInternalParamsState(this).entries;\n var key = name + '';\n var result = [];\n var index = 0;\n for (; index < entries.length; index++) {\n if (entries[index].key === key) result.push(entries[index].value);\n }\n return result;\n },\n // `URLSearchParams.prototype.has` method\n // https://url.spec.whatwg.org/#dom-urlsearchparams-has\n has: function has(name) {\n validateArgumentsLength(arguments.length, 1);\n var entries = getInternalParamsState(this).entries;\n var key = name + '';\n var index = 0;\n while (index < entries.length) {\n if (entries[index++].key === key) return true;\n }\n return false;\n },\n // `URLSearchParams.prototype.set` method\n // https://url.spec.whatwg.org/#dom-urlsearchparams-set\n set: function set(name, value) {\n validateArgumentsLength(arguments.length, 1);\n var state = getInternalParamsState(this);\n var entries = state.entries;\n var found = false;\n var key = name + '';\n var val = value + '';\n var index = 0;\n var entry;\n for (; index < entries.length; index++) {\n entry = entries[index];\n if (entry.key === key) {\n if (found) entries.splice(index--, 1);\n else {\n found = true;\n entry.value = val;\n }\n }\n }\n if (!found) entries.push({ key: key, value: val });\n state.updateURL();\n },\n // `URLSearchParams.prototype.sort` method\n // https://url.spec.whatwg.org/#dom-urlsearchparams-sort\n sort: function sort() {\n var state = getInternalParamsState(this);\n var entries = state.entries;\n // Array#sort is not stable in some engines\n var slice = entries.slice();\n var entry, entriesIndex, sliceIndex;\n entries.length = 0;\n for (sliceIndex = 0; sliceIndex < slice.length; sliceIndex++) {\n entry = slice[sliceIndex];\n for (entriesIndex = 0; entriesIndex < sliceIndex; entriesIndex++) {\n if (entries[entriesIndex].key > entry.key) {\n entries.splice(entriesIndex, 0, entry);\n break;\n }\n }\n if (entriesIndex === sliceIndex) entries.push(entry);\n }\n state.updateURL();\n },\n // `URLSearchParams.prototype.forEach` method\n forEach: function forEach(callback /* , thisArg */) {\n var entries = getInternalParamsState(this).entries;\n var boundFunction = bind(callback, arguments.length > 1 ? arguments[1] : undefined, 3);\n var index = 0;\n var entry;\n while (index < entries.length) {\n entry = entries[index++];\n boundFunction(entry.value, entry.key, this);\n }\n },\n // `URLSearchParams.prototype.keys` method\n keys: function keys() {\n return new URLSearchParamsIterator(this, 'keys');\n },\n // `URLSearchParams.prototype.values` method\n values: function values() {\n return new URLSearchParamsIterator(this, 'values');\n },\n // `URLSearchParams.prototype.entries` method\n entries: function entries() {\n return new URLSearchParamsIterator(this, 'entries');\n }\n}, { enumerable: true });\n\n// `URLSearchParams.prototype[@@iterator]` method\nredefine(URLSearchParamsPrototype, ITERATOR, URLSearchParamsPrototype.entries);\n\n// `URLSearchParams.prototype.toString` method\n// https://url.spec.whatwg.org/#urlsearchparams-stringification-behavior\nredefine(URLSearchParamsPrototype, 'toString', function toString() {\n var entries = getInternalParamsState(this).entries;\n var result = [];\n var index = 0;\n var entry;\n while (index < entries.length) {\n entry = entries[index++];\n result.push(serialize(entry.key) + '=' + serialize(entry.value));\n } return result.join('&');\n}, { enumerable: true });\n\nsetToStringTag(URLSearchParamsConstructor, URL_SEARCH_PARAMS);\n\n$({ global: true, forced: !USE_NATIVE_URL }, {\n URLSearchParams: URLSearchParamsConstructor\n});\n\n// Wrap `fetch` for correct work with polyfilled `URLSearchParams`\n// https://github.com/zloirock/core-js/issues/674\nif (!USE_NATIVE_URL && typeof $fetch == 'function' && typeof Headers == 'function') {\n $({ global: true, enumerable: true, forced: true }, {\n fetch: function fetch(input /* , init */) {\n var args = [input];\n var init, body, headers;\n if (arguments.length > 1) {\n init = arguments[1];\n if (isObject(init)) {\n body = init.body;\n if (classof(body) === URL_SEARCH_PARAMS) {\n headers = init.headers ? new Headers(init.headers) : new Headers();\n if (!headers.has('content-type')) {\n headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8');\n }\n init = create(init, {\n body: createPropertyDescriptor(0, String(body)),\n headers: createPropertyDescriptor(0, headers)\n });\n }\n }\n args.push(init);\n } return $fetch.apply(this, args);\n }\n });\n}\n\nmodule.exports = {\n URLSearchParams: URLSearchParamsConstructor,\n getState: getInternalParamsState\n};\n","'use strict';\n// TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env`\nrequire('../modules/es.string.iterator');\nvar $ = require('../internals/export');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar USE_NATIVE_URL = require('../internals/native-url');\nvar global = require('../internals/global');\nvar defineProperties = require('../internals/object-define-properties');\nvar redefine = require('../internals/redefine');\nvar anInstance = require('../internals/an-instance');\nvar has = require('../internals/has');\nvar assign = require('../internals/object-assign');\nvar arrayFrom = require('../internals/array-from');\nvar codeAt = require('../internals/string-multibyte').codeAt;\nvar toASCII = require('../internals/string-punycode-to-ascii');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar URLSearchParamsModule = require('../modules/web.url-search-params');\nvar InternalStateModule = require('../internals/internal-state');\n\nvar NativeURL = global.URL;\nvar URLSearchParams = URLSearchParamsModule.URLSearchParams;\nvar getInternalSearchParamsState = URLSearchParamsModule.getState;\nvar setInternalState = InternalStateModule.set;\nvar getInternalURLState = InternalStateModule.getterFor('URL');\nvar floor = Math.floor;\nvar pow = Math.pow;\n\nvar INVALID_AUTHORITY = 'Invalid authority';\nvar INVALID_SCHEME = 'Invalid scheme';\nvar INVALID_HOST = 'Invalid host';\nvar INVALID_PORT = 'Invalid port';\n\nvar ALPHA = /[A-Za-z]/;\n// eslint-disable-next-line regexp/no-obscure-range -- safe\nvar ALPHANUMERIC = /[\\d+-.A-Za-z]/;\nvar DIGIT = /\\d/;\nvar HEX_START = /^(0x|0X)/;\nvar OCT = /^[0-7]+$/;\nvar DEC = /^\\d+$/;\nvar HEX = /^[\\dA-Fa-f]+$/;\n/* eslint-disable no-control-regex -- safe */\nvar FORBIDDEN_HOST_CODE_POINT = /[\\0\\t\\n\\r #%/:?@[\\\\]]/;\nvar FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT = /[\\0\\t\\n\\r #/:?@[\\\\]]/;\nvar LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE = /^[\\u0000-\\u001F ]+|[\\u0000-\\u001F ]+$/g;\nvar TAB_AND_NEW_LINE = /[\\t\\n\\r]/g;\n/* eslint-enable no-control-regex -- safe */\nvar EOF;\n\nvar parseHost = function (url, input) {\n var result, codePoints, index;\n if (input.charAt(0) == '[') {\n if (input.charAt(input.length - 1) != ']') return INVALID_HOST;\n result = parseIPv6(input.slice(1, -1));\n if (!result) return INVALID_HOST;\n url.host = result;\n // opaque host\n } else if (!isSpecial(url)) {\n if (FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT.test(input)) return INVALID_HOST;\n result = '';\n codePoints = arrayFrom(input);\n for (index = 0; index < codePoints.length; index++) {\n result += percentEncode(codePoints[index], C0ControlPercentEncodeSet);\n }\n url.host = result;\n } else {\n input = toASCII(input);\n if (FORBIDDEN_HOST_CODE_POINT.test(input)) return INVALID_HOST;\n result = parseIPv4(input);\n if (result === null) return INVALID_HOST;\n url.host = result;\n }\n};\n\nvar parseIPv4 = function (input) {\n var parts = input.split('.');\n var partsLength, numbers, index, part, radix, number, ipv4;\n if (parts.length && parts[parts.length - 1] == '') {\n parts.pop();\n }\n partsLength = parts.length;\n if (partsLength > 4) return input;\n numbers = [];\n for (index = 0; index < partsLength; index++) {\n part = parts[index];\n if (part == '') return input;\n radix = 10;\n if (part.length > 1 && part.charAt(0) == '0') {\n radix = HEX_START.test(part) ? 16 : 8;\n part = part.slice(radix == 8 ? 1 : 2);\n }\n if (part === '') {\n number = 0;\n } else {\n if (!(radix == 10 ? DEC : radix == 8 ? OCT : HEX).test(part)) return input;\n number = parseInt(part, radix);\n }\n numbers.push(number);\n }\n for (index = 0; index < partsLength; index++) {\n number = numbers[index];\n if (index == partsLength - 1) {\n if (number >= pow(256, 5 - partsLength)) return null;\n } else if (number > 255) return null;\n }\n ipv4 = numbers.pop();\n for (index = 0; index < numbers.length; index++) {\n ipv4 += numbers[index] * pow(256, 3 - index);\n }\n return ipv4;\n};\n\n// eslint-disable-next-line max-statements -- TODO\nvar parseIPv6 = function (input) {\n var address = [0, 0, 0, 0, 0, 0, 0, 0];\n var pieceIndex = 0;\n var compress = null;\n var pointer = 0;\n var value, length, numbersSeen, ipv4Piece, number, swaps, swap;\n\n var char = function () {\n return input.charAt(pointer);\n };\n\n if (char() == ':') {\n if (input.charAt(1) != ':') return;\n pointer += 2;\n pieceIndex++;\n compress = pieceIndex;\n }\n while (char()) {\n if (pieceIndex == 8) return;\n if (char() == ':') {\n if (compress !== null) return;\n pointer++;\n pieceIndex++;\n compress = pieceIndex;\n continue;\n }\n value = length = 0;\n while (length < 4 && HEX.test(char())) {\n value = value * 16 + parseInt(char(), 16);\n pointer++;\n length++;\n }\n if (char() == '.') {\n if (length == 0) return;\n pointer -= length;\n if (pieceIndex > 6) return;\n numbersSeen = 0;\n while (char()) {\n ipv4Piece = null;\n if (numbersSeen > 0) {\n if (char() == '.' && numbersSeen < 4) pointer++;\n else return;\n }\n if (!DIGIT.test(char())) return;\n while (DIGIT.test(char())) {\n number = parseInt(char(), 10);\n if (ipv4Piece === null) ipv4Piece = number;\n else if (ipv4Piece == 0) return;\n else ipv4Piece = ipv4Piece * 10 + number;\n if (ipv4Piece > 255) return;\n pointer++;\n }\n address[pieceIndex] = address[pieceIndex] * 256 + ipv4Piece;\n numbersSeen++;\n if (numbersSeen == 2 || numbersSeen == 4) pieceIndex++;\n }\n if (numbersSeen != 4) return;\n break;\n } else if (char() == ':') {\n pointer++;\n if (!char()) return;\n } else if (char()) return;\n address[pieceIndex++] = value;\n }\n if (compress !== null) {\n swaps = pieceIndex - compress;\n pieceIndex = 7;\n while (pieceIndex != 0 && swaps > 0) {\n swap = address[pieceIndex];\n address[pieceIndex--] = address[compress + swaps - 1];\n address[compress + --swaps] = swap;\n }\n } else if (pieceIndex != 8) return;\n return address;\n};\n\nvar findLongestZeroSequence = function (ipv6) {\n var maxIndex = null;\n var maxLength = 1;\n var currStart = null;\n var currLength = 0;\n var index = 0;\n for (; index < 8; index++) {\n if (ipv6[index] !== 0) {\n if (currLength > maxLength) {\n maxIndex = currStart;\n maxLength = currLength;\n }\n currStart = null;\n currLength = 0;\n } else {\n if (currStart === null) currStart = index;\n ++currLength;\n }\n }\n if (currLength > maxLength) {\n maxIndex = currStart;\n maxLength = currLength;\n }\n return maxIndex;\n};\n\nvar serializeHost = function (host) {\n var result, index, compress, ignore0;\n // ipv4\n if (typeof host == 'number') {\n result = [];\n for (index = 0; index < 4; index++) {\n result.unshift(host % 256);\n host = floor(host / 256);\n } return result.join('.');\n // ipv6\n } else if (typeof host == 'object') {\n result = '';\n compress = findLongestZeroSequence(host);\n for (index = 0; index < 8; index++) {\n if (ignore0 && host[index] === 0) continue;\n if (ignore0) ignore0 = false;\n if (compress === index) {\n result += index ? ':' : '::';\n ignore0 = true;\n } else {\n result += host[index].toString(16);\n if (index < 7) result += ':';\n }\n }\n return '[' + result + ']';\n } return host;\n};\n\nvar C0ControlPercentEncodeSet = {};\nvar fragmentPercentEncodeSet = assign({}, C0ControlPercentEncodeSet, {\n ' ': 1, '\"': 1, '<': 1, '>': 1, '`': 1\n});\nvar pathPercentEncodeSet = assign({}, fragmentPercentEncodeSet, {\n '#': 1, '?': 1, '{': 1, '}': 1\n});\nvar userinfoPercentEncodeSet = assign({}, pathPercentEncodeSet, {\n '/': 1, ':': 1, ';': 1, '=': 1, '@': 1, '[': 1, '\\\\': 1, ']': 1, '^': 1, '|': 1\n});\n\nvar percentEncode = function (char, set) {\n var code = codeAt(char, 0);\n return code > 0x20 && code < 0x7F && !has(set, char) ? char : encodeURIComponent(char);\n};\n\nvar specialSchemes = {\n ftp: 21,\n file: null,\n http: 80,\n https: 443,\n ws: 80,\n wss: 443\n};\n\nvar isSpecial = function (url) {\n return has(specialSchemes, url.scheme);\n};\n\nvar includesCredentials = function (url) {\n return url.username != '' || url.password != '';\n};\n\nvar cannotHaveUsernamePasswordPort = function (url) {\n return !url.host || url.cannotBeABaseURL || url.scheme == 'file';\n};\n\nvar isWindowsDriveLetter = function (string, normalized) {\n var second;\n return string.length == 2 && ALPHA.test(string.charAt(0))\n && ((second = string.charAt(1)) == ':' || (!normalized && second == '|'));\n};\n\nvar startsWithWindowsDriveLetter = function (string) {\n var third;\n return string.length > 1 && isWindowsDriveLetter(string.slice(0, 2)) && (\n string.length == 2 ||\n ((third = string.charAt(2)) === '/' || third === '\\\\' || third === '?' || third === '#')\n );\n};\n\nvar shortenURLsPath = function (url) {\n var path = url.path;\n var pathSize = path.length;\n if (pathSize && (url.scheme != 'file' || pathSize != 1 || !isWindowsDriveLetter(path[0], true))) {\n path.pop();\n }\n};\n\nvar isSingleDot = function (segment) {\n return segment === '.' || segment.toLowerCase() === '%2e';\n};\n\nvar isDoubleDot = function (segment) {\n segment = segment.toLowerCase();\n return segment === '..' || segment === '%2e.' || segment === '.%2e' || segment === '%2e%2e';\n};\n\n// States:\nvar SCHEME_START = {};\nvar SCHEME = {};\nvar NO_SCHEME = {};\nvar SPECIAL_RELATIVE_OR_AUTHORITY = {};\nvar PATH_OR_AUTHORITY = {};\nvar RELATIVE = {};\nvar RELATIVE_SLASH = {};\nvar SPECIAL_AUTHORITY_SLASHES = {};\nvar SPECIAL_AUTHORITY_IGNORE_SLASHES = {};\nvar AUTHORITY = {};\nvar HOST = {};\nvar HOSTNAME = {};\nvar PORT = {};\nvar FILE = {};\nvar FILE_SLASH = {};\nvar FILE_HOST = {};\nvar PATH_START = {};\nvar PATH = {};\nvar CANNOT_BE_A_BASE_URL_PATH = {};\nvar QUERY = {};\nvar FRAGMENT = {};\n\n// eslint-disable-next-line max-statements -- TODO\nvar parseURL = function (url, input, stateOverride, base) {\n var state = stateOverride || SCHEME_START;\n var pointer = 0;\n var buffer = '';\n var seenAt = false;\n var seenBracket = false;\n var seenPasswordToken = false;\n var codePoints, char, bufferCodePoints, failure;\n\n if (!stateOverride) {\n url.scheme = '';\n url.username = '';\n url.password = '';\n url.host = null;\n url.port = null;\n url.path = [];\n url.query = null;\n url.fragment = null;\n url.cannotBeABaseURL = false;\n input = input.replace(LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE, '');\n }\n\n input = input.replace(TAB_AND_NEW_LINE, '');\n\n codePoints = arrayFrom(input);\n\n while (pointer <= codePoints.length) {\n char = codePoints[pointer];\n switch (state) {\n case SCHEME_START:\n if (char && ALPHA.test(char)) {\n buffer += char.toLowerCase();\n state = SCHEME;\n } else if (!stateOverride) {\n state = NO_SCHEME;\n continue;\n } else return INVALID_SCHEME;\n break;\n\n case SCHEME:\n if (char && (ALPHANUMERIC.test(char) || char == '+' || char == '-' || char == '.')) {\n buffer += char.toLowerCase();\n } else if (char == ':') {\n if (stateOverride && (\n (isSpecial(url) != has(specialSchemes, buffer)) ||\n (buffer == 'file' && (includesCredentials(url) || url.port !== null)) ||\n (url.scheme == 'file' && !url.host)\n )) return;\n url.scheme = buffer;\n if (stateOverride) {\n if (isSpecial(url) && specialSchemes[url.scheme] == url.port) url.port = null;\n return;\n }\n buffer = '';\n if (url.scheme == 'file') {\n state = FILE;\n } else if (isSpecial(url) && base && base.scheme == url.scheme) {\n state = SPECIAL_RELATIVE_OR_AUTHORITY;\n } else if (isSpecial(url)) {\n state = SPECIAL_AUTHORITY_SLASHES;\n } else if (codePoints[pointer + 1] == '/') {\n state = PATH_OR_AUTHORITY;\n pointer++;\n } else {\n url.cannotBeABaseURL = true;\n url.path.push('');\n state = CANNOT_BE_A_BASE_URL_PATH;\n }\n } else if (!stateOverride) {\n buffer = '';\n state = NO_SCHEME;\n pointer = 0;\n continue;\n } else return INVALID_SCHEME;\n break;\n\n case NO_SCHEME:\n if (!base || (base.cannotBeABaseURL && char != '#')) return INVALID_SCHEME;\n if (base.cannotBeABaseURL && char == '#') {\n url.scheme = base.scheme;\n url.path = base.path.slice();\n url.query = base.query;\n url.fragment = '';\n url.cannotBeABaseURL = true;\n state = FRAGMENT;\n break;\n }\n state = base.scheme == 'file' ? FILE : RELATIVE;\n continue;\n\n case SPECIAL_RELATIVE_OR_AUTHORITY:\n if (char == '/' && codePoints[pointer + 1] == '/') {\n state = SPECIAL_AUTHORITY_IGNORE_SLASHES;\n pointer++;\n } else {\n state = RELATIVE;\n continue;\n } break;\n\n case PATH_OR_AUTHORITY:\n if (char == '/') {\n state = AUTHORITY;\n break;\n } else {\n state = PATH;\n continue;\n }\n\n case RELATIVE:\n url.scheme = base.scheme;\n if (char == EOF) {\n url.username = base.username;\n url.password = base.password;\n url.host = base.host;\n url.port = base.port;\n url.path = base.path.slice();\n url.query = base.query;\n } else if (char == '/' || (char == '\\\\' && isSpecial(url))) {\n state = RELATIVE_SLASH;\n } else if (char == '?') {\n url.username = base.username;\n url.password = base.password;\n url.host = base.host;\n url.port = base.port;\n url.path = base.path.slice();\n url.query = '';\n state = QUERY;\n } else if (char == '#') {\n url.username = base.username;\n url.password = base.password;\n url.host = base.host;\n url.port = base.port;\n url.path = base.path.slice();\n url.query = base.query;\n url.fragment = '';\n state = FRAGMENT;\n } else {\n url.username = base.username;\n url.password = base.password;\n url.host = base.host;\n url.port = base.port;\n url.path = base.path.slice();\n url.path.pop();\n state = PATH;\n continue;\n } break;\n\n case RELATIVE_SLASH:\n if (isSpecial(url) && (char == '/' || char == '\\\\')) {\n state = SPECIAL_AUTHORITY_IGNORE_SLASHES;\n } else if (char == '/') {\n state = AUTHORITY;\n } else {\n url.username = base.username;\n url.password = base.password;\n url.host = base.host;\n url.port = base.port;\n state = PATH;\n continue;\n } break;\n\n case SPECIAL_AUTHORITY_SLASHES:\n state = SPECIAL_AUTHORITY_IGNORE_SLASHES;\n if (char != '/' || buffer.charAt(pointer + 1) != '/') continue;\n pointer++;\n break;\n\n case SPECIAL_AUTHORITY_IGNORE_SLASHES:\n if (char != '/' && char != '\\\\') {\n state = AUTHORITY;\n continue;\n } break;\n\n case AUTHORITY:\n if (char == '@') {\n if (seenAt) buffer = '%40' + buffer;\n seenAt = true;\n bufferCodePoints = arrayFrom(buffer);\n for (var i = 0; i < bufferCodePoints.length; i++) {\n var codePoint = bufferCodePoints[i];\n if (codePoint == ':' && !seenPasswordToken) {\n seenPasswordToken = true;\n continue;\n }\n var encodedCodePoints = percentEncode(codePoint, userinfoPercentEncodeSet);\n if (seenPasswordToken) url.password += encodedCodePoints;\n else url.username += encodedCodePoints;\n }\n buffer = '';\n } else if (\n char == EOF || char == '/' || char == '?' || char == '#' ||\n (char == '\\\\' && isSpecial(url))\n ) {\n if (seenAt && buffer == '') return INVALID_AUTHORITY;\n pointer -= arrayFrom(buffer).length + 1;\n buffer = '';\n state = HOST;\n } else buffer += char;\n break;\n\n case HOST:\n case HOSTNAME:\n if (stateOverride && url.scheme == 'file') {\n state = FILE_HOST;\n continue;\n } else if (char == ':' && !seenBracket) {\n if (buffer == '') return INVALID_HOST;\n failure = parseHost(url, buffer);\n if (failure) return failure;\n buffer = '';\n state = PORT;\n if (stateOverride == HOSTNAME) return;\n } else if (\n char == EOF || char == '/' || char == '?' || char == '#' ||\n (char == '\\\\' && isSpecial(url))\n ) {\n if (isSpecial(url) && buffer == '') return INVALID_HOST;\n if (stateOverride && buffer == '' && (includesCredentials(url) || url.port !== null)) return;\n failure = parseHost(url, buffer);\n if (failure) return failure;\n buffer = '';\n state = PATH_START;\n if (stateOverride) return;\n continue;\n } else {\n if (char == '[') seenBracket = true;\n else if (char == ']') seenBracket = false;\n buffer += char;\n } break;\n\n case PORT:\n if (DIGIT.test(char)) {\n buffer += char;\n } else if (\n char == EOF || char == '/' || char == '?' || char == '#' ||\n (char == '\\\\' && isSpecial(url)) ||\n stateOverride\n ) {\n if (buffer != '') {\n var port = parseInt(buffer, 10);\n if (port > 0xFFFF) return INVALID_PORT;\n url.port = (isSpecial(url) && port === specialSchemes[url.scheme]) ? null : port;\n buffer = '';\n }\n if (stateOverride) return;\n state = PATH_START;\n continue;\n } else return INVALID_PORT;\n break;\n\n case FILE:\n url.scheme = 'file';\n if (char == '/' || char == '\\\\') state = FILE_SLASH;\n else if (base && base.scheme == 'file') {\n if (char == EOF) {\n url.host = base.host;\n url.path = base.path.slice();\n url.query = base.query;\n } else if (char == '?') {\n url.host = base.host;\n url.path = base.path.slice();\n url.query = '';\n state = QUERY;\n } else if (char == '#') {\n url.host = base.host;\n url.path = base.path.slice();\n url.query = base.query;\n url.fragment = '';\n state = FRAGMENT;\n } else {\n if (!startsWithWindowsDriveLetter(codePoints.slice(pointer).join(''))) {\n url.host = base.host;\n url.path = base.path.slice();\n shortenURLsPath(url);\n }\n state = PATH;\n continue;\n }\n } else {\n state = PATH;\n continue;\n } break;\n\n case FILE_SLASH:\n if (char == '/' || char == '\\\\') {\n state = FILE_HOST;\n break;\n }\n if (base && base.scheme == 'file' && !startsWithWindowsDriveLetter(codePoints.slice(pointer).join(''))) {\n if (isWindowsDriveLetter(base.path[0], true)) url.path.push(base.path[0]);\n else url.host = base.host;\n }\n state = PATH;\n continue;\n\n case FILE_HOST:\n if (char == EOF || char == '/' || char == '\\\\' || char == '?' || char == '#') {\n if (!stateOverride && isWindowsDriveLetter(buffer)) {\n state = PATH;\n } else if (buffer == '') {\n url.host = '';\n if (stateOverride) return;\n state = PATH_START;\n } else {\n failure = parseHost(url, buffer);\n if (failure) return failure;\n if (url.host == 'localhost') url.host = '';\n if (stateOverride) return;\n buffer = '';\n state = PATH_START;\n } continue;\n } else buffer += char;\n break;\n\n case PATH_START:\n if (isSpecial(url)) {\n state = PATH;\n if (char != '/' && char != '\\\\') continue;\n } else if (!stateOverride && char == '?') {\n url.query = '';\n state = QUERY;\n } else if (!stateOverride && char == '#') {\n url.fragment = '';\n state = FRAGMENT;\n } else if (char != EOF) {\n state = PATH;\n if (char != '/') continue;\n } break;\n\n case PATH:\n if (\n char == EOF || char == '/' ||\n (char == '\\\\' && isSpecial(url)) ||\n (!stateOverride && (char == '?' || char == '#'))\n ) {\n if (isDoubleDot(buffer)) {\n shortenURLsPath(url);\n if (char != '/' && !(char == '\\\\' && isSpecial(url))) {\n url.path.push('');\n }\n } else if (isSingleDot(buffer)) {\n if (char != '/' && !(char == '\\\\' && isSpecial(url))) {\n url.path.push('');\n }\n } else {\n if (url.scheme == 'file' && !url.path.length && isWindowsDriveLetter(buffer)) {\n if (url.host) url.host = '';\n buffer = buffer.charAt(0) + ':'; // normalize windows drive letter\n }\n url.path.push(buffer);\n }\n buffer = '';\n if (url.scheme == 'file' && (char == EOF || char == '?' || char == '#')) {\n while (url.path.length > 1 && url.path[0] === '') {\n url.path.shift();\n }\n }\n if (char == '?') {\n url.query = '';\n state = QUERY;\n } else if (char == '#') {\n url.fragment = '';\n state = FRAGMENT;\n }\n } else {\n buffer += percentEncode(char, pathPercentEncodeSet);\n } break;\n\n case CANNOT_BE_A_BASE_URL_PATH:\n if (char == '?') {\n url.query = '';\n state = QUERY;\n } else if (char == '#') {\n url.fragment = '';\n state = FRAGMENT;\n } else if (char != EOF) {\n url.path[0] += percentEncode(char, C0ControlPercentEncodeSet);\n } break;\n\n case QUERY:\n if (!stateOverride && char == '#') {\n url.fragment = '';\n state = FRAGMENT;\n } else if (char != EOF) {\n if (char == \"'\" && isSpecial(url)) url.query += '%27';\n else if (char == '#') url.query += '%23';\n else url.query += percentEncode(char, C0ControlPercentEncodeSet);\n } break;\n\n case FRAGMENT:\n if (char != EOF) url.fragment += percentEncode(char, fragmentPercentEncodeSet);\n break;\n }\n\n pointer++;\n }\n};\n\n// `URL` constructor\n// https://url.spec.whatwg.org/#url-class\nvar URLConstructor = function URL(url /* , base */) {\n var that = anInstance(this, URLConstructor, 'URL');\n var base = arguments.length > 1 ? arguments[1] : undefined;\n var urlString = String(url);\n var state = setInternalState(that, { type: 'URL' });\n var baseState, failure;\n if (base !== undefined) {\n if (base instanceof URLConstructor) baseState = getInternalURLState(base);\n else {\n failure = parseURL(baseState = {}, String(base));\n if (failure) throw TypeError(failure);\n }\n }\n failure = parseURL(state, urlString, null, baseState);\n if (failure) throw TypeError(failure);\n var searchParams = state.searchParams = new URLSearchParams();\n var searchParamsState = getInternalSearchParamsState(searchParams);\n searchParamsState.updateSearchParams(state.query);\n searchParamsState.updateURL = function () {\n state.query = String(searchParams) || null;\n };\n if (!DESCRIPTORS) {\n that.href = serializeURL.call(that);\n that.origin = getOrigin.call(that);\n that.protocol = getProtocol.call(that);\n that.username = getUsername.call(that);\n that.password = getPassword.call(that);\n that.host = getHost.call(that);\n that.hostname = getHostname.call(that);\n that.port = getPort.call(that);\n that.pathname = getPathname.call(that);\n that.search = getSearch.call(that);\n that.searchParams = getSearchParams.call(that);\n that.hash = getHash.call(that);\n }\n};\n\nvar URLPrototype = URLConstructor.prototype;\n\nvar serializeURL = function () {\n var url = getInternalURLState(this);\n var scheme = url.scheme;\n var username = url.username;\n var password = url.password;\n var host = url.host;\n var port = url.port;\n var path = url.path;\n var query = url.query;\n var fragment = url.fragment;\n var output = scheme + ':';\n if (host !== null) {\n output += '//';\n if (includesCredentials(url)) {\n output += username + (password ? ':' + password : '') + '@';\n }\n output += serializeHost(host);\n if (port !== null) output += ':' + port;\n } else if (scheme == 'file') output += '//';\n output += url.cannotBeABaseURL ? path[0] : path.length ? '/' + path.join('/') : '';\n if (query !== null) output += '?' + query;\n if (fragment !== null) output += '#' + fragment;\n return output;\n};\n\nvar getOrigin = function () {\n var url = getInternalURLState(this);\n var scheme = url.scheme;\n var port = url.port;\n if (scheme == 'blob') try {\n return new URLConstructor(scheme.path[0]).origin;\n } catch (error) {\n return 'null';\n }\n if (scheme == 'file' || !isSpecial(url)) return 'null';\n return scheme + '://' + serializeHost(url.host) + (port !== null ? ':' + port : '');\n};\n\nvar getProtocol = function () {\n return getInternalURLState(this).scheme + ':';\n};\n\nvar getUsername = function () {\n return getInternalURLState(this).username;\n};\n\nvar getPassword = function () {\n return getInternalURLState(this).password;\n};\n\nvar getHost = function () {\n var url = getInternalURLState(this);\n var host = url.host;\n var port = url.port;\n return host === null ? ''\n : port === null ? serializeHost(host)\n : serializeHost(host) + ':' + port;\n};\n\nvar getHostname = function () {\n var host = getInternalURLState(this).host;\n return host === null ? '' : serializeHost(host);\n};\n\nvar getPort = function () {\n var port = getInternalURLState(this).port;\n return port === null ? '' : String(port);\n};\n\nvar getPathname = function () {\n var url = getInternalURLState(this);\n var path = url.path;\n return url.cannotBeABaseURL ? path[0] : path.length ? '/' + path.join('/') : '';\n};\n\nvar getSearch = function () {\n var query = getInternalURLState(this).query;\n return query ? '?' + query : '';\n};\n\nvar getSearchParams = function () {\n return getInternalURLState(this).searchParams;\n};\n\nvar getHash = function () {\n var fragment = getInternalURLState(this).fragment;\n return fragment ? '#' + fragment : '';\n};\n\nvar accessorDescriptor = function (getter, setter) {\n return { get: getter, set: setter, configurable: true, enumerable: true };\n};\n\nif (DESCRIPTORS) {\n defineProperties(URLPrototype, {\n // `URL.prototype.href` accessors pair\n // https://url.spec.whatwg.org/#dom-url-href\n href: accessorDescriptor(serializeURL, function (href) {\n var url = getInternalURLState(this);\n var urlString = String(href);\n var failure = parseURL(url, urlString);\n if (failure) throw TypeError(failure);\n getInternalSearchParamsState(url.searchParams).updateSearchParams(url.query);\n }),\n // `URL.prototype.origin` getter\n // https://url.spec.whatwg.org/#dom-url-origin\n origin: accessorDescriptor(getOrigin),\n // `URL.prototype.protocol` accessors pair\n // https://url.spec.whatwg.org/#dom-url-protocol\n protocol: accessorDescriptor(getProtocol, function (protocol) {\n var url = getInternalURLState(this);\n parseURL(url, String(protocol) + ':', SCHEME_START);\n }),\n // `URL.prototype.username` accessors pair\n // https://url.spec.whatwg.org/#dom-url-username\n username: accessorDescriptor(getUsername, function (username) {\n var url = getInternalURLState(this);\n var codePoints = arrayFrom(String(username));\n if (cannotHaveUsernamePasswordPort(url)) return;\n url.username = '';\n for (var i = 0; i < codePoints.length; i++) {\n url.username += percentEncode(codePoints[i], userinfoPercentEncodeSet);\n }\n }),\n // `URL.prototype.password` accessors pair\n // https://url.spec.whatwg.org/#dom-url-password\n password: accessorDescriptor(getPassword, function (password) {\n var url = getInternalURLState(this);\n var codePoints = arrayFrom(String(password));\n if (cannotHaveUsernamePasswordPort(url)) return;\n url.password = '';\n for (var i = 0; i < codePoints.length; i++) {\n url.password += percentEncode(codePoints[i], userinfoPercentEncodeSet);\n }\n }),\n // `URL.prototype.host` accessors pair\n // https://url.spec.whatwg.org/#dom-url-host\n host: accessorDescriptor(getHost, function (host) {\n var url = getInternalURLState(this);\n if (url.cannotBeABaseURL) return;\n parseURL(url, String(host), HOST);\n }),\n // `URL.prototype.hostname` accessors pair\n // https://url.spec.whatwg.org/#dom-url-hostname\n hostname: accessorDescriptor(getHostname, function (hostname) {\n var url = getInternalURLState(this);\n if (url.cannotBeABaseURL) return;\n parseURL(url, String(hostname), HOSTNAME);\n }),\n // `URL.prototype.port` accessors pair\n // https://url.spec.whatwg.org/#dom-url-port\n port: accessorDescriptor(getPort, function (port) {\n var url = getInternalURLState(this);\n if (cannotHaveUsernamePasswordPort(url)) return;\n port = String(port);\n if (port == '') url.port = null;\n else parseURL(url, port, PORT);\n }),\n // `URL.prototype.pathname` accessors pair\n // https://url.spec.whatwg.org/#dom-url-pathname\n pathname: accessorDescriptor(getPathname, function (pathname) {\n var url = getInternalURLState(this);\n if (url.cannotBeABaseURL) return;\n url.path = [];\n parseURL(url, pathname + '', PATH_START);\n }),\n // `URL.prototype.search` accessors pair\n // https://url.spec.whatwg.org/#dom-url-search\n search: accessorDescriptor(getSearch, function (search) {\n var url = getInternalURLState(this);\n search = String(search);\n if (search == '') {\n url.query = null;\n } else {\n if ('?' == search.charAt(0)) search = search.slice(1);\n url.query = '';\n parseURL(url, search, QUERY);\n }\n getInternalSearchParamsState(url.searchParams).updateSearchParams(url.query);\n }),\n // `URL.prototype.searchParams` getter\n // https://url.spec.whatwg.org/#dom-url-searchparams\n searchParams: accessorDescriptor(getSearchParams),\n // `URL.prototype.hash` accessors pair\n // https://url.spec.whatwg.org/#dom-url-hash\n hash: accessorDescriptor(getHash, function (hash) {\n var url = getInternalURLState(this);\n hash = String(hash);\n if (hash == '') {\n url.fragment = null;\n return;\n }\n if ('#' == hash.charAt(0)) hash = hash.slice(1);\n url.fragment = '';\n parseURL(url, hash, FRAGMENT);\n })\n });\n}\n\n// `URL.prototype.toJSON` method\n// https://url.spec.whatwg.org/#dom-url-tojson\nredefine(URLPrototype, 'toJSON', function toJSON() {\n return serializeURL.call(this);\n}, { enumerable: true });\n\n// `URL.prototype.toString` method\n// https://url.spec.whatwg.org/#URL-stringification-behavior\nredefine(URLPrototype, 'toString', function toString() {\n return serializeURL.call(this);\n}, { enumerable: true });\n\nif (NativeURL) {\n var nativeCreateObjectURL = NativeURL.createObjectURL;\n var nativeRevokeObjectURL = NativeURL.revokeObjectURL;\n // `URL.createObjectURL` method\n // https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL\n // eslint-disable-next-line no-unused-vars -- required for `.length`\n if (nativeCreateObjectURL) redefine(URLConstructor, 'createObjectURL', function createObjectURL(blob) {\n return nativeCreateObjectURL.apply(NativeURL, arguments);\n });\n // `URL.revokeObjectURL` method\n // https://developer.mozilla.org/en-US/docs/Web/API/URL/revokeObjectURL\n // eslint-disable-next-line no-unused-vars -- required for `.length`\n if (nativeRevokeObjectURL) redefine(URLConstructor, 'revokeObjectURL', function revokeObjectURL(url) {\n return nativeRevokeObjectURL.apply(NativeURL, arguments);\n });\n}\n\nsetToStringTag(URLConstructor, 'URL');\n\n$({ global: true, forced: !USE_NATIVE_URL, sham: !DESCRIPTORS }, {\n URL: URLConstructor\n});\n","(()=>{var e={296:(e,t,r)=>{var o=/^\\s+|\\s+$/g,n=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,c=/^0o[0-7]+$/i,u=parseInt,s=\"object\"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,l=\"object\"==typeof self&&self&&self.Object===Object&&self,a=s||l||Function(\"return this\")(),f=Object.prototype.toString,p=Math.max,y=Math.min,b=function(){return a.Date.now()};function d(e){var t=typeof e;return!!e&&(\"object\"==t||\"function\"==t)}function h(e){if(\"number\"==typeof e)return e;if(function(e){return\"symbol\"==typeof e||function(e){return!!e&&\"object\"==typeof e}(e)&&\"[object Symbol]\"==f.call(e)}(e))return NaN;if(d(e)){var t=\"function\"==typeof e.valueOf?e.valueOf():e;e=d(t)?t+\"\":t}if(\"string\"!=typeof e)return 0===e?e:+e;e=e.replace(o,\"\");var r=i.test(e);return r||c.test(e)?u(e.slice(2),r?2:8):n.test(e)?NaN:+e}e.exports=function(e,t,r){var o,n,i,c,u,s,l=0,a=!1,f=!1,v=!0;if(\"function\"!=typeof e)throw new TypeError(\"Expected a function\");function m(t){var r=o,i=n;return o=n=void 0,l=t,c=e.apply(i,r)}function O(e){var r=e-s;return void 0===s||r>=t||r<0||f&&e-l>=i}function w(){var e=b();if(O(e))return g(e);u=setTimeout(w,function(e){var r=t-(e-s);return f?y(r,i-(e-l)):r}(e))}function g(e){return u=void 0,v&&o?m(e):(o=n=void 0,c)}function P(){var e=b(),r=O(e);if(o=arguments,n=this,s=e,r){if(void 0===u)return function(e){return l=e,u=setTimeout(w,t),a?m(e):c}(s);if(f)return u=setTimeout(w,t),m(s)}return void 0===u&&(u=setTimeout(w,t)),c}return t=h(t)||0,d(r)&&(a=!!r.leading,i=(f=\"maxWait\"in r)?p(h(r.maxWait)||0,t):i,v=\"trailing\"in r?!!r.trailing:v),P.cancel=function(){void 0!==u&&clearTimeout(u),l=0,o=s=n=u=void 0},P.flush=function(){return void 0===u?c:g(b())},P}},96:(e,t,r)=>{var o=\"Expected a function\",n=NaN,i=\"[object Symbol]\",c=/^\\s+|\\s+$/g,u=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,l=/^0o[0-7]+$/i,a=parseInt,f=\"object\"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,p=\"object\"==typeof self&&self&&self.Object===Object&&self,y=f||p||Function(\"return this\")(),b=Object.prototype.toString,d=Math.max,h=Math.min,v=function(){return y.Date.now()};function m(e){var t=typeof e;return!!e&&(\"object\"==t||\"function\"==t)}function O(e){if(\"number\"==typeof e)return e;if(function(e){return\"symbol\"==typeof e||function(e){return!!e&&\"object\"==typeof e}(e)&&b.call(e)==i}(e))return n;if(m(e)){var t=\"function\"==typeof e.valueOf?e.valueOf():e;e=m(t)?t+\"\":t}if(\"string\"!=typeof e)return 0===e?e:+e;e=e.replace(c,\"\");var r=s.test(e);return r||l.test(e)?a(e.slice(2),r?2:8):u.test(e)?n:+e}e.exports=function(e,t,r){var n=!0,i=!0;if(\"function\"!=typeof e)throw new TypeError(o);return m(r)&&(n=\"leading\"in r?!!r.leading:n,i=\"trailing\"in r?!!r.trailing:i),function(e,t,r){var n,i,c,u,s,l,a=0,f=!1,p=!1,y=!0;if(\"function\"!=typeof e)throw new TypeError(o);function b(t){var r=n,o=i;return n=i=void 0,a=t,u=e.apply(o,r)}function w(e){var r=e-l;return void 0===l||r>=t||r<0||p&&e-a>=c}function g(){var e=v();if(w(e))return P(e);s=setTimeout(g,function(e){var r=t-(e-l);return p?h(r,c-(e-a)):r}(e))}function P(e){return s=void 0,y&&n?b(e):(n=i=void 0,u)}function j(){var e=v(),r=w(e);if(n=arguments,i=this,l=e,r){if(void 0===s)return function(e){return a=e,s=setTimeout(g,t),f?b(e):u}(l);if(p)return s=setTimeout(g,t),b(l)}return void 0===s&&(s=setTimeout(g,t)),u}return t=O(t)||0,m(r)&&(f=!!r.leading,c=(p=\"maxWait\"in r)?d(O(r.maxWait)||0,t):c,y=\"trailing\"in r?!!r.trailing:y),j.cancel=function(){void 0!==s&&clearTimeout(s),a=0,n=l=i=s=void 0},j.flush=function(){return void 0===s?u:P(v())},j}(e,t,{leading:n,maxWait:t,trailing:i})}},703:(e,t,r)=>{\"use strict\";var o=r(414);function n(){}function i(){}i.resetWarningCache=n,e.exports=function(){function e(e,t,r,n,i,c){if(c!==o){var u=new Error(\"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types\");throw u.name=\"Invariant Violation\",u}}function t(){return e}e.isRequired=e;var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:n};return r.PropTypes=r,r}},697:(e,t,r)=>{e.exports=r(703)()},414:e=>{\"use strict\";e.exports=\"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED\"}},t={};function r(o){var n=t[o];if(void 0!==n)return n.exports;var i=t[o]={exports:{}};return e[o](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.g=function(){if(\"object\"==typeof globalThis)return globalThis;try{return this||new Function(\"return this\")()}catch(e){if(\"object\"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})};var o={};(()=>{\"use strict\";r.r(o),r.d(o,{LazyLoadComponent:()=>Y,LazyLoadImage:()=>ne,trackWindowScroll:()=>D});const e=require(\"react\");var t=r.n(e),n=r(697);function i(){return\"undefined\"!=typeof window&&\"IntersectionObserver\"in window&&\"isIntersecting\"in window.IntersectionObserverEntry.prototype}function c(e){return c=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},c(e)}function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function s(e,t,r){return(t=a(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function l(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:this.props.scrollPosition,t=this.placeholder.getBoundingClientRect(),r=this.placeholder.style,o=parseInt(r.getPropertyValue(\"margin-left\"),10)||0,n=parseInt(r.getPropertyValue(\"margin-top\"),10)||0;return{bottom:e.y+t.bottom+n,left:e.x+t.left+o,right:e.x+t.right+o,top:e.y+t.top+n}}},{key:\"isPlaceholderInViewport\",value:function(){if(\"undefined\"==typeof window||!this.placeholder)return!1;var e=this.props,t=e.scrollPosition,r=e.threshold,o=this.getPlaceholderBoundingBox(t),n=t.y+window.innerHeight,i=t.x,c=t.x+window.innerWidth,u=t.y;return Boolean(u-r<=o.bottom&&n+r>=o.top&&i-r<=o.right&&c+r>=o.left)}},{key:\"updateVisibility\",value:function(){this.isPlaceholderInViewport()&&this.props.onVisible()}},{key:\"render\",value:function(){var e=this,r=this.props,o=r.className,n=r.height,i=r.placeholder,c=r.style,l=r.width;if(i&&\"function\"!=typeof i.type)return t().cloneElement(i,{ref:function(t){return e.placeholder=t}});var a=function(e){for(var t=1;t=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(r,T)),n=this.useIntersectionObserver?null:this.state.scrollPosition;return t().createElement(e,S({forwardRef:this.baseComponentRef,scrollPosition:n},o))}}])&&E(o.prototype,n),Object.defineProperty(o,\"prototype\",{writable:!1}),l}(t().Component);return r.propTypes={delayMethod:n.PropTypes.oneOf([\"debounce\",\"throttle\"]),delayTime:n.PropTypes.number,useIntersectionObserver:n.PropTypes.bool},r.defaultProps={delayMethod:\"throttle\",delayTime:300,useIntersectionObserver:!0},r};function C(e){return C=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},C(e)}function B(e,t){for(var r=0;r=0&&Number.isFinite(n.y)&&n.y>=0),t}return r=s,(o=[{key:\"componentDidUpdate\",value:function(e,t){t.visible!==this.state.visible&&this.props.afterLoad()}},{key:\"onVisible\",value:function(){this.props.beforeLoad(),this.setState({visible:!0})}},{key:\"render\",value:function(){if(this.state.visible)return this.props.children;var e=this.props,r=e.className,o=e.delayMethod,n=e.delayTime,c=e.height,u=e.placeholder,s=e.scrollPosition,l=e.style,a=e.threshold,f=e.useIntersectionObserver,p=e.width;return this.isScrollTracked||f&&i()?t().createElement(h,{className:r,height:c,onVisible:this.onVisible,placeholder:u,scrollPosition:s,style:l,threshold:a,useIntersectionObserver:f,width:p}):t().createElement(W,{className:r,delayMethod:o,delayTime:n,height:c,onVisible:this.onVisible,placeholder:u,style:l,threshold:a,width:p})}}])&&$(r.prototype,o),Object.defineProperty(r,\"prototype\",{writable:!1}),s}(t().Component);H.propTypes={afterLoad:n.PropTypes.func,beforeLoad:n.PropTypes.func,useIntersectionObserver:n.PropTypes.bool,visibleByDefault:n.PropTypes.bool},H.defaultProps={afterLoad:function(){return{}},beforeLoad:function(){return{}},useIntersectionObserver:!0,visibleByDefault:!1};const Y=H;function X(e){return X=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},X(e)}var A=[\"afterLoad\",\"beforeLoad\",\"delayMethod\",\"delayTime\",\"effect\",\"placeholder\",\"placeholderSrc\",\"scrollPosition\",\"threshold\",\"useIntersectionObserver\",\"visibleByDefault\",\"wrapperClassName\",\"wrapperProps\"];function G(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function J(e){for(var t=1;t=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(e,A));return t().createElement(\"img\",Q({},r,{onLoad:this.onImageLoad()}))}},{key:\"getLazyLoadImage\",value:function(){var e=this.props,r=e.beforeLoad,o=e.className,n=e.delayMethod,i=e.delayTime,c=e.height,u=e.placeholder,s=e.scrollPosition,l=e.style,a=e.threshold,f=e.useIntersectionObserver,p=e.visibleByDefault,y=e.width;return t().createElement(Y,{beforeLoad:r,className:o,delayMethod:n,delayTime:i,height:c,placeholder:u,scrollPosition:s,style:l,threshold:a,useIntersectionObserver:f,visibleByDefault:p,width:y},this.getImg())}},{key:\"getWrappedLazyLoadImage\",value:function(e){var r=this.props,o=r.effect,n=r.height,i=r.placeholderSrc,c=r.width,u=r.wrapperClassName,s=r.wrapperProps,l=this.state.loaded,a=l?\" lazy-load-image-loaded\":\"\",f=l||!i?{}:{backgroundImage:\"url(\".concat(i,\")\"),backgroundSize:\"100% 100%\"};return t().createElement(\"span\",Q({className:u+\" lazy-load-image-background \"+o+a,style:J(J({},f),{},{color:\"transparent\",display:\"inline-block\",height:n,width:c})},s),e)}},{key:\"render\",value:function(){var e=this.props,t=e.effect,r=e.placeholderSrc,o=e.visibleByDefault,n=e.wrapperClassName,i=e.wrapperProps,c=this.getLazyLoadImage();return(t||r)&&!o||n||i?this.getWrappedLazyLoadImage(c):c}}])&&Z(r.prototype,o),Object.defineProperty(r,\"prototype\",{writable:!1}),u}(t().Component);oe.propTypes={onLoad:n.PropTypes.func,afterLoad:n.PropTypes.func,beforeLoad:n.PropTypes.func,delayMethod:n.PropTypes.string,delayTime:n.PropTypes.number,effect:n.PropTypes.string,placeholderSrc:n.PropTypes.string,threshold:n.PropTypes.number,useIntersectionObserver:n.PropTypes.bool,visibleByDefault:n.PropTypes.bool,wrapperClassName:n.PropTypes.string,wrapperProps:n.PropTypes.object},oe.defaultProps={onLoad:function(){},afterLoad:function(){return{}},beforeLoad:function(){return{}},delayMethod:\"throttle\",delayTime:300,effect:\"\",placeholderSrc:null,threshold:100,useIntersectionObserver:!0,visibleByDefault:!1,wrapperClassName:\"\"};const ne=oe})(),module.exports=o})();","import { Children, cloneElement, isValidElement } from 'react';\n/**\n * Given `this.props.children`, return an object mapping key to child.\n *\n * @param {*} children `this.props.children`\n * @return {object} Mapping of key to child\n */\n\nexport function getChildMapping(children, mapFn) {\n var mapper = function mapper(child) {\n return mapFn && isValidElement(child) ? mapFn(child) : child;\n };\n\n var result = Object.create(null);\n if (children) Children.map(children, function (c) {\n return c;\n }).forEach(function (child) {\n // run the map function here instead so that the key is the computed one\n result[child.key] = mapper(child);\n });\n return result;\n}\n/**\n * When you're adding or removing children some may be added or removed in the\n * same render pass. We want to show *both* since we want to simultaneously\n * animate elements in and out. This function takes a previous set of keys\n * and a new set of keys and merges them with its best guess of the correct\n * ordering. In the future we may expose some of the utilities in\n * ReactMultiChild to make this easy, but for now React itself does not\n * directly have this concept of the union of prevChildren and nextChildren\n * so we implement it here.\n *\n * @param {object} prev prev children as returned from\n * `ReactTransitionChildMapping.getChildMapping()`.\n * @param {object} next next children as returned from\n * `ReactTransitionChildMapping.getChildMapping()`.\n * @return {object} a key set that contains all keys in `prev` and all keys\n * in `next` in a reasonable order.\n */\n\nexport function mergeChildMappings(prev, next) {\n prev = prev || {};\n next = next || {};\n\n function getValueForKey(key) {\n return key in next ? next[key] : prev[key];\n } // For each key of `next`, the list of keys to insert before that key in\n // the combined list\n\n\n var nextKeysPending = Object.create(null);\n var pendingKeys = [];\n\n for (var prevKey in prev) {\n if (prevKey in next) {\n if (pendingKeys.length) {\n nextKeysPending[prevKey] = pendingKeys;\n pendingKeys = [];\n }\n } else {\n pendingKeys.push(prevKey);\n }\n }\n\n var i;\n var childMapping = {};\n\n for (var nextKey in next) {\n if (nextKeysPending[nextKey]) {\n for (i = 0; i < nextKeysPending[nextKey].length; i++) {\n var pendingNextKey = nextKeysPending[nextKey][i];\n childMapping[nextKeysPending[nextKey][i]] = getValueForKey(pendingNextKey);\n }\n }\n\n childMapping[nextKey] = getValueForKey(nextKey);\n } // Finally, add the keys which didn't appear before any key in `next`\n\n\n for (i = 0; i < pendingKeys.length; i++) {\n childMapping[pendingKeys[i]] = getValueForKey(pendingKeys[i]);\n }\n\n return childMapping;\n}\n\nfunction getProp(child, prop, props) {\n return props[prop] != null ? props[prop] : child.props[prop];\n}\n\nexport function getInitialChildMapping(props, onExited) {\n return getChildMapping(props.children, function (child) {\n return cloneElement(child, {\n onExited: onExited.bind(null, child),\n in: true,\n appear: getProp(child, 'appear', props),\n enter: getProp(child, 'enter', props),\n exit: getProp(child, 'exit', props)\n });\n });\n}\nexport function getNextChildMapping(nextProps, prevChildMapping, onExited) {\n var nextChildMapping = getChildMapping(nextProps.children);\n var children = mergeChildMappings(prevChildMapping, nextChildMapping);\n Object.keys(children).forEach(function (key) {\n var child = children[key];\n if (!isValidElement(child)) return;\n var hasPrev = (key in prevChildMapping);\n var hasNext = (key in nextChildMapping);\n var prevChild = prevChildMapping[key];\n var isLeaving = isValidElement(prevChild) && !prevChild.props.in; // item is new (entering)\n\n if (hasNext && (!hasPrev || isLeaving)) {\n // console.log('entering', key)\n children[key] = cloneElement(child, {\n onExited: onExited.bind(null, child),\n in: true,\n exit: getProp(child, 'exit', nextProps),\n enter: getProp(child, 'enter', nextProps)\n });\n } else if (!hasNext && hasPrev && !isLeaving) {\n // item is old (exiting)\n // console.log('leaving', key)\n children[key] = cloneElement(child, {\n in: false\n });\n } else if (hasNext && hasPrev && isValidElement(prevChild)) {\n // item hasn't changed transition states\n // copy over the last transition props;\n // console.log('unchanged', key)\n children[key] = cloneElement(child, {\n onExited: onExited.bind(null, child),\n in: prevChild.props.in,\n exit: getProp(child, 'exit', nextProps),\n enter: getProp(child, 'enter', nextProps)\n });\n }\n });\n return children;\n}","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport TransitionGroupContext from './TransitionGroupContext';\nimport { getChildMapping, getInitialChildMapping, getNextChildMapping } from './utils/ChildMapping';\n\nvar values = Object.values || function (obj) {\n return Object.keys(obj).map(function (k) {\n return obj[k];\n });\n};\n\nvar defaultProps = {\n component: 'div',\n childFactory: function childFactory(child) {\n return child;\n }\n};\n/**\n * The `` component manages a set of transition components\n * (`` and ``) in a list. Like with the transition\n * components, `` is a state machine for managing the mounting\n * and unmounting of components over time.\n *\n * Consider the example below. As items are removed or added to the TodoList the\n * `in` prop is toggled automatically by the ``.\n *\n * Note that `` does not define any animation behavior!\n * Exactly _how_ a list item animates is up to the individual transition\n * component. This means you can mix and match animations across different list\n * items.\n */\n\nvar TransitionGroup = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(TransitionGroup, _React$Component);\n\n function TransitionGroup(props, context) {\n var _this;\n\n _this = _React$Component.call(this, props, context) || this;\n\n var handleExited = _this.handleExited.bind(_assertThisInitialized(_this)); // Initial children should all be entering, dependent on appear\n\n\n _this.state = {\n contextValue: {\n isMounting: true\n },\n handleExited: handleExited,\n firstRender: true\n };\n return _this;\n }\n\n var _proto = TransitionGroup.prototype;\n\n _proto.componentDidMount = function componentDidMount() {\n this.mounted = true;\n this.setState({\n contextValue: {\n isMounting: false\n }\n });\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.mounted = false;\n };\n\n TransitionGroup.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, _ref) {\n var prevChildMapping = _ref.children,\n handleExited = _ref.handleExited,\n firstRender = _ref.firstRender;\n return {\n children: firstRender ? getInitialChildMapping(nextProps, handleExited) : getNextChildMapping(nextProps, prevChildMapping, handleExited),\n firstRender: false\n };\n } // node is `undefined` when user provided `nodeRef` prop\n ;\n\n _proto.handleExited = function handleExited(child, node) {\n var currentChildMapping = getChildMapping(this.props.children);\n if (child.key in currentChildMapping) return;\n\n if (child.props.onExited) {\n child.props.onExited(node);\n }\n\n if (this.mounted) {\n this.setState(function (state) {\n var children = _extends({}, state.children);\n\n delete children[child.key];\n return {\n children: children\n };\n });\n }\n };\n\n _proto.render = function render() {\n var _this$props = this.props,\n Component = _this$props.component,\n childFactory = _this$props.childFactory,\n props = _objectWithoutPropertiesLoose(_this$props, [\"component\", \"childFactory\"]);\n\n var contextValue = this.state.contextValue;\n var children = values(this.state.children).map(childFactory);\n delete props.appear;\n delete props.enter;\n delete props.exit;\n\n if (Component === null) {\n return /*#__PURE__*/React.createElement(TransitionGroupContext.Provider, {\n value: contextValue\n }, children);\n }\n\n return /*#__PURE__*/React.createElement(TransitionGroupContext.Provider, {\n value: contextValue\n }, /*#__PURE__*/React.createElement(Component, props, children));\n };\n\n return TransitionGroup;\n}(React.Component);\n\nTransitionGroup.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * `` renders a `` by default. You can change this\n * behavior by providing a `component` prop.\n * If you use React v16+ and would like to avoid a wrapping `
` element\n * you can pass in `component={null}`. This is useful if the wrapping div\n * borks your css styles.\n */\n component: PropTypes.any,\n\n /**\n * A set of `` components, that are toggled `in` and out as they\n * leave. the `` will inject specific transition props, so\n * remember to spread them through if you are wrapping the `` as\n * with our `` example.\n *\n * While this component is meant for multiple `Transition` or `CSSTransition`\n * children, sometimes you may want to have a single transition child with\n * content that you want to be transitioned out and in when you change it\n * (e.g. routes, images etc.) In that case you can change the `key` prop of\n * the transition child as you change its content, this will cause\n * `TransitionGroup` to transition the child out and back in.\n */\n children: PropTypes.node,\n\n /**\n * A convenience prop that enables or disables appear animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n appear: PropTypes.bool,\n\n /**\n * A convenience prop that enables or disables enter animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n enter: PropTypes.bool,\n\n /**\n * A convenience prop that enables or disables exit animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n exit: PropTypes.bool,\n\n /**\n * You may need to apply reactive updates to a child as it is exiting.\n * This is generally done by using `cloneElement` however in the case of an exiting\n * child the element has already been removed and not accessible to the consumer.\n *\n * If you do need to update a child as it leaves you can provide a `childFactory`\n * to wrap every child, even the ones that are leaving.\n *\n * @type Function(child: ReactElement) -> ReactElement\n */\n childFactory: PropTypes.func\n} : {};\nTransitionGroup.defaultProps = defaultProps;\nexport default TransitionGroup;","function _extends() {\n return module.exports = _extends = Object.assign ? Object.assign.bind() : function (n) {\n for (var e = 1; e < arguments.length; e++) {\n var t = arguments[e];\n for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n }\n return n;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports, _extends.apply(null, arguments);\n}\nmodule.exports = _extends, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _objectWithoutPropertiesLoose(r, e) {\n if (null == r) return {};\n var t = {};\n for (var n in r) if ({}.hasOwnProperty.call(r, n)) {\n if (-1 !== e.indexOf(n)) continue;\n t[n] = r[n];\n }\n return t;\n}\nmodule.exports = _objectWithoutPropertiesLoose, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t