{"version":3,"sources":["webpack:///./app/javascript/components/Deal/NoOptions.jsx","webpack:///./app/javascript/components/Deal/OptionSelector/OptionSelectorControl.jsx","webpack:///./app/javascript/components/Deal/OptionSelector/OptionSelectorPagination.jsx","webpack:///./app/javascript/components/Deal/OptionSelector/OptionSelectorSummary.jsx","webpack:///./app/javascript/components/Deal/OptionSelector/OptionSelectorStockWarning.jsx","webpack:///./app/javascript/components/Deal/ContentIntroGallery/GalleryTabs.jsx","webpack:///./app/javascript/components/Deal/ContentIntroGallery/GallerySlide.jsx","webpack:///./app/javascript/components/Deal/Dealer.jsx","webpack:///./app/javascript/components/Deal/Option.jsx","webpack:///./app/javascript/components/Deal/OptionSelector/OptionSelectorPage.jsx","webpack:///./app/javascript/components/Deal/OptionSelector/OptionSelector.jsx","webpack:///./app/javascript/components/Deal/CarTax.jsx","webpack:///./app/javascript/components/Deal/ContentIntroGallery/ContentIntroGallery.jsx","webpack:///./app/javascript/components/Deal/Enquire.jsx","webpack:///./app/javascript/components/Deal/ExclamationIcon.jsx","webpack:///./app/javascript/components/Deal/Lightbox/Lightbox.jsx","webpack:///./app/javascript/components/Deal/OptionSelector/steps/Colour.jsx","webpack:///./app/javascript/components/Deal/PaintSwatches.jsx","webpack:///./app/javascript/components/Deal/Pricing.jsx","webpack:///./app/javascript/components/Deal/SalesInfo.jsx","webpack:///./app/javascript/components/Deal/Summary.jsx","webpack:///./app/javascript/components/Deal/SummaryItem.jsx","webpack:///./app/javascript/components/Deal/Vehicle/Enquire.jsx","webpack:///./app/javascript/components/Deal/Vehicle/Pricing.jsx","webpack:///./app/javascript/components/Deal/Vehicle/SalesInfo.jsx","webpack:///./app/javascript/components/Deal/Vehicle/Summary.jsx","webpack:///./app/javascript/components/Deal/SalesInfoItem.jsx","webpack:///./app/javascript/components/Deal/MonthlyPrice/MonthlyPrice.jsx","webpack:///./app/javascript/components/Deal/UpfrontPrice/UpfrontPrice.jsx","webpack:///./app/javascript/components/Deal/OptionsGroup.jsx","webpack:///./app/javascript/components/Deal/helpers.js","webpack:///./app/javascript/components/Deal/ContentIntroGallery/GalleryNavigation.jsx","webpack:///./app/javascript/components/Deal/FinanceLease.jsx","webpack:///./app/javascript/components/Deal/MotoringTerms.jsx"],"names":["NoOptions","message","className","defaultProps","OptionSelectorControl","isLast","step","pages","enquirePath","nextClicked","deal","useSelector","state","Deal","handleEnterPress","event","fn","which","handleNext","monthlyPrice","maintainedMonthlyPrice","price","maintenanceSelected","toFixed","split","wholePrice","decimalPrice","role","onKeyDown","onClick","name","href","OptionSelectorPagination","jumpToStep","loggedIn","dispatch","useDispatch","query","handleViewChange","type","preventDefault","isSales","payload","classNames","salesView","toLowerCase","map","item","index","count","listItemClasses","currentStep","key","handleClick","OptionSelectorSummaryItem","selected","length","description","isPositiveNumber","num","OptionSelectorSummary","priceParts","isPersonal","selectedColour","getSelectedOptions","filter","isPaintwork","selectedTrim","isAllTrim","selectedPacks","isPacks","selectedExterior","isExterior","selectedInterior","isInterior","selectedEquipment","isEquipment","initialPaymentPrice","maintainedInitialPaymentPrice","initialPayment","toString","lx_monthly_increase","annualMileage","numberWithCommas","contractLength","EnquireNow","OptionSelectorStockWarning","channel","isStock","isFrozen","isShortTerm","warning_text","props","store","GalleryTabs","selectedTab","onTabChange","id","label","tab","GallerySlide","image","style","tabIndex","src","alt","Dealer","contact","commission","link","leadTime","stockList","title","content","replace","Option","onChange","checked","disabled","visible","initialMonths","packDescriptions","isAdmin","formatPriceForPeriod","value","period","displayPrice","htmlFor","packDescription","OptionSelectorPage","categories","useState","isTwoColumns","setIsTwoColumns","onNext","onBack","setTwoColumns","OptionSelector","stepsArray","loggedInSteps","allCategories","customerSteps","categoriesColour","categoriesTrim","categoriesPacks","categoriesExterior","categoriesInterior","categoriesEquipment","stepsView","i","component","push","showSteps","steps","stepsNavigation","showNavigation","preventEnterSubmission","startAtStep","OptionSelectorProvider","CarTax","taxConfig","p11d","vat","options","totalOptionPrice","option","reduce","total","bik_value","benefit","p11dParam","percentage","formatPrice","year","CarTaxWrapper","ContentIntroGallery","exteriorImages","interiorImages","setSelectedTab","Set","loadedImages","setLoadedImages","useEmblaCarousel","loop","align","skipSnaps","dragFree","breakpoints","emblaRef","emblaApi","alternateImages","extImages","intImages","result","maxLength","Math","max","useEffect","allImages","forEach","url","img","Image","onload","prev","handleGalleryChange","detail","gallery","scrollTo","window","addEventListener","removeEventListener","filteredImages","ref","CustomEvent","imageUrl","document","dispatchEvent","handleImageClick","visibility","has","Enquire","paths","leaseType","isVan","phoneNumber","dealType","isFinanceLease","enquire","callbackPath","callback","carDealTypeLabel","isLoading","URLParamsInit","URLParamsApplied","isEnquire","EnquireWrapper","focusable","xmlns","viewBox","fill","d","Lightbox","handleLightboxOpen","findIndex","Colour","PaintSwatch","memo","lowLight","midLight","highLight","isSelected","background","PaintSwatches","paintsData","initialPaint","selectedPaint","setSelectedPaint","showPaints","setShowPaints","isFrozenOrStock","newSelectedPaint","URL","location","paintPreviewId","searchParams","get","find","String","history","replaceState","selectedPaintId","cap_paint","contains","option_code","actuallySelectedOptionIds","initialPaintOption","imagin_paint","code","optionId","set","turbolinks","PopStateEvent","handlePaintSelect","low_light","mid_light","high_light","PaintSwatchesWrapper","int","string","parseInt","Pricing","mileages","shortTermMileages","terms","shortTerms","initialPayments","shortTermInitialPaymentsByTerm","defaultInitialPaymentMonthsByTerm","init","hasShortTerm","hasStandardTerm","resetReduxState","useFinanceLease","dealId","make","model","trim","fueltype","fuelType","transmission","initialised","maintenancePrice","initialiseOptions","optionsIsPersonal","derivativeId","search","Rails","ajax","dataType","accept","success","error","fetchPrice","financeLeaseMonthlyPrice","financeLeaseInitialPaymentPrice","data","mileage","term","initial_payment","modelYear","model_year","params","URLSearchParams","optionIDArray","unique","getAll","isTurbolinksLoad","pathname","esc","encodeURIComponent","Object","keys","join","toQueryString","setIsPageLoad","optionIds","e","target","Number","isNaN","maintenanceLink","rel","currentChannelPath","PricingWrapper","SalesInfo","emailQuotePath","reportAProblemPath","financeLeaseTerm","financeLeaseMileage","financeLeaseInitialPayment","derivative","dealers","setState","otherOptions","setOtherOptions","colourOptions","setColourOptions","trimOptions","setTrimOptions","isHidden","setIsHidden","offerId","selectedOfferId","isTrim","selectedOther","isOther","getOptions","formattedArray","MISSING_VALUE","formatDealType","splitValue","charAt","toUpperCase","slice","listOptions","funderName","withMaintenance","regulatedMarketingSupport","nonRegulatedMarketingSupport","leadTimes","expiresAt","capId","managedBy","lastUpdatedAt","lastUpdatedBy","stock","pre_order","specAt","short_term","paint","otr","otr2","discount","doc_fee","displayType","thousandSeparator","prefix","fixedDecimalScale","decimalScale","collection_fee","includes_insurance","includes_maintenance","includes_breakdown_cover","minimum_age","discount_code","discount_amount","funder_url","alert","restrictions","dealer","stock_list","action","method","pluginOrElectric","funderId","SalesInfoWrapper","Summary","adminFee","VAT","shortTerm","indexOf","setMaintenancePrice","formUrl","formatValues","parseFloat","alignItems","marginRight","marginTop","textAlign","noValidate","justifyContent","SummaryWrapper","SummaryItem","vehicleStatus","vehicle","vehiclePriceId","initialPaymentMonths","SalesInfoItem","MonthlyPrice","isBusiness","pounds","pence","UpfrontPrice","DefaultOptions","defaultOptions","descriptions","comeLabel","OptionsGroup","filteredCategories","filterCategories","entries","isInCategory","isVisible","includes","getPackDescriptions","packContents","sort","isDefault","visibleSelectableOptions","isEnabled","OptionsGroupWrapper","ONE_OF","REQUIRES_ONE","REQUIRES_ALL","NOT_WITH","INCLUDED_IN","INCLUDE_ONE","getOption","getRule","ruleId","rules","getRules","ruleIds","getRulesOfTypeForOption","ruleType","getRulesForOptions","flat","getOneOfRulesForOption","isChildPackOption","includedInRulesPrimaryOptions","primaryOptionId","requiresRulesOptions","intersection","selectedChildPackOption","selectedIncludedInRules","all","primaryRequiresOneRulesForOption","enabledByRequiresOne","rule","some","appliedRulesForOption","enabledByAppliedRules","any","categoryCode","curry","categoryCodes","filtered","n","maintainedOfferId","geotargetlyInit","g","o","t","a","r","ge","tl","y","getElementsByTagName","createElement","async","referrer","parentNode","insertBefore","onerror","def","geotargetly","len","getElementsByClassName","display","s","kFormatter","abs","sign","GalleryNavigation","scrollPrev","scrollNext","FinanceLease","MotoringTerms","shortTermInitialPaymentsTotal","shortTermInitialPayments","applicableTerms","applicableMileages","applicableInitialPayments","Turbolinks","visit","handleToggle","labels","position","zIndex","shortTermInitialPayment","applicableInitialPayment"],"mappings":"0GAAA,2BAKMA,GALN,OAKkB,SAAC,GAAD,IAAGC,EAAH,EAAGA,QAAH,OAAiB,uBAAGC,UAAU,cAAcD,KAM9DD,EAAUG,aAAe,CACvBF,QAAS,0CAGID,a,4hCCgFAI,UAxFe,SAAC,GAAuD,IAArDC,EAAoD,EAApDA,OAAQC,EAA4C,EAA5CA,KAAMC,EAAsC,EAAtCA,MAAOC,EAA+B,EAA/BA,YAAaC,EAAkB,EAAlBA,YAC3DC,EAAOC,aAAY,SAACC,GAAD,OAAWA,EAAMC,QAEpCC,EAAmB,SAACC,EAAOC,GACX,KAAhBD,EAAME,OACRD,KAIEE,EAAa,WACjBT,KAGMU,EAA8DT,EAA9DS,aAAcC,EAAgDV,EAAhDU,uBAEhBC,EAFgEX,EAAxBY,oBAEVF,EAAyBD,EAE7D,IAAmCE,EAAQA,EAAME,QAAQ,GAAGC,MAAM,KAAO,GAAzE,GAAOC,EAAP,KAAmBC,EAAnB,KAEA,OACE,yBAAKxB,UAAU,0BAA0ByB,KAAK,SAC1B,kBAAVN,GACN,yBAAKnB,UAAU,0CACb,uBAAGA,UAAU,wCAAb,aACA,uBAAGA,UAAU,kCAAb,OACIuB,EADJ,IACgB,8BAAOC,KAK3B,yBAAKxB,UAAU,6CACXG,GACA,oCACE,uBAAGH,UAAU,uCAAb,UAEE,4BACEA,UAAU,uCACV0B,UAAW,SAACb,GAAD,OAAWD,EAAiBC,EAAOG,IAC9CW,QAASX,GAHX,QAFF,MAWA,uBAAGhB,UAAU,uCAAb,OAEE,4BACEA,UAAU,uCACV0B,UAAW,SAACb,GAAD,OAAWD,EAAiBC,EAAOG,IAC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c,IAEf3V,EAAa,OAAS,MATzB,QAYA,YAIN,yBAAK5D,UAAU,8BACZ4a,EACC,oCACG8G,EAA8B9e,KAAI,SAACyf,GAAD,OACjC,kBAAC,WAAD,CAAUnf,IAAKmf,GACb,2BAAOriB,UAAU,oBACf,2BACEqC,KAAK,QACLT,KAAK,kBACLmE,GAAE,0BAAqBsc,GACvB3a,MAAO2a,EACPjb,UAAW0a,EAA0BhF,SAASuF,GAC9Clb,QAASkb,IAA4B/a,EACrCJ,SAAU,SAACrG,GACToB,EAAS,CACPI,KAAM,uBACNG,QAASsP,EAAIjR,EAAM6U,OAAOhO,YAIhC,0BAAM1H,UAAU,2BAA2BqiB,SAMnD,oCACGP,EAA0Blf,KAAI,SAAC0f,GAAD,OAC7B,kBAAC,WAAD,CAAUpf,IAAKof,GACb,2BAAOtiB,UAAU,oBACf,2BACEqC,KAAK,QACLT,KAAK,kBACLmE,GAAE,0BAAqBuB,GACvBI,MAAO4a,EACPnb,QAASmb,IAA6Bhb,EACtCJ,SAAU,SAACrG,GACToB,EAAS,CACPI,KAAM,uBACNG,QAASsP,EAAIjR,EAAM6U,OAAOhO,YAIhC,0BAAM1H,UAAU,2BAA2BsiB","file":"js/application~7c0edf50-bd43aa428fc2c0132474.chunk.js","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nimport './NoOptions.scss';\n\nconst NoOptions = ({ message }) => <p className=\"no-options\">{message}</p>;\n\nNoOptions.propTypes = {\n  message: PropTypes.string,\n};\n\nNoOptions.defaultProps = {\n  message: 'Sorry, there are no options available.',\n};\n\nexport default NoOptions;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { useSelector } from 'react-redux';\n\n// Style imports\nimport './OptionSelectorControl.scss';\n\nconst OptionSelectorControl = ({ isLast, step, pages, enquirePath, nextClicked }) => {\n  const deal = useSelector((state) => state.Deal);\n\n  const handleEnterPress = (event, fn) => {\n    if (event.which === 13) {\n      fn();\n    }\n  };\n\n  const handleNext = () => {\n    nextClicked();\n  };\n\n  const { monthlyPrice, maintainedMonthlyPrice, maintenanceSelected } = deal;\n\n  const price = maintenanceSelected ? maintainedMonthlyPrice : monthlyPrice;\n\n  const [wholePrice, decimalPrice] = price ? price.toFixed(2).split('.') : [];\n\n  return (\n    <div className=\"option-selector-control\" role=\"group\">\n      {typeof price === 'number' && (\n        <div className=\"option-selector-control__price-wrapper\">\n          <p className=\"option-selector-control__price-label\">Per month</p>\n          <p className=\"option-selector-control__price\">\n            £{wholePrice}.<span>{decimalPrice}</span>\n          </p>\n        </div>\n      )}\n\n      <div className=\"option-selector-control__buttons-wrapper\">\n        {!isLast && (\n          <>\n            <p className=\"option-selector-control__skip-label\">\n              Skip to\n              <button\n                className=\"option-selector-control__button-next\"\n                onKeyDown={(event) => handleEnterPress(event, handleNext)}\n                onClick={handleNext}\n              >\n                next\n              </button>\n              or\n            </p>\n            <p className=\"option-selector-control__next-label\">\n              Next\n              <button\n                className=\"option-selector-control__button-next\"\n                onKeyDown={(event) => handleEnterPress(event, handleNext)}\n                onClick={handleNext}\n              >\n                choose {pages[step + 1].name}\n              </button>\n              <span>or</span>\n            </p>\n          </>\n        )}\n\n        {/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}\n        <a\n          className=\"option-selector-control__enquire b-btn-gold font-weight-bold drv-button--xl\"\n          href=\"#\"\n          data-action=\"modal#close modal#load\"\n          data-target=\"enquire-modal\"\n          data-path={enquirePath}\n          role=\"button\"\n        >\n          ENQUIRE\n          <span className=\"drv-button__icon\" />\n        </a>\n      </div>\n    </div>\n  );\n};\n\nOptionSelectorControl.propTypes = {\n  isLast: PropTypes.bool.isRequired,\n  step: PropTypes.number.isRequired,\n  pages: PropTypes.arrayOf(\n    PropTypes.shape({\n      name: PropTypes.string,\n      component: PropTypes.node,\n    }),\n  ).isRequired,\n  enquirePath: PropTypes.string.isRequired,\n  nextClicked: PropTypes.func.isRequired,\n};\n\nexport default OptionSelectorControl;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { useDispatch, useSelector } from 'react-redux';\nimport classNames from 'classnames';\n\n// Style imports\nimport './OptionSelectorPagination.scss';\n\nconst OptionSelectorPagination = ({ name, pages, jumpToStep, loggedIn }) => {\n  // React Redux hooks\n  const dispatch = useDispatch();\n  const query = useSelector((state) => state.Deal);\n\n  const handleClick = (event, index) => {\n    event.preventDefault();\n\n    dispatch({ type: 'SET_DEAL_CURRENT_STEP', payload: index + 1 });\n\n    jumpToStep(index);\n  };\n\n  const handleViewChange = (event, type) => {\n    event.preventDefault();\n    const isSales = !!(type === 'sales');\n\n    if (isSales) {\n      jumpToStep(0);\n      dispatch({ type: 'SET_DEAL_CURRENT_STEP', payload: 1 });\n    }\n\n    dispatch({ type: 'SET_DEAL_SALES_VIEW', payload: isSales });\n  };\n\n  return (\n    <nav\n      className={classNames('option-selector-pagination', { 'option-selector-pagination--logged-in': loggedIn })}\n      aria-label=\"Deal options navigation\"\n    >\n      {loggedIn && (\n        <div className=\"option-selector-pagination__view-control\" role=\"group\">\n          <button\n            className={classNames('option-selector-pagination__button', 'option-selector-pagination__button--sales', {\n              'option-selector-pagination__button--active': query.salesView,\n            })}\n            onClick={(event) => handleViewChange(event, 'sales')}\n          >\n            <span className=\"sr-only\">Sales view</span>\n          </button>\n\n          <button\n            className={classNames(\n              'option-selector-pagination__button',\n              'option-selector-pagination__button--customer',\n              { 'option-selector-pagination__button--active': !query.salesView },\n            )}\n            onClick={(event) => handleViewChange(event, 'customer')}\n          >\n            <span className=\"sr-only\">Customer view</span>\n          </button>\n        </div>\n      )}\n\n      <h2 className=\"option-selector-pagination__title\">Select your {name.toLowerCase()}</h2>\n\n      <div className=\"option-selector-pagination__progress\">\n        {!!pages &&\n          pages.map((item, index) => {\n            const count = index + 1;\n\n            const listItemClasses = classNames({\n              'option-selector-pagination__item': true,\n              'option-selector-pagination__item--sales-view': loggedIn && query.salesView,\n              'option-selector-pagination__item--current': query.currentStep === count,\n            });\n\n            return (\n              <a key={item.name} href=\"/\" className={listItemClasses} onClick={(event) => handleClick(event, index)}>\n                <span className=\"option-selector-pagination__label\">{item.name}</span>\n              </a>\n            );\n          })}\n      </div>\n    </nav>\n  );\n};\n\nOptionSelectorPagination.propTypes = {\n  name: PropTypes.string.isRequired,\n  pages: PropTypes.arrayOf(\n    PropTypes.shape({\n      name: PropTypes.string,\n      component: PropTypes.node,\n    }),\n  ).isRequired,\n  loggedIn: PropTypes.bool.isRequired,\n  jumpToStep: PropTypes.func.isRequired,\n};\n\nexport default OptionSelectorPagination;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { useSelector, useDispatch } from 'react-redux';\n\n// Helpers\nimport {\n  getSelectedOptions,\n  isPaintwork,\n  isAllTrim,\n  isPacks,\n  isExterior,\n  isInterior,\n  isEquipment,\n  numberWithCommas,\n} from '../helpers';\n\n// Style Imports\nimport './OptionSelectorSummary.scss';\n\nconst OptionSelectorSummaryItem = ({ name, selected }) => {\n  return (\n    <li className=\"option-selector-summary__item\">\n      <p className=\"option-selector-summary__option-name\">{name}:</p>\n\n      <ul className=\"option-selector-summary__option-values\">\n        {selected.length > 0 &&\n          selected.map((item) => (\n            <li className=\"option-selector-summary__option-value\" key={item.description}>\n              {item.description}\n            </li>\n          ))}\n      </ul>\n    </li>\n  );\n};\n\nOptionSelectorSummaryItem.propTypes = {\n  name: PropTypes.string.isRequired,\n  selected: PropTypes.arrayOf(PropTypes.string).isRequired,\n};\n\nconst isPositiveNumber = (num) => typeof num === 'number' && num > 0;\n\nconst OptionSelectorSummary = ({ isPersonal, jumpToStep }) => {\n  // React Redux hooks\n  const dispatch = useDispatch();\n  const deal = useSelector((state) => state.Deal);\n\n  const handleClear = (event) => {\n    event.preventDefault();\n    dispatch({ type: 'CLEAR_SELECTED_OPTIONS' });\n    jumpToStep(0);\n  };\n\n  const selectedColour = getSelectedOptions(deal).filter(isPaintwork);\n  const selectedTrim = getSelectedOptions(deal).filter(isAllTrim);\n  const selectedPacks = getSelectedOptions(deal).filter(isPacks);\n  const selectedExterior = getSelectedOptions(deal).filter(isExterior);\n  const selectedInterior = getSelectedOptions(deal).filter(isInterior);\n  const selectedEquipment = getSelectedOptions(deal).filter(isEquipment);\n\n  const {\n    monthlyPrice,\n    maintainedMonthlyPrice,\n    maintenanceSelected,\n    initialPaymentPrice,\n    maintainedInitialPaymentPrice,\n  } = deal;\n\n  const price = maintenanceSelected ? maintainedMonthlyPrice : monthlyPrice;\n  const initialPayment = maintenanceSelected ? maintainedInitialPaymentPrice : initialPaymentPrice;\n\n  let priceParts;\n\n  if (isPositiveNumber(price)) {\n    priceParts = price.toFixed(2).toString().split('.');\n  }\n\n  return (\n    <div className=\"option-selector-summary\">\n      <div className=\"option-selector-summary__total\">\n        <p className=\"option-selector-summary__period\">Per month</p>\n        <p className=\"option-selector-summary__price\">\n          {isPositiveNumber(price) ? (\n            <>\n              £{priceParts[0]}\n              <span className=\"option-selector-summary__price-pence\">.{priceParts[1]}</span>\n            </>\n          ) : (\n            'Call us'\n          )}\n        </p>\n      </div>\n\n      {!!deal.lx_monthly_increase && <div className=\"alert alert-warning\">Luxury Car Tax has been applied.</div>}\n\n      <ul className=\"option-selector-summary__list\">\n        {isPositiveNumber(deal.annualMileage) && (\n          <li className=\"option-selector-summary__item\">\n            <p className=\"option-selector-summary__item-name\">Annual Mileage:</p>\n            <p className=\"option-selector-summary__item-value\">{numberWithCommas(deal.annualMileage)} miles</p>\n          </li>\n        )}\n\n        {isPositiveNumber(initialPayment) && (\n          <li className=\"option-selector-summary__item\">\n            <p className=\"option-selector-summary__item-name\">Initial Payment:</p>\n            <p className=\"option-selector-summary__item-value\">\n              £{numberWithCommas(initialPayment.toFixed(2))} ({isPersonal ? 'inc' : 'ex'}. VAT)\n            </p>\n          </li>\n        )}\n\n        <li className=\"option-selector-summary__item\">\n          <p className=\"option-selector-summary__item-name\">Contract Length:</p>\n          <p className=\"option-selector-summary__item-value\">{deal.contractLength} months</p>\n        </li>\n      </ul>\n\n      <h4 className=\"option-selector-summary__heading\">Your options</h4>\n\n      <ul className=\"option-selector-summary__list option-selector-summary__list--options\">\n        <OptionSelectorSummaryItem name=\"Colour\" selected={selectedColour} />\n\n        <OptionSelectorSummaryItem name=\"Trim\" selected={selectedTrim} />\n\n        <OptionSelectorSummaryItem name=\"Packs\" selected={selectedPacks} />\n\n        <OptionSelectorSummaryItem name=\"Exterior\" selected={selectedExterior} />\n\n        <OptionSelectorSummaryItem name=\"Interior\" selected={selectedInterior} />\n\n        <OptionSelectorSummaryItem name=\"Equipment\" selected={selectedEquipment} />\n      </ul>\n\n      <button className=\"option-selector-summary__clear\" onClick={handleClear}>\n        <span className=\"option-selector-summary__clear-icon\" />\n        Clear and start again\n      </button>\n    </div>\n  );\n};\n\nOptionSelectorSummary.propTypes = {\n  isPersonal: PropTypes.bool.isRequired,\n  jumpToStep: PropTypes.func.isRequired,\n};\n\nexport default OptionSelectorSummary;\n","import React from 'react';\nimport { useSelector, Provider } from 'react-redux';\nimport PropTypes from 'prop-types';\n\nimport store from '../../../store/store';\n\n// Style imports\nimport './OptionSelectorStockWarning.scss';\n\nconst EnquireNow = ({ enquirePath }) => {\n  return (\n    // eslint-disable-next-line jsx-a11y/anchor-is-valid\n    <a\n      className=\"option-selector-stock-warning__enquire-now\"\n      data-action=\"modal#close modal#load\"\n      data-target=\"enquire-modal\"\n      data-path={enquirePath}\n      href=\"#\"\n      role=\"button\"\n    >\n      Please enquire\n    </a>\n  );\n};\n\nEnquireNow.propTypes = {\n  enquirePath: PropTypes.string.isRequired,\n};\n\nconst OptionSelectorStockWarning = ({ enquirePath, channel }) => {\n  const deal = useSelector((state) => state.Deal);\n\n  if (!deal.isStock && !deal.isFrozen && !deal.isShortTerm) return null;\n\n  let warning_text = 'This vehicle is part of a limited stock deal and therefore options cannot be added.';\n  if (deal.isShortTerm) {\n    warning_text =\n      'Short term lease vehicle specifications cannot be customised as vehicles are either already built or on route from the factory.';\n  } else if (deal.isFrozen && !deal.isStock) {\n    warning_text = 'Additional options can not be selected at this time.';\n  }\n\n  return (\n    <div className=\"option-selector-stock-warning alert alert-info text-center\">\n      <p>\n        <span className=\"option-selector-stock-warning__emphasis\">Please note:</span> {warning_text}\n      </p>\n      {!deal.isShortTerm && (\n        <p>\n          <EnquireNow enquirePath={enquirePath} channel={channel} /> for specific requirements including choice of\n          colours.\n        </p>\n      )}\n    </div>\n  );\n};\n\nOptionSelectorStockWarning.propTypes = {\n  enquirePath: PropTypes.string.isRequired,\n  channel: PropTypes.string.isRequired,\n};\n\nexport default (props) => (\n  <Provider store={store}>\n    {/* eslint-disable-next-line react/jsx-props-no-spreading */}\n    <OptionSelectorStockWarning {...props} />\n  </Provider>\n);\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\n\nconst GalleryTabs = ({ selectedTab, onTabChange }) => {\n  const tabs = [\n    { id: 'all', label: 'All' },\n    { id: 'interior', label: 'Interior' },\n    { id: 'exterior', label: 'Exterior' },\n  ];\n\n  return (\n    <div className=\"drv-deal-content__gallery-tabs\">\n      {tabs.map((tab) => (\n        <button\n          key={tab.id}\n          className={classNames('drv-deal-content__gallery-tab', {\n            'drv-deal-content__gallery-tab--active': selectedTab === tab.id,\n          })}\n          onClick={() => onTabChange(tab.id)}\n        >\n          {tab.label}\n        </button>\n      ))}\n    </div>\n  );\n};\n\nGalleryTabs.propTypes = {\n  selectedTab: PropTypes.string.isRequired,\n  onTabChange: PropTypes.func.isRequired,\n};\n\nexport default GalleryTabs;\n","import React from 'react';\nimport PropTypes from 'prop-types';\n\nconst GallerySlide = ({ image, index, onClick, style }) => {\n  const handleKeyDown = (event) => {\n    if (event.key === 'Enter' || event.key === ' ') {\n      onClick();\n    }\n  };\n\n  return (\n    <div\n      className=\"drv-deal-content__carousel-slide\"\n      role=\"button\"\n      tabIndex={0}\n      onClick={onClick}\n      onKeyDown={handleKeyDown}\n      style={style}\n    >\n      <img src={image} alt=\"\" className=\"drv-deal-content__carousel-image\" data-index={index} style={style} />\n    </div>\n  );\n};\n\nGallerySlide.propTypes = {\n  image: PropTypes.string.isRequired,\n  index: PropTypes.number.isRequired,\n  onClick: PropTypes.func.isRequired,\n  style: PropTypes.shape({\n    visibility: PropTypes.string,\n  }),\n};\n\nGallerySlide.defaultProps = {\n  style: null,\n};\n\nexport default GallerySlide;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport SalesInfoItem from './SalesInfoItem';\n\nconst Dealer = ({ name, contact, commission, link, leadTime, stockList }) => {\n  const formatLeadTime = () => {\n    // eslint-disable-next-line no-useless-escape\n    return leadTime.replace(/<br\\s*[\\/]?>/gi, '\\n');\n  };\n\n  return (\n    <div className=\"g-deal-sales-info__group\">\n      {link && (\n        <div className=\"g-deal-sales-info__item\">\n          <p>\n            <a href={link}>{name}</a>\n          </p>\n        </div>\n      )}\n\n      <SalesInfoItem title=\"Lead time\" content={formatLeadTime()} />\n      <SalesInfoItem title=\"Commission\" content={commission} />\n      <SalesInfoItem title=\"Contact\" content={contact} />\n\n      {stockList && (\n        <div className=\"g-deal-sales-info__item\">\n          <p>\n            <a href={stockList}>View Stock List</a>\n          </p>\n        </div>\n      )}\n    </div>\n  );\n};\n\nDealer.propTypes = {\n  name: PropTypes.string.isRequired,\n  contact: PropTypes.string.isRequired,\n  commission: PropTypes.string.isRequired,\n  link: PropTypes.string.isRequired,\n  leadTime: PropTypes.string.isRequired,\n  stockList: PropTypes.string,\n};\n\nDealer.defaultProps = {\n  stockList: '',\n};\n\nexport default Dealer;\n","import React from 'react';\nimport PropTypes from 'prop-types';\n\n// Helpers\nimport { numberWithCommas } from './helpers';\n\nconst Option = ({\n  id,\n  onChange,\n  checked,\n  disabled,\n  visible,\n  description,\n  price,\n  initialMonths,\n  contractLength,\n  packDescriptions,\n  isAdmin,\n}) => {\n  if (!visible) return null;\n\n  const formatPriceForPeriod = (value, period = 'p/m') => `+ £${numberWithCommas(value.toFixed(2))} ${period}`;\n\n  const monthlyPrice = price / (initialMonths + contractLength - 1);\n  const displayPrice = monthlyPrice === 0 ? 'No cost' : formatPriceForPeriod(monthlyPrice);\n\n  return (\n    <div className=\"options-selector-group__item\">\n      <input\n        className=\"options-selector-group__input\"\n        id={`input_${id}`}\n        type=\"checkbox\"\n        name=\"options\"\n        onChange={onChange}\n        value={id}\n        checked={checked}\n        disabled={disabled}\n      />\n\n      <label className=\"options-selector-group__label\" htmlFor={`input_${id}`}>\n        <span className=\"options-selector-group__info\">\n          <span className=\"options-selector-group__description\">{description}</span>\n          <span className=\"options-selector-group__price\">\n            {disabled && checked ? 'Included in pack' : displayPrice}\n            {isAdmin && monthlyPrice !== 0 && (\n              <span className=\"options-selector-group__total-price\">{formatPriceForPeriod(price, 'total')}</span>\n            )}\n          </span>\n        </span>\n        {packDescriptions.length > 0 && (\n          <ul className=\"options-selector-group__contents c-list-ticks-featured\">\n            {packDescriptions.map((packDescription) => (\n              <li key={packDescription} className=\"c-list-ticks-featured__item\">\n                {packDescription}\n              </li>\n            ))}\n          </ul>\n        )}\n      </label>\n    </div>\n  );\n};\n\nOption.propTypes = {\n  id: PropTypes.string.isRequired,\n  onChange: PropTypes.func.isRequired,\n  checked: PropTypes.bool.isRequired,\n  disabled: PropTypes.bool.isRequired,\n  visible: PropTypes.bool.isRequired,\n  description: PropTypes.string.isRequired,\n  price: PropTypes.number.isRequired,\n  initialMonths: PropTypes.number.isRequired,\n  contractLength: PropTypes.number.isRequired,\n  packDescriptions: PropTypes.arrayOf(PropTypes.string).isRequired,\n  isAdmin: PropTypes.bool.isRequired,\n};\n\nexport default Option;\n","import React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { useDispatch, useSelector } from 'react-redux';\n\n// Component Imports\nimport OptionSelectorControl from './OptionSelectorControl';\nimport OptionSelectorPagination from './OptionSelectorPagination';\nimport OptionSelectorSummary from './OptionSelectorSummary';\nimport OptionSelectorStockWarning from './OptionSelectorStockWarning';\nimport OptionsGroup from '../OptionsGroup';\n\nconst OptionSelectorPage = ({\n  categories,\n  name,\n  pages,\n  isPersonal,\n  enquirePath,\n  isLast,\n  channel,\n  jumpToStep,\n  step,\n  loggedIn,\n}) => {\n  // React Redux hooks\n  const dispatch = useDispatch();\n  const query = useSelector((state) => state.Deal);\n\n  const [isTwoColumns, setIsTwoColumns] = useState(false);\n\n  const nextClicked = () => {\n    jumpToStep(step + 1);\n\n    dispatch({\n      type: 'SET_DEAL_CURRENT_STEP',\n      payload: !isLast ? query.currentStep + 1 : query.currentStep,\n    });\n  };\n\n  const backClicked = () => {\n    jumpToStep(step - 1);\n\n    dispatch({\n      type: 'SET_DEAL_CURRENT_STEP',\n      payload: query.currentStep - 1,\n    });\n  };\n\n  return (\n    <>\n      <OptionSelectorPagination name={name} pages={pages} jumpToStep={jumpToStep} loggedIn={loggedIn} />\n\n      <div className=\"option-selector__page\">\n        <div className=\"option-selector__page-inner option-selector__options\">\n          <OptionSelectorStockWarning enquirePath={enquirePath} channel={channel} />\n\n          <div\n            className={classNames('option-selector__page-content', {\n              'option-selector__page-content--two-columns': isTwoColumns,\n            })}\n          >\n            <OptionsGroup\n              categories={categories}\n              onNext={nextClicked}\n              onBack={backClicked}\n              channel={channel}\n              setTwoColumns={setIsTwoColumns}\n            />\n\n            {!query.isStock && !query.isFrozen && (\n              <p className=\"options-selector-group-skip\">\n                Choose an option\n                {!(loggedIn && query.salesView) && (\n                  <>\n                    {' '}\n                    or{' '}\n                    <button type=\"button\" className=\"b-btn b-btn-link b-btn-sm\" onClick={nextClicked}>\n                      Skip this step\n                    </button>\n                  </>\n                )}\n              </p>\n            )}\n          </div>\n        </div>\n\n        <div className=\"option-selector__page-inner option-selector__summary-wrapper\">\n          <OptionSelectorSummary isPersonal={isPersonal} jumpToStep={jumpToStep} />\n        </div>\n      </div>\n\n      <OptionSelectorControl\n        isLast={isLast}\n        pages={pages}\n        step={step}\n        nextClicked={nextClicked}\n        enquirePath={enquirePath}\n      />\n    </>\n  );\n};\n\nOptionSelectorPage.propTypes = {\n  name: PropTypes.string.isRequired,\n  pages: PropTypes.arrayOf(\n    PropTypes.shape({\n      name: PropTypes.string,\n      component: PropTypes.node,\n    }),\n  ).isRequired,\n  step: PropTypes.number.isRequired,\n  enquirePath: PropTypes.string.isRequired,\n  channel: PropTypes.string.isRequired,\n  isLast: PropTypes.bool.isRequired,\n  loggedIn: PropTypes.bool.isRequired,\n  categories: PropTypes.arrayOf(PropTypes.number).isRequired,\n  jumpToStep: PropTypes.func,\n  isPersonal: PropTypes.bool.isRequired,\n};\n\nOptionSelectorPage.defaultProps = {\n  jumpToStep: () => {},\n};\n\nexport default OptionSelectorPage;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport StepZilla from 'react-stepzilla';\nimport { Provider, useSelector } from 'react-redux';\n\n// Component Imports\nimport OptionSelectorPage from './OptionSelectorPage';\n\n// Categories\nimport {\n  allCategories,\n  categoriesColour,\n  categoriesTrim,\n  categoriesPacks,\n  categoriesExterior,\n  categoriesInterior,\n  categoriesEquipment,\n} from '../../../data/optionCategories';\n\n// Redux\nimport store from '../../../store/store';\n\n// Style Imports\nimport './OptionSelector.scss';\n\nconst OptionSelector = ({ isPersonal, enquirePath, channel, loggedIn }) => {\n  const query = useSelector((state) => state.Deal);\n\n  const stepsArray = [];\n\n  const loggedInSteps = [{ name: 'All options', categories: allCategories }];\n\n  const customerSteps = [\n    { name: 'Colour', categories: categoriesColour },\n    { name: 'Trim', categories: categoriesTrim },\n    { name: 'Packs', categories: categoriesPacks },\n    { name: 'Exterior', categories: categoriesExterior },\n    { name: 'Interior', categories: categoriesInterior },\n    { name: 'Equipment', categories: categoriesEquipment },\n  ];\n\n  const stepsView = loggedIn && query.salesView ? loggedInSteps : customerSteps;\n\n  for (let i = 0; i < stepsView.length; i += 1) {\n    const step = {\n      name: stepsView[i].name,\n      component: (\n        <OptionSelectorPage\n          step={i}\n          name={stepsView[i].name}\n          categories={stepsView[i].categories}\n          isLast={i === stepsView.length - 1}\n          loggedIn={loggedIn}\n          pages={stepsView}\n          isPersonal={isPersonal}\n          enquirePath={enquirePath}\n          channel={channel}\n        />\n      ),\n    };\n\n    stepsArray.push(step);\n  }\n\n  return (\n    <StepZilla\n      showSteps={false}\n      steps={stepsArray}\n      stepsNavigation={false}\n      showNavigation={false}\n      preventEnterSubmission\n      startAtStep={query.currentStep - 1}\n    />\n  );\n};\n\nOptionSelector.propTypes = {\n  isPersonal: PropTypes.bool.isRequired,\n  enquirePath: PropTypes.string.isRequired,\n  channel: PropTypes.string.isRequired,\n  loggedIn: PropTypes.bool.isRequired,\n};\n\nexport default function OptionSelectorProvider(props) {\n  return (\n    <Provider store={store}>\n      {/* eslint-disable-next-line react/jsx-props-no-spreading */}\n      <OptionSelector {...props} />\n    </Provider>\n  );\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Provider, useSelector } from 'react-redux';\n\n// Redux store\nimport store from '../../store/store';\n\n// Helpers\nimport { getSelectedOptions } from './helpers';\nimport { formatPrice } from '../../utils';\n\nconst CarTax = ({ taxConfig, p11d, vat }) => {\n  const deal = useSelector((state) => state.Deal);\n  const options = getSelectedOptions(deal);\n  const totalOptionPrice =\n    options.length > 0 ? options.map((option) => option.price).reduce((total, num) => total + num) : null;\n\n  const bik_value = (benefit, p11dParam, percentage) => {\n    if (!benefit || !p11dParam) {\n      return 'N/A';\n    }\n\n    return formatPrice((p11dParam + totalOptionPrice * vat) * (benefit / 100) * (percentage / 100));\n  };\n\n  return (\n    <>\n      <h2 className=\"drv-text-title drv-mb-4\">Company car tax calculator</h2>\n      <div className=\"table-responsive\">\n        <table className=\"drv-table drv-mt-4\">\n          <thead>\n            <tr>\n              <th>Tax Year</th>\n              <th>BIK</th>\n              <th>BIK Value</th>\n              <th>Tax Payable at 20%</th>\n              <th>Tax Payable at 40%</th>\n            </tr>\n          </thead>\n          <tbody>\n            {taxConfig.map(({ year, benefit }) => (\n              <tr key={year}>\n                <td>{year}</td>\n                <td>{benefit ? `${benefit}%` : 'N/A'}</td>\n                <td>{bik_value(benefit, p11d, 100)}</td>\n                <td>{bik_value(benefit, p11d, 20)}</td>\n                <td>{bik_value(benefit, p11d, 40)}</td>\n              </tr>\n            ))}\n          </tbody>\n        </table>\n      </div>\n    </>\n  );\n};\n\nCarTax.propTypes = {\n  taxConfig: PropTypes.arrayOf(\n    PropTypes.shape({\n      year: PropTypes.number,\n      benefit: PropTypes.number,\n    }),\n  ).isRequired,\n  p11d: PropTypes.number.isRequired,\n  vat: PropTypes.number.isRequired,\n};\n\nexport default function CarTaxWrapper(props) {\n  return (\n    <Provider store={store}>\n      {/* eslint-disable-next-line react/jsx-props-no-spreading */}\n      <CarTax {...props} />\n    </Provider>\n  );\n}\n","import React, { useState, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport useEmblaCarousel from 'embla-carousel-react';\n\nimport GalleryTabs from './GalleryTabs';\nimport GallerySlide from './GallerySlide';\nimport GalleryNavigation from './GalleryNavigation';\n\nconst ContentIntroGallery = ({ exteriorImages, interiorImages }) => {\n  const [selectedTab, setSelectedTab] = useState('exterior');\n  const [loadedImages, setLoadedImages] = useState(new Set());\n  const [emblaRef, emblaApi] = useEmblaCarousel({\n    loop: true,\n    align: 'center',\n    skipSnaps: false,\n    dragFree: false,\n    breakpoints: {\n      '(min-width: 768px)': { align: 'start' },\n    },\n  });\n\n  const alternateImages = (extImages, intImages) => {\n    if (!intImages || intImages.length === 0) {\n      return extImages;\n    }\n\n    const result = [];\n    const maxLength = Math.max(extImages.length, intImages.length);\n\n    for (let i = 0; i < maxLength; i++) {\n      if (i < extImages.length) {\n        result.push(extImages[i]);\n      }\n      if (i < intImages.length) {\n        result.push(intImages[i]);\n      }\n    }\n\n    return result;\n  };\n\n  useEffect(() => {\n    if (interiorImages?.length) {\n      setSelectedTab('all');\n    }\n  }, [interiorImages]);\n\n  const allImages = [...alternateImages(exteriorImages, interiorImages || [])];\n\n  // Preload all images on mount\n  useEffect(() => {\n    const allImgs = [...alternateImages(exteriorImages, interiorImages || [])];\n    allImgs.forEach((url) => {\n      const img = new Image();\n      img.src = url;\n      img.onload = () => {\n        setLoadedImages((prev) => new Set([...prev, url]));\n      };\n    });\n  }, [exteriorImages, interiorImages]);\n\n  // Listen for gallery param changes\n  useEffect(() => {\n    const handleGalleryChange = (event) => {\n      const { gallery } = event.detail;\n      if (gallery === 'interior' && interiorImages?.length >= 2) {\n        setSelectedTab('interior');\n        emblaApi?.scrollTo(0);\n      }\n    };\n\n    window.addEventListener('galleryParamChanged', handleGalleryChange);\n    return () => window.removeEventListener('galleryParamChanged', handleGalleryChange);\n  }, [emblaApi, interiorImages]);\n\n  const filteredImages = () => {\n    if (!interiorImages?.length) {\n      return exteriorImages;\n    }\n    switch (selectedTab) {\n      case 'interior':\n        return interiorImages;\n      case 'exterior':\n        return exteriorImages;\n      default:\n        return allImages;\n    }\n  };\n\n  const handleTabChange = (tab) => {\n    setSelectedTab(tab);\n    emblaApi?.scrollTo(0);\n  };\n\n  const handleImageClick = (image) => {\n    const event = new CustomEvent('alt-gallery:open', {\n      detail: {\n        imageUrl: image,\n        type: selectedTab,\n      },\n    });\n    document.dispatchEvent(event);\n  };\n\n  return (\n    <div className=\"drv-deal-content__gallery\">\n      {interiorImages?.length >= 2 && (\n        <GalleryTabs selectedTab={selectedTab} onTabChange={handleTabChange} interiorImages={interiorImages} />\n      )}\n\n      <div className=\"drv-deal-content__carousel\" ref={emblaRef}>\n        <div className=\"drv-deal-content__carousel-container\">\n          {filteredImages().map((image, index) => (\n            <GallerySlide\n              key={image}\n              image={image}\n              index={index}\n              onClick={() => handleImageClick(image)}\n              style={{ visibility: loadedImages.has(image) ? 'visible' : 'hidden' }}\n            />\n          ))}\n        </div>\n      </div>\n\n      {filteredImages().length > 1 && <GalleryNavigation emblaApi={emblaApi} />}\n    </div>\n  );\n};\n\nContentIntroGallery.propTypes = {\n  exteriorImages: PropTypes.arrayOf(PropTypes.string).isRequired,\n  interiorImages: PropTypes.arrayOf(PropTypes.string),\n};\n\nContentIntroGallery.defaultProps = {\n  interiorImages: [],\n};\n\nexport default ContentIntroGallery;\n","import React from 'react';\nimport PropTypes from 'prop-types';\n\nimport { Provider, useSelector } from 'react-redux';\n\nimport store from '../../store/store';\n\nimport MonthlyPrice from './MonthlyPrice/MonthlyPrice';\nimport UpfrontPrice from './UpfrontPrice/UpfrontPrice';\n\nconst Enquire = ({ paths, leaseType, isPersonal, isVan, phoneNumber, dealType }) => {\n  const deal = useSelector((state) => state.Deal);\n\n  const {\n    monthlyPrice,\n    maintainedMonthlyPrice,\n    maintenanceSelected,\n    initialPaymentPrice,\n    maintainedInitialPaymentPrice,\n    isFinanceLease,\n  } = deal;\n\n  const enquirePath = `${paths.enquire}&use_finance_lease=${isFinanceLease}`;\n  const callbackPath = paths.callback;\n\n  const price = maintenanceSelected ? maintainedMonthlyPrice : monthlyPrice;\n  const initialPayment = maintenanceSelected ? maintainedInitialPaymentPrice : initialPaymentPrice;\n\n  const carDealTypeLabel = dealType === 'RatebookDeal' ? 'Guide price' : leaseType;\n\n  return (\n    <>\n      <div className=\"g-deal-enquire__price\">\n        <div className=\"g-deal-enquire__monthly\">\n          <h4>\n            {dealType === 'RatebookDeal' && (\n              <span\n                className=\"b-info\"\n                data-toggle=\"tooltip\"\n                data-placement=\"top\"\n                data-original-title=\"This is an auto generated rate. Please enquire for most competitive quote.\"\n              />\n            )}\n            {isVan ? 'Business Lease' : carDealTypeLabel} {!isPersonal && <span>ex VAT</span>}\n          </h4>\n          <MonthlyPrice price={price} isLoading={deal.URLParamsInit && !deal.URLParamsApplied} isEnquire />\n        </div>\n        {typeof initialPayment === 'number' && initialPayment > 0 && (\n          <UpfrontPrice\n            price={initialPayment}\n            isPersonal={isPersonal}\n            isLoading={deal.URLParamsInit && !deal.URLParamsApplied}\n            isEnquire\n          />\n        )}\n      </div>\n      <div className=\"drv-deal-enquire__action\">\n        {/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}\n        <a\n          href=\"#\"\n          data-action=\"modal#load\"\n          data-target=\"enquire-modal\"\n          data-path={enquirePath}\n          role=\"button\"\n          className=\"drv-deal-enquire__button drv-button drv-button--green drv-button--xl drv-button--icon\"\n        >\n          ENQUIRE\n          <span className=\"drv-button__icon\" />\n        </a>\n      </div>\n      <div className=\"g-deal-enquire__additional\">\n        <p className=\"g-deal-enquire__call\">\n          Call <a href={`tel:${phoneNumber}`}>{phoneNumber}</a>\n        </p>\n        <p className=\"g-deal-enquire__callback\">\n          {/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}\n          <a href=\"#\" data-action=\"modal#load\" data-target=\"callback-modal\" data-path={callbackPath} role=\"button\">\n            Request a callback\n          </a>\n        </p>\n      </div>\n    </>\n  );\n};\n\nEnquire.propTypes = {\n  paths: PropTypes.shape({\n    enquire: PropTypes.string.isRequired,\n    callback: PropTypes.string.isRequired,\n  }).isRequired,\n  leaseType: PropTypes.string.isRequired,\n  isPersonal: PropTypes.bool.isRequired,\n  isVan: PropTypes.bool.isRequired,\n  phoneNumber: PropTypes.string.isRequired,\n  dealType: PropTypes.string,\n};\n\nEnquire.defaultProps = {\n  dealType: '',\n};\n\nexport default function EnquireWrapper(props) {\n  return (\n    <Provider store={store}>\n      {/* eslint-disable-next-line react/jsx-props-no-spreading */}\n      <Enquire {...props} />\n    </Provider>\n  );\n}\n","import React from 'react';\n\nexport default () => (\n  <svg\n    aria-hidden=\"true\"\n    focusable=\"false\"\n    data-prefix=\"fas\"\n    data-icon=\"exclamation-triangle\"\n    role=\"img\"\n    xmlns=\"http://www.w3.org/2000/svg\"\n    viewBox=\"0 0 576 512\"\n    className=\"svg-inline--fa fa-exclamation-triangle\"\n  >\n    <path\n      fill=\"currentColor\"\n      d=\"M569.517 440.013C587.975 472.007 564.806 512 527.94 512H48.054c-36.937 0-59.999-40.055-41.577-71.987L246.423 23.985c18.467-32.009 64.72-31.951 83.154 0l239.94 416.028zM288 354c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z\"\n    />\n  </svg>\n);\n","/* eslint-disable no-nested-ternary */\nimport React, { useState, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport useEmblaCarousel from 'embla-carousel-react';\n\nimport GalleryNavigation from '../ContentIntroGallery/GalleryNavigation';\n\nconst Lightbox = ({ exteriorImages, interiorImages }) => {\n  const [selectedTab, setSelectedTab] = useState(interiorImages?.length ? 'all' : 'exterior');\n  const [loadedImages, setLoadedImages] = useState(new Set());\n  const [emblaRef, emblaApi] = useEmblaCarousel({\n    loop: true,\n    align: 'center',\n    skipSnaps: false,\n  });\n\n  const alternateImages = (extImages, intImages) => {\n    if (!intImages || intImages.length === 0) {\n      return extImages;\n    }\n\n    const result = [];\n    const maxLength = Math.max(extImages.length, intImages.length);\n\n    for (let i = 0; i < maxLength; i++) {\n      if (i < extImages.length) {\n        result.push(extImages[i]);\n      }\n      if (i < intImages.length) {\n        result.push(intImages[i]);\n      }\n    }\n\n    return result;\n  };\n\n  const allImages = [...alternateImages(exteriorImages, interiorImages || [])];\n\n  // Preload all images on mount\n  useEffect(() => {\n    const allImgs = [...alternateImages(exteriorImages, interiorImages)];\n    allImgs.forEach((url) => {\n      const img = new Image();\n      img.src = url;\n      img.onload = () => {\n        setLoadedImages((prev) => new Set([...prev, url]));\n      };\n    });\n  }, [exteriorImages, interiorImages]);\n\n  // Listen for lightbox events from Stimulus\n  useEffect(() => {\n    const handleLightboxOpen = (event) => {\n      const { imageUrl, type } = event.detail;\n      if (emblaApi) {\n        let currentImages;\n        if (type === 'interior' && interiorImages?.length) {\n          currentImages = interiorImages;\n        } else if (type === 'exterior') {\n          currentImages = exteriorImages;\n        } else {\n          currentImages = interiorImages?.length ? allImages : exteriorImages;\n        }\n\n        const index = currentImages.findIndex((img) => img === imageUrl);\n\n        emblaApi.scrollTo(index >= 0 ? index : 0);\n        setSelectedTab(\n          type === 'all' && interiorImages?.length\n            ? 'all'\n            : type === 'interior' && interiorImages?.length\n              ? 'interior'\n              : 'exterior',\n        );\n      }\n    };\n\n    window.addEventListener('lightbox:open', handleLightboxOpen);\n    return () => window.removeEventListener('lightbox:open', handleLightboxOpen);\n  }, [emblaApi, allImages, interiorImages, exteriorImages]);\n\n  const filteredImages = () => {\n    if (!interiorImages?.length) {\n      return exteriorImages;\n    }\n    switch (selectedTab) {\n      case 'interior':\n        return interiorImages;\n      case 'exterior':\n        return exteriorImages;\n      default:\n        return allImages;\n    }\n  };\n\n  return (\n    <div className=\"drv-lightbox-modal__content\">\n      <div className=\"drv-lightbox-modal__carousel\" ref={emblaRef}>\n        <div className=\"drv-lightbox-modal__carousel-container\">\n          {filteredImages().map((image) => (\n            <div key={image} className=\"drv-lightbox-modal__slide\">\n              <img\n                src={image}\n                alt=\"\"\n                className=\"drv-lightbox-modal__image\"\n                style={{ visibility: loadedImages.has(image) ? 'visible' : 'hidden' }}\n              />\n            </div>\n          ))}\n        </div>\n      </div>\n\n      <GalleryNavigation emblaApi={emblaApi} />\n    </div>\n  );\n};\n\nLightbox.propTypes = {\n  exteriorImages: PropTypes.arrayOf(PropTypes.string).isRequired,\n  interiorImages: PropTypes.arrayOf(PropTypes.string),\n};\n\nLightbox.defaultProps = {\n  interiorImages: [],\n};\n\nexport default Lightbox;\n","import React from 'react';\nimport PropTypes from 'prop-types';\n\n// Component Imports\nimport OptionsGroup from '../../OptionsGroup';\n\nimport { categoriesColour } from '../../../../data/optionCategories';\n\nconst Colour = ({ channel, setTwoColumns }) => {\n  return <OptionsGroup categories={categoriesColour} channel={channel} setTwoColumns={setTwoColumns} />;\n};\n\nColour.propTypes = {\n  channel: PropTypes.string.isRequired,\n  setTwoColumns: PropTypes.func.isRequired,\n};\n\nexport default Colour;\n","/* eslint-disable react/jsx-props-no-spreading */\nimport React, { useState, useEffect, memo } from 'react';\nimport PropTypes from 'prop-types';\nimport { useSelector, Provider, useDispatch } from 'react-redux';\n\n// Redux store\nimport store from '../../store/store';\n\n// Helpers\nimport { contains } from '../../utils';\nimport { numberWithCommas } from './helpers';\n\nconst PaintSwatch = memo(({ description, lowLight, midLight, highLight, isSelected }) => {\n  const style = {\n    background: `linear-gradient(90deg, ${lowLight} 0%, ${midLight} 50%, ${highLight} 100%)`,\n  };\n\n  return (\n    <span\n      className={`drv-paint-swatch drv-paint-swatch--large ${isSelected ? 'drv-paint-swatch--selected' : ''}`}\n      style={style}\n      title={description}\n    />\n  );\n});\n\nPaintSwatch.propTypes = {\n  description: PropTypes.string.isRequired,\n  lowLight: PropTypes.string.isRequired,\n  midLight: PropTypes.string.isRequired,\n  highLight: PropTypes.string.isRequired,\n  isSelected: PropTypes.bool.isRequired,\n};\n\nconst PaintSwatches = ({ paintsData, initialPaint }) => {\n  const deal = useSelector((state) => state.Deal);\n  const dispatch = useDispatch();\n  const [selectedPaint, setSelectedPaint] = useState(null);\n  const [showPaints, setShowPaints] = useState(false);\n  const isFrozenOrStock = deal.isFrozen || deal.isStock;\n\n  useEffect(() => {\n    let newSelectedPaint = null;\n    const url = new URL(window.location);\n    const paintPreviewId = url.searchParams.get('paint_preview');\n\n    if (paintPreviewId) {\n      if (isFrozenOrStock) {\n        newSelectedPaint = deal.options.find((option) => String(option.id) === String(paintPreviewId));\n        setSelectedPaint(newSelectedPaint);\n        return;\n      }\n      url.searchParams.delete('paint_preview');\n      window.history.replaceState({}, '', url);\n    }\n\n    if (deal.URLParamsInit || deal.URLParamsApplied) {\n      const selectedPaintId = paintsData.find(({ cap_paint }) =>\n        contains(String(cap_paint.option_code), deal.selected.actuallySelectedOptionIds.map(String)),\n      );\n      if (selectedPaintId) {\n        newSelectedPaint = deal.options.find(\n          (option) => String(option.id) === String(selectedPaintId.cap_paint.option_code),\n        );\n        setSelectedPaint(newSelectedPaint);\n      }\n    } else if (initialPaint) {\n      const initialPaintOption = paintsData.find(({ imagin_paint }) => imagin_paint?.code === initialPaint);\n      if (initialPaintOption) {\n        newSelectedPaint = deal.options.find(\n          (option) => String(option.id) === String(initialPaintOption.cap_paint.option_code),\n        );\n        setSelectedPaint(newSelectedPaint);\n      }\n    }\n  }, [\n    deal.URLParamsInit,\n    deal.URLParamsApplied,\n    deal.selected.actuallySelectedOptionIds,\n    deal.options,\n    initialPaint,\n    paintsData,\n    isFrozenOrStock,\n  ]);\n\n  const handlePaintSelect = (optionId) => {\n    if (selectedPaint) {\n      if (!isFrozenOrStock) {\n        dispatch({\n          type: 'OPTIONS.REMOVE',\n          id: String(selectedPaint.id),\n        });\n      } else {\n        const url = new URL(window.location);\n        url.searchParams.delete('paint_preview');\n        window.history.replaceState({}, '', url);\n      }\n    }\n\n    const newSelectedPaint = deal.options.find((option) => String(option.id) === String(optionId));\n    setSelectedPaint(newSelectedPaint);\n\n    if (!isFrozenOrStock) {\n      dispatch({\n        type: 'OPTIONS.ADD',\n        id: String(optionId),\n      });\n    } else {\n      const url = new URL(window.location);\n      url.searchParams.set('paint_preview', optionId);\n      window.history.replaceState({ turbolinks: {} }, '', url);\n      window.dispatchEvent(new PopStateEvent('popstate'));\n    }\n  };\n\n  const monthlyPrice = selectedPaint ? selectedPaint.price / (deal.initialMonths + deal.contractLength - 1) : 0;\n  const displayPrice = monthlyPrice === 0 ? 'No cost' : `+ £${numberWithCommas(monthlyPrice.toFixed(2))} p/m`;\n\n  return (\n    <>\n      <p className=\"drv-deal-hero__images-info drv-deal-hero__images-info--mobile\">\n        Images are for illustrative purposes only\n      </p>\n      <button\n        className={`drv-paint-selector__toggle ${showPaints ? 'drv-paint-selector__toggle--open' : ''}`}\n        onClick={() => setShowPaints(!showPaints)}\n      >\n        Select colour\n      </button>\n\n      <div className={`drv-paint-selector ${showPaints ? '' : 'drv-paint-selector--hidden'}`}>\n        <div className=\"d-flex justify-content-between mb-4\">\n          {(deal.URLParamsApplied || isFrozenOrStock) && selectedPaint && (\n            <div className=\"drv-paint-selector__description\">\n              <b>Select your Colour Swatch:</b>\n              <br />\n              <span className=\"drv-paint-selector__paint-name\">\n                {' '}\n                {selectedPaint.description}{' '}\n                {!isFrozenOrStock && <span className=\"drv-paint-selector__price\">{displayPrice}</span>}\n              </span>\n            </div>\n          )}\n          <p className=\"drv-deal-hero__images-info drv-deal-hero__images-info--desktop\">\n            Images are for illustrative purposes only\n          </p>\n        </div>\n        <div className=\"drv-paint-selector__wrapper\">\n          {paintsData.length > 0 &&\n            paintsData.map(({ cap_paint, imagin_paint }) => {\n              if (imagin_paint) {\n                const isSelected = String(selectedPaint?.id) === String(cap_paint.option_code);\n                return (\n                  <div key={cap_paint.option_code} className=\"drv-paint-selector__radio-group\">\n                    <input\n                      type=\"radio\"\n                      id={`paint_${cap_paint.option_code}`}\n                      name=\"paint\"\n                      value={cap_paint.option_code}\n                      checked={isSelected}\n                      onChange={() => handlePaintSelect(cap_paint.option_code)}\n                    />\n                    <label htmlFor={`paint_${cap_paint.option_code}`} className=\"drv-paint-selector__label\">\n                      <PaintSwatch\n                        description={cap_paint.description}\n                        lowLight={imagin_paint.low_light}\n                        midLight={imagin_paint.mid_light}\n                        highLight={imagin_paint.high_light}\n                        isSelected={isSelected}\n                      />\n                    </label>\n                  </div>\n                );\n              }\n              return null;\n            })}\n        </div>\n        <p className=\"drv-paint-selector__disclaimer\">\n          Not all paint options may be available. Some colours may incur an additional fee. Please enquire\n        </p>\n      </div>\n    </>\n  );\n};\n\nPaintSwatches.propTypes = {\n  initialPaint: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\n  paintsData: PropTypes.arrayOf(\n    PropTypes.shape({\n      cap_paint: PropTypes.shape({\n        option_code: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\n        description: PropTypes.string.isRequired,\n      }).isRequired,\n      imagin_paint: PropTypes.shape({\n        code: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\n        low_light: PropTypes.string.isRequired,\n        mid_light: PropTypes.string.isRequired,\n        high_light: PropTypes.string.isRequired,\n      }),\n    }),\n  ).isRequired,\n};\n\nconst PaintSwatchesWrapper = (props) => (\n  <Provider store={store}>\n    <PaintSwatches {...props} />\n  </Provider>\n);\n\nexport default PaintSwatchesWrapper;\n","import React, { useEffect } from 'react';\nimport { Provider, useDispatch, useSelector } from 'react-redux';\nimport Rails from '@rails/ujs';\nimport PropTypes from 'prop-types';\nimport { unique, currentChannelPath } from '../../utils';\nimport { maintenanceLink } from './helpers';\n\nimport store from '../../store/store';\n\nimport MotoringTerms from './MotoringTerms';\nimport FinanceLease from './FinanceLease';\n\nconst DEFAULT_TERM = 24;\nconst DEFAULT_INITIAL_MONTHS = 9;\n\n//    toQueryString :: Obj -> String\nconst toQueryString = (params) => {\n  const esc = encodeURIComponent;\n\n  return Object.keys(params)\n    .map((key) => `${esc(key)}=${esc(params[key])}`)\n    .join('&');\n};\n\n//    int :: String -> Int\nconst int = (string) => parseInt(string, 10);\n\nconst Pricing = ({\n  mileages,\n  shortTermMileages,\n  paths,\n  terms,\n  shortTerms,\n  initialPayments,\n  shortTermInitialPaymentsByTerm,\n  defaultInitialPaymentMonthsByTerm,\n  init,\n  isVan,\n  channel,\n  hasShortTerm,\n  hasStandardTerm,\n}) => {\n  const dispatch = useDispatch();\n  const deal = useSelector((state) => state.Deal);\n\n  const resetReduxState = () => {\n    dispatch({ type: 'RESET_DEAL_STATE' });\n  };\n\n  useEffect(() => {\n    document.addEventListener('turbolinks:load', resetReduxState());\n\n    dispatch({\n      type: 'INITIALISE',\n      payload: {\n        contractLength: int(init.contractLength || DEFAULT_TERM),\n        annualMileage: int(init.annualMileage),\n        initialMonths: int(init.initialMonths || DEFAULT_INITIAL_MONTHS),\n        monthlyPrice: init.monthlyPrice,\n        maintainedMonthlyPrice: init.maintainedMonthlyPrice,\n        initialPaymentPrice: init.initialPaymentPrice,\n        maintainedInitialPaymentPrice: init.maintainedInitialPaymentPrice,\n        isFinanceLease: init.useFinanceLease,\n        dealId: init.dealId,\n        isShortTerm: init.isShortTerm,\n        make: init.make,\n        model: init.model,\n        trim: init.trim,\n        isVan,\n        fueltype: init.fuelType,\n        transmission: init.transmission,\n        price: init.price,\n      },\n    });\n\n    return () => {\n      document.removeEventListener('turbolinks:load', resetReduxState());\n    };\n  }, []);\n\n  const {\n    annualMileage,\n    contractLength,\n    initialMonths,\n    initialised,\n    monthlyPrice,\n    maintainedMonthlyPrice,\n    maintenanceSelected,\n    initialPaymentPrice,\n    maintainedInitialPaymentPrice,\n    isFinanceLease,\n  } = deal;\n\n  const maintenancePrice = maintainedMonthlyPrice && Math.max(0, maintainedMonthlyPrice - monthlyPrice);\n\n  const price = maintenanceSelected ? maintainedMonthlyPrice : monthlyPrice;\n  const initialPayment = maintenanceSelected ? maintainedInitialPaymentPrice : initialPaymentPrice;\n\n  const initialiseOptions = () => {\n    const loadOptionsForSelectedPricingType =\n      // eslint-disable-next-line eqeqeq\n      (typeof deal.optionsIsPersonal === 'undefined' || deal.optionsIsPersonal != deal.isPersonal) &&\n      typeof deal.derivativeId !== 'undefined';\n\n    if (loadOptionsForSelectedPricingType) {\n      const url = `/${channel}/deals/${deal.dealId}/options.json${window.location.search}`;\n      Rails.ajax({\n        url,\n        type: 'GET',\n        dataType: 'json',\n        accept: 'application/json',\n        success: (result) => {\n          dispatch({ type: 'OPTIONS.INIT', ...result });\n\n          // If any 'actuallySelectedOptionIds' are present\n          // For each id dispatch an OPTION.ADD event as though the user clicked an option\n          deal.selected.actuallySelectedOptionIds.forEach((option) => {\n            dispatch({ type: 'OPTIONS.ADD', id: option });\n          });\n        },\n        error: () => {},\n      });\n      return <p>Loading...</p>;\n    }\n  };\n\n  const fetchPrice = () => {\n    // this bit is really important. We need to wait until redux has been initialised with the right data before continuing.\n    // when switching to another deal the previous deal might still be in state, and if it is (i.e. this deal and that deal aren't the same) then don't continue until the new deal has finished initialising.\n    if (\n      !initialised ||\n      (initialised && typeof deal.derivativeId !== 'undefined' && deal.derivativeId !== init.derivativeId)\n    )\n      return;\n\n    if (isFinanceLease) {\n      dispatch({ type: 'STORE_MONTHLY_PRICE', payload: init.financeLeaseMonthlyPrice });\n      dispatch({ type: 'STORE_INITIAL_PAYMENT', payload: init.financeLeaseInitialPaymentPrice });\n      return;\n    }\n\n    const data = {};\n\n    if (annualMileage) {\n      data.mileage = annualMileage;\n    }\n\n    if (contractLength) {\n      data.term = contractLength;\n    }\n\n    if (initialMonths) {\n      data.initial_payment = initialMonths;\n    }\n\n    if (init.modelYear) {\n      data.model_year = init.modelYear;\n    }\n\n    const params = new URLSearchParams(window.location.search);\n\n    // On load check URL for option_ids[]\n    if (params.get('option_ids[]')) {\n      // If exists get all unique options into an array\n      const optionIDArray = unique(params.getAll('option_ids[]'));\n\n      // Only run this once - deal.URLParamsInit flag set to true after first run\n      if (!deal.URLParamsInit && deal.isTurbolinksLoad) {\n        // Set selected options in redux equal to url params\n        dispatch({\n          type: 'DEAL_URL_PARAMS_INIT',\n          payload: optionIDArray,\n        });\n      }\n    }\n\n    let url = `${window.location.pathname}.json?${toQueryString(data)}`;\n\n    if (deal.selected.actuallySelectedOptionIds) {\n      deal.selected.actuallySelectedOptionIds.forEach((id) => {\n        url += `&option_ids[]=${id}`;\n      });\n    }\n\n    if (params.get('utm_source')) {\n      url += `&utm_source=${params.get('utm_source')}`;\n    }\n\n    if (params.get('utm_medium')) {\n      url += `&utm_medium=${params.get('utm_medium')}`;\n    }\n\n    if (params.get('utm_campaign')) {\n      url += `&utm_campaign=${params.get('utm_campaign')}`;\n    }\n\n    if (params.get('paint_preview')) {\n      url += `&paint_preview=${params.get('paint_preview')}`;\n    }\n\n    Rails.ajax({\n      url,\n      type: 'GET',\n      dataType: 'json',\n      accept: 'application/json',\n      success: (result) => {\n        dispatch({ type: 'STORE_UPDATED_PRICE', payload: result });\n\n        window.history.replaceState({ turbolinks: {} }, '', url.replace('.json', ''));\n        window.dispatchEvent(new PopStateEvent('popstate')); // Manually trigger popstate event\n      },\n      error: () => {}, // TODO: do we need to actually use this?\n    });\n  };\n\n  const setIsPageLoad = () => {\n    dispatch({ type: 'SET_TURBOLINKS_LOAD' });\n  };\n\n  useEffect(() => {\n    fetchPrice();\n\n    window.addEventListener('turbolinks:load', setIsPageLoad);\n    return () => window.removeEventListener('turbolinks:load', setIsPageLoad);\n  }, [initialised, contractLength, annualMileage, initialMonths, isFinanceLease, deal.selected.optionIds]);\n\n  // Initialise Options once we have a derivateID present\n  useEffect(() => {\n    initialiseOptions();\n  }, [deal.derivativeId]);\n\n  // this bit is really important. We need to wait until redux has been initialised with the right data before continuing.\n  if (!initialised) return null;\n\n  return (\n    <div className=\"drv-deal-sidebar-selections l-deal__sidebar-selections\">\n      <h2 className=\"drv-deal-sidebar-title d-none d-lg-block\">Personalise your lease</h2>\n      {isVan && (\n        <div className=\"drv-switch drv-mt-6 drv-mb-4\">\n          <input\n            className=\"drv-switch-checkbox\"\n            type=\"checkbox\"\n            checked={isFinanceLease}\n            onChange={(e) =>\n              dispatch({\n                type: 'STORE_FINANCE_LEASE',\n                payload: e.target.checked,\n              })\n            }\n          />\n          <label className=\"drv-switch-label\">\n            <span className=\"drv-switch-label-option\">Contract Hire</span>\n            <span className=\"drv-switch-label-option\">Finance Lease</span>\n          </label>\n        </div>\n      )}\n      {isFinanceLease ? (\n        <FinanceLease />\n      ) : (\n        <>\n          <MotoringTerms\n            price={price}\n            annualMileage={annualMileage}\n            contractLength={contractLength}\n            initialMonths={initialMonths}\n            mileages={mileages}\n            shortTermMileages={shortTermMileages}\n            terms={terms}\n            shortTerms={shortTerms}\n            initialPayments={initialPayments}\n            initialPayment={initialPayment}\n            shortTermInitialPaymentsByTerm={shortTermInitialPaymentsByTerm}\n            defaultInitialPaymentMonthsByTerm={defaultInitialPaymentMonthsByTerm}\n            hasShortTerm={hasShortTerm}\n            hasStandardTerm={hasStandardTerm}\n            isPersonal={init.isPersonal}\n          />\n\n          {!Number.isNaN(maintenancePrice) && maintenancePrice > 0 && (\n            <>\n              <div className=\"drv-text-larger\">Add a Maintenance and Tyre Plan</div>\n              <div className=\"drv-block drv-mb-4\">\n                Only{' '}\n                <span className=\"drv-deal-sidebar__option-value drv-text-gold-darker drv-text-bold\">\n                  £{maintenancePrice.toFixed(2)}\n                </span>{' '}\n                {init.isPersonal ? 'inc. VAT' : 'ex. VAT'}{' '}\n                <a\n                  href={maintenanceLink(isVan)}\n                  target=\"_blank\"\n                  rel=\"noreferrer\"\n                  className=\"drv-link drv-text-accent drv-text-bold\"\n                >\n                  Find out more\n                </a>\n              </div>\n              <label htmlFor=\"maintenanceCheck-true\" className=\"drv-checkbox__label drv-ml-1\">\n                <input\n                  type=\"radio\"\n                  name=\"maintenanceCheck\"\n                  id=\"maintenanceCheck-true\"\n                  className=\"drv-checkbox drv-checkbox--radio\"\n                  value=\"true\"\n                  checked={maintenanceSelected}\n                  onChange={() =>\n                    dispatch({\n                      type: 'STORE_MAINTENANCE_SELECTED',\n                      payload: true,\n                    })\n                  }\n                />\n                <span className=\"\">Yes I’d like the maintenance plan</span>\n              </label>\n              <label htmlFor=\"maintenanceCheck-false\" className=\"drv-checkbox__label drv-ml-1\">\n                <input\n                  type=\"radio\"\n                  name=\"maintenanceCheck\"\n                  id=\"maintenanceCheck-false\"\n                  className=\"drv-checkbox drv-checkbox--radio\"\n                  value=\"false\"\n                  checked={!maintenanceSelected}\n                  onChange={() =>\n                    dispatch({\n                      type: 'STORE_MAINTENANCE_SELECTED',\n                      payload: false,\n                    })\n                  }\n                />\n                <span className=\"\">No, I&apos;ll maintain it myself</span>\n              </label>\n            </>\n          )}\n\n          <div className=\"drv-block drv-mt-8\">\n            {/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}\n            <a\n              className=\"drv-button drv-button--blue drv-button--large drv-text-bold\"\n              href=\"#\"\n              data-action=\"modal#load\"\n              data-target=\"options-modal\"\n              data-path={`${currentChannelPath(paths.options)}?deal_id=${deal.dealId}`}\n              role=\"button\"\n            >\n              Select colour, trim and options\n            </a>\n          </div>\n        </>\n      )}\n    </div>\n  );\n};\n\nPricing.propTypes = {\n  init: PropTypes.shape({\n    derivativeId: PropTypes.number.isRequired,\n    dealId: PropTypes.number,\n    modelYear: PropTypes.string,\n    monthlyPrice: PropTypes.number,\n    financeLeaseInitialPaymentPrice: PropTypes.number,\n    financeLeaseMonthlyPrice: PropTypes.number,\n    maintainedInitialPaymentPrice: PropTypes.number,\n    maintainedMonthlyPrice: PropTypes.number,\n    initialPaymentPrice: PropTypes.number,\n    contractLength: PropTypes.number.isRequired,\n    annualMileage: PropTypes.number.isRequired,\n    initialMonths: PropTypes.number,\n    useFinanceLease: PropTypes.bool,\n    isPersonal: PropTypes.bool.isRequired,\n    isShortTerm: PropTypes.bool.isRequired,\n    make: PropTypes.string,\n    model: PropTypes.string,\n    trim: PropTypes.string,\n    fuelType: PropTypes.string,\n    transmission: PropTypes.string,\n    price: PropTypes.number,\n  }).isRequired,\n  isVan: PropTypes.bool.isRequired,\n  terms: PropTypes.arrayOf(PropTypes.number).isRequired,\n  mileages: PropTypes.arrayOf(PropTypes.number).isRequired,\n  paths: PropTypes.shape({\n    enquire: PropTypes.string.isRequired,\n    options: PropTypes.string.isRequired,\n  }).isRequired,\n  hasShortTerm: PropTypes.bool,\n  hasStandardTerm: PropTypes.bool,\n  shortTermMileages: PropTypes.arrayOf(PropTypes.number).isRequired,\n  shortTerms: PropTypes.arrayOf(PropTypes.number).isRequired,\n  initialPayments: PropTypes.arrayOf(PropTypes.number).isRequired,\n  shortTermInitialPaymentsByTerm: PropTypes.objectOf(PropTypes.arrayOf(PropTypes.number)).isRequired,\n  defaultInitialPaymentMonthsByTerm: PropTypes.objectOf(PropTypes.number).isRequired,\n  channel: PropTypes.string,\n};\n\nPricing.defaultProps = {\n  hasShortTerm: false,\n  hasStandardTerm: false,\n  channel: '',\n};\n\nexport default function PricingWrapper(props) {\n  return (\n    <Provider store={store}>\n      {/* eslint-disable-next-line react/jsx-props-no-spreading */}\n      <Pricing {...props} />\n    </Provider>\n  );\n}\n","import React, { useEffect, useState } from 'react';\nimport PropTypes from 'prop-types';\nimport { useSelector, Provider } from 'react-redux';\nimport Rails from '@rails/ujs';\n\nimport NumberFormat from 'react-number-format';\nimport store from '../../store/store';\nimport SalesInfoItem from './SalesInfoItem';\nimport Dealer from './Dealer';\n\n// Helpers\nimport { getSelectedOptions, isPaintwork, isTrim, isOther, selectedOfferId } from './helpers';\n\nconst SalesInfo = ({\n  emailQuotePath,\n  reportAProblemPath,\n  financeLeaseTerm,\n  financeLeaseMileage,\n  financeLeaseInitialPayment,\n}) => {\n  const data = useSelector((state) => state.Deal);\n  const [state, setState] = useState({\n    deal: {},\n    derivative: {},\n    dealers: [],\n  });\n\n  const [otherOptions, setOtherOptions] = useState([]);\n  const [colourOptions, setColourOptions] = useState([]);\n  const [trimOptions, setTrimOptions] = useState([]);\n  const [isHidden, setIsHidden] = useState(false);\n\n  const fetchOffer = () => {\n    const offerId = selectedOfferId(data);\n\n    if (offerId) {\n      Rails.ajax({\n        url: `/offers/${offerId}.json`,\n        type: 'GET',\n        dataType: 'json',\n        accept: 'application/json',\n        success: (result) => {\n          setState(result);\n        },\n        error: () => {},\n      });\n    } else {\n      setState({\n        deal: {},\n        derivative: {},\n        dealers: [],\n      });\n    }\n  };\n\n  const getOptions = () => {\n    if (data.selected.optionIds.length > 0) {\n      const selectedColour = getSelectedOptions(data).filter(isPaintwork);\n      const selectedTrim = getSelectedOptions(data).filter(isTrim);\n      const selectedOther = getSelectedOptions(data).filter(isOther);\n\n      setColourOptions(selectedColour);\n      setTrimOptions(selectedTrim);\n      setOtherOptions(selectedOther);\n    }\n  };\n\n  useEffect(() => {\n    fetchOffer();\n    getOptions();\n  }, [data.offerId, data.selected.optionIds, data.maintenanceSelected]);\n\n  const MISSING_VALUE = '-';\n\n  const formatLeadTimes = () => {\n    const formattedArray = [];\n\n    state.leadTimes.forEach((item) => {\n      // eslint-disable-next-line no-useless-escape\n      formattedArray.push(item.leadTime.replace(/<br\\s*[\\/]?>/gi, '\\n'));\n    });\n\n    return formattedArray.join(' / ');\n  };\n\n  const formatDealType = (value) => {\n    const splitValue = value.replace(/([A-Z])/g, ' $1');\n    const result = splitValue.charAt(0).toUpperCase() + splitValue.slice(1);\n\n    return result;\n  };\n\n  const listOptions = (options) => {\n    return options.map((option) => option.description);\n  };\n\n  const toggleVisibility = () => {\n    setIsHidden(!isHidden);\n  };\n\n  return (\n    <div className={`g-deal-sales-info__wrap ${isHidden ? 'hidden' : ''}`}>\n      <button className=\"g-deal-sales-info__toggle-button\" onClick={toggleVisibility}>\n        {isHidden ? 'Show sales info' : 'Hide sales info'}\n      </button>\n      <div className=\"g-deal-sales-info__scroll-container\">\n        <div className=\"g-deal-sales-info__group\">\n          <div className=\"g-deal-sales-info__item\">\n            <h4>Funder</h4>\n\n            {state.funderName ? (\n              <p>\n                <span className={`b-label b-label--${state.funderName.toLowerCase()}`}>{state.funderName}</span>\n                <span className=\"text-uppercase font-weight-bold\">\n                  {data.maintenanceSelected && state.deal.withMaintenance && ' & Rivervale'}\n                </span>\n              </p>\n            ) : (\n              <p>{MISSING_VALUE}</p>\n            )}\n          </div>\n\n          {state.regulatedMarketingSupport && (\n            <div className=\"g-deal-sales-info__item\">\n              <h4>Regulated marketing support</h4>\n              <p>{state.regulatedMarketingSupport}</p>\n            </div>\n          )}\n\n          {state.nonRegulatedMarketingSupport && (\n            <div className=\"g-deal-sales-info__item\">\n              <h4>Non-regulated marketing support</h4>\n              <p>{state.nonRegulatedMarketingSupport}</p>\n            </div>\n          )}\n\n          {state.leadTimes && <SalesInfoItem title=\"Lead times\" content={formatLeadTimes()} />}\n\n          <div className=\"g-deal-sales-info__item\">\n            <h4>Deal expires</h4>\n            <p>{state.deal.expiresAt || 'No expiry'}</p>\n          </div>\n\n          <div className=\"g-deal-sales-info__item\">\n            <h4>Deal type</h4>\n            <p>{state.deal.type ? formatDealType(state.deal.type) : MISSING_VALUE}</p>\n          </div>\n\n          <div className=\"g-deal-sales-info__item\">\n            <h4>CAP ID</h4>\n            <p>{state.derivative.capId || MISSING_VALUE}</p>\n          </div>\n\n          <div className=\"g-deal-sales-info__item\">\n            <h4>Managed by</h4>\n            <p>{state.deal.managedBy || MISSING_VALUE}</p>\n          </div>\n\n          <div className=\"g-deal-sales-info__item\">\n            <h4>Price updated</h4>\n            <p>\n              {state.deal.lastUpdatedAt ? (\n                <>\n                  {state.deal.lastUpdatedAt} ago\n                  {state.deal.lastUpdatedBy ? ` by ${state.deal.lastUpdatedBy}` : ''}\n                </>\n              ) : (\n                MISSING_VALUE\n              )}\n            </p>\n          </div>\n\n          <div className=\"g-deal-sales-info__item\">\n            <h4>In stock?</h4>\n            <p>{state.deal.stock || MISSING_VALUE}</p>\n          </div>\n\n          <div className=\"g-deal-sales-info__item\">\n            <h4>Is pre-order?</h4>\n            <p>{state.deal.pre_order || MISSING_VALUE}</p>\n          </div>\n\n          <div className=\"g-deal-sales-info__item\">\n            <h4>\n              Model year\n              {state.deal.specAt ? ' / spec date' : ''}\n            </h4>\n            <p>\n              {state.derivative.modelYear || MISSING_VALUE}\n              {state.deal.specAt ? ` / ${state.deal.specAt}` : ''}\n            </p>\n          </div>\n\n          {!state.deal.short_term && (\n            <>\n              <div className=\"g-deal-sales-info__item\">\n                <h4>Funder commission</h4>\n                <p>{state.commission || MISSING_VALUE}</p>\n              </div>\n\n              <div className=\"g-deal-sales-info__item\">\n                <h4>Paint</h4>\n                <p>{state.paint || MISSING_VALUE}</p>\n              </div>\n\n              <SalesInfoItem title=\"OTR 1\" content={state.otr} />\n\n              <SalesInfoItem title=\"OTR 2\" content={state.otr2} />\n\n              <div className=\"g-deal-sales-info__item\">\n                <h4>Discount</h4>\n                <p>{state.discount || MISSING_VALUE}</p>\n              </div>\n            </>\n          )}\n\n          {state.deal.short_term && (\n            <>\n              {state.doc_fee && (\n                <div className=\"g-deal-sales-info__item\">\n                  <h4>Doc fee</h4>\n                  <p>\n                    <NumberFormat\n                      value={state.doc_fee}\n                      displayType=\"text\"\n                      thousandSeparator\n                      prefix=\"£\"\n                      fixedDecimalScale\n                      decimalScale={2}\n                    />\n                  </p>\n                </div>\n              )}\n              {state.collection_fee && (\n                <div className=\"g-deal-sales-info__item\">\n                  <h4>Collection fee</h4>\n                  <p>\n                    <NumberFormat\n                      value={state.collection_fee}\n                      displayType=\"text\"\n                      thousandSeparator\n                      prefix=\"£\"\n                      fixedDecimalScale\n                      decimalScale={2}\n                    />\n                  </p>\n                </div>\n              )}\n              <SalesInfoItem title=\"Includes insrance?\" content={state.includes_insurance} />\n              <SalesInfoItem title=\"Includes maintenance?\" content={state.includes_maintenance} />\n              <SalesInfoItem title=\"includes breakdown cover?\" content={state.includes_breakdown_cover} />\n              <SalesInfoItem title=\"Minimum age\" content={state.minimum_age} />\n              <SalesInfoItem title=\"Discount code\" content={state.discount_code} />\n              <SalesInfoItem title=\"Discount amount\" content={state.discount_amount} />\n              {state.funder_url && (\n                <div className=\"g-deal-sales-info__item\">\n                  <p>\n                    <a href={state.funder_url} target=\"_blank\" rel=\"noreferrer\">\n                      View Funder Website\n                    </a>\n                  </p>\n                </div>\n              )}\n            </>\n          )}\n\n          <SalesInfoItem alert title=\"Restrictions / additional information\" content={state.restrictions} />\n        </div>\n\n        {state.dealers.map((dealer) => (\n          <Dealer\n            key={dealer.id}\n            commission={dealer.commission}\n            contact={dealer.contact}\n            leadTime={dealer.leadTime}\n            link={dealer.link}\n            name={dealer.name}\n            stockList={dealer.stock_list}\n          />\n        ))}\n      </div>\n      <div className=\"g-deal-sales-info__footer\">\n        <div className=\"g-deal-sales-info__item\">\n          {/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}\n          <a\n            href=\"#\"\n            className=\"b-btn btn-block b-btn-link b-btn-link--danger\"\n            data-action=\"modal#load\"\n            data-target=\"report_a_problem_modal\"\n            data-path={`${reportAProblemPath}?deal_type=${state.deal.type && formatDealType(state.deal.type)}&funder_maintenance=${data.maintenanceSelected}&colour_options=${listOptions(colourOptions)}&trim_options=${listOptions(trimOptions)}&other_options=${listOptions(otherOptions)}`}\n            role=\"button\"\n          >\n            Report this deal\n          </a>\n        </div>\n\n        {/* NOTE: Current implementation allow to send the form before fetching the offer details due to async logic if you click super fast */}\n        <div className=\"g-deal-sales-info__item\">\n          <form data-action=\"modal#load\" data-target=\"quote_modal\" action={emailQuotePath} method=\"post\">\n            <input type=\"hidden\" name=\"quotation[type]\" value=\"NewVehicleQuotation\" />\n            <input type=\"hidden\" name=\"offer[id]\" value={data.offerId} />\n            <input type=\"hidden\" name=\"quotation[is_electric]\" value={data.pluginOrElectric || ''} />\n            <input type=\"hidden\" name=\"quotation[funder_id]\" value={state.funderId || ''} />\n            <input type=\"hidden\" name=\"quotation[deal_id]\" value={state.deal.id || ''} />\n            <input type=\"hidden\" name=\"quotation[derivative_id]\" value={state.derivative.id || ''} />\n            <input type=\"hidden\" name=\"quotation[monthly_rental]\" value={data.monthlyPrice || ''} />\n            <input\n              type=\"hidden\"\n              name=\"quotation[maintained_monthly_rental]\"\n              value={data.maintainedMonthlyPrice || ''}\n            />\n            <input\n              type=\"hidden\"\n              name=\"quotation[term]\"\n              value={data.isFinanceLease ? financeLeaseTerm : data.contractLength || ''}\n            />\n            <input\n              type=\"hidden\"\n              name=\"quotation[mileage]\"\n              value={data.isFinanceLease ? financeLeaseMileage : data.annualMileage || ''}\n            />\n            <input\n              type=\"hidden\"\n              name=\"quotation[initial_payments]\"\n              value={data.isFinanceLease ? financeLeaseInitialPayment : data.initialMonths || ''}\n            />\n            <input type=\"hidden\" name=\"quotation[funder_maintenance]\" value={data.maintenanceSelected || false} />\n            <input\n              type=\"hidden\"\n              name=\"quotation[maintenance]\"\n              value={data.maintainedMonthlyPrice - data.monthlyPrice || ''}\n            />\n            {colourOptions.length > 0 &&\n              colourOptions.map((option) => (\n                <input\n                  type=\"hidden\"\n                  name=\"quotation[colour_option]\"\n                  value={option.description}\n                  key={option.description}\n                />\n              ))}\n            {trimOptions.length > 0 &&\n              trimOptions.map((option) => (\n                <input\n                  type=\"hidden\"\n                  name=\"quotation[trim_option]\"\n                  value={option.description}\n                  key={option.description}\n                />\n              ))}\n            {otherOptions.length > 0 &&\n              otherOptions.map((option) => (\n                <input\n                  type=\"hidden\"\n                  name=\"quotation[other_options][]\"\n                  value={option.description}\n                  key={option.description}\n                />\n              ))}\n            <p>\n              <button className=\"b-btn b-btn-green b-btn-block\" type=\"submit\">\n                Send email quote\n              </button>\n            </p>\n          </form>\n        </div>\n      </div>\n    </div>\n  );\n};\n\nSalesInfo.propTypes = {\n  emailQuotePath: PropTypes.string.isRequired,\n  financeLeaseTerm: PropTypes.number.isRequired,\n  financeLeaseMileage: PropTypes.number.isRequired,\n  financeLeaseInitialPayment: PropTypes.number.isRequired,\n  reportAProblemPath: PropTypes.string.isRequired,\n};\n\nexport default function SalesInfoWrapper(props) {\n  return (\n    <Provider store={store}>\n      {/* eslint-disable-next-line react/jsx-props-no-spreading */}\n      <SalesInfo {...props} />\n    </Provider>\n  );\n}\n","import React, { useState, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport { Provider, useDispatch, useSelector } from 'react-redux';\n\n// Redux store\nimport store from '../../store/store';\n\n// Helpers\nimport { getSelectedOptions, numberWithCommas, selectedOfferId, maintenanceLink } from './helpers';\n\nconst Summary = ({\n  p11d,\n  adminFee,\n  isPersonal,\n  isVan,\n  VAT,\n  derivativeId,\n  financeLeaseTerm,\n  financeLeaseMileage,\n  financeLeaseInitialPayment,\n  shortTerms,\n  phoneNumber,\n}) => {\n  const dispatch = useDispatch();\n  const deal = useSelector((state) => state.Deal);\n  const options = getSelectedOptions(deal);\n\n  const offerId = selectedOfferId(deal);\n  const {\n    annualMileage,\n    contractLength,\n    initialMonths,\n    maintenanceSelected,\n    isFinanceLease,\n    maintainedMonthlyPrice,\n    monthlyPrice,\n  } = deal;\n\n  const [shortTerm] = useState(shortTerms.indexOf(contractLength) > -1);\n  const [maintenancePrice, setMaintenancePrice] = useState(null);\n  const formUrl = isVan ? '/van-leasing/order-online' : '/car-leasing/order-online';\n\n  useEffect(() => {\n    if (maintainedMonthlyPrice && monthlyPrice) {\n      const price = Math.max(0, maintainedMonthlyPrice - monthlyPrice).toFixed(2);\n      setMaintenancePrice(price);\n    } else {\n      setMaintenancePrice(0);\n    }\n  }, [maintainedMonthlyPrice, monthlyPrice]);\n\n  const formatValues = (value) => {\n    return `£${numberWithCommas(parseFloat(value).toFixed(2))}`;\n  };\n\n  const leaseType = () => {\n    if (isFinanceLease) return 'Finance Lease';\n    if (isPersonal) return 'Personal Contract Hire';\n\n    return 'Business Contract Hire';\n  };\n\n  const leaseTypeTooltip = () => {\n    if (isFinanceLease)\n      return 'A Finance Lease (FL) agreement gives you the option to sell the vehicle at the end of your arrangement, and to keep a percentage of the proceeds, providing there’s still equity in the vehicle. You can also choose to enter a secondary lease period to extend the contract. A Finance Lease vehicle cannot, under normal circumstances, be purchased outright by the customer, unless there’s specific agreement in place with the funder.';\n    if (isPersonal)\n      return 'Personal Contract Hire (PCH) is the industry term for the most common type of vehicle lease agreement. You choose your vehicle, set your annual mileage, and pay an ‘initial payment’ to bring down the overall cost. You then pay a fixed monthly fee for the duration of your contract.';\n\n    return 'Business Contract Hire (BCH) is the industry terminology for the most common type of business lease agreement. You choose your vehicle, set your annual mileage, and pay an ‘initial payment’ to bring down the overall cost of the deal. You then pay a fixed monthly fee for the duration of your contract.';\n  };\n\n  return (\n    <>\n      <div className=\"l-deal__sidebar-summary drv-deal-sidebar-summary drv-mt-6\">\n        <hr className=\"drv-hr drv-mb-4 d-none d-xl-block\" />\n        <div className=\"drv-deal-sidebar-summary__title\">Your Deal Summary</div>\n        <ul className=\"drv-list-table\">\n          <li className=\"drv-list-table__item\">\n            <span className=\"drv-list-table__title\" data-controller=\"tooltip\" data-tooltip-placement-value=\"left\">\n              <span className=\"drv-info\" data-tooltip-target=\"button\" />\n              Lease Type\n              <span className=\"drv-tooltip\" role=\"tooltip\" data-tooltip-target=\"tooltip\">\n                {leaseTypeTooltip()}\n                <span className=\"drv-tooltip__arrow\" data-popper-arrow />\n              </span>\n            </span>\n            <span className=\"drv-list-table__data\">{leaseType()}</span>\n          </li>\n          <li className=\"drv-list-table__item\">\n            <span className=\"drv-list-table__title\">P11D</span>\n            <span className=\"drv-list-table__data\">{formatValues(p11d)}</span>\n          </li>\n          <li className=\"drv-list-table__item\">\n            <span className=\"drv-list-table__title\">Initial Payment</span>\n            <span className=\"drv-list-table__data\">\n              {isFinanceLease ? financeLeaseInitialPayment : initialMonths} months\n            </span>\n          </li>\n          <li className=\"drv-list-table__item\">\n            <span className=\"drv-list-table__title\">Contract Length</span>\n            <span className=\"drv-list-table__data\">{isFinanceLease ? financeLeaseTerm : contractLength} months</span>\n          </li>\n          <li className=\"drv-list-table__item\">\n            <span className=\"drv-list-table__title\">Annual mileage</span>\n            <span className=\"drv-list-table__data\">\n              {isFinanceLease ? numberWithCommas(financeLeaseMileage) : numberWithCommas(annualMileage)} miles\n            </span>\n          </li>\n          {maintenancePrice > 0 && (\n            <li className=\"drv-list-table__item\">\n              <span className=\"drv-list-table__title\">\n                Maintenance Plan\n                <a\n                  href={maintenanceLink(isVan)}\n                  target=\"_blank\"\n                  rel=\"noreferrer\"\n                  className=\"drv-list-table__info drv-link drv-text-accent\"\n                >\n                  Find out more\n                </a>\n              </span>\n              <span className=\"drv-list-table__data\">\n                {isFinanceLease || shortTerm ? (\n                  'No Thanks'\n                ) : (\n                  <label\n                    htmlFor=\"maintenanceCheck\"\n                    className=\"drv-checkbox__label drv-ml-1\"\n                    style={{ alignItems: 'flex-start' }}\n                  >\n                    <input\n                      className=\"drv-checkbox\"\n                      style={{ marginRight: '0', marginTop: '4px' }}\n                      checked={maintenanceSelected}\n                      onChange={(event) =>\n                        dispatch({\n                          type: 'STORE_MAINTENANCE_SELECTED',\n                          payload: event.target.checked,\n                        })\n                      }\n                      type=\"checkbox\"\n                      id=\"maintenanceCheck\"\n                    />\n                    <span className=\"drv-ml-2\" style={{ textAlign: 'right' }}>\n                      Only £{maintenancePrice}\n                      <br />\n                      {isPersonal ? 'inc. VAT' : 'ex. VAT'}\n                    </span>\n                  </label>\n                )}\n              </span>\n            </li>\n          )}\n          <li className=\"drv-list-table__item\">\n            <span className=\"drv-list-table__title\" data-controller=\"tooltip\" data-tooltip-placement-value=\"left\">\n              <span className=\"drv-info\" data-tooltip-target=\"button\" />\n              Arrangement fee\n              <div className=\"drv-tooltip\" role=\"tooltip\" data-tooltip-target=\"tooltip\">\n                The arrangement fee is the cost of our services i.e. processing the order and lease agreement, and is\n                charged at point of order. Please refer to our Initial Disclosure Document for more information.\n                <div className=\"drv-tooltip__arrow\" data-popper-arrow />\n              </div>\n            </span>\n            <span className=\"drv-list-table__data\">\n              {isPersonal ? `${formatValues(adminFee * VAT)} inc VAT` : `${formatValues(adminFee)} ex VAT`}\n            </span>\n          </li>\n          <li className=\"drv-list-table__item\">\n            <span className=\"drv-list-table__title\" data-controller=\"tooltip\" data-tooltip-placement-value=\"left\">\n              <span className=\"drv-info\" data-tooltip-target=\"button\" />\n              Road tax\n              <div className=\"drv-tooltip\" role=\"tooltip\" data-tooltip-target=\"tooltip\">\n                Additional charges may apply – please refer to our terms and conditions.\n                <div className=\"drv-tooltip__arrow\" data-popper-arrow />\n              </div>\n            </span>\n            <span className=\"drv-list-table__data drv-text-bold\">INCLUDED</span>\n          </li>\n          <li className=\"drv-list-table__item\">\n            <span className=\"drv-list-table__title\" data-controller=\"tooltip\" data-tooltip-placement-value=\"left\">\n              <span className=\"drv-info\" data-tooltip-target=\"button\" />\n              Breakdown cover\n              <div className=\"drv-tooltip\" role=\"tooltip\" data-tooltip-target=\"tooltip\">\n                Duration of cover may vary, please ask your Leasing Consultant for further details.\n                <div className=\"drv-tooltip__arrow\" data-popper-arrow />\n              </div>\n            </span>\n            <span className=\"drv-list-table__data drv-text-bold\">INCLUDED</span>\n          </li>\n          <li className=\"drv-list-table__item\">\n            <span className=\"drv-list-table__title\" data-controller=\"tooltip\" data-tooltip-placement-value=\"left\">\n              <span className=\"drv-info\" data-tooltip-target=\"button\" />\n              Delivery\n              <div className=\"drv-tooltip\" role=\"tooltip\" data-tooltip-target=\"tooltip\">\n                Vehicles usually driven unless stated, please speak with your leasing consultant for further\n                information.\n                <div className=\"drv-tooltip__arrow\" data-popper-arrow />\n              </div>\n            </span>\n            <span className=\"drv-list-table__data drv-text-bold\">\n              FREE UK MAINLAND <br />\n              <small className=\"drv-text-small\">(Exclusions apply)</small>\n            </span>\n          </li>\n        </ul>\n      </div>\n\n      <div className=\"drv-deal-contents drv-deal-sidebar-order l-deal__sidebar-order\">\n        <h3 className=\"drv-deal-sidebar-summary__title drv-text-bold drv-text-accent drv-text-centre\">\n          Happy with your deal?\n        </h3>\n        <p className=\"drv-text drv-mb-4 drv-text-centre\">\n          Apply for finance and order your <br /> brand new car now!\n        </p>\n        <form noValidate action={formUrl} method=\"get\">\n          <input type=\"hidden\" name=\"initial_payment_months\" value={initialMonths} />\n          <input type=\"hidden\" name=\"maintenance_selected\" value={maintenanceSelected} />\n\n          {offerId && <input type=\"hidden\" name=\"offer_id\" value={offerId} />}\n\n          {!offerId && <input type=\"hidden\" name=\"term\" value={contractLength} />}\n\n          {!offerId && <input type=\"hidden\" name=\"mileage\" value={annualMileage} />}\n\n          {!offerId && <input type=\"hidden\" name=\"derivative_id\" value={derivativeId} />}\n\n          {options.length > 0 &&\n            options.map((option) => (\n              <input type=\"hidden\" name=\"selected_option_ids[]\" value={option.id} key={option.id} />\n            ))}\n\n          <button\n            className=\"drv-button drv-deal-sidebar-summary__button drv-button--xl drv-button--gold drv-button--icon\"\n            style={{ justifyContent: 'center' }}\n          >\n            ORDER NOW\n            <span className=\"drv-button__icon\" />\n          </button>\n        </form>\n        <p className=\"drv-text drv-mt-4 drv-mb-4 drv-text-centre\">\n          <span className=\"drv-text-bold\">Need help?</span> Call us on{' '}\n          <a href={`tel:${phoneNumber}`} className=\"drv-link drv-text-larger drv-text-bold drv-link--unstyled\">\n            {phoneNumber}\n          </a>\n        </p>\n        <hr className=\"drv-hr\" />\n        <small className=\"drv-text drv-text-extra-small\">\n          Excess mileage fees may apply. Underwriting restrictions may apply. Please see our IDD for details of costs of\n          our services, remuneration and commission.\n        </small>\n        <small className=\"drv-text drv-text-extra-small drv-text-bold drv-mt-2\">\n          Please note, Select Car Leasing is a broker, not a lender.\n        </small>\n      </div>\n    </>\n  );\n};\n\nSummary.propTypes = {\n  p11d: PropTypes.string.isRequired,\n  isPersonal: PropTypes.bool.isRequired,\n  isVan: PropTypes.bool.isRequired,\n  adminFee: PropTypes.number.isRequired,\n  derivativeId: PropTypes.number.isRequired,\n  financeLeaseTerm: PropTypes.number.isRequired,\n  financeLeaseMileage: PropTypes.number.isRequired,\n  financeLeaseInitialPayment: PropTypes.number.isRequired,\n  VAT: PropTypes.number,\n  shortTerms: PropTypes.arrayOf(PropTypes.number).isRequired,\n  phoneNumber: PropTypes.string.isRequired,\n};\n\nSummary.defaultProps = {\n  VAT: 0,\n};\n\nexport default function SummaryWrapper(props) {\n  return (\n    <Provider store={store}>\n      {/* eslint-disable-next-line react/jsx-props-no-spreading */}\n      <Summary {...props} />\n    </Provider>\n  );\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\n\nconst SummaryItem = ({ name, selected }) => {\n  return (\n    <li className=\"c-list-table__item\">\n      <span className=\"c-list-table__title\">{name}:</span>\n\n      {/* eslint-disable-next-line react/no-invalid-html-attribute */}\n      <span className=\"c-list-table__data\" rel=\"options\">\n        {selected.length > 0 ? (\n          selected.map((item) => <span key={item.description}>{item.description}</span>)\n        ) : (\n          <span>-</span>\n        )}\n      </span>\n    </li>\n  );\n};\n\nSummaryItem.propTypes = {\n  name: PropTypes.string.isRequired,\n  selected: PropTypes.arrayOf(\n    PropTypes.shape({\n      description: PropTypes.string,\n    }),\n  ).isRequired,\n};\n\nexport default SummaryItem;\n","import React from 'react';\nimport PropTypes from 'prop-types';\n\nimport { Provider, useSelector } from 'react-redux';\n\nimport store from '../../../store/store';\n\nimport MonthlyPrice from '../MonthlyPrice/MonthlyPrice';\nimport UpfrontPrice from '../UpfrontPrice/UpfrontPrice';\n\nconst Enquire = ({ paths, leaseType, isPersonal, isVan, phoneNumber, dealType }) => {\n  const deal = useSelector((state) => state.Deal);\n\n  const { maintenanceSelected, isFinanceLease } = deal;\n\n  const monthlyPrice = parseFloat(deal.monthlyPrice);\n  const maintainedMonthlyPrice = parseFloat(deal.maintainedMonthlyPrice);\n  const initialPaymentPrice = parseFloat(deal.initialPaymentPrice);\n  const maintainedInitialPaymentPrice = parseFloat(deal.maintainedInitialPaymentPrice);\n\n  const enquirePath = `${paths.enquire}&use_finance_lease=${isFinanceLease}`;\n  const callbackPath = paths.callback;\n\n  const price = maintenanceSelected ? maintainedMonthlyPrice : monthlyPrice;\n  const initialPayment = maintenanceSelected ? maintainedInitialPaymentPrice : initialPaymentPrice;\n\n  const carDealTypeLabel = dealType === 'RatebookDeal' ? 'Guide price' : leaseType;\n\n  return (\n    <>\n      <div className=\"g-deal-enquire__price\">\n        <div className=\"g-deal-enquire__monthly\">\n          <h4>\n            {dealType === 'RatebookDeal' && (\n              <span\n                className=\"b-info\"\n                data-toggle=\"tooltip\"\n                data-placement=\"top\"\n                data-original-title=\"This is an auto generated rate. Please enquire for most competitive quote.\"\n              />\n            )}\n            {isVan ? 'Business Lease' : carDealTypeLabel} {!isPersonal && <span>ex VAT</span>}\n          </h4>\n          <MonthlyPrice price={price} isLoading={deal.URLParamsInit && !deal.URLParamsApplied} isEnquire />\n        </div>\n        {typeof initialPayment === 'number' && initialPayment > 0 && (\n          <UpfrontPrice\n            price={initialPayment}\n            isPersonal={isPersonal}\n            isLoading={deal.URLParamsInit && !deal.URLParamsApplied}\n            isEnquire\n          />\n        )}\n      </div>\n      <div className=\"drv-deal-enquire__action\">\n        {/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}\n        <a\n          href=\"#\"\n          data-action=\"modal#load\"\n          data-target=\"enquire-modal\"\n          data-path={enquirePath}\n          role=\"button\"\n          className=\"drv-deal-enquire__button drv-button drv-button--green drv-button--xl drv-button--icon\"\n        >\n          ENQUIRE\n          <span className=\"drv-button__icon\" />\n        </a>\n      </div>\n      <div className=\"g-deal-enquire__additional\">\n        <p className=\"g-deal-enquire__call\">\n          Call <a href={`tel:${phoneNumber}`}>{phoneNumber}</a>\n        </p>\n        <p className=\"g-deal-enquire__callback\">\n          {/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}\n          <a href=\"#\" data-action=\"modal#load\" data-target=\"callback-modal\" data-path={callbackPath} role=\"button\">\n            Request a callback\n          </a>\n        </p>\n      </div>\n    </>\n  );\n};\n\nEnquire.propTypes = {\n  paths: PropTypes.shape({\n    enquire: PropTypes.string.isRequired,\n    callback: PropTypes.string.isRequired,\n  }).isRequired,\n  leaseType: PropTypes.string.isRequired,\n  isPersonal: PropTypes.bool.isRequired,\n  isVan: PropTypes.bool.isRequired,\n  phoneNumber: PropTypes.string.isRequired,\n  dealType: PropTypes.string,\n};\n\nEnquire.defaultProps = {\n  dealType: '',\n};\n\nexport default function EnquireWrapper(props) {\n  return (\n    <Provider store={store}>\n      {/* eslint-disable-next-line react/jsx-props-no-spreading */}\n      <Enquire {...props} />\n    </Provider>\n  );\n}\n","import React, { useEffect } from 'react';\nimport { Provider, useDispatch, useSelector } from 'react-redux';\nimport Rails from '@rails/ujs';\nimport PropTypes from 'prop-types';\nimport { unique } from '../../../utils';\nimport { maintenanceLink } from '../helpers';\n\nimport store from '../../../store/store';\n\nimport MotoringTerms from '../MotoringTerms';\nimport FinanceLease from '../FinanceLease';\n\nconst DEFAULT_TERM = 24;\nconst DEFAULT_INITIAL_MONTHS = 9;\n\n//    toQueryString :: Obj -> String\nconst toQueryString = (params) => {\n  const esc = encodeURIComponent;\n\n  return Object.keys(params)\n    .map((key) => `${esc(key)}=${esc(params[key])}`)\n    .join('&');\n};\n\n//    int :: String -> Int\nconst int = (string) => parseInt(string, 10);\n\nconst Pricing = ({\n  mileages,\n  shortTermMileages,\n  terms,\n  shortTerms,\n  initialPayments,\n  shortTermInitialPaymentsByTerm,\n  defaultInitialPaymentMonthsByTerm,\n  init,\n  isVan,\n  hasShortTerm,\n  hasStandardTerm,\n  vehicleStatus,\n}) => {\n  const dispatch = useDispatch();\n  const deal = useSelector((state) => state.Deal);\n\n  const resetReduxState = () => {\n    dispatch({ type: 'RESET_DEAL_STATE' });\n  };\n\n  useEffect(() => {\n    document.addEventListener('turbolinks:load', resetReduxState());\n\n    dispatch({\n      type: 'INITIALISE',\n      payload: {\n        contractLength: int(init.contractLength || DEFAULT_TERM),\n        annualMileage: int(init.annualMileage),\n        initialMonths: int(init.initialMonths || DEFAULT_INITIAL_MONTHS),\n        monthlyPrice: init.monthlyPrice,\n        maintainedMonthlyPrice: init.maintainedMonthlyPrice,\n        initialPaymentPrice: init.initialPaymentPrice,\n        maintainedInitialPaymentPrice: init.maintainedInitialPaymentPrice,\n        isFinanceLease: init.useFinanceLease,\n        dealId: init.dealId,\n        isShortTerm: init.isShortTerm,\n        make: init.make,\n        model: init.model,\n        trim: init.trim,\n        isVan,\n        fueltype: init.fuelType,\n        transmission: init.transmission,\n        price: init.price,\n      },\n    });\n\n    return () => {\n      document.removeEventListener('turbolinks:load', resetReduxState());\n    };\n  }, []);\n\n  const {\n    annualMileage,\n    contractLength,\n    initialMonths,\n    initialised,\n    monthlyPrice,\n    maintainedMonthlyPrice,\n    maintenanceSelected,\n    initialPaymentPrice,\n    maintainedInitialPaymentPrice,\n    isFinanceLease,\n  } = deal;\n\n  const maintenancePrice = maintainedMonthlyPrice && Math.max(0, maintainedMonthlyPrice - monthlyPrice);\n\n  const price = maintenanceSelected ? maintainedMonthlyPrice : monthlyPrice;\n  const initialPayment = maintenanceSelected ? maintainedInitialPaymentPrice : initialPaymentPrice;\n\n  const fetchPrice = () => {\n    // this bit is really important. We need to wait until redux has been initialised with the right data before continuing.\n    // when switching to another deal the previous deal might still be in state, and if it is (i.e. this deal and that deal aren't the same) then don't continue until the new deal has finished initialising.\n    if (\n      !initialised ||\n      (initialised && typeof deal.derivativeId !== 'undefined' && deal.derivativeId !== init.derivativeId)\n    )\n      return;\n\n    if (isFinanceLease) {\n      dispatch({ type: 'STORE_MONTHLY_PRICE', payload: init.financeLeaseMonthlyPrice });\n      dispatch({ type: 'STORE_INITIAL_PAYMENT', payload: init.financeLeaseInitialPaymentPrice });\n      return;\n    }\n\n    const data = {};\n\n    if (annualMileage) {\n      data.mileage = annualMileage;\n    }\n\n    if (contractLength) {\n      data.term = contractLength;\n    }\n\n    if (initialMonths) {\n      data.initial_payment = initialMonths;\n    }\n\n    if (init.modelYear) {\n      data.model_year = init.modelYear;\n    }\n\n    const params = new URLSearchParams(window.location.search);\n\n    // On load check URL for option_ids[]\n    if (params.get('option_ids[]')) {\n      // If exists get all unique options into an array\n      const optionIDArray = unique(params.getAll('option_ids[]'));\n\n      // Only run this once - deal.URLParamsInit flag set to true after first run\n      if (!deal.URLParamsInit && deal.isTurbolinksLoad) {\n        // Set selected options in redux equal to url params\n        dispatch({\n          type: 'DEAL_URL_PARAMS_INIT',\n          payload: optionIDArray,\n        });\n      }\n    }\n\n    let url = `${window.location.pathname}.json?${toQueryString(data)}`;\n\n    if (deal.selected.actuallySelectedOptionIds) {\n      deal.selected.actuallySelectedOptionIds.forEach((id) => {\n        url += `&option_ids[]=${id}`;\n      });\n    }\n\n    if (params.get('utm_source')) {\n      url += `&utm_source=${params.get('utm_source')}`;\n    }\n\n    if (params.get('utm_medium')) {\n      url += `&utm_medium=${params.get('utm_medium')}`;\n    }\n\n    if (params.get('utm_campaign')) {\n      url += `&utm_campaign=${params.get('utm_campaign')}`;\n    }\n\n    Rails.ajax({\n      url,\n      type: 'GET',\n      dataType: 'json',\n      accept: 'application/json',\n      success: (result) => {\n        dispatch({ type: 'STORE_UPDATED_PRICE', payload: result });\n\n        window.history.replaceState({ turbolinks: {} }, '', url.replace('.json', ''));\n        window.dispatchEvent(new PopStateEvent('popstate')); // Manually trigger popstate event\n      },\n      error: () => {}, // TODO: do we need to actually use this?\n    });\n  };\n\n  const setIsPageLoad = () => {\n    dispatch({ type: 'SET_TURBOLINKS_LOAD' });\n  };\n\n  useEffect(() => {\n    fetchPrice();\n\n    window.addEventListener('turbolinks:load', setIsPageLoad);\n    return () => window.removeEventListener('turbolinks:load', setIsPageLoad);\n  }, [initialised, contractLength, annualMileage, initialMonths, isFinanceLease, deal.selected.optionIds]);\n\n  // this bit is really important. We need to wait until redux has been initialised with the right data before continuing.\n  if (!initialised) return null;\n\n  return (\n    <div className=\"drv-deal-sidebar-selections l-deal__sidebar-selections\">\n      {vehicleStatus === 'reserved' && (\n        <p className=\"d-block mb-4 drv-text-gold\">\n          This vehicle is <span className=\"drv-text-bold\">reserved</span> but simply enquire and one of our leasing\n          consultants will be in contact.\n        </p>\n      )}\n      <h2 className=\"drv-deal-sidebar-title d-none d-lg-block\">Personalise your lease</h2>\n      {isVan && (\n        <div className=\"drv-switch drv-mt-6 drv-mb-4\">\n          <input\n            className=\"drv-switch-checkbox\"\n            type=\"checkbox\"\n            checked={isFinanceLease}\n            onChange={(e) =>\n              dispatch({\n                type: 'STORE_FINANCE_LEASE',\n                payload: e.target.checked,\n              })\n            }\n          />\n          <label className=\"drv-switch-label\">\n            <span className=\"drv-switch-label-option\">Contract Hire</span>\n            <span className=\"drv-switch-label-option\">Finance Lease</span>\n          </label>\n        </div>\n      )}\n      {isFinanceLease ? (\n        <FinanceLease />\n      ) : (\n        <>\n          <MotoringTerms\n            price={price}\n            annualMileage={annualMileage}\n            contractLength={contractLength}\n            initialMonths={initialMonths}\n            mileages={mileages}\n            shortTermMileages={shortTermMileages}\n            terms={terms}\n            shortTerms={shortTerms}\n            initialPayments={initialPayments}\n            initialPayment={initialPayment}\n            shortTermInitialPaymentsByTerm={shortTermInitialPaymentsByTerm}\n            defaultInitialPaymentMonthsByTerm={defaultInitialPaymentMonthsByTerm}\n            hasShortTerm={hasShortTerm}\n            hasStandardTerm={hasStandardTerm}\n            isPersonal={init.isPersonal}\n          />\n\n          {!Number.isNaN(maintenancePrice) && maintenancePrice > 0 && (\n            <>\n              <div className=\"drv-text-larger\">Add a Maintenance and Tyre Plan</div>\n              <div className=\"drv-block drv-mb-4\">\n                Only{' '}\n                <span className=\"drv-deal-sidebar__option-value drv-text-gold-darker drv-text-bold\">\n                  £{maintenancePrice.toFixed(2)}\n                </span>{' '}\n                {init.isPersonal ? 'inc. VAT' : 'ex. VAT'}{' '}\n                <a\n                  href={maintenanceLink(isVan)}\n                  target=\"_blank\"\n                  rel=\"noreferrer\"\n                  className=\"drv-link drv-text-accent drv-text-bold\"\n                >\n                  Find out more\n                </a>\n              </div>\n              <label htmlFor=\"maintenanceCheck-true\" className=\"drv-checkbox__label drv-ml-1\">\n                <input\n                  type=\"radio\"\n                  name=\"maintenanceCheck\"\n                  id=\"maintenanceCheck-true\"\n                  className=\"drv-checkbox drv-checkbox--radio\"\n                  value=\"true\"\n                  checked={maintenanceSelected}\n                  onChange={() =>\n                    dispatch({\n                      type: 'STORE_MAINTENANCE_SELECTED',\n                      payload: true,\n                    })\n                  }\n                />\n                <span className=\"\">Yes I’d like the maintenance plan</span>\n              </label>\n              <label htmlFor=\"maintenanceCheck-false\" className=\"drv-checkbox__label drv-ml-1\">\n                <input\n                  type=\"radio\"\n                  name=\"maintenanceCheck\"\n                  id=\"maintenanceCheck-false\"\n                  className=\"drv-checkbox drv-checkbox--radio\"\n                  value=\"false\"\n                  checked={!maintenanceSelected}\n                  onChange={() =>\n                    dispatch({\n                      type: 'STORE_MAINTENANCE_SELECTED',\n                      payload: false,\n                    })\n                  }\n                />\n                <span className=\"\">No, I&apos;ll maintain it myself</span>\n              </label>\n            </>\n          )}\n        </>\n      )}\n    </div>\n  );\n};\n\nPricing.propTypes = {\n  init: PropTypes.shape({\n    derivativeId: PropTypes.number.isRequired,\n    dealId: PropTypes.number,\n    modelYear: PropTypes.string,\n    monthlyPrice: PropTypes.number,\n    financeLeaseInitialPaymentPrice: PropTypes.number,\n    financeLeaseMonthlyPrice: PropTypes.number,\n    maintainedInitialPaymentPrice: PropTypes.number,\n    maintainedMonthlyPrice: PropTypes.number,\n    initialPaymentPrice: PropTypes.number,\n    contractLength: PropTypes.number.isRequired,\n    annualMileage: PropTypes.number.isRequired,\n    initialMonths: PropTypes.number,\n    useFinanceLease: PropTypes.bool,\n    isPersonal: PropTypes.bool.isRequired,\n    isShortTerm: PropTypes.bool.isRequired,\n    make: PropTypes.string,\n    model: PropTypes.string,\n    trim: PropTypes.string,\n    fuelType: PropTypes.string,\n    transmission: PropTypes.string,\n    price: PropTypes.number,\n  }).isRequired,\n  isVan: PropTypes.bool.isRequired,\n  terms: PropTypes.arrayOf(PropTypes.number).isRequired,\n  mileages: PropTypes.arrayOf(PropTypes.number).isRequired,\n  paths: PropTypes.shape({\n    enquire: PropTypes.string.isRequired,\n    options: PropTypes.string.isRequired,\n  }).isRequired,\n  hasShortTerm: PropTypes.bool,\n  hasStandardTerm: PropTypes.bool,\n  shortTermMileages: PropTypes.arrayOf(PropTypes.number).isRequired,\n  shortTerms: PropTypes.arrayOf(PropTypes.number).isRequired,\n  initialPayments: PropTypes.arrayOf(PropTypes.number).isRequired,\n  shortTermInitialPaymentsByTerm: PropTypes.objectOf(PropTypes.arrayOf(PropTypes.number)).isRequired,\n  defaultInitialPaymentMonthsByTerm: PropTypes.objectOf(PropTypes.number).isRequired,\n  vehicleStatus: PropTypes.string.isRequired,\n};\n\nPricing.defaultProps = {\n  hasShortTerm: false,\n  hasStandardTerm: false,\n};\n\nexport default function PricingWrapper(props) {\n  return (\n    <Provider store={store}>\n      {/* eslint-disable-next-line react/jsx-props-no-spreading */}\n      <Pricing {...props} />\n    </Provider>\n  );\n}\n","import React, { useEffect, useState } from 'react';\nimport PropTypes from 'prop-types';\nimport { useSelector, Provider } from 'react-redux';\nimport Rails from '@rails/ujs';\n\nimport store from '../../../store/store';\n\nconst SalesInfo = ({ emailQuotePath }) => {\n  const data = useSelector((state) => state.Deal);\n  const [state, setState] = useState({\n    derivative: {},\n    vehicle: {},\n  });\n\n  const [isHidden, setIsHidden] = useState(false);\n\n  const fetchVehiclePrice = () => {\n    if (data.vehiclePriceId) {\n      Rails.ajax({\n        url: `/vehicle_prices/${data.vehiclePriceId}.json`,\n        type: 'GET',\n        dataType: 'json',\n        accept: 'application/json',\n        success: (result) => {\n          setState(result);\n        },\n        error: () => {},\n      });\n    } else {\n      setState({\n        derivative: {},\n        vehicle: {},\n      });\n    }\n  };\n\n  useEffect(() => {\n    fetchVehiclePrice();\n  }, [data.vehiclePriceId, data.maintenanceSelected]);\n\n  const MISSING_VALUE = '-';\n\n  const toggleVisibility = () => {\n    setIsHidden(!isHidden);\n  };\n\n  return (\n    <div className={`g-deal-sales-info__wrap ${isHidden ? 'hidden' : ''}`}>\n      <button className=\"g-deal-sales-info__toggle-button\" onClick={toggleVisibility}>\n        {isHidden ? 'Show sales info' : 'Hide sales info'}\n      </button>\n      <div className=\"g-deal-sales-info__scroll-container\">\n        <div className=\"g-deal-sales-info__group\">\n          <div className=\"g-deal-sales-info__item\">\n            <h4>Funder</h4>\n            {state.funderName ? (\n              <p>\n                <span className={`b-label b-label--${state.funderName.toLowerCase()}`}>{state.funderName}</span>\n              </p>\n            ) : (\n              <p>{MISSING_VALUE}</p>\n            )}\n          </div>\n\n          <div className=\"g-deal-sales-info__item\">\n            <h4>Deal type</h4>\n            <p>Used Deal</p>\n          </div>\n\n          <div className=\"g-deal-sales-info__item\">\n            <h4>CAP ID</h4>\n            <p>{state.derivative.capId || MISSING_VALUE}</p>\n          </div>\n\n          <div className=\"g-deal-sales-info__item\">\n            <h4>In stock?</h4>\n            <p>Yes</p>\n          </div>\n\n          <div className=\"g-deal-sales-info__item\">\n            <h4>Model year</h4>\n            <p>{state.derivative.modelYear || MISSING_VALUE}</p>\n          </div>\n        </div>\n      </div>\n      <div className=\"g-deal-sales-info__footer\">\n        {/* NOTE: Current implementation allow to send the form before fetching the offer details due to async logic if you click super fast */}\n        <div className=\"g-deal-sales-info__item\">\n          <form data-action=\"modal#load\" data-target=\"quote_modal\" action={emailQuotePath} method=\"post\">\n            <input type=\"hidden\" name=\"quotation[type]\" value=\"UsedVehicleQuotation\" />\n            <input type=\"hidden\" name=\"quotation[is_electric]\" value={data.pluginOrElectric || ''} />\n            <input type=\"hidden\" name=\"quotation[funder_id]\" value={state.funderId || ''} />\n            <input type=\"hidden\" name=\"quotation[derivative_id]\" value={state.derivative.id || ''} />\n            <input type=\"hidden\" name=\"quotation[vehicle_id]\" value={state.vehicle.id || ''} />\n            <input type=\"hidden\" name=\"quotation[monthly_rental]\" value={data.monthlyPrice || ''} />\n            <input\n              type=\"hidden\"\n              name=\"quotation[maintained_monthly_rental]\"\n              value={data.maintainedMonthlyPrice || ''}\n            />\n            <input type=\"hidden\" name=\"quotation[initial_payments]\" value={state.initialPaymentMonths || ''} />\n            <input type=\"hidden\" name=\"quotation[term]\" value={state.term || ''} />\n            <input type=\"hidden\" name=\"quotation[mileage]\" value={state.mileage || ''} />\n            <input type=\"hidden\" name=\"quotation[funder_maintenance]\" value={data.maintenanceSelected || false} />\n            <input\n              type=\"hidden\"\n              name=\"quotation[maintenance]\"\n              value={data.maintainedMonthlyPrice - data.monthlyPrice || ''}\n            />\n            <p>\n              <button className=\"b-btn b-btn-green b-btn-block\" type=\"submit\">\n                Send email quote\n              </button>\n            </p>\n          </form>\n        </div>\n      </div>\n    </div>\n  );\n};\n\nSalesInfo.propTypes = {\n  emailQuotePath: PropTypes.string.isRequired,\n};\n\nexport default function SalesInfoWrapper(props) {\n  return (\n    <Provider store={store}>\n      {/* eslint-disable-next-line react/jsx-props-no-spreading */}\n      <SalesInfo {...props} />\n    </Provider>\n  );\n}\n","import React, { useState, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport { Provider, useDispatch, useSelector } from 'react-redux';\n\n// Redux store\nimport store from '../../../store/store';\n\n// Helpers\nimport { numberWithCommas, maintenanceLink } from '../helpers';\n\nconst Summary = ({\n  p11d,\n  adminFee,\n  isPersonal,\n  isVan,\n  VAT,\n  financeLeaseTerm,\n  financeLeaseMileage,\n  financeLeaseInitialPayment,\n  shortTerms,\n}) => {\n  const dispatch = useDispatch();\n  const deal = useSelector((state) => state.Deal);\n\n  const {\n    annualMileage,\n    contractLength,\n    initialMonths,\n    maintenanceSelected,\n    isFinanceLease,\n    maintainedMonthlyPrice,\n    monthlyPrice,\n  } = deal;\n\n  const [shortTerm] = useState(shortTerms.indexOf(contractLength) > -1);\n  const [maintenancePrice, setMaintenancePrice] = useState(null);\n\n  useEffect(() => {\n    if (maintainedMonthlyPrice && monthlyPrice) {\n      const price = Math.max(0, maintainedMonthlyPrice - monthlyPrice).toFixed(2);\n      setMaintenancePrice(price);\n    } else {\n      setMaintenancePrice(0);\n    }\n  }, [maintainedMonthlyPrice, monthlyPrice]);\n\n  const formatValues = (value) => {\n    return `£${numberWithCommas(parseFloat(value).toFixed(2))}`;\n  };\n\n  const leaseType = () => {\n    if (isFinanceLease) return 'Finance Lease';\n    if (isPersonal) return 'Personal Contract Hire';\n\n    return 'Business Contract Hire';\n  };\n\n  const leaseTypeTooltip = () => {\n    if (isFinanceLease)\n      return 'A Finance Lease (FL) agreement gives you the option to sell the vehicle at the end of your arrangement, and to keep a percentage of the proceeds, providing there’s still equity in the vehicle. You can also choose to enter a secondary lease period to extend the contract. A Finance Lease vehicle cannot, under normal circumstances, be purchased outright by the customer, unless there’s specific agreement in place with the funder.';\n    if (isPersonal)\n      return 'Personal Contract Hire (PCH) is the industry term for the most common type of vehicle lease agreement. You choose your vehicle, set your annual mileage, and pay an ‘initial payment’ to bring down the overall cost. You then pay a fixed monthly fee for the duration of your contract.';\n\n    return 'Business Contract Hire (BCH) is the industry terminology for the most common type of business lease agreement. You choose your vehicle, set your annual mileage, and pay an ‘initial payment’ to bring down the overall cost of the deal. You then pay a fixed monthly fee for the duration of your contract.';\n  };\n\n  return (\n    <>\n      <div className=\"l-deal__sidebar-summary drv-deal-sidebar-summary drv-mt-6\">\n        <hr className=\"drv-hr drv-mb-4 d-none d-xl-block\" />\n        <div className=\"drv-deal-sidebar-summary__title\">Your Deal Summary</div>\n        <ul className=\"drv-list-table\">\n          <li className=\"drv-list-table__item\">\n            <span className=\"drv-list-table__title\" data-controller=\"tooltip\" data-tooltip-placement-value=\"left\">\n              <span className=\"drv-info\" data-tooltip-target=\"button\" />\n              Lease Type\n              <span className=\"drv-tooltip\" role=\"tooltip\" data-tooltip-target=\"tooltip\">\n                {leaseTypeTooltip()}\n                <span className=\"drv-tooltip__arrow\" data-popper-arrow />\n              </span>\n            </span>\n            <span className=\"drv-list-table__data\">{leaseType()}</span>\n          </li>\n          <li className=\"drv-list-table__item\">\n            <span className=\"drv-list-table__title\">P11D</span>\n            <span className=\"drv-list-table__data\">{formatValues(p11d)}</span>\n          </li>\n          <li className=\"drv-list-table__item\">\n            <span className=\"drv-list-table__title\">Initial Payment</span>\n            <span className=\"drv-list-table__data\">\n              {isFinanceLease ? financeLeaseInitialPayment : initialMonths} months\n            </span>\n          </li>\n          <li className=\"drv-list-table__item\">\n            <span className=\"drv-list-table__title\">Contract Length</span>\n            <span className=\"drv-list-table__data\">{isFinanceLease ? financeLeaseTerm : contractLength} months</span>\n          </li>\n          <li className=\"drv-list-table__item\">\n            <span className=\"drv-list-table__title\">Annual mileage</span>\n            <span className=\"drv-list-table__data\">\n              {isFinanceLease ? numberWithCommas(financeLeaseMileage) : numberWithCommas(annualMileage)} miles\n            </span>\n          </li>\n          {maintenancePrice > 0 && (\n            <li className=\"drv-list-table__item\">\n              <span className=\"drv-list-table__title\">\n                Maintenance Plan\n                <a\n                  href={maintenanceLink(isVan)}\n                  target=\"_blank\"\n                  rel=\"noreferrer\"\n                  className=\"drv-list-table__info drv-link drv-text-accent\"\n                >\n                  Find out more\n                </a>\n              </span>\n              <span className=\"drv-list-table__data\">\n                {isFinanceLease || shortTerm ? (\n                  'No Thanks'\n                ) : (\n                  <label\n                    htmlFor=\"maintenanceCheck\"\n                    className=\"drv-checkbox__label drv-ml-1\"\n                    style={{ alignItems: 'flex-start' }}\n                  >\n                    <input\n                      className=\"drv-checkbox\"\n                      style={{ marginRight: '0', marginTop: '4px' }}\n                      checked={maintenanceSelected}\n                      onChange={(event) =>\n                        dispatch({\n                          type: 'STORE_MAINTENANCE_SELECTED',\n                          payload: event.target.checked,\n                        })\n                      }\n                      type=\"checkbox\"\n                      id=\"maintenanceCheck\"\n                    />\n                    <span className=\"drv-ml-2\" style={{ textAlign: 'right' }}>\n                      Only £{maintenancePrice}\n                      <br />\n                      {isPersonal ? 'inc. VAT' : 'ex. VAT'}\n                    </span>\n                  </label>\n                )}\n              </span>\n            </li>\n          )}\n          <li className=\"drv-list-table__item\">\n            <span className=\"drv-list-table__title\" data-controller=\"tooltip\" data-tooltip-placement-value=\"left\">\n              <span className=\"drv-info\" data-tooltip-target=\"button\" />\n              Arrangement fee\n              <div className=\"drv-tooltip\" role=\"tooltip\" data-tooltip-target=\"tooltip\">\n                The arrangement fee is the cost of our services i.e. processing the order and lease agreement, and is\n                charged at point of order. Please refer to our Initial Disclosure Document for more information.\n                <div className=\"drv-tooltip__arrow\" data-popper-arrow />\n              </div>\n            </span>\n            <span className=\"drv-list-table__data\">\n              {isPersonal ? `${formatValues(adminFee * VAT)} inc VAT` : `${formatValues(adminFee)} ex VAT`}\n            </span>\n          </li>\n          <li className=\"drv-list-table__item\">\n            <span className=\"drv-list-table__title\" data-controller=\"tooltip\" data-tooltip-placement-value=\"left\">\n              <span className=\"drv-info\" data-tooltip-target=\"button\" />\n              Road tax\n              <div className=\"drv-tooltip\" role=\"tooltip\" data-tooltip-target=\"tooltip\">\n                Additional charges may apply – please refer to our terms and conditions.\n                <div className=\"drv-tooltip__arrow\" data-popper-arrow />\n              </div>\n            </span>\n            <span className=\"drv-list-table__data drv-text-bold\">INCLUDED</span>\n          </li>\n          <li className=\"drv-list-table__item\">\n            <span className=\"drv-list-table__title\" data-controller=\"tooltip\" data-tooltip-placement-value=\"left\">\n              <span className=\"drv-info\" data-tooltip-target=\"button\" />\n              Breakdown cover\n              <div className=\"drv-tooltip\" role=\"tooltip\" data-tooltip-target=\"tooltip\">\n                Duration of cover may vary, please ask your Leasing Consultant for further details.\n                <div className=\"drv-tooltip__arrow\" data-popper-arrow />\n              </div>\n            </span>\n            <span className=\"drv-list-table__data drv-text-bold\">INCLUDED</span>\n          </li>\n          <li className=\"drv-list-table__item\">\n            <span className=\"drv-list-table__title\" data-controller=\"tooltip\" data-tooltip-placement-value=\"left\">\n              <span className=\"drv-info\" data-tooltip-target=\"button\" />\n              Delivery\n              <div className=\"drv-tooltip\" role=\"tooltip\" data-tooltip-target=\"tooltip\">\n                Vehicles usually driven unless stated, please speak with your leasing consultant for further\n                information.\n                <div className=\"drv-tooltip__arrow\" data-popper-arrow />\n              </div>\n            </span>\n            <span className=\"drv-list-table__data drv-text-bold\">\n              FREE UK MAINLAND <br />\n              <small className=\"drv-text-small\">(Exclusions apply)</small>\n            </span>\n          </li>\n        </ul>\n      </div>\n\n      <div className=\"drv-deal-contents drv-deal-sidebar-order l-deal__sidebar-order\">\n        <small className=\"drv-text drv-text-extra-small\">\n          Excess mileage fees may apply. Underwriting restrictions may apply. Please see our IDD for details of costs of\n          our services, remuneration and commission.\n        </small>\n        <small className=\"drv-text drv-text-extra-small drv-text-bold drv-mt-2\">\n          Please note, Select Car Leasing is a broker, not a lender.\n        </small>\n      </div>\n    </>\n  );\n};\n\nSummary.propTypes = {\n  p11d: PropTypes.string.isRequired,\n  isPersonal: PropTypes.bool.isRequired,\n  isVan: PropTypes.bool.isRequired,\n  adminFee: PropTypes.number.isRequired,\n  financeLeaseTerm: PropTypes.number.isRequired,\n  financeLeaseMileage: PropTypes.number.isRequired,\n  financeLeaseInitialPayment: PropTypes.number.isRequired,\n  VAT: PropTypes.number,\n  shortTerms: PropTypes.arrayOf(PropTypes.number).isRequired,\n};\n\nSummary.defaultProps = {\n  VAT: 0,\n};\n\nexport default function SummaryWrapper(props) {\n  return (\n    <Provider store={store}>\n      {/* eslint-disable-next-line react/jsx-props-no-spreading */}\n      <Summary {...props} />\n    </Provider>\n  );\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\n\nconst SalesInfoItem = ({ title, content, alert }) => {\n  if (!content) {\n    return null;\n  }\n\n  return (\n    <div className=\"g-deal-sales-info__item\">\n      <h4>{title}</h4>\n      <p className={classNames({ 'g-deal-sales-info__alert': alert })}>{content}</p>\n    </div>\n  );\n};\n\nSalesInfoItem.propTypes = {\n  title: PropTypes.string.isRequired,\n  content: PropTypes.string,\n  alert: PropTypes.bool,\n};\n\nSalesInfoItem.defaultProps = {\n  content: '',\n  alert: false,\n};\n\nexport default SalesInfoItem;\n","/* eslint-disable react/require-default-props */\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport NumberFormat from 'react-number-format';\n\n// Style Imports\nimport './MonthlyPrice.scss';\n\nconst MonthlyPrice = ({ price, isBusiness, isLoading, isEnquire }) => {\n  if (price) {\n    const [pounds, pence] = price.toFixed(2).toString().split('.');\n\n    return (\n      <div className=\"monthly-price\">\n        {isLoading ? (\n          <span className=\"monthly-price__loading\" />\n        ) : (\n          <p className={isBusiness ? 'business' : null}>\n            {isEnquire ? (\n              <>\n                <NumberFormat value={pounds} displayType=\"text\" thousandSeparator prefix=\"£\" fixedDecimalScale />\n                <span className=\"g-deal-enquire__pence\">.{pence}</span>\n                <span className=\"g-deal-enquire__mobile\"> p/m</span>\n              </>\n            ) : (\n              <>\n                <NumberFormat value={pounds} displayType=\"text\" thousandSeparator prefix=\"£\" fixedDecimalScale />\n                <span className=\"g-deal-options__pence\">.{pence}</span>\n              </>\n            )}\n          </p>\n        )}\n      </div>\n    );\n  }\n\n  return <p>Call us</p>;\n};\n\nMonthlyPrice.propTypes = {\n  price: PropTypes.number,\n  isBusiness: PropTypes.bool,\n  isLoading: PropTypes.bool,\n  isEnquire: PropTypes.bool,\n};\n\nexport default MonthlyPrice;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport NumberFormat from 'react-number-format';\n\n// Style Imports\nimport './UpfrontPrice.scss';\n\nconst UpfrontPrice = ({ price, isPersonal, isLoading, isEnquire }) => (\n  <div className={isEnquire ? 'g-deal-enquire__upfront' : 'g-deal-options__upfront'}>\n    <h3>\n      Initial payment\n      {isPersonal ? ' inc' : ' ex'} VAT\n    </h3>\n\n    {isLoading ? (\n      <span className=\"upfront-price__loading\" />\n    ) : (\n      <p className={`g-deal-enquire__price-info ${!isPersonal ? 'business' : null}`}>\n        {isEnquire ? (\n          <>\n            <NumberFormat\n              value={price}\n              displayType=\"text\"\n              thousandSeparator\n              prefix=\"£\"\n              fixedDecimalScale\n              decimalScale={2}\n            />\n            <span className=\"g-deal-enquire__desktop\"> (Plus admin fee)</span>\n            <span className=\"g-deal-enquire__mobile\"> Initial Payment </span>\n          </>\n        ) : (\n          <>\n            <NumberFormat\n              value={price}\n              displayType=\"text\"\n              thousandSeparator\n              prefix=\"£\"\n              fixedDecimalScale\n              decimalScale={2}\n            />\n            <span className=\"g-deal-options__admin\"> (Plus admin fee)</span>\n          </>\n        )}\n      </p>\n    )}\n  </div>\n);\n\nUpfrontPrice.propTypes = {\n  price: PropTypes.number.isRequired,\n  isPersonal: PropTypes.bool.isRequired,\n  isLoading: PropTypes.bool,\n  isEnquire: PropTypes.bool,\n};\n\nUpfrontPrice.defaultProps = {\n  isLoading: false,\n  isEnquire: false,\n};\n\nexport default UpfrontPrice;\n","import React, { useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport { useSelector, Provider, useDispatch } from 'react-redux';\n\n// Redux store\nimport store from '../../store/store';\n\n// Helpers\nimport { contains, unique } from '../../utils';\nimport { isInCategory, isVisible, isEnabled, filterCategories } from './helpers';\n\n// Component Imports\nimport Option from './Option';\nimport NoOptions from './NoOptions';\n\n// Style Imports\nimport './OptionsGroup.scss';\n\nconst DefaultOptions = ({ defaultOptions }) => {\n  if (defaultOptions.length === 0) return null;\n\n  const descriptions = defaultOptions.map((option) => (\n    <span className=\"b-label default-options__option\" key={option.description}>\n      {option.description}\n    </span>\n  ));\n\n  let comeLabel = 'all come';\n  if (defaultOptions.length === 1) {\n    comeLabel = 'comes';\n  } else if (defaultOptions.length === 2) {\n    comeLabel = 'both come';\n  }\n\n  return (\n    <p className=\"default-options\">\n      {descriptions} {comeLabel} as standard.\n    </p>\n  );\n};\n\nDefaultOptions.propTypes = {\n  defaultOptions: PropTypes.arrayOf(PropTypes.shape({ description: PropTypes.string })).isRequired,\n};\n\nconst OptionsGroup = ({ categories, setTwoColumns }) => {\n  // React Redux hooks\n  const deal = useSelector((state) => state.Deal);\n  const dispatch = useDispatch();\n\n  const filteredCategories = [];\n\n  filterCategories(Object.entries(deal.categories), categories).forEach(([name, code]) => {\n    const data = deal.options.filter(isInCategory(code));\n    const visibleArray = data.map((option) => isVisible(option.id, deal));\n\n    if (visibleArray.includes(true)) {\n      filteredCategories.push({ name, code, data });\n    }\n  });\n\n  useEffect(() => {\n    setTwoColumns(filteredCategories.length > 2);\n  }, [filteredCategories]);\n\n  const getPackDescriptions = (option) => {\n    return unique(option.packContents).sort();\n  };\n\n  if (filteredCategories.length === 0) return <NoOptions />;\n\n  return filteredCategories.map(({ name, code, data }) => {\n    const defaultOptions = data.filter((option) => option.isDefault);\n    const selectableOptions = data.filter((option) => !option.isDefault);\n    const visibleSelectableOptions = selectableOptions.filter((option) => isVisible(option.id, deal));\n\n    if (visibleSelectableOptions.length === 0) return null;\n\n    return (\n      <div className=\"options-selector-group\" role=\"group\" key={code}>\n        <h3 className=\"options-selector-group__heading\">{name}</h3>\n\n        <DefaultOptions defaultOptions={defaultOptions} />\n\n        {visibleSelectableOptions.map((option) => {\n          const checked = contains(option.id, deal.selected.optionIds);\n\n          return (\n            <Option\n              id={option.id}\n              onChange={() =>\n                dispatch({\n                  type: checked ? 'OPTIONS.REMOVE' : 'OPTIONS.ADD',\n                  id: option.id,\n                })\n              }\n              isDefault={option.isDefault}\n              checked={checked}\n              visible={isVisible(option.id, deal)}\n              disabled={deal.isStock || deal.isFrozen || !isEnabled(option.id, deal) || (option.isDefault && checked)}\n              description={option.description}\n              price={option.price}\n              contractLength={deal.contractLength}\n              initialMonths={deal.initialMonths}\n              packDescriptions={getPackDescriptions(option)}\n              isAdmin={deal.isAdmin}\n              key={option.id}\n            />\n          );\n        })}\n      </div>\n    );\n  });\n};\n\nOptionsGroup.propTypes = {\n  categories: PropTypes.arrayOf(PropTypes.number).isRequired,\n  setTwoColumns: PropTypes.func.isRequired,\n};\n\nconst OptionsGroupWrapper = ({ categories, channel, setTwoColumns }) => (\n  <Provider store={store}>\n    <OptionsGroup categories={categories} channel={channel} setTwoColumns={setTwoColumns} />\n  </Provider>\n);\n\nOptionsGroupWrapper.propTypes = OptionsGroup.propTypes;\n\nexport default OptionsGroupWrapper;\n","import { curry, intersection, all, any, unique, contains } from '../../utils';\n\nimport {\n  categoriesColour,\n  categoriesTrim,\n  categoriesPacks,\n  categoriesExterior,\n  categoriesInterior,\n  categoriesEquipment,\n} from '../../data/optionCategories';\n\n// CONSTANTS\nexport const ONE_OF = 'OO';\nexport const REQUIRES_ONE = 'RO';\nexport const REQUIRES_ALL = 'RA';\nexport const NOT_WITH = 'NW';\nexport const INCLUDED_IN = 'IN';\nexport const INCLUDE_ONE = 'IO';\n\n// GETTERS\n\n//           getOption :: (String, State) -> Option?\nexport const getOption = (optionId, state) => state.options.find(({ id }) => `${id}` === `${optionId}`);\n\nexport const getSelectedOptions = (state) => state.options.filter(({ id }) => contains(id, state.selected.optionIds));\n\n//           getRule :: (String, State) -> Rule?\nexport const getRule = (ruleId, state) => state.rules.find(({ id }) => id === ruleId);\n\n//           getRules ::([String, state]) -> [Rule?]\nexport const getRules = (ruleIds, state) => state.rules.filter(({ id }) => contains(id, ruleIds));\n\n//           getRulesOfTypeForOption :: (String, String, State) -> [Rule?]\nexport const getRulesOfTypeForOption = (optionId, ruleType, state) =>\n  getOption(optionId, state).rules.filter(({ type }) => type === ruleType);\n\n//    getRulesForOptions :: ([String], State) => [Rule?]\nexport const getRulesForOptions = (optionIds, state) =>\n  unique(\n    state.options\n      .filter(({ id }) => contains(id, optionIds))\n      .map(({ ruleIds }) => ruleIds)\n      .flat(),\n  );\n\n//    getOneOfRulesForOption :: (String, State) -> [Rule?]\nexport const getOneOfRulesForOption = (optionId, state) => getRulesOfTypeForOption(optionId, 'OO', state);\n\n// FILTERS\n\n//           isChildPackOption :: (id, state) -> Boolean\nexport const isChildPackOption = (optionId, state) => {\n  const option = getOption(optionId, state);\n  const includedInRulesPrimaryOptions = option.rules\n    .filter(({ type, primaryOptionId }) => type === INCLUDED_IN && primaryOptionId !== optionId)\n    .map(({ primaryOptionId }) => primaryOptionId);\n  const requiresRulesOptions = unique(\n    option.rules\n      .filter(\n        ({ type, primaryOptionId }) => contains(type, [REQUIRES_ONE, REQUIRES_ALL]) && primaryOptionId === optionId,\n      )\n      .map(({ optionIds }) => optionIds)\n      .flat(),\n  );\n\n  return intersection(includedInRulesPrimaryOptions, requiresRulesOptions).length > 0;\n};\n\nexport const isVisible = (optionId, state) => {\n  const selectedChildPackOption = isChildPackOption(optionId, state) && contains(optionId, state.selected.optionIds);\n\n  return !isChildPackOption(optionId, state) || selectedChildPackOption;\n};\n\n//           isEnabled :: (id, state) -> Boolean\nexport const isEnabled = (optionId, state) => {\n  const option = getOption(optionId, state);\n\n  if (contains(optionId, state.selected.optionIds)) {\n    const selectedIncludedInRules = getRules(intersection(option.ruleIds, state.selected.ruleIds), state).filter(\n      ({ type }) => type === INCLUDED_IN,\n    );\n\n    if (selectedIncludedInRules.length > 0) {\n      return all(\n        selectedIncludedInRules.map(({ primaryOptionId }) => {\n          if (primaryOptionId !== optionId && contains(primaryOptionId, state.selected.optionIds)) {\n            return false;\n          }\n          return true;\n        }),\n      );\n    }\n\n    return true;\n  }\n\n  // // \"REQUIRES ONE\" is the only option that requires us to check the selected options regardless of\n  // // if the rule is applied or not\n  const primaryRequiresOneRulesForOption = option.rules.filter(\n    // TODO: this should also check for REQUIRES_ALL\n    ({ primaryOptionId, type }) => primaryOptionId === optionId && type === REQUIRES_ONE,\n  );\n\n  const enabledByRequiresOne = primaryRequiresOneRulesForOption.map(\n    // if any of the other optionIds for the rule are selected, this is enabled.\n    (rule) => state.selected.optionIds.some((id) => contains(id, rule.optionIds)),\n  );\n\n  if (primaryRequiresOneRulesForOption.length > 0 && !all(enabledByRequiresOne)) {\n    return false;\n  }\n\n  const appliedRulesForOption = getRules(intersection(option.ruleIds, state.selected.ruleIds), state);\n\n  if (appliedRulesForOption.length === 0) {\n    return true;\n  }\n\n  const enabledByAppliedRules = appliedRulesForOption.map((rule) => {\n    if (rule.type === ONE_OF) {\n      return !any(rule.optionIds.map((id) => isChildPackOption(id, state)));\n    }\n\n    if (rule.type === NOT_WITH && rule.primaryOptionId) {\n      const primaryOption = getOption(rule.primaryOptionId, state);\n      return primaryOption.isDefault || !contains(rule.primaryOptionId, state.selected.optionIds);\n    }\n\n    return true;\n  });\n\n  return all(enabledByAppliedRules);\n};\n\n//           isOther :: Option -> Boolean\n//           This is terribly named, but Other here means not paint or trim\nexport const isOther = ({ categoryCode }) => !contains(categoryCode, [...categoriesColour, ...categoriesTrim]);\n\n//           isPaintwork :: Option -> Boolean\nexport const isPaintwork = ({ categoryCode }) => contains(categoryCode, categoriesColour);\n\n//           is :: Option -> Boolean\nexport const isTrim = ({ categoryCode }) => contains(categoryCode, categoriesTrim);\n\n//           isTrim :: Option -> Boolean\nexport const isAllTrim = ({ categoryCode }) => contains(categoryCode, categoriesTrim);\n\n//           isPacks :: Option -> Boolean\nexport const isPacks = ({ categoryCode }) => contains(categoryCode, categoriesPacks);\n\n//           isExterior :: Option -> Boolean\nexport const isExterior = ({ categoryCode }) => contains(categoryCode, categoriesExterior);\n\n//           isInterior :: Option -> Boolean\nexport const isInterior = ({ categoryCode }) => contains(categoryCode, categoriesInterior);\n\n//           isEquipment :: Option -> Boolean\nexport const isEquipment = ({ categoryCode }) => contains(categoryCode, categoriesEquipment);\n\n//           isInCategory :: Integer -> Option -> Boolean\nexport const isInCategory = curry((code, { categoryCode }) => categoryCode === code);\n\n// Returns array of category objects matching category code\nexport const filterCategories = (data, categoryCodes) => {\n  const filtered = [];\n\n  data.forEach((item) => {\n    if (contains(item[1], categoryCodes)) {\n      filtered.push(item);\n    }\n  });\n\n  return filtered;\n};\n\n//           numberWithCommas :: Number -> String\nexport const numberWithCommas = (n) => {\n  if (typeof n !== 'number' && typeof n !== 'string') return '';\n  return n.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, ',');\n};\n\nexport const selectedOfferId = ({ offerId, maintainedOfferId, maintenanceSelected }) => {\n  return maintenanceSelected ? maintainedOfferId : offerId;\n};\n\nexport const geotargetlyInit = (g, e, o, t, a, r, ge, tl, y) => {\n  const s = function () {\n    const def = `geotargetlygeocontent${geotargetly}_default`;\n    const len = g.getElementsByClassName(def).length;\n    if (len > 0) {\n      for (let i = 0; i < len; i++) {\n        g.getElementsByClassName(def)[i].style.display = 'inline';\n      }\n    }\n  };\n  t = g.getElementsByTagName(e)[0];\n  y = g.createElement(e);\n  y.async = true;\n  y.src = `https://g1584674684.co/gc?refurl=${g.referrer}&id=-MQlZ7_Rghz2O0OylT8S&winurl=${encodeURIComponent(window.location)}`;\n  t.parentNode.insertBefore(y, t);\n  y.onerror = function () {\n    s();\n  };\n};\n\nexport const kFormatter = (num) => {\n  return Math.abs(num) > 999\n    ? `${Math.sign(num) * (Math.abs(num) / 1000).toFixed(1)}K`\n    : Math.sign(num) * Math.abs(num);\n};\n\nexport const maintenanceLink = (isVan) => {\n  const url = '/guides/personal-car-leasing/servicing-and-maintenance-packages';\n  return isVan ? `/van-leasing${url}` : url;\n};\n","import React from 'react';\nimport PropTypes from 'prop-types';\n\nconst GalleryNavigation = ({ emblaApi }) => {\n  const scrollPrev = () => emblaApi?.scrollPrev();\n  const scrollNext = () => emblaApi?.scrollNext();\n\n  return (\n    <>\n      <button\n        className=\"drv-deal-content__carousel-button drv-deal-content__carousel-button--prev\"\n        onClick={scrollPrev}\n        aria-label=\"Previous slide\"\n      />\n      <button\n        className=\"drv-deal-content__carousel-button drv-deal-content__carousel-button--next\"\n        onClick={scrollNext}\n        aria-label=\"Next slide\"\n      />\n    </>\n  );\n};\n\nGalleryNavigation.propTypes = {\n  emblaApi: PropTypes.shape({\n    scrollPrev: PropTypes.func,\n    scrollNext: PropTypes.func,\n  }),\n};\n\nGalleryNavigation.defaultProps = {\n  emblaApi: null,\n};\n\nexport default GalleryNavigation;\n","import React from 'react';\n\nconst FinanceLease = () => (\n  <div className=\"g-deal-options__financelease\" style={{ display: 'block' }}>\n    <div className=\"g-deal-options__info-block\">\n      <p>\n        Finance Lease is available on variable contract term and mileage, please request a personalised quote below.\n      </p>\n    </div>\n    <ul className=\"c-list-ticks-featured\">\n      <li className=\"c-list-ticks-featured__item\">\n        Finance Lease offers more end-of-contract options than with traditional Contract Hire.\n      </li>\n      <li className=\"c-list-ticks-featured__item\">\n        Opportunity to sell the vehicle at the end of the initial agreement and to enjoy a share of the proceeds.\n      </li>\n      <li className=\"c-list-ticks-featured__item\">\n        Flexibility to retain the use of your vehicle at the end of the contract by entering a secondary rental period.\n      </li>\n      <li className=\"c-list-ticks-featured__item\">\n        Lower your monthly fees with a &apos;Balloon Payment&apos; Finance Lease arrangement.\n      </li>\n      <li className=\"c-list-ticks-featured__item\">\n        Business lease customers can take advantage of tax benefits in terms of claimable expenses and recoverable VAT.\n      </li>\n      <li className=\"c-list-ticks-featured__item\">Contact a Select Van Leasing consultant for a personalised quote.</li>\n    </ul>\n  </div>\n);\n\nexport default FinanceLease;\n","/* eslint-disable react/prop-types */\n/* eslint-disable react/require-default-props */\nimport React, { Fragment, useState, useEffect } from 'react';\nimport { useDispatch } from 'react-redux';\nimport PropTypes from 'prop-types';\nimport NumberFormat from 'react-number-format';\n\nimport Range from '../ui/Range';\n\nimport { kFormatter } from './helpers';\nimport { contains } from '../../utils';\n\n//    int :: String -> Int\nconst int = (string) => parseInt(string, 10);\n\nconst MotoringTerms = ({\n  price,\n  annualMileage,\n  contractLength,\n  initialMonths,\n  mileages,\n  shortTermMileages,\n  terms,\n  shortTerms,\n  initialPayments,\n  initialPayment,\n  shortTermInitialPaymentsByTerm,\n  defaultInitialPaymentMonthsByTerm,\n  isPersonal,\n  hasShortTerm,\n  hasStandardTerm,\n}) => {\n  const dispatch = useDispatch();\n\n  const [shortTerm] = useState(shortTerms.indexOf(contractLength) > -1);\n\n  const handleToggle = (event) => {\n    event.preventDefault();\n    const term = shortTerm ? 48 : 12;\n    // eslint-disable-next-line no-restricted-globals\n    const params = new URLSearchParams(location.search);\n\n    params.set('term', term);\n    // eslint-disable-next-line no-restricted-globals\n    Turbolinks.visit(`${location.pathname}?${params}`);\n  };\n\n  const shortTermInitialPaymentsTotal = shortTermInitialPaymentsByTerm['12'];\n  const shortTermInitialPayments = shortTermInitialPaymentsByTerm[contractLength];\n\n  const applicableTerms = shortTerm ? shortTerms : terms;\n  const applicableMileages = shortTerm ? shortTermMileages : mileages;\n  const applicableInitialPayments = shortTerm ? shortTermInitialPayments : initialPayments;\n\n  useEffect(() => {\n    if (!contains(contractLength, applicableTerms)) {\n      dispatch({\n        type: 'STORE_CONTRACT_LENGTH',\n        payload: applicableTerms[0],\n      });\n    }\n\n    if (shortTerm) {\n      if (!contains(annualMileage, shortTermMileages)) {\n        dispatch({\n          type: 'STORE_ANNUAL_MILEAGE',\n          payload: shortTermMileages[0],\n        });\n      }\n      if (!contains(initialMonths, shortTermInitialPayments)) {\n        dispatch({\n          type: 'STORE_INITIAL_MONTHS',\n          payload: defaultInitialPaymentMonthsByTerm[contractLength],\n        });\n      }\n    }\n  }, [shortTerm, contractLength]);\n\n  return (\n    <>\n      <header className=\"drv-deal-sidebar__option-title drv-block drv-mb-3\">\n        <span className=\"drv-text-bold\" data-controller=\"tooltip\" data-tooltip-placement-value=\"left\">\n          <span className=\"drv-info\" data-tooltip-target=\"button\" />\n          Contract Length:\n          <div className=\"drv-tooltip\" role=\"tooltip\" data-tooltip-target=\"tooltip\" data-tooltip-placement-value=\"left\">\n            This is simply the length of your lease\n            <div className=\"drv-tooltip__arrow\" data-popper-arrow />\n          </div>\n        </span>\n        <span className=\"\"> (months) </span>\n        <span className=\"drv-deal-sidebar__option-value drv-text-bold drv-text-gold-darker\">\n          {contractLength} months\n        </span>\n      </header>\n      <div className=\"drv-radio-buttons drv-mb-6\">\n        {applicableTerms.map((term) => (\n          <Fragment key={term}>\n            <label className=\"drv-radio-button\">\n              <input\n                type=\"radio\"\n                name=\"term\"\n                id={`term_${term}`}\n                value={term}\n                checked={term === contractLength}\n                onChange={(event) => {\n                  dispatch({\n                    type: 'STORE_CONTRACT_LENGTH',\n                    payload: int(event.target.value),\n                  });\n                }}\n              />\n              <span className=\"drv-radio-button__label\">{term}</span>\n            </label>\n          </Fragment>\n        ))}\n      </div>\n      {hasStandardTerm && hasShortTerm && (\n        // eslint-disable-next-line jsx-a11y/anchor-is-valid\n        <a\n          className=\"d-block drv-mb-6 drv-link drv-text-medium-weight drv-deal-sidebar-term-toggle\"\n          href=\"#\"\n          onClick={(e) => handleToggle(e)}\n        >\n          {shortTerm ? 'Long term leasing options available' : 'Short term leasing options available'}\n        </a>\n      )}\n\n      <header className=\"drv-deal-sidebar__option-title drv-block drv-mb-3 drv-mt-1\">\n        <span className=\"drv-text-bold\" data-controller=\"tooltip\" data-tooltip-placement-value=\"left\">\n          <span className=\"drv-info\" data-tooltip-target=\"button\" />\n          Annual miles:\n          <div className=\"drv-tooltip\" role=\"tooltip\" data-tooltip-target=\"tooltip\">\n            Your annual mileage allowance is multiplied by the length of your contract to give you a total mileage\n            allowance. Please note that an Excess mileage fee may apply if you exceed your total contract mileage, this\n            will be detailed on your Finance Agreement. We will base your quotes on an appropriate mileage for your\n            needs.\n            <div className=\"drv-tooltip__arrow\" data-popper-arrow />\n          </div>\n        </span>\n        <span className=\"drv-deal-sidebar__option-value drv-text-bold drv-text-gold-darker\">\n          {' '}\n          {annualMileage} miles\n        </span>\n      </header>\n      <Range\n        data={applicableMileages}\n        selected={annualMileage}\n        onChange={(value) => {\n          dispatch({\n            type: 'STORE_ANNUAL_MILEAGE',\n            payload: int(applicableMileages[value - 1]),\n          });\n        }}\n        labels={applicableMileages.map((mileage) => kFormatter(mileage))}\n      />\n\n      <header\n        className=\"drv-deal-sidebar__option-title drv-block drv-mb-3\"\n        style={{ marginTop: '-1rem', position: 'relative', zIndex: '1' }}\n      >\n        <span className=\"drv-text-bold\" data-controller=\"tooltip\" data-tooltip-placement-value=\"left\">\n          <span className=\"drv-info\" data-tooltip-target=\"button\" />\n          Initial payment:\n          <div className=\"drv-tooltip\" role=\"tooltip\" data-tooltip-target=\"tooltip\">\n            Your initial payment is essentially your first monthly instalment, equivalent to a set number of monthly\n            rentals. It is not a deposit - it is part of your total lease cost.\n            <div className=\"drv-tooltip__arrow\" data-popper-arrow />\n          </div>\n        </span>\n        <span className=\"\">(months) </span>\n        <span className=\"drv-deal-sidebar__option-value drv-text-bold drv-text-gold-darker\">\n          {price ? (\n            <>\n              <NumberFormat\n                value={initialPayment}\n                displayType=\"text\"\n                thousandSeparator\n                prefix=\"£\"\n                fixedDecimalScale\n                decimalScale={2}\n              />\n              {isPersonal ? ' inc' : ' ex'} VAT\n            </>\n          ) : (\n            'Call us'\n          )}\n        </span>\n      </header>\n      <div className=\"drv-radio-buttons drv-mb-6\">\n        {shortTerm ? (\n          <>\n            {shortTermInitialPaymentsTotal.map((shortTermInitialPayment) => (\n              <Fragment key={shortTermInitialPayment}>\n                <label className=\"drv-radio-button\">\n                  <input\n                    type=\"radio\"\n                    name=\"initial_payment\"\n                    id={`initial_payment_${shortTermInitialPayment}`}\n                    value={shortTermInitialPayment}\n                    disabled={!applicableInitialPayments.includes(shortTermInitialPayment)}\n                    checked={shortTermInitialPayment === initialMonths}\n                    onChange={(event) => {\n                      dispatch({\n                        type: 'STORE_INITIAL_MONTHS',\n                        payload: int(event.target.value),\n                      });\n                    }}\n                  />\n                  <span className=\"drv-radio-button__label\">{shortTermInitialPayment}</span>\n                </label>\n              </Fragment>\n            ))}\n          </>\n        ) : (\n          <>\n            {applicableInitialPayments.map((applicableInitialPayment) => (\n              <Fragment key={applicableInitialPayment}>\n                <label className=\"drv-radio-button\">\n                  <input\n                    type=\"radio\"\n                    name=\"initial_payment\"\n                    id={`initial_payment_${initialMonths}`}\n                    value={applicableInitialPayment}\n                    checked={applicableInitialPayment === initialMonths}\n                    onChange={(event) => {\n                      dispatch({\n                        type: 'STORE_INITIAL_MONTHS',\n                        payload: int(event.target.value),\n                      });\n                    }}\n                  />\n                  <span className=\"drv-radio-button__label\">{applicableInitialPayment}</span>\n                </label>\n              </Fragment>\n            ))}\n          </>\n        )}\n      </div>\n    </>\n  );\n};\n\nMotoringTerms.propTypes = {\n  price: PropTypes.number,\n  annualMileage: PropTypes.number.isRequired,\n  contractLength: PropTypes.number.isRequired,\n  initialMonths: PropTypes.number,\n  mileages: PropTypes.arrayOf(PropTypes.number).isRequired,\n  terms: PropTypes.arrayOf(PropTypes.number).isRequired,\n  shortTermMileages: PropTypes.arrayOf(PropTypes.number).isRequired,\n  shortTerms: PropTypes.arrayOf(PropTypes.number).isRequired,\n  initialPayments: PropTypes.arrayOf(PropTypes.number).isRequired,\n  initialPayment: PropTypes.number.isRequired,\n  shortTermInitialPaymentsByTerm: PropTypes.objectOf(PropTypes.arrayOf(PropTypes.number)).isRequired,\n  defaultInitialPaymentMonthsByTerm: PropTypes.objectOf(PropTypes.number).isRequired,\n  hasShortTerm: PropTypes.bool.isRequired,\n  hasStandardTerm: PropTypes.bool.isRequired,\n};\n\nexport default MotoringTerms;\n"],"sourceRoot":""}