uawdijnntqw1x1x1
IP : 216.73.217.167
Hostname : xhost1.intravision.ru
Kernel : Linux xhost1.intravision.ru 3.16.0-7-amd64 #1 SMP Debian 3.16.59-1 (2018-10-03) x86_64
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
OS : Linux
PATH:
/
var
/
files
/
need-2-delete
/
.
/
mini-borishof.ru1
/
upload
/
coooper
/
clientlib.min.20200624203628-17.js
/
/
define("apps/minidigital/components/product-selector/teaser/clientlib",["jquery","core/Messagebus","core/Individualization","core/utils/cosyImage","core/utils/Environment","apps/minidigital/components/visualizer/clientlib/scripts/utils/Messages","apps/minidigital/components/visualizer/clientlib/scripts/data/Features","core/Debugger","core/componentInitializer","bluebird"],function(d,a,h,f,i,e,j,k,g,b){var c=function(l){this.$element=d(l); this.$elContainer=this.$element.find(".md-product-selector-teaser-container"); this.name=this.$element.data("component-name"); this.isNewVisualizerJourney=this.$element.is("[data-new-visualizer-journey]"); this.isPdhAvailable=!d(".md-js-main").is(".md-pdh-not-available"); this.$previewImage=this.$element.find(".js-preview"); this.$btnMain=this.$element.find(".js-btn-main"); this.$btnSec=this.$element.find(".js-btn-sec"); this.defaults={debug:k.isDebugEnabled(this.name)}; this.options=d.extend({},this.$element.data()); this.modelCode=""; this.persistentData={}; if(!i.isWcmmodeEdit&&this.isNewVisualizerJourney&&this.isPdhAvailable){this.init() }}; c.prototype={init:function(){if(this.$element.parents(".md-product-selector").data("body-type")){this.bodyType=this.$element.parents(".md-product-selector").data("body-type").toString().trim() }else{this.bodyType="" }this.initEvents() },initEvents:function(){a.subscribe({channel:e.channel,topic:e.events.LEAVE,callback:this.initTeaser.bind(this)}); a.subscribe({channel:"md:product-selector",topic:"updateCosyImages",callback:this.hide.bind(this)}); this.$btnMain.on("click touchstart",this.onClickBtnMain.bind(this)); this.$btnSec.on("click touchstart",this.onClickBtnSec.bind(this)); this.$element.hide() },initTeaser:function(l){this.modelCode=l.modelCode?l.modelCode:null; if(this.modelCode){this.setPersistentData(l.features); if(this.hasPersistentData()){this.generatePreview(); this.show() }}},setPersistentData:function(l){if(!(l instanceof j)){throw new TypeError("Provided features are not of type Features!") }this.persistentData=l },hasPersistentData:function(){return(!d.isEmptyObject(this.persistentData)&&this.persistentData instanceof j) },generatePreview:function(){var l=d.extend({vehicle:this.modelCode.substring(0,4),height:510,width:920,w:8000,h:8000,x:1200,y:1200,pov:"HERO",cut:1,var_plate:'"Your MINI"'},this.persistentData.toCosyParams()); this.$previewImage[0].src=f.generateURL(l) },show:function(){this.$element.show(); this.$elContainer.show() },hide:function(){this.$elContainer.hide() },initAllProductSelectors:function(){var l=d(".md-component.model-group-summary"); var m=l.toArray().map(function(n){return g.initElement(d(n)) }); return b.all(m) },onClickBtnMain:function(n){n.preventDefault(); if(h.hasStoragePermission()){h.set(this.bodyType,this.persistentData) }var m=this.persistentData; var l=this.initAllProductSelectors(); l.then(function(){a.publish({channel:"md:product-selector",topic:"updateCosyImages",data:m}); a.publish({channel:e.channel,topic:e.events.LATE_ACCEPTANCE}) }) },onClickBtnSec:function(m){m.preventDefault(); var l=d(".md-visualizer:first").find(".md-product-inpage-anchor a").first(); l.velocity("scroll",{duration:1500}) }}; return c }); define("apps/minidigital/components/product-selector/clientlib/scripts/utils/Messages",function(){var a={channel:"md:product-selector",events:{VIEW_UPDATE:"viewUpdate",VIEW_UPDATE_ALTERNATIVE:"viewUpdateAlternative",ERROR:"error",VIEW_SHOW:"viewShow",UPDATE_COSY_IMAGES:"updateCosyImages"}}; return a }); define("apps/minidigital/components/product-selector/model-group-summary/clientlib",["jquery","core/Messagebus","apps/minidigital/components/visualizer/clientlib/scripts/utils/Messages","apps/minidigital/components/product-selector/model-group-summary/clientlib/scripts/components/initializer","core/CosySlider","apps/minidigital/components/product-selector/clientlib/scripts/data/ModelFeatures"],function(g,a,d,f,e,c){var b=function(h){if(h){this.$elements={el:g(h),slider:g(".ps-model-card__slider",h),disclaimers:g(".md-disclaimer-btn .md-icn-alt",h),conflictsContainer:g(".ps-model-card__conflicts",h),modelCardContainer:g(".md-product-selector-modelgroup-summary",h)}; this.recomendation={}; this.base={chainedString:"",bodycolor:""}; this.data=this.initData(); this.individualConfig={}; this.allowedCodes=[]; this.isSliderWithThumbnails=this.$elements.modelCardContainer.data("isNewGalleryViewEnabled"); if(this.data){this.components=(new f(h)).components; this.slider=false; if(Object.keys(this.recomendation).length>0){this.initSlider(this.recomendation) }else{this.initSlider(this.base) }this.attachEvents(); g(".md-product-selector-reset-wrapper").hide() }else{this.$elements.el.remove() }}}; b.prototype.attachEvents=function(){a.channel(d.channel).subscribe(d.events.CONFIGURATION_OBJECT_UPDATED,this.changeConfig.bind(this)); g(".ps-model-card__update-design-link",this.$elements.$el).on("click",function(){g([document.documentElement,document.body]).animate({scrollTop:g(g(".visualizer")[0]).offset().top},500) }); a.subscribe({channel:"md:product-selector",topic:"updateCosyImages",callback:this.changeConfig.bind(this)}); a.subscribe({channel:"md:visualizer",topic:"configurationUpdate",callback:function(h){g(".md-product-selector-teaser").show(); g(".md-product-selector-reset-wrapper").hide() }.bind(this)}); a.subscribe({channel:"md:visualizer",topic:"resetChanges",callback:function(){this.individualConfig=this.base; this.setCurrentActiveButton(1); this.initSlider(this.base); g('[data-name="individual"]',this.$elements.el).addClass("ps-label-select-group__select-container--first"); g(".ps-model-card__update-design-link",this.$elements.el).hide(); g([document.documentElement,document.body]).animate({scrollTop:g(g(".product-selector")[0]).offset().top-40},500) }.bind(this)}); g(".md-custom-overlay-close").on("click",function(){g(".md-custom-overlay-wrapper").removeClass("pricing-disclaimer-container") }); g(document).on("click",".md-custom-overlay-close",function(){g(".md-custom-overlay-wrapper").removeClass("pricing-disclaimer-container") }); this.components.selectGroup.$el[0].addEventListener("label-group-toggle",function(h){this.setCurrentCar(h.detail.value) }.bind(this)) }; b.prototype.initData=function(){var h=this.$elements.el.data(); if(h.hasOwnProperty("modelRecomendationSa")){this.recomendation={chainedString:h.modelRecomendationSa+"_"+h.modelRecomendationFabric,bodycolor:h.modelRecomendationPaint} }if(h.hasOwnProperty("modelCode")){var i=h.modelCode.split(","); this.modelCode=i&&i.length>0?i[0]:""; return h }return false }; b.prototype.initSlider=function(h){if(h){if(this.slider){this.slider.destroy() }this.slider=new e(this.$elements.slider,this.modelCode,h.sa,h.bodycolor,this.isSliderWithThumbnails) }}; b.prototype.checkConflicts=function(i){var m=["wheels","stripes","bodycolor","caps"]; var j=".ps-model-card__conflict"; var l="ps-model-card__conflict--visible"; var h="ps-model-card__conflicts--visible"; var k=m.filter(function(n){if(this.allowedCodes.indexOf(i[n])===-1){g(j+"--"+n,this.$elements.el).addClass(l); return true }return false }.bind(this)); if(k.length>0){this.$elements.conflictsContainer.addClass(h) }}; b.prototype.prepareSaCode=function(i){var h=i.split("_"); return h.filter(function(j){return this.isValidCode(j) }.bind(this)) }; b.prototype.isValidCode=function(h){return this.allowedCodes.indexOf(h)!==-1 }; b.prototype.setCurrentCar=function(h){if(h==="base"){this.initSlider(this.base) }else{if(h==="individual"){this.initSlider(this.individualConfig) }else{this.initSlider(this.recomendation) }}}; b.prototype.translateConfig=function(j){var k=j; if(!this.allowedCodes||this.allowedCodes.length===0){var i=c.getFeatureWhitelistByModelRange(this.modelCode); if(Array.isArray(i)){i.push("NOSTR"); i.push("NOCAP"); this.allowedCodes=i }}if(!j.hasOwnProperty("chainedString")){var h=Array.isArray(j.optional.code)?j.optional.code:[]; var l=this.individualConfig?this.individualConfig.bodycolor:this.base.bodycolor; k={bodycolor:this.isValidCode(j.bodycolor.code)?j.bodycolor.code:l,wheels:j.wheels.code,stripes:j.stripes.code,caps:j.caps.code,chainedString:h.concat([j.bodycolor.code,j.wheels.code,j.stripes.code,j.caps.code]).join("_")} }k.sa=this.prepareSaCode(k.chainedString); this.checkConflicts(k); return k }; b.prototype.changeConfig=function(h){var i="ps-label-select-group__select-container--first"; g(".ps-model-card__update-design-link",this.$elements.el).show(); g("."+i,this.$elements.el).removeClass(i); g(".md-product-selector-teaser").hide(); g(".md-product-selector-reset-wrapper").show(); g(".md-product-selector-reset-wrapper .hidden").removeClass("hidden"); this.setCurrentActiveButton(0); this.individualConfig=this.translateConfig(h); this.initSlider(this.individualConfig) }; b.prototype.setCurrentActiveButton=function(h){var j=g(".ps-label-select-group__select-container",this.$elements.el); var i="ps-label-select__rounded-button--active"; g("."+i,this.$elements.el).removeClass(i); if(h===2){h=j.length-1 }if(j[h]){g(j[h]).addClass(i) }}; return b }); define("apps/minidigital/components/product-selector/model-group-summary/clientlib/scripts/components/initializer",["core/components/HTMLComponentInitializer","apps/minidigital/components/product-selector/model-group-summary/clientlib/scripts/components/AccordionListComponent","apps/minidigital/components/product-selector/model-group-summary/clientlib/scripts/components/LabelSelectComponent","apps/minidigital/components/product-selector/model-group-summary/clientlib/scripts/components/LabelSelectGroupComponent"],function(b,d,e,c){var a={"label-select":e,"label-select-group":c,"accordion-list":d}; return function(f){var g=new b(f,a); this.components=g.components } }); define("apps/minidigital/components/product-selector/model-group-summary/clientlib/scripts/components/AccordionListComponent",["jquery","core/components/InheritedComponent"],function(b,c){if(!Array.from){Array.from=(function(){var h=Object.prototype.toString; var i=function(k){return typeof k==="function"||h.call(k)==="[object Function]" }; var g=function(l){var k=Number(l); if(isNaN(k)){return 0 }if(k===0||!isFinite(k)){return k }return(k>0?1:-1)*Math.floor(Math.abs(k)) }; var f=Math.pow(2,53)-1; var e=function(l){var k=g(l); return Math.min(Math.max(k,0),f) }; return function j(t){var l=this; var s=Object(t); if(t==null){throw new TypeError("Array.from requires an array-like object - not null or undefined") }var q=arguments.length>1?arguments[1]:void undefined; var n; if(typeof q!=="undefined"){if(!i(q)){throw new TypeError("Array.from: when provided, the second argument must be a function") }if(arguments.length>2){n=arguments[2] }}var r=e(s.length); var m=i(l)?Object(new l(r)):new Array(r); var o=0; var p; while(o<r){p=s[o]; if(q){m[o]=typeof n==="undefined"?q(p,o):q.call(n,p,o) }else{m[o]=p }o+=1 }m.length=r; return m } }()) }var d={steps:[false,false,false,false,false],elements:["Test","Test","Test","Test","Test","Test"],level:0,active:false,hasContent:false}; function a(e){c.call(this,e,d); this.setData({steps:Array.from(new Array(5)).map(function(f,g){return(g+1)<=this.component.data.level }.bind(this)),hasContent:this.component.data.content.toString().trim().length>0}) }a.prototype=Object.create(c.prototype); a.prototype.constructor=a; a.prototype.getElements=function(){return{header:b(".ps-accordion-list__header",this.$el),tabs:b(".js-tab-header",this.$el)} }; a.prototype.attachEvents=function(){this.$elements.header.on("click",this.clickOnElement.bind(this)); this.$elements.tabs.on("click",this.clickOnTabElement.bind(this)) }; a.prototype.clickOnTabElement=function(e){e.preventDefault(); var h=b(event.currentTarget).first(); var f=h.attr("data-fueltype-tab-header"); var g=b(".js-tab-content[data-fueltype-tab-body='"+f+"']",this.$el); if(g.length){b(".js-tab-content.active",this.$el).each(function(){b(this).removeClass("active") }); b(".js-tab-header.selected",this.$el).each(function(){b(this).removeClass("selected") }); h.addClass("selected"); g.addClass("active") }}; a.prototype.clickOnElement=function(e){e.preventDefault(); this.setData({active:!this.component.data.active}) }; return a }); define("apps/minidigital/components/product-selector/model-group-summary/clientlib/scripts/components/LabelSelectComponent",["jquery","core/components/InheritedComponent"],function(b,c){var a={active:false,value:"test"}; var d=function(e){this.$el=e; c.call(this,e,a) }; d.prototype=Object.create(c.prototype); d.prototype.constructor=d; d.prototype.attachEvents=function(){this.$elements.container.on("click",this.clickOnElement.bind(this)) }; d.prototype.getElements=function(){return{container:b(".ps-label-select",this.$el)} }; d.prototype.clickOnElement=function(e){e.preventDefault(); this.$el[0].dispatchEvent(new CustomEvent("label-select-toggle",{bubbles:true,detail:{$el:this.$el,instance:this,value:this.component.data.value}})) }; return d }); define("apps/minidigital/components/product-selector/model-group-summary/clientlib/scripts/components/LabelSelectGroupComponent",["jquery","core/components/InheritedComponent","apps/minidigital/components/product-selector/model-group-summary/clientlib/scripts/components/LabelSelectComponent"],function(b,c,d){var a=function(e){this.$el=e; var f=b("[data-input]",e).toArray().map(function(h){var g=b(h); if(g.data("valid")){return g.html() }return false }); c.call(this,e,{firstLabel:f[0],secondLabel:f[1],thirdLabel:f[2],link:f[3]}) }; a.prototype=Object.create(c.prototype); a.prototype.constructor=a; a.prototype.attachEvents=function(){var e=this; this.$elements.selects.forEach(function(f){f.addEventListener("label-select-toggle",e.toggleLabel.bind(e)) }) }; a.prototype.toggleLabel=function(e){this.deactivateSelects(e.detail.$el); b(".md-custom-overlay-wrapper").removeClass("pricing-disclaimer-container"); if(e.detail.$el.hasClass("disclaimer-label")){b(".md-custom-overlay-wrapper").addClass("pricing-disclaimer-container") }this.$el[0].dispatchEvent(new CustomEvent("label-group-toggle",{bubbles:true,detail:{$el:this.$el,instance:this,value:e.detail.instance.component.data.name}})) }; a.prototype.deactivateSelects=function(f){var g="ps-label-select__rounded-button--active"; var e=b("."+g,this.$el); e.removeClass(g); f.addClass(g) }; a.prototype.getElements=function(){return{selects:this.components.selects.map(function(e){return e.$el[0] })} }; a.prototype.createComponents=function(){var e=b('[data-component="label-select"]',this.$el); return{selects:e.toArray().map(function(f){return new d(b(f)) })} }; return a }); define("apps/minidigital/components/product-selector/clientlib",["jquery","velocity","core/Messagebus","core/componentInitializer","core/TrackingAdapter","core/utils/Environment","core/utils/cosyImage","core/utils/ModelDataService","core/Individualization","apps/minidigital/components/product-selector/clientlib/scripts/utils/Messages","apps/minidigital/components/product-selector/clientlib/scripts/utils/Tracking","apps/minidigital/components/product-selector/clientlib/scripts/utils/ModelFeaturesCheck","apps/minidigital/components/product-selector/clientlib/scripts/views/WizardView","apps/minidigital/components/product-selector/clientlib/scripts/views/WizardLayer","apps/minidigital/components/product-selector/clientlib/scripts/views/ui/ResetButton","apps/minidigital/components/product-selector/clientlib/scripts/data/Data","apps/minidigital/components/visualizer/clientlib/scripts/data/Features","core/Wishlist","lodash","core/Debugger","core/utils/HTMLHelper","core/utils/webp"],function(e,r,q,j,u,o,n,k,m,t,g,w,b,p,a,d,f,h,v,i,s,l){var c=function(x){this.$element=e(x); this.name=this.$element.data("component-name"); this.id=this.name+"-"+this.loadId(); this.$wishlistSection=this.$element.find(".js-wishlist-product-selector-section"); this.wizardViewArr=[]; this.wizardLayer=null; this.data=null; this.currentWizardView=null; this.trackingObj=u.getInstance(); this.isViewUpdate=false; this.isSnucAvailabilityCounterGloballyEnabled=typeof this.$element.data("snuc-availabilitycounter-globally-enabled")!="undefined"; this.defaults={debug:i.isDebugEnabled(this.name)}; this.options=e.extend({},this.$element.data()); this.messageChannel=q.channel(t.channel); if(!o.isWcmmodeEdit){this.init() }}; c.prototype={init:function(){this.settings=e.extend({},this.defaults,this.options); if(this.settings.debug){console.log("ProductSelector.init",this.settings) }this.settings.messagechannel=this.messageChannel; this.setupData(); this.tracking=new g(this); this.subscribe(); this.setupWizardViews(); this.setupLayerView(); this.setupAdditionalUI(); this.data.setStartConfiguration(this.getDeeplinkParams()); this.showCurrentView(); this.wizardViewArr[0].initAdditionalFeatures(); this.updateVsmsCounter(); this.updateSNUCSimilarCarsTeasers() },initProductWishlist:function(y){var x; this.$wishlistSection.each(function(F,B){var P,L,Q,K,M,O,N,A,E,H,I,J,G,D={}; E=e(B); H=E.data("bodyType"); I=E.data("modelCode"); J=E.data("transmissionCode"); if(typeof H!="undefined"||typeof I!="undefined"||typeof J!="undefined"){for(L in y){if(y[L].rangeCode==H&&y[L].code==I){N=y[L].vehicles; break }}if(typeof N=="undefined"){console.error("modelCode ",I," does not exist") }for(L in N){if(N[L].transmissionCode==J){A=N[L]; break }}if(typeof A=="undefined"){console.error("transmissionElement ",A," does not exist") }else{G=A.salesGroupTree.equipment.features.concat(A.salesGroupTree.exterior.features.concat(A.salesGroupTree.interior.features.concat(A.salesGroupTree.packs.features.concat(A.salesGroupTree.trimlevel.features)))); for(L in G){D[G[L].code]=G[L] }if(h.hasStoragePermission()){P=v.template(E.find('[type="text/template"]').html()); K={wishlistEntries:[],hasZeroItems:false,hasSomeItems:false,hasAllItems:false,featureCount:-1,featureInWishlistCount:-1}; M=h.getAllFeatureItems(); var C=0; if(M!=null){for(Q in M){var z=D[M[Q].featureCode]; if(typeof z!="undefined"){K.wishlistEntries.push({code:z.code||"",imageUrl:z.cosyUrl||"",name:z.name||"",description:z.description||""}); C++ }}}if(C==0){K.hasZeroItems=true }else{if(C<h.getItemCount()){K.hasSomeItems=true }else{if(C==h.getItemCount()){K.hasAllItems=true }}}K.featureCount=h.getItemCount(); K.featureInWishlistCount=C; E.replaceWith(P(K)) }}}}) },updateSNUCSimilarCarsTeasers:function(){var A=this.$element.data("snucSimilarcarsTeaserIsActivated"); if(A){var z=this.$element.data("snucSimilarCarsTeaserPath"); if(typeof z!=="undefined"){var x=this.$element.find(".js-snuc-similarcarsteaser-placeholder"); if(x.length>0){var y=this; x.each(function(E,M){var F=z; var C=e(M).data("modelCode"); var H=e(M).data("derivativeName"); var I=e(M).data("fuelType"); var J=e(M).data("driveType"); var B=e(M).data("transmission"); var D=e(M).data("featureCodes"); var G=e(M).data("isAuthorRunMode"); var K=e(M).data("heroImagePath"); K=K.replace(/\//g,"!ph!"); var L=""; if(G){L="?wcmmode=disabled" }F=F.substring(0,F.indexOf(".html"))+".modelCode-"+C+".derivativeName-"+H+".fuelType-"+I+".driveType-"+J+".transmission-"+B+".featureCodes-"+D+".heroImagePath-"+K+".html"+L; e.ajax({url:F,dataType:"html",success:function(P){M.innerHTML=P; var O=e(P).find(".md-snuc-similarcarsteaser__generic-teaser").data("genericTeaserButtonUrl"); e(M).find(".md-snuc-similarcarsteaser__generic-teaser .btn").attr("href",O); var N=e(M).find(".md-image").filter(y._hasSrcsetImages).filter(y._hasNoBrandImages).filter(y._hasNoPackageImage); var Q=y.getIndividualizationFeatures(); if(Q){y.updateCosyImage(N,Q) }j.initElement(e(M).find(".md-snuc-similarcarsteaser")); M.classList.remove("hidden") }}) }) }}}},updateVsmsCounter:function(){var x=this.$element.data("vsmsCountersAreActivated"); if(x){var y=this.$element.data("vsmsProductSelectorPath"); if(typeof y!=="undefined"){e.ajax({url:y,dataType:"json",success:function(G){var F=(typeof G!=="object")?JSON.parse(G):(G||{}); var H=F.fuelViews||{}; var E=F.transmissionViews||{}; var B=F.driveViews||{}; var C=B; var J=this.$element.find(".js-fueltype-vsmscounter"); var I=this.$element.find(".js-transmission-vsmscounter"); var D=this.$element.find(".js-driveType-vsmscounter"); var A=this.$element.find(".js-quickentry-vsmscounter"); var z=this.$element.find(".js-snuc-similarcarsteaser-placeholder"); this.updateVsmsCounterElement(J,H,false,this.isSnucAvailabilityCounterGloballyEnabled); this.updateVsmsCounterElement(I,E,false,this.isSnucAvailabilityCounterGloballyEnabled); this.updateVsmsCounterElement(D,B,false,this.isSnucAvailabilityCounterGloballyEnabled); this.updateVsmsCounterElement(A,C,false,this.isSnucAvailabilityCounterGloballyEnabled); this.updateVsmsCounterElement(z,B,true,this.isSnucAvailabilityCounterGloballyEnabled) }.bind(this)}) }}},updateVsmsCounterElement:function(z,y,x,A){if(A&&z.length>0){z.each(function(C,E){var F=e(E).data("modelId"); if(typeof F!=="undefined"){var D=y[F]||{}; var B=D.count; if(typeof B!=="undefined"&&B>=0){if(!x){e(E).find(".js-vsmscounter-count").text(B); e(E).removeClass("hidden") }else{e(E).attr("data-model-counter",B) }}}}.bind(y)) }},getDeeplinkParams:function(){var B={}; var z=this.getParameterByName("modelgroupslug"); var x=this.data.getModelGroupIdBySlug(z); if(z&&x){B[0]=x }var C=this.getParameterByName("fueltype"); if(C){B[1]=C }var y=this.getParameterByName("transmission"); if(y){B[2]=y }var A=this.getParameterByName("drive"); if(A){B[3]=A }return B },subscribe:function(){this.messageChannel.subscribe({topic:t.events.VIEW_UPDATE,callback:this.onViewUpdateHandler.bind(this)}); this.messageChannel.subscribe({topic:t.events.VIEW_UPDATE_ALTERNATIVE,callback:this.onViewUpdateAlternativeHandler.bind(this)}); this.messageChannel.subscribe({topic:t.events.UPDATE_COSY_IMAGES,callback:this.onUpdateCosyImages.bind(this)}); k.channel.subscribe({topic:k.events.LOADED,callback:this.checkIndividualization.bind(this)}); k.channel.subscribe({topic:k.events.LOADED,callback:this.initProductWishlist.bind(this)}) },setupData:function(){this.data=d.init(this.settings) },setupWizardViews:function(){var x=this; var y=this.$element.find("."+this.data.settings.wizardViewSelector); this.data.END_VIEWSTEP=y.length-1; if(this.data.isProductSelectorPackageMode()){this.data.PACKAGE_VIEWSTEP=this.data.END_VIEWSTEP-1 }e.each(y,function(z,A){x.data.pushStep(e(A).data(x.data.settings.wizardDataSelector)); x.wizardViewArr.push(new b(z,A,x.settings)) }) },setupLayerView:function(){var x=this.$element.find("."+this.data.settings.wizardLayerSelector); if(x.length){this.wizardLayer=new p(x[0]) }var y=this.$element.find(".js-wizard-layer--alternative"); if(y.length){this.wizardLayerAlternative=new p(y[0]) }},setupAdditionalUI:function(){this.resetBtn=new a(this.$element.find(".js-resetbutton")); var x=this.$element.find(".js-updateconfig--alternative"); x.on("click",this.onClickBtnUpdateConfigAlternative.bind(this)) },onViewUpdateHandler:function(x){this.isViewUpdate=true; this.hideCurrentView(); this.showCurrentView(); this.updateEmissiontable() },onViewUpdateAlternativeHandler:function(y){if(this.data.isProductSelectorQuickMode()){this.showLayerAlternative(); var x=y.id; this.updateAlternativeView(x) }},checkIndividualization:function(){var x=this.getIndividualizationFeatures(); if(x){this.onUpdateCosyImages(x) }},getIndividualizationFeatures:function(){if(m.has(this.data.settings.bodyType)&&!this.settings.ignoreIndividualization){var x=m.get(this.data.settings.bodyType); return new f(x) }return false },onUpdateCosyImages:function(x){if(!this.settings.ignoreIndividualization){this.updateCharacteristics(x); this.data.updateCosyParameters(x); this.updateCosyImages(x) }},updateCharacteristics:function(x){var y=this.$element.find("."+this.data.settings.sliderSelector+" ."+this.data.settings.wizardOptionSelector); y.each(function(C,D){var B=e(D),E=B.data("model-code").toString().split(","),F=x; if(E.length){F=new w(E).checkFeatures(F) }if(!e.isEmptyObject(F.bodycolor)){var A=B.find(".js-characteristics-colour"); A.removeClass("is-default"); A.find(".option-name").text(F.bodycolor.name.toString().trim()); if(F.bodycolor.isDefault){A.addClass("is-default") }}if(!e.isEmptyObject(F.wheels)){var z=B.find(".js-characteristics-wheels"); z.removeClass("is-default"); z.find(".option-name").text(F.wheels.name.toString().trim()); if(F.wheels.isDefault){z.addClass("is-default") }}}) },updateCosyImages:function(x){this._getCosyImages().each(function(y,z){this.updateCosyImage(z,x) }.bind(this)) },updateCosyImage:function(B,z){var y=e(B),D=y.find("img"),x=y.closest("[data-model-code]"),E=z; if(x.length){var C=x.data("model-code").toString().split(","); E=new w(C).checkFeatures(E); if(y.parents(".md-product-selector-model-summary").length!==0){this.checkForDefaults(y,E) }}var A=z.toCosyParams.apply(E); if(l.isSupported){A.resp="WEBP" }D.each(function(F,G){n.replaceParameters(G,A) }) },_getCosyImages:function(){return this.$element.find(".md-image").filter(this._hasSrcsetImages).filter(this._hasNoBrandImages).filter(this._hasNoPackageImage) },_hasSrcsetImages:function(x,y){return e(y).find('[srcset*="cosy"], [data-srcset*="cosy"], [data-cosy-srcset*="cosy"]').length>0 },_hasNoBrandImages:function(x,y){return e(y).parents(".md-modelgroup-summary-brandimage").length===0 },_hasNoPackageImage:function(x,y){return e(y).parents(".md-product-selector-packageimage").length===0 },checkForDefaults:function(y,A){var z=y.parents(".md-product-selector-model-summary").find(".js-model-summary-fallbacks"); var x=false; if(A.hasOwnProperty("bodycolor")&&A.bodycolor.isDefault){z.children(".fallback__colour").removeClass("hidden"); x=true }if(A.hasOwnProperty("wheels")&&A.wheels.isDefault){z.children(".fallback__wheels").removeClass("hidden"); x=true }z.toggleClass("hidden",!x) },loadId:function(){var x="data-md-tracking-region-id"; return(this.$element.find("["+x+"]").first()?this.$element.find("["+x+"]").first().attr(x):"unidentified") },updateEmissiontable:function(){var x=e(".md-product-model-summary"); var z=x.find("select"); var y=this.data.currentConfig[2]; if(y){z.val(y).trigger("change") }},hideCurrentView:function(){if(this.currentWizardView){this.currentWizardView.hide() }},showCurrentView:function(){this.currentWizardView=this.wizardViewArr[this.data.currentViewStep]; switch(this.data.currentViewStep){case this.data.BASE_VIEWSTEP:this.showFirstView(); break; case this.data.END_VIEWSTEP:if(this.$element.data("wizardSkipProductModelSummary")){this.skipLastView() }else{this.showLastView() }break; default:this.showViewAccordingToOptions(); break }},setCurrentViewStep:function(){this.currentWizardView=this.wizardViewArr[this.data.currentViewStep]; var x=this.currentWizardView.update(); if(!x){this.data.currentViewStep=this.data.BASE_VIEWSTEP; this.currentWizardView=this.wizardViewArr[this.data.currentViewStep] }return x },showViewAccordingToOptions:function(){var x=this.getCurrentViewOptionLength(); if(x>1){this.updateView(); this.showView(); this.showLayer() }else{if(x===1){this.selectOptionAndSkipView() }else{this.skipWithoutSelection() }}},getCurrentViewOptionLength:function(){var x=this.data.currentConfig[this.data.BASE_VIEWSTEP]; var y=this.data.getConfigStr(); return this.currentWizardView.getOptionLength(x,y) },updateView:function(){this.currentWizardView.update() },updateAlternativeView:function(A){var x=this.$element.find(".js-wizard-layer--alternative .md-product-selector-quick-view"); x.removeClass("is-active"); var y=this.$element.find(".js-wizard-layer--alternative .md-product-selector-quick-view[data-modelgroup-id="+A+"]"); var z=y.find(".js-wizard-view-option"); y.addClass("is-active"); z.addClass("is-active"); s.equalizeHeight(z,".md-summary-content-wrapper","padding-bottom"); s.equalizeHeight(z,".md-product-selector-summary__key-stats-wrapper","padding-bottom") },showFirstView:function(){this.showView(); if(this.isViewUpdate){this.hideLayer() }},showLastView:function(){this.updateView(); this.showView(); this.showLayer() },skipLastView:function(){this.showLastView(); var x=this.currentWizardView.$element.find(".md-detail-option.is-active ."+this.data.settings.configbuttonSelector); if(this.settings.debug){console.log("ProductSelector.skipLastView",x) }if(x.length!==0){x.first().click(); this.$element.find(".js-close").click() }},selectOptionAndSkipView:function(){this.currentWizardView.selectAndSkip() },skipWithoutSelection:function(){this.currentWizardView.skipWithoutSelection() },showView:function(){this.currentWizardView.show(); this.messageChannel.publish({topic:t.events.VIEW_SHOW}) },showLayer:function(){if(!this.wizardLayer.isOpen){this.wizardLayer.show() }else{this.wizardLayer.scrollToTop() }},hideLayer:function(){this.wizardLayer.hide() },scrollToTop:function(){e(window).scrollTop(this.currentWizardView.$element.offset().top) },getParameterByName:function(y,x){if(!x){x=window.location.href }y=y.replace(/[\[\]]/g,"\\$&"); var A=new RegExp("[?&]"+y+"(=([^&#]*)|&|#|$)"),z=A.exec(x); if(!z){return null }if(!z[2]){return"" }return decodeURIComponent(z[2].replace(/\+/g," ")) },showLayerAlternative:function(){if(!this.wizardLayerAlternative.isOpen){this.wizardLayerAlternative.show() }else{this.wizardLayerAlternative.scrollToTop() }},onClickBtnUpdateConfigAlternative:function(z){var x=e(z.currentTarget); var B=x.data("model-id"); z.preventDefault(); this.data.currentViewStep=this.data.END_VIEWSTEP; this.wizardLayerAlternative.hide(); var y=this.$element.find(".js-wizard-layer .js-wizard-view .js-wizard-subview .js-wizard-view-option"); y.removeClass("is-active"); this.currentWizardView=this.wizardViewArr[this.data.currentViewStep]; var A=this.currentWizardView.$element.find("[data-model-id="+B+" ]"); A.addClass("is-active"); this.showCurrentView() }}; return c }); define("apps/minidigital/components/product-selector/clientlib/scripts/data/Data",["jquery"],function(d){var b=function(e){this.OPTIONS_SEPARATOR="_"; this.OPTION_DEFAULT="default"; this.BASE_VIEWSTEP=0; this.END_VIEWSTEP=4; this.BUTTONTYPE_BACK="buttonBack"; this.BUTTONTYPE_RESTART="buttonRestart"; this.UPDATE_BY_BACK="click_back"; this.UPDATE_BY_FORWARD="click_forward"; this.UPDATE_BY_SYSTEM="system"; this.EVENTTYPE_TOUCHEND="touchend"; this.EVENTTYPE_CLICK="click"; this.BREAKPOINT_TABLET=768; this.MODE_NORMAL="normal"; this.MODE_QUICK="quick"; this.MODE_PACKAGE="package"; this.PACKAGE_VIEWSTEP=this.END_VIEWSTEP-1; this.defaults={}; this.options=e; this.settings=d.extend({},this.defaults,this.options); this.currentViewStep=this.BASE_VIEWSTEP; this.currentConfig={}; this.currentOptions=[]; this.wizardStepArr=[]; this.obj={}; this.wizardStepInteractionArr=[]; this.slugToModelGroupMap={}; this.eventType=null; this.cosyParameters={}; this.packageSaCode=""; this.init() }; b.prototype={init:function(){this.currentViewStep=this.settings.startStep },updateCurrentConfig:function(e,j,f,h,g,i){this.currentConfig=this.getConfig(e,j); if(f){this.currentConfig.slug=f }this.currentConfig.bodyType=h; this.currentConfig.modelCode=g; this.currentConfig.sellingPrice=i },updateCurrentOptions:function(f,e){this.currentOptions=this.currentOptions||[]; this.currentOptions[f]=e },updateCosyParameters:function(e){this.cosyParameters=e },getCosyParameters:function(){return this.cosyParameters },getNeighbouredViewStep:function(e){return(this.currentViewStep+e) },setCurrentViewStep:function(e){this.currentViewStep=e },pushStep:function(e){this.wizardStepArr.push(e) },getConfig:function(e,g){var f=this.obj||{}; f[e]=g; return f },getConfigStr:function(){var j=""; var e=this; var g=(this.isProductSelectorPackageMode()&&!this.isMandatoryPackageMode()); for(var f=0; f<e.currentViewStep; f++){if(g&&f===this.PACKAGE_VIEWSTEP){j=j.substr(0,j.length-1); continue }var h=(f!==(e.currentViewStep-1))?e.OPTIONS_SEPARATOR:""; j+=e.currentConfig[f]+h }return j },getViewNameById:function(e){return this.wizardStepArr[e] },pushStepToWizardStepInteractionArr:function(e){if(e>this.BASE_VIEWSTEP&&e<this.END_VIEWSTEP){if(d.inArray(e,this.wizardStepInteractionArr)===-1){this.wizardStepInteractionArr.push(e) }}},removeLastStepFromWizardStepInteractionArr:function(){this.wizardStepInteractionArr.pop() },resetWizardStepInteractionArr:function(){this.wizardStepInteractionArr=[] },setStartConfiguration:function(g){var f; var e=this.BASE_VIEWSTEP; for(f in g){e++; if(g.hasOwnProperty(f)){this.currentConfig=this.getConfig(f,g[f]) }}this.currentViewStep=e },addModelGroupIdSlug:function(f,e){this.slugToModelGroupMap[f]=e },getModelGroupIdBySlug:function(e){return this.slugToModelGroupMap[e] },setEventType:function(e){this.eventType=e },resetEventType:function(){this.eventType=null },getProductSelectorMode:function(){return this.settings.selectorMode||null },isProductSelectorNormalMode:function(){return this.getProductSelectorMode()===this.MODE_NORMAL||this.getProductSelectorMode()===null||this.getProductSelectorMode()===undefined },isProductSelectorQuickMode:function(){return this.getProductSelectorMode()===this.MODE_QUICK },isProductSelectorPackageMode:function(){return this.getProductSelectorMode()===this.MODE_PACKAGE },isMandatoryPackageMode:function(){return(this.settings.mandatoryPackageMode||false) },getPackageSaCode:function(){return this.packageSaCode },setPackageSaCode:function(e){this.packageSaCode=e }}; var a=null; var c={init:function(e){a=a||new b(e); return a },getInstance:function(){return a }}; return c }); define("apps/minidigital/components/product-selector/clientlib/scripts/data/ModelFeatures",["jquery","core/utils/ModelDataService"],function(c,b){var a=(function(){var n=[]; var g={}; var h={modelFeatures:{},combinedFeatures:{},whitelists:{},defaults:{},accessoriesWhitelist:{}}; function i(){b.channel.subscribe({topic:b.events.LOADED,callback:p}) }function p(q){n=q; q.forEach(function(r){g[r.code]=r }) }function o(s,r,q){h[s][r]=q }function d(r,q){if(!h[r].hasOwnProperty(q)){return }return h[r][q] }function e(r){var q=d("modelFeatures",r); if(c.isEmptyObject(q)){var s=g[r]; q=c.isEmptyObject(s)?{}:s.vehicles.reduce(function(u,t){return c.extend(true,u,t.salesGroupTree.exterior,{hasJCWKit:t.salesGroupTree.hasJCWKit}) },{}); if(!c.isEmptyObject(q)){c.extend(true,q,{defaults:s.defaultModelFeatures}) }if("undefined"!==typeof s){o("modelFeatures",r,q) }}return q }function l(t){if("string"===typeof t||t.length===1){var s=("string"===typeof t)?t:t[0]; return e(s) }var r=t.join("_"); var q=d("combinedFeatures",r); if(c.isEmptyObject(q)){q=t.reduce(function(u,v){return c.extend(true,u,e(v)) },{}); o("combinedFeatures",r,q) }return q }function f(t){var r=c.isArray(t)?t.join("_"):t; var q=d("whitelists",r); if("undefined"===typeof q||(c.isArray(q)&&q.length===0)){var s=l(t); q=Object.keys(s).filter(function(u){return c.isArray(s[u]) }).reduce(function(u,v){var w=s[v].map(function(x){return x.code }); return u.concat(w) },[]); o("whitelists",r,q) }return q }function k(t){var r=c.isArray(t)?t.join("_"):t; var q=d("defaults",r); if("undefined"===typeof q||c.isEmptyObject(q)){var s=l(t); q=s.defaults||{}; o("defaults",r,q) }return q }function m(r){var q=l(r); return q.hasJCWKit }function j(t){var s=c.isArray(t)?t.join("_"):t; var q=d("accessoriesWhitelist",s); if(c.isEmptyObject(q)){var r=g[s]; q=c.isEmptyObject(r)?{}:r.vehicles.reduce(function(z,w){var x=w.salesGroupTree; var y=x.equipment&&x.equipment.features||undefined; var u=x.exterior&&x.exterior.features||undefined; var v=x.packs&&x.packs.features||undefined; var A=x.trimLevel&&x.trimLevel.features||undefined; if(y){z=z.concat(y) }if(u){z=z.concat(u) }if(v){z=z.concat(v) }if(A){z=z.concat(A) }return z },[]).filter(function(u){return["S0","P0"].indexOf(u.code.substr(0,2))!==-1 }).map(function(u){return u.code }).filter(function(w,v,u){return u.indexOf(w)===v }); if(!c.isEmptyObject(q)){o("accessoriesWhitelist",s,q) }}return q }i(); return{getFeaturesByModel:e,getCombinedFeaturesByModel:l,getFeatureWhitelistByModelRange:f,getDefaultsByModelRange:k,hasJCWKitByModelRange:m,getAccessoriesWhitelistByModel:j} })(); return a }); define("apps/minidigital/components/product-selector/clientlib/scripts/utils/Messages",function(){var a={channel:"md:product-selector",events:{VIEW_UPDATE:"viewUpdate",VIEW_UPDATE_ALTERNATIVE:"viewUpdateAlternative",ERROR:"error",VIEW_SHOW:"viewShow",UPDATE_COSY_IMAGES:"updateCosyImages"}}; return a }); define("apps/minidigital/components/product-selector/clientlib/scripts/utils/Tracking",["jquery","core/Messagebus","core/TrackingAdapter","core/TrackingAdapter/TrackingImpression","core/Debugger","apps/minidigital/components/product-selector/clientlib/scripts/utils/Messages","apps/minidigital/components/product-selector/clientlib/scripts/data/Data"],function(g,c,f,b,a,e,d){var h=function h(j,i){this.ProductSelector=j; this.data=d.getInstance(); this.$element=this.ProductSelector.$element; this.TrackingObj=f.getInstance(); this.Messagebus=c; this.messageChannel=c.channel(e.channel); this.history=[]; this.$buttons=this.$element.find(".js-updateconfig, .slick-arrow"); this.$thumbnails=this.$element.find(".cosy-slider__thumbnails"); this.$thumbnail=this.$thumbnails.find(".slick-slide"); this.state={tracking:{initialized:false}}; this.options=g.extend(true,{},this.$element.data("tracking-component"),i); this.defaults={debug:a.isDebugEnabled("product-selector-tracking"),clickEvent:(Modernizr.touch)?"tap":"click"}; if(!this.TrackingObj){console.log("ProductSelector.Tracking error: no trackingObj"); return }this.defaultProductObj=this.getDefaultProductObj(); this.defaultEventObj={eventInfo:{eventPoints:"",eventName:"product selector step",effect:"product selector step viewed"},category:{primaryCategory:"product tools",subCategory01:"product selection"},attributes:{relatedComponentID:this.options.componentInfo.componentId,relatedComponentName:this.options.componentInfo.componentName,relatedComponentPrimaryCategory:this.options.category.primaryCategory}}; this.CATEGORIES={tracking:["modgr","fuel","trans","drive"],fuelTypes:{O:"petrol",P:"petrol",D:"diesel",X:"hybrid"},transmissions:{S0205:"automatic",Default:"manual",S02TB:"sports automatic"},driveTypes:{VR:"2wd",FWD:"2wd",AR:"4wd",AWD:"4wd"}}; this.init() }; h.prototype={init:function(){this.settings=g.extend({},this.defaults,this.options); if(this.settings.debug){console.log("ProductSelector.initTracking",this) }this.pageIndex=this.TrackingObj.getCurrentPageIndex(); this.initEvents(); this.initImpressionTracking() },initEvents:function(){this.$buttons.on("click tap",this.onClick.bind(this)); this.subscriptions=[this.messageChannel.subscribe({topic:e.events.VIEW_UPDATE,callback:this.onViewUpdate.bind(this)}),this.messageChannel.subscribe({topic:e.events.VIEW_SHOW,callback:this.onViewShow.bind(this)})]; if(this.$thumbnails.length){this.$thumbnail.on("click tap",this.onClick.bind(this)) }},onClick:function(k){var j=g(k.currentTarget); var n=j.parent(".md-product-selector-summary"); var i=(j.is("[data-md-tracking-link-id]")&&j.parents(".model-group-summary").length?j.attr("data-md-tracking-link-id").split("-").pop():"na"); var l=((n.is("[data-fueltype-id]"))?n.is("[data-transmission-id]")?"trans: "+this.getTransmission(n.attr("data-transmission-id")):"fuel: "+this.getFuelType(n.attr("data-fueltype-id")):""); var m={eventInfo:{eventName:"product selector click",cause:"default",eventAction:"click",effect:j.is(".slick-arrow")?"gallery arrow":j.is(".slick-slide")?"gallery thumbnail":"cta"},category:{subCategory01:"navigation"},attributes:{CTAposition:i,CTAselection:l}}; this.trackCustomEvent(m) },onViewUpdate:function(j){this.lastActivation=j; if(this.activationByBack()&&this.data.currentViewStep===0){this.onClose() }else{if(this.activationByBack()){this.history=this.history.slice(0,this.data.currentViewStep) }else{var i=this.getStepTrackingObject(this.getCustomEventObj()); this.history.push(i) }}},onViewShow:function(){if(!this.lastActivation){return }if(this.settings.debug){console.log("ProductSelector.tracking.state",this) }var j=this.getCustomEventObj(); if(this.data.currentViewStep===4){var i=this; setTimeout(function(){g.extend(j.eventInfo,{eventName:"product selector model viewed",cause:"default",effect:"model viewed in product selector"}); j.attributes.selection=i.getEventHistory(); i.updatePageTrackingObj({productID:i.data.currentConfig.modelCode,description:i.data.currentConfig.selectedModelName,productImage:i.getCurrentProductImage()},{},{modelCode:i.data.currentConfig.modelCode,bodyType:i.data.currentConfig.bodyType,modelName:i.data.currentConfig.selectedModelName,sellingPriceVehicle:i.data.currentConfig.sellingPrice}); i.trackCustomEvent(j) },1000) }else{if(this.data.currentViewStep!==0){j=this.getStepTrackingObject(j); j.attributes.selection=this.getEventHistory(); this.trackCustomEvent(j) }}},onClose:function(){this.clearHistory() },onError:function(j){if(this.settings.debug){console.log("ProductSelector.onError",j) }if(!j.error){return }var i={eventInfo:{eventName:"product selector error",eventAction:"automatic",cause:"automatic",effect:"product selector error shown to user"},category:{subcategory01:"error"},attributes:{errorCode:"50",errorMessage:"",errorMessageCode:j.error.message,errorType:"112"}}; this.trackCustomEvent(i) },trackCustomEvent:function(j){if(this.settings.debug){console.log("PSTracking.trackCustomEvent",j.eventInfo,j.category,j.attributes) }try{j.eventInfo.timeStamp=Date.now().toString(); this.TrackingObj.addEventTracking(this.defaultEventObj,j,this.pageIndex) }catch(i){if(this.settings.debug){console.log(i) }}},getDefaultProductObj:function(){var k={},i={},j={}; try{k=window.dataLayer.pages[0].product[0]; i=k.productInfo; j=k.attributes }catch(l){console.error("error while reading product data from dataLayer") }return{productInfo:{description:i.description||j.bodyName,manufacturer:"MINI",productID:"",productImage:"",productThumbnail:"",productURL:"",productName:j.bodyName},category:{primaryCategory:"new car",subCategory01:j.bodyName},attributes:{bodyName:j.bodyName,bodyType:j.bodyType,modelName:"na",modelCode:"na",relatedComponentID:this.options.componentInfo.componentId,relatedComponentName:this.options.componentInfo.componentName,relatedComponentPrimaryCategory:this.options.category.primaryCategory,basePriceVehicle:j.basePriceVehicle,basePriceOptions:j.basePriceOptions,basePrice:j.basePrice,sellingPriceVehicle:j.sellingPriceVehicle,sellingPriceOptions:j.sellingPriceOptions,sellingPriceTotal:j.sellingPriceTotal}} },initPageTrackingObj:function(){this.state.tracking.initialized=true; var i=this.TrackingObj.initProductTracking(this.defaultProductObj,this.pageIndex); this.productIndex=i.productIndex },updatePageTrackingObj:function(o,n,m){var l=g.extend({},this.defaultProductObj.productInfo,o); var k=g.extend({},this.defaultProductObj.category,n); var j=g.extend({},this.defaultProductObj.attributes,m); var i=g.extend({},this.defaultProductObj,{productInfo:l,category:k,attributes:j}); return this.TrackingObj.updateProductTracking(this.productIndex,i,this.pageIndex) },getTrackingCategory:function(i){return this.CATEGORIES.tracking[i]||"" },getFuelType:function(i){return this.CATEGORIES.fuelTypes[i]||"" },getTransmission:function(i){return this.CATEGORIES.transmissions[i]||"" },getDriveType:function(i){return this.CATEGORIES.driveTypes[i]||"" },clearHistory:function(){this.history=[] },activationByBack:function(){return this.lastActivation.activation===this.data.UPDATE_BY_BACK },activationBySystem:function(){return this.lastActivation.activation===this.data.UPDATE_BY_SYSTEM },getStepTrackingObject:function(k){var l,m=this.data.currentViewStep,j=this.data.currentViewStep-1,i=this.data.currentConfig[j]; if(m===1){this.state.tracking.initialized?this.updatePageTrackingObj():this.initPageTrackingObj(); i="na"; l=this.data.currentConfig.slug }else{if(m===2){l=this.getFuelType(i) }else{if(m===3){l=this.getTransmission(i) }else{if(m===4){l=this.getDriveType(i) }}}}this.updatePageTrackingObj({},{},{bodyType:this.data.currentConfig.bodyType,modelCode:this.data.currentConfig.modelCode}); k.attributes.selection.push({code:i,category:this.getTrackingCategory(j),value:l,type:this.activationBySystem()?"d":"u"}); return k },getCustomEventObj:function(){return{eventInfo:{eventAction:this.settings.clickEvent,cause:"default"},attributes:{currentStepNumber:this.data.currentViewStep,currentStepName:this.CATEGORIES.tracking[this.data.currentViewStep],selection:[]}} },getEventHistory:function(){return this.history.map(function(i){return{category:i.attributes.selection[0].category,code:i.attributes.selection[0].code,value:i.attributes.selection[0].value,type:i.attributes.selection[0].type} }) },getCurrentProductImage:function(){var j=this.$element.find(".is-active").last(); var k=""; if(j!==undefined){var i=j.find("img").last(); if(i!==undefined&&i.length>0){k=i[0].currentSrc }}return k },initImpressionTracking:function(){this.impressionTrackingInstances=[new b(this.trackTileImpression.bind(this),this.defaultEventObj).addTarget(this.$element.find(".model-group-summary:not(.md-component)").toArray())] },trackTileImpression:function(i){return{eventInfo:{eventName:"product selector tile impression",eventAction:"tile view",cause:"default",effect:this.getTilePosition(i)},category:{subCategory01:"interaction"}} },getTilePosition:function(k){var l=g(k).siblings(":not(.slick-cloned)").add(k); var j=l.index(k)+1; var i=l.length; return j+"/"+i }}; return h }); define("apps/minidigital/components/product-selector/clientlib/scripts/utils/ModelFeaturesCheck",["jquery","core/Debugger","apps/minidigital/components/product-selector/clientlib/scripts/data/ModelFeatures"],function(f,b,c){var e="optional"; var a={bodycolor:"colour",wheels:"wheels",stripes:"stripes",caps:"roofAndMirrorCaps"}; var d=function(g){this.modelCodes=g; this.featuresWhitelist=c.getFeatureWhitelistByModelRange(this.modelCodes); this.defaults=c.getDefaultsByModelRange(this.modelCodes); this.accessoriesWhitelist=c.getAccessoriesWhitelistByModel(this.modelCodes) }; d.prototype={checkFeatures:function(h){var g={}; Object.keys(h).forEach(function(i){if(e===i&&c.hasJCWKitByModelRange(this.modelCodes)){g[e]=h[e] }else{if(this.featuresWhitelist.indexOf(h[i].code)!==-1){g[i]=h[i] }else{if(this.defaults.hasOwnProperty(a[i])){g[i]=f.extend(this.defaults[a[i]],{isDefault:true}) }}}}.bind(this)); return g },checkAccessories:function(h){var g={}; Object.keys(h).forEach(function(i){if(this.accessoriesWhitelist.indexOf(h[i].code)!==-1){g[i]=h[i] }}.bind(this)); return g }}; return d }); define("apps/minidigital/components/product-selector/clientlib/scripts/views/WizardOption",["jquery","core/Messagebus","core/Debugger","core/wishlist/FeatureItem","apps/minidigital/components/product-selector/clientlib/scripts/utils/Messages","apps/minidigital/components/product-selector/clientlib/scripts/views/ui/WizardBackButton","apps/minidigital/components/product-selector/clientlib/scripts/views/ui/ConfigButton","apps/minidigital/components/product-selector/clientlib/scripts/views/ui/WishlistView","apps/minidigital/components/product-selector/clientlib/scripts/data/Data"],function(g,e,j,f,c,d,b,h,i){var a=function(l,k){this.stepId=l; this.id=""; this.settings={}; this.$element=g(k); this.slug=this.$element.data("modelgroupSlug"); this.data=i.getInstance(); this.bodyType=this.$element.data("bodyType"); this.modelCode=this.$element.data("modelCode"); this.modelName=this.$element.data("modelName"); this.sellingPrice=this.$element.data("sellingPrice"); this.messageChannel=this.data.settings.messagechannel; this.defaults={debug:j.isDebugEnabled("product-selector")}; this.options=g.extend({},this.$element.data()); this.init() }; a.prototype={init:function(){this.settings=g.extend({},this.defaults,this.options); this.id=this.settings[this.data.getViewNameById(this.stepId)+"Id"]; if(this.settings.debug){console.log("ProductSelector/WizardOption.init",this.$element,this.settings,this.id) }var k=this.$element.find("."+this.data.settings.wizardRestartSelector); if(k.length){this.wizardBackbutton=new d(k,this.data.BUTTONTYPE_RESTART) }var l=this.$element.find("."+this.data.settings.configbuttonSelector); l.each(function(n,o){new b(g(o)) }); var m=this.$element.find("."+this.data.settings.wishlistSelector); if(m.length){new h(m) }this.addEventListener(); return this },addEventListener:function(){var k=this.data.EVENTTYPE_CLICK; this.$element.find("."+this.data.settings.updateConfigSelector).on(k,this.onBtnClickHandler.bind(this)); var l=this.$element.find("."+this.data.settings.packageDetailsSelector); if(l.length){l.on("click tap",this.onDetailsClick.bind(this)) }},onBtnClickHandler:function(k){if(this.settings.debug){console.log("WizardOption.onBtnClickHandler",this.stepId,this.data.getViewNameById(this.stepId),this.id) }k.preventDefault(); this.data.setEventType(k.type); this.updateConfig(); if(this.data.isProductSelectorQuickMode()){this.messageChannel.publish({topic:c.events.VIEW_UPDATE_ALTERNATIVE,data:{activation:this.data.UPDATE_BY_FORWARD,id:this.id,stepId:this.stepId,eventType:this.data.eventType}}) }else{this.data.setCurrentViewStep(this.data.getNeighbouredViewStep(1)); this.messageChannel.publish({topic:c.events.VIEW_UPDATE,data:{activation:this.data.UPDATE_BY_FORWARD,id:this.id,stepId:this.stepId,eventType:this.data.eventType}}) }this.data.resetEventType() },updateConfig:function(){var m=(this.data.isProductSelectorPackageMode()&&this.data.getViewNameById(this.stepId)===this.data.MODE_PACKAGE); var l=((m&&this.data.isMandatoryPackageMode())?this.id:this.modelCode); if(m){var k=this.settings.packageCode; if(k){this.data.setPackageSaCode(k) }}m&&!this.data.isMandatoryPackageMode()?this.data.setPackageSaCode(this.id):this.data.updateCurrentConfig(this.stepId,this.id,this.slug,this.bodyType,l,this.sellingPrice) },onDetailsClick:function(k){k.preventDefault(); var l=this.$element.find(".md-image img"); var m=new f({bodyType:this.bodyType,modelCode:this.modelCode,code:this.id,name:this.settings.packageName,description:this.settings.packageDescription,image:l.attr("data-srcset")}); if(this.settings.packageOptions){g.extend(m,{list:{items:this.settings.packageOptions,delimeter:";"}}) }e.publish({channel:"md:details-sidebar",topic:"showDetails",data:m}) },select:function(){if(this.settings.debug){console.log("WizardOption.select",this.stepId,this.data.getViewNameById(this.stepId),this.id) }this.updateConfig(); this.data.setCurrentViewStep(this.data.getNeighbouredViewStep(1)); this.messageChannel.publish({topic:c.events.VIEW_UPDATE,data:{activation:this.data.UPDATE_BY_SYSTEM,id:this.id,stepId:this.stepId}}) },show:function(){if(this.settings.debug){console.log("WizardOption.show",this.stepId,this.data.END_VIEWSTEP,this.data.getViewNameById(this.stepId),this.id) }if(this.stepId===this.data.END_VIEWSTEP){this.data.currentConfig.selectedModelName=this.modelName }else{this.data.currentConfig.selectedModelName=undefined }this.$element.addClass("is-active") },hide:function(){if(this.settings.debug){console.log("WizardOption.hide",this.stepId,this.data.getViewNameById(this.stepId),this.id) }this.$element.removeClass("is-active") }}; return a }); define("apps/minidigital/components/product-selector/clientlib/scripts/views/WizardSubView",["jquery","core/Messagebus","apps/minidigital/components/product-selector/clientlib/scripts/views/WizardOption","apps/minidigital/components/product-selector/clientlib/scripts/data/Data","apps/minidigital/components/product-selector/clientlib/scripts/utils/Messages","core/Debugger"],function(g,b,e,d,f,a){var c=function(j,k,i,h){this.groupId=j; this.stepId=k; this.settings={}; this.optionObj={}; this.$element=g(i); this.defaults={debug:a.isDebugEnabled("product-selector")}; this.options=g.extend({},this.$element.data(),h); this.data=d.getInstance(); this.optionArray=null; this.messageChannel=this.data.settings.messagechannel; this.init() }; c.prototype={init:function(){this.settings=g.extend({},this.defaults,this.options); if(this.settings.debug){console.log("ProductSelector/WizardSubView.init",this.$element,this.settings) }var h=this; g.each(this.$element.find("."+this.data.settings.wizardOptionSelector),function(m,n){var o=h.getOptionId(g(n).data())||h.data.OPTION_DEFAULT; if(!h.optionObj[o]){var l={}; l[o]=[]; h.optionObj=g.extend({},h.optionObj,l) }h.optionObj[o].push(new e(h.stepId,n)) }); if(this.stepId===this.data.BASE_VIEWSTEP){var k=[]; g.each(h.optionObj,function(l,m){k.push(m.slug) }); this.data.updateCurrentOptions(this.stepId,k) }var j=this.$element.find(".js-without-selection"); var i=(this.data.isProductSelectorPackageMode()&&!this.data.isMandatoryPackageMode()&&j.length!==0); if(i){j.on("click tap",this.skipWithoutSelection.bind(this)) }return this },getOptionId:function(k){var p=this; var o=this.stepId; var j=""; var q=(this.data.isProductSelectorPackageMode()&&!this.data.isMandatoryPackageMode()); for(var l=0; l<o; l++){if(q&&l===this.data.PACKAGE_VIEWSTEP){j=j.substr(0,j.length-1); continue }var n=p.data.getViewNameById(l)+"Id"; var h=k[n]; var m=(l!==(o-1))?p.data.OPTIONS_SEPARATOR:""; if(h){j+=(h+m) }else{j=null }}return j },getOptionLength:function(j){var h=0; if(this.optionObj.hasOwnProperty(j)){h=this.optionObj[j].length }var i=this.$element.find(".js-without-selection"); if(h!==0&&this.isPackageViewStep()&&i.length){h+=1 }return h },isPackageViewStep:function(){return this.data.isProductSelectorPackageMode()&&this.stepId===this.data.PACKAGE_VIEWSTEP },update:function(){var i=this.data.getConfigStr(); if(this.optionObj.hasOwnProperty(i)){var h=this.optionObj[i]; this.data.pushStepToWizardStepInteractionArr(this.stepId); g.each(h,function(j,k){k.show() }) }},selectAndSkip:function(){var h=this.data.getConfigStr(); if(this.optionObj.hasOwnProperty(h)){this.optionObj[h][0].select() }},skipWithoutSelection:function(h){var i=this.data.UPDATE_BY_SYSTEM; if("undefined"!==typeof h){h.preventDefault(); i=h.type }this.data.setEventType(i); this.data.setPackageSaCode(""); this.data.setCurrentViewStep(this.data.END_VIEWSTEP); this.messageChannel.publish({topic:f.events.VIEW_UPDATE,data:{activation:this.data.UPDATE_BY_FORWARD,id:"na",stepId:this.stepId,eventType:this.data.eventType}}); this.data.resetEventType() },show:function(){this.$element.addClass("is-active"); g("."+this.data.settings.wizardRestartSelector,this.$element).css({display:"block"}); if(this.stepId===this.data.END_VIEWSTEP){if(this.data.wizardStepInteractionArr.length===0){g("."+this.data.settings.wizardRestartSelector,this.$element).css({display:"none"}) }}},hide:function(){this.$element.removeClass("is-active"); for(var h in this.optionObj){g.each(this.optionObj[h],function(j,k){k.hide() }) }}}; return c }); define("apps/minidigital/components/product-selector/clientlib/scripts/views/WizardView",["jquery","core/Messagebus","core/Debugger","apps/minidigital/components/product-selector/clientlib/scripts/views/WizardSubView","apps/minidigital/components/product-selector/clientlib/scripts/views/ui/WizardBackButton","apps/minidigital/components/product-selector/clientlib/scripts/views/ui/SummarySlider","apps/minidigital/components/product-selector/clientlib/scripts/data/Data"],function(g,c,a,e,d,b,f){var h=function(k,j,i){this.stepId=k; this.settings={}; this.$element=g(j); this.wizardSubviewObj={}; this.subviewLength=0; this.defaults={debug:a.isDebugEnabled("product-selector")}; this.options=g.extend({},this.$element.data(),i); this.data=f.getInstance(); this.messageChannel=this.data.settings.messagechannel; this.wizardBackbutton=null; this.hasSlider=false; this.init() }; h.prototype={init:function(){this.settings=g.extend({},this.defaults,this.options); if(this.settings.debug){console.log("ProductSelector/WizardView.init",this.$element,this.settings) }var j=this; var k=this.$element.find("."+this.data.settings.wizardSubviewSelector); g.each(k,function(o,p){var m=j.data.getViewNameById(j.data.BASE_VIEWSTEP); var n=g(p).attr("data-"+m+"-id"); var l=g(p).attr("data-"+m+"-slug"); if(l){j.data.addModelGroupIdSlug(l,n) }if(n){j.wizardSubviewObj[n]=new e(n,j.stepId,p,{}) }}); this.subviewLength=k.length; var i=this.$element.find("."+this.data.settings.wizardPrevSelector); if(i.length){this.wizardBackbutton=new d(i,this.data.BUTTONTYPE_BACK) }return this },initAdditionalFeatures:function(){switch(this.subviewLength){case 1:this.showSingleSliderItem(); break; default:this.initSlider() }},initSlider:function(){this.hasSlider=true; var i=g("."+this.data.settings.sliderSelector,this.$element); if(i.length){new b(i) }},showSingleSliderItem:function(){},getOptionLength:function(j,k){var i=0; if(this.wizardSubviewObj.hasOwnProperty(j)){i=this.wizardSubviewObj[j].getOptionLength(k) }return i },update:function(){var i=this.data.currentConfig[this.data.BASE_VIEWSTEP]; if(this.wizardSubviewObj.hasOwnProperty(i)){this.wizardSubviewObj[i].update() }},selectAndSkip:function(){var i=this.data.currentConfig[this.data.BASE_VIEWSTEP]; if(this.wizardSubviewObj.hasOwnProperty(i)){this.wizardSubviewObj[i].selectAndSkip() }},skipWithoutSelection:function(){var i=this.data.currentConfig[this.data.BASE_VIEWSTEP]; if(this.wizardSubviewObj.hasOwnProperty(i)){this.wizardSubviewObj[i].skipWithoutSelection() }},show:function(){var i=this.data.currentConfig[this.data.BASE_VIEWSTEP]; this.$element.addClass("is-active"); if(this.wizardSubviewObj.hasOwnProperty(i)){this.wizardSubviewObj[i].show() }if(this.hasSlider){g(window).trigger("resize") }},hide:function(){for(var i in this.wizardSubviewObj){this.wizardSubviewObj[i].hide() }this.$element.removeClass("is-active") }}; return h }); define("apps/minidigital/components/product-selector/clientlib/scripts/views/WizardLayer",["jquery","core/Messagebus","core/Debugger","apps/minidigital/components/product-selector/clientlib/scripts/utils/Messages","apps/minidigital/components/product-selector/clientlib/scripts/data/Data"],function(f,b,a,e,c){var d=function(g){this.$element=f(g); this.$html=f("html"); this.$body=f("body"); this.$close=this.$element.find(".js-close"); if(this.$element.hasClass("js-wizard-layer--alternative")){this.$backButton=this.$element.find(".md-product-selector-backbutton") }this.data=c.getInstance(); this.isOpen=false; this.messageChannel=this.data.settings.messagechannel; this.init() }; d.prototype={init:function(){this.settings={}; this.settings.debug=a.isDebugEnabled("product-selector"); if(this.settings.debug){console.log("ProductSelector/WizardLayer.init",this.$element,this.settings) }this.addEventHandler() },addEventHandler:function(){var g=this.data.EVENTTYPE_CLICK; this.$close.on(g,this.onCloseClickHandler.bind(this)); this.$element.on("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",this.onLayerTransitionEndHandler.bind(this)); if(this.$backButton){this.$backButton.on(g,this.onClickBackButton.bind(this)) }},onCloseClickHandler:function(g){if(this.settings.debug){console.log(g) }g.preventDefault(); this.data.setEventType(g.type); this.data.setCurrentViewStep(this.data.BASE_VIEWSTEP); if(this.data.isProductSelectorQuickMode()){this.hide() }else{this.messageChannel.publish({topic:e.events.VIEW_UPDATE,data:{activation:this.data.UPDATE_BY_BACK,eventType:this.data.eventType}}) }this.data.resetEventType() },onClickBackButton:function(g){if(this.settings.debug){console.log(g) }g.preventDefault(); this.hide() },onLayerTransitionEndHandler:function(){if(this.$element.hasClass("is-active")){this.$body.addClass("md-no-scroll"); this.$html.css({"overflow-y":"visible"}) }},scrollToTop:function(){this.$element.scrollTop(0) },show:function(){this.isOpen=true; this.$element.addClass("is-active") },hide:function(){this.$html.css({"overflow-y":"scroll"}); this.$body.removeClass("md-no-scroll"); this.$element.removeClass("is-active"); this.isOpen=false }}; return d }); define("apps/minidigital/components/product-selector/clientlib/scripts/views/ui/ConfigButton",["jquery","apps/minidigital/components/product-selector/clientlib/scripts/data/Data","apps/minidigital/components/product-selector/clientlib/scripts/utils/ModelFeaturesCheck"],function(d,a,c){var b=function(e){this.$element=d(e); this.SELECTOR_TARGETURL="targetConfiguratorUrl"; this.SELECTOR_MODELCODE="modelCode"; this.SELECTOR_FEATURECODE="featureCodes"; this.SELECTOR_TRANSMISSION="transmissionCode"; this.DEFAULT_TRANSMISSION="Default"; this.PARAM_CONFIG="?configCode="; this.PARAM_FEATURES="&configFeatures="; this.EXTERNAL_CON="externalCon"; this.VISUALIZER_FEATURES="useVisualizerFeatures"; this.options=d.extend({},this.$element.data()); this.options[this.SELECTOR_TARGETURL]=this.$element.attr("href"); this.data=a.getInstance(); this.init() }; b.prototype={init:function(){if(this.options[this.EXTERNAL_CON]){this.$element.attr("href",this.getConConfiguratorUrl()) }else{if(this.getModelCode()&&this.getConfiguratorPath()){this.$element.attr("href",this.getConfiguratorUrl()) }}if(this.options[this.VISUALIZER_FEATURES]){this.$element.on("click touchend",this.onConfigButtonClickHandler.bind(this)) }},onConfigButtonClickHandler:function(f){f.preventDefault(); if(this.options[this.EXTERNAL_CON]){window.open(this.getConConfiguratorUrl()) }else{if(this.getModelCode()&&this.getConfiguratorPath()){window.open(this.getConfiguratorUrl()) }}},getConfiguratorUrl:function(){return this.getConfiguratorPath()+this.getConfigCode()+this.getConfigFeatures()+this.getConfiguratorParams() },getConConfiguratorUrl:function(){var e=[this.getConfiguratorPath()]; if(this.getModelCode()){e.push(this.getModelCode()) }if(this.getFeatureCodes()||this.getTransmissionCode()){var f=[]; if(this.getTransmissionCode()&&this.getTransmissionCode()!==this.DEFAULT_TRANSMISSION&&this.getTransmissionCode().length>0){f.push(this.getTransmissionCode()) }if(this.getFeatureCodes()){f.push(this.getFeatureCodes()) }if(f.length>0){e.push(f.join(",")) }}return e.join("/") },getConfigCode:function(){return this.getModelCode()?this.PARAM_CONFIG+this.getModelCode():"" },getConfigFeatures:function(){var g=this.getTransmissionCode(); var f=g===this.DEFAULT_TRANSMISSION; var h=this.getFeatureCodes(); if(f&&!h){return"" }var e=this.PARAM_FEATURES; e+=!f?g+",":""; e+=h?h+",":""; return e.slice(0,-1) },getConfiguratorParams:function(){return this.options.configuratorParams?"&"+d.param(this.options.configuratorParams):"" },getConfiguratorPath:function(){return this.options[this.SELECTOR_TARGETURL] },getModelCode:function(){return this.options[this.SELECTOR_MODELCODE] },getFeatureCodes:function(){var g=this.data.getCosyParameters(),h=[],j=[]; if("undefined"!==typeof this.options[this.SELECTOR_FEATURECODE]){h=this.options[this.SELECTOR_FEATURECODE].split(",") }var f=new c(this.getModelCode()).checkFeatures(g); if("function"===typeof g.toCosyParams){f=g.toCosyParams.call(f); for(var e in f){if(!f.hasOwnProperty(e)&&f[e].length===0){continue }d.merge(j,f[e].split(",")) }}if(j.length!==0){h=j }if(this.data.isProductSelectorPackageMode()&&!this.data.isMandatoryPackageMode()){var i=this.data.getPackageSaCode(); if(i!==""){h.push(i) }}else{if(this.data.isProductSelectorPackageMode()){var i=this.data.getPackageSaCode(); if(i!==""){h.push(i) }}}h=h.sort(); return h.length?h.join(","):"" },getTransmissionCode:function(){return this.options[this.SELECTOR_TRANSMISSION] }}; return b }); define("apps/minidigital/components/product-selector/clientlib/scripts/views/ui/ResetButton",["jquery","core/Messagebus","core/Individualization","apps/minidigital/components/product-selector/clientlib/scripts/data/Data","apps/minidigital/components/visualizer/clientlib/scripts/utils/Messages"],function(e,a,d,c,b){var f=function(g){this.$element=e(g); this.$btnWrapper=this.$element.parents(".md-button"); this.data=c.getInstance(); this.updateSubscription; this.init(); this.$element.on("click touchend",this.onResetButtonClickHandler.bind(this)) }; f.prototype={init:function(){this.updateSubscription=d.messagebus.subscribe(d.events.UPDATE,this.checkForIndividualization.bind(this)); this.checkForIndividualization() },checkForIndividualization:function(){if(d.has(this.data.settings.bodyType)){this.$btnWrapper.removeClass("hidden"); if("undefined"!==typeof this.updateSubscription){this.updateSubscription.unsubscribe() }}},onResetButtonClickHandler:function(g){g.preventDefault(); d.remove(this.data.settings.bodyType); this.$btnWrapper.addClass("hidden"); a.publish({channel:b.channel,topic:b.events.RESET_CHANGES}) }}; return f }); define("apps/minidigital/components/product-selector/clientlib/scripts/views/ui/SummarySlider",["jquery","velocity","core/Slider","core/Messagebus","core/utils/viewportspy","apps/minidigital/components/product-selector/clientlib/scripts/data/Data","core/utils/HTMLHelper"],function(f,g,e,b,h,d,c){var a=function(i){this.SELECTOR_SLIDE_ITEM=".model-group-summary"; this.SELECTOR_PAGINATION="slick-pagination"; this.SELECTOR_UI=".js-slider-ui"; this.SELECTOR_CONTENT=".js-slider-content"; this.PAGINATION_SEPARATOR="/"; this.SELECTOR_SECTION_MODEL=".js-top-section"; this.SLIDER_BREAKPOINT_TABLET=768; this.SLIDER_BREAKPOINT_DESKTOP=1280; this.SLIDER_BREAKPOINT_DESKTOP_LARGE=1920; this.SLIDER_BREAKPOINTS={SLIDES_2:[1,2,3,3],SLIDES_3:[1,2,3,3],SLIDES_4:[1,2,3,4]}; this.$element=i; this.$slider=this.$element.find(this.SELECTOR_CONTENT); this.$slides=null; this.$sectionModel=this.$element.find(this.SELECTOR_SECTION_MODEL); this.options=f.extend({},this.$element.data()); this.slider=null; this.$pagination=f("<div />",{"class":this.SELECTOR_PAGINATION}); this.data=d.getInstance(); this.slidesCount=Math.min(4,this.$element.find(this.SELECTOR_SLIDE_ITEM).length); this.isCenterMode=this.slidesCount<=2; this.slidesToShow=this.SLIDER_BREAKPOINTS["SLIDES_"+this.slidesCount][0]; this.characteristicsChildrenCount=this.$element.find(".md-product-selector-characteristics:first-of-type").children(".md-characteristics-item").length; this.init() }; a.prototype={init:function(){this.$slides=this.$element.find(this.SELECTOR_SLIDE_ITEM); this.updateStates(); this.initSlider(); this.initEvents(); this.equalizeAllHeights() },initSlider:function(){var i={adaptiveHeight:false,variableWidth:false,autoplay:false,draggable:true,infinite:false,centerMode:this.isCenterMode,slidesToShow:this.SLIDER_BREAKPOINTS["SLIDES_"+this.slidesCount][3],slidesToScroll:1,arrows:true,prevArrow:this.$element.find(".js-slick-btn-prev"),nextArrow:this.$element.find(".js-slick-btn-next"),responsive:[{breakpoint:this.SLIDER_BREAKPOINT_DESKTOP_LARGE,settings:{slidesToShow:this.SLIDER_BREAKPOINTS["SLIDES_"+this.slidesCount][2]}},{breakpoint:this.SLIDER_BREAKPOINT_DESKTOP,settings:{slidesToShow:this.SLIDER_BREAKPOINTS["SLIDES_"+this.slidesCount][1]}},{breakpoint:this.SLIDER_BREAKPOINT_TABLET,settings:{slidesToShow:this.SLIDER_BREAKPOINTS["SLIDES_"+this.slidesCount][0]}}]}; this.$slider.on("init",this.onSliderInitHandler.bind(this)); this.$slider.on("afterChange",this.onSliderAfterChangeHandler.bind(this)); this.$slider.on("setPosition",this.onSliderPositionChangeHandler.bind(this)); this.$slider.css({display:"block"}); this.slider=new e(this.$slider,i) },onSliderInitHandler:function(j,i){this.updatePagination(i) },onSliderAfterChangeHandler:function(j,i){this.updatePagination(i) },onSliderPositionChangeHandler:function(j,i){this.updatePagination(i) },initEvents:function(){this.subscriptions={resize:b.subscribe({channel:h.messages.channel,topic:h.messages.events.RESIZE,callback:this.onViewportUpdate.bind(this)})}; this.subscriptions.resize.debounce(200) },onViewportUpdate:function(){this.slider.slick.resize(); this.updateStates(); this.equalizeAllHeights() },appendPaginator:function(){if(!this.$element.find("."+this.SELECTOR_PAGINATION).length){this.$pagination.prependTo(this.$element.parent().find(this.SELECTOR_UI)) }},updatePagination:function(k){this.updateStates(); var j=this.slidesToShow,n=(k.currentSlide+1)||1,m=(j>1)?n+(j-1):n,l=(n===m)?n:n+" - "+m; this.appendPaginator(); var i=this.$element.parent().find("."+this.SELECTOR_PAGINATION); i.toggleClass("is-inactive",!(j<k.slideCount)); i.html('<span class="slide-current">'+l+'</span><span class="slide-count"> '+this.PAGINATION_SEPARATOR+" "+k.slideCount+"</span>") },updateStates:function(){var i=Math.min(3,(Math.max(0,h.viewportData.mode))); this.slidesToShow=this.SLIDER_BREAKPOINTS["SLIDES_"+this.slidesCount][i] },equalizeAllHeights:function(){c.equalizeHeight(this.$element,".md-modelgroup-summary-images-wrapper","padding-top"); c.equalizeHeight(this.$element,".md-modelgroup-summary-text","padding-bottom"); c.equalizeHeight(this.$element,".md-modelgroup-summary-disclaimer","padding-bottom"); c.equalizeHeight(this.$element,".md-modelgroup-summary-description-list-transmission","padding-bottom"); for(var j=1; j<this.characteristicsChildrenCount; j++){c.equalizeHeight(this.$element,".md-characteristics-item:nth-of-type("+j+")","padding-bottom") }}}; return a }); define("apps/minidigital/components/product-selector/clientlib/scripts/views/ui/WizardBackButton",["jquery","core/Messagebus","apps/minidigital/components/product-selector/clientlib/scripts/utils/Messages","apps/minidigital/components/product-selector/clientlib/scripts/data/Data"],function(e,a,d,c){var b=function(f,g){this.$element=e(f); this.data=c.getInstance(); this.type=g; this.messageChannel=this.data.settings.messagechannel; this.init() }; b.prototype={init:function(){this.addEventListener(); return this },addEventListener:function(){var f=this.data.EVENTTYPE_CLICK; this.$element.find(".btn").on(f,this.onBtnClickHandler.bind(this)) },onBtnClickHandler:function(f){f.preventDefault(); this.updateCurrentViewStep(f) },updateCurrentViewStep:function(g){var f=this.getTargetViewStep(); this.adjustViewArray(); this.data.setEventType(g.type); this.data.setCurrentViewStep(f); this.messageChannel.publish({topic:d.events.VIEW_UPDATE,data:{activation:this.data.UPDATE_BY_BACK,eventType:this.data.eventType}}); this.data.resetEventType() },adjustViewArray:function(){switch(this.type){case this.data.BUTTONTYPE_BACK:this.data.removeLastStepFromWizardStepInteractionArr(); break; case this.data.BUTTONTYPE_RESTART:this.data.resetWizardStepInteractionArr(); break; default:this.data.resetWizardStepInteractionArr(); break }},getTargetViewStep:function(){switch(this.type){case this.data.BUTTONTYPE_BACK:return this.getPreviousViewStep(); break; case this.data.BUTTONTYPE_RESTART:return this.getRestartViewStep(); break; default:return this.data.BASE_VIEWSTEP; break }},getPreviousViewStep:function(){if(this.data.wizardStepInteractionArr.length>1){var f=this.data.wizardStepInteractionArr.indexOf(this.data.currentViewStep); return this.data.wizardStepInteractionArr[f-1] }return this.data.BASE_VIEWSTEP },getRestartViewStep:function(){if(this.data.wizardStepInteractionArr.length>=1){return this.data.wizardStepInteractionArr[0] }return this.data.BASE_VIEWSTEP },show:function(){this.$element.addClass("is-active") },hide:function(){this.$element.removeClass("is-active") }}; return b }); define("apps/minidigital/components/product-selector/clientlib/scripts/views/ui/WishlistView",["jquery","lodash","core/Messagebus","core/Wishlist","core/wishlist/FeatureItem","core/utils/ModelDataService","apps/minidigital/components/product-selector/clientlib/scripts/utils/ModelFeaturesCheck","apps/minidigital/components/product-selector/clientlib/scripts/views/ui/WishlistItem"],function(h,m,e,c,f,g,k,l){var i=3; var b="hidden"; var a="md-wishlist-show-more"; var d='input[type="checkbox"]'; var j=function(n){this.$element=h(n); this.$content=this.$element.find(".js-content"); this.$allHeadline=this.$element.find(".js-all-headline"); this.$subsetHeadline=this.$element.find(".js-subset-headline"); this.$notification=this.$element.find(".js-notification"); this.$wishlistAllItemsCheckboxContainer=this.$element.find(".js-checkbox"); this.$wishlistAllItemsCheckbox=this.$element.find('input[type="checkbox"]'); this.$showMore=this.$element.find(".js-show-more"); this.$showMoreButton=this.$showMore.children("button"); this.$showMoreAmountLabel=this.$showMore.find(".js-show-more-amount"); this.subsetHeadlineTemplate=this.$subsetHeadline.text(); this.featureItems=c.getAllFeatureItems(); this.wishlistCount=0; this.wishlistItems=[]; if(this.$element.length!==0){this.init() }}; j.prototype={init:function(){g.channel.subscribe({topic:g.events.LOADED,callback:this.onLoaded.bind(this)}) },onLoaded:function(){this.prepareTemplate(); this.initEvents(); if("undefined"!==typeof this.templateRenderer&&Object.keys(this.featureItems).length){this.onWishlistUpdate() }},prepareTemplate:function(){var n=this.$element.find('[type="text/template"]'); if(n.length){this.templateRenderer=m.template(n.html()) }},initEvents:function(){this.$wishlistAllItemsCheckbox.on("change",this.toggleWishlistCheckboxes.bind(this)); this.$content.on("change",d,this.toggleWishlistAllCheckbox.bind(this)); this.$showMoreButton.on("click tap",this.showMore.bind(this)); this.subscriptions={update:c.messagebus.subscribe(c.events.UPDATE,this.onWishlistUpdate.bind(this))} },onWishlistUpdate:function(){this.wishlistCount=c.getItemCount(); this.featureItems=c.getAllFeatureItems(); if(!this.wishlistCount){this.hide(); return }this.applyCheckToFeatureItems(); this.adjustHeadline(); this.updateShowMoreAmountLabel(); this.setWishlistItems(); this.renderWishlistItems(); this.show() },applyCheckToFeatureItems:function(){this.featureItemsCount=Object.keys(this.featureItems).length; this.featureItems=new k(this.getModelCode()).checkAccessories(this.featureItems); this.filteredFeatureItemsCount=Object.keys(this.featureItems).length },getModelCode:function(){return this.$element.parents(".js-wizard-view-option").data("model-code") },adjustHeadline:function(){var p=this.filteredFeatureItemsCount>0; var n=p&&(this.filteredFeatureItemsCount<this.featureItemsCount); if(n){var o=this.subsetHeadlineTemplate.replace("{{subset}}",this.filteredFeatureItemsCount).replace("{{all}}",this.featureItemsCount); this.$subsetHeadline.text(o) }this.$allHeadline.toggleClass(b,n); this.$subsetHeadline.toggleClass(b,!n); this.$notification.toggleClass(b,p); this.$wishlistAllItemsCheckboxContainer.toggleClass(b,!p) },updateShowMoreAmountLabel:function(){this.$showMoreAmountLabel.text(this.filteredFeatureItemsCount-i); this.$showMore.toggleClass(b,this.filteredFeatureItemsCount<=i) },setWishlistItems:function(){this.wishlistItems=[]; Object.keys(this.featureItems).reverse().forEach(this.addItemToWishlist,this) },addItemToWishlist:function(n){var p=this.featureItems[n]; var o=new f(p); this.wishlistItems.push(new l(this.templateRenderer,o)) },renderWishlistItems:function(){var n=this.wishlistItems.map(function(o){return o.getElementNode() }); this.$content.empty().append(n) },toggleWishlistCheckboxes:function(){var n=this.$wishlistAllItemsCheckbox[0].checked; this.$content.find(d).prop("checked",n) },toggleWishlistAllCheckbox:function(){var n=this.$content.find(d).toArray().reduce(function(p,o){return o.checked!==p?false:p },true); this.$wishlistAllItemsCheckbox.prop("checked",n) },showMore:function(){this.$element.addClass(a) },show:function(){this.$element[0].classList.remove(b) },hide:function(){this.$element[0].classList.add(b) }}; return j }); define("apps/minidigital/components/product-selector/clientlib/scripts/views/ui/WishlistItem",["jquery","core/Wishlist","core/Messagebus","core/wishlist/FeatureItem"],function(c,a,b,e){var d=function(f,g){this.templateRenderer=f; if(g instanceof e){this.featureItem=g }if("function"===typeof this.templateRenderer&&"undefined"!==typeof this.featureItem){this.init() }}; d.prototype={init:function(){this.renderTemplate(); this.initEvents() },renderTemplate:function(){var f=this.templateRenderer({code:this.featureItem.code,name:this.featureItem.name,image:this.featureItem.image}); this.$element=c(f); this.$detailsBtn=this.$element.find(".js-details-btn") },initEvents:function(){this.$detailsBtn.on("click touchend",this.showDetails.bind(this)) },showDetails:function(f){f.preventDefault(); b.publish({channel:"md:details-sidebar",topic:"showDetails",data:this.featureItem}) },getElementNode:function(){return this.$element[0] }}; return d });
/var/files/need-2-delete/./mini-borishof.ru1/upload/coooper/clientlib.min.20200624203628-17.js