1"use strict";(self.webpackChunkaem_maven_archetype=self.webpackChunkaem_maven_archetype||[]).push([["src_main_webpack_utils_accessoriescatalog_accessoriescatalog_service_ts"],{71409:function(t,e,r){r.d(e,{Mj:function(){return b},N_:function(){return _},T8:function(){return E},Tc:function(){return M},UP:function(){return d},_V:function(){return O},_k:function(){return f},e6:function(){return s},id:function(){return g},k5:function(){return N},qj:function(){return y},so:function(){return U},xK:function(){return S},yA:function(){return p},yl:function(){return T}});var n=r(96980),o=r(12285);function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function a(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function u(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?a(Object(r),!0).forEach(function(e){c(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function c(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=i(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==i(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var l="AccessoriesWishlist",s="AccessoriesWishlist::quantityChanged";function f(){try{var t=localStorage.getItem(l);if(!t)return[];var e=JSON.parse(t);return Array.isArray(e)?e:[]}catch(t){return[]}}function p(t){localStorage.setItem(l,JSON.stringify(t))}function v(t){return(null!=t?t:"").trim().toLowerCase().replace(/\bland rover\s*/gi,"").trim()}function d(t,e){var r;if(!e.length)return!0;var n=v(null!==(r=t.vehicleModel)&&void 0!==r?r:"");return!!n&&e.some(function(t){var e=v(t);return!!e&&(n===e||n.includes(e))})}function y(t){return null==t||"string"==typeof t&&""===t.trim()?[]:t.split(",").map(function(t){return t.trim()}).filter(Boolean)}function h(){return f().reduce(function(t,e){var r;return t+(null!==(r=e.quantity)&&void 0!==r?r:1)},0)}var m=".cmp-accessorieswishlist";function b(){var t,e=document.querySelector(m),r=null==e?void 0:e.getAttribute("data-filter-by-vehicle-model"),n=y(null!=r?r:"");return n.length>0?(t=n).length?f().filter(function(e){return d(e,t)}).reduce(function(t,e){var r;return t+(null!==(r=e.quantity)&&void 0!==r?r:1)},0):h():h()}function g(t){return f().some(function(e){return e.partNumber===t})}var w="en-GB";function P(t,e){var r=(e||w).replace(/_/g,"-")||w;return new Intl.DateTimeFormat(r,{day:"2-digit",month:"2-digit",year:"numeric"}).format(t)}function _(t,e){var r,n,o=f(),i=t.partNumber,a=i?o.findIndex(function(t){return t.partNumber===i}):-1,c=null!==(r=null!=e?e:null===(n=document.documentElement)||void 0===n?void 0:n.lang)&&void 0!==r?r:w;if(a>=0){var l,v=o[a],d=null!==(l=v.quantity)&&void 0!==l?l:0;o[a]=u(u(u({},v),t),{},{quantity:d+1})}else o.push(u(u({},t),{},{dateAdded:P(new Date,c),productUrl:t.productUrl,quantity:1}));p(o);var y=o.reduce(function(t,e){var r;return t+(null!==(r=e.quantity)&&void 0!==r?r:1)},0);document.dispatchEvent(new CustomEvent(s,{detail:{count:y},bubbles:!0}))}function S(t){var e=f(),r=e.findIndex(function(e){return e.partNumber===t});if(!(r<0)){e.splice(r,1),p(e);var n=e.reduce(function(t,e){var r;return t+(null!==(r=e.quantity)&&void 0!==r?r:1)},0);document.dispatchEvent(new CustomEvent(s,{detail:{count:n},bubbles:!0}))}}function O(t,e){var r,n=f(),o=n.findIndex(function(e){return e.partNumber===t});if(!(o<0)){var i=n[o],a=(null!==(r=i.quantity)&&void 0!==r?r:0)+e;if(!(a<0)){n[o]=u(u({},i),{},{quantity:a}),p(n);var c=n.reduce(function(t,e){var r;return t+(null!==(r=e.quantity)&&void 0!==r?r:1)},0);document.dispatchEvent(new CustomEvent(s,{detail:{count:c},bubbles:!0}))}}}var j="[data-view-wishlist-cta]";
1function C(t){return t.replace(/\s*\(\d+\)\s*$/,"").trimEnd()}function k(t,e,r){return r?t?"".concat(t," (").concat(e,")"):"(".concat(e,")"):t}function A(t,e,r){if(!r)return t;var o=function(t){var e,r,o=null!==(e=null===(r=document.documentElement)||void 0===r?void 0:r.lang)&&void 0!==e?e:"en-GB";return(0,n.ZB)(o)(t,"one:Item;other:Items")}(e);return t?"".concat(t,", ").concat(o):o}function E(t){var e,r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:j,o=t.querySelector(n);if(o){var i=o.querySelector(".cta-content"),a=C(null!==(e=null==i?void 0:i.textContent)&&void 0!==e?e:""),u=C(null!==(r=o.getAttribute("aria-label"))&&void 0!==r?r:"");o.setAttribute("data-wishlist-cta-base",a),o.setAttribute("data-wishlist-cta-aria-base",u);var c=b(),l=c>0;i&&(i.textContent=k(a,c,l)),o.setAttribute("aria-label",A(u,c,l))}}function T(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:j,n=t.querySelector(r);if(n){var o=n.getAttribute("data-wishlist-cta-base"),i=n.getAttribute("data-wishlist-cta-aria-base");if(null===o||null===i){var a,u,c=n.querySelector(".cta-content");o=null!=o?o:C(null!==(a=null==c?void 0:c.textContent)&&void 0!==a?a:""),i=null!=i?i:C(null!==(u=n.getAttribute("aria-label"))&&void 0!==u?u:""),n.setAttribute("data-wishlist-cta-base",o),n.setAttribute("data-wishlist-cta-aria-base",i)}var l=e>0,s=n.querySelector(".cta-content");s&&(s.textContent=k(null!=o?o:"",e,l)),n.setAttribute("aria-label",A(null!=i?i:"",e,l))}}function N(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:j;T(t,b(),e)}var D="[data-wishlist-cta][data-part-number]",q="icon-favourite-solid",I="icon-favourite",x=function(t){return new URL(t,window.location.origin).href};function U(t,e,r){var n,i;if(!e)throw new Error("Locale is required");if(!t)throw new Error("Part is required");if(!r)throw new Error("Product page URL is required");var a=(0,o.Kp)("button",["AccessoriesCatalogDetail__related-parts-button--wishlist"],{type:"button",dataWishlistCta:"",dataPartNumber:null!==(n=t.reference)&&void 0!==n?n:"",datatestid:"ac-part-card-wishlist-toggle-cta"}),u=(0,o.Kp)("i",[g(null!==(i=t.reference)&&void 0!==i?i:"")?"icon-favourite-solid":"icon-favourite"]);return a.appendChild(u),a.addEventListener("click",function(n){var o,i,u;(n.preventDefault(),n.stopPropagation(),g(null!==(o=t.reference)&&void 0!==o?o:""))?S(null!==(i=t.reference)&&void 0!==i?i:""):_({apiUrl:t.url,partNumber:null!==(u=t.reference)&&void 0!==u?u:"",productUrl:x(r)},e);var c,l=a.querySelector("i");l&&(l.className=g(null!==(c=t.reference)&&void 0!==c?c:"")?"icon-favourite-solid":"icon-favourite")}),a}function M(t){t.querySelectorAll(D).forEach(function(t){var e=t.getAttribute("data-part-number");if(e){var r=t.querySelector("i");r&&(r.className=g(e)?q:I)}})}},41126:function(t,e,r){r.d(e,{A:function(){return N}});var n=r(12285);function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function i(t){return function(t){if(Array.isArray(t))return a(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return a(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function u(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,l(n.key),n)}}function c(t,e,r){return(e=l(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function l(t){var e=function(t,e){if("object"!=o(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}
1(t,"string");return"symbol"==o(e)?e:e+""}var s=function(){return t=function t(e,r){var n,o,i,a;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),c(this,"container",void 0),c(this,"options",void 0),!(e instanceof HTMLElement))throw new Error("Container must be a HTMLElement");if(!r||!r.productData)throw new Error("productData is required");this.container=e,this.options={productData:r.productData,elementType:null!==(n=r.elementType)&&void 0!==n?n:"article",className:Array.isArray(r.className)?r.className:[null!==(o=r.className)&&void 0!==o?o:""],attributes:null!==(i=r.attributes)&&void 0!==i?i:{},headerContent:null!==(a=r.headerContent)&&void 0!==a?a:null},this.render()},(e=[{key:"render",value:function(){var t=this.options.productData,e=t.productName,r=t.productPriceHuman,o=t.productPriceMachine,a=t.productImageUrl;if((null==e?void 0:e.trim())&&(null==a?void 0:a.trim())){var u=(0,n.Kp)(this.options.elementType,["DxProductCard"].concat(i(this.options.className)),this.options.attributes),c=(0,n.Kp)("div",["DxProductCard__content"]);u.appendChild(c);var l=(0,n.Kp)("header",["DxProductCard__header"]);if(c.appendChild(l),null!=e&&e.trim()){var s=(0,n.Kp)("h3",["DxProductCard__name"]);s.innerHTML=e,l.appendChild(s)}if(this.options.headerContent&&l.appendChild(this.options.headerContent),null!=r&&r.trim()){var f=(0,n.Kp)("p",["DxProductCard__price"]),p=null!=o&&o.trim()?{value:o}:void 0,v=(0,n.Kp)("data",[],p);v.textContent=r,f.appendChild(v),c.appendChild(f)}if(null!=a&&a.trim()){var d,y=(0,n.Kp)("picture",["DxProductCard__picture"]),h=(0,n.Kp)("img",["DxProductCard__image"],{src:a,alt:null!==(d=null==e?void 0:e.trim())&&void 0!==d?d:"",loading:"lazy",decoding:"async"});y.appendChild(h),u.appendChild(y)}this.container.replaceChildren(u)}}}])&&u(t.prototype,e),r&&u(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function f(t){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f(t)}function p(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof u?n:u,l=Object.create(c.prototype);return v(l,"_invoke",function(r,n,o){var i,u,c,l=0,s=o||[],f=!1,p={p:0,n:0,v:t,a:v,f:v.bind(t,4),d:function(e,r){return i=e,u=0,c=t,p.n=r,a}};function v(r,n){for(u=r,c=n,e=0;!f&&l&&!o&&e<s.length;e++){var o,i=s[e],v=p.p,d=i[2];r>3?(o=d===n)&&(c=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=t):i[0]<=v&&((o=r<2&&v<i[1])?(u=0,p.v=n,p.n=i[1]):v<d&&(o=r<3||i[0]>n||n>d)&&(i[4]=r,i[5]=n,p.n=d,u=0))}if(o||r>1)return a;throw f=!0,n}return function(o,s,d){if(l>1)throw TypeError("Generator is already running");for(f&&1===s&&v(s,d),u=s,c=d;(e=u<2?t:c)||!f;){i||(u?u<3?(u>1&&(p.n=-1),v(u,c)):p.n=c:p.v=c);try{if(l=2,i){if(u||(o="next"),e=i[o]){if(!(e=e.call(i,c)))throw TypeError("iterator result is not an object");if(!e.done)return e;c=e.value,u<2&&(u=0)}else 1===u&&(e=i.return)&&e.call(i),u<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=t}else if((e=(f=p.n<0)?c:r.call(n,p))!==a)break}catch(e){i=t,u=1,c=e}finally{l=1}}return{value:e,done:f}}}(r,o,i),!0),l}var a={};function u(){}function c(){}function l(){}e=Object.getPrototypeOf;var s=[][n]?e(e([][n]())):(v(e={},n,function(){return this}),e),f=l.prototype=u.prototype=Object.create(s);function d(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,l):(t.__proto__=l,v(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return c.prototype=l,v(f,"constructor",l),v(l,"constructor",c),c.displayName="GeneratorFunction",v(l,o,"GeneratorFunction"),v(f),v(f,o,"Generator"),v(f,n,function(){return this}),v(f,"toString",function(){return"[object Generator]"}),(p=function(){return{w:i,m:d}})()}function v(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}v=function(t,e,r,n){if(e)o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r;else{var i=function(e,r){v(t,e,function(t){return this._invoke(e,r,t)})};i("next",0),i("throw",1),i("return",2)}},v(t,e,r,n)}function d(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function y(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(t){d(i,n,o,a,u,"next",t)}function u(t){d(i,n,o,a,u,"throw",t)}a(void 0)})}}function h(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,b(n.key),n)}}function m(t,e,r){return(e=b(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function b(t){var e=function(t,e){if("object"!=f(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=f(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}
1(t,"string");return"symbol"==f(e)?e:e+""}var g=function(){return t=function t(e,r,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"http://localhost:8080/api/v1",i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),m(this,"baseUrl",void 0),m(this,"brand",void 0),m(this,"country",void 0),m(this,"language",void 0),m(this,"authenticationRequired",void 0),this.baseUrl=o,this.brand=e,this.country=r,this.language=n,this.authenticationRequired=i},e=[{key:"_getAuthToken",value:(l=y(p().m(function t(){var e,r;return p().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,fetch("/content/misc/api/aoc/v1/iap.json");case 1:if((e=t.v).ok){t.n=2;break}throw new Error("Failed to retrieve IAP auth token: (".concat(e.status,")"));case 2:return t.n=3,e.json();case 3:if((r=t.v).token){t.n=4;break}throw new Error("Token was missing or empty in IAP response");case 4:return t.a(2,r.token)}},t)})),function(){return l.apply(this,arguments)})},{key:"_callApi",value:(c=y(p().m(function t(){var e,r,n,o,i,a=arguments;return p().w(function(t){for(;;)switch(t.n){case 0:if(e=a.length>0&&void 0!==a[0]?a[0]:"",r=a.length>1&&void 0!==a[1]&&a[1]?"".concat(this.baseUrl,"/").concat(this.brand,"/").concat(e):"".concat(this.baseUrl,"/").concat(this.brand,"/").concat(this.country,"/").concat(this.language).concat(e),n={"Content-Type":"application/json",Accept:"application/json"},!this.authenticationRequired){t.n=2;break}return t.n=1,this._getAuthToken();case 1:o=t.v,n.Authorization="Bearer ".concat(o);case 2:return t.n=3,fetch(r,{headers:n});case 3:if((i=t.v).ok){t.n=4;break}throw new Error("Accessories Catalog API request failed: (".concat(i.status,") for ").concat(r));case 4:return t.a(2,i.json())}},t,this)})),function(){return c.apply(this,arguments)})},{key:"getNameplates",value:(u=y(p().m(function t(){var e;return p().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this._callApi();case 1:return e=t.v,t.a(2,null!=e?e:[])}},t,this)})),function(){return u.apply(this,arguments)})},{key:"getPartCategoriesByNameplate",value:(a=y(p().m(function t(e){var r;return p().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this._callApi("/".concat(e));case 1:return r=t.v,t.a(2,r?r.map(function(t){return{name:t.name,subCategories:t.subCategories,urlPortion:t.urlPortion}}):[])}},t,this)})),function(t){return a.apply(this,arguments)})},{key:"getPartsBySubCategory",value:(i=y(p().m(function t(e,r,n){var o;return p().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this._callApi("/".concat(e,"/").concat(r,"/").concat(n));case 1:return o=t.v,t.a(2,o||[])}},t,this)})),function(t,e,r){return i.apply(this,arguments)})},{key:"getPartByPath",value:(o=y(p().m(function t(e){return p().w(function(t){for(;;)if(0===t.n)return t.a(2,this._callApi(e,!0))},t,this)})),function(t){return o.apply(this,arguments)})},{key:"getPart",value:(n=y(p().m(function t(e,r,n,o){return p().w(function(t){for(;;)if(0===t.n)return t.a(2,this._callApi("/".concat(e,"/").concat(r,"/").concat(n,"/").concat(o,"/?view=related-parts")))},t,this)})),function(t,e,r,o){return n.apply(this,arguments)})}],e&&h(t.prototype,e),r&&h(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r,n,o,i,a,u,c,l}(),w=r(71409);function P(t){return P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},P(t)}function _(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function S(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?_(Object(r),!0).forEach(function(e){E(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):_(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function O(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof u?n:u,l=Object.create(c.prototype);return j(l,"_invoke",function(r,n,o){var i,u,c,l=0,s=o||[],f=!1,p={p:0,n:0,v:t,a:v,f:v.bind(t,4),d:function(e,r){return i=e,u=0,c=t,p.n=r,a}};function v(r,n){for(u=r,c=n,e=0;!f&&l&&!o&&e<s.length;e++){var o,i=s[e],v=p.p,d=i[2];r>3?(o=d===n)&&(c=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=t):i[0]<=v&&((o=r
1<2&&v<i[1])?(u=0,p.v=n,p.n=i[1]):v<d&&(o=r<3||i[0]>n||n>d)&&(i[4]=r,i[5]=n,p.n=d,u=0))}if(o||r>1)return a;throw f=!0,n}return function(o,s,d){if(l>1)throw TypeError("Generator is already running");for(f&&1===s&&v(s,d),u=s,c=d;(e=u<2?t:c)||!f;){i||(u?u<3?(u>1&&(p.n=-1),v(u,c)):p.n=c:p.v=c);try{if(l=2,i){if(u||(o="next"),e=i[o]){if(!(e=e.call(i,c)))throw TypeError("iterator result is not an object");if(!e.done)return e;c=e.value,u<2&&(u=0)}else 1===u&&(e=i.return)&&e.call(i),u<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=t}else if((e=(f=p.n<0)?c:r.call(n,p))!==a)break}catch(e){i=t,u=1,c=e}finally{l=1}}return{value:e,done:f}}}(r,o,i),!0),l}var a={};function u(){}function c(){}function l(){}e=Object.getPrototypeOf;var s=[][n]?e(e([][n]())):(j(e={},n,function(){return this}),e),f=l.prototype=u.prototype=Object.create(s);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,l):(t.__proto__=l,j(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return c.prototype=l,j(f,"constructor",l),j(l,"constructor",c),c.displayName="GeneratorFunction",j(l,o,"GeneratorFunction"),j(f),j(f,o,"Generator"),j(f,n,function(){return this}),j(f,"toString",function(){return"[object Generator]"}),(O=function(){return{w:i,m:p}})()}function j(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}j=function(t,e,r,n){if(e)o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r;else{var i=function(e,r){j(t,e,function(t){return this._invoke(e,r,t)})};i("next",0),i("throw",1),i("return",2)}},j(t,e,r,n)}function C(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function k(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(t){C(i,n,o,a,u,"next",t)}function u(t){C(i,n,o,a,u,"throw",t)}a(void 0)})}}function A(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,T(n.key),n)}}function E(t,e,r){return(e=T(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function T(t){var e=function(t,e){if("object"!=P(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=P(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==P(e)?e:e+""}var N=function(){function t(e){var r=e.brand,n=e.locale,o=e.urls,i=e.authenticationRequired;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),E(this,"_api",void 0),E(this,"_brand",void 0),E(this,"_market",void 0),E(this,"_language",void 0),E(this,"_locale",void 0),E(this,"_authenticationRequired",void 0),E(this,"_urls",void 0);var a=this._splitLocale(n),u=a.language,c=a.market;this._authenticationRequired=i,this._brand="lrdx"===r?"lr":r,this._language=u,this._locale=n,this._market=c,this._urls=o,this._api=new g(this._brand,this._market,this._language,this._urls.api,this._authenticationRequired)}return e=t,r=[{key:"mediaUrl",get:function(){return this._urls.media}},{key:"getCategories",value:(f=k(O().m(function t(e){var r,n,o,i;return O().w(function(t){for(;;
1)switch(t.n){case 0:if(r="aoc-".concat(e,"-categories"),!(n=sessionStorage.getItem(r))){t.n=4;break}if(t.p=1,o=JSON.parse(n),!(Array.isArray(o)&&o.length>0)){t.n=2;break}return t.a(2,o);case 2:t.n=4;break;case 3:t.p=3,t.v;case 4:return t.n=5,this._api.getPartCategoriesByNameplate(e);case 5:if((i=t.v)&&i.length){t.n=6;break}throw new Error("No categories found for nameplate: ".concat(e));case 6:return sessionStorage.setItem(r,JSON.stringify(i)),t.a(2,i)}},t,this,[[1,3]])})),function(t){return f.apply(this,arguments)})},{key:"getPart",value:(l=k(O().m(function t(e,r,n,o){return O().w(function(t){for(;;)if(0===t.n)return t.a(2,this._api.getPart(e,r,n,o))},t,this)})),function(t,e,r,n){return l.apply(this,arguments)})},{key:"getPartByPath",value:(c=k(O().m(function t(e){return O().w(function(t){for(;;)if(0===t.n)return t.a(2,this._api.getPartByPath(e))},t,this)})),function(t){return c.apply(this,arguments)})},{key:"getPartsBySubCategory",value:(u=k(O().m(function t(e,r,n){return O().w(function(t){for(;;)if(0===t.n)return t.a(2,this._api.getPartsBySubCategory(e,r,n))},t,this)})),function(t,e,r){return u.apply(this,arguments)})},{key:"getAllPartsByCategories",value:(a=k(O().m(function e(r,n){var o,i,a,u=this;return O().w(function(e){for(;;)switch(e.n){case 0:return o=n.flatMap(function(e){return e.subCategories.map(function(){var n=k(O().m(function n(o){var i,a,c;return O().w(function(n){for(;;)switch(n.n){case 0:return i=t.getPartsCacheKey(e.urlPortion,o.urlPortion),n.p=1,a=i,n.n=2,u.getPartsBySubCategory(r,e.urlPortion,o.urlPortion);case 2:return c=n.v,n.a(2,[a,c]);case 3:return n.p=3,n.v,n.a(2,[i,[]])}},n,null,[[1,3]])}));return function(t){return n.apply(this,arguments)}}())}),i=Map,e.n=1,Promise.all(o);case 1:return a=e.v,e.a(2,new i(a))}},e)})),function(t,e){return a.apply(this,arguments)})},{key:"getPathParameters",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location.pathname;if(!t.match("/accessories/"))throw new Error("No `/accessories/` segment found in path.");var e=t.trim().replace(".html","").split("/"),r=e.indexOf("accessories"),n=e.slice(0,r+1).join("/"),o=e[r+1],i=e[r+2],a=e[r+3];return{accessory:e[r+4],base:n,category:i,nameplate:o,subcategory:a}}},{key:"getNameplates",value:(i=k(O().m(function t(){var e,r,n,o;return O().w(function(t){for(;;)switch(t.n){case 0:if(e="aoc-nameplates",!(r=sessionStorage.getItem(e))){t.n=4;break}if(t.p=1,n=JSON.parse(r),!(Array.isArray(n)&&n.length>0)){t.n=2;break}return t.a(2,n);case 2:t.n=4;break;case 3:t.p=3,t.v;case 4:return t.n=5,this._api.getNameplates();case 5:if((o=t.v)&&o.length){t.n=6;break}throw new Error("No nameplates found");case 6:return sessionStorage.setItem(e,JSON.stringify(o)),t.a(2,o)}},t,this,[[1,3]])})),function(){return i.apply(this,arguments)})},{key:"renderPartCard",value:function(t,e,r){var o,i,a,u=arguments.length>3&&void 0!==arguments[3]&&arguments[3],c="/"!==e.charAt(0)?"/":"",l=e.includes("__accessory__")?e.replace("__accessory__",t.urlPortion):"".concat(c).concat(e,"/").concat(t.urlPortion,".html"),f=t.imageThumbnailUrl?"".concat(this._urls.media).concat(t.imageThumbnailUrl):"",p={productName:null!==(o=t.name)&&void 0!==o?o:"",productPriceHuman:String(null!==(i=t.priceFormatted)&&void 0!==i?i:""),productPriceMachine:String(null!==(a=t.totalPriceIncLocalTax)&&void 0!==a?a:""),productImageUrl:f},v=null;u&&(v=(0,w.so)(t,this._locale,l));var d=(0,n.Kp)("li",["AccessoriesCatalogDetail__related-parts-item"]);return new s(d,{productData:p,elementType:"a",className:["AccessoriesCatalogDetail__related-parts-link","AccessoriesCatalogDetail__related-parts-card"],attributes:S({href:l,"data-accessory":t.urlPortion},r?{target:r}:{}),headerContent:v}),d}},{key:"_splitLocale",value:function(t){var e=t.match(/^([a-z]{2})_([a-z]{2})$/i);if(!e)throw new Error('Invalid locale format "'.concat(t,'" â expected ll_cc format (e.g. "en_gb", "fr_be")'));return{language:e[1].toLowerCase(),market:e[2].toLowerCase()}}}],o=[{key:"getPartsCacheKey",value:function(t,e){return"".concat(t,"/").concat(e)}}],r&&A(e.prototype,r),o&&A(e,o),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,o,i,a,u,c,l,f}()},86079:function(t,e,r){r.d(e,{G:function(){return u}});var n=r(96980);function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,a(n.key),n)}}function a(t){var e=function(t,e){if("object"!=o(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}
1(t,"string");return"symbol"==o(e)?e:e+""}var u=function(){return t=function t(e){var r,o,i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{locale:void 0};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.element=e,this.locale=null!==(r=a.locale)&&void 0!==r?r:e.getAttribute("data-locale");var u=null!==(o=null===(i=this.element.getAttribute("data-locale"))||void 0===i?void 0:i.split("_").map(function(t,e){return e?t.toUpperCase():t.toLowerCase()}).join("-"))&&void 0!==o?o:"";this.getPlural=(0,n.ZB)(u),this.getRelativeDate=(0,n.yg)(u),this.initI18n()},r=[{key:"getMessage",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{retainCasing:!0},n=t.replace(/\{\{(\w+)\}\}/g,""),o=n===n.toUpperCase(),i=n===n.toLowerCase();return t.replace(/\{\{(\w+)\}\}/g,function(t,n){if(void 0===(null==e?void 0:e[n]))return t;var a=e[n].toString();return r.retainCasing&&(o?a=a.toUpperCase():i&&(a=a.toLowerCase())),a})}}],(e=[{key:"initI18n",value:function(){for(var t=this.element.getElementsByTagName("*"),e=/\{{[DMYdmy]+\s*[DMYdmy]*;[1-9]\s(months?|years?|days?)\}\}/gi,r=0;r<t.length;r++){var n=t[r];n.innerHTML.match(e)&&(n.innerHTML=n.innerHTML.replace(e,this.getRelativeDate))}}}])&&i(t.prototype,e),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}()},96980:function(t,e,r){r.d(e,{ZB:function(){return a},yg:function(){return c}});var n=r(86079);function o(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return i(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var a=function(t){return function(e,r){var o,i;if(!r)return r;var a=new Intl.PluralRules(t).select(e),u=null==r||null===(o=r.split)||void 0===o?void 0:o.call(r,";");if((null==u?void 0:u.length)<=1)return"".concat(e," ").concat(r);var c=Object.fromEntries(null==u?void 0:u.map(function(t){return t.split(":")})),l=null!==(i=null==c?void 0:c[a])&&void 0!==i?i:null==c?void 0:c.other;return l.includes("{{quantity}}")?n.G.getMessage(l,{quantity:e}):"".concat(e," ").concat(l)}},u={YEAR:function(t,e){return t.setFullYear(t.getFullYear()+e)},MONTH:function(t,e){return t.setMonth(t.getMonth()+e)},DAY:function(t,e){return t.setDate(t.getDate()+e)}},c=function(t){return function(e){var r=o(e.replace(/[{}]/g,"").split(";"),3),n=r[0],i=r[1],a=r[2],c=new Date;i.split(",").forEach(function(t){var e=o(t.trim().split(" "),2),r=e[0],n=e[1],i=parseInt(r,10);if(!Number.isNaN(i)){var a=n.toUpperCase().replace(/S$/,""),l=u[a];l&&l(c,i)}});var l,s,f,p,v=new Intl.DateTimeFormat(t,(l=n.toUpperCase(),s={},f={Y:{2:"2-digit",4:"numeric"},M:{1:"numeric",2:"2-digit",3:"short",4:"long"},D:{1:"numeric",2:"2-digit"}},p={Y:"year",M:"month",D:"day"},Object.keys(f).forEach(function(t){var e=t.toUpperCase();if(l.includes(e)){var r=l.split(e).length-1,n=f[e][r];s[p[e]]=null!=n?n:"numeric"}}),s)).format(c);return"L"===a?v.toLowerCase():"U"===a?v.toUpperCase():v}}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.