1import{u as U,aa as B,r,j as t,aw as E,l as H,W as Y,T as A,ah as K,i as W}from"./index-DxpMJHht.js";import{a as q}from"./PCLayout-C8uwrf_b.js";import{I as G}from"./info-CKT1RCse.js";function v(e,d,o){const l=d/100/12;return l===0?e/o:e*l*Math.pow(1+l,o)/(Math.pow(1+l,o)-1)}function X(){const{t:e}=U(),d=B(),o=new URLSearchParams(d),l=parseFloat(o.get("price")||"0")||3e6,[p,w]=r.useState(String(l)),[n,S]=r.useState("20"),[i,F]=r.useState("30"),[m,k]=r.useState("2.5"),[h,R]=r.useState(!0),[P,I]=r.useState("30000"),[M,T]=r.useState(!1),s=r.useMemo(()=>{const a=parseFloat(p.replace(/,/g,""))||0,c=parseFloat(m)||2.5,$=parseInt(i)||30,z=parseFloat(n)||20,u=$*12,b=a*(z/100),x=a-b,C=v(x,c,u),j=C*u,O=j-x,y=parseFloat(P)||3e4,D=C/y*100,L=[{label:"å©ç -0.5%",rate:Math.max(.5,c-.5)},{label:"ç¶åå©ç",rate:c},{label:"å©ç +1%",rate:c+1},{label:"å©ç +2%",rate:c+2},{label:"å©ç +3%",rate:c+3}].map(f=>{const N=v(x,f.rate,u);return{...f,monthly:N,ratio:N/y*100}});return{price:a,downPayment:b,loanAmount:x,monthlyPayment:C,totalPayment:j,totalInterest:O,debtRatio:D,stressTests:L}},[p,n,i,m,P]),g=a=>a.toLocaleString("zh-HK",{maximumFractionDigits:0});return t.jsxs("div",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:63",className:"min-h-screen bg-gray-50",children:[t.jsx(E,{"data-loc":"client/src/pages/pc/PCMortgage.tsx:64"}),t.jsx(H,{"data-loc":"client/src/pages/pc/PCMortgage.tsx:65",title:"æ¾³éææè¨ç®å¨ â 便¬¾è©¦ç®",description:"æ¾³éææè¨ç®å¨ï¼æä¾ä¾æ¬¾è©¦ç®ãå©çæ¯è¼ãææææ¸è¨ç®çåè½ï¼å©æ¨è¦åç½®æ¥é ç®ã",keywords:"æ¾³éææ,æ¾³é便¬¾è¨ç®,æ¾³éæ¿è²¸,ææè¨ç®å¨"}),t.jsxs("div",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:70",className:"max-w-[1100px] mx-auto px-4 py-8",children:[t.jsxs("div",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:71",className:"mb-6",children:[t.jsxs("h1",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:72",className:"text-2xl font-black text-gray-900 flex items-center gap-2",children:[t.jsx(Y,{"data-loc":"client/src/pages/pc/PCMortgage.tsx:73",size:24,className:"text-orange-500"}),"ææè¨ç®å¨"]}),t.jsx("p",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:76",className:"text-sm text-gray-500 mt-1",children:e("æ ¹ææ¾³ééç®¡å±æææå¼è¨ç®æ¯æä¾æ¬¾åå£å測試")})]}),t.jsxs("div",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:79",className:"grid grid-cols-5 gap-6",children:[t.jsx("div",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:81",className:"col-span-2 space-y-4",children:t.jsxs("div",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:82",className:"bg-white rounded-2xl border border-gray-100 shadow-sm p-5",children:[t.jsx("h2",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:83",className:"text-sm font-bold text-gray-700 mb-4",children:e("ç©æ¥è³æ")}),t.jsxs("div",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:84",className:"space-y-4",children:[t.jsxs("div",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:85",children:[t.jsx("label",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:86",className:"block text-xs font-medium text-gray-500 mb-1.5",children:e("ç©æ¥å¹æ ¼ï¼MOPï¼")}),t.jsx("input",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:87",type:"text",value:p,onChange:a=>w(a.target.value),className:"w-full px-3 py-2.5 text-sm border border-gray-200 rounded-xl focus:outline-none focus:ring-2 focus:ring-orange-400",placeholder:"3,000,000"})]}),t.jsxs("div",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:96",children:[t.jsxs("label",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:97",className:"block text-xs font-medium text-gray-500 mb-1.5",children:["馿æ¯ä¾ï¼",t.jsxs("span",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:98",className:"text-orange-500 font-bold",children:[n,"%"]})]}),t.jsx("input",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:100",type:"range",min:"10",max:"50",value:n,onChange:a=>S(a.target.value),className:"w-full accent-orange-500"}),t.jsxs("div",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:103",className:"flex justify-between text-xs text-gray-400 mt-1",children:[t.jsx("span",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:104",children:"10%"}),t.jsx("span",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:104",children:"50%"})]})]}),t.jsxs("div",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:108",children:[t.jsxs("label",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:109",className:"block text-xs font-medium text-gray-500 mb-1.5",children:["貸款年æï¼",t.jsxs("span",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:110",className:"text-orange-500 font-bold",children:[i," å¹´"]})]}),t.jsx("input",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:112",type:"range",min:"5",max:"30",value:i,onChange:a=>F(a.target.value),className:"w-full accent-orange-500"}),t.jsxs("div",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:115",className:"flex justify-between text-xs text-gray-400 mt-1",children:[t.jsx("span",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:116",children:e("5å¹´")}),t.jsx("span",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:116",children:e("30å¹´")})]})]}),t.jsxs("div",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:120",children:[t.jsx("label",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:121",className:"block text-xs font-medium text-gray-500 mb-1.5",children:e("å¹´å©çï¼%ï¼")}),t.jsx("input",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:122",type:"number",step:"0.1",min:"0.5",max:"10",value:m,onChange:a=>k(a.target.value),className:"w-full px-3 py-2.5 text-sm border border-gray-200 rounded-xl focus:outline-none focus:ring-2 focus:ring-orange-400"})]}),t.jsxs("div",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:127",children:[t.jsx("label",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:128",className:"block text-xs font-medium text-gray-500 mb-1.5",children:e("æ¯ææ¶å
¥ï¼MOPï¼ç¨æ¼å£å測試ï¼")}),t.jsx("input",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:129",type:"number",value:P,onChange:a=>I(a.target.value),className:"w-full px-3 py-2.5 text-sm border border-gray-200 rounded-xl focus:outline-none focus:ring-2 focus:ring-orange-400"})]}),t.jsxs("div",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:134",className:"flex items-center gap-3 p-3 bg-gray-50 rounded-xl",children:[t.jsx("button",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:135",onClick:()=>R(!h),className:`w-10 h-5 rounded-full transition-all relative ${h?"bg-orange-500":"bg-gray-300"}`,children:t.jsx("span",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:139",className:`absolute top-0.5 w-4 h-4 bg-white rounded-full shadow transition-all ${h?"left-5":"left-0.5"}`})}),t.jsx("span",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:141",className:"text-sm text-gray-700",children:e("馿¬¡ç½®æ¥")})]})]})]})}),t.jsxs("div",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:148",className:"col-span-3 space-y-4",children:[t.jsxs("div",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:150",className:"bg-gradient-to-br from-orange-500 to-orange-600 rounded-2xl p-6 text-white",children:[t.jsx("p",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:151",className:"text-sm opacity-80 mb-1",children:e("æ¯æä¾æ¬¾")}),t.jsxs("p",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:152",className:"text-4xl font-black mb-4",children:["MOP ",g(s.monthlyPayment)]}),t.jsxs("div",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:153",className:"grid grid-cols-3 gap-4",children:[t.jsxs("div",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:154",children:[t.jsx("p",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:155",className:"text-xs opacity-70",children:e("馿")}),t.jsx("p",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:156",className:"text-base font-bold",children:g(s.downPayment)})]}),t.jsxs("div",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:158",children:[t.jsx("p",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:159",className:"text-xs opacity-70",children:e("貸款é¡")}),t.jsx("p",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:160",className:"text-base font-bold",children:g(s.loanAmount)})]}),t.jsxs("div",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:162",children:[t.jsx("p",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:163",className:"text-xs opacity-70",children:e("ç¸½å©æ¯")}),t.jsx("p",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:164",className:"text-base font-bold",children:g(s.totalInterest)})]})]})]}),t.jsxs("div",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:170",className:"bg-white rounded-2xl border border-gray-100 shadow-sm p-5",children:[t.jsxs("div",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:171",className:"flex items-center justify-between mb-3",children:[t.jsx("h3",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:172",className:"text-sm font-bold text-gray-700",children:e("便¬¾ä½æ¶å
¥æ¯")}),t.jsxs("span",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:173",className:`text-sm font-bold ${s.debtRatio>50?"text-red-500":s.debtRatio>35?"text-yellow-500":"text-green-500"}`,children:[s.debtRatio.toFixed(1),"%"]})]}),t.jsx("div",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:177",className:"w-full bg-gray-100 rounded-full h-3",children:t.jsx("div",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:178",className:`h-3 rounded-full transition-all ${s.debtRatio>50?"bg-red-500":s.debtRatio>35?"bg-yellow-400":"bg-green-500"}`,style:{width:`${Math.min(s.debtRatio,100)}%`}})}),t.jsxs("div",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:183",className:"flex justify-between text-xs text-gray-400 mt-1.5",children:[t.jsx("span",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:184",children:e("å®å
¨ï¼<35%ï¼")}),t.jsx("span",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:185",children:e("æ¾³éé管å±ä¸é 50%")})]})]}),t.jsxs("div",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:190",className:"bg-white rounded-2xl border border-gray-100 shadow-sm overflow-hidden",children:[t.jsxs("button",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:191",onClick:()=>T(!M),className:"w-full flex items-center justify-between p-5 text-sm font-bold text-gray-700 hover:bg-gray-50 transition-colors",children:[t.jsxs("div",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:195",className:"flex items-center gap-2",children:[t.jsx(A,{"data-loc":"client/src/pages/pc/PCMortgage.tsx:196",size:16,className:"text-orange-500"}),"å©çå£å測試"]}),M?t.jsx(K,{"data-loc":"client/src/pages/pc/PCMortgage.tsx:199",size:16}):t.jsx(W,{"data-loc":"client/src/pages/pc/PCMortgage.tsx:199",size:16})]}),M&&t.jsxs("div",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:202",className:"px-5 pb-5",children:[t.jsx("div",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:203",className:"overflow-x-auto",children:t.jsxs("table",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:204",className:"w-full text-sm",children:[t.jsx("thead",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:205",children:t.jsxs("tr",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:206",className:"border-b border-gray-100",children:[t.jsx("th",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:207",className:"text-left py-2 text-xs font-medium text-gray-500",children:e("æ
å¢")}),t.jsx("th",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:208",className:"text-right py-2 text-xs font-medium text-gray-500",children:e("å©ç")}),t.jsx("th",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:209",className:"text-right py-2 text-xs font-medium text-gray-500",children:e("æ¯æä¾æ¬¾")}),t.jsx("th",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:210",className:"text-right py-2 text-xs font-medium text-gray-500",children:e("使¶å
¥")})]})}),t.jsx("tbody",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:213",children:s.stressTests.map((a,c)=>t.jsxs("tr",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:215",className:`border-b border-gray-50 ${c===1?"bg-orange-50":""}`,children:[t.jsx("td",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:216",className:`py-2.5 font-medium ${c===1?"text-orange-600":"text-gray-700"}`,children:a.label}),t.jsxs("td",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:217",className:"text-right text-gray-600",children:[a.rate.toFixed(1),"%"]}),t.jsxs("td",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:218",className:"text-right font-semibold text-gray-800",children:["MOP ",g(a.monthly)]}),t.jsxs("td",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:219",className:`text-right font-bold ${a.ratio>50?"text-red-500":a.ratio>35?"text-yellow-500":"text-green-500"}`,children:[a.ratio.toFixed(1),"%"]})]},c))})]})}),t.jsxs("p",{"data-loc":"client/src/pages/pc/PCMortgage.tsx:227",className:"text-xs text-gray-400 mt-3 flex items-start gap-1",children:[t.jsx(G,{"data-loc":"client/src/pages/pc/PCMortgage.tsx:228",size:12,className:"shrink-0 mt-0.5"}),"æ¾³éé管å±å£åæ¸¬è©¦æ¨æºï¼å©ç +2%ï¼ä¾æ¬¾ä½æ¶å
¥æ¯ä¸è¶
é 50%"]})]})]})]})]})]}),t.jsx(q,{"data-loc":"client/src/pages/pc/PCMortgage.tsx:237"})]})}
1export{X 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.