1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[49888],{49888:(e,s,a)=>{a.r(s),a.d(s,{default:()=>f});var l=a(95155),t=a(33546),n=a(93954),r=a(35484),i=a(14577),d=a(64962),o=a(12115),c=a(99003),m=a(76105),x=a(13993),u=a(64086),h=a(21831),b=a(87459);let j=e=>{let s=Number(e);return Number.isFinite(s)?Math.max(0,s):0};var v=a(42743);let N=v.Ik({housePrice:v.ai().min(0,"æ¿å±ç¸½å¹ä¸è½çºè² æ¸"),renovationCost:v.ai().min(0,"è£æ½¢ææ¬ä¸è½çºè² æ¸"),monthlyRent:v.ai().min(0,"æç§éä¸è½çºè² æ¸"),monthlyManagementFee:v.ai().min(0,"æ¯æç®¡çè²»ä¸è½çºè² æ¸"),vacancyRate:v.ai().min(0).max(100,"空置çä¸è½å¤§æ¼ 100")}),p=e=>{let s=Number(e);return Number.isFinite(s)?Math.max(0,s):0};function f(){let[e,s]=(0,o.useState)(!1),[a,v]=(0,o.useState)(null),{handleSubmit:f,watch:g,setValue:y}=(0,c.mN)({resolver:(0,t.u)(N),defaultValues:{housePrice:1500,renovationCost:150,monthlyRent:3e4,monthlyManagementFee:2500,vacancyRate:5}}),w=e=>{let s={housePrice:p(e.housePrice),renovationCost:p(e.renovationCost),monthlyRent:p(e.monthlyRent),monthlyManagementFee:p(e.monthlyManagementFee),vacancyRate:p(e.vacancyRate)};0===s.housePrice&&0===s.renovationCost?v({isValid:!1,grossYield:0,netYield:0,annualGrossRent:0,annualNetRent:0,status:"low",isVacancyRateLow:!1}):v(function(e){let s=1e4*j(e.housePrice),a=1e4*j(e.renovationCost),l=j(e.monthlyRent),t=j(e.monthlyManagementFee),n=Math.min(1,Math.max(0,j(e.vacancyRate)/100)),r=s+a;if(s<=0||l<=0||r<=0)return{grossYield:0,netYield:0,annualGrossRent:0,annualNetRent:0,status:"low",isVacancyRateLow:!1,isValid:!1};let i=12*l,d=(l-t)*12*(1-n),o=s>0?i/s*100:0,c=r>0?d/r*100:0,m=Number.isFinite(o)?Number(o.toFixed(2)):0,x=Number.isFinite(c)?Number(c.toFixed(2)):0,u=Number.isFinite(i)?Math.round(i):0,h=Number.isFinite(d)?Math.round(d):0,b="low";return x>=4?b="high":x>=2&&(b="medium"),{grossYield:m,netYield:x,annualGrossRent:u,annualNetRent:h,status:b,isVacancyRateLow:n<.05,isValid:!0}}(s))},R=(0,b.Qb)("yield",g(),e=>{for(let[s,a]of Object.entries(e))y(s,a)});return((0,o.useEffect)(()=>{s(!0),f(w)()},[]),(0,o.useEffect)(()=>{if(!e)return;let s=g(()=>f(w)());return()=>s.unsubscribe()},[g,f,e]),e)?(0,l.jsx)(h.default,{toolType:"yield",toolInput:R,title:"",children:(0,l.jsx)(m.Z,{children:(0,l.jsx)(u.X,{inputs:(0,l.jsxs)("div",{className:"space-y-6",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2 mb-4 text-slate-900 font-bold border-b pb-2 border-slate-200/90",children:[(0,l.jsx)("div",{className:"w-1.5 h-5 bg-slate-900 rounded-full inline-block"}),(0,l.jsx)("span",{children:"ç§è³æè³è©¦ç®åæ¸"})]}),(0,l.jsx)(x.Cw,{label:"æ¿å±ç¸½å¹",value:g("housePrice"),min:0,max:1e4,step:50,unit:"è¬å
",onChange:e=>y("housePrice",e)}),(0,l.jsx)(x.Cw,{label:"è£æ½¢èè²·è³£ç¨
è²»ææ¬",value:g("renovationCost"),min:0,max:1e3,step:10,unit:"è¬å
",onChange:e=>y("renovationCost",e)}),(0,l.jsx)(x.Cw,{label:"é ææ¯æç§éæ¶å
¥",value:g("monthlyRent"),min:0,max:2e5,step:1e3,unit:"å
",onChange:e=>y("monthlyRent",e)}),(0,l.jsx)(x.Cw,{label:"æ¯æç®¡çè²»",value:g("monthlyManagementFee"),min:0,max:2e4,step:100,unit:"å
",onChange:e=>y("monthlyManagementFee",e)}),(0,l.jsx)(x.Cw,{label:"å¹´å空置ç",sub:"(é è¨ 5%ï¼æ¯å¹´ç´ç©ºç§ååæ)",value:g("vacancyRate"),min:0,max:50,step:1,unit:"%",onChange:e=>y("vacancyRate",e)})]}),results:a?.isValid?(0,l.jsxs)("div",{className:"space-y-6",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2 mb-4 text-slate-900 font-bold border-b pb-2 border-slate-200/90",children:[(0,l.jsx)("div",{className:"w-1.5 h-5 bg-slate-900 rounded-full inline-block"}),(0,l.jsx)("span",{children:"æ·¨å ±é
¬ç試ç®çµæ"})]}),(0,l.jsxs)("div",{className:"bg-white border border-slate-200/90 rounded-2xl p-6 shadow-2xs space-y-3",children:[(0,l.jsxs)("div",{className:"text-slate-900 font-extrabold flex items-center gap-1.5 text-xs uppercase tracking-wider",children:[(0,l.jsx)(n.A,{className:"w-4 h-4 text-blue-600"}),"ç實淨æå ±ç (CAP Rate)"]}),(0,l.jsxs)("div",{className:"text-3xl sm:text-4xl font-black text-emerald-600 font-mono tabular-nums",children:[a.netYield,"%"]})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,l.jsx)(u.S,{label:"è¡¨é¢æ¯æå ±ç (Gross Yield)",value:a.grossYield,unit:"%",variant:"secondary"}),(0,l.jsx)(u.S,{label:"ç坦年忷¨ç§é",value:a.annualNetRent.toLocaleStr
1ing(),unit:"å
",subValue:"æ£é¤ç®¡çè²»è空置æå¤±",variant:"secondary"})]}),(0,l.jsxs)("div",{className:"space-y-3",children:["low"===a.status&&(0,l.jsxs)("div",{className:"p-4 bg-slate-50 border-l-4 border-rose-600 rounded-r-xl border border-slate-200/90 flex gap-3",children:[(0,l.jsx)(r.A,{className:"text-rose-600 shrink-0 mt-0.5"}),(0,l.jsxs)("div",{children:[(0,l.jsx)("h4",{className:"font-bold text-rose-700",children:"[è³éæçåä½]"}),(0,l.jsx)("p",{className:"text-sm text-rose-600/90 mt-1",children:"æ·¨æå ±ç使¼ 2%ï¼å¯è½ç¢çè² åç¾éæµã建è°éæ°è©ä¼°è³ç¢é
ç½®ï¼æèæ
®å
¶ä»å
·åæéè¨æçä¹æè³æ¨çã"})]})]}),"medium"===a.status&&(0,l.jsxs)("div",{className:"p-4 bg-slate-50 border-l-4 border-amber-500 rounded-r-xl border border-slate-200/90 flex gap-3",children:[(0,l.jsx)(i.A,{className:"text-amber-600 shrink-0 mt-0.5"}),(0,l.jsxs)("div",{children:[(0,l.jsx)("h4",{className:"font-bold text-amber-800",children:"[è³éæçä¸ç]"}),(0,l.jsx)("p",{className:"text-sm text-amber-700 mt-1",children:"æ·¨æå ±ç仿¼ 2%~4%ï¼ç¬¦å齿åå¸å ´åå¼ãç§éæ¶ç坿¶µèåºç¤å©æ¯æ¯åºï¼æ´é«æ½å¨å ±é
¬å°é«åº¦åæ±ºæ¼æªä¾ä¹è³æ¬å©å¾ã"})]})]}),"high"===a.status&&(0,l.jsxs)("div",{className:"p-4 bg-slate-50 border-l-4 border-emerald-500 rounded-r-xl border border-slate-200/90 flex gap-3",children:[(0,l.jsx)(d.A,{className:"text-emerald-600 shrink-0 mt-0.5"}),(0,l.jsxs)("div",{children:[(0,l.jsx)("h4",{className:"font-bold text-emerald-800",children:"[è³éæçåªç°]"}),(0,l.jsx)("p",{className:"text-sm text-emerald-700 mt-1",children:"æ·¨æå ±çè¶
é 4%ï¼å
·åç©©å®ä¹æ£åç¾éæµï¼å±¬æ¼è¶
è¶å¸å ´åå¼ç髿¶çè³ç¢ã"})]})]}),a.isVacancyRateLow&&(0,l.jsxs)("div",{className:"p-4 bg-slate-50 border-l-4 border-slate-400 rounded-r-xl border border-slate-200/90 flex gap-3",children:[(0,l.jsx)(i.A,{className:"text-slate-600 shrink-0 mt-0.5"}),(0,l.jsxs)("div",{children:[(0,l.jsx)("h4",{className:"font-bold text-slate-800",children:"[é¢¨éªæç¤º]"}),(0,l.jsx)("p",{className:"text-sm text-slate-700 mt-1",children:"ä½ è¨å®çç©ºç½®çæ¥µä½ã實å䏿¿å®¢éç§ãä¿®ç¹ãæ¾æ°æ¿å®¢åéæéææ¬ï¼å»ºè°ç©ºç½®çæ 5%~10% (ç´æ¯å¹´ç©ºååæè³ä¸åæ) è¼çºå®å
¨ã"})]})]})]})]}):(0,l.jsx)("div",{className:"flex items-center justify-center h-full text-slate-400 font-medium",children:a&&!a.isValid?"è«è¼¸å
¥ææçæ¸å¼":"è«å¨å·¦å´è¼¸å
¥æ¸å¼éå§è©¦ç®"})})})}):(0,l.jsx)(h.default,{toolType:"yield",toolInput:R,title:"",children:(0,l.jsxs)("div",{className:"animate-pulse flex flex-col lg:flex-row gap-6 lg:gap-8 w-full",children:[(0,l.jsxs)("div",{className:"flex-1 w-full lg:min-w-[300px] space-y-6",children:[(0,l.jsx)("div",{className:"h-[220px] bg-slate-100 rounded-xl w-full"}),(0,l.jsx)("div",{className:"h-[220px] bg-slate-100 rounded-xl w-full"}),(0,l.jsx)("div",{className:"h-[180px] bg-slate-100 rounded-xl w-full"})]}),(0,l.jsxs)("div",{className:"flex-1 w-full lg:min-w-[350px] space-y-6",children:[(0,l.jsx)("div",{className:"h-[160px] bg-slate-100 rounded-xl w-full"}),(0,l.jsx)("div",{className:"h-[100px] bg-slate-100 rounded-xl w-full"}),(0,l.jsx)("div",{className:"h-[240px] bg-slate-100 rounded-xl w-full"})]})]})})}}}]);
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.