1"use strict";(self.webpackChunkaem_maven_archetype=self.webpackChunkaem_maven_archetype||[]).push([["components-configuratorprompt-cplayer-js","components-configuratorprompt-saved-build-template-js","components-configuratorprompt-utils-js"],{47949:function(t,e,n){n.r(e),n.d(e,{adjustCPlayerImage:function(){return s},configuratorImageReduction:function(){return l},getBuildUrl:function(){return m},initCPlayer:function(){return p}});var r=n(2048),i=n(71202),a=n(31695),o=n(97874);function c(t){return function(t){if(Array.isArray(t))return u(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 u(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(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 u(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var f=document.querySelector(".ConfiguratorPrompt__saved-build-data")&&document.querySelector(".ConfiguratorPrompt__saved-build-data").getAttribute("data-cplayer-api-key"),l=function(t,e){return e?t-.3*t:t},s=function(t){if(f){var e=t.classList.contains("ConfiguratorPrompt--config-image-reduction"),n=t.querySelector(".CPlayer__innerdiv"),r=t.querySelector(".ConfiguratorPrompt__image"),i=t.querySelector("canvas"),c=t.querySelector(".canvas-container");if(i&&n&&r){if((i.offsetWidth<c.offsetWidth||"large"!==(0,a.pi)(!1))&&(n.style.width="initial"),"large"===(0,a.pi)(!1)){var u=e?100:130,s=(window.innerWidth-(o.Y+1))*((u-200)/(2e3-(o.Y+1)))+200;s=(s=l(s,e))<u?u:s,n.style.width="".concat(s,"%")}var d=n.offsetWidth,m=n.offsetHeight,p=r.offsetWidth,g=r.offsetHeight;n.style.marginLeft="".concat(-(d-p)/2,"px"),n.style.marginTop="".concat(-(m-g)/2,"px"),"large"!==(0,a.pi)(!1)&&e&&(n.style.marginTop="0px")}}},d=function(t,e){!function(t){c(t.querySelectorAll(".CPlayer__innerdiv")).forEach(function(t,e){e>0&&t.parentNode.removeChild(t)})}(t);var n=e.vehicleName,r=e.vehicleDetail,a=t.querySelector("canvas");(0,i.eA)(a)&&(a.setAttribute("aria-label","".concat(n," ").concat(r[0])),a.setAttribute("role","img")),s(t)},m=function(t){return t&&t.configWebUrl?t.configWebUrl:t&&t.currentBuildUrl},p=function(t,e,n){if(f){var i=m(e);if(i){var a=t.querySelector(".CPlayer__innerdiv");a&&a.parentNode.removeChild(a);var o={apiKey:f,scale:1,debug:!1,onLoadCallback:function(){d(t,e)}},c={webUrl:i&&i.split("?")[0],layout:n,view:"exterior",currentFrame:0,frames:[0]},u=t.querySelector(".canvas-container");new r.A(u,o).renderFrame(c)}}}},68850:function(t,e,n){n.r(e),n.d(e,{appendSavedView:function(){return y},findFeatureByName:function(){return u},findFirstPropertyValue:function(){return l},findObjectByKey:function(){return f},getNameplate:function(){return m},getSavedBuildAttribute:function(){return o},getVehicleId:function(){return p},getVehicleInfoString:function(){return s},outputAttribute:function(){return c},savedBuildTemplate:function(){return g},secondaryCtas:function(){return d}});var r=n(97874),i=n(47949),a=n(27404),o=function(t){var e=t.dataset;return Object.keys(e).forEach(function(t){e[t]=e[t].startsWith("cdx.cplayer.")?"":e[t]}),e},c=function(t){return t||""},u=function(t,e){return e.find(function(e){return e.name===t})},f=function(t,e){return e.find(function(e){return Object.prototype.hasOwnProperty.call(e,t)})},l=function(t){return t[Object.keys(t)[0]]},s=function(t){var e=t["feature-dictionary"]["feature-list"],n=[];return["BODYSTYLE","ENGINE","SPECPACK"].forEach(function(t){var r=u(t,e);if(r){var i=f("description",r.feature);if(i){var a=l(i.description)||"";n.push(a.replace(/-/g,"‑"))}}}),n.join(" | ")},d=function(t){var e=c(t.savedBuildsCtaText),n=c(t.savedBuildsCtaUrl),r=c(t.orderStockCtaText),i=c(t.orderStockCtaUrl);if(!(e&&e||r&&i))return"";var a=function(t,e){return t&&e?'<a class="secondaryLinkWithStyle" href="'.concat(e,'"><span>').concat(t,"</span></a>"):""},o=a(e,n),u=a(r,i);return""===o&&""===u?"":'<div class="secondaryLinkContainer">\n '.concat(a(e,n),"\n ").concat(a(r,i),"\n </div>")},m=function(t){return l(t["feature-dictionary"].vehicle.description)},p=function(t){return t["feature-dictionary"].vehicle.id},g=function(t,e,n){var r=o(e),i=m(t.configData);return'<section class="ConfiguratorPrompt ConfiguratorPrompt__saved-build ConfiguratorPrompt--show fontSmooth">\n <div class="ConfiguratorPrompt__image">\n <div class="canvas-container">\n <img src="/resources/public/images/transparent-1x1.png" />\n </div>\n </div>\n <div class="ConfiguratorPrompt__content">\n <h2 class="ConfiguratorPrompt__header heading headingH3 fontH3">'.concat(c(r.heading),'</h2>\n <h3 class="ConfiguratorPrompt__nameplate heading headingH4 fontH4">').concat(c(i),'</h3>\n <div class="ConfiguratorPrompt__derivatives">').concat(s(t.configData),'</div>\n <p class="ConfiguratorPrompt__copy fontBodyCopy">').concat(c(r.subHeading),'</p>\n <div class="linkContainer">\n <div class="primaryLinkContainer">\n <a class="').concat(n,'" href="').concat(t.customerData.url,'"><span>').concat(c(r.primaryCtaText),"</span></a>\n </div>\n ").concat(d(r),"\n </div>\n </div>\n </section>")},y=function(t,e,n){if(e){var o=document.createElement("div"),c=e.querySelector(".primaryLinkWithStyle").className||".primaryLinkWithStyle";o.innerHTML=g(t,n,c);var u=o.firstElementChild,f="ltr"===getComputedStyle(document.querySelector("html")).direction?"right":"left";u.setAttribute("data-intro-image-positioning",e.getAttribute("data-intro-image-positioning")||f),u.setAttribute("data-theme",e.getAttribute("data-theme")||"light"),e.after(u);var l={vehicleName:m(t.configData),vehicleDetail:s(t.configData),currentBuildUrl:t.customerData.url};enquire.register("screen and (min-width: ".concat(r.Y+1,"px)"),{match:function(){(0,i.initCPlayer)(u,l,"desktop")}}),enquire.register("screen and (max-width: ".concat(r.Y,"px)"),{match:function(){(0,i.initCPlayer)(u,l,"mobile")}});var d=p(t.configData);(0,a.nameplateRequiresImageResize)(d,u),window.addEventListener("resize",function(){(0,i.adju
1stCPlayerImage)(u)})}}},27404:function(t,e,n){n.r(e),n.d(e,{checkForValidConfigBuild:function(){return v},checkForValidQuoteBuild:function(){return y},deleteLegacyLocalStorage:function(){return l},getFinanceLabels:function(){return g},getFinanceOverrideLabels:function(){return d},getJsonFromItemByKey:function(){return m},getTimeDifferenceInDays:function(){return s},initEnquire:function(){return b},nameplateRequiresImageResize:function(){return S},parseVehicleDetails:function(){return h},prefixFinanceLabels:function(){return p},setupDefaultLink:function(){return C}});var r=n(47949),i=n(97874);function a(t){return function(t){if(Array.isArray(t))return t}(t)||u(t)||c(t)||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 o(t){return function(t){if(Array.isArray(t))return f(t)}(t)||u(t)||c(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 c(t,e){if(t){if("string"==typeof t)return f(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?f(t,e):void 0}}function u(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function f(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function l(){var t=o(document.querySelectorAll(".ConfiguratorPrompt"));if(t.length){var e="jaguar"===t[0].getAttribute("data-brand")?"jag":"lr";localStorage.removeItem("ConfiguratorPrompt_".concat(e))}}function s(t){return(Date.now()-t)/864e5}function d(t){var e=t.getAttribute("data-finance-products");return e?JSON.parse(e.replace(/"/g,'"')):[]}function m(t,e,n){var r=e[t],i=r.visibilityRules.getConfiguredNameplateKey(),a="latest"!==i&&n;return r.visibilityRules.datastore.getItemByKey(i,a)}function p(t){return t.getAttribute("data-prefix-labels-before-values")&&"true"===t.getAttribute("data-prefix-labels-before-values")}function g(t,e){var n=t.filter(function(t){return t.productName.toLowerCase()===e.product.name.toLowerCase()});return!!n.length&&n[0]}function y(t,e,n){if(!1===e[n])return!1;var r=m(n,e);return!(s(r.timestamp)>30)&&!!g(t,r)}function v(t){return!1!==t.config}function h(t){var e=[],n=[];if(t&&t.model&&e.push(t.model),t&&t.specpack&&e.push(t.specpack),t&&t.engine){var r=a(t.engine.split("|")),i=r[0],o=r.slice(1);e.push(i),o.forEach(function(t){return n.push(t.trim())})}return{vehicleDetailString:e.join(" | "),engineString:n.join(" | ")}}function b(t,e){enquire.register("screen and (min-width: ".concat(i.Y+1,"px)"),{match:function(){(0,r.initCPlayer)(t,e,"desktop")}}),enquire.register("screen and (max-width: ".concat(i.Y,"px)"),{match:function(){(0,r.initCPlayer)(t,e,"mobile")}})}function C(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"#",r=t[e];if(r instanceof HTMLElement){var i=r.getAttribute("href");i&&"#"!==i||r.setAttribute("href",n)}}function S(t,e){var n=document.querySelector('meta[name="configurator-image-reduction"]'),r=n&&n.getAttribute("content"),i=r&&r.split(",").map(function(t){return t.trim().toLowerCase()});i&&i.length&&i.includes(t.toLowerCase())&&e.classList.add("ConfiguratorPrompt--config-image-reduction")}},97874:function(t,e,n){n.d(e,{Y:function(){return r}});var r=900}}]);
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.