12345 |
- import{r as U,w as Q,c as ye,d as ge,y as be,au as Oe,av as xe,f as Ee,a as D,R as Se,h as Re,af as Pe,F as ke,m as F,ac as De,n as Ae,t as X,a6 as Le,z as Ce,aw as oe,ax as je,ad as Me,I as Te,ay as Ie,k as Ne}from"./index-869d77fb.js";const Be=(e,t)=>{const r=U(e());return Q(e,n=>{n!==r.value&&(r.value=n)}),Q(r,n=>{n!==e()&&t(n)}),r};function S(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function te(e){var t=S(e).Element;return e instanceof t||e instanceof Element}function E(e){var t=S(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function ue(e){if(typeof ShadowRoot>"u")return!1;var t=S(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}var B=Math.round;function Z(){var e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function qe(){return!/^((?!chrome|android).)*safari/i.test(Z())}function z(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!1);var n=e.getBoundingClientRect(),o=1,a=1;t&&E(e)&&(o=e.offsetWidth>0&&B(n.width)/e.offsetWidth||1,a=e.offsetHeight>0&&B(n.height)/e.offsetHeight||1);var f=te(e)?S(e):window,c=f.visualViewport,i=!qe()&&r,u=(n.left+(i&&c?c.offsetLeft:0))/o,s=(n.top+(i&&c?c.offsetTop:0))/a,v=n.width/o,x=n.height/a;return{width:v,height:x,top:s,right:u+v,bottom:s+x,left:u,x:u,y:s}}function pe(e){var t=S(e),r=t.pageXOffset,n=t.pageYOffset;return{scrollLeft:r,scrollTop:n}}function We(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function Ve(e){return e===S(e)||!E(e)?pe(e):We(e)}function P(e){return e?(e.nodeName||"").toLowerCase():null}function J(e){return((te(e)?e.ownerDocument:e.document)||window.document).documentElement}function He(e){return z(J(e)).left+pe(e).scrollLeft}function k(e){return S(e).getComputedStyle(e)}function re(e){var t=k(e),r=t.overflow,n=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(r+o+n)}function Fe(e){var t=e.getBoundingClientRect(),r=B(t.width)/e.offsetWidth||1,n=B(t.height)/e.offsetHeight||1;return r!==1||n!==1}function Xe(e,t,r){r===void 0&&(r=!1);var n=E(t),o=E(t)&&Fe(t),a=J(t),f=z(e,o,r),c={scrollLeft:0,scrollTop:0},i={x:0,y:0};return(n||!n&&!r)&&((P(t)!=="body"||re(a))&&(c=Ve(t)),E(t)?(i=z(t,!0),i.x+=t.clientLeft,i.y+=t.clientTop):a&&(i.x=He(a))),{x:f.left+c.scrollLeft-i.x,y:f.top+c.scrollTop-i.y,width:f.width,height:f.height}}function Ye(e){var t=z(e),r=e.offsetWidth,n=e.offsetHeight;return Math.abs(t.width-r)<=1&&(r=t.width),Math.abs(t.height-n)<=1&&(n=t.height),{x:e.offsetLeft,y:e.offsetTop,width:r,height:n}}function ne(e){return P(e)==="html"?e:e.assignedSlot||e.parentNode||(ue(e)?e.host:null)||J(e)}function ve(e){return["html","body","#document"].indexOf(P(e))>=0?e.ownerDocument.body:E(e)&&re(e)?e:ve(ne(e))}function $(e,t){var r;t===void 0&&(t=[]);var n=ve(e),o=n===((r=e.ownerDocument)==null?void 0:r.body),a=S(n),f=o?[a].concat(a.visualViewport||[],re(n)?n:[]):n,c=t.concat(f);return o?c:c.concat($(ne(f)))}function Ue(e){return["table","td","th"].indexOf(P(e))>=0}function ae(e){return!E(e)||k(e).position==="fixed"?null:e.offsetParent}function $e(e){var t=/firefox/i.test(Z()),r=/Trident/i.test(Z());if(r&&E(e)){var n=k(e);if(n.position==="fixed")return null}var o=ne(e);for(ue(o)&&(o=o.host);E(o)&&["html","body"].indexOf(P(o))<0;){var a=k(o);if(a.transform!=="none"||a.perspective!=="none"||a.contain==="paint"||["transform","perspective"].indexOf(a.willChange)!==-1||t&&a.willChange==="filter"||t&&a.filter&&a.filter!=="none")return o;o=o.parentNode}return null}function de(e){for(var t=S(e),r=ae(e);r&&Ue(r)&&k(r).position==="static";)r=ae(r);return r&&(P(r)==="html"||P(r)==="body"&&k(r).position==="static")?t:r||$e(e)||t}var N="top",_="bottom",H="right",M="left",he="auto",ze=[N,_,H,M],me="start",G="end",_e=[].concat(ze,[he]).reduce(function(e,t){return e.concat([t,t+"-"+me,t+"-"+G])},[]),Ge="beforeRead",Je="read",Ke="afterRead",Qe="beforeMain",Ze="main",et="afterMain",tt="beforeWrite",rt="write",nt="afterWrite",ee=[Ge,Je,Ke,Qe,Ze,et,tt,rt,nt];function ot(e){var t=new Map,r=new Set,n=[];e.forEach(function(a){t.set(a.name,a)});function o(a){r.add(a.name);var f=[].concat(a.requires||[],a.requiresIfExists||[]);f.forEach(function(c){if(!r.has(c)){var i=t.get(c);i&&o(i)}}),n.push(a)}return e.forEach(function(a){r.has(a.name)||o(a)}),n}function at(e){var t=ot(e);return ee.reduce(function(r,n){return r.concat(t.filter(function(o){return o.phase===n}))},[])}function it(e){var t;return function(){return t||(t=new Promise(function(r){Promise.resolve().then(function(){t=void 0,r(e())})})),t}}function A(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return[].concat(r).reduce(function(o,a){return o.replace(/%s/,a)},e)}var C='Popper: modifier "%s" provided an invalid %s property, expected %s but got %s',st='Popper: modifier "%s" requires "%s", but "%s" modifier is not available',ie=["name","enabled","phase","fn","effect","requires","options"];function ct(e){e.forEach(function(t){[].concat(Object.keys(t),ie).filter(function(r,n,o){return o.indexOf(r)===n}).forEach(function(r){switch(r){case"name":typeof t.name!="string"&&console.error(A(C,String(t.name),'"name"','"string"','"'+String(t.name)+'"'));break;case"enabled":typeof t.enabled!="boolean"&&console.error(A(C,t.name,'"enabled"','"boolean"','"'+String(t.enabled)+'"'));break;case"phase":ee.indexOf(t.phase)<0&&console.error(A(C,t.name,'"phase"',"either "+ee.join(", "),'"'+String(t.phase)+'"'));break;case"fn":typeof t.fn!="function"&&console.error(A(C,t.name,'"fn"','"function"','"'+String(t.fn)+'"'));break;case"effect":t.effect!=null&&typeof t.effect!="function"&&console.error(A(C,t.name,'"effect"','"function"','"'+String(t.fn)+'"'));break;case"requires":t.requires!=null&&!Array.isArray(t.requires)&&console.error(A(C,t.name,'"requires"','"array"','"'+String(t.requires)+'"'));break;case"requiresIfExists":Array.isArray(t.requiresIfExists)||console.error(A(C,t.name,'"requiresIfExists"','"array"','"'+String(t.requiresIfExists)+'"'));break;case"options":case"data":break;default:console.error('PopperJS: an invalid property has been provided to the "'+t.name+'" modifier, valid properties are '+ie.map(function(n){return'"'+n+'"'}).join(", ")+'; but "'+r+'" was provided.')}t.requires&&t.requires.forEach(function(n){e.find(function(o){return o.name===n})==null&&console.error(A(st,String(t.name),n,n))})})})}function ft(e,t){var r=new Set;return e.filter(function(n){var o=t(n);if(!r.has(o))return r.add(o),!0})}function K(e){return e.split("-")[0]}function lt(e){var t=e.reduce(function(r,n){var o=r[n.name];return r[n.name]=o?Object.assign({},o,n,{options:Object.assign({},o.options,n.options),data:Object.assign({},o.data,n.data)}):n,r},{});return Object.keys(t).map(function(r){return t[r]})}function we(e){return e.split("-")[1]}function ut(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function pt(e){var t=e.reference,r=e.element,n=e.placement,o=n?K(n):null,a=n?we(n):null,f=t.x+t.width/2-r.width/2,c=t.y+t.height/2-r.height/2,i;switch(o){case N:i={x:f,y:t.y-r.height};break;case _:i={x:f,y:t.y+t.height};break;case H:i={x:t.x+t.width,y:c};break;case M:i={x:t.x-r.width,y:c};break;default:i={x:t.x,y:t.y}}var u=o?ut(o):null;if(u!=null){var s=u==="y"?"height":"width";switch(a){case me:i[u]=i[u]-(t[s]/2-r[s]/2);break;case G:i[u]=i[u]+(t[s]/2-r[s]/2);break}}return i}var se="Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.",vt="Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.",ce={placement:"bottom",modifiers:[],strategy:"absolute"};function fe(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return!t.some(function(n){return!(n&&typeof n.getBoundingClientRect=="function")})}function dt(e){e===void 0&&(e={});var t=e,r=t.defaultModifiers,n=r===void 0?[]:r,o=t.defaultOptions,a=o===void 0?ce:o;return function(c,i,u){u===void 0&&(u=a);var s={placement:"bottom",orderedModifiers:[],options:Object.assign({},ce,a),modifiersData:{},elements:{reference:c,popper:i},attributes:{},styles:{}},v=[],x=!1,d={state:s,setOptions:function(g){var l=typeof g=="function"?g(s.options):g;y(),s.options=Object.assign({},a,s.options,l),s.scrollParents={reference:te(c)?$(c):c.contextElement?$(c.contextElement):[],popper:$(i)};var h=at(lt([].concat(n,s.options.modifiers)));s.orderedModifiers=h.filter(function(O){return O.enabled});{var b=ft([].concat(h,s.options.modifiers),function(O){var I=O.name;return I});if(ct(b),K(s.options.placement)===he){var m=s.orderedModifiers.find(function(O){var I=O.name;return I==="flip"});m||console.error(['Popper: "auto" placements require the "flip" modifier be',"present and enabled to work."].join(" "))}var p=k(i),R=p.marginTop,L=p.marginRight,q=p.marginBottom,W=p.marginLeft;[R,L,q,W].some(function(O){return parseFloat(O)})&&console.warn(['Popper: CSS "margin" styles cannot be used to apply padding',"between the popper and its reference element or boundary.","To replicate margin, use the `offset` modifier, as well as","the `padding` option in the `preventOverflow` and `flip`","modifiers."].join(" "))}return T(),d.update()},forceUpdate:function(){if(!x){var g=s.elements,l=g.reference,h=g.popper;if(!fe(l,h)){console.error(se);return}s.rects={reference:Xe(l,de(h),s.options.strategy==="fixed"),popper:Ye(h)},s.reset=!1,s.placement=s.options.placement,s.orderedModifiers.forEach(function(O){return s.modifiersData[O.name]=Object.assign({},O.data)});for(var b=0,m=0;m<s.orderedModifiers.length;m++){if(b+=1,b>100){console.error(vt);break}if(s.reset===!0){s.reset=!1,m=-1;continue}var p=s.orderedModifiers[m],R=p.fn,L=p.options,q=L===void 0?{}:L,W=p.name;typeof R=="function"&&(s=R({state:s,options:q,name:W,instance:d})||s)}}},update:it(function(){return new Promise(function(w){d.forceUpdate(),w(s)})}),destroy:function(){y(),x=!0}};if(!fe(c,i))return console.error(se),d;d.setOptions(u).then(function(w){!x&&u.onFirstUpdate&&u.onFirstUpdate(w)});function T(){s.orderedModifiers.forEach(function(w){var g=w.name,l=w.options,h=l===void 0?{}:l,b=w.effect;if(typeof b=="function"){var m=b({state:s,name:g,instance:d,options:h}),p=function(){};v.push(m||p)}})}function y(){v.forEach(function(w){return w()}),v=[]}return d}}var Y={passive:!0};function ht(e){var t=e.state,r=e.instance,n=e.options,o=n.scroll,a=o===void 0?!0:o,f=n.resize,c=f===void 0?!0:f,i=S(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&u.forEach(function(s){s.addEventListener("scroll",r.update,Y)}),c&&i.addEventListener("resize",r.update,Y),function(){a&&u.forEach(function(s){s.removeEventListener("scroll",r.update,Y)}),c&&i.removeEventListener("resize",r.update,Y)}}var mt={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:ht,data:{}};function wt(e){var t=e.state,r=e.name;t.modifiersData[r]=pt({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}var yt={name:"popperOffsets",enabled:!0,phase:"read",fn:wt,data:{}},gt={top:"auto",right:"auto",bottom:"auto",left:"auto"};function bt(e){var t=e.x,r=e.y,n=window,o=n.devicePixelRatio||1;return{x:B(t*o)/o||0,y:B(r*o)/o||0}}function le(e){var t,r=e.popper,n=e.popperRect,o=e.placement,a=e.variation,f=e.offsets,c=e.position,i=e.gpuAcceleration,u=e.adaptive,s=e.roundOffsets,v=e.isFixed,x=f.x,d=x===void 0?0:x,T=f.y,y=T===void 0?0:T,w=typeof s=="function"?s({x:d,y}):{x:d,y};d=w.x,y=w.y;var g=f.hasOwnProperty("x"),l=f.hasOwnProperty("y"),h=M,b=N,m=window;if(u){var p=de(r),R="clientHeight",L="clientWidth";if(p===S(r)&&(p=J(r),k(p).position!=="static"&&c==="absolute"&&(R="scrollHeight",L="scrollWidth")),p=p,o===N||(o===M||o===H)&&a===G){b=_;var q=v&&p===m&&m.visualViewport?m.visualViewport.height:p[R];y-=q-n.height,y*=i?1:-1}if(o===M||(o===N||o===_)&&a===G){h=H;var W=v&&p===m&&m.visualViewport?m.visualViewport.width:p[L];d-=W-n.width,d*=i?1:-1}}var O=Object.assign({position:c},u&>),I=s===!0?bt({x:d,y}):{x:d,y};if(d=I.x,y=I.y,i){var V;return Object.assign({},O,(V={},V[b]=l?"0":"",V[h]=g?"0":"",V.transform=(m.devicePixelRatio||1)<=1?"translate("+d+"px, "+y+"px)":"translate3d("+d+"px, "+y+"px, 0)",V))}return Object.assign({},O,(t={},t[b]=l?y+"px":"",t[h]=g?d+"px":"",t.transform="",t))}function Ot(e){var t=e.state,r=e.options,n=r.gpuAcceleration,o=n===void 0?!0:n,a=r.adaptive,f=a===void 0?!0:a,c=r.roundOffsets,i=c===void 0?!0:c;{var u=k(t.elements.popper).transitionProperty||"";f&&["transform","top","right","bottom","left"].some(function(v){return u.indexOf(v)>=0})&&console.warn(["Popper: Detected CSS transitions on at least one of the following",'CSS properties: "transform", "top", "right", "bottom", "left".',`
- `,'Disable the "computeStyles" modifier\'s `adaptive` option to allow',"for smooth transitions, or remove these properties from the CSS","transition declaration on the popper element if only transitioning","opacity or background-color for example.",`
- `,"We recommend using the popper element as a wrapper around an inner","element that can have any CSS property transitioned for animations."].join(" "))}var s={placement:K(t.placement),variation:we(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,le(Object.assign({},s,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:f,roundOffsets:i})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,le(Object.assign({},s,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:i})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}var xt={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Ot,data:{}};function Et(e){var t=e.state;Object.keys(t.elements).forEach(function(r){var n=t.styles[r]||{},o=t.attributes[r]||{},a=t.elements[r];!E(a)||!P(a)||(Object.assign(a.style,n),Object.keys(o).forEach(function(f){var c=o[f];c===!1?a.removeAttribute(f):a.setAttribute(f,c===!0?"":c)}))})}function St(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow),function(){Object.keys(t.elements).forEach(function(n){var o=t.elements[n],a=t.attributes[n]||{},f=Object.keys(t.styles.hasOwnProperty(n)?t.styles[n]:r[n]),c=f.reduce(function(i,u){return i[u]="",i},{});!E(o)||!P(o)||(Object.assign(o.style,c),Object.keys(a).forEach(function(i){o.removeAttribute(i)}))})}}var Rt={name:"applyStyles",enabled:!0,phase:"write",fn:Et,effect:St,requires:["computeStyles"]},Pt=[mt,yt,xt,Rt],kt=dt({defaultModifiers:Pt});function Dt(e,t,r){var n=K(e),o=[M,N].indexOf(n)>=0?-1:1,a=typeof r=="function"?r(Object.assign({},t,{placement:e})):r,f=a[0],c=a[1];return f=f||0,c=(c||0)*o,[M,H].indexOf(n)>=0?{x:c,y:f}:{x:f,y:c}}function At(e){var t=e.state,r=e.options,n=e.name,o=r.offset,a=o===void 0?[0,0]:o,f=_e.reduce(function(s,v){return s[v]=Dt(v,t.rects,a),s},{}),c=f[t.placement],i=c.x,u=c.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=i,t.modifiersData.popperOffsets.y+=u),t.modifiersData[n]=f}var Lt={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:At};const[Ct,j]=ye("popover"),jt=["overlay","duration","teleport","overlayStyle","overlayClass","closeOnClickOverlay"],Mt={show:Boolean,theme:F("light"),overlay:Boolean,actions:De(),actionsDirection:F("vertical"),trigger:F("click"),duration:Ae,showArrow:X,placement:F("bottom"),iconPrefix:String,overlayClass:Le,overlayStyle:Object,closeOnClickAction:X,closeOnClickOverlay:X,closeOnClickOutside:X,offset:{type:Array,default:()=>[0,8]},teleport:{type:[String,Object],default:"body"}};var Tt=ge({name:Ct,props:Mt,emits:["select","touchstart","update:show"],setup(e,{emit:t,slots:r,attrs:n}){let o;const a=U(),f=U(),c=U(),i=Be(()=>e.show,l=>t("update:show",l)),u=()=>({placement:e.placement,modifiers:[{name:"computeStyles",options:{adaptive:!1,gpuAcceleration:!1}},Me({},Lt,{options:{offset:e.offset}})]}),s=()=>f.value&&c.value?kt(f.value,c.value.popupRef.value,u()):null,v=()=>{Ce(()=>{i.value&&(o?o.setOptions(u()):(o=s(),oe&&(window.addEventListener("animationend",v),window.addEventListener("transitionend",v))))})},x=l=>{i.value=l},d=()=>{e.trigger==="click"&&(i.value=!i.value)},T=(l,h)=>{l.disabled||(t("select",l,h),e.closeOnClickAction&&(i.value=!1))},y=()=>{i.value&&e.closeOnClickOutside&&(!e.overlay||e.closeOnClickOverlay)&&(i.value=!1)},w=(l,h)=>r.action?r.action({action:l,index:h}):[l.icon&&D(Te,{name:l.icon,classPrefix:e.iconPrefix,class:j("action-icon")},null),D("div",{class:[j("action-text"),{[Ie]:e.actionsDirection==="vertical"}]},[l.text])],g=(l,h)=>{const{icon:b,color:m,disabled:p,className:R}=l;return D("div",{role:"menuitem",class:[j("action",{disabled:p,"with-icon":b}),{[je]:e.actionsDirection==="horizontal"},R],style:{color:m},tabindex:p?void 0:0,"aria-disabled":p||void 0,onClick:()=>T(l,h)},[w(l,h)])};return be(()=>{v(),Oe(()=>{var l;a.value=(l=c.value)==null?void 0:l.popupRef.value})}),xe(()=>{o&&(oe&&(window.removeEventListener("animationend",v),window.removeEventListener("transitionend",v)),o.destroy(),o=null)}),Q(()=>[i.value,e.offset,e.placement],v),Ee([f,a],y,{eventName:"touchstart"}),()=>{var l;return D(ke,null,[D("span",{ref:f,class:j("wrapper"),onClick:d},[(l=r.reference)==null?void 0:l.call(r)]),D(Se,Re({ref:c,show:i.value,class:j([e.theme]),position:"",transition:"van-popover-zoom",lockScroll:!1,"onUpdate:show":x},n,Pe(e,jt)),{default:()=>[e.showArrow&&D("div",{class:j("arrow")},null),D("div",{role:"menu",class:j("content",e.actionsDirection)},[r.default?r.default():e.actions.map(g)])]})])}}});const Nt=Ne(Tt);export{Nt as P};
|