You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
paopao-ce/web/dist/assets/vueuc-5-iSHcg-.js

2 lines
24 KiB

import{a as q,o as ue}from"./evtd-9ZCiDXyn.js";import{A as He,F as Se,C as Ve,d as C,p as Xe,g as Te,i as ce,H as I,G as ee,P as ze,N as Z,c as _,h as A,X as Ye,b as K,E as U,n as Ee,u as Ae,I as De,J as Ne,O as _e}from"./@vue-M2CzPUka.js";import{u as te}from"./@css-render-nQ5vzMKz.js";import{h as Pe,u as ae,o as je,i as Ue}from"./vooks-RlHpQsWY.js";import{z as qe}from"./vdirs-gz97tqc5.js";import{R as Ke}from"./@juggle--NVrOerG.js";import{C as Ge}from"./css-render-Adblu2bf.js";let R=[];const Fe=new WeakMap;function Je(){R.forEach(n=>n(...Fe.get(n))),R=[]}function Be(n,...e){Fe.set(n,e),!R.includes(n)&&R.push(n)===1&&requestAnimationFrame(Je)}function Qe(n){return n.composedPath()[0]||null}function he(n){return typeof n=="string"?n.endsWith("px")?Number(n.slice(0,n.length-2)):Number(n):n}function G(n){if(n!=null)return typeof n=="number"?`${n}px`:n.endsWith("px")?n:`${n}px`}function Ze(n=8){return Math.random().toString(16).slice(2,2+n)}function de(n,e,t="default"){const r=e[t];if(r===void 0)throw new Error(`[vueuc/${n}]: slot[${t}] is empty.`);return r()}function fe(n,e=!0,t=[]){return n.forEach(r=>{if(r!==null){if(typeof r!="object"){(typeof r=="string"||typeof r=="number")&&t.push(He(String(r)));return}if(Array.isArray(r)){fe(r,e,t);return}if(r.type===Se){if(r.children===null)return;Array.isArray(r.children)&&fe(r.children,e,t)}else r.type!==Ve&&t.push(r)}}),t}function pe(n,e,t="default"){const r=e[t];if(r===void 0)throw new Error(`[vueuc/${n}]: slot[${t}] is empty.`);const o=fe(r());if(o.length===1)return o[0];throw new Error(`[vueuc/${n}]: slot[${t}] should have exactly one child.`)}let X=null;function Ie(){if(X===null&&(X=document.getElementById("v-binder-view-measurer"),X===null)){X=document.createElement("div"),X.id="v-binder-view-measurer";const{style:n}=X;n.position="fixed",n.left="0",n.right="0",n.top="0",n.bottom="0",n.pointerEvents="none",n.visibility="hidden",document.body.appendChild(X)}return X.getBoundingClientRect()}function Re(n,e){const t=Ie();return{top:e,left:n,height:0,width:0,right:t.width-n,bottom:t.height-e}}function ie(n){const e=n.getBoundingClientRect(),t=Ie();return{left:e.left-t.left,top:e.top-t.top,bottom:t.height+t.top-e.bottom,right:t.width+t.left-e.right,width:e.width,height:e.height}}function et(n){return n.nodeType===9?null:n.parentNode}function Oe(n){if(n===null)return null;const e=et(n);if(e===null)return null;if(e.nodeType===9)return document;if(e.nodeType===1){const{overflow:t,overflowX:r,overflowY:o}=getComputedStyle(e);if(/(auto|scroll|overlay)/.test(t+o+r))return e}return Oe(e)}const tt=C({name:"Binder",props:{syncTargetWithParent:Boolean,syncTarget:{type:Boolean,default:!0}},setup(n){var e;Xe("VBinder",(e=Te())===null||e===void 0?void 0:e.proxy);const t=ce("VBinder",null),r=I(null),o=i=>{r.value=i,t&&n.syncTargetWithParent&&t.setTargetRef(i)};let l=[];const v=()=>{let i=r.value;for(;i=Oe(i),i!==null;)l.push(i);for(const y of l)ue("scroll",y,M,!0)},m=()=>{for(const i of l)q("scroll",i,M,!0);l=[]},d=new Set,g=i=>{d.size===0&&v(),d.has(i)||d.add(i)},w=i=>{d.has(i)&&d.delete(i),d.size===0&&m()},M=()=>{Be(a)},a=()=>{d.forEach(i=>i())},c=new Set,p=i=>{c.size===0&&ue("resize",window,s),c.has(i)||c.add(i)},h=i=>{c.has(i)&&c.delete(i),c.size===0&&q("resize",window,s)},s=()=>{c.forEach(i=>i())};return ee(()=>{q("resize",window,s),m()}),{targetRef:r,setTargetRef:o,addScrollListener:g,removeScrollListener:w,addResizeListener:p,removeResizeListener:h}},render(){return de("binder",this.$slots)}}),St=tt,Tt=C({name:"Target",setup(){const{setTargetRef:n,syncTarget:e}=ce("VBinder");return{syncTarget:e,setTargetDirective:{mounted:n,updated:n}}},render(){const{syncTarget:n,setTargetDirective:e}=this;return n?ze(pe("follower",this.$slots),[[e]]):pe("follower",this.$slots)}});function me(n,e){console.error(`[vueuc/${n}]: ${e}`)}const{c:O}=Ge(),ne="vueuc-style";function ve(n){return n&-n}class nt{constructor(e,t){this.l=e,this.min=t;const r=new Array(e+1);for(let o=0;o<e+1;++o)r[o]=0;this.ft=r}add(e,t){if(t===0)return;const{l:r,ft:o}=this;for(e+=1;e<=r;)o[e]+=t,e+=ve(e)}get(e){return this.sum(e+1)-this.sum(e)}sum(e){if(e===void 0&&(e=this.l),e<=0)return 0;const{ft:t,min:r,l:o}=this;if(e>o)throw new Error("[FinweckTree.sum]: `i` is larger than length.");let l=e*r;for(;e>0;)l+=t[e],e-=ve(e);return l}getBound(e){let t=0,r=this.l;for(;r>t;){const o=Math.floor((t+r)/2),l=this.sum(o);if(l>e){r=o;continue}else if(l<e){if(t===o)return this.sum(t+1)<=e?t+1:o;t=o}else return o}return t}}function be(n){return typeof n=="string"?document.querySelector(n):n()}const rt=C({name:"LazyTeleport",props:{to:{type:[String,Object],default:void 0},disabled:Boolean,show:{type:Boolean,required:!0}},setup(n){return{showTeleport:Pe(Z(n,"show")),mergedTo:_(()=>{const{to:e}=n;return e??"body"})}},render(){return this.showTeleport?this.disabled?de("lazy-teleport",this.$slots):A(Ye,{disabled:this.disabled,to:this.mergedTo},de("lazy-teleport",this.$slots)):null}}),J={top:"bottom",bottom:"top",left:"right",right:"left"},ge={start:"end",center:"center",end:"start"},le={top:"height",bottom:"height",left:"width",right:"width"},ot={"bottom-start":"top left",bottom:"top center","bottom-end":"top right","top-start":"bottom left",top:"bottom center","top-end":"bottom right","right-start":"top left",right:"center left","right-end":"bottom left","left-start":"top right",left:"center right","left-end":"bottom right"},it={"bottom-start":"bottom left",bottom:"bottom center","bottom-end":"bottom right","top-start":"top left",top:"top center","top-end":"top right","right-start":"top right",right:"center right","right-end":"bottom right","left-start":"top left",left:"center left","left-end":"bottom left"},lt={"bottom-start":"right","bottom-end":"left","top-start":"right","top-end":"left","right-start":"bottom","right-end":"top","left-start":"bottom","left-end":"top"},we={top:!0,bottom:!1,left:!0,right:!1},ye={top:"end",bottom:"start",left:"end",right:"start"};function st(n,e,t,r,o,l){if(!o||l)return{placement:n,top:0,left:0};const[v,m]=n.split("-");let d=m??"center",g={top:0,left:0};const w=(c,p,h)=>{let s=0,i=0;const y=t[c]-e[p]-e[c];return y>0&&r&&(h?i=we[p]?y:-y:s=we[p]?y:-y),{left:s,top:i}},M=v==="left"||v==="right";if(d!=="center"){const c=lt[n],p=J[c],h=le[c];if(t[h]>e[h]){if(e[c]+e[h]<t[h]){const s=(t[h]-e[h])/2;e[c]<s||e[p]<s?e[c]<e[p]?(d=ge[m],g=w(h,p,M)):g=w(h,c,M):d="center"}}else t[h]<e[h]&&e[p]<0&&e[c]>e[p]&&(d=ge[m])}else{const c=v==="bottom"||v==="top"?"left":"top",p=J[c],h=le[c],s=(t[h]-e[h])/2;(e[c]<s||e[p]<s)&&(e[c]>e[p]?(d=ye[c],g=w(h,c,M)):(d=ye[p],g=w(h,p,M)))}let a=v;return e[v]<t[le[v]]&&e[v]<e[J[v]]&&(a=J[v]),{placement:d!=="center"?`${a}-${d}`:a,left:g.left,top:g.top}}function ut(n,e){return e?it[n]:ot[n]}function at(n,e,t,r,o,l){if(l)switch(n){case"bottom-start":return{top:`${Math.round(t.top-e.top+t.height)}px`,left:`${Math.round(t.left-e.left)}px`,transform:"translateY(-100%)"};case"bottom-end":return{top:`${Math.round(t.top-e.top+t.height)}px`,left:`${Math.round(t.left-e.left+t.width)}px`,transform:"translateX(-100%) translateY(-100%)"};case"top-start":return{top:`${Math.round(t.top-e.top)}px`,left:`${Math.round(t.left-e.left)}px`,transform:""};case"top-end":return{top:`${Math.round(t.top-e.top)}px`,left:`${Math.round(t.left-e.left+t.width)}px`,transform:"translateX(-100%)"};case"right-start":return{top:`${Math.round(t.top-e.top)}px`,left:`${Math.round(t.left-e.left+t.width)}px`,transform:"translateX(-100%)"};case"right-end":return{top:`${Math.round(t.top-e.top+t.height)}px`,left:`${Math.round(t.left-e.left+t.width)}px`,transform:"translateX(-100%) translateY(-100%)"};case"left-start":return{top:`${Math.round(t.top-e.top)}px`,left:`${Math.round(t.left-e.left)}px`,transform:""};case"left-end":return{top:`${Math.round(t.top-e.top+t.height)}px`,left:`${Math.round(t.left-e.left)}px`,transform:"translateY(-100%)"};case"top":return{top:`${Math.round(t.top-e.top)}px`,left:`${Math.round(t.left-e.left+t.width/2)}px`,transform:"translateX(-50%)"};case"right":return{top:`${Math.round(t.top-e.top+t.height/2)}px`,left:`${Math.round(t.left-e.left+t.width)}px`,transform:"translateX(-100%) translateY(-50%)"};case"left":return{top:`${Math.round(t.top-e.top+t.height/2)}px`,left:`${Math.round(t.left-e.left)}px`,transform:"translateY(-50%)"};case"bottom":default:return{top:`${Math.round(t.top-e.top+t.height)}px`,left:`${Math.round(t.left-e.left+t.width/2)}px`,transform:"translateX(-50%) translateY(-100%)"}}switch(n){case"bottom-start":return{top:`${Math.round(t.top-e.top+t.height+r)}px`,left:`${Math.round(t.left-e.left+o)}px`,transform:""};case"bottom-end":return{top:`${Math.round(t.top-e.top+t.height+r)}px`,left:`${Math.round(t.left-e.left+t.width+o)}px`,transform:"translateX(-100%)"};case"top-start":return{top:`${Math.round(t.top-e.top+r)}px`,left:`${Math.round(t.left-e.left+o)}px`,transform:"translateY(-100%)"};case"top-end":return{top:`${Math.round(t.top-e.top+r)}px`,left:`${Math.round(t.left-e.left+t.width+o)}px`,transform:"translateX(-100%) translateY(-100%)"};case"right-start":return{top:`${Math.round(t.top-e.top+r)}px`,left:`${Math.round(t.left-e.left+t.width+o)}px`,transform:""};case"right-end":return{top:`${Math.round(t.top-e.top+t.height+r)}px`,left:`${Math.round(t.left-e.left+t.width+o)}px`,transform:"translateY(-100%)"};case"left-start":return{top:`${Math.round(t.top-e.top+r)}px`,left:`${Math.round(t.left-e.left+o)}px`,transform:"translateX(-100%)"};case"left-end":return{top:`${Math.round(t.top-e.top+t.height+r)}px`,left:`${Math.round(t.left-e.left+o)}px`,transform:"translateX(-100%) translateY(-100%)"};case"top":return{top:`${Math.round(t.top-e.top+r)}px`,left:`${Math.round(t.left-e.left+t.width/2+o)}px`,transform:"translateY(-100%) translateX(-50%)"};case"right":return{top:`${Math.round(t.top-e.top+t.height/2+r)}px`,left:`${Math.round(t.left-e.left+t.width+o)}px`,transform:"translateY(-50%)"};case"left":return{top:`${Math.round(t.top-e.top+t.height/2+r)}px`,left:`${Math.round(t.left-e.left+o)}px`,transform:"translateY(-50%) translateX(-100%)"};case"bottom":default:return{top:`${Math.round(t.top-e.top+t.height+r)}px`,left:`${Math.round(t.left-e.left+t.width/2+o)}px`,transform:"translateX(-50%)"}}}const dt=O([O(".v-binder-follower-container",{position:"absolute",left:"0",right:"0",top:"0",height:"0",pointerEvents:"none",zIndex:"auto"}),O(".v-binder-follower-content",{position:"absolute",zIndex:"auto"},[O("> *",{pointerEvents:"all"})])]),zt=C({name:"Follower",inheritAttrs:!1,props:{show:Boolean,enabled:{type:Boolean,default:void 0},placement:{type:String,default:"bottom"},syncTrigger:{type:Array,default:["resize","scroll"]},to:[String,Object],flip:{type:Boolean,default:!0},internalShift:Boolean,x:Number,y:Number,width:String,minWidth:String,containerClass:String,teleportDisabled:Boolean,zindexable:{type:Boolean,default:!0},zIndex:Number,overlap:Boolean},setup(n){const e=ce("VBinder"),t=ae(()=>n.enabled!==void 0?n.enabled:n.show),r=I(null),o=I(null),l=()=>{const{syncTrigger:a}=n;a.includes("scroll")&&e.addScrollListener(d),a.includes("resize")&&e.addResizeListener(d)},v=()=>{e.removeScrollListener(d),e.removeResizeListener(d)};K(()=>{t.value&&(d(),l())});const m=te();dt.mount({id:"vueuc/binder",head:!0,anchorMetaName:ne,ssr:m}),ee(()=>{v()}),je(()=>{t.value&&d()});const d=()=>{if(!t.value)return;const a=r.value;if(a===null)return;const c=e.targetRef,{x:p,y:h,overlap:s}=n,i=p!==void 0&&h!==void 0?Re(p,h):ie(c);a.style.setProperty("--v-target-width",`${Math.round(i.width)}px`),a.style.setProperty("--v-target-height",`${Math.round(i.height)}px`);const{width:y,minWidth:x,placement:B,internalShift:k,flip:N}=n;a.setAttribute("v-placement",B),s?a.setAttribute("v-overlap",""):a.removeAttribute("v-overlap");const{style:E}=a;y==="target"?E.width=`${i.width}px`:y!==void 0?E.width=y:E.width="",x==="target"?E.minWidth=`${i.width}px`:x!==void 0?E.minWidth=x:E.minWidth="";const Y=ie(a),L=ie(o.value),{left:H,top:u,placement:f}=st(B,i,Y,k,N,s),b=ut(f,s),{left:$,top:S,transform:z}=at(f,L,i,u,H,s);a.setAttribute("v-placement",f),a.style.setProperty("--v-offset-left",`${Math.round(H)}px`),a.style.setProperty("--v-offset-top",`${Math.round(u)}px`),a.style.transform=`translateX(${$}) translateY(${S}) ${z}`,a.style.setProperty("--v-transform-origin",b),a.style.transformOrigin=b};U(t,a=>{a?(l(),g()):v()});const g=()=>{Ee().then(d).catch(a=>console.error(a))};["placement","x","y","internalShift","flip","width","overlap","minWidth"].forEach(a=>{U(Z(n,a),d)}),["teleportDisabled"].forEach(a=>{U(Z(n,a),g)}),U(Z(n,"syncTrigger"),a=>{a.includes("resize")?e.addResizeListener(d):e.removeResizeListener(d),a.includes("scroll")?e.addScrollListener(d):e.removeScrollListener(d)});const w=Ue(),M=ae(()=>{const{to:a}=n;if(a!==void 0)return a;w.value});return{VBinder:e,mergedEnabled:t,offsetContainerRef:o,followerRef:r,mergedTo:M,syncPosition:d}},render(){return A(rt,{show:this.show,to:this.mergedTo,disabled:this.teleportDisabled},{default:()=>{var n,e;const t=A("div",{class:["v-binder-follower-container",this.containerClass],ref:"offsetContainerRef"},[A("div",{class:"v-binder-follower-content",ref:"followerRef"},(e=(n=this.$slots).default)===null||e===void 0?void 0:e.call(n))]);return this.zindexable?ze(t,[[qe,{enabled:this.mergedEnabled,zIndex:this.zIndex}]]):t}})}});class ft{constructor(){this.handleResize=this.handleResize.bind(this),this.observer=new(typeof window<"u"&&window.ResizeObserver||Ke)(this.handleResize),this.elHandlersMap=new Map}handleResize(e){for(const t of e){const r=this.elHandlersMap.get(t.target);r!==void 0&&r(t)}}registerHandler(e,t){this.elHandlersMap.set(e,t),this.observer.observe(e)}unregisterHandler(e){this.elHandlersMap.has(e)&&(this.elHandlersMap.delete(e),this.observer.unobserve(e))}}const xe=new ft,$e=C({name:"ResizeObserver",props:{onResize:Function},setup(n){let e=!1;const t=Te().proxy;function r(o){const{onResize:l}=n;l!==void 0&&l(o)}K(()=>{const o=t.$el;if(o===void 0){me("resize-observer","$el does not exist.");return}if(o.nextElementSibling!==o.nextSibling&&o.nodeType===3&&o.nodeValue!==""){me("resize-observer","$el can not be observed (it may be a text node).");return}o.nextElementSibling!==null&&(xe.registerHandler(o.nextElementSibling,r),e=!0)}),ee(()=>{e&&xe.unregisterHandler(t.$el.nextElementSibling)})},render(){return Ae(this.$slots,"default")}});let Q;function ct(){return typeof document>"u"?!1:(Q===void 0&&("matchMedia"in window?Q=window.matchMedia("(pointer:coarse)").matches:Q=!1),Q)}let se;function Me(){return typeof document>"u"?1:(se===void 0&&(se="chrome"in window?window.devicePixelRatio:1),se)}const ht=O(".v-vl",{maxHeight:"inherit",height:"100%",overflow:"auto",minWidth:"1px"},[O("&:not(.v-vl--show-scrollbar)",{scrollbarWidth:"none"},[O("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",{width:0,height:0,display:"none"})])]),Et=C({name:"VirtualList",inheritAttrs:!1,props:{showScrollbar:{type:Boolean,default:!0},items:{type:Array,default:()=>[]},itemSize:{type:Number,required:!0},itemResizable:Boolean,itemsStyle:[String,Object],visibleItemsTag:{type:[String,Object],default:"div"},visibleItemsProps:Object,ignoreItemResize:Boolean,onScroll:Function,onWheel:Function,onResize:Function,defaultScrollKey:[Number,String],defaultScrollIndex:Number,keyField:{type:String,default:"key"},paddingTop:{type:[Number,String],default:0},paddingBottom:{type:[Number,String],default:0}},setup(n){const e=te();ht.mount({id:"vueuc/virtual-list",head:!0,anchorMetaName:ne,ssr:e}),K(()=>{const{defaultScrollIndex:u,defaultScrollKey:f}=n;u!=null?p({index:u}):f!=null&&p({key:f})});let t=!1,r=!1;De(()=>{if(t=!1,!r){r=!0;return}p({top:M.value,left:w})}),Ne(()=>{t=!0,r||(r=!0)});const o=_(()=>{const u=new Map,{keyField:f}=n;return n.items.forEach((b,$)=>{u.set(b[f],$)}),u}),l=I(null),v=I(void 0),m=new Map,d=_(()=>{const{items:u,itemSize:f,keyField:b}=n,$=new nt(u.length,f);return u.forEach((S,z)=>{const T=S[b],F=m.get(T);F!==void 0&&$.add(z,F)}),$}),g=I(0);let w=0;const M=I(0),a=ae(()=>Math.max(d.value.getBound(M.value-he(n.paddingTop))-1,0)),c=_(()=>{const{value:u}=v;if(u===void 0)return[];const{items:f,itemSize:b}=n,$=a.value,S=Math.min($+Math.ceil(u/b+1),f.length-1),z=[];for(let T=$;T<=S;++T)z.push(f[T]);return z}),p=(u,f)=>{if(typeof u=="number"){y(u,f,"auto");return}const{left:b,top:$,index:S,key:z,position:T,behavior:F,debounce:V=!0}=u;if(b!==void 0||$!==void 0)y(b,$,F);else if(S!==void 0)i(S,F,V);else if(z!==void 0){const re=o.value.get(z);re!==void 0&&i(re,F,V)}else T==="bottom"?y(0,Number.MAX_SAFE_INTEGER,F):T==="top"&&y(0,0,F)};let h,s=null;function i(u,f,b){const{value:$}=d,S=$.sum(u)+he(n.paddingTop);if(!b)l.value.scrollTo({left:0,top:S,behavior:f});else{h=u,s!==null&&window.clearTimeout(s),s=window.setTimeout(()=>{h=void 0,s=null},16);const{scrollTop:z,offsetHeight:T}=l.value;if(S>z){const F=$.get(u);S+F<=z+T||l.value.scrollTo({left:0,top:S+F-T,behavior:f})}else l.value.scrollTo({left:0,top:S,behavior:f})}}function y(u,f,b){l.value.scrollTo({left:u,top:f,behavior:b})}function x(u,f){var b,$,S;if(t||n.ignoreItemResize||H(f.target))return;const{value:z}=d,T=o.value.get(u),F=z.get(T),V=(S=($=(b=f.borderBoxSize)===null||b===void 0?void 0:b[0])===null||$===void 0?void 0:$.blockSize)!==null&&S!==void 0?S:f.contentRect.height;if(V===F)return;V-n.itemSize===0?m.delete(u):m.set(u,V-n.itemSize);const P=V-F;if(P===0)return;z.add(T,P);const D=l.value;if(D!=null){if(h===void 0){const oe=z.sum(T);D.scrollTop>oe&&D.scrollBy(0,P)}else if(T<h)D.scrollBy(0,P);else if(T===h){const oe=z.sum(T);V+oe>D.scrollTop+D.offsetHeight&&D.scrollBy(0,P)}L()}g.value++}const B=!ct();let k=!1;function N(u){var f;(f=n.onScroll)===null||f===void 0||f.call(n,u),(!B||!k)&&L()}function E(u){var f;if((f=n.onWheel)===null||f===void 0||f.call(n,u),B){const b=l.value;if(b!=null){if(u.deltaX===0&&(b.scrollTop===0&&u.deltaY<=0||b.scrollTop+b.offsetHeight>=b.scrollHeight&&u.deltaY>=0))return;u.preventDefault(),b.scrollTop+=u.deltaY/Me(),b.scrollLeft+=u.deltaX/Me(),L(),k=!0,Be(()=>{k=!1})}}}function Y(u){if(t||H(u.target)||u.contentRect.height===v.value)return;v.value=u.contentRect.height;const{onResize:f}=n;f!==void 0&&f(u)}function L(){const{value:u}=l;u!=null&&(M.value=u.scrollTop,w=u.scrollLeft)}function H(u){let f=u;for(;f!==null;){if(f.style.display==="none")return!0;f=f.parentElement}return!1}return{listHeight:v,listStyle:{overflow:"auto"},keyToIndex:o,itemsStyle:_(()=>{const{itemResizable:u}=n,f=G(d.value.sum());return g.value,[n.itemsStyle,{boxSizing:"content-box",height:u?"":f,minHeight:u?f:"",paddingTop:G(n.paddingTop),paddingBottom:G(n.paddingBottom)}]}),visibleItemsStyle:_(()=>(g.value,{transform:`translateY(${G(d.value.sum(a.value))})`})),viewportItems:c,listElRef:l,itemsElRef:I(null),scrollTo:p,handleListResize:Y,handleListScroll:N,handleListWheel:E,handleItemResize:x}},render(){const{itemResizable:n,keyField:e,keyToIndex:t,visibleItemsTag:r}=this;return A($e,{onResize:this.handleListResize},{default:()=>{var o,l;return A("div",_e(this.$attrs,{class:["v-vl",this.showScrollbar&&"v-vl--show-scrollbar"],onScroll:this.handleListScroll,onWheel:this.handleListWheel,ref:"listElRef"}),[this.items.length!==0?A("div",{ref:"itemsElRef",class:"v-vl-items",style:this.itemsStyle},[A(r,Object.assign({class:"v-vl-visible-items",style:this.visibleItemsStyle},this.visibleItemsProps),{default:()=>this.viewportItems.map(v=>{const m=v[e],d=t.get(m),g=this.$slots.default({item:v,index:d})[0];return n?A($e,{key:m,onResize:w=>this.handleItemResize(m,w)},{default:()=>g}):(g.key=m,g)})})]):(l=(o=this.$slots).empty)===null||l===void 0?void 0:l.call(o)])}})}}),pt=O(".v-x-scroll",{overflow:"auto",scrollbarWidth:"none"},[O("&::-webkit-scrollbar",{width:0,height:0})]),At=C({name:"XScroll",props:{disabled:Boolean,onScroll:Function},setup(){const n=I(null);function e(o){!(o.currentTarget.offsetWidth<o.currentTarget.scrollWidth)||o.deltaY===0||(o.currentTarget.scrollLeft+=o.deltaY+o.deltaX,o.preventDefault())}const t=te();return pt.mount({id:"vueuc/x-scroll",head:!0,anchorMetaName:ne,ssr:t}),Object.assign({selfRef:n,handleWheel:e},{scrollTo(...o){var l;(l=n.value)===null||l===void 0||l.scrollTo(...o)}})},render(){return A("div",{ref:"selfRef",onScroll:this.onScroll,onWheel:this.disabled?void 0:this.handleWheel,class:"v-x-scroll"},this.$slots)}}),W="v-hidden",mt=O("[v-hidden]",{display:"none!important"}),Ft=C({name:"Overflow",props:{getCounter:Function,getTail:Function,updateCounter:Function,onUpdateCount:Function,onUpdateOverflow:Function},setup(n,{slots:e}){const t=I(null),r=I(null);function o(v){const{value:m}=t,{getCounter:d,getTail:g}=n;let w;if(d!==void 0?w=d():w=r.value,!m||!w)return;w.hasAttribute(W)&&w.removeAttribute(W);const{children:M}=m;if(v.showAllItemsBeforeCalculate)for(const x of M)x.hasAttribute(W)&&x.removeAttribute(W);const a=m.offsetWidth,c=[],p=e.tail?g==null?void 0:g():null;let h=p?p.offsetWidth:0,s=!1;const i=m.children.length-(e.tail?1:0);for(let x=0;x<i-1;++x){if(x<0)continue;const B=M[x];if(s){B.hasAttribute(W)||B.setAttribute(W,"");continue}else B.hasAttribute(W)&&B.removeAttribute(W);const k=B.offsetWidth;if(h+=k,c[x]=k,h>a){const{updateCounter:N}=n;for(let E=x;E>=0;--E){const Y=i-1-E;N!==void 0?N(Y):w.textContent=`${Y}`;const L=w.offsetWidth;if(h-=c[E],h+L<=a||E===0){s=!0,x=E-1,p&&(x===-1?(p.style.maxWidth=`${a-L}px`,p.style.boxSizing="border-box"):p.style.maxWidth="");const{onUpdateCount:H}=n;H&&H(Y);break}}}}const{onUpdateOverflow:y}=n;s?y!==void 0&&y(!0):(y!==void 0&&y(!1),w.setAttribute(W,""))}const l=te();return mt.mount({id:"vueuc/overflow",head:!0,anchorMetaName:ne,ssr:l}),K(()=>o({showAllItemsBeforeCalculate:!1})),{selfRef:t,counterRef:r,sync:o}},render(){const{$slots:n}=this;return Ee(()=>this.sync({showAllItemsBeforeCalculate:!1})),A("div",{class:"v-overflow",ref:"selfRef"},[Ae(n,"default"),n.counter?n.counter():A("span",{style:{display:"inline-block"},ref:"counterRef"}),n.tail?n.tail():null])}});function We(n){return n instanceof HTMLElement}function Ce(n){for(let e=0;e<n.childNodes.length;e++){const t=n.childNodes[e];if(We(t)&&(Le(t)||Ce(t)))return!0}return!1}function ke(n){for(let e=n.childNodes.length-1;e>=0;e--){const t=n.childNodes[e];if(We(t)&&(Le(t)||ke(t)))return!0}return!1}function Le(n){if(!vt(n))return!1;try{n.focus({preventScroll:!0})}catch{}return document.activeElement===n}function vt(n){if(n.tabIndex>0||n.tabIndex===0&&n.getAttribute("tabIndex")!==null)return!0;if(n.getAttribute("disabled"))return!1;switch(n.nodeName){case"A":return!!n.href&&n.rel!=="ignore";case"INPUT":return n.type!=="hidden"&&n.type!=="file";case"BUTTON":case"SELECT":case"TEXTAREA":return!0;default:return!1}}let j=[];const Bt=C({name:"FocusTrap",props:{disabled:Boolean,active:Boolean,autoFocus:{type:Boolean,default:!0},onEsc:Function,initialFocusTo:String,finalFocusTo:String,returnFocusOnDeactivated:{type:Boolean,default:!0}},setup(n){const e=Ze(),t=I(null),r=I(null);let o=!1,l=!1;const v=typeof document>"u"?null:document.activeElement;function m(){return j[j.length-1]===e}function d(s){var i;s.code==="Escape"&&m()&&((i=n.onEsc)===null||i===void 0||i.call(n,s))}K(()=>{U(()=>n.active,s=>{s?(M(),ue("keydown",document,d)):(q("keydown",document,d),o&&a())},{immediate:!0})}),ee(()=>{q("keydown",document,d),o&&a()});function g(s){if(!l&&m()){const i=w();if(i===null||i.contains(Qe(s)))return;c("first")}}function w(){const s=t.value;if(s===null)return null;let i=s;for(;i=i.nextSibling,!(i===null||i instanceof Element&&i.tagName==="DIV"););return i}function M(){var s;if(!n.disabled){if(j.push(e),n.autoFocus){const{initialFocusTo:i}=n;i===void 0?c("first"):(s=be(i))===null||s===void 0||s.focus({preventScroll:!0})}o=!0,document.addEventListener("focus",g,!0)}}function a(){var s;if(n.disabled||(document.removeEventListener("focus",g,!0),j=j.filter(y=>y!==e),m()))return;const{finalFocusTo:i}=n;i!==void 0?(s=be(i))===null||s===void 0||s.focus({preventScroll:!0}):n.returnFocusOnDeactivated&&v instanceof HTMLElement&&(l=!0,v.focus({preventScroll:!0}),l=!1)}function c(s){if(m()&&n.active){const i=t.value,y=r.value;if(i!==null&&y!==null){const x=w();if(x==null||x===y){l=!0,i.focus({preventScroll:!0}),l=!1;return}l=!0;const B=s==="first"?Ce(x):ke(x);l=!1,B||(l=!0,i.focus({preventScroll:!0}),l=!1)}}}function p(s){if(l)return;const i=w();i!==null&&(s.relatedTarget!==null&&i.contains(s.relatedTarget)?c("last"):c("first"))}function h(s){l||(s.relatedTarget!==null&&s.relatedTarget===t.value?c("last"):c("first"))}return{focusableStartRef:t,focusableEndRef:r,focusableStyle:"position: absolute; height: 0; width: 0;",handleStartFocus:p,handleEndFocus:h}},render(){const{default:n}=this.$slots;if(n===void 0)return null;if(this.disabled)return n();const{active:e,focusableStyle:t}=this;return A(Se,null,[A("div",{"aria-hidden":"true",tabindex:e?"0":"-1",ref:"focusableStartRef",style:t,onFocus:this.handleStartFocus}),n(),A("div",{"aria-hidden":"true",style:t,ref:"focusableEndRef",tabindex:e?"0":"-1",onFocus:this.handleEndFocus})])}});export{Bt as F,rt as L,$e as V,Et as a,zt as b,Tt as c,St as d,Ft as e,At as f,xe as r};