import{k as Je,j as r,t as el,m as Te,n as ll,p as n,f as tl,i as c,v as il,A as ye,w as f,x as d,s as sl,S as nl}from"./web.Os7kOAdY.js";import{d as al,c as ol}from"./clipboard.BNxbz_oK.js";import{g as Ee,t as rl}from"./i18n-runtime._BAkvU05.js";var cl=ye('<div style="text-align:center;padding:16px;background:#fff;border-radius:8px;border:1px solid var(--border)"><div></div><p style=font-size:12px;color:var(--muted);margin-top:8px>'),dl=ye('<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></div><div class=tool-field><span class=tool-label></span><input class=tool-input></div></div><div class=tool-grid-2><div class=tool-field><span class=tool-label></span><input class=tool-input placeholder="Acme Inc."></div><div class=tool-field><span class=tool-label></span><input class=tool-input></div></div><div class=tool-grid-2><div class=tool-field><span class=tool-label></span><input class=tool-input type=email placeholder=name@example.com></div><div class=tool-field><span class=tool-label></span><input class=tool-input placeholder=https://example.com></div></div><div class=tool-grid-2><div class=tool-field><span class=tool-label></span><input class=tool-input placeholder="+86 10 12345678"></div><div class=tool-field><span class=tool-label></span><input class=tool-input placeholder="+86 13800138000"></div></div><div class=tool-grid-2><div class=tool-field><span class=tool-label></span><input class=tool-input></div><div class=tool-field><span class=tool-label></span><input class=tool-input></div></div><div class=tool-grid-2><div class=tool-field><span class=tool-label></span><input class=tool-input></div><div class=tool-field><span class=tool-label></span><input class=tool-input placeholder=100000></div></div><div class=tool-field><span class=tool-label></span><input class=tool-input></div><div class=tool-actions><button class="tool-btn is-primary"></button><button class="tool-btn is-ghost"></button><button class="tool-btn is-ghost"></button></div><!$><!/><details><summary style=cursor:pointer;color:var(--accent);font-size:14px></summary><pre class=tool-pre style=font-size:12px;white-space:pre-wrap></pre></details><p class=tool-hint>');function vl(){const[we,F]=r(Ee(),{equals:!1}),i=t=>rl(t,we());el(()=>{const t=u=>{const a=u.detail?.locale;a&&F(a)};window.addEventListener("taitan:locale-change",t),F(Ee()),sl(()=>window.removeEventListener("taitan:locale-change",t))});const[g,ze]=r(""),[h,Ne]=r(""),[C,Re]=r(""),[T,Le]=r(""),[E,Ae]=r(""),[y,ke]=r(""),[w,Oe]=r(""),[z,Ie]=r(""),[N,Ve]=r(""),[R,Me]=r(""),[L,Pe]=r(""),[A,De]=r(""),[k,Qe]=r("");function x(){const t=["BEGIN:VCARD","VERSION:3.0"],u=`${g()} ${h()}`.trim();return u&&t.push(`FN:${u}`),(h()||g())&&t.push(`N:${h()};${g()};;;`),C()&&t.push(`ORG:${C()}`),T()&&t.push(`TITLE:${T()}`),E()&&t.push(`EMAIL;TYPE=INTERNET:${E()}`),y()&&t.push(`TEL;TYPE=WORK,VOICE:${y()}`),w()&&t.push(`TEL;TYPE=CELL:${w()}`),z()&&t.push(`URL:${z()}`),(N()||R()||L()||A())&&t.push(`ADR;TYPE=WORK:;;${N()};${R()};;${A()};${L()}`),k()&&t.push(`NOTE:${k()}`),t.push(`REV:${new Date().toISOString()}`),t.push("END:VCARD"),t.join(`\r
`)}function Fe(t){const a=Array.from({length:25},()=>Array(25).fill(!1));function p(l,s){for(let $=0;$<7;$++)for(let v=0;v<7;v++){const _=$===0||$===6||v===0||v===6,S=$>=2&&$<=4&&v>=2&&v<=4;a[s+$][l+v]=_||S}}p(0,0),p(18,0),p(0,18);for(let l=8;l<17;l++)a[6][l]=l%2===0,a[l][6]=l%2===0;let o=0;for(let l=0;l<t.length;l++)o=(o<<5)-o+t.charCodeAt(l)|0;for(let l=9;l<17;l++)for(let s=9;s<24;s++)a[l][s]||(o=o<<3^o>>>2^s*7+l*13|0,a[l][s]=(o&1)===1);for(let l=0;l<25;l++)for(let s=8;s<17;s++)(l<8||l>=17)&&!a[l][s]&&l!==6&&(o=o<<2^o>>>3^s+l*3|0,a[l][s]=(o&1)===1);return a}function Xe(){const t=x(),u=Fe(t),a=4,p=u.length*a;let o=`<svg xmlns="http://www.w3.org/2000/svg" width="${p}" height="${p}" viewBox="0 0 ${p} ${p}">`;o+=`<rect width="${p}" height="${p}" fill="white"/>`;for(let l=0;l<u.length;l++)for(let s=0;s<u[l].length;s++)u[l][s]&&(o+=`<rect x="${s*a}" y="${l*a}" width="${a}" height="${a}" fill="black"/>`);return o+="</svg>",o}const[X,Ye]=r("");return(()=>{var t=Te(dl),u=t.firstChild,a=u.firstChild,p=a.firstChild,o=p.nextSibling,l=a.nextSibling,s=l.firstChild,$=s.nextSibling,v=u.nextSibling,_=v.firstChild,S=_.firstChild,Y=S.nextSibling,je=_.nextSibling,j=je.firstChild,O=j.nextSibling,W=v.nextSibling,q=W.firstChild,B=q.firstChild,G=B.nextSibling,We=q.nextSibling,H=We.firstChild,K=H.nextSibling,U=W.nextSibling,Z=U.firstChild,J=Z.firstChild,ee=J.nextSibling,qe=Z.nextSibling,le=qe.firstChild,te=le.nextSibling,ie=U.nextSibling,se=ie.firstChild,ne=se.firstChild,I=ne.nextSibling,Be=se.nextSibling,ae=Be.firstChild,V=ae.nextSibling,oe=ie.nextSibling,re=oe.firstChild,ce=re.firstChild,M=ce.nextSibling,Ge=re.nextSibling,de=Ge.firstChild,ue=de.nextSibling,pe=oe.nextSibling,$e=pe.firstChild,P=$e.nextSibling,ve=pe.nextSibling,D=ve.firstChild,Q=D.nextSibling,fe=Q.nextSibling,He=ve.nextSibling,[ge,Ke]=ll(He.nextSibling),he=ge.nextSibling,be=he.firstChild,Ue=be.nextSibling,Ze=he.nextSibling;return n(p,()=>i("名")),o.$$input=e=>ze(e.currentTarget.value),n(s,()=>i("姓")),$.$$input=e=>Ne(e.currentTarget.value),n(S,()=>i("公司/组织")),Y.$$input=e=>Re(e.currentTarget.value),n(j,()=>i("职位")),O.$$input=e=>Le(e.currentTarget.value),n(B,()=>i("邮箱")),G.$$input=e=>Ae(e.currentTarget.value),n(H,()=>i("网站")),K.$$input=e=>Ie(e.currentTarget.value),n(J,()=>i("工作电话")),ee.$$input=e=>ke(e.currentTarget.value),n(le,()=>i("手机")),te.$$input=e=>Oe(e.currentTarget.value),n(ne,()=>i("地址")),I.$$input=e=>Ve(e.currentTarget.value),n(ae,()=>i("城市")),V.$$input=e=>Me(e.currentTarget.value),n(ce,()=>i("国家")),M.$$input=e=>Pe(e.currentTarget.value),n(de,()=>i("邮编")),ue.$$input=e=>De(e.currentTarget.value),n($e,()=>i("备注")),P.$$input=e=>Qe(e.currentTarget.value),D.$$click=()=>al(x(),`${g()}${h()||"contact"}.vcf`,"text/vcard"),n(D,()=>i("下载 .vcf 文件")),Q.$$click=()=>ol(x()),n(Q,()=>i("复制 vCard 内容")),fe.$$click=()=>Ye(Xe()),n(fe,()=>i("生成 QR 码")),n(t,tl(nl,{get when(){return X()},get children(){var e=Te(cl),b=e.firstChild,m=b.nextSibling;return n(m,()=>i("vCard QR 码（示意图）")),c(()=>d(b,"innerHTML",X())),e}}),ge,Ke),n(be,()=>i("查看 vCard 源码")),n(Ue,x),n(Ze,()=>i("生成 vCard 3.0 格式电子名片，可导入手机通讯录或 Outlook 等邮件客户端。")),c(e=>{var b=i("小明"),m=i("张"),xe=i("工程师"),_e=i("XX路XX号"),Se=i("北京"),me=i("中国"),Ce=i("其他备注信息");return b!==e.e&&f(o,"placeholder",e.e=b),m!==e.t&&f($,"placeholder",e.t=m),xe!==e.a&&f(O,"placeholder",e.a=xe),_e!==e.o&&f(I,"placeholder",e.o=_e),Se!==e.i&&f(V,"placeholder",e.i=Se),me!==e.n&&f(M,"placeholder",e.n=me),Ce!==e.s&&f(P,"placeholder",e.s=Ce),e},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),c(()=>d(o,"value",g())),c(()=>d($,"value",h())),c(()=>d(Y,"value",C())),c(()=>d(O,"value",T())),c(()=>d(G,"value",E())),c(()=>d(K,"value",z())),c(()=>d(ee,"value",y())),c(()=>d(te,"value",w())),c(()=>d(I,"value",N())),c(()=>d(V,"value",R())),c(()=>d(M,"value",L())),c(()=>d(ue,"value",A())),c(()=>d(P,"value",k())),il(),t})()}Je(["input","click"]);export{vl as default};
