import{k as _e,j as b,t as he,h as E,m as S,n as T,p as l,q as B,f as ye,i as h,v as w,A as D,x as F,e as N,s as ve,F as Se}from"./web.Os7kOAdY.js";import{g as Y,t as Te}from"./i18n-runtime._BAkvU05.js";var Fe=D("<div class=panel style=display:flex;flex-direction:column;gap:14px><div style=display:flex;gap:8px;flex-wrap:wrap><button></button><button></button><button></button></div><!$><!/><!$><!/><!$><!/><p class=tool-hint>"),ke=D("<div style=display:flex;flex-direction:column;gap:12px><div class=tool-grid-2><div class=tool-field><span class=tool-label></span><input class=tool-input type=number></div><div class=tool-field><span class=tool-label></span><input class=tool-input type=number></div></div><div class=tool-field><span class=tool-label></span><div style=display:flex;flex-wrap:wrap;gap:8px;margin-top:6px></div></div><pre class=tool-pre style=font-size:14px>"),Ce=D("<label style=display:flex;align-items:center;gap:4px;font-size:13px;cursor:pointer><input type=checkbox><!$><!/>（<!$><!/>）"),Z=D("<div style=display:flex;flex-direction:column;gap:12px><div class=tool-field><span class=tool-label></span><input class=tool-input type=number></div><pre class=tool-pre style=font-size:14px></pre><p class=tool-hint>");const z=[{min:0,max:36e3,rate:.03,deduction:0},{min:36e3,max:144e3,rate:.1,deduction:2520},{min:144e3,max:3e5,rate:.2,deduction:16920},{min:3e5,max:42e4,rate:.25,deduction:31920},{min:42e4,max:66e4,rate:.3,deduction:52920},{min:66e4,max:96e4,rate:.35,deduction:85920},{min:96e4,max:1/0,rate:.45,deduction:181920}],ee=[{key:"children",label:"子女教育",amount:1e3},{key:"education",label:"继续教育",amount:400},{key:"housing_loan",label:"住房贷款利息",amount:1e3},{key:"housing_rent",label:"住房租金",amount:1500},{key:"elderly",label:"赡养老人",amount:3e3},{key:"baby",label:"婴幼儿照护",amount:2e3}];function Me(c){if(c<=0)return 0;for(const a of z)if(c<=a.max)return c*a.rate-a.deduction;const m=z[z.length-1];return c*m.rate-m.deduction}function Ee(c){if(c<=0)return 0;const m=c/12,a=[{max:3e3,rate:.03,deduction:0},{max:12e3,rate:.1,deduction:210},{max:25e3,rate:.2,deduction:1410},{max:35e3,rate:.25,deduction:2660},{max:55e3,rate:.3,deduction:4410},{max:8e4,rate:.35,deduction:7160},{max:1/0,rate:.45,deduction:15160}];for(const d of a)if(m<=d.max)return c*d.rate-d.deduction;return 0}function Ie(){const[c,m]=b(Y(),{equals:!1}),a=e=>Te(e,c());he(()=>{const e=t=>{const n=t.detail?.locale;n&&m(n)};window.addEventListener("taitan:locale-change",e),m(Y()),ve(()=>window.removeEventListener("taitan:locale-change",e))});const[d,I]=b("salary"),[H,te]=b("15000"),[q,ne]=b("3000"),[P,le]=b("50000"),[j,ae]=b("10000"),[K,oe]=b({}),O=E(()=>{let e=0;const t=K();for(const n of ee)t[n.key]&&(e+=n.amount);return e}),p=E(()=>{const e=parseFloat(H())||0,t=parseFloat(q())||0,n=5e3,f=e-t-n-O(),g=Math.max(f*12,0),C=Me(g),y=Math.round(C/12*100)/100,R=Math.round((e-t-y)*100)/100;return{monthly:e,si:t,threshold:n,monthlyDeduction:O(),monthlyTaxable:Math.max(f,0),annualTaxable:g,annualTax:Math.round(C*100)/100,monthlyTax:y,takeHome:R}}),L=E(()=>{const e=parseFloat(P())||0,t=Math.round(Ee(e)*100)/100;return{bonus:e,tax:t,afterTax:Math.round((e-t)*100)/100}}),k=E(()=>{const e=parseFloat(j())||0;let t;e<=4e3?t=e-800:t=e*.8,t=Math.max(t,0);let n;return t<=2e4?n=t*.2:t<=5e4?n=t*.3-2e3:n=t*.4-7e3,n=Math.max(Math.round(n*100)/100,0),{income:e,taxableIncome:t,tax:n,afterTax:Math.round((e-n)*100)/100}}),ie=e=>{oe(t=>({...t,[e]:!t[e]}))};return(()=>{var e=S(Fe),t=e.firstChild,n=t.firstChild,f=n.nextSibling,g=f.nextSibling,C=t.nextSibling,[y,R]=T(C.nextSibling),se=y.nextSibling,[U,re]=T(se.nextSibling),ce=U.nextSibling,[G,de]=T(ce.nextSibling),ue=G.nextSibling;return n.$$click=()=>I("salary"),l(n,()=>a("工资薪金")),f.$$click=()=>I("bonus"),l(f,()=>a("年终奖")),g.$$click=()=>I("freelance"),l(g,()=>a("劳务报酬")),l(e,(()=>{var o=B(()=>d()==="salary");return()=>o()&&(()=>{var i=S(ke),s=i.firstChild,r=s.firstChild,u=r.firstChild,x=u.nextSibling,v=r.nextSibling,_=v.firstChild,J=_.nextSibling,Q=s.nextSibling,V=Q.firstChild,xe=V.nextSibling,$e=Q.nextSibling;return l(u,()=>a("税前月薪（元）")),x.$$input=$=>te($.currentTarget.value),l(_,()=>a("五险一金（元/月）")),J.$$input=$=>ne($.currentTarget.value),l(V,()=>a("专项附加扣除（每月）")),l(xe,ye(Se,{each:ee,children:$=>(()=>{var M=S(Ce),A=M.firstChild,me=A.nextSibling,[W,pe]=T(me.nextSibling),fe=W.nextSibling,be=fe.nextSibling,[X,ge]=T(be.nextSibling);return X.nextSibling,A.addEventListener("change",()=>ie($.key)),l(M,()=>$.label,W,pe),l(M,()=>$.amount,X,ge),h(()=>F(A,"checked",K()[$.key]||!1)),M})()})),l($e,()=>`起征点: 5,000 元/月
五险一金: ${p().si.toFixed(2)} 元/月
专项附加扣除: ${p().monthlyDeduction.toFixed(2)} 元/月
月应纳税所得额: ${p().monthlyTaxable.toFixed(2)} 元
年应纳税所得额: ${p().annualTaxable.toFixed(2)} 元
年度个税: ${p().annualTax.toFixed(2)} 元
月均个税: ${p().monthlyTax.toFixed(2)} 元
━━━━━━━━━━━━━━━━━━━━
月到手工资: ${p().takeHome.toFixed(2)} 元`),h(()=>F(x,"value",H())),h(()=>F(J,"value",q())),w(),i})()})(),y,R),l(e,(()=>{var o=B(()=>d()==="bonus");return()=>o()&&(()=>{var i=S(Z),s=i.firstChild,r=s.firstChild,u=r.nextSibling,x=s.nextSibling,v=x.nextSibling;return l(r,()=>a("年终奖金额（元）")),u.$$input=_=>le(_.currentTarget.value),l(x,()=>`年终奖: ${L().bonus.toFixed(2)} 元
应纳个税: ${L().tax.toFixed(2)} 元
━━━━━━━━━━━━━━━━━━━━
税后到手: ${L().afterTax.toFixed(2)} 元`),l(v,()=>a("按全年一次性奖金单独计税方式计算。")),h(()=>F(u,"value",P())),w(),i})()})(),U,re),l(e,(()=>{var o=B(()=>d()==="freelance");return()=>o()&&(()=>{var i=S(Z),s=i.firstChild,r=s.firstChild,u=r.nextSibling,x=s.nextSibling,v=x.nextSibling;return l(r,()=>a("劳务报酬收入（元）")),u.$$input=_=>ae(_.currentTarget.value),l(x,()=>`劳务收入: ${k().income.toFixed(2)} 元
应纳税所得额: ${k().taxableIncome.toFixed(2)} 元
预扣预缴税额: ${k().tax.toFixed(2)} 元
━━━━━━━━━━━━━━━━━━━━
税后到手: ${k().afterTax.toFixed(2)} 元`),l(v,()=>a("≤4000元减除800元费用；&gt;4000元减除20%费用。税率：20%/30%/40%三档。")),h(()=>F(u,"value",j())),w(),i})()})(),G,de),l(ue,()=>a("税率依据2024年中国个人所得税法，仅供参考。")),h(o=>{var i=`tool-btn ${d()==="salary"?"active":""}`,s=`tool-btn ${d()==="bonus"?"active":""}`,r=`tool-btn ${d()==="freelance"?"active":""}`;return i!==o.e&&N(n,o.e=i),s!==o.t&&N(f,o.t=s),r!==o.a&&N(g,o.a=r),o},{e:void 0,t:void 0,a:void 0}),w(),e})()}_e(["click","input"]);export{Ie as default};
