import{k as K,j as d,t as O,h as Q,m as p,n as L,p as t,q as N,i as _,v as U,A as u,x as v,s as V}from"./web.Os7kOAdY.js";import{g as k,t as W}from"./i18n-runtime._BAkvU05.js";var X=u("<div class=panel style=display:flex;flex-direction:column;gap:14px><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><input class=tool-input type=number min=1></div><!$><!/><p class=tool-hint>"),Y=u("<dl class=tool-kv><dt></dt><dd></dd><dt></dt><dd></dd><!$><!/>"),Z=u("<dt>"),ee=u("<dd>");function ne(){const[M,g]=d(k(),{equals:!1}),n=e=>W(e,M());O(()=>{const e=i=>{const l=i.detail?.locale;l&&g(l)};window.addEventListener("taitan:locale-change",e),g(k()),V(()=>window.removeEventListener("taitan:locale-change",e))});const[x,q]=d("100"),[m,A]=d("15"),[f,j]=d("1"),s=Q(()=>{const e=parseFloat(x()),i=parseFloat(m()),l=parseInt(f())||1;if(isNaN(e)||e<=0)return null;const o=e*i/100,r=e+o;return{tip:o,total:r,perPerson:r/l,n:l}});return(()=>{var e=p(X),i=e.firstChild,l=i.firstChild,o=l.firstChild,r=o.nextSibling,H=l.nextSibling,b=H.firstChild,S=b.nextSibling,h=i.nextSibling,C=h.firstChild,y=C.nextSibling,I=h.nextSibling,[E,R]=L(I.nextSibling),z=E.nextSibling;return t(o,()=>n("金额")),r.$$input=a=>q(a.currentTarget.value),t(b,()=>n("小费 %")),S.$$input=a=>A(a.currentTarget.value),t(C,()=>n("人数")),y.$$input=a=>j(a.currentTarget.value),t(e,(()=>{var a=N(()=>!!s());return()=>a()&&(()=>{var $=p(Y),F=$.firstChild,P=F.nextSibling,T=P.nextSibling,w=T.nextSibling,B=w.nextSibling,[D,G]=L(B.nextSibling);return t(F,()=>n("小费")),t(P,()=>s().tip.toFixed(2)),t(T,()=>n("总计")),t(w,()=>s().total.toFixed(2)),t($,(()=>{var J=N(()=>s().n>1);return()=>J()&&[(()=>{var c=p(Z);return t(c,()=>n("人均")),c})(),(()=>{var c=p(ee);return t(c,()=>s().perPerson.toFixed(2)),c})()]})(),D,G),$})()})(),E,R),t(z,()=>n("常见档位：服务一般 10%、合格 15%、惊艳 20%。")),_(()=>v(r,"value",x())),_(()=>v(S,"value",m())),_(()=>v(y,"value",f())),U(),e})()}K(["input"]);export{ne as default};
