(function(i){function t(t){for(var a,s,c=t[0],l=t[1],o=t[2],d=0,v=[];d3&&(l[0]=l[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,s)),(l[1]||"").length-1:i.financing.bundle_selected},on:{change:[function(t){var n=i.financing.bundle_selected,a=t.target,e=!!a.checked;if(Array.isArray(n)){var r=null,s=i._i(n,r);a.checked?s<0&&i.$set(i.financing,"bundle_selected",n.concat([r])):s>-1&&i.$set(i.financing,"bundle_selected",n.slice(0,s).concat(n.slice(s+1)))}else i.$set(i.financing,"bundle_selected",e)},i.calculate]}}),n("label",{staticClass:"rci-input-list-child-label",staticStyle:{width:"auto"},attrs:{for:"bundle_"+i.financing.bundle.name}},[n("span",[i._v(i._s(i.financing.bundle.name))]),n("div",{staticClass:"rci-infohint",on:{mouseenter:function(t){return i.setBundleHover(i.financing.bundle.name)},mouseleave:function(t){return i.removeBundleHover(i.financing.bundle.name)}}},[n("div",{class:["rci-row","rci-info-hint-content","mCS_destroyed",i.isBundleHovered(i.financing.bundle.name)?"rci-info-popup-open rci-info-hint-content--open":""],style:i.isBundleHovered(i.financing.bundle.name)?"visibility: visible; width: 600px; display: block; opacity: 1":"",attrs:{for:"bundle_"+i.financing.bundle.name}},[i._m(10),n("div",{staticClass:"rci-col rci-info-hint-title"},[n("div",{staticClass:"rci-info-hint-title-content"},[i._v(i._s(i.financing.bundle.name))])]),i._m(11)]),i._m(12)])])]),n("div",{staticClass:"rci-col rci-amount-col"},[n("span",{staticClass:"rci-amount-col-value"},[i._v(i._s(i._f("formatNumber")(i.financing.bundle.price,2))+" "+i._s(i.financing.currency)+" / mjesečno")])])])])])]),i._m(13)])])]):i._e()]),n("div",{staticClass:"rci-oneBoxRight",staticStyle:{"margin-top":"0px"},attrs:{order:"z_rci_20.0"}},[n("div",{staticClass:"rci-monthlyPaymentBox",staticStyle:{display:"block"},attrs:{order:"z_rci_4.0"}},[n("div",{staticClass:"rci-content rci-row"},[i._m(14),n("div",{staticClass:"rci-col rci-summary-label rci-summary-label--one rci-summary-label--no-info rci-summary-label--no-title rci-summary-label--monthly-payment"},[n("div",{staticClass:"rci-row"},[n("div",{staticClass:"rci-col rci-summary-label-title rci-infohint-parent"}),n("div",{staticClass:"rci-col rci-summary-label-value rci-infohint-parent"},[n("span",{staticClass:"rci-value"},[i._v(i._s(i._f("formatNumber")(i.financing.monthly_installment,2))+" "+i._s(i.financing.currency)+" / mjesečno *")])])])]),i._m(15)])]),n("div",{staticClass:"rci-summaryBox",staticStyle:{display:"block"}},[i._m(16),n("div",{staticClass:"rci-content rci-row"},i._l(i.summary,(function(t,a){return n("div",{key:a,staticClass:"rci-col rci-summary-label rci-summary-label--one rci-summary-label--no-info"},[n("div",{staticClass:"rci-row"},[n("div",{staticClass:"rci-col rci-summary-label-title rci-infohint-parent"},[n("span",[i._v(i._s(t.label))]),n("div",{staticClass:"rci-infohint"})]),n("div",{staticClass:"rci-col rci-summary-label-value rci-infohint-parent"},[n("span",{staticClass:"rci-value"},[i._v(i._s(t.value))])])])])})),0)])])])]),n("div",{staticClass:"rci-legalBoxProduct",staticStyle:{display:"block"}},[n("div",{staticClass:"rci-title rci-box-title"},[i._v("Uvjeti i odredbe")]),n("div",{staticClass:"rci-content rci-row"},[n("div",{staticClass:"rci-col rci-summary-label rci-summary-label--one rci-summary-label--no-info rci-summary-label--no-value"},[n("div",{staticClass:"rci-row"},[n("div",{staticClass:"rci-col rci-summary-label-title rci-infohint-parent"},[n("span",{domProps:{innerHTML:i._s(i.financing.disclaimer)}}),n("div",{staticClass:"rci-infohint"})]),i._m(17)])])])])])])])])])])])])])])])])},_=[function(){var i=this,t=i.$createElement,n=i._self._c||t;return n("div",{staticClass:"rci-loader-fixed"},[n("img",{attrs:{alt:"loader",src:"//prod.rciservices.eu/common/js/latest/styles/images/page-loader.gif"}})])},function(){var i=this,t=i.$createElement,n=i._self._c||t;return n("div",{staticClass:"rci-errorPopup",staticStyle:{display:"none"},attrs:{id:"fin-simulator-container-errorPopup"}},[n("div",{staticClass:"rci-errorPopup-fixed"},[n("div",{staticClass:"rci-errorPopup-body"},[n("span",{staticClass:"message"},[i._v("Something went wrong...")]),n("button",{attrs:{id:"errorPopupButton",type:"button"}},[i._v("OK")])])])])},function(){var i=this,t=i.$createElement,n=i._self._c||t;return n("div",{staticClass:"rci-row rci-one-header",staticStyle:{display:"block"}},[n("div",{staticClass:"rci-col rci-one-header-title-wrapper"},[n("div",{staticClass:"rci-row"},[n("div",{staticClass:"rci-col rci-one-header-value"},[i._v("Informativni financijski kalkulator")]),n("div",{staticClass:"rci-col rci-header-close-button"},[n("div",{staticClass:"rci-content rci-row"},[n("div",{staticClass:"rci-col rci-btn-wrapper rci-btn-wrapper--close"},[n("button",{staticClass:"rci-btn rci-btn--close",attrs:{type:"button"}})])])])])]),n("div",{staticClass:"rci-col rci-one-header-return-btn rci-one-header-return-btn--mobile-gap"},[n("div",{staticClass:"rci-content rci-row"})])])},function(){var i=this,t=i.$createElement,n=i._self._c||t;return n("div",{staticClass:"rci-customerNavigation rci-customerNavigation--block",staticStyle:{display:"block"}},[n("div",{staticClass:"rci-title"},[n("span",{staticClass:"rci-title-span"})]),n("div",{staticClass:"rci-wrapper"},[n("div",{staticClass:"rci-navigation"})])])},function(){var i=this,t=i.$createElement,n=i._self._c||t;return n("div",{staticClass:"rci-accordion-step-header rci-accordion-step-header--active rci-accordion--rci-compare-left"},[n("div",{staticClass:"rci-accordion-step-header-label rci-accordion-step-header-label--single-offer"},[n("div",{staticClass:"rci-accordion-step-header-title"},[i._v(" P ")]),n("div",{staticClass:"rci-accordion-step-header-value"},[i._v(" RCREDVO-0 ")])])])},function(){var i=this,t=i.$createElement,n=i._self._c||t;return n("div",{staticClass:"rci-col rci-slider-content-mobile"},[n("label",{staticClass:"rci-input-label rci-input-label-sr-only",attrs:{for:"fin-simulator-container-downpaymentSlider-P-RCREDVO-0_input"}}),n("input",{staticClass:"rci-input-text",attrs:{id:"fin-simulator-container-downpaymentSlider-P-RCREDVO-0_input",name:"fin-simulator-container-downpaymentSlider-P-RCREDVO-0_input",type:"text"}})])},function(){var i=this,t=i.$createElement,n=i._self._c||t;return n("div",{staticClass:"rci-row rci-slider-min-max"},[n("div",{staticClass:"rci-col rci-slider-min rci-min-value"},[n("span",{staticClass:"rci-slider-min-value rci-value"},[i._v("0,00 €")])]),n("div",{staticClass:"rci-col rci-slider-max rci-max-value"},[n("span",{staticClass:"rci-slider-max-value rci-value"},[i._v("10.400,00 €")])])])},function(){var i=this,t=i.$createElement,n=i._self._c||t;return n("div",{staticClass:"rci-error-message"},[n("span",{staticClass:"rci-error-message-value"},[i._v("Please provide proper value")])])},function(){var i=this,t=i.$createElement,n=i._self._c||t;return n("div",{staticClass:"rci-title rci-box-title",attrs:{order:"rci_3.1"}},[i._v(" Želite li dodatno uključiti paket? "),n("div",{staticClass:"rci-infohint"})])},function(){var i=this,t=i.$createElement,n=i._self._c||t;return n("div",{staticClass:"rci-input-list-title"},[n("span")])},function(){var i=this,t=i.$createElement,n=i._self._c||t;return n("div",{staticClass:"rci-col rci-info-hint rci-info-hint-close-wrapper"},[n("div",{staticClass:"rci-hint-close"})])},function(){var i=this,t=i.$createElement,n=i._self._c||t;return n("div",{staticClass:"rci-col rci-info-hint-text"},[n("div",{staticClass:"rci-info-hint-text-content"},[n("b",[i._v("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse sagittis, nisi non dictum pulvinar, ligula erat venenatis massa, sit amet vestibulum ipsum ipsum id magna.")])])])},function(){var i=this,t=i.$createElement,n=i._self._c||t;return n("div",{staticClass:"rci-info-icon-wrapper"},[n("button",{staticClass:"rci-btn-info rci-info-hint-opened",attrs:{id:"fin-simulator-container_fin-simulator-container-insurance1-P-RBALLVN-0_info",type:"button","data-ico-after":"",for:"fin-simulator-container_fin-simulator-container-insurance1-P-RBALLVN-0"}}),n("div",{staticClass:"rci-info-popup-open-triangle"})])},function(){var i=this,t=i.$createElement,n=i._self._c||t;return n("div",{staticClass:"rci-error-message"},[n("span",{staticClass:"rci-error-message-value"},[i._v("Please provide proper value")])])},function(){var i=this,t=i.$createElement,n=i._self._c||t;return n("div",{staticClass:"rci-col rci-summary-label rci-summary-label--one rci-summary-label--no-info rci-summary-label--no-value",attrs:{order:"54"}},[n("div",{staticClass:"rci-row"},[n("div",{staticClass:"rci-col rci-summary-label-title rci-infohint-parent"},[n("span",[i._v("Kredita")]),n("div",{staticClass:"rci-infohint"})]),n("div",{staticClass:"rci-col rci-summary-label-value rci-infohint-parent"},[n("span",{staticClass:"rci-value"})])])])},function(){var i=this,t=i.$createElement,n=i._self._c||t;return n("div",{staticClass:"rci-col rci-summary-label rci-summary-label--one rci-summary-label--no-info rci-summary-label--no-value rci-summary-label--solid rci-watchers-hide"},[n("div",{staticClass:"rci-row"},[n("div",{staticClass:"rci-col rci-summary-label-title rci-infohint-parent"},[n("span",[i._v("Incluye de descuento por financiar")]),n("div",{staticClass:"rci-infohint"})]),n("div",{staticClass:"rci-col rci-summary-label-value rci-infohint-parent"},[n("span",{staticClass:"rci-value"})])])])},function(){var i=this,t=i.$createElement,n=i._self._c||t;return n("div",{staticClass:"rci-title rci-box-title"},[i._v(" Pojedinosti o ponudi "),n("div",{staticClass:"rci-infohint"})])},function(){var i=this,t=i.$createElement,n=i._self._c||t;return n("div",{staticClass:"rci-col rci-summary-label-value rci-infohint-parent"},[n("span",{staticClass:"rci-value"})])}],h=(n("7db0"),n("a9e3"),n("a434"),n("bc3a")),b=n.n(h),C=(n("e1b1"),n("b8c8")),g={name:"RciSimulator",components:{VueRangeSlider:C["a"]},data:function(){return{loading:!0,showSlider:!1,firstApiCall:!0,activeFinancingId:null,calculations:[],bundleHovers:[]}},created:function(){var i=this;c.$on("RCI_CALCULATOR_SHOWN",(function(){i.$nextTick((function(){i.showSlider=!0}))})),c.$on("RCI_CALCULATOR_HIDDEN",(function(){i.$nextTick((function(){i.showSlider=!1}))})),this.loading=!0,this.calculate()},computed:{financing:function(){var i=this;if(!this.activeFinancingId)return{};var t=this.calculations.find((function(t){return Number(t.financing_id)===Number(i.activeFinancingId)}));if(!t)throw"Financing with ID not found!";return t},settings:function(){return this.financing.financing_settings},durationTabs:function(){var i=[];if(!this.settings)return i;if(this.settings.duration_max>this.settings.duration_min&&this.settings.duration_max>0)for(var t=this.settings.duration_min;t<=this.settings.duration_max;t+=this.settings.duration_step)i.push(t);return i},summary:function(){return[{label:"Vrijednost vozila",value:s(window.RCI_SIMULATOR_CONFIG.vehicle_price,2)+" "+this.financing.currency},{label:"Učešće",value:s(this.financing.participation,2)+" "+this.financing.currency},{label:"Iznos financiranja",value:s(this.financing.financing_amount,2)+" "+this.financing.currency},{label:"Trajanje otplate",value:this.financing.duration+" mjeseci"},{label:"Nominalna kamatna stopa",value:s(this.financing.nominal_interest_rate,2)+"%"},{label:"Efektivna kamatna stopa",value:s(this.financing.effective_interest_rate,2)+"%"},{label:"Trošak obrade",value:s(this.financing.administration_fee,2)+" "+this.financing.currency},{label:"Mjesečna rata",value:s(this.financing.monthly_installment,2)+" "+this.financing.currency}]}},methods:{setDuration:function(i){this.financing.duration=i,this.calculate()},changeFinancingType:function(i){this.activeFinancingId=i,this.calculate()},downscaleParticipation:function(){var i=this.settings.down_payment_step;this.financing.participation-i>=this.settings.down_payment_min&&(this.financing.participation-=i,this.calculate())},upscaleParticipation:function(){var i=this.settings.down_payment_step;this.financing.participation+i<=this.settings.down_payment_max&&(this.financing.participation+=i,this.calculate())},calculate:function(){var i=this;this.loading=!0;var t="https://rna.sto2.hr/api/rci-calculator/calculate";"127.0.0.1"!==window.location.hostname&&"localhost"!==window.location.hostname||(t="http://127.0.0.1:8000/api/rci-calculator/calculate");var n=window.RCI_SIMULATOR_CONFIG;for(var a in this.financing)n[a]=this.financing[a];n["first_api_call"]=this.firstApiCall,this.firstApiCall=!1,b.a.post(t,n).then((function(t){i.loading=!1,i.calculations=t.data;var a=i.calculations.find((function(i){return i.financing_id>0}));if(!a)throw"Error while searching for first financing.";i.activeFinancingId||(i.activeFinancingId=a.financing_id),document.querySelector(".rci-calculator-price-wrapper").style.display="block",document.querySelector(".price-calculation-info-button").innerText="VEČ OD",n["first_api_call"]&&(document.querySelector(".price-calculation-price-month-installment").innerText=s(a.monthly_installment,2)+" "+a.currency+"/mj*")}))},isBundleHovered:function(i){return-1!==this.bundleHovers.indexOf(i)},setBundleHover:function(i){var t=this.bundleHovers.indexOf(i);-1===t&&this.bundleHovers.push(i)},removeBundleHover:function(i){var t=this.bundleHovers.indexOf(i);-1!==t&&this.bundleHovers.splice(t,1)}}},y=g,w=(n("ee9e"),Object(v["a"])(y,m,_,!1,null,"5f4ccafa",null)),x=w.exports,S={name:"App",data:function(){return{visible:!1}},mounted:function(){var i=this;document.querySelector(".rci-calculator-price-wrapper .rci-calculator-button").addEventListener("click",(function(){c.$emit("RCI_CALCULATOR_SHOWN"),i.visible=!0}))},components:{RciSimulator:x,Modal:f},methods:{onClose:function(){this.visible=!1,c.$emit("RCI_CALCULATOR_HIDDEN")}}},k=S,O=(n("2673"),Object(v["a"])(k,e,r,!1,null,"0f45a776",null)),P=O.exports;a["a"].config.productionTip=!1,a["a"].filter("formatNumber",s),new a["a"]({render:function(i){return i(P)}}).$mount("#rciCalculator")},cf93:function(i,t,n){},ee9e:function(i,t,n){"use strict";n("4931")}}); //# sourceMappingURL=app.24ee6037.js.map