PageSourceSearch

https://www.samuitimes.com/build/js/chunks/InterestCalculator.CQj3Q3ox.js

js samuitimes.com collected 2026-10-02 12:38:25 UTC 10,355 bytes, 1 lines download raw bytes

1import{A as g}from"./vue-apexcharts.BZ9jzY6X.js";import{p as v}from"./calculator.DnPPJH4a.js";import{L as P}from"./LoanForm.CvX3Ga-l.js";import{f as u}from"../currency_format.C1iz9Esb.js";import{S as b}from"./SliderNumberInput.NoZ1sAC6.js";import{d as w}from"./debounce.DRu_9mJA.js";import{i as d}from"./isEmpty.D7AUEg_7.js";import _ from"./OtpModal.B7cqWPoL.js";import{u as C}from"./index.DueSF9_s.js";import{mapState as D}from"./vuex.esm.browser.0x13uf2D.js";import{n as R}from"./_plugin-vue2_normalizer.WtMK3bkS.js";import"./isSymbol.D_SuF1gh.js";import"./lazy-module.BKQiYMM0.js";import"./contactForm.JHVLeRfz.js";import"./validator.B7atf7yr.js";import"./joi-browser.BT8dQM0N.js";import"./index.C7nH7Tym.js";import"./get.CvaKYTft.js";import"./get.CV9uko90.js";import"./isNull.CGorzo2h.js";import"./parsePhoneNumber_.BsGCQg0d.js";import"./parsePhoneNumber.DC9nczeJ.js";import"./validation.QCTuSP7y.js";import"./rentalContactForm.Gx1Npkeo.js";import"./loadForm.DIIhbqAk.js";import"./scheduleViewingStep1Form.BFPVIL8S.js";import"./validateWithMessages.DDzm4VLC.js";import"./EqTextInput.C2njY9YG.js";import"./EqTextArea.BKeuPCfV.js";import"./EqLanguageOptions.Dp8mKg5P.js";import"./index.u-EQOEth.js";import"./toNumber.CTajAh1i.js";import"./isTypedArray.QsD9C-0s.js";import"./_Set.B5Qo9BPv.js";import"./networking.Cu3Aslsi.js";import"./user.BEyvPNAF.js";import"./search.BkD3dx_z.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};a.SENTRY_RELEASE={id:"v3.301.0"};var t=new a.Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="35e4c4e4-9c91-4b8a-b6af-9b02781fcd0b",a._sentryDebugIdIdentifier="sentry-dbid-35e4c4e4-9c91-4b8a-b6af-9b02781fcd0b")}catch{}})();const x={name:"InterestCalculator",props:["reference","startPrice","seriesData","finance","monthLabel","currencyLabel","transferFee","financeFormData","translates","defaultCountry","leadableType","leadableId","saleType","section","step","enquireLanguageOptions","defaultEnquireLanguage","showRtoCheckbox","isForSale","rtoBuyerLandingPageUrl"],components:{OtpModal:_,SliderNumberInput:b,LoanForm:P,ApexChart:g},data(){const{startPrice:a=4e6,financeFormData:t,reference:e}=this,{messageTextFinance:s}=t,n=20,i=this.getDownPay(a,n),r=this.getMoneyDisplay(e),o=this.getMoneyDisplay(i);return{price:a,priceInput:r,maxPrice:a*2,downPay:i,downPayInput:o,downPayRate:n,downPayRateInput:n,interestRate:5,maxInterestRate:20,loanTerm:30,maxLoanTerm:30,isMobile:window.site.isMobile&&!window.site.isTablet,financeRequestData:{message:s},isFinanceFormValidated:!1,chartSeries:[],chartOptions:{}}},mounted(){const{series:a=[],setChartSeries:t}=this;a.length&&t(a)},watch:{price(a,t){if(a!==t){const e=parseFloat(a),{downPayRate:s}=this;this.priceInput=this.getMoneyDisplay(e),this.downPay=this.getDownPay(e,s),this.downPayInput=this.getMoneyDisplay(this.downPay)}},downPayRate(a,t){a!==t&&(this.downPayRateInput=Math.ceil(a))},series(a,t){a!==t&&this.setChartSeries(a)}},computed:{...D("enquire",{leadTempId:a=>a.leadTempId}),isChartOptionsEmpty(){return d(this.chartOptions)},isChartSeriesEmpty(){return d(this.chartSeries)},sinkingFund(){const{seriesData:a=[]}=this,e=(a.find(s=>s.key==="sinkingFund")||{}).value;return e!==null&&e?parseFloat(e):0},freeholdPremium(){const{seriesData:a=[]}=this,e=(a.find(s=>s.key==="freeholdPremium")||{}).value;return e!==null&&e?parseFloat(e):0},payPerMonth(){const{price:a,downPay:t,interestRate:e,loanTerm:s,freeholdPremium:n,sinkingFund:i}=this,o=a+i+n-t,c=e/1200,l=s*12,p=v(c,l,-o);return Math.ceil(p)},series(){const{seriesData:a=[],price:t,downPay:e}=this,s=t-e;return a.map(n=>n.key==="loanAmount"?s:n.key==="downPayment"?e:parseFloat(n.value))},labels(){const{seriesData:a=[]}=this;return a.map(t=>t.label)},colors(){const{seriesData:a=[]}=this;return a.map(t=>t.color)},totalCost(){const{series:a=[]}=this;return a.reduce((t,e)=>t+=parseFloat(e),0)},options(){const{labels:a,seriesData:t,isMobile:e,colors:s,series:n,totalCost:i}=this;return{labels:a,colors:s,dataLabels:{enabled:!1},legend:{show:!0,position:e?"bottom":"right",formatter:(o,c)=>{const{seriesIndex:l}=c,p=t[l]||{},{key:m}=p,h=m==="total"?i:n[l],y=Math.ceil(h),f=u("site",y,!0,!0);return`<span class="interest-series-item__wrap">${o} <small>${f}</small></span>`}}}},financeAvailableText(){const{finance:a,translates:t}
1=this,{isAvailableText:e,financeOptionAvailable:s}=t;return a?e:s}},methods:{onPriceChange(a){const{value:t}=a.target,e=this.getNumberFromDisplay(t),s=parseFloat(e);this.price=s>0?s:0,this.priceInput=this.getMoneyDisplay(this.price)},onDownPayChange(a){const{value:t}=a.target,e=this.getNumberFromDisplay(t),s=parseFloat(e),{price:n}=this;this.downPay=s>n?n:s<1?0:s,this.downPayInput=this.getMoneyDisplay(this.downPay),this.downPayRate=this.getDownPayRate(n,this.downPay)},onDownPayRateChange(a,t){const{price:e}=this;this.downPayRate=parseFloat(t),this.downPay=this.getDownPay(e,t),this.downPayInput=this.getMoneyDisplay(this.downPay)},onDownPayRateInputChange(a){const{value:t}=a.target,{price:e}=this,s=t>100?100:t<1?0:parseFloat(t);this.downPayRate=s,this.downPay=this.getDownPay(e,s),this.downPayInput=this.getMoneyDisplay(this.downPay)},onInterestRateInputChange(a){const{maxInterestRate:t}=this,{value:e}=a.target,s=e?parseFloat(e):0;this.interestRate=s<0?0:s>=t?t:s},getDownPay(a=0,t=0){const e=a/100*t;return Math.ceil(e)},getDownPayRate(a=0,t=0){return a===0?this.downPayRate:t*100/a},getTotalInterest(){const{payPerMonth:a,loanTerm:t,price:e,downPay:s,freeholdPremium:n,sinkingFund:i,interestRate:r}=this;if(r===0||r==="0")return 0;const c=t*12*a,l=e+n+i-s,p=c-l;return Math.ceil(p)},getNumberFromDisplay(a){const t=a.replace(/\D+/g,"");return t===""?0:t},getMoneyDisplay(a){return u("site",a,!1,!1)}
1,onOpenFinanceRequest(){this.$modal.show("finance-request-form")},onFinanceFormClose(a){this.$modal.hide("finance-request-form"),a&&this.$refs.otpModalRef.openModal({id:this.leadTempId,urls:C.enquiry})},setChartSeries:w(function(a){this.chartSeries=a,this.chartOptions=this.options},250,{trailing:!0})}};var I=function(){var t=this,e=t._self._c;return e("div",{staticClass:"wrap_interest_calculator",class:{"have-finance":t.finance}},[e("div",{staticClass:"finance_left"},[e("div",{staticClass:"row-calc",class:{mobile:t.isMobile,currency_mmk:t.currencyLabel==="Kyats (Lakh)"}},[e("div",{staticClass:"col-calc"},[e("label",[t._v(t._s(t.translates.propertyPriceText))]),e("div",{staticClass:"value-set"},[e("i",[t._v(t._s(t.currencyLabel))]),e("input",{staticClass:"value primary-input primary-input2",attrs:{type:"text",pattern:"[0-9]*",inputmode:"decimal"},domProps:{value:t.priceInput},on:{input:t.onPriceChange}})]),e("slider-number-input",{attrs:{step:t.step,max:t.maxPrice},model:{value:t.price,callback:function(s){t.price=s},expression:"price"}})],1),e("div",{staticClass:"col-calc i-pedding"},[e("label",[t._v(t._s(t.translates.downPaymentText))]),e("div",{staticClass:"value-set"},[e("i",[t._v(t._s(t.currencyLabel))]),e("input",{staticClass:"value primary-input append",attrs:{type:"text",pattern:"[0-9]*",inputmode:"decimal"},domProps:{value:t.downPayInput},on:{input:t.onDownPayChange}}),e("input",{staticClass:"secondary-input",attrs:{type:"text",pattern:"[0-9]*",inputmode:"decimal"},domProps:{value:t.downPayRateInput},on:{input:t.onDownPayRateInputChange}}),e("i",{staticClass:"numeric-append"},[t._v("%")])]),e("slider-number-input",{attrs:{step:1,value:t.downPayRate,max:100,"on-field-input":t.onDownPayRateChange}})],1),e("div",{staticClass:"col-calc"},[e("label",[t._v(t._s(t.translates.interestRateText))]),e("div",{staticClass:"value-set"},[e("input",{staticClass:"value numeric-input",attrs:{type:"text",pattern:"[0-9]*",inputmode:"decimal"},domProps:{value:t.interestRate},on:{input:t.onInterestRateInputChange}}),e("i",{staticClass:"i-right"},[t._v("%")])]),e("slider-number-input",{attrs:{step:.25,max:t.maxInterestRate},model:{value:t.interestRate,callback:function(s){t.interestRate=s},expression:"interestRate"}})],1),e("div",{staticClass:"col-calc"},[e("label",[t._v(t._s(t.translates.loanTermText))]),e("div",{staticClass:"value-set"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.loanTerm,expression:"loanTerm"}],staticClass:"value numeric-input",attrs:{type:"text",pattern:"[0-9]*",inputmode:"decimal"},domProps:{value:t.loanTerm},on:{input:function(s){s.target.composing||(t.loanTerm=s.target.value)}}}),e("i",{staticClass:"i-year"},[t._v(t._s(t.translates.yearsText))])]),e("slider-number-input",{attrs:{step:1,min:1,max:t.maxLoanTerm},model:{value:t.loanTerm,callback:function(s){t.loanTerm=s},expression:"loanTerm"}})],1)])]),e("div",{staticClass:"finance_right"},[e("div",{staticClass:"body-chart"},[e("div",{staticClass:"wrap__charts-price",class:{"no-finance":!t.finance&&!t.isMobile}},[e("span",{staticClass:"charts-price__pay"},[t._v(t._s(t.currencyLabel)+t._s(t.payPerMonth.toLocaleString()))]),e("span",{staticClass:"charts-price__currency"},[t._v(t._s(t.monthLabel))])]),!t.isChartOptionsEmpty&&!t.isChartSeriesEmpty?e("apex-chart",{ref:"chart",attrs:{height:t.isMobile?400:250,width:t.isMobile?"100%":480,type:"donut",options:t.chartOptions,series:t.chartSeries}}):t._e()],1),e("div",{staticClass:"pre-qualified",class:{"no-finance":!t.finance}},[e("div",{staticClass:"pre-qualified__text"},[e("span",{staticClass:"pre-qualified-title"},[t._v(t._s(t.translates.financeText)+":")]),t._v(" "+t._s(t.finance)+" "+t._s(t.financeAvailableText)+" ")]),e("span",{staticClass:"btn btn-theme",on:{click:t.onOpenFinanceRequest}},[t._v(t._s(t.translates.requestDetailsText))])]),e("modal",{attrs:{name:"finance-request-form",draggable:"false",height:t.isMobile?"100%":"auto",width:t.isMobile?"100%":"310px"}},[e("loan-form",{attrs:{translates:t.translates,"form-data":t.financeFormData,"on-close":t.onFinanceFormClose,"leadable-id":t.leadableId,"leadable-type":t.leadableType,"sale-type":t.saleType,section:t.section,"default-country":t.defaultCountry,"language-options":t.enquireLanguageOptions,"default-enquire-language":t.defaultEnquireLanguage,"show-rto-checkbox":!1,"is-for-sale":t.isForSale,"rto-buyer-landing-page-url":t.rtoBuyerLandingPageUrl}})],1),e("otp-modal",{ref:"otpModalRef",attrs:{translates:t.translates}}
1)],1)])},T=[],F=R(x,I,T,!1,null,"0f5605ca");const mt=F.exports;export{mt as default};

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.