index-e9453d64.js 9.8 KB

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