| 1 |
- import{W as D,J as z,a as O,r as g,B as C,R as q,X as G,w as V,o as Y,y,g as P,U as Q,A as ee,s as te,Y as ne,d as W,c as w,m as re}from"./index-b63c6ed2.js";function Je(){}const Ke=Object.assign,H=typeof window<"u",F=e=>e!==null&&typeof e=="object",m=e=>e!=null,x=e=>typeof e=="function",Xe=e=>F(e)&&x(e.then)&&x(e.catch),Ze=e=>Object.prototype.toString.call(e)==="[object Date]"&&!Number.isNaN(e.getTime()),U=e=>typeof e=="number"||/^\d+(\.\d+)?$/.test(e),oe=()=>H?/ios|iphone|ipad|ipod/.test(navigator.userAgent.toLowerCase()):!1;function T(e,t){const n=t.split(".");let r=e;return n.forEach(u=>{var s;r=F(r)&&(s=r[u])!=null?s:""}),r}function qe(e,t,n){return t.reduce((r,u)=>((!n||e[u]!==void 0)&&(r[u]=e[u]),r),{})}const Ge=(e,t)=>JSON.stringify(e)===JSON.stringify(t),Qe=e=>Array.isArray(e)?e:[e],et=null,E=[Number,String],ue={type:Boolean,default:!0},tt=e=>({type:e,required:!0}),nt=()=>({type:Array,default:()=>[]}),rt=e=>({type:Number,default:e}),ot=e=>({type:E,default:e}),A=e=>({type:String,default:e});var v=typeof window<"u",se=e=>e===window,$=(e,t)=>({top:0,left:0,right:e,bottom:t,width:e,height:t}),ut=e=>{const t=y(e);if(se(t)){const n=t.innerWidth,r=t.innerHeight;return $(n,r)}return t!=null&&t.getBoundingClientRect?t.getBoundingClientRect():$(0,0)};function st(e){const t=D(e,null);if(t){const n=P(),{link:r,unlink:u,internalChildren:s}=t;r(n),z(()=>u(n));const c=O(()=>s.indexOf(n));return{parent:t,index:c}}return{parent:null,index:g(-1)}}function ie(e){const t=[],n=r=>{Array.isArray(r)&&r.forEach(u=>{var s;ne(u)&&(t.push(u),(s=u.component)!=null&&s.subTree&&(t.push(u.component.subTree),n(u.component.subTree.children)),u.children&&n(u.children))})};return n(e),t}var k=(e,t)=>{const n=e.indexOf(t);return n===-1?e.findIndex(r=>t.key!==void 0&&t.key!==null&&r.type===t.type&&r.key===t.key):n};function ae(e,t,n){const r=ie(e.subTree.children);n.sort((s,c)=>k(r,s.vnode)-k(r,c.vnode));const u=n.map(s=>s.proxy);t.sort((s,c)=>{const o=u.indexOf(s),i=u.indexOf(c);return o-i})}function it(e){const t=C([]),n=C([]),r=P();return{children:t,linkChildren:s=>{Q(e,Object.assign({link:i=>{i.proxy&&(n.push(i),t.push(i.proxy),ae(r,t,n))},unlink:i=>{const a=n.indexOf(i);t.splice(a,1),n.splice(a,1)},children:t,internalChildren:n},s))}}}function ce(e){let t;Y(()=>{e(),ee(()=>{t=!0})}),te(()=>{t&&e()})}function le(e,t,n={}){if(!v)return;const{target:r=window,passive:u=!1,capture:s=!1}=n;let c=!1,o;const i=l=>{if(c)return;const d=y(l);d&&!o&&(d.addEventListener(e,t,{capture:s,passive:u}),o=!0)},a=l=>{if(c)return;const d=y(l);d&&o&&(d.removeEventListener(e,t,s),o=!1)};z(()=>a(r)),q(()=>a(r)),ce(()=>i(r));let p;return G(r)&&(p=V(r,(l,d)=>{a(d),i(l)})),()=>{p==null||p(),a(r),c=!0}}function at(e,t,n={}){if(!v)return;const{eventName:r="click"}=n;le(r,s=>{(Array.isArray(e)?e:[e]).every(i=>{const a=y(i);return a&&!a.contains(s.target)})&&t(s)},{target:document})}var h,b;function de(){if(!h&&(h=g(0),b=g(0),v)){const e=()=>{h.value=window.innerWidth,b.value=window.innerHeight};e(),window.addEventListener("resize",e,{passive:!0}),window.addEventListener("orientationchange",e,{passive:!0})}return{width:h,height:b}}var fe=/scroll|auto|overlay/i,J=v?window:void 0;function pe(e){return e.tagName!=="HTML"&&e.tagName!=="BODY"&&e.nodeType===1}function ge(e,t=J){let n=e;for(;n&&n!==t&&pe(n);){const{overflowY:r}=window.getComputedStyle(n);if(fe.test(r))return n;n=n.parentNode}return t}function ct(e,t=J){const n=g();return Y(()=>{e.value&&(n.value=ge(e.value,t))}),n}var me=Symbol("van-field");function lt(e){const t=D(me,null);t&&!t.customValue.value&&(t.customValue.value=e,V(e,()=>{t.resetValidation(),t.validateWithTrigger("onChange")}))}function dt(e){const t="scrollTop"in e?e.scrollTop:e.pageYOffset;return Math.max(t,0)}function R(e,t){"scrollTop"in e?e.scrollTop=t:e.scrollTo(e.scrollX,t)}function Ee(){return window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0}function he(e){R(window,e),R(document.body,e)}const ye=oe();function ft(){ye&&he(Ee())}const we=e=>e.stopPropagation();function pt(e,t){(typeof e.cancelable!="boolean"||e.cancelable)&&e.preventDefault(),t&&we(e)}const{width:ve,height:be}=de();function Be(e){const t=window.getComputedStyle(e);return t.transform!=="none"||t.perspective!=="none"||["transform","perspective","filter"].some(n=>(t.willChange||"").includes(n))}function gt(e){let t=e.parentElement;for(;t;){if(t&&t.tagName!=="HTML"&&t.tagName!=="BODY"&&Be(t))return t;t=t.parentElement}return null}function f(e){if(m(e))return U(e)?`${e}px`:String(e)}function mt(e){if(m(e)){if(Array.isArray(e))return{width:f(e[0]),height:f(e[1])};const t=f(e);return{width:t,height:t}}}function Et(e){const t={};return e!==void 0&&(t.zIndex=+e),t}let B;function Ce(){if(!B){const e=document.documentElement,t=e.style.fontSize||window.getComputedStyle(e).fontSize;B=parseFloat(t)}return B}function xe(e){return e=e.replace(/rem/g,""),+e*Ce()}function Ae(e){return e=e.replace(/vw/g,""),+e*ve.value/100}function Se(e){return e=e.replace(/vh/g,""),+e*be.value/100}function ht(e){if(typeof e=="number")return e;if(H){if(e.includes("rem"))return xe(e);if(e.includes("vw"))return Ae(e);if(e.includes("vh"))return Se(e)}return parseFloat(e)}const De=/-(\w)/g,K=e=>e.replace(De,(t,n)=>n.toUpperCase());function yt(e,t=2){let n=e+"";for(;n.length<t;)n="0"+n;return n}const wt=(e,t,n)=>Math.min(Math.max(e,t),n);function _(e,t,n){const r=e.indexOf(t);return r===-1?e:t==="-"&&r!==0?e.slice(0,r):e.slice(0,r+1)+e.slice(r).replace(n,"")}function vt(e,t=!0,n=!0){t?e=_(e,".",/\./g):e=e.split(".")[0],n?e=_(e,"-",/-/g):e=e.replace(/-/,"");const r=t?/[^-0-9.]/g:/[^-0-9]/g;return e.replace(r,"")}function bt(e,t){return Math.round((e+t)*1e10)/1e10}const{hasOwnProperty:Oe}=Object.prototype;function Pe(e,t,n){const r=t[n];m(r)&&(!Oe.call(e,n)||!F(r)?e[n]=r:e[n]=X(Object(e[n]),r))}function X(e,t){return Object.keys(t).forEach(n=>{Pe(e,t,n)}),e}var Fe={name:"姓名",tel:"电话",save:"保存",clear:"清空",cancel:"取消",confirm:"确认",delete:"删除",loading:"加载中...",noCoupon:"暂无优惠券",nameEmpty:"请填写姓名",addContact:"添加联系人",telInvalid:"请填写正确的电话",vanCalendar:{end:"结束",start:"开始",title:"日期选择",weekdays:["日","一","二","三","四","五","六"],monthTitle:(e,t)=>`${e}年${t}月`,rangePrompt:e=>`最多选择 ${e} 天`},vanCascader:{select:"请选择"},vanPagination:{prev:"上一页",next:"下一页"},vanPullRefresh:{pulling:"下拉即可刷新...",loosing:"释放即可刷新..."},vanSubmitBar:{label:"合计:"},vanCoupon:{unlimited:"无门槛",discount:e=>`${e}折`,condition:e=>`满${e}元可用`},vanCouponCell:{title:"优惠券",count:e=>`${e}张可用`},vanCouponList:{exchange:"兑换",close:"不使用",enable:"可用",disabled:"不可用",placeholder:"输入优惠码"},vanAddressEdit:{area:"地区",areaEmpty:"请选择地区",addressEmpty:"请填写详细地址",addressDetail:"详细地址",defaultAddress:"设为默认收货地址"},vanAddressList:{add:"新增地址"}};const I=g("zh-CN"),L=C({"zh-CN":Fe}),Ne={messages(){return L[I.value]},use(e,t){I.value=e,this.add({[e]:t})},add(e={}){X(L,e)}};var Te=Ne;function $e(e){const t=K(e)+".";return(n,...r)=>{const u=Te.messages(),s=T(u,t+n)||T(u,n);return x(s)?s(...r):s}}function S(e,t){return t?typeof t=="string"?` ${e}--${t}`:Array.isArray(t)?t.reduce((n,r)=>n+S(e,r),""):Object.keys(t).reduce((n,r)=>n+(t[r]?S(e,r):""),""):""}function ke(e){return(t,n)=>(t&&typeof t!="string"&&(n=t,t=""),t=t?`${e}__${t}`:e,`${t}${S(t,n)}`)}function N(e){const t=`van-${e}`;return[t,ke(t),$e(t)]}function Z(e){return e.install=t=>{const{name:n}=e;n&&(t.component(n,e),t.component(K(`-${n}`),e))},e}const Bt={to:[String,Object],url:String,replace:Boolean};function Re({to:e,url:t,replace:n,$router:r}){e&&r?r[n?"replace":"push"](e):t&&(n?location.replace(t):location.href=t)}function Ct(){const e=P().proxy;return()=>Re(e)}const[_e,M]=N("badge"),Ie={dot:Boolean,max:E,tag:A("div"),color:String,offset:Array,content:E,showZero:ue,position:A("top-right")};var Le=W({name:_e,props:Ie,setup(e,{slots:t}){const n=()=>{if(t.content)return!0;const{content:o,showZero:i}=e;return m(o)&&o!==""&&(i||o!==0&&o!=="0")},r=()=>{const{dot:o,max:i,content:a}=e;if(!o&&n())return t.content?t.content():m(i)&&U(a)&&+a>+i?`${i}+`:a},u=o=>o.startsWith("-")?o.replace("-",""):`-${o}`,s=O(()=>{const o={background:e.color};if(e.offset){const[i,a]=e.offset,{position:p}=e,[l,d]=p.split("-");t.default?(typeof a=="number"?o[l]=f(l==="top"?a:-a):o[l]=l==="top"?f(a):u(a),typeof i=="number"?o[d]=f(d==="left"?i:-i):o[d]=d==="left"?f(i):u(i)):(o.marginTop=f(a),o.marginLeft=f(i))}return o}),c=()=>{if(n()||e.dot)return w("div",{class:M([e.position,{dot:e.dot,fixed:!!t.default}]),style:s.value},[r()])};return()=>{if(t.default){const{tag:o}=e;return w(o,{class:M("wrapper")},{default:()=>[t.default(),c()]})}return c()}}});const Me=Z(Le),[je,xt]=N("config-provider"),ze=Symbol(je),[Ve,j]=N("icon"),Ye=e=>e==null?void 0:e.includes("/"),We={dot:Boolean,tag:A("i"),name:String,size:E,badge:E,color:String,badgeProps:Object,classPrefix:String};var He=W({name:Ve,props:We,setup(e,{slots:t}){const n=D(ze,null),r=O(()=>e.classPrefix||(n==null?void 0:n.iconPrefix)||j());return()=>{const{tag:u,dot:s,name:c,size:o,badge:i,color:a}=e,p=Ye(c);return w(Me,re({dot:s,tag:u,class:[r.value,p?"":`${r.value}-${c}`],style:{color:a,fontSize:f(o)},content:i},e.badgeProps),{default:()=>{var l;return[(l=t.default)==null?void 0:l.call(t),p&&w("img",{class:j("image"),src:c},null)]}})}}});const At=Z(He);export{wt as A,Me as B,tt as C,nt as D,le as E,ht as F,Ge as G,yt as H,At as I,Ze as J,ct as K,at as L,ut as M,be as N,gt as O,ve as P,ge as Q,dt as R,ce as S,rt as T,Xe as U,Ee as V,he as W,me as X,Qe as Y,Ct as a,st as b,N as c,et as d,Ke as e,A as f,Et as g,f as h,F as i,Je as j,x as k,H as l,ot as m,E as n,mt as o,qe as p,lt as q,Bt as r,vt as s,ue as t,it as u,m as v,Z as w,ft as x,pt as y,bt as z};
|