import{k as Y,j as c,t as B,m as g,n as $,p as t,f as R,i as T,v as G,A as b,w as O,x as Q,s as V,S as A}from"./web.Os7kOAdY.js";import{g as L,t as X}from"./i18n-runtime._BAkvU05.js";var ee=b('<div style="border:1px solid var(--border);border-radius:8px;padding:20px;margin-bottom:16px"><div style=display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:16px><div><p style=margin:0;font-size:12px;color:var(--text-2)></p><p style="margin:4px 0 0;font-size:16px;font-weight:bold;font-family:monospace"></p></div><div><p style=margin:0;font-size:12px;color:var(--text-2)></p><p style="margin:4px 0 0;font-size:18px;font-weight:bold"></p></div><div><p style=margin:0;font-size:12px;color:var(--text-2)></p><p style="margin:4px 0 0;font-size:14px;color:var(--text-2)"><!$><!/><!$><!/>"'),te=b('<div class=tool-container><div style=display:flex;gap:12px;margin-bottom:16px;flex-wrap:wrap;align-items:center><input class=tool-input style=flex:1;min-width:200px><button class=tool-btn></button></div><!$><!/><div style="border:1px solid var(--border);border-radius:8px;padding:16px"><h4 style="margin:0 0 12px;font-size:14px"></h4><div style=display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:8px;font-size:13px>'),ne=b('<div style="border:1px solid var(--border);border-radius:8px;padding:20px;text-align:center"><p style=margin:0;color:var(--text-2)>'),re=b('<div style="display:flex;justify-content:space-between;padding:4px 8px;background:var(--bg-2,#f8f8f8);border-radius:4px"><span></span><span style=color:var(--text-2);font-family:monospace><!$><!/>***');const y=[{name:"顺丰",fullName:"顺丰速运",pattern:"SF"},{name:"圆通",fullName:"圆通速递",pattern:"YT"},{name:"中通",fullName:"中通快递",pattern:"75"},{name:"韵达",fullName:"韵达快递",pattern:"31"},{name:"申通",fullName:"申通快递",pattern:"77"},{name:"百世",fullName:"百世快递",pattern:"70"},{name:"EMS",fullName:"中国邮政EMS",pattern:"E"},{name:"邮政",fullName:"中国邮政包裹",pattern:"99"},{name:"京东",fullName:"京东物流",pattern:"JD"},{name:"极兔",fullName:"极兔速递",pattern:"JT"},{name:"德邦",fullName:"德邦快递",pattern:"DPK"},{name:"天天",fullName:"天天快递",pattern:"66"},{name:"宅急送",fullName:"宅急送",pattern:"ZJS"},{name:"中铁",fullName:"中铁快运",pattern:"CR"}];function le(_){const s=_.trim().toUpperCase();if(!s)return null;const l=y.filter(e=>/[A-Z]/.test(e.pattern)).sort((e,i)=>i.pattern.length-e.pattern.length);for(const e of l)if(s.startsWith(e.pattern))return e;const p=y.filter(e=>/^\d+$/.test(e.pattern)).sort((e,i)=>i.pattern.length-e.pattern.length);for(const e of p)if(s.startsWith(e.pattern))return e;return null}function se(){const[_,s]=c(L(),{equals:!1}),l=r=>X(r,_());B(()=>{const r=x=>{const a=x.detail?.locale;a&&s(a)};window.addEventListener("taitan:locale-change",r),s(L()),V(()=>window.removeEventListener("taitan:locale-change",r))});const[p,e]=c(""),[i,M]=c(null),[P,J]=c(!1);function S(){const r=p().trim();r&&(J(!0),M(le(r)))}return(()=>{var r=g(te),x=r.firstChild,a=x.firstChild,C=a.nextSibling,j=x.nextSibling,[N,D]=$(j.nextSibling),W=N.nextSibling,w=W.firstChild,Z=w.nextSibling;return a.$$keydown=n=>n.key==="Enter"&&S(),a.$$input=n=>e(n.currentTarget.value),C.$$click=S,t(C,()=>l("识别快递公司")),t(r,R(A,{get when(){return P()},get children(){return R(A,{get when(){return i()},get fallback(){return(()=>{var n=g(ne),o=n.firstChild;return t(o,()=>l("无法识别快递公司，请检查单号是否正确。")),n})()},get children(){var n=g(ee),o=n.firstChild,d=o.firstChild,f=d.firstChild,v=f.nextSibling,m=d.nextSibling,u=m.firstChild,q=u.nextSibling,F=m.nextSibling,k=F.firstChild,h=k.nextSibling,H=h.firstChild,[E,I]=$(H.nextSibling),K=E.nextSibling,[z,U]=$(K.nextSibling);return z.nextSibling,t(f,()=>l("快递单号")),t(v,()=>p().trim()),t(u,()=>l("快递公司")),t(q,()=>i().fullName),t(k,()=>l("匹配规则")),t(h,()=>l('前缀 "'),E,I),t(h,()=>i().pattern,z,U),n}})}}),N,D),t(w,()=>l("支持识别的快递公司：")),t(Z,()=>y.map(n=>(()=>{var o=g(re),d=o.firstChild,f=d.nextSibling,v=f.firstChild,[m,u]=$(v.nextSibling);return m.nextSibling,t(d,()=>n.fullName),t(f,()=>n.pattern,m,u),o})())),T(()=>O(a,"placeholder",l("输入快递单号..."))),T(()=>Q(a,"value",p())),G(),r})()}Y(["input","keydown","click"]);export{se as default};
